Unsolved QSerialPort Screen 4D system
-
Hi everybody,
I bought a screen from 4D system (uLCD-24PTU)
I want use QSerialPort to comminucate with this screen but I have some trouble with byte read.
Normaly I would read for some action [07 1E 00 00 00 19]
but when I read in slot :
void MainWindow::readData() { qDebug() << "---------------------------"; QByteArray data = screen->readAll(); qDebug() << data << data.size(); }
Sometime I have the corret response in on time.
"\x07\x1E\x00\x00\x00\x19" 6
But sometime, in two time
"\x07\x1E" 2
"\x00\x00\x00\x19" 4
How can have reply in one time ? ("\x07\x1E\x00\x00\x00\x19" 6)
Thanks
-
@Franckynos I don't think you can. Use http://doc.qt.io/qt-5/qiodevice.html#readyRead signal to read in a buffer until you got what you need. readAll() just returns what currently is there.