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
452 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?


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

1 Answer

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

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

...