Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

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

sms - Danish letters in AT command

I am trying to get my SMS gateway to send SMS using AT commands. I am connecting via SSH i a command prompt. I am a beginner to this, so please bear over with me. The following lines work:

DEV=/dev/ttyACM1
DESTNUM="PHONENUMER"
SMS="Test SMS from ?"
echo -e "ATZ
" >$DEV
echo -e "AT+CMGF=1
" >$DEV
echo -e "AT+CMGS="$DESTNUM"
" >$DEV
echo -e "$SMSx1A" >$DEV

So the above sends the sms correctly, but it does not include the dansih letter "?". Usually this is included in UTF-8.

How do I get my code working with the danish characters? Any ideas?

question from:https://stackoverflow.com/questions/65598708/danish-letters-in-at-command

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

1 Reply

0 votes
by (71.8m points)

By default, short messages are sent using GSM aplhabet (03.38), defined by 3GPP TS 23.038. This setting can be changed by issuing AT+CSMP command (Set Text Mode Parameters - I'll not examine it in depth in this answer).

More specifically, 7-bits aplhabet is used, so that the device can encode 8 characters in 7 bytes (8x7=56), saving "precious space" to send some more information.

This alphabet is a clever derivation from 7-bit ASCII. A set of codes used in ASCII for "useless" characters (especially control characters) are instead used to add specific characters from alphabet such as Danish:

Danish Character GSM 03.38 code
? x0B
? x0C
? x0D
? x0F
? x1C
? x1D

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...