Class: XBee::Frame::ReceivedFrame
- Defined in:
- lib/ruxbee/frame/received_frame.rb
Direct Known Subclasses
ATCommandResponse, ExplicitRxIndicator, IODataSampleRxIndicator, 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.
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 |