public interface SerialDevice
| Modifier and Type | Field and Description |
|---|---|
static String |
DEVICE_CATEGORY
Constant for the value of the service property
DEVICE_CATEGORY
used for all Serial devices. |
static String |
SERIAL_COMPORT
Service property for the serial comport.
|
| Modifier and Type | Method and Description |
|---|---|
SerialPortConfiguration |
getConfiguration()
Gets the Serial port configuration.
|
InputStream |
getInputStream()
Returns an input stream.
|
OutputStream |
getOutputStream()
Returns an output stream.
|
boolean |
isCTS()
Returns the CTS state.
|
boolean |
isDSR()
Returns the DSR state.
|
boolean |
isDTR()
Returns the DTR state.
|
boolean |
isRTS()
Returns the DTS state.
|
void |
setConfiguration(SerialPortConfiguration configuration)
Sets the Serial port configuration.
|
void |
setDTR(boolean dtr)
Sets the DTR state.
|
void |
setRTS(boolean rts)
Sets the RTS state.
|
static final String DEVICE_CATEGORY
DEVICE_CATEGORY
used for all Serial devices.
A Serial base driver bundle must set this property key.
Constants.DEVICE_CATEGORY,
Constant Field Valuesstatic final String SERIAL_COMPORT
Represents the name of the port. The value type is String.
For example, "/dev/ttyUSB0", "COM5", or "/dev/tty.usbserial-XXXXXX".
InputStream getInputStream() throws IOException
IOException - if an I/O error occurred.OutputStream getOutputStream() throws IOException
IOException - If an I/O error occurred.SerialPortConfiguration getConfiguration()
void setConfiguration(SerialPortConfiguration configuration) throws SerialDeviceException
configuration - The SerialPortConfiguration object containing the
configuration.SerialDeviceException - If the parameter is specified incorrectly
or the parameter is not supported.boolean isDTR()
boolean isRTS()
boolean isDSR()
boolean isCTS()
void setDTR(boolean dtr)
throws SerialDeviceException
dtr - true for DTR on; false for DTR for off.SerialDeviceException - If the parameter is not supported.void setRTS(boolean rts)
throws SerialDeviceException
rts - true for RTS on; false for RTS for off.SerialDeviceException - If the parameter is not supported.Copyright © Contributors to the Eclipse Foundation Licensed under the Eclipse Foundation Specification License – v1.0