summaryrefslogtreecommitdiffstats
path: root/src/serialport/qserialport_unix_p.h
diff options
context:
space:
mode:
authorDenis Shienkov <denis.shienkov@gmail.com>2014-09-29 18:44:36 +0400
committerDenis Shienkov <denis.shienkov@gmail.com>2014-10-02 09:21:53 +0200
commitac0422e8c9e74f2275129e3c7c69ef64299f07a9 (patch)
tree5196d564d75318db03e399308c9893e6d480d4c1 /src/serialport/qserialport_unix_p.h
parent26d61928f5a50c74f843cd88276c5b18e1bed375 (diff)
Fix reading on Windows at limited read buffer size
In case the read buffer has a limited size then are impossible to read remainder which is still can be in driver's queue, since no readyRead signal emmitted and reading are stalled. Problem is that Windows does not fire the EV_RXCHAR event in case a driver's queue has ready to read remainder; this event will be triggered only when a new data are received. The solution is to start of asynchronous read operation for reading of possible remainder from the queue after doing QSP::read() from the user. Besides is necessary to meet conditions: - do not start reading in case a reading already is started - do not start reading in case is not in limited buffer size - do not start reading in case is a previous reading returns a less data than read buffer size or are not in the hardware flow control mode Tested on Windows 8 with virtual com0com serial ports using Qt5 and then Qt4. Task-number: QTBUG-41295 Change-Id: I01797e6f8d6006751244144fead3616b1de1b811 Reviewed-by: Robert Kurjata <rkurjata@gmail.com> Reviewed-by: Sergey Belyashov <Sergey.Belyashov@gmail.com>
Diffstat (limited to 'src/serialport/qserialport_unix_p.h')
-rw-r--r--src/serialport/qserialport_unix_p.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/serialport/qserialport_unix_p.h b/src/serialport/qserialport_unix_p.h
index 1213c30a..408fdc50 100644
--- a/src/serialport/qserialport_unix_p.h
+++ b/src/serialport/qserialport_unix_p.h
@@ -120,6 +120,7 @@ public:
bool setBreakEnabled(bool set);
void startWriting();
+ qint64 readData(char *data, qint64 maxSize);
bool waitForReadyRead(int msecs);
bool waitForBytesWritten(int msecs);