PDU codec details

Source: Internet
Author: User

PDU codec details

Brief Introduction


SMS is a specification developed by ETSI (GSM 03.40 and GSM 03.38 ). It can send up to 160 characters, when using 7-bits encoding. 8-bit encoding (up to 140 characters) is usually not displayed directly through the mobile phone; it is usually used as a data message, such as pictures and ringtones in smart messaging) and ota wap settings. 16-bit information (up to 70 characters) is used to display Unicode (ucs2) text information, can be displayed by most mobile phones. A 16-bit text message starting with Class 0 will be displayed on some mobile phones as flash sms (blinking SMS and warning SMS ).
There are two ways to send and receive SMS messages: Use the text mode or use the PDU (protocol description unit) mode. Text mode (which may not be supported by some mobile phones) is actually a form of PDU encoding. When SMS information is displayed, different character sets and different encoding methods may be used. The most common options are "pccp437", "pcdn", "8859-1", "Ira", and "GSM ". these are specified by reading at + CSCs in the application's at-command. If you want to read the information on your mobile phone, the mobile phone will select an appropriate encoding for you. An application that can read SMS messages either uses the test mode or the PDU mode. If the text mode is used, the application will bind (or restrict) some possible encoding options. In some cases, it is not enough. If you use the PDU mode, you can use any encoding method.

--------------------------------------------------------------------------------

Receive
The PDU string not only contains messages, but also contains a lot of sender metadata, its SMS service center, and time signs. These are in hexadecimal notation or decimal notation of half eight bytes. The following character book I received from Nokia 6110, when the string sent from www. MTN. co. za is "hellohello.
07 917238010010f5 040bc87238880900fda-9930925161958003c16010

The eight-bit string contains three parts: The first eight-bit SMSC information length ("07"), SMSC information ("917238010010f5 "), and the sms_deliver part (specified in GSM 03.40 ).

Note: Some mobile phones (for example, ericssson 888 ?) The first three parts (colored) are omitted in PDU mode.
8-bit description
The length of the SMSC information. (In this example, there are seven octal digits)
91 SMSC address type (91 indicates an international phone number)
72 38 01 00 10 F5 service center number (decimal number of half eight digits) The telephone number is an odd number (11), So add F to ensure 8 digits. The service center number is "+ 27381000015"
04 the first 8 bits of sms_deliver.
The length of the 0b address. Length of the sending number (0b hex = 11 dec)
Address type of the C8 sending number
72 38 88 09 00 F1 sending number (decimal number of half eight digits) with an end of F.
00 TP-PID. Protocol identifier
00 TP-DCS encoding method
99 30 92 51 61 95 80 TP-SCTS. Time Postmark (half 8 digits)
0a TP-UDL. User Data Length, length of information. The TP-DCS domain indicates data in 7-bit format. Therefore, the length is 10 7-bits. If the TP-DCS is set to 8-bit or Unicode, the length should be 9 eight-bit length.
E8329bfd4697d9ec37 TP-UD. 7-bit encoding information.

All 8 bits are in hexadecimal encoding, except for the service center number, sending number, and time postmark. They are both in decimal half 8 bits. The end part of the PDU string contains some hexadecimal 8-bits data, but their actual 7-bits data.
The decimal half 8 digits only need to switch the high position and position to obtain the actual value. For example: "72 38 88 09 00 F1" to "27 83 88 90 00 1f ". Because the phone number is an odd number, there is no way to make up the 8-bit code, so use F to complete. At the resolution time of the postmark ("99 03 29 15 16 59 08"), the first six represent the date, the last six represent the time, and the last two represent the time zone.

--------------------------------------------------------------------------------

Flash sms
Class 0 information on some mobile phones (all nokias, some Siemens, Ericsson, Motorola, etc.) will be displayed as a flash SMS message. Once this information arrives, it will be immediately displayed on the screen without pressing any buttons. If the data encoding method is set to 16-bit Unicode (ucs2) and the Information starts with "0001", it will be displayed as a flashing flash message.

Octet value description
TP-DCS 18 16 bits (ucs2), message Class 0
TP-VP AA validity (period)
TP-UDL 0C User Data Length, 12 octets
TP-UD 00 01 00 41 00 6C 00 65 00 72 00 74 user data, message "alert"

This table displays the relevant information in flash sms.
The first Unicode character ("00 01") can flash. The maximum number of such messages is 69 Unicode characters.

--------------------------------------------------------------------------------

Nokia icon
This is an OTA (on the air) bitmap.
This file was downloaded from the Nokia forum. In the "smart messaging" connection.

PDU
Type 44
RP: 0 (no reply path)
Udhi: 1 (UD begins with a header)
SRI: 0 (no status report will be returned)
MMS: 1 (no more messages)
MTI: 00 (SMS-deliver)
OA 0b
91
6302752852f1
Length: 11 digit
Type: International, e.164/e.163
Number: 36 20 5782251
PID 00
PDU content: Short Message
DCs F5
Data coding: 8 bit
Message class: 1
SCTS 1, 991012
114343
40
Date: 99/01/21
Time: 11:34:34
Timezone: GMT + 1
Udl 89
137 octets
Ud udh 06
05
04
1583
1583
Length of header: 6 octets
Information element type: NBS port addressing
Information element length: 4 octets
Destination Port: CLI icon
Source Port: CLI icon
O
T
A

B
I
T
M
A
P H
D
R 00

48
0e
01
Infofield: Last octet, no compression,
No palette, 8 bit, 0 animated icons
Width: 72 Pixel
Height: 14 Pixel
Depth: 1?
I
M
A
G
E

D
A
T
A
3ff00110005b0001e8
7ff802a801a500021c
3ff80c470101000408
7ff808010081001c04
3ff008150081001304
7e10183f0058803a84
7df030490064802c9c
7e501855002d80473c
3ad0082a8058404218
39b005010060c04930
105005be0042203220
1a1007620046600c40
09e001bb003b900840
042000960001080ea0

--------------------------------------------------------------------------------

7-bit encoding
"Hellohello" contains 10 characters, which must be represented by 7-bits.
H e l o h e l o
104 101 108 108 111 104 101 108 108 111
1101000 1100101 1101100 1101100 1101111 1101000 1100101 1101100 1101100 1101111
1101000
110010 1
00, 11011
1101 100
110 1111
11 01000
1 100101
1101100
1101100
110111 1

First, convert the character to a 7-bit binary, and then call the subsequent character to the front to complete the difference. For example, if H is translated into 1101000, e is translated into 1100101. Obviously, H's binary code is less than eight bits, then the last bits of E will be added to the front of H. Then it becomes 11101000 (E8 ). The following table lists the codes remaining:

1 1101000
00 110010
100 11011
1111 1101
01000 110
100101 11
1101100 1

1 1101100
110111
E8 32 9B FD 46 97 D9
EC 37

Then it is changed to nine eight-digit E8 32 9B FD 46 97 D9 EC 37.

--------------------------------------------------------------------------------

Error Message
Error code meaning
0-127 GSM 04.11 Annex E-2 values
128-255 GSM 03.40 section 9.2.3.22 values
300 phone failure
301 SMS service of phone Reserved
302 operation not allowed
303 operation not supported
304 invalid PDU Mode Parameter
305 invalid text mode parameter
310 SIM not inserted
311 SIM pin necessary
312 PH-SIM pin necessary
313 SIM failure
314 SIM busy
315 SIM wrong
320 memory failure
321 invalid memory index
322 memory full
330 SMSC (Message Service Center) Address Unknown
331 no NETWORK SERVICE
332 network timeout
500 unknown error
512 manufacturer specific

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.