This article was reproduced from: http://blog.csdn.net/hanmengaidudu/article/details/17099749
I. Send text message in text format
Send text text message to Unicom:
~: Microcom-s 115200/DEV/TTYUSB1
At
Ok
Set the SMS format to text mode:
At+cmgf=1
Ok
At+cmgs= "+861300711****"
Enter what is sent:
> Hello (press CTRL + Z to send after content is finished)
+cmgs:48
Ok
SMS Text Format for telecom:
~: Microcom-s 115200/DEV/TTYUSB1
At
Ok
Set the SMS format to text mode:
At+cmgf=1
Ok
At+cmgs= "+861532736****"
Set the SMS format to text mode:
> Hello (press CTRL + Z to send after content is finished)
+cmgs:48
Second, send the PDU format SMS
Receiving Number: +8613007110996
SMS content: Happy work!
Wuhan Center number: +8613800270500
1, SMS Center number processing: using string addr representation
A, remove the short information Center number + number to see if the length is even, if not, finally add F
i.e. addr = "+8613800100500"
= = Addr = "8613800270500F"
b, the odd bit and the even digit exchange.
= = Addr = "683108200705f0"
C, add the short Message center number in front of the character 91,91 is the meaning of internationalization
= = Addr = "91683108200705f0"
D, calculate the addr length, results in addition to 2, formatted into a 2-bit 16 binary string, 16/2 = 8 "08", and put in front of addr.
= = Addr = "0891683108200705f0"
2, mobile phone number processing: with the string phone
A, remove the phone number + number, to see if the length is even, if not, finally add F
That is, phone = "+8613007110996"
+ Phone = "8613007110996F"
b, the mobile phone number odd digits and even digits exchange.
+ Phone = "683100170199f6"
3, SMS part processing: With the string msg expression
A, convert the string to Unicode code, the conversion method is:
Download a Chinese character Unicode encoding converter when the input "happy to work!" "When
Converted to decimal 24037 20316 24841 24555 65281, then using the calculator five a conversion, such as 24037 conversion to 16 5de5,
The final hexadecimal connection is 5de54f5c61095febff01 (the conversion is implemented in Linux using the Iconv function. )
B, the msg length in addition to 2, the two-bit 16 binary number, which is 5de54f5c61095febff01 = 20/2 + "0A", plus msg
= msg = "0a5de54 F5c61095febff01 "
4, combo
A, cell phone number preceded by a string 11000d91 (1100: Fixed, 0D: the length of the mobile phone number, not counting +, hexadecimal, 91: sent to the phone for 91, sent to the PHS 81)
phone = "11000d91" + phone
+ 11000d91683100170199f6
B, mobile phone number plus 000800 and just short message content And 000800 is dead.
phone = phone + "000800" + msg
11000D91683100170199F6 + 000800 + 0a5d E54F5C61095FEBFF01
= phone = 11000d91683109423346f90008000a5de54f5c61095febff01
C, phone length divided by 2, Decimal number formatted as 2 bits
= 11000D91683100170199F60008000A5DE54F5C61095FEBFF01 = 50 bits/2 =
5, Note = Addr+phone ==> 0891683108200705f011000d91683100170199f60008000a5de54f5c61095febff01
5, So the content to be sent is
Send: at
: OK
Send: at+cmgf=0
Close: OK
Send: at+cmgs=25
receive:;
Post: note---> //"--- > "for sender (Ctrl + Z, Hex 0x1a)
Received: +cmgs:50
Ok
6, if the return is not error, congratulations, sent successfully. If you return +cms error:304, there is a problem with the format, check it out.
Arm+llinux System transplant 3G Dial-up Internet SMS (ii) "Turn"