mardi 22 mars 2016

Wait on COM receive event and console input event in Windows API

I'm an intermediate C++ programmer, but I'm new to using Windows' API functions.

I'm trying to create a console program that will sit/sleep until either

  1. The user inputs something in the console and presses enter
  2. Serial data is received on a COM port that's already been opened

Searching around, it sounds like the way to do this in Windows is with Events, (which sound like they're the same basic idea as interrupts?)

I found documentation on the WaitCommEvent, and I've read about reading console input buffer events. I'm guessing the function to use is WaitForMultipleObjects, but what handles specifically do I send it so it will wait for both a COM RX event or a console standard input event?



Wait on COM receive event and console input event in Windows API

Aucun commentaire:

Enregistrer un commentaire