public class IPv6RemoteATCommandRequestPacket extends XBeeAPIPacket
Used to query or set module parameters on a remote device identified by an IPv6 address. For parameter changes on the remote device to take effect, changes must be applied, either by setting the apply changes options bit, or by sending an AC command to the remote.
Remote Command options are set as a bitfield.
If configured, command response is received as an IPv6 Remote AT Command
Response packet. See IPv6RemoteATCommandResponsePacket
.
IPv6RemoteATCommandResponsePacket
,
XBeeAPIPacket
NO_FRAME_ID
Constructor and Description |
---|
IPv6RemoteATCommandRequestPacket(int frameID,
Inet6Address destAddress,
int transmitOptions,
String command,
byte[] parameter)
Class constructor.
|
IPv6RemoteATCommandRequestPacket(int frameID,
Inet6Address destAddress,
int transmitOptions,
String command,
String parameter)
Class constructor.
|
Modifier and Type | Method and Description |
---|---|
static IPv6RemoteATCommandRequestPacket |
createPacket(byte[] payload)
Creates a new
IPv6RemoteATCommandRequestPacket object from the given
payload. |
LinkedHashMap<String,String> |
getAPIPacketParameters()
Returns a map with the XBee packet parameters and their values.
|
String |
getCommand()
Returns the AT Command.
|
Inet6Address |
getDestAddress()
Retrieves the destination IPv6 address.
|
byte[] |
getParameter()
Returns the AT command parameter as byte array.
|
String |
getParameterAsString()
Returns the AT command parameter as String.
|
int |
getTransmitOptions()
Returns the transmit options bitfield.
|
boolean |
needsAPIFrameID()
Returns whether the API packet needs API Frame ID or not.
|
void |
setParameter(byte[] parameter)
Sets the AT command parameter as byte array.
|
void |
setParameter(String parameter)
Sets the AT command parameter as String.
|
checkFrameID, getAPIData, getFrameID, getFrameType, getFrameTypeValue, getPacketData, isBroadcast, setFrameID
equals, generateByteArray, generateByteArrayEscaped, getChecksum, getPacketLength, getParameters, hashCode, parsePacket, parsePacket, toPrettyString, toString
public IPv6RemoteATCommandRequestPacket(int frameID, Inet6Address destAddress, int transmitOptions, String command, byte[] parameter)
IPv6RemoteATCommandRequestPacket
object with the given parameters.frameID
- Frame ID.destAddress
- IPv6 address of the destination device.transmitOptions
- Bitfield of supported transmission options.command
- AT command.parameter
- AT command parameter as byte array.IllegalArgumentException
- if frameID < 0
or
if frameID > 255
or
if transmitOptions !=
or
if transmitOptions !=
.NullPointerException
- if destAddress == null
or
if command == null
.Inet6Address
,
RemoteATCommandOptions
public IPv6RemoteATCommandRequestPacket(int frameID, Inet6Address destAddress, int transmitOptions, String command, String parameter)
IPv6RemoteATCommandRequestPacket
object with the given parameters.frameID
- The Frame ID.destAddress
- IPv6 address of the destination device.transmitOptions
- Bitfield of supported transmission options.command
- AT command.parameter
- AT command parameter as String.IllegalArgumentException
- if frameID < 0
or
if frameID > 255
or
if transmitOptions !=
or
if transmitOptions !=
.NullPointerException
- if destAddress == null
or
if command == null
.Inet6Address
,
RemoteATCommandOptions
public static IPv6RemoteATCommandRequestPacket createPacket(byte[] payload)
IPv6RemoteATCommandRequestPacket
object from the given
payload.payload
- The API frame payload. It must start with the frame type
corresponding to an IPv6 Remote AT Command packet (0x1B
).
The byte array must be in OperatingMode.API
mode.IllegalArgumentException
- if payload[0] != APIFrameType.IPV6_REMOTE_AT_COMMAND_REQUEST.getValue()
or
if payload.length <
orNullPointerException
- if payload == null
.public LinkedHashMap<String,String> getAPIPacketParameters()
XBeeAPIPacket
public String getCommand()
public Inet6Address getDestAddress()
Inet6Address
public byte[] getParameter()
getParameterAsString()
,
setParameter(String parameter)
,
setParameter(byte[] parameter)
public String getParameterAsString()
null
if not
parameter is set.getParameter()
,
setParameter(String parameter)
,
setParameter(byte[] parameter)
public int getTransmitOptions()
RemoteATCommandOptions
public boolean needsAPIFrameID()
XBeeAPIPacket
needsAPIFrameID
in class XBeeAPIPacket
true
if the packet needs API Frame ID, false
otherwise.public void setParameter(byte[] parameter)
parameter
- The AT command parameter as byte array.getParameter()
,
getParameterAsString()
,
setParameter(String)
public void setParameter(String parameter)
parameter
- The AT command parameter as String.getParameter()
,
getParameterAsString()
,
setParameter(byte[])
© Copyright 2014 - 2024 Digi International Inc. All rights reserved.