发送长短信时出错
我正在做一个很长的短信项目,但遇到了一些问题。我可以将 2 条短信作为一条长消息发送,但显示的文本似乎不正确。我知道 A0 处有一个错误,指示 160 个单词,因此短信有一个 @ 单词填充了所有空白。但我的意思是实际上短信文本已损坏。
我发送的2条短信:
AT+CMGS=28
0041000A9156186651270000A0050003000201E8F71D14969741F9771D
AT+CMGS=23
0041010A9156186651270000A0050003000202E8329BFD06
I am doing a long SMS project but I have encountered some problems. I am able to send 2 SMS messages as one long message, but the text that appears doesn't seem to be right. I know there is an error at A0 indicating a 160 word so the SMS has a @ word filling all the empty space. But what I mean is the actually SMS text is corrupted.
The 2 SMS I send:
AT+CMGS=28
0041000A9156186651270000A0050003000201E8F71D14969741F9771D
AT+CMGS=23
0041010A9156186651270000A0050003000202E8329BFD06
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
据我所知,PDU 编码错误。对于串联的 SMS,您必须包含 UDH(因此您还需要在 SMS 标头八位字节中设置标志以表明包含 UDH)。当然,还要确保消息文本从七字节边界开始。
网上有一些教程:
http://www.dreamfabric.com/sms/
其中以非常容易理解的方式更详细地解释事情。我建议您查看一下它们并检查您对消息进行编码的方式。
From what I can see the PDU is wrongly encoded. With concatenated SMS's you must include the UDH (so you also need to set in the SMS header octet the flag to say a UDH is included). And of course ensure that the message text starts on a septet boundary.
There are a few tutorials on the web:
http://www.dreamfabric.com/sms/
Which explain things in more detail and also in a very understandable way. I suggest you take at look a them and check the way you are encoding your messages.