qbytearray

QSerialPort readLine() extremely slow compared to readAll()

倾然丶 夕夏残阳落幕 提交于 2019-11-28 09:24:11
The data I'm reading from a serialport (in Qt, using QtSerialPort/QSerialPort) is separated by the newline '\n' and return '\r' characters, which is the way I intend to look at it for parsing. The line length may very, but it is very easy to extract the data from the format of each line. //signal/slot connection on readyRead() is as follows: connect(serial, SIGNAL(readyRead()), this, SLOT(readData())); where readData() is defined as: void MainWindow::readData() { //As mentioned below, which I will reiterate, I have already tried the addition of // canReadLine(): if (serial->canReadLine()){

QSerialPort readLine() extremely slow compared to readAll()

。_饼干妹妹 提交于 2019-11-27 02:52:55
问题 The data I'm reading from a serialport (in Qt, using QtSerialPort/QSerialPort) is separated by the newline '\n' and return '\r' characters, which is the way I intend to look at it for parsing. The line length may very, but it is very easy to extract the data from the format of each line. //signal/slot connection on readyRead() is as follows: connect(serial, SIGNAL(readyRead()), this, SLOT(readData())); where readData() is defined as: void MainWindow::readData() { //As mentioned below, which I