stamp.peripheral
Class ModemInterface

java.lang.Object
  |
  +--stamp.peripheral.ModemInterface

public class ModemInterface
extends Object

Generic modem interface with AT command set.


Field Summary
static int RESULT_BUSY
           
static int RESULT_CONNECT
           
static int RESULT_ERROR
           
static int RESULT_NO_CARRIER
           
static int RESULT_NO_DIALTONE
           
static int RESULT_NOANSWER
           
static int RESULT_OK
           
static int RESULT_RING
           
 Uart rxUart
           
 boolean status
           
 Uart txUart
           
 
Constructor Summary
ModemInterface(int txPin, int rxPin, int txhspin, int rxhspin, int speed)
           
 
Method Summary
 boolean login(String loginPrompt, String login, String password, String pwprompt, int loginTimeout)
           
 boolean login(String loginPrompt, String login, String password, String pwprompt, String cmdprompt, String command, int loginTimeout)
           
 int sendCommand(String command)
          Send an AT command to the modem.
 int sendDial(String prefix, String number)
          Send an AT prefix and dial string to the modem.
 
Methods inherited from class java.lang.Object
equals
 

Field Detail

RESULT_OK

public static final int RESULT_OK

RESULT_CONNECT

public static final int RESULT_CONNECT

RESULT_RING

public static final int RESULT_RING

RESULT_NO_CARRIER

public static final int RESULT_NO_CARRIER

RESULT_ERROR

public static final int RESULT_ERROR

RESULT_NO_DIALTONE

public static final int RESULT_NO_DIALTONE

RESULT_BUSY

public static final int RESULT_BUSY

RESULT_NOANSWER

public static final int RESULT_NOANSWER

txUart

public Uart txUart

rxUart

public Uart rxUart

status

public boolean status
Constructor Detail

ModemInterface

public ModemInterface(int txPin,
                      int rxPin,
                      int txhspin,
                      int rxhspin,
                      int speed)
Method Detail

sendCommand

public int sendCommand(String command)
Send an AT command to the modem.
Returns:
result code from the modem.

sendDial

public int sendDial(String prefix,
                    String number)
Send an AT prefix and dial string to the modem.
Returns:
result code from the modem.

login

public boolean login(String loginPrompt,
                     String login,
                     String password,
                     String pwprompt,
                     int loginTimeout)

login

public boolean login(String loginPrompt,
                     String login,
                     String password,
                     String pwprompt,
                     String cmdprompt,
                     String command,
                     int loginTimeout)