public class RXIPv6Packet extends XBeeAPIPacket
TXIPv6Packet
,
XBeeAPIPacket
NO_FRAME_ID
Constructor and Description |
---|
RXIPv6Packet(Inet6Address destAddress,
Inet6Address sourceAddress,
int destPort,
int sourcePort,
IPProtocol protocol,
byte[] data)
Class constructor.
|
Modifier and Type | Method and Description |
---|---|
static RXIPv6Packet |
createPacket(byte[] payload)
Creates a new
RXIPv6Packet object from the given payload. |
LinkedHashMap<String,String> |
getAPIPacketParameters()
Returns a map with the XBee packet parameters and their values.
|
byte[] |
getData()
Retrieves the received data.
|
Inet6Address |
getDestAddress()
Retrieves the destination IPv6 address.
|
int |
getDestPort()
Retrieves the destination port.
|
IPProtocol |
getProtocol()
Retrieves the IP protocol.
|
Inet6Address |
getSourceAddress()
Retrieves the source IPv6 address.
|
int |
getSourcePort()
Retrieves the source port.
|
boolean |
needsAPIFrameID()
Returns whether the API packet needs API Frame ID or not.
|
void |
setData(byte[] data)
Sets the new received data.
|
void |
setDestAddress(Inet6Address destAddress)
Sets the destination IPv6 address.
|
void |
setDestPort(int destPort)
Sets the destination port.
|
void |
setProtocol(IPProtocol protocol)
Sets the IP protocol.
|
void |
setSourceAddress(Inet6Address sourceAddress)
Sets the destination IPv6 address.
|
void |
setSourcePort(int sourcePort)
Sets the source port.
|
checkFrameID, getAPIData, getFrameID, getFrameType, getFrameTypeValue, getPacketData, isBroadcast, setFrameID
equals, generateByteArray, generateByteArrayEscaped, getChecksum, getPacketLength, getParameters, hashCode, parsePacket, parsePacket, toPrettyString, toString
public RXIPv6Packet(Inet6Address destAddress, Inet6Address sourceAddress, int destPort, int sourcePort, IPProtocol protocol, byte[] data)
RXIPv6Packet
object with
the given parameters.destAddress
- IPv6 address of the source device.sourceAddress
- IPv6 address of the source device.destPort
- Destination port number.sourcePort
- Source port number.protocol
- Protocol used for transmitted data.data
- Receive data bytes.IllegalArgumentException
- if destPort < 0
or
if destPort > 65535
or
if sourcePort < 0
or
if sourcePort > 65535
NullPointerException
- if destAddress == null
or
if sourceAddress == null
if protocol == null
.IPProtocol
,
Inet6Address
public static RXIPv6Packet createPacket(byte[] payload)
RXIPv6Packet
object from the given payload.payload
- The API frame payload. It must start with the frame type
corresponding to a RX IPv6 packet (0x9A
).
The byte array must be in OperatingMode.API
mode.IllegalArgumentException
- if payload[0] != APIFrameType.RX_IPV6.getValue()
or
if payload.length <
.NullPointerException
- if payload == null
.public LinkedHashMap<String,String> getAPIPacketParameters()
XBeeAPIPacket
public byte[] getData()
setData(byte[])
public Inet6Address getDestAddress()
setDestAddress(Inet6Address)
,
Inet6Address
public int getDestPort()
setDestPort(int)
public IPProtocol getProtocol()
setProtocol(IPProtocol)
,
IPProtocol
public Inet6Address getSourceAddress()
setSourceAddress(Inet6Address)
,
Inet6Address
public int getSourcePort()
setSourcePort(int)
public boolean needsAPIFrameID()
XBeeAPIPacket
needsAPIFrameID
in class XBeeAPIPacket
true
if the packet needs API Frame ID, false
otherwise.public void setData(byte[] data)
data
- The received data.getData()
public void setDestAddress(Inet6Address destAddress)
destAddress
- The new destination IPv6 address.NullPointerException
- if destAddress == null
.getDestAddress()
,
Inet6Address
public void setDestPort(int destPort)
destPort
- The new destination port.IllegalArgumentException
- if destPort < 0
or
if destPort > 65535
.getDestPort()
public void setProtocol(IPProtocol protocol)
protocol
- The new IP protocol.NullPointerException
- if protocol == null
.getProtocol()
,
IPProtocol
public void setSourceAddress(Inet6Address sourceAddress)
sourceAddress
- The new source IPv6 address.NullPointerException
- if sourceAddress == null
.getSourceAddress()
,
Inet6Address
public void setSourcePort(int sourcePort)
sourcePort
- The new source port.IllegalArgumentException
- if sourcePort < 0
or
if sourcePort > 65535
.getSourcePort()
© Copyright 2014 - 2024 Digi International Inc. All rights reserved.