summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* Windows: Fix no longer receive data after EV_TXEMPTY triggered for CDC ACM ↵v5.1.0-rc2v5.1.0-rc1v5.1.0Denis Shienkov2013-06-071-4/+2
| | | | | | | | | | | | | | | | | | | | | | device A previous patch * SHA1 ID: 2bcac223e64599eb74889975053f6547000b13cb introduced a regression: after triggering of EV_TXEMPTY a reception of data is stopped. The reason for this was an immediate return from the handler processCompletionRoutine(). The solution - do not do an immediate return and let to call method startAsyncRead(). Thanks to Dan Task-number: QTPLAYGROUND-22 Change-Id: I1a6b358e6bbaba94527dc9db98a2ab046a8c6f05 Reviewed-by: Sergey Belyashov <Sergey.Belyashov@gmail.com> Reviewed-by: Laszlo Papp <lpapp@kde.org>
* Windows: Fix false ResourceError triggering for CDC ACM devicesDenis Shienkov2013-06-061-2/+9
| | | | | | | | | | | | | | | | | | | | | When transmitted data to the USB serial port of the class CDC ACM, is triggered an unexpected TXEMPTY event, which we didn't add to a mask of events in SetCommMask(). In this case handler processCompletionRoutine() interpreted it as ResourceError. This DCD ACM devices over USB connection using the Microsoft USB serial driver (usbser.sys). Thus, allegedly, this behavior identical for all standard CDC ACM devices on Windows. Solution - check on unexpected EV_TXEMPTY flag and immediately return true from processCompletionRoutine(). Thanks to Josh Handley. Task-number: QTPLAYGROUND-22 Change-Id: Iac3eccc79e243e5bbf1a34cd44458c9ad265a5db Reviewed-by: Sergey Belyashov <Sergey.Belyashov@gmail.com> Reviewed-by: Laszlo Papp <lpapp@kde.org>
* sync.profile: Point dependencies to an empty stringSergio Ahumada2013-05-261-1/+1
| | | | | | | | | | | This means that we are going to use the same branch name for the dependencies as the branch of the repository under test. If we are testing the 'stable' branch, all dependencies will point to the 'stable' branch as well. Change-Id: Ibb0cf31b90d04f280691859d66486803ff58cc78 Reviewed-by: Iikka Eklund <iikka.eklund@digia.com>
* Doc: Updates based on sanity checkv5.1.0-beta1Venugopal Shivashankar2013-05-0611-299/+93
| | | | | | | | | | | | | - Removed redundant qdoc pages on supported platforms, getting source, and building from source. - Added a module page to list the C++ classes - Removed unnecessary \module commands in several pages - Made a few language edits to class documentation - Updated the index page with some introductory content - Fixed broken links to the examples Change-Id: Ia7bd74b383f344426814db736f7bc4cd77c13992 Reviewed-by: Laszlo Papp <lpapp@kde.org>
* Update the documentation and internal setBreakEnabled APILaszlo Papp2013-05-067-22/+11
| | | | | | | | | | | | | The change 0add3b934b8405fc5b65efeba9f05cc1dc353e64 changed the API, and we had a compromise in there to get the API changes in as soon as possible. This change tries to address the suggested documentation and internal API changes. Only tested on Linux with Qt 4.8.4 and Qt 5.1, so it might break on other platforms. Change-Id: I153e5a35d76beb26e04dbabf184bc9b90ef4b70b Reviewed-by: Denis Shienkov <denis.shienkov@gmail.com> Reviewed-by: Sergey Belyashov <Sergey.Belyashov@gmail.com>
* Fix examples directory layoutKai Koehne2013-05-0351-28/+30
| | | | | | | | | | | | | Move examples into a dedicated 'serialport' directory. This is in line with what the other modules do, and makes sure that the examples show up in a sensible place even for the 'combined' source packages. Task-number: QTBUG-30912 Change-Id: Iefa2b634df3d2eb34f655b34f6fb24a224b78869 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com> Reviewed-by: Laszlo Papp <lpapp@kde.org> Reviewed-by: Jerome Pasion <jerome.pasion@digia.com>
* Revert "Refactor the Windows port enumeration from GUID classes to ↵Denis Shienkov2013-04-301-7/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | devinterfaces" This reverts commit 3bfe998860e0bfd3ce48784188eaa0d58bf86da1. Patch with enumerating of devices through interfaces GUID's enters many regressions, breaks universality and complicates realization. For example, it breaks enumeration of CDC ACM devices. Moreover, some devices (like Nokia phones) has incorrect registration in Windows registry so workaround will greatly complicates code. Decision with use of GUID's interfaces was worse than the previous with use of setup GUID's. Thus, was made the decision to roll away changes on really working decision with Setup Class GUID's. Now tested for devices: * built-in serial port * USB/Serial converter on PL2303 chip * USB/Serial converter on FTDI chip * USB/Bluetooth dongle with standard MS bluetooth stack * USB/CDMA Modem ZTE MF180 * Com0com virtual serial ports * Eltima virtual serial ports * Telit virtual serial ports * CDC ACM serial port on Motorola E398 phone * CDC ACM (and modem) serial port on Nokia E95 phone on Windows XP/7/8. Task-number: QTPLAYGROUND-27 Change-Id: Icc893e9e54e51dbf78da2d132dab6db986d94e03 Reviewed-by: Laszlo Papp <lpapp@kde.org>
* Eliminate the blocking terminal example notes as it still does not existLaszlo Papp2013-04-302-4/+2
| | | | | Change-Id: I28986ada705996ada22b30d10877ea9eed0dba8f Reviewed-by: Denis Shienkov <denis.shienkov@gmail.com>
* API change: setBreak -> setBreakEnabledThiago Macieira2013-04-272-6/+2
| | | | | | | | | setBreak(false) to disable breaks are a bad idea. clearBreak(false) to enable breaks are an even worse idea. So rename the function to setBreakEnabled(), which follows existing Qt patterns. Change-Id: I5f76afc3c9e7039b55be231f6be4d5d20ec2e537 Reviewed-by: Laszlo Papp <lpapp@kde.org>
* Workaround for fix sending of data for WinCE platformDenis Shienkov2013-04-241-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* Fix of errors of compilation on WinCE platformDenis Shienkov2013-04-211-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | Some previous commits entered regressions in compile process, namely: * sha1: 544f927c3724344d01d45d19151d236c143f8c83 After implementation of a new concept of internal architecture of library, is entered regression for the indefinite eventMask variable in the waitForReadOrWrite() method. Solution - to define a variable into this method. * sha1: 3ea635d74d4035c9036c2b7208b162620f51aa8b Entered the name space regression for the class CommEventNotifier. Solution - not to use a name space for this class. Tested for target: "-platform win32-msvc2005 -xplatform wincewm50pocket-msvc2005" Task-number: QTPLAYGROUND-13 Change-Id: I9dbcc0023f06c1b0e6d7b1b670828650382ab785 Reviewed-by: Laszlo Papp <lpapp@kde.org>
* Refactor the Windows port enumeration from GUID classes to devinterfacesDenis Shienkov2013-04-201-12/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Earlier enumeration of devices was made through GUID classes. But MSDN says that this approach became outdated (since Windows 2000), and instead of classes it is necessary to use GUID interfaces. See: * http://msdn.microsoft.com/en-us/library/windows/hardware/ff545036%28v=vs.85%29.aspx * http://msdn.microsoft.com/en-us/library/windows/hardware/ff545046%28v=vs.85%29.aspx Thus there was a changeover of: * GUID_DEVCLASS_PORTS by GUID_DEVINTERFACE_COMPORT * GUID_CLASS_MODEM by GUID_DEVINTERFACE_MODEM Of course, flags for the SetupDiGetClassDevs() function changed also. This approach decided the following: * Use of newer API for enumeration * There is no need GUID classes for non-standard "purely" the virtual devices (like com0com and so forth) * There is no need to check for name "LPT" existence, because GUID_DEVINTERFACE_COMPORT belong only to serial ports devices (instead of GUID_DEVCLASS_PORTS that include serial and parallel ports). It is checked on devices: * Built-in serial ports * USB/Serial converters (PL, FTDI) * USB Bluetooth serial ports (with standard MS stack) * USB modems (ZTE MF180) * Com0com virtual serial ports * Eltima virtual serial ports * Telit virtual serial ports It is checked on OS: Windows XP/Vista/7/8 Change-Id: I9da51d815ac5081a95113659be2b38ebd31275a4 Reviewed-by: Sergey Belyashov <Sergey.Belyashov@gmail.com> Reviewed-by: Laszlo Papp <lpapp@kde.org>
* Add further device filters on Linux without libudevDenis Shienkov2013-04-191-1/+3
| | | | | | | | | | | | | | Added: * ttyAMA filter for AMBA serial ports, e.g. see http://lxr.free-electrons.com/source/drivers/tty/serial/amba-pl011.c * ircomm filter for infrared serial devices, e.g. see http://www.tldp.org/HOWTO/html_single/Infrared-HOWTO/ Change-Id: I9e1cd04513a937f080978a7ecc7139a906de40f0 Reviewed-by: Laszlo Papp <lpapp@kde.org> Reviewed-by: Sergey Belyashov <Sergey.Belyashov@gmail.com>
* doc: Minor changes to qtserialport.qdocconfSergio Ahumada2013-04-162-5/+8
| | | | | | | | | Organizing the file a bit to make it match other qdocconf files. Also, renaming \title Qt Serial Port to match other modules. Change-Id: I65938cad5184ca886765272294ce07d117f77b5a Reviewed-by: Jerome Pasion <jerome.pasion@digia.com> Reviewed-by: Venugopal Shivashankar <venugopal.shivashankar@digia.com>
* Mentioning of Unbuffered mode in the open() method is removedDenis Shienkov2013-04-101-2/+1
| | | | | | | | | At present the Unbuffered mode isn't supported, therefore the mentioning is deleted. Change-Id: I399dd7ac79f6571a5d0738957120a046b2422fef Reviewed-by: Laszlo Papp <lpapp@kde.org> Reviewed-by: Sergey Belyashov <Sergey.Belyashov@gmail.com>
* Add CMake unit tests for QtSerialPort.Stephen Kelly2013-04-094-1/+24
| | | | | Change-Id: I406517f216e7c73c20439ca2f9a17e60709ef661 Reviewed-by: Laszlo Papp <lpapp@kde.org>
* Remove the namespace doc as the namespace usage was removedLaszlo Papp2013-04-081-32/+0
| | | | | | | | This file does not have any useful content either, and unlikely to have in a foreseeable future. Change-Id: I36da8a3599f308a42d5809168b0f48dc197df126 Reviewed-by: Denis Shienkov <denis.shienkov@gmail.com>
* Fix a typo in the example qdoc to eliminate the warningLaszlo Papp2013-04-081-1/+1
| | | | | Change-Id: Ia241ea3198a1e9deb3501de07fb510eea8dfd77c Reviewed-by: Denis Shienkov <denis.shienkov@gmail.com>
* Fix several documentation issues for the snippet qdoc keywordLaszlo Papp2013-04-083-32/+32
| | | | | | | | As it can be seen in other submodule examples, the "example" prefix is unnecessary, and it even causes warnings. Change-Id: Id168108758cc7f6dbb0aebf753b757c4f67b3f47 Reviewed-by: Denis Shienkov <denis.shienkov@gmail.com>
* Use the ingroup/title/example properly without the module keywordLaszlo Papp2013-04-085-15/+15
| | | | | | | | | This also eliminates several documentation warnings when trying to build that. Planning to add \brief and other fancy stuff later, but the main purpose of this change is to eliminate the documentation warnings. Change-Id: Ib4048d0af691bac9ea70f6ca907649dce0f650db Reviewed-by: Denis Shienkov <denis.shienkov@gmail.com>
* Use the proper signature for the data error policy changed signalLaszlo Papp2013-04-081-1/+1
| | | | | | Change-Id: Iaf6df920dfca65b80231bb702c0290bb5c0e00d9 Reviewed-by: Sergey Belyashov <Sergey.Belyashov@gmail.com> Reviewed-by: Denis Shienkov <denis.shienkov@gmail.com>
* Fix cast from ASCII in library codeThiago Macieira2013-04-071-5/+9
| | | | | | | | | | | | | Must always declare the source encoding. QtSerialPort must still compile with Qt 4, so #define QStringLiteral to be QLatin1String there (even though QStringLiteral is supposed to be UTF-8). Note: this code is bad. It's not thread-safe outside of GCC. It should use Q_GLOBAL_STATIC. Change-Id: I938c2f836f9c3c1d2beaade20e67ce5ef142741e Reviewed-by: Laszlo Papp <lpapp@kde.org> Reviewed-by: Sergey Belyashov <Sergey.Belyashov@gmail.com>
* Remove non-standard comma at the end of an enumThiago Macieira2013-04-071-1/+1
| | | | | | Change-Id: I69ca34c159a267855977bee9670836ce7a249782 Reviewed-by: Laszlo Papp <lpapp@kde.org> Reviewed-by: Sergey Belyashov <Sergey.Belyashov@gmail.com>
* doc: Removed the HTML template from the .qdocconf filesSergio Ahumada2013-04-051-1/+0
| | | | | | | qt-module-defaults.qdocconf already contains the HTML template. Change-Id: I831615cdfdb3d4df73393c6b6815fc837bc444d4 Reviewed-by: Laszlo Papp <lpapp@kde.org>
* tests: Don't run manual tests in the CI systemv5.1.0-alpha1Sergio Ahumada2013-04-042-2/+0
| | | | | | | | Manual tests are not suppossed to be run by the CI system, so removing CONFIG += testcase from the .pro files. Change-Id: I43a729a22a25d9656a1cf76cf3489b3abb893fbd Reviewed-by: Laszlo Papp <lpapp@kde.org>
* Mac: Fixed the description() method for Bluetooth devicesDenis Shienkov2013-03-291-0/+8
| | | | | | | | | | | | | | | | | | | | | | | At the moment, the description() method returns empty string, because for Bluetooth devices does not exist the properties with the names kIOPropertyProductNameKey and kUSBProductString into dictionary. To obtain description information for the Bluetooth serial devices can to use a separate property called "BTName". This property can also be seen with the utility IORegistryExplorer. In the current implementation, the name "BTName" is hard-coded in the source code because I did not find any of its definition in the header files XCode, in the Apple's developer site and in general, on the hard drive. Thus, in the future it is possible to replace the hard-code to a constant, if it exists. Tested on MacOSX 10.6.8 Task-number: QTPLAYGROUND-25 Change-Id: I227aa2a1429660287ea83c1b142d2af3a11fd086 Reviewed-by: Sergey Belyashov <Sergey.Belyashov@gmail.com> Reviewed-by: Denis Shienkov <denis.shienkov@gmail.com>
* Win32: Truncate read buffer when ReadFile returns errorDenis Shienkov2013-03-291-2/+4
| | | | | | | | | | | | | | Previously reserved read buffer must be truncated when reading error occurs. Also reserve() method is moved down after method lookupReadCompletionNotifier(). So we get rid of an additional truncate() method when lookup can return null pointer. Change-Id: I843ff6043b31da892a93d93b8b4209ce8f10a7d2 Reviewed-by: Sergey Belyashov <Sergey.Belyashov@gmail.com> Reviewed-by: Denis Shienkov <denis.shienkov@gmail.com>
* Use explicit constructors where it is applicableLaszlo Papp2013-03-281-2/+2
| | | | | | | Change-Id: I8619ef269b124357a164e7f771058deda6fcb419 Reviewed-by: Israel Lins Albuquerque <israelins85@yahoo.com.br> Reviewed-by: Sergey Belyashov <Sergey.Belyashov@gmail.com> Reviewed-by: Denis Shienkov <denis.shienkov@gmail.com>
* remove dependence of working QSerialPortInfoIsrael Lins2013-03-271-1/+1
| | | | | | | | On system with no support to QSerialPortInfo the constructor QSerialPort(QString portName, QObject *parent) don't works. Change-Id: I1a98e03f9153d2b963fa2985901e40ddf17717cf Reviewed-by: Laszlo Papp <lpapp@kde.org>
* Add accessor methods for checking the availability of the PID/VIDLaszlo Papp2013-03-269-19/+55
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | As mentioned in the previous change, this is necessary for those end users who would like to explicitly know if the device on the serial port has a valid vendor or/and product identifier. This is now providing a nice and convenient API for having a dedicated boolean method for making this query possible. It is a lot more readable and convenient to use than other alternatives including the extended scope for the integer query method and so forth. It is more explicit and clear about the intention that one checks if the device has a valid identifier. It would be more vague with error codes and so forth. One somewhat reasonable alternative could be this, albeit this is also more inconvenient: a) bool vendorIdentifier(quint16 &vendorIdentifier) const; b) bool productIdentifier(quint16 &vendorIdentifier) const; ... as this would require an additional variable from the user, and this could not be used with ternary operators so easily, et cetera. There are even worse ideas like how the exceptional conversion happens in QString and so forth, but that also requires an explicit variable or zero if one is sure the conversion should succeed. One can pass zero in there, but that is still inconvenient and more than passing nothing, and zero can become unclear what it supposed to present half or one year later. The change has been tested on Linux with Qt4 and Qt5, and cenumerator works as expected. The documentation has been added accodingly. Task-number: QTPLAYGROUND-21 Change-Id: I905708ce0e67307bf89d69e645462486ad869b0c Reviewed-by: Sergey Belyashov <Sergey.Belyashov@gmail.com> Reviewed-by: Denis Shienkov <denis.shienkov@gmail.com>
* Add local echo support for the terminal exampleDenis Shienkov2013-03-266-53/+89
| | | | | | | | | | | | | | | | | | | Earlier, by default when put a characters for the transfer, this characters is always displayed on the console, i.e. can be said that has always worked the local echo mode. This led to the problem with duplication of input characters on the console, in case if the remote device (e.g. a modem) was enabled the echo mode by default. For example, when typing the command "AT", the console displays "AATT". To fix this problem, to the settings dialog was added the checkbox "Local echo" in which can turn off the display of input characters to the console. Change-Id: Iebc9384bab97e313a954a8f8c00ea22129913280 Reviewed-by: Laszlo Papp <lpapp@kde.org> Reviewed-by: Sergey Belyashov <Sergey.Belyashov@gmail.com>
* Fix crash the Terminal example when trying to select the custom baud rateDenis Shienkov2013-03-251-1/+1
| | | | | | | | | | | | | Attempting to choose from QComboBox the custom baud rate leads to crash because the null pointer is returned to the QLineEdit and call the method for setup the validator by null pointer. Only editable combo boxes have a line edit, so trying to set a non-editable is dereferencing a null ptr. Change-Id: Ia9aaef64ef908b1b2d95090a203dc223d12f0b76 Reviewed-by: Sergey Belyashov <Sergey.Belyashov@gmail.com> Reviewed-by: Laszlo Papp <lpapp@kde.org>
* Change the return type of the vendor/productIdentifier() APILaszlo Papp2013-03-259-41/+38
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The API was established with a bit of insanity, namely: it returns raw strings for the 16-bit vendor and product _numbers_. This brings lots of limitations into the system aside from its silly nature, like how to handle lower and upper case hex letters (a-f, A-F) and so forth. Also, it is not clear whether the API should return zero aligned strings, or whether or not to return the leading indicator of the hex format (0x). This is now all being eliminated by switching to the 16-bit unsigned integer use. There are mostly two use cases for the usage of this: a) Comparison or mapping to find the requested port and device This is getting very simple because it will mean a simple 16-bit unsigned integer comparison which is cross-platform by its nature for sure. b) Display the string to the end user This is for instance with an enumerator or terminal emulator application, but in this special case the user can format the output of the integer as wished. Then, it can easily become a cross-platform display. Even customizing is simple enough to provide the native look'n feel without the library forcing one particular type. The documentation is being changed correspondingly. As for the future, if the need even arises, the following methods could be considered for the info provider class (QSerialPortInfo): bool hasVendorIdentifier() const; bool hasProductIdentifier() const; ... both can be added without any issues (i.e. in a binary compatible way). The examples are updated now as well with presenting the usage of the new API. The GUI emulator example got the string management a bit updated to be in line with the console based emulator (cenumerator). In general, it is also a way more reasonable way of putting a string together with so many placeholders. Also, the argument and list management got a bit nicer formatting style per line break. Testing: the change has been tested on Linux with Qt4 and Qt5. Task-number: QTPLAYGROUND-21 Change-Id: I33683061787af94a797685794be9ebcfa90c499a Reviewed-by: Sergey Belyashov <Sergey.Belyashov@gmail.com> Reviewed-by: Denis Shienkov <denis.shienkov@gmail.com>
* Fix the broken serialport information obtaining on MacLaszlo Papp2013-03-251-4/+4
| | | | | | | | | | | | This regression was introduced by the following commit: ca59808315342560b5b09687fd47dbe537787ef7 It is due to the fact that the static method provides the string for the return value, and not in place for the "this" object. This was an oversight. Change-Id: I5fa5a25562abe1567d9423022072e012b4e66b45 Reviewed-by: Sergey Belyashov <Sergey.Belyashov@gmail.com> Reviewed-by: Denis Shienkov <denis.shienkov@gmail.com>
* Make a good use of the new "override" C++11 specifier when availableLaszlo Papp2013-03-245-20/+25
| | | | | | | | | | | | | | | | | | The usage of the specifier helps to catch mistakes in general and also explicitly shows the intention. Furthermore, leave the "virtual" specifier out as per Qt Coding Style: http://qt-project.org/wiki/Qt_Coding_Style#fe675674b70cdaca505f3cff0244fbae It does not make much sense in general with the override specifier either anyhow. Note: an empty define is still necessary as long as QtSerialPort supports Qt4 which is the current situation. Change-Id: Iedf01071e6303d88305c140f4a767bb43059f593 Reviewed-by: Denis Shienkov <denis.shienkov@gmail.com> Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
* Windows: Add missed error code ResourceError processingDenis Shienkov2013-03-231-1/+5
| | | | | | | | | | | | | | | | | | Previously, when pulled from the system the USB Bluetooth dongle (which is associated with the opened serial port) don't cause emitting of signal error() with code ResourceError. This reproduced only in case if through already open the serial port was called the read operation, in this case read operation returns fail with the system error code ERROR_DEVICE_REMOVED. Now, this problem has been fixed and handled correctly by at least on Windows XP, Vista, 7 and 8 (x32) with the Standard MS Bluetooth stack. Seems, that it is common behavior for all the USB Bluetooth devices with use the Standard MS Bluetooth Stack. Change-Id: Ic19c850360d27a2729f72b438e1e185db09eeb97 Reviewed-by: Sergey Belyashov <Sergey.Belyashov@gmail.com> Reviewed-by: Laszlo Papp <lpapp@kde.org>
* Use the error string established for showing the error messageLaszlo Papp2013-03-221-8/+2
| | | | | | Change-Id: Id34f2428641725ede6eda9505c9b577a21e94e1e Reviewed-by: Sergey Belyashov <Sergey.Belyashov@gmail.com> Reviewed-by: Denis Shienkov <denis.shienkov@gmail.com>
* Demonstrate the error notification through the terminal exampleLaszlo Papp2013-03-220-0/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | I have received a couple of requests recently whether it is planned to support error notification and hence I think it would be a good idea to demonstrate its usage inside the examples as much as possible. Here you can find the first attempt for that. As the library aims to provide the error strings as well, all that has to be done is to setup a handler for the notification and display a message box and conditionally close the serial port in case of critical errors. The string will also be provided by the library which makes the interface unified across certain projects. However, the clients can also use their strings if they wish. It is up to their decision. The error strings are already localized and internationalized inside the library. The handler is now also tagged properly for the documentation so that it is more appropriate for end users reading the documentation to get these bits right as it is probably a severe issue for many developers and end users. This will also allow us to be very careful about the error strings inside the library that is among my next goals to make it even nicer than before because currently there is no "high-level" error message prepended to the more detailed one. Hence, this could still be improved in the near future. Some errors are already tested when opening the serial port. Hence, the example can demonstrate both types of error management: sync and async. It might be sometimes more feasible to have a sync error management in place even if async can also work. The change has been tested on Linux and Windows with Qt4, and with Qt5 on Linux for the time being. Thank you for Denis to revealing the importance of the issue even if this patch is representing a bit different approach. Change-Id: If0274e684fd5da08b32bbf0227bfb98784c3a78f Reviewed-by: Denis Shienkov <denis.shienkov@gmail.com> Reviewed-by: Sergey Belyashov <Sergey.Belyashov@gmail.com>
* Demonstrate the error notification through the terminal exampleLaszlo Papp2013-03-212-0/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | I have received a couple of requests recently whether it is planned to support error notification and hence I think it would be a good idea to demonstrate its usage inside the examples as much as possible. Here you can find the first attempt for that. As the library aims to provide the error strings as well, all that has to be done is to setup a handler for the notification and display a message box and conditionally close the serial port in case of critical errors. The string will also be provided by the library which makes the interface unified across certain projects. However, the clients can also use their strings if they wish. It is up to their decision. The error strings are already localized and internationalized inside the library. The handler is now also tagged properly for the documentation so that it is more appropriate for end users reading the documentation to get these bits right as it is probably a severe issue for many developers and end users. This will also allow us to be very careful about the error strings inside the library that is among my next goals to make it even nicer than before because currently there is no "high-level" error message prepended to the more detailed one. Hence, this could still be improved in the near future. Some errors are already tested when opening the serial port. Hence, the example can demonstrate both types of error management: sync and async. It might be sometimes more feasible to have a sync error management in place even if async can also work. The change has been tested on Linux and Windows with Qt4, and with Qt5 on Linux for the time being. Thank you for Denis to revealing the importance of the issue even if this patch is representing a bit different approach. Change-Id: If0274e684fd5da08b32bbf0227bfb98784c3a78f Reviewed-by: Denis Shienkov <denis.shienkov@gmail.com> Reviewed-by: Sergey Belyashov <Sergey.Belyashov@gmail.com>
* baudRateChanged not emitted when neededIsrael Lins2013-03-191-1/+1
| | | | | | | Change-Id: I5922871e546e50c61661a1a7c2251c0abc79fbde Reviewed-by: Laszlo Papp <lpapp@kde.org> Reviewed-by: Denis Shienkov <denis.shienkov@gmail.com> Reviewed-by: Sergey Belyashov <Sergey.Belyashov@gmail.com>
* Win32: Fix read sequence with considering the type of policyDenis Shienkov2013-03-171-1/+1
| | | | | | | | | | | Method startAsyncRead() should only be called in case of a policy type IgnorePolicy installed. In other types of policies should be re-trigger startWaitCommEvent() method for correctly catch frame/parity errors for each char readed. Change-Id: I94e002d0634fc6cc9763ac492972735393bbf3a2 Reviewed-by: Sergey Belyashov <Sergey.Belyashov@gmail.com> Reviewed-by: Laszlo Papp <lpapp@kde.org>
* Windows: Fix receive policies processingDenis Shienkov2013-03-163-14/+15
| | | | | | | | Policies should be handled only with ParityError occurred according to the description of the method setDataErrorPolicy(). Change-Id: Ie0dc9347e50d358508def5ba1a84dadbb0ead4be Reviewed-by: Laszlo Papp <lpapp@kde.org>
* Remove description for QSerialPort::close() methodDenis Shienkov2013-03-141-3/+0
| | | | | | | | | | | | | Description of the method close() does not reflect the reality in terms of flush data before closing, at current moment data is not flushes and device closes immediately. Thus, it is wiser to remove the description to the functionality that does not exist at the moment. Moreover, that the question of whether to do or not do flush, is to be considered later. Change-Id: Ifb286c0c4a608b8dfea8b0380ce92bf3df9f3de3 Reviewed-by: Laszlo Papp <lpapp@kde.org>
* Define module versionLaszlo Papp2013-03-141-1/+3
| | | | | | | | Task-number: QTBUG-29838 Change-Id: Ic2880bb15f134576f819db22443dc87163c922d4 Reviewed-by: Sergey Belyashov <Sergey.Belyashov@gmail.com> Reviewed-by: Denis Shienkov <denis.shienkov@gmail.com>
* Use fromUtf8 for the conversion instead of copy assignmentLaszlo Papp2013-03-121-4/+4
| | | | | | Change-Id: I9f450a55c7fa33811aaa2181eddc0241ea3bbc42 Reviewed-by: Sergey Belyashov <Sergey.Belyashov@gmail.com> Reviewed-by: Denis Shienkov <denis.shienkov@gmail.com>
* Add the console config due to WindowsLaszlo Papp2013-03-121-0/+1
| | | | | | | | | | For new codes, it is better not to use scopes as it is less noise, and works fine. Change-Id: I0078e70e037aaa1ddd861de40542db7386f69dda Reviewed-by: Jake Petroules <jake.petroules@petroules.com> Reviewed-by: Sergey Belyashov <Sergey.Belyashov@gmail.com> Reviewed-by: Denis Shienkov <denis.shienkov@gmail.com>
* Mac: Add missed check for CFStringGetCString/CFNumberGetValue return valueDenis Shienkov2013-03-111-22/+22
| | | | | | Change-Id: Ie327c957517a383676004caa9a13c7e467153ee9 Reviewed-by: Laszlo Papp <lpapp@kde.org> Reviewed-by: Sergey Belyashov <Sergey.Belyashov@gmail.com>
* Fix a typo for the output of the cenumerator exampleLaszlo Papp2013-03-111-2/+2
| | | | | | Change-Id: Id0d2b28158e34aa6ea1c5d16cd41e3f2c6cd48b4 Reviewed-by: Jake Petroules <jake.petroules@petroules.com> Reviewed-by: Denis Shienkov <denis.shienkov@gmail.com>
* Command line applications should not be placed into a bundle on OS X.Jake Petroules2013-03-111-0/+2
| | | | | Change-Id: Idf872d769d683440ec6cb98ae722ba68b8715a86 Reviewed-by: Laszlo Papp <lpapp@kde.org>
* Prefer the library built in the project tree for the examples and testsLaszlo Papp2013-03-112-6/+6
| | | | | | | | | | | | | | | | | | | | This is necessary when the user has a previous QtSerialPort version installed because the examples and tests will pick up the old installed version. That can cause breakages for the "one shot" build in case of API breaks or behavior changes. For consistency, and more importantly for proper explicit usage without raw INCLUDEPATH usage, QMAKE_INCDIR is introduced in place. qtAddLibrary has to be moved to the beginning not to prepend the QtSerialPort include later, and hence to avoid the issue for the example and test builds. This change also removes a left-over line for Mac as it has just been tested that the line is unnecessary. Change-Id: If391b4398a323e0a3eb285bd79d98ec1dd410381 Reviewed-by: Denis Shienkov <denis.shienkov@gmail.com> Reviewed-by: Sergey Belyashov <Sergey.Belyashov@gmail.com>