public class IPMessage extends Object
This class is used within the XBee Java Library to read data sent to IP devices.
Constructor and Description |
---|
IPMessage(Inet4Address ipAddress,
int sourcePort,
int destPort,
IPProtocol protocol,
byte[] data)
Class constructor.
|
IPMessage(Inet6Address ipv6Address,
int sourcePort,
int destPort,
IPProtocol protocol,
byte[] data)
Class constructor.
|
Modifier and Type | Method and Description |
---|---|
byte[] |
getData()
Returns the byte array containing the data of the message.
|
String |
getDataString()
Returns the data of the message in string format.
|
int |
getDestPort()
Returns the destination port of the transmission.
|
String |
getHostAddress()
Returns the IPv4 or IPv6 address this message is associated to.
|
Inet4Address |
getIPAddress()
Returns the IPv4 address this message is associated to.
|
Inet6Address |
getIPv6Address()
Returns the IPv6 address this message is associated to.
|
IPProtocol |
getProtocol()
Returns the protocol used in the transmission.
|
int |
getSourcePort()
Returns the source port of the transmission.
|
public IPMessage(Inet4Address ipAddress, int sourcePort, int destPort, IPProtocol protocol, byte[] data)
IPMessage
with the given parameters.ipAddress
- The IP address the message comes from.sourcePort
- TCP or UDP source port of the transmission.destPort
- TCP or UDP destination port of the transmission.protocol
- IP protocol used in the transmission.data
- Byte array containing the data of the message.IllegalArgumentException
- if sourcePort < 0
or
if sourcePort > 65535
or
if destPort < 0
or
if destPort > 65535
.NullPointerException
- if ipAddress == null
or
if data == null
or
if protocol == null
.IPProtocol
,
Inet4Address
public IPMessage(Inet6Address ipv6Address, int sourcePort, int destPort, IPProtocol protocol, byte[] data)
IPMessage
with the given parameters.ipv6Address
- The IPv6 address the message comes from.sourcePort
- TCP or UDP source port of the transmission.destPort
- TCP or UDP destination port of the transmission.protocol
- IP protocol used in the transmission.data
- Byte array containing the data of the message.IllegalArgumentException
- if sourcePort < 0
or
if sourcePort > 65535
or
if destPort < 0
or
if destPort > 65535
.NullPointerException
- if ipv6Address == null
or
if data == null
or
if protocol == null
.IPProtocol
,
Inet6Address
public byte[] getData()
public String getDataString()
public int getDestPort()
public String getHostAddress()
Inet4Address
,
Inet6Address
public Inet4Address getIPAddress()
Inet4Address
public Inet6Address getIPv6Address()
Inet6Address
public IPProtocol getProtocol()
IPProtocol
public int getSourcePort()
© Copyright 2014 - 2024 Digi International Inc. All rights reserved.