Resources | developer.brewmp.com Resources | developer.brewmp.com

Developer

resources

Simulating SMS

The Simulator supports simulation of incoming and outgoing SMS messages, and simulation of SMS storage

The Brew MP device layer monitors incoming SMS messages, such as IS-637 messages for CDMA devices. These messages are then conditionally dispatched to applications that meet one or more of the following conditions:

  • Applications registered to receive specific IS-637 messages based upon the teleservice ID of the message
  • Applications registered to receive all IS-637 CMT 95 (4099) text messages
  • Any Brew MP applications to which a CMT 95 text message has been directed

To register to receive SMS messages for a specific Teleservice ID, the application must register for the notification NMASK_TAPI_SMS_TS notification from the AEECLSID_TAPI class. The upper 16 bits of the mask must contain the actual Teleservice ID of the message. For example, to register for a SMS message of ID 400, the application must contain the following:

ISHELL_RegisterNotify(piShell, clsMyApp, AEECLSID_TAPI, NMASK_TAPI_SMS_TS |  
         (400 << 16))

To register to receive all SMS Text messages, the application must register for the notification NMASK_TAPI_SMS_TEXT from the AEECLSID_TAPI class. The application must contain the following:

ISHELL_RegisterNotify(piShell, clsMyApp, AEECLSID_TAPI, 
          NMASK_TAPI_SMS_TEXT)

Regardless of the method you use to register SMS messages, you can also perform the registration in the application MIF. This is the preferred method of registering for notifications. To use the ISMS interface, you must have a MIF associated with your application with privileges for AEEPRIVID_PLTapi. If your application uses ISMSStorage, the MIF must have the privilege for AEECLSID_SMSM™AINCLIENT.

Please refer to documentation of ITAPI interface in the C/C++ API Reference for more details.

SMS dialog

To access the SMS dialog in the Simulator, select Tools > SMS.

The SMS dialog opens:

BREW Directed SMS

Select this option to use an application's hex ClassID number and a text message to simulate a Brew MP directed SMS message.

BREW's application-directed SMS is commonly used to support the transmission of simple SMS text messages by leveraging CMT-95 (teleservice ID 4099) messages. In Brew MP, these messages have a special format that allow them to be identified and dispatched to Brew MP applications. The format is as follows:

//BREW:<ClassID> : 

If the SMS messages received do not use this format, they can't launch Brew MP applications. They can be viewed using and SMS messaging application.

  1. In ClassID: 0x: type the application's hex ClassID number.
  2. In Message: type the text message you want sent.
  3. Click Send. EVT_APP_MESSAGE with dwParam pointing to the user character string causes the message to appear in the device's screen.

Mobile Terminated SMS

Select this option to load SMS information that has been stored in a *.sim file, or type the message into the SMS simulation GUI.

  1. Enter the following information to emulate a mobile-terminated SMS message.
    In this field Make this entry
    Filename

    Either leave blank if using the Message entry, or browse to the .sim file that contains the message to be sent by the client application. The name of the .sim file contains the year, month, date, time to differentiate multiple messages. By default, the Simulator writes these files in your temporary folder on your system. You can specify a different SMS message logging directory by specifying a value for "SMSLogDirName" under the [General] section of BREWSim.dat file. For example,

    [General] 
    SMSLogDirName = “C:\foo\SMSLogs\”

    Restart the Simulator after configuring SMSLogDirName. Thereafter, all the SMS logs will be created in that folder.

    Priority Specifies the message priority: Normal, Interactive, Urgent or Emergency.
    Service Category Specifies the mode of the message: UASMS, WMS-CDMA or WMS-GSM.
    TimeStamp Time the message was sent, in seconds after a base time. Click this button to edit the time.
    Encoding Specifies the encoding type.
    From Specifies the sender of the message.
    Privacy Specifies the message privacy setting: Normal, Restricted, Confidential, or Secret.
    Message Length Specifies the message length.
    Message Specifies the message text.
  2. Once you have made your entries, click Send.

    EVT_APP_MESSAGE is sent, with dwParam pointing to the user character string.

Note: For the message to be passed, the application must be in the current applet directory and in the MIF path.

In applications that handle the EVT_APP_SUSPEND and EVT_APP_RESUME event codes, the application can resume running at the interruption point. For all other applications, Brew MP unloads the current application and the Application Manager shows the device's initial screen.

In addition to a Brew MP simulated SMS and a mobile-terminated SMS, you can send an SMS message from an application to the Simulator's phone number (123-456-7890). This message is then looped back to the Simulator about five seconds after the message has been sent from the client application.