Class: Calypso::SerialPortData
- Inherits:
-
Object
- Object
- Calypso::SerialPortData
- Defined in:
- lib/calypso/serialportdata.rb
Overview
Serial port information wrapper.
Instance Attribute Summary collapse
-
#baud ⇒ Fixnum
readonly
Serial baud rate.
-
#databits ⇒ Fixnum
readonly
Number of data bits per byte.
-
#parity ⇒ Symbol
readonly
Connection parity.
-
#port ⇒ String
readonly
Path to the serial device.
-
#stopbits ⇒ Fixnum
readonly
Number of stop bits.
Instance Method Summary collapse
-
#initialize(port, baud = 9600, databits = 8, stopbits = 1, parity = SerialPort::NONE) ⇒ SerialPortData
constructor
Create a new serial port controller.
Constructor Details
#initialize(port, baud = 9600, databits = 8, stopbits = 1, parity = SerialPort::NONE) ⇒ SerialPortData
Create a new serial port controller.
41 42 43 44 45 46 47 |
# File 'lib/calypso/serialportdata.rb', line 41 def initialize(port, baud = 9600, databits = 8, stopbits = 1, parity = SerialPort::NONE) @port = port @baud = baud @databits = databits @stopbits = stopbits @parity = parity end |
Instance Attribute Details
#baud ⇒ Fixnum (readonly)
Returns Serial baud rate.
26 27 28 |
# File 'lib/calypso/serialportdata.rb', line 26 def baud @baud end |
#databits ⇒ Fixnum (readonly)
Returns Number of data bits per byte.
28 29 30 |
# File 'lib/calypso/serialportdata.rb', line 28 def databits @databits end |
#parity ⇒ Symbol (readonly)
Returns Connection parity.
32 33 34 |
# File 'lib/calypso/serialportdata.rb', line 32 def parity @parity end |
#port ⇒ String (readonly)
Returns Path to the serial device.
24 25 26 |
# File 'lib/calypso/serialportdata.rb', line 24 def port @port end |
#stopbits ⇒ Fixnum (readonly)
Returns Number of stop bits.
30 31 32 |
# File 'lib/calypso/serialportdata.rb', line 30 def stopbits @stopbits end |