how to do event based serial port reading in c?
Posted
by moon
on Stack Overflow
See other posts from Stack Overflow
or by moon
Published on 2010-06-01T09:30:03Z
Indexed on
2010/06/01
9:33 UTC
Read the original article
Hit count: 149
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);
}
© Stack Overflow or respective owner