From c732ad3b469bfba8b714772c455aeb70706a1a8e Mon Sep 17 00:00:00 2001 From: Andre Hartmann Date: Fri, 12 Aug 2016 21:20:18 +0200 Subject: 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 Reviewed-by: Alex Blasche --- src/plugins/canbus/peakcan/peakcanbackend.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/plugins/canbus/peakcan/peakcanbackend.cpp') 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, ×tamp); if (st != PCAN_ERROR_OK) { - if (st != PCAN_ERROR_XMTFULL) + if (st != PCAN_ERROR_QRCVEMPTY) q->setError(systemErrorString(st), QCanBusDevice::ReadError); break; } -- cgit v1.2.3