Sha256: efe244f2cc04d61232b2568ff5a0d7475fee4a24dee832798b4bf5d6da03edce

Contents?: true

Size: 807 Bytes

Versions: 2

Compression:

Stored size: 807 Bytes

Contents

require 'ruxbee/frame/at_command_response'

module XBee
  module Frame
    class RemoteCommandResponse < XBee::Frame::ATCommandResponse
      attr_accessor :destination_address, :destination_network
      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
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
ruxbee-0.1.1 lib/ruxbee/frame/remote_command_response.rb
ruxbee-0.1.0 lib/ruxbee/frame/remote_command_response.rb