Sedona

serial::SerialPort


sys::Obj
  serial::SerialPort

public final class SerialPort

SerialPort models a serial I/O port without software buffering.


PARITY_DISABLED

public static const define int PARITY_DISABLED

Value of parity field when parity is disabled

PARITY_EVEN

public static const define int PARITY_EVEN

Value of parity field for even parity

PARITY_MARK

public static const define int PARITY_MARK

Value of parity field for mark parity

PARITY_NONE

public static const define int PARITY_NONE

Value of parity field for no parity

PARITY_ODD

public static const define int PARITY_ODD

Value of parity field for odd parity

PARITY_SPACE

public static const define int PARITY_SPACE

Value of parity field for space parity

RTS_HIGH

public static const define int RTS_HIGH

Value of rtsLevel field if RTS should initially be high (active low)

RTS_LOW

public static const define int RTS_LOW

Value of rtsLevel field if RTS should initially be low (active high)

baudRate

public int baudRate

Integer value of baud rate; set of permissible values is platform-dependent. Defaults to 38400.

dataBits

public int dataBits

Integer number of data bits. Defaults to 8.

in

public inline InStream in

Stream interface for reading from port.

out

public inline OutStream out

Stream interface for writing to port.

parity

public int parity

Parity: DISABLED/NONE/ODD/EVEN/MARK/SPACE (use consts provided). Defaults to NONE.

portNum

public int portNum

Hardware address of port (meaning may vary w/platform).

rtsLevel

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)

stopBits

public int stopBits

Integer number of stop bits. Defaults to 1.

SerialPort

public void SerialPort()

SerialPort constructor sets up in/outstream refs. Note that existence of cstr forces class to be final.

close

public int close()

Closes the port. Subsequent attempts to read or write from the port will return errors.

open

public int open()

Opens/initializes serial port using current values of config params.

setParams

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