com.rapplogic.xbee.api
Class XBeePacket

java.lang.Object
  extended by com.rapplogic.xbee.api.XBeePacket

public class XBeePacket
extends java.lang.Object

Packages a frame data array into an XBee packet.

Author:
andrew

Nested Class Summary
static class XBeePacket.SpecialByte
           
 
Constructor Summary
XBeePacket(int[] frameData)
          Performs the necessary activities to construct an XBee packet from the frame data.
 
Method Summary
 int[] getByteArray()
           
 int[] getPacket()
          Deprecated. use getByteArray
static boolean isSpecialByte(int b)
           
 java.lang.String toString()
           
static int[] unEscapePacket(int[] packet)
           
static boolean verify(int[] packet)
          Returns true if the packet is valid
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

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 -
Method Detail

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: