Class: XBee::Frame::RemoteCommandResponse

Inherits:
ATCommandResponse show all
Defined in:
lib/apimode/frame/remote_command_response.rb

Instance Attribute Summary collapse

Attributes inherited from ATCommandResponse

#at_command, #frame_id, #retrieved_value, #status

Attributes inherited from Base

#api_identifier, #cmd_data, #frame_id

Instance Method Summary collapse

Methods inherited from ATCommandResponse

#command_statuses, #initialize

Methods inherited from ReceivedFrame

#initialize

Methods inherited from Base

#_dump, #data, #length

Constructor Details

This class inherits a constructor from XBee::Frame::ATCommandResponse

Instance Attribute Details

#destination_addressObject

Returns the value of attribute destination_address.



6
7
8
# File 'lib/apimode/frame/remote_command_response.rb', line 6

def destination_address
  @destination_address
end

#destination_networkObject

Returns the value of attribute destination_network.



6
7
8
# File 'lib/apimode/frame/remote_command_response.rb', line 6

def destination_network
  @destination_network
end

Instance Method Details

#cmd_data=(data_string) ⇒ Object



7
8
9
10
11
12
13
14
15
16
17
18
19
# File 'lib/apimode/frame/remote_command_response.rb', line 7

def cmd_data=(data_string)
  dest_high = dest_low = 0
  self.frame_id, dest_high, dest_low, self.destination_network, self.at_command, status_byte, self.retrieved_value = data_string.unpack("CNNna2Ca*")
  self.destination_address = dest_high << 32 | dest_low
  self.status = case status_byte
  when 0..4
    command_statuses[status_byte]
  else
    raise "AT Command Response frame appears to include an invalid status: 0x%02x" % status_byte
  end
  #actually assign and move along
  @cmd_data = data_string
end