From fc5e6011c1af70bd47a77796a0d0ab0fcd186541 Mon Sep 17 00:00:00 2001 From: Andre Hartmann Date: Wed, 10 Apr 2019 20:34:10 +0200 Subject: Systec: Fix error message "Cannot configure TxEcho for open device" When using the QCanBusDevice::ReceiveOwnKey, it has to be applied before the device is opened. While this already correctly happened in SystecCanBackendPrivate::open(), the parameter was applied again in SystecCanBackendPrivate::setConfigurationParameter() which led to the error message. Solution is to skip ReceiveOwnKey when applying all configuration parameters in SystecCanBackend::open(), like already done there for BitRateKey. [ChangeLog][SystecCAN] Fixed the error message "Cannot configure TxEcho for open device" when QCanBusDevice::ReceiveOwnKey was used. Change-Id: I37c1732798a3ce205a65ca803a99b5b7b9306d2a Reviewed-by: Samuel Gaist Reviewed-by: Denis Shienkov --- src/plugins/canbus/systeccan/systeccanbackend.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/plugins/canbus') diff --git a/src/plugins/canbus/systeccan/systeccanbackend.cpp b/src/plugins/canbus/systeccan/systeccanbackend.cpp index f33d9ba..3fdd135 100644 --- a/src/plugins/canbus/systeccan/systeccanbackend.cpp +++ b/src/plugins/canbus/systeccan/systeccanbackend.cpp @@ -479,11 +479,11 @@ bool SystecCanBackend::open() if (!d->open()) return false; - // Apply all stored configurations except bitrate, because - // the bitrate can not be applied after opening the device + // Apply all stored configurations except bitrate and receive own, + // because these cannot be applied after opening the device const QVector keys = configurationKeys(); for (int key : keys) { - if (key == QCanBusDevice::BitRateKey) + if (key == BitRateKey || key == ReceiveOwnKey) continue; const QVariant param = configurationParameter(key); const bool success = d->setConfigurationParameter(key, param); -- cgit v1.2.3