public class DeviceResponseStatusPacket extends XBeeAPIPacket
This frame type is sent to the serial port after the serial port sends a
DeviceResponsePacket
.
DeviceResponsePacket
,
XBeeAPIPacket
NO_FRAME_ID
Constructor and Description |
---|
DeviceResponseStatusPacket(int frameID,
DeviceCloudStatus status)
Class constructor.
|
Modifier and Type | Method and Description |
---|---|
static DeviceResponseStatusPacket |
createPacket(byte[] payload)
Creates a new
DeviceResponseStatusPacket object from the given
payload. |
LinkedHashMap<String,String> |
getAPIPacketParameters()
Returns a map with the XBee packet parameters and their values.
|
DeviceCloudStatus |
getStatus()
Retrieves the status of the device response.
|
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 |
setStatus(DeviceCloudStatus status)
Sets the status of the device response.
|
checkFrameID, getAPIData, getFrameID, getFrameType, getFrameTypeValue, getPacketData, setFrameID
equals, generateByteArray, generateByteArrayEscaped, getChecksum, getPacketLength, getParameters, hashCode, parsePacket, parsePacket, toPrettyString, toString
public DeviceResponseStatusPacket(int frameID, DeviceCloudStatus status)
DeviceResponseStatusPacket
object with the given parameters.frameID
- Frame ID.status
- Device response status.IllegalArgumentException
- if frameID < 0
or
if frameID > 255
.NullPointerException
- if status == null
.DeviceCloudStatus
public static DeviceResponseStatusPacket createPacket(byte[] payload)
DeviceResponseStatusPacket
object from the given
payload.payload
- The API frame payload. It must start with the frame type
corresponding to a Device Response Status packet
(0xBA
). The byte array must be in
OperatingMode.API
mode.IllegalArgumentException
- if payload[0] != APIFrameType.DEVICE_RESPONSE_STATUS.getValue()
or
if payload.length <
.NullPointerException
- if payload == null
.public LinkedHashMap<String,String> getAPIPacketParameters()
XBeeAPIPacket
public DeviceCloudStatus getStatus()
setStatus(DeviceCloudStatus)
,
DeviceCloudStatus
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 setStatus(DeviceCloudStatus status)
status
- The status of the device response.NullPointerException
- if status == null
.getStatus()
,
DeviceCloudStatus
© Copyright 2014 - 2024 Digi International Inc. All rights reserved.