user3292311
user3292311

Reputation: 43

how to execute AT commands using c#

I want to know how to use AT+CLCC command in c# and how to monitor responses in a console ? I tried with following code. But I couldn't get progress.This is what I have tried so far.It doesn't give any response.

This is my code :

_serialPort.WriteLine("AT+CLCC");

string responce = "";
responce = responce + _serialPort.ReadLine();

Console.WriteLine("Check this......:" + responce);

how should i do it?

Upvotes: 1

Views: 479

Answers (1)

Bas
Bas

Reputation: 27085

I lost a couple of days on this a long time ago.

Use the DataReceived event to receive data from a serial port.

SerialPort.DataReceived Event

Upvotes: 2

Related Questions