如何使用 AT 命令从 GSM 设备发送 Unicode 消息

How to send Unicode message from a GSM device using AT command

我有一个使用 C# .Net 的现有桌面应用程序,用于使用 GSM device/modem 发送和接收消息。一切正常,但现在我遇到了一些问题:

1 - 我不能在一条消息中发送超过 160 个字符。

2 - 我无法发送 Unicode 消息(我的语言是孟加拉语)。我已经尝试转换为十六进制,但它正在发送另一种语言。

这是我目前尝试过的方法:

port.WriteLine("AT+CSCS=\"UCS2\"\n");
Thread.Sleep(100);
port.WriteLine("AT+CMGF=1"+Environment.NewLine);
Thread.Sleep(100);
port.WriteLine("AT+CMGS=\""+number+"\"");
Thread.Sleep(100);
port.WriteLine(message+char.ConvertFromUtf32(26)+Environment.NewLine);
Thread.Sleep(100);
port.Write(new byte[]{26},0,1);
Thread.Sleep(100);

首先,你应该! And for AT+CMGS you must also properly wait for the ready-to-receive-payload response from the modem, see the first part of this answer


关于短信大小,160 个字符是 GSM 网络的限制。可以发送 "virtually" 更大的消息,方法是拆分文本并发送多条消息,这些消息在接收手机 phone 上透明地串联在一起,这样看起来就像是一条消息。这叫做multi-part sms.

您不能在文本模式下发送多部分消息,您必须为此使用 PDU 模式。


在您 运行 AT+CSCS="UCS2" 之后,每个字符串 参数都必须以这种方式编码,包括 switching to a different character encoding with AT+CSCS。在您的情况下,这适用于 AT+CMGS.

<da> 参数