diff options
author | Denis Shienkov <denis.shienkov@gmail.com> | 2013-04-19 19:10:38 +0400 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2013-04-24 18:45:20 +0200 |
commit | 7da0c605d565a3634a6e3f32b73dcf1f57681340 (patch) | |
tree | 87f7a57083fc711898dcbb0dd1c825ca1633d14e | |
parent | 5cca18d3c02869411a92011a76f5b05deba1ffc2 (diff) | |
download | qtserialport-7da0c605d565a3634a6e3f32b73dcf1f57681340.tar.gz |
Workaround for fix sending of data for WinCE platform
The commit
* sha1: 544f927c3724344d01d45d19151d236c143f8c83
entered regression of implementation of data writing to the
serial port.
Regression is that after data writing to the internal ring
buffer of a class these data really aren't transferred to
the serial port and remain in this buffer because no event
EV_TXEMPTY triggered. This event will occur only after the
serial port will transfer at least one byte of data and the
FIFO buffer of the driver becomes the free for transmission
of the next portion of data from ring buffer of class.
Thus the simplest decision is the forced call of WriteFile()
of function after each addition of the internal ring buffer
to trigger EV_TXEMPTY sequence. In this case we launch
WriteFile() implicitly through the notifyWrite() method with
the WriteChunkSize parameter (instead of one byte) to optimize
transmission for speed (theoretically).
WARNING: This decision is just a workaround and not a real fix,
shall be decided in the future in more correct and effective
way.
Tested for target:
"-platform win32-msvc2005 -xplatform wincewm50pocket-msvc2005"
on standard Pocket PC WM5.0 Device Emulator.
Task-number: QTPLAYGROUND-13
Change-Id: I4b3a36fa064dee92406a7511eb2b98b2a55e5315
Reviewed-by: Laszlo Papp <lpapp@kde.org>
-rw-r--r-- | src/serialport/qserialport_wince.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/serialport/qserialport_wince.cpp b/src/serialport/qserialport_wince.cpp index 07e3c67..78d2746 100644 --- a/src/serialport/qserialport_wince.cpp +++ b/src/serialport/qserialport_wince.cpp @@ -286,6 +286,9 @@ qint64 QSerialPortPrivate::writeToBuffer(const char *data, qint64 maxSize) else ::memcpy(ptr, data, maxSize); + // trigger write sequence + notifyWrite(QSerialPortPrivateData::WriteChunkSize); + return maxSize; } |