Thread: Polling serial ports

  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, 03:52 PM
  5. Serial Ports
    By camposv in forum C Programming
    Replies: 2
    Last Post: 01-30-2002, 12:18 PM