summaryrefslogtreecommitdiffstats
path: root/src
Commit message (Collapse)AuthorAgeFilesLines
* VectorCAN: Fix receiving frames with multiple open channelsAndre Hartmann2018-04-131-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | As reason for the fix, see section "3.4.1 XLevent" in the Vector documentation XL_Driver_Library_Manual_EN.pdf, which states: "portHandle: Internal use only". This portHandle seems to be always zero and therefore channels greater then zero could not receive frames. Tested with Vectors simulated channels by sending frames to one channel which in turn were received by both channels. The sending channel had the local echo flag set, the other one not. [ChangeLog][QCanBus][VectorCAN] Fixed a receive problem in the VectorCAN plugin. When multiple channels were open, only the first one could receive frames. Task-number: QTBUG-67030 Change-Id: Ib76a04bc06e7b810d1c1cb092b79c4bc1aacf23a (cherry picked from commit 20cbe35dc3282b8e27278e3bd54d415cc8147d3c) Reviewed-by: Alex Blasche <alexander.blasche@qt.io> Reviewed-by: Denis Shienkov <denis.shienkov@gmail.com>
* TinyCAN: Intermediate fix for availableDevices()Andre Hartmann2018-01-032-5/+9
| | | | | | | | | | | | | | | | * Currently there is no way to detect the available devices * The existing code lead to compile errors with MSVC2013 * Also fix the documentation while at it [ChangeLog][QCanBus][Plugins] The function availableDevices() now returns an empty list for the TinyCAN plugin. The code was never functional and always returned a hardcoded example list. The function will be changed in later Qt versions to return the correct values once QTBUG-62958 is solved. Task-number: QTBUG-65474 Change-Id: Iebb4c8d4baf3b021d8890c6b3f252e9050856fce Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
* SocketCAN: Compile with Kernels without CAN FD BRS/ESIAndre Hartmann2017-11-191-0/+7
| | | | | | | | | | | [ChangeLog][SocketCAN] Fixed compiling the SocketCAN plugin with older Kernels without support for CAN FD bitrate switch and error state indicator. Task-number: QTBUG-64406 Change-Id: I05a7869b7df64ae6c3c29aa69dbf423d886b610a Reviewed-by: Denis Shienkov <denis.shienkov@gmail.com> Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
* QCanBus: Extend documentation for CAN device usageAndre Hartmann2017-11-031-2/+17
| | | | | | Change-Id: I16406e1d5c344daeb16856bacf1db857f1b820f7 Reviewed-by: Alex Blasche <alexander.blasche@qt.io> Reviewed-by: Denis Shienkov <denis.shienkov@gmail.com>
* SystecCAN: Fix availableDevices() for more than one deviceAndre Hartmann2017-10-251-1/+2
| | | | | | | | | | | | | | initInfo->m_fTryNext is set to false when the callback is entered but must be set to true to continue with the next device. [ChangeLog][QCanBus][SystecCAN] Fixed that the function availableDevices() only returned the first device. Change-Id: I689564c2379a1db28cb7c623425aa261e44fdd4d Reviewed-by: Denis Shienkov <denis.shienkov@gmail.com> Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
* SystecCAN: Fix device number assignment in availableDevices()Andre Hartmann2017-10-231-3/+3
| | | | | | | | | | | | [ChangeLog][QCanBus][SystecCAN] The function availableDevices() returned the wrong device number in some cases. In turn, it was not possible to connect to the correct device afterwards. Task-number: QTBUG-63833 Change-Id: I37cc250d144596af00aec9f743f0016e5634abe7 Reviewed-by: Alex Blasche <alexander.blasche@qt.io> Reviewed-by: André Hartmann <aha_1980@gmx.de> Reviewed-by: Denis Shienkov <denis.shienkov@gmail.com>
* Fix outdated BSD license headerKai Koehne2017-10-201-2/+12
| | | | | | Change-Id: Ifdd8f08e12f471aee37f749b4ad911ab7b6adb2a Reviewed-by: André Hartmann <aha_1980@gmx.de> Reviewed-by: Jani Heikkinen <jani.heikkinen@qt.io>
* Fix outdated FDL license headerKai Koehne2017-10-2011-53/+53
| | | | | | Change-Id: Ib7a43e822a32f7e0c77055baeef4f0fba33092a5 Reviewed-by: André Hartmann <aha_1980@gmx.de> Reviewed-by: Jani Heikkinen <jani.heikkinen@qt.io>
* PeakCAN: Avoid turning PeakCAN status frames into random data framesAndre Hartmann2017-10-051-0/+5
| | | | | | | | | | | | | [ChangeLog][CanBus][PeakCAN] Peak CAN status frames are no longer converted into QCanBusFrame::DataFrame, they are simply dropped for now. In a later Qt version they might by converted into proper QCanBusFrame::ErrorFrame, together with an interpretErrorFrame() implementation. Change-Id: I673ef2c8d312a96de192def831036ad10d5f2c01 Reviewed-by: Denis Shienkov <denis.shienkov@gmail.com> Reviewed-by: Marcell Varga <eandr2@gmail.com> Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
* PeakCAN: Fix connect() always returning false under LinuxMarcell Varga2017-09-291-1/+8
| | | | | | | | | | | It was impossible to open a Peak CAN device under Linux, because CAN_SetValue (which is needed for the Windows implementation) always returned with error. Task-number: QTBUG-63428 Change-Id: I353bf44a7bdea4a18ef84d8037a3a9fd86d47d89 Reviewed-by: Denis Shienkov <denis.shienkov@gmail.com> Reviewed-by: André Hartmann <aha_1980@gmx.de>
* QCanBusDevice: Improve connect/disconnect documentationAndre Hartmann2017-09-051-0/+7
| | | | | | | | | | | ... because I recently saw the following statement in user code: if (!m_device->connectDevice()) m_device->disconnectDevice(); Change-Id: Ifabd5e7416f5cc58d39c197abad3fc53d54e6ccc Reviewed-by: Rolf Eike Beer <eb@emlix.com> Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
* Fix unxepected state in Modbus process queued elementKarsten Heimrich2017-08-141-0/+4
| | | | | | | | | | | | | Due to the nature of our serial bus device, a frame could already be send completely, but the bytes written did not report that yet. Then we received an answer before we reached the receive state, messing up the whole state logic. Now we process incoming frames only if we are in receive state, otherwise drop full frames. Task-number: QTBUG-62144 Task-number: QTBUG-62299 Change-Id: I88a4cf0b64a823409cbb277431a004a9d126cddc Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
* QCanBusFrame: Fix Clang semantic warningAndre Hartmann2017-08-141-2/+2
| | | | | | | | | Semantic Issue -Wformat-nonliteral 391:37: warning: format string is not a string literal Change-Id: I0154e9db2c47fa5645f236197ee73c5309ef622d Reviewed-by: Denis Shienkov <denis.shienkov@gmail.com> 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>
* Fix build with Clang 5.0: remove unused captureThiago Macieira2017-06-131-1/+1
| | | | | | | qmodbusrtuserialmaster_p.h:356:68: error: lambda capture 'this' is not used [-Werror,-Wunused-lambda-capture] Change-Id: Ia53158e207a94bf49489fffd14c7903c7e4655cb Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
* PeakCAN: Update supported channels documentationAndre Hartmann2017-05-231-2/+2
| | | | | | | | Amends commit 3f8eb3be91641f9dba597e4421f9bbf50c5c161e Change-Id: Ibc0a1019ac4a4e63044c43125826614983a604e4 Reviewed-by: Denis Shienkov <denis.shienkov@gmail.com> Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
* CAN: Add requirements to plugin documentationAndre Hartmann2017-05-234-0/+12
| | | | | | Change-Id: I0dbbf10d8448c5d26f28bd7fa84cdeab21e6eb5c Reviewed-by: Denis Shienkov <denis.shienkov@gmail.com> Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
* VectorCAN: Fix crash when device open failsv5.9.0-beta4Andre Hartmann2017-04-251-0/+6
| | | | | | | | | | | | | | | | | | | | xlOpenPort() fails to open "can0" when the Vector vxlapi.dll is available, but no Vector device driver is installed. Calling xlClosePort() afterwards crashes. Before this patch, xlDeactivateChannel() and xlClosePort() were called unconditionally as part of VectorCanBackendPrivate::close() when any VectorCanBackendPrivate::open() step failed. Now xlClosePort() is only called when xlOpenPort() succeeded. Also guard xlDeactivateChannel() for consistence (doesn't make sense to call it on a closed device), even if this never crashed for me. Change-Id: Iad480f7e02ca8f45b8cc4d1d8930640b2d8cbeb2 Reviewed-by: Denis Shienkov <denis.shienkov@gmail.com> Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
* Fix build with -no-feature-commandlineparserStephan Binner2017-04-251-1/+1
| | | | | Change-Id: Ie939d23f1de0956fa34c74f52180775af8d38524 Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
* QCanBusDeviceInfo: Remove unused forward declarationAndre Hartmann2017-04-251-1/+0
| | | | | | | | Looks like a relict from a former implementation. Change-Id: Ic8c1c81151bc7877a991d35d410680f9bc29448a Reviewed-by: Denis Shienkov <denis.shienkov@gmail.com> Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
* CAN: Remove unneded core-private dependency for pluginsv5.9.0-beta3v5.9.0-beta2Andre Hartmann2017-04-135-5/+5
| | | | | | Change-Id: I9f5c41a5c3cd0c83f3835d29de22b76ac367cdbb Reviewed-by: Denis Shienkov <denis.shienkov@gmail.com> Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
* VectorCAN: Un-wrap medium long linesAndre Hartmann2017-04-121-10/+5
| | | | | | | | All lines are still shorter than 100 chars and even shorter as the longest line in this file. Change-Id: I227b13f78b3b7628287729f40ffec7bfa06231db Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
* VectorCAN: Fix error category for disconnection errorAndre Hartmann2017-04-121-1/+1
| | | | | | Change-Id: Ic3dce0c8b91e9994c31763725de48f4900fd9bef Reviewed-by: Alex Blasche <alexander.blasche@qt.io> Reviewed-by: Denis Shienkov <denis.shienkov@gmail.com>
* QCanBusDeviceInfo: Improve implementationAndre Hartmann2017-04-083-27/+15
| | | | | | | | | | | | | | | | As pointed out in the 5.9 API review. Deleted the standard constructor to not assign memory. The only way to construct QCanBusDeviceInfo is now by using the return value of QCanBus::availableDevices(): const auto infos = QCanBus::instance()->availableDevices(backend); for (const QCanBusDeviceInfo &info : infos) // do something with info Change-Id: I3382d8a8fffadd18e4f2f87d4ede94e7c2e442f2 Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
* canbusutil: Remove unused declarationsAndre Hartmann2017-04-032-4/+0
| | | | | Change-Id: Ib3f7925f0f063c12bea487c73f8cb1c5817c2492 Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
* Merge remote-tracking branch 'origin/5.8' into 5.9v5.9.0-beta1Liang Qi2017-03-3169-88/+91
|\ | | | | | | | | | | | | | | Conflicts: src/plugins/canbus/canbus.pro src/plugins/canbus/vectorcan/vectorcanbackend.cpp Change-Id: I3625693784e88204c93479806242ae70c7ec7ff3
| * Fix QModbusRtuSerialMaster wouldn't close5.8Konstantin Shtepa2017-03-301-3/+1
| | | | | | | | | | | | | | | | | | | | | | | | QModbusRtuSerialMaster wouldn't close on disconnect and would never release serial port because of patch in QTBUG-56009. Revert part of patch 6bed30d5ceef1463469e37173b3ebac2cfdc2352 which lead to this state. Task-number: QTBUG-59050 Change-Id: I8b3280a2889a416aa80e7f58264b5f9696b8c8b9 Reviewed-by: André Hartmann <aha_1980@gmx.de> Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
| * Revert "QCanBusFactory: de-inline virtual destructor"André Hartmann2017-03-272-4/+4
| | | | | | | | | | | | | | | | | | | | | | It turned out, that this change is not binary compatible as it was meant to be. Loading the plugins with QPluginLoader failed, so this patch needs to be reverted. This reverts commit b63a833346ed14baddbf598d48e005090b8bcb56. Change-Id: I32c7e3a46bdd5e2ea6217e6d2050a3878f53f1ff Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
| * VectorCAN: Fix build with -no-feature-libraryAndre Hartmann2017-03-091-2/+1
| | | | | | | | | | | | | | Amends commit 6803fbb01566e74df895326fb7805868696ce9c4 Change-Id: I97d06afa554df0c7528164f8accf9196c542e65c Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
| * Fix build with -no-feature-libraryUlf Hermann2017-03-062-2/+4
| | | | | | | | | | | | | | | | | | 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>
| * QCanBusFactory: de-inline virtual destructorAndre Hartmann2017-03-032-4/+4
| | | | | | | | | | | | | | | | As demanded in the API review. Change-Id: I640ab16a12ab9297270371550236eda903f26ea2 Reviewed-by: Marc Mutz <marc.mutz@kdab.com> Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
| * VectorCAN: Load vxlapi64.dll for 64 bit buildsAndre Hartmann2017-02-171-0/+4
| | | | | | | | | | | | | | Task-number: QTBUG-58774 Change-Id: I9ac12dbb5ae267a063b3c60130ed86499bce22dc Reviewed-by: Denis Shienkov <denis.shienkov@gmail.com> Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
| * VectorCAN: Fix receiving frames with extended IDAndre Hartmann2017-02-162-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Beside the CAN ID, the bit XL_CAN_EXT_MSG_ID is stored in event.tagData.msg.id. This bit indicates, that the received frame has extended frame format. However, this bit must be masked before calling QCanBusFrame::setFrameId(), otherwise the frame is marked as invalid with the ID set to zero. Most likely this was broken by commit a54fd820916caed2fb13b1a38e57deb5d918f74f Task-number: QTBUG-58840 Change-Id: I1814f19fe3ba8a7d057c42e112b62228fabf4206 Reviewed-by: Denis Shienkov <denis.shienkov@gmail.com> Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
| * Updated copyright headersAndre Hartmann2017-02-0268-78/+78
| | | | | | | | | | Change-Id: I7d38491c7ee15a1de788375acf9144c59b507d2a Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
| * Merge remote-tracking branch 'origin/5.8.0' into 5.8Liang Qi2017-01-261-1/+1
| |\ | | | | | | | | | Change-Id: I34693c3a4b342b1a5b30b5adc4af34f67fccb8b2
| | * Fix ICC warning about conversion changing signThiago Macieira2016-12-071-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | error #68: integer conversion resulted in a change of sign QByteArray elements are char, not quint8. Change-Id: I73fa1e59a4844c43a109fffd148caecfb59c95cc Reviewed-by: Alex Blasche <alexander.blasche@qt.io> Reviewed-by: André Hartmann <aha_1980@gmx.de>
* | | QCanBus: Add convenience constructor to QCanBusPrivateAndre Hartmann2017-03-311-4/+2
| | | | | | | | | | | | | | | Change-Id: I1a63fc5ceef54e2c8fb3d853990d8e0370f940b5 Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
* | | QCanBus: Use QLatin1String overload of QJsonObject::value() in loadPluginsAndre Hartmann2017-03-301-2/+2
| | | | | | | | | | | | | | | | | | | | | The overload was introduced in Qt 5.7. Change-Id: I99ae1bd0ef896213b6c5a85277ff0dfb1da1602a Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
* | | canbusutil: Print available devices for given pluginAndre Hartmann2017-03-303-4/+26
| | | | | | | | | | | | | | | | | | Change-Id: I72d2dd90137c3be2e07311d1dc4f83dfa4c15a18 Reviewed-by: Rolf Eike Beer <eb@emlix.com> Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
* | | canbusutil: Better output formatting with timestamp and infoAndre Hartmann2017-03-301-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Print two spaces after the info to separate the CAN ID, print no space before the info as the timestamp already ends with two spaces. Example output: 1490815444.0159 - - 12345678 [04] 00 11 22 33 1490815444.0171 B - 12345678 [04] 00 11 22 33 1490815444.0186 - E 12345678 [04] 00 11 22 33 1490815444.0200 B E 12345678 [04] 00 11 22 33 This example output was generated with the following small script: for i in 0 1 2 3 do cansend vcan0 12345678##${i}00112233 done Change-Id: I579f72383ebb92a979251bd41fe3a6fa58f33f04 Reviewed-by: Denis Shienkov <denis.shienkov@gmail.com> Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
* | | canbusutil: Rename command line option for extra informationAndre Hartmann2017-03-301-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | At the moment, only CAN FD flags are shown, but this is very likely to be extended to TX/RX printing soon. Change-Id: Ibdf6014645fdc5a4d3791ab12ce298f4e2a4b3c6 Reviewed-by: Denis Shienkov <denis.shienkov@gmail.com> Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
* | | QCanBusFactory: Restore binary compatibility to Qt 5.8Andre Hartmann2017-03-309-30/+89
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* | | QCanBus: Remove unused forward declarationAndre Hartmann2017-03-281-2/+0
| | | | | | | | | | | | | | | Change-Id: I608b890166deea40e20cc3790790479960aba6b2 Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
* | | canbusutil: Add CAN FD flag handlingAndre Hartmann2017-03-275-8/+53
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * For receiving, force the CAN plugin into CAN FD mode and show the CAN FD flags like the CAN Example * For sending, check if an odd number of data bytes is given and interpret the first data char as CAN FD flags Task-number: QTBUG-56464 Change-Id: I235827ea59d58744c34d5259e5637ad9c3326112 Reviewed-by: Denis Shienkov <denis.shienkov@gmail.com> Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
* | | canbusutil: Unify CAN bus frame terminologyAndre Hartmann2017-03-271-2/+2
| | | | | | | | | | | | | | | | | | | | | Change-Id: I23fefe9f8db3656fccb08c3968d6174a91d82412 Reviewed-by: Denis Shienkov <denis.shienkov@gmail.com> Reviewed-by: Rolf Eike Beer <eb@emlix.com> Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
* | | VectorCAN: Update documentation for QCanBusDevice::ReceiveOwnKeyAndre Hartmann2017-03-271-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | Amends commit bb77953d24bd633eb87caf80df1fbaa3d8cf6da5 Change-Id: Idc52125a043294c0f9c5eedb9d4883373d924cb9 Reviewed-by: Denis Shienkov <denis.shienkov@gmail.com> Reviewed-by: Mihai Baneu <bdmihai@gmail.com> Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
* | | SocketCAN: Sort device info list by device nameAndre Hartmann2017-03-141-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | Otherwise the sorting depends on the directory structure in /sys/class/net/ Change-Id: I95cc3d5f5d88f16c3511a9594eb4c466f807ef71 Reviewed-by: Denis Shienkov <denis.shienkov@gmail.com> Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
* | | QCanBusDeviceInfo: cancel friendship to GenericBusPluginAndre Hartmann2017-03-131-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* | | QCanBusDeviceInfo: Improve documentationAndre Hartmann2017-03-121-11/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Amends the introducing commit 55d405697c79c4ca23535140e60915e89b4054e3 as well as the API improvement in commit 15d3834f6dbe319827abdbdb92383846dd7cac3c Change-Id: Ie1da751cf3cbe743bc2d159bb1515af6b3d23fe0 Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
* | | QCanBus: Sort includes and remove unneeded onesAndre Hartmann2017-03-071-3/+2
| | | | | | | | | | | | | | | | | | Change-Id: Ic47e936f6b6320e06da8d999cffad729e2f273b8 Reviewed-by: Denis Shienkov <denis.shienkov@gmail.com> Reviewed-by: Alex Blasche <alexander.blasche@qt.io>