public class UserDataRelayPacket extends XBeeAPIPacket
XBeeLocalInterface
.UserDataRelayOutputPacket
,
XBeeAPIPacket
NO_FRAME_ID
Constructor and Description |
---|
UserDataRelayPacket(int frameID,
XBeeLocalInterface localInterface,
byte[] data)
Class constructor.
|
Modifier and Type | Method and Description |
---|---|
static UserDataRelayPacket |
createPacket(byte[] payload)
Creates a new
UserDataRelayPacket 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 data to send.
|
XBeeLocalInterface |
getDestinationInterface()
Retrieves the the destination 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 data to send.
|
void |
setDestinationInterface(XBeeLocalInterface localInterface)
Sets the destination XBee local interface.
|
checkFrameID, getAPIData, getFrameID, getFrameType, getFrameTypeValue, getPacketData, setFrameID
equals, generateByteArray, generateByteArrayEscaped, getChecksum, getPacketLength, getParameters, hashCode, parsePacket, parsePacket, toPrettyString, toString
public UserDataRelayPacket(int frameID, XBeeLocalInterface localInterface, byte[] data)
UserDataRelayPacket
object with the given parameters.frameID
- Frame ID.localInterface
- The destination XBeeLocalInterface
.data
- RF Data that is sent to the destination interface.IllegalArgumentException
- if frameID < 0
or
if frameID > 255
.NullPointerException
- if localInterface == null
.public static UserDataRelayPacket createPacket(byte[] payload)
UserDataRelayPacket
object from the given payload.payload
- The API frame payload. It must start with the frame type
corresponding to a User Data Relay packet (0x2D
).
The byte array must be in OperatingMode.API
mode.IllegalArgumentException
- if payload[0] != APIFrameType.USER_DATA_RELAY.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 getDestinationInterface()
setDestinationInterface(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
- Data to send.getData()
public void setDestinationInterface(XBeeLocalInterface localInterface)
localInterface
- The new destination interface.NullPointerException
- if localInterface == null
.getDestinationInterface()
,
XBeeLocalInterface
© Copyright 2014 - 2024 Digi International Inc. All rights reserved.