Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
468 views
in Technique[技术] by (71.8m points)

java - GSM Modem Send Message in UCS2 format error

I'm using java to communicate with a gsm modem (Siemens) using AT commands.
I set the encoding of modem to "UCS2".
When sending messages as soon as I send the phone number I get ERROR from the device:

AT+CSCS=UCS2
OK

AT+CSMP=17,167,0,8
OK

AT+CMGF=1
OK

AT+CMGS="0919xxxxxxx"
ERROR

HELP ME, PLEEEEEEASE! :(

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

I think you are encoding the <da> address argument to AT+CMGS incorrectly.

You refer to 91 and 92 style, but are you actually referring to the '81'/'82' format as explained in the Coding of Alpha fields in the SIM for UCS2 blog post about encoding as specified in 3GPP TS 11.11?

After you run AT+CSCS="UCS2" every single string must be encoded that way, so for instance to switch from UCS2 to UTF-8 would be AT+CSCS="005500540046002D0038".

Alpha fields with 80/81/82 encoding only applies to some cases, and not UCS2 encoded strings in general. In particular notice that the encoding of the string "UTF-8" in the above AT+CSCS command has nothing to do with this. That also applies to the <da> argument to AT+CMGS.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

2.1m questions

2.1m answers

60 comments

56.9k users

...