| http://www.wavecom.com/forum Open AT ® Release version: 4.21

# Sample - SMS Automaton

- Changes
- Dependencies
- Application Description

## Changes

- V1.00 : Initial revision
- V1.10 : New Wavecom sample library.
- V2.00 : Now using ADL ; The +AUTOSTART command disables/enables the application.
- V3.00 : Multi-Uart support ; MultiApp library support
- V4.00 : New call stack declaration format

## Dependencies

This sample depends on the following libraries :

- MultiApp
  This MultiApp sample library provides start/stop mechanism to handle several running ADL applications.

## Application Description

This application provides unsolicited indications to inform the external application that a formatted SMS has been received.

As this application uses the MultiApp library, the following start/stop command has to be used to control the application execution.

AT+AUTOSTART (Secured Control start/stop command)

Command | Answers
AT+AUTOSTART? | +AUTOSTART: <state> OK
AT+AUTOSTART=? | +AUTOSTART: (0-1) OK
AT+AUTOSTART= <state> | +CME ERROR: 3 or OK

Parameter | Values range | Description | Default value
state | 0-1 | The current application running state. This parameter is stored in non-volatile memory. | 0

The init entry point sent to the MultiApp library is the smsauto_init() function. The start/stop entry points linked to the +AUTOSTART command are the smsauto_run() and smsauto_stop() functions.

This application provides unsolicited responses informing the external application that a formatted SMS has been received. The SMS text may be formatted as follows (for example) :

#TEST#value#/TEST#text text#VALUE#123456789#/VALUE#

The Tags are delimitted by the '#' character. The Tags' name are defined in the cTagTab[] const string table in the appli.c file, and are case sensitives. A Tag name may not include the '#' character.

All the text between the "#tag#" and "#/tag#" expressions is considered as a value for this Tag. This text may not include the '#/' character sequence.

All the text between an ending tag "#/tag#" and another starting tag "#tag2#" is ignored and lost.

If a SMS format error occurs, the preceding well-formatted data are treated, but the following data are lost.

For this example, the syntax of the unsolicited response is the following (Wavecom OpenAt SMS Tag) :

+WOST: "TEST","value"
+WOST: "VALUE","123456789"

If at least one Tag is well formatted, the SMS is deleted from SIM, otherwise it remains in SIM memory.
The provided "appli.c" file uses two example tags : "TEST" and "VALUE".

Updated: Tue May 22 20:10:10 CEST 2007;