Class XBeeAPIPacket
This abstract class provides the basic structure of a ZigBee API frame.
Inheritance
Inherited Members
Namespace: XBeeLibrary.Core.Packet
Assembly: XBeeLibrary.Core.dll
Syntax
public abstract class XBeeAPIPacket : XBeePacket
Remarks
Derived classes should implement their own methods to generate the API data and frame ID in case they support it.
Basic operations such as frame type retrieval are performed in this class.
Constructors
XBeeAPIPacket(Byte)
Initializes a new instance of class XBeeAPIPacket with the
specified frameTypeValue
.
Declaration
protected XBeeAPIPacket(byte frameTypeValue)
Parameters
Type | Name | Description |
---|---|---|
System.Byte | frameTypeValue | XBee packet frame type integer value. |
XBeeAPIPacket(APIFrameType)
Initializes a new instance of class XBeeAPIPacket with the
specified frameType
.
Declaration
protected XBeeAPIPacket(APIFrameType frameType)
Parameters
Type | Name | Description |
---|---|---|
APIFrameType | frameType | XBee packet frame type. |
Fields
NO_FRAME_ID
Declaration
public const int NO_FRAME_ID = 9999
Field Value
Type | Description |
---|---|
System.Int32 |
Properties
APIData
The XBee API packet data.
Declaration
public byte[] APIData { get; }
Property Value
Type | Description |
---|---|
System.Byte[] |
Remarks
This does not include the frame ID if it is needed.
APIPacketParameters
Gets a map with the XBee packet parameters and their values.
Declaration
protected abstract 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. |
APIPacketSpecificData
Gets the XBee API packet specific data.
Declaration
protected abstract byte[] APIPacketSpecificData { get; }
Property Value
Type | Description |
---|---|
System.Byte[] |
Remarks
This does not include the frame ID if it is needed.
FrameID
The Frame ID of the API packet.
Declaration
public ushort FrameID { get; set; }
Property Value
Type | Description |
---|---|
System.UInt16 |
Remarks
If the frame ID is not configured or if the API packet does not need a Frame ID
(if (!NeedsAPIFrameID)
), this property returns NO_FRAME_ID.
Exceptions
Type | Condition |
---|---|
System.ArgumentException | If |
FrameType
The XBee packet frame type.
Declaration
public APIFrameType FrameType { get; }
Property Value
Type | Description |
---|---|
APIFrameType |
See Also
FrameTypeValue
The XBee packet frame type byte value.
Declaration
public byte FrameTypeValue { get; }
Property Value
Type | Description |
---|---|
System.Byte |
IsBroadcast
Indicates whether the packet is a broadcast packet.
Declaration
public abstract bool IsBroadcast { get; }
Property Value
Type | Description |
---|---|
System.Boolean |
NeedsAPIFrameID
Indicates whether the API packet needs API Frame ID or not.
Declaration
public abstract bool NeedsAPIFrameID { get; }
Property Value
Type | Description |
---|---|
System.Boolean |
PacketParameters
A sorted dictionary with the packet parameters and their values.
Declaration
protected override LinkedDictionary<string, string> PacketParameters { get; }
Property Value
Type | Description |
---|---|
LinkedDictionary<System.String, System.String> |
Overrides
Methods
CheckFrameID(Int32)
Indicates whether the given ID is the current frame ID.
Declaration
public bool CheckFrameID(int id)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | id | The frame id to check. |
Returns
Type | Description |
---|---|
System.Boolean |
|
See Also
GetPacketData()
Returns the packet data.
Declaration
public override byte[] GetPacketData()
Returns
Type | Description |
---|---|
System.Byte[] | The packet data. |