summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
...
* Mark the signal QSP::dataErrorPolicyChanged() as deprecatedDenis Shienkov2015-05-121-1/+3
| | | | | | | | | This was missed since Qt 5.2. (cherry-picked from 05673348c71a967da09b4d26274a447d00ff16c4) Task-number: QTBUG-46066 Change-Id: I105728382a682def9bbecbf1e33d28bfff00a6e9 Reviewed-by: Denis Shienkov <denis.shienkov@gmail.com>
* Remove the QT_VERSION_CHECK(5, 0, 0) macroDenis Shienkov2015-04-204-30/+0
| | | | | | | | ... since current branch supports only Qt4. Change-Id: Idf7de463bf28ff046f4d4356ef1b50009740a82a Reviewed-by: Sergey Belyashov <Sergey.Belyashov@gmail.com> Reviewed-by: Denis Shienkov <denis.shienkov@gmail.com>
* Cleanup an error string when QSP::clearError() is calledDenis Shienkov2015-04-201-1/+1
| | | | | | | | | | | | | | QSP::clearError() calls setError() with an empty error string. But setError() anyway calls the qt_error_string() that sets an error string from an system error which occurred before, that is garbage in this case. Thus, we need to call qt_error_string() only if the input QSP::SerialPortError is not NoError. (cherry-picked from 6ae78369d1156e653df6a2e539230a89cf963b00) Change-Id: I949f30ca8bf260c8884e819524909fd6cd32ad5e Reviewed-by: Denis Shienkov <denis.shienkov@gmail.com>
* Remove unused readyReadEmitted variableDenis Shienkov2015-04-202-4/+0
| | | | | | (cherry-picked from 9a9aed53e1e23200d471ced91a83fbca9976f231) Change-Id: Ia1c15507ffa7135ffae0d8776c45746b454633cd Reviewed-by: Denis Shienkov <denis.shienkov@gmail.com>
* Add additional lock directories for *nix-specific platformsDenis Shienkov2015-04-201-0/+3
| | | | | | (cherry-picked from 03629b992766fe30ad148ccdf732e0aa1ec0171e) Change-Id: I03a32923f773a55304f47a58d4b709e880bf3a5e Reviewed-by: Denis Shienkov <denis.shienkov@gmail.com>
* Don't use QStringLiteral when QLatin1String is efficient.Debao Zhang2015-04-204-19/+19
| | | | | | | | | For QLatin1String, startsWith/endsWith/append/operator==/... are overloaded, so use QLatin1String instead of QStringLiteral in such cases. (cherry-picked from 7f857db22e0d409aac65e4773bb377796893b624) Change-Id: I92b0a2597f935acb4310c8d717a46b537308ecd9 Reviewed-by: Denis Shienkov <denis.shienkov@gmail.com>
* Fix warning about constructing a QString from ASCII.Friedemann Kleint2015-04-201-1/+1
| | | | | | (cherry-picked from 801198fab9f6e29b1cd56a8820606f616e3d256e) Change-Id: I814992c07273b9aa55d2eb0a02dffc46b60a9842 Reviewed-by: Denis Shienkov <denis.shienkov@gmail.com>
* Fix QSPI::portName() on OSXDenis Shienkov2015-03-141-9/+4
| | | | | | | | | | | | | | | | | | The commit ab51ad6a5f4e533c31bd8e5b6f16a3bcd09a3ee6 changes a behavior of conversion from a device location to a device name and vice-versa. Now it is expected that the location as "/dev/cu.serial1" will be converted to the "cu.serial1" name and vice-versa. But currently the QSPI on OSX returns the name of device as "serial1" instead of "cu.serial1", that lead to failure of QSP::open() method. The reason is that a device name is queried from the dictionary with the "kIOTTYDeviceKey" key, which always returns a right part of name from a dot. Thus, we need to use QSPI::portNameFromSystemLocation() method instead. (cherry-picked from 3db7c8ac2484c5e5eb10150b87a9c4d81d20b51d) Change-Id: Id7dfb2476c4a52a4c320c64588341fe6d0a5fa7d Reviewed-by: Denis Shienkov <denis.shienkov@gmail.com>
* Make QSP::timeoutValue() as staticDenis Shienkov2015-03-121-1/+1
| | | | | | (cherry-picked from e19945cdd347bf2aaef9f0552f6bea7a706030ad) Change-Id: I9f11be6f1de66af70e84a00943d8cc75909e4956 Reviewed-by: Denis Shienkov <denis.shienkov@gmail.com>
* Get rid of C-style's SERIALPORT_BUFFERSIZE macroDenis Shienkov2015-03-122-7/+4
| | | | | | | | It is reasonable make it as enum and part of QSP class. (cherry-picked from ae7cd02d1c5b9d3f659a3a2430f47c8fa41672b7) Change-Id: I13d4561568b2688f7d1a054073455c23a64c1b94 Reviewed-by: Denis Shienkov <denis.shienkov@gmail.com>
* Unix: Clear serial_struct instancesJonathan Liu2015-03-111-0/+4
| | | | | | | | | Silences the following Valgrind warning: Conditional jump or move depends on uninitialised value(s) (cherry-picked from 53afe73154c7c00b54cd280fa3d6c9127a2bc84b) Change-Id: I8fd8cfd6aa6f75ed515e6151cfc282faca508bdc Reviewed-by: Denis Shienkov <denis.shienkov@gmail.com>
* Update the licenses and its headersDenis Shienkov2015-02-1777-1470/+1651
| | | | | | | | | | | As this branch is intended for support of Qt4, then expediently to revert the license headers with the same content as in the current Qt4. Besides, are removed the licenses as GPLv2(2.1, 3) as they aren't present in sources of current Qt4. Change-Id: I8bda62ef5f95f362053ad77f5b1666df27795254 Reviewed-by: Sergey Belyashov <Sergey.Belyashov@gmail.com> Reviewed-by: Denis Shienkov <denis.shienkov@gmail.com>
* Update copyright headersJani Heikkinen2015-02-1671-437/+421
| | | | | | | | | Qt copyrights are now in The Qt Company, so we could update the source code headers accordingly. In the same go we should also fix the links to point to qt.io. Change-Id: I35f551de8408a2eb6a0f39df1f09d90c8084a7c0 Reviewed-by: Denis Shienkov <denis.shienkov@gmail.com>
* Fix a regresison in the waitForXXX() methods on WindowsDenis Shienkov2015-01-271-4/+8
| | | | | | | | | | | | | | | | | | | | A regression was introduced by commit 893173f9d562f312ce51f00c07eef4ae0f1a0212: call to waitForXX() method always fails. The reason is in that earlier we always had a three valid handles of I/O events, which are passed to the WaitForMultipleObjects() function. But after that commit, we can have up 1 to 3 created handles, depends on the I/O operation. In this case, we also passes a three handles to the WaitForMultipleObjects() function, but some of them are non-initialized. This lead to the WaitForMultipleObjects() always returns with the ERROR_INVALID_HANDLE error code. Thus, we need transfer to the WaitForMultipleObjects() only active event handles. Change-Id: Idc0d98e781506dd30011d4e50f53e06e2776ed52 Reviewed-by: Sergey Belyashov <Sergey.Belyashov@gmail.com>
* Fix crash in destructor if a device was not open on WindowsDenis Shienkov2015-01-271-0/+3
| | | | | | | | | | If a device is not open, then the hEvent field of the OVERLAPPED structure is in non-initialized state. In this case the CloseHandle() on the hEvent lead to crash. It is reasonable to initialize this hEvent field in a constructor. Change-Id: I1c9df21bdab4c95fc774f8d024de04e18948d81f Reviewed-by: Sergey Belyashov <Sergey.Belyashov@gmail.com>
* Improve usage of the break state for the Tx lineDenis Shienkov2015-01-164-8/+93
| | | | | | | | | | | | | | | | | 1. Now the sendBreak() method is deprecated since it is blocking and impossible to implement same behavior on different platforms using their API's. Besides, this method can be implemented via setBreakEnabled() and QTimer. 2. Introduced the new property named as "breakEnabled" which consist of setBreakEnabled() and isBreakEnabled() methods and the signal breakEnabledChanged(). Note: After opening, the port always is in non-break state. Task-number: QTBUG-36571 Change-Id: Ib808dab7eaed8cc5449c66d8186a29a7b7e45afc Reviewed-by: Denis Shienkov <denis.shienkov@gmail.com>
* Do not touch of the read notifier after its creationDenis Shienkov2015-01-062-28/+0
| | | | | | | | | | | | | | When are used the multiple opening and closing chains, then a read notification can be stalled. The reason is in old heritage of a code related to preventing of recursive calls. Thus, need just to remove this old code. It is not the in-depth investigation of an issue but just a workaround which can be improved in future. Tested on Linux with on-board and socat serial ports using Qt5. Task-number: QTBUG-43484 Change-Id: I04556fdde2775448b33d68f141f4328647c549c9 Reviewed-by: Denis Shienkov <denis.shienkov@gmail.com>
* Use Q_NULLPTR where it is possibleDenis Shienkov2015-01-066-39/+39
| | | | | Change-Id: I7261a92ea4405c8aeab7670f73e7225ed7e4d9d0 Reviewed-by: Denis Shienkov <denis.shienkov@gmail.com>
* Do not use internal pre-cached RTS and DTR variablesDenis Shienkov2014-12-052-14/+4
| | | | | | | | | | | | | | | Some devices do not support these signals, and returns an errors when attempt to query it. But the QSP::open() always requests a status of these lines. In this case the QSP::open() will return true, but also will setup an error code (for example, QSP::UnsupportedOperationError for socat's devices in Linux). That is unexpected behavior for the user. It is reasonable do not query a state of these signals when opening. Also we do not need to use of appropriate internal variables, and we can remove it. Change-Id: I277110014c20c1f2c3fdaed20c4582d1356897b9 Reviewed-by: Denis Shienkov <denis.shienkov@gmail.com>
* Interpret ENOTTY as UnsupportedOperationError instead of ResourceErrorDenis Shienkov2014-12-051-1/+1
| | | | | | | | The ENOTTY is closer to QSP::UnsupportedOperationError, because it is decoded as "Inappropriate ioctl for device". Change-Id: Ibcbe09e201eeb5ede6daa417654a181dd380df5a Reviewed-by: Denis Shienkov <denis.shienkov@gmail.com>
* Detect of Bluetooth SPP (rfcomm) device with SysFsDenis Shienkov2014-12-051-11/+19
| | | | | Change-Id: I41d67e9ca8d9cb6042b4d8de756a22d18b077dcd Reviewed-by: Denis Shienkov <denis.shienkov@gmail.com>
* Setup an error when QSP::setBaudRate() fails on UnixDenis Shienkov2014-12-051-0/+1
| | | | | | | | | | | Inside of a method is missed setup of an error code, therefore always returns QSP::UnknownError (or some previous error). Tested on Linux with USB PL2303, using Terminal example (when trying to setup of an unsupported 14400 baud rate). Change-Id: I6b3143dd6d451a32024a5ca5239dac826ceb7af6 Reviewed-by: Denis Shienkov <denis.shienkov@gmail.com>
* Mark a device as open only after all settings was apliedDenis Shienkov2014-12-041-3/+3
| | | | | | | | | | | | | | | | | Otherwise it lead to emmiting of the QSP::NotOpenError in case we close a device from a slot, which is connected to QSP::SerialPortError signal. In this case QSP::close() called twice: from the slot, and from the QSP::open() method (this behavior can be reproduced with Terminal example). So, inside of QSP::open() we need to move QIODevice::open() down, and instead of QSP::close() to use QSPP::close(). Tested on Linux with USB PL2303 with trying to setup an unsupported baud rate as 14400 baud. Change-Id: I12dec085423dd9f5a08b7884f32dd2ba8aa8c951 Reviewed-by: Denis Shienkov <denis.shienkov@gmail.com>
* Do not close closed device in Terminal exampleDenis Shienkov2014-12-041-1/+2
| | | | | | | | | | When opening is fails, the QSP himself close a device. Thus, we do not need to close device in Terminal example again, because it caused emmiting of the QSP::NotOpenError and to showing of additional messagebox. Change-Id: Id8aa3f3b835fd7d4187bdf83c1d6584d5fd541f7 Reviewed-by: Denis Shienkov <denis.shienkov@gmail.com>
* Detect a valid of serial8250 portsDenis Shienkov2014-12-032-8/+29
| | | | | | | | | | | | | | | | Usually, a Linux kernel reserves a places for the non-PnP serial devices, for example, such as ttyS[0-4/14]. In case the system has not a HW devices which are attached to this places, then these devices will be stubs and present as usual serial ports. Thus, we can know about a validity of these devices only in attempt to open them and to query a type of. Note: This patch is theoretical, because are not tested for a valid 8250 devices. Task-number: QTBUG-32024 Change-Id: I313145caadfeeee4d5fe3c8e16c1bcf4ae79214d Reviewed-by: Denis Shienkov <denis.shienkov@gmail.com>
* Improve QSPI sysfs algorithmDenis Shienkov2014-12-031-81/+107
| | | | | | | | | | | | | | | | | | | | | | | | | | | Earlier, the algorithm used check for magic keywords (like "usb", "platform" and so on) in the target path for decision-making what of device can be skipped or accepted. But this is a wrong approach, because on different platforms can be different key-words and we can not know it. So, it is more reasonable to use a different approach where we make decision by a driver name (by analogy with current udev implementation). In this case we skip those devices which has an empty driver name or when a name is equal to "serial8250". * When a driver name is empty, then we can be sure that it is other than serial port device (e.g. as pseudo-terminal, console and so on). Thus, it is similar to udev devices without a parent, which we ignore. * When a driver name is "serial8250", it is equal to "platform" devices, which we too ignore for current implementation. Though in a future this can be solved (i.e. we can try to detect a valid devices based on "serial8250" driver). Tested on Linux with on-board and USB serial ports using Qt5. Change-Id: I884ad8f3fddff9487ad4a67c4904b57f62164e00 Reviewed-by: Denis Shienkov <denis.shienkov@gmail.com>
* Make QSPI udev functions more readableDenis Shienkov2014-12-031-31/+37
| | | | | Change-Id: I5c33421338e6a64dbadeb168cf165a84bedec5b9 Reviewed-by: Denis Shienkov <denis.shienkov@gmail.com>
* Improve QSPI algorithm on UnixDenis Shienkov2014-12-032-14/+22
| | | | | | | | | | | | | | | | | | | | | | | | QSPI uses the wrong algorithm of devices search. In case no any devices are detected with udev (or with sysfs), starts a search with a filters. In this case a user gets a list of devices that are not a serial ports, that is wrong. The main idea should be in that udev or sysfs are the main sources of obtaining information. In case they returns an empty list this means that system has no serial ports. Algorithm is: Try to find devices through udev. If it fails (system error or udev is not present), then try to find using sysfs; otherwise return udev result, even if it has an empty list. If sysfs is fails (permission denied or sysfs is not present), then try to find devices in /dev/ as last attempt; otherwise return sysfs result, even if it has an empty list. Tested on Linux (with udev, sysfs, filters) using FTDI serial ports. Change-Id: I0132e27f720b007ea3f4861e9cd7ed77833cff8c Reviewed-by: Denis Shienkov <denis.shienkov@gmail.com>
* Add scroll area to Enumerator exampleDenis Shienkov2014-12-021-4/+8
| | | | | | | | | When a system has many serial ports, the last of them are not visible on the screen, because a widget has a big height. So, it is reasonable to add scrolling of all serial ports info. Change-Id: Ic13b58fba38a17d6f5142476bca501a0d26ec76d Reviewed-by: Denis Shienkov <denis.shienkov@gmail.com>
* Translate serial port settings of Terminal exampleDenis Shienkov2014-12-021-11/+11
| | | | | Change-Id: Ica127147999eaecc3d03189cfa9cd893115b846c Reviewed-by: Denis Shienkov <denis.shienkov@gmail.com>
* Allow to setup custom device in Terminal exampleDenis Shienkov2014-12-022-10/+25
| | | | | | | | | Terminal example allows to select only available devices which are received from QSPI. Now it is possible to enter and to open of any custom device. Change-Id: I83172a346cb5dc0e20c217957133e9e3e506d8a4 Reviewed-by: Denis Shienkov <denis.shienkov@gmail.com>
* Autotest misconfiguration error message is more verboseSergey Belyashov2014-12-012-4/+31
| | | | | | | | Error message about missing environment variables generates list of required variables. Change-Id: Icbb680abbd9fc5d0549907b7399757d943c6d535 Reviewed-by: Denis Shienkov <denis.shienkov@gmail.com>
* Simplify and improve the QSP::TimeoutError handlingDenis Shienkov2014-11-286-56/+21
| | | | | | | | | | | It is reasonable to get rid of duplicating a code of TimeoutError handling. A common parts of a code can be moved to one place. Also, can be improved some of related if/else conditions. Tested on Windows 8 and Linux with virtual serial ports. Change-Id: I63112727faf42d4357f64f3450ea422167eaee90 Reviewed-by: Denis Shienkov <denis.shienkov@gmail.com>
* Handle EINVAL, ENOIOCTLCMD, ENOTTY and EPERM errorsDenis Shienkov2014-11-281-0/+20
| | | | | | | | | | | According to TTY_IOCTL(4), the ioctl on tty device can return these errors, which we need to interpret to QSP::SerialPortError. For example, a virtual devices which are created by SOCAT, returns the EINVAL error when the ioctl does query of line states. Change-Id: Iece3b773fdc8fe4b97951ccf7cff9d2670f24694 Reviewed-by: Denis Shienkov <denis.shienkov@gmail.com>
* Improve the QSP::clear() on WindowsDenis Shienkov2014-11-281-5/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | Commit 9c88ad89801596e1d94acc4f32ff55c34118a66f solves a problem partially. Still when used QSP::clear() with some devices (e.g. virtual ports from the "AGG Software") the reading can be stalled. It is reasonable to make following: 1. Prevent to reset the both readStarted and writeStarted variables inside of QSP::clear() method. These variables shall be reset inside of _q_completeXX() methods which will be called automatically from the notifiers, since the PurgeComm should terminate pending read or write operations. 2. Instead of startAsyncRead() should be called the startAsyncCommunication(), that allow to correctly startup of the read sequence. This scenario can be reproduced with running of the tst_QSerialPort::readAfterInputClear() autotest. Tested on Windows 8 with the virtual com0com ports and with the virtual ports from the "AGG Software" using Qt5. Change-Id: Ic1a53334abd97667a9dd3291c3b975eb04062efd Reviewed-by: Denis Shienkov <denis.shienkov@gmail.com>
* Prevent multiple calls of WaitCommEventDenis Shienkov2014-11-281-2/+3
| | | | | | | | | | | | | | | Commit ac0422e8c9e74f2275129e3c7c69ef64299f07a9 introduced a regression that QSP::startAsyncCommunication() was called twice when a limited read buffer is used. In the second call the WaitCommEvent function returned the ERROR_INVALID_PARAMETER error that lead to a stall of the read sequence. QSP::startAsyncCommunication() should be called only when the read buffer has enough space. Tested on Windows 8 with the virtual com0com ports using Qt5. Change-Id: Icd6cada7c3acfd4e689ac76ec304416b00f52b50 Reviewed-by: Denis Shienkov <denis.shienkov@gmail.com>
* Fix critical typo with _q_startAsyncWrite()Denis Shienkov2014-11-281-1/+1
| | | | | | | | | Commit 62dfdeb3642250bdb642dbf607a8c7b95e57835e introduce a critical typo that revert a bug which are fixed in the b4d5bd813f591dc618e0fff2d55d93eeccb1a26e commit. Change-Id: I9ed29f5b443cbd7102878287d531d18a9351a2e5 Reviewed-by: Denis Shienkov <denis.shienkov@gmail.com>
* Close the handle for the events that were createdAndy Shaw2014-11-272-0/+11
| | | | | | | | The handles should be closed when QSerialPort is deleted in order to clean up the native resources. Change-Id: If04521fc0fa3b898093bda3317962b4c44818034 Reviewed-by: Denis Shienkov <denis.shienkov@gmail.com>
* Allow to use custom devices pathsDenis Shienkov2014-11-2715-100/+196
| | | | | | | | | | | | | | | | | | | | | | | QSP incorrectly transforms non-standard device names to their paths and vice-versa (for example, "/home/ttyS0", "//./COM1", and so on). Now this problem is solved: * The transformation code is moved to QSPP. * Added autotests auto/qserialportinfoprivate to testing of conversion algorithm. These tests are private and can be activated with building of QtSerialPort with: qmake "QT_CONFIG+=private_tests warnings_are_errors" \ DEFINES+=QT_BUILD_INTERNAL Tested on Windows 8, Linux, OSX with auto-tests, with on-board and virtual serial ports. Task-number: QTBUG-38639 Change-Id: I43757a7f1390f53ed2b1d70de59c6bfb71892a59 Reviewed-by: Denis Shienkov <denis.shienkov@gmail.com>
* Remove the 'register' keywordThiago Macieira2014-11-271-2/+2
| | | | | | | | It doesn't do anything and has been deprecated in C++14. Clang even prints a warning. Change-Id: Ie803a206f02897f99358ed22bf9cb999ca457741 Reviewed-by: Denis Shienkov <denis.shienkov@gmail.com>
* Remove Q_OS_WIN64 since Q_OS_WIN32 defines 64-bit tooDenis Shienkov2014-11-241-1/+1
| | | | | Change-Id: I32eaf132f19a3b6fcbd5fd55d0690c3bd62bb641 Reviewed-by: Denis Shienkov <denis.shienkov@gmail.com>
* Simplify handling of overlapped resultDenis Shienkov2014-11-232-7/+7
| | | | | | | | | | | There is not necessary to pass direction to handleOverlappedResult(). Because it is passed already as a second argument (pointer to OVERLAPPED structure that defines a desired direction). Also this method is renamed to more simple and short name. Change-Id: I9c20cf97c1712aed8d3e9ea6d9b4687ce4487523 Reviewed-by: Denis Shienkov <denis.shienkov@gmail.com>
* Declare QElapsedTimer closer to usageDenis Shienkov2014-11-223-10/+6
| | | | | Change-Id: I74622eaf3a7f5179ff25fc815997d5e4cf3cc2c7 Reviewed-by: Denis Shienkov <denis.shienkov@gmail.com>
* Create notifiers inside of startAsyncXX() methods when requiredDenis Shienkov2014-11-222-43/+88
| | | | | | | | | | | | It is reasonable to move creation of notifiers from the constructor to the specific separate methods. In this case notifiers are created in startAsyncXXX() methods if necessary for concrete I/O operation. Also it allows to return an error in case a notifier is failed. Tested on Windows 8 with virtual com0com serial ports. Change-Id: I351a4c54214c84455150d0fc157a99108280cc12 Reviewed-by: Denis Shienkov <denis.shienkov@gmail.com>
* Fix QSPI::isNull()Denis Shienkov2014-11-219-78/+206
| | | | | | | | | | | The method QSPI::isNull() should return false when QSPI is empty. Tested on Winsows 8 and Linux with on-board, virtual and USB serial ports using Qt5 and then Qt4. Task-number: QTBUG-41262 Change-Id: Ic9e0afc5549311283aef7ec2ed841f5e418b7edf Reviewed-by: Denis Shienkov <denis.shienkov@gmail.com>
* Check for lock file in non-writable directoriesRainer Keller2014-10-231-8/+11
| | | | | | | | | | | | On some linux systems /var/lock is not writable by users which are not root and not in the uucp or dialout group. If the root user acquires a lock and you are trying to access the same port with a non-root user it will not check for the lock but creates a new lock file in /tmp instead. This change checks in readable directories for lock files. Change-Id: Ia308fd344d2fe9d3c699f7a428ff620ea101eff3 Reviewed-by: Denis Shienkov <denis.shienkov@gmail.com>
* Cleanup from the Qt5 dependencesDenis Shienkov2014-10-2318-111/+32
| | | | | | | | Now in this branch there is QtSerialPort which has support only for Qt4. Change-Id: I11d5403dcc17f8c2929429abb6df9f2b2b4fb558 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com> Reviewed-by: Sergey Belyashov <Sergey.Belyashov@gmail.com>
* Merge remote-tracking branch 'origin/5.3' into 5.4Frederik Gladhorn2014-10-1412-52/+215
|\ | | | | | | Change-Id: Id7e66059233e8d07ba44cad19048d9cddc68e250
| * Fix QSP::bytesToWrite() on WindowsDenis Shienkov2014-10-067-36/+68
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
| * Allow for deviceInstanceIdentifier() to return an upper case stringDenis Shienkov2014-10-061-3/+3
| | | | | | | | | | | | Change-Id: I91977b1aa4a8e5bd8321efc5cfda375c9d7deff7 Reviewed-by: Sergey Belyashov <Sergey.Belyashov@gmail.com> Reviewed-by: Denis Shienkov <denis.shienkov@gmail.com>