edu.uiuc.cs.seclab.modem.xbee
Class XBeeRxPacketImpl

java.lang.Object
  extended by edu.uiuc.cs.seclab.modem.xbee.XBeeApiPacketImpl
      extended by edu.uiuc.cs.seclab.modem.xbee.XBeeRxPacketImpl

public class XBeeRxPacketImpl
extends XBeeApiPacketImpl

Received packet


Field Summary
protected  XBeeAddress addr
           
static byte CMD_ADDR16_ID
           
static byte CMD_ADDR64_ID
           
static byte CMD_ZIGBEE_ID
           
protected  java.lang.String data
           
protected  byte options
           
protected  byte rssi
           
static byte RXOPT_ZB_ACKED
           
static byte RXOPT_ZB_BCAST
           
protected  XBee16Address shortAddr
           
 
Constructor Summary
XBeeRxPacketImpl()
           
XBeeRxPacketImpl(XBee64Address longAddr_, XBee16Address shortAddr_, byte options_, java.lang.String data_)
           
XBeeRxPacketImpl(XBeeAddress addr_, byte rssi_, byte i, java.lang.String string)
           
 
Method Summary
 void acceptVisitor(XBeeApiPacketVisitor visitor)
           
 byte getCmdId()
           
 byte getRssi()
          RSSI in -dBm (not supported on ZigBee)
 java.lang.String getRxData()
           
 XBee16Address getShortSrcAddr()
          Return the short source address if this is a ZigBee packet
 XBeeAddress getSrcAddr()
          Return the source address (long or short if 802.15.4, long if ZigBee)
 boolean isZbAcked()
          Return true if this is a ZigBee packet and was acked
 boolean isZbBcast()
          Return true if this is a broadcast ZigBee packet
protected  void localGetData(java.lang.StringBuilder sb)
          Produce a data blob for the inner part of an API packet
 void parse(byte cmdId, byte[] bytes, int offset, int len)
          Parse the inner part of an API packet
 java.lang.String toString()
           
 
Methods inherited from class edu.uiuc.cs.seclab.modem.xbee.XBeeApiPacketImpl
getData
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

addr

protected XBeeAddress addr

CMD_ADDR16_ID

public static final byte CMD_ADDR16_ID
See Also:
Constant Field Values

CMD_ADDR64_ID

public static final byte CMD_ADDR64_ID
See Also:
Constant Field Values

CMD_ZIGBEE_ID

public static final byte CMD_ZIGBEE_ID
See Also:
Constant Field Values

data

protected java.lang.String data

options

protected byte options

rssi

protected byte rssi

RXOPT_ZB_ACKED

public static final byte RXOPT_ZB_ACKED
See Also:
Constant Field Values

RXOPT_ZB_BCAST

public static final byte RXOPT_ZB_BCAST
See Also:
Constant Field Values

shortAddr

protected XBee16Address shortAddr
Constructor Detail

XBeeRxPacketImpl

public XBeeRxPacketImpl()

XBeeRxPacketImpl

public XBeeRxPacketImpl(XBee64Address longAddr_,
                        XBee16Address shortAddr_,
                        byte options_,
                        java.lang.String data_)
                 throws ModemException
Throws:
ModemException

XBeeRxPacketImpl

public XBeeRxPacketImpl(XBeeAddress addr_,
                        byte rssi_,
                        byte i,
                        java.lang.String string)
                 throws ModemException
Throws:
ModemException
Method Detail

acceptVisitor

public void acceptVisitor(XBeeApiPacketVisitor visitor)
Specified by:
acceptVisitor in class XBeeApiPacketImpl

getCmdId

public byte getCmdId()
Specified by:
getCmdId in class XBeeApiPacketImpl

getRssi

public byte getRssi()
RSSI in -dBm (not supported on ZigBee)


getRxData

public java.lang.String getRxData()

getShortSrcAddr

public XBee16Address getShortSrcAddr()
Return the short source address if this is a ZigBee packet

Returns:

getSrcAddr

public XBeeAddress getSrcAddr()
Return the source address (long or short if 802.15.4, long if ZigBee)

Returns:

isZbAcked

public boolean isZbAcked()
Return true if this is a ZigBee packet and was acked

Returns:

isZbBcast

public boolean isZbBcast()
Return true if this is a broadcast ZigBee packet

Returns:

localGetData

protected void localGetData(java.lang.StringBuilder sb)
Description copied from class: XBeeApiPacketImpl
Produce a data blob for the inner part of an API packet

Specified by:
localGetData in class XBeeApiPacketImpl

parse

public void parse(byte cmdId,
                  byte[] bytes,
                  int offset,
                  int len)
           throws ModemException
Description copied from class: XBeeApiPacketImpl
Parse the inner part of an API packet

Specified by:
parse in class XBeeApiPacketImpl
Throws:
ModemException

toString

public java.lang.String toString()
Overrides:
toString in class XBeeApiPacketImpl