Class: Smartware::SZZTConnection

Inherits:
CommandBasedDevice show all
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

Instance Method Summary collapse

Methods inherited from CommandBasedDevice

#command, #receive_data

Constructor Details

#initializeSZZTConnection

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_commandObject

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_commandObject

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_fallObject

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_keypadObject

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_deviceObject

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