Home
GSM interface library for surveillance applications
Contents
1. 000 0 cee tees 14 Write SMS to memory 0000 tte eee 15 Enable disable unsolicited messageS 000 ccc ects 15 Read unsolicited messages display status llle 16 Encoding the SMS parameters to PDU issllsleseeseeleeeleese 16 Copying strings from one to another liliis eee 16 Hexadecimal to character string conversion 16 Character string to hexadecimal conversion illie eese 17 Character string to octet conversion llli 17 Encoding of SMS content to octetS 0 0000 res 17 Calculation of length of string liliis 17 Decoding the data section of PDU 6 ee 17 Decoding the SMS deliver status PDU 1 2 2 2 000 ccc ee 18 Conversion between GSM alphabet and the ASCII format 000000s 18 Conversion from ASCII for extended ISO 8859 1 to GSM alphabet 18 SMS Delay iendre iri miarana ei ion Seed heed Maes px Aer ade nenas ees qd 18 Decrement TimingDelay 0 cece rn 18 SysTick configuration ern ra o a hh 19 Document revision history lisse mr 25 Doc ID 16271 Rev 1 ky UM0794 Getting started 1 Getting started 1 1 Package contents The GSM interface library package includes the following e SMS library e Application example To configure GSM module SIM300 SIM340 To send receive SMS To set SMS parameters e Documentation User manual 1 2 Hardware connection to run the applic
2. wv UMO794 J User manual GSM interface library for surveillance applications Introduction GSM global system for mobile communications is an open digital cellular technology used for transmitting mobile voice and data services GSM supports voice calls and data transfer speeds of up to 9 6 kbit s together with the transmission of SMS short message service This document explains how to use the GSM interface library to configure and use the GSM module and use the SMS feature for control and monitoring This library is developed for the STM32 microcontroller and tested on the STM3210E EVAL It uses a UART interface to communicate with the GSM module The firmware is in C language The objective of this library is to show the user the features and capabilities of the STM32 for automation and surveillance applications using the SMS feature of GSM This library is provided with an application example and is interfaced with SIM340 and SIM300 GSM modules from SIMCOM This library communicates with the GSM module through AT commands over a UART Interface Figure 1 below shows the block diagram of this demonstration board Figure 1 Block diagram STM3210E EVAL Daughterboard demonstration kit SIM340 300 AM05239v1 June 2010 Doc ID 16271 Rev 1 1 26 www st com Contents UM0794 Contents 1 Getting started st ne Da o ER D a 8 lg a iS 5 1 1 Package contents se cuenta ue poe qp pede dee di
3. liliis 14 2 8 24 Write message to memory 2 eee 15 2 8 22 Enable disable unsolicited messages leues 15 2 3 23 Read unsolicited messages display status 0 0 16 2 3 24 Encoding the SMS parameters to PDU 00 000000 16 2 3 25 Copying strings from one to another 00 0c eee 16 2 3 26 Hexadecimal to character string conversion 0005 16 2 26 Doc ID 16271 Rev 1 ky UM0794 Contents 2 3 27 Character string to hexadecimal conversion 000005 17 2 3 28 Character string to octet conversion 000 cece 17 2 3 29 Encoding of SMS content to octets 00 0 eee eee 17 2 3 30 Calculation of length of string lesen 17 2 3 31 Decoding the data section of PDU 0202000 00s 17 2 3 32 Decoding the SMS deliver status PDU 000000 18 2 3 33 Conversion between GSM alphabet and the ASCII format 18 2 3 34 The routines for definition of delay 0 0 00 cee eee 18 3 Application example tics eee eve e RE EERaCE E x wERRRRN ER tes 20 3 1 Sending an SMS 993 wenden 9 canoe ees RR To rd EN oh d a pu ca ps 20 3 2 Receiving an SMS du ga GI REOR RAGRAURRCE RUE A RR UA Ea 21 3 3 Deleting an SMS xia xice piu REALE RU RADAR G CR CK UR RU Raw RC RR EUR 24 4 Revision history isuueueeesh Rura eee ee ee EE 25 ky Doc ID 16271 Rev 1 3 26 List of tables UM0794 List
4. ONLY BE USED IN AUTOMOTIVE APPLICATIONS AT USER S OWN RISK Resale of ST products with provisions different from the statements and or technical features set forth in this document shall immediately void any warranty granted by ST for the ST product or service described herein and shall not create or extend in any manner whatsoever any liability of ST ST and the ST logo are trademarks or registered trademarks of ST in various countries Information in this document supersedes and replaces all information previously supplied The ST logo is a registered trademark of STMicroelectronics All other names are the property of their respective owners 2010 STMicroelectronics All rights reserved STMicroelectronics group of companies Australia Belgium Brazil Canada China Czech Republic Finland France Germany Hong Kong India Israel Italy Japan Malaysia Malta Morocco Philippines Singapore Spain Sweden Switzerland United Kingdom United States of America www st com 26 26 Doc ID 16271 Rev 1 ky
5. The following parameters are This function returns needed for this function the message SMS Send This function sends _ patntartommsssade Bt reference number that SMS in PDU mode VR 9 g can be used for Destination number in string message delivery format status Note 1 Ifthe message string is in ASCII for extended character set it is ISO 8859 1 format the user must de comment the define ASCII I SO8859 1 macro in the SMS h file In this case the string must be terminated by NULL character 2 If the message is already in GSM alphabet the string must be terminated by OxFF 10 26 Doc ID 16271 Rev 1 UM0794 SMS library 2 3 11 Reading SMS Table 11 Reading SMS Function name Description This function receives the SMS SMS_Read om the preferred storage 2 3 12 Delete SMS Table 12 Input parameters The following parameters are needed to read the SMS Index of the SMS to be read number not string Status change flag False normal mode status change from unread to read if the message is unread True the status of the message remains the same Pointer of the PDUSMReceiveStruct_t Structure Delete SMS Output parameters This function fills the PDUSMReceiveStruct_t type pointer location passed by the user with SMS details u8_SMSCLenghh service centre number length b_MoreDatalndic reserved u8_SMSCNum service centre number in string
6. of tables Table 1 Table 2 Table 3 Table 4 Table 5 Table 6 Table 7 Table 8 Table 9 Table 10 Table 11 Table 12 Table 13 Table 14 Table 15 Table 16 Table 17 Table 18 Table 19 Table 20 Table 21 Table 22 Table 23 Table 24 Table 25 Table 26 Table 27 Table 28 Table 29 Table 30 Table 31 Table 32 Table 33 Table 34 Table 35 Table 36 Table 37 Table 38 4 26 Network LED status 2e esr ch roa ken bon ea ae Rana Ae ec 5 SMS mode configuration llilsslseeleeee rn 7 Read SMS service centre parameters 0000 cece eee 7 Set SMS service centre parameters lilii seh 8 Enable disable new message alert nonu nunnu eee 8 Enable disable message submit status report s sasaaa 0c cece eee 9 Store SMS Settings o eima aiian aa P aiia eee tees 9 Restore SMS settingS 0 00 9 Reading SMS mode 1 0 2 0 10 Sending SMS na a aa i aoh eani tte rn 10 Reading SMS isa ss anke nes ea pr ia Hae dae ewe ERR ERR iee des 11 Delete SMS ei ides e en Pack Cus dte uk Rot Ru BSE G ROB cts deo x n but LER Ra 11 Write SMS to memory anusan 0 hr 12 Send SMS from memory 00 000 cee ln 12 Set SMS storage Memory 2 2 lr 13 Read SMS storage 1 0 cee 13 Enable disable alpha ID 00 00 eee 14 Read alpha Dee erikorra tepane ne R teens 14 Set SMS validity period anana aaau 14 Enable disable extra information
7. parameters This routine converts The pointer to the The converted string is available in GSM alphabet to ep the same string The length of the string to be Soi ASCII character string after conversion is also string converted to ASCII returned back SMS_GSMAlbhabettolS088591 Table 34 Conversion from ASCII for extended ISO 8859 1 to GSM alphabet Function name Description Input parameters Output parameters f The pointer to the The converted string is available in This routine converts SMS 1S088591t0GSMAlbhabet the string from ASCII Sting to be the same string Tie length ofthe converted to GSM string after conversion is also to GSM alphabet alphabet returned back 2 3 34 The routines for definition of delay Table 35 SMS Delay Function name Description Input parameters Output parameters This function offers The delay count 16 bit For SMS Delay delay in the determining the exact value delay execution see the routines below The successful completion of delay returns true Table 36 Decrement_TimingDelay Function name Description Input parameters Output parameters Decrement_TimingDelay Mon e tiis None None 18 26 Doc ID 16271 Rev 1 ky UM0794 SMS library Table 37 SysTick configuration Function name SysTick Config Description This routine configures the SysTick for delay For example if
8. the micro is running at 72 MHz and for 1ms delay counter decrement period the value of SYSTIC COUNTER is 72000 Input parameters None Output parameters None Doc ID 16271 Rev 1 19 26 Application example UM0794 3 Application example 3 1 Sending an SMS To send an SMS the user must do the following 1 Set the SMS PDU mode 2 Enable the status report 3 Send the SMS and read the SMS reference number returned by the SMS send routine 4 Check the status report for the above reference number The example code for SMS send with status report enabled is below For details see the gsm_appli c the send SMS section in the ApplicationRun routine Set the PDU Mode b_TestStatus SMS_ModeConfig PDU_MODE if TRUE b_TestStatus u8 u8_Temp 0 ul6 ul6_SMSRefNo 0 SMS Send Reference Number u8 u8_ATC12 AT CSMS 0 u8 u8_PhNo xxxxxxxxxxxx SMS Destination Number u8 puc8_SMS_String J Test SMS Message Content b gCurrentSMSMode FALSE Current SMS Mode indicator Flag Enable Status Report SMS StausReport ENABLE u16 SMSRefNo SMS Send u8 PhNo puc8 SMS String while b gStatusReportReceived FALSE Wait Until Status Report Received if SMSStatusReportBuff u8_gStatusBuffRear u8_SMReferenceNo u16_SMSR efNo if SMSStatusReportBuff u8_gStatusBuffRear u8_MSGStatus 0 Messsage is d
9. MSCNumFormatVal centre structure NOT SUPPORTED number service centre SMS SCDetails UNKNOWN ISDN address format and SC t This routine fills NATIONAL ISDN alpha ID if enabled the parameters in INTNATIONAL ISDN Tisdoeagon NET SPECIFIC ISDN u8 scaAlpha alpha ID in string format 1 ltalso returns the status of the command executed The function returns true as soon as the parameters are filled in the passed location Doc ID 16271 Rev 1 7 26 SMS library UM0794 2 3 4 Table 4 Set SMS service centre parameters Set SMS service centre parameters Function name SMS ServiceCentreSet Description This function sets the SMS service centre number service centre address format and SC alpha ID if enabled Input parameters The pointer of the message service centre structure SMS SCDetails t that contains the service centre parameters u8 MsgSerOCntrNo service centre Number in String format SMSCNumFormatVal NOT SUPPORTED UNKNOWN ISDN NATIONAL ISDN INTNATIONAL ISDN NET SPECIFIC ISDN u8 scaAlpha alpha data in string format This is not required Output parameters This returns the status of the command executed The function returns true as soon as the parameters are set 2 3 5 Table 5 Enable disable new message alert Enable disable new message alert Function
10. S ModeConfig PDU MODE if TRUE b TestStatus Wait Until new message received while b_gNewMsgReceived FALSE e SendorIdentityVal UNKNOWN NUM SMS Read u16 NewMessageLocBuffer u8 gl BuffRear FALSE amp s RcvStruct1 Clear the location in the New mesage Index buffer ul6 NewMessageLocBuffer u8 gBuffRear z0 u8_gBuffRear if u8_gBuffRear gt NEW_MSG_BUFFLEN u8_gBuffRear 0 Clear the Flag if there is no other new message to read if u8 gBuffRear u8 gBuffFront b_gNewMsgReceived FALSE ys Check for Message Sendor Authorization y if TRUE UserStrcompare u8_AdminNumber s_RevStruct1 u8_PhoneNum e SendorIdentityVal ADMIN NUM Message Sendor is authorised and user can decode and process the command here ApplicationSMSContentDecode 22 26 Doc ID 16271 Rev 1 q UM0794 Application example else if TRU UserStrcompare u8_UserNumber1 s_RevStruct1 u8_PhoneNum Lj e SendorIdentityVal USER1 NUM Message Sendor is authorised and user can decode and process the command here ApplicationSMSContentDecode else if TRU UserStrcompare u8_UserNumber1 s_RevStruct1 u8_PhoneNum Lj e SendorIdentityVal USER2 NUM Message Sendor is authorised and user can decode and process the command here ApplicationSMSContentDecode else e SendorIdentit
11. a octets SMS EncodeSMSContent 2 3 30 Calculation of length of string Table 30 Calculation of length of string This routine calculates the length StringLength of the string up to 255 characters The pointer to the string long The calculated length of the string is returned back 2 3 31 Decoding the data section of PDU Table 31 Decoding the data section of PDU Function name Description Input parameters Output parameters The pointer to the The decoded string is copied into TPDU string and the the same pointer and the length of length the decoded string is returned This routine decodes the SMS_DecodeSMSContent TPDU to string ky Doc ID 16271 Rev 1 17 26 SMS library UM0794 2 3 32 Decoding the SMS deliver status PDU Table 32 Decoding the SMS deliver status PDU Function name Description Input parameters Output parameters The decoded status report is filled in the status buffer The pointer to the ssStatusReportBuff u8_gStatusBuff This routine decodes location of the PDU Front 1 The status of the SMS is also the SMS status PDU and the length of the PDU SMS DecodeStatusPDU returned True the SMS is delivered False the SMS is in pending state 2 3 33 Conversion between GSM alphabet and the ASCII format Table 33 Conversion between GSM alphabet and the ASCII format Function name Description Input parameters Output
12. abled Output parameters The status of the execution of the routine is returned As soon as the alpha ID is enabled disabled this function returns true 2 3 18 Read alpha ID Table 18 Read alpha ID Function name Description Input parameters Output parameters The following is returned by the This function routine SMS ReadAlphalD ES the alpha None True the alpha ID is enabled False the alpha ID is disabled 2 3 19 Set SMS validity period Table 19 Set SMS validity period Function name Description Input parameters Output parameters This function sets the ES SMS SetValidityPeriod validity period of the The SMS validity period None in minutes 32 bit SMS 2 3 20 Enable disable extra information Table 20 Enable disable extra information Function name This function SMS_ConfigExtralnfo information Description enables disables the display of extra Input parameters display is disabled display is enabled The value of SetConfig type enum DISABLE extra information ENABLE extra information Output parameters The status of the routine execution True successful execution False execution unsuccessful 14 26 Doc ID 16271 Rev 1 UM0794 SMS library 2 3 21 Table 21 Write SMS to memory Write message to memory Function name SMS_WritetoMemory Description This functio
13. ation To connect the GSM daughter board with the STM32 demonstration kit the user must perform the following 1 Connect pin 1 of J1 Rx pin of the SIM300 on the daughter board to PA9 STM32 2 Connect pin 3 of J1 Tx pin of the SIM300 on the daughter board to PA10 STM32 3 Connect pin 2 of J9 PWRKEY pin of the SIM300 on the daughter board to PA2 STM32 Now common the grounds of both the boards and power up the daughter board and then the STM32 demonstration kit If the DB9 connector is used the user should first connect the DB9 connector and then the power supply adapter Now to turn on the GSM module the user must press the SW2 switch for 2 3 seconds Also to turn off the module the user should press the SW2 switch for 1 5 seconds The LED D6 shows the status of the GSM module Table 1 Network LED status State SIM300 function Off SIM300 is not running 64 ms on 800 ms off SIM300 does not find the network 64 ms on 3000 ms off SIM300 find the network 64 ms on 300 ms off GPRS communication Doc ID 16271 Rev 1 5 26 SMS library UM0794 2 SMS library 2 1 Getting started In order to check that the GSM module is initialized properly or not the user can send AT using the SendATCommand u8 u8 ATCommand u8 u8 Length function defined in the gsm generic c file In response to this the GSM module returns OK 2 2 SMS library architecture The following architecture is used for the SMS li
14. atus Function name Description Input parameters Output parameters The value of SetConfig type enum This function returns False extra information display is the status of the SMS ReadUnsolicitMsgStatus in None disabled display of unsolicited messages status True extra Information display is enabled 2 3 24 Encoding the SMS parameters to PDU Table 24 Encoding the SMS parameters to PDU Function name Description Input parameters Output parameters This routine receives The pointer to the The decoded PDU is assigned to the string the message PDUSMSendStruct pointer passed in the function Also the SMS EncodePDUString structure and _ttype structure and Status of the routine execution is returned converts it into PDU string into which the True successful execution string PDU is assigned False execution unsuccessful 2 3 25 Copying strings from one to another Table 25 Copying strings from one to another Function name Input parameters Output parameters This routine copies the The string argument 1 is copied into string argument 2 It also returns the length of the string The pointer to the strings UserStrcpy string argument 1 into string argument 2 2 3 26 Hexadecimal to character string conversion Table 26 Hexadecimal to character string conversion Function name Description Input parameters Output parameters Th
15. brary e Application layer gsm appli c e SMS library sms c atcommands h e STM32 USART library stm32f10x_usart c e GSM stack GSM module The files are organized in the following directory structure e Application user application layer files main c gsm appli c stm32f10x it c stm32f10x_vector c gsm appli h stm32f10x conf h stm32f10x it h e SMS library sms c sms h atcommands h e Library the STM3210E EVAL library 6 26 Doc ID 16271 Rev 1 ky UM0794 SMS library 2 3 SMS library description 2 3 1 Set SMS mode The following function can be used to set the SMS mode 2 3 2 SMS mode initialization Table 2 SMS mode configuration Function name SMS_ModeConfig This function configures the SMS mode This may be Test mode or PDU Description Input parameters The enum of type SMSFromat_t The value may be one of the following Output parameters The status of the command executed The function returns true as soon as the mode is set to the TEXT MODE mode desired one PDU MODE 2 3 3 Read SMS service centre number and parameters Table 3 Read SMS service centre parameters Function name SMS ServiceCentreRead Description This function reads the message service SMS service centre Input parameters The pointer of the Output parameters u8_MsgSerCntrNo service centre number in string format S
16. elivered else Message pending 20 26 Doc ID 16271 Rev 1 ky UM0794 Application example 3 2 4 Clear the SMSStatusReportBuff u8 gStatusBuffRear structure members SMSStatusReportBuff u8_gStatusBuffRear u8_MSGStatus 0 SMSStatusReportBuff u8_gStatusBuffRear u8_SMReferenceNo 0 for u8_Temp 0 u8_Temp lt 14 u8_Temp SMSStatusReportBuff u8_gStatusBuffRear u8_SMSCTimeStamp u8_Temp 0 f SMSStatusReportBuff u8_gStatusBuffRear u8_SMSCDelieverTime u8_Temp 0 SMSStatusReportBuff u8_gStatusBuffRear u8_SMRcvrNo u8_Temp 0 Now point the Rear pointer of the circular buffer to the next element u8 gStatusBuffRear if u8 gStatusBuffRear STATUS PDU QUEUE LEN u8_gStatusBuffRear 0 Clear the Flag if there is no SMS Status Report to Read if u8_gStatusBuf fRear u8_gStatusBuffFront b_gStatusReportReceived FALSE SMS Send with Status Report Ends Here kc kck ck ck ck kckckck ck kc kc k ko KK Receiving an SMS To receive an SMS the user must do the following 1 Setthe SMS PDU mode 2 Enable the new message indication 3 Read SMS Doc ID 16271 Rev 1 21 26 Application example UM0794 The example code is given below for details refer to the gsm_appli c file ERERERL ARAL KIC EE RA NC RECEIVING new Message RREKKKKKKKKR KKK KK KK Set the PDU Mode mu b TestStatus SM
17. format u8 PhoneNumLen senders number length u8_SenderName name of the sender if available in address book u8_PhoneNum phone number of the sender u8 TimeStamp time Stamp YY MM DD HH MM SS xx u8 UserDataLen length of the SMS u8 MsgContent SMS content in string format Function name SMS Delete This function deletes the SMS from the specified storage Memory1 Description format not string Doc ID 16271 Rev 1 Input parameters The index of the SMS to be deleted in number Output parameters This returns the status of the command executed True SMS is deleted False SMS is not deleted 11 26 SMS library UM0794 2 3 13 Write SMS to memory Table 13 Write SMS to memory Function name SMS_WritetoMemory Description Input parameters Output parameters This function returns SMSSendlNdex t type structure that contains the following 1 u16_RefNum message reference number Number format The following parameters are needed for this This function b CMSErrOcurred this flag indicates the following True CMS Error has occurred False message written properly and user can use the reference number function writes the Pointer to message SMS to j string memory u16_CMSErrlndex This Indicates the CMS Error Index Destination number in string format b_CMEErrOcur
18. ge indication detailed information display CSDH from active memory to non volatile memory 8 bit profile index ranging from O to 255 this should be a number not a character SMS StoreSettings Output parameters This returns the status of the command executed The function returns true as soon as the configuration is saved 2 3 8 Restore SMS settings The user must ensure that the mentioned profile index exists Table 8 Restore SMS settings Function name SMS RetoreSettings Description This function restores SMS settings for SMS mode test or PDU new message indication detailed information display CSDH from non volatile memory to active memory Input parameters 8 bit profile index ranging from 0 to 255 this should be a number not a character to be restored from the memory Output parameters This returns the status of the command executed The function returns true as soon as the mentioned profile is successfully retrieved Doc ID 16271 Rev 1 9 26 SMS library UM0794 2 3 9 Reading SMS mode Table 9 Reading SMS mode Function name Description Input parameters Output parameters muU f This returns the SMS mode is function returns SMS_ModeRead the mode of the SMS None PDU_MODE TEXT MODE 2 3 10 Sending SMS Table 10 Sending SMS Function name Description Input parameters Output parameters
19. is routine converts the 16 The 16 bit digit and the The converted string is copied Epa NaToChe Convener bit hex digit into string pointer to the string into the string passed q 16 26 Doc ID 16271 Rev 1 UM0794 SMS library 2 3 27 Character string to hexadecimal conversion Table 27 Character string to hexadecimal conversion Function name Description Input parameters Output parameters This routine converts the The pointer to the string The converted hexadecimal CharToHexDigitConverter string up to 5 character long to be converted into M e digit is returned 16 bit hex digit hexadecimal digit 2 3 28 Character string to octet conversion Table 28 Character string to octet conversion Function name Description Input parameters Output parameters This routine converts the string The pointer to the string to The converted hexadecimal digit CnhartoOctat up to 2 character long octet be converted into octet is returned 2 3 29 Encoding of SMS content to octets Table 29 Encoding of SMS content to octets Function name Description Input parameters Output parameters This routine encodes the The decoded PDU octet is The pointer to the f E text message content in to available in the same string message string and the octets of the data section of lenath of the strin and also the function returns the PDU 9 9 the length of the dat
20. la UR AMA QUAQN RUE RUNG RE 5 1 2 Hardware connection to run the application 0 00 5 2 SMS library ado x aC ine etek eee aC abc a a daran CR CR RC RR RU tan 6 2 1 Getting started 22s osx EXER REESE EGG ARRAS EXRG SAGE KE 6 2 2 SMS library architecture llli 6 23 SMS library description 22424644 sid IREixae ER es Shek 542 ER Eas 7 2 3 1 Set SMS mode 0 0 ees 7 2 3 2 SMS mode initialization llle 7 2 3 3 Read SMS service centre number and parameters 7 2 3 4 Set SMS service centre parameters 00000 cece eee eee 8 2 3 5 Enable disable new message alert 0 00 cee eee nee 8 2 3 6 Enable disable message submit status report 040 9 2 9 7 Store SMS settings 0 0 ccc eee 9 2 3 8 Restore SMS settings liliis 9 2 3 9 Reading SMS mode 060 c cece teas 10 2 3 10 Sending SMS 0 000 10 2 3 11 ReadingSMS 0 00 eae 11 23 12 Delete SMS os dua ened ve Ph yee eee ote bebe een E 11 2 3 13 Write SMS to memory 20 0c eae 12 2 3 14 Send SMS from memory 20 0c ae 12 2 3 15 Set SMS storage memory 00 e ee 13 2 3 16 Read SMS storage 0 ceca 13 2 8 17 Enable disable alpha ID 0 00000 ee 14 2 8 18 ReadalphalD esee 14 2 3 19 Set SMS validity period liliis 14 2 3 20 kEnable disable extra information
21. n writes SMS to memory Input parameters pu8_Number Number in String format This is optional pu8_SMSString SMS content Output parameters SMSSendIndex_t Structure that contains the following 1 ui6_RefNum Message reference Number 2 b_CMSErrOccurred This flag indicates the following TRUE CMS Error has occurred FALSE Message written properly and the user can use the reference number 3 uf6 CMSErrIndex This indicates the CMS Error Index 4 b CMEErrOccurred This flag indicates the following TRUE CME Error has occurred FALSE Message written properly and the user can use the reference number 5 u16 CMEErrIndex This indicates the CME Error Index 2 3 22 Table 22 Enable disable unsolicited messages Enable disable unsolicited messages Function name SMS ConfigUnsolicitMsg Description This function enables disables the display of unsolicited messages Input parameters The value of SetConfig type enum DISABLE unsolicited messages display is disabled ENABLE unsolicited messages display is enabled Output parameters The status of the routine execution True successful execution False execution unsuccessful Doc ID 16271 Rev 1 15 26 SMS library UM0794 2 3 23 Read unsolicited messages display status Table 23 Read unsolicited messages display st
22. name SMS NewSMSAlert Description This function Input parameters The value of SetConfig Enum Output parameters This returns the status of the command enables disables the alert for new SMS receive ENABLE enables the alert for new message DISABLE disables the alert for new message executed The function returns true as soon as the new configuration is set Comment The user can also read and set the configuration parameters for new messages through the following function bool NewSMSNotificationConfi g NewMsgNotifConfig ps NewMsgNitifConfigV al For details please see the description of the above function 8 26 Doc ID 16271 Rev 1 q UM0794 SMS library 2 3 6 Enable disable message submit status report Table 6 Enable disable message submit status report Function name Description Input parameters Output parameters The value of SetConfig Enum ENABLE enables ihe This returns the status of the SMS_StausReport This function enables disables the SMS submit status report status report for SMS submit DISABLE disables the command executed The function returns true as soon as the new configuration is set status report for SMS submit 2 3 7 Store SMS settings Table 7 Store SMS settings Function name Description Input parameters This function stores SMS settings for SMS mode text or PDU new messa
23. red This flag indicates the following True CME Error has occurred False message written properly and user can use the reference number 5 u16 CMEErrndex this indicates the CME Error Index 2 3 14 Send SMS from memory Table 14 Send SMS from memory Function name SMS SendFromMemory This function sets the SMS storage number format not memory Description Input parameters Output parameters The index of the SMS to be sent in message reference number This function returns the string that can be used for the message delivery status 12 26 Doc ID 16271 Rev 1 q UM0794 SMS library 2 3 15 Table 15 Set SMS storage memory Set SMS storage memory Function name SMS_StorageMemorySet Description SMS_StorageMe moryRead Input parameters The pointer to the SMStorageParam_t type structure that contains u8_Memory1 messages to be read and deleted from this memory storage u8 Memory2 message is written and sent from this memory storage u8 Memory3 received message is placed in this memory storage if routing to PC is not setl Output parameters This function returns the status of the command and also fills the passed location with the number of used locations and total number of available locations 1 Example u8 Memory2 SV for SIM card storage 2 3 16 Table 16 Read SMS s
24. services described herein and ST assumes no liability whatsoever relating to the choice selection or use of the ST products and services described herein No license express or implied by estoppel or otherwise to any intellectual property rights is granted under this document If any part of this document refers to any third party products or services it shall not be deemed a license grant by ST for the use of such third party products or services or any intellectual property contained therein or considered as a warranty covering the use in any manner whatsoever of such third party products or services or any intellectual property contained therein UNLESS OTHERWISE SET FORTH IN ST S TERMS AND CONDITIONS OF SALE ST DISCLAIMS ANY EXPRESS OR IMPLIED WARRANTY WITH RESPECT TO THE USE AND OR SALE OF ST PRODUCTS INCLUDING WITHOUT LIMITATION IMPLIED WARRANTIES OF MERCHANTABILITY FITNESS FOR A PARTICULAR PURPOSE AND THEIR EQUIVALENTS UNDER THE LAWS OF ANY JURISDICTION OR INFRINGEMENT OF ANY PATENT COPYRIGHT OR OTHER INTELLECTUAL PROPERTY RIGHT UNLESS EXPRESSLY APPROVED IN WRITING BY AN AUTHORIZED ST REPRESENTATIVE ST PRODUCTS ARE NOT RECOMMENDED AUTHORIZED OR WARRANTED FOR USE IN MILITARY AIR CRAFT SPACE LIFE SAVING OR LIFE SUSTAINING APPLICATIONS NOR IN PRODUCTS OR SYSTEMS WHERE FAILURE OR MALFUNCTION MAY RESULT IN PERSONAL INJURY DEATH OR SEVERE PROPERTY OR ENVIRONMENTAL DAMAGE ST PRODUCTS WHICH ARE NOT SPECIFIED AS AUTOMOTIVE GRADE MAY
25. torage Read SMS storage Function name SMS StorageMemoryRead Description This function sets the SMS storage memory Input parameters follows storage storage The pointer to the SMStorageParam t type Structure Output parameters The parameters are filled in the location passed The details are as u8 Memory1 messages to be read and deleted from this memory u8 Memory2 messages are written and sent from this memory u8 Memory3 received messages are placed in this memory storage if routing to PC is not set u16 Memory1Total total number of locations available in memory1 u16 Memory1Used number of locations already used u16_Memory2Total total number of locations available in Memory2 u16 Memory2Used number of locations already used u16_Memory3Total total number of locations available in memory3 u16 Memory1Used number of locations already used 7 1 The status of the execution of the routine is also returned As soon as the parameters read this function returns true Doc ID 16271 Rev 1 13 26 SMS library UM0794 2 3 17 Table 17 Enable disable alpha ID Enable disable alpha ID Function name This function SMS ConfigAlphalD s the alpha ID Description enables disable Input parameters The value of SetConfig type enum ENABLE the alpha ID is enabled DISABLE the alpha ID is dis
26. yVal UNKNOWN NUM User is not authorised and if needed then system can inform the admin ApplicationUnauthorizedNotification Note 1 The Data length more than 159 is not supported in this version of library 4 Doc ID 16271 Rev 1 23 26 Application example UM0794 3 3 24 26 Deleting an SMS To delete an SMS the user must do the following 1 Set the delete SMS index 2 Call delete SMS routine If the delete SMS routine returns TRUE the SMS is deleted The following is the example code to show how to use the SMS_Delete routine b_SMDeleteFlag SMSDelete u16_SMDeleteIndex if TRUE b_SMDeleteFlag Message is Deleted Successfully Doc ID 16271 Rev 1 ky UM0794 Revision history 4 Revision history Table 38 Document revision history Date 03 Jun 2010 Revision 1 Initial release Changes Doc ID 16271 Rev 1 25 26 UM0794 Please Read Carefully Information in this document is provided solely in connection with ST products STMicroelectronics NV and its subsidiaries ST reserve the right to make changes corrections modifications or improvements to this document and the products and services described herein at any time without notice All ST products are sold pursuant to ST s terms and conditions of sale Purchasers are solely responsible for the choice selection and use of the ST products and
Download Pdf Manuals
Related Search
Related Contents
PLUS PREVENTER BAIT Modélisation GRILLE et GRILLE_MEMBRANE EXPERT TV METERS USER MANUAL - HIK YVC-1000 Quick Start Guide Istruzioni per l`uso TRUMAN - Groupe President Electronics zorman et ump - SNUipp Manual - Prodance Copyright © All rights reserved.
Failed to retrieve file