public class ModemStatusPacket extends XBeeAPIPacket
RF module status messages are sent from the module in response to specific conditions and indicates the state of the modem in that moment.
XBeeAPIPacket
NO_FRAME_ID
Constructor and Description |
---|
ModemStatusPacket(ModemStatusEvent modemStatusEvent)
Class constructor.
|
Modifier and Type | Method and Description |
---|---|
static ModemStatusPacket |
createPacket(byte[] payload)
Creates a new
ModemStatusPacket object from the given payload. |
LinkedHashMap<String,String> |
getAPIPacketParameters()
Returns a map with the XBee packet parameters and their values.
|
byte[] |
getAPIPacketSpecificData()
Returns the XBee API packet specific data.
|
ModemStatusEvent |
getStatus()
Returns modem status event enum.
|
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.
|
checkFrameID, getAPIData, getFrameID, getFrameType, getFrameTypeValue, getPacketData, setFrameID
generateByteArray, generateByteArrayEscaped, getChecksum, getPacketLength, getParameters, parsePacket, parsePacket, toPrettyString, toString
public ModemStatusPacket(ModemStatusEvent modemStatusEvent)
ModemStatusPacket
object
with the given modem status.modemStatusEvent
- Modem status event enum. entry.NullPointerException
- if modemStatusEvent == null
.public static ModemStatusPacket createPacket(byte[] payload)
ModemStatusPacket
object from the given payload.payload
- The API frame payload. It must start with the frame type
corresponding to a Modem Status packet (0x8A
).
The byte array must be in OperatingMode.API
mode.IllegalArgumentException
- if payload[0] != APIFrameType.MODEM_STATUS.getValue()
or
if payload.length < {@value #MIN_API_PAYLOAD_LENGTH}
.NullPointerException
- if payload == null
or
if modemStatusEvent == null
.public LinkedHashMap<String,String> getAPIPacketParameters()
XBeeAPIPacket
public byte[] getAPIPacketSpecificData()
XBeeAPIPacket
This does not include the frame ID if it is needed.
public ModemStatusEvent getStatus()
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.© Copyright 2014–2014 Digi International Inc. All rights reserved.