summaryrefslogtreecommitdiffstats
path: root/src/serialbus/qmodbusclient_p.h
Commit message (Collapse)AuthorAgeFilesLines
* Include what you need: <QPointer>Marc Mutz2023-10-131-0/+3
| | | | | | | | | | | | | | | | | | | | | | | All these TUs relied on transitive includes of qpointer.h, maybe to a large extent via qevent.h, though, given that qevent.h is more or less the only public QtBase header that includes qpointer.h, something else seems to be at play here. Said qevent.h actually needs QPointer in-name-only, so a forward declaration would suffice. Prepare for qevent.h dropping the include. The algorithm I used was: If the TU mentions 'passiveGrabbers', the name of the QEvent function that returns QPointers, and the TU doesn't have qpointer.h included explicitly, include it. That may produce False Positives, but better safe than sorry. Otherwise, in src/, add an include to all source and header files which mention QPointer. Exception: if foo.h of a foo.cpp already includes it, don't include again. Task-number: QTBUG-117670 Change-Id: Iec41618b4877a94432a7de4a2473f326cb70675a Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Use SPDX license identifiersLucie Gérard2022-06-101-38/+2
| | | | | | | | | | | Replace the current license disclaimer in files by a SPDX-License-Identifier. License files are organized under LICENSES directory. Pick-to: 6.4 Task-number: QTBUG-67283 Change-Id: Ie17b09db5a4aa7bb0d33906360f1125e9632425c Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
* Use up-to date LGPL license headerKai Köhne2021-11-301-11/+14
| | | | | | | | | Remove usages of outdated LGPL3 header that references LICENSES.LGPLv3 instead of LICENSES.LGPL3. Change-Id: I2dd25a1a7d6ad3e3cbb06753bbc839e26f4a7b26 Reviewed-by: André Hartmann <aha_1980@gmx.de> Reviewed-by: Jani Heikkinen <jani.heikkinen@qt.io>
* Update dependencies on 'dev' in qt/qtserialbusQt Submodule Update Bot2019-10-301-0/+1
| | | | | | | | Also added missing limits.h inclusion for INT_MAX, as the implicit inclusion is gone in qtbase. Change-Id: I897e87b477b739f7833d28c318d7e33bd458dbb0 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Rewrite RTU master state machineKarsten Heimrich2019-04-011-0/+1
| | | | | | | Task-number: QTBUG-73965 Task-number: QTBUG-73230 Change-Id: I4e4b201b172d32802ce934f111631279dc7157e1 Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
* Use QSharedPointer::create() moreMarc Mutz2017-07-241-1/+1
| | | | | | | | | | This is the result of running the (experimental) clang-tidy check qt-modernize-qsharedpointer-create Discarded changes: none. Change-Id: I4eca880aac30cf595b7f0667c755dcad1734abcb Reviewed-by: Karsten Heimrich <karsten.heimrich@qt.io>
* Updated copyright headersAndre Hartmann2017-02-021-1/+1
| | | | | Change-Id: I7d38491c7ee15a1de788375acf9144c59b507d2a Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
* Use 'nullptr' where it is possibleDenis Shienkov2016-04-211-1/+1
| | | | | Change-Id: I729e6b53cbc0b9a16c72c2351cc95d6bd7a2a0aa Reviewed-by: Alex Blasche <alexander.blasche@theqtcompany.com>
* Cleanup constructors and destructors.Karsten Heimrich2016-01-291-4/+1
| | | | | | | | | | | | - replace Q_DECL_EQ_DEFAULT/DELETE with explicit '= default/delete' - DebugHandler: no default ctor necessary - QModbusCommEvent: fix = default that should have been = delete - remove defaulted ctors/ dtors, where possible, matching the current module style Change-Id: I7d6fd5b8404cbb5c2741927ec676c6f8a1f75c22 Reviewed-by: Marc Mutz <marc.mutz@kdab.com> Reviewed-by: Alex Blasche <alexander.blasche@theqtcompany.com>
* Implement timeout handling more close to the specification.Karsten Heimrich2016-01-291-0/+2
| | | | | | | | - Implements 3.5 character timeout handling. - Take send and response timeouts into account. Change-Id: I765dfe188b45671f007cb3f8f1cc66bb48ce94ed Reviewed-by: Alex Blasche <alexander.blasche@theqtcompany.com>
* Adjust header includes according to our coding conventions.Karsten Heimrich2016-01-081-2/+2
| | | | | Change-Id: Id2c01e09e5d24bf2ecce57211cb13299478544e3 Reviewed-by: Alex Blasche <alexander.blasche@theqtcompany.com>
* Merge duplicated code, simplify things a bit.Karsten Heimrich2016-01-081-2/+12
| | | | | Change-Id: Ie7c7833ff13e6680a05eab1153078a6717932c8e Reviewed-by: Alex Blasche <alexander.blasche@theqtcompany.com>
* Implement minimum response timeout, update auto-test.Karsten Heimrich2015-12-181-1/+1
| | | | | Change-Id: I4f46cf74dd486ca56ea17437e15638246283363e Reviewed-by: Alex Blasche <alexander.blasche@theqtcompany.com>
* Implement: If a queued object gets deleted, remove it from the queue.Karsten Heimrich2015-12-181-0/+3
| | | | | Change-Id: Ibe9902e2a884b844898a88544fed809d3c7f5eeb Reviewed-by: Alex Blasche <alexander.blasche@theqtcompany.com>
* Implement number of retries before a request fails.Karsten Heimrich2015-12-181-1/+16
| | | | | Change-Id: If3d1f50b431793dcb9209cfd20f077aa98675431 Reviewed-by: Alex Blasche <alexander.blasche@theqtcompany.com>
* Move QModbusClient responseTimer into QModbusRtuSerialMasterAlex Blasche2015-11-241-5/+0
| | | | | | | | | | The TCP client doesn't use a queue system for requests and therefore needs one timer per request. Therefore the abstraction offered by QModbusClient is not suitable for the TCP client. As a consequence we move the response timer into the RTU client implementation. Change-Id: Ic30dfd730bcdae42ee7515be0fdf0eaff64af2fa Reviewed-by: Karsten Heimrich <karsten.heimrich@theqtcompany.com>
* Merge duplicated QueueElement handling code into one function.Karsten Heimrich2015-11-231-0/+1
| | | | | | Change-Id: I3d2d4f75e02659eabdb63ac78667f764e998f58a Reviewed-by: Ralf Nolden <nolden@kde.org> Reviewed-by: Alex Blasche <alexander.blasche@theqtcompany.com>
* Implement raw request send and receive handling.Karsten Heimrich2015-11-231-1/+4
| | | | | Change-Id: I6564e771830f8c2575e8c35376a36275728d06d4 Reviewed-by: Alex Blasche <alexander.blasche@theqtcompany.com>
* Merge the TCP and RTU read/write implementations.Karsten Heimrich2015-11-191-0/+5
| | | | | | | | | This allows us to get rid of several public pure virtual functions and to have the implementation in a single place instead of duplicating it in several classes. Change-Id: I88fb28a5d507c7b64d20bba73765534e2925165e Reviewed-by: Karsten Heimrich <karsten.heimrich@theqtcompany.com>
* Implements receiving of TCP Modbus responses on client sideAlex Blasche2015-11-181-0/+6
| | | | | Change-Id: Ib5c9301d1c732cc5bf4ba4dd98789eda0e951e35 Reviewed-by: Karsten Heimrich <karsten.heimrich@theqtcompany.com>
* Update virtuals and explicit, default {con|de}structors.Karsten Heimrich2015-11-161-5/+5
| | | | | | | | | One could argue superfluous, though I've done this to keep the style more consistent througout the Modbus implementation. Change-Id: I39f6fe739bda2c518fafe072b9a00b74942e2d08 Reviewed-by: Ralf Nolden <nolden@kde.org> Reviewed-by: Karsten Heimrich <karsten.heimrich@theqtcompany.com>
* Unify include statements.Karsten Heimrich2015-11-111-3/+3
| | | | | Change-Id: I3839727c2ef6eba897968effe7e6fc03c62742ad Reviewed-by: Alex Blasche <alexander.blasche@theqtcompany.com>
* Introduce API to manage response timerAlex Blasche2015-11-071-2/+11
| | | | | | | The timer will keep track of the expired time since sending a request. Change-Id: Iecf64980d3fea778d391a87fd63c020600e0ec02 Reviewed-by: Karsten Heimrich <karsten.heimrich@theqtcompany.com>
* Add QModbusClient::timeout propertyAlex Blasche2015-10-271-1/+3
| | | | | | | | | | This is required to control the timeout before a client assumes a server to be non-responsive. The upcoming client implementations will use this property. Change-Id: Ie276d979de54db3f932ae66d8655560095ea7cb8 Reviewed-by: Karsten Heimrich <karsten.heimrich@theqtcompany.com>
* Implement request generation, add additional auto-tests.Karsten Heimrich2015-10-251-1/+6
| | | | | | Change-Id: Ia1d57e67bdc3398d3e7c0097aeb5eb7de8096133 Reviewed-by: Alex Blasche <alexander.blasche@theqtcompany.com> Reviewed-by: Karsten Heimrich <karsten.heimrich@theqtcompany.com>
* Implement write multiple registers response handling.Karsten Heimrich2015-10-191-0/+2
| | | | | | | | Auto-test for limits of number of registers 0 to 124. Change-Id: Id233418d79e3d806bc61ddd98bf8a451f3a93146 Reviewed-by: Karsten Heimrich <karsten.heimrich@theqtcompany.com> Reviewed-by: Ralf Nolden <nolden@kde.org>
* Implement write single register response handling.Karsten Heimrich2015-10-191-0/+2
| | | | | | Change-Id: I78c8ab894cffa6c0c10d3da4523bd1885a5923f7 Reviewed-by: Karsten Heimrich <karsten.heimrich@theqtcompany.com> Reviewed-by: Ralf Nolden <nolden@kde.org>
* Implement read/write multiple registers response handling.Ralf Nolden2015-10-191-0/+2
| | | | | | | | | | | Backed with auto-test. The start address is set in the test when creating the unit to 100 to create a valid unit instead of setting the start address in the implementation to 0 which overwrites an existing start address of a request unit. Change-Id: Iff80d4ae03ff3a03a8391b58afd87b7ab0378c61 Reviewed-by: Karsten Heimrich <karsten.heimrich@theqtcompany.com> Reviewed-by: Alex Blasche <alexander.blasche@theqtcompany.com>
* Add processReadInputRegistersResponse() w/ testRalf Nolden2015-10-161-0/+1
| | | | | Change-Id: I823758612d1a26573865ea935d1c1717921d0a69 Reviewed-by: Alex Blasche <alexander.blasche@theqtcompany.com>
* Add processReadHoldingRegistersResponse() w/ testRalf Nolden2015-10-161-0/+2
| | | | | Change-Id: If3e1fe38413cb0ba300bd7890730c1e4346d462f Reviewed-by: Alex Blasche <alexander.blasche@theqtcompany.com>
* Add processReadDiscreteInputsResponse() with testRalf Nolden2015-10-151-0/+1
| | | | | | Change-Id: Ia5c4650b781e6af8c7e9363cc4880e9ecdc429e8 Reviewed-by: Alex Blasche <alexander.blasche@theqtcompany.com> Reviewed-by: Karsten Heimrich <karsten.heimrich@theqtcompany.com>
* Implement coils read/single|multiple write processing.Karsten Heimrich2015-10-131-0/+3
| | | | | | Change-Id: Iac49d6f161438196eadadc6e172535612ff053c7 Reviewed-by: Karsten Heimrich <karsten.heimrich@theqtcompany.com> Reviewed-by: Alex Blasche <alexander.blasche@theqtcompany.com>
* Define interface for request/response proccessing.Karsten Heimrich2015-10-131-0/+2
| | | | | | Change-Id: Ib972142f8933b4caa67d9201e9790dbe216f5bd3 Reviewed-by: Karsten Heimrich <karsten.heimrich@theqtcompany.com> Reviewed-by: Alex Blasche <alexander.blasche@theqtcompany.com>
* Rename include guards after class name change.Karsten Heimrich2015-09-301-3/+3
| | | | | | Change-Id: I185e8f710b28b02f19cee6011c0343eb231248d5 Reviewed-by: Ralf Nolden <nolden@kde.org> Reviewed-by: Karsten Heimrich <karsten.heimrich@theqtcompany.com>
* Rename classes, master -> client, slave -> serverKarsten Heimrich2015-09-281-3/+3
| | | | | | Change-Id: I87011ffd423842cf9dbe5babc0801c95b47c9a86 Reviewed-by: Ralf Nolden <nolden@kde.org> Reviewed-by: Karsten Heimrich <karsten.heimrich@theqtcompany.com>
* Rename files. master -> client, slave -> serverKarsten Heimrich2015-09-281-0/+68
Change-Id: I5493bb6d1966abcf3d8ec764900d177317703d7e Reviewed-by: Ralf Nolden <nolden@kde.org> Reviewed-by: Karsten Heimrich <karsten.heimrich@theqtcompany.com>