de-vri-es / serial2-rs

Cross platform serial ports for Rust
Other
48 stars 11 forks source link

Set `IGNBRK` and `IGNPAR` for `termios.c_iflag` #23

Closed Tnze closed 8 months ago

Tnze commented 8 months ago

It's required to set both parity and break indicators to be ignored to enter the "real raw mode". Otherwise the tty would insert \0s in the received data when UART is overrun. Which causes problems.

We should add an API to ignore break indicators.

de-vri-es commented 8 months ago

Good point. For now I'll atleast make sure that Settings::set_raw() set these flags.

Thanks for reporting it!

de-vri-es commented 8 months ago

Fixed in 0.2.17. Thanks!

For now, if someone actually wants to receive parity errors or break conditions in the data stream, they will have to use as_termios_mut().

Tnze commented 8 months ago

Thank you