Home

ADL User Guide for Open AT® V4.10

image

Contents

1. Please refer to adl busParallelTimingCfg t type description for information amp chronograms about the available modes 3 9 2 6 3 ReadCfg WriteCfg The ReadCfg amp WriteCfg parameters define the timing configuration for each read and write process using the adl busParallelTimingCfg t type 3 9 2 6 4 Cs The Cs parameter defines the Chip Select signal configuration using the adl busParallelCs t type 3 9 2 6 5 NbAddNeeded The NbAddNeeded parameter defines the required number of address pins to be used by this bus configuration Maximum address pins number depends on the required Chip Select pin Chip Select pin Maximum address pins number CS2 2 A1 A24 CS3 3 A1 A24 A25 Address pins are alvvays reserved by decimal order Eg If one address pin is required A1 signal will be reserved e If two address pins are required A1 amp A24 signals will be reserved As CS2 amp A25 signals are multiplexed on the same pin CS2 signal can be used only if CS3 one was not previously subscribed with three address pins Please note that CS3 signal can be used with three address pins only if CS2 one is not subscribed 3 9 2 6 6 PrivateAddress This output parameter is reserved for ADL private usage 3 9 2 6 7 MaskValidAddress The MaskValidAddress output parameter provides the application with the bit mask which can be set at direct read write process time Each bit is associated with one o
2. c sisi 51 3 6 2 Flash Objects Management eee ee eens eee ene etna sense enaeenaeenae ees 51 3 6 3 The adl flhSubscribe Function 52 3 6 4 The adl flhExist Function 53 3 6 5 The adl flhErase Function 53 3 6 6 The adl fhWrite Function 54 3 6 7 The adl flhRead Function 55 3 6 8 The adl flhGetFreeMem Function cece cece eee I 55 3 6 9 The adl flhGetlDCount Function ss 56 3 6 10 The adl flhGetUsedSize Function 56 3 7 ReuuE laue EPHEMERIDES 57 3 7 1 Required Header File sisi 58 3 7 2 The adl_fcmlsAvailable Function e 58 3 7 3 The adl fcmSubscribe Function 59 3 7 4 The adl fcmUnsubscribe Function me 63 3 7 5 The adl fcmReleaseCredits Function 63 3 7 6 The adl fcmSwitchV24State Function cece eee eee e eee ees 64 3 7 7 The adl fcmSendData Function ss 64 3 7 8 The adl fcmSendDataExt Function ccc eee e eee eaten ee ees 66 3 7 9 The adl fcmGetStatus Function 67 wavecom Confidential Page 6 220 This document is the sole and exclusive property of WAVECOM Not to be distributed or divulged without prior written agreement Ce document est la propri t exclusive de WAVECOM Il ne peut tre communiqu ou divulgu des tiers sans son autorisation pr alable wevecom Make it wireless WM_DEV_OAT_UGD_019 002 September 11 2006 cE MEAMCiIJOE luIdRrcc mU 68 3 8 1 Required Header File sise 68 3 8 2 GPIO TYPO Swiss iie babs vues vars nn nie teens
3. Make it wireless WM DEV OAT UGD 019 002 September 11 2006 e Parameters CelllD A amp D space cell identifier to subscribe to This cell may already exist or not If the cell does not exist the given size is allocated Size New cell size in bytes this parameter is ignored if the cell already exists It may be set to ADL AD SIZE UNDEF for a variable size In this case new cells subscription will fail until the undefined size cell is finalised Total used size in flash will be the data size header size Header size is variable with an average value of 16 bytes When subscribing the size is rounded up to the next multiple of 4 e Returned values o A positive or null value on success e The A amp D cell handle on success to be used on further A amp D API functions calls o A negative error value e ADL RET ERR ALREADY SUBSCRIBED if the cell is already subscribed e ADL AD RET ERR OVERFLOW if there is not enough allocated space e ADL AD RET ERR NOT AVAILABLE if there is no A amp D space available on the product e ADL RET ERR PARAM if the Cellld parameter is OxFFFFFFFF this value should not be used as an A amp rD Cell ID e ADL RET ERR BAD STATE when subscribing an undefined size cell if another undefined size cell is already subscribed and not finalized e ADL RET ERR SERVICE LOCKED if the function was called from a low level interruption handler the function is forbidden in this context
4. Q2687 Wireless CPU SCTU block Clock rate Prescaler Counter width Comparator number width channels 1 13 MHz 8 bits 16 bits 4 Q268X Wireless CPUs SCTU architecture is shown in the diagram below SCTU Bus Interface amp Register Bank Figure 11 Q268X Wireless CPUs SCTU Architecture wavecom Confidential Page 193 220 This document is the sole and exclusive property of WAVECOM Not to be distributed or divulged without prior written agreement Ce document est la propri t exclusive de WAVECOM Il ne peut tre communiqu ou divulgu des tiers sans son autorisation pr alable weaevecom mds Make it wireless WM DEV OAT UGD 019 002 September 11 2006 Global SCTU functioning is described below e A prescaler is cadenced by the internal clock signal the prescaler reload value is configurable at service subscription e The counter is clocked by the prescaler overflow signal the counter reload value is configurable at service subscription e The comparator channels are configurable separately comparison values amp interruption generation flag e The counter overflow interruption flag is also configurable e Once the service is subscribed the timer can be started amp stopped by the application 3 24 1 Required Header File The header file for the SCTU functions is adl sctu h 3 24 2 The adl sctulnfo t Structure This structure allovv the application to get the
5. WM_DEV_OAT_UGD_019 002 September 11 2006 4 Error Codes 4 1 General Error Codes Error Code Error Value Description OK O No error response ERROR 1 general error code ADL_RET_ERR_PARAM 2 parameter error ADL_RET_ERR_UNKNOWN_HDL 3 unknown handler handle error ADL RET ERR ALREADY SUBSCRIBED 4 service already subscribed ADL RET ERR NOT SUBSCRIBED 5 service not subscribed ADL_RET_ERR_FATAL 6 fatal error ADL_RET_ERR_BAD_HDL 7 Bad handle ADL_RET_ERR_BAD_STATE 8 Bad state ADL_RET_ERR_PIN_KO 9 Bad PIN state ADL RET ERR NO MORE HANDLES 10 The service subscription maximum capacity is reached ADL RET ERR DONE 11 The required iterative process is now terminated ADL RET ERR OVERFLOW 12 The required operation has exceeded the function capabilities ADL RET ERR NOT SUPPORTED 13 An option required by the function is not enabled on the Wireless CPU the function is not supported in this configuration ADL RET ERR NO MORE TIMERS 14 The function requires a timer subscription but no more timers are available ADL RET ERR NO MORE SEMAPHORES 15 The function requires a semaphore allocation but there are no more free resource ADL RET ERR SERVICE LOCKED 16 If the function was called from a low lewel interruption handler the function is forbidden in this case ADL RET ERR SPECIFIC BASE 20 Beginning of specific errors range wavecom Confiden
6. ADL_GPRS_EVENT_NW_CLASS B If the network has forced the ME on class B ADL GPRS EVENT NVW CLASS CG If the network has forced the ME on class CG ADL GPRS EVENT NW CLASS CC If the network has forced the ME on class CC wavecom Confidential Page 136 220 This document is the sole and exclusive property of WWAVECOM Not to be distributed or divulged without prior written agreement Ce document est la propri t exclusive de WAVECOM Il ne peut tre communiqu ou divulgu des tiers sans son autorisation pr alable wavecom Make it wireless WM_DEV_OAT_UGD_019 002 September 11 2006 Event Call ID Description ADL GPRS EVENT ME CLASS B If the ME has changed to class B ADL GPRS EVENT ME CLASS CG If the ME has changed to class CG ADL GPRS EVENT ME CLASS CC If the ME has changed to class CC ADL GPRS EVENT NO CARRIER f the activation of the external application with ATD 99 PPP dialing did hang up ADL_GPRS_EVENT_DEACTIVATE_OK X f the deactivation requested with ad gprsDeact function was successful on the Cid X ADL GPRS EVENT DEACTIVATE OK FROM EXT X If the deactivation requested by the external application was successful on the Cid X ADL GPRS EVENT ANSWER OK f the acceptance of the incoming PDP activation with ad gprsAct was successful ADL GPRS EVENT ANSWER OK FROM EXT f the acceptance of the incoming PDP activa
7. rest state 1 data valid on falling edge 3 9 2 2 3 ChipSelect The ChipSelect parameter sets the pin used to handle the Chip Select signal Defined values are ADL_BUS_SPI_ADDR_CS_GPIO Use a GPIO as Chip Select signal the GpioChipSelect parameter has to be used ADL_BUS_SPI_ADDR_CS_HARD Use the reserved hardware chip select pin for the required bus ADL_BUS_SPI_ADDR_CS_NONE 3 9 2 2 4 ChipSelectPolarity The Chip Select signal is not handled by the ADL BUS service The application should allocate a GPIO to handle itself the Chip Select signal The ChipSelectPolarity parameter sets the polarity of the Chip Select signal defined values are ADL BUS SPI CS POL LOW Chip Select signal is active in Low state ADL BUS SPI CS POL HIGH Chip Select signal is active in High state wavecom Confidential Page 85 220 This document is the sole and exclusive property of WWAVECOM Not to be distributed or divulged without prior written agreement Ce document est la propri t exclusive de WAVECOM Il ne peut tre communiqu ou divulgu a des tiers sans son autorisation pr alable wevecom es Make it wireless WM_DEV_OAT_UGD_019 002 September 11 2006 3 9 2 2 5 LsbFirst The LsbFirst parameter defines the priority for data transmission through the SPI bus LSB or MSB first This applies only to data The Opcode and Address fields sen
8. Make it wireless WM DEV OAT UGD 019 002 September 11 2006 3 17 3 The adl semConsume Function This function allows the application to reduce the required semaphore counter by one If this counter value falls under zero the calling execution context is suspended until the semaphore is produced from another context e Prototype s32 adl_semConsume s32 SemHandle e Parameters SemHandle Semaphore service handle previously returned by the adl semSubscribe function e Returned values o OK on success o ADL RET ERRH UNKNOVVN HDL when the supplied handle is unknown o ADL RET ERR SERVICE LOCKED if the function was called from a low level interruption handler the function is forbidden in this context 3 17 4 The adl semConsumeDelay Function This function allows the application to reduce the required semaphore counter by one If this counter value falls under zero the calling execution context is suspended until the semaphore is produced from another context Moreover if the semaphore is not produced during the supplied time out duration the calling context is automatically resumed e Prototype s32 adl semConsumeDelay s32 SemHandle u32 TimeOut e Parameters SemHandle Semaphore service handle previously returned by the adl semSubscribe function Timeout Time to wait before resuming context when the semaphore is not produced must not be O Time measured is in 18 5 ms ticks
9. WM DEV OAT UGD 019 002 September 11 2006 3 20 13 The adl adGetState Function This function provides an information structure on the current A amp D volume state e Prototype s32 adl adGetState adl adState t State e Parameters State A amp D volume information structure based on the following type typedef struct u32 freemem Space free memory size u32 deletedmem Deleted memory size u32 totalmem Total memory ul6 numobjects Number of allocated objects ul6 numdeleted Number of deleted objects u8 pad not used adl adState t e Returned values o OKon success o ADL AD RET ERR NOT AVAILABLE if there is no A amp D space available on the product o ADL AD RET ERR NEED RECOMIPACT if a power down or a reset occurred when a re compaction process was running The application has to launch the adl adRecompact function before using any other A amp D service function o ADL RET ERR PARAM on parameter error o ADL RET ERR SERVICE LOCKED if the function was called from a low level interruption handler the function is forbidden in this context wavecom Confidential Page 169 220 This document is the sole and exclusive property of WWAVECOM Not to be distributed or divulged without prior written agreement Ce document est la propri t exclusive de WAVECOM Il ne peut tre communiqu ou divulgu des tiers sans son autorisation pr alable wavecom Make it wireless
10. wavecom Make it wireless WM_DEV_OAT_UGD_019 002 September 11 2006 3 20 16 Example This example demonstrates how to use the A amp D service in a nominal case error cases not handled Complete examples using the A amp D service are also available on the SDK DTL Application Download sample generic Download library sample Global variables amp constants Cell amp event handles s32 MyADCellHandle s32 MyADEventHandle Info amp state structure adl adInfo t Info adl adState t State A amp D event handler void MyADEventHandler adl adEvent e Event u32 Progress Check event switch Event case ADL AD EVENT RECOMPACT DONE case ADL AD EVENT FORMAT DONE The process is over TRACE 1 Format Recompact process over break Somewhere in the application code used as an event handler void MyFunction void Local variables u8 DataBuffer 10 Get state adl adGetState amp State Subscribe to the A amp D event service MyADEventHandle adl adEventSubscribe MyADEventHandler Subscribe to an A amp D cell MyADCellHandle adl adSubscribe 0x00000000 20 Write data buffer wm memset DataBuffer 10 O0 adl adWrite MyADCellHandle 10 DataBuffer V Car iaro adl_adInfo MyADCellHandle amp Info VVOWVOCOAN Confidential Page 172 220 This document is the sole and exclusive prop
11. Get context information adl gprsGetCidInformations 1 amp InfosCid De activate the session adl gprsDeAct 1 break case ADL GPRS EVENT DEACTIVATE OK TRACE 1 PDP Ctxt d De activation OK CID Un subscribe from GPRS event handler adl gprsUnsubscribe MyGprsEventHandler break Forward event return ADL_GPRS_FORWARD Somewhere in the application code used as an event handler void MyFunction void Fill Setup structure MyGprsSetup APN myapn MyGprsSetup Login login MyGprsSetup Password password wavecom Confidential Page 146 220 This document is the sole and exclusive property of VVAVECOM Not to be distributed or divulged without prior written agreement Ce document est la propri t exclusive de WAVECOM Il ne peut tre communiqu ou divulgu des tiers sans son autorisation pr alable wavecom Make it wireless WM DEV OAT UGD 019 002 September 11 2006 wavecom Confidential Page 147 220 This document is the sole and exclusive property of WAVECOM Not to be distributed or divulged without prior written agreement Ce document est la propri t exclusive de WAVECOM II ne peut tre communiqu ou divulgu a des tiers sans son autorisation pr alable wevecom es Make it wireless WM_DEV_OAT_UGD_019 002 September 11 2006 3 17 Semaphore ADL Service The ADL Semaphore service allows the application to
12. Only one analysis may be running at a time The adl errStartBacktraceAnalysis function will return the ADL RET ERR ALREADY SUBSCRIBED error code if it is called while an analysis is currently running 3 10 7 The adl errGetAnalysisState Function This function may be used in order to know the current backtrace analysis process state e Prototype adl errAnalysisState eadl errGetAnalysisState void e Returned values The current backtraces analysis state which use the type below typedef enum ADL ERR ANALYSIS STATE IDLE No running analysis ADL ERR ANALYSIS STATE RUNNING An analysis is running adl errAnalysisState e wavecom Confidential Page 106 220 This document is the sole and exclusive property of WWAVECOM Not to be distributed or divulged without prior written agreement Ce document est la propri t exclusive de WAVECOM Il ne peut tre communiqu ou divulgu des tiers sans son autorisation pr alable wevecom mds Make it wireless WM DEV OAT UGD 019 002 September 11 2006 3 10 8 The adl errRetrieveNextBacktrace Function This function allows the application to retrieve the next backtrace buffer stored in the product memory The backtrace analysis may have been started first with the adl errStartBacktraceAnalysis function e Prototype s32 adl errRetrieveNextBacktrace u8 Handle u8 BacktraceBuffer ul6 Size e Parameters Handle Backtrace analysis handle returned by th
13. TimeStamp2 Second timestamp Result Time difference between the two provided timestamps e Returned values o O on success and if TimeStamp1 equals to TimeStamp2 o 1 on success and if TimeStamp1 is greater than TimeStamp2 o 1 on success and if TimeStamp2 is greater than TimeStamp1 o ADL RET ERR PARAM if one parameter value is incorrect 3 22 6 Example This example demonstrates how to use the RTC service in a nominal case error cases are not handled Complete examples using the RTC service are also available on the SDK generic Download library sample Somewhere in the application code used as an event handler void MyFunction void Local variables adl_rtcTime_t Timel Time2 adl rtcTimeStamp t Stampl Stamp2 Diff s32 Way Get time adl rtcGetTime amp Timel adl rtcGetTime amp Time2 Convert to time stamps adl rtcConvertTime amp Timel amp Stampl ADL RTC CONVERT TO TIMESTAMP adl rtcConvertTime amp Time2 amp Stamp2 ADL RTC CONVERT TO TIMESTAMP Reckon time difference Way adl rtcDiffTime amp Stampl amp Stamp2 amp Diff wavecom Confidential Page 184 220 This document is the sole and exclusive property of WWAVECOM Not to be distributed or divulged without prior written agreement Ce document est la propri t exclusive de WAVECOM Il ne peut tre communiqu ou divulgu a des tiers sans son autorisation pr alable
14. Timestamp ADL RTC GET TIMESTAMP US t aue ee structure part 0 999 These macros may be used in order to extract durations parts from a given timestamp the logical equations below are always true _t TimeStamp ADL RTC GET TIMESTAMP SECONDS t ADL RTC GET TIMESTAMP MINUTES t ADL RTC GET TIMESTAMP HOURS t ADL RTC GET TIMESTAMP DAYS t ADL RTC MINUTE SECONDS ADL RTC HOUR SECONDS ADL RTC DAY SECONDS ox ox _t SecondFracPart ADL RTC SECOND FRACPART STEP ADL RTC GET TIMESTAMP MS t ADL RTC MS US ADL RTC GET TIMESTAMP US t wavecom Confidential Page 182 220 This document is the sole and exclusive property of WWAVECOM Not to be distributed or divulged without prior written agreement Ce document est la propri t exclusive de WAVECOM Il ne peut tre communiqu ou divulgu a des tiers sans son autorisation pr alable wevecom D Make it wireless WM DEV OAT UGD 019 002 September 11 2006 3 22 3 The adl rtcGetTime Function This function retrieves the current RTC time structure e Prototype s32 adl rtcGetTime adl rtcTime t TimeStructure e Parameters TimeStructure Retrieved current time structure e Returned values o OKon success o ADL RET ERR PARAM if the parameter is incorrect 3 22 4 The adl rtcConvertTime Function This function is able to convert RTC time structure to timestamp structure and timestamp structure to RTC time s
15. Speed in bits second is also provided ok response after an ata command from the external application in data call answer case the connection Speed in bps is also provided MO MT ADL CALL EVENT HANGUP OK FRO M EXT Data ok response after an ATH command from the external application on data call release Data is the ADL CALL DATA FLAG constant O on voice call release MO MT ADL CALL EVENT AUDIO OPENNED o if WIND 9 MO MT ADL CALL EVENT ANSWER OK AUT O Speed OK response after an auto answer to an incoming call ATSO command was set to a non zero value in data call answer case the connection Speed in bps is also provided MT ADL CALL EVENT RING GPRS O if GPRS phone call wavecom Confidential Page 130 220 This document is the sole and exclusive property of WWAVECOM Not to be distributed or divulged without prior written agreement Ce document est la propri t exclusive de WAVECOM Il ne peut tre communiqu ou divulgu des tiers sans son autorisation pr alable wevecom es Make it wireless WM_DEV_OAT_UGD_019 002 September 11 2006 Event Call ID Description Type ADL_CALL_EVENT_SETUP_FROM_EXT f the external application has used CMD Mode the ATD command to setup a call Mode value depends on call type Voice O GSM Data ADL CALL DATA FLAG GPRS session activation binary OR between
16. VWoOWVGCO W Make it wireless Operating Systems Integrated Development Environments Plug Ins Wireless CPUs Services wavecom Make it wireless WM DEV OAT UGD 019 002 September 11 2006 ADL User Guide for Open AT V4 10 Revision 002 Date September 11 2006 Reference WIMI DEV OAT UGD 019 wavecom Confidential Page 1 220 This document is the sole and exclusive property of WAVECOM Not to be distributed or divulged without prior written agreement Ce document est la propri t exclusive de WAVECOM Il ne peut tre communiqu ou divulgu a des tiers sans son autorisation pr alable wavecom Make it wireless s WM_DEV_OAT_UGD_019 002 September 11 2006 Document History Index Date Versions 001 May 2006 Creation 002 September Creation 2006 wavecom Confidential Page 2 220 This document is the sole and exclusive property of WAVECOM Not to be distributed or divulged without prior written agreement Ce document est la propri t exclusive de WAVECOM Il ne peut tre communiqu ou divulgu a des tiers sans son autorisation pr alable wavecom Make it wireless WM DEV OAT UGD 019 002 September 11 2006 Copyright This manual is copyrighted by WAVECOM with all rights reserved No part of this manual may be reproduced in any form without the prior written permission of WAVECOM No patent liability is assumed with respect to th
17. WM DEV OAT UGD 019 002 September 11 2006 3 20 14 The adl adGetCellList Function This function provides the list of the current allocated cells e Prototype s32 adl adGetCellList wm_lst_t CellList e Parameters CellList Return allocated cell list The list elements are the cell identifiers and are based on u32 type The list is ordered by cell id values from the lowest to the highest Caution The list memory is allocated by the ad1 adGetCellList function and has to be released by the application e Returned values o OKon success o ADL AD RET ERR NOT AVAILABLE if there is no A amp D space available on the product o ADL RET ERR PARAM on parameter error o ADL RET ERR SERVICE LOCKED if the function was called from a low level interruption handler the function is forbidden in this context wavecom Confidential Page 170 220 This document is the sole and exclusive property of WWAVECOM Not to be distributed or divulged without prior written agreement Ce document est la propri t exclusive de WAVECOM Il ne peut tre communiqu ou divulgu des tiers sans son autorisation pr alable wevecom es Make it wireless WM_DEV_OAT_UGD_019 002 September 11 2006 3 20 15 The adl adFormat Function This function re initializes the A amp D storage volume It is only allowed if there is currently no subscribed cells or if there are no currently running re compaction or format process Imp
18. WM_DEV_OAT_UGD_019 002 September 11 2006 3 2 5 2 The adl atCmdSendText Function This function allows to provide a running Text Mode command on a specific port e g AT CMGW with the required text This function has to be used as soon as the prompt response gt comes in the response handler provided on adl atCmdCreate function call e Prototype s8 adl_atCmdSendText adl_port_e Port ascii Text e Parameters Port Port on which is currently running the Text Mode command waiting for some text input Text Text to be provided to the running Text Mode command on the required port If the text does not end with a Ctrl Z character Ox1A code the function will add it automatically e Returned values o OK on success the text has been provided to the running Text Mode command the response handler provided on adl atCmaCreate call will be notified vvith the command responses o ADL RET ERR PARAM on parameter error NULL text ADL RET ERR UNKNOWN HDL if the required port is not available o ADL RET ERR BAD STATE if there is no Text Mode command currently running on the required port o ADL RET ERR SERVICE LOCKED if the function was called from a low level interruption handler the function is forbidden in this context Oo Note It is not possible to send the text in several times As soon as the adl atCmdSendText function is used the provided text will immediately be sent and the comma
19. e Parameters GpioHandle Handle previously returned by adl ioSubscribe function Gpio Identifier of the GPIO using one of the adl ioLabel u union type State Value to be set on the output e Returned values o OKon success o ADL RET ERR PARAM on parameter error o ADL RET ERR UNKNOWN HDL if the handle is unknown o ADL RET ERR BAD STATE if one of the required GPIO was not subscribed as an output 3 8 13 The adl io GetProductType Function This function returns the Wireless CPU type e Prototype adl ioProductTypes e adl ioGetProductType void e Returned values This function returns the Wireless CPU type with the following defined values Identifier Product type ADL IO PRODUCT TYPE 02686 Q2686 Wireless CPU ADL IO PRODUCT TYPE 02687 Q2687 Wireless CPU 3 8 14 The adl ioGetFeatureGPIOList Function This function retrieves a list of GPIOs multiplexed with a specific feature ie the GPIO which are not available for subscription when this feature is enabled e Prototype s32 adl ioGetFeatureGPIOList adl ioFeature e Feature u8 GpioTab u8 GpioNb wavecom Confidential Page 80 220 This document is the sole and exclusive property of WWAVECOM Not to be distributed or divulged without prior written agreement Ce document est la propri t exclusive de WAVECOM Il ne peut tre communiqu ou divulgu des tiers sans son autorisation pr alable wevecom Make it wirel
20. 3 20 3 The adl adUnsubscribe Function This function unsubscribes from the given A amp D cell handle e Prototype s32 adl adUnsubscribe s32 CellHandle e Parameters CellHandle A amp D cell handle returned by adi adSubscribe function e Returned values o OK on success o ADL RET ERR UNKNOWN HDL if the handle was not subscribed o ADL RET ERR SERVICE LOCKED if the function was called from a low level interruption handler the function is forbidden in this context wavecom Confidential Page 161 220 This document is the sole and exclusive property of WAVECOM Not to be distributed or divulged without prior written agreement Ce document est la propri t exclusive de WAVECOM Il ne peut tre communiqu ou divulgu a des tiers sans son autorisation pr alable wevecom es Make it wireless WM_DEV_OAT_UGD_019 002 September 11 2006 3 20 4 The adl adEventSubscribe Function This function allows the application to provide ADL with an event handler to be notified with A amp D service related events e Prototype s32 adl adEventSubscribe adl adEventHdlr f Handler e Parameters Handler Call back function provided by the application Please refer to next chapter for more information e Returned values o A positive or null value on success e A amp D event handle to be used in further A amp D API functions calls o A negative error value e ADL_RET_ERR_PARAM if the Handler parameter is invalid
21. Handle previously returned by the adl msgSubscribe function e Returned values o OKon success o ADL RET ERR UNKNOWN HDL if the supplied handle is unknown o ADL RET ERR SERVICE LOCKED if the function was called from a low level interruption handler the function is forbidden in this context 3 14 8 The adi msgSend Function This function allows the application to send a message at any time e Prototype s32 adl_msgSend adl_msgMailBox_e DestinationMbx u32 MessageIdentifier u32 Length void Data e Parameters DestinationMbx Destination mailbox to which the message is to be posted The only value allowed is ADL MSG MBX OAT TASK Messageldentifier The application defined message identifier Message reception filters will be applied to this identifier before notifying the concerned message handlers Length Message body length if any Should be set to O if the message does not include a body wavecom Confidential Page 126 220 This document is the sole and exclusive property of WAVECOM Not to be distributed or divulged without prior written agreement Ce document est la propri t exclusive de WAVECOM Il ne peut tre communiqu ou divulgu a des tiers sans son autorisation pr alable wavecom o Make it wireless WM DEV OAT UGD 019 002 September 11 2006 Data Message body buffer address if any Should be set to O if the message does not include a body This buffer data content w
22. If some A amp D cells are deleted and the recompaction process is not performed regularly the deleted cell space will not be freed e Prototype s32 adl adRecompact s32 EventHandle e Parameters EventHandle Event handle previously returned by the adl_adEventSubscribe function The associated handler will receive the re compaction process events sequence e Returned values o OK on success Event handlers will receive the following event sequence e ADL AD EVENT RECOMPATCT INIT just after the process is launched e ADL AD EVENT RECOMPACT PROGRESS several times indicating the process progression e ADL AD EVENT RECOMPACT DONE when the process is completed o ADL RET ERR BAD STATE if a re compaction or format process is currently running o ADL RET ERR UNKNOWN HDL if the handle is unknown o ADL RET ERR NOT SUBSCRIBED if no A amp D event handler has been subscribed o ADL AD RET ERR NOT AVAILABLE if there is no A amp D space available on the product o ADL RET ERR SERVICE LOCKED if the function was called from a low level interruption handler the function is forbidden in this context wavecom Confidential Page 168 220 This document is the sole and exclusive property of WWAVECOM Not to be distributed or divulged without prior written agreement Ce document est la propri t exclusive de WAVECOM Il ne peut tre communiqu ou divulgu des tiers sans son autorisation pr alable weavecom p Make it wireless
23. This document is the sole and exclusive property of WAVECOM Not to be distributed or divulged without prior written agreement Ce document est la propri t exclusive de WAVECOM Il ne peut tre communiqu ou divulgu des tiers sans son autorisation pr alable wevecom Make it wireless WM DEV OAT UGD 019 002 September 11 2006 A X s Task wm apmCustomStackSize CE um Low level Int handler Call Stack wm apmIROLowLevelStackSize X High level Int handler Call Stack wm apmIROHighLevelStackSize Total Open AT available RAM size Heap memory Global variables Figure 3 Open AT RAM Mapping Call Stack Space Note 1 Previous Open AT versions required the wn apmCustomStack constant definition This constant is now completely internally processed by the Wavecom OS and its definition has to be removed from the Open AT application code Note 2 In RTE mode the call stacks are processed by the host s operating system and are not configurables declared sizes are just removed from the available RAM space for the heap memory It also means that stack overflovvs cannot be debugged within the RTE mode Note 3 The GCC compiler and GNU Newlib standard C library implementation require more stack size than the ARM compiler If the GCC compiler is used the Open AT application is declared with greater stack sizes An automatic multiplier tool is integrated in the generation tools wh
24. This service provides APIs to process AT standard response strings 3 19 1 Required Header File The header file for the AT strings service is adl str h 3 19 2 The adl striD e Type All predefined AT strings for this service are defined in the following type typedef enum ADL STR NO STRING Unknown string ADL STR OK OK ADL STR BUSY BUSY ADL STR NO ANSWER NO ANSWER ADL STR NO CARRIER NO CARRIER ADL STR CONNECT CONNECT ADL STR ERROR ERROR ADL STR CME ERROR 4CME ERROR ADL STR CMS ERROR CMS ERROR ADL STR CPIN CPIN ADL STR LAST TERMINAL Terminal resp are before this line ADL STR RING ADL STR LAST TERMINAL RING ADL STR WIND WIND ADL STR CRING CRING ADL STR CPINC CPINC ADL STR WSTR WSTR ADL STR CMEE CMEE ADL STR CREG CREG ADL STR CGREG CGREG ADL STR CRC CRC ADL STR CGEREP CGEREP Last string ID ADL STR LAST adi strID e wavecom Confidential Page 156 220 This document is the sole and exclusive property of WAVECOM Not to be distributed or divulged without prior written agreement Ce document est la propri t exclusive de WAVECOM Il ne peut tre communiqu ou divulgu a des tiers sans son autorisation pr alable wevecom Make it wireless WM_DEV_OAT_UGD_019 002 September 11 2006 3 19 3 The adl strGetlID Function
25. WDWL other syntax ADL SAFE CMD WOPEN STOP AT WOPEN 0 command ADL SAFE CMD WOPEN START AT WOPEN 1 command ADL SAFE CMD WOPEN GET VERSION AT WOPEN 2 command ADL SAFE CMD WOPEN ERASE OBJ AT WOPEN 3 command ADL SAFE CMD WOPEN ERASE APP AT WOPEN 4 command ADL SAFE CMD WOPEN SUSPEND APP AT WOPEN 5 command ADL SAFE CMD WOPEN AD GET SIZE AT WOPEN 6 command ADL SAFE CMD WOPEN AD SET SIZE AT WOPEN 6 lt size gt command ADL SAFE CMD WOPEN READ AT WOPEN command ADL SAFE CMD WOPEN TEST AT WOPEN command ADL SAFE CMD WOPEN OTHER WOPEN other syntax adl safeCmdType e The paras received structure contains the same parameters as the commands used for adl atCmdSubscribe API If the Handler returns FALSE the command will not be forwarded to the Wavecom OS If the Handler returns TRUE the command will be processed by the Wavecom OS which will send responses to the external application e Returned values o OKon success o ADL RET ERR PARAM if the parameters have an incorrect value o ADL RET ERR ALREADY SUBSCRIBED if the service is already subscribed o ADL RET ERR SERVICE LOCKED if the function was called from a low level interruption handler the function is forbidden in this context 3 18 3 The adl safeUnsubscribe Function This function unsubscribes from Application safe mode service The VWDWL and WOPEN commands are not filtered anymore and are processed by the Wav
26. calling this function ADL RET ERR SERVICE LOCKED f the function was called from a low level interruption handler the function is forbidden in this context Important Note This function must be called before opening the GPRS FCM Flows 3 16 7 The adl gprsDeact Function This function runs the adl gprsDeactExt on the ADL PORT OPEN AT VIRTUAL BASE port cf adi gprsDeactExt description for more information Please note that events generated by the ad1 gprsDeact will not be able to be forvvarded to any external port since the setup command runs on the Open AT port wavecom Confidential Page 142 220 This document is the sole and exclusive property of WWAVECOM Not to be distributed or divulged without prior written agreement Ce document est la propri t exclusive de WAVECOM Il ne peut tre communiqu ou divulgu des tiers sans son autorisation pr alable weaevecom Make it wireless WM_DEV_OAT_UGD_019 002 September 11 2006 3 16 8 The adl gprsDeactExt Function This function deactivates a specific PDP context identified by its Cid e Prototype s8 adl gprsDeactExt u8 Cid adl port e Port e Parameters Cid The Cid of the PDP context to deactivate integer value between 1 and 4 Port Port on which to run the PDP context deactivation command Deactivation return events are received in the GPRS event handler lf the application requires ADL to forward these events they will b
27. e ADL RET ERR NO MORE HANDLES if the A amp D event service has been subscribed more than 128 times e ADL RET ERR SERVICE LOCKED if the function was called from a low level interruption handler the function is forbidden in this context Notes In order to format or re compact the A amp D storage volume the adl adEventSubscribe function has to be called before the ad1 adFormat or the adl adRecompact functions 3 20 5 The adl adEventHdir f Call back Type This call back function has to be provided to ADL through the adl adEventSubscribe interface in order to receive A amp D related events e Prototype typedef void adl adEventHdlr f adl adEvent e Event u32 Progress wavecom Confidential Page 162 220 This document is the sole and exclusive property of WAVECOM Not to be distributed or divulged without prior written agreement Ce document est la propri t exclusive de WAVECOM Il ne peut tre communiqu ou divulgu a des tiers sans son autorisation pr alable wevecom mds Make it wireless WM DEV OAT UGD 019 002 September 11 2006 e Parameters Event Event is the received event identifier The events defined in the adl adEvent e type are described in the table below Event Meaning ADL AD EVENT FORMAT INIT The adl adFormat function has PEZ B B been called by an application a format process has just been required ADL AD EVENT FORMAT PROGRESS The format process is on going Several
28. exclusive de WAVECOM Il ne peut tre communiqu ou divulgu des tiers sans son autorisation pr alable wevecom Make it wireless WM_DEV_OAT_UGD_019 002 September 11 2006 3 13 2 The adl smsSubscribe Function 1 0 0 0 cece cence m 119 3 13 3 The adl smsSend Function 120 3 13 4 The adl smsUnsubscribe Function ccc eee eens 121 3 14 Message Service unten taaciaad tem XE Ra RR ARR tea LERRA ten AR RR tea eds 122 3 14 1 Required Header File sse esse enses 122 3 14 2 The adl msgMailBox e Type 122 3 14 3 The adl msgldComparator e Type ssssesss 122 3 14 4 The adl msgFilter t Structure ss 123 3 14 5 The adl msgSubscribe Function 124 3 14 6 The adl msgHandler f call back Type eseesessess 125 3 14 7 The adl msgUnsubscribe Function 126 3 14 8 The adl msgSend Function 126 3 149 Example iei uere eae skr nort ee wena e deer gre vex noc Verre ex RD QE D 128 3 15 Call Service 129 3 15 1 Required Header File sisi 129 3 15 2 The adl callSubscribe Function 129 3 15 3 The adl callSetup Function 132 3 15 4 The adl callSetupExt Function 132 3 15 5 The adl callHangup Function 133 3 15 6 The adl callHangupExt Function ss 133 3 15 7 The adl callAnswer Function 134 3 15 8 The adl callAnswerExt Function 134 3 15 9 The adl callUnsubscribe Function ss 134 3 16 GPRS Service sessi pepe Rye eara Rn ex pee bead EaaRxe ex tenaient e
29. o ADL RET ERR SERVICE LOCKED if the function was called from a low level interruption handler the function is forbidden in this context o OKifthe function is successfully executed 3 2 3 3 The adl atSendStdResponseExt Function This function sends the provided standard response with an argument to the required port as a response an unsolicited response or an intermediate response according to the requested type e Prototype s32 adl atSendStdResponseExt u8 Type adl strID e RspID u32 arg e Parameters Type Same use as the adl atSendResponse Type parameter RsplD Standard response ID to be sent see 83 19 for more information arg Standard response argument According to response ID this argument should be an u32 integer or an ascii string e Returned value o ADL RET ERR SERVICE LOCKED if the function was called from a low level interruption handler the function is forbidden in this context o OKifthe function is successfully executed wavecom Confidential Page 30 220 This document is the sole and exclusive property of WAVECOM Not to be distributed or divulged without prior written agreement Ce document est la propri t exclusive de WAVECOM Il ne peut tre communiqu ou divulgu des tiers sans son autorisation pr alable wevecom D Make it wireless WM DEV OAT UGD 019 002 September 11 2006 3 2 3 4 Additional IVlacros for Specific Port Access The above Response s
30. ou divulgu des tiers sans son autorisation pr alable weaevecom pens Make it wireless WM_DEV_OAT_UGD_019 002 September 11 2006 1 Introduction 1 1 Important Hemarks Itis strongly recommended before reading this document to read the ADL User Guide Open AT 4 10 and specifically the Introduction chapter 1 for having a better overview of what Open AT is about The ADL library and the standard embedded Open AT API layer must not be used in the same application code As ADL APIs will encapsulate commands and trap responses applications may enter in error modes if synchronization is no more guaranteed 1 2 References 1 Basic Development Guide for Open AT 4 10 ref WM DEV OAT UGD 017 2 AT commands Interface Guide for OS 6 61 ref VM DEV OAT UGD 014 3 Tools Manual for Open AT IDE 1 00 ref WM DEV OAT UGD 018 1 3 Glossary Application Mandatory API Mandatory software interfaces to be used by the Embedded Application AT commands Set of standard modem commands AT function Software that processes the AT commands and AT subscriptions Embedded API layer Software developed by Wavecom containing the Open AT APIs Application Mandatory API AT Command Embedded API OS API Standard API FCM API IO API and BUS API Embedded Application User application sources to be compiled and run on a Wavecom product Embedded OS Software that includes the Embedded Application and the Wavecom librar
31. the Target Monitoring Tool Value of I 123 e DUMP u8 TL u8 P ul6 L Displays the content each byte in hexadecimal format of the provided buffer in the Target Monitoring Tool TL defines the trace level traces will be displayed on the CUS4 element of the Target Monitoring Tool Trace levels range is from 1 to 32 P is the buffer s address to dump L is the length in bytes of the required dump Since a display line maximum length is 255 bytes if the display length is greater than 80 each byte is displayed on 3 ascii characters the dump will be segmented on several lines Each 80 bytes truncated line will end with the character sequence Example 1 u8 Buffer x0 x1 x2 x3 x4 x5 x6 x7 x8 x9 DUMP 1 Buffer 10 At runtime this will display the following string on the CUS4 level 1 on the Target Monitoring Tool 00 01 02 03 04 05 06 07 08 09 wavecom Confidential Page 49 220 This document is the sole and exclusive property of WAVECOM Not to be distributed or divulged without prior written agreement Ce document est la propri t exclusive de WAVECOM Il ne peut tre communiqu ou divulgu des tiers sans son autorisation pr alable wevecom pem Make it wireless WM DEV OAT UGD 019 002 September 11 2006 Example 2 u8 Buffer 200 i for i20 i lt 200 i Buffer i i DUMP 1 Buffer 200 At runtime this will display the following three lines on th
32. 11 2006 using the adl msgIdComparator e type Please refer to the type description for more information see 8 3 14 3 o Source Required incoming message source context the handler will be notified vvith messages received from this context The ADL CTX ALL constant should be used if the application vvishes to receive all messages whatever the source context 3 14 4 2 Filter Examples e With the following filter parameters MsgIdentifierMask 0x0000F000 MsgIdentifierValue 0x00003000 Comparator ADL MSG ID COMP EQUAL Source ADL CTX ALL the comparison will match if the message identifier fourth quartet is strictly equal to 3 whatever the other bit values and whatever the source context e With the following filter parameters MsgIdentifierMask 0 MsgIdentifierValue 0 Comparator ADL MSG ID COMP EQUAL Source ADL CTX ALL the comparison will always match whatever the message identifier amp the source context values e With the following filter parameters MsgIdentifierMask OxFFFFO0000 MsgIdentifierValue 0x00010000 Comparator ADL MSG ID COMP GREATER OR EQUAL Source ADL CTX HIGH LEVEL IRQ HANDLER the comparison will match if the message identifier two most significant bytes are greater or equal to 1 and if the message was posted from high level interruption handler 3 14 5 The adl msgSubscribe Function This function allovvs the application to receive incoming user defined messages sent from a
33. 135 220 This document is the sole and exclusive property of VVAVECOM Not to be distributed or divulged without prior written agreement Ce document est la propri t exclusive de WAVECOM Il ne peut tre communiqu ou divulgu des tiers sans son autorisation pr alable wevecom p Make it wireless WM DEV OAT UGD 019 002 September 11 2006 3 16 GPRS Service ADL provides this service to handle GPRS related events and to setup activate and deactivate PDP contexts 3 16 1 Required Header File The header file for the GPRS related functions is adl gprs h 3 16 2 The adl gprsSubscribe Function This function subscribes to the GPRS service in order to receive GPRS related events e Prototype s8 adl gprsSubscribe adl gprsHdlr f GprsHandler e Parameters GprsHandler GPRS handler defined using the following type typedef s8 adl gprsHdlr f u16 Event u8 Cid The pairs events Cid received by this handler are defined below Event Call ID Description ADL GPRS EVENT RING GPRS If incoming PDP context activation is requested by the network ADL GPRS EVENT NVV CONTEXT DEACT X If the network has forced the deactivation of the Cid X ADL GPRS EVENT ME CONTEXT DEACT X If the ME has forced the deactivation of the Cid X ADL_GPRS_EVENT_NW_DETACH If the network has forced the detachment of the ME ADL_GPRS_EVENT_ME_DETACH If the ME has forced a network detachment or lost the network
34. 3 20 12 The adl adRecompact Function 168 3 20 13 The adl adGetState Function 169 3 20 14 The adl adGetCellList Function 170 3 20 15 The adl adFormat Function essssssssssesss nenne 171 3 20 16 Examiple ii terii ie een inde cane dd er kb c e EEEE EEEN EA 172 3 21 AT FCM IO Ports Service csssssssssssssssssssssse sees esee nnns 173 3 21 1 Required Header File 0 0 cc sisi 173 9 21 2 AT FPCMIMO POrs cipir iirin atiera h AAE AREE AKERRA EAR E Tee rea DEM a renin 173 3 21 29 Ports Test Macros xen inp RRRRERARRRDARAAUERAXKNORRRRRERARRRSRRRARERAXENMSRRASERA 175 3 21 4 The adl portSubscribe Function m 176 3 21 5 The adl portUnsubscribe Function ss 177 3 21 6 The adl portlsAvailable Function 0c eee eee eee 177 3 21 7 The adl portGetSignalState Function 178 3 21 8 The adl portStartSignalPolling Function cccceceeeeee escent eee 178 3 21 9 The adl portStopSignalPolling Function 180 3 22 RTC Service 181 3 22 1 Required Header File sisi 181 2 22 2 RTC service TYP S 14140240 haceseotenebe sonne someone nes emtacehe inertie 181 3 22 3 The adl rtcGetTime Function 183 3 22 4 The adl rtcConvertTime Function 444848 183 3 22 5 The adl rtcDiffTime Function 184 9 22 0 Example iei uerbi see uer metit decr gre vex noc te s E e RD eee 184 3 23 IRQ Service 185 3 23 1 Required Header File icnesiiselsulsalkial ea sedi saa kPa aa i nd n Ra da 185 3 23 2 T
35. ADL CALL GPHS FLAG constant and the activated CID According to the notified handlers return values the call setup may be launched or not if at least one handler returns the ADL CALL NO FORWARD code or higher the command will reply CME ERROR 600 to the external application otherwise if all handlers return ADL CALL FORWARD the call setup is launched ADL CALL EVENT SETUP ERROR NO A call setup from embedded or MO _SIM O external application has failed no SIM card inserted ADL CALL EVENT SETUP ERROR PIN A call setup from embedded or MO _NOT READY O external application has failed the PIN code is not entered ADL CALL EVENT SETUP ERROR A call setup from embedded or MO Error external application has failed the Error field is the returned CME ERRORH value cf AT Commands interface guide for more information wavecom Confidential Page 131 220 This document is the sole and exclusive property of WAVECOM Not to be distributed or divulged without prior written agreement Ce document est la propri t exclusive de WAVECOM Il ne peut tre communiqu ou divulgu des tiers sans son autorisation pr alable wevecom Make it wireless WM DEV OAT UGD 019 002 September 11 2006 The events returned by this handler are defined below Event Description ADL CALL FORWARD the call event shall be sent to the external application On unsolicite
36. ADL applications may subscribe to an unsolicited response in order to receive the event in the provided handler Once an application has subscribed to an unsolicited response it will have to unsubscribe from it to stop the callback function being executed every time the matching unsolicited response is sent from the Wavecom OS Multiple subscriptions each unsolicited response may be subscribed several times If an application subscribes to an unsolicited response with handler 1 and then subscribes to the same unsolicited response with handler 2 every time the ADL parser receives this unsolicited response handler 1 and then handler 2 will be executed 3 2 2 1 The adl atUnSoSubscribe Function This function subscribes to a specific unsolicited response with an associated callback function when the required unsolicited response is sent from the Wavecom OS the callback function will be executed e Prototype s16 adl atUnSoSubscribe ascii UnSostr adl atUnSoHandler t UnSohdl e Parameters UnSostr The name as a string of the unsolicited response we want to subscribe to This parameter can also be set as an adl rsplD e response ID Please refer to 8 3 19 for more information UnSohdl A handler to the callback function associated to the unsolicited response The callback function is defined as follow typedef bool adl atUnSoHandler t adl atUnsolicited t The argument of the callback function will be a adl atUnsol
37. Abnormal error on Gpio write should be signalized to Wavecom support ADL ERR FLH READ adl flhRead Abnormal error on Flash object read should be signalized to Wavecom support ADL ERR FLH DELETE adl flhErase Abnormal error on Flash object erasure should be signalized to Wavecom support e Returned values o OKon success ADL RET ERR PARAM if the parameter has an incorrect value o ADL RET ERR ALREADY SUBSCRIBED if the service is already subscribed o ADL RET ERR SERVICE LOCKED if the function was called from a low level interruption handler the function is forbidden in this context O 3 10 3 The adl errUnsubscribe Function This function unsubscribes from error service Errors generated by ADL or by the adl errHalt function will no more be handled by the error handler e Prototype s8 adl errUnsubscribe adl errHdlr f Handler e Parameters Handler Handler returned by adl errSubscribe function e Returned values OK on success O o ADL_RET_ERR_PARAM if the parameter has an incorrect value o ADL RET ERR UNKNOWN HDL if the provided handler is unknown o ADL_RET_ERR_NOT_SUBSCRIBED if the service is not subscribed wavecom confidential Page 104 220 This document is the sole and exclusive property of VVAVECOM Not to be distributed or divulged without prior written agreement Ce document est la propri t exclusive de WAVECOM Il ne peut tre communiqu ou divulgu des tier
38. An ADL OSA EVENT CLOSED confirmation event will then be received in the service handler o ADL RET ERR UNKNOWN HDL if the supplied OSA handle is unknown o ADL RET ERR SERVICE LOCKED if the function was called from a low level interruption handler the function is forbidden in this context wavecom Confidential Page 117 220 This document is the sole and exclusive property of VVAVECOM Not to be distributed or divulged without prior written agreement Ce document est la propri t exclusive de WAVECOM Il ne peut tre communiqu ou divulgu des tiers sans son autorisation pr alable wavecom Make it wireless WM DEV OAT UGD 019 002 September 11 2006 3 12 6 Example This example simply demonstrates how to use the OSA service in a nominal case error cases are not handled wavecom Confidential Page 118 220 This document is the sole and exclusive property of WAVECOM Not to be distributed or divulged without prior written agreement Ce document est la propri t exclusive de WAVECOM II ne peut tre communiqu ou divulgu a des tiers sans son autorisation pr alable weavecom pn Make it wireless WM DEV OAT UGD 019 002 September 11 2006 3 13 SMS Service ADL provides this service to handle SMS events and to send SMSs to the network 3 13 1 Required Header File The header file for the SMS related functions is adl sms h 3 13 2 The adl smsSubscribe Function This function subs
39. Command iii 19 2 7 2 AT WOPEN Command iii 19 2 8 Notes on Wavecom OS iii en e hen en see esee 20 2 9 SOC IL LY coro Sueno Hem tte uu D sata cies at E RM MENTRE MIN C T EDEN UM RUE 21 2 9 1 Software Security Memory Access Protection usussuus 21 2 9 2 Hardware Security Watchdog Protection 21 2 9 3 Safe Boot Mod seekers ex RE fede sens cKAF RERBA GEAR EREIXEPeEREIEXRIERR DER RR 21 2 10 RTE limitations e inem tese vag DST ENS nee a Y ead an DNE Na RUE 22 2 10 1 Sending large buffers through an ADL API 22 2 10 2 IROSSOrVICOS iiit be step opi sto aptae EE ERN MIU EIER 22 VV OWVOCOAY Confidential Page 5 220 This document is the sole and exclusive property of WAVECOM Not to be distributed or divulged without prior written agreement Ce document est la propri t exclusive de WAVECOM Il ne peut tre communiqu ou divulgu des tiers sans son autorisation pr alable wevecom Make it wireless WM_DEV_OAT_UGD_019 002 September 11 2006 3 AP e E R EE E E E OEE E A EN 23 3 1 Mandatory Application Code sssssssssssssssssse sen se esee nnns 23 3 1 1 Required Header File sisi 23 3 1 2 Call Stack Sizes eiecit exer chr exa rk C o RR EA E C LL aa 23 3 1 3 The adl main FUNCTION scsi suisses nea adu un re annee 25 3 2 AT Commands Service ssssssrrrrrrrrrrrrrrrtt rttr rrtt ese eene ese nsn 26 3 2 1 Required Header File i cities kae Se RE iR EXRRERIARRERERiABRRRE
40. GpioRead array GpioArray GPIO read structure array using the adl ioRead t type For each array element o the eLabel field has to be provided by the application to identify vvhich GPIO has to be read o the eState field will be updated by the function with the read value on the input e Returned values OK on success read values are updated in the GpioArray parameter Oo o ADL RET ERR PARAM on parameter error o ADL RET ERR UNKNOVN HDL if the handle is unknown o ADL RET ERR BAD STATE if one of the required GPIOs was not subscribed as an input 3 8 10 The adl ioReadSingle Function This function allows one GPIO to be read from a previously allocated handle e Prototype s32 adl ioReadSingle s32 GpioHandle u32 Gpio wavecom Confidential Page 78 220 This document is the sole and exclusive property of WAVECOM Not to be distributed or divulged without prior written agreement Ce document est la propri t exclusive de WAVECOM Il ne peut tre communiqu ou divulgu des tiers sans son autorisation pr alable weavecom a Make it wireless WM_DEV_OAT_UGD_019 002 September 11 2006 e Parameters GpioHandle Handle previously returned by adl ioSubscribe function Gpio Identifier of the GPIO using one of the adl ioLabel u union type e Returned values GPIO read value on success ADL_RET_ERR_PARAM on parameter error ADL RET ERR UNKNOWN HDL if the handle is unknown ADL RET ERR BAD S
41. NULL parameters number if Type is ADL CMD TYPE PARA or O with other type values o Port Port on which the command was sent by the external application o ParaList Parameters list if Type is ADL CMD TYPE PARA Each parameter may be accessed by the ADL GET PARAMN p i macro where p is the command handler parameter adl atCmdPreParser t pointer and iis the parameter index from O to NbPara 1 NbPara is the number of arguments received and it is a number betvveen the minimum arguments number a and the maximum arguments number b eg a 1 b 5 and AT MYCMD 0 1 2 _i can be between O and 3 1 2 If a string parameter is provided eg AT MYCMD string the quotes will be removed from the returned string eg ADL GET PARAM para O will return string without quotes in this case If a parameter is not provided eg AT MYCMD 1 the matching list element will be set to NULL eg ADL GET PARAMI para O will return NULL in this case o StrLength StrData Incoming command string buffer length and address If the incoming command from the external application is containing useless spaces or semi colon characters those will automatically be removed from the command string e g if an wavecom Confidential Page 32 220 This document is the sole and exclusive property of WAVECOM Not to be distributed or divulged without prior written agreement Ce document est la propri t exclusive de WAVE
42. Not to be distributed or divulged without prior written agreement Ce document est la propri t exclusive de WAVECOM Il ne peut tre communiqu ou divulgu des tiers sans son autorisation pr alable wavecom Make it wireless WM_DEV_OAT_UGD_019 002 September 11 2006 3 6 Flash 3 6 1 Required Header File The header file for the flash functions is adl_flash h 3 6 2 Flash Objects Management An ADL application may subscribe to a set of objects identified by an handle used by all ADL flash functions This handle is chosen and given by the application at subscription time To access to a particular object the application gives the handle and the ID of the object to access At first subscription the Handle and the associated set of IDs are saved in flash The number of flash object IDs associated to a given handle may be only changed after have erased the flash objects with the AT WOPEN 3 command For a particular handle the flash objects ID take any value from O to the ID range upper limit provided on subscription Important note Due to the internal storage implementation only up to 2000 object identifiers can exist at the same time 3 6 2 1 Flash objects write erase inner process overvievv Written flash objects are queued in the flash object storage place Each time the adl flh Write function is called the process below is done e If the object already exists it is now considered as erased i
43. OP Reve Porcio 68 3 8 3 The adl ioEventSubscribe Function ss 74 3 8 4 The adl ioHdlr f Call back Type ssess IH 74 3 8 5 The adl ioEventUnsubscribe Function seeseeseee 75 3 8 6 The adl ioSubscribe Function 76 3 8 7 The adl ioUnsubscribe Function 77 3 8 8 The adl ioSetDirection Function 77 3 8 9 The adl ioRead F nction occi ecerebpere te epu sek ge v eri ede EE tes 78 3 8 10 The adl ioReadSingle Function esess e 78 3 8 11 The adl ioWrite Function ssssssssssssssssss II e ene nen 79 3 8 12 The adl ioWriteSingle Function 80 3 8 13 The adl io GetProductType Function 80 3 8 14 The adl_ioGetFeatureGPIOList Function lese 80 3 8 15 The adl iolsFeatureEnabled Function ss 81 3 8 16 EX IMipl sas IDEE 82 3 9 Bus Service iiie tere perpe E RR og teak sae eeu bua ed pe te weeds oe pete seleg teed vee 84 3 9 1 Required Header File eee ee eee eee eee eee ess nee hehe nne 84 3 9 2 Bus TYPES ise te etx E xex x ex exem uen waa Ex bd Rise s eda UI e ERR EAR RR ERA e 84 3 9 3 The adl busSubscribe Function 94 3 9 4 The adl busUnsubscribe Function 96 3 9 5 The adl busRead Function 97 3 9 6 The adl busWrite Function essssssssssesese nemen mensem nennen 97 3 9 7 The adl busDirectRead Function ss 98 3 9 8 The adl busDirectWrite Function 99 3 9 9 EXO Oe MEE TTC NN M A a met et nn die 100 3 10 Error Management 40 408 se
44. READ option at subscription time with interruption source specific data Please refer to each interruption source related service for more information about this field data structure 3 23 6 The adl irqSubscribe Function This function allows the application to supply an interruption handler to be used later in Interruption source related service subscription e Prototype s32 adl irqSubscribe adl irgHandler f IrqHandler adl irqNotifyLevel e NotificationLevel adl irgPriorityLevel e PriorityLevel u32 Options e Parameter IrqHandler Interruption handler supplied by the application Please refer to adl_irqHandler_f type definition for more information see 3 23 7 NotificationLevel Interruption handler notification level allows the supplied handler to be identified as a low level or a high level one wavecom Confidential Page 187 220 This document is the sole and exclusive property of WWAVECOM Not to be distributed or divulged without prior written agreement Ce document est la propri t exclusive de WAVECOM Il ne peut tre communiqu ou divulgu a des tiers sans son autorisation pr alable wevecom es Make it wireless WM_DEV_OAT_UGD_019 002 September 11 2006 Please refer to adl irqNotifyLevel e type definition for more information see 8 3 23 3 PriorityLevel Interruption handler priority level allows the supplied handler to be set as a low priority or a high priority one Plea
45. Services ids oo DO x a HERI VAR Ur AEA EN NNE NAE DUE ENESENN 201 3 25 1 Required Header File sise 202 3 25 2 The adl extintSettings t Structure 2 0 eect eae 202 3 25 3 The adl extintlnfo t Structure eee eee m 203 3 25 4 The adl extintSubscribe Function 203 3 25 5 The adl extintConfig Function 204 3 25 6 The adl extintRead function 205 3 25 7 The adl extintUnsubscribe Function 205 3 2D 8 Examipl6e ipeo EE pnu aNu ENNE E E EO EEE VAEVAE 207 3 26 Execution Context Service 4 444 emen 208 3 26 1 Required Header File sse ese ense 209 3 26 2 The adl ctxlD e Typ6ez iiid ete eee gr eid re REX CERE RR HE eva 209 3 26 3 The adl ctxGetlD Function 209 3 26 4 The adl ctxGetTasklD Function 209 3 26 5 The adl ctxGetDiagnostic Function ss 210 3 26 6 The adl ctxSuspend Function 210 3 26 7 The adl ctxResume Function 211 3 26 83 Example eer nee ei ren Ne ai sans 212 8 27 ADL VariSpeed Service sssisnnrecvrerestmeentestueettenemeententre etienne ete ARR E ERE 213 3 27 1 Required Header File sisi 213 3 27 2 The adl vsMode e Type sississessesseseesmemeseeeese 213 3 27 3 The adl vsSubscribe Function 4888 214 3 27 4 The adl vsSetClockMode Function 214 3 27 5 The adl vsUnsubscribe function cece teeta eee eats 215 3 27 0 Examygple iicet tein oeste andes a E EEEa se 215 3 28 ADL DAC Servii ede ei sie ened RR ER Re aed ava RAF gua M AAA C RR eT ERES 216 3 28 1 Requir
46. access the module Parallel bus 3 9 2 2 The adl busSPliSettings t Structure This structure defines the SPI bus settings for subscription typedef struct u32 Clk Speed u32 Clk Mode u32 ChipSelect u32 ChipSelectPolarity u32 LsbFirst u32 GpioChipSelect u32 WriteHandling u32 DataLinesConf adl busSPISettings t wavecom Confidential Page 84 220 This document is the sole and exclusive property of WWAVECOM Not to be distributed or divulged without prior written agreement Ce document est la propri t exclusive de WAVECOM Il ne peut tre communiqu ou divulgu des tiers sans son autorisation pr alable wavecom Make it wireless 3 9 2 2 1 CIk Speed WM DEV OAT UGD 019 002 September 11 2006 The C1k Speed parameter is the SPI bus clock speed Allowed values are in the O 127 range The SPI clock speed is defined using the formula below Pclk 2 C1k_ Speed 2 Where Pclk is the Wireless CPU Peripheral Clock speed On the Q2686 Wireless CPU Pclk rate is set to 26 MHz Example if CIk Speed is set to O the SPI bus clock speed is set to 13 MHz 3 9 2 2 2 Cik_Mode The C1k Mode parameter is the SPI clock mode Defined values are ADL_BUS_SPI_CLK_MODE_0 rest state O data valid on rising edge ADL_BUS_SPI_CLK_MODE_1 rest state O data valid on falling edge ADL_BUS_SPI_CLK_MODE_2 rest state 1 data valid on rising edge ADL_BUS_SPI_CLK_MODE_3
47. allocated to store the read flash object e Returned values o OK on success o ADL_RET_ERR_PARAM if one at least of the parameters has a bad value ADL_RET_ERR_UNKNOWN_HDL if handle is not subscribed ADL FLH RET ERR ID OUT OF RANGE if ID is out of handle range ADL FLH RET ERR OBJ NOT EXIST if the object does not exist ADL RET ERR FATAL if a fatal error occurred ADL ERR FLH READ error event will then occur o ADL RET ERR SERVICE LOCKED if the function was called from a low level interruption handler the function is forbidden in this context OoO0o00 3 6 8 The adl flhGetFreelVlem Function This function gets the current remaining flash memory size e Prototype u32 adl flhGetFreeMem void e Returned values o Current free flash memory size in bytes wavecom Confidential Page 55 220 This document is the sole and exclusive property of WAVECOM Not to be distributed or divulged without prior written agreement Ce document est la propri t exclusive de WAVECOM Il ne peut tre communiqu ou divulgu des tiers sans son autorisation pr alable wevecom Make it wireless WM DEV OAT UGD 019 002 September 11 2006 3 6 9 The adl flhGetliDCount Function This function returns the ID count for the provided handle or the total remaining ID count e Prototype s32 adl_flhGetIDCount ascii Handle e Parameters Handle The Handle of the subscribed set of objects If set to NULL the total
48. allow to enter PIN code if provided if necessary e Prototype s32 adl_simSubscribe adi simHdlr f SimHandler ascii PinCode e Parameters SimHandler SIM handler defined using the following type typedef void adl simHdlr f u8 Event The events received by this handler are defined below Normal events ADL SIM EVENT PIN OK if PIN code is all right ADL SIM EVENT REMOVED if SIM card is removed ADL SIM EVENT INSERTED if SIM card is inserted ADL SIM EVENT FULL INIT when initialization is done Error events ADL SIM EVENT PIN ERROR if given PIN code is wrong ADL SIM EVENT PIN NO ATTEMPT if there is only one attempt left to entered the right PIN code ADL SIM EVENT PIN WAIT if the argument PinCode is set to NULL On the last three events the service is waiting for the external application to enter the PIN code Please note that the deprecated ADL SIM EVENT ERROR event has been removed since the ADL version 3 This code was mentioned in version 2 documentation but was never generated by the SIM service wavecom Confidential Page 109 220 This document is the sole and exclusive property of WAVECOM Not to be distributed or divulged without prior written agreement Ce document est la propri t exclusive de WAVECOM Il ne peut tre communiqu ou divulgu a des tiers sans son autorisation pr alable weavecom p Make it wireless WM DEV OAT UGD 019 002 September 11 2006 PinCode It is a
49. an error code in RTE mode the service is not supported in this mode The only way to debug interruption handlers is to use the Debug service to send traces readable by the Target Monitoring Tool Use of the IRQ service should be flagged in order to make an application working correctly in RTE wavecom Confidential Page 189 220 This document is the sole and exclusive property of WWAVECOM Not to be distributed or divulged without prior written agreement Ce document est la propri t exclusive de WAVECOM Il ne peut tre communiqu ou divulgu des tiers sans son autorisation pr alable wevecom Make it wireless WM_DEV_OAT_UGD_019 002 September 11 2006 3 23 7 The adl irqHandler f Call back Type This type has to be used by the application in order to provide ADL with an interruption hander e Prototype typedef bool adl irqHandler f adl irqID e Source adl irqNotifyLevel e NotificationLevel adl irqEventData t Data e Parameter Source Interruption source identifier Please refer to adl irqID e type definition for more information see 8 3 23 2 NotificationLevel Interruption handler current notification level Please refer to adl irqNotifyLevel e type definition for more information see 8 3 23 3 Data Interruption handler input output data field Please refer to adl irqEventData e type definition for more information see 8 3 23 5 e Returned values o Not
50. command When hang up return events will be received in the Call event handler if the application requires ADL to forward these events they will be forwarded to this Port parameter value e Returned values o OK on success wavecom Confidential Page 133 220 This document is the sole and exclusive property of WAVECOM Not to be distributed or divulged without prior written agreement Ce document est la propri t exclusive de WAVECOM Il ne peut tre communiqu ou divulgu a des tiers sans son autorisation pr alable wevecom Make it wireless WM DEV OAT UGD 019 002 September 11 2006 o ADL RET ERR PARAM on parameter error unavailable port o ADL RET ERR SERVICE LOCKED if the function was called from a low level interruption handler the function is forbidden in this context 3 15 7 The adl callAnswer Function This function just runs the adl callAnswerExt one on the ADL PORT OPEN AT VIRTUAL BASE port cf adl callAnswerExt description for more information Please note that events generated by the adl callAnswer will not be able to be forvvarded to any external port since the setup command was running on the Open AT port 3 15 8 The adl callAnswerExt Function This function allows the application to answer a phone call out of the call events handler e Prototype s8 adl callAnswerExt adl port e Port e Parameters Port Port on which to run the call hang up command When hang up retu
51. defines the Parallel bus Chip Select typedef struct u8 Type u8 Id u8 pad 2 adl busParallelCs t 3 9 2 4 1 Type The Type parameter defines the Chip Select signal type The only available value is ADL BUS PARA CS TYPE CS All other values are reserved for future use wavecom Confidential Page 87 220 This document is the sole and exclusive property of WAVECOM Not to be distributed or divulged without prior written agreement Ce document est la propri t exclusive de WAVECOM Il ne peut tre communiqu ou divulgu a des tiers sans son autorisation pr alable wavecom TER Make it wireless WM DEV OAT UGD 019 002 September 11 2006 3 9 2 4 2 Id The Id parameter defines the Chip Select identifier used available values are 2 for CS2 pin and 3 for CS3 pin 3 9 2 5 The adl busParallelTimingCfg t Structure This type defines the Parallel bus timings typedef struct u8 AccessTime u8 SetupTime u8 HoldTime u8 TurnaroundTime u8 OpToOpTurnaroundTime u8 pad 3 adl busParallelTimingCfg t The opToOpTurnaroundTime parameter is reserved for future use The other parameters configuration defines the parallel bus timing in 26 MHz cycles number one cycle duration is 1 26 MHz 38 5 ns according to the bus mode required at subscription time 3 9 2 5 1 Motorola Modes Timing The following timing behavior applies when the ADL BUS PARALLEL MODE ASYNC MOTOROLA LOW E signal low polarity o
52. delay Therefore in order not to miss any event any application has to handle the case of a startup delay of 20 seconds Moreover if the product reset is due to a fatal error from Open AT application or from Wavecom OS the adl main function s adlInitType parameter will be set to the ADL INIT REBOOT FROM EXCEPTION value ADL may generates errors which will be handled by an error handler wavecom Confidential Page 103 220 This document is the sole and exclusive property of WWAVECOM Not to be distributed or divulged without prior written agreement Ce document est la propri t exclusive de WAVECOM Il ne peut tre communiqu ou divulgu des tiers sans son autorisation pr alable wavecom Make it wireless WM_DEV_OAT_UGD_019 002 September 11 2006 ErrorID ADL function Cause ADL_ERR_MEM GET adl memGet The product ran out of heap memory or the heap memory is composed of free blocks smaller than the required size ADL ERR MEM RELEASE adl memRelease The provided pointer was not provided by the adl memGet function or it vvas already released ADL ERR IO ALLOCATE adl ioSubscribe Abnormal error on Gpio subscription should be signalized to Wavecom support ADL ERR IO RELEASE adl ioUnsubscribe Abnormal error on Gpio unsubscription should be signalized to Wavecom support ADL ERR IO READ adl ioRead Abnormal error on Gpio read should be signalized to Wavecom support ADL ERR IO WRITE adl ioWrite
53. esse e she e she hne hene nnn 103 3 10 1 Required Header File esse ense 103 3 10 2 The adl errSubscribe Function 103 3 10 3 The adl errUnsubscribe Function ss 104 3 10 4 The adl errHalt Function cece eee ence eee aai 105 3 10 5 The adl errEraseAllBacktraces Function 105 3 10 6 The adl errStartBacktraceAnalysis Function 2 105 3 10 7 The adl errGetAnalysisState Function 106 3 10 8 The adl errRetrieveNextBacktrace FUNCTION 282 107 3 11 SIM Service 109 3 11 1 Required Header File cece eee eee eee eee eee eee 109 3 11 2 The adl simSubscribe Function 1 0 0 cece mm 109 3 11 3 The adl simUnsubscribe Function cece eee 110 3 11 4 The adl_simGetState Function 4 440 111 3 12 Open SIM Access Service ccc e eee nee e eee e nett nee sees eese nnns 112 3 12 1 Required Header File sisi 112 3 12 2 The adl osaSubscribe Function 4408 112 3 12 3 The adl osaHandler f call back Type 113 3 12 4 The adl osaSendResponse Function 115 3 12 5 The adl osaUnsubscribe Function cece eee eee 116 3 126 _EXAMPls cncscctencencsncttaaencietenkhaachanvhdekhesth div idekhdathaaehdiehsathdamhnewncdees 118 3 13 SMS S ertVICce iii EE RR HRESEERRIRRORKXG need R unions Saeed 119 3 13 1 Required Header File ss memes nnn nn 119 wavecom Confidential Page 7 220 This document is the sole and exclusive property of WAVECOM Not to be distributed or divulged without prior written agreement Ce document est la propri t
54. handler the function is forbidden in this context 3 14 6 The adi msgHandler f call back Type Such a call back function has to be supplied to ADL through the adl msgSubscribe interface in order to receive incoming messages Messages will be received through this handler each time the supplied filter conditions are fulfilled e Prototype typedef void adl msgHandler f u32 MsgIdentifier adl ctxID e Source u32 Length void Data e Parameters Msgldentifier Incoming message identifier Source Source context identifier from vvhich the message was sent Lenght Message body length in bytes This length should be O if the message does not include a body wavecom Confidential Page 125 220 This document is the sole and exclusive property of WWAVECOM Not to be distributed or divulged without prior written agreement Ce document est la propri t exclusive de WAVECOM Il ne peut tre communiqu ou divulgu des tiers sans son autorisation pr alable wevecom es Make it wireless WM_DEV_OAT_UGD_019 002 September 11 2006 Data Message body buffer address This address should be NULL if the message does not include a body 3 14 7 The adi msgUnsubscribe Function This function un subscribes from a previously subscribed message filter Associated message handler will no longer receive the filtered messages e Prototype S32 adl msgUnsubscribe s32 MsgHandle e Parameters MsgHandle
55. interruption source s identifier s when an SCTU interruption occurs When an interruption handler is subscribed with the ADL_IRQ OPTION AUTO READ option and connected to the SCTU service the SourceData field in the adl irqEventData t input parameter of this handler will have to be cast to this type in order to handle correctly the information typedef struct u8 SourceMask Interruption sources mask adl sctuInfo t e Parameter SourceMask SCTU interruption source bits mask this will be a bit vvise OR of one or several of the constants below Constant Use ADL SCTU IT SRC OVERFLOW Counter overflow interruption source ADL SCTU IT SRC COMP CHANNEL O Comparator channel O interruption i mM 2 i source ADL SCTU IT SRC COMP CHANNEL 1 Comparator channel 7 interruption i mM B i source ADL SCTU IT SRC COMP CHANNEL 2 Comparator channel 2 interruption i mE i i i source ADL SCTU IT SRC COMP CHANNEL 3 Comparator channel 3 interruption i mn i E i source wavecom Confidential Page 194 220 This document is the sole and exclusive property of WWAVECOM Not to be distributed or divulged without prior written agreement Ce document est la propri t exclusive de WAVECOM Il ne peut tre communiqu ou divulgu des tiers sans son autorisation pr alable wevecom es Make it wireless WM_DEV_OAT_UGD_019 002 September 11 2006 3 24 3 The adl sctuSubscribe Function This function allows th
56. is allocated to the Open AT application The Open AT application is seen as a Real Time task in the Wavecom OS and each time this task runs the Wavecom RAM protection is activated If the Open AT application tries to access this RAM then an exception occurs and the software resets In case of illegal RAM access the stored back trace will display the ARM exception 1 xxx statement where xxx is the address that the application was attempting to access 2 9 2 Hardware Security Watchdog Protection All software both Open AT application amp Wavecom OS is protected from reaching a dead end lock by a 5 seconds external watchdog reset circuit If one task uses the CPU for more than the allovved time the external watchdog circuit resets the Wireless CPU If a crash due to this vvatchdog protection is detected the stored back trace will display the Watchdog Reset statement 2 9 3 Safe Boot Mode A specific Safe Boot mode is available on the Wireless CPU This mode is activated when a key combination configured through the AT WOPEN 8 command mode is pressed during Wireless CPU reset It is useful when the embedded application causes an exception soon after the Wireless CPU resets without any possibility for the external application to send any AT command to disable the Open AT command wavecom Confidential Page 21 220 This document is the sole and exclusive property of VVAVECOM Not to be distributed or divulged w
57. o ADL RET ERR SERVICE LOCKED if the function was called from a low level interruption handler the function is forbidden in this context wavecom Confidential Page 164 220 This document is the sole and exclusive property of WAVECOM Not to be distributed or divulged without prior written agreement Ce document est la propri t exclusive de WAVECOM Il ne peut tre communiqu ou divulgu des tiers sans son autorisation pr alable wevecom D Make it wireless WM DEV OAT UGD 019 002 September 11 2006 3 20 8 The adl adinfo Function This function provides information on the requested A amp D cell e Prototype s32 adl adInfo s32 CellHandle adl adInfo t Info e Parameters CellHandle A amp D cell handle returned by adi adSubscribe function Info Information structure on requested cell based on following type typedef struct u32 identifier identifier u32 size entry size void data pointer to stored data u32 remaining remaining writable space unless finalized bool finalised TRUE if entry is finalized adl_adInfo t e Returned values o OKon success o ADL RET ERR PARAM on parameter error o ADL RET ERR UNKNOWN HDL if the handle was not subscribed o ADL RET ERR BAD STATE if the required cell is a not finalized or an undefined size o ADL RET ERR SERVICE LOCKED if the function was called from a low level interruption handler the function is forbidde
58. only for this handle it will be automaticaly stopped e Prototype s8 adl portUnsubscribe u8 Handle e Parameters Handle Handle previously returned by the adl portSubscribe function e Returned values o OKon success o ADL RET ERR UNKNOWN HDL if the provided handle is unknown o ADL RET ERR NOT SUBSCRIBED if the service is not subscribed o ADL RET ERR SERVICE LOCKED if the function was called from a low level interruption handler the function is forbidden in this context 3 21 6 The adl portlisAvailable Function This function checks if the required port is currently opened or not e Prototype bool adl portIsAvailable adl port e Port e Parameters Port Port from which to require the current state e Returned values o TRUE if the port is currently opened o FALSE if the port is closed or if it does not exists Notes o The function will always return TRUE on the ADL_PORT_GSM_BASE port o The function will always return TRUE on the ADL PORT GPRS BASE port if the GPRS feature is enabled alvvays FALSE otherwise wavecom Confidential Page 177 220 This document is the sole and exclusive property of WWAVECOM Not to be distributed or divulged without prior written agreement Ce document est la propri t exclusive de WAVECOM Il ne peut tre communiqu ou divulgu des tiers sans son autorisation pr alable wevecom er tui Make it wireless WM DEV OAT UGD 019 002 September 11 20
59. please refer to this structure description 8 3 9 2 8 The adl busAccess t Type for more information DataLen Number of items to write on the bus Data Data buffer to write on the bus Note Items bit size is defined in the pAccessMode configuration structure e Returned values OK on success ADL RET ERR UNKNOWN HDL if the provided handle is unknown ADL RET ERR PARAM if a parameter has an incorrect value ADL RET ERR BAD STATE if there is no acknowledgement from the remote chip on the bus I2C bus only O O O 3 9 7 The adl busDirectHead Function This function reads data about previously subscribed Parallel bus type This function is not usable with the SPI or I2C bus e Prototype s32 adl busDirectRead s32 Handle u32 ChipAddress u32 DataLen void Data e Parameters Handle Handle previously returned by the adl busSubscribe function ChipAddress Chip address configuration This address has to be a combination of the desired address bits to set Available address bits are returned in a mask at subscription time DataLen Number of items to read from the bus wavecom Confidential Page 98 220 This document is the sole and exclusive property of WWAVECOM Not to be distributed or divulged without prior written agreement Ce document est la propri t exclusive de WAVECOM Il ne peut tre communiqu ou divulgu des tiers sans son autorisation pr alable wevecom Make it w
60. port in order to monitor several signals the polling time interval is set up by the first function call polling tme parameters are ignored or further calls If the wavecom Confidential Page 178 220 This document is the sole and exclusive property of WWAVECOM Not to be distributed or divulged without prior written agreement Ce document est la propri t exclusive de WAVECOM Il ne peut tre communiqu ou divulgu des tiers sans son autorisation pr alable weavecom gt G nie Make it wireless WM DEV OAT UGD 019 002 September 11 2006 function is called several times on the same port amp signal additional calls will be ignored Once a polling process is started on a port s signal this one is monitored each time this signal state changes a ADL PORT EVENT XXX STATE CHANGE event is sent to all the handlers which have required a polling process on it Whatever is the number of requested signals and subscribers to this port polling process a single cyclic timer will be internally used for this one e Prototype s8 adl portStartSignalPolling u8 Handle adl port e Port adl portSignal e Signal u8 PollingTimerType u32 PollingTimerValue e Parameters Handle Handle previously returned by the adl portSubscribe function Port Port on which to run the polling process Only physical output related ports UARTX amp USB ones used as physical ports or with the 27 010 protocol may be use
61. port state may be known using the ADL AT FCM port service e Prototype s8 adl fcmSubscribe adl fcmFlow e Flow adl fcmCtrlHdlr f CtrlHandler adl fcmDataHdlr f DataHandler wavecom Confidential Page 59 220 This document is the sole and exclusive property of WWAVECOM Not to be distributed or divulged without prior written agreement Ce document est la propri t exclusive de WAVECOM Il ne peut tre communiqu ou divulgu a des tiers sans son autorisation pr alable weaevecom mds Make it wireless WM DEV OAT UGD 019 002 September 11 2006 e Parameters Flow The allowed values are the available ports of the adl port e type Only ports with the FCM capability may be used with this service ie all ports except the ADL PORT OPEN AT VIRTUAL BASE and not SPP ADL PORT BLUETOOTH VIRTUAL BASE based ones Please note that the ad1 fcmFlow e type is the same than the ad1 port e one except the fact that is may handle some additional FCM specific flags see below Previous versions FCM flows identifiers have been kept for ascendant compatibility Hovvever these constants should be considered as deprecated and the adl port e type members should now be used instead define ADL FCM FLOW V24 UART1 ADL PORT UART1 define ADL FCM FLOW V24 UART2 ADL PORT UART2 define ADL FCM FLOW V24 USB ADL PORT USB define ADL FCM FLOW GSM DATA ADL PORT GSM BASE define ADL FCM FLOW GPRS ADL PORT GPRS BASE To pe
62. request event was sent to the application but no response was posted back to the VVavecom firmware Vvhen this event is received the OSA service is automatically un subscribed and the Wavecom firmware resumes the local SIM connection ADL OSA EVENT CLOSED The application will receive this event after un subscribing from the OSA service The Wavecom firmware has resumed the local SIM connection Param Event parameters using the following type typedef union adl_osaStatus_e ErrorEvent struct u16 Length u8 Data RequestEvent adi osaE ventParam u wavecom Confidential Page 114 220 This document is the sole and exclusive property of WAVECOM Not to be distributed or divulged without prior written agreement Ce document est la propri t exclusive de WAVECOM Il ne peut tre communiqu ou divulgu des tiers sans son autorisation pr alable wevecom Make it wireless WM_DEV_OAT_UGD_019 002 September 11 2006 This union is used depending on the event type Event Type Event Parameter ADL_OSA_EVENT_INIT_SUCCESS Set to NULL ADL_OSA_EVENT_INIT_FAILURE Set to NULL ADL_OSA_EVENT_ATR_REQUEST Set to NULL ADL OSA EVENT APDU REQUEST RequestEvent structure set Length APDU request buffer length Data APDU request data buffer address ADL_OSA_EVENT_SIM_ERROR ErrorEvent va ue set according to the status previously sent back through the adl_o
63. steps e Returned values o ERROR if the timer wasn t found or couldn t be stopped o the remaining time of the timer before it expires unit according to the TimerValue parameter o ADL RET ERR BAD HDL if the provided handler is not the timer s one o ADL RET ERR BAD STATE if the handler has already expired wavecom Confidential Page 43 220 This document is the sole and exclusive property of WAVECOM Not to be distributed or divulged without prior written agreement Ce document est la propri t exclusive de WAVECOM Il ne peut tre communiqu ou divulgu des tiers sans son autorisation pr alable wavecom Make it wireless WM DEV OAT UGD 019 002 September 11 2006 o ADL RET ERR SERVICE LOCKED if the function was called from a low level interruption handler the function is forbidden in this context 3 3 4 Example wavecomCconfidential Page 44 220 This document is the sole and exclusive property of WAVECOM Not to be distributed or divulged without prior written agreement Ce document est la propri t exclusive de WAVECOM Il ne peut tre communiqu ou divulgu des tiers sans son autorisation pr alable weavecom a Make it wireless WM_DEV_OAT_UGD_019 002 September 11 2006 3 4 Memory Service 3 4 1 Required Header File The header file for the memory functions is adl memory h 3 4 2 The adl memGetlinfo Function This function returns information about
64. string containing the PIN code text to enter If it is set to NULL or if the provided code is incorrect the PIN code will have to be entered by the external application This argument is used only the first time the service is subscribed It is ignored on all further subscriptions e Returned value o ADL RET ERR SERVICE LOCKED if the function was called from a low level interruption handler the function is forbidden in this context o OKifthe function is successfully executed 3 11 3 The adl simUnsubscribe Function This function unsubscribes from SIM service The provided handler will not receive SIM events any more e Prototype s32 adl simUnsubscribe adl simHdlr f Handler e Parameters Handler Handler used with adl SimSubscribe function e Returned value o ADL RET ERR SERVICE LOCKED if the function was called from a low level interruption handler the function is forbidden in this context o OKifthe function is successfully executed wavecom Confidential Page 110 220 This document is the sole and exclusive property of WWAVECOM Not to be distributed or divulged without prior written agreement Ce document est la propri t exclusive de WAVECOM II ne peut tre communiqu ou divulgu a des tiers sans son autorisation pr alable wavecom Make it wireless WM DEV OAT UGD 019 002 September 11 2006 3 11 4 The adl simGetState Function This function gets the current SIM service state e Pro
65. subscribed commands are concatenated command handlers will not be notified e Since ADL uses its own internal process of the WIND indications the current value of the AT WIND command may not be the same when the AT WOPEN command state is O or 1 2 4 Open AT Memory Resources The available memory resources for the Open AT applications are listed below OS 6 61 Q2686 Wireless CPU H type memory 256 1600 Kbytes of ROM application code default 832 Kbytes for configuration see AT WWOPEN command 256 Kytes of RAM 128 Kbytes of Flash Object Data 0 1344 Kbytes of Application amp Data Storage Volume default 768 Kbytes for configuration see AT VWVOPEN command The total available flash space for both Open AT application place and A amp D storage place is 1600 Kbytes The maximum A amp D storage place size is 1344 Kbytes about 1 3 Mbytes usable for Wavecom OS upgrade capability In this case the Open AT application maximum size will be 256 Kbytes wavecom Confidential Page 16 220 This document is the sole and exclusive property of WAVECOM Not to be distributed or divulged without prior written agreement Ce document est la propri t exclusive de WAVECOM Il ne peut tre communiqu ou divulgu des tiers sans son autorisation pr alable wevecom e Make it wireless WM DEV OAT UGD 019 002 September 11 2006 The minimum A amp D storage place size is O Kbytes u
66. task was running e ADL CTX HIGH LEVEL IRO HANDLER if a high level interruption handler was running 3 26 5 The adl ctxGetDiagnostic Function This function allows the application to retrieve information about the current application s execution contexts e Prototype u32 adl ctxGetDiagnostic void e Returned values Bit mask where one or several of the following values are set with a bitwise OR combination o ADL CTX DIAG NO IRQ PROCESSING if the Open AT IRQ processing mechanism has not been started interruption handlers stack sizes have not been supplied o ADL CTX DIAG BAD IRQ PARAM reserved for future use o ADL CTX DIAG NO HIGH LEVEL IRQ HANDLER if high level interruption handlers are not supported high level handler stack size is not supplied 3 26 6 The adl ctxSuspend Function This function allows the application to suspend the Open AT task process This process can be resumed later thanks to the adl ctxResume function which should be called from an interruption handler wavecom Confidential Page 210 220 This document is the sole and exclusive property of WWAVECOM Not to be distributed or divulged without prior written agreement Ce document est la propri t exclusive de WAVECOM Il ne peut tre communiqu ou divulgu a des tiers sans son autorisation pr alable wevecom es Make it wireless WM_DEV_OAT_UGD_019 002 September 11 2006 e Prototype s32 adl_ctxSuspend adl_ctxID_e Tas
67. the falling or the rising edge of the input signal or both vvith debounce filter only o The input signal is filtered by one of the following processes e Bypass no filter e Debounce a stable state is required for a configurable duration before generating the interruption Figure 12 ADL External Interruption Service Example of Interruption with Debounce Period E g EXTINT is the input signal extint ch is the generated interruption When the debounce period equals 4 the Wireless CPU waits for a stable signal during 4 cycles 7 8 ms steps before generating the interruption e Stretching the signal is stretched in order to detect even small glitches in the signal cik32k T LLL LL LLL LLL Le Figure 13 ADL External Interruption Service Example of Interruption with Stretching Process E g EXTINT is the input signal extint_ch is the generated interruption With the stretching process the generated interruptions are stretched in time in order not to miss any pulses on the input signal o Interruption generated because an External Interruption pin is always pre acknowledged whatever is the subscribed option in the IRO service wavecom Confidential Page 201 220 This document is the sole and exclusive property of VVAVECOM Not to be distributed or divulged without prior written agreement Ce document est la propri t exclusive de WAVECOM Il ne peut tre communiqu ou divulgu a des tiers sans son autorisation pr al
68. the sole and exclusive property of WWAVECOM Not to be distributed or divulged without prior written agreement Ce document est la propri t exclusive de WAVECOM Il ne peut tre communiqu ou divulgu des tiers sans son autorisation pr alable wavecom Make it wireless WM_DEV_OAT_UGD_019 002 September 11 2006 3 16 10 The adl gprsUnsubscribe Function This function unsubscribes from the GPRS service The provided handler will not receive any more GPRS events e Prototype s8 adl gprsUnsubscribe adl gprsHdlr f Handler e Parameters Handler Handler used with adl gprsSubscribe function e Returned values This function returns OK on success or a negative error value Possible error values are Error value Description ADL_RET_ERR_PARAM parameter error ADL_RET_ERR_LUNKNOWN_HDL the provided handler is unknown ADL RET ERR NOT SUBSCRIBED the service is not subscribed ADL_RET_ERR_BAD_STATE the service is still processing another GPRS API application should wait for the corresponding event indication of end of processing in the GPHS handler before calling this function ADL RET ERR SERVICE LOCKED f the function was called from a low level interruption handler the function is forbidden in this context 3 16 11 The adl gprsisAniPAddress Function This function checks if the provided string is a valid IP address Valid IP address strings arebased on the a b c d form
69. was called from a low level interruption handler the function is forbidden in this context 000000 O 3 21 9 The adl portStopSignalPolling Function This function stops a running polling process on a required port signal for the provided subscribed handle The associated handler will not receive the ADL PORT EVENT XXX STATE CHANGE events related to this signal port anymore The internal polling process cyclic timer will be stopped as soon as the last subscriber to the current running polling process has call this function e Prototype s8 adl portStopSignalPolling u8 Handle adl port e Port adl portSignal e Signal e Parameters Handle Handle previously returned by the adl portSubscribe function Port Port on which the polling process to stop is running Signal Signal on which the polling process to stop is running e Returned values OK on success ADL_RET_ERR_PARAM on parameter error ADL_RET_ERR_UNKNOWN_HDL if the provided handle is unknown ADL RET ERR NOT SUBSCRIBED if the service is not subscribed ADL RET ERR BAD STATE if the required port is not opened ADL RET ERR BAD HDL if there is no running polling process for this Handle Port Signal combination ADL RET ERR SERVICE LOCKED if the function was called from a low level interruption handler the function is forbidden in this context 000000 O wavecom Confidential Page 180 220 This document is the sole and exclusive proper
70. 0 channel ports there is an additional Open AT virtual port usable to send commands only with Open AT applications in order not to be disturbed or not to disturb applications running on the Wireless CPU physical ports The ADL AT command stacks architecture is resumed with the scheme below adl atCmdCreate AT Open AT ADL Response Handler Open AT app virtual port command CT responses stack UART 1 port y Open AT app UART 2 port ADL Open AT app stack External app Open AT app responses Logical channel X responses port Other AT4 ADL Open AT app responses stacks External app Figure 4 ADL AT Command Stacks Architecture wavecom Confidential Page 41 220 This document is the sole and exclusive property of VVAVECOM Not to be distributed or divulged without prior written agreement Ce document est la propri t exclusive de WAVECOM Il ne peut tre communiqu ou divulgu des tiers sans son autorisation pr alable wevecom Make it wireless WM DEV OAT UGD 019 002 September 11 2006 3 3 Timers 3 3 1 Required Header Files The header file for the functions dealing with timers is adl TimerHandler h 3 3 2 The adl tmrSubscribe Function This function starts a timer vvith an associated callback function The callback function will be executed as soon as the timer expires Note Since the Wavecom products time granularity is 18 5 ms the 100 ms st
71. 002 September 11 2006 List of Figures Figure 1 General software architecture 15 Figure 2 Error when trying to send too large a data buffer through an API 22 Figure 3 Open AT RAM Mapping Call Stack Space 24 Figure 4 ADL AT Command Stacks Architecture ss 41 Figure 5 Open AT RAM Mapping with adl memInfo t Structure Field Names A T 46 Figure 6 Flow Control Manager Representation s 57 Figure 7 Motorola Modes Timing Example cccceeeeee ee eee eee ee ee ee eeeeeeeeeees 88 Figure 8 Intel Mode Timing Read Process Example esses 89 Figure 9 Intel Mode Timing Write Process Example sssseesssss 89 Figure 10 A amp D cell content install vvindow esessessessesesesesenee 167 Figure 11 Q268X Wireless CPUs SCTU Architecture 193 Figure 12 ADL External Interruption Service Example of Interruption with Debounce PEO inno a nir Rn e Rad ier ten UB ERREUR Sn Fed Risa Ke RARE 201 Figure 13 ADL External Interruption Service Example of Interruption with Stretching ProCeSSs iie ex Pe x UAR FOX UR WoUY Re XR PORE Meu eoex veux scg vexW seas yarns 201 wavecom Confidential Page 12 220 This document is the sole and exclusive property of WAVECOM Not to be distributed or divulged without prior written agreement Ce document est la propri t exclusive de WAVECOM II ne peut tre communiqu
72. 02 220 This document is the sole and exclusive property of WWAVECOM Not to be distributed or divulged without prior written agreement Ce document est la propri t exclusive de WAVECOM Il ne peut tre communiqu ou divulgu a des tiers sans son autorisation pr alable wevecom Make it wireless WM DEV OAT UGD 019 002 September 11 2006 3 25 3 The adl extintinfo t Structure This structure allovvs the application to get the external interruption pin input status at any time When an interruption handler is subscribed with the ADL IRO OPTION AUTO READ option and plugged on the Extlnt service the SourceData field in the adl irqEventData t input parameter of this handler must be cast to this type in order to handle the information correctly typedef struct u8 PinState External Interruption Pin input status adi extintInfo t e Parameter PinState Current state 0 1 of the input signal plugged on the external interruption pin 3 25 4 The adl extintSubscribe Function This function allows the application to subscribe to the Extlnt service Each External Interruption pin can only be subscribed one time Once subscribed the pin is no more configurable through the AT commands interface with AT WIPC or AT WEFM commands e Prototype s32 adl extintSubscribe adl extintID e ExtIntID s32 LowLevellrqHandle s32 HighLevellrqHandle adl extintSettings t Settings e Parameters ExtIntiID Extern
73. 02 September 11 2006 By default ie without any Open AT application or if the application does not use the FCM service all the Wireless CPU s ports are processed by the Wavecom OS The default behaviors are e When a GSM CSD call is set up the GSM CSD data port is directly connected to the UART port where the ATD command was sent e When a GPRS session is set up the GPRS data port is directly connected to the UART port where the ATD or AT CGDATA command was sent e When a Bluetooth peripheral is detected amp connected through an SPP based profile a local data bridge may be set up between a Bluetooth virtual data port and the required UART port using the AT WLDB command Once subscribed by an Open AT application vvith the FCM service a port is no more available to be used with the AT commands by an external application The available ports are the ones listed in the ADL AT FCM Ports service e ADL PORT UART X ADL PORT UART X VIRTUAL BASE identifiers may be used to access to the Wireless CPU s physicals UARTS or logical 27 010 protocol ports e ADL PORT GSM BASE identifier may be used to access to a remote modem connected through a GSM CSD call data flow e ADL PORT GPRS BASE identifier may be used to exchange IP packets with the operator netvvork and the Internet e ADL PORT BLUETOOTH VIRTUAL BASE may be used to access to a connected Bluetooth device data stream with the Serial Port Profile SPP The 1 switch
74. 06 3 21 7 The adl portGetSignalState Function This function returns the required port signal state e Prototype s8 adl portGetSignalState adl port e Port adl portSignal e Signal e Parameters Port Port from which to require the current signal state Only physical output related ports UARTX amp r USB ones used as physical ports or with the 27 010 protocol may be used with this function Signal Signal from which to query the current state based on the following type typedef enum ADL_PORT_SIGNAL_CTS ADL_PORT_SIGNAL_DSR ADL PORT SIGNAL LAST adl portSignal e Signal are detailed below ADL PORT SIGNAL CTS Required port CTS input signal physical pin in case of a physical port UARTX emulated logical signal in case of a 27 010 logical port ADL PORT SIGNAL DSR Required port DSR input signal physical pin in case of a physical port UARTX emulated logical signal in case of a 27 010 logical port e Returned values o The signal state 0 1 on success o ADL RET ERR PARAM on parameter error o ADL RET ERR BAD STATE if the required port is not opened 3 21 8 The adl portStartSignalPolling Function This function starts a polling process on a required port signal for the provided subscribed handle Only one polling process can run at a time A polling process is defined on one port for one or several of this port s signals It means that this function may be called several times on the same
75. 1 2006 2 6 Inner AT Commands Configuration The ADL library needs for its internal processes to set up some AT command configurations that differ from the default values The concerned commands are listed hereafter AT Command Fixed value AT CMEE 1 AT WIND All indications AT CREG 2 AT CGREG 2 AT CRC 1 AT CGEREP 2 ATV 1 ATQ O A WIND unsolicited indications are always required by the ADL library The WIND 3 indication product reset will be enabled only if the external application required it The above fixed values are set up internally by ADL This means that all related error codes for CMEE or unsolicited results are always all available to all Open AT ADL applications without requiring them to be sent using the corresponding configuration command Important caution User is strongly advised against modifying the current values of these commands from any Open AT application Wavecom would not guarantee ADL correct processing if these values are modified by any embedded application External applications may modify these AT commands parameter values without any constraints These commands and related unsolicited results behavior is the same with our without a running ADL application If errors codes or unsolicited results related to these commands are subscribed and then forvvarded by an ADL application to an external one these results will be displayed for
76. 1 ADL IO HIGH Read inputs ReadValue adl ioReadSingle MyGpioHandlel ADL IO 92686 GPIO 2 ReadValue adl ioReadSingle MyGpioHandle2 ADL IO Q2686 GPIO 19 Unsubscribe from the GPIO services adl ioUnsubscribe MyGpioHandlel adl ioUnsubscribe MyGpioHandle2 Unsubscribe from the GPIO event service adl ioUnsubscribe MyGpioEventHandle wavecom Confidential Page 83 220 This document is the sole and exclusive property of WWAVECOM Not to be distributed or divulged without prior written agreement Ce document est la propri t exclusive de WAVECOM Il ne peut tre communiqu ou divulgu a des tiers sans son autorisation pr alable wavecom Make it wireless WM DEV OAT UGD 019 002 September 11 2006 3 9 Bus Service ADL provides a bus service to handle SPI I2C amp Parallel bus operations 3 9 1 Required Header File The header file for the bus functions is adl bus h 3 9 2 Bus Types 3 9 2 1 The adl busType e Type This structure defines the bus available for subscription on the Wireless CPU typedef enum ADL BUS SPI1 1 ADL BUS SPI2 ADL BUS I2C 4 ADL BUS PARALLEL 6 adl busType e The ADL BUS SPI1 constant is used to access the Wireless CPU SPI1 bus The ADL BUS SPI2 constant is used to access the Wireless CPU SPI2 bus The ADL BUS I2C constant is used to access the Wireless CPU I2C bus The ADL BUS PARALLEL constant can be used to
77. 19 002 September 11 2006 o ADL RET ERR SERVICE LOCKED if the function was called from a low level interruption handler the function is forbidden in this context Note for RTE In RTE mode calling this API will cause a message box display prompting the user for installing the desired A amp D cell content or not see Figure 10 A amp D cell content install vvindow rte Be1r Sag t3 Do you want to continue p The application is going to install the 4 amp D cell ID Ox00000000 ua e Clicking Yes will install the cell content on the target and stop the RTE mode Clicking No will cause the API to return with an error code Figure 10 A amp D cell content install window If the user selects No the API will fail and return the ADL AD RET ERROR code If the user selects Yes the cell content is installed the Wireless CPU resets and the RTE mode is automatically closed wavecom Confidential Page 167 220 This document is the sole and exclusive property of WWAVECOM Not to be distributed or divulged without prior written agreement Ce document est la propri t exclusive de WAVECOM Il ne peut tre communiqu ou divulgu des tiers sans son autorisation pr alable wevecom es Make it wireless WM_DEV_OAT_UGD_019 002 September 11 2006 3 20 12 The adi adRecompact Function This function starts the re compaction process which will release the deleted cell spaces and IDs Caution
78. 2 September 11 2006 3 2 4 3 Example callback function void atabc Handler adl atCmdPreParser t paras Unsubscribe therefore the command at abc will only work once adl atCmdUnSubscribe attabc adl atCmdHandler t atabc Handler if paras gt Type ADL CMD TYPE READ adl atSendResponsePort ADL AT RSP paras gt Port r nhandling attabc r n else if paras gt Type ADL CMD TYPE TEST adl_atSendResponsePort ADL AT RSP paras gt Port r nhandling attabc r n else if paras gt Type ADL CMD TYPE ACT adl_atSendResponsePort ADL_AT_RSP paras gt Port r nhandling attabc r n else if paras gt Type ADL CMD TYPE PARA ascii buffer 25 wm_strcpy buffer r nhandling attabc wm_strcat buffer ADL GET PARAM paras 0 wm strcat buffer r n adl atSendResponsePort ADL AT RSP paras gt Port buffer J adl atSendResponsePort ADL AT RSP paras Port r nOK r n J main function void adl main adl InitType e adlInitType Subscribe to the at abc command in all modes and accepting 1 parameter 2 adl atCmdSubscribe attabc adl atCmdHandler t atabc Handler ADL CMD TYPE TEST ADL CMD TYPE READ ADL CMD TYPE ACT ADL CMD TYPE PARA Ox0011 3 2 5 Run AT Commands 3 2 5 1 The adl atCmdCreate Function This function sends a command on the required port and allows the subscription to several responses and intermediates responses with one associated ca
79. 2 adl vsSubscribe void e Parameters None e Returned values o A positive or null value on success e VariSpeed service handle to be used in further service function calls o A negative error value otherwise e ADL RET ERR ALREADY SUBSCRIBED if the service has already been subscribed e ADL RET ERR NOT SUPPORTED if the Real Time enhancement feature is not enabled on the Wireless CPU e ADL RET ERR SERVICE LOCKED if the function was called from a low level interruption handler the function is forbidden in this context 3 27 4 The adl vsSetClockiViode Function This function allows the application to modify the speed of the CPU clock e Prototype s32 adl vsSetClockMode s32 VsHandle adl vsMode e ClockMode e Parameters VsHandle VariSpeed service handle previously returned by the adl vsSubscribe function ClockMode Required clock mode Refer to adl vsMode e type definition for more information see 8 3 27 2 e Returned values o OK on success o ADL RET ERR UNKNOWN HDL if the supplied handle is unknown o ADL RET ERR PARAM if the supplied clock mode value is wrong o ADL RET ERR SERVICE LOCKED if the function was called from a low level interruption handler the function is forbidden in this context wavecom Confidential Page 214 220 This document is the sole and exclusive property of WAVECOM Not to be distributed or divulged without prior written agreement Ce document est la propri t exclusive de W
80. 7 GPIO 1 2 ADL IO Q2687 GPIO 2 ADL IO 02687 GPIO 3 ADL IO 02687 GPIO 43 ADL IO Q2687 GPIO 44 ADL IO Q2687 PAD Ox7FFFFFFF adi ioLabel 02687 e Note As soon as a multiplexed feature is used or no longer used an ADL IO EVENT FEATURE ENABLED ADL IO EVENT FEATURE DISABLED event is notified to the Open AT application in order to inform it that the related GPIOs are no longer available or available again 3 8 2 3 The adl ioDirection e Type This type represents the direction used for a GPIO typedef enum ADL_IO OUTPUT ADL IO INPUT adl ioDirection e wavecom Confidential Page 71 220 This document is the sole and exclusive property of WAVECOM Not to be distributed or divulged without prior written agreement Ce document est la propri t exclusive de WAVECOM Il ne peut tre communiqu ou divulgu des tiers sans son autorisation pr alable wavecom Make it wireless WM DEV OAT UGD 019 002 September 11 2006 The ADL IO OUTPUT constant is used to set a GPIO as an output The ADL IO INPUT constant is used to set a GPIO as an input 3 8 2 4 The adl ioState e Type This type represents the state of a GPIO typedef enum ADL IO LOW ADL IO HIGH adi ioState e The ADL IO LOW constant represents the low state of a GPIO The ADL IO HIGH constant represents the high state of a GPIO 3 8 2 5 The adl ioSetDirection t Structure This type is used by th
81. AT UGD 019 002 September 11 2006 DataHandler FCM data events handler using the following type typedef bool adl fcmDataHdlr f u16 DataLen u8 Data This handler receives data blocks from the associated flow Once the data block is processed the handler must return TRUE to release the credit or FALSE if the credit must not be released In this case all credits will be released next time the handler will return TRUE On all flows all data handlers master and slaves subscribed are notified with a data event and the credit will be released only if all handlers return TRUE each handler should return TRUE as default value If a credit is not released on the data block reception it will be released the next time the data handler will return TRUE The adl fcmReleaseCredits should also be used to release credits outside of the data handler Maximum size of each data packets to be received by the data handlers depends on the flow type o On serial link flows UART physical amp logical based ports 120 bytes o On GSM CSD data port 270 bytes o On GPRS port 1500 bytes o On Bluetooth virtual ports 120 bytes If data size to be received by the Open AT application exceeds this maximum packet size data will be segmented by the Flovv Control Manager which will call several times the Data Handlers with the segmented packets Please note that on GPRS flow whole IP packets will alvvays be received by the O
82. ATUS CARD UNKNOWN ERROR Generic code for all other error cases Length ATR or APDU request response buffer length in bytes Note Should be set to O if the SIM card status is not OK Data ATR or APDU request response buffer address This buffer content will be copied and sent by ADL to the Wavecom firmware Note Should be set to O if the SIM card status is not OK e Returned values o OK on success o ADL_RET_ERR_PARAM on a supplied parameter error o ADL RET ERR UNKNOWN HDL if the supplied OSA handle is unknown o ADL RET ERR BAD STATE if the OSA service is not waiting for an APDU or ATR request response 3 12 5 The adl osaUnsubscribe Function This function un subscribes from the OSA service the local SIM connection is resumed by the Wavecom firmware and the application supplied handler is not any longer notified of OSA events wavecom Confidential Page 116 220 This document is the sole and exclusive property of WWAVECOM Not to be distributed or divulged without prior written agreement Ce document est la propri t exclusive de WAVECOM Il ne peut tre communiqu ou divulgu a des tiers sans son autorisation pr alable wavecom Make it wireless WM DEV OAT UGD 019 002 September 11 2006 e Prototype s32 adl osaUnsubscribe s32 OsaHandle e Parameters OsaHandle OSA service handle previously returned by the adl osaSubscribe function e Returned values o OKon success
83. AVECOM Il ne peut tre communiqu ou divulgu des tiers sans son autorisation pr alable wavecom Make it wireless WM_DEV_OAT_UGD_019 002 September 11 2006 3 27 5 The adl vsUnsubscribe function This function allows the application to unsubscribe from the VariSpeed service control The CPU mode is reset to the standard speed e Prototype s32 adl vsUnsubscribe s32 VsHandle e Parameters VsHandle VariSpeed service handle previously returned by the adl vsSubscribe function e Returned values o OK on success o ADL RET ERR UNKNOWN HDL if the supplied handle is unknown o ADL RET ERR SERVICE LOCKED if the function was called from a low level interruption handler the function is forbidden in this context 3 27 6 Example This example demonstrates how to use the VariSpeed service in a nominal case error cases are not handled Global variable VariSpeed service handle s32 MyVariSpeedHandle Somewhere in the application code used as event handlers void MyFunctionl void Subscribe to the VariSpeed service MyVariSpeedHandle adl vsSubscribe Enter the boost mode adl vsSetClockMode MyVariSpeedHandle ADL_VS_MODE_BOOST void MyFunction2 void Un subscribe from the VariSpeed service adl vsUnsubscribe MyVariSpeedHandle wavecom Confidential Page 215 220 This document is the sole and exclusive property of WWAVECOM Not to be distri
84. CIFIC BASE 3 wavecom Confidential Page 220 220 This document is the sole and exclusive property of WWAVECOM Not to be distributed or divulged without prior written agreement Ce document est la propri t exclusive de WAVECOM Il ne peut tre communiqu ou divulgu a des tiers sans son autorisation pr alable vwWovVecoAV Make it wireless WAVECOM S A 3 esplanade du Foncet 92442 Issy les Moulineaux Cedex France Tel 33 0 1 46 29 08 00 Fax 33 0 1 46 29 08 08 Wavecom Inc 4810 Eastgate Mall Second Floor San Diego CA 92121 USA Tel 1 858 362 0101 Fax 1 858 558 5485 WAVECOM Asia Pacific Ltd Unit 201 207 2nd Floor Bio Informatics Centre No 2 Science Park West Avenue Hong Kong Science Park Shatin New Territories Hong Kong www wavecom com
85. CM RET OK WAIT RESUME return values the memory buffer will be effectively released once the ADL FCM EVENT MEM RELEASE event will be received in the Control Handler The application has to use only dynamic allocated buffers with adl memGet function 3 7 9 The adl fcmGetStatus Function This function gets the buffer status for requested flow handle in the requested way e Prototype s8 adl fcmGetStatus u8 Handle adl fcmWay e Way e Parameters Handle Handle returned by the adl fcmSubscribe function Way As flows have two ways from Embedded application and to Embedded application this parameter specifies the direction or vvay from which the buffer status is requested The possible values are typedef enum ADL FCM WAY FROM EMBEDDED ADL FCM WAY TO EMBEDDED adl fcmWay e e Returned values o ADL FCM RET BUFFER EMIPTY ff the requested flow and way buffer is empty o ADL FCM RET BUFFER NOT EMPTY ff the requested flow and way buffer is not empty the Flow Control Manager is still processing data on this flow o ADL RET ERRH UNKNOWN HDL ff the provided handle is unknown o ADL RET ERR PARAM ff the way parameter value in out of range wavecom Confidential Page 67 220 This document is the sole and exclusive property of WWAVECOM Not to be distributed or divulged without prior written agreement Ce document est la propri t exclusive de WAVECOM Il ne peut tre communiqu ou divulgu a des tier
86. COM Il ne peut tre communiqu ou divulgu des tiers sans son autorisation pr alable wevecom ds Make it wireless WM DEV OAT UGD 019 002 September 11 2006 external application sends AT MY CMD string the command handler will receive AT MYCMD Options This flag combines with a bitwise OR information in C language the following Command type Value Meaning ADL CMD TYPE PARA Ox0100 AT cmd x y is allowed The execution of the callback function also depends on whether the number of argument is valid or not Minimum arguments OxOOOX Minimum argument number for number incoming command Usable only if the ADL CMD TYPE PARA type is required Maximum arguments OxOOXO Maximum argument number for number incoming command Usable only if the ADL CMD TYPE PARA type is required ADL CMD TYPE TEST Ox0200 AT cmd is allowed ADL CMD TYPE READ 0x0400 AT cmd is allowed ADL_CMD_TYPE_ACT 0x0800 AT cmd is allowed ADL_CMD_TYPE_ROOT Ox1000 All commands starting with the subscribed string are allowed The handler will only receive the whole AT string no parameters detection For example if the at string is subscribed all at cmad 1 at cmd2 etc strings will be received by the handler however the only string at is not received Incoming commands which are matching with these options combinations will lead to the callb
87. DL RET ERR SERVICE LOCKED if the function was called from a low level interruption handler the function is forbidden in this context wavecom Confidential Page 151 220 This document is the sole and exclusive property of WAVECOM Not to be distributed or divulged without prior written agreement Ce document est la propri t exclusive de WAVECOM Il ne peut tre communiqu ou divulgu des tiers sans son autorisation pr alable wavecom Make it wireless WM DEV OAT UGD 019 002 September 11 2006 3 17 7 Example This example shows how to use the Semaphore service in a nominal case error cases are not handled wavecom Confidential Page 152 220 This document is the sole and exclusive property of WAVECOM Not to be distributed or divulged without prior written agreement Ce document est la propri t exclusive de WAVECOM II ne peut tre communiqu ou divulgu a des tiers sans son autorisation pr alable weavecom gt G nie Make it wireless WM DEV OAT UGD 019 002 September 11 2006 3 18 Application Safe Mode Service By default the VVOPEN and WDWL commands cannot be filtered by any embedded application This service allovvs one application to get these commands events in order to prevent any external application stop or erase the current embedded one 3 18 1 Required Header File The header file for the Application safe mode service is adl safe h 3 18 2 The adl safeSubscribe F
88. ED ADL IO EVENT FEATURE DISABLED event is notified to the Open AT application in order to inform it that the related GPIO is available or not available Wismo QUIK Q2687 Gpio Labels The Gpio labels for the Wismo Quik Q2687 Wireless CPU are defined by the values below for each GPIO label it is also indicated if this label is linked to a specific feature GPIO Identifier Linked Feature if any ADL IO 02687 GPIO 1 ADL IO FEATURE BUS PARALLEL ADDR2 CS2 ADL IO 02687 GPIO 2 ADL IO FEATURE BUS PARALLEL ADDR1 ADL IO 02687 GPIO 3 ADL IO FEATURE INTO ADL IO Q2687 GPIO 4 ADL IO FEATURE KBD ADL IO 02687 GPIO 5 ADL IO FEATURE KBD ADL IO 02687 GPIO 6 ADL IO FEATURE KBD ADL IO 02687 GPIO 7 ADL IO FEATURE KBD ADL IO 02687 GPIO 8 ADL IO FEATURE KBD ADL IO 02687 GPIO 9 ADL IO FEATURE KBD ADL IO 02687 GPIO 10 ADL IO FEATURE KBD ADL IO Q2687 GPIO 11 ADL IO FEATURE KBD ADL IO Q2687 GPIO 12 ADL IO FEATURE KBD ADL IO 02687 GPIO 13 ADL IO FEATURE KBD ADL IO 02687 GPIO 14 ADL IO FEATURE UART2 ADL IO Q2687 GPIO 15 ADL IO FEATURE UART2 ADL IO 02687 GPIO 16 ADL IO FEATURE UART2 ADL IO 02687 GPIO 17 ADL IO FEATURE UART2 ADL IO 02687 GPIO 18 ADL IO FEATURE SIMPRES ADL IO Q2687 GPIO 19 ADL IO Q2687 GPIO 20 ADL IO 02687 GPIO 21 ADL IO Q2687 GPIO 22 ADL IO FEATURE BT RST ADL IO Q2687 GPIO 23 ADL IO 02687 GP
89. ICE LOCKED if the function was called from a low level interruption handler the function is forbidden in this context O O e Exceptions The following exception must be generated on this function call o RTK exception 133 if the semaphore has been produced too many times A semaphore can be produced until its inner counter reaches its initial value 3 17 6 The adl semUnsubscribe Function This function allows the application to unsubscribe from the Semaphore service in order to release the previously reserved resource A semaphore can be unsubscribed only if its inner counter value is the initial one the semaphore has been produced as many times as it has been consumed wavecom Confidential Page 150 220 This document is the sole and exclusive property of WWAVECOM Not to be distributed or divulged without prior written agreement Ce document est la propri t exclusive de WAVECOM Il ne peut tre communiqu ou divulgu a des tiers sans son autorisation pr alable wavecom Make it wireless WM DEV OAT UGD 019 002 September 11 2006 e Prototype s32 adl semUnsubscribe s32 SemHandle e Parameters SemHandle Semaphore service handle previously returned by the adl semSubscribe function e Returned values o OKon success o ADL RET ERR UNKNOVVN HDL when the supplied handle is unknown o ADL RET ERR BAD STATE when the semaphore inner counter value is different from the initial value o A
90. IO 24 wavecom Confidential Page 70 220 This document is the sole and exclusive property of WWAVECOM Not to be distributed or divulged without prior written agreement Ce document est la propri t exclusive de WAVECOM Il ne peut tre communiqu ou divulgu des tiers sans son autorisation pr alable wavecom Make it wireless WM_DEV_OAT_UGD_019 002 September 11 2006 GPIO Identifier Linked Feature if any ADL IO Q2687_GPIO 25 ADL IO FEATURE INT1 ADL IO 02687 GPIO 26 ADL IO FEATURE BUS I2C ADL IO Q2687_GPIO 27 ADL IO FEATURE BUS I2C ADL IO 02687 GPIO 28 ADL IO FEATURE BUS SPI1 CLK ADL IO 02687 GPIO 29 ADL IO FEATURE BUS SPI1 IO ADL IO 02687 GPIO 30 ADL IO FEATURE BUS SPIL I ADL IO Q2687_GPIO 31 ADL IO FEATURE BUS SPI1 CS ADL IO Q2687_GPIO 32 ADL IO FEATURE BUS SPI2 CLK ADL IO 02687 GPIO 33 ADL IO FEATURE BUS SPI2 IO ADL IO Q2687_GPIO 34 ADL IO FEATURE BUS SPI2 I ADL IO 02687 GPIO 35 ADL IO FEATURE BUS SPI2 CS ADL IO 02687 GPIO 36 ADL IO FEATURE UARTI ADL IO Q2687_GPIO_ 37 ADL IO FEATURE UARTI ADL IO Q2687_GPIO 38 ADL IO FEATURE UARTI ADL IO 02687 GPIO 39 ADL IO FEATURE UARTI ADL IO 02687 GPIO 40 ADL IO FEATURE UART1 ADL IO Q2687_GPIO 41 ADL IO FEATURE UART1 ADL IO Q2687 GPIO 42 ADL IO FEATURE UART1 ADL IO Q2687 GPIO 43 ADL IO FEATURE UART1 ADL IO Q2687 GPIO 44 typedef enum ADL IO Q268
91. IO 27 ADL IO FEATURE BUS I2C ADL IO Q2686 GPIO 28 ADL IO FEATURE BUS SPI1 CLK ADL IO Q2686 GPIO 29 ADL IO FEATURE BUS SPI1 IO ADL IO Q2686 GPIO 30 ADL IO FEATURE BUS SPI1 I ADL IO Q2686 GPIO 31 ADL IO FEATURE BUS SPI1 CS ADL IO Q2686 GPIO 32 ADL IO FEATURE BUS SPI2 CLK ADL IO Q2686 GPIO 33 ADL IO FEATURE BUS SPI2 IO ADL IO Q2686 GPIO 34 ADL IO FEATURE BUS SPI2 I ADL IO Q2686 GPIO 35 ADL IO FEATURE BUS SPI2 CS ADL IO Q2686 GPIO 36 ADL IO FEATURE UART1 ADL IO Q2686 GPIO 37 ADL IO FEATURE UART1 ADL IO Q2686 GPIO 38 ADL IO FEATURE UART1 ADL IO Q2686 GPIO 39 ADL IO FEATURE UART1 ADL IO Q2686 GPIO 40 ADL IO FEATURE UART1 ADL IO Q2686 GPIO 41 ADL IO FEATURE UART1 ADL IO Q2686 GPIO 42 ADL IO FEATURE UART1 ADL IO Q2686 GPIO 43 ADL IO FEATURE UART1 ADL IO Q2686 GPIO 44 wavecom Confidential Page 69 220 This document is the sole and exclusive property of WWAVECOM Not to be distributed or divulged without prior written agreement Ce document est la propri t exclusive de WAVECOM Il ne peut tre communiqu ou divulgu a des tiers sans son autorisation pr alable wavecom Make it wireless WM_DEV_OAT_UGD_019 002 September 11 2006 typedef enum ADL IO Q2686 GPIO 1 3 ADL IO O2686 GPIO 2 ADL IO Q2686 GPIO 3 ADL IO Q2686 GPIO 43 ADL IO Q2686 GPIO 44 ADL IO Q2686 PAD Ox7FFFFFFF adl ioLabel Q2686 e Note As soon as a multiplexed feature is used or not used an ADL IO EVENT FEATURE ENABL
92. IZE WriteBuffer adl busWrite MyI2CHandle amp AccessConfig WRITE SIZE WriteBuffer Write 5 bytes set to 0 on the Parallel bus at address 0 adl busDirectWrite MyParaHandle 0 WRITE SIZE WriteBuffer Read 3 bytes from the SPI amp I2C bus adl busRead MySPIHandle amp AccessConfig READ SIZE ReadBuffer adl busRead MyI2CHandle amp AccessConfig READ SIZE ReadBuffer Read 3 bytes from the Parallel bus at address 0 adl busDirectRead MyParaHandle 0 READ SIZE ReadBuffer Unsubscribe from subscribed BUS adl busUnsubscribe MySPIHandle adl busUnsubscribe MyI2CHandle wavecom Confidential Page 101 220 This document is the sole and exclusive property of WAVECOM Not to be distributed or divulged without prior written agreement Ce document est la propri t exclusive de WAVECOM Il ne peut tre communiqu ou divulgu a des tiers sans son autorisation pr alable wavecom Make it wireless WM_DEV_OAT_UGD_019 002 September 11 2006 adl busUnsubscribe MyParaHandle wavecom Confidential Page 102 220 This document is the sole and exclusive property of VVAVECOM Not to be distributed or divulged without prior written agreement Ce document est la propri t exclusive de WAVECOM Il ne peut tre communiqu ou divulgu des tiers sans son autorisation pr alable wevecom Make it wireless WM DEV OAT UGD 019 002 Sept
93. If ID is set to ADL FLH ALL IDS all flash objects related to the provided handle will be erased e Returned values OK on success ADL RET ERR UNKNOWN HDL if handle is not subscribed ADL FLH RET ERR ID OUT OF RANGE if ID is out of handle range ADL FLH RET ERR OBJ NOT EXIST if the object does not exist ADL RET ERR FATAL if a fatal error occurred ADL ERR FLH DELETE error event will then be generated o ADL RET ERR SERVICE LOCKED if the function was called from a low level interruption handler the function is forbidden in this context 0000 0 wavecom Confidential Page 53 220 This document is the sole and exclusive property of WAVECOM Not to be distributed or divulged without prior written agreement Ce document est la propri t exclusive de WAVECOM Il ne peut tre communiqu ou divulgu des tiers sans son autorisation pr alable weavecom penan Make it wireless WM_DEV_OAT_UGD_019 002 September 11 2006 3 6 6 The adl fhWrite Function This function writes the flash object from the given Handle at the given ID for the length provided with the string provided A single flash object can use up to 30 Kbytes of memory e Prototype s8 adl flhWrite ascii Handle ul16 ID ul16 Len u8 WriteData e Parameters Handle The Handle of the subscribed set of objects ID The ID of the flash object to write Len The length of the flash object to write WriteData The provided string to write in th
94. M area is global and accessible from all contexts wavecom Confidential Page 208 220 This document is the sole and exclusive property of WWAVECOM Not to be distributed or divulged without prior written agreement Ce document est la propri t exclusive de WAVECOM Il ne peut tre communiqu ou divulgu des tiers sans son autorisation pr alable wevecom Make it wireless WM DEV OAT UGD 019 002 September 11 2006 3 26 1 Required Header File The header file for the Execution Context function is adl ctx h 3 26 2 The adl ctxlID e Type This type defines the execution context identifiers typedef enum ADL_CTX_OAT_TASK ADL CTX LOW LEVEL IRQ HANDLER OxFD ADL CTX HIGH LEVEL IRQ HANDLER OxFE ADL CTX ALL OxFF Reserved for internal use ADL CTX WAVECOM OxFF Wavecom tasks context adl ctxID e The ADL CTX OAT TASK constant identifies the Open AT application task context The ADL CTX LOW LEVEL IRQ HANDLER constant identifies the low level interruption handler context The ADL CTX HIGH LEVEL IRQ HANDLER constant identifies the high level interruption handler context The ADL CTX WAVECOM constant identifies the Wavecom OS context 3 26 3 The adl ctxGetID Function This function allows the application to retrieve the current execution context identifier e Prototype adl ctxID e adl ctxGetID void e Returned values o ADL CTX OAT TASK if the function is called fr
95. NGED event e Prototype s32 adl ioSubscribe u32 GpioNb adl ioConfig t GpioConfig u8 PollingTimerType u32 PollingTime s32 GpioEventHandle e Parameters GpioNb Size of the GpioConfig array GpioConfig GPIO subscription configuration array which contains GpioNb elements For each element the adl ioConfig t structure members have to be configured PollingTimerType Type of the polling timer if required defined values are ADL TMR TYPE 100MS 100 ms granularity timer ADL TMR TYPE TICK 18 5 ms tick granularity timer If no polling is requested this parameter is ignored PollingTime If some GPIO are allocated as inputs this parameter represents the time interval between two GPIO polling operations unit is dependent on the PollingTimerType value Please note that each required polling process uses one of the available ADL timers Reminder up to 32 timers can be simultaneously subscribed If no polling is requested this parameter has to be O GpioEventHandle GPIO event handle previously returned by adl ioEventSubscribe function Associated event handler will receive an ADL IO EVENT INPUT CHANGED event each time one of the subscribed inputs state has changed If no polling is requested this parameter is ignored e Returned values o A positive or null value on success e GPIO handle to be used on further GPIO API functions calls wavecom Confidential Page 76 220 Th
96. NNARRRREMRRRNRE RUN 26 3 2 2 Unsolicited Responses 26 3 2 3 RESPONSES et ERRERRAENENERREER REA RERSRRRUSRRKRRIN ERR ERR EERERRMPEERSRERARRNKRAMNEN 28 3 2 4 Incoming AT Commands ssssssssssssssssssse sese essen eene 31 3 2 5 Run AT Commands uada ANNAA Rx RR REA TERR FRE ER RETE MES 35 3 3 TAFDGES siennes dedans wens pedeewee sade pave ETA rede E EA EEE 42 3 3 1 Required Header Files issues 42 3 3 2 The adl tmrSubscribe Function 448 42 3 3 3 The adl tmrUnSubscribe Function me 43 3 3 4 Example eet REA RMASRRNRR ER ER RNEKRARRERRRRESRRTRINRRENSRERS EFERRMSEERREERARERER AMA 44 3 4 Memory SOIrvViCGsiinictisinedictasneatneainecindarnealonainedacdatnealcentnedindasnealonabnanindass 45 3 4 1 Required Header File sise 45 3 4 2 The adl memGetlnfo Function 45 3 4 3 The adl memGet Function 46 3 4 4 The adl memhRelease Function ss 47 3 4 5 Heap Memory Block Status is issues 47 3 4 6 Example cat swaiaaedewnkae en ewes beer neat hess pe ane NERIEERSEERERRKPEERERERRRENERANNKN 48 3 5 Debug TraGCES waicicixsctceainsdinterksctanasencteiankhaleneneh sement d enanti ainsi 48 3 5 1 Required Header File siens 48 3 5 2 Debug Configuration eessiesk rack EX kbri RA ERRARE RARE RR GR ARAKEA ARRA YR Rada 48 3 5 3 Full Debug Configuration sise 50 3 5 4 Release Configuration oi cciniisccasceiseensndisceasneasgensnedsceabiedsyensnedsceadneden 50 3 6 EE ES RE neled vaeSnalex pes AE 51 3 6 1 Required Header File
97. Not to be distributed or divulged without prior written agreement Ce document est la propri t exclusive de WAVECOM Il ne peut tre communiqu ou divulgu a des tiers sans son autorisation pr alable weavecom a Make it wireless WM_DEV_OAT_UGD_019 002 September 11 2006 DataLen Data block buffer size Maximum data packet size depends on the subscribed flow o On serial link based flows 2000 bytes On GSM data flow no limitation memory allocation size On GPRS flow 1500 bytes On Bluetooth virtual ports 2000 bytes O O O e Returned values o OKon success The Control handler will also receive a ADL FCM EVENT MEM RELEASE event when the data block memory buffer will be released o ADL FCM RET OK WAIT RESUME on success but the last credit was used The Control handler will also receive a ADL FCM EVENT MEM RELEASE event when the data block memory buffer will be released ADL RET ERR PARAM is a parameter has an incorrect value ADL_ RET_ ERR_ UNKNOWN HDL if the provided handle is unknown ADL_ RET_ ERR_BAD_ STATE if the flow is not ready to send data ADL_ FCM _ RET_ ERR_ _WAIT_RESUME if the flow has no more credit to use o ADL RET ERR SERVICE LOCKED if the function was called from a low level interruption handler the function is forbidden in this context OO0o00 On ADL FCM RET XXX WAIT RESUME returned value the subscriber has to wait for a ADL_ FCM _ EVENT_ RESUME event on Control Handler to co
98. ORY eise aErt hei Eig treet erac Erde e use S erp BOVEM RUP iranien 2 eeldiciupme E 3 TRADEMARKS exei exe idet xn br tote eye dux nas cue Nes anna ns eves tants te ve RED tu MONS 3 OVERVIEW EE 4 TABLE OF CONTENT Soressi laii cru E d erar Dust uto Pacha Er Le RENE Y ir ener 5 LIST OF FIGURES niodo ate tenue nan te ei sale d Rue ments editer 12 1 INTRODUCTION ssr inner nencttitin vasaassacdveusainns E a aa yee tiouelte mener ete 13 1 1 Important Rernarks iere eher E RR REN RERRRRRIRRRSXRRSAERRR RIERRSREXA E SENERE ENNER 13 1 2 F eferences is iiie xil ied xdg kA iXX RR ERPIK RENE MERE ERIIR SERRE nent XQ ER IEEE E ERR iles 13 1 3 CITE LE IS RE pae RR ERR RERRRYRRSERRRVRRRERRRVERGENKRERRGSERRNVERGERANERRZEERTVKRSERKTERRN KKTERRCEA 13 1 44 AbbreviatiOLris ccce eee EE It aia inate ane osier 14 2 DESCRIPTION me 15 2 1 Software Architecture sssssssssssssssssssessee enemies esses sse 15 2 2 Imported APIs from Open AT library ccccccc cece ec ec ec eeeeeeenenseceseaeaenenenens 16 2 9 ADL BIMMALONS saucius obs tie re Sid ais REIP n tend aie ease Sad RR oh sens RR ee 16 2 4 Open Al Memory HOSOLFOBS eids d6 ceneasccaeveniiencsdaiweneriatvemieniecteniatwendiad 16 2 5 Defined Compilation Flags nee ne eee senem ese heme eene nnns 17 2 6 Inner AT Commands Configuration issues 18 2 7 Open AT Specific AT Commands isssssssssssssssesee enne senes sa san 19 2 7 1 AT WDWL
99. ROR Reboot after an error in install process cf adl adInstall API adl InitType e Important note The adl main function is NOT like a standard C main function The application does not end when adl main returns An Open AT application is stopped only if the AT W OPEN 0 command is used The ad1 main function is only the application entry point and has to subscribe to some services and events to go further In addition the whole software is protected by a vvatchdog mechanism the application shall not use infinite loops and loops having a too long duration the Wireless CPU will reset due to the watchdog hardware security please refer to 8 2 9 2 Hardware Security Watchdog Protection for more information wavecom Confidential Page 25 220 This document is the sole and exclusive property of WAVECOM Not to be distributed or divulged without prior written agreement Ce document est la propri t exclusive de WAVECOM Il ne peut tre communiqu ou divulgu des tiers sans son autorisation pr alable wevecom Make it wireless WM_DEV_OAT_UGD_019 002 September 11 2006 3 2 AT Commands Service 3 2 1 Required Header File The header file for the functions dealing with AT commands is adl_at h 3 2 2 Unsolicited Responses An unsolicited response is a string sent by the Wavecom OS to applications in order to provide them unsolicited event information ie not in response to an AT command
100. Read Hold Read Access Read Turnaround Following Access tnt 3518 amp 3d9 31 1 3 1 1 ADD y vairedaddess gp j y val read address Figure 8 Intel Mode Timing Read Process Example In this write process example Setup amp Access time are set to 2 Hold time is set to 1 and Turnaround time is set to 3 Write Hold Write Setup Write Access Write Tumaround Following Access Nu r M M r T r ADD Lt valid write addrgss Kd jq vad write address l l l l l l l l l I I I l DATA valid Write data i i I e M eo Figure 9 Intel Mode Timing Write Process Example wavecom confidential Page 89 220 This document is the sole and exclusive property of WWAVECOM Not to be distributed or divulged without prior written agreement Ce document est la propri t exclusive de WAVECOM Il ne peut tre communiqu ou divulgu des tiers sans son autorisation pr alable wavecom Make it wireless WM_DEV_OAT_UGD_019 002 September 11 2006 3 9 2 6 The adl busParallelSettings t Structure This type defines the Parallel bus settings for subscription typedef struct union struct u8 Width u8 Mode u8 pad 2 adl busParallelTimingCfg t ReadCfg adl busParallelTimingCfg t WriteCfg adl busParallelCs t Cs u8 NbAddNeeded In
101. SA service ADL_OSA_EVENT_ATR_REQUEST The application is notified with this event after the ADL OSA EVENT INIT SUCCESS one The Wavecom firmware is required for the Answer To Heset data The application has to reset the remote SIM card and to get the ATR data in order to post it back to the VVavecom firmware through the adl osaSendResponse function wavecom Confidential Page 113 220 This document is the sole and exclusive property of WAVECOM Not to be distributed or divulged without prior written agreement Ce document est la propri t exclusive de WAVECOM Il ne peut tre communiqu ou divulgu des tiers sans son autorisation pr alable wevecom es Make it wireless WM_DEV_OAT_UGD_019 002 September 11 2006 Event Type Use ADL_OSA_EVENT_APDU_REQUEST This event is received by the application each time the Wavecom firmware has to send an APDU request to the SIM card This request notified to the application through the Length amp Data parameters has to be forwarded to the remote SIM by the application and has to read the associated response in order to post it back to the Wavecom firmware through the adl osaSendResponse function ADL OSA EVENT SIM ERROR This event is notified to the application fan error was notified to the VVavecom firmware in a SIM response posted through the adl osaSendResponse function or fthe internal response time out has elapsed a
102. TATE if one of the required GPIO was not subscribed as an input O O O O O 3 8 11 The adl ioWrite Function This function writes on several GPIOs from a previously allocated handle e Prototype s32 adl ioWrite s32 GpioHandle u32 GpioNb adl_ioWrite_t GpioWrite e Parameters GpioHandle Handle previously returned by adl_ioSubscribe function GpioNb Size of the GpioWrite array GpioWrite GPIO write structure array using the adl ioWrite t type For each array element e the eLabel field identifies which GPIO has to be written e the eState field is the value to be set on the output e Returned values OK on success O o ADL RET ERR UNKNOWN HDL if the provided handle is unknown o ADL RET ERR PARAM if one parameter has an incorrect value o ADL RET ERR BAD STATE if one of the required GPIOs was not subscribed as an output wavecom Confidential Page 79 220 This document is the sole and exclusive property of WWAVECOM Not to be distributed or divulged without prior written agreement Ce document est la propri t exclusive de WAVECOM Il ne peut tre communiqu ou divulgu des tiers sans son autorisation pr alable wevecom Make it wireless WM DEV OAT UGD 019 002 September 11 2006 3 8 12 The adl ioWriteSingle Function This function allows one GPIO to be written from a previously allocated handle e Prototype s32 adl ioWriteSingle s32 GpioHandle u32 Gpio u32 State
103. This function returns the ID of the provided response string e Prototype adl strID e adl strGetID ascii rsp e Parameters rsp String to parse to get the ID e Returned values o ADL STR NO STRING if the string is unknown o Id of the string otherwise 3 19 4 The adl strGetIDExt Function This function returns the ID of the provided response string vvith an optional argument and its type e Prototype adl strID e adl strGetIDExt ascii rsp void arg u8 argtype e Parameters rsp String to parse to get the ID arg Parsed first argument not used if set to NULL argtype Type of the parsed argument if argtype is ADL STR ARG TYPE ASCII arg is an ascii string if argtype is ADL STR ARG TYPE U32 arg is an u32 integer e Returned values o ADL STR NO STRING if the string is unknown o Id of the string otherwise wavecom Confidential Page 157 220 This document is the sole and exclusive property of WWAVECOM Not to be distributed or divulged without prior written agreement Ce document est la propri t exclusive de WAVECOM Il ne peut tre communiqu ou divulgu des tiers sans son autorisation pr alable wavecom Make it wireless WM_DEV_OAT_UGD_019 002 September 11 2006 3 19 5 The adl strisTerminalResponse Function This function checks whether the provided response ID is a terminal one A terminal response is the last response that a response handler
104. VECOM Il ne peut tre communiqu ou divulgu des tiers sans son autorisation pr alable weavecom Make it wireless WM_DEV_OAT_UGD_019 002 September 11 2006 typedef struct adl strID e RspID adl_atPort_e Dest ul6 StrLength ascii StrData 1 adl atResponse t This structure members are defined below o RsplD Detected standard response ID if the received response is a standard one See 8 3 19 for more information o Dest Port on which the command has been executed it is also the destination port where the response will be forwarded if the handler returns TRUE o StrLength amp StrData Response string length amp value The return value of the callback function has to be TRUE if the response string has to be sent to the provided port FALSE otherwise This allows a variable number of arguments where ADL expects a list of response and intermediate response to subscribe to When the command is executed its responses are compared with each item of this list For each matching response the callback function is called the other responses are processed as required by the RspFlag parameter Note The last element of the list must be NULL If the list is set to only 2 elements and NULL when the command will be sent all the responses and intermediate responses received by the ADL parser will execute the callback function until a terminal response is received by the ADL parser T
105. X ka Ey e ERR 136 3 16 1 Required Header File sise 136 3 16 2 The adl gprsSubscribe Function 136 3 16 3 The adl gprsSetup Function 4 488 139 3 16 4 The adl gprsSetupExt Function esses 140 3 16 5 The adl gprsAct Function meme 141 3 16 6 The adl gprsActExt Function 141 3 16 7 The adl gprsDeact Function cesses 142 3 16 8 The adl gprsDeactExt Function ss 143 3 16 9 The adl gprsGetCidinformations Function essessessss 144 3 16 10 The adl gprsUnsubscribe Function 145 3 16 11 The adl gprslsAnlPAddress Function 145 9 16 12 Examplezisiietii Na Ne RIM RIMISAMDANIAK NN ATE NIME E MAIN nest D EN OD tas 146 3 17 Semaphore ADL Service ss eee sees esee esee ns 148 3 17 1 Required Header File sisi 148 3 17 2 The adl semSubscribe Function cece eee eee m 148 3 17 3 The adl semConsume Function 149 3 17 4 The adl semConsumeDelay Function 149 3 17 5 The adl semProduce Function 150 3 17 6 The adl semUnsubscribe Function cece eee 150 S177 Exarmiplesi suns Sees sen een xe EV UR ERN EVIDENS EVI init net 152 3 18 Application Safe Mode Service c ccc ccc eee eens eens eens eens nens 153 3 18 1 Required Header File issues 153 3 18 2 The adl safeSubscribe Function 153 3 18 3 The adl safeUnsubscribe Function ss 154 3 18 4 The adl safeRunCommand Function 155 wavecom Confidential Page 8 220 This document is the sole and exclusive prop
106. _FEATURE_NONE ADL IO FEATURE BUS SPI1 CLK SPI 1 bus clock pin ADL IO FEATURE BUS SPI1 IO SRI 1 bus bi directional data pin ADL IO FEATURE BUS SPIL I SPI 1 bus uni directional input pin ADL IO FEATURE BUS SPI1 CS SPI 1 bus hardware chip select pin ADL IO FEATURE BUS SPI2 CLK SPI 2 bus clock pin ADL IO FEATURE BUS SPI2 IO SPI 2 bus bi directional data pin ADL IO FEATURE BUS SPI2 I KL SPI 2 bus uni directional input pin ADL IO FEATURE BUS SPI2 CS SPI 2 bus hardware chip select pin ADL IO FEATURE BUS I2C I2C bus WM IO FEATURE BUS PARALLEL ADDR1 Parallel bus Address pin WM IO FEATURE BUS PARALLEL ADDR2 CS2 Parallel bus chip select 2 Address pin ADL IO FEATURE KBD Keypad ADL IO FEATURE SIMPRES SIM presence signal ADL IO FEATURE UARTI1 UART 1 port ADL IO FEATURE UART2 UART 2 port ADL IO FEATURE INTO External interrupt 0 ADL IO FEATURE INTI External interrupt 1 ADL IO FEATURE BT RST Bluetooth reset signal ADL IO FEATURE LAST adi ioFeature e wavecom Confidential Page 73 220 This document is the sole and exclusive property of WWAVECOM Not to be distributed or divulged without prior written agreement Ce document est la propri t exclusive de WAVECOM Il ne peut tre communiqu ou divulgu des tiers sans son autorisation pr alable wevecom Make it wireless WM DEV OAT UGD 019 002 September 11 2006 3 8 3 The adl ioEv
107. _UGD_019 002 September 11 2006 3 API 3 1 Mandatory Application Code 3 1 1 Required Header File Mandatory application API header file is adl AppliInit h This file is already included by adl global h 3 1 2 Call Stack Sizes This constant below must be defined by every Open AT application in order to provide the Wavecom OS with the required Open AT task call stack size const ul6 wm apmCustomStackSize 1024 The 1024 value is an example If the application whishes to handle interruptions cf IRQ service chapter amp Execution context service chapter see 8 3 25 it has also to define the required contexts low level and or high level call stack sizes The constant used for low level interruption handlers execution context is the one below const ul6 wm apmIRQLowLevelStackSize 1024 Example value The constant used for high level interruption handlers execution context is the one below const ul6 wm apmIRQHighLevelStackSize 1024 Example value Please note that these definitions are optional if the application either does not supply one or both of these call stack sizes or set them to O the associated context s will not be available at runtime e Reminder A call stack is the Open AT RAM area which contains the local variables and return addresses for function calls Call stack sizes are dedued from the total available RAM size for Open AT application wavecom Confidential Page 23 220
108. a propri t exclusive de WAVECOM Il ne peut tre communiqu ou divulgu des tiers sans son autorisation pr alable wevecom er tui Make it wireless WM DEV OAT UGD 019 002 September 11 2006 o ADL RET ERR SERVICE LOCKED if the function was called from a low level interruption handler the function is forbidden in this context Note The function will return a NULL pointer if the timer value is zero The timer will not be started 3 3 3 The adl tmrUnSubscribe Function This function stops the timer and unsubscribes to it and his handler The call to this function is only meaningful to a cyclic timer or a timer that hasn t expired yet e Prototype s32 adl_tmrUnSubscribe adl_tmr_t tim adl tmrHandler t Timerhdl u8 TimerType e Parameters tim The timer vve vvant to unsubscribe to Timerhdl The handler of the callback function associated to the timer Note This parameter is only used to verify the coherence of tim parameter Timerhdl has to be the timer handler used in the subscription procedure For example PhoneTaskTimerPtr adl tmrSubscribe TRUE OneSecond ADL TMR TYPE 100MS PhoneTaskTimer adl tmrUnSubscribe PhoneTaskTimerPtr PhoneTaskTimer ADL TMR TYPE 100MS TimerType Unit of the TimerValue parameter The allovved values are defined below Timer type Timer unit ADL TMR TYPE 100MS TimerValue is in 100 ms steps ADL TMR TYPE TICK TimerValue is in 18 5 ms tick
109. a signal on the hardware Interrupt product pin The INTERRUPT feature has to be enabled on the product please refer to the AT WFM command Open AT application running in Remote Task Environment cannot be suspended the function has no effect Please note that the current Open AT application process is suspended immediately on the adl safeRunCommand process if there is any code after this function call it will be executed only when the process is resumed RspHandler Response handler to get command results All responses are subscribed and the command is executed on the Open AT virtual port Instead of providing a response handler a port identifier may be specified using adl port e type the command will be executed on this port and the resulting responses sent back on this port e Returned values o OKon success o ADL RET ERR PARAM if the parameter has an incorrect value o ADL RET ERR SERVICE LOCKED if the function was called from a low level interruption handler the function is forbidden in this context wavecom Confidential Page 155 220 This document is the sole and exclusive property of WWAVECOM Not to be distributed or divulged without prior written agreement Ce document est la propri t exclusive de WAVECOM Il ne peut tre communiqu ou divulgu des tiers sans son autorisation pr alable wavecom Make it wireless WM DEV OAT UGD 019 002 September 11 2006 3 19 AT Strings Service
110. able wavecom Make it wireless WM DEV OAT UGD 019 002 September 11 2006 3 25 1 Required Header File The header file for the Extint service definitions is adl extint h 3 25 2 The adl extintSettings t Structure This structure allovvs the application to configure external interruption pin behavior typedef struct adl extintPolarity e Polarity Input signal polarity adl extintProcess e Process Input signal process u8 DebounceDuration Debounce process duration adl extintSettings t e Parameters Polarity Interruption generation polarity using the following type typedef enum ADL EXTINT POLARITY LOW Falling edge interruption ADL EXTINT POLARITY HIGH Rising edge interruption ADL EXTINT POLARITY BOTH Both edges interruption only usable with debounce process ADL EXTINT POLARITY LAST Internal use only adl extintPolarity e Process Filter process applied to the input signal typedef enum t ADL EXTINT PROCESS BYPASS No filter ADL EXTINT PROCESS DEBOUNCE Debounce filter ADL EXTINT PROCESS STRETCHING Stretching filter ADL EXTINT PROCESS LAST Internal use only adi extintProcess e DebounceDuration Used only with the debounce process ignored with other processes Time during which the signal must be stable before generating the interruption in 7 8 ms steps The values allowed range is from 1 to 7 wavecom Confidential Page 2
111. ack function execution If options do not match the command will be forvvarded to be processed by the Wavecom OS e Returned values o OK o ERROR if an error occurred o ADL RET ERR SERVICE LOCKED if the function was called from a low level interruption handler the function is forbidden in this context wavecom Confidential Page 33 220 This document is the sole and exclusive property of WAVECOM Not to be distributed or divulged without prior written agreement Ce document est la propri t exclusive de WAVECOM II ne peut tre communiqu ou divulgu a des tiers sans son autorisation pr alable wevecom es Make it wireless WM_DEV_OAT_UGD_019 002 September 11 2006 Important note about incoming concatenated command ADL is able to recognize and process concatenated commands coming from external applications Please refer to AT Commands Interface Guide document 2 for more information on concatenated commands syntax In this case this port enters a specific concatenation processing mode which will end as soon as the last command replies OK or if one of the used command replies an ERROR code During this specific mode all other external command requests will be refused on this port any external application connected on this port will receive a CME ERROR 515 code if it tries to send another command The embedded application can continue using this port for its specific processes but it has to be car
112. al Interruption pin identifier to be subscribed using the type below typedef enum t ADL EXTINT PINO External interruption pin 0 ADL EXTINT PINI1 External interruption pin 1 ADL EXTINT PIN LAST Internal use only adl extintID e LowLevellrqHandle Low level interruption handler identifier previously returned by the adl irqSubscribe function This parameter is optional if the HighLevelIrqHandle parameter is supplied wavecom Confidential Page 203 220 This document is the sole and exclusive property of WAVECOM Not to be distributed or divulged without prior written agreement Ce document est la propri t exclusive de WAVECOM Il ne peut tre communiqu ou divulgu des tiers sans son autorisation pr alable weavecom Make it wireless WM DEV OAT UGD 019 002 September 11 2006 HighLevellrqHandle High level interruption handler identifier previously returned by the adl irqSubscribe function This parameter is optional if the LowLevelIrqHandle parameter is supplied Settings External interruption pin configuration to be defined using the adl extintSettings t structure e Returned values o A positive or null value on success e Extlnt service handle to be used in further Extlnt service function calls o A negative error value otherwise e ADL RET ERR PARAM on a supplied parameter error e ADL RET ERR ALREADY SUBSCRIBED if the service was already subscribed for this extern
113. al interruption pin the Extlnt service can only be subscribed one time for each pin e ADL RET ERR BAD HDL if one or both supplied interruption handler identifiers are invalid e ADL RET ERR BAD STATE if the external interruption pin is not correctly configured with the AT Commands interface please refer to the AT WIPC command description e ADL RET ERR SERVICE LOCKED if the function was called from a low level interruption handler the function is forbidden in this context 3 25 5 The adl extintConfig Function This function allows the application to modify an external interruption pin configuration e Prototype s32 adl extintConfig s32 ExtIntHandle adl extintSettings t Settings e Parameters ExtIntHandle Extlnt service handle previously returned by the adl extintSubscribe function Settings External interruption pin configuration to be defined using the adl extintSettings t structure wavecom Confidential Page 204 220 This document is the sole and exclusive property of WWAVECOM Not to be distributed or divulged without prior written agreement Ce document est la propri t exclusive de WAVECOM Il ne peut tre communiqu ou divulgu a des tiers sans son autorisation pr alable wevecom es Make it wireless WM_DEV_OAT_UGD_019 002 September 11 2006 e Returned values o OKon success ADL RET ERR PARAM on a supplied parameter error o ADL RET ERR UNKNOWN HDL if the supplied Extlnt
114. alable wavecom Make it wireless WM_DEV_OAT_UGD_019 002 September 11 2006 ADL to forward these events they will be forwarded to this Port parameter value e Returned values This function returns OK on success or a negative error value Possible error values are Error value Description ADL RET ERR PARAM parameter error bad Cid value or unavailable port ADL RET ERR PIN KO If the PIN is not entered or if the WIND 4 indication has not occurred yet ADL GPRS CID NOT DEFINED problem to set up the Cid the CID is already activated ADL NO GPRS SERVICE if the GPRS service is not supported by the product ADL RET ERR BAD STATE The service is still processing another GPRS AP application should wait for the corresponding event indication of end of processing in the GPRS handler before calling this function ADL RET ERR SERVICE LOCKED f the function was called from a low level interruption handler the function is forbidden in this context 3 16 5 The adl gprsAct Function This function just runs the adl gprsActExt one on the ADL PORT OPEN AT VIRTUAL BASE port cf adi gprsActExt description for more information Please note that events generated by the ad1 gprsAct will not be able to be forvvarded to any external port since the setup command was running on the Open AT port 3 16 6 The adl gprsActExt Function This function activates a specific PDP context identified by i
115. at where a b c amp d are integer values between O and 255 e Prototype bool adl gprsIsAnIPAddress ascii AddressStr e Parameters AddressStr IP address string to check e Returned values o TRUE if the provided string is a valid IP address one and FALSE otherwise o NULL amp empty string are not considered as a valid IP address wavecom Confidential Page 145 220 This document is the sole and exclusive property of WWAVECOM Not to be distributed or divulged without prior written agreement Ce document est la propri t exclusive de WAVECOM Il ne peut tre communiqu ou divulgu des tiers sans son autorisation pr alable wavecom Make it wireless WM_DEV_OAT_UGD_019 002 September 11 2006 3 16 12 Example This example just demonstrates how to use the GPRS service in a nominal case error cases are not handled Complete examples using the GPRS service are also available on the SDK Ping GPRS sample Global variables adl gprsSetupParams t MyGprsSetup adl gprsInfosCid t InfosCid GPRS event handler s8 MyGprsEventHandler u16 Event u8 CID Trace event TRACE 1 Received GPRS event d d Event CID Switch on event switch Event case ADL GPRS EVENT SETUP OK TRACE 1 PDP Ctxt Cid d Setup OK CID Activate the session adl gprsAct 1 break case ADL GPRS EVENT ACTIVATE OK TRACE 1 PDP Ctxt d Activation OK CID
116. be modified while the flow is in data state In order to change these parameters value the concerned flow has firstly to be switched back in AT mode with the adl fcmSwitchV24State API Once the parameters changed the flow may be switched again to data mode using the same API wavecom Confidential Page 62 220 This document is the sole and exclusive property of WWAVECOM Not to be distributed or divulged without prior written agreement Ce document est la propri t exclusive de WAVECOM Il ne peut tre communiqu ou divulgu des tiers sans son autorisation pr alable weavecom incl Make it wireless WM DEV OAT UGD 019 002 September 11 2006 3 7 4 The adl fcmUnsubscribe Function This function unsubscribes from a previously subscribed FCM service closing the previously opened flows The unsubscription will be effective only when the control event handler has received the ADL FCM EVENT FLOV CLOSED event If slave handles were subscribed as soon as the master one unsubscribes from the flow all the slave one will also be unsubscribed e Prototype s8 adl fcmUnsubscribe u8 Handle e Parameters Handle Handle returned by the adl fcmSubscribe function e Returned values o OKon success The Control handler will also receive a ADL FCM EVENT FLOV CLOSED event when flow is ready to process ADL RET ERR UNKNOWN HDL if the handle is incorrect ADL RET ERR NOT SUBSCRIBED if the flow is already unsubscri
117. bed ADL RET ERR BAD STATE if the serial link is not in AT mode ADL RET ERR SERVICE LOCKED if the function was called from a low level interruption handler the function is forbidden in this context 0000 3 7 5 The adl fcmHeleaseCredits Function This function releases some credits for requested flovv handle The slave subscribers should not use this API e Prototype s8 adl fcmReleaseCredits u8 Handle u8 NbCredits e Parameters Handle Handle returned by the adl fcmSubscribe function NbCredits Number of credits to release for this flow If this number is greater than the number of previously received data blocks all credits are released If an application wants to release all received credits at any time it should call the adl fcmReleaseCredits API with NbCredits parameter set to OxFF e Returned values o OKon success o ADL RET ERR UNKNOWN HDL if the provided handle is unknown wavecom Confidential Page 63 220 This document is the sole and exclusive property of WWAVECOM Not to be distributed or divulged without prior written agreement Ce document est la propri t exclusive de WAVECOM Il ne peut tre communiqu ou divulgu a des tiers sans son autorisation pr alable weavecom gt G nie Make it wireless WM DEV OAT UGD 019 002 September 11 2006 o ADL RET ERR BAD HDL if the handle is a slave one o ADL RET ERR SERVICE LOCKED if the function was called from a low level interru
118. bed in order to drive un to 8 remote chips e Prototype s32 adl busSubscribe adl busType e BusType adl busSettings u BusSettings e Parameters BusType Type of the bus to subscribe to using the adl busType e type values BusSettings Subscribed bus configuration parameters using the adl busSettings u type e Returned values o A positive or null value on success e BUS handle to be used in further BUS API functions calls wavecom Confidential Page 94 220 This document is the sole and exclusive property of WAVECOM Not to be distributed or divulged without prior written agreement Ce document est la propri t exclusive de WAVECOM Il ne peut tre communiqu ou divulgu des tiers sans son autorisation pr alable wavecom Make it wireless WM_DEV_OAT_UGD_019 002 September 11 2006 o A negative error value e ADL_RET_ERR_PARAM if a parameter has an incorrect value e ADL RET ERR ALREADY SUBSCRIBED if the required bus is already subscribed with the provided configuration e ADL RET ERR NO MORE HANDLES if there are no more free bus handles 8 bus configurations have already been subscribed e ADL RET ERR BAD HDL if a GPIO required by the provided bus configuration is currently subscribed by an Open AT application e ADL RET ERR NOT SUPPORTED if the required bus type is not supported by the Wireless CPU on which the application is running e ADL RET ERR SERVICE LOCKED if the function was call
119. bscribe to the 4WIND 4 unsolicited response adl_atUnSoUnSubscribe WIND 4 adl atUnSoHandler t Wind4 Handler adl atSendResponse ADL AT RSP r nWe have received a Wind 4 r n We want this response to be sent to the external application so we return TRUE return TRUE main function void adl main adl InitType e adlInitType Subscribe to the 4WIND 4 unsolicited response adl atUnSoSubscribe 4WIND 4 adl atUnSoHandler t Wind4 Handler 3 2 3 Responses 3 2 3 1 The adl atSendResponse function This function sends the provided text to any external application connected to the required port as a response an unsolicited response or an intermediate response according to the requested type e Prototype s32 adl atSendResponse ul6 Type ascii String e Parameters Type This parameter is composed of the response type and the destination port where to send the response The type amp destination combination has to be done with the following macro ADL AT PORT TYPE port type The port argument has to be a defined value of the adl atPort e type and this required port has to be available cf the AT FCM port Service sending a response on an Open AT the GSM or GPRS based port will have no effects wavecom Confidential Page 28 220 This document is the sole and exclusive property of WAVECOM Not to be distributed or divulged without prior written agre
120. buted or divulged without prior written agreement Ce document est la propri t exclusive de WAVECOM Il ne peut tre communiqu ou divulgu a des tiers sans son autorisation pr alable wevecom Make it wireless WM DEV OAT UGD 019 002 September 11 2006 3 28 ADL DAC Service 3 28 1 Required Header File The header file for the functions dealing with the DAC interface is adl dac h 3 28 2 The adl dacSubscribe Function This function subscribes to one of the module DAC block interface e Prototype s32 adl dacSubscribe adl dacChannel e Channel adl dacParam t Parameters e Parameters Channel The DAC channel identifier to be subscribed using the type below typedef enum ADL DAC CHANNEL 1 ADL DAC NUMBER OF CHANNEL ADL DAC CHANNEL PAD Ox7fffffff adi dacChannel e Channel identifiers depend on the current module type please refer to the module Product Technical Specification document for more information Module type Channel Output DAC PIN Output DAC PIN identifier name number Q2687 ADL_DAC_CHANNEL_1 AUXDAC 82 Parameters DAC channel initialization parameters using the type below typedef struct u32 InitialValue adl_dacParam_t InitialValue Initial value to be written on the DAC just after it has been opened Significant bits and output voltage depend on the module type please refer to the module Product Technical Specification document
121. com Confidential Page 175 220 This document is the sole and exclusive property of WWAVECOM Not to be distributed or divulged without prior written agreement Ce document est la propri t exclusive de WAVECOM Il ne peut tre communiqu ou divulgu a des tiers sans son autorisation pr alable weavecom i Make it wireless WM_DEV_OAT_UGD_019 002 September 11 2006 3 21 4 The adl portSubscribe Function This function subscribes to the AT FCM IO Ports service in order to receive specific ports related events e Prototype s8 adl portSubscribe adl portHdlr f PortHandler e Parameters PortHandler Port related events handler defined using the following type typedef void adl portHdlr f adl portEvent e Event adl port e Port u8 State The events received by this handler are defined below ADL PORT EVENT OPENED Informs the ADL application that the specified Port is now opened According to its type it may now be used with either AT Commands service or FCM service ADL PORT EVENT CLOSED Informs the ADL application that the specified Port is now closed It is not usable anymore with neither AT Commands service nor FCM service ADL PORT EVENT DSR STATE CHANGE Informs the ADL application that the specified Port DSR signal state has changed to the new State value 0 1 This event will be received by all subscribers which have started a polling process on the specified Port DSR signal with the ad p
122. cribes to the SMS service in order to receive SMSs from the network e Prototype s8 adl smsSubscribe adl smsHdlr f SmsHandler adl smsCtrlHdlr f SmsCtrlHandler u8 Mode e Parameters SmsHandler SMS handler defined using the following type typedef bool adl_smsHdlr_f ascii SmsTel ascii SmsTimeLength ascii SmsText This handler is called each time an SMS is received from the network SmsTel contains the originating telephone number of the SMS in text mode or NULL in PDU mode SmsTimeLength contains the SMS time stamp in text mode or the PDU length in PDU mode SmsText contains the SMS text in text mode or the SMS PDU in PDU mode This handler returns TRUE if the SMS must be forvvarded to the external application it is then stored in SIM memory and the external application is then notified by a CMTI unsolicited indication It returns FALSE if the SMS should not be forwarded If the SMS service is subscribed several times a received SMS will be forwarded to the external application only if each of the handlers return TRUE Note Whatever is the handler s returned value the incoming message has been internally processed by ADL if it is read later via the CMGR or CMGL command its status will be REC READ instead of REC UNREAD wavecom Confidential Page 119 220 This document is the sole and exclusive property of WWAVECOM Not to be distributed or divulged without prior w
123. cription time e Returned values o OKon success o ADL RET ERR PARAM on a supplied parameter error o ADL RET ERR UNKNOWN HDL if the supplied SCTU handle is unknown o ADL RET ERR BAD STATE if the SCTU timer is running 3 24 5 The adl sctuStart Function This function allows the application to start the SCTU block timer Once started the SCTU interruptions are generated according to the counter overflow amp comparator channel settings e Prototype s32 adl sctuStart s32 SctuHandle e Parameters SctuHandle SCTU service handle previously returned by the adl sctuSubscribe function e Returned values o OKon success o ADL RET ERR UNKNOWN HDL if the supplied SCTU handle is unknown o ADL RET ERR NOT SUBSCRIBED if no interruption source has been defined in the SCTU block configuration o ADL RET ERR BAD STATE if the SCTU timer is already running wavecom Confidential Page 197 220 This document is the sole and exclusive property of WAVECOM Not to be distributed or divulged without prior written agreement Ce document est la propri t exclusive de WAVECOM Il ne peut tre communiqu ou divulgu a des tiers sans son autorisation pr alable wevecom Make it wireless WM DEV OAT UGD 019 002 September 11 2006 3 24 6 The adl_sctuRead Function This function allows the application to retrieve the SCTU interruption source mask It should be called only from low level interruption handlers
124. d events these ones will be forwarded to all opened ports On responses events these ones will be forwarded only on the port on which the request was executed ADL CALL NO FORWARD the call event shall not be sent to the external application ADL CALL NO FORWARD ATH the call event shall not be sent to the external application and the application shall terminate the call by sending an ATH command ADL_CALL_NO_FORWARD_ATA the call event shall not be sent to the external application and the application shall answer the call by sending an ATA command e Returned values o OK on success ADL_RET_ERR_PARAM on parameter error o ADL RET ERR SERVICE LOCKED if the function was called from a low level interruption handler the function is forbidden in this context O 3 15 3 The adl callSetup Function This function just runs the adl callSetupExt one on the ADL PORT OPEN AT VIRTUAL BASE port cf adi callSetupExt description for more information Please note that events generated by the ad1 callSetup will not be able to be forwarded to any external port since the setup command was running on the Open AT port 3 15 4 The adl callSetupExt Function This function sets up a call to a specified phone number wavecom Confidential Page 132 220 This document is the sole and exclusive property of WWAVECOM Not to be distributed or divulged without prior written agreement Ce document est la propri t exc
125. d message identifier is lower than the subscribed message identifier ADL MSG ID COMP LOWER OR EQUAL The received message identifier is lower or equal to the subscribed message identifier 3 14 4 The adl msgFilter t Structure This structure allows the application to define a message filter at service subscription time typedef struct u32 MsgIdentifierMask u32 MsgIdentifierValue adl msgIdComparator e Comparator adl ctxID e Source adl msgFilter t 3 14 4 1 Structure Fields The structure fields are defined below o MsgIdentifierMask Bit mask to be applied to the incoming message identifier at reception time Only the bits set to 1 in this mask will be compared for the service handlers notification If the mask is set to O the identifier comparison will always match o MsgIdentifierValue Message identifier value to be compared with the received message identifier Only the bits filtered by the MsgIdentifierMask mask are significant o Comparator Operator to be used for incoming message identifier comparison wavecom Confidential Page 123 220 This document is the sole and exclusive property of WWAVECOM Not to be distributed or divulged without prior written agreement Ce document est la propri t exclusive de WAVECOM Il ne peut tre communiqu ou divulgu des tiers sans son autorisation pr alable wevecom Make it wireless WM DEV OAT UGD 019 002 September
126. d with this function Signal Signal to monitor while the polling process See the adl portGetSignalState function for information about the available signals PollingTimerType PollingTimerValue parameter value s unit The allowed values are defined below Timer type Timer unit ADL TMR TYPE 100MS PollingTimerValue is in 100 ms steps ADL TMR TYPE TICK Polling TimerValue is in 18 5 ms tick steps This parameter is ignored on additional function calls on the same port PollingTimerValue Polling time interval uses the PollingTimerType parameter s value unit This parameter is ignored on additional function calls on the same port wavecom Confidential Page 179 220 This document is the sole and exclusive property of WAVECOM Not to be distributed or divulged without prior written agreement Ce document est la propri t exclusive de WAVECOM Il ne peut tre communiqu ou divulgu des tiers sans son autorisation pr alable wevecom Make it wireless WM_DEV_OAT_UGD_019 002 September 11 2006 e Returned values OK on success ADL_RET_ERR_PARAM on parameter error ADL_RET_ERR_UNKNOWN_HDL if the provided handle is unknown ADL RET ERR NOT SUBSCRIBED if the service is not subscribed ADL RET ERR BAD STATE if the required port is not opened ADL RET ERR ALREADY SUBSCRIBED if a polling process is already running on another port ADL RET ERR SERVICE LOCKED if the function
127. document is the sole and exclusive property of WWAVECOM Not to be distributed or divulged without prior written agreement Ce document est la propri t exclusive de WAVECOM Il ne peut tre communiqu ou divulgu a des tiers sans son autorisation pr alable wevecom Make it wireless WM_DEV_OAT_UGD_019 002 September 11 2006 3 23 3 The adl irqNotificationLevel e Type This type defines the notification level of a given interruption handler typedef enum ADL_IRQ NOTIFY_LOW_LEVEL ADL IRQ NOTIFY HIGH LEVEL ADL IRQ NOTIFY LAST Reserved for internal use adl irqNotificationLevel e The ADL IRQ NOTIFY LOW LEVEL constant allows low level interruption handlers to be defined The ADL IRO NOTIFY HIGH LEVEL constant allows high level interruption handlers to be defined For more information on specific high and low level handlers behavior please refer to the Execution Context Service description 8 3 25 3 23 4 The adl irqPriorityLevel e Type This structure supplies interruption handlers with data related to the interruption source typedef struct ADL_IRQ PRIORITY LOW LEVEL ADL IRO PRIORITY HIGH LEVEL ADL IRQ PRIORITY LAST Reserved for internal use adl irqPriorityLevel e The ADL IRO PRIORITY LOW LEVEL constant allows a low priority interruption handler to be defined The ADL IRQ PRIORITY HIGH LEVEL constant allows a low priority interruption handler to be defined The priority le
128. e adl fln Write X lt gt adl flhDelete X adl fln Write X e The flash object driver checks if there is enough place the store the new object If not a Garbage Collector process is done see below e The new object is created About the erase process each time the adl flh Delete or adl flh Write function is called on a ID this object is from this time considered as erased even if it is not physicaly erased an inner erase flag is set on this object Objects are physically erased only when the Garbage Collector process is done when an adl flh Write function call needs a size bigger than the available place in the flash objects storage place The Garbage Collector process erases the flash objects storage place and re write only the objects which have not their erase flag set Please note that the flash memory physical limitation is the erasure cycle number which is granted to be at least 100 000 times wavecom Confidential Page 51 220 This document is the sole and exclusive property of WAVECOM Not to be distributed or divulged without prior written agreement Ce document est la propri t exclusive de WAVECOM Il ne peut tre communiqu ou divulgu des tiers sans son autorisation pr alable wevecom Make it wireless WM DEV OAT UGD 019 002 September 11 2006 3 6 2 2 Flash Objects in Remote Task Environment When an application is running in Remote Task Environment the flash ob
129. e adl errStartBacktraceAnalysis function BacktraceBuffer Buffer in which the next retrieved backtrace will be copied This parameter may be set to NULL in order to know the next backtrace buffer required size Size Backtrace buffer size If this size is not large enough the ADL RET ERR PARAM error code will be returned e Returned values o OK if the next stored backtrace was successfully copied in the BacktraceBuffer parameter o The required size for next backtrace buffer if the BacktraceBuffer parameter is set to NULL o ADL RET ERR PARAM if the provided Size parameter is not large enough o ADL RET ERR NOT SUBSCRIBED if the adl errStartBacktraceAnalysis function was not called before o ADL RET ERR UNKNOWN HDL if the provided Handle parameter is invalid o ADL RET ERR DONE if the last backtrace buffer has already been retrieved The Handle parameter will novv be unsubscribed and not usable any more with the adl errRetrieveNextBacktrace function A new analysis has to be started with the adl errStartBacktraceAnalysis function o ADL RET ERR SERVICE LOCKED if the function was called from a low level interruption handler the function is forbidden in this context Notes o Once retrieved the backtrace buffers may be stored separately or concatenated in order to be sent using the application s protocol bearer choice to a remote server or PC Once retrieved as one or several files on a PC this these one s may be
130. e this feature state is represented by the bit 5 00000020 in hexadecimal format Please contact your VVavecom distributor for more information on how to enable this feature on the Wireless CPU 3 12 1 Required Header File The header file for the OSA service definitions is adl osa h 3 12 2 The adl osaSubscribe Function This function allows the application to supply an OSA service handler which will then be notified on each OSA event reception Moreover by calling this function the application requests the Wavecom firmware to close the local SIM connection and to post SIM requests to the application from now e Prototype s32 adl osaSubscribe adl osaHandler f OsaHandler e Parameters OsaHandler OSA service handler supplied by the application Please refer to adl osaHandler f type definition for more information see paragraph 3 12 3 e Returned values o A positive or null value on success OSA service handle to be used in further OSA service function calls A confirmation event will then be received in the service handler e ADL OSA EVENT INIT SUCCESS if the local SIM connection was closed successfully e ADL OSA EVENT INIT FAILURE if a Bluetooth SAP connection is running wavecom Confidential Page 112 220 This document is the sole and exclusive property of WWAVECOM Not to be distributed or divulged without prior written agreement Ce document est la propri t exclusive de WAVECOM Il ne peut tre c
131. e CUS4 level 1 on the Target Monitoring Tool 00 01 02 03 04 05 06 07 O8 O9 OA bytes from OB to 4D 4E AF 50 51 52 53 54 55 56 57 58 59 5A bytes from 5B to 9D 9E 9F AO Al A2 A3 A4 A5 A6 A7 bytes from A8 to C4 C5 C6 C7 In this Debug configuration the FULL TRACE and FULL DUMP macros are ignored even if these ones are used in the application source code they will neither be compiled nor displayed on Target Monitoring Tool at runtime 3 5 3 Full Debug Configuration When the Full Debug configuration is selected in the used IDE or with the wmmake command the DEBUG APP and DEBUG FULL compilation flags are both defined and also the following macros e TRACE u8 TL ascii T Cf the Debug configuration e DUMP u8 TL u8 P ul6 L Cf the Debug configuration e FULL TRACE u8 TL ascii T Works exactly as the TRACE macro e FULL_DUMP u8 TL u8 P ul6 L Works exactly as the DUMP macro 3 5 4 Release Configuration When the Release configuration is selected in the used IDE or with the wmmake command neither the _DEBUG_APP_ nor DEBUG FULL compilation flags are defined In this configuration the TRACE DUMP FULL TRACE and FULL DUMP macros are ignored even if these ones are used in the application source code they will neither be compiled nor displayed on Target Monitoring Tool at runtime wavecom Confidential Page 50 220 This document is the sole and exclusive property of WAVECOM
132. e Returned values o OKon success o ADL RET ERR UNKNOWN HDL when the supplied handle is unknown o ADL RET ERR PARAM when a supplied parameter value is vvrong wavecom Confidential Page 149 220 This document is the sole and exclusive property of WWAVECOM Not to be distributed or divulged without prior written agreement Ce document est la propri t exclusive de WAVECOM Il ne peut tre communiqu ou divulgu a des tiers sans son autorisation pr alable wevecom Make it wireless WM DEV OAT UGD 019 002 September 11 2006 o ADL RET ERR SERVICE LOCKED if the function was called from a low level interruption handler the function is forbidden in this context e Exceptions The following exception must be generated on this function call o RTK exception 206 if the semaphore has been consumed too many times A semaphore can be consumed a number of times equal to its initial value 256 3 17 5 The adi semProduce Function This function allows the application to increase the required semaphore counter by one If this counter value gets above zero the execution contexts that vere suspended due to using this semaphore are resumed e Prototype s32 adl semProduce s32 SemHandle e Parameters SemHandle Semaphore service handle previously returned by the adl semSubscribe function e Returned values OK on success ADL RET ERR UNKNOVWN HDL if the supplied handle is unknown o ADL RET ERR SERV
133. e adl ioSetDirection function to set a GPIO to a new direction typedef struct adl ioLabel u eLabel adl ioDirection e eDirection adi ioSetDirection t The eLabel member represents the GPIO label The eDirection member represents the new GPIO direction 3 8 2 6 The adl ioRead t Structure This type is used by the adl ioRead function to read one or several GPIO values typedef struct adl ioLabel u eLabel adl ioState e eState adl ioRead t The eLabel member represents the GPIO label The estate member is set by the function to the GPIO read value wavecom Confidential Page 72 220 This document is the sole and exclusive property of WWAVECOM Not to be distributed or divulged without prior written agreement Ce document est la propri t exclusive de WAVECOM Il ne peut tre communiqu ou divulgu a des tiers sans son autorisation pr alable wavecom Make it wireless WM DEV OAT UGD 019 002 September 11 2006 3 8 2 7 The adl ioWrite t Structure This type is used by the adl ioWrite function to write one or several GPIO values typedef struct adl ioLabel u eLabel adl ioState e eState adl ioWrite t The eLabel member represents the GPIO label The eState member represents the GPIO value to be set on the output 3 8 2 8 The adl ioFeature e Type This type enumerates the Wireless CPU features which are multiplexed with one or several GPIOs typedef enum ADL_IO
134. e and exclusive property of WAVECOM Not to be distributed or divulged without prior written agreement Ce document est la propri t exclusive de WAVECOM Il ne peut tre communiqu ou divulgu des tiers sans son autorisation pr alable wavecom Make it wireless WM_DEV_OAT_UGD_019 002 September 11 2006 e Prototype s32 adl sctuUnsubscribe s32 SctuHandle e Parameters SctuHandle SCTU service handle previously returned by the adl sctuSubscribe function e Returned values o OK on success o ADL RET ERR UNKNOWN HDL if the supplied SCTU handle is unknown o ADL RET ERR BAD STATE if the SCTU timer is running o ADL RET ERR SERVICE LOCKED if the function was called from a low level interruption handler the function is forbidden in this context 3 24 9 Example This example simply demonstrates how to use the SCTU service in a nominal case error cases are not handled Global variables SCTU service handle s32 SctuHandle IRQ service handle s32 IrqHandle SCTU configuration counter overflow each 5ms adl sctuSettings t Config 80 0 65166 TRUE SCTU interruption handler bool MySctuHandler adi irqID e Source adl irqNotifyLevel e NotificationLevel adl irqEventData t Data Read the interruption source adl sctuInfo t Source AutoReadSource adl sctuRead SctuHandler amp Source Interruption source can also be obtained from the auto read opt
135. e application to subscribe to the SCTU service Moreover by calling this function the application powers on the required Wireless CPU System Controller Timer Unit block e Prototype s32 adl sctuSubscribe adl sctuID e BlockID s32 LowLevellrqHandle s32 HighLevelIrqHandle adl_sctuSettings_t Settings e Parameters BlockID SCTU block identifier to be subscribed using the type below typedef enum ADL SCTU BLOCK1 SCTU block 1 ADL SCTU BLOCK LAST Internal use only adl sctuID e LowLevellrqHandle Low level interruption handler identifier previously returned by the adl irqSubscribe function This parameter is optional if the HighLevelIrqHandle parameter is supplied HighLevellrqHandle High level interruption handler identifier previously returned by the adl irqSubscribe function This parameter is optional if the LowLevelIrgHandle parameter is supplied Settings SCTU block configuration to be defined using the following structure typedef struct u8 PrescalerReload Prescaler reload value u8 Pad Reserved ul6 CounterReload Counter reload value bool OverflowITFlag Overflow interruption flag adl sctuSettings t PrescalerReload Value to be reloaded in the prescaler register on each overflow ie when the prescaler reaches the OxFF value The prescaler time period can be calculated by the formula PrescalerTime OxFF PrescalerReload 1 ClockFrequency wav
136. e communiqu ou divulgu des tiers sans son autorisation pr alable wevecom Make it wireless WM DEV OAT UGD 019 002 September 11 2006 3 20 6 The adl adEventUnsubscribe Function This function allows the Open AT application to unsubscribe from the A amp D events notification e Prototype s32 adl adEventUnsubscribe s32 EventHandle e Parameters EventHandle Handle previously returned by the adl adEventSubscribe function e Returned values o OKon success o ADL_RET_ERR_UNKNOWN_HDL if the handle is unknown o ADL RET ERR NOT SUBSCRIBED if no A amp D event handler has been subscribed o ADL RET ERR BAD STATE if a format or re compaction process is currently running with this event handle o ADL RET ERR SERVICE LOCKED if the function was called from a low level interruption handler the function is forbidden in this context 3 20 7 The adl adWrite Function This function writes data at the end of the given A amp D cell e Prototype s32 adl adWrite s32 CellHandle u32 Size void Data 9 e Parameters CellHandle A amp D cell handle returned by adl_adSubscribe function Size Data buffer size in bytes Data Data buffer e Returned values o OKon success o ADL RET ERR UNKNOWN HDL if the handle was not subscribed o ADL RET ERR PARAM on parameter error o ADL RET ERR BAD STATE if the cell is finalized o ADL AD RET ERR OVERFLOW if the write operation exceed the cell size
137. e demonstrates how to use the GPIO service in a nominal case error cases not handled on the Q2686 Wireless CPU Complete examples using the GPIO service are also available on the SDK generic Telemetry sample generic Drivers library sample wavecom Confidential Page 82 220 This document is the sole and exclusive property of WAVECOM Not to be distributed or divulged without prior written agreement Ce document est la propri t exclusive de WAVECOM II ne peut tre communiqu ou divulgu a des tiers sans son autorisation pr alable wavecom Make it wireless WM_DEV_OAT_UGD_019 002 September 11 2006 Check event switch Event case ADL IO EVENT INPUT CHANGED The subscribed input has changed TRACE 1 GPIO d new value d adl ioRead t Param 0 eLabel adl ioRead t Param 0 eState break Somewhere in the application code used as an event handler void MyFunction void Local variables s32 ReadValue Subscribe to the GPIO event service MyGpioEventHandle adl ioEventSubscribe MyGpioEventHandler Subscribe to the GPIO service One handle without polling one with a 100ms polling process MyGpioHandlel adl ioSubscribe GPIO COUNT1 MyGpioConfigl 0 0 0 MyGpioHandle2 adl ioSubscribe GPIO COUNT2 MyGpioConfig2 ADL TMR TYPE 100MS 1 MyGpioEventHandle 17 SE OTELE adl ioWriteSingle MyGpioHandlel ADL IO Q2686 GPIO
138. e document est la propri t exclusive de WAVECOM Il ne peut tre communiqu ou divulgu a des tiers sans son autorisation pr alable wavecom Make it wireless WM_DEV_OAT_UGD_019 002 September 11 2006 GPIO Identifier Linked Feature if any ADL IO Q2686 GPIO 1 ADL IO Q2686 GPIO 2 ADL IO Q2686 GPIO 3 ADL IO FEATURE INTO ADL IO Q2686 GPIO 4 ADL IO FEATURE KBD ADL IO Q2686 GPIO 5 ADL IO FEATURE KBD ADL IO Q2686 GPIO 6 ADL IO FEATURE KBD ADL IO Q2686 GPIO 7 ADL IO FEATURE KBD ADL IO Q2686 GPIO 8 ADL IO FEATURE KBD ADL IO Q2686 GPIO 9 ADL IO FEATURE KBD ADL IO Q2686 GPIO 10 ADL IO FEATURE KBD ADL IO Q2686 GPIO 11 ADL IO FEATURE KBD ADL IO Q2686 GPIO 12 ADL IO FEATURE KBD ADL IO Q2686 GPIO 13 ADL IO FEATURE KBD ADL IO Q2686 GPIO 14 ADL IO FEATURE UART2 ADL IO Q2686 GPIO 15 ADL IO FEATURE UART2 ADL IO Q2686 GPIO 16 ADL IO FEATURE UART2 ADL IO Q2686 GPIO 17 ADL IO FEATURE UART2 ADL IO Q2686 GPIO 18 ADL IO FEATURE SIMPRES ADL IO Q2686 GPIO 19 ADL IO Q2686 GPIO 20 ADL IO Q2686 GPIO 21 ADL IO Q2686 GPIO 22 ADL IO FEATURE BT RST ADL IO Q2686 GPIO 23 ADL IO Q2686 GPIO 24 ADL IO Q2686 GPIO 25 ADL IO FEATURE INT1 ADL IO Q2686 GPIO 26 ADL IO FEATURE BUS I2C ADL IO Q2686 GP
139. e flash object e Returned values o OK on success o ADL_RET_ERR_PARAM if one at least of the parameters has a bad value o ADL RET ERR UNKNOWN HDL if handle is not subscribed ADL FLH RET ERR ID OUT OF RANGE if ID is out of handle range o ADL RET ERR FATAL if a fatal error occurred ADL ERR FLH WRITE error event will then occur o ADL FLH RET ERR MEM FULL if flash memory is full o ADL FLH RET ERR NO ENOUGH IDS if the object can not be created due to the global ID number limitation o ADL RET ERR SERVICE LOCKED if the function was called from a low level interruption handler the function is forbidden in this context O wavecom Confidential Page 54 220 This document is the sole and exclusive property of WAVECOM Not to be distributed or divulged without prior written agreement Ce document est la propri t exclusive de WAVECOM Il ne peut tre communiqu ou divulgu des tiers sans son autorisation pr alable wevecom D Make it wireless WM DEV OAT UGD 019 002 September 11 2006 3 6 7 The adl flhHead Function This function reads the flash object from the given Handle at the given ID for the length provided and stores it in a string e Prototype s8 adl flhRead ascii Handle ul6 ID ul16 Len u8 ReadData e Parameters Handle The Handle of the subscribed set of objects ID The ID of the flash object to read Len The length of the flash object to read ReadData The string
140. e forwarded to this Port parameter value e Returned values This function returns OK on success or a negative error value Possible error values are Error value Description ADL_RET_ERR_PARAM parameters error bad Cid value or unavailable port ADL_RET_ERR_PIN_KO if the PIN is not entered or if the WIND 4 indication has not occurred yet ADL_GPRS_CID_NOT_DEFINED problem to set up the Cid the CID is already activated ADL NO GPRS SERVICE if the GPRS service is not supported by the product ADL RET ERR BAD STATE the service is still processing another GPRS AF application should wait for the corresponding event indication of end of processing in the GPHS handler before calling this function ADL RET ERR SERVICE LOCKED f the function was called from a low level interruption handler the function is forbidden in this context Important note If the GPRS flow is running please do wait for the ADL FCM EVENT FLOVWV CLOSED event before calling the adl gprsDeact function in order to prevent Wireless CPU lock wavecom Confidential Page 143 220 This document is the sole and exclusive property of WWAVECOM Not to be distributed or divulged without prior written agreement Ce document est la propri t exclusive de WAVECOM Il ne peut tre communiqu ou divulgu a des tiers sans son autorisation pr alable wevecom Make it wireless WM DEV OAT UGD 019 002 Septe
141. e sent on the bus Allovved values for the OpcodeLength parameter are the O 32 range Example in order to send the BBB word on the bus prior to a read or write process the Opcode parameter has to be set to the OxBBB00000 value and the OpcodeLength parameter has to be set to 12 3 9 2 8 3 Usable for the both SPI amp I2C buses Size The Size parameter allows the bit size of read write process data buffer items to be set using the adl busSize e type 3 9 2 9 The adl busSize e Type This type sets the bit size for read amp write processes data buffer items typedef enum BUS_SIZE_1 BIT 1 BUS SIZE BITS BUS SIZE BITS BUS SIZE BITS BUS SIZE BITS OUBRWNE BUS BUS BUS BUS BUS BUS BUS BUS BUS SIZE BITS SIZE 7 BITS SIZE BYTE SIZE 9 BITS SIZE 10 BITS SIZE 11 BITS SIZE 12 BITS SIZE 13 BITS SIZE 14 BITS BUS SIZE 15 BITS BUS SIZE HALF ADL BUS SIZE WORD adi busSize e ADL BUS SIZE HALF Size parameter values can be From ADL_BUS_SIZE_1_BIT to ADL_BUS_SIZE_ HALF values for the SPI bus e Only the ADL BUS SIZE BYTE value for the I2C bus e ADL BUS SIZE BYTE Or ADL BUS SIZE HALF for the Parallel bus wavecom Confidential Page 93 220 This document is the sole and exclusive property of WWAVECOM Not to be distributed or divulged without prior written agreement Ce document est la propri t
142. e use of the information contained herein Trademarks WAVECOM WISMO and Open AT and certain other trademarks and logos appearing on this document are filed or registered trademarks of Wavecom S A in France or in other countries All other company and or product names mentioned may be filed or registered trademarks of their respective owners wavecom Confidential Page 3 220 This document is the sole and exclusive property of WAVECOM Not to be distributed or divulged without prior written agreement Ce document est la propri t exclusive de WAVECOM Il ne peut tre communiqu ou divulgu des tiers sans son autorisation pr alable wavecom Make it wireless WM DEV OAT UGD 019 002 September 11 2006 Overvievv This user guide describes the Application Development Layer ADL The aim of the Application Development Layer is to ease the development of Open AT embedded application It applies to revision Open AT 4 10 and higher until next version of this document wavecom Confidential Page 4 220 This document is the sole and exclusive property of WAVECOM Not to be distributed or divulged without prior written agreement Ce document est la propri t exclusive de WAVECOM Il ne peut tre communiqu ou divulgu des tiers sans son autorisation pr alable wevecom Make it wireless WM DEV OAT UGD 019 002 September 11 2006 Table of Contents DOCUMENT HIST
143. eceive SMS events e Prototype s8 adl smsUnsubscribe u8 Handle e Parameters Handle Handle returned by adl smsSubscribe function e Returned values OK on success ADL RET ERR UNKNOVWN HDL if the provided handler is unknown ADL RET ERR NOT SUBSCRIBED if the service is not subscribed ADL RET ERR BAD STATE if the service is processing an SMS ADL RET ERR SERVICE LOCKED if the function was called from a low level interruption handler the function is forbidden in this context O O O O wavecom confidential Page 121 220 This document is the sole and exclusive property of WAVECOM Not to be distributed or divulged without prior written agreement Ce document est la propri t exclusive de WAVECOM Il ne peut tre communiqu ou divulgu des tiers sans son autorisation pr alable wevecom es Make it wireless WM_DEV_OAT_UGD_019 002 September 11 2006 3 14 Message Service ADL provides this service to allow applications to post and handle messages Messages are used to exchange data between the different application components application task interruption handler 3 14 1 Required Header File The header file for message related functions is adl msg h 3 14 2 The adl msglViailBox e Type This type defines the available mailboxes for the message service Mailboxes are used to identify a message destination typedef enum ADL_MSG MBX OAT TASK ADL MSG MBX _ OAT TASK LAST Re
144. ecom Confidential Page 195 220 This document is the sole and exclusive property of WAVECOM Not to be distributed or divulged without prior written agreement Ce document est la propri t exclusive de WAVECOM Il ne peut tre communiqu ou divulgu des tiers sans son autorisation pr alable wevecom EE g Make it wireless WM_DEV_OAT_UGD_019 002 September 11 2006 Eg With a 13 MHz frequency amp a prescaler reload value set to 80 the prescaler time period is 13 54 us 255 80 1 13000000 OverflowlTFlag Boolean value which controls the counter overflow interruption If this flag is set each time counter overflow occurs an SCTU interruption is generated e Returned values o A positive or null value on success e SCTU service handle to be used in further SCTU service function calls o A negative error value otherwise e ADL RET ERR PARAM on a supplied parameter error e ADL RET ERR ALREADY SUBSCRIBED if the service was already subscribed for this block the SCTU service can only be subscribed one time on each block e ADL RET ERR BAD HDL if one or both supplied interruption handler identifiers are invalid e ADL RET ERR SERVICE LOCKED if the function was called from a low level interruption handler the function is forbidden in this context Important note While the SCTU service is subscribed the Wireless CPU will never enter low power consumption mode since the full speed internal clock
145. ecom Confidential Page 74 220 This document is the sole and exclusive property of WWAVECOM Not to be distributed or divulged without prior written agreement Ce document est la propri t exclusive de WAVECOM Il ne peut tre communiqu ou divulgu des tiers sans son autorisation pr alable wavecom Make it wireless Event amp Param WM_DEV_OAT_UGD_019 002 September 11 2006 Event is the received event identifier other parameters use depends on the event type The events defined in the adl_ioEvent_e type are described in the following table Event Meaning Param ADL IO EVENT FEATURE ENABLED ADL IO EVENT FEATURE DISABLED One or several multiplexed features are now enabled on the Wireless CPU Associated GPIO are not available for subscription One or several multiplexed features are now disabled on the Wireless CPU Associated GPIO are available for subscription Updated features identifiers table using the adl ioFeature e type Updated features identifiers table using the adl ioFeature e type ADL IO EVENT INPUT CHANGED One or several of the subscribed inputs have changed This event will be received only if a polling process is required at GPIO subscription time Read values table using the adl ioRead t type Note If the GPIO event is subscribed in the ad1 main function an ADL IO EVENT FEATURE ENABLED event will be generated just aft
146. ecom OS e Prototype s8 adl safeUnsubscribe adl safeHdlr f Handler e Parameters Handler Handler used with adl safeSubscribe function e Returned values o OKon success o ADL RET ERR PARAM if the parameter has an incorrect value o ADL RET ERR UNKNOWN HDL if the provided handler is unknown wavecom Confidential Page 154 220 This document is the sole and exclusive property of WWAVECOM Not to be distributed or divulged without prior written agreement Ce document est la propri t exclusive de WAVECOM Il ne peut tre communiqu ou divulgu a des tiers sans son autorisation pr alable wevecom Make it wireless WM DEV OAT UGD 019 002 September 11 2006 o ADL RET ERR NOT SUBSCRIBED if the service is not subscribed o ADL RET ERR SERVICE LOCKED if the function was called from a low level interruption handler the function is forbidden in this context 3 18 4 The adl safeHunCommand Function This function allows VW DWL or WOPEN command with any standard syntax e Prototype s8 adl safeRunCommand adl safeCmdType e CmdType adl atRspHandler t RspHandler e Parameters CmdType Command type to run please refer to adl safeSubscribe description ADL SAFE CMD WDWL OTHER and ADL SAFE CMD VOPEN OTHER values are not allowed The ADL SAFE CMD VOPEN SUSPEND APP may be used to suspend the Open AT application task The execution may be resumed using the AT VWOPENRES command or by sending
147. ects flash of the Open AT Embedded Application allowed only if the application is stopped 4 Erase the Open AT Embedded Application allowed only if the application is stopped 5 Suspend the Open AT application until the AT WOPENRES command is used or an hardware interruption occurs 6 Configures the Application amp Data storage place and Open AT application place sizes 7 Requires the current Open AT application state e g to check if the application binary has correctly been built or if the application is running in Target or RTE mode 8 Configures the Safe Boot mode refer to 82 9 for more information Note Refer to the document 2 for more information about this command By default this command is not pre parsed it can not be filtered by the Open AT application except if the Application Safe Mode service is used wavecom Confidential Page 19 220 This document is the sole and exclusive property of VVAVECOM Not to be distributed or divulged without prior written agreement Ce document est la propri t exclusive de WAVECOM Il ne peut tre communiqu ou divulgu des tiers sans son autorisation pr alable wavecom c Make it wireless WM DEV OAT UGD 019 002 September 11 2006 2 8 Notes on Wavecom OS The Open AT application runs within a single task managed by the Wavecom OS event handlers are always called sequentially by ADL no specific re entrancy protection has to be implemen
148. ed from a low level interruption handler the function is forbidden in this context Notes A bus is available only if the GPIO multiplexed with the corresponding feature is not yet subscribed by an Open AT application Concerned features depend on the bus type and configuration Bus Type amp Configuration Multiplexed Features ADL BUS I2C bus ADL IO FEATURE BUS I2C ADL BUS SPI1 bus ADL IO FEATURE BUS SPI1 CLK not using the hardware chip select pin ADL IO FEATURE BUS SPIl1 IO using one bi directional data pin ADL BUS SPI1 bus ADL IO FEATURE BUS SPI1 CLK using the hardware chip select pin ADL IO FEATURE BUS SPII IO using one bi directional data pin ADL IO FEATURE BUS SPI1 CS ADL BUS SPI1 bus ADL IO FEATURE BUS SPI1 CLK not using the hardware chip select pin ADL IO FEATURE BUS SPII IO using two data pins ADL IO FEATURE BUS SPI1 I ADL BUS SPI1 bus ADL IO FEATURE BUS SPI1 CLK using the hardware chip select pin ADL IO FEATURE BUS SPII IO using two data pins ADL IO FEATURE BUS SPIL I ADL IO FEATURE BUS SPI1 CS ADL BUS SPI2 bus ADL IO FEATURE BUS SPI2 CLK not using the hardware chip select pin ADL IO FEATURE BUS SPI2 IO using one bi directional data pin ADL BUS SPI2 bus ADL IO FEATURE BUS SPI2 CLK using the hardware chip select pin ADL IO FEATURE BUS SPI2 IO using one bi directional data pin ADL IO FEATURE BUS SPI2 CS wavecom Confidential Page 95 220 This docu
149. ed Header File issues 216 3 28 2 The adl dacSubscribe Function ss 216 3 28 3 The adl dacUnsubscribe Function ssssssssssrsrsrererrrrrrrrnererererrrerene 217 3 28 4 The adl dacWrite Function sessssssssssssssss nne 217 3 28 95 IEXAMPIB EE ee die ptu EU US REID DEC NU SLIDE ELE nus 218 4 ERROR CODES tuis cua n vh eek sed ce ER YR TRO Da ra ar pidava RU rues 219 4 1 G n ral Error Codes e ies ecd iex peek rae vies lucevindi nies evn E ENNEN 219 4 2 Specific FCM Service Error Codes 220 4 3 Specific Flash Service Error Codes 220 wavecom Confidential Page 10 220 This document is the sole and exclusive property of VVAVECOM Not to be distributed or divulged without prior written agreement Ce document est la propri t exclusive de WAVECOM Il ne peut tre communiqu ou divulgu des tiers sans son autorisation pr alable wavecom Make it wireless WM_DEV_OAT_UGD_019 002 September 11 2006 4 4 Specific GPRS Service Error Codes cece cece cece eee ee cece nese essen 220 4 5 Specific A amp D Storage Service Error Codes 220 wavecom Confidential Page 11 220 This document is the sole and exclusive property of WAVECOM Not to be distributed or divulged without prior written agreement Ce document est la propri t exclusive de WAVECOM Il ne peut tre communiqu ou divulgu des tiers sans son autorisation pr alable wevecom Make it wireless WM DEV OAT UGD 019
150. ed values o OKon success o ADL RET ERR UNKNOVVN HDL if the supplied Extint handle is unknown o ADL RET ERR SERVICE LOCKED if the function was called from a low level interruption handler the function is forbidden in this context wavecom Confidential Page 206 220 This document is the sole and exclusive property of VVAVECOM Not to be distributed or divulged without prior written agreement Ce document est la propri t exclusive de WAVECOM Il ne peut tre communiqu ou divulgu des tiers sans son autorisation pr alable wavecom Make it wireless WM_DEV_OAT_UGD_019 002 September 11 2006 3 25 8 Example This example demonstrates how to use the Extlnt service in a nominal case error cases are not handled Global variables ExtInt service handle s32 ExtIntHandle IRQ service handle s32 IrqHandle ExtInt configuration debounce mode on both edges with 7 8 ms debounce period adl_extintSettings_t Config ADL_EXTINT_POLARITY_BOTH ADL_EXTINT_PROCESS_DEBOUNCE 1 ExtInt interruption handler bool MyExtIntHandler adl_irqID_e Source adl_irqNotifyLevel_e NotificationLevel adl irqEventData t Data Read the input status adl extintInfo t Status AutoReadStatus adl extintRead ExtIntHandle amp Status Input status can also be obtained from the auto read option AutoReadStatus adl extintInfo t Data gt SourceData return TRUE Some
151. eful to send one at least one and only one terminal response for each subscribed command If a subscribed command is used in a concatenated command string the corresponding handler will be notified as if the command vvas used alone In order to handle properly the concatenation mechanism each subscribed command has to finally answer with a single terminal response ADL STR OK ADL STR ERROR or other ones otherwise the port will stay in concatenation processing mode refusing all internal and external commands on this one 3 2 4 2 The adi atCmdUnSubscribe Function This function unsubscribes from a command and its handler e Prototype s16 adl atCmdUnSubscribe ascii Cmdstr adl atCmdHandler t Cmdhdl e Parameters Cmdstr The string name of the command we want to unsubscribe from Cmdhdl The handler of the callback function associated to the command e Returned values o OK if the command was found o ADL RET ERR SERVICE LOCKED if the function was called from a low level interruption handler the function is forbidden in this context o ERROR otherwise wavecom Confidential Page 34 220 This document is the sole and exclusive property of WAVECOM Not to be distributed or divulged without prior written agreement Ce document est la propri t exclusive de WAVECOM Il ne peut tre communiqu ou divulgu des tiers sans son autorisation pr alable wavecom Make it wireless WM_DEV_OAT_UGD_019 00
152. ember 11 2006 3 10 Error Management 3 10 1 Required Header File The header file for the error functions is adl errors h 3 10 2 The adl errSubscribe Function This function subscribes to error service and gives an error handler this allows the application to handle errors generated by ADL or by the adl errHalt function Errors generated by the Wavecom OS can not be handled by such an error handler e Prototype s8 adl errSubscribe adl errHdlr f Handler e Parameters Handler Error Handler defined on following type typedef bool adl errHdlr f u16 ErrorID ascii ErrorStr An error is described by an Id and a string associated text that are sent as parameters to the adl errHalt function If the error is processed and filtered the handler should return FALSE The return value TRUE will cause the product to execute a fatal error reset with a backtrace A backtrace is composed of the provided message and a call stack footprint taken at the function call time It is readable by the Target Monitoring Tool Please refer to the Tools Manual document 3 for more information Note That ErrorID below Ox0100 are for internal purpose so the application should only use ErrorID above OxO100 The reboot is performed once the handler has returned TRUE In order to ensure the downloading of a new binary file after a fatal error has been detected the Open AT application software startup is done after a 20 seconds
153. ement Ce document est la propri t exclusive de WAVECOM Il ne peut tre communiqu ou divulgu des tiers sans son autorisation pr alable weavecom Make it wireless WM DEV OAT UGD 019 002 September 11 2006 Note that with the ADL AT UNS type value if the ADL AT PORT TYPE macro is not used the unsolicited response will be broadcasted on all currently opened ports If the ADL AT PORT TYPE macro is not used with the ADL AT RSP amp ADL AT INT types responses will be by default sent on the UART 1 port If this port is not opened responses will not be displayed The type argument has to be one of the values defined below e ADL AT RSP Terminal response have to ends an incoming AT command A destination port has to be specified Sending such a response will flush all previously buffered unsolicited responses on the required port e ADL AT INT Intermediate response text to display while an incoming AT command is running A destination port has to be specified Sending such a response will just display the required text without flushing all previously buffered unsolicited responses on the required port e ADL AT UNS Unsolicited response text to be displayed out of a currently running command process For the required port if any or for each currently opened port if the ADL AT PORT TYPE macro is not used if an AT command is currently running ie the command was sent by the external applicat
154. ending functions may be also used with the macros below which provide the additional Port argument it should avoid heavy code including each time the ADL AT PORT TYPE macro call define adl atSendResponsePort t p r adl atSendResponse ADL AT PORT TYPE p t r define adl atSendStdResponsePort t p r adl atSendStdResponse ADL AT PORT TYPE p t r define adl atSendStdResponseExtPort t p r a adl atSendStdResponseExt ADL AT PORT TYPE p t r a 3 2 4 Incoming AT Commands An ADL application may subscribes to an AT command string in order to receive events each time an external application sends this AT command on one of the Wireless CPU s ports Once the application has subscribed to a command it will have to unsubscribe to stop the callback function being executed every time this command is sent by an external application Multiple subscriptions if an application subscribes to a command with a handler and subscribes then to the same command with another handler every time this command is sent by the external application both handlers will be successively executed in the subscription order 3 2 4 1 The adi atCmdSubscribe Function This function subscribes to a specific command with an associated callback function so that next time the required command is sent by an external application the callback function will be executed e Prototype s16 adl atCmdSubscribe ascii Cmdstr adl atCmdHandle
155. entSubscribe Function This function allows the Open AT application to provide ADL with a call back for GPIO related events e Prototype s32 adl ioEventSubscribe adl ioHdlr f GpioEventHandler e Parameters GpioEventHandler Application provided event call back function Please refer to next chapter for event descriptions e Returned values o A positive or null value on success e GPIO event handle to be used in further GPIO API functions calls o A negative error value otherwise e ADL RET ERR PARAM if a parameter has an incorrect value e ADL RET ERR NO MORE HANDLES if the GPIO event service has been subscribed to more than 128 timers o ADL RET ERR SERVICE LOCKED if the function was called from a low level interruption handler the function is forbidden in this context Note In order to set up an automatic GPIO polling process the adl ioEventSubscribe function has to be called before the adl ioSubscribe 3 8 4 The adl ioHdlr f Call back Type Such a call back function has to be provided to ADL through the adl ioEventSubscribe interface in order to receive GPIO related events e Prototype typedef void adl ioHdlr f s32 GpioHandle adl ioEvent e Event u32 Size void Param e Parameters GpioHandle Read GPIO handle for the ADL IO EVENT INPUT CHANGED event For other events this parameter value is not relevant Size Number of items read inputs or updated features in the Param table wav
156. eps are emulated reaching a value as close as possible to the requested one modulo 18 5 For example if a 20 100ms timer is required the real time value will be 1998 ms 108 18 5ms e Prototype adl tmr t adl tmrSubscribe bool bCyclic u32 TimerValue u8 TimerType adl tmrHandler t Timerhdl e Parameters bCyclic This boolean flag indicates whether the timer is cyclic TRUE or not FALSE The cyclic timer is automatically set up vvhen a cycle is over TimerValue The number of periods after which the timer expires TimerType dependant TimerType Unit of the TimerValue parameter The allovved values are defined below Timer type Timer unit ADL TMR TYPE 100MS TimerValue is in 100 ms steps ADL TMR TYPE TICK TimerValue is in 18 5 ms tick steps Timerhdl The handler of the callback function associated to the timer It is defined following the type below typedef void adl tmrHandler t u8 The argument of the callback function will be the timer ID received by the ADL parser e Returned values o A pointer to the timer started that will be later used for instance for the un subscription There can only be 32 timers running at the same time if you try to get more this function will return a NULL pointer wavecom Confidential Page 42 220 This document is the sole and exclusive property of WAVECOM Not to be distributed or divulged without prior written agreement Ce document est l
157. equence 1s delay 1s delay this serial link is switched to AT mode and corresponding handler is notified by the ADL FCM EVENT V24 AT MODE EXT event Then the behavior depends on the returned value If it is TRUE all this flovv remaining handlers are also notified with this event The main handle can not be un subscribed in this state If it is FALSE this flow remaining handlers are not notified with this event and this serial link is switched back immediately to data mode In the first case after the ADL FCM EVENT V24 AT MODE EXT event the main handle subscriber should switch the serial link to data mode with the adl fcmSwitchV24State API or wait for the ADL FCM EVENT V24 DATA MODE EXT event This one will come when the external application sends the ATO command the serial link is switched to data mode and then all V24 clients are notified e When a GSM data call is released from the remote part the GSM flow will automatically be unsubscribed the ADL FCM EVENT FLOVWV CLOSED event will be received by all the flow subscribers When a GPRS session is released or when a GSM data call is released from the Wireless CPU side with the adl_callHangUp function the corresponding GSM or GPRS flow have to be unsubscribed These flows will have to be subscribed again before starting up a new GSM data call or a new GPRS session For serial link flows the serial line parameters speed character framing etc must not
158. er 11 2006 3 16 4 The adl gprsSetupExt Function This function sets up a PDP context identified by its CID vvith some specific parameters e Prototype s8 adl gprsSetupExt u8 Cid adl gprsSetupParams t Params adl port e Port e Parameters Cid The Cid of the PDP context to setup integer value between 1 and 4 Params The parameters to set up are contained in the following type typedef struct ascii APN ascii Login ascii Password ascii FixedIP bool HeaderCompression bool DataCompression adl gprsSetupParams t APN Address of the Provider GPRS Gateway GGSN maximum 100 bytes string Login GPRS account login maximum 50 bytes string Password GPRS account password maximum 50 bytes string FixedlP Optional fixed IP address of the MS used only if not set to NULL maximum 15 bytes string HeaderCompression PDP header compression option enabled if set to TRUE DataCompression PDP data compression option enabled if set to TRUE Port Port on which to run the PDP context setup command Setup return events are received in the GPRS event handler If the application requires wavecom Confidential Page 140 220 This document is the sole and exclusive property of WAVECOM Not to be distributed or divulged without prior written agreement Ce document est la propri t exclusive de WAVECOM Il ne peut tre communiqu ou divulgu des tiers sans son autorisation pr
159. er the application has started in order to notify it with all the enabled features on the Wireless CPU power on 3 8 5 The adl ioEventUnsubscribe Function This function allovvs the Open AT application to unsubscribe from the GPIO events notification e Prototype s32 adl ioEventUnsubscribe s32 GpioEventHandle e Parameters GpioEventHandle Handle previously returned by the adl ioEventSubscribe function e Returned values o OK on success o ADL RET ERR UNKNOWN HDL if the handle is unknown o ADL RET ERR NOT SUBSCRIBED if no GPIO event handler has been subscribed o ADL RET ERR BAD STATE if a polling process is currently running with this event handle wavecom Confidential Page 75 220 This document is the sole and exclusive property of WWAVECOM Not to be distributed or divulged without prior written agreement Ce document est la propri t exclusive de WAVECOM Il ne peut tre communiqu ou divulgu a des tiers sans son autorisation pr alable wevecom Make it wireless WM DEV OAT UGD 019 002 September 11 2006 o ADL RET ERR SERVICE LOCKED if the function was called from a low level interruption handler the function is forbidden in this context 3 8 6 The adl ioSubscribe Function This function subscribes to some GPIOs For subscribed inputs a polling system can be configured in order to notify a previously subscribed GPIO event handler vvith an ADL IO EVENT INPUT CHA
160. eral Purpose Input Output GGSN Gateway GPRS Support Node GPRS General Packet Radio Service IP Internet Protocol IR Infrared KB Kilobyte MS Mobile Station OS Operating System PDP Packet Data Protocol PDU Protocol Data Unit RAM Random Access Memory ROM Read Only Memory RTK Real Time Kernel SDK Software Development Kit SMA Small Adapter SMS Short Message Services wavecom confidential Page 14 220 This document is the sole and exclusive property of WAVECOM Not to be distributed or divulged without prior written agreement Ce document est la propri t exclusive de WAVECOM Il ne peut tre communiqu ou divulgu des tiers sans son autorisation pr alable wavecom en Make it wireless WM_DEV_OAT_UGD_019 002 September 11 2006 2 Description 2 1 Software Architecture The Application Development Layer library provides a high level interface for the Open AT software developer The ADL set of services has to be used to access all the Wavecom Wireless CPUs capabilities amp interfaces The Open AT environment relies on the following software architecture Application Code WAVECOM WIRELESS Figure 1 General software architecture The different software elements on a Wavecom product are described in this section The Open AT application which includes the following items o the application code o as an option according to the application needs one or several Open AT plug in librari
161. erty of WAVECOM Not to be distributed or divulged without prior written agreement Ce document est la propri t exclusive de WAVECOM Il ne peut tre communiqu ou divulgu des tiers sans son autorisation pr alable wavecom Make it wireless WM_DEV_OAT_UGD_019 002 September 11 2006 Jf Hasta tha cell will fail moe ilaculisedl adl adInstall MyADCellHandle Finalize the cell adl adFinalise MyADCellHandle Delete the cell adl adDelete MyADCellHandle Launch the re compaction process adl adRecompact MyADEventHandle Launch the format process will fail re compaction process is running adl adFormat MyADEventHandle Unsubscribe from the A amp D event service will fail re compaction process is running adl adEventUnsubscribe MyADEventHandler 3 21 AT FCM IO Ports Service ADL applications may use this service to be informed about the product AT FCM IO ports states 3 21 1 Required Header File The header file for the AT FCM IO Ports service is adl port h 3 21 2 AT FCM IO Ports AT Commands and FCM services can be used to send and receive AT Commands or data blocks to or from one of the product ports These ports are linked either to product physical serial ports as UART1 UART2 USB ports or virtual ports as Open AT virtual AT port GSM CSD call data port GPRS session data port or Bluetooth virtual ports AT FCM IO Ports are ide
162. erty of WAVECOM Not to be distributed or divulged without prior written agreement Ce document est la propri t exclusive de WAVECOM Il ne peut tre communiqu ou divulgu des tiers sans son autorisation pr alable wevecom Make it wireless WM_DEV_OAT_UGD_019 002 September 11 2006 3 19 AT Strings S rvice iniismusminniananiinnatetinatetnientatenin nat nina sien nent Para 156 3 19 1 Required Header File issus 156 3 19 2 The adl Stri Die Type iet ete ex Re Re ERE ERE EAEE 156 3 19 3 The adl strGetID Function csssssss IH 157 3 19 4 The adl strGetIDExt Function 157 3 19 5 The adl_strisTerminalResponse Function 158 3 19 6 The adl strGetResponse Function 158 3 19 7 The adl strGetResponseExt Function 159 3 20 pplication amp Data Storage Service 160 3 20 1 Required Header File 00 cc cece cece cece eee eee sense 160 3 20 2 The adl adSubscribe Function 160 3 20 3 The adl adUnsubscribe Function 161 3 20 4 The adl adEventSubscribe Function cece cece eee eee ee ees 162 3 20 5 The adl adEventHdlr f Call back Type 162 3 20 6 The adl adEventUnsubscribe Function cc cece eee eee 164 3 20 7 The adl adWrite Function cece cece eee eee ee mene nens 164 3 20 8 The adl adlnfo Function 165 3 20 9 The adl adFinalise Function 165 3 20 10 The adl_adDelete Function 166 3 20 11 The adl adlnstall Function ssssssssssssss 166
163. es such as the IP connectivity library o the Wavecom Application Development Layer library which provides all the services used by the application o the Wavecom OS which manages the Wavecom Wireless CPU wavecom Confidential Page 15 220 This document is the sole and exclusive property of WAVECOM Not to be distributed or divulged without prior written agreement Ce document est la propri t exclusive de WAVECOM Il ne peut tre communiqu ou divulgu a des tiers sans son autorisation pr alable weaevecom ds Make it wireless WM DEV OAT UGD 019 002 September 11 2006 2 2 Imported APIs from Open AT library The following APIs can be used like in Open AT standard applications The required headers are already included in the global ADL header file The APIs available by this way are listed below e Standard API defined in wm stdio h file e List API defined in wm list h file e Sound API defined in wm snd h file Please refer to Open AT ADL User Guide document 1 for these APIs description 2 3 ADL Limitations e ADL is not designed to run in ATQ1 mode quiet mode meaning that there is no answer to AT commands e While an ADL application is running the ATQ command always replies CME ERROR 600 Not allowed by embedded application e Concatenated commands for example AT CREG CGMR may be used from the embedded application but not from external applications while ADL is running If
164. ess WM_DEV_OAT_UGD_019 002 September 11 2006 e Parameters Feature Required feature to retrieve from multiplexed GPIO list GpioTab Returned multiplexed GPIO list containing feature If set to NULL the required table size is returned by the function GpioNb Size of GpioTab array e Returned values o Associated feature multiplexed GPIO count on success if GpioTab is NULL or if the provided size matches with the required one o ADL RET ERR PARAM if the provided array size does not match with the required one o ADL RET ERR UNKNOWN _ HDL if the feature is unknown 3 8 15 The adl iolsFeatureEnabled Function This function checks if the required feature is enabled or not e Prototype bool adl ioIsFeatureEnabled adl ioFeature e Feature e Parameters Feature Required feature e Returned values o FALSE if the feature is unknown or if it is disabled the associated GPIO are available for subscription o TRUE if the feature is enabled the associated GPIO is not available for subscription wavecom Confidential Page 81 220 This document is the sole and exclusive property of WWAVECOM Not to be distributed or divulged without prior written agreement Ce document est la propri t exclusive de WAVECOM Il ne peut tre communiqu ou divulgu des tiers sans son autorisation pr alable wavecom Make it wireless WM DEV OAT UGD 019 002 September 11 2006 3 8 16 Example This exampl
165. evecom pu Make it wireless WM DEV OAT UGD 019 002 September 11 2006 3 15 Call Service ADL provides this service to handle call related events and to setup calls 3 15 1 Required Header File The header file for the call related functions is adl call h 3 15 2 The adl callSubscribe Function This function subscribes to the call service in order to receive call related events e Prototype s8 adl callSubscribe adl callHdlr f CallHandler e Parameters CallHandler Call handler defined using the following type typedef s8 adl callHdlr f u16 Event u32 Call ID The pairs events call Id received by this handler are defined below each event is received according to an event type which can be o MO Mobile Originated call related event o MT Mobile Terminated call related event o CMD Incoming AT command related event Event Call ID Description Type ADL CALL EVENT RING VOICE O if voice phone call MT ADL CALL EVENT RING DATA O if data phone call MT ADL CALL EVENT NEW ID X if wind 5 X MO ADL CALL EVENT RELEASE ID X if wind 6 X on data call release X is MO a logical OR between the Call ID and MT the ADL CALL DATA FLAG constant ADL CALL EVENT ALERTING O if wind 2 MO ADL CALL EVENT NO CARRIER O phone call failure NO CARRIER MO MT ADL CALL EVENT NO ANSWER O phone call failure no answer MO ADL CALL EVENT BUSY O phone call fa
166. exclusive de WAVECOM Il ne peut tre communiqu ou divulgu des tiers sans son autorisation pr alable weavecom gt G nie Make it wireless WM DEV OAT UGD 019 002 September 11 2006 Note The ADL BUS SIZE WORD value may be used on future Wireless CPU versions to define 32 bit wide data item size The read write functions data buffer format depends on this bitsize configuration e From ADL BUS SIZE 1 BIT to ADL BUS SIZE BYTE values the data buffer will be considered to be an u8 buffer e From ADL BUS SIZE 9 BITS to ADL BUS SIZE HALF values the data buffer will be considered to be an u16 buffer Moreover if the required size is not the ADL BUS SIZE BYTE or the ADL BUS SIZE _ HALF only the least significant bits of each buffer item will be used Examples In order to send bytes on the bus the bit size parameter has to be set to the ADL BUS_SIZE_BYTE value read write functions data buffer format will be considered as an u8 buffer In order to send 10 bits words on the bus the bit size parameter has to be set to the ADL BUS SIZE 10 BITS value read write functions data buffer format will be considered as an u16 buffer and only the 10 least significant bits of each u16 will be sent on the bus 3 9 3 The adl busSubscribe Function This function subscribes to a specific bus in order to write and read values to from a remote chip Up to 8 bus configurations can simultaneously be subscri
167. f the required address pins Eg If two address pins are required two bits will be set in the mask For each set bit the associated address pin is the pin corresponding to the bit index Eg If the b1 bit is set the A1 address pin will be usable at read write process time wavecom Confidential Page 91 220 This document is the sole and exclusive property of WWAVECOM Not to be distributed or divulged without prior written agreement Ce document est la propri t exclusive de WAVECOM Il ne peut tre communiqu ou divulgu des tiers sans son autorisation pr alable wavecom Make it wireless WM_DEV_OAT_UGD_019 002 September 11 2006 3 9 2 7 The adl busSettings u Type This structure sets the bus configuration parameters that are provided at subscription time typedef union adl busSPISettings t SPI adl busI2Csettings t I2C adl busParallelsettings t Parallel adl busSettings u The union SPI member is used by the API if an SPI bus subscription is required The union I2C member is used by the API if an I2C bus subscription is required The union Parallel member will be used by the API if a Parallel bus subscription is required 3 9 2 8 The adl busAccess t Type This structure sets the bus access configuration parameters to be used on a standard read or write process request for SPI or I2C bus only typedef struct u32 Address u32 Opcode u8 OpcodeLength u8 AddressLength ad
168. for more information Module type Significant bits Max output voltage Q2687 8 less significant bits 2 2 V for OxFF value wavecom Confidential Page 216 220 This document is the sole and exclusive property of WAVECOM Not to be distributed or divulged without prior written agreement Ce document est la propri t exclusive de WAVECOM Il ne peut tre communiqu ou divulgu a des tiers sans son autorisation pr alable wevecom Make it wireless WM DEV OAT UGD 019 002 September 11 2006 e Returned values o A positive or null value on success e DAC service handle to be used with further DAC service functions calls o A negative error value otherwise e ADL RET ERR ALREADY SUBSCRIBED if the required channel has already been subscribed e ADL RET ERR NO MORE HANDLES if there is no more free DAC handles e ADL RET ERR NOT SUPPORTED if the current module does not support the DAC service e ADL RET ERR PARAM on parameter error Note The DAC service is only available on the Q2687 product 3 28 3 The adl dacUnsubscribe Function This function unsubscribes from a previously subscribed DAC block e Prototype s32 adl dacUnsubscribe s32 Handle e Parameters Handle DAC service handle previously returned by the adl dacSubscribe function e Returned values o OKon success o ADL RET ERR UNKNOWN HDL if the provided handle is unknown 3 28 4 The adl dacWrite Function Thi
169. from a low level interruption handler the function is forbidden in this context Note Calling adl adDelete will unsubscribe the allocated handle 3 20 11 The adl adinstall Function This function installs the content of the requested cell if it is a DWL file This file should be an Open AT application an EEPROM configuration file an XModem downloader binary file or a Wavecom OS binary file Caution This API resets the Wireless CPU on success e Prototype s32 adl adInstall s32 CellHandle e Parameters CellHandle A amp D cell handle returned by adl adSubscribe function e Returned values o Wireless CPU resets on success The parameter of the adl_main function is then set to ADL INIT DOWNLOAD SUCCESS or ADL INIT DOWNLOAD ERROR according to the DWL file update success or not Before the Wireless CPU reset all subscribed event handlers if any will receive the ADL AD EVENT INSTALL event in order to let them perform last operations o ADL RET ERR BAD STATE if the cell is not finalized o ADL RET ERR UNKNOWN HDL if the handle was not subscribed wavecom Confidential Page 166 220 This document is the sole and exclusive property of WWAVECOM Not to be distributed or divulged without prior written agreement Ce document est la propri t exclusive de WAVECOM Il ne peut tre communiqu ou divulgu des tiers sans son autorisation pr alable wavecom SE Make it wireless WM DEV OAT UGD 0
170. ged without prior written agreement Ce document est la propri t exclusive de WAVECOM Il ne peut tre communiqu ou divulgu a des tiers sans son autorisation pr alable wavecom Make it wireless WM DEV OAT UGD 019 002 September 11 2006 3 9 2 2 8 DataLinesConf The DataLinesConf parameter defines if the SPI bus uses one single pin to handle both input and output data signals or two pins to handle them separately defined values are One bi directional pin is used to handle both input amp output data signals Two pins are used to handle separately input amp output data signals ADL BUS SPI DATA BIDIR ADL BUS SPI DATA UNIDIR 3 9 2 3 The adl busli2CSettings t Structure This structure defines the I2C bus settings for subscription typedef struct t u32 ChipAddress u32 Clk Speed adl busI2CSettings t 3 9 2 3 1 ChipAddress The ChipAddress parameter sets the remote chip 7 bit address on the I2C bus Only b1 to b7 bits are used bO bit and the 3 most significant bytes are ignored Example if the remote chip address is set to AO the ChipAddress parameter has to be set to the OxAO value 3 9 2 3 2 CIk Speed The C1k Speed parameter sets the required I2C bus speed defined values are ADL BUS I2C CLK STD Standard I2C bus speed 100 Kbits s ADL BUS I2C CLK FAST Fast I2C bus speed 400 Kbits s 3 9 2 4 The adl busParallelCs t Structure This type
171. handle is unknown O 3 25 6 The adl extintHead function This function allows the application to retrieve the external interruption pin input status e Prototype s32 adl extintRead s32 ExtIntHandle adl extintInfo t Info e Parameters ExtIntHandle Extint service handle previously returned by the adl_extintSubscribe function Info External interruption pin information structure Refer to adl extintInfo t type definition see 83 25 3 e Returned values o OKon success o ADL RET ERR PARAM on a supplied parameter error o ADL RET ERR UNKNOWN HDL if the supplied Extint handle is unknown 3 25 7 The adl extintUnsubscribe Function This function allows the application to unsubscribe from the Extint service Associated interruption handlers are unplugged from the Extlnt interruption source Pin configuration control is resumed by the AT WIPC command e Prototype s32 adl extintUnsubscribe s32 ExtIntHandle e Parameters ExtIntHandle Extint service handle previously returned by the adl extintSubscribe function wavecom Confidential Page 205 220 This document is the sole and exclusive property of WWAVECOM Not to be distributed or divulged without prior written agreement Ce document est la propri t exclusive de WAVECOM Il ne peut tre communiqu ou divulgu a des tiers sans son autorisation pr alable wavecom Make it wireless WM_DEV_OAT_UGD_019 002 September 11 2006 e Return
172. handle the semaphore resources supplied by the Open AT OS Semaphores are used to synchronize processes between the application task and high level interruption handlers Note Semaphores cannot be used in a low level interruption handler context 3 17 1 Required Header File The header file for the Semaphore service definitions is adl sem h 3 17 2 The adl semSubscribe Function This function allows the application to reserve and initialize a semaphore resource e Prototype s32 adl semSubscribe u16 SemCounter e Parameters SemCounter Semaphore inner counter initialization value reflects the number of times the semaphore can be consumed before the calling task must be suspended e Returned values o A positive or null value on success e Semaphore service handle to be used in further service function calls o A negative error value otherwise e ADL RET ERR NO MORE SEMAPHORES when there are no more free semaphore resources Up to 7 semaphore resources are available e ADL RET ERR SERVICE LOCKED if the function was called from a low level interruption handler the function is forbidden in this context wavecom Confidential Page 148 220 This document is the sole and exclusive property of WWAVECOM Not to be distributed or divulged without prior written agreement Ce document est la propri t exclusive de WAVECOM Il ne peut tre communiqu ou divulgu a des tiers sans son autorisation pr alable wevecom
173. he 1 January 1970 Second fractional part step is the ADL RTC SECOND FRACPART STEP constant This field most significant bit is not used values are in the O Ox7FFF range wavecom Confidential Page 181 220 This document is the sole and exclusive property of WWAVECOM Not to be distributed or divulged without prior written agreement Ce document est la propri t exclusive de WAVECOM Il ne peut tre communiqu ou divulgu des tiers sans son autorisation pr alable wevecom Make it wireless WM DEV OAT UGD 019 002 September 11 2006 3 22 2 3 Constants RTC service constants are defined below Constant Value Use Second fractional part step ADL RTC SECOND FRACPART STEP 30 5 value in us The real value is 1 215 ADL RTC DAY SECONDS 24x60x60 Seconds count in a day ADL RTC MS US 1000 seconds count in a B millisecond 3 22 2 4 Macros RTC service macros are defined below Macro Parameter Use adl rtcTimeStamp t Timestamp ADL RTC GET TIMIESTAMP SECONDSY t structure seconds part 0 59 adl rtcTimeStamp t Timestamp ADL_RTC_GET_TIMESTAMP MINUTES 9 lare ranures pan iD 59 adl rtcTimeStamp t mestamp ADL RTC GET TIMESTAMP HOURS t oUm e heurs part 0 23 ADL RTC GET TIMESTAMP DAYS t adl rie Timestamp Timestamp nd zl xc structure days part Timestamp ADL RTC GET TIMESTAMP MSY t He ideo S structure part 0 999
174. he Bluetooth virtual ones with enabled profiles other than the SPP one o If the port is already used to handle a feature required by an external application through the AT commands WLDB command or a CSD GPRS data session is already running 3 7 3 The adl fcmSubscribe Function This function subscribes to the FCM service opening the requested port and setting the control and data handlers The subscription will be effective only when the control event handler has received the ADL FCM EVENT FLOW OPENNED event Each port may be subscribed only one time Additional subscriptions may be done using the ADL FCM FLOW SLAVE flag see below Slave subscribed handles will be able to send amp receive data on from the flow but will know some limitations e For serial line flows UART physical amp logical based ports only the main handle will be able to switch the Serial Link state between AT amp Data mode e f the main handle unsubscribe from the flow all slave handles will also be unsubscribed Important note For serial link related flows UART physical amp logical based ports the corresponding port has to be opened first with the AT VW MFM command for physical ports or with the 27 010 protocol driver on the external application side for logical ports otherwise the subscription will fail See AT Commands Interface guide document 2 for more information By default only the UART1 physical port is opened A specific
175. he adl irqiD e Type cente tenete voe ev ENA a E WR TAN T WP TUD RT EN 185 3 23 3 The adl irqNotificationLevel e Type 186 3 23 4 The adl_irqPriorityLevel_ e Type cssessses e 186 3 23 5 The adl irqEventData t Structure 187 3 23 6 The adl irqSubscribe Function 187 3 23 7 The adl irqHandler f Call back Type 190 wavecom Confidential Page 9 220 This document is the sole and exclusive property of VVAVECOM Not to be distributed or divulged without prior written agreement Ce document est la propri t exclusive de WAVECOM II ne peut tre communiqu ou divulgu des tiers sans son autorisation pr alable wevecom Make it wireless WM_DEV_OAT_UGD_019 002 September 11 2006 3 23 8 The adl irqUnsubscribe Function ss 191 3 23 9 Examples cette tueescee nO Pv Gade enn dera reu epuDI dris putes 192 3 24 SCTU S rVICe oie ente Ann hare tanen nea ERE RR an ete datant terne ten 193 3 24 1 Required Header File 0 0 cc cece sisi 194 3 24 2 The adl sctulnfo t Structure 404 194 3 24 3 The adl sctuSubscribe Function ss 195 3 24 4 The adl sctuSetChannelConfig Function 196 3 24 5 The adl sctuStart Function eee m mmn 197 3 24 6 The adl sctuRead Function 198 3 24 7 The adl sctuStop Function ccc eee eee eee meme 198 3 24 8 The adl sctuUnsubscribe Function 198 3 24 9 Exarmiple scciaceigicneschaakid iaaa a a aa aa a tad abe RR UR UR MR UR NARRA ARR 199 3 25 Extint ADL
176. he elements of this response list can also be set as an adl rsp ID e response ID Please refer to 8 3 19 for more information e Returned values o OK on success the command will be executed on the required port as soon as possible o ADL_RET_ERR_PARAM on parameter error NULL command string or al command required this command can not be used with the adl atCmdCreate function o ADL RET ERR UNKNOWN HDL if the required port is not available o ADL RET ERR SERVICE LOCKED if the function was called from a low level interruption handler the function is forbidden in this context wavecom Confidential Page 37 220 This document is the sole and exclusive property of WAVECOM Not to be distributed or divulged without prior written agreement Ce document est la propri t exclusive de WAVECOM Il ne peut tre communiqu ou divulgu des tiers sans son autorisation pr alable weavecom a Make it wireless WM_DEV_OAT_UGD_019 002 September 11 2006 Note 1 This function can be associated with the adl atCmdSubscribe one for filtering or spying any intermediate response or response of a specific command send by the external application See the example below Note 2 Commands sent through the adl atCmdCreate function are directly submitted to the Wavecom OS AT interface they can not be filtered by an adl atCmdSubscribe mechanism The adl at CmdSubscribe function filters only the commands coming from external W
177. his type defines the available CPU modes for the VariSpeed Service typedef enum ADL_VS_MODE_STANDARD ADL_VS_MODE_BOOST ADL VS MODE LAST Reserved for internal use adl vsMode e The ADL V8 MODE STANDARD constant identifies the standard CPU clock mode default CPU mode on startup The ADL VS MODE BOOST constant can be used by the application to make the Wireless CPU enter a specific boost mode where the CPU clock frequency is set to its maximum value Caution In boost mode the Wireless CPU power consumption increases significantly For more information refer to the Wireless CPU Power Consumption Mode documentation Depending on the Wireless CPU type the clock frequencies of the available modes are listed below Modes Wireless CPU Q2686 Q2687 ADL VS MODE STANDARD 26 MHz 26 MHz ADL VS MODE BOOST 104 MHz 104 MHz wavecom Confidential Page 213 220 This document is the sole and exclusive property of VVAVECOM Not to be distributed or divulged without prior written agreement Ce document est la propri t exclusive de WAVECOM Il ne peut tre communiqu ou divulgu des tiers sans son autorisation pr alable wevecom Make it wireless WM DEV OAT UGD 019 002 September 11 2006 3 27 3 The adl vsSubscribe Function This function allows the application to get control over the VariSpeed service The VariSpeed service can only be subscribed one time e Prototype s3
178. ich applies a factor to stack sizes declared in the Open AT application source file By default this factor is set to 3 eg If the application source code requires a 1 kilobyte stack size the effective size with GCC compiler will be 3 kilobytes It can be modified and even set to O by the gss option of the wmnew script wavecom Confidential Page 24 220 This document is the sole and exclusive property of WAVECOM Not to be distributed or divulged without prior written agreement Ce document est la propri t exclusive de WAVECOM Il ne peut tre communiqu ou divulgu des tiers sans son autorisation pr alable wevecom es Make it wireless WM_DEV_OAT_UGD_019 002 September 11 2006 3 1 3 The adl main function This function must be defined by each Open AT application in order to provide the Wavecom OS with the required Open AT application entry point Once the application is started using the AT WOPEN 1 command it is called by the Wavecom OS each time the Wireless CPU is powered on and after each hardware or software reset e Prototype void adl main adl InitType e InitType e Parameters InitType Wireless CPU power on or reset reason based on the following type typedef enum ADL_INIT_POWER_ON Normal power on ADL_INIT_REBOOT_FROM EXCEPTION Reboot after an exception ADL INIT DOWNLOAD SUCCESS Reboot after a successful install process cf adl adInstall API ADL INIT DOWNLOAD ER
179. icited t structure holding the unsolicited response vve subscribed to The adl atUnsolicited t structure defined as follow it is declared in the adl at h header file wavecom Confidential Page 26 220 This document is the sole and exclusive property of WAVECOM Not to be distributed or divulged without prior written agreement Ce document est la propri t exclusive de WAVECOM Il ne peut tre communiqu ou divulgu des tiers sans son autorisation pr alable weavecom p Make it wireless WM DEV OAT UGD 019 002 September 11 2006 typedef struct adl strID e RspID Standard response ID adl atPort e Dest Unsolicited response destination port ul6 StrLength the length of the string name of the unsolicited response ascii StrData 1 a pointer to the string name of the unsolicited response adi atUnsolicited t The RsplD field is the parsed standard response ID if the received response is a standard one Refer to 8 3 19 for more information The Dest field is the unsolicited response original destination port If it is set to ADL PORT NONE unsolicited response is required to be broadcasted on all ports The return value of the callback function will have to be TRUE if the unsolicited string is to be sent to the external application on the port indicated by the Dest field if not set to ADL PORT NONE otherwise on all ports and FALSE otherwise Note That in case of seve
180. ill be copied into the message e Returned values o OKon success o ADL RET ERR PARAM if a parameter has an incorrect value Note When a message is posted the source context identifier is automatically set accordingly to the current context e f the message is sent from the application task the source context identifier is set to ADL CTX OAT TASK e f the message is sent from a low level interruption handler the source context identifier is set to ADL CTX LOW LEVEL IRQ HANDLER e f the message is sent from a high level interruption handler the source context identifier is set to ADL CTX HIGH LEVEL IRO HANDLER wavecom Confidential Page 127 220 This document is the sole and exclusive property of WWAVECOM Not to be distributed or divulged without prior written agreement Ce document est la propri t exclusive de WAVECOM Il ne peut tre communiqu ou divulgu a des tiers sans son autorisation pr alable wavecom Make it wireless WM DEV OAT UGD 019 002 September 11 2006 3 14 9 Example This example simply demonstrates how to use the message service in a nominal case error cases are not handled wavecom Confidential Page 128 220 This document is the sole and exclusive property of WAVECOM Not to be distributed or divulged without prior written agreement Ce document est la propri t exclusive de WAVECOM II ne peut tre communiqu ou divulgu des tiers sans son autorisation pr alable w
181. ilure busy MO wavecom Confidential Page 129 220 This document is the sole and exclusive property of WWAVECOM Not to be distributed or divulged without prior written agreement Ce document est la propri t exclusive de WAVECOM Il ne peut tre communiqu ou divulgu des tiers sans son autorisation pr alable wavecom Make it wireless WM_DEV_OAT_UGD_019 002 September 11 2006 Event Call ID Description Type ADL CALL EVENT SETUP OK Speed ok response after a call setup performed by the adl callSetup function in data call setup case the connection Speed in bits second is also provided MO ADL CALL EVENT ANSWER OK Speed ok response after an ADL CALL NO FORWARD ATA request from a call handler in data call answer case the connection Speed in bps is also provided ADL CALL EVENT CIEV Speed OK response after a performed call setup in data call setup case the connection Speed in bps is also provided ADL CALL EVENT HANGUP OK Data ok response after a ADL CALL NO FORWARD ATH request or a call hangup performed by the adl callHangup function on data call release Data is the ADL CALL DATA FLAG constant O on voice call release MO MT ADL CALL EVENT SETUP OK FROM EXT Speed ADL CALL EVENT ANSWER OK FRO M EXT Speed ok response after an ATD command from the external application in data call setup case the connection
182. ion AutoReadSource adl sctuInfo t Data SourceData return TRUE wavecom Confidential Page 199 220 This document is the sole and exclusive property of WAVECOM Not to be distributed or divulged without prior written agreement Ce document est la propri t exclusive de WAVECOM Il ne peut tre communiqu ou divulgu des tiers sans son autorisation pr alable wavecom Make it wireless WM DEV OAT UGD 019 002 September 11 2006 wavecom Confidential Page 200 220 This document is the sole and exclusive property of WAVECOM Not to be distributed or divulged without prior written agreement Ce document est la propri t exclusive de WAVECOM II ne peut tre communiqu ou divulgu des tiers sans son autorisation pr alable wavecom Make it wireless WM DEV OAT UGD 019 002 September 11 2006 3 25 Extint ADL Service The ADL External Interruption Extlnt service allows the application to handle Wireless CPU External Interruption pin configuration amp interruptions External interruption pins are multiplexed with the Wireless CPU GPIO and are available only if configured correctly through the AT commands o The INTERRUPT feature must be enabled in the AT W FM command o The required pin must be configured as an interruption not a GPIO in the AT WIPC command The global External Interruption pin operation is described below o The interruption is generated either on
183. ion but this command answer has not be sent back yet any unsolicited response will automatically be buffered until a terminal response is sent on this port String The text to be sent Please note that this is exactly the text string to be displayed on the required port ie all carriage return amp line feed characters r n in C language have to be sent by the application itself e Returned values o ADL RET ERR SERVICE LOCKED if the function was called from a low level interruption handler the function is forbidden in this context o OKifthe function is successfully executed wavecom Confidential Page 29 220 This document is the sole and exclusive property of VVAVECOM Not to be distributed or divulged without prior written agreement Ce document est la propri t exclusive de WAVECOM Il ne peut tre communiqu ou divulgu des tiers sans son autorisation pr alable wavecom Make it wireless WM DEV OAT UGD 019 002 September 11 2006 3 2 3 2 The adl atSendStdResponse Function This function sends the provided standard response to the required port as a response an unsolicited response or an intermediate response according to the requested type e Prototype s32 adl atSendStdResponse u8 Type adl strID e RspID e Parameters Type Same use as the adl atSendResponse Type parameter RspID Standard response ID to be sent see 83 19 for more information e Returned value
184. ion pr alable wevecom Make it wireless WM DEV OAT UGD 019 002 September 11 2006 Options Comment ADL IRO OPTION POST ACKNOWLEDGEMENT This option forces ADL acknowledge the interruption source after having called the low level handler It is ignored for high level handlers subscription Please note that in this configuration the low level interruption handler will alvvays be called sequentially it does not have to be re entrant Caution This option is not supported by all interruption source services please refer to these services de scription for more information e Returned values o A positive or null value on success e IRQ service handle to be used in further IRQ amp interruption source services function calls o A negative error value otherwise e ADL RET ERR PARAM on a supplied parameter error e ADL RET ERR NOT SUBSCRIBED if a low or high level handler subscription is required while the associated context call stack size vvas not supplied by the application please referto the Mandatory Service description 8 3 1 e ADL RET ERR NOT SUPPORTED if the Real Time enhancement feature is not enabled on the Wireless CPU e ADL RET ERR BAD STATE if the function is called in RTE mode e ADL RET ERR SERVICE LOCKED if the function was called from a low level interruption handler the function is forbidden in this context Note The IRQ service will alvvays return
185. ireless WM_DEV_OAT_UGD_019 002 September 11 2006 Data Buffer into which the read items are copied items bit size 8 or 16 bits is defined at subscription time in the configuration structure e Returned values o OK on success o ADL RET ERR UNKNOWN HDL if the provided handle is unknown o ADL RET ERR PARAM if a parameter has an incorrect value 3 9 8 The adl busDirectWrite Function This function writes on a previously subscribed bus e Prototype s32 adl busDirectWrite s32 Handle u32 ChipAddress u32 DataLen void Data e Parameters Handle Handle previously returned by the adl busSubscribe function ChipAddress Chip address configuration This address has to be a combination of the desired address bits to set Available address bits are returned in a mask at subscription time DataLen Number of items to write on the bus Data Data buffer to write on the bus item bit size 8 or 16 bits is defined at subscription time in the configuration structure e Returned values o OKon success o ADL RET ERR UNKNOWN HDL if the provided handle is unknown o ADL RET ERR PARAM if a parameter has an incorrect value wavecom Confidential Page 99 220 This document is the sole and exclusive property of WWAVECOM Not to be distributed or divulged without prior written agreement Ce document est la propri t exclusive de WAVECOM Il ne peut tre communiqu ou divulgu a des tiers sans son autorisa
186. ireless CPU ports Note 3 This function can be used to send Text Mode commands such as AT CMGW etc in order to provide the text related to this command the adl atCmdSendText function has then to be used as soon as the prompt gt response is received in the response handler Any further calls to adl atCmdCreate on this port will just store the required command in order to send those ones as soon as the running Text Mode command has ended Note 4 A command sent through the adl atCmdCreate function must be canceled by another command sent later through the same function E g if ATD amp ATH commands are sent through the function before ATD answers the ATD command does not receive any response since its execution has been canceled by the ATH command wavecom Confidential Page 38 220 This document is the sole and exclusive property of VVAVECOM Not to be distributed or divulged without prior written agreement Ce document est la propri t exclusive de WAVECOM Il ne peut tre communiqu ou divulgu des tiers sans son autorisation pr alable wavecom Make it wireless WM_DEV_OAT_UGD_019 002 September 11 2006 e Example In the following example we spy the ATD command by sending the AT CLCC command every time a subscribed intermediate response or response is received by the ADL parser atd responses callback function s16 ATD Response Handler adl atResponse t paras None
187. is document is the sole and exclusive property of WAVECOM Not to be distributed or divulged without prior written agreement Ce document est la propri t exclusive de WAVECOM Il ne peut tre communiqu ou divulgu a des tiers sans son autorisation pr alable wevecom Make it wireless WM DEV OAT UGD 019 002 September 11 2006 o A negative error value e ADL RET ERR PARAMI if a parameter has an incorrect value e ADL RET ERR ALREADY SUBSCRIBED if a requested GPIO was not free e ADL RET ERR NO MORE TIMIERS if there is no timer available to start the polling process required by application e ADL RET ERR NO MORE HANDLES if no more GPIO handles are available e ADL RET ERR SERVICE LOCKED if the function was called from a low level interruption handler the function is forbidden in this context 3 8 7 The adl ioUnsubscribe Function This function un subscribes from a previously allocated GPIO handle e Prototype s32 adl_ioUnsubscribe s32 GpioHandle e Parameters GpioHandle Handle previously returned by adl ioSubscribe function e Returned values o OKon success o ADL RET ERR UNKNOWN HDL if the provided handle is unknown o ADL RET ERR SERVICE LOCKED if the function was called from a low level interruption handler the function is forbidden in this context 3 8 8 The adl ioSetDirection Function This function allows the direction of one or more previously allocated GPIO to be modified e Pr
188. is function sends an SMS to the network e Prototype s8 adl smsSend u8 Handle ascii SmsTel ascii SmsText u8 Mode e Parameters Handle Handle returned by adl_smsSubscribe function wavecom Confidential Page 120 220 This document is the sole and exclusive property of WAVECOM Not to be distributed or divulged without prior written agreement Ce document est la propri t exclusive de WAVECOM Il ne peut tre communiqu ou divulgu des tiers sans son autorisation pr alable wevecom es Make it wireless WM_DEV_OAT_UGD_019 002 September 11 2006 SmsTel Telephone number where to send the SMS in text mode or NULL in PDU mode SmsText SMS text in text mode or SMS PDU in PDU mode Mode Mode used to send SMSs ADL SMS MODE PDU to send a SMS in PDU mode ADL SMS MODE TEXT to send a SMS in Text mode e Returned values OK on success ADL RET ERR PARAM if a parameter has an incorrect value ADL RET ERR UNKNOWN HDL if the provided handle is unknown ADL RET ERR BAD STATE if the product is not ready to send an SMS initialization not yet performed or sending an SMS already in progress o ADL RET ERR SERVICE LOCKED if the function was called from a low level interruption handler the function is forbidden in this context OOo 3 13 4 The adl smsUnsubscribe Function This function unsubscribes from the SMS service The associated handler with provided handle will no longer r
189. is used Low power consumption mode will be usable again as soon as the SCTU service is unsubscribed 3 24 4 The adl sctuSetChannelConfig Function This function allows the application to configures one of the SCTU block comparator channels e Prototype s32 adl sctuSetChannelConfig s32 SctuHandle adl sctuChannel e ChannelID u16 CompareValue bool InterruptionFlag e Parameters SctuHandle SCTU service handle previously returned by the adl sctuSubscribe function wavecom Confidential Page 196 220 This document is the sole and exclusive property of WWAVECOM Not to be distributed or divulged without prior written agreement Ce document est la propri t exclusive de WAVECOM Il ne peut tre communiqu ou divulgu des tiers sans son autorisation pr alable weavecom pn Make it wireless WM DEV OAT UGD 019 002 September 11 2006 ChannellD Comparator channel identifier using the following type typedef enum t ADL SCTU CHANNEL 0 ADL SCTU CHANNEL 1 ADL SCTU CHANNEL 2 ADL SCTU CHANNEL 3 adi sctuChannel e CompareValue Counter value to be monitored by the comparator channel The default value is set to O at service subscription time InterruptionFlag Boolean value which controls the comparator channel interruption If this flag is set an SCTU interruption is raised each time the counter value matches the comparator channel value The default value is set to FALSE at service subs
190. istributed or divulged without prior written agreement Ce document est la propri t exclusive de WAVECOM Il ne peut tre communiqu ou divulgu des tiers sans son autorisation pr alable wavecom Make it wireless WM DEV OAT UGD 019 002 September 11 2006 o ADL RET ERR SERVICE LOCKED if the function was called from a low level interruption handler the function is forbidden in this context 3 7 FCM Service ADL provides a FCM Flow Control Manager service to handle all FCM events and to access to the data ports provided on the product An ADL application may subscribe to a specific flow UART 1 UART 2 or USB physical virtual ports GSM CSD call data port GPRS session data port or Bluetooth virtual data ports to exchange data on it Wavecom Module Embedded Application ADL AT ommands i SE aus TCP IP Stack I I I I I I I GPRS I session AT GSM CSD commands call v Bluetooth V24 Serial Link Uart 1 amp 2 physical amp logical ports virtual ports Figure 6 Flow Control Manager Representation wavecom Confidential Page 57 220 This document is the sole and exclusive property of WAVECOM Not to be distributed or divulged without prior written agreement Ce document est la propri t exclusive de WAVECOM Il ne peut tre communiqu ou divulgu des tiers sans son autorisation pr alable wavecom Make it wireless WM_DEV_OAT_UGD_019 0
191. ithout prior written agreement Ce document est la propri t exclusive de WAVECOM Il ne peut tre communiqu ou divulgu des tiers sans son autorisation pr alable wavecom Make it wireless WM DEV OAT UGD 019 002 September 11 2006 2 10 RTE limitations 2 10 1 Sending large buffers through an ADL API Large data buffers greater than 1600 data bytes cannot be sent through an ADL API Eg adl busWrite in RTE mode If the application tries to do so an error message see Figure 2 Error when trying to send too large a data buffer through an API will be displayed and the RTE application will stop with an error x 4 SEVERE ERROR buffer RPC2 frame too long gt 1600 bytes Figure 2 Error when trying to send too large a data buffer through an API 2 10 2 IRQ services Due to the RTE architecture and to the very low latency amp processing times required in IRQ based applications the IRQ service amp all the related services such as SCTU Extlnt services etc are not available in this mode The subscription function will always fail when called in RTE wavecom Confidential Page 22 220 This document is the sole and exclusive property of VVAVECOM Not to be distributed or divulged without prior written agreement Ce document est la propri t exclusive de WAVECOM Il ne peut tre communiqu ou divulgu des tiers sans son autorisation pr alable wevecom es Make it wireless WM_DEV_OAT
192. ject storage place is emulated on the PC side objects are read written from to files on the PC hard disk and not from to the Wireless CPU s flash memory The two storage places Wireless CPU and PC one may be synchronized using the RTE Monitor interface cf the Tools Manual 3 for more information 3 6 3 The adl flhSubscribe Function This function subscribes to a set of objects identified by the given Handle e Prototype s8 adl flhSubscribe ascii Handle u16 NbObjectsRes e Parameters Handle The Handle of the set of objects to subscribe to NbObjectRes The number of objects related to the given handle It means that the IDs available for this handle are in the range O NbObjectRes 1 e Returned values o OKon success first allocation for this handle o ADL_RET_ERR_PARAM on parameter error o ADL RET ERR ALREADY SUBSCRIBED if space is already created for this handle o ADL FLH RET ERR NO ENOUGH IDS if there are no more enough object IDs to allocate the handle o ADL RET ERR SERVICE LOCKED if the function was called from a low level interruption handler the function is forbidden in this context Notes e Only one subscription is necessary It is not necessary to subscribe to the same handle at each application start e It is not possible to unsubscribe from an handle To release the handle and the associated objects the user must do an AT WOPEN 3 to erase the flash objects of the Open AT Embedded Applica
193. k e Parameters Task Task identifier to be suspended The only value allowed is ADL_CTX_OAT_TASK e Returned values o OKon success The application task is now suspended o ADL RET ERR PARAM if a wrong parameter is supplied Notes o If the function was called in the application task context it will not return but just suspend the task The OK value will be returned vvhen the task process is resumed o While the application is suspended received events are queued until the process is resumed If too many events occur the application mailbox vvould be overloaded and this would lead the Wireless CPU to reset the application task should not be suspended for a long time o For the same reason while the application is suspended the subscribed AT commands cannot be processed by the application 3 26 7 The adl ctxHesume Function This function allows the application to resume the Open AT task process previously suspended with to the adl ctxSuspend function e Prototype s32 adl ctxResume adl ctxID e Task e Parameters Task Task identifier to be suspended The only value allowed is ADL CTX OAT TASK e Returned values o OK on success The application s task process is now resumed o ADL RET ERR PARAM if a wrong parameter is supplied wavecom Confidential Page 211 220 This document is the sole and exclusive property of WAVECOM Not to be distributed or divulged without prior written agreement Ce doc
194. l busSize e Size adl busAccess t 3 9 2 8 1 Address amp AddressLength Usable for the both SPI amp 12C buses The Address parameter allovvs up to 32 bits to be sent on the bus before starting the read or write process The number of bits to send is set by the AddressLength parameter If less than 32 bits are required to be sent only the most significant bits are sent on the bus Allovved values for the AddressLength parameter are e the O 32 range for the SPI bus the O 8 16 24 32 values for the I2C bus Example in order to send the AA byte on the bus prior to a read or write process the Address parameter has to be set to the 0xAA000000 value and the AddressLength parameter has to be set to 8 wavecom Confidential Page 92 220 This document is the sole and exclusive property of WWAVECOM Not to be distributed or divulged without prior written agreement Ce document est la propri t exclusive de WAVECOM Il ne peut tre communiqu ou divulgu a des tiers sans son autorisation pr alable wavecom Make it wireless WM DEV OAT UGD 019 002 September 11 2006 3 9 2 8 2 Opcode amp OpcodeLength Usable only for SPI bus ignored for 2C bus The Opcode parameter allows up to 32 bits to be sent on the bus before starting the read or write process The number of bits to send is set by the OpcodeLength parameter If less than 32 bits are required to be sent only the most significant bits ar
195. l logical channels on UART 2 Please refer to AT CMUX command amp 27 010 protocol documentation to know how to open close such a logical channel e ADL PORT USB VIRTUAL BASE Base ID for 27 010 protocol logical channels on USB link reserved for future products e ADL PORT BLUETOOTH VIRTUAL BASE Base ID for connected Bluetooth peripheral virtual port ONLY USABLE WITH THE FCM SERVICE Please refer to the Bluetooth AT commands documentation to know how to connect and how to open close such a virtual port e ADL PORT GSM BASE Virtual Port ID for GSM CSD data call flow ONLY USABLE WITH THE FCM SERVICE wavecom Confidential Page 174 220 This document is the sole and exclusive property of WAVECOM Not to be distributed or divulged without prior written agreement Ce document est la propri t exclusive de WAVECOM Il ne peut tre communiqu ou divulgu des tiers sans son autorisation pr alable weaevecom Make it wireless WM_DEV_OAT_UGD_019 002 September 11 2006 Please note that this port will be considered as always available no OPEN CLOSE events for this port adl portlsAvailable function will always return TRUE e ADL PORT GPRS BASE Virtual Port ID for GPRS data session flow ONLY USABLE WITH THE FCM SERVICE Please note that this port will be considered as always available no OPEN CLOSE events for this port adl portlsAvailable function will always return TRUE if the GPRS feature is supported on the cu
196. lag argument has to be one of the values defined below If set to TRUE the responses and intermediate responses of the sent command that are not subscribed ie not listed in the adl atCmdCreate function arguments will be sent on the required port If set to FALSE they will not be sent to the external application If the ADL AT PORT TYPE macro is not used by default the command will be sent to the Open AT virtual port see next paragraph for more information about At commands ports Rsphdl Handler of the callback function associated to all the responses and intermediate responses subscribed in the adl atCmdCreate function call Note that the callback function will be called one time on each response line sent back by the Wavecom OS For example since the AT CGMR commands replies with two lines Software version response and then OK response the response handler will be called two times if all responses are subscribed The callback function is defined as follow typedef bool adl atRspHandler t adl atResponse t The argument of the callback function will be an adl atResponse t structure holding the received response The adl atResponse t structure is defined as follows declared in the adl at h header file wavecom Confidential Page 36 220 This document is the sole and exclusive property of WAVECOM Not to be distributed or divulged without prior written agreement Ce document est la propri t exclusive de WA
197. llback function so that when any of the responses or intermediates responses we subscribe to will be received by the ADL parser the callback function will be executed wavecom Confidential Page 35 220 This document is the sole and exclusive property of WAVECOM Not to be distributed or divulged without prior written agreement Ce document est la propri t exclusive de WAVECOM Il ne peut tre communiqu ou divulgu des tiers sans son autorisation pr alable wevecom Make it wireless WM DEV OAT UGD 019 002 September 11 2006 e Prototype s8 adl atCmdCreate ascii Cmdstr ul6 Rspflag adl atRspHandler t Rsphdl NULL e Parameters Cmdstr The string name of the command we want to send If the string does not ends with the CR character r in C language it will be added by ADL In case of text mode commands as CMGW for example text end character has to be the Z x1A in C language one Rspflag This parameter is composed of the unsubscribed responses destination flag and the port where to send the command The flag amp destination combination has to be done with the following macro ADL AT PORT TYPE port flag The port argument has to be a defined value of the adl atPort e type and this required port has to be available cf the AT FCM port Service If this port is not available or if it is a GSM or GPRS based one the command will not be executed The _f
198. lusive de WAVECOM Il ne peut tre communiqu ou divulgu a des tiers sans son autorisation pr alable wevecom Make it wireless WM_DEV_OAT_UGD_019 002 September 11 2006 e Prototype s8 adl callSetupExt ascii PhoneNb u8 Mode adl port e Port e Parameters PhoneNb Phone number to use to set up the call Mode Mode used to set up the call ADL CALL MODE VOICE ADL CALL MODE DATA Port Port on which to run the call setup command When setup return events will be received in the Call event handler if the application requires ADL to forward these events they will be forvvarded to this Port parameter value e Returned values o OKon success o ADL RET ERR PARAM on parameter error bad value or unavailable port o ADL RET ERR SERVICE LOCKED if the function was called from a low level interruption handler the function is forbidden in this context 3 15 5 The adl callHangup Function This function just runs the adl callHangupExt one on the ADL PORT OPEN AT VIRTUAL BASE port cf adl callHangupExt description for more information Please note that events generated by the ad1 callHangup will not be able to be forvvarded to any external port since the setup command was running on the Open AT port 3 15 6 The adl callHangupExt Function This function hangs up the phone call e Prototype s8 adl callHangupExt adl port e Port e Parameters Port Port on which to run the call hang up
199. m which to get the string arg Response argument to copy in the response string Depending on the response ID this argument should be an u32 integer value or an ascii string e Returned values o Standard response string on success o NULL if the ID does not exist Important caution The returned pointer memory is allocated by this function but its ownership is transferred to the embedded application This means that the embedded application will have to release the returned pointer wavecom Confidential Page 159 220 This document is the sole and exclusive property of VVAVECOM Not to be distributed or divulged without prior written agreement Ce document est la propri t exclusive de WAVECOM Il ne peut tre communiqu ou divulgu des tiers sans son autorisation pr alable weaevecom ds Make it wireless WM DEV OAT UGD 019 002 September 11 2006 3 20 Application amp Data Storage Service This service provides APIs to use the Application amp Data storage volume This volume may be used to store data or dwl files Wavecom OS updates new Open AT applications or E2P configuration files in order to be installed later on the product The default storage size is 768 Kbytes It may be configured with the AT WOPEN command Please refer to the AT commands interface guide document 2 for more information This storage size has to be set to the maximum about 1 2 Mbytes in order t
200. mber 11 2006 3 16 9 The adl gprsGetCidInformations Function This function gets information about a specific activated PDP context identified by its Cid e Prototype s8 adl gprsGetCidInformations u8 Cid adl gprsInfosCid t Infos e Parameters Cid The Cid of the PDP context integer value betvveen 1 and 4 Infos Information of the activated PDP context is contained in the following type typedef struct t u32 LocalIP Local IP address of the MS u32 DNS1 First DNS IP address u32 DNS2 Second DNS IP address u32 Gateway Gateway IP address adl gprsInfosCid t This parameter fields will be set only if the GPRS session is activated otherwise they all will be set to O e Returned values This function returns OK on success or a negative error value Possible error values are Error value Description ADL_RET_ERR_PARAM parameters error bad Cid value ADL RET ERR PIN KO if the PIN is not entered or if the WIND 4 indication has not occurred yet ADL GPRS CID NOT DEFINED problem to set up the Cid the CID is already activated ADL NO GPRS SERVICE if the GPRS service is not supported by the product ADL RET ERR BAD STATE the service is still processing another GPRS AF application should wait for the corresponding event indication of end of processing in the GPRS handler before calling this function wavecom Confidential Page 144 220 This document is
201. ment is the sole and exclusive property of WWAVECOM Not to be distributed or divulged without prior written agreement Ce document est la propri t exclusive de WAVECOM Il ne peut tre communiqu ou divulgu des tiers sans son autorisation pr alable wavecom Make it wireless WM_DEV_OAT_UGD_019 002 September 11 2006 Bus Type amp Configuration Multiplexed Features ADL BUS SPI2 bus ADL IO FEATURE BUS SPI2 CLK not using the hardware chip select pin ADL IO FEATURE BUS SPI2 IO using two data pins ADL IO FEATURE BUS SPI2 I ADL BUS SPI2 bus ADL IO FEATURE BUS SPI2 CLK using the hardware chip select pin ADL IO FEATURE BUS SPI2 IO using two data pins ADL IO FEATURE BUS SPI2 I ADL IO FEATURE BUS SPI2 CS ADL BUS PARALLEL bus None using one hardware chip select CS3 using one address pin ADL BUS PARALLEL bus ADL IO FEATURE BUS PARALLEL ADDR1 using one hardware chip select CS3 using two address pins ADL BUS PARALLEL bus ADL IO FEATURE BUS PARALLEL ADDR1 using one hardware chip select CS3 ADL IO FEATURE BUS PARALLEL ADDR2 CS2 using three address pins ADL BUS PARALLEL bus ADL IO FEATURE BUS PARALLEL ADDR2 CS2 using one hardware chip select CS2 using one address pin ADL BUS PARALLEL bus ADL IO FEATURE BUS PARALLEL ADDR1 using one hardware chip select CS2 ADL IO FEATURE BUS PARALLEL ADDR2 CS2 using tvvo address pins Once the bus is subscribed the features correspo
202. n ADL GPRS NO FORWARD ATH the event is not sent to the external application and the application will terminate the incoming activation request by sending an ATH command ADL_GPRS_NO_FORWARD_ATA the event is not sent to the external application and the application will accept the incoming activation request by sending an ATA command e Returned values for adl gprsSubscribe This function returns OK on success or a negative error value Possible error values are Error value Description ADL RET ERR PARAM In case of parameter error ADL RET ERR SERVICE LOCKED f the function was called from a low level interruption handler the function is forbidden in this context 3 16 3 The adl gprsSetup Function This function runs the adl gprsSetupExt on the ADL PORT OPEN AT VIRTUAL BASE port cf adi gprsSetupExt description for more information Please note that events generated by the ad1 gprsSetup will not be able to be forvvarded to any external port since the setup command runs on the Open AT port wavecom Confidential Page 139 220 This document is the sole and exclusive property of WWAVECOM Not to be distributed or divulged without prior written agreement Ce document est la propri t exclusive de WAVECOM Il ne peut tre communiqu ou divulgu a des tiers sans son autorisation pr alable wevecom Make it wireless WM_DEV_OAT_UGD_019 002 Septemb
203. n in this context 3 20 9 The adl adFinalise Function This function set the provided A amp D cell in read only finalized mode The cell content can not be modified e Prototype s32 adl adFinalise s32 CellHandle e Parameters CellHandle A amp D cell handle returned by adl_adSubscribe function e Returned values o OKon success o ADL RET ERR UNKNOWN HDL if the handle was not subscribed o ADL RET ERR BAD STATE if the cell was already finalized wavecom Confidential Page 165 220 This document is the sole and exclusive property of WWAVECOM Not to be distributed or divulged without prior written agreement Ce document est la propri t exclusive de WAVECOM Il ne peut tre communiqu ou divulgu des tiers sans son autorisation pr alable wevecom Make it wireless WM DEV OAT UGD 019 002 September 11 2006 o ADL RET ERR SERVICE LOCKED if the function was called from a low level interruption handler the function is forbidden in this context 3 20 10 The adl adDelete Function This function deletes the provided A amp D cell The used space and the ID will be available on next re compaction process e Prototype s32 adl adDelete s32 CellHandle e Parameters CellHandle A amp D cell handle returned by adi adSubscribe function e Returned values o OKon success o ADL RET ERR UNKNOWN HDL if the handle was not subscribed o ADL RET ERR SERVICE LOCKED if the function was called
204. n was called from a low level interruption handler the function is forbidden in this context wavecom Confidential Page 191 220 This document is the sole and exclusive property of VVAVECOM Not to be distributed or divulged without prior written agreement Ce document est la propri t exclusive de WAVECOM Il ne peut tre communiqu ou divulgu a des tiers sans son autorisation pr alable wavecom Make it wireless WM DEV OAT UGD 019 002 September 11 2006 3 23 9 Example This example simply demonstrates how to use the interruption service in a nominal case error cases are not handled wavecom Confidential Page 192 220 This document is the sole and exclusive property of WAVECOM Not to be distributed or divulged without prior written agreement Ce document est la propri t exclusive de WAVECOM II ne peut tre communiqu ou divulgu a des tiers sans son autorisation pr alable wavecom Make it wireless WM DEV OAT UGD 019 002 September 11 2006 3 24 SCTU Service ADL provides this service System Controller Timer Unit SCTU to handle the Wireless CPU hardware timerconfiguration and interruptions SCTU are hardware timers able to raise interruptions on comparisons and or overflovv SCTU block settings depend on Wireless CPU type Q2686 Wireless CPU SCTU block Clock rate Prescaler Counter width Comparator number width channels 1 13 MHz 8 bits 16 bits 4
205. nction pAccessMode Bus access mode defined according to the adl busAccess t structure Please refer to this structure description 8 3 9 2 8 The adl busAccess t Type for more information DataLen Number of items to read from the bus Data Buffer where to copy the read items Note items bit size is defined in the pAccessMode configuration structure e Returned values OK on success ADL RET ERR UNKNOVN HDL if the provided handle is unknown ADL RET ERR PARAMI if a parameter has an incorrect value ADL RET ERR BAD STATE if there is no acknowledgement from the remote chip on the bus I2C bus only 0000 3 9 6 The adl busWrite Function This function writes on a previously subscribed SPI or I2C bus type This function is not usable with the Parallel bus e Prototype s32 adl busWrite s32 Handle adl_busAccess_t pAccessMode u32 DataLen void Data wavecom confidential Page 97 220 This document is the sole and exclusive property of WWAVECOM Not to be distributed or divulged without prior written agreement Ce document est la propri t exclusive de WAVECOM Il ne peut tre communiqu ou divulgu des tiers sans son autorisation pr alable wevecom es Make it wireless WM_DEV_OAT_UGD_019 002 September 11 2006 e Parameters Handle Handle previously returned by the adl busSubscribe function pAccessMode Bus access mode defined according to the adl busAccess t structure
206. nd will be executed further calls to adl atCmdSendText will return ADL RET ERR BAD STATE until a new Text Mode command is sent on this port It is possible to insert new lines Vr chracters in the text body 3 2 5 3 AT Commands Ports Processing Several AT commands ports are available on the Wireless CPU an application may know each port s current state using the AT FCM Port service When an AT command is sent using the adl atCmdCreate function this one is pushed on the required port inner command stack ADL is processing one command stack by available port on the Wireless CPU When an AT command is sent from an external application on a specific port this command is also pushed on the required port inner command stack wavecom Confidential Page 40 220 This document is the sole and exclusive property of WAVECOM Not to be distributed or divulged without prior written agreement Ce document est la propri t exclusive de WAVECOM Il ne peut tre communiqu ou divulgu des tiers sans son autorisation pr alable weaevecom mds Make it wireless WM DEV OAT UGD 019 002 September 11 2006 For each command stack while this stack is not empty ADL sends the commands one by one ie ADL sends the command on the required port waits until the terminal response is received and then continue with the next command until reaching the stack s end In addition to Wireless CPU physical UART ports and logical 27 01
207. nding to the required configuration are enabled and the multiplexed GPIO are not available for subscription by the Open AT application or through the standard AT commands 3 9 4 The adl busUnsubscribe Function This function unsubscribes from a previously subscribed SPI or I2C bus type This function is not usable with the Parallel bus e Prototype s32 adl busUnsubscribe s32 Handle e Parameters Handle Handle previously returned by the adl busSubscribe function e Returned values o OK on success o ADL_RET_ERR_UNKNOWN_HDL if the provided handle is unknown o ADL RET ERR SERVICE LOCKED if the function was called from a low level interruption handler the function is forbidden in this context wavecom Confidential Page 96 220 This document is the sole and exclusive property of WWAVECOM Not to be distributed or divulged without prior written agreement Ce document est la propri t exclusive de WAVECOM Il ne peut tre communiqu ou divulgu des tiers sans son autorisation pr alable wevecom es Make it wireless WM_DEV_OAT_UGD_019 002 September 11 2006 3 9 5 The adl busRead Function This function reads data from a previously subscribed bus SPI or I2C type This function is not usable with the Parallel bus e Prototype s32 adl busRead s32 Handle adl busAccess t pAccessMode u32 DataLen void Data e Parameters Handle Handle previously returned by the adl busSubscribe fu
208. nk step it includes the ADL library plug in libraries if any and Open AT application global variables Note This field is set to O Under Remote Task Environment e Reminder The Open AT RAM is divided in three areas Call stack Heap memory amp Global variables This function returns the area sizes Stack size Call Stack Heap Heap size Total size memory l Global size Globa variables Figure 5 Open AT RAM Mapping with adl_memInfo_t Structure Field Names e Returned values o OK on success the Info parameter is updated in the Open AT RAM information o ADL RET ERR PARAM on parameter error 3 4 3 The adl memGet Function This function allocates the memory for the requested size into the client application RAM memory e Prototype void adl memGet u32 size e Parameters size The memory buffer requested size in bytes e Returned values o A pointer to the allocated memory buffer on success wavecom Confidential Page 46 220 This document is the sole and exclusive property of WAVECOM Not to be distributed or divulged without prior written agreement Ce document est la propri t exclusive de WAVECOM Il ne peut tre communiqu ou divulgu des tiers sans son autorisation pr alable wevecom Make it wireless WM DEV OAT UGD 019 002 September 11 2006 o If the memory allocation fails this function will lead to a ADL ERR MEM GET error which can be handled b
209. ntified by the type below wavecom Confidential Page 173 220 This document is the sole and exclusive property of WWAVECOM Not to be distributed or divulged without prior written agreement Ce document est la propri t exclusive de WAVECOM Il ne peut tre communiqu ou divulgu des tiers sans son autorisation pr alable weavecom pn Make it wireless WM DEV OAT UGD 019 002 September 11 2006 typedef enum ADL_PORT_NONE ADL PORT UARTI ADL PORT UART2 ADL PORT USB ADL PORT UART1 VIRTUAL BASE 0x10 ADL_PORT_UART2_VIRTUAL_BASE 0x20 ADL_PORT_USB_VIRTUAL_BASE 0x30 ADL_PORT_BLUETOOTH_VIRTUAL_BASE 0x40 ADL_PORT_GSM_BASE 0x50 ADL_PORT_GPRS_ BASE 0x60 ADL PORT OPEN AT VIRTUAL BASE 0x80 adl port e The available ports are described hereafter e ADL PORT NONE Not usable e ADL PORT UART1 Product physical UART 1 Please refer to the AT WMFM command documentation to know how to open close this product port e ADL PORT UART2 Product physical UART 2 Please refer to the AT WMFM command documentation to know how to open close this product port e ADL PORT USB Product physical USB port reserved for future products e ADL PORT UART1 VIRTUAL BASE Base ID for 27 010 protocol logical channels on UART 1 Please refer to AT CMUX command amp 27 010 protocol documentation to know how to open close such a logical channel e ADL PORT UART2 VIRTUAL BASE Base ID for 27 010 protoco
210. ntinue sending data wavecom Confidential Page 65 220 This document is the sole and exclusive property of WWAVECOM Not to be distributed or divulged without prior written agreement Ce document est la propri t exclusive de WAVECOM Il ne peut tre communiqu ou divulgu a des tiers sans son autorisation pr alable wevecom Make it wireless WM_DEV_OAT_UGD_019 002 September 11 2006 3 7 8 The adl fcmSendDataExt Function This function sends a data block on the requested flow This API do not perform any processing on provided data block which is sent directly on the flow e Prototype s8 adl fcmSendDataExt u8 Handle adl_fcmDataBlock_t DataBlock e Parameters Handle Handle returned by the adl fcmSubscribe function DataBlock Data block buffer to write using the following type typedef struct ul6 Reserved1l 4 u32 Reserved3 ul6 DataLength Data length ul6 Reserved2 5 u8 Data 1 Data to send adi fcmDataBlock t The block must be dynamically allocated and filled by the application before sending it to the function The allocation size has to be sizeof adl fcmDataBlock t DataLength where DataLength is the value to be set in the DataLength field of the structure Maximum data packet size depends on the subscribed flow o On serial link based flows 2000 bytes On GSM data flow no limitation memory allocation size On GPRS flow 1500 bytes On Blueto
211. ny application components the application task itself or interruption handlers e Prototype s32 adl msgSubscribe adl mgsFilter t Filter adl msgHandler f msgHandler wavecom Confidential Page 124 220 This document is the sole and exclusive property of WWAVECOM Not to be distributed or divulged without prior written agreement Ce document est la propri t exclusive de WAVECOM Il ne peut tre communiqu ou divulgu des tiers sans son autorisation pr alable weavecom 7 Make it wireless WM_DEV_OAT_UGD_019 002 September 11 2006 e Parameters Filter Identifier and source context conditions to check each message reception in order to notify the message handler Please refer to the adl msgFilter t structure description for more information MsgHandler Application defined message handler which will be notified each time a received message matches the filter conditions Please refer to adl msgHandler f call back type definition for more information e Returned values o A positive or null value on success e Message service handle to be used in further Message service functions calls o A negative error value otherwise e ADL RET ERR PARAMI if a parameter has an incorrect value e ADL RET ERR NO MORE HANDLES if there are no more free message service handles up to 128 message filters can be subscribed e ADL RET ERR SERVICE LOCKED if the function was called from a low level interruption
212. o have enough place to store a Wavecom OS update Caution Any A amp D size change will lead to an area format process some additional seconds on start up all A amp D cells data will be erased Legal mention The Download Over The Air feature enables the Wavecom OS to be remotely updated The downloading and OS updating processes have to be activated and managed by an appropriate Open AT based application to be developed by the customer The security of the wvhole process request for update authentication encryption etc has to be managed by the customer under his own responsibility Wavecom shall not be liable for any issue related to any use by customer of the Download Over The Air feature Wavecom AGREES AND THE CUSTOMER ACKNOWLEDGES THAT THE SDK Open AT IS PROVIDED AS IS BY Wavecom WITHOUT ANY WARRANTY OR GUARANTEE OF ANY KIND 3 20 1 Required Header File The header file for the Application amp Data storage service is adl ad h 3 20 2 The adl adSubscribe Function This function subscribes to the required A amp D space cell identifier e Prototype s32 adl adSubscribe u32 CellID u32 Size wavecom Confidential Page 160 220 This document is the sole and exclusive property of WWAVECOM Not to be distributed or divulged without prior written agreement Ce document est la propri t exclusive de WAVECOM Il ne peut tre communiqu ou divulgu des tiers sans son autorisation pr alable wevecom
213. ock Status A list of the currently reserved heap memory blocks can be displayed at any time using the Target Monitoring Tool Get RTK Status command Please refer to the Tools Manual document 3 for more information wavecom Confidential Page 47 220 This document is the sole and exclusive property of WAVECOM Not to be distributed or divulged without prior written agreement Ce document est la propri t exclusive de WAVECOM Il ne peut tre communiqu ou divulgu des tiers sans son autorisation pr alable wavecom Make it wireless WM_DEV_OAT_UGD_019 002 September 11 2006 3 4 6 Example This example demonstrates how to use the Memory service in a nominal case error cases are not handled Complete examples using the Memory service are also available on the SDK this service is used by almost all examples Somewhere in the application code used as an event handler void MyFunction void 1 Local variables adl memInfo t MemInfo u8 MyByteBuffer Gets Open AT RAM information adl memGetInfo amp MemInfo Allocates a 10 bytes memory buffer MyByteBuffer u8 adl memGet 10 Releases the previously allocated memory buffer adl memRelease MyByteBuffer 3 5 Debug Traces This service allow to display software trace strings on the Target Monitoring Tool The different vvays to embed these trace strings in an Open AT application depends on the selec
214. of the response of the at clcc command is subscribed but because the 2 argument is set to TRUE all will be sent to the external application adl atCmdCreate at clcc ADL AT PORT TYPE paras gt Port TRUE adl atRspHandler t NULL NULL return TRUE atd callback function void ATD Handler adl atCmdPreParser t paras adl atCmdUnSubscribe atd adl atCmdHandler t ATD Handler We unsubscribe the command so that when we resend the command it won t be received by the ADL parser anymore We resend the command for the phone call to be made and subscribe to some of its responses We also set the 2 argument to TRUE so that the response not subscribed will be directly sent to the external application adl atCmdCreate paras gt StrData TRUE adl atRspHandler t ATD Response Handler ADL AT PORT TYPE paras gt Port TRUE HWIND 2 OK NULL main function void adl main adl InitType e adlInitType Subscribe to the atd command adl atCmdSubscribe atd adl atCmdHandler t ATD Handler ADL CMD TYPE ACT J wavecom Confidential Page 39 220 This document is the sole and exclusive property of WAVECOM Not to be distributed or divulged without prior written agreement Ce document est la propri t exclusive de WAVECOM Il ne peut tre communiqu ou divulgu des tiers sans son autorisation pr alable wevecom es Make it wireless
215. om an ADL service event handler o ADL CTX LOW LEVEL IRQ HANDLER if the function is called from a low level interruption handler o ADL CTX HIGH LEVEL IRQ HANDLER if the function is called from an high level interruption handler 3 26 4 The adl ctxGetTaskID Function This function allows the application to retrieve the current running task identifier e n Open ATO task or high level interruption handler contexts this function will behave like the adl ctxGetID function e But in a low level handler execution context the retrieved identifier will be the active task identifier when the interruption signal is raised wavecom Confidential Page 209 220 This document is the sole and exclusive property of WAVECOM Not to be distributed or divulged without prior written agreement Ce document est la propri t exclusive de WAVECOM Il ne peut tre communiqu ou divulgu a des tiers sans son autorisation pr alable wavecom Make it wireless WM_DEV_OAT_UGD_019 002 September 11 2006 e Prototype adl ctxID e adl ctxGetTaskID void e Returned values o ADL CTX OAT TASK if the function is called from an ADL service event handler o ADL CTX HIGH LEVEL IRQ HANDLER if the function is called from a high level interruption handler o lfcalled from a low level interruption handler the returned value depends on the interrupted task e ADL CTX OAT TASK if the Open AT task was running e ADL CTX WAVECOM if a Wavecom OS
216. ommuniqu ou divulgu des tiers sans son autorisation pr alable weaevecom mds Make it wireless WM DEV OAT UGD 019 002 September 11 2006 o A negative error value otherwise e ADL RET ERR PARAM on a supplied parameter error e ADL RET ERR NOT SUPPORTED if the Open SIM access feature is not enabled on the Wireless CPU e ADL RET ERR ALREADY SUBSCRIBED if the service was already subscribed the OSA service can only be subscribed one time e ADL RET ERR SERVICE LOCKED if the function was called from a low level interruption handler the function is forbidden in this context 3 12 3 The adl osaHandler f call back Type Such a call back function has to be supplied to ADL on the OSA service subscription It will be notified by the service on each OSA event e Prototype typedef void adl osaHandler f adl osaEvent e Event adl osaEventParam u Param e Parameters Event OSA service event identifier using one of the following defined values Event Type Use ADL OSA EVENT INIT SUCCESS The OSA service has been successfully subscribed The local SIM card has been shut down and From now on all SIM requests will be posted to on the application through the OSA service ADL OSA EVENT INIT FAILURE The OSA service subscription has failed The Wireless CPU is already connected to a remote SIM through the Bluetooth SAP profile the SAP connection has to be closed prior to subscribing to the O
217. ortStartSignalPolling function ADL PORT EVENT CTS STATE CHANGE Informs the ADL application that the specified Port CTS signal state has changed to the new State value 0 1 This event will be received by all subscribers which have started a polling process on the specified Port CTS signal with the ad portStartSignalPolling function The handler Port parameter uses the adl port e type described above The handler State parameter is set only for the ADL PORT EVENT XXX STATE CHANGE events e Returned values o A positive or null handle on success o ADL RET ERR PARAM on parameter error o ADL RET ERR NO MORE HANDLES if there is no more free handles the service is able to process up 127 subscriptions o ADL RET ERR SERVICE LOCKED if the function was called from a low level interruption handler the function is forbidden in this context wavecom Confidential Page 176 220 This document is the sole and exclusive property of WWAVECOM Not to be distributed or divulged without prior written agreement Ce document est la propri t exclusive de WAVECOM Il ne peut tre communiqu ou divulgu a des tiers sans son autorisation pr alable wevecom es Make it wireless WM_DEV_OAT_UGD_019 002 September 11 2006 3 21 5 The adl portUnsubscribe Function This function unsubscribes from the AT FCM IO Ports service The related handler will not receive ports related events any more If a signal polling process was started
218. ortant caution All the A amp D storage cells will be erased by this operation The A amp D storage format process can take several seconds e Prototype s32 adl adFormat s32 EventHandle e Parameters EventHandle Event handle previously returned by the adl adEventSubscribe function The associated handler will receive the format process events sequence e Returned values o OKon success Event handlers will receive the following event sequence e ADL AD EVENT FORMAT INIT just after the process is launched e ADL AD EVENT FORMAT PROGRESS several times indicating the process progression e ADL AD EVENT FORMAT DONE once the process is done o ADL RET ERR UNKNOWN HDL if the handle is unknown o ADL RET ERR NOT SUBSCRIBED if no A amp D event handler has been subscribed o ADL AD RET ERR NOT AVAILABLE if there is no A amp D space available on the product o ADL RET ERR BAD STATE if there is at least one currently subscribed cell or if a re compaction or format process is already running o ADL RET ERR SERVICE LOCKED if the function was called from a low level interruption handler the function is forbidden in this context wavecom Confidential Page 171 220 This document is the sole and exclusive property of WAVECOM Not to be distributed or divulged without prior written agreement Ce document est la propri t exclusive de WAVECOM Il ne peut tre communiqu ou divulgu des tiers sans son autorisation pr alable
219. oth virtual ports 2000 bytes O e Returned values o OKon success The Control handler will also receive a ADL FCM EVENT MEM RELEASE event when the data block memory buffer will be released o ADL FCM RET OK WAIT RESUMI on success but the last credit was used The Control handler will also receive a ADL FCM EVENT MEM RELEASE event when the data block memory buffer will be released ADL RET ERR PARAM is a parameter has an incorrect value ADL_ RET_ ERR_ UNKNOWN_HDL if the provided handle is unknown ADL RET ERR BAD STATE if the flow is not ready to send data ADL_ FCM _ RET_ ERR_ _WAIT_RESUME if the flow has no more credit to use o ADL RET ERR SERVICE LOCKED if the function was called from a low level interruption handler the function is forbidden in this context OO0o00 wavecom Confidential Page 66 220 This document is the sole and exclusive property of WWAVECOM Not to be distributed or divulged without prior written agreement Ce document est la propri t exclusive de WAVECOM Il ne peut tre communiqu ou divulgu des tiers sans son autorisation pr alable weavecom gt G nie Make it wireless WM DEV OAT UGD 019 002 September 11 2006 On ADL FCM RET XXX WAIT RESUME returned value the subscriber has to wait for an ADL FCM EVENT RESUMIE event on Control Handler to continue sending data Important Remark The Data block will be released by the adl fcmSendDataExt API on OK and ADL F
220. ototype s32 adl ioSetDirection s32 GpioHandle u32 GpioNb adl_ioSetDirection_t GpioDir e Parameters GpioHandle Handle previously returned by adl ioSubscribe function GpioNb Size of the GpioDir array GpioDir GPIO direction configuration structure array using the adl ioSetDirection t type For each array element e the eLabel field identifies which GPIO direction has to be modified e the eDirection field is the new GPIO direction to be set wavecom Confidential Page 77 220 This document is the sole and exclusive property of WAVECOM Not to be distributed or divulged without prior written agreement Ce document est la propri t exclusive de WAVECOM Il ne peut tre communiqu ou divulgu a des tiers sans son autorisation pr alable wevecom es Make it wireless WM_DEV_OAT_UGD_019 002 September 11 2006 e Returned values OK on success ADL_RET_ERR_PARAM on parameter error ADL_RET_ERR_UNKNOWN_HDL if the provided handle is unknown ADL RET ERR SERVICE LOCKED if the function was called from a low level interruption handler the function is forbidden in this context O O O O 3 8 9 The adl_ioRead Function This function allows several GPIOs to be read from a previously allocated handle e Prototype s32 adl ioRead s32 GpioHandle u32 GpioNb adl ioRead t GpioRead e Parameters GpioHandle Handle previously returned by adl ioSubscribe function GpioNb Size of the
221. pen AT application e Returned values o A positive or null handle on success which will have to be used in all further FCM operations The Control handler will also receive a ADL FCM EVENT FLOVV OPENNED event when flow is ready to process o ADL RET ERR PARAM if one parameter has an incorrect value o ADL RET ERR ALREADY SUBSCRIBED if the flow is already subscribed in master mode o ADL RET ERR NOT SUBSCRIBED if a slave subscription is made when master flow is not subscribed o ADL FCM RET ERROR GSM GPRS ALREADY OPENNED if a GSM or GPRS subscription is made when the other one is already subscribed o ADL RET ERR BAD STATE if the required port is not available o ADL RET ERR SERVICE LOCKED if the function was called from a low level interruption handler the function is forbidden in this context wavecom Confidential Page 61 220 This document is the sole and exclusive property of WWAVECOM Not to be distributed or divulged without prior written agreement Ce document est la propri t exclusive de WAVECOM Il ne peut tre communiqu ou divulgu des tiers sans son autorisation pr alable wevecom Make it wireless WM DEV OAT UGD 019 002 September 11 2006 Notes When 7 bits mode is enabled on a v24 serial link in data mode payload data is located on the 7 least significant bits LSB of every byte e When a serial link is in data mode if the external application sends the s
222. progress events should be received until the process is completed ADL AD EVENT FORMAT DONE The format process is over The A amp D storage area is now usable again All cells have been erased and the whole storage place is available ADL AD EVENT RECOMIPACT INIT The adl adHecompact function has been called by an application a re compaction process has been required ADL AD EVENT RECOMPACT PROGRESS The re compaction process is on going Several progress events should be received until the process is completed ADL AD EVENT RECOMPACT DONE The re compaction process is over the A amp D storage area is now usable again The space previously used by deleted cells is now free ADL AD EVENT INSTALL The adl adinstall function has been called by an application an install process has just been required and the Wireless CPU is going to reset Progress On ADL AD EVENT FORMAT PROGRESS amp ADL AD EVENT RECOMPACT PROGRESS events reception this parameter is the process progress ratio considered as a percentage On ADL AD EVENT FORMAT DONE amp ADL AD EVENT RECOMJPACT DONE events reception this parameter is set to 10096 Otherwise this parameter is set to O wavecom Confidential Page 163 220 This document is the sole and exclusive property of WWAVECOM Not to be distributed or divulged without prior written agreement Ce document est la propri t exclusive de WAVECOM Il ne peut tr
223. ption handler the function is forbidden in this context 3 7 6 The adl fcmSwitchV24State Function This function switches a serial link state to AT mode or to Data mode The operation will be effective only vvhen the control event handler has received an ADL FCM EVENT V24 XXX MODE event Only the main handle subscriber can use this API e Prototype s8 adl fcmSwitchV24State u8 Handle u8 V24State e Parameters Handle Handle returned by the adl fcmSubscribe function V24State Serial link state to switch to Allowed values are defined below ADL FCM V24 STATE AT ADL FCM V24 STATE DATA e Returned values o OKon success The Control handler will also receive a ADL FCM EVENT V24 XXX MODE event when the serial link state has changed ADL RET ERR PARAM if one parameter has an incorrect value ADL RET ERR UNKNOWN HDL if the provided handle is unknown ADL RET ERR BAD HDL if the handle is not the main flow one ADL RET ERR SERVICE LOCKED if the function was called from a low level interruption handler the function is forbidden in this context 0000 3 7 7 The adl fcmSendData Function This function sends a data block on the requested flow e Prototype s8 adl fcmSendData u8 Handle u8 Data ul6 DataLen e Parameters Handle Handle returned by the adl fcmSubscribe function Data Data block buffer to write wavecom Confidential Page 64 220 This document is the sole and exclusive property of WAVECOM
224. r ADL BUS PARALLEL MODE ASYNC MOTOROLA HIGH E signal high polarity modes are required at subscription time In the example given the Access Setup amp Hold times are set to 1 and the Turnaround time is set to 2 Write Setup Write Access Write Hold Write Tumaround Read Setup Read Access Read Hold Read Turnaround ADD valid write ad rgss 1 I wajdreadaddrgss DATA l l I l l I l l l l l I l FE l l l l cS l l l l m l l RAN l l l l l l l l l l E polarity ff Ny l l l l t l E polarity 1 in D A 1 data sampling data sampling Figure 7 Motorola Modes Timing Example wavecom Confidential Page 88 220 This document is the sole and exclusive property of WAVECOM Not to be distributed or divulged without prior written agreement Ce document est la propri t exclusive de WAVECOM Il ne peut tre communiqu ou divulgu a des tiers sans son autorisation pr alable wavecom pert Make it wireless WM DEV OAT UGD 019 002 September 11 2006 3 9 2 5 2 Intel Mode Timing The following timing behavior applies when the ADL BUS PARALLEL MODE ASYNC INTEL mode is required at subscription time In this mode the timing configuration must not be the same for the read or write process In this read process example Setup amp Hold times are set to 1 and Access amp Turnaround times are set to 3 Read Setup
225. r t Cmdhdl ul6 Options e Parameters Cmdstr The string name of the command we want to subscribe to Since this service only handles AT commands this string has to begin by the AT characters Cmdhdl The handler of the callback function associated to the command The callback function is defined as follow typedef void adl atCmdHandler t adl atCmdPreParser t wavecom Confidential Page 31 220 This document is the sole and exclusive property of WAVECOM Not to be distributed or divulged without prior written agreement Ce document est la propri t exclusive de WAVECOM Il ne peut tre communiqu ou divulgu des tiers sans son autorisation pr alable wevecom er tui Make it wireless WM DEV OAT UGD 019 002 September 11 2006 The argument of the callback function will be an adl atCmdPreParser t structure holding the command we subscribed to The adl atCmdPreParser t structure is defined as follow it is declared in the adl at h header file typedef struct ul6 Type Incoming Command Type u8 NbPara Parameters number adl atPort e Port Source port wm lst t ParaList Parameters list ul6 StrLength Command string length ascii StrData 1 Command string adi atCmdPreParser t This structure members are defined below o Type Incoming command type will be one of the required ones at subscription time detected by the ADL pre processing o NbPara Non
226. ral handlers associated to the same unsolicited response all of them have to return TRUE for the unsolicited response to be sent to the external application e Returned values o OK on success o ERROR if an error occurred o ADL RET ERR SERVICE LOCKED if the function was called from a low level interruption handler the function is forbidden in this context 3 2 2 2 The adl atUnSoUnSubscribe Function This function unsubscribes from an unsolicited response and its handler e Prototype s16 adl atUnSoUnSubscribe ascii UnSostr adl_atUnSoHandler_t UnSohdl e Parameters UnSostr The string of the unsolicited response we want to unsubscribe to UnSohdl The callback function associated to the unsolicited response e Returned values o OK if the unsolicited response was found o ERROR otherwise o ADL RET ERR SERVICE LOCKED if the function was called from a low level interruption handler the function is forbidden in this context wavecom Confidential Page 27 220 This document is the sole and exclusive property of WAVECOM Not to be distributed or divulged without prior written agreement Ce document est la propri t exclusive de WAVECOM II ne peut tre communiqu ou divulgu des tiers sans son autorisation pr alable wavecom Make it wireless WM_DEV_OAT_UGD_019 002 September 11 2006 3 2 2 3 Example callback function bool Wind4 Handler adl atUnsolicited t paras Unsu
227. read using the Target Monitoring Tool and the Serial Link Manager in order to decode the backtrace buffer s Please refer to the Tools Manual document 3 3 in order to know how to process these files wavecom Confidential Page 107 220 This document is the sole and exclusive property of WAVECOM Not to be distributed or divulged without prior written agreement Ce document est la propri t exclusive de WAVECOM Il ne peut tre communiqu ou divulgu a des tiers sans son autorisation pr alable wavecom Make it wireless WM_DEV_OAT_UGD_019 002 September 11 2006 o If adl errRetrieveNextBacktrace is used you have to retrieve all next backtraces Otherwise it is impossible to retrieve the first backtraces wavecom Confidential Page 108 220 This document is the sole and exclusive property of VVAVECOM Not to be distributed or divulged without prior written agreement Ce document est la propri t exclusive de WAVECOM Il ne peut tre communiqu ou divulgu des tiers sans son autorisation pr alable wevecom Make it wireless WM DEV OAT UGD 019 002 September 11 2006 3 11 SIM Service ADL provides this service to handle SIM and PIN code related events 3 11 1 Required Header File The header file for the SIM related functions is adl sim h 3 11 2 The adl simSubscribe Function This function subscribes to the SIM service in order to receive SIM and PIN code related events This will
228. relevant for high level interruption handlers o For low level interruption handlers e A TRUE return value will force ADL to call the subscribed high level handler for this interruption source e A FALSE return value will force ADL not to call any high level handler for this interruption source Note For low level interruption handlers 1 ms can be considered as a maximum latency time before being notified with the interruption source event wavecom Confidential Page 190 220 This document is the sole and exclusive property of WWAVECOM Not to be distributed or divulged without prior written agreement Ce document est la propri t exclusive de WAVECOM Il ne peut tre communiqu ou divulgu des tiers sans son autorisation pr alable wavecom Make it wireless 3 23 8 WM DEV OAT UGD 019 002 September 11 2006 The adl irqUnsubscribe Function This function allows the application to un subscribe from the interruption service The associated handler will no longer be notified of interruption events e Prototype s32 adl irqUnsubscribe s32 IrqHandle e Parameter IrqHandle Interruption service handle previously returned by the adl_irqSubscribe function e Returned values O Oo O OK on success ADL RET ERR UNKNOWN HDL if the supplied handle is unknown ADL RET ERR BAD STATE if the supplied handle is still used by an interruption source service ADL RET ERR SERVICE LOCKED if the functio
229. remaining ID count will be returned e Returned values o On success e ID count allocated on the provided handle if any e the total remaining ID count if the handle is set to NULL o ADL RET ERR UNKNOWN HDL if handle is not subscribed o ADL RET ERR SERVICE LOCKED if the function was called from a low level interruption handler the function is forbidden in this context 3 6 10 The adl flhGetUsedSize Function This function returns the used size by the provided ID range from the provided handle The handle should also be set to NULL to get the whole used size e Prototype s32 adl flhGetUsedSize ascii Handle ul16 StartID u16 EndID e Parameters Handle The Handle of the subscribed set of objects If set to NULL the whole flash memory used size will be returned StartlD First ID of the range from which to get the used size has to be lower than EndlD EndiD Last ID of the range from which to get the used size has to be greater than StartID To get the used size by all an handle IDs the O ADL FLH ALL IDS range may be used e Returned values o Used size on success from the provided Handle if any otherwise the whole flash memory used size o ADL RET ERR PARAM on parameter error ADL RET ERR UNKNOWN HDL if handle is not subscribed o ADL FLH RET ERR ID OUT OF RANGE if ID is out of handle range O wavecom confidential Page 56 220 This document is the sole and exclusive property of WAVECOM Not to be d
230. rform a slave subscription see above a bit vvise or has to be done vwith the flow ID and the ADL FCM FLOW SLAVE flag for example adl fcmSubscribe ADL PORT UART1 ADL FCM FLOW SLAVE MyCtrlHandler MyDataHandler CtrlHandler FCM control events handler using the following type typedef bool adl_fcmCtrlHdlr_f adl fcmEvent e event The FCM control events are defined below All handlers related to the concerned flow master and slaves will be notified together with this events o ADL FCM EVENT FLOW _ OPENNED related to adl fcmSubscribe o ADL FCM EVENT FLOW CLOSED related to adl fcmUnsubscribe o ADL FCM EVENT V24 DATA MODE related to adl fcmSwitchV24State o ADL FCM EVENT V24 DATA MODE EXT see note below o ADL FCM EVENT V24 AT MODE related to adl fcmSwitchV24State o ADL FCM EVENT V24 AT MODE EXT see note below o ADL FCM EVENT RESUME related to adl fcmSendData and adl fcmSendDataExt o ADL FCM EVENT MEM RELEASE related to adl fcmSendData and adl fcmSendDataExt This handler return value is not relevant except for ADL FCM EVENT V24 AT MODE EXT wavecom Confidential Page 60 220 This document is the sole and exclusive property of WAVECOM Not to be distributed or divulged without prior written agreement Ce document est la propri t exclusive de WAVECOM Il ne peut tre communiqu ou divulgu a des tiers sans son autorisation pr alable wevecom mds Make it wireless WM DEV O
231. rite timing settings ADL BUS PARA CS TYPE CS 3 Use CS3 pin 0 0 3 dis address pins required WBVeCOnN Confidential Page 100 220 This document is the sole and exclusive property of WAVECOM Not to be distributed or divulged without prior written agreement Ce document est la propri t exclusive de WAVECOM Il ne peut tre communiqu ou divulgu des tiers sans son autorisation pr alable e WovVeCOAM Make it wireless WM DEV OAT UGD 019 002 September 11 2006 Write Read buffer sizes define WRITE SIZE 5 define READ SIZE 3 Access configuration structure adl busAccess t AccessConfig 0 O O O No Opcode No Address ADL BUS SIZE BYTE Byte u8 data buffer BUS Handles s32 MySPIHandle MyI2Chandle MyParaHandle Data buffers u8 WriteBuffer WRITE SIZE ReadBuffer READ SIZE Somewhere in the application code used as an event handler void MyFunction void Local variables s32 ReadValue Subscribe to the SPI1 BUS MySPIHandle adl busSubscribe ADL BUS SPI1 amp MySPIConfig Subscribe to the I2C BUS MyI2CHandle adl busSubscribe ADL BUS I2C amp MyI2CConfig Subscribe to the Parallel BUS MyParaHandle adl busSubscribe ADL BUS PARALLEL amp MyParaConfig ll rite 5 bytes sec to OY om che SE x X6 lows wm memset WriteBuffer WRITE SIZE 0 adl busWrite MySPIHandle amp AccessConfig WRITE S
232. ritten agreement Ce document est la propri t exclusive de WAVECOM Il ne peut tre communiqu ou divulgu des tiers sans son autorisation pr alable wevecom es Make it wireless WM_DEV_OAT_UGD_019 002 September 11 2006 SmsCtrlHandler SMS event handler defined using the following type typedef void adl smsCtrlHdlr f u8 Event u16 Nb This handler is notified by follovving events during a n sending process ADL SMS EVENT SENDING OK the SMS was sent successfully Nb parameter value is not relevant ADL SMS EVENT SENDING ERROR An error occurred during SMS sending Nb parameter contains the error number according to CMS ERROR value cf AT Commands Interface Guide ADL SMS EVENT SENDING MR the SMS was sent successfully Nb parameter contains the sent Message Reference value A ADL_SMS_EVENT_SENDING_OK event will be received by the control handler Mode Mode used to receive SMSs ADL SMS MODE PDU SmsHandler will be called in PDU mode on each SMS reception ADL SMS MODE TEXT SmsHandler will be called in Text mode on each SMS reception e Returned values o On success this function returns a positive or null handle requested for further SMS sending operations o ADL_RET_ERR_PARAM if a parameter has a wrong value o ADL RET ERR SERVICE LOCKED if the function was called from a low level interruption handler the function is forbidden in this context 3 13 3 The adl smsSend Function Th
233. rn events will be received in the Call event handler if the application requires ADL to forward these events they will be forvvarded to this Port parameter value e Returned values o OKon success o ADL RET ERR PARAM on parameter error unavailable port o ADL RET ERR SERVICE LOCKED if the function was called from a low level interruption handler the function is forbidden in this context 3 15 9 The adl callUnsubscribe Function This function unsubscribes from the Call service The provided handler will not receive Call events any more e Prototype s8 adl callUnsubscribe adl callHdlr f Handler e Parameters Handler Handler used with adl_callSubscribe function e Returned values OK on success O o ADL_RET_ERR_PARAM on parameter error o ADL_ RET_ ERR_ UNKNOWN HDL if the provided handler is unknown o ADL RET ERR NOT SUBSCRIBED if the service is not subscribed wavecom Confidential Page 134 220 This document is the sole and exclusive property of WAVECOM Not to be distributed or divulged without prior written agreement Ce document est la propri t exclusive de WAVECOM Il ne peut tre communiqu ou divulgu des tiers sans son autorisation pr alable wavecom Make it wireless WM_DEV_OAT_UGD_019 002 September 11 2006 o ADL RET ERR SERVICE LOCKED if the function was called from a low level interruption handler the function is forbidden in this context wavecom Confidential Page
234. rrent product e ADL PORT OPEN AT VIRTUAL BASE Base ID for AT commands contexts dedicated to Open AT applications ONLY USABLE WITH THE AT COMMANDS SERVICE This port is always available and is opened immediately at the product s start up This is the default port where are executed the AT commands sent by the AT Command service 3 21 3 Ports Test Macros Some ports amp events test macros are provided These macros are defined hereafter e ADL PORT IS A SIGNAL CHANGE EVENT e Returns TRUE if the event e js a signal change one FALSE otherwise e ADL PORT GET PHYSICAL BASE port Extracts the physical port identifier part of the provided port E g if used on a 27 010 virtual port identifier based on the UART 2 this macro will return ADL PORT UART2 e ADL PORT IS A PHYSICAL PORT port Returns TRUE if the provided port is a physical output based one E g UAHT 1 UAHT2 or 27 010 logical ports FALSE otherwise e ADL PORT IS A PHYSICAL OR BT PORT port Returns TRUE is the provided port is a physical output or a bluetooth based one FALSE otherwise e ADL PORT IS AN FCM PORT port Returns TRUE if the provided port is able to handle the FCM service i e all ports except the Open AT virtual base ones FALSE otherwise e ADL PORT IS AN AT PORT port Returns TRUE if the provided port is able to handle AT commands services i e all ports except the GSM amp GPRS virtual base ones FALSE otherwise wave
235. s function allows to set the output value of a subscribed DAC block e Prototype s32 adl dacWrite s32 Handle u32 Value e Parameters Handle DAC service handle previously returned by the adl dacSubscribe function Value Value to be written on the DAC output Significant bits and output voltage depend on the module type Refer to the module Product Technical Specification document for more information Module type Significant bits Max output voltage Q2687 8 less significant bits 2 2 V for OxFF value VVOWVOCOAN Confidential Page 217 220 This document is the sole and exclusive property of WAVECOM Not to be distributed or divulged without prior written agreement Ce document est la propri t exclusive de WAVECOM Il ne peut tre communiqu ou divulgu des tiers sans son autorisation pr alable wavecom Make it wireless WM DEV OAT UGD 019 002 September 11 2006 e Returned values o OKon success o ADL RET ERR PARAM on parameter error 3 28 5 Example This example shows how to use the DAC service in a nominal case error cases not handled wavecom Confidential Page 218 220 This document is the sole and exclusive property of WAVECOM Not to be distributed or divulged without prior written agreement Ce document est la propri t exclusive de WAVECOM II ne peut tre communiqu ou divulgu a des tiers sans son autorisation pr alable wavecom Make it wireless
236. s on the figure above means that UART based ports may be used with AT commands or FCM services as well These switches are processed by the adl fcmSwitchV24State function The 2 switch on the figure above means that either the GSM CSD port or the GPRS port may be subscribed at one time but not both together Important note GPRS provides only packet mode transmission This means that the embedded application can only send receive IP packets to from the GPRS flow 3 7 1 Required Header File The header file for the FCM functions is adl_fcm h 3 7 2 The adl fcmlsAvailable Function This function allows to check if the required port is available and ready to handle the FCM service e Prototype bool adl fcmIsAvailable adl fcmFlow e Flow wavecom Confidential Page 58 220 This document is the sole and exclusive property of WWAVECOM Not to be distributed or divulged without prior written agreement Ce document est la propri t exclusive de WAVECOM Il ne peut tre communiqu ou divulgu des tiers sans son autorisation pr alable wevecom Make it wireless WM DEV OAT UGD 019 002 September 11 2006 e Parameters Flow Port from which to require the state e Returned values o TRUE if the port is ready to handle the FCM service o FALSE if it is not ready Notes All ports should be available for the FCM service except o The Open AT virtual one which is only usable for AT commands o T
237. s sans son autorisation pr alable wavecom Make it wireless WM DEV OAT UGD 019 002 September 11 2006 3 8 GPIO Service ADL provides a GPIO service to handle GPIO operations 3 8 1 Required Header File The header file for the GPIO functions is adl gpio h 3 8 2 GPIO Types 3 8 2 1 The adl ioConfig t Structure This structure is used by the adl ioSubscribe function in order to set the reserved GPIO parameters typedef struct adl ioLabel u eLabel u32 Pad adl ioDirection e eDirection adl ioState e eState adl ioConfig t The eLabel member represents the GPIO label The eDirection member represents the required GPIO direction The estate member represents the GPIO state at subscription time for outputs only 3 8 2 2 The adl ioLabel u Union This union represents the different GPIO labels depending on the Wireless CPU used typedef union t adl ioLabel 02686 e 202686 Label adl ioLabel 02687 e 02687 Label adl ioLabel u The 92686 Label member has to be used on the O2686 Wireless CPU The 92687 Label member has to be used on the O2687 Wireless CPU Wismo QUIK Q2686 Gpio Labels The following table lists the Gpio labels for the Wismo Quik Q2686 Wireless CPU and their specific linked features when applicable wavecom Confidential Page 68 220 This document is the sole and exclusive property of WWAVECOM Not to be distributed or divulged without prior written agreement C
238. s sans son autorisation pr alable weaevecom mds Make it wireless WM DEV OAT UGD 019 002 September 11 2006 o ADL RET ERR SERVICE LOCKED if the function was called from a low level interruption handler the function is forbidden in this context 3 10 4 The adl errHalt Function This function causes an error defined by its ID and string If an error handler is defined it will be called otherwise a product reset will occur e Prototype void adl errHalt ul6 ErrorID const ascii ErrorString e Parameters ErrorlD Error ID ErrorString Error string to be provided to the error handler and to be stored in the resulting backtrace if a fatal error is required Please note that only the string address is stored in the backtrace so this parameter has not to be a pointer on a RAM buffer but a constant string pointer Moreover the string will only be correctly displayed if the current application is still present in the Wireless CPU s flash memory If the application is erased or modified the string will not be correctly displayed when retrieving the backtraces 3 10 5 The adl errEraseAllBacktraces Function Backtraces caused by the adl errHalt function ADL or the Wavecom OS are stored in the product non volatile memory A limited number of backtraces may be stored in memory depending on each backtrace size and other internal parameters stored in the same storage place The adl errEraseAllBacktraces func
239. saSendResponse function or set by the firmware on unsolicited errors Please refer to the adl osaSendResponse function description for more information ADL OSA EVENT CLOSED Set to NULL 3 12 4 The adl osaSendHesponse Function This function allows the application to post back ATR or APDU responses to the Wavecom firmware after receiving an ADL OSA EVENT ATR REQUEST or ADL OSA EVENT APDU REQUEST event e Prototype s32 adl_osaSendResponse s32 OsaHandle adl_osaStatus_e Status ul6 Length u8 Data e Parameters OsaHandle OSA service handle previously returned by the adl_osaSubscribe function wavecom Confidential Page 115 220 This document is the sole and exclusive property of WAVECOM Not to be distributed or divulged without prior written agreement Ce document est la propri t exclusive de WAVECOM Il ne peut tre communiqu ou divulgu des tiers sans son autorisation pr alable weavecom gt G nie Make it wireless WM DEV OAT UGD 019 002 September 11 2006 Status Status to be supplied to the firmware in response to an ATR or APDU request using the following defined values Event Type Use ADL OSA STATUS OK Response data buffer has been received from the SIM card ADL OSA STATUS CARD NOT ACCESSIBLE S M card does not seem to be accessible no response from the card ADL OSA STATUS CARD REMOVED The SIM card has been removed ADL OSA ST
240. sable for applications with huge hard coded data In this case the Open AT application maximum size will be about 1 5 Mbytes Caution Any A amp D size change will lead to this area format process Some seconds on start up all A amp D cells data will be erased 2 5 Defined Compilation Flags Default compilation flags are defined for all Open AT projects These flags are defined below __ DEBUG APP If this flag is defined by default the TRACE amp DUMP macros cf traces service chapter will be compiled and will display debug information on Target Monitoring Tool Otherwise these macro will be ignored __OAT_ API VERSION _ Numeric flag which contains the current used API version level For Open AT V4 10 interface it is defined as OAT API VERSION 410 __ DEBUG FULL If this flag is defined using the wmmake script with the fulldebug option the FULL TRACE amp FULL DUMP macros cf traces service chapter will be compiled and will display debug information on Target Monitoring Tool Otherwise these macros will be ignored wavecom Confidential Page 17 220 This document is the sole and exclusive property of WAVECOM Not to be distributed or divulged without prior written agreement Ce document est la propri t exclusive de WAVECOM Il ne peut tre communiqu ou divulgu des tiers sans son autorisation pr alable weaevecom mds Make it wireless WM DEV OAT UGD 019 002 September 1
241. se refer to adl irqPriorityLevel e type definition for more information see 8 3 23 4 Options Interruption handler notification options A bitwise OR combination of the following options has to be used Options Comment ADL_IRO OPTION AUTO READ Vvhen the interruption occurs the source related information structure is automatically read by the service and supplied to the interruption handler Please refer to adl irqHandler f type and interruption source related services description for more information see 3 23 7 Note When used with a high level interruption handler this option allows the application to get the source related information structure read at interruption time ADL_IRQ OPTION PRE ACKNOWLEDGEMENT Set by default This option forces ADL acknowledge the interruption source prior to calling the low level handler It is ignored for high level handlers subscription Please note that in this configuration the low level interruption handler should be re entrant as if another interruption occurs before the first one s process is not over the low level handler will be called one more time wavecom Confidential Page 188 220 This document is the sole and exclusive property of WWAVECOM Not to be distributed or divulged without prior written agreement Ce document est la propri t exclusive de WAVECOM Il ne peut tre communiqu ou divulgu des tiers sans son autorisat
242. served for internal use adl msgMailBox e The ADL MSG MBX OAT TASK constant identifies the Open AT application task Other values are reserved for internal use 3 14 3 The adi msgidComparator e Type This type defines the different message identifier comparison operators available typedef enum ADL MSG ID COMP EQUAL ADL MSG ID COMP DIFFERENT ADL MSG ID COMP GREATER ADL MSG ID COMP GREATER OR EQUAL ADL MSG ID COMP LOWER ADL MSG ID COMP LOWER OR EQUAL ADL MSG ID COMP LAST Reserved for internal use adl msgIdComparator e wavecom Confidential Page 122 220 This document is the sole and exclusive property of WWAVECOM Not to be distributed or divulged without prior written agreement Ce document est la propri t exclusive de WAVECOM Il ne peut tre communiqu ou divulgu a des tiers sans son autorisation pr alable weavecom Make it wireless WM_DEV_OAT_UGD_019 002 September 11 2006 The meaning of each comparison operator is defined below Comparison Operator Description ADL MSG ID COMP EQUAL The two identifiers are equal ADL MSG ID COMP DIFFERENT The two identifiers are different ADL MSG ID COMP GREATER The received message identifier is greater than the subscribed message identifier ADL MSG ID COMP GREATER OR EQUAL The received message identifier is greater or equal to the subscribed message identifier ADL MSG ID COMP LOWER The receive
243. struct volatile void PrivateAddress u32 MaskValidAddress Out u adl busParallelSettings t The structure is usable e Before the subscription function call in order to set the required parallel bus configuration using the In union member e After the subscription function call in order to retrieve the address mask to be set at read write process time using the Out union member adl busParallelSettings t is an union structure and the required parallel bus configuration cannot be defined with a const 3 9 2 6 1 Width The Width parameter defines the read write process data buffer items bit size 8 or 16 bits using the adl busSize e type 3 9 2 6 2 Mode The Mode parameter defines the required parallel bus standard mode to be used wavecom confidential Page 90 220 This document is the sole and exclusive property of WWAVECOM Not to be distributed or divulged without prior written agreement Ce document est la propri t exclusive de WAVECOM Il ne peut tre communiqu ou divulgu a des tiers sans son autorisation pr alable weavecom Make it wireless WM DEV OAT UGD 019 002 September 11 2006 The following values are available ADL BUS PARALLEL MODE ASYNC INTEL Standard Intel mode ADL BUS PARALLEL MODE ASYNC MOTOROLA HIGH Standard Motorola mode with E signal high polarity ADL BUS PARALLEL MODE ASYNC MOTOROLA LOW Standard Motorola mode with E signal low polarity
244. subscribed with the ADL IRO OPTION POST ACKNOWLEDGEMENT option in other cases the SCTU interruption source s will alvvays be acknowledged and the function will return an error e Prototype s32 adl sctuRead s32 SctuHandle adl sctuInfo t Info e Parameters SctuHandle SCTU service handle previously returned by the adl sctuSubscribe function Info SCTU interruption source information structure Please refer to adl sctuInfo t structure definition see 8 3 24 2 e Returned values o OKon success o ADL RET ERR PARAM on a supplied parameter error o ADL RET ERR UNKNOWN HDL if the supplied SCTU handle is unknown o ADL RET ERR BAD STATE if no SCTU interruption has occurred 3 24 7 The adl sctuStop Function This function allows the application to stop the SCTU block timer SCTU interruptions will no longer be generated for this block e Prototype s32 adl_sctuStop s32 SctuHandle e Parameters SctuHandle SCTU service handle previously returned by the adl sctuSubscribe function e Returned values o OKon success o ADL RET ERR UNKNOWN HDL if the supplied SCTU handle is unknown o ADL RET ERR BAD STATE if the SCTU timer is not running 3 24 8 The adl sctuUnsubscribe Function This function allows the application to unsubscribe from the SCTU service Associated interruption handlers are disconnected from the SCTU interruption source wavecom Confidential Page 198 220 This document is the sol
245. t are always sent with MSB first Defined values are ADL BUS SPI MSB FIRST Data buffer is sent with MSB first ADL BUS SPI LSB FIRST Data buffer is sent with LSB first 3 9 2 2 6 GpioChipSelect The GpioChipSelect parameter is used only if the ChipSelect parameter is set to the ADL BUS SPI ADDR CS GPIO value It sets the GPIO label to use as the chip select signal It has to be a member of the adl ioLabel u union see the GPIO service description Example in order to use the O2686 Wireless CPU GPIO 1 to handle the SPI bus chip select signal ChipSelect parameter has to be set to ADL BUS SPI ADDR CS GPIO value and GpioChipSelect parameter has to be set to ADL IO Q2686 GPIO 1 value 3 9 2 2 7 WriteHandling The WriteHandling parameter defines the chip select signal behavior Defined values are Chip select signal state changes on each written or read word word size is defined on ADL_BUS_SPI_WORD_HANDLING read or write process request in the Size parameter of the adl_busAccess_t configuration structure Chip select signal is enabled at the beginning of the read write process and is disabled at the end of this process ADL BUS SPI FRAME HANDLING Note This mode is not available with the ADL BUS SPI ADDR CS HARD Chip Select configuration wavecom Confidential Page 86 220 This document is the sole and exclusive property of WAVECOM Not to be distributed or divul
246. t has a low priority and should be interrupted by the other ones e The high level interruption handler context This is also a task context but with an higher priority that the main application task High level interruption handlers run in this context This context has a middle priority when an interruption raises an event monitored by a high level handler This context will be immediately activated even if the application task was running however this context could be interrupted by low level interruption handlers e The low level interruption handler context This is a context designed to be activated as soon as possible on an interruption event This context has a high priority vvhen an interruption raises an event monitored by a low level handler This context will be immediately activated even if a task whatever it is application task high level handler or a WAVECOM OS task was running On the other hand the execution time spent in this context has to be as short as possible moreover some service calls are forbidden while this context is running As the application code should run in different contexts at the same time the user should protect his critical functions against re entrancy Critical code sections should be protected through a semaphore mechanism cf Semaphores service The ADL services are all re entrant Data can be exchanged between contexts through a message system cf Messages service However the RA
247. ted configuration in the used IDE or with the wmmake command For more information about the Target Monitoring Tool the configurations and the Integrated Development Environments please refer to the Tools Manual document 3 3 5 1 Required Header File The header file for the flash functions is adl traces h 3 5 2 Debug Configuration When the Debug configuration is selected in the used IDE or with the wmmake command the DEBUG APP compilation flag is defined and also the following macros wavecom Confidential Page 48 220 This document is the sole and exclusive property of WAVECOM Not to be distributed or divulged without prior written agreement Ce document est la propri t exclusive de WAVECOM Il ne peut tre communiqu ou divulgu des tiers sans son autorisation pr alable weavecom a Make it wireless WM_DEV_OAT_UGD_019 002 September 11 2006 e TRACE u8 TL ascii T Prints a trace in the Target Monitoring Tool TL defines the trace level traces will be displayed on the CUS4 element of the Target Monitoring Tool Trace levels range is from 1 to 32 T is the trace string which may use the standard C sprintf syntax Please note that the maximum displayed string length is 256 bytes If the string is longer it will be truncated on display Example u8 I 123 TRACE 1 Value if I d I At runtime this will display the following string on the CUS4 level 1 on
248. ted in the application code due to ADL architecture The Wavecom OS and the Open AT application manage their own RAM area Any access from one of these entities to the other s RAM area is prohibited and causes an exception Global variables call stack and dynamic memory are all part of the RAM allocated to the Open AT application wavecom Confidential Page 20 220 This document is the sole and exclusive property of WAVECOM Not to be distributed or divulged without prior written agreement Ce document est la propri t exclusive de WAVECOM Il ne peut tre communiqu ou divulgu a des tiers sans son autorisation pr alable weaevecom ds Make it wireless WM DEV OAT UGD 019 002 September 11 2006 2 9 Security Security mechanisms are implemented in the Wavecom OS in order to protect the Wireless CPU against software errors When this occurs the Wireless CPU resets and a function call log called back trace is stored in the Wireless CPU non volatile memory After reset the adl main function is called with the ADL INIT REBOOT FROM EXCEPTION value After a reset caused by a software crash the application is started only 20 seconds after the start of the Wavecom OS This allows at least 20 seconds delay to re download a new application or to stop the currently running one In case of a normal reset the application restarts immediately 2 9 1 Software Security Memory Access Protection A specific RAM area
249. the Open AT RAM areas sizes e Prototype s32 adl memGetInfo adl memInfo t Info e Parameters Info Structure updated by the function using the following type typedef struct t u32 TotalSize u32 StackSize u32 HeapSize u32 GlobalSize adi memInfo t o TotalSize Total RAM size for the Open AT application in bytes Please refer to the 2 4Memory Resources chapter for more information o StackSize Open AT application call stack area size in bytes This size is defined by the Open AT application through the wm apmCustomStackSize constant Please refer to the 3 Mandatory API chapter for more information Note This field is set to O under Remote Task Environment o HeapSize Open AT application total heap memory area size in bytes This size is the difference between the total Open AT memory size and the Global amp Stack areas sizes Note This field is set to O under Remote Task Environment wavecom Confidential Page 45 220 This document is the sole and exclusive property of WAVECOM Not to be distributed or divulged without prior written agreement Ce document est la propri t exclusive de WAVECOM Il ne peut tre communiqu ou divulgu des tiers sans son autorisation pr alable weavecom Ss Make it wireless WM_DEV_OAT_UGD_019 002 September 11 2006 o GlobalSize Open AT application global variables area size in bytes This size is defined at the binary li
250. the external application only if this one has required them using the corresponding AT commands same behavior than the Wavecom AT OS without a running ADL application wavecom Confidential Page 18 220 This document is the sole and exclusive property of WAVECOM Not to be distributed or divulged without prior written agreement Ce document est la propri t exclusive de WAVECOM Il ne peut tre communiqu ou divulgu des tiers sans son autorisation pr alable weavecom 1 Make it wireless WM DEV OAT UGD 019 002 September 11 2006 2 7 Open AT Specific AT Commands See document WM DEV OAT UGD 014 001 AT Commands Interface Guide document 2 2 7 1 AT WDWL Command The AT WDWL command is usable to download dwl files trough the serial link using the 1K Xmodem protocol Dwl files may be Wavecom OS updates Open AT application binaries or E2P configuration files By default this command is not pre parsed it can not be filtered by the Open AT application except if the Application Safe Mode service is used Note The AT WDWL command is described in the document 2 2 7 2 AT WOPEN Command The AT WOPEN command allows to control Open AT applications mode amp parameters Parameters O Stop the application the application will be stopped on all product resets 1 Start the application the application will be started on all product resets 2 Get the Open AT libraries versions 3 Erase the obj
251. tial Page 219 220 This document is the sole and exclusive property of WWAVECOM Not to be distributed or divulged without prior written agreement Ce document est la propri t exclusive de WAVECOM Il ne peut tre communiqu ou divulgu des tiers sans son autorisation pr alable wavecom Make it wireless WM_DEV_OAT_UGD_019 002 September 11 2006 4 2 Specific FCM Service Error Codes Error code Error value ADL FCM RET ERROR GSM GPRS ALREADY OPENNED ADL RET ERR SPECIFIC BASE ADL FCM RET ERR WAIT RESUME ADL RET ERR SPECIFIC BASE 1 ADL FCM RET OK WAIT RESUME OK 1 ADL_FCM_RET_BUFFER_EMPTY OK 2 ADL_FCM_RET_BUFFER_NOT_EMPTY OK 3 4 3 Specific Flash Service Error Codes Error Code Error Value ADL FLH RET ERR OBJ NOT EXIST ADL RET ERR SPECIFIC BASE ADL FLH RET ERR MEM FULL ADL RET ERR SPECIFIC BASE 1 ADL FLH RET ERR NO ENOUGH IDS ADL RET ERR SPECIFIC BASE 2 ADL FLH RET ERR ID OUT OF RANGE ADL RET ERR SPECIFIC BASE 3 4 4 Specific GPRS Service Error Codes Error Code Error Value ADL GPRS CID NOT DEFINED 3 ADL NO GPRS SERVICE 4 ADL CID NOT EXIST 5 4 5 Specific A amp D Storage Service Error Codes Error Code Error Value ADL AD RET ERR NOT AVAILABLE ADL RET ERR SPECIFIC BASE ADL AD RET ERR OVERFLOW ADL RET ERR SPECIFIC BASE 1 ADL AD RET ERROR ADL RET ERR SPECIFIC BASE 2 ADL AD RET ERR NEED RECOMPACT ADL RET ERR SPE
252. tion wavecom Confidential Page 52 220 This document is the sole and exclusive property of WAVECOM Not to be distributed or divulged without prior written agreement Ce document est la propri t exclusive de WAVECOM II ne peut tre communiqu ou divulgu a des tiers sans son autorisation pr alable wevecom Make it wireless WM_DEV_OAT_UGD_019 002 September 11 2006 3 6 4 The adl flhExist Function This function checks if a flash object exists from the given Handle at the given ID in the flash memory allocated to the ADL developer e Prototype s32 adl flhExist ascii Handle ul6 ID e Parameters Handle The Handle of the subscribe set of objects ID The ID of the flash object to investigate in the range allocated to the provided Handle e Returned values the requested Flash object length on success O if the object does not exist ADL RET ERR UNKNOWN HDL if handle is not subscribed ADL FLH RET ERR ID OUT OF RANGE if ID is out of handle range ADL RET ERR SERVICE LOCKED if the function was called from a low level interruption handler the function is forbidden in this context 0000 0 3 6 5 The adl flhErase Function This function erases the flash object from the given Handle at the given ID e Prototype s8 adl flhErase ascii Handle ul6 ID e Parameters Handle The Handle of the subscribed set of objects ID The ID of the flash object to be erased Important note
253. tion allows to free and re initialize this storage place e Prototype s32 adl errEraseAllBacktraces void e Returned value o ADL RET ERR SERVICE LOCKED if the function was called from a low level interruption handler the function is forbidden in this context o OKifthe function is successfully executed 3 10 6 The adl errStartBacktraceAnalysis Function In order to retrieve backtraces from the product memory a backtrace analysis process has to be started with the adl errStartBacktraceAnalysis function wavecom Confidential Page 105 220 This document is the sole and exclusive property of WWAVECOM Not to be distributed or divulged without prior written agreement Ce document est la propri t exclusive de WAVECOM Il ne peut tre communiqu ou divulgu des tiers sans son autorisation pr alable wevecom es Make it wireless WM_DEV_OAT_UGD_019 002 September 11 2006 e Prototype s8 adl_errStartBacktraceAnalysis void e Returned values o A positive or null handle on success This handle have to be used in the next adl_errRetrieveNextBacktrace function call It will be valid until this function returns a ADL RET ERR DONE code o ADL RET ERR ALREADY SUBSCRIBED if a backtrace analysis is already running o ERROR ifan unexpected internal error occurred o ADL RET ERR SERVICE LOCKED if the function was called from a low level interruption handler the function is forbidden in this context Note
254. tion by the external application was successful ADL GPRS EVENT ACTIVATE OK X ADL GPRS EVENT GPRS DIAL OK FROM EXT x If the activation requested with ad gprsAct on the Cid X was successful f the activation requested by the external application with ATD 99 PPP dialing was successful on the Cid X ADL GPRS EVENT ACTIVATE OK FROM EXT x If the activation requested by the external application on the Cid X was successful ADL GPRS EVENT HANGUP OK FROM EXT f the rejection of the incoming PDP activation by the external application was successful ADL GPRS EVENT DEACTIVATE KO X f the deactivation requested with ad gprsDeact on the Cid X failed ADL GPRS EVENT DEACTIVATE KO FROM EXT X If the deactivation requested by the external application on the Cid X failed wavecom confidential Page 137 220 This document is the sole and exclusive property of WAVECOM Not to be distributed or divulged without prior written agreement Ce document est la propri t exclusive de WAVECOM Il ne peut tre communiqu ou divulgu des tiers sans son autorisation pr alable wevecom es Make it wireless WM_DEV_OAT_UGD_019 002 September 11 2006 Event Call ID Description ADL_GPRS_EVENT_ACTIVATE_KO_FROM_EXT f the activation requested by x the external application on the Cid X failed ADL GPRS EVENT ACTIVATE KO X If the activation requested
255. tion pr alable wavecom Make it wireless WM_DEV_OAT_UGD_019 002 September 11 2006 3 9 9 Example This example simply demonstrates how to use the BUS service in a nominal case error cases are not handled on the O2687 Wireless CPU Complete examples of BUS service used are also available on the SDK generic Data_Storage sample generic Drivers library sample Global variables amp constants SPI Subscription data const adl busSPISettings t MySPIConfig 0 13MHz SPI clock speed ADL BUS SPI CLK MODE O0 Mode 0 clock ADL BUS SPI ADDR CS GPIO M Use a GRIO 0 bancile che eh Select signal ADL BUS SPI CS POL LOW Chip Select active in low state ADL BUS SPI MSB FIRST Data are sent MSB first ADL IO 02687 GPIO 31 V Uee GEO JI wo handle che a Select signal ADL_BUS_SPI_FRAME HANDLING Chip Select active during the whole frame ADL BUS SPI DATA BIDIR Chip connected using one data pin VL PIPER SUb Ss Cp Coma const adl busI2CSettings t MyI2CConfig 0x20 Chip address is 0x20 ADL_BUS_I2C_CLK_STD Chip uses the I2C standard clock speed Parallel Subscription data adl busParallelSettings t MyParaConfig ADL BUS SIZE BYTE US bits parallel bus ADL BUS PARALLEL MODE ASYNC MOTOROLA LOW Motorola mode Low E signal polarity 0x00 0x00 i ty 1727207207 0 Read timing settings ib ak tb ab 2 i 0 Ol W
256. totype void adl simState e adl simGetState void e Returned values The returned value is the SIM service state based on following type typedef enum ADL SIM STATE INIT Service init state PIN state not known yet ADL SIM STATE REMOVED SIM removed ADL SIM STATE INSERTED SIM inserted PIN state not known yet ADL SIM STATE FULL INIT SIM Full Init done ADL SIM STATE PIN ERROR SIM error state ADL SIM STATE PIN OK PIN code OK waiting for full init ADL SIM STATE PIN WAIT SIM inserted PIN code not entered yet Always last State ADL SIM STATE LAST adi simState e wavecom Confidential Page 111 220 This document is the sole and exclusive property of WWAVECOM Not to be distributed or divulged without prior written agreement Ce document est la propri t exclusive de WAVECOM Il ne peut tre communiqu ou divulgu a des tiers sans son autorisation pr alable weavecom anis Make it wireless WM_DEV_OAT_UGD_019 002 September 11 2006 3 12 Open SIM Access Service The ADL Open SIM Access OSA service allows the application to handle APDU requests amp responses with an external SIM card connected through one of the Wireless CPU interfaces UART SPI I2C Note The Open SIM Access feature has to be enabled on the Wireless CPU in order to make this service available The Open SIM Access feature state can be read thanks to the AT WCFM 5 command response valu
257. tructure e Prototype s32 adl rtcConvertTime adl rtcTime t TimeStructure adl rtcTimeStamp t TimeStamp adl rtcConvert e Conversion e Parameters TimeStructure Input output RTC time structure TimeStamp Input output timestamp structure Conversion Conversion mode using the type below typedef enum ADL_RTC_CONVERT_TO_TIMESTAMP ADL RTC CONVERT FROM TIMESTAMP adl_rtcConvert_e ADL_RTC_CONVERT_TO_TIMESTAMP This mode converts the TimeStructure parameter to the TimeStamp parameter ADL_RTC_CONVERT_FROM_TIMESTAMP This mode converts the TimeStamp parameter to the TimeStructure parameter e Returned values o OK on success o ERROR if conversion failed internal error o ADL RET ERR PARAM if one parameter value is incorrect wavecom Confidential Page 183 220 This document is the sole and exclusive property of WAVECOM Not to be distributed or divulged without prior written agreement Ce document est la propri t exclusive de WAVECOM Il ne peut tre communiqu ou divulgu des tiers sans son autorisation pr alable wavecom Make it wireless WM_DEV_OAT_UGD_019 002 September 11 2006 3 22 5 The adl rtcDiffTime Function This function calculates the difference betvveen tvvo timestamp structures e Prototype s32 adl rtcDiffTime adl rtcTimeStamp t TimeStampl adl rtcTimeStamp t TimeStamp2 adl rtcTimeStamp t Result e Parameters TimeStamp1 First timestamp
258. ts Cid e Prototype s8 adl gprsActExt u8 Cid adl port e Port e Parameters Cid The Cid of the PDP context to activate integer value between 1 and 4 Port Port on which to run the PDP context activation command Activation return events are received in the GPRS event handler If the application wavecom Confidential Page 141 220 This document is the sole and exclusive property of WAVECOM Not to be distributed or divulged without prior written agreement Ce document est la propri t exclusive de WAVECOM Il ne peut tre communiqu ou divulgu des tiers sans son autorisation pr alable wavecom Make it wireless WM_DEV_OAT_UGD_019 002 September 11 2006 requires ADL to forward these events they will be forwarded to this Port parameter value e Returned values This function returns OK on success or a negative error value Possible error values are Error Value Description ADL_RET_ERR_PARAM parameters error bad Cid value or unavailable port ADL_RET_ERR_PIN_KO If the PIN is not entered or if the WIND 4 indication has not occurred yet ADL GPRS CID NOT DEFINED problem to set up the Cid the CID is already activated ADL NO GPRS SERVICE if the GPRS service is not supported by the product ADL RET ERR BAD STATE The service is still processing another GPRS AP application should wait for the corresponding event indication of end of processing in the GPRS handler before
259. ty of WAVECOM Not to be distributed or divulged without prior written agreement Ce document est la propri t exclusive de WAVECOM Il ne peut tre communiqu ou divulgu des tiers sans son autorisation pr alable wavecom Make it wireless WM DEV OAT UGD 019 002 September 11 2006 3 22 RTC Service ADL provides a RTC service to access to the Wireless CPU s inner RTC and to process time related data 3 22 1 Required Header File The header file for the RTC functions is adl rtc h 3 22 2 RTC service Types 3 22 2 1 The adl rtcTime t Structure The following structure is used by the Wavecom OS in order to retrieve the current RTC time typedef struct ul6 Year Year Four digits u8 Month Month 1 12 u8 Day Day of the month 1 31 u8 Hour Hour 0 23 u8 Minute Minute 0 59 u8 Second Second 0 59 u8 Pad Not used ul6 SecondFracPart Second fractional part adl rtcTime t Second fractional part step is the ADL RTC SECOND FRACPART STEP constant This field most significant bit is not used values are in the O Ox7FFF range 3 22 2 2 The adl rtcTimeStamp t Structure The following structure may be used to perform arithmetic operations on time data typedef struct u32 TimeStamp Seconds elapsed since 1 January 1970 ul6 SecondFracPart Second fractional part adl rtcTimeStamp t The timestamp uses the Unix format seconds elapsed since t
260. ument est la propri t exclusive de WAVECOM Il ne peut tre communiqu ou divulgu des tiers sans son autorisation pr alable wavecom Make it wireless WM DEV OAT UGD 019 002 September 11 2006 3 26 8 Example This example simply demonstrates how to use the execution context service in a nominal case error cases are not handled wavecom Confidential Page 212 220 This document is the sole and exclusive property of WAVECOM Not to be distributed or divulged without prior written agreement Ce document est la propri t exclusive de WAVECOM II ne peut tre communiqu ou divulgu a des tiers sans son autorisation pr alable wavecom Make it wireless WM_DEV_OAT_UGD_019 002 September 11 2006 3 27 ADL VariSpeed Service The ADL VariSpeed service allovvs the Wireless CPU clock frequency to be controlled in order to temporarily increase application performance Note o The Real Time Enhancement feature must be enabled on the Wireless CPU in order to make this service available o The Real Time Enhancement feature state can be read thanks to the AT WCFM 5 command response value This feature state is represented by the bit 4 00000010 in hexadecimal format o Please contact your Wavecom distributor for more information on how to enable this feature on the Wireless CPU 3 27 1 Required Header File The header file for the VariSpeed service is adl vs h 3 27 2 The adl vsiViode e Type T
261. unction This function subscribes to the Application safe mode service in order to receive WOPEN and WDWL commands events e Prototype s8 adl safeSubscribe ul6 WDWLopt ul6 WOPENopt adl safeHdlr f SafeHandler e Parameters WDWLopt Additionnal options for VWWDWL command subscription This command is at least subscribed in ACTION and READ mode Please see adl atCmdSubscribe API for more details about these options WOPENopt Additionnal options for VWOPEN command subscription This command is at least subscribed in READ TEST and PARAM mode with minimum of one mandatory parameter Please see adl atCmdSubscribe API for more details about these options SafeHandler Application safe mode handler defined using the following type typedef bool adl safeHdlr f adl safeCmdType e CmdType adl atCmdPreParser t paras The CmdType events received by this handler are defined below wavecom Confidential Page 153 220 This document is the sole and exclusive property of WWAVECOM Not to be distributed or divulged without prior written agreement Ce document est la propri t exclusive de WAVECOM Il ne peut tre communiqu ou divulgu des tiers sans son autorisation pr alable wevecom Make it wireless WM_DEV_OAT_UGD_019 002 September 11 2006 typedef enum ADL SAFE CMD WDWL AT WDWL command ADL SAFE CMD WDWL READ AT WDWL command ADL SAFE CMD WDWL OTHER
262. vel of an handler allows the notification order to be set in case of event conflict e A low priority level handler cannot be interrupted by other low priority level handlers e A high priority level handler cannot be interrupted by other high or low priority level handlers e A low priority level handler can be interrupted by any high priority level handler wavecom Confidential Page 186 220 This document is the sole and exclusive property of WAVECOM Not to be distributed or divulged without prior written agreement Ce document est la propri t exclusive de WAVECOM Il ne peut tre communiqu ou divulgu des tiers sans son autorisation pr alable weavecom a Make it wireless WM_DEV_OAT_UGD_019 002 September 11 2006 3 23 5 The adl irqEventData t Structure This structure supplies interruption handlers with data related to the interruption source typedef struct union void LowLevelOuput void HighLevelInput UserData void SourceData adl irqEventData t 3 23 5 1 The UserData Field This field allows the application to exchange data between low level and high level interruption handlers The LowLevelOuput member address has to be modified by the low level handler before it returns This address will be supplied to the high level handler through the HighLevelInput member 3 23 5 2 The SourceData Field This field provides interruption handlers which have used the ADL IRO OPTION AUTO
263. wevecom es Make it wireless WM_DEV_OAT_UGD_019 002 September 11 2006 3 23 IRQ Service The ADL IRQ service allows interruption handlers to be defined These handlers are usable with other services External Interruption Pins SCTU to monitor specific interruption sources Interruption handlers are running in specific execution contexts of the application Please refer to the Execution Contexts Service for more information 8 3 25 Note o The Real Time Enhancement feature has to be enabled on the Wireless CPU in order to make this service available o The Real Time Enhancement feature state can be read thanks to the AT WCFM 5 command response value this feature state is represented by the bit 4 O0000010 in hexadecimal format o Please contact your Wavecom distributor for more information on how to enable this feature on the Wireless CPU 3 23 1 Required Header File The header file for the IRQ functions is adl irq h 3 23 2 The adl irgID e Type This type defines the interruption sources that the service is able to monitor typedef enum ADL IRQ ID EXTINTO ADL IRQ ID EXTINT1 ADL IRQ ID SCTUI1 ADL IRQ ID LAST Reserved for internal use adl irqID e The ADL IRQ ID EXTINTX constants identify interruption sources raised by the External Interrupt Pins service The ADL IRQ ID SCTUX constants identify interruption sources raised by the SCTU service wavecom Confidential Page 185 220 This
264. where in the application code used as event handlers void MyFunctionl void Subscribes to the IRQ service IrqHandle adl irqSubscribe MyExtIntHandler ADL IRQ NOTIFY LOW LEVE L ADL IRQ PRIORITY HIGH LEVEL ADL IRQ OPTION AUTO READ Subscribes to the ExtInt service SctuHandle adl sctuSubscribe ADL_SCTU_BLOCK1 IrqHandle 0 amp Config Configures comparator channel ExtIntHandle adl ExtIntSubscribe ADL EXTINT PINO IrqHandle 0 amp Config void MyFunction2 void Un subscribes from the ExtInt service adl extintUnsubscribe ExtIntHandle wavecom Confidential Page 207 220 This document is the sole and exclusive property of WAVECOM Not to be distributed or divulged without prior written agreement Ce document est la propri t exclusive de WAVECOM Il ne peut tre communiqu ou divulgu des tiers sans son autorisation pr alable wevecom Make it wireless WM DEV OAT UGD 019 002 September 11 2006 3 26 Execution Context Service The application runs under several execution contexts according to the monitored event ADL service event or interruption event The execution contexts are e The application task context This is the main application context initialized on the ad1 main function call and scheduled each time a message is received each message is then converted to an ADL service event according to its content This contex
265. will receive from a command e Prototype bool adl strIsTerminalResponse adl strID e RspID e Parameters RspID Response ID to check e Returned values o TRUE if the provided response ID is a terminal one o FALSE otherwise 3 19 6 The adl strGetResponse Function This function provides the standard response string from its ID e Prototype ascii adl strGetResponse adl strID e RspID e Parameters RspID Response ID from which to get the string e Returned values o Standard response string on success o NULL if the ID does not exist Important caution The returned pointer memory is allocated by this function but its ownership is transferred to the embedded application This means that the embedded application will have to release the returned pointer wavecom Confidential Page 158 220 This document is the sole and exclusive property of WWAVECOM Not to be distributed or divulged without prior written agreement Ce document est la propri t exclusive de WAVECOM Il ne peut tre communiqu ou divulgu a des tiers sans son autorisation pr alable wevecom Make it wireless WM_DEV_OAT_UGD_019 002 September 11 2006 3 19 7 The adl strGetResponseExt Function This function provides a standard response string from its ID with the provided argument e Prototype ascii adl strGetResponseExt adl strID e RspID u32 arg e Parameters RspID Response ID fro
266. with ad gprsAct on the Cid X failed ADL GPRS EVENT ANSWER OK AUTO If the incoming PDP context activation was automatically accepted by the ME ADL GPRS EVENT SETUP OK X If the set up of the Cid X with ad gprsSetup was successful ADL GPRS EVENT SETUP KO X If the set up of the Cid X with ad gprsSetup failed ADL GPRS EVENT ME ATTACH If the ME has forced a network attachment ADL GPRS EVENT ME UNREG If the ME is not registered ADL GPRS EVENT ME UNREG SEARCHING If the ME is not registered but is searching a new operator for registration Note If Cid X is not defined the value ADL CID NOT EXIST will be used as X wavecom Confidential Page 138 220 This document is the sole and exclusive property of VVAVECOM Not to be distributed or divulged without prior written agreement Ce document est la propri t exclusive de WAVECOM Il ne peut tre communiqu ou divulgu des tiers sans son autorisation pr alable weaevecom mds Make it wireless WM DEV OAT UGD 019 002 September 11 2006 The possible returned values for this handler are defined below Event Description ADL GPRS FORWARD the event shall be sent to the external application On unsolicited events these one be forwarded to all opened ports On responses events these one be forwarded only on the port on which the request was executed ADL GPRS NO FORWARD the event is not sent to the external applicatio
267. y Embedded software User application binary set of Embedded Application sources Wavecom library External Application Application external to the Wavecom product that sends AT commands through the serial link IDE Integrated Development Environment Target Open AT compatible product supporting an Embedded Application wavecom Confidential Page 13 220 This document is the sole and exclusive property of WAVECOM Not to be distributed or divulged without prior written agreement Ce document est la propri t exclusive de WAVECOM Il ne peut tre communiqu ou divulgu des tiers sans son autorisation pr alable weavecom a Make it wireless WM_DEV_OAT_UGD_019 002 September 11 2006 Target Monitoring Tool Set of utilities used to monitor a Wavecom product Receive command pre Process for intercepting AT responses parsing Send command Process for intercepting AT commands pre parsing Standard API Standard set of C functions Wavecom library Library delivered by Wavecom to interface Embedded Application sources with VVavecom OS functions Wavecom OS Set of GSM and open functions supplied to the User 1 4 Abbreviations A amp D Application amp Data ADL Application Development Layer API Application Programming Interface APN Access Point Name CID Context IDentifier CPU Central Processing Unit DAC Digital Analog Converter EXTINT External Interruption FCM Flow Control Manager GPIO Gen
268. y the Error Service If this error is filtered and refused by the error handler the function will return NULL Please refer to the paragraph 3 10 for more information o Memory allocation may also fail due to an unrecoverable corrupted memory state one of the follovving exceptions is then generated these exceptions cannot be filtered by the Error service and systematically lead to a reset of the Wireless CPU o RTK exception 166 A buffer header or footer data is corrupted a write overflovv has occurred on this block 3 4 4 The adl memhRelease Function This function releases the allocated memory buffer designed by the supplied pointer e Prototype bool adl memRelease void ptr e Parameters ptr A pointer on the allocated memory buffer e Returned values o TRUE if the memory was correctly released In this case the provided pointer is set to NULL o If the memory release fails one of the following exceptions is generated these exception cannot be filtered by the Error service and systematically lead to a reset of the Wireless CPU o RTK exception 155 The supplied address is out of the heap memory address range o RTK exception 161 or RTK exception 166 The supplied buffer header or footer data is corrupted a write overflow has occurred on this block o RTK exception 159 or RTK exception 172 The heap memory release process has failed due to a global memory corruption in the heap area 3 4 5 Heap Memory Bl

Download Pdf Manuals

image

Related Search

Related Contents

Philips myBathroom Ceiling light 32081/31/16  Homelite UT20044 User's Manual  Super EverDrive V2  Berichte über Landwirtschaft    薬食安発 ー002 第 ー3 号  BG User Manual - Newport Corporation  ワイヤレスゲート|9419|  Enjeux et Bibliographie sélective défis des ressources humaines    

Copyright © All rights reserved.
Failed to retrieve file