Class TransmitPacket
This class represents a Transmit Packet. Packet is built using the parameters of the constructor or providing a valid API payload.
Inherited Members
Namespace: XBeeLibrary.Core.Packet.Common
Assembly: XBeeLibrary.Core.dll
Syntax
public class TransmitPacket : XBeeAPIPacket
Remarks
A Transmit Request API frame causes the module to send data as an RF packet to the specified destination.
The 64-bit destination address should be set to 0x000000000000FFFF
for a broadcast
transmission (to all devices).
The coordinator can be addressed by either setting the 64-bit address to all 0x00
and
the 16-bit address to 0xFFFE
, or by setting the 64-bit address to the coordinator's
64-bit address and the 16-bit address to 0x0000
.
For all other transmissions, setting the 16-bit address to the correct 16-bit address can help improve performance when transmitting to multiple destinations.
If a 16-bit address is not known, this field should be set to 0xFFFE
(unknown).
The Transmit Status frame (TRANSMIT_REQUEST) will indicate the discovered 16-bit address, if successful (TransmitStatusPacket).
The broadcast radius can be set 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.
The maximum number of payload bytes can be read with the NP
command.
Several transmit options can be set using the transmit options bitfield.
Constructors
TransmitPacket(Byte, XBee64BitAddress, XBee16BitAddress, Byte, Byte, Byte[])
Class constructor. Instantiates a new TransmitPacket object with the given parameters.
Declaration
public TransmitPacket(byte frameID, XBee64BitAddress destAddress64, XBee16BitAddress destAddress16, byte broadcastRadius, byte transmitOptions, byte[] rfData)
Parameters
Type | Name | Description |
---|---|---|
System.Byte | frameID | The Frame ID. |
XBee64BitAddress | destAddress64 | The 64-bit address of the destination device. |
XBee16BitAddress | destAddress16 | The 16-bit address of the destination device. |
System.Byte | broadcastRadius | The maximum number of hops a broadcast transmission can occur. |
System.Byte | transmitOptions | The bitfield of supported transmission options. |
System.Byte[] | rfData | The RF Data that is sent to the destination device. |
Exceptions
Type | Condition |
---|---|
System.ArgumentException | If |
System.ArgumentNullException | If |
See Also
Properties
APIPacketParameters
Gets a map with the XBee packet parameters and their values.
Declaration
protected override LinkedDictionary<string, string> APIPacketParameters { get; }
Property Value
Type | Description |
---|---|
LinkedDictionary<System.String, System.String> | A sorted map containing the XBee packet parameters with their values. |
Overrides
APIPacketSpecificData
Gets the XBee API packet specific data.
Declaration
protected override byte[] APIPacketSpecificData { get; }
Property Value
Type | Description |
---|---|
System.Byte[] |
Overrides
Remarks
This does not include the frame ID if it is needed.
BroadcastRadius
The broadcast radius.
Declaration
public byte BroadcastRadius { get; }
Property Value
Type | Description |
---|---|
System.Byte |
DestAddress16
The 16 bit destination address.
Declaration
public XBee16BitAddress DestAddress16 { get; }
Property Value
Type | Description |
---|---|
XBee16BitAddress |
See Also
DestAddress64
The 64 bit destination address.
Declaration
public XBee64BitAddress DestAddress64 { get; }
Property Value
Type | Description |
---|---|
XBee64BitAddress |
See Also
IsBroadcast
Indicates whether the packet is a broadcast packet.
Declaration
public override bool IsBroadcast { get; }
Property Value
Type | Description |
---|---|
System.Boolean |
Overrides
NeedsAPIFrameID
Indicates whether the API packet needs API Frame ID or not.
Declaration
public override bool NeedsAPIFrameID { get; }
Property Value
Type | Description |
---|---|
System.Boolean |
Overrides
RFData
The received RF data.
Declaration
public byte[] RFData { get; set; }
Property Value
Type | Description |
---|---|
System.Byte[] |
TransmitOptions
The transmit options.
Declaration
public byte TransmitOptions { get; }
Property Value
Type | Description |
---|---|
System.Byte |
Methods
CreatePacket(Byte[])
Creates a new TransmitPacket object from the given payload.
Declaration
public static TransmitPacket CreatePacket(byte[] payload)
Parameters
Type | Name | Description |
---|---|---|
System.Byte[] | payload | The API frame payload. It must start with the frame type corresponding
to a Transmit packet ( |
Returns
Type | Description |
---|---|
TransmitPacket | Parsed Transmit packet. |
Exceptions
Type | Condition |
---|---|
System.ArgumentException | If |
System.ArgumentNullException | If |