I have a program that opens a serial port using boost asio.
The serial port defaults to a delay that supports idle lines. On Windows platforms, I saw a delay of 30 ms, and on Linux platforms, the delay was 20 ms.
On Linux, I found that the ioctl class from linux.h has a way to set sequential settings using some flags (and what I need: low_latency).
The code is as follows:
boost::asio::basic_serial_port<boost::asio::serial_port_service>::native_type native = serial_port_.native();
struct serial_struct serial;
ioctl(native, TIOCGSERIAL, &serial);
serial.flags |= ASYNC_LOW_LATENCY;
ioctl(native, TIOCSSERIAL, &serial);
I want to reduce latency on my windows platform. Is there an equivalent way that does the same for Windows with C ++?
By the way, I saw that there are some solutions that offer changing the serial port properties in the Windows device manager, but I do not have these properties, as these solutions showed, and I need a solution for the code.
source
share