public class TXTLSProfilePacket extends XBeeAPIPacket
TXIPv4Packet
,
XBeeAPIPacket
Modifier and Type | Field and Description |
---|---|
static int |
OPTIONS_CLOSE_SOCKET
This option will close the socket after the transmission.
|
static int |
OPTIONS_LEAVE_SOCKET_OPEN
This option will leave socket open after the transmission.
|
NO_FRAME_ID
Constructor and Description |
---|
TXTLSProfilePacket(int frameID,
Inet4Address destAddress,
int destPort,
int sourcePort,
int profile,
int transmitOptions,
byte[] data)
Class constructor.
|
Modifier and Type | Method and Description |
---|---|
static TXTLSProfilePacket |
createPacket(byte[] payload)
Creates a new
TXTLSProfilePacket object from the given payload. |
LinkedHashMap<String,String> |
getAPIPacketParameters()
Returns a map with the XBee packet parameters and their values.
|
byte[] |
getData()
Returns the transmission data.
|
Inet4Address |
getDestAddress()
Returns the destination IP address.
|
int |
getDestPort()
Returns the destination port.
|
int |
getProfile()
Returns the TLS profile.
|
int |
getSourcePort()
Returns the source port.
|
int |
getTransmitOptions()
Returns the transmit options.
|
boolean |
isBroadcast()
Returns whether or not the packet is a broadcast packet.
|
boolean |
needsAPIFrameID()
Returns whether the API packet needs API Frame ID or not.
|
void |
setData(byte[] data)
Sets the new transmission data.
|
void |
setDestAddress(Inet4Address destAddress)
Sets the destination IP address.
|
void |
setDestPort(int destPort)
Sets the destination port.
|
void |
setProfile(int profile)
Sets the TLS profile.
|
void |
setSourcePort(int sourcePort)
Sets the source port.
|
void |
setTransmitOptions(int transmitOptions)
Sets the transmit options.
|
checkFrameID, getAPIData, getFrameID, getFrameType, getFrameTypeValue, getPacketData, setFrameID
equals, generateByteArray, generateByteArrayEscaped, getChecksum, getPacketLength, getParameters, hashCode, parsePacket, parsePacket, toPrettyString, toString
public static final int OPTIONS_CLOSE_SOCKET
public static final int OPTIONS_LEAVE_SOCKET_OPEN
public TXTLSProfilePacket(int frameID, Inet4Address destAddress, int destPort, int sourcePort, int profile, int transmitOptions, byte[] data)
TXTLSProfilePacket
object
with the given parameters.frameID
- Frame ID.destAddress
- IP address of the destination device.destPort
- Destination port number.sourcePort
- Source port number.profile
- Zero-indexed number that indicates the profile as
specified by the corresponding $num command.transmitOptions
- Transmit options bitfield. Can be
OPTIONS_LEAVE_SOCKET_OPEN
or
OPTIONS_CLOSE_SOCKET
.data
- Transmit data bytes.IllegalArgumentException
- if frameID < 0
or
if frameID > 255
or
if destPort < 0
or
if destPort > 65535
or
if sourcePort < 0
or
if sourcePort > 65535
or
if profile < 0
or
if profile > 255
or
if transmitOptions
are invalid.NullPointerException
- if destAddress == null
.Inet4Address
public static TXTLSProfilePacket createPacket(byte[] payload)
TXTLSProfilePacket
object from the given payload.payload
- The API frame payload. It must start with the frame type
corresponding to a TX request with TLS profile packet
(0x23
). The byte array must be in
OperatingMode.API
mode.IllegalArgumentException
- if payload[0] != APIFrameType.TX_REQUEST_TLS_PROFILE.getValue()
or
if payload.length <
.NullPointerException
- if payload == null
.public LinkedHashMap<String,String> getAPIPacketParameters()
XBeeAPIPacket
public byte[] getData()
setData(byte[])
public Inet4Address getDestAddress()
setDestAddress(Inet4Address)
,
Inet4Address
public int getDestPort()
setDestPort(int)
public int getProfile()
setProfile(int)
public int getSourcePort()
setSourcePort(int)
public int getTransmitOptions()
OPTIONS_CLOSE_SOCKET
,
OPTIONS_LEAVE_SOCKET_OPEN
,
setTransmitOptions(int)
public boolean isBroadcast()
XBeeAPIPacket
isBroadcast
in class XBeeAPIPacket
true
if the packet is a broadcast packet, false
otherwise.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 transmission data.getData()
public void setDestAddress(Inet4Address destAddress)
destAddress
- The new destination IP address.NullPointerException
- if destAddress == null
.getDestAddress()
,
Inet4Address
public void setDestPort(int destPort)
destPort
- The new destination port.IllegalArgumentException
- if destPort < 0
or
if destPort > 65535
.getDestPort()
public void setProfile(int profile)
profile
- The new TLS profile.IllegalArgumentException
- if profile < 0
or
if profile > 255
.getProfile()
public void setSourcePort(int sourcePort)
sourcePort
- The new source port.IllegalArgumentException
- if sourcePort < 0
or
if sourcePort > 65535
.getSourcePort()
public void setTransmitOptions(int transmitOptions)
transmitOptions
- Transmit options. Can be
OPTIONS_CLOSE_SOCKET
or
OPTIONS_LEAVE_SOCKET_OPEN
.IllegalArgumentException
- if transmitOptions
are invalid.OPTIONS_CLOSE_SOCKET
,
OPTIONS_LEAVE_SOCKET_OPEN
,
getTransmitOptions()
© Copyright 2014 - 2024 Digi International Inc. All rights reserved.