public class UserDataRelayOutputPacket extends XBeeAPIPacket
XBeeLocalInterface
.UserDataRelayPacket
,
XBeeAPIPacket
NO_FRAME_ID
Constructor and Description |
---|
UserDataRelayOutputPacket(XBeeLocalInterface localInterface,
byte[] data)
Class constructor.
|
Modifier and Type | Method and Description |
---|---|
static UserDataRelayOutputPacket |
createPacket(byte[] payload)
Creates a new
UserDataRelayOutputPacket 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.
|
byte[] |
getData()
Retrieves the received data.
|
XBeeLocalInterface |
getSourceInterface()
Retrieves the the source XBee local interface.
|
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 received data.
|
void |
setSourceInterface(XBeeLocalInterface localInterface)
Sets the source XBee local interface.
|
checkFrameID, getAPIData, getFrameID, getFrameType, getFrameTypeValue, getPacketData, setFrameID
equals, generateByteArray, generateByteArrayEscaped, getChecksum, getPacketLength, getParameters, hashCode, parsePacket, parsePacket, toPrettyString, toString
public UserDataRelayOutputPacket(XBeeLocalInterface localInterface, byte[] data)
UserDataRelayOutputPacket
object with the given parameters.localInterface
- The source XBeeLocalInterface
.data
- RF Data that is received from the source interface.NullPointerException
- if localInterface == null
.public static UserDataRelayOutputPacket createPacket(byte[] payload)
UserDataRelayOutputPacket
object from the given
payload.payload
- The API frame payload. It must start with the frame type
corresponding to a User Data Relay packet (0xAD
).
The byte array must be in OperatingMode.API
mode.IllegalArgumentException
- if payload[0] != APIFrameType.USER_DATA_RELAY_OUTPUT.getValue()
or
if payload.length <
.NullPointerException
- if payload == null
.public LinkedHashMap<String,String> getAPIPacketParameters()
XBeeAPIPacket
public byte[] getAPIPacketSpecificData()
XBeeAPIPacket
This does not include the frame ID if it is needed.
public byte[] getData()
setData(byte[])
public XBeeLocalInterface getSourceInterface()
setSourceInterface(XBeeLocalInterface)
,
XBeeLocalInterface
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
- Received data.getData()
public void setSourceInterface(XBeeLocalInterface localInterface)
localInterface
- The new source interface.NullPointerException
- if localInterface == null
.getSourceInterface()
,
XBeeLocalInterface
© Copyright 2014 - 2024 Digi International Inc. All rights reserved.