how to do event based serial port reading in c?
- by moon
i want to read serial port when there is some data present i mean on the event when data arrives only then i will read serial port instead of continuously reading the port i have this code for continuous reading the port how can i make it event based.
thanx in advance.
while(1)
{
bReadRC = ReadFile(m_hCom, &byte, 6, &iBytesRead, NULL);
printf("Data Recieved Through Serial port and no. of Bytes Recieved is %d",iBytesRead);
}