summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/plugins/canbus/socketcan/socketcanbackend.cpp7
-rw-r--r--src/plugins/canbus/socketcan/socketcanbackend.h1
-rw-r--r--src/plugins/canbus/tinycan/tinycanbackend.cpp4
-rw-r--r--src/serialbus/doc/src/tinycan.qdoc10
4 files changed, 17 insertions, 5 deletions
diff --git a/src/plugins/canbus/socketcan/socketcanbackend.cpp b/src/plugins/canbus/socketcan/socketcanbackend.cpp
index 81b7c13..74b0d1d 100644
--- a/src/plugins/canbus/socketcan/socketcanbackend.cpp
+++ b/src/plugins/canbus/socketcan/socketcanbackend.cpp
@@ -75,6 +75,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
Q_DECLARE_LOGGING_CATEGORY(QT_CANBUS_PLUGINS_SOCKETCAN)
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 <sys/socket.h>
#include <sys/uio.h>
#include <linux/can.h>
+#include <sys/time.h>
QT_BEGIN_NAMESPACE
diff --git a/src/plugins/canbus/tinycan/tinycanbackend.cpp b/src/plugins/canbus/tinycan/tinycanbackend.cpp
index 7fdd5c5..3891186 100644
--- a/src/plugins/canbus/tinycan/tinycanbackend.cpp
+++ b/src/plugins/canbus/tinycan/tinycanbackend.cpp
@@ -73,7 +73,9 @@ bool TinyCanBackend::canCreate(QString *errorReason)
QList<QCanBusDeviceInfo> TinyCanBackend::interfaces()
{
- return { createDeviceInfo(QStringLiteral("can0.0")), createDeviceInfo(QStringLiteral("can0.1")) };
+ QList<QCanBusDeviceInfo> result;
+ result.append(createDeviceInfo(QStringLiteral("can0.0")));
+ return result;
}
namespace {
diff --git a/src/serialbus/doc/src/tinycan.qdoc b/src/serialbus/doc/src/tinycan.qdoc
index 97ceabb..43349dc 100644
--- a/src/serialbus/doc/src/tinycan.qdoc
+++ b/src/serialbus/doc/src/tinycan.qdoc
@@ -53,13 +53,15 @@
\code
QCanBusDevice *device = QCanBus::instance()->createDevice(
- QStringLiteral("tinycan"), QStringLiteral("channela"));
+ QStringLiteral("tinycan"), QStringLiteral("can0.0"));
device->connectDevice();
\endcode
- Where \e can0.0 is the active CAN interface name. TinyCAN provides the
- interfaces \e can0.0 and \e can0.1, which maps to INDEX_CAN_KANAL_A resp.
- INDEX_CAN_KANAL_B in the TinyCAN plugin.
+ Where \e can0.0 is the active CAN interface name. TinyCAN currently only provides
+ the interface \e can0.0, which maps to INDEX_CAN_KANAL_A in the TinyCAN plugin.
+
+ \note The function availableDevices() currently always returns one device
+ "can0.0" as there is no way to detect the available CAN adapters for now.
\note Only the USB adapters are currently supported by this plugin.