com.esf.device.modem.service
Interface IModemService

All Superinterfaces:
IBasicCellularModemService, ICellularModemService, IUsbModemService
All Known Subinterfaces:
I3gModemService, IEvdoModemService, IMC572xModemService

public interface IModemService
extends IUsbModemService, ICellularModemService

Defines generic modem service

Author:
ilya.binshtok

Field Summary
static java.lang.String NEW_CONFIGURATION_TOPIC
          Deprecated. Modem driver publishes EventAdmin Event on this topic after it receives and processes new configuration event from configuration manager. This event to be picked up by application (business logic) code to make a decision whether to restart modem connection.
static java.lang.String SERVICE_NAME
          service name of this interface for the bundle activator (com.esf.device.modem.service.IModemService)
 
Method Summary
 void applyNewConfiguration(java.util.Properties prop)
          service name of this interface for the bundle activator (com.arcom.zywan.device.modem.service.IModemService)
 void connect()
          Establishes connection with service provider by starting PPP session
 void disconnect()
          Terminates connection with service provider by stopping PPP session
 long getCallRxCounter()
          Reports number of bytes received during a call
 long getCallTxCounter()
          Reports number of bytes tarnsmitted during a call
 java.lang.String getIPaddress()
          Reports IP address assigned to cellular interface
 java.lang.String getNetworkTechnology()
          Reports network technology (e.g.
 java.lang.String getPeerIPaddress()
          Reports IP address of the peer
 java.lang.String getPowerMode()
          Answers modem's power mode.
 java.lang.String getServiceType()
          Reports Service Type
 int getSignalStrength()
          Reports signal strength in dBm
 boolean isConfigured()
          States whether a configuration has been supplied for this modem
 boolean isConnected()
          Answers if connection to the service provider is established
 boolean isConnecting()
          Reports if modem connection is in progress
 boolean isRoaming()
          Reports roaming status
 ModemConfiguration provideConfiguration()
          Provides current modem configuration
 void reset()
          resets the modem and tries to restore the state of the modem driver.
 void sendSms(java.lang.String recipientNumber, java.lang.String smscNumber, java.lang.String message)
          Sends an SMS to the specified recipient via the specified provider SMSC number
 void turnOff()
          Turns modem off
 void turnOn()
          Turns modem on
 
Methods inherited from interface com.esf.device.modem.service.IUsbModemService
getProductID, getUsbPortAddress, getVendorID
 
Methods inherited from interface com.esf.device.modem.service.ICellularModemService
getConnectionInfo, isEnabledInConfiguration
 
Methods inherited from interface com.esf.device.modem.service.IBasicCellularModemService
allowConnect, disable, enable, getManufacturer, getModel, getRevisionID, getSerialNumber, isConnectAllowed, isEnabled, isOn
 

Field Detail

SERVICE_NAME

static final java.lang.String SERVICE_NAME
service name of this interface for the bundle activator (com.esf.device.modem.service.IModemService)


NEW_CONFIGURATION_TOPIC

static final java.lang.String NEW_CONFIGURATION_TOPIC
Deprecated. Modem driver publishes EventAdmin Event on this topic after it receives and processes new configuration event from configuration manager. This event to be picked up by application (business logic) code to make a decision whether to restart modem connection.
See Also:
Constant Field Values
Method Detail

provideConfiguration

ModemConfiguration provideConfiguration()
                                        throws java.lang.Exception
Provides current modem configuration

Specified by:
provideConfiguration in interface ICellularModemService
Returns:
current configuration as ModemConfiguration
Throws:
java.lang.Exception

applyNewConfiguration

void applyNewConfiguration(java.util.Properties prop)
                           throws java.lang.Exception
Description copied from interface: ICellularModemService
service name of this interface for the bundle activator (com.arcom.zywan.device.modem.service.IModemService)

Specified by:
applyNewConfiguration in interface ICellularModemService
Throws:
java.lang.Exception

getNetworkTechnology

java.lang.String getNetworkTechnology()
Reports network technology (e.g. evdo, 3g)

Specified by:
getNetworkTechnology in interface ICellularModemService
Returns:
- network technology as String

turnOn

void turnOn()
            throws java.lang.Exception
Turns modem on

Specified by:
turnOn in interface ICellularModemService
Throws:
java.lang.Exception

turnOff

void turnOff()
             throws java.lang.Exception
Turns modem off

Specified by:
turnOff in interface ICellularModemService
Throws:
java.lang.Exception

reset

void reset()
           throws java.lang.Exception
resets the modem and tries to restore the state of the modem driver. (e.g. PPP connection, status thread)

Specified by:
reset in interface ICellularModemService
Throws:
java.lang.Exception

connect

void connect()
             throws java.lang.Exception
Establishes connection with service provider by starting PPP session

Specified by:
connect in interface ICellularModemService
Throws:
java.lang.Exception

disconnect

void disconnect()
                throws java.lang.Exception
Terminates connection with service provider by stopping PPP session

Specified by:
disconnect in interface ICellularModemService
Throws:
java.lang.Exception

isConnected

boolean isConnected()
                    throws java.lang.Exception
Answers if connection to the service provider is established

Specified by:
isConnected in interface ICellularModemService
Returns:
boolean
true - connection is established
false - connection is not established
Throws:
java.lang.Exception

isConnecting

boolean isConnecting()
                     throws java.lang.Exception
Reports if modem connection is in progress

Specified by:
isConnecting in interface ICellularModemService
Returns:
boolean
true - modem connection is in progress
false - modem is not connecting
Throws:
java.lang.Exception

getPowerMode

java.lang.String getPowerMode()
                              throws java.lang.Exception
Answers modem's power mode. (e.g. ONLINE, OFFLINE, LPM)

Specified by:
getPowerMode in interface ICellularModemService
Returns:
modem power mode
Throws:
java.lang.Exception

getIPaddress

java.lang.String getIPaddress()
                              throws java.lang.Exception
Reports IP address assigned to cellular interface

Specified by:
getIPaddress in interface ICellularModemService
Returns:
dotted-decimal IP address
null - if no IP address is assigned
Throws:
java.lang.Exception

getPeerIPaddress

java.lang.String getPeerIPaddress()
                                  throws java.lang.Exception
Reports IP address of the peer

Specified by:
getPeerIPaddress in interface ICellularModemService
Returns:
dotted-decimal IP address
null - if no IP address is assigned
Throws:
java.lang.Exception

getSignalStrength

int getSignalStrength()
                      throws java.lang.Exception
Reports signal strength in dBm

Specified by:
getSignalStrength in interface ICellularModemService
Returns:
signal strength
Throws:
java.lang.Exception

isRoaming

boolean isRoaming()
                  throws java.lang.Exception
Reports roaming status

Specified by:
isRoaming in interface ICellularModemService
Returns:
true - modem is roaming false - modem is not roaming
Throws:
java.lang.Exception

getServiceType

java.lang.String getServiceType()
                                throws java.lang.Exception
Reports Service Type

Specified by:
getServiceType in interface ICellularModemService
Returns:
service indication
Throws:
java.lang.Exception

getCallTxCounter

long getCallTxCounter()
                      throws java.lang.Exception
Reports number of bytes tarnsmitted during a call

Specified by:
getCallTxCounter in interface ICellularModemService
Returns:
number of bytes transmitted
Throws:
java.lang.Exception

getCallRxCounter

long getCallRxCounter()
                      throws java.lang.Exception
Reports number of bytes received during a call

Specified by:
getCallRxCounter in interface ICellularModemService
Returns:
number of bytes received
Throws:
java.lang.Exception

isConfigured

boolean isConfigured()
States whether a configuration has been supplied for this modem

Returns:
true if configuration exists, otherwise false

sendSms

void sendSms(java.lang.String recipientNumber,
             java.lang.String smscNumber,
             java.lang.String message)
             throws java.lang.Exception
Sends an SMS to the specified recipient via the specified provider SMSC number

Parameters:
recipientNumber - the number to send the SMS to
smscNumber - the SMSC number specified by the cell provider
message - the SMS message to send to the specified recipient
Throws:
java.lang.Exception - if there was an error