Class: XBee::Frame::ReceivedFrame

Inherits:
Base
  • Object
show all
Defined in:
lib/apimode/frame/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.



98
99
100
101
102
103
104
105
106
107
# File 'lib/apimode/frame/frame.rb', line 98

def initialize(frame_data)
  # raise "Frame data must be an enumerable type" unless frame_data.kind_of?(Enumerable)
  self.api_identifier = frame_data[0]
  if $DEBUG then
    print "Initializing a ReceivedFrame of type 0x%x | " % self.api_identifier.unpack('H*').join.to_i(16)
  else
    puts "Initializing a ReceivedFrame of type 0x%x" % self.api_identifier.unpack('H*').join.to_i(16)
  end
  self.cmd_data = frame_data[1..-1]
end