Link to home
Start Free TrialLog in
Avatar of bandi081497
bandi081497

asked on

Handling COM port under NT service

Hi All,

I've got a big problem. I wrote a service under WINNT which      
asks the SERIAL Port, and put the characters into a file.
The problem is, I don't know when is data in the input buffer. My program contains a loop which never ends and the CP usage is nearly 100%. As far as I know, the sender sends a signal which indicates that the data is valid. How can I mask it?
Is there any solution?

Thanks in advance

ANdrew
Avatar of altena
altena

Remove the loop, check out the "WaitCommEvent" function
in the Win32 Help/documentation.

You can have the OS "wake your progam" whenever something
interesting happens at the COMM port.
ASKER CERTIFIED SOLUTION
Avatar of ZifNab
ZifNab

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial