XBee C# library API reference

Show / Hide Table of Contents

Class ExplicitAddressingPacket

This class represents an Explicit Addressing Command packet. Packet is built using the parameters of the constructor or providing a valid API payload.

Inheritance
System.Object
XBeePacket
XBeeAPIPacket
ExplicitAddressingPacket
Inherited Members
XBeeAPIPacket.NO_FRAME_ID
XBeeAPIPacket.FrameID
XBeeAPIPacket.FrameType
XBeeAPIPacket.FrameTypeValue
XBeeAPIPacket.APIData
XBeeAPIPacket.PacketParameters
XBeeAPIPacket.CheckFrameID(Int32)
XBeeAPIPacket.GetPacketData()
XBeePacket.PacketLength
XBeePacket.Checksum
XBeePacket.Parameters
XBeePacket.GenerateByteArray()
XBeePacket.GenerateByteArrayEscaped()
XBeePacket.ToString()
XBeePacket.ToPrettyString()
XBeePacket.ParsePacket(String, OperatingMode)
XBeePacket.ParsePacket(Byte[], OperatingMode)
XBeePacket.Equals(Object)
XBeePacket.GetHashCode()
System.Object.Equals(System.Object, System.Object)
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
Namespace: XBeeLibrary.Core.Packet.Common
Assembly: XBeeLibrary.Core.dll
Syntax
public class ExplicitAddressingPacket : XBeeAPIPacket
Remarks

Allows application layer fields (endpoint and cluster ID) to be specified for a data transmission. Similar to the Transmit Request, but also requires application layer addressing fields to be specified (endpoints, cluster ID, profile ID). An Explicit Addressing Request API frame causes the module to send data as an RF packet to the specified destination, using the specified source and destination endpoints, cluster ID, and profile ID.

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_STATUS) 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. Note: if source routing is used, the RF payload will be reduced by two bytes per intermediate hop in the source route.

Several transmit options can be set using the transmit options bitfield.

Constructors

ExplicitAddressingPacket(Byte, XBee64BitAddress, XBee16BitAddress, Byte, Byte, Byte[], Byte[], Byte, Byte, Byte[])

Class constructor. Instantiates a new ExplicitAddressingPacket object with the given parameters.

Declaration
public ExplicitAddressingPacket(byte frameID, XBee64BitAddress destAddress64, XBee16BitAddress destAddress16, byte sourceEndpoint, byte destEndpoint, byte[] clusterID, byte[] profileID, 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 sourceEndpoint

The source endpoint for the transaction.

System.Byte destEndpoint

The destination endpoint for the transaction.

System.Byte[] clusterID

The cluster ID used in the transaction.

System.Byte[] profileID

The profile ID used in the transaction.

System.Byte broadcastRadius

The maximum number of hops a broadcast transmission can traverse. Set to 0 to use the network maximum hops value.

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 frameID < 0 or if frameID > 255 or if profileID.Length != 2 or if clusterID.Length != 2.

System.ArgumentNullException

If destAddress64 == null or if destAddress16 == null.

See Also
XBeeTransmitOptions
XBee16BitAddress
XBee64BitAddress

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
XBeeAPIPacket.APIPacketParameters

APIPacketSpecificData

Gets the XBee API packet specific data.

Declaration
protected override byte[] APIPacketSpecificData { get; }
Property Value
Type Description
System.Byte[]
Overrides
XBeeAPIPacket.APIPacketSpecificData
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

ClusterID

The cluster ID used in the transmission.

Declaration
public byte[] ClusterID { 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
XBee16BitAddress

DestAddress64

The 64-bit destination address.

Declaration
public XBee64BitAddress DestAddress64 { get; }
Property Value
Type Description
XBee64BitAddress
See Also
XBee64BitAddress

DestEndpoint

The destination endpoint of the transmission.

Declaration
public byte DestEndpoint { get; }
Property Value
Type Description
System.Byte

IsBroadcast

Indicates whether the packet is a broadcast packet.

Declaration
public override bool IsBroadcast { get; }
Property Value
Type Description
System.Boolean
Overrides
XBeeAPIPacket.IsBroadcast

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
XBeeAPIPacket.NeedsAPIFrameID

ProfileID

The profile ID used in the transmission.

Declaration
public byte[] ProfileID { get; }
Property Value
Type Description
System.Byte[]

RFData

The received RF data.

Declaration
public byte[] RFData { get; set; }
Property Value
Type Description
System.Byte[]

SourceEndpoint

The source endpoint of the transmission.

Declaration
public byte SourceEndpoint { get; }
Property Value
Type Description
System.Byte

TransmitOptions

The transmit options bitfield.

Declaration
public byte TransmitOptions { get; }
Property Value
Type Description
System.Byte

Methods

CreatePacket(Byte[])

Creates a new ExplicitAddressingPacket object from the given payload.

Declaration
public static ExplicitAddressingPacket CreatePacket(byte[] payload)
Parameters
Type Name Description
System.Byte[] payload

The API frame payload. It must start with the frame type corresponding to an Explicit Addressing packet (0x11). The byte array must be in API mode.

Returns
Type Description
ExplicitAddressingPacket

Parsed Explicit Addressing packet.

Exceptions
Type Condition
System.ArgumentException

If payload[0] != APIFrameType.EXPLICIT_ADDRESSING_COMMAND_FRAME.GetValue() or if payload.length < XBeeLibrary.Core.Packet.Common.ExplicitAddressingPacket.MIN_API_PAYLOAD_LENGTH.

System.ArgumentNullException

If payload == null.

See Also

XBeeTransmitOptions
COORDINATOR_ADDRESS
UNKNOWN_ADDRESS
BROADCAST_ADDRESS
COORDINATOR_ADDRESS
ExplicitRxIndicatorPacket
XBeeAPIPacket
Product page More documentation Official site About Digi Contact us Support
©2019 Digi International Inc. All rights reserved.
Digi International Inc.