com.rapplogic.xbee.api
Class XBeePacket
java.lang.Object
com.rapplogic.xbee.api.XBeePacket
public class XBeePacket
- extends java.lang.Object
Packages a frame data array into an XBee packet.
- Author:
- andrew
Constructor Summary |
XBeePacket(int[] frameData)
Performs the necessary activities to construct an XBee packet from the frame data. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
XBeePacket
public XBeePacket(int[] frameData)
- Performs the necessary activities to construct an XBee packet from the frame data.
This includes: computing the checksum, escaping the necessary bytes, adding the start byte and length bytes.
The format of a packet is as follows:
start byte - msb length byte - lsb length byte - frame data - checksum byte
- Parameters:
frameData
-
getPacket
public int[] getPacket()
- Deprecated. use getByteArray
- Returns:
getByteArray
public int[] getByteArray()
isSpecialByte
public static boolean isSpecialByte(int b)
toString
public java.lang.String toString()
- Overrides:
toString
in class java.lang.Object
verify
public static boolean verify(int[] packet)
- Returns true if the packet is valid
- Parameters:
packet
-
- Returns:
unEscapePacket
public static int[] unEscapePacket(int[] packet)
- Parameters:
packet
-
- Returns: