I have a device which sends serial data in packets. Each packet is separated by a serial break (a low level on the serial line which lasts longer than a character).
How can I detect a break using boost::asio::serial_port
? There is a send_break()
function, but I could not find information about receiving a break.
If I manually set the PARMRK
flag and clear the IGNBRK
and BRKINT
flags in c_iflag
using tcsetattr
, the Linux serial driver converts a break into a 0xff 0x00 0x00
sequence which I can detect. However, the data can also contain this sequence so it is not ideal.
Is there a better way to detect a serial break using boost::asio::serial_port
?