From 206235ed47e0b086acc06015aeb36484bfeeab76 Mon Sep 17 00:00:00 2001 From: "Robin.Mueller" Date: Thu, 11 Jun 2020 16:03:09 +0200 Subject: [PATCH] dataset base bugfixes --- datapool/DataSetBase.cpp | 10 +++++++--- health/HealthHelper.cpp | 2 +- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/datapool/DataSetBase.cpp b/datapool/DataSetBase.cpp index 9104c8e7..60b20f29 100644 --- a/datapool/DataSetBase.cpp +++ b/datapool/DataSetBase.cpp @@ -36,7 +36,7 @@ ReturnValue_t DataSetBase::read(uint32_t lockTimeout) { if (state == States::DATA_SET_UNINITIALISED) { lockDataPool(lockTimeout); for (uint16_t count = 0; count < fillCount; count++) { - ReturnValue_t result = readVariable(count); + result = readVariable(count); if(result != RETURN_OK) { break; } @@ -46,14 +46,15 @@ ReturnValue_t DataSetBase::read(uint32_t lockTimeout) { } else { sif::error << "DataSet::read(): " - "Call made in wrong position." << std::endl; + "Call made in wrong position. Don't forget to commit" + " member datasets!" << std::endl; result = SET_WAS_ALREADY_READ; } return result; } ReturnValue_t DataSetBase::readVariable(uint16_t count) { - ReturnValue_t result = DataSetIF::INVALID_PARAMETER_DEFINITION; + ReturnValue_t result = HasReturnvaluesIF::RETURN_OK; // These checks are often performed by the respective // variable implementation too, but I guess a double check does not hurt. if (registeredVariables[count]->getReadWriteMode() != @@ -62,6 +63,9 @@ ReturnValue_t DataSetBase::readVariable(uint16_t count) { != PoolVariableIF::NO_PARAMETER) { result = registeredVariables[count]->readWithoutLock(); + if(result != HasReturnvaluesIF::RETURN_OK) { + result = INVALID_PARAMETER_DEFINITION; + } } return result; } diff --git a/health/HealthHelper.cpp b/health/HealthHelper.cpp index b23a8bd2..df259b52 100644 --- a/health/HealthHelper.cpp +++ b/health/HealthHelper.cpp @@ -62,7 +62,7 @@ void HealthHelper::setHealth(HasHealthIF::HealthState health) { void HealthHelper::informParent(HasHealthIF::HealthState health, HasHealthIF::HealthState oldHealth) { - if (parentQueue == 0) { + if (parentQueue == MessageQueueMessageIF::NO_QUEUE) { return; } MessageQueueMessage message;