stamp.peripheral
Class ModemInterface
java.lang.Object
|
+--stamp.peripheral.ModemInterface
- public class ModemInterface
- extends Object
Generic modem interface with AT command set.
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. |
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
ModemInterface
public ModemInterface(int txPin,
int rxPin,
int txhspin,
int rxhspin,
int speed)
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)