From ad9ac7537e150150679a4104b915836f8cc0f248 Mon Sep 17 00:00:00 2001 From: "Robin.Mueller" Date: Mon, 19 Oct 2020 00:25:03 +0200 Subject: [PATCH] bool is mapped to uint8 now for pod type conversion --- globalfunctions/Type.h | 4 ++++ parameters/ParameterHelper.cpp | 18 ++++++++++-------- parameters/ParameterWrapper.h | 2 +- 3 files changed, 15 insertions(+), 9 deletions(-) diff --git a/globalfunctions/Type.h b/globalfunctions/Type.h index 6910f909..8d03c467 100644 --- a/globalfunctions/Type.h +++ b/globalfunctions/Type.h @@ -59,6 +59,10 @@ struct PodTypeConversion { static const Type::ActualType_t type = Type::UNKNOWN_TYPE; }; template<> +struct PodTypeConversion { + static const Type::ActualType_t type = Type::UINT8_T; +}; +template<> struct PodTypeConversion { static const Type::ActualType_t type = Type::UINT8_T; }; diff --git a/parameters/ParameterHelper.cpp b/parameters/ParameterHelper.cpp index a3b615f8..e2ea4eb6 100644 --- a/parameters/ParameterHelper.cpp +++ b/parameters/ParameterHelper.cpp @@ -9,6 +9,10 @@ ParameterHelper::~ParameterHelper() { } ReturnValue_t ParameterHelper::handleParameterMessage(CommandMessage *message) { + if(storage == nullptr) { + return HasReturnvaluesIF::RETURN_FAILED; + } + ReturnValue_t result = HasReturnvaluesIF::RETURN_FAILED; switch (message->getCommand()) { case ParameterMessage::CMD_PARAMETER_DUMP: { @@ -112,15 +116,13 @@ ReturnValue_t ParameterHelper::sendParameter(MessageQueueId_t to, uint32_t id, } ReturnValue_t ParameterHelper::initialize() { - ownerQueueId = owner->getCommandQueue(); + ownerQueueId = owner->getCommandQueue(); - - storage = objectManager->get(objects::IPC_STORE); - if (storage == NULL) { - return HasReturnvaluesIF::RETURN_FAILED; - } else { - return HasReturnvaluesIF::RETURN_OK; - } + storage = objectManager->get(objects::IPC_STORE); + if (storage == nullptr) { + return ObjectManagerIF::CHILD_INIT_FAILED; + } + return HasReturnvaluesIF::RETURN_OK; } void ParameterHelper::rejectCommand(MessageQueueId_t to, ReturnValue_t reason, diff --git a/parameters/ParameterWrapper.h b/parameters/ParameterWrapper.h index 75f7af9b..e0a2d27e 100644 --- a/parameters/ParameterWrapper.h +++ b/parameters/ParameterWrapper.h @@ -68,7 +68,7 @@ public: template void set(const T *readonlyData, uint8_t rows, uint8_t columns) { - this->data = NULL; + this->data = nullptr; this->readonlyData = readonlyData; this->type = PodTypeConversion::type; this->rows = rows;