|
SMSLib 3.5.3 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.smslib.AGateway
org.smslib.modem.ModemGateway
public class ModemGateway
Class representing GSM modems or phones. Extends AGateway with modem specific operations.
Nested Class Summary | |
---|---|
static class |
ModemGateway.IPProtocols
|
static class |
ModemGateway.ModemTypes
Class representing different types of GSM modems / phones. |
Nested classes/interfaces inherited from class org.smslib.AGateway |
---|
AGateway.AsyncEvents, AGateway.GatewayAttributes, AGateway.GatewayStatuses, AGateway.Protocols |
Constructor Summary | |
---|---|
ModemGateway(ModemGateway.ModemTypes myType,
java.lang.String id,
java.lang.String myModemDevice,
int myModemParms,
java.lang.String myManufacturer,
java.lang.String myModel)
|
|
ModemGateway(java.lang.String id,
java.lang.String myModemDevice,
int myModemParms,
java.lang.String myManufacturer,
java.lang.String myModel,
AModemDriver myDriver)
|
Method Summary | |
---|---|
boolean |
deleteMessage(InboundMessage msg)
|
AATHandler |
getATHandler()
|
int |
getBatteryLevel()
Returns the battery level (0-100). |
java.lang.String |
getCustomInitString()
Returns the custom modem init string (if any). |
java.lang.String |
getImsi()
Returns the IMSI (International Mobile Subscriber Identity) number. |
boolean |
getIpEncryption()
Check if the encryption of IP modem transmission is enabled |
ModemGateway.IPProtocols |
getIpProtocol()
|
java.lang.String |
getManufacturer()
Returns the Manufacturer string of the modem or phone. |
java.lang.String |
getMessageByIndex(int msgIndex)
|
java.lang.String |
getModel()
Returns the Model string. |
AModemDriver |
getModemDriver()
|
int |
getQueueSchedulingInterval()
Returns the Gateway Queue sending internal (in milliseconds). |
java.lang.String |
getSerialNo()
Returns the Serial Number of the modem. |
int |
getSignalLevel()
Returns the signal level (RSSI). |
java.lang.String |
getSimPin()
Returns the SIM PIN. |
java.lang.String |
getSimPin2()
Returns the SIM PIN 2. |
java.lang.String |
getSmscNumber()
Returns the SMSC number used by SMSLib. |
java.lang.String |
getSwVersion()
Returns the modem's firmware version. |
InboundMessage |
readMessage(java.lang.String memLoc,
int memIndex)
|
void |
readMessages(java.util.Collection<InboundMessage> msgList,
InboundMessage.MessageClasses msgClass)
|
int |
readPhonebook(Phonebook phonebook)
|
java.lang.String |
sendCustomATCommand(java.lang.String atCommand)
Send a custom AT command to the modem and returns the response received. |
boolean |
sendMessage(OutboundMessage msg)
|
java.lang.String |
sendUSSDCommand(java.lang.String ussdCommand)
Send an Unstructured Supplementary Service Data command. |
java.lang.String |
sendUSSDCommand(java.lang.String ussdCommand,
boolean interactive)
Send an Unstructured Supplementary Service Data command. |
boolean |
sendUSSDRequest(USSDRequest request)
|
void |
setCustomInitString(java.lang.String myCustomInitString)
Sets the custom modem init string. |
void |
setDisplayIllegalReceivedMessages(boolean b)
|
void |
setIpEncryption(boolean ipEncryption)
Set the IP modem transmission encryption status |
void |
setIpProtocol(ModemGateway.IPProtocols myIpProtocol)
|
void |
setSimPin(java.lang.String mySimPin)
Sets the SIM PIN. |
void |
setSimPin2(java.lang.String mySimPin2)
Sets the SIM PIN 2. |
void |
setSmscNumber(java.lang.String mySmscNumber)
Sets the SMSC number used by SMSLib. |
void |
startGateway()
|
void |
stopGateway()
|
Methods inherited from class org.smslib.AGateway |
---|
getAttributes, getDeliveryErrorCode, getFrom, getGatewayId, getInboundMessageCount, getMyself, getOutboundMessageCount, getProtocol, getRestartCount, getStatus, incInboundMessageCount, incOutboundMessageCount, isInbound, isOutbound, queryBalance, queryCoverage, queryMessage, queryMessage, sendMessages, setAttributes, setDeliveryErrorCode, setFrom, setInbound, setOutbound, setProtocol, setStatus |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ModemGateway(ModemGateway.ModemTypes myType, java.lang.String id, java.lang.String myModemDevice, int myModemParms, java.lang.String myManufacturer, java.lang.String myModel)
public ModemGateway(java.lang.String id, java.lang.String myModemDevice, int myModemParms, java.lang.String myManufacturer, java.lang.String myModel, AModemDriver myDriver)
Method Detail |
---|
public void setIpProtocol(ModemGateway.IPProtocols myIpProtocol)
public ModemGateway.IPProtocols getIpProtocol()
public void setIpEncryption(boolean ipEncryption)
ipEncryption
- the status of encryptionpublic boolean getIpEncryption()
public void startGateway() throws TimeoutException, GatewayException, java.io.IOException, java.lang.InterruptedException
startGateway
in class AGateway
TimeoutException
GatewayException
java.io.IOException
java.lang.InterruptedException
public void stopGateway() throws TimeoutException, GatewayException, java.io.IOException, java.lang.InterruptedException
stopGateway
in class AGateway
TimeoutException
GatewayException
java.io.IOException
java.lang.InterruptedException
public void readMessages(java.util.Collection<InboundMessage> msgList, InboundMessage.MessageClasses msgClass) throws TimeoutException, GatewayException, java.io.IOException, java.lang.InterruptedException
readMessages
in class AGateway
TimeoutException
GatewayException
java.io.IOException
java.lang.InterruptedException
public InboundMessage readMessage(java.lang.String memLoc, int memIndex) throws TimeoutException, GatewayException, java.io.IOException, java.lang.InterruptedException
readMessage
in class AGateway
TimeoutException
GatewayException
java.io.IOException
java.lang.InterruptedException
public boolean sendMessage(OutboundMessage msg) throws TimeoutException, GatewayException, java.io.IOException, java.lang.InterruptedException
sendMessage
in class AGateway
TimeoutException
GatewayException
java.io.IOException
java.lang.InterruptedException
public boolean deleteMessage(InboundMessage msg) throws TimeoutException, GatewayException, java.io.IOException, java.lang.InterruptedException
deleteMessage
in class AGateway
TimeoutException
GatewayException
java.io.IOException
java.lang.InterruptedException
public int readPhonebook(Phonebook phonebook) throws TimeoutException, GatewayException, java.io.IOException, java.lang.InterruptedException
readPhonebook
in class AGateway
TimeoutException
GatewayException
java.io.IOException
java.lang.InterruptedException
public void setDisplayIllegalReceivedMessages(boolean b)
public java.lang.String getMessageByIndex(int msgIndex) throws TimeoutException, GatewayException, java.io.IOException, java.lang.InterruptedException
TimeoutException
GatewayException
java.io.IOException
java.lang.InterruptedException
public void setSimPin(java.lang.String mySimPin)
mySimPin
- The SIM PIN.public void setSimPin2(java.lang.String mySimPin2)
mySimPin2
- The SIM PIN 2.public java.lang.String getSimPin()
public java.lang.String getSimPin2()
public AModemDriver getModemDriver()
public AATHandler getATHandler()
public java.lang.String getManufacturer() throws TimeoutException, GatewayException, java.io.IOException, java.lang.InterruptedException
TimeoutException
- The gateway did not respond in a timely manner.
GatewayException
- A Gateway error occurred.
java.io.IOException
- An IO error occurred.
java.lang.InterruptedException
- The call was interrupted.public java.lang.String getModel() throws TimeoutException, GatewayException, java.io.IOException, java.lang.InterruptedException
TimeoutException
- The gateway did not respond in a timely manner.
GatewayException
- A Gateway error occurred.
java.io.IOException
- An IO error occurred.
java.lang.InterruptedException
- The call was interrupted.public java.lang.String getSerialNo() throws TimeoutException, GatewayException, java.io.IOException, java.lang.InterruptedException
TimeoutException
- The gateway did not respond in a timely manner.
GatewayException
- A Gateway error occurred.
java.io.IOException
- An IO error occurred.
java.lang.InterruptedException
- The call was interrupted.public java.lang.String getImsi() throws TimeoutException, GatewayException, java.io.IOException, java.lang.InterruptedException
This number is stored in the SIM. Since this number may be used for several illegal activities, the method is remarked. If you wish to see your IMSI, just uncomment the method.
TimeoutException
- The gateway did not respond in a timely manner.
GatewayException
- A Gateway error occurred.
java.io.IOException
- An IO error occurred.
java.lang.InterruptedException
- The call was interrupted.public java.lang.String getSwVersion() throws TimeoutException, GatewayException, java.io.IOException, java.lang.InterruptedException
TimeoutException
- The gateway did not respond in a timely manner.
GatewayException
- A Gateway error occurred.
java.io.IOException
- An IO error occurred.
java.lang.InterruptedException
- The call was interrupted.public int getBatteryLevel() throws TimeoutException, GatewayException, java.io.IOException, java.lang.InterruptedException
TimeoutException
- The gateway did not respond in a timely manner.
GatewayException
- A Gateway error occurred.
java.io.IOException
- An IO error occurred.
java.lang.InterruptedException
- The call was interrupted.public int getSignalLevel() throws TimeoutException, GatewayException, java.io.IOException, java.lang.InterruptedException
TimeoutException
- The gateway did not respond in a timely manner.
GatewayException
- A Gateway error occurred.
java.io.IOException
- An IO error occurred.
java.lang.InterruptedException
- The call was interrupted.public java.lang.String getSmscNumber()
setSmscNumber(String)
public void setSmscNumber(java.lang.String mySmscNumber)
Note that in most cases, you will not need to call this method, as the modem knows the SMSC it should use by reading the SIM card. In rare cases when the modem/phone cannot read the SMSC from the SIM card or you would like to set a different SMSC than the default, you can use this method.
mySmscNumber
- The SMSC number used from now on.public java.lang.String getCustomInitString()
setCustomInitString(String)
public void setCustomInitString(java.lang.String myCustomInitString)
myCustomInitString
- The custom init string.getCustomInitString()
public java.lang.String sendCustomATCommand(java.lang.String atCommand) throws GatewayException, TimeoutException, java.io.IOException, java.lang.InterruptedException
atCommand
- The AT Command.
TimeoutException
- The gateway did not respond in a timely manner.
GatewayException
- A Gateway error occurred.
java.io.IOException
- An IO error occurred.
java.lang.InterruptedException
- The call was interrupted.public java.lang.String sendUSSDCommand(java.lang.String ussdCommand) throws GatewayException, TimeoutException, java.io.IOException, java.lang.InterruptedException
sendUSSDCommand
in class AGateway
ussdCommand
- the USSD command to send
GatewayException
TimeoutException
java.io.IOException
java.lang.InterruptedException
public java.lang.String sendUSSDCommand(java.lang.String ussdCommand, boolean interactive) throws GatewayException, TimeoutException, java.io.IOException, java.lang.InterruptedException
sendUSSDCommand
in class AGateway
ussdCommand
- the USSD command to sendinteractive
- whether the USSD session should be left open
GatewayException
TimeoutException
java.io.IOException
java.lang.InterruptedException
public boolean sendUSSDRequest(USSDRequest request) throws GatewayException, TimeoutException, java.io.IOException, java.lang.InterruptedException
sendUSSDRequest
in class AGateway
GatewayException
TimeoutException
java.io.IOException
java.lang.InterruptedException
public int getQueueSchedulingInterval()
AGateway
getQueueSchedulingInterval
in class AGateway
|
SMSLib 3.5.3 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |