SMS and the PDU format
来源:互联网 发布:明朝实力 知乎 编辑:程序博客网 时间:2024/04/27 14:31
Introduction
The SMS message, as specified by the Etsiorganization (documents GSM 03.40 and GSM 03.38), can be up to 160 characters long, where each character is 7 bits according to the 7-bit default alphabet.Eight-bit messages (max 140 characters) are usually not viewable by the phones as text messages; instead they are used for data in e.g. smart messaging(images and ringing tones) and OTA provisioning of WAP settings. 16-bit messages (max 70 characters) are used for Unicode (UCS2) text messages, viewable by most phones. A 16-bit text message of class 0 will on some phones appear as a Flash SMS (aka blinking SMS or alert SMS).
The PDU format
There are two ways of sending and receiving SMS messages: by text mode and by PDU (protocol description unit) mode. The text mode (unavailable on some phones) is just an encoding of the bit stream represented by the PDU mode. Alphabets maydiffer and there are several encoding alternatives when displaying an SMS message. The most common options are "PCCP437", "PCDN", "8859-1", "IRA" and"GSM". These are all set by the at-command AT+CSCS, whenyou read the message in a computer application. If you read the messageon your phone, the phone will choose a proper encoding.An application capable of reading incoming SMS messages, can thus use text mode or PDU mode. If text mode is used, the application is bound to (orlimited by) the set of preset encoding options. In some cases, that's just not good enough. If PDU mode is used, any encoding can be implemented.
Receiving a message in the PDU mode
The PDU string contains not only the message, but also a lot of meta-information about the sender, his SMS service center, thetime stamp etc. It is all in the form of hexa-decimal octets or decimal semi-octets.The following string is what I received on a Nokia 6110 when sending the message containing "hellohello" from www.mtn.co.za.
This octet sequence consists of three parts: An initial octet indicating the length of the SMSC information ("07"), the SMSC information itself ("917283010010F5"), and the SMS_DELIVER part (specified by ETSI in GSM 03.40).
Note: on some phones (e.g. Ericssson 888?) the first three (colored) parts are omitted when showing the message in PDU mode!
All the octets above are hexa-decimal 8-bit octets, except the Service centernumber, the sender number and the timestamp; they are decimal semi-octets.The message part in the end of the PDU string consists of hexa-decimal 8-bit octets, but these octets represent 7-bit data (see below).
The semi-octets are decimal, and e.g. the sender number is obtained by performing internal swapping within the semi-octets from "72 38 88 09 00 F1"to "27 83 88 90 00 1F". The length of the phone number is odd, so a proper octet sequence cannot be formed by this number. This is thereason why the trailing F has been added.The time stamp, when parsed, equals "99 03 29 15 16 59 08", wherethe 6 first characters represent date, the following 6 representstime, and the last two represents time-zone related to GMT.
Interpreting 8-bit octets as 7-bit messages
This transformation is described in detail in GSM 03.38, and an example of the"hellohello" transformation is shown here. Thetransformation is based on the 7 bit defaultalphabet , but an applicationbuilt on the PDU mode can use any character encoding.
Sending a message in the PDU mode
The following example shows how to send the message "hellohello"in the PDU mode from a Nokia 6110.
AT+CMGF=0 //Set PDU mode AT+CSMS=0 //Check if modem supports SMS commands AT+CMGS=23 //Send message, 23 octets (excluding the two initial zeros) >0011000B916407281553F80000AA0AE8329BFD4697D9EC37<ctrl-z> There are 23 octets in this message (46 'characters'). The first octet ("00") doesn't count, it is only an indicator of the length of the SMSC information supplied (0).The PDU string consists of the following:
Links
- CMS error codes
- Versenden von Kurznachrichten mittels PDU
- Etsi
- SMS and the PDU format
- SMS and the PDU format
- SMS with the SMS PDU-mode
- SMS with the SMS PDU-mode
- SMS PDU-Mode The Protocol Identifier octet
- 开发者指南 SMS with the SMS PDU-mode
- 手机SMS PDU
- SMS PDU编码
- CDMA SMS pdu解码
- SMS PDU编码
- CDMA SMS pdu解码
- SMS的PDU编码
- SMS短信PDU编码
- CDMA SMS pdu解码
- Android SMS PDU
- sms的pdu格式
- Android SMS PDU
- Android SMS PDU
- 海量数据面试题整理(转)
- IIS服务器排错指南及错误代码大全
- 估算表的长度
- 手机3D电影离我们还有多远?
- mtd-utils 工具的使用
- SMS and the PDU format
- 杂谈我的IT梦
- linux SAMBA使用方法收集中。。。
- (转)stlport使用注意
- 笔记本电脑键盘拆卸方法
- C++中CString,int,string,char*之间的转换
- sql server 的ANSI_NULLS设置
- Thunderbird邮件格式排版问题
- thrift多线程服务端