Class: XBee::Frame::ReceivedFrame
- Defined in:
- lib/apimode/frame/frame.rb
Direct Known Subclasses
ATCommandResponse, ExplicitRxIndicator, ModemStatus, ReceivePacket, TransmitStatus
Instance Attribute Summary
Attributes inherited from Base
#api_identifier, #cmd_data, #frame_id
Instance Method Summary collapse
-
#initialize(frame_data) ⇒ ReceivedFrame
constructor
A new instance of ReceivedFrame.
Methods inherited from Base
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 |