Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct
QSerialPort setting echo flags
matone1 last edited by
I am attempting to migrate to use QSerialPort for my serial device from termios calls. The existing code is
struct termios options;
options.c_cflag |= CS8 | CSTOPB | CREAD | CLOCAL;
options.c_lflag &= ~(ECHO | ECHOE);
tcsetattr(file, TCSANOW, &options);
and it works. For the QSerialPort, I can set all the options but the ECHO flags. The QSerialPort connects to the device but cannot read it. When I compare the stty settings, between the old code and the QSerialPort, the only difference is the ECHO settings.
Any idea how to set them? If I manually set them, QSerialPort rests them.
You can get the native handle with QSerialPort::handle and then modify its properties.
Hope it helps