XBee C# library API reference

Show / Hide Table of Contents

Class TXSMSPacket

This class represents a TX (Transmit) SMS packet. Packet is built using the parameters of the constructor or providing a valid API payload.

Inheritance
System.Object
XBeePacket
XBeeAPIPacket
TXSMSPacket
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.Cellular
Assembly: XBeeLibrary.Core.dll
Syntax
public class TXSMSPacket : XBeeAPIPacket
Remarks

A TX SMS message will cause the cellular module to send an SMS.

Constructors

TXSMSPacket(Byte, String, String)

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

Declaration
public TXSMSPacket(byte frameID, string phoneNumber, string data)
Parameters
Type Name Description
System.Byte frameID

The frame ID.

System.String phoneNumber

The phone number. Only numbers and '+' prefix allowed.

System.String data

The data to send as body of the SMS message.

Exceptions
Type Condition
System.ArgumentException

If frameID < 0 or if frameID > 255 or if the length of the phoneNumber is greater than XBeeLibrary.Core.Packet.Cellular.TXSMSPacket.PHONE_NUMBER_LENGTH or if phoneNumber is invalid.

System.ArgumentNullException

If phoneNumber == null.

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.

Data

The data to send.

Declaration
public string Data { get; set; }
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

PhoneNumber

The phone number. Only numbers and '+' prefix allowed.

Declaration
public string PhoneNumber { get; set; }
Property Value
Type Description
System.String
Exceptions
Type Condition
System.ArgumentNullException

If the value to be set is null.

System.ArgumentException

If the length of the value to be set is greater than XBeeLibrary.Core.Packet.Cellular.TXSMSPacket.PHONE_NUMBER_LENGTH or if the value to be set is invalid.

PhoneNumberByteArray

The phone number byte array.

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

Methods

CreatePacket(Byte[])

Creates a new TXSMSPacket object from the given payload.

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

The API frame payload. It must start with the frame type corresponding to a TX SMS packet (0x1F). The byte array must be in API mode.

Returns
Type Description
TXSMSPacket

Parsed TX SMS packet.

Exceptions
Type Condition
System.ArgumentException

If payload[0] != APIFrameType.TX_SMS.GetValue() or if payload.length < XBeeLibrary.Core.Packet.Cellular.TXSMSPacket.MIN_API_PAYLOAD_LENGTH.

System.ArgumentNullException

If payload == null.

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