———
|
Table of Contents
Siemens MC35 GSM modem tipsSome special characters
Useful AT CommandsAT+CNMFSet format of sms data - text or pdu PDU formatSending SMS in PDU formatReceiving SMS in PDU format
status reports in pdu formatSMS PDU formats demystified February 12, 2009 Introduction SMS (Short Message Service) text messaging is the most widely used data application across any electronic device. The simplicity and availability of tools to compose and receive SMS have made it the most popular technology across the globe. There are various software that provide value over just receiving and sending of SMS (Bulk SMS tools, SMS campaign manager, Auto responders). When developing software for SMS, there are various approaches that can be taken. One of which is to send and receive SMS through a GSM modem or a mobile phone connected to your computer using a data cable (or Bluetooth or Infrared). A software on the computer will communicate to the modem via serial communication using AT commands. There are two ways (Text mode and PDU mode) of sending and receiving SMS via a GSM modem or mobile phone connected to your computer. The PDU (Protocol Data Unit) mode provides you with advanced functionality and information when sending or receiving SMS over the Text Mode. PDU Formats The specifications for the PDU have been developed by ETSI. There are various PDU formats specified by the ETSI. In this article, I will attempt to explain the various PDU formats in a simplified manner with reference to the GSM 03.40 standard. 1. SMS-DELIVER (A SMS received from the mobile operator to the phone / modem) 2. SMS-SUBMIT (A SMS sent from the phone / modem to the mobile operator) 3. SMS-STATUS-REPORT (Conveys a status report for a previously sent SMS) 4. SMS-COMMAND (Sends a command from the phone / modem to the mobile operator) 1. SMS-DELIVER 2. SMS-SUBMIT 3. SMS-STATUS-REPORT 0791198994800721 C6220C91197940005637902001917360229020019173602249 Octet Description 07 Length of the SMSC information. 91 Type of address of the SMSC. 19 89 94 80 07 21 Service center number in decimal octets. The number of the service center is +919849087012. C6 First Octet of this SMS-STATUS-REPORT message. 22 TP-MR. The message reference number. It is the same as the TP-MR of the sent SMS for which the delivery report has been received. 0C Length of recipient phone number. 91 Type of address of recipient phone number. 19 79 40 00 56 37 The recipient phone number. +919704006573 90 20 01 91 73 60 22 Service Center Time Stamp. 10/02/09 19:37:06 Time Zone GMT+5.30 90 20 01 91 73 60 22 Discharge Time Stamp. 10/02/09 19:37:06 Time Zone GMT+5.30 49 The status of the SMS. (TP-Status) Mobile number does not exist. Type-Of-Address The field identifies the type of recipient number, originating number or service center number. Bit 7 = 1 Bits 6-4: Type of number Bits Type of number 000 Unknown 001 International number 010 National number 011 Network specific number 100 Subscriber number 101 Alphanumeric 110 Abbreviated number 111 Reserved for extension Bits 3-0: Numbering pan identification Bits Numbering plan identification 0000 Unknown 0001 ISDN / telephone numbering plan 0011 Data numbering plan 0100 Telex numbering plan 1000 National numbering plan 1001 Private numbering plan 1010 ERMES numbering plan 1111 Reserved for extension Example: Type of address = 91 (Hex) 10010001 (Binary) Bit 7 = 1 Bit 6-4 = 001 (International number) Bit 3-0 = 0001 (ISDN / telephone numbering plan) First Octet of SMS-STATUS-REPORT The field contains TP-MTI (Message Type Indicator), TP-MMS (More messages to send) and TP-SRQ (Status report qualifier) Bits Description 7-6 Reserved 5 TP-SRQ (0 – Result of SMS-SUBMIT, 1- Result of SMS-Command) 4-3 Reserved 2 TP-MMS (0 – More messages are waiting, 1 – No more messages are waiting for this MS in the service center) 1-0 TP-MTI Message Type Indicator values Bits 1-0 Message Type 00 SMS-DELIVER (in the direction SC to MS) 00 SMS-DELIVER REPORT (in the direction MS to SC) 10 SMS-STATUS-REPORT (in the direction SC to MS) 10 SMS-COMMAND (in the direction MS to SC) 01 SMS-SUBMIT (in the direction MS to SC) 01 SMS-SUBMIT-REPORT (in the direction SC to MS) 11 Reserved Example: First Octet = C6 (Hex) 110001 10 (Binary) Bit 5 = 0 (Result of SMS-SUBMIT) Bit 2 = 1 (No more messages are waiting for this MS in the service center) Bit 1-0 = 10 (SMS-STATUS-REPORT is the message type) Time-Stamp The field is in semi octet representation and represents the local time in the following way. Bits Description 13-12 Year 11-10 Month 9-8 Day 7-6 24 Hour 5-4 Minute 3-2 Second 1-0 Time Zone (GMT Differenece) Example: Time Stamp = 90200191736022 Year = 2009, Month = 02 (Feb), Day = 10, Hour = 19, Minute = 37, Second = 06, Time Zone = 22 Time Zone = 22 (00100010) MSB = 0 (+), if 1 then negative(-) 22 x 15 mins = 330 mins . i.e. Time Zone = GMT + 5.30 TP-ST (Status Field) The field indicates the status of a previously submitted SMS in PDU. Bit 7=0, Bits 6-0: Short message transaction completed 0000000 Short message received succesfully 0000001 Short message forwarded to the mobile phone, but unable to confirm delivery 0000010 Short message replaced by the service center 0000011 – 0001111 Reserved 0010000 – 0011111 Values specific to each service center Temporary error, Service center still trying to transfer SMS 0100000 Congestion 0100001 SME busy 0100010 No response from SME 0100011 Service rejected 0100100 Quality of service not available 0100101 Error in SME 0100110 – 0101111 Reserved 0110000 – 0111111 Values specific to each service center Permanent error, Service center is not making any more transfer attempts 1000000 Remote procedure error 1000001 Incompatible destination 1000010 Connection rejected by SME 1000011 Not obtainable 1000100 Quality of service not available 1000101 No interworking available 1000110 SM validity period expired 1000111 SM deleted by originating SME 1001000 SM deleted by service center administration 1001001 SM does not exist 1001010 – 1001111 Reserved 1010000 – 1011111 Values specific to each service center Temporary error, Service center is not making any more transfer attempts 1100000 Congestion 1100001 SME busy 1100010 No response from SME 1100011 Service rejected 1100100 Quality of service not available 1100101 Error in SME 1100110 – 1101001 Reserved 1101010 – 1101111 Reserved 1110000 – 1111111 Values specific to each service center Bit 7=1, Bits 6-0: Reserved Example: TP-ST = 49 (Hex) 01001001 (Binary) Bit 7 = 0 Bit 6-0 = 1001001 (SM does not exist ) AT+CNMINew SMS message indications test commandAT+CNMI=? - list of supported modes Write commandAT+CNMI=[<mode>][, <mt>][, <bm>][, <ds>][, <bfr>] - set mode
when <mode> 1…3 is entered. recorded live indicationsreceived sms at position 8 >AT+CNMI=2,3,0,2 +CMTI: "MT",8 Appendixessms classes
What are the classes of SM-MT (mobile terminated) messages? Classes identify the message's importance as well as the location where it should be stored. There are 4 message classes.
TermsExplanation of terms
IRA means that one byte is displayed as two characters in hexadecimal format. For example, the byte 0x36 (decimal 54) is displayed as “36” (two characters). IRA is used here for input 8-bit or 16-bit data via terminal devices using text mode. This means only characters 'A'..F','a'..'f' and '0'..'9' are valid.
The escape sequence used within a text coded in the GSM default alphabet (0x1B) must be correctly interpreted by the TE, both for character input and output. To the module, an escape sequence appears like any other byte received or sent.
TA is used equivalent to Mobile Equipment (ME) which stands for the GSM module described here. It uses GSM default alphabet as its character set.
TE is the device connected to the TA via serial interface. In most cases TE is an ANSI/ASCII terminal that does not fully support the GSM default alphabet, for example MS Hyperterminal.
The character set currently used by Terminal Equipment is selected with AT+CSCS.
DCS is part of a short message and is saved on the SIM. When writing a short message to the SIM in text mode, the dcs stored with AT+CSMP is used and determines the coded character set. Links
|