public class UserDataRelayPacket extends XBeeAPIPacket
XBeeLocalInterface.UserDataRelayOutputPacket,
XBeeAPIPacketNO_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, setFrameIDequals, generateByteArray, generateByteArrayEscaped, getChecksum, getPacketLength, getParameters, hashCode, parsePacket, parsePacket, toPrettyString, toStringpublic 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()
XBeeAPIPacketpublic byte[] getAPIPacketSpecificData()
XBeeAPIPacketThis does not include the frame ID if it is needed.
public byte[] getData()
setData(byte[])public XBeeLocalInterface getDestinationInterface()
setDestinationInterface(XBeeLocalInterface),
XBeeLocalInterfacepublic boolean isBroadcast()
XBeeAPIPacketisBroadcast in class XBeeAPIPackettrue if the packet is a broadcast packet, false
otherwise.public boolean needsAPIFrameID()
XBeeAPIPacketneedsAPIFrameID in class XBeeAPIPackettrue 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 - 2019 Digi International Inc. All rights reserved.