class XBee::Frames::ExplicitRXIndicator

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

Constants

OPTION_BITS

Attributes

address16[RW]
address64[RW]
cluster_id[RW]
data[RW]
destination_endpoint[RW]
options[RW]
profile_id[RW]
source_endpoint[RW]

Public Class Methods

new(packet: nil) click to toggle source
Calls superclass method
# File lib/xbee/frames/explicit_rx_indicator.rb, line 30
def initialize(packet: nil)
        super

        if @parse_bytes
                @address64 = Address64.new *@parse_bytes.shift(8)
                @address16 = Address16.new *@parse_bytes.shift(2)
                @source_endpoint = @parse_bytes.shift
                @destination_endpoint = @parse_bytes.shift
                @cluster_id = Bytes.unsigned_int_from_array @parse_bytes.shift(2)
                @profile_id = Bytes.unsigned_int_from_array @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
# File lib/xbee/frames/explicit_rx_indicator.rb, line 47
def bytes
        super +
                (address64 || Address64.from_array([0] * 8)).to_a +
                (address16 || Address16.new(0, 0)).to_a +
                [source_endpoint || 0x00] +
                [destination_endpoint || 0x00] +
                Bytes.array_from_unsigned_int(cluster_id || 0) +
                Bytes.array_from_unsigned_int(profile_id || 0) +
                [options || 0x00] +
                (data || [])
end