Frage

I am setting up a communication with several devices via a COM port.

For the sake of presence check, I would like to implement that a present device can set a so-called BREAK condition on its UART TX. (A break condition is a condition where the sender sets its TX to low for more than 8 bits.)

But how can I detect this condition on the PC side under Windows? I have found some functions to set a break condition, or to send a timed break, but not for detecting one.

War es hilfreich?

Lösung

A break is an interrupt kind of event, it should only be used to reset communication in progress. So you'll get it from WaitCommEvent, EV_BREAK event bit.

Favor the handshake signals for a "presence" test. GetCommModemStatus, MS_DSR_ON tells you that the device is powered-up, MS_CTS_ON tells you that it is willing to receive data.

Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top