SMS

The SMS Sample App

This sample app demonstrates the usage of the sms service along with a few other services and APIs in order to perform SMS messaging operations. It requires an activated SIM card to send and receive messages. It also allows for some of the basic functionalities that are expected from such an application, namely the ability to view the messages in the inbox, delete, mark as read/unread. This app can also be used as an automatic SMS reply service in order to acquire various information about the device remotely. More information on this service is provided by typing sms --help.

  • SMS service with .adef bindings and related .cdef requires, provides, and sources sections.
  • Modem Information service with .adef bindings and related .cdef requires, provides, and sources sections.
  • AT Commands Client service with .adef bindings and related .cdef requires, provides, and sources sections.

The smsApp is a sample application designed to demonstrate the functions provided by the SMS. This sample app provides two executables, one for the service and another one for the controller. You can find:

  • An .adef file:
    • smsApp.adef to define the executables, processes, requires, bindings, and externals.
  • An .sdef file:
    • smsApp.sdef to define the commands, and the system structure
  • Two .cdef files:
    • Component.cdef for the service component
    • Component.cdef for the controller
Note
The app is built along with a complete system using the .sdef in order to use the command line tools to control the application.

Go to the sample code.

Install the sample app:

$ cd apps/sample/smsApp
$ mksys -t wp76xx smsApp.sdef
$ app install smsApp.wp76xx.update <ip address>

where ip address is the address of your target device.

If you're not using a Sierra Wireless WP76xx module, replace wp76xx with the appropriate identifier for your target.

Note
The smsApp has only been tested on WP76xx.

Usage

To use the app to send an SMS message, use the following command. Replace Phone Number with the phone number you wish to send a message to and replace Message with the message you wish to send.

sms send <Phone Number> <Message>

To use the app to open the inbox, use the following command:

sms inbox

Scroll through the messages by typing:

sms next
Note
For more information on specific commands, read the following section taken from the app's help.
"NAME:\n"
" sms - Used to perform SMS operations\n"
"\n"
"PREREQUISITES:\n"
" SIM is inserted, registered on the network, and is in ready state. Type cm sim in order to see state.\n"
" This is only necessary if you wish to send and receive txt mesasges. Inbox operations don't require this.\n"
"\n"
"DESCRIPTION:\n"
" sms send <Destination Number> <Text Message to Send>\n"
" Sends <Text Message to Send> to <Destination Number> synchronously. <Destination Number> is assumed\n"
" to be valid and registered on the network.\n"
" If a text message is longer than 160 characters, it automatically gets broken down into smaller texts\n"
" each containing at most 160 characters and gets sent through multiple messages. However, it is important\n"
" to note that longer than 511 character messages are not supported due to legato argument parser and not\n"
" the app itself.\n"
"\n"
" sms sendAsync <Destination Number> <Text Message to Send>\n"
" Sends <Text Message to Send> to <Destination Number> asynchronously. <Destination Number> is assumed\n"
" to be valid and registered on the network.\n"
"\n"
" sms sendAT <Destination Number> <Text Message to Send>\n"
" Sends <Text Message to Send> to <Destination Number> using AT commands API. <Destination Number> is assumed\n"
" to be valid and registered on the network.\n"
"\n"
" sms inbox\n"
" Loads the messages stored on the device and displays the first one in the list.\n"
"\n"
" sms next\n"
" Goes to the next message in the inbox and displays its contents. Messages need to already be loaded\n"
" in advance by typig: sms inbox. If end of messages is reached, it will go back to the beginning.\n"
"\n"
" sms delete\n"
" Deletes from storage the last message which was displayed using either Inbox or Next.\n"
"\n"
" sms status\n"
" Displays the status of the last message which was displayed using either Inbox or Next.\n"
"\n"
" sms unread\n"
" Marks as unread, the last message which was displayed using either Inbox or Next.\n"
"\n"
" sms count\n"
" Counts the total number of received messages since the last reset count.\n"
"\n"
" sms reset\n"
" Resets the received message counter.\n"
"\n"
"DEVICE INFORMATION REQUESTS:\n"
" Send the following messages to the device via SMS and get the associated device information as a reply.\n"
"\n"
" info reset\n"
" Get various reset information\n"
"\n"
" info psn\n"
" Get Platform Serial Number (PSN).\n"
"\n"
" info sku\n"
" Get product stock keeping unit number (SKU).\n"
"\n"
" info pri\n"
" Get Product Requirement Information Identifier (PRI ID) Part Number and the Revision Number.\n"
"\n"
" info manufacturer\n"
" Get Manufacturer name.\n"
"\n"
" info nai\n"
" get CDMA Network Access Identifier (NAI).\n"
"\n"
" info prl preference\n"
" Get CDMA Preferred Roaming List (PRL) only preferences status.\n"
"\n"
" info prl version\n"
" Get CDMA version of Preferred Roaming List (PRL).\n"
"\n"
" info min\n"
" Get CDMA Mobile Identification Number (MIN).\n"
"\n"
" info mdn\n"
" Get Mobile Directory Number (MDN) of the device.\n"
"\n"
" info esn\n"
" Get Electronic Serial Number (ESN) of the device.\n"
"\n"
" info meid\n"
" Get CDMA device Mobile Equipment Identifier (MEID).\n"
"\n"
" info imeisv\n"
" Get International Mobile Equipment Identity software version number (IMEISV).\n"
"\n"
" info imei\n"
" Get International Mobile Equipment Identity (IMEI).\n"
"\n"
" info device model\n"
" Get target hardware platform identity.\n"
"\n"
" info bootloader\n"
" Get bootloader version.\n"
"\n"
" info firmware\n"
" Get firmware version.\n"