My program needs to receive strings through the serialport.
Problem is that the program is stuck on ReadLine when there’s no input.
Is there a way to call the function startReading when a line is read by SP.ReadLine?
void GetInput()
{
SerialPort SP = new SerialPort();
SP.PortName = "COM3";
SP.Open();
string Line = string.Empty;
While(Line == "")
{
Line = SP.ReadLine();
Application.DoEvents();
}
StartReading();
}
void StartReading()
{
}
1 Answer