Class TXIPv4Packet
This class represents a TX (Transmit) IPv4 packet. Packet is built using the parameters of the constructor or providing a valid API payload.
Inherited Members
Namespace: XBeeLibrary.Core.Packet.IP
Assembly: XBeeLibrary.Core.dll
Syntax
public class TXIPv4Packet : XBeeAPIPacket
Constructors
TXIPv4Packet(Byte, IPAddress, Int32, Int32, IPProtocol, Int32, Byte[])
Class constructor. Instantiates a new TXIPv4Packet object with the given parameters.
Declaration
public TXIPv4Packet(byte frameID, IPAddress destAddress, int destPort, int sourcePort, IPProtocol protocol, 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. |
IPProtocol | protocol | Protocol used for transmitted data. |
System.Int32 | transmitOptions | Transmit options bitfield. |
System.Byte[] | data | Transmit data bytes. |
Exceptions
Type | Condition |
---|---|
System.ArgumentException | If |
See Also
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
APIPacketSpecificData
Gets the XBee API packet specific data.
Declaration
protected override byte[] APIPacketSpecificData { get; }
Property Value
Type | Description |
---|---|
System.Byte[] |
Overrides
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 |
See Also
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
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
Protocol
The network protocol.
Declaration
public IPProtocol Protocol { get; set; }
Property Value
Type | Description |
---|---|
IPProtocol |
Exceptions
Type | Condition |
---|---|
System.ArgumentException | If the value to set is unknown. |
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 TXIPv4Packet object from the given payload.
Declaration
public static TXIPv4Packet 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 IPv4 packet ( |
Returns
Type | Description |
---|---|
TXIPv4Packet | Parsed TX IPv4 packet. |
Exceptions
Type | Condition |
---|---|
System.ArgumentException | If |
System.ArgumentNullException | If |