public class RemoteATCommandResponsePacket extends XBeeAPIPacket
If a module receives a remote command response RF data frame in response
to a Remote AT Command Request, the module will send a Remote AT Command
Response message out the UART. Some commands may send back multiple frames--
for example, Node Discover (ND
) command.
This packet is received in response of a RemoteATCommandPacket
.
Response also includes an ATCommandStatus
object with the status
of the AT command.
RemoteATCommandPacket
,
ATCommandStatus
,
XBeeAPIPacket
NO_FRAME_ID
Constructor and Description |
---|
RemoteATCommandResponsePacket(int frameID,
XBee64BitAddress sourceAddress64,
XBee16BitAddress sourceAddress16,
String command,
ATCommandStatus status,
byte[] commandValue)
Class constructor.
|
Modifier and Type | Method and Description |
---|---|
static RemoteATCommandResponsePacket |
createPacket(byte[] payload)
Creates an new
RemoteATCommandResponsePacket object from the
given payload. |
XBee16BitAddress |
get16bitSourceAddress()
Returns the 16-bit source address.
|
XBee64BitAddress |
get64bitSourceAddress()
Returns the 64-bit source address.
|
LinkedHashMap<String,String> |
getAPIPacketParameters()
Returns a map with the XBee packet parameters and their values.
|
String |
getCommand()
Returns the AT command.
|
byte[] |
getCommandValue()
Retrieves the AT command response value.
|
String |
getCommandValueAsString()
Returns the AT command response value as String.
|
ATCommandStatus |
getStatus()
Returns the AT command response status.
|
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 |
setCommandValue(byte[] commandValue)
Sets the AT response response value.
|
void |
setCommandValue(String commandValue)
Sets the AT command response value as String.
|
checkFrameID, getAPIData, getFrameID, getFrameType, getFrameTypeValue, getPacketData, setFrameID
generateByteArray, generateByteArrayEscaped, getChecksum, getPacketLength, getParameters, parsePacket, parsePacket, toPrettyString, toString
public RemoteATCommandResponsePacket(int frameID, XBee64BitAddress sourceAddress64, XBee16BitAddress sourceAddress16, String command, ATCommandStatus status, byte[] commandValue)
RemoteATCommandResponsePacket
object with the given parameters.frameID
- frame ID.sourceAddress64
- 64-bit address of the remote radio returning
response.sourceAddress16
- 16-bit network address of the remote.command
- The AT command.status
- The command status.commandValue
- The AT command response value.IllegalArgumentException
- if frameID < 0
or
if frameID > 255
.NullPointerException
- if sourceAddress64 == null
or
if sourceAddress16 == null
or
if command == null
or
if status == null
.ATCommandStatus
,
XBee16BitAddress
,
XBee64BitAddress
public static RemoteATCommandResponsePacket createPacket(byte[] payload)
RemoteATCommandResponsePacket
object from the
given payload.payload
- The API frame payload. It must start with the frame type
corresponding to a Remote AT Command Response packet (0x97
).
The byte array must be in OperatingMode.API
mode.IllegalArgumentException
- if payload[0] != APIFrameType.REMOTE_AT_COMMAND_RESPONSE.getValue()
or
if payload.length <
or
if frameID < 0
or
if frameID > 255
.NullPointerException
- if payload == null
.public XBee16BitAddress get16bitSourceAddress()
XBee16BitAddress
public XBee64BitAddress get64bitSourceAddress()
XBee64BitAddress
public LinkedHashMap<String,String> getAPIPacketParameters()
XBeeAPIPacket
public String getCommand()
public byte[] getCommandValue()
public String getCommandValueAsString()
null
if no
value is set.public ATCommandStatus getStatus()
ATCommandStatus
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 setCommandValue(byte[] commandValue)
commandValue
- The AT command response value.public void setCommandValue(String commandValue)
commandValue
- The AT command response value as String.© Copyright 2014–2014 Digi International Inc. All rights reserved.