| Modifier and Type | Field and Description |
|---|---|
protected com.fazecast.jSerialComm.SerialPort |
com |
| Constructor and Description |
|---|
SerialPortConnector(java.lang.String devname,
int baud,
java.lang.String settings)
Open a serial port.
|
| Modifier and Type | Method and Description |
|---|---|
void |
close()
Close the connection.
|
java.lang.String[] |
connections()
Gets a list of all known active connections
|
java.io.InputStream |
getInputStream()
Get the input stream to read data over.
|
java.lang.String |
getName()
Get a string representation of the connection.
|
java.io.OutputStream |
getOutputStream()
Get the output stream to write data to.
|
com.fazecast.jSerialComm.SerialPort |
getSerialPort()
Get the underlying serial port.
|
boolean |
isReliable()
Check if a connection is relaible.
|
void |
setConnectionListener(ConnectionListener listener)
Set a connection state listener.
|
java.lang.String |
toString() |
boolean |
waitOutputCompletion(long timeout)
Wait until the output buffer is empty.
|
public SerialPortConnector(java.lang.String devname,
int baud,
java.lang.String settings)
throws java.io.IOException
devname - device name of the serial port.baud - baud rate for the serial port.settings - serial port settings (null for defaults, or "N81" for no parity, 8 bits, 1 stop bit).java.io.IOException - if the settings are invalid or the port cannot be opened (e.g. missing or already in use).public com.fazecast.jSerialComm.SerialPort getSerialPort()
public java.lang.String getName()
Connectorpublic java.io.InputStream getInputStream()
ConnectorgetInputStream in interface Connectorpublic java.io.OutputStream getOutputStream()
ConnectorgetOutputStream in interface Connectorpublic void setConnectionListener(ConnectionListener listener)
ConnectorsetConnectionListener in interface Connectorlistener - listener to call for connection/disconnection,
or null to disable listener.public void close()
Connectorpublic boolean isReliable()
ConnectorisReliable in interface Connectorpublic boolean waitOutputCompletion(long timeout)
ConnectorwaitOutputCompletion in interface Connectortimeout - timeout in milliseconds.public java.lang.String[] connections()
Connectorconnections in interface Connectorpublic java.lang.String toString()
toString in class java.lang.Object