summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorAndre Hartmann <aha_1980@gmx.de>2018-01-01 18:01:51 +0100
committerAndré Hartmann <aha_1980@gmx.de>2018-01-03 09:25:13 +0000
commit8ff62bd9536b5539e1e6b393c4ec87b092e36621 (patch)
tree35d2571ffc3e69f3c2830aa180c8b462d09ec16d /src
parent50aea4ada4521f009ea8524b91daea1fac283c41 (diff)
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 <alexander.blasche@qt.io>
Diffstat (limited to 'src')
-rw-r--r--src/plugins/canbus/tinycan/tinycanbackend.cpp4
-rw-r--r--src/serialbus/doc/src/tinycan.qdoc10
2 files changed, 9 insertions, 5 deletions
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<QCanBusDeviceInfo> TinyCanBackend::interfaces()
{
- return { createDeviceInfo(QStringLiteral("can0.0")), createDeviceInfo(QStringLiteral("can0.1")) };
+ QList<QCanBusDeviceInfo> result;
+ result.append(createDeviceInfo(QStringLiteral("can0.0")));
+ return result;
}
Q_GLOBAL_STATIC(QList<TinyCanBackendPrivate *>, qChannels)
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.