XBee C# library API reference

Show / Hide Table of Contents

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.

Inheritance
System.Object
XBeePacket
XBeeAPIPacket
RXIPv4Packet
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 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 destPort < 0 or if destPort > 65535 or if sourcePort < 0 or if sourcePort > 65535 or if protocol is unknown.

See Also
System.Net.IPAddress
IPProtocol

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 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
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

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
IPProtocol

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 null.

See Also
System.Net.IPAddress

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 (0xB0). The byte array must be in API mode.

Returns
Type Description
RXIPv4Packet

Parsed RX IPv4 packet.

Exceptions
Type Condition
System.ArgumentException

If payload[0] != APIFrameType.RX_IPV4.GetValue() or if payload.length < XBeeLibrary.Core.Packet.IP.RXIPv4Packet.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.