summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorDenis Shienkov <denis.shienkov@gmail.com>2014-07-19 19:25:19 +0400
committerDenis Shienkov <denis.shienkov@gmail.com>2014-10-06 15:40:02 +0200
commit62dfdeb3642250bdb642dbf607a8c7b95e57835e (patch)
treea38ae8ded5ffcfd0fbe2541dcfa6ba1301e9268a /tests
parentd9a29ff7cc479e8a9e6d418de6408866f0dce4b6 (diff)
downloadqtserialport-62dfdeb3642250bdb642dbf607a8c7b95e57835e.tar.gz
Fix QSP::bytesToWrite() on Windows
After calling the WriteFile() function, QSP::bytesToWrite() should return zero, but did return the size of writeBuffer. On Windows, we must not to cut a size of the writeBuffer until the asynchronous write operation has completed. So we need to make use of an additional actualBytesToWrite variable, the value of which is increased when new data is added to the writeBuffer, and decreased after calling the WriteFile() function. This change also entails the modification of the QSP::writeData() method and deleting the QSP::startWriting() method. Now all platform-dependent code (related to startWriting(), and to copying of memory to writeBuffer) resides in the new QSP::writeData() method. But this modification does not change the behavior on platforms other than Windows. Tested on Windows with the virtual com0com serial ports using Qt5. Change-Id: I35c1428ad374c0709d6c352a93c552898e947bde Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com> Reviewed-by: Sergey Belyashov <Sergey.Belyashov@gmail.com>
Diffstat (limited to 'tests')
0 files changed, 0 insertions, 0 deletions