diff options
author | Andre Hartmann <aha_1980@gmx.de> | 2019-04-10 20:34:10 +0200 |
---|---|---|
committer | André Hartmann <aha_1980@gmx.de> | 2019-04-11 13:42:07 +0000 |
commit | fc5e6011c1af70bd47a77796a0d0ab0fcd186541 (patch) | |
tree | 8d80ac0f5544754744c6c6c03b37f7ca27e9e6f0 | |
parent | d5b3a2b6e6462f4ad46fce8f52539333b131dcad (diff) |
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 <samuel.gaist@idiap.ch>
Reviewed-by: Denis Shienkov <denis.shienkov@gmail.com>
-rw-r--r-- | src/plugins/canbus/systeccan/systeccanbackend.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
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<int> 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); |