class XBee::Frames::ReceivePacket

When a device configured with a standard API Rx Indicator (AO = 0) receives an RF data packet, it sends it out the serial interface using this message type.

Constants

OPTION_BITS

Attributes

address16[RW]
address64[RW]
data[RW]
options[RW]

Public Class Methods

new(packet: nil) click to toggle source
Calls superclass method XBee::Frames::Frame::new
# File lib/xbee/frames/receive_packet.rb, line 26
def initialize(packet: nil)
        super

        if @parse_bytes
                @address64 = Address64.new *@parse_bytes.shift(8)
                @address16 = Address16.new *@parse_bytes.shift(2)
                @options = @parse_bytes.shift
                @data = @parse_bytes
                @parse_bytes = []
        end
end

Public Instance Methods

bytes() click to toggle source
Calls superclass method XBee::Frames::Frame#bytes
# File lib/xbee/frames/receive_packet.rb, line 39
def bytes
        super + (address64 || Address64.from_array([0] * 8)).to_a + (address16 || Address16.new(0, 0)).to_a + [options || 0x00] + (data || [])
end