How to use AT-Command in C #

I tried to send commands to a GSM modem or C # phone using this code, but it does not work! Can anyone tell me what to do?

SerialPort sp = new SerialPort();
sp.PortName = "COM42";
sp.Open();
sp.Write("ATD09364191752");
+3
source share
2 answers
  • You do not write a new line after the ATD command. (I think you need to.)
  • You do not call sp.Flush(), so the command may get stuck in the buffer. Try adding this call after the call Write().
+3
source

You rely on all the default settings for messaging protocols, establishing communications, etc. You might want to check the modem documents.

+2
source

Source: https://habr.com/ru/post/1776121/


All Articles