QT serial port receives SMS Chinese text message-decoding

Source: Internet
Author: User

 

How to decode Chinese text message received by SMS

 

1. Send unread SMS instructions:
 
QStrCmd = "AT + CMGL = 0 \ r ";
QDebug () <qStrCmd;
MyCom-> write (qStrCmd. toAscii ());

2. Determine whether to receive unread text messages

 

3. receive, analyze the text message, and extract the PDU of the text message content.

 

4. Analyze the SMS content PDU

 

SMS Decoding
 
08 91 683104501905f0 04 0D 91 685158191026F4 00 08 217021811074 23 04 60A8597D (Hello)

1. SMSC
08 the length of the address information is 8 8 bytes (including 91)

91 Number in international format

Fill in 'f' for the 683127501905f0 address to generate an even number.

 

2. PDUType
04

 

3. OA reply address
0D number: a total of 13 decimal numbers (excluding 91 and 'F ')

91 international format

Add 'F' to the reply address of 685158191026F4 to generate an even number.

 

4. How does SMSC process SMSC?

00 protocol identifier (TP-PID) is a common GSM type, point-to-point method

 

5. encoding method

08 UCS2 Encoding

 

6. SMS time
217021811074 23 service timestamp (TP-SCTS) 12-07-12 18:01:47

7. Text message length

04

8. Text message content
60A8597D "hello"

 

Source code download: http://download.csdn.net/detail/wyz365889/4431313

 

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.