summaryrefslogtreecommitdiff
path: root/src/serialport/qserialportinfo.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Doc: Remove unnecessary \fn tag for the swap() functionDenis Shienkov2017-03-181-2/+1
| | | | | | | ... as this function is implemented in cpp file. Change-Id: Ia5a0c262ebdb4b98b4575c85ab45fdc93742731f Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
* Improve documentation a bitDenis Shienkov2017-01-041-8/+8
| | | | | | | | ... where has been added the '\c' tag where it is required. Change-Id: Ie346fc147deb535501eb365693a2ff5fe22a98f9 Reviewed-by: Sergey Belyashov <Sergey.Belyashov@gmail.com> Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
* QSerialPortInfo: use delegate ctor to de-duplicate codeAnton Kudryavtsev2016-07-111-7/+1
| | | | | | Change-Id: I698b9afc7b15bdfca7176ea3ec823da1ba91957c Reviewed-by: Sergey Belyashov <Sergey.Belyashov@gmail.com> Reviewed-by: Denis Shienkov <denis.shienkov@gmail.com>
* Replace 'Q_NULLPTR' and 'NULL' with 'nullptr'Denis Shienkov2016-06-171-1/+1
| | | | | | | | | We can use nullptr since Qt 5.7. Change-Id: Id5354280d6a94b2c1f4c5967c65a22db878eca3e Reviewed-by: Anton Kudryavtsev <a.kudryavtsev@netris.ru> Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com> Reviewed-by: Denis Shienkov <denis.shienkov@gmail.com>
* Replace 'Q_FOREACH' with the range-based 'for'Denis Shienkov2016-05-131-6/+8
| | | | | | Change-Id: I057267982ac946ce1ec863a79120cd21cd563c4b Reviewed-by: Sergey Belyashov <Sergey.Belyashov@gmail.com> Reviewed-by: Denis Shienkov <denis.shienkov@gmail.com>
* Merge remote-tracking branch 'origin/5.6' into 5.7v5.7.0-beta1Liang Qi2016-04-081-0/+2
|\ | | | | | | Change-Id: I1b9b5ff33064eab6e35e4fd57b72b8fbf2a5a022
| * Merge remote-tracking branch 'origin/5.6.0' into 5.6Liang Qi2016-03-211-0/+2
| |\ | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/serialport/qserialportinfo_osx.cpp src/serialport/qserialportinfo_unix.cpp src/serialport/qserialportinfo_win.cpp src/serialport/qserialportinfo_wince.cpp Change-Id: I9540cf8c714a99b7ace9aeaeb003cb4a00b8303e
| | * Deprecate QSPI::isBusy() methodv5.6.0-rc1v5.6.05.6.0Denis Shienkov2016-02-181-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | It is impossible to implement this method properly on all platforms. Its implementation is complicated and introduces a side-effects, related to the race-conditions, permissions and so on. The user can implement QSPI::isBusy() himself just trying to open a desired device, what is equivalent to the current implementation. Change-Id: I71ef69a1a8edb7c4df23c8b2816add40475e00b5 Reviewed-by: Sergey Belyashov <Sergey.Belyashov@gmail.com> Reviewed-by: Denis Shienkov <denis.shienkov@gmail.com>
* | | Merge remote-tracking branch 'origin/5.6' into 5.7Liang Qi2016-03-071-2/+7
|\ \ \ | |/ / | | | | | | Change-Id: I35f19a7d266f90e957bfe01534a40c4d98b40b34
| * | Fix documentation of QSPI::standardBaudRates()Denis Shienkov2016-02-171-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This method returns a list of baud rates which are standard for this platform, but not for the current serial port. Change-Id: Ic833aa41da8aab0caaaac054b66208c7094b4589 Reviewed-by: Sergey Belyashov <Sergey.Belyashov@gmail.com> Reviewed-by: Denis Shienkov <denis.shienkov@gmail.com>
| * | Move QSPI::standardBaudRates() in one placeDenis Shienkov2016-02-161-0/+5
| |/ | | | | | | | | | | | | | | | | | | Currently we do not need in multiple implementations of this method, and can move it to the qserialportinfo.cpp file. Change-Id: I9d27c739ebd07f76a0e4e808766052bf90d4c19b Reviewed-by: Sergey Belyashov <Sergey.Belyashov@gmail.com> Reviewed-by: Denis Shienkov <denis.shienkov@gmail.com>
* | Unify license header usageAntti Kokko2016-02-021-13/+19
|/ | | | | | | | Update old header.LGPL3 to header.LGPL Change-Id: I1b17b6f798ee521d2e3bd8c37024df7cd65ee0c4 Reviewed-by: Sergey Belyashov <Sergey.Belyashov@gmail.com> Reviewed-by: Jani Heikkinen <jani.heikkinen@theqtcompany.com>
* Merge remote-tracking branch 'origin/5.4' into 5.5Oswald Buddenhagen2015-07-171-0/+2
|\ | | | | | | Change-Id: Ibf52d73727ece041fea18c0711f018ddf9cc7960
| * Add missing QT_DEPRECATED_SINCE(5, 2) macroDenis Shienkov2015-07-161-0/+2
| | | | | | | | | | | | | | | | | | The macro was added in the header file, but not in the implementation file. Change-Id: I51bc62eedbaba627fb525c04dc126bf0125e7a39 Reviewed-by: Marc Mutz <marc.mutz@kdab.com> Reviewed-by: Denis Shienkov <denis.shienkov@gmail.com>
* | Merge remote-tracking branch 'origin/5.4' into 5.5Frederik Gladhorn2015-02-251-1/+1
|\ \ | |/ | | | | | | | | | | | | | | | | | | | | | | Conflicts: .qmake.conf src/serialport/qserialport_unix.cpp src/serialport/qserialport_unix_p.h src/serialport/qserialport_win.cpp src/serialport/qserialport_win_p.h src/serialport/qserialport_wince.cpp src/serialport/qserialport_wince_p.h Change-Id: Ibb917652b132e66fbb90f437bf762c1094911dc0
| * Use Q_NULLPTR where it is possibleDenis Shienkov2014-12-101-1/+1
| | | | | | | | | | Change-Id: I7261a92ea4405c8aeab7670f73e7225ed7e4d9d0 Reviewed-by: Sergey Belyashov <Sergey.Belyashov@gmail.com>
* | Update copyright headersJani Heikkinen2015-02-131-6/+6
|/ | | | | | | | | | 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: Sergey Belyashov <Sergey.Belyashov@gmail.com> Reviewed-by: Denis Shienkov <denis.shienkov@gmail.com>
* Fix QSPI::isNull()Denis Shienkov2014-11-211-3/+5
| | | | | | | | | | | 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: Sergey Belyashov <Sergey.Belyashov@gmail.com>
* Update license headers and add new license filesAntti Kokko2014-09-091-18/+10
| | | | | | | | | - Renamed LICENSE.LGPL to LICENSE.LGPLv21 - Added LICENSE.LGPLv3 & LICENSE.GPLv2 - Removed LICENSE.GPL Change-Id: I08685205169cdd4b49a651ed98f36ba1e6c1bb29 Reviewed-by: Sergey Belyashov <Sergey.Belyashov@gmail.com>
* Add API for querying the serial numberLaszlo Papp2014-03-021-2/+18
| | | | | | | | | | | Thanks go to Massimo Callegari for the initial patch and the request to remind us again. Thanks also go to Denis and Sergey for working on the windows serial number parser. Task-number: QTBUG-31981 Change-Id: I60d882280f481eb99d275e0a9c81da50292b1c61 Reviewed-by: Massimo Callegari <massimocallegari@yahoo.it> Reviewed-by: Sergey Belyashov <Sergey.Belyashov@gmail.com>
* Do not use the deprecated method in the "See also" sectionLaszlo Papp2014-03-011-2/+2
| | | | | Change-Id: I2a73e9dc19e93c678d803d4aaf2e03c19e7613fb Reviewed-by: Sergey Belyashov <Sergey.Belyashov@gmail.com>
* Obsolete the isValid() method in QSerialPortInfoLaszlo Papp2013-11-301-0/+1
| | | | | | | Task-number: QTBUG-35184 Change-Id: Ie822943bcaf071024bc4f9782441b0534fcbd43d Reviewed-by: Sergey Belyashov <Sergey.Belyashov@gmail.com> Reviewed-by: Denis Shienkov <denis.shienkov@gmail.com>
* Add more "See also" references for the serial port info documentationLaszlo Papp2013-07-081-0/+22
| | | | | | Change-Id: I90fbcd6ce4f88869528ea8757aa7dd428c3adaa3 Reviewed-by: Sergey Belyashov <Sergey.Belyashov@gmail.com> Reviewed-by: Jerome Pasion <jerome.pasion@digia.com>
* Doc: Updates based on sanity checkv5.1.0-beta1Venugopal Shivashankar2013-05-061-2/+1
| | | | | | | | | | | | | - 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>
* Add accessor methods for checking the availability of the PID/VIDLaszlo Papp2013-03-261-0/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* Change the return type of the vendor/productIdentifier() APILaszlo Papp2013-03-251-10/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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 missed renaming for standardRatesAleksei Timofeyev2013-02-081-1/+1
| | | | | | | Change-Id: I716667d26cd89c2a619798bf769a59d847b6bff3 Reviewed-by: Laszlo Papp <lpapp@kde.org> Reviewed-by: Sergey Belyashov <Sergey.Belyashov@gmail.com> Reviewed-by: Denis Shienkov <denis.shienkov@gmail.com>
* Remove the QtSerialPort namespace define and hence namespace usageLaszlo Papp2013-02-071-4/+0
| | | | | | | | | | * This is for following the convention in the Qt Project with the rest. * This fixes examples and tests to build now as all of them are broken due to the regression. Change-Id: I3f4d64d97466520aea621da582a64a0d97e32136 Reviewed-by: Denis Shienkov <denis.shienkov@gmail.com>
* Fix the potential build breaks introduced by a previous commit (regression)Laszlo Papp2013-02-071-0/+4
| | | | | | | | | | | | | This is due to the fact the Qt namespace is not considered which is normally not a problem as it is empty by default. However, using something like "-qtnamespace MyNamespace" when configuring Qt will break the QtSerialPort build completely. This is intended to be a fix for the library, and the examples/tests will be fixed in a separate commit if necessary. Change-Id: Iecd24dc5135c3a9645910754589dfd8bf4942337 Reviewed-by: Sergey Belyashov <Sergey.Belyashov@gmail.com> Reviewed-by: Denis Shienkov <denis.shienkov@gmail.com>
* Update the "\since 5.0" tag to "\since 5.1" for the public classesLaszlo Papp2013-02-031-1/+1
| | | | | | | Change-Id: I503d94e4e94cb1a8cc8fa908a894c5425a230238 Reviewed-by: Thiago Augusto Correa <thiago.correa@gmail.com> Reviewed-by: Sergey Belyashov <Sergey.Belyashov@gmail.com> Reviewed-by: Denis Shienkov <denis.shienkov@gmail.com>
* Refactor certain variable names, remove useless comments and so forthLaszlo Papp2013-02-011-6/+6
| | | | | Change-Id: Id8af629c2b488050b8accd4c552e9b0ebf366e32 Reviewed-by: Denis Shienkov <denis.shienkov@gmail.com>
* Make all the file renames and relevant changesLaszlo Papp2013-01-271-0/+242
"git log --follow /path/to/the/file/in/question" can be used, for instance, for the renamed files to get the whole history. Change-Id: I20da087ca88e2c179a6c3232772fa21575e0aa6a Reviewed-by: Denis Shienkov <denis.shienkov@gmail.com>