Details
-
Suggestion
-
Resolution: Invalid
-
Not Evaluated
-
None
-
5.1.0
-
None
-
Qt: 5.1.0 MinGW
OS: Windows XP SP3
Description
Initialization: ... QSerialPort sport; connect(&sport, SIGNAL(readyRead()), this, SLOT(portReadyRead())); connect(&sport, SIGNAL(error(QSerialPort::SerialPortError)), this, SLOT(portError(QSerialPort::SerialPortError))); cfg_portname = "COM1"; cfg_baudrete = QSerialPort::Baud9600; cfg_databits = QSerialPort::Data8; cfg_parity = QSerialPort::NoParity; cfg_stopbits = QSerialPort::OneStop; cfg_errorpolicy = QSerialPort::SkipPolicy; // <-- cfg_flowcontrol = QSerialPort::NoFlowControl; sport.setPortName(cfg_portname); sport.open(QIODevice::ReadWrite); sport.setBaudRate(cfg_baudrete); sport.setDataBits(cfg_databits); sport.setParity(cfg_parity); sport.setStopBits(cfg_stopbits); sport.setDataErrorPolicy(cfg_errorpolicy); sport.setFlowControl(cfg_flowcontrol); ... SLOT: void MbSerialPort::portReadyRead() { //data_recv.append(sport.readAll()); while (!sport.atEnd()) data_recv.append(sport.read(100)); emit devRecvPacket(data_recv); qDebug() << "INFO: MbSerialPort::portReadyRead() RECV: " << data_recv.toHex(); qDebug() << "INFO: error = " << sport.error() << " " << sport.errorString(); }
If set setDataErrorPolicy(QSerialPort::SkipPolicy) only one byte accesible to read and no reemmited readyRead().
( Next byte of first packet can be read when second packet receiving (or any activity on Rx-line )
I belive this is related with:
qserialport_win.cpp: /line 630/ bool QSerialPortPrivate::startAsyncRead() { DWORD bytesToRead = policy == QSerialPort::IgnorePolicy ? ReadChunkSize : 1; ... }
And no attemts to read next bytes before system event.
No system events before activity on RxD.
And bytesAvailable() returns 0 too.
Attachments
For Gerrit Dashboard: QTBUG-33076 | ||||||
---|---|---|---|---|---|---|
# | Subject | Branch | Project | Status | CR | V |
64821,1 | WIP: Windows: Refactor of handling of policies for received data | stable | qt/qtserialport | Status: ABANDONED | 0 | 0 |