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

java.lang.Object
  extended by edu.uiuc.cs.seclab.modem.xbee.XBeeAtCmd
Direct Known Subclasses:
XBeeParamCmd, XBeeSpecialCmd

public abstract class XBeeAtCmd
extends java.lang.Object

Abstract AT command for XBee modem. Used to get and set parameter registers within modem, and perform special functions like scanning for channels and checking the firmware version.


Nested Class Summary
static class XBeeAtCmd.Mode
          Specifies what mode should be used to execute command.
 
Constructor Summary
XBeeAtCmd()
           
 
Method Summary
protected abstract  java.lang.String getApiParams()
          Convert the parameters associated with this command to a binary API-format buffer suitable for transmission to the modem.
abstract  java.lang.String getAtCmd()
          Get the two-character AT code associated with this command.
 XBeeAtPacketImpl getPktImpl(XBeeAtCmd.Mode mode, byte frameId)
          Generate low-level packet data corresponding to this command operating in the specified mode.
abstract  java.lang.String getShortDesc()
          Return a short (one-line) description for command suitable for display in parameter table.
 long processResp(XBeeAtRespPacketImpl impl, XBeeAtCmd.Mode mode)
          Process a response to an AT command and return a bound in milliseconds on when all expected responses will be received.
abstract  java.lang.Object unmarshalRespParams(java.lang.String params)
          Unmarshal the parameters returned from API command
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

XBeeAtCmd

public XBeeAtCmd()
Method Detail

getApiParams

protected abstract java.lang.String getApiParams()
                                          throws ModemException
Convert the parameters associated with this command to a binary API-format buffer suitable for transmission to the modem.

Throws:
ModemException

getAtCmd

public abstract java.lang.String getAtCmd()
Get the two-character AT code associated with this command.


getPktImpl

public XBeeAtPacketImpl getPktImpl(XBeeAtCmd.Mode mode,
                                   byte frameId)
                            throws ModemException
Generate low-level packet data corresponding to this command operating in the specified mode.

Throws:
ModemException

getShortDesc

public abstract java.lang.String getShortDesc()
Return a short (one-line) description for command suitable for display in parameter table.


processResp

public long processResp(XBeeAtRespPacketImpl impl,
                        XBeeAtCmd.Mode mode)
                 throws ModemException
Process a response to an AT command and return a bound in milliseconds on when all expected responses will be received. Most commands only accept a single response, so we return 0 by default, indicating that processing has completed. Should be overridden in subclasses that expect multiple responses.

Throws:
ModemException

unmarshalRespParams

public abstract java.lang.Object unmarshalRespParams(java.lang.String params)
                                              throws ModemException
Unmarshal the parameters returned from API command

Throws:
ModemException