summaryrefslogtreecommitdiffstats
path: root/src/plugins/canbus/peakcan
diff options
context:
space:
mode:
authorAndre Hartmann <aha_1980@gmx.de>2016-08-12 21:20:18 +0200
committerAndré Hartmann <aha_1980@gmx.de>2016-08-26 08:39:54 +0000
commitc732ad3b469bfba8b714772c455aeb70706a1a8e (patch)
tree25ba1ca150e1cf4b13c8d599968aab0577494ed4 /src/plugins/canbus/peakcan
parent46c3db77f3289cced28e39aefa03f175b61cdcfc (diff)
PeakCAN: Do not set an error when receive buffer is empty
The function PeakCanBackendPrivate::startRead() reads all incoming frames until the receive buffer becomes empty. When the receive buffer is empty, the function should exit silently. Otherwise, an error should be set up. The previous code simply used the wrong constant to allow this valid case. Change-Id: I325e25682d7749950d936bf715a160a2beff7d06 Reviewed-by: Denis Shienkov <denis.shienkov@gmail.com> Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
Diffstat (limited to 'src/plugins/canbus/peakcan')
-rw-r--r--src/plugins/canbus/peakcan/peakcanbackend.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/plugins/canbus/peakcan/peakcanbackend.cpp b/src/plugins/canbus/peakcan/peakcanbackend.cpp
index 3b06ede..c62fc1b 100644
--- a/src/plugins/canbus/peakcan/peakcanbackend.cpp
+++ b/src/plugins/canbus/peakcan/peakcanbackend.cpp
@@ -434,7 +434,7 @@ void PeakCanBackendPrivate::canReadNotification()
const TPCANStatus st = ::CAN_Read(channelIndex, &message, &timestamp);
if (st != PCAN_ERROR_OK) {
- if (st != PCAN_ERROR_XMTFULL)
+ if (st != PCAN_ERROR_QRCVEMPTY)
q->setError(systemErrorString(st), QCanBusDevice::ReadError);
break;
}