class XBee::Frames::TransmitRequest

This frame causes the device to send payload data as an RF packet to a specific destination.

You can set the broadcast radius from 0 up to NH. If set to 0, the value of NH specifies the broadcast radius (recommended). This parameter is only used for broadcast transmissions.

You can read the maximum number of payload bytes with the NP command.

Constants

OPTIONS

Attributes

broadcast_radius[RW]
data[RW]
options[RW]

Public Class Methods

broadcast() click to toggle source

Allocates and returns an instance pre-addressed as a broadcast.

# File lib/xbee/frames/transmit_request.rb, line 36
def broadcast
        new.tap do |frame|
                frame.address64 = Address64::BROADCAST
        end
end
coordinator() click to toggle source

Allocates and returns an instance pre-addressed for the coordinator node.

# File lib/xbee/frames/transmit_request.rb, line 44
def coordinator
        new.tap do |frame|
                frame.address64 = Address64::COORDINATOR
                frame.address16 = Address16::COORDINATOR
        end
end
new(packet: nil) click to toggle source
Calls superclass method XBee::Frames::AddressedFrame::new
# File lib/xbee/frames/transmit_request.rb, line 53
def initialize(packet: nil)
        super

        if @parse_bytes
                @broadcast_radius = @parse_bytes.shift
                @options = @parse_bytes.shift
                @data = @parse_bytes
                @parse_bytes = []
        end
end

Public Instance Methods

bytes() click to toggle source
Calls superclass method XBee::Frames::AddressedFrame#bytes
# File lib/xbee/frames/transmit_request.rb, line 65
def bytes
        super + [broadcast_radius || 0x00] + [options || 0x00] + (data || [])
end