Huawei Cdma Modem, How can send sms via C# App OR AT command

689 views Asked by At

I've huawei EC156 cdma modem, I tried to send SMS via AT commands with many commands, But always received response "command not support".

I have used the following commands:

1- AT+CMGS

2- AT + GWWC Also, I didn't find any C# Libraries dealing with cdma modems.

1

There are 1 answers

7
Roberto Caboni On

You definitely need to check the AT commands user manual of your device and check their syntax.

AT+CMGS has two different modes:

  • in PDU mode its syntax is AT+CMGS=<PDU>
  • in text mode it is AT+CMGS=< dest phone number>

In both cases AT+CMGS is wrong, and operation not supported is the error you get for a wrong syntax (after setting verbose error mode with AT+CMEE=2).


There are plenty of questions showing the correct AT commands sequence required to send an SMS, for example this one.

I summarize that sequence here briefly:

Some things ti check before starting:

  1. Make sure that the SIM is inserted
  2. Make sure that the PIN code has been correctly inserted (by issuing AT+CPIN? you have to receive the READY response)
  3. Make sure that the device is correctly registered to the network (by issuing AT+CREG? you have to receive the +CREG: 0,1 response)

Then:

  1. Switch to text mode by issuing AT+CMGF=1
  2. Tell to the device the phone number you want send the SMS to, by issuing AT+CMGS=<PHONE NUMBER>. The device will output the > prompt character
  3. Write your text
  4. Close the SMS by providing the Ctrl-Z character (0x1A ASCII code)
  5. On success, the response +CMGS: <N> will be displayed, with N in the range 0-255 meaning the progressive ID of sent messages