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

# Sample - MultiApp Library

- Changes
- Library Description
- Library API

## Changes

- V3.00 : Initial revision

## Library Description

This MultiApp sample library provides start/stop mechanism to handle several running ADL applications. When an application uses this library, it provides some parameters as the start/stop command name, the start and stop callbacks, etc...

It also defines a +WHO command, to know which application is currently running.

## Library API

All constants and APIs are defined by the multi_app.h header file, which must be included by any application to allows it to use the MultiApp Library.

The MultiApp APIs are defined bellow :

ma_LoadApplication
This API can be used to load a new application.

void ma_LoadApplication ( adl_InitType_e InitType, ma_ApplicationHandler_f InitProc );

Parameter | Description
InitType | adl_main InitType parameter has to be forwarded to the library using this one.
InitProc | The application entry point (see below)

ma_ApplicationHandler_f
This type is used to define MultiApp callbacks.

typedef void ( * ma_ApplicationHandler_f ) ( adl_InitType_e InitType, ascii * PinCode, ma_Element_t * ApplicationData );

Parameter | Description
InitType | InitType, forwarded from adl_main entry point.
PinCode | Application defined PinCode, defined by the ma_SetupPinCode API (NULL by default).
ApplicationData | Structure to be filled with application information. typedef struct { ascii * AppName; ascii * AppCmd; u16 AppTrcID; u16 ObjRange; ma_StartFctHdlr_f AppStart; ma_StopFctHdlr_f AppStop; } ma_Element_t; AppName : Application name (also used as flash objects handle) AppCmd : Application command name AppTrcID : Trace ID (provided by the library) ObjRange : Used Flash Object numbers (object 0 is always the application state) AppStart : Application start callback AppStop : Application stop callback

ma_StartFctHdlr_f
This type is used to define MultiApp start function callbacks.

typedef bool ( * ma_StartFctHdlr_f ) ( u8 Port );

Parameter | Description
Port | Serial port from which command was sent.

ma_StopFctHdlr_f
This type is used to define MultiApp stop function callbacks.

typedef void ( * ma_StopFctHdlr_f ) ( void );

ma_SetupPinCode
This API may be used to define a specific PIN code for the whole application.

void ma_SetupPinCode ( ascii * PinCode );

Parameter | Description
PinCode | PIN code to be sent to all loaded application entry points.

The +WHO command is decribed below :

AT+WHO (Currently running applications dump command)

Command | Answers
AT+WHO | Application name[ - running] Application name[ - running] ... OK Displays all linked applications, with the "running" word for the started ones...

Updated: Tue May 22 20:11:05 CEST 2007;