summaryrefslogtreecommitdiffstats
path: root/tests
Commit message (Collapse)AuthorAgeFilesLines
* 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>
* | | QCanBusFrame: add flag to identify CAN FD framesRolf Eike Beer2016-11-151-27/+68
| | | | | | | | | | | | | | | | | | | | | | | | Task-number: QTBUG-49675 Task-number: QTBUG-56720 Change-Id: Id24783c6ee1b81317d2e6d0965a9ed37987b47ec Reviewed-by: André Hartmann <aha_1980@gmx.de> Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
* | | QCanBusFrame: Extend valid check for frame id >= 2^29Andre Hartmann2016-11-011-4/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | All changes to canId have to go through setFrameId, which marks frames with id >= 2^29 as invalid. This can then be checked by isValid(). Change-Id: Ie9a80c35608cdb215d8d1ce3cb314bdc77924e05 Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
* | | QCanBusFrame::toString(): Add one more space around the length fieldAndre Hartmann2016-10-311-9/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This limits the three fields CAN-ID, length and data better. SocketCAN's candump does it this way and with this change canbusutil get's more compatible to candump. This function is new in 5.8, so there is no behavior change for existing code outside Qt. Change-Id: Ifc26cb7584a572d7aef91763242e7def909a6083 Reviewed-by: Rolf Eike Beer <eb@emlix.com> Reviewed-by: Andreas Wilhelm <aw@emlix.com> Reviewed-by: Denis Shienkov <denis.shienkov@gmail.com> Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
* | | QCanBusFrame: Change default ctor to not copy QByteArrayAndre Hartmann2016-09-221-1/+1
| | | | | | | | | | | | | | | | | | Task-number: QTBUG-51845 Change-Id: I5846b288d03b936fd1f3d3658a70c9ec5f7e6b46 Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
* | | QCanBusFrame: Remove setSeconds and setMicroSeconds from TimeStampAndre Hartmann2016-09-192-8/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | These functions were not used outside the tests and are not useful for the end user. So remove them now before our BC rules forbid it. [ChangeLog][QtSerialBus][QCanBusFrame::TimeStamp] Removed the setSeconds() and setMicroSeconds() functions to avoid confusion about unnormalized time stamps. Change-Id: Idf40bd5ce0bd949b7fb5dd992388688d52c80647 Reviewed-by: Denis Shienkov <denis.shienkov@gmail.com> Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
* | | QCanBusFrame: Easier TimeStamp creation from microseconds onlyAndre Hartmann2016-09-191-0/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The new function fromMicroSeconds() automatically converts overflow microseconds to seconds. [ChangeLog][QtSerialBus][QCanBusFrame::TimeStamp] TimeStamp::fromMicroSeconds() creates time stamps with normalized microseconds and the overflow added to seconds. Change-Id: I55aab33c1bcf444c50b09415e038a3c8929caeab Reviewed-by: Denis Shienkov <denis.shienkov@gmail.com> Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
* | | GenericCanBus: Add Unix-style timestampsAndre Hartmann2016-09-051-0/+3
| | | | | | | | | | | | | | | Change-Id: Ic428f1b9d1a95322a655f3d2b6d6cc658a7841d9 Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
* | | GenericCanBus: Convert connect to Qt5 styleAndre Hartmann2016-09-051-1/+1
| | | | | | | | | | | | | | | | | | Change-Id: Ic6f2540f3b13bfb5f5795c9ca2acae83c3af53b3 Reviewed-by: Denis Shienkov <denis.shienkov@gmail.com> Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
* | | GenericCanBus: Remove redundant includeAndre Hartmann2016-09-051-2/+0
| | | | | | | | | | | | | | | | | | | | | | | | qcanbusdevice.h is already included by dummybackend.h. Change-Id: I4ad3cca1f874489e67265fc2668ab66147b86454 Reviewed-by: Denis Shienkov <denis.shienkov@gmail.com> Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
* | | GenericCanBus: Remove unused variableAndre Hartmann2016-09-052-5/+1
| | | | | | | | | | | | | | | Change-Id: Ice496b6bc2210a36fe79197ee929a2400ffd04d9 Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
* | | QCanBusFactory: Add override to derived createDevice()Andre Hartmann2016-08-011-2/+1
| | | | | | | | | | | | | | | Change-Id: I78fdf3ebf0d5becd11a003596c0f3ec3aa556504 Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
* | | QCanBusFrame::toString(): Pretty align length and data fieldsAndre Hartmann2016-07-181-10/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | CAN 2.0 has a maximum data field length of 8 bytes, and CAN FD can have up to 64 data bytes. Insert an extra space for data field length < 10 to pretty align all the frames in a table. Change-Id: Icc5db2cfa066848d47d107c82269c1cf26252924 Reviewed-by: Alex Blasche <alexander.blasche@theqtcompany.com>
* | | QCanBusFrame: Add toString()Andre Hartmann2016-06-242-1/+76
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This allows to display CAN frames to the user and reduces a lot of duplication. [ChangeLog][QtSerialBus][QCanBusFrame] Added toString() to QCanBusFrame. Task-number: QTBUG-53171 Change-Id: I56c4c8c41012f76e2db6e1c97307325b0c73b14a Reviewed-by: Alex Blasche <alexander.blasche@theqtcompany.com>
* | | QCanBus: Receive an error message from createDevice()Andre Hartmann2016-06-012-3/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | [ChangeLog] Before, createDevice() could only return nullptr if anything goes wrong. Now, an optional textual error description can be returned. Task-number: QTBUG-53642 Change-Id: Ie097e5c63096ae6a6fb9a798e4a8f23219cf1cfb Reviewed-by: Alex Blasche <alexander.blasche@theqtcompany.com>
* | | QCanBus: Changed createDevice() API to use only QStringAndre Hartmann2016-06-011-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The old implementation used QByteArray and QString, and it could be hard to remember which type belongs where. For completeness, plugins() now returns QStringList instead of QList<QByteArray>. [ChangeLog][QCanBus] Changed the signature of createDevice() to use only QString parameters. Further, plugins() now returns a QStringList. Task-number: QTBUG-53642 Change-Id: Ief5ed9c87fba36744d6b96483095fab26e0d332c Reviewed-by: Denis Shienkov <denis.shienkov@gmail.com> Reviewed-by: Alex Blasche <alexander.blasche@theqtcompany.com>
* | | Merge remote-tracking branch 'gerrit/5.7' into devAlex Blasche2016-05-272-2/+11
|\| | | | | | | | | | | Change-Id: I53bef6cafb6c7a4f0b84bbd8b5dc3b0be64ee5ec
| * | Merge remote-tracking branch 'gerrit/5.6' into 5.7Alex Blasche2016-05-191-0/+8
| |\| | | | | | | | | | Change-Id: I0018eb72470e2dbbbbdbf5f8320020c114d93cd2
| | * QCanFrame: Fix constructing frames with extended ID < 0x800Andre Hartmann2016-05-181-0/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | While frames with an CAN-ID > 0x7FF always require the extended format, the opposite is not true for frames with an ID <= 0x7FF. From CAN bus side, the following CAN frames are both valid, not equal from CAN ID side, and do not lead to bus collisons (as they would do, if both were in standard format): 123 [8] 11 22 33 44 55 66 77 88 00000123 [5] 44 33 22 11 00 Introduced with 23e54b294d3e96a669fff16f2f5343373fb6010a Task-number: QTBUG-53171 Change-Id: I3412b5980ecaab649bfcb493c952a888f5a90394 Reviewed-by: Denis Shienkov <denis.shienkov@gmail.com> Reviewed-by: Alex Blasche <alexander.blasche@theqtcompany.com>
| * | CAN: Do not use PUBLIC(PRIVATE)_HEADERS divisionDenis Shienkov2016-05-131-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | ... also made small cosmetic dependent refactoring of plugins project files. Change-Id: I0fbfd585c14868944a3cac8ff5bd82408a5cace6 Reviewed-by: André Hartmann <aha_1980@gmx.de> Reviewed-by: Alex Blasche <alexander.blasche@theqtcompany.com>
| * | Use DISTFILES instead of OTHER_FILESDenis Shienkov2016-05-131-2/+1
| | | | | | | | | | | | | | | | | | Change-Id: Id666c7c78b159955db1b494f6997437b6ea19bc1 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com> Reviewed-by: Alex Blasche <alexander.blasche@theqtcompany.com>
* | | Merge remote-tracking branch 'origin/5.7' into devLiang Qi2016-05-138-35/+34
|\| | | | | | | | | | | | | | | | | | | | Conflicts: tests/auto/qcanbusdevice/tst_qcanbusdevice.cpp Change-Id: I10ddcd45e929a6165976ef4a60b60c1513613e02
| * | Merge remote-tracking branch 'origin/5.6' into 5.7Liang Qi2016-05-068-35/+34
| |\| | | | | | | | | | Change-Id: I687907747e05cedbd3f9f1c20df95e5de2d5cd48
| | * CAN: Do not use QPointer class as it is overheadDenis Shienkov2016-05-043-12/+11
| | | | | | | | | | | | | | | | | | | | | ... and use the QScopedPointer instead, where possible. Change-Id: Ie503d5ff31af77cf6a495f324c1e93c34ff7d58b Reviewed-by: Alex Blasche <alexander.blasche@theqtcompany.com>
| | * CAN: Correct spelling for "CAN" and "CAN FD"Andre Hartmann2016-05-021-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | ... in comments, user and debug output, and documentation. Change-Id: I76ddf418bc1612a7310f80ee2ce596e8d6ab0721 Reviewed-by: Denis Shienkov <denis.shienkov@gmail.com> Reviewed-by: Frank Meerkoetter <frank.meerkoetter@basyskom.com> Reviewed-by: Alex Blasche <alexander.blasche@theqtcompany.com>
| | * Replace 'Q_DECL_OVERRIDE' with 'override'Denis Shienkov2016-04-264-17/+17
| | | | | | | | | | | | | | | Change-Id: Iebbd61359296499600fe164429e710273a94b86d Reviewed-by: Alex Blasche <alexander.blasche@theqtcompany.com>
| | * Use 'auto' where it is possibleDenis Shienkov2016-04-222-2/+2
| | | | | | | | | | | | | | | | | | Change-Id: I3d915a6230a1f35317abc39d6266a9d46a5d9be6 Reviewed-by: Alex Blasche <alexander.blasche@theqtcompany.com> Reviewed-by: André Hartmann <aha_1980@gmx.de>
| | * Use 'nullptr' where it is possibleDenis Shienkov2016-04-212-2/+2
| | | | | | | | | | | | | | | Change-Id: I729e6b53cbc0b9a16c72c2351cc95d6bd7a2a0aa Reviewed-by: Alex Blasche <alexander.blasche@theqtcompany.com>
* | | Add synchronous read & write to QCanBusDeviceAlex Blasche2016-05-021-11/+206
|/ / | | | | | | | | | | | | | | | | | | waitForFramesWritten() and waitForFramesReceived() are added to QCanBusDevice. Task-number: QTBUG-52495 Change-Id: I393768b78b0ddc4b69fc32b9e5af2ee2ace55ccf Reviewed-by: Denis Shienkov <denis.shienkov@gmail.com> Reviewed-by: André Hartmann <aha_1980@gmx.de>
* | Remove explicit dependency to QSerialPortAlex Blasche2016-04-081-1/+0
| | | | | | | | | | | | | | | | It is not needed and streamlines the project dependencies. Change-Id: Ib2dce00d6d1ed39aea331cb0e63d77615c4386c8 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com> Reviewed-by: Karsten Heimrich <karsten.heimrich@theqtcompany.com>
* | Have a means to register a custom data size calculator.Karsten Heimrich2016-03-171-0/+41
| | | | | | | | | | | | | | | | | | Adds possibility to: * Override our data size calculation for a function code. * Implement data size calculation for a custom function code. Change-Id: I5611990a7bc10c2e90aef0f52aa1eb7ddf440717 Reviewed-by: Alex Blasche <alexander.blasche@theqtcompany.com>
* | Merge remote-tracking branch 'gerrit/5.6' into 5.7Alex Blasche2016-03-173-3/+6
|\| | | | | | | Change-Id: If97de045fd88034b9379ff1abef8633a1e73b37a