Polling serial ports

This is a discussion on Polling serial ports within the Windows Programming forums, part of the Platform Specific Boards category; Well, what i want to do is a simple routine that polls a port every 10ms for [timeout] seconds. This ...

  1. #1
    Registered User
    Join Date
    Sep 2001
    Posts
    3

    Thumbs down Polling serial ports

    Well, what i want to do is a simple routine that polls a port every 10ms for [timeout] seconds.
    This is under CE btw. but it shouldn't make a difference.

    Looked around and found a function-call, called GetCommMask(), and thought to myself that i could just call that and check for the EV_RXCHAR bit of the mask.
    Well, thing is, this function seems to just set mask to zero, or to whatever you have set using SetCommMask().

    Looked around some more, and found a function called WaitForCommEvent, nice, well, this function does never timeout?!?!

    So this was no good, read the stuff at MSDN, found out some way that you could make WaitCommEvent() return directly and just set the mask if it's ?OverLapped?, but that parameter doesn't seem to be valid for CE at least, haven't checked with an ordinary windows.

    Now is there anyway way to accomplish this?
    Last edited by Nevyn; 06-10-2002 at 06:21 AM.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Replies: 13
    Last Post: 06-24-2008, 01:59 AM
  2. Polling serial ports
    By Nevyn in forum Windows Programming
    Replies: 3
    Last Post: 06-12-2002, 03:02 AM
  3. Need a hand accessing the serial ports
    By Danwood13 in forum C++ Programming
    Replies: 3
    Last Post: 04-24-2002, 10:03 AM
  4. Serial Ports
    By SavesTheDay in forum C Programming
    Replies: 4
    Last Post: 02-04-2002, 02:52 PM
  5. Serial Ports
    By camposv in forum C Programming
    Replies: 2
    Last Post: 01-30-2002, 11:18 AM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21