qtserialport

QSerialPort is causing a program stop (endless loop?) if opening device

旧巷老猫 提交于 2019-12-01 05:51:59
问题 I want to write on a serial device. Unfortunately I have the feeling the QSerialPort is not properly implemented under linux. In contrast to other methods (python) I get !sometimes! a hang of the program when I try to call: serial.open(QIODevice::ReadWrite) I am using the example from http://qt-project.org/wiki/QtSerialPort (see below). The QSerialPortInfo is working properly so that I can search for my device before I open it. The problem appeared in all Qt 5.* series. I am currently using 5

qt-updating ui by thread

試著忘記壹切 提交于 2019-12-01 00:02:59
hi I have a problem with updating ui by a thread. code works correctly but the problem is when I want to move my window as you know in that moment ui thread will stop updating. and my thread sends values to stopped thread that causes error. I don't know how to fix this. here is my thread code header: #ifndef READERTHREAD_H #define READERTHREAD_H #include <QtSerialPort/QSerialPort> #include <QtSerialPort/QSerialPortInfo> #include <QThread> class readerThread : public QThread { Q_OBJECT public: explicit readerThread(QObject *parent = 0); void run(); bool stop = false; QByteArray port_input;

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