summaryrefslogtreecommitdiffstats
path: root/src/plugins/canbus/tinycan
diff options
context:
space:
mode:
authorAndre Hartmann <aha_1980@gmx.de>2017-11-13 20:36:08 +0100
committerAndré Hartmann <aha_1980@gmx.de>2017-11-15 08:03:17 +0000
commit0f33c698229ebb418b71a19dd409e2b5a417182e (patch)
tree8020e3c40375ed26072769541c9760d9f00f8e84 /src/plugins/canbus/tinycan
parent328db7b395a1df970ccc641b2077c5c6ecbcf7de (diff)
CAN: Improve checking for unsupported CAN FD frames
The check for the correct data length is already done by QCanBusFrame::isValid. Plugins that don't support CAN FD should rather check for the CAN FD flag and discard CAN FD frames with payload length < 8 also. [ChangeLog][CAN bus plugins] The CAN bus plugins that don't support CAN FD now also discard CAN FD frames with payload length < 8. Change-Id: I5a699a497b79dab2b8960fadc7fa30dbda6c4a62 Reviewed-by: Denis Shienkov <denis.shienkov@gmail.com> Reviewed-by: Alex Blasche <alexander.blasche@qt.io> Reviewed-by: Rolf Eike Beer <eb@emlix.com>
Diffstat (limited to 'src/plugins/canbus/tinycan')
-rw-r--r--src/plugins/canbus/tinycan/tinycanbackend.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/plugins/canbus/tinycan/tinycanbackend.cpp b/src/plugins/canbus/tinycan/tinycanbackend.cpp
index 0985e48..5bea8eb 100644
--- a/src/plugins/canbus/tinycan/tinycanbackend.cpp
+++ b/src/plugins/canbus/tinycan/tinycanbackend.cpp
@@ -559,7 +559,7 @@ bool TinyCanBackend::writeFrame(const QCanBusFrame &newData)
}
// CAN FD frame format not supported at this stage
- if (Q_UNLIKELY(newData.payload().size() > 8)) {
+ if (Q_UNLIKELY(newData.hasFlexibleDataRateFormat())) {
setError(tr("CAN FD frame format not supported."), QCanBusDevice::WriteError);
return false;
}