diff options
author | Andre Hartmann <aha_1980@gmx.de> | 2016-07-25 20:42:17 +0200 |
---|---|---|
committer | André Hartmann <aha_1980@gmx.de> | 2016-08-30 12:39:12 +0000 |
commit | 45bcf9e8f0249a984a90e021e69e93b96733ddd4 (patch) | |
tree | daacfdc3b90cd51afa6368181025d6a9785d9618 /src/plugins/canbus/vectorcan | |
parent | 5291efbac552b55d1343040f61908fbf71c29243 (diff) |
CAN: Unify interface names
Mostly, the interfaces now simply start with can0 and the number
increases for every next interface.
Some vendors distinguish between e.g. PCI and USB interfaces. In this
case, the interfaces are named usb0 and pci0, with increasing numbers,
respectively.
Multiple channels per device are accessed by adding the channel number
after a dot: can0.0 for the first channel in the first device (TinyCAN).
SocketCAN is still a bit different, as it allows arbitrary interface
names to be mapped to the hardware or virtual CAN busses.
[ChangeLog][QtSerialBus][Unify interface names] The interface names
of the different backends were unified to follow a common rule: The
prefixes were unified, the numbering now always starts with zero.
Change-Id: Ia2ca76a9be01b9123aed1ede90debf69871bb82c
Reviewed-by: Denis Shienkov <denis.shienkov@gmail.com>
Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
Diffstat (limited to 'src/plugins/canbus/vectorcan')
-rw-r--r-- | src/plugins/canbus/vectorcan/vectorcanbackend.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/plugins/canbus/vectorcan/vectorcanbackend.cpp b/src/plugins/canbus/vectorcan/vectorcanbackend.cpp index 78cf22f..d00d16a 100644 --- a/src/plugins/canbus/vectorcan/vectorcanbackend.cpp +++ b/src/plugins/canbus/vectorcan/vectorcanbackend.cpp @@ -224,8 +224,8 @@ bool VectorCanBackendPrivate::setConfigurationParameter(int key, const QVariant void VectorCanBackendPrivate::setupChannel(const QString &interfaceName) { - if (interfaceName.startsWith(QStringLiteral("channel"))) { - const QStringRef ref = interfaceName.midRef(7); + if (interfaceName.startsWith(QStringLiteral("can"))) { + const QStringRef ref = interfaceName.midRef(3); bool ok = false; const int channelIndex = ref.toInt(&ok); if (ok && (channelIndex >= 0 && channelIndex < XL_CONFIG_MAX_CHANNELS)) { |