public class SerialPortDevice
extends java.lang.Object
getInputStream(),
| Constructor and Description |
|---|
SerialPortDevice(java.lang.String portName,
int baudRate,
int dataBits,
java.lang.String stopBits,
java.lang.String parity,
java.lang.String flowControl,
java.lang.String operation,
int timeout)
creates new SerialPortDevice
|
| Modifier and Type | Method and Description |
|---|---|
void |
close() |
java.io.InputStream |
getInputStream() |
java.lang.String |
getOperation() |
java.io.OutputStream |
getOutputStream() |
java.lang.String |
getPortName() |
void |
portOpen()
opens the serial port
|
public SerialPortDevice(java.lang.String portName,
int baudRate,
int dataBits,
java.lang.String stopBits,
java.lang.String parity,
java.lang.String flowControl,
java.lang.String operation,
int timeout)
throws java.io.IOException
portName - the device name or path to the Serial PortbaudRate - the Baud Rate of the Serial PortdataBits - the number of data bitsstopBits - string for the number of stop bitsparity - parity stringoperation - either "read", "write" or "read-write (default)"timeout - receive timeout in msjava.io.IOExceptionpublic void portOpen()
throws java.io.IOException
java.io.IOExceptionpublic java.io.OutputStream getOutputStream()
OutputStream if operation is to write
null otherwisepublic java.io.InputStream getInputStream()
InputStream if operation is to read
null otherwisepublic java.lang.String getPortName()
public java.lang.String getOperation()
public void close()
throws java.io.IOException
java.io.IOException