Class RXIPv4Packet
This class represents an RX (Receive) 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 RXIPv4Packet : XBeeAPIPacket
Constructors
RXIPv4Packet(IPAddress, Int32, Int32, IPProtocol, Byte[])
Class constructor. Instantiates a new RXIPv4Packet
object with
the given parameters.
Declaration
public RXIPv4Packet(IPAddress sourceAddress, int destPort, int sourcePort, IPProtocol protocol, byte[] data)
Parameters
Type | Name | Description |
---|---|---|
System.Net.IPAddress | sourceAddress | 32-bit IP address of the source device. |
System.Int32 | destPort | Destination port number. |
System.Int32 | sourcePort | Source port number. |
IPProtocol | protocol | Protocol used for transmitted data. |
System.Byte[] | data | Receive data bytes. |
Exceptions
Type | Condition |
---|---|
System.ArgumentException | If |
See Also
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 received data.
Declaration
public byte[] Data { get; set; }
Property Value
Type | Description |
---|---|
System.Byte[] |
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. |
See Also
SourceAddress
The 32-bit source IP address.
Declaration
public IPAddress SourceAddress { get; set; }
Property Value
Type | Description |
---|---|
System.Net.IPAddress |
Exceptions
Type | Condition |
---|---|
System.ArgumentNullException | If the value to set is |
See Also
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. |
Methods
CreatePacket(Byte[])
Creates a new RXIPv4Packet
object from the given payload.
Declaration
public static RXIPv4Packet CreatePacket(byte[] payload)
Parameters
Type | Name | Description |
---|---|---|
System.Byte[] | payload | The API frame payload. It must start with the frame type corresponding
to an RX IPv4 packet ( |
Returns
Type | Description |
---|---|
RXIPv4Packet | Parsed RX IPv4 packet. |
Exceptions
Type | Condition |
---|---|
System.ArgumentException | If |
System.ArgumentNullException | If |