sys::Obj serial::SerialPort
public final class SerialPort
SerialPort models a serial I/O port without software buffering.
public static const define int PARITY_DISABLED
Value of parity field when parity is disabled
public static const define int PARITY_EVEN
Value of parity field for even parity
public static const define int PARITY_MARK
Value of parity field for mark parity
public static const define int PARITY_NONE
Value of parity field for no parity
public static const define int PARITY_ODD
Value of parity field for odd parity
public static const define int PARITY_SPACE
Value of parity field for space parity
public static const define int RTS_HIGH
Value of rtsLevel field if RTS should initially be high (active low)
public static const define int RTS_LOW
Value of rtsLevel field if RTS should initially be low (active high)
public int baudRate
Integer value of baud rate; set of permissible values is platform-dependent. Defaults to 38400.
public int dataBits
Integer number of data bits. Defaults to 8.
public inline InStream in
Stream interface for reading from port.
public inline OutStream out
Stream interface for writing to port.
public int parity
Parity: DISABLED/NONE/ODD/EVEN/MARK/SPACE (use consts provided). Defaults to NONE.
public int portNum
Hardware address of port (meaning may vary w/platform).
public int rtsLevel
Initial RTS level: HIGH or LOW. Defaults to LOW. This value is also assumed to be the RTS inactive level. (e.g. RTS_LOW implies RTS active high)
public int stopBits
Integer number of stop bits. Defaults to 1.
public void SerialPort()
SerialPort constructor sets up in/outstream refs. Note that existence of cstr forces class to be final.
public int close()
Closes the port. Subsequent attempts to read or write from the port will return errors.
public int open()
Opens/initializes serial port using current values of config params.
public int setParams(int port, int baud, int dataB, int stopB, int par, int rts)
Sets all params at once - no error checking at this time