Class: Smartware::SZZTConnection
- Inherits:
-
CommandBasedDevice
- Object
- EventMachine::Connection
- CommandBasedDevice
- Smartware::SZZTConnection
- Defined in:
- lib/smartware/drivers/common/szzt_connection.rb
Constant Summary collapse
- DESIRED_BAUD =
7
- BAUD_TABLE =
[ 1200, 2400, 4800, 9600, 19200, 38400, 57600, 115200 ]
Instance Attribute Summary collapse
-
#baud_switch_command ⇒ Object
Returns the value of attribute baud_switch_command.
-
#baud_test_command ⇒ Object
Returns the value of attribute baud_test_command.
-
#dsr_fall ⇒ Object
Returns the value of attribute dsr_fall.
-
#handle_keypad ⇒ Object
Returns the value of attribute handle_keypad.
-
#initialize_device ⇒ Object
Returns the value of attribute initialize_device.
Instance Method Summary collapse
-
#initialize ⇒ SZZTConnection
constructor
A new instance of SZZTConnection.
Methods inherited from CommandBasedDevice
Constructor Details
#initialize ⇒ SZZTConnection
Returns a new instance of SZZTConnection.
11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 |
# File 'lib/smartware/drivers/common/szzt_connection.rb', line 11 def initialize super @ready_for_commands = false @command_timer = nil @probing_baud = false @baud_index = nil @baud_test_command = nil @baud_switch_command = nil @initialize_device = nil @handle_keypad = nil @dsr_fall = nil EventMachine.add_periodic_timer(1) { check_dsr! } EventMachine.next_tick { check_dsr! } end |
Instance Attribute Details
#baud_switch_command ⇒ Object
Returns the value of attribute baud_switch_command.
8 9 10 |
# File 'lib/smartware/drivers/common/szzt_connection.rb', line 8 def baud_switch_command @baud_switch_command end |
#baud_test_command ⇒ Object
Returns the value of attribute baud_test_command.
8 9 10 |
# File 'lib/smartware/drivers/common/szzt_connection.rb', line 8 def baud_test_command @baud_test_command end |
#dsr_fall ⇒ Object
Returns the value of attribute dsr_fall.
9 10 11 |
# File 'lib/smartware/drivers/common/szzt_connection.rb', line 9 def dsr_fall @dsr_fall end |
#handle_keypad ⇒ Object
Returns the value of attribute handle_keypad.
9 10 11 |
# File 'lib/smartware/drivers/common/szzt_connection.rb', line 9 def handle_keypad @handle_keypad end |
#initialize_device ⇒ Object
Returns the value of attribute initialize_device.
8 9 10 |
# File 'lib/smartware/drivers/common/szzt_connection.rb', line 8 def initialize_device @initialize_device end |