2

I'm using C# to command a GSM/GPRS modem via a serial port.

Can I write the commands to the port one after another without a gap or should I wait for the response form the modem after the last command? Using something like Thread.Sleep.

I use it to send SMS to multiple phone numbers.

=======

  • **Yes**, you should absolutely [wait for the response](https://stackoverflow.com/a/43261913/23118) before sending the next command line. **No**, you should absolutely [never use Thread.Sleep](https://stackoverflow.com/a/46064206/23118). – hlovdal Nov 30 '17 at 22:56
  • I disagree with closing as *too broad* because that is absolutely not true. The question asked is 100% answerable (shortly done in the comment above). For someone inexperienced with AT commands this is a good question to ask instead of just taking for granted that one of the many horrible examples on internet that uses sleeping instead of reading and parsing the response as a valid way of doing things. – hlovdal Nov 30 '17 at 23:01

0 Answers0