eWON JTK

com.ewon.ewonitf
Class ModemManager

java.lang.Object
  extended by com.ewon.ewonitf.ModemManager

public class ModemManager
extends Object

This static class provides methods for eWON modem management, like modem reset or SMS reception.


Field Summary
static int INIT_FINISHED
          value returned by getModemInitStatus() when the modem initialisation is complete.
static int INIT_IN_PROGRESS
          value returned by getModemInitStatus() when the modem initialisation is started and in progress.
static int INIT_PENDING
          value returned by getModemInitStatus() when the modem initialisation is pending and not yet started.
 
Method Summary
static int getDialoutCounter()
           
static int getGsmNetReg()
           
static int getGsmOpId()
           
static int getModemDetectionErr()
           
static int getModemInitStatus()
          This function returns information about the Modem initialisation process.
static int getSmsCount()
          This function reports the number of SMS currently in the queue and waiting to be read.
static SmsMessage readSms()
          Use this function to read an SMS from the SMS queue.
static void resetModem()
          Reset the eWON modem.
static void updateClientInOut()
          During an active outgoing PPP communication, this function will update the volumes exchanged.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

INIT_FINISHED

public static final int INIT_FINISHED
value returned by getModemInitStatus() when the modem initialisation is complete.

See Also:
Constant Field Values

INIT_IN_PROGRESS

public static final int INIT_IN_PROGRESS
value returned by getModemInitStatus() when the modem initialisation is started and in progress.

See Also:
Constant Field Values

INIT_PENDING

public static final int INIT_PENDING
value returned by getModemInitStatus() when the modem initialisation is pending and not yet started.

See Also:
Constant Field Values
Method Detail

resetModem

public static void resetModem()
Reset the eWON modem. This function will trigger a 'modem reset request', the actual reset may occur asynchronousely a few seconds later. This reset operation will occur independently of any operation in progress with the modem, so this command may disrupt other processes in the eWON and although these process will handle the error and recover, this command may result in errors beeing reported in the the eWON events file.


getModemInitStatus

public static int getModemInitStatus()
This function returns information about the Modem initialisation process.

This information is usefull during eWON boot or after the modem has been reset with the resetModem() function.

Returns:
one of INIT_FINISHED, INIT_PENDING or INIT_IN_PROGRESS

updateClientInOut

public static void updateClientInOut()
                              throws EWException
During an active outgoing PPP communication, this function will update the volumes exchanged.

Throws:
EWException

getDialoutCounter

public static int getDialoutCounter()
                             throws EWException
Returns:
the same value as SYS block . But faster.
Throws:
EWException

getGsmNetReg

public static int getGsmNetReg()
                        throws EWException
Returns:
the same value as SYS block . But faster.
Throws:
EWException

getGsmOpId

public static int getGsmOpId()
                      throws EWException
Returns:
the same value as SYS block . But faster.
Throws:
EWException

getModemDetectionErr

public static int getModemDetectionErr()
                                throws EWException
Returns:
the same value as SYS block . But faster.
Throws:
EWException

getSmsCount

public static int getSmsCount()
This function reports the number of SMS currently in the queue and waiting to be read. These SMS can be read with the readSms() function.

Returns:
the number of SMS currently waiting in queue to be read.
See Also:
readSms()

readSms

public static SmsMessage readSms()
Use this function to read an SMS from the SMS queue.

Returns:
The function will return an SmsMessage object. This object provides a number of methods to obtain the following information: SMS reception date and time, phone number of the SMS sender, SMS message.

The following example shows how to print the SMS information.

     try
     {
         SmsMessage smsMessage = ModemManager.readSms();
         System.out.println("SmsNdx: "+smsMessage.getSmsNdx());
         System.out.println("SmsDateTime"+ new Date(smsMessage.getSmsDataTime()).toString());
         System.out.println("SmsDateTime"+Long.toString(smsMessage.getSmsDataTime()));
 
         System.out.println("SmsFrom: "+smsMessage.getSmsFrom());
         System.out.println("SmsMessage: "+smsMessage.getSmsMessage());
     }
     catch (Exception e)
     {
         //for example there are no SMS to read.
         System.out.println("Error: "+e.toString());
     }
 
See Also:
SmsMessage

eWON JTK

www.eWON.biz: Your Eyes Watching Over Net