2

I need to send SMS via my USB dongle, and this is possible through AT Commands. But, I have no idea about how to pass AT commands to the dongle. Internet has no help as well. How can I pass AT commands to the dongle with a simple code snippet?

halfer
  • 19,824
  • 17
  • 99
  • 186
PeakGen
  • 21,894
  • 86
  • 261
  • 463

1 Answers1

4

Most USB dongles will show up as a serial port on your PC. You can thus connect with a terminal program to the appropriate COM port and send AT commands. Sending an SMS usually works like this, pressing enter after each line:

AT+CFUN=1             --> Full functionality
AT+CMGF=1             --> Text mode SMS
AT+CMGS="+12345678"   --> Phone number
> text goes here      --> your SMS text
ctrl-z                -->  end sequence, 0x1A in hex

Programatically from Qt or other languages you would just open a serial connection to the appropriate port and send a sequence like this.

Also, keep in mind that not all USB dongles support this.

PurpleAlien
  • 886
  • 6
  • 7
  • Notice that not all phones supports text mode, and if not you have to use PDU mode, see http://www.3gpp.org/ftp/Specs/html-info/27005.htm for details. – hlovdal May 05 '13 at 11:19
  • Thanks a lot for the reply. But, how can I write these commands? – PeakGen May 05 '13 at 16:30
  • Either just type them in using a terminal program like Putty, or programatically use a serial port communication class like qextserialport when using Qt. – PurpleAlien May 05 '13 at 16:33