public interface CommConnection extends StreamConnection
Connection
to a logical serial port, which is a StreamConnection
.
There is no way from this side of the connection to know the connection state on the other side (particularly,
closing the other side has no effect on this side; a thread blocked on InputStream.read()
will infinitely block).
The generic URL format described in Connector
is specified as following:
protocol
: commname
: the CommPort
nameparams
: optional connection parameters in the following listbaudrate
: positive integer (9600 by default)bitsperchar
: positive integer (8 by default)stopbits
:1|2|1.5 (1 by default)parity
:odd|even|none (none by default)Modifier and Type | Method and Description |
---|---|
int |
getBaudrate()
Gets the current configured baudrate.
|
InputStream |
openInputStream()
Returns an
InputStream which implements the BitsInput interface. |
OutputStream |
openOutputStream()
Returns an
OutputStream which implements the BitsOutput interface. |
int |
setBaudrate(int baudrate)
Configures the baudrate.
|
openDataInputStream
openDataOutputStream
close
int getBaudrate()
int setBaudrate(int baudrate)
getBaudrate()
.baudrate
- the new baudrateInputStream openInputStream() throws IOException
InputStream
which implements the BitsInput
interface.
This implementation is useful when this Connection
supports more than 8 bits per frame.openInputStream
in interface InputConnection
InputStream
.IOException
- if a stream is already openOutputStream openOutputStream() throws IOException
OutputStream
which implements the BitsOutput
interface.
This implementation is useful when this Connection
supports more than 8 bits per frame.openOutputStream
in interface OutputConnection
OutputStream
.IOException
- if a stream is already open