title: Receive SMS through GSM modem
body: <p>I saw that similar topics were posted on this forum, but I simply don't understand how to send AT commands and receive a response. (I started to program in C# several months ago. I'm still an n00b, but I'm working hard to learn it...). </p>
  
  <p>I need to create application which would only receive SMS message through GSM USB dongle. So far I managed to create app that will recognize and connect modem through COM ports that is available. Now I need to push AT commands for receiving messages and displaying them into a textBox. I was wondering if anyone can spare few minutes to explain the process to me, and modify my code with comments so I can finally learn and understand how to use serialPort for communication. What I need to know, when SMS is sent, does this message is received and stored by GSM modem (and it is stored until I send some requests to read them or do I need to send some event that would trigger GSM modem to collect message from ISP)? how to push AT commands and receive their response (I only know that is done by using serialPort object, but doesn't have clue how to do it...)</p>
  
  <p>This is my method for receiving (which I'm stuck BTW... :))</p>
  
  <pre><code>private void receiveMessage()
  {
      //commclass is only a class for getting COM port, baud rate and timeout
      CommClass cc = new CommClass();
      cc.setParameters();
      serialPort1.PortName = cc.getPort();
      serialPort1.BaudRate = cc.getBaud();
      serialPort1.ReadTimeout = cc.getTimeout();
      serialPort1.Open();
  
      if (!serialPort1.IsOpen)
      {
          //MessageBox is written in Croatian language, it is only an alert to check the configuration because port is not opened...
          MessageBox.Show("Modem nije spojen, molimo provjerite konfiguraciju...!");
          //timer1.Stop();
      }
      else
      {
          //this.label2.Text = serialPort1.PortName;
          //this.label2.Visible = true;
          //this.label3.Visible = true;
          //this is where I need to place a code for receiving all SMS messages
          this.serialPort1.Write("AT+CMGL=\"REC UNREAD\"");
      }
      serialPort1.Close();
  }
  </code></pre>
  
  <p>If anyone willing to help, I would appreciate that, if not I would have to deal with it by my self (probably spent few hours/days until I figure it out...)</p>
  
  <p>In both cases, thank you anyway... Cheers.</p>