Unsolved Qt Serial Port Read
-
Hi I am trying to read data from the serial port using QT serial port class and using the read method of this class. But not able to read anything over the serial port.
Can anyone please help me what is the correct sequence or configuration needed to read from the serial port?
I checked the serial port write part and verified with the serial port tools like hyper terminal/tera term and its happening properly
Please let me know where is the gap or I am missing in QT Serial port read?
Thanks in advance
Ayush -
Hi,
You should use the readyRead signal to get notified when something has arrived on the serial port and then read it.
If you need blocking behavior (WARNING it will freeze your UI) you have an example in the documentation of QSerialPort.
-
hi
If i may suggest the
http://doc.qt.io/qt-5/qtserialport-terminal-example.html
is s good starting point as it has a config dialog for setting up serial parameters.
Its available directly in the Creator -