SerialPort :: ODD, SerialPort :: MARK, SerialPort :: SPACE (MARK and SPACE are not supported in Posix)
Raise the argError argument about a bad argument.
SerialPort :: new and SerialPort :: open without returning a block instance of SerialPort. SerialPort :: open with skipping blocks SerialPort to the block and closes it when you exit the block (for example, File :: open).
** Instance Methods **
- modem_params () β aHash
- modem_params = (aHash) -> aHash
- get_modem_params () β aHash
- set_modem_params (aHash) -> aHash
- set_modem_params (baudrate [, databits [, stopbits [, parity]]])
Get and set the modem parameters. The hash keys are "baud", "bit_data", "stop_bits" and "parity" (see above).
Parameters absent from the hash or not set to nil remain unchanged. The default parameter values ββfor the set_modem_params method are: databits = 8, stopbits = 1, parity = (databits == 8? SerialPort :: NONE: SerialPort :: EVEN).
- baud () β anInteger
- baud = (anInteger) β anInteger
- data_bits () β 4, 5, 6, 7 or 8
- data_bits = (anInteger) β anInteger
- stop_bits () β 1 or 2
- stop_bits = (anInteger) β anInteger
- parity () β anInteger: SerialPort :: NONE, SerialPort :: EVEN, SerialPort :: ODD, SerialPort :: MARK or SerialPort :: SPACE
- parity = (anInteger) β anInteger
Get and set the corresponding modem parameter.
- flow_control () β anInteger
- flow_control = (anInteger) β anInteger
Get and install flow control: SerialPort :: NONE, SerialPort :: HARD, SerialPort :: SOFT or (SerialPort :: HARD | SerialPort :: SOFT).
Note. SerialPort :: HARD mode is not supported on all platforms. SerialPort :: HARD uses the RTS / CTS connection; DSR / DTR is not supported.
- read_timeout () β anInteger
- read_timeout = (anInteger) β anInteger
- write_timeout () β anInteger
- write_timeout = (anInteger) β anInteger
Get and set the timeout values ββ(in milliseconds) for reading and writing. A negative timeout will return all available data without waiting, a zero read timeout will not return, at least one byte is available, and a positive read timeout is returned when the requested number of bytes is available or the interval between the arrival of two bytes exceeds timeout value.
Note. Reading timeouts do not mix well with multi-threaded ones.
Note. In Posix, write timeouts are not implemented.
Send a break for a given time.
time β anInteger: tenths of a second to break. Note. In Posix, this value is very approximate.
Returns a hash with the state of each bit of the status string. The keys are "rts", "dtr", "cts", "dsr", "dcd" and "ri".
Note. On Windows, rts and dtr are not included.
- RTS ()
- DTR ()
- CTS ()
- DSR ()
- DCD ()
ri () β 0 or 1
rts = (0 or 1)
- dtr = (0 or 1) β 0 or 1
Get and set the corresponding line status bit.
Note. On Windows, rts () and dtr () are not implemented