4

Is there a class for AT communication with devices? Like a class which encapsulates AT commands into a .NET interface?

It needs to be also able to parse AT responses such as Network Lists.

Example : +COPS=? returns a list of carriers and it would take some pretty complex regex to actually parse it. Instead of writing my own lib I want to use a premade one.

AT Commands I am refereeing to are these : http://en.wikipedia.org/wiki/Hayes_command_set

Kristina
  • 15,859
  • 29
  • 111
  • 181

2 Answers2

6

Try this one: GSM Communication Library. Apart from built in commands it allows you to send any command you need.

Giorgi
  • 30,270
  • 13
  • 89
  • 125
-1

I hope this also help you. This is c# code to send AT commands to your com port device (mobile phone, etc) This can be used to send sms, etc

//Send SMS
SerialPort serialPort = new SerialPort();
serialPort.BaudRate = 56700;
serialPort.PortName = "COM3";
serialPort.Open();
serialPort.WriteLine("AT+CMGF=1" + Environment.NewLine);//Set Message Format
serialPort.WriteLine("AT+CMGS=" + PhoneNumber + (char)(26));
serialPort.WriteLine(MyMessage + System.Environment.NewLine);
serialPort.Close();
Prasanna
  • 4,583
  • 2
  • 22
  • 29
  • 2
    No, no, no! Please do not process AT commands in this way. You **MUST** wait for the final result code (e.g. OK, ERROR, ...) before sending the next command. And specifically for AT+CMGS you **MUST** wait for the modem to send "\n\r> " before you should start sending MyMessage. See this answer for more details, http://stackoverflow.com/a/15591673/23118. – hlovdal Mar 25 '13 at 10:25