Monday, September 29, 2025
1 change · 17.0
Enhancements to existing features
Belgian POS fiscal blackbox devices are now read more efficiently to avoid delays caused by repeated serial port timeouts. The update also improves device detection and buffer handling, reducing the risk that a blackbox is mistaken for another connected device.
Original PR description
This commit is a backport of some parts of odoo/enterprise#93614. The goal is to ensure that we don't read too many different times from the serial port, as each read has a timeout of 3 seconds: if 2 read fail, we exceed the longpolling's timeout. We then backport the `read_until(char)` instead of `read(n)` allowing us to read not more than once (except for the lrc, which is read only if first read is successful). We also backport the supported retry, which ensures we detect a blackbox when we plug one (prevent detecting it as an Adam Scale), and correctly flush buffers after writing/reading. Task: 5116854