XBee C# library API reference

Show / Hide Table of Contents

Class XBeePacketsQueue

This class represents a queue of XBee packets used for sequential packet reading.

Inheritance
System.Object
XBeePacketsQueue
Inherited Members
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()
Namespace: XBeeLibrary.Core.Models
Assembly: XBeeLibrary.Core.dll
Syntax
public class XBeePacketsQueue
Remarks

The class provides some methods to get specific packet types from different source nodes.

Constructors

XBeePacketsQueue()

Initializes a new instance of class XBeePacketsQueue.

Declaration
public XBeePacketsQueue()

XBeePacketsQueue(Int32)

Initializes a new instance of class XBeePacketsQueue with the specified maxLength.

Declaration
public XBeePacketsQueue(int maxLength)
Parameters
Type Name Description
System.Int32 maxLength

Maximum Length of the queue.

Exceptions
Type Condition
System.ArgumentException

If maxLength < 1.

Fields

DEFAULT_MAX_LENGTH

Default maximum number of packets to store in the queue.

Declaration
public const int DEFAULT_MAX_LENGTH = 50
Field Value
Type Description
System.Int32

Properties

CurrentSize

Gets the current size of the XBee packets queue.

Declaration
public int CurrentSize { get; }
Property Value
Type Description
System.Int32

The current size of the XBee packets queue.

MaxSize

Gets the maximum size of the XBee packets queue.

Declaration
public int MaxSize { get; }
Property Value
Type Description
System.Int32

Methods

AddPacket(XBeePacket)

Adds the provided packet to the list of packets. If the queue is full the first packet will be discarded to add the given one.

Declaration
public void AddPacket(XBeePacket xbeePacket)
Parameters
Type Name Description
XBeePacket xbeePacket

The XBee packet to be added to the list.

See Also
XBeePacket

ClearQueue()

Clears the list of packets.

Declaration
public void ClearQueue()

GetFirstDataPacket(Int32)

Returns the first data packet from the queue waiting up to the specified timeout if necessary for an XBee data packet to become available. null if the queue is empty or there is not any data packet inside.

Declaration
public XBeePacket GetFirstDataPacket(int timeout)
Parameters
Type Name Description
System.Int32 timeout

The time in milliseconds to wait for an XBee data packet to become available. 0 to return immediately.

Returns
Type Description
XBeePacket

The first data packet from the queue, null if it is empty or no data packets are contained in the queue.

See Also
XBeePacket

GetFirstDataPacketFrom(RemoteXBeeDevice, Int32)

Returns the first data packet from the queue whose 64-bit source address matches the address of the provided remote XBee device.

Declaration
public XBeePacket GetFirstDataPacketFrom(RemoteXBeeDevice remoteXBeeDevice, int timeout)
Parameters
Type Name Description
RemoteXBeeDevice remoteXBeeDevice

The XBee device containing the 64-bit address to look for in the list of packets.

System.Int32 timeout

The time in milliseconds to wait for an XBee data packet from the specified remote XBee device to become available. 0 to return immediately.

Returns
Type Description
XBeePacket

The first XBee data packet whose its 64-bit address matches the address of the provided remote XBee device. null if no data packets from the specified XBee device are found in the queue.

Remarks

The methods waits up to the specified timeout if necessary for an XBee data packet to become available. null if the queue is empty or there is not any XBee data packet sent by the provided remote XBee device.

See Also
RemoteXBeeDevice
XBeePacket

GetFirstExplicitDataPacket(Int32)

Returns the first explicit data packet from the queue waiting up to the specified timeout if necessary for an XBee explicit data packet to become available. null if the queue is empty or there is not any explicit data packet inside.

Declaration
public XBeePacket GetFirstExplicitDataPacket(int timeout)
Parameters
Type Name Description
System.Int32 timeout

The time in milliseconds to wait for an XBee explicit data packet to become available. 0 to return immediately.

Returns
Type Description
XBeePacket

The first explicit data packet from the queue, null if it is empty or no data packets are contained in the queue.

See Also
XBeePacket
ExplicitRxIndicatorPacket

GetFirstExplicitDataPacketFrom(RemoteXBeeDevice, Int32)

Returns the first explicit data packet from the queue whose 64-bit source address matches the address of the provided remote XBee device.

Declaration
public XBeePacket GetFirstExplicitDataPacketFrom(RemoteXBeeDevice remoteXBeeDevice, int timeout)
Parameters
Type Name Description
RemoteXBeeDevice remoteXBeeDevice

The XBee device containing the 64-bit address to look for in the list of packets.

System.Int32 timeout

The time in milliseconds to wait for an XBee explicit data packet from the specified remote XBee device to become available. 0 to return immediately.

Returns
Type Description
XBeePacket

The first XBee explicit data packet whose its 64-bit address matches the address of the provided remote XBee device. null if no explicit data packets from the specified XBee device are found in the queue.

Remarks

The methods waits up to the specified timeout if necessary for an XBee explicit data packet to become available. null if the queue is empty or there is not any XBee explicit data packet sent by the provided remote XBee device.

See Also
RemoteXBeeDevice
XBeePacket
ExplicitRxIndicatorPacket

GetFirstIPDataPacket(Int32)

Returns the first IP data packet from the queue waiting up to the specified timeout if necessary for an IP data packet to become available. null if the queue is empty or there is not any IP data packet inside.

Declaration
public XBeePacket GetFirstIPDataPacket(int timeout)
Parameters
Type Name Description
System.Int32 timeout

The time in milliseconds to wait for an IP data packet to become available. 0 to return immediately.

Returns
Type Description
XBeePacket

The first IP data packet from the queue, null if it is empty or no IP packets are contained in the queue.

See Also
XBeePacket

GetFirstIPDataPacketFrom(IPAddress, Int32)

Returns the first IP data packet from the queue whose IP address matches the provided address.

Declaration
public XBeePacket GetFirstIPDataPacketFrom(IPAddress ipAddress, int timeout)
Parameters
Type Name Description
System.Net.IPAddress ipAddress

The IP address to look for in the list of packets.

System.Int32 timeout

The time in milliseconds to wait for an IP data packet to become available. 0 to return immediately.

Returns
Type Description
XBeePacket

The first IP packet whose IP address matches the provided IP address. null if no IP data packets from the specified IP address are found in the queue.

See Also
XBeePacket
System.Net.IPAddress

GetFirstPacket(Int32)

Returns the first packet from the queue waiting up to the specified timeout if necessary for an XBee packet to become available. Or null if the queue is empty.

Declaration
public XBeePacket GetFirstPacket(int timeout)
Parameters
Type Name Description
System.Int32 timeout

The time in milliseconds to wait for an XBee packet to become available. 0 to return immediately.

Returns
Type Description
XBeePacket

The first packet from the queue, null if it is empty.

See Also
XBeePacket

GetFirstPacketFrom(RemoteXBeeDevice, Int32)

Returns the first packet from the queue whose 64-bit source address matches the address of the provided remote XBee device.

Declaration
public XBeePacket GetFirstPacketFrom(RemoteXBeeDevice remoteXBeeDevice, int timeout)
Parameters
Type Name Description
RemoteXBeeDevice remoteXBeeDevice

The remote XBee device containing the 4-bit address to look for in the list of packets.

System.Int32 timeout

The time in milliseconds to wait for an XBee packet from the specified remote XBee device to become available. 0 to return immediately.

Returns
Type Description
XBeePacket

The first XBee packet whose 64-bit address matches the address of the provided remote XBee device. null if no packets from the specified XBee device are found in the queue.

Remarks

The methods waits up to the specified timeout if necessary for an XBee packet to become available. null if the queue is empty or there is not any XBee packet sent by the provided remote XBee device.

See Also
RemoteXBeeDevice
XBeePacket

GetFirstUserDataRelayPacket(Int32)

Returns the first User Data Relay packet from the queue waiting up to the specified timeout if necessary for the packet to become available. null if the queue is empty or there is not any User Data Relay packet inside.

Declaration
public XBeePacket GetFirstUserDataRelayPacket(int timeout)
Parameters
Type Name Description
System.Int32 timeout

The time in milliseconds to wait for a User Data Relay packet to become available. 0 to return immediately.

Returns
Type Description
XBeePacket

The first User Data Relay packet from the queue, null if it is empty or no data packets are contained in the queue.

See Also
XBeePacket
UserDataRelayOutputPacket

See Also

XBeePacket
Product page More documentation Official site About Digi Contact us Support
©2019 Digi International Inc. All rights reserved.
Digi International Inc.