SMSLib 3.5.3

org.smslib.modem.athandler
Class AATHandler

java.lang.Object
  extended by org.smslib.modem.athandler.AATHandler
Direct Known Subclasses:
ATHandler

public abstract class AATHandler
extends java.lang.Object


Constructor Summary
AATHandler(ModemGateway myGateway)
           
 
Method Summary
 void addStorageLocation(java.lang.String myStorageLocation)
           
abstract  boolean deleteMessage(int memIndex, java.lang.String memLocation)
           
abstract  void done()
           
abstract  void echoOff()
           
abstract  boolean enterPin(java.lang.String pin)
           
 int findMatchingTerminator(java.lang.String response)
          Look up a terminating string for a response from a buffer
abstract  java.lang.String formatUSSDResponse(java.lang.String ussdResponse)
           
abstract  java.lang.String getBatteryLevel()
           
 java.lang.String getDescription()
           
 ModemGateway getGateway()
           
abstract  java.lang.String getGprsStatus()
           
abstract  java.lang.String getImsi()
           
abstract  CNMIDetector getIndications()
           
abstract  java.lang.String getManufacturer()
           
abstract  java.lang.String getMessageByIndex(int msgIndex)
           
abstract  java.lang.String getModel()
           
abstract  java.lang.String getNetworkOperator()
           
abstract  java.lang.String getNetworkRegistration()
           
abstract  java.lang.String getSerialNo()
           
abstract  java.lang.String getSignalLevel()
           
abstract  java.lang.String getSimStatus()
           
 java.lang.String getStorageLocations()
           
abstract  java.lang.String getSwVersion()
           
 java.lang.String[] getTerminators()
           
 java.lang.String getUnsolicitedResponse(int index)
           
 java.lang.String[] getUnsolicitedResponses()
           
abstract  void init()
           
abstract  boolean isAlive()
           
 boolean isUnsolicitedResponse(int terminatorIndex)
          Determine whether a terminator index returned by findMatchingTerminator(String) is indicative of an unsolicited response from the modem
 boolean isUnsolicitedResponse(java.lang.String response)
          Convenience method to avoid having to call findMatchingTerminator(String) and isUnsolicitedResponse(int)
abstract  void keepLinkOpen()
           
abstract  java.lang.String listMessages(InboundMessage.MessageClasses messageClass)
           
static AATHandler load(ModemGateway gateway, java.lang.String gsmManuf, java.lang.String gsmModel)
           
 boolean matchesTerminator(java.lang.String response)
          Convenience method to determine if a response is a terminating response
abstract  AGateway.AsyncEvents processUnsolicitedEvents(java.lang.String response)
           
abstract  java.lang.String readPhonebook(java.lang.String location)
           
abstract  java.lang.String readPhonebookLocations()
           
abstract  void readStorageLocations()
           
abstract  void reset()
           
abstract  java.lang.String send(java.lang.String s)
           
abstract  java.lang.String sendCustomATCommand(java.lang.String atCommand)
           
abstract  int sendMessage(int size, java.lang.String pdu, java.lang.String phone, java.lang.String text)
           
abstract  java.lang.String sendUSSDCommand(java.lang.String ussdCommand)
           
abstract  java.lang.String sendUSSDCommand(java.lang.String ussdCommand, boolean interactive)
           
abstract  boolean sendUSSDRequest(java.lang.String presentation, java.lang.String content, java.lang.String dcs)
           
abstract  boolean setIndications()
           
abstract  boolean setPduProtocol()
           
 void setStorageLocations(java.lang.String myStorageLocations)
           
abstract  boolean setTextProtocol()
           
abstract  boolean setVerboseErrors()
           
abstract  boolean switchStorageLocation(java.lang.String mem)
           
abstract  void switchToCmdMode()
           
abstract  void sync()
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AATHandler

public AATHandler(ModemGateway myGateway)
Method Detail

getGateway

public ModemGateway getGateway()

getDescription

public java.lang.String getDescription()

getStorageLocations

public java.lang.String getStorageLocations()

setStorageLocations

public void setStorageLocations(java.lang.String myStorageLocations)

addStorageLocation

public void addStorageLocation(java.lang.String myStorageLocation)

getTerminators

public java.lang.String[] getTerminators()

getUnsolicitedResponses

public java.lang.String[] getUnsolicitedResponses()

getUnsolicitedResponse

public java.lang.String getUnsolicitedResponse(int index)

sync

public abstract void sync()
                   throws java.io.IOException,
                          java.lang.InterruptedException
Throws:
java.io.IOException
java.lang.InterruptedException

reset

public abstract void reset()
                    throws TimeoutException,
                           GatewayException,
                           java.io.IOException,
                           java.lang.InterruptedException
Throws:
TimeoutException
GatewayException
java.io.IOException
java.lang.InterruptedException

echoOff

public abstract void echoOff()
                      throws java.io.IOException,
                             java.lang.InterruptedException
Throws:
java.io.IOException
java.lang.InterruptedException

init

public abstract void init()
                   throws TimeoutException,
                          GatewayException,
                          java.io.IOException,
                          java.lang.InterruptedException
Throws:
TimeoutException
GatewayException
java.io.IOException
java.lang.InterruptedException

done

public abstract void done()
                   throws TimeoutException,
                          GatewayException,
                          java.io.IOException,
                          java.lang.InterruptedException
Throws:
TimeoutException
GatewayException
java.io.IOException
java.lang.InterruptedException

isAlive

public abstract boolean isAlive()
                         throws TimeoutException,
                                GatewayException,
                                java.io.IOException,
                                java.lang.InterruptedException
Throws:
TimeoutException
GatewayException
java.io.IOException
java.lang.InterruptedException

getSimStatus

public abstract java.lang.String getSimStatus()
                                       throws TimeoutException,
                                              GatewayException,
                                              java.io.IOException,
                                              java.lang.InterruptedException
Throws:
TimeoutException
GatewayException
java.io.IOException
java.lang.InterruptedException

enterPin

public abstract boolean enterPin(java.lang.String pin)
                          throws TimeoutException,
                                 GatewayException,
                                 java.io.IOException,
                                 java.lang.InterruptedException
Throws:
TimeoutException
GatewayException
java.io.IOException
java.lang.InterruptedException

setVerboseErrors

public abstract boolean setVerboseErrors()
                                  throws TimeoutException,
                                         GatewayException,
                                         java.io.IOException,
                                         java.lang.InterruptedException
Throws:
TimeoutException
GatewayException
java.io.IOException
java.lang.InterruptedException

setPduProtocol

public abstract boolean setPduProtocol()
                                throws TimeoutException,
                                       GatewayException,
                                       java.io.IOException,
                                       java.lang.InterruptedException
Throws:
TimeoutException
GatewayException
java.io.IOException
java.lang.InterruptedException

setTextProtocol

public abstract boolean setTextProtocol()
                                 throws TimeoutException,
                                        GatewayException,
                                        java.io.IOException,
                                        java.lang.InterruptedException
Throws:
TimeoutException
GatewayException
java.io.IOException
java.lang.InterruptedException

setIndications

public abstract boolean setIndications()
                                throws TimeoutException,
                                       GatewayException,
                                       java.io.IOException,
                                       java.lang.InterruptedException
Throws:
TimeoutException
GatewayException
java.io.IOException
java.lang.InterruptedException

getIndications

public abstract CNMIDetector getIndications()

getManufacturer

public abstract java.lang.String getManufacturer()
                                          throws TimeoutException,
                                                 GatewayException,
                                                 java.io.IOException,
                                                 java.lang.InterruptedException
Throws:
TimeoutException
GatewayException
java.io.IOException
java.lang.InterruptedException

getModel

public abstract java.lang.String getModel()
                                   throws TimeoutException,
                                          GatewayException,
                                          java.io.IOException,
                                          java.lang.InterruptedException
Throws:
TimeoutException
GatewayException
java.io.IOException
java.lang.InterruptedException

getSerialNo

public abstract java.lang.String getSerialNo()
                                      throws TimeoutException,
                                             GatewayException,
                                             java.io.IOException,
                                             java.lang.InterruptedException
Throws:
TimeoutException
GatewayException
java.io.IOException
java.lang.InterruptedException

getImsi

public abstract java.lang.String getImsi()
                                  throws TimeoutException,
                                         GatewayException,
                                         java.io.IOException,
                                         java.lang.InterruptedException
Throws:
TimeoutException
GatewayException
java.io.IOException
java.lang.InterruptedException

getSwVersion

public abstract java.lang.String getSwVersion()
                                       throws TimeoutException,
                                              GatewayException,
                                              java.io.IOException,
                                              java.lang.InterruptedException
Throws:
TimeoutException
GatewayException
java.io.IOException
java.lang.InterruptedException

getBatteryLevel

public abstract java.lang.String getBatteryLevel()
                                          throws TimeoutException,
                                                 GatewayException,
                                                 java.io.IOException,
                                                 java.lang.InterruptedException
Throws:
TimeoutException
GatewayException
java.io.IOException
java.lang.InterruptedException

getSignalLevel

public abstract java.lang.String getSignalLevel()
                                         throws TimeoutException,
                                                GatewayException,
                                                java.io.IOException,
                                                java.lang.InterruptedException
Throws:
TimeoutException
GatewayException
java.io.IOException
java.lang.InterruptedException

getNetworkOperator

public abstract java.lang.String getNetworkOperator()
                                             throws TimeoutException,
                                                    GatewayException,
                                                    java.io.IOException,
                                                    java.lang.InterruptedException
Throws:
TimeoutException
GatewayException
java.io.IOException
java.lang.InterruptedException

switchStorageLocation

public abstract boolean switchStorageLocation(java.lang.String mem)
                                       throws TimeoutException,
                                              GatewayException,
                                              java.io.IOException,
                                              java.lang.InterruptedException
Throws:
TimeoutException
GatewayException
java.io.IOException
java.lang.InterruptedException

switchToCmdMode

public abstract void switchToCmdMode()
                              throws TimeoutException,
                                     GatewayException,
                                     java.io.IOException,
                                     java.lang.InterruptedException
Throws:
TimeoutException
GatewayException
java.io.IOException
java.lang.InterruptedException

keepLinkOpen

public abstract void keepLinkOpen()
                           throws TimeoutException,
                                  GatewayException,
                                  java.io.IOException,
                                  java.lang.InterruptedException
Throws:
TimeoutException
GatewayException
java.io.IOException
java.lang.InterruptedException

sendMessage

public abstract int sendMessage(int size,
                                java.lang.String pdu,
                                java.lang.String phone,
                                java.lang.String text)
                         throws TimeoutException,
                                GatewayException,
                                java.io.IOException,
                                java.lang.InterruptedException
Throws:
TimeoutException
GatewayException
java.io.IOException
java.lang.InterruptedException

listMessages

public abstract java.lang.String listMessages(InboundMessage.MessageClasses messageClass)
                                       throws TimeoutException,
                                              GatewayException,
                                              java.io.IOException,
                                              java.lang.InterruptedException
Throws:
TimeoutException
GatewayException
java.io.IOException
java.lang.InterruptedException

getMessageByIndex

public abstract java.lang.String getMessageByIndex(int msgIndex)
                                            throws TimeoutException,
                                                   GatewayException,
                                                   java.io.IOException,
                                                   java.lang.InterruptedException
Throws:
TimeoutException
GatewayException
java.io.IOException
java.lang.InterruptedException

deleteMessage

public abstract boolean deleteMessage(int memIndex,
                                      java.lang.String memLocation)
                               throws TimeoutException,
                                      GatewayException,
                                      java.io.IOException,
                                      java.lang.InterruptedException
Throws:
TimeoutException
GatewayException
java.io.IOException
java.lang.InterruptedException

getGprsStatus

public abstract java.lang.String getGprsStatus()
                                        throws TimeoutException,
                                               GatewayException,
                                               java.io.IOException,
                                               java.lang.InterruptedException
Throws:
TimeoutException
GatewayException
java.io.IOException
java.lang.InterruptedException

send

public abstract java.lang.String send(java.lang.String s)
                               throws TimeoutException,
                                      GatewayException,
                                      java.io.IOException,
                                      java.lang.InterruptedException
Throws:
TimeoutException
GatewayException
java.io.IOException
java.lang.InterruptedException

getNetworkRegistration

public abstract java.lang.String getNetworkRegistration()
                                                 throws GatewayException,
                                                        TimeoutException,
                                                        java.io.IOException,
                                                        java.lang.InterruptedException
Throws:
GatewayException
TimeoutException
java.io.IOException
java.lang.InterruptedException

readStorageLocations

public abstract void readStorageLocations()
                                   throws java.lang.Exception
Throws:
java.lang.Exception

sendCustomATCommand

public abstract java.lang.String sendCustomATCommand(java.lang.String atCommand)
                                              throws GatewayException,
                                                     TimeoutException,
                                                     java.io.IOException,
                                                     java.lang.InterruptedException
Throws:
GatewayException
TimeoutException
java.io.IOException
java.lang.InterruptedException

sendUSSDCommand

public abstract java.lang.String sendUSSDCommand(java.lang.String ussdCommand)
                                          throws GatewayException,
                                                 TimeoutException,
                                                 java.io.IOException,
                                                 java.lang.InterruptedException
Throws:
GatewayException
TimeoutException
java.io.IOException
java.lang.InterruptedException

sendUSSDCommand

public abstract java.lang.String sendUSSDCommand(java.lang.String ussdCommand,
                                                 boolean interactive)
                                          throws GatewayException,
                                                 TimeoutException,
                                                 java.io.IOException,
                                                 java.lang.InterruptedException
Throws:
GatewayException
TimeoutException
java.io.IOException
java.lang.InterruptedException

sendUSSDRequest

public abstract boolean sendUSSDRequest(java.lang.String presentation,
                                        java.lang.String content,
                                        java.lang.String dcs)
                                 throws GatewayException,
                                        TimeoutException,
                                        java.io.IOException,
                                        java.lang.InterruptedException
Throws:
GatewayException
TimeoutException
java.io.IOException
java.lang.InterruptedException

formatUSSDResponse

public abstract java.lang.String formatUSSDResponse(java.lang.String ussdResponse)

readPhonebookLocations

public abstract java.lang.String readPhonebookLocations()
                                                 throws GatewayException,
                                                        TimeoutException,
                                                        java.io.IOException,
                                                        java.lang.InterruptedException
Throws:
GatewayException
TimeoutException
java.io.IOException
java.lang.InterruptedException

readPhonebook

public abstract java.lang.String readPhonebook(java.lang.String location)
                                        throws GatewayException,
                                               TimeoutException,
                                               java.io.IOException
Throws:
GatewayException
TimeoutException
java.io.IOException

processUnsolicitedEvents

public abstract AGateway.AsyncEvents processUnsolicitedEvents(java.lang.String response)
                                                       throws java.io.IOException
Throws:
java.io.IOException

load

public static AATHandler load(ModemGateway gateway,
                              java.lang.String gsmManuf,
                              java.lang.String gsmModel)
                       throws java.lang.RuntimeException
Throws:
java.lang.RuntimeException

findMatchingTerminator

public int findMatchingTerminator(java.lang.String response)
Look up a terminating string for a response from a buffer

Parameters:
response -
Returns:
negative = no match, otherwise match

isUnsolicitedResponse

public boolean isUnsolicitedResponse(int terminatorIndex)
Determine whether a terminator index returned by findMatchingTerminator(String) is indicative of an unsolicited response from the modem

Parameters:
terminatorIndex - Index returned by findMatchingTerminator(String)
Returns:
True if terminatorIndex indicates an unsolicited response

isUnsolicitedResponse

public boolean isUnsolicitedResponse(java.lang.String response)
Convenience method to avoid having to call findMatchingTerminator(String) and isUnsolicitedResponse(int)

Parameters:
response -
Returns:
True if response is an unsolicited response

matchesTerminator

public boolean matchesTerminator(java.lang.String response)
Convenience method to determine if a response is a terminating response

Parameters:
response -
Returns:
True if a terminating response

SMSLib 3.5.3

(c) 2002-2011, http://smslib.org