Search code examples
c#ajaxgsmmodemat-command

C# Listener to detect automactically new incoming SMS on GSM Modem using AT commands


I'm developing a web application using c# to send and receive SMS from GSM modem by using AT commands.

Sending and receiving is working fine. Receiving the SMS is working on button click event, but I want whenever new SMS comes program should show it automatically.


Solution

  • You didn't require any thread you just need define datarecieved event which will be automatically fired when ever new message arrives. and you can use it's handler to read message.

    You need to set

    serialport1.DtrEnablle = true;
    serialport1.RtsEnable = true;
    

    Considering you have enabled notifications using

    AT+CNMI=1
    AT&W