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

java.lang.Object
  extended by edu.uiuc.cs.seclab.modem.xbee.XBeeTxn
Direct Known Subclasses:
XBeeAtCmdTxn, XBeeTxTxn

public abstract class XBeeTxn
extends java.lang.Object

XBee modem transaction. Currently supports AT commands and transmission requests.


Nested Class Summary
protected  class XBeeTxn.RespTimer
           
 
Field Summary
protected  boolean completed
           
protected  long endTm
           
protected  byte frameId
           
protected  long startTm
           
protected  XBeeTxn.RespTimer timer
           
 
Constructor Summary
XBeeTxn()
           
 
Method Summary
abstract  void addResp(XBeeTxStatPktImpl resp)
           
protected  void completeTxnImmed()
           
abstract  int exec(XBeeModem mdm)
          Execute this transaction on the provided modem.
 long getDuration()
           
 byte getFrameId()
           
 boolean isCompleted()
           
 void setFrameId(byte id)
           
 java.lang.String toString()
           
 boolean waitForCompletion(long toutMs)
          Wait until transaction completes, or until toutMs milliseconds have elapsed.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

completed

protected boolean completed

endTm

protected long endTm

frameId

protected byte frameId

startTm

protected long startTm

timer

protected XBeeTxn.RespTimer timer
Constructor Detail

XBeeTxn

public XBeeTxn()
Method Detail

addResp

public abstract void addResp(XBeeTxStatPktImpl resp)
                      throws ModemException
Throws:
ModemException

completeTxnImmed

protected void completeTxnImmed()

exec

public abstract int exec(XBeeModem mdm)
                  throws ModemException
Execute this transaction on the provided modem.

Throws:
ModemException

getDuration

public long getDuration()

getFrameId

public byte getFrameId()

isCompleted

public boolean isCompleted()

setFrameId

public void setFrameId(byte id)

toString

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

waitForCompletion

public boolean waitForCompletion(long toutMs)
Wait until transaction completes, or until toutMs milliseconds have elapsed.

Returns:
true if completed.