XBee C# library API reference

Show / Hide Table of Contents

Class ATCommandPacket

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

Inheritance
System.Object
XBeePacket
XBeeAPIPacket
ATCommandPacket
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 ATCommandPacket : XBeeAPIPacket
Remarks

Used to query or set module parameters on the local device. This API command applies changes after executing the command. (Changes made to module parameters take effect once changes are applied.).

Command response is received as an ATCommandResponsePacket.

Constructors

ATCommandPacket(Byte, String, Byte[])

Class constructor. Instantiates a ATCommandPacket with the given parameters.

Declaration
public ATCommandPacket(byte frameID, string command, byte[] parameter)
Parameters
Type Name Description
System.Byte frameID

The XBee API frame ID.

System.String command

The AT command.

System.Byte[] parameter

The AT command parameter, null if it is not required.

Exceptions
Type Condition
System.ArgumentException

If frameID < 0 or if frameID > 255.

System.ArgumentNullException

If command is null.

ATCommandPacket(Byte, String, String)

Class constructor. Instantiates a ATCommandPacket with the given parameters.

Declaration
public ATCommandPacket(byte frameID, string command, string parameter)
Parameters
Type Name Description
System.Byte frameID

The XBee API frame ID.

System.String command

The AT command.

System.String parameter

AT command parameter as string, null if it is not required.

Exceptions
Type Condition
System.ArgumentException

If frameID < 0 or if frameID > 255.

System.ArgumentNullException

If command is null.

Properties

APIPacketParameters

A sorted dictionary with the packet parameters and their values.

Declaration
protected override LinkedDictionary<string, string> APIPacketParameters { get; }
Property Value
Type Description
LinkedDictionary<System.String, System.String>
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.

Command

The AT command.

Declaration
public string Command { get; }
Property Value
Type Description
System.String

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

Parameter

The AT command parameter.

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

StringParameter

The AT command parameter as string.

Declaration
public string StringParameter { get; set; }
Property Value
Type Description
System.String

Methods

CreatePacket(Byte[])

Creates a new ATCommandPacket object from the given payload.

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

The API frame payload. It must start with the frame type corresponding to an AT Command packet (0x08). The byte array must be in API mode.

Returns
Type Description
ATCommandPacket

Parsed AT Command packet.

Exceptions
Type Condition
System.ArgumentException

If payload[0] != APIFrameType.AT_COMMAND.GetValue() or if payload.Length < XBeeLibrary.Core.Packet.Common.ATCommandPacket.MIN_API_PAYLOAD_LENGTH.

System.ArgumentNullException

If payload == null.

See Also

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