Class: XBee::Frame::ReceivedFrame

Inherits:
Base
  • Object
show all
Defined in:
lib/ruxbee/frame/received_frame.rb

Instance Attribute Summary

Attributes inherited from Base

#api_identifier, #cmd_data, #frame_id

Instance Method Summary collapse

Methods inherited from Base

#_dump, #data, #length

Constructor Details

#initialize(frame_data) ⇒ ReceivedFrame

Returns a new instance of ReceivedFrame.



4
5
6
7
8
9
10
11
12
# File 'lib/ruxbee/frame/received_frame.rb', line 4

def initialize(frame_data)
  self.api_identifier = frame_data[0].unpack('H*').join.to_i(16) unless frame_data.nil?
  if $DEBUG then
    print "Initializing a ReceivedFrame of type 0x%02x | " % self.api_identifier
  elsif $VERBOSE
    puts "Initializing a ReceivedFrame of type 0x%02x" % self.api_identifier
  end
  self.cmd_data = frame_data[1..-1] unless frame_data.nil?
end