XBee C# library API reference

Show / Hide Table of Contents

Class TXTLSProfilePacket

This class represents a TX (Transmit) request with TLS profile packet. The packet implies the use of TLS and behaves similar to the TX Request (0x20) frame, with the protocol field replaced with a TLS Profile field to choose from the profiles configured with the $0, $1, and $2 configuration commands. Packet is built using the parameters of the constructor or providing a valid API payload.

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

Constructors

TXTLSProfilePacket(Byte, IPAddress, Int32, Int32, Int32, Int32, Byte[])

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

Declaration
public TXTLSProfilePacket(byte frameID, IPAddress destAddress, int destPort, int sourcePort, int profile, int transmitOptions, byte[] data)
Parameters
Type Name Description
System.Byte frameID

Frame ID.

System.Net.IPAddress destAddress

32-bit IP address of the destination device.

System.Int32 destPort

Destination port number.

System.Int32 sourcePort

Source port number.

System.Int32 profile

Zero-indexed number that indicates the profile as specified by the corresponding $num command.

System.Int32 transmitOptions

Transmit options bitfield.

System.Byte[] data

Transmit data bytes.

Exceptions
Type Condition
System.ArgumentException

If frameID < 0 or if frameID > 255 or if destPort < 0 or if destPort > 65535 or if sourcePort < 0 or if sourcePort > 65535 or if profile < 0 or if profile > 255 or if transmitOptions is invalid.

See Also
System.Net.IPAddress

Fields

OPTIONS_CLOSE_SOCKET

Declaration
public const int OPTIONS_CLOSE_SOCKET = 2
Field Value
Type Description
System.Int32

OPTIONS_LEAVE_SOCKET_OPEN

Declaration
public const int OPTIONS_LEAVE_SOCKET_OPEN = 0
Field Value
Type Description
System.Int32

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 transmission data.

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

DestAddress

The 32-bit destination IP address.

Declaration
public IPAddress DestAddress { get; set; }
Property Value
Type Description
System.Net.IPAddress
Exceptions
Type Condition
System.ArgumentNullException

If the value to set is null.

See Also
System.Net.IPAddress

DestPort

The destination port. The port must be a number between 0 and 65535.

Declaration
public int DestPort { get; set; }
Property Value
Type Description
System.Int32
Exceptions
Type Condition
System.ArgumentException

If the value to set is not between 0 and 65535.

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

Profile

The TLS profile.

Declaration
public int Profile { get; set; }
Property Value
Type Description
System.Int32
Exceptions
Type Condition
System.ArgumentException

If the value to set is not between 0 and 255.

SourcePort

The source port. The port must be a number between 0 and 65535.

Declaration
public int SourcePort { get; set; }
Property Value
Type Description
System.Int32
Exceptions
Type Condition
System.ArgumentException

If the value to set is not between 0 and 65535.

TransmitOptions

The transmit options. Must be OPTIONS_CLOSE_SOCKET or OPTIONS_LEAVE_SOCKET_OPEN.

Declaration
public int TransmitOptions { get; set; }
Property Value
Type Description
System.Int32
Exceptions
Type Condition
System.ArgumentException

If the value to set is invalid.

Methods

CreatePacket(Byte[])

Creates a new TXTLSProfilePacket object from the given payload.

Declaration
public static TXTLSProfilePacket 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 request with TLS profile packet (0x23). The byte array must be in API mode.

Returns
Type Description
TXTLSProfilePacket

Parsed TX request with TLS profile packet.

Exceptions
Type Condition
System.ArgumentException

If payload[0] != APIFrameType.TX_REQUEST_TLS_PROFILE.GetValue() or if payload.length < XBeeLibrary.Core.Packet.IP.TXTLSProfilePacket.MIN_API_PAYLOAD_LENGTH.

System.ArgumentNullException

If payload == null.

See Also

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