Class: Smartware::SankyoConnection

Inherits:
CommandBasedDevice show all
Defined in:
lib/smartware/drivers/common/sankyo_connection.rb

Defined Under Namespace

Classes: CommandResponse

Constant Summary collapse

STX =
0xF2
ACK =
0x06
NAK =
0x15

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from CommandBasedDevice

#command, #receive_data

Constructor Details

#initializeSankyoConnection

Returns a new instance of SankyoConnection.



30
31
32
33
34
35
36
37
38
39
40
# File 'lib/smartware/drivers/common/sankyo_connection.rb', line 30

def initialize
  super

  @command_timer = nil
  @initialize_device = nil
  @ready_for_commands = false
  @state = :drop

  EventMachine.add_periodic_timer(10) { check_dsr! }
  EventMachine.next_tick { check_dsr! }
end

Instance Attribute Details

#initialize_deviceObject

Returns the value of attribute initialize_device.



28
29
30
# File 'lib/smartware/drivers/common/sankyo_connection.rb', line 28

def initialize_device
  @initialize_device
end