summaryrefslogtreecommitdiff
path: root/examples
Commit message (Collapse)AuthorAgeFilesLines
...
* Add a new simple and command line reader exampleLaszlo Papp2013-10-255-1/+174
| | | | | | Change-Id: I69c05be5db564888986925d943aff32221f5b310 Reviewed-by: Sergey Belyashov <Sergey.Belyashov@gmail.com> Reviewed-by: Denis Shienkov <denis.shienkov@gmail.com>
* Add a new simple and command line writer exampleLaszlo Papp2013-10-255-1/+194
| | | | | | Change-Id: I5d893d18477790def27bfa1fa051d459a8193db5 Reviewed-by: Sergey Belyashov <Sergey.Belyashov@gmail.com> Reviewed-by: Denis Shienkov <denis.shienkov@gmail.com>
* Fix a typo in the examples (patity -> parity)Laszlo Papp2013-10-245-5/+5
| | | | | | Change-Id: I92b6fbe5fbc1a402919a8339086f495e351ca6dc Reviewed-by: Denis Shienkov <denis.shienkov@gmail.com> Reviewed-by: Sergey Belyashov <Sergey.Belyashov@gmail.com>
* Don't link against QtGui in cenumeratorAlejandro Exojo2013-10-081-0/+2
| | | | | | Change-Id: Ibc730410bae66a8547733a66daa4d1dcb5808534 Reviewed-by: Laszlo Papp <lpapp@kde.org> Reviewed-by: Denis Shienkov <denis.shienkov@gmail.com>
* Refactor the blocking master documentationLaszlo Papp2013-10-011-66/+69
| | | | | Change-Id: I67e1eb66c5661f6830389189a323aa7f97e474f9 Reviewed-by: Denis Shienkov <denis.shienkov@gmail.com>
* Doc: Review QtSerialPort documentationNico Vertriest2013-09-272-69/+67
| | | | | | | | | | Adapted to review comments Task-number: QTBUG-32173 Change-Id: I41839934c3aea9ccf3ef596e2a869b479f3c75ba Reviewed-by: Laszlo Papp <lpapp@kde.org> Reviewed-by: Jerome Pasion <jerome.pasion@digia.com>
* Add a missing space to the codeLaszlo Papp2013-07-081-1/+1
| | | | | | Change-Id: I8e97e51801dbef8154f2dcba1bd2b9464486eccf Reviewed-by: Denis Shienkov <denis.shienkov@gmail.com> Reviewed-by: Sergey Belyashov <Sergey.Belyashov@gmail.com>
* Doc: Updates based on sanity checkv5.1.0-beta1Venugopal Shivashankar2013-05-064-24/+28
| | | | | | | | | | | | | - 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>
* Fix examples directory layoutKai Koehne2013-05-0350-27/+29
| | | | | | | | | | | | | 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>
* Eliminate the blocking terminal example notes as it still does not existLaszlo Papp2013-04-301-3/+1
| | | | | Change-Id: I28986ada705996ada22b30d10877ea9eed0dba8f 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>
* Add accessor methods for checking the availability of the PID/VIDLaszlo Papp2013-03-263-6/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-253-17/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* 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-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>
* 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>
* 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>
* Replace the deprecated commands (\i, \o, \bold) with the new onesLaszlo Papp2013-02-284-17/+17
| | | | | | | | See the following page for details: http://doc-snapshot.qt-project.org/qt5-stable/qdoc/27-qdoc-commands-alphabetical.html Change-Id: I405deea5cf065075907ac7830e92bb064a1c72d0 Reviewed-by: Denis Shienkov <denis.shienkov@gmail.com>
* Do not add "core" to the QT variable as it is added by defaultLaszlo Papp2013-02-261-1/+1
| | | | | | Change-Id: I8d30a47331bdb26f1531d214f5da830eca03d030 Reviewed-by: Sergey Belyashov <Sergey.Belyashov@gmail.com> Reviewed-by: Denis Shienkov <denis.shienkov@gmail.com>
* Assign a new method name for the port name setting APILaszlo Papp2013-02-236-6/+6
| | | | | | | | | | | | | | | | | | * This is more intuitive as it is not setting the port with all its settings like baud rate, flow control, stop bits, parity, and so forth, but only the port name. * This will allow in upcoming change to establish a property for the port name along with a port name changed signal to be useful from different threads, QML, and so forth. * Clean up the documentation not to provide internal information to the end users, and also make the text a bit more concise and better readable. * Examples are also changed accordingly, to use the new API. Change-Id: Idbaa8ee2dee17c63fc0278f687ccc231c5ab670f Reviewed-by: Denis Shienkov <denis.shienkov@gmail.com>
* Unbreak some examples with custom namespaceLaszlo Papp2013-02-124-0/+16
| | | | | | | | QT_BEGIN/END_NAMESPACE is necessary for forward declaration for sure. Change-Id: I2e3a839218971b9443850e8098d9777652351265 Reviewed-by: Simo Fält <simo.falt@digia.com> Reviewed-by: Denis Shienkov <denis.shienkov@gmail.com>
* Fix the breakage for the terminal example when custom namespace is definedLaszlo Papp2013-02-082-2/+8
| | | | | | | | This is currently causing breakages on the CI machine, but it is a generic issue that can be reproduced by configuring qt with custom namespace. Change-Id: I40340ab1df5e2cc3dd67797a74cebcb09fbfd539 Reviewed-by: Denis Shienkov <denis.shienkov@gmail.com>
* Remove the QtSerialPort namespace define and hence namespace usageLaszlo Papp2013-02-0714-14/+16
| | | | | | | | | | * 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 license issues to pass the QtQA license testsLaszlo Papp2013-02-065-5/+5
| | | | | | | | | | | The issues were revealed by qtqa/tests/prebuild/license/tst_licenses.pl while trying to put the QtSerialPort under CI. X - Y is an unfortunate workaround, but seems to be necessary for now due to the following change: https://codereview.qt-project.org/#change,14529 Change-Id: I265f1929961705eda9db54386e721f20495c329c Reviewed-by: Denis Shienkov <denis.shienkov@gmail.com>
* Unbreak the terminal example compilationLaszlo Papp2013-02-061-5/+1
| | | | | | | | | | | | | | | | This is a workaround, and not a real fix as the whole namespace situation is a mess for now, and has to be discussed with others. The real fix has to wait, but the build has to be working right now off-hand. Also, there is not much point in exposing this global header file for Qt4 either as the usage of the two public classes should be enough along with the deterministic namespace name that will be agreed upon later (i.e. the namespace define will be removed most likely). Tested with Qt5, and the terminal example builds just fine on ArchLinux. Change-Id: I9609afb43997ed20bf9770b517a93121bff84d82 Reviewed-by: Denis Shienkov <denis.shienkov@gmail.com>
* Refactor certain variable names, remove useless comments and so forthLaszlo Papp2013-02-012-6/+6
| | | | | Change-Id: Id8af629c2b488050b8accd4c552e9b0ebf366e32 Reviewed-by: Denis Shienkov <denis.shienkov@gmail.com>
* Make the cross Qt4/5 versions experience better with forward headersLaszlo Papp2013-01-3015-15/+15
| | | | | | | | | | This is not a nice way, but quick of getting this feature done. For future reference, we should most likely do something as QtCreator does for instance with "QMAKE_SUBSTITUTES". Change-Id: I3df23ac019552f9586aede336296079109066da1 Reviewed-by: Sergey Belyashov <Sergey.Belyashov@gmail.com> Reviewed-by: Denis Shienkov <denis.shienkov@gmail.com>
* Improve terminal example handling of custom baud rate.Thiago A. Correa2013-01-281-2/+3
| | | | | | | | | | This makes the custom baud rate handling independent on the index of the last entry in the QComboBox. Change-Id: I5f0bfa148595e4312a8721a690e87e2fc36906d9 Reviewed-by: Laszlo Papp <lpapp@kde.org> Reviewed-by: Sergey Belyashov <Sergey.Belyashov@gmail.com> Reviewed-by: Denis Shienkov <denis.shienkov@gmail.com>
* Make all the file renames and relevant changesLaszlo Papp2013-01-2715-15/+15
| | | | | | | | "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>
* Change the QtCore reference in the copyright headers to QtSerialPortLaszlo Papp2013-01-2727-27/+27
| | | | | Change-Id: Ic19f6843d32260404f72038cf77aa6f686e7a3ff Reviewed-by: Denis Shienkov <denis.shienkov@gmail.com>
* Rename the SerialPort* classes to QSerialPort* including the internals.Laszlo Papp2013-01-2720-102/+102
| | | | | | | | | | | | | | | Unfortunately, the rename has to happen in a separate commit because of the limitations of "git": "git does not track renames of files in history, git only records tree snapshots. It can try to guess whether a change was a rename, or just unrelated removal+addition, when asked. You can help this by making the rename in a different commit from a modification. See man git-log -C and -M" ... so the rename will happen in the next change. Change-Id: Ibe56eba0a0d2c7489db48a6c519d60d3315c00de Reviewed-by: Denis Shienkov <denis.shienkov@gmail.com>
* Fix a few documentations issues (namespace and correct module name usage)Laszlo Papp2013-01-271-1/+1
| | | | | | | | | | * Reflect the namespace documentation to the QtSerialPort change. * Module names should be spelled with whitespaces in the documentation according to the following convention: http://qt-project.org/wiki/Spelling_Module_Names_in_Qt_Documentation Change-Id: I504d45140d3f56fda9d4d6cdd272157bac3959d6 Reviewed-by: Denis Shienkov <denis.shienkov@gmail.com>
* Use the BaudRate enumeration values instead of raw values in the examplesLaszlo Papp2013-01-265-5/+5
| | | | | Change-Id: I4e33c07972e391dc6833872b1c640e565df480ac Reviewed-by: Denis Shienkov <denis.shienkov@gmail.com>
* Change the variable names properly for the examples and tests in case of Qt4Laszlo Papp2013-01-267-7/+7
| | | | | Change-Id: I08609cb9c679002262a24b52fc46bbfcabb512d7 Reviewed-by: Denis Shienkov <denis.shienkov@gmail.com>
* Add the blockingmaster/slave to the examples.qdocLaszlo Papp2013-01-261-0/+2
| | | | | | | | Apparently, this had been mixed when those examples and their documentations were merged in. Change-Id: I94b6a355cc1bee1a910777b7bd8dfd3d40ea09bb Reviewed-by: Denis Shienkov <denis.shienkov@gmail.com>
* Change Denis' email address in the copyrights headersLaszlo Papp2013-01-2631-31/+31
| | | | | Change-Id: I8c564f68bb32423957f2171e1c76d8a428f16eb3 Reviewed-by: Denis Shienkov <denis.shienkov@gmail.com>
* Call the module QtSerialPort instead of QtAddOnSerialPortLaszlo Papp2013-01-2621-21/+21
| | | | | | | | Use the QTSERIALPORT as a term for internal variables as well to remain consistent with the freshly chosen module name. Change-Id: Ia780b105649b39a1eca46702466da5bc31ec5af0 Reviewed-by: Denis Shienkov <denis.shienkov@gmail.com>
* Move the library and example documentations to the right placesLaszlo Papp2013-01-266-0/+602
| | | | | Change-Id: Ia04d1f576b90ba705471b290b50f7adc2b13d00f Reviewed-by: Denis Shienkov <denis.shienkov@gmail.com>
* Change the copyright headers to the Qt Project standard formLaszlo Papp2013-01-2627-653/+653
| | | | | Change-Id: Id6414c91a0bc700734873cd798807868865cd453 Reviewed-by: Denis Shienkov <denis.shienkov@gmail.com>
* Use "BaudRate" instead of "Rate" and "BaudXXXX" instead of "RateXXXX"Laszlo Papp2013-01-269-37/+37
| | | | | Change-Id: Id5db378b6da89f672cb55fa312e325cd1e9b88ce Reviewed-by: Denis Shienkov <denis.shienkov@gmail.com>
* Added documentation for BlockingSlave exampleDenis Shienkov2012-12-202-9/+21
| | | | | | | | Added documentation for BlockingSlave example and added bookmarks, used in documentation to refer to code. Change-Id: Ic60ff4eb46661deed12bcaaee84e5f7647cc4937 Reviewed-by: Denis Shienkov <denis.shienkov@gmail.com>
* Added serial Master and serial Slave examplesDenis Shienkov2012-12-1311-1/+917
| | | | | | | | Added examples to demonstrate the Signal/Slot approach using the serial interface. Change-Id: I09f451afba67dbac8c357b0aa723460fc8d4b6aa Reviewed-by: Denis Shienkov <denis.shienkov@gmail.com>
* Added documentation for BlockingMaster exampleDenis Shienkov2012-12-132-6/+19
| | | | | | | | Added documentation for BlockingMaster example and added bookmarks, used in documentation to reffer to code. Change-Id: I923d27a51d46b17eaf478c0280823c8ce9b7ea3e Reviewed-by: Denis Shienkov <denis.shienkov@gmail.com>
* Refactoring for BlockingMaster and BlockingSlave examplesDenis Shienkov2012-12-0512-123/+125
| | | | | | | Renamed classes and methods to a more appropriate in meaning. Change-Id: I69f1ef2fb30f3e207e506fea60eeca3195bf70ed Reviewed-by: Denis Shienkov <denis.shienkov@gmail.com>
* Refactoring for BlockingMaster and BlockingSlave examplesDenis Shienkov2012-11-306-14/+14
| | | | | | | | | * Standardized library headers inclusion. * Renamed methods of TransactionThread to a more appropriate in meaning. Change-Id: Ibfe91b3b7723b0454c36a5677fe2dad464d4da13 Reviewed-by: Sergey Belyashov <Sergey.Belyashov@gmail.com> Reviewed-by: Denis Shienkov <denis.shienkov@gmail.com>