From eec4d3034e4f1371fe60728e3f84bcb8ddd32c93 Mon Sep 17 00:00:00 2001 From: Andre Hartmann Date: Sat, 11 Nov 2017 19:58:16 +0100 Subject: SocketCAN: Compile with Kernels without CAN FD BRS/ESI [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 Reviewed-by: Alex Blasche --- src/plugins/canbus/socketcan/socketcanbackend.cpp | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'src/plugins') diff --git a/src/plugins/canbus/socketcan/socketcanbackend.cpp b/src/plugins/canbus/socketcan/socketcanbackend.cpp index 930221d..2ec4379 100644 --- a/src/plugins/canbus/socketcan/socketcanbackend.cpp +++ b/src/plugins/canbus/socketcan/socketcanbackend.cpp @@ -74,6 +74,13 @@ struct canfd_frame { #endif +#ifndef CANFD_BRS +# define CANFD_BRS 0x01 /* bit rate switch (second bitrate for payload data) */ +#endif +#ifndef CANFD_ESI +# define CANFD_ESI 0x02 /* error state indicator of the transmitting node */ +#endif + QT_BEGIN_NAMESPACE const char sysClassNetC[] = "/sys/class/net/"; -- cgit v1.2.3 From ab34a242b51193972389d909ff30eaf194d61b42 Mon Sep 17 00:00:00 2001 From: Samuli Piippo Date: Mon, 11 Dec 2017 14:39:34 +0200 Subject: Add missing include for struct timeval Fix build failure with musl libc: socketcanbackend.h:88:38: error: 'timeval' was not declared in this scope Change-Id: I4089f5a906095c21b2790d35ad131d9a0713ff3b Reviewed-by: Alex Blasche --- src/plugins/canbus/socketcan/socketcanbackend.h | 1 + 1 file changed, 1 insertion(+) (limited to 'src/plugins') diff --git a/src/plugins/canbus/socketcan/socketcanbackend.h b/src/plugins/canbus/socketcan/socketcanbackend.h index 50976b1..b49d267 100644 --- a/src/plugins/canbus/socketcan/socketcanbackend.h +++ b/src/plugins/canbus/socketcan/socketcanbackend.h @@ -50,6 +50,7 @@ #include #include #include +#include QT_BEGIN_NAMESPACE -- cgit v1.2.3 From 8ff62bd9536b5539e1e6b393c4ec87b092e36621 Mon Sep 17 00:00:00 2001 From: Andre Hartmann Date: Mon, 1 Jan 2018 18:01:51 +0100 Subject: TinyCAN: Intermediate fix for availableDevices() * 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 --- src/plugins/canbus/tinycan/tinycanbackend.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src/plugins') diff --git a/src/plugins/canbus/tinycan/tinycanbackend.cpp b/src/plugins/canbus/tinycan/tinycanbackend.cpp index 6405308..53b9872 100644 --- a/src/plugins/canbus/tinycan/tinycanbackend.cpp +++ b/src/plugins/canbus/tinycan/tinycanbackend.cpp @@ -70,7 +70,9 @@ bool TinyCanBackend::canCreate(QString *errorReason) QList TinyCanBackend::interfaces() { - return { createDeviceInfo(QStringLiteral("can0.0")), createDeviceInfo(QStringLiteral("can0.1")) }; + QList result; + result.append(createDeviceInfo(QStringLiteral("can0.0"))); + return result; } Q_GLOBAL_STATIC(QList, qChannels) -- cgit v1.2.3