summaryrefslogtreecommitdiffstats
path: root/tests
Commit message (Collapse)AuthorAgeFilesLines
* Generic(V1): Fix emitting framesReceived when disconnectedAndre Hartmann2020-02-272-2/+4
| | | | | | | | | | | | | | | | | When one of these plugins was used in the CAN-Example, the frames received slot was still called after disconnecting. That made the example stuck and emitting lots of "Cannot read frame as device is not connected." messages. This is mostly relevant for developers though, as these plugins are not deployed. Change-Id: I675518148f4bf37f11911dd7a0f6423ae18be19d Reviewed-by: Denis Shienkov <denis.shienkov@gmail.com> Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
* Add binary compatibility file for qtserialbus 5.14 branchMilla Pohjanheimo2019-12-161-0/+5526
| | | | | | | | BC file built against 5.14.0 added. Change-Id: I1026ada6cac92800e0041e3b443fb880a5ab43b0 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io> Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
* QCanBusDevice: Undo source-incompatible changeAndre Hartmann2019-09-061-0/+2
| | | | | | | Introduced in eca5edf45a8043 Change-Id: If1586d0b62b0544feee5b07289503966efa0f16d Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
* Merge remote-tracking branch 'origin/5.13' into devQt Forward Merge Bot2019-08-131-0/+5487
|\ | | | | | | Change-Id: I27e3cc8e4200cc12606a32ec253794def104a3f5
| * Binary compatibility file for Qt5.13.0 fr QtSerialBusMilla Pohjanheimo2019-08-121-0/+5487
| | | | | | | | | | | | | | BC file added. Change-Id: I0c59afb6169f0915c0f23048ed19566765383f3d Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
* | QCanBusDevice: More error codes and messages on failuresAndre Hartmann2019-07-311-38/+89
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | More error messages can now be logged with the logging framework or directly accessed with the errorOccurred() signal. The new error codes QCanBusDevice::OperationError and QCanBusDevice::TimeoutError were introduced to signal situations where the device is not able to perform a specific operation respectively when an operation timed out. [ChangeLog][QCanBusDevice] Added the QCanBusDevice::OperationError and QCanBusDevice::TimeoutError codes to signal wrong operation respectively timeout errors. Task-number: QTBUG-70449 Change-Id: Ifa0831bd0947b624579ae8662df10a2a9ce38714 Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
* | Merge remote-tracking branch 'origin/5.13' into devQt Forward Merge Bot2019-06-111-1/+2
|\| | | | | | | Change-Id: I884ade0e33e4533880c2e86f07b8f747bebfa1ba
| * Merge remote-tracking branch 'origin/5.12' into 5.13Qt Forward Merge Bot2019-06-081-1/+2
| |\ | | | | | | | | | Change-Id: Ie9901b3993fc8f7d3c3f7f09763db6843e6cb514
| | * Android: disable tests requiring pluginsAlex Blasche2019-05-081-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | androiddeployqt cannot work out that the plugins under qtserialbus/tests/auto/plugins are required to pass this test. Fixes: QTBUG-73621 Change-Id: Ib246ff186ec4c8688e1525fc9500d69fda4775a4 Reviewed-by: André Hartmann <aha_1980@gmx.de> Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io> Reviewed-by: BogDan Vatra <bogdan@kdab.com>
* | | Merge remote-tracking branch 'origin/5.13' into devQt Forward Merge Bot2019-05-041-2/+2
|\| | | | | | | | | | | Change-Id: I563668f100ffd7e39e94f109642b7d51b6b9a135
| * | Reduce minimal Modbus response timeout to 10msAlex Blasche2019-04-301-2/+2
| | | | | | | | | | | | | | | | | | Fixes: QTBUG-75461 Change-Id: Id5aed512cc9f163dc719cae0b121b9c65e0f232a Reviewed-by: André Hartmann <aha_1980@gmx.de>
* | | QCanBusDevice::Filter: Add operators == and !=Andre Hartmann2019-02-111-0/+86
|/ / | | | | | | | | | | | | | | | | | | | | [ChangeLog][QCanBusDevice] Added operators to compare QCanBusDevice::Filter for equality or inequality. Fixes: QTBUG-72979 Change-Id: I4cfedca5fcd0b4b8e300ad984b5c3065ca5b8a4f Reviewed-by: Denis Shienkov <denis.shienkov@gmail.com> Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
* | Merge remote-tracking branch 'origin/5.12' into 5.13v5.13.0-beta1v5.13.0-alpha1Qt Forward Merge Bot2019-02-021-0/+5103
|\| | | | | | | Change-Id: Iafab50612db47a99c06b30b77b51dc71f665577f
| * Add binary compatibility file for QtSerialBus for Qt 5.12Milla Pohjanheimo2018-12-181-0/+5103
| | | | | | | | | | | | | | Binary compatibility file added. Change-Id: I3f63fc11a7f5b8ab24f9334aaf2f71ac989fe303 Reviewed-by: Sergio Ahumada <sahumada@texla.cl>
* | Remove hard QtSerialPort dependency from QtSerialBusAlex Blasche2018-11-072-2/+9
|/ | | | | | Task-number: QTBUG-70360 Change-Id: I511e368e227a46f9eba178612c8b106f5930ee49 Reviewed-by: André Hartmann <aha_1980@gmx.de>
* Fix incorrect reading and writing of QModbusServer registersAlex Blasche2018-10-241-0/+66
| | | | | | | | | | | Prior to this change the startAddress of the current value mapping was not taken into account. Therefore shifted reads and write (with non-zero startAddresses) were accessing the wrong register indexes. Fixes: QTBUG-64843 Change-Id: Iaf1f91705586f45db059d6dd54b68a84d16926a0 Reviewed-by: Karsten Heimrich <karsten.heimrich@qt.io>
* QCanBusDevice: Don't return a bool value from clear()Andre Hartmann2018-09-131-9/+9
| | | | | | | | | | | | | As pointed out in the API review, this could lead to confusion when reading statements like this: if (device->clear(QCanBusDevice::Input)) { // ... } Change-Id: Ic039d3ed32f9ef8e7c3fb8b5f0659b8c9afd8038 Reviewed-by: Alex Blasche <alexander.blasche@qt.io> Reviewed-by: Denis Shienkov <denis.shienkov@gmail.com>
* Merge remote-tracking branch 'origin/5.11' into devQt Forward Merge Bot2018-06-121-0/+5038
|\ | | | | | | Change-Id: Ica7cd1da4c15676aceff65f061d20c43e8f5bf69
| * Add binary compatibility file for QtSerialBus for 5.11Milla Pohjanheimo2018-06-051-0/+5038
| | | | | | | | | | | | | | Binary compatibility file for bic test added. Change-Id: I93a13cf30861a7f3e3e97811216c0c37a8158151 Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
* | Merge remote-tracking branch 'origin/5.11' into devQt Forward Merge Bot2018-06-041-1/+1
|\| | | | | | | | | | | | | Conflicts: .qmake.conf Change-Id: I1e024cf6987c7f869b991dbcc14591fb4d382340
| * tst_qmodbusclient: Fix inconsistent overridesFriedemann Kleint2018-05-301-1/+1
| | | | | | | | | | | | | | | | | | | | Add override to processResponse(), fixing: \tst_qmodbusclient.cpp(70,10): warning: 'processResponse' overrides a member function but is not marked 'override' [-Winconsistent-missing-override] bool processResponse(const QModbusResponse &response, QModbusDataUnit *data) Change-Id: Ie12af6914647c0a078189f85af1d3b037828eb6e Reviewed-by: Karsten Heimrich <karsten.heimrich@qt.io>
* | Merge remote-tracking branch 'origin/5.11' into devQt Forward Merge Bot2018-03-101-0/+10
|\| | | | | | | Change-Id: I2f548dce2bba78a757355addb35ad80f072701c0
| * Ensure QModbusDevice::close() handles being unconnected alreadyv5.11.0-beta2Alex Blasche2018-03-061-0/+10
| | | | | | | | | | | | | | | | | | | | | | | | Prior to this change, an unconnected device would transition into the Closing state if disconnectDevice() was called. Since the transition to Unconnected is bound to sockets being closed the already unconnected ModbusDevice would forever hang in CLosing. Task-number: QTBUG-66648 Change-Id: Ia439f6b63b7d4ab7f377a45fb09cb5f5b99627f7 Reviewed-by: André Hartmann <aha_1980@gmx.de> Reviewed-by: Karsten Heimrich <karsten.heimrich@qt.io>
* | Merge remote-tracking branch 'origin/5.11' into devQt Forward Merge Bot2018-02-281-3/+3
|\| | | | | | | Change-Id: If041fd380305b2fa40106998b036079a76b971d3
| * Tests: Use read-only access to array objects in tst_qcanbusdeviceAndre Hartmann2018-02-101-3/+3
| | | | | | | | | | | | | | Amends 48325e7e0b1094d96d32c39ad4df6d1c816c5c1e Change-Id: I328199bb0b34d5a484b5ca09247eb2fa04bca452 Reviewed-by: Denis Shienkov <denis.shienkov@gmail.com>
* | QCanBusDevice: Add readAllFrames() and clear() functionsAndre Hartmann2018-02-191-0/+58
|/ | | | | | | | | | | [ChangeLog][QCanBusDevice] Added functions to read all frames from the receive buffer and to clear the receive or transmit buffer. Task-number: QTBUG-66143 Change-Id: I0b2f9bd0044c688f6a3261ccce8c22b9e58dfea8 Reviewed-by: Denis Shienkov <denis.shienkov@gmail.com> Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
* Merge remote-tracking branch 'origin/5.10' into devLiang Qi2018-01-201-0/+5038
|\ | | | | | | | | | | | | Conflicts: .qmake.conf Change-Id: Ibcb5508d7f131cbeba0d047111177a8dff1e5f68
| * Add binary compatibility file for QtSerialBus for 5.10Milla Pohjanheimo2017-12-141-0/+5038
| | | | | | | | | | | | | | File to test binary compatibility added for 5.10 Change-Id: I0d9d7fa85e02f3cc34c108e81ecc54ed27b8adbd Reviewed-by: Sergio Ahumada <sahumada@texla.cl>
* | CAN: Cleanup and modernize testsAndre Hartmann2017-11-233-94/+80
| | | | | | | | | | | | | | | | | | | | | | | | | | * Adopt includes to common style * Use member inits * Use Qt5 connect style * Replace QVERIFY by QCOMPARE where applicaple and vice versa * Prettify comments * Replace QString::fromLatin1 with QStringLiteral Change-Id: I9d838d12062a8fa3312105f8f9110e1ba65616ee Reviewed-by: Denis Shienkov <denis.shienkov@gmail.com> Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
* | QCanBusFrame: Validate CAN FD payload lengthsAndre Hartmann2017-11-081-1/+43
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In contrast to CAN 2.0 which allows all payload sizes between 0 and 8, CAN FD only has discrete payload lengths: 0..8, 12, 16, 20, 24, 32, 48, and 64. [ChangeLog][QCanBusFrame] QCanBusFrame::isValid() now checks for invalid CAN FD payload lengths. E.g. 24 is a valid CAN FD payload length, but 28 is not. Frames with invalid data field size may therefore be discarded by QCanBusDevice::writeFrame() as it is impossible to transmit them on a real CAN bus. Task-number: QTBUG-63294 Change-Id: I2598194061f7f8b15f4ee5eabbf41e3134b92d4f Reviewed-by: Alex Blasche <alexander.blasche@qt.io> Reviewed-by: Rolf Eike Beer <eb@emlix.com> Reviewed-by: Denis Shienkov <denis.shienkov@gmail.com>
* | Cleanup and synchronize the dummy pluginsAndre Hartmann2017-11-065-26/+15
|/ | | | | | | | We keep both available to test against the different versions of QCanBusFactory. But they should be as similar as possible. Change-Id: I94488bdddeecc405026b41a5ead15e1342839faa Reviewed-by: Denis Shienkov <denis.shienkov@gmail.com>
* QCanBusFrame: Introduce local echo flagAndre Hartmann2017-07-041-10/+45
| | | | | | | | | | | | | | | | | | | | | | | | | | Inspiration for change after reading the SocketCAN mailing list thread: https://marc.info/?l=linux-can&m=147438437202356&w=2 The main usage is, to verify at application stage, that and when a frame was really sent on the bus. For architectures like SocketCAN, where multiple applications can connect to one CAN bus on the same system, this flag also indicates frames that are sent by an other local running application (i.e. not coming from the real bus). Implementations done for SystecCAN, VectorCAN and SocketCAN plugin. PCAN Basic does not seem to have support for this flag. For SocketCAN, see section "4.1.7 RAW socket returned message flags" in https://www.kernel.org/doc/Documentation/networking/can.txt for reference. [ChangeLog][QCanBusFrame] Added local echo flag to mark all echo frames that are generated by the hardware on successful transmission to CAN bus as such. Change-Id: I66d4ce1ec6dfd0a0b994a7b7a9de1a5f503fcb70 Reviewed-by: Denis Shienkov <denis.shienkov@gmail.com> Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
* QCanBusFrame: Add missing Error State Indicator streaming testsAndre Hartmann2017-04-041-9/+17
| | | | | | | | Amends commit 19d4d81e8dd7ccb9831bea725989d2a08d258207 Change-Id: Icd9e64c0b480b627e22b3d4fce4fff68a87ab410 Reviewed-by: Alex Blasche <alexander.blasche@qt.io> Reviewed-by: Rolf Eike Beer <eb@emlix.com>
* Merge remote-tracking branch 'origin/5.8' into 5.9v5.9.0-beta1Liang Qi2017-03-3118-16/+4703
|\ | | | | | | | | | | | | | | Conflicts: src/plugins/canbus/canbus.pro src/plugins/canbus/vectorcan/vectorcanbackend.cpp Change-Id: I3625693784e88204c93479806242ae70c7ec7ff3
| * Fix build with -no-feature-libraryUlf Hermann2017-03-061-0/+2
| | | | | | | | | | | | | | | | | | Drop an unused include, don't try to set the library path if !QT_CONFIG(library) and don't build the peakcan and tinycan plugins as those use QLibrary to look up their symbols. Change-Id: Id8b1245c1cf69f7548e050d47d5956f53562477d Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
| * Binary compatibility file and global.cfg for qtserialbus (5.8.0)Milla Pohjanheimo2017-02-062-0/+4685
| | | | | | | | | | | | | | Added binary compatibility file and global.cfg for qtserialbus Change-Id: I43c27c5ce36718856a1b3fa7b8870c3de003d819 Reviewed-by: Sergio Ahumada <sahumada@texla.cl>
| * Updated copyright headersAndre Hartmann2017-02-0216-16/+16
| | | | | | | | | | Change-Id: I7d38491c7ee15a1de788375acf9144c59b507d2a Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
* | Add plugin to test CanBusFactory compatibilityAndre Hartmann2017-03-307-2/+242
| | | | | | | | | | | | | | | | | | Add a plugin that implements the now deprecated QCanBusFactory to assure this still works. Change-Id: Idd0e121ebdd324bacc01c1805ab43749a85c7a84 Reviewed-by: Alex Blasche <alexander.blasche@qt.io> Reviewed-by: Denis Shienkov <denis.shienkov@gmail.com>
* | QCanBusFactory: Restore binary compatibility to Qt 5.8Andre Hartmann2017-03-301-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | Added a new QCanBusFactoryV2 to load plugins with the new virtual function availableDevices(). To be able to still load plugins compiled against Qt 5.8, both factories have to be considered when loading plugins and creating devices. Change-Id: I843cdd0b82193e391699daa298454c8b9522e860 Reviewed-by: Denis Shienkov <denis.shienkov@gmail.com> Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
* | GenericBusPlugin: Remove unneded includeAndre Hartmann2017-03-131-2/+0
| | | | | | | | | | Change-Id: I118d1a5e2ec4fff583476a1a643a37764ce2b49b Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
* | QCanBusDeviceInfo: cancel friendship to GenericBusPluginAndre Hartmann2017-03-133-5/+8
| | | | | | | | | | | | | | | | | | | | GenericBusPlugin is just used for internal testing. It does not need special handling, it can just behave like the other plugins. Change-Id: I55cb1133b51cb5f6ab3ca49484d3ba795867c2bb Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
* | CAN: Introduce CAN FD flag Error State Indicator (ESI)Andre Hartmann2017-01-171-0/+42
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Added hasErrorStateIndicator and setErrorStateIndicator to QCanBusFrame. * Setting QCanBusFrame::setErrorStateIndicator(true) also sets QCanBusFrame::setFlexibleDataRateFormat(true) * Setting QCanBusFrame::setFlexibleDataRateFormat(false) also sets QCanBusFrame::setErrorStateIndicator(false) [ChangeLog][QCanBusFrame] Added error state indicator flag to QCanBusFrame and set it appropriate receiving CAN FD frames with the SocketCAN plugin. Setting this flag for testing purposes is also possible. Change-Id: I406b693fc7b7cde8a0d6b2c34c1f313800f11203 Reviewed-by: Rolf Eike Beer <eb@emlix.com> Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
* | CAN: Introduce CAN FD Bitrate Switch (BRS)Andre Hartmann2017-01-171-8/+58
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | QCanBusFrame: Added hasBitrateSwitch and setBitrateSwitch to QCanBusFrame and therefore, increased the QCanBusFrame version number. * Setting QCanBusFrame::setBitrateSwitch(true) also sets QCanBusFrame::setFlexibleDataRateFormat(true) * Setting QCanBusFrame::setFlexibleDataRateFormat(false) also sets QCanBusFrame::setBitrateSwitch(false) QCanBusDevice: Reference implementation and documentation are done for the SocketCAN plugin. The CAN Example allows to send frames with Bitrate Switch enabled and visualize received frames with Bitrate Switch set. Unfortunately, the SocketCAN plugin does not allow to change any bitrate yet, so the newly added data bitrate selection box in ConnectDialog seems a bit useless. This box is however needed once other plugins become CAN FD capable and implement bitrate switching. [ChangeLog][QCanBusFrame] Introduced flag to allow data bitrate switching for CAN FD frames. Reference implementation is done for the SocketCAN plugin. Task-number: QTBUG-56720 Change-Id: Ieab04020f4750c8b0085624d2250ad7cd982cd96 Reviewed-by: Rolf Eike Beer <eb@emlix.com> Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
* | Eradicate Q_FOREACH loops and mark the module as Q_FOREACH-freeAndre Hartmann2017-01-111-3/+5
| | | | | | | | | | Change-Id: I4ec52799514b750c158e3cb8e6c38d1f1063c6c5 Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
* | CAN: Add QCanBusDeviceInfoAndre Hartmann2017-01-102-0/+22
|/ | | | | | | | | | | | | | | | | | | | | | | | | | Returns: * a list of available devices for the chosen plugin * if the device is virtual * if the device is CAN FD capable Use this list in the CAN Example for interface selection. If information about virtual channels or CAN FD capabability is not available, false is returned. For SocketCAN, PeakCAN, VectorCAN and SystecCAN, the implementation is completed. TinyCAN only return the list of possible interfaces for now. This is can be changed later, but needs quite some refactoring of the TinyCAN plugin. [ChangeLog][QtCanBus] Added the new class QCanBusDeviceInfo for enumeration of available CAN interfaces and more information about them. Task-number: QTBUG-54298 Change-Id: I851bcc3b9ee41aaaf1164c6b4a5aaf6503cd8746 Reviewed-by: Denis Shienkov <denis.shienkov@gmail.com> Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
* tst_qmodbuspdu: Cast to charFriedemann Kleint2016-12-081-1/+1
| | | | | | | Amends change 254d78c86343d178305b57ba58d7b53bff845542. Change-Id: I4662a460a10b3122b993e6de6b1e269c507c8fa0 Reviewed-by: André Hartmann <aha_1980@gmx.de>
* tst_qmodbuspdu: Fix compiler warningFriedemann Kleint2016-12-021-1/+1
| | | | | | | | | tst_qmodbuspdu.cpp(859): warning C4309: 'argument': truncation of constant value Change-Id: I88d9dd3c65abb79a7d536e4b30a62273ab155398 Reviewed-by: André Hartmann <aha_1980@gmx.de> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Karsten Heimrich <karsten.heimrich@qt.io>
* Merge remote-tracking branch 'origin/5.7' into 5.8Liang Qi2016-11-161-0/+19
|\ | | | | | | | | | | | | | | | | Conflicts: src/plugins/canbus/peakcan/main.cpp src/plugins/canbus/tinycan/main.cpp src/serialbus/qcanbusframe.h Change-Id: I7a38350688086b5f5cd7072acccb3fa38af76f88
| * Merge remote-tracking branch 'origin/5.6' into 5.7Liang Qi2016-11-161-0/+19
| |\ | | | | | | | | | | | | | | | | | | Conflicts: tests/auto/qmodbuspdu/tst_qmodbuspdu.cpp Change-Id: Id97e8ef6a6c176add1eda3738888c69c33f5378c
| | * Fix handling of byte count fieldsSamuel Gaist2016-11-041-0/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The various byte count fields are all unsigned byte however the incoming data are loaded in a QByteArray which returns signed char. This patch fixes this by converting the field value to quint8. [ChangeLog][Modbus] Fixed handling of packets with payloads longer than 127 bytes. Task-number: QTBUG-54834 Change-Id: I699c4cf0cea9933bef6c040c573d2d6e6a113920 Reviewed-by: André Hartmann <aha_1980@gmx.de>