CDMA Cat really! @#¥#% (*, even the PDU is not supported, can only send text messages. And the Chinese text message is actually Unicode, can not be entered in the Super terminal. can only write programs.
Online This problem to talk about more, do up more tired, but also occasionally garbled. You might as well post the success code for C #.
Reprint please indicate the source
Copy Code code as follows:
void Sendchnsms (String content,string phone)
{
Chinese CDMA send, Unicode encoded byte
Byte[] B = Encoding.BigEndianUnicode.GetBytes (content);
CDMA at command phone number in front can not add 86, otherwise, although the display successfully sent, but the Message Center response error code 5
if (phone. IndexOf ("86") ==0)
{
Phone = phone. Substring (2);
}
Assuming it's a COM3 mouth.
SerialPort sp = new SerialPort ("COM3");
Unlike GSM cats, the baud rate is 115200, and this problem has been troubling for a long time saying
Sp. BaudRate = 115200;
Sp. Open ();
Set up Chinese SMS
Sp. Write ("at+wscl=6,4\r");
Thread.Sleep (500);
Set Text Format SMS
Sp. Write ("at+cmgf=1\r");
Thread.Sleep (500);
Set the number to send and the byte length of the Send content
Sp. Write ("at+cmgs=\" "+ Phone +" \ "," + B.length + "\ r");
Thread.Sleep (500);
Write
Sp. Write (b, 0, b.length);
Thread.Sleep (500);
Write Ctrl+z End SMS content, note that in Unicode mode requires two bytes, this is also unable to operate under HyperTerminal reason
byte[] B2 = new byte[] {0x00, 0x1a};
Sp. Write (B2, 0, B2. Length);
Sp. Close ();
}
"Original" CDMA cat with at command send Chinese text message (C #)