class XBee::Frame::RemoteCommandRequest

Attributes

destination_address[RW]
destination_network[RW]

Public Class Methods

new(at_command, destination_address = 0x000000000000ffff, destination_network = 0x0000fffe, frame_id = nil, parameter_value = nil, parameter_pack_string = "a*") { |self| ... } click to toggle source
Calls superclass method XBee::Frame::ATCommand::new
# File lib/apimode/frame/remote_command_request.rb, line 10
def initialize(at_command, destination_address = 0x000000000000ffff, destination_network = 0x0000fffe, frame_id = nil, parameter_value = nil, parameter_pack_string = "a*")
  self.destination_address = destination_address
  self.destination_network = destination_network
  super(at_command, frame_id, parameter_value, parameter_pack_string)
  yield self if block_given?
end

Public Instance Methods

api_identifier() click to toggle source
# File lib/apimode/frame/remote_command_request.rb, line 6
def api_identifier ; 0x17 ; end
cmd_data() click to toggle source
# File lib/apimode/frame/remote_command_request.rb, line 23
def cmd_data
  dest_high = (self.destination_address >> 32) & 0xFFFFFFFF
  dest_low = self.destination_address & 0xFFFFFFFF
  if parameter_value.nil?
    [self.frame_id, dest_high, dest_low, self.destination_network, 0x00, self.at_command].pack("CNNnCa2")
  else
    [self.frame_id, dest_high, dest_low, self.destination_network, 0x02, self.at_command, self.parameter_value].pack("CNNnCa2#{parameter_pack_string}")
  end
end
cmd_data=(data_string) click to toggle source
# File lib/apimode/frame/remote_command_request.rb, line 17
def cmd_data=(data_string)
  dest_high = dest_low = 0
  self.frame_id, dest_high, dest_low, self.destination_network, self.at_command, self.parameter_value = data_string.unpack("CNNnxa2#{parameter_pack_string}")
  self.destination_address = dest_high << 32 | dest_low
end