GSM 调制解调器以 UCS2 格式发送消息错误 [英] GSM Modem Send Message in UCS2 format error
问题描述
我正在使用 Java 通过 AT 命令与 gsm 调制解调器(西门子)通信.
我将调制解调器的编码设置为UCS2".
发送电话号码后立即发送消息时,我从设备收到错误消息:
AT+CSCS=UCS2
好的
AT+CSMP=17,167,0,8
好的
AT+CMGF=1
好的
AT+CMGS="0919xxxxxxx"
错误
帮帮我,求求你了!:(
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! :(
推荐答案
我认为您将 <da>
地址参数编码为 AT+CMGS
不正确.
I think you are encoding the <da>
address argument to AT+CMGS
incorrectly.
您指的是 91 和 92 样式,但您实际上指的是 在 UCS2 的 SIM 卡中编码 Alpha 字段 博客文章关于3GPP TS 11.11?
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?
在您运行 AT+CSCS="UCS2"
后,每个字符串都必须以这种方式进行编码,因此例如从 UCS2 切换到 UTF-8 将是 AT+CSCS="005500540046002D0038"
.
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"
.
采用 80/81/82 编码的 Alpha 字段仅适用于某些情况,一般不适用于 UCS2 编码的字符串.特别注意上面AT+CSCS
命令中字符串UTF-8"的编码与此无关.这也适用于 AT+CMGS
的
参数.
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
.
这篇关于GSM 调制解调器以 UCS2 格式发送消息错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!