diff --git a/datapoollocal/LocalDataPoolManager.cpp b/datapoollocal/LocalDataPoolManager.cpp index 3c5f0c1b..5373edb4 100644 --- a/datapoollocal/LocalDataPoolManager.cpp +++ b/datapoollocal/LocalDataPoolManager.cpp @@ -131,11 +131,6 @@ ReturnValue_t LocalDataPoolManager::generateHousekeepingPacket(sid_t sid, return HasReturnvaluesIF::RETURN_FAILED; } - // do we generate hk packets for invalid datasets? -// if(not dataSetToSerialize->isValid()) { -// return HasReturnvaluesIF::RETURN_OK; -// } - store_address_t storeId; HousekeepingPacketDownlink hkPacket(sid, collectionInterval, dataSetToSerialize->getFillCount(), dataSetToSerialize); @@ -249,7 +244,7 @@ ReturnValue_t LocalDataPoolManager::performHkOperation() { void LocalDataPoolManager::performPeriodicHkGeneration(HkReceiver* receiver) { if(receiver->intervalCounter >= intervalSecondsToInterval( receiver->isDiagnostics, - receiver->hkParameter.collectionInterval)) { + receiver->hkParameter.collectionIntervalSeconds)) { ReturnValue_t result = generateHousekeepingPacket( receiver->dataId.dataSetSid, receiver->destinationQueue); if(result != HasReturnvaluesIF::RETURN_OK) { @@ -279,7 +274,7 @@ uint32_t LocalDataPoolManager::intervalSecondsToInterval(bool isDiagnostics, float LocalDataPoolManager::intervalToIntervalSeconds(bool isDiagnostics, uint32_t collectionInterval) { if(isDiagnostics) { - return static_cast(collectionInterval * diagnosticMinimumInterval); + return static_cast(collectionInterval * diagnosticMinimumInterval); } else { return static_cast(collectionInterval * regularMinimumInterval); diff --git a/datapoollocal/LocalDataPoolManager.h b/datapoollocal/LocalDataPoolManager.h index d0d3d805..068d2703 100644 --- a/datapoollocal/LocalDataPoolManager.h +++ b/datapoollocal/LocalDataPoolManager.h @@ -176,7 +176,7 @@ private: type */ union HkParameter { /** This parameter will be used for the PERIODIC type */ - dur_seconds_t collectionInterval = 0; + float collectionIntervalSeconds = 0; /** This parameter will be used for the ON_UPDATE type */ bool hkDataChanged; }; diff --git a/housekeeping/HousekeepingMessage.cpp b/housekeeping/HousekeepingMessage.cpp index 2335f03d..2b1da851 100644 --- a/housekeeping/HousekeepingMessage.cpp +++ b/housekeeping/HousekeepingMessage.cpp @@ -8,7 +8,7 @@ void HousekeepingMessage::setHkReportMessage(CommandMessage* message, sid_t sid, message->setCommand(HK_REPORT); message->setMessageSize(HK_MESSAGE_SIZE); setSid(message, sid); - setParameter(message, storeId.raw); + message->setParameter3(storeId.raw); } void HousekeepingMessage::setHkDiagnosticsMessage(CommandMessage* message, @@ -16,13 +16,13 @@ void HousekeepingMessage::setHkDiagnosticsMessage(CommandMessage* message, message->setCommand(DIAGNOSTICS_REPORT); message->setMessageSize(HK_MESSAGE_SIZE); setSid(message, sid); - setParameter(message, storeId.raw); + message->setParameter3(storeId.raw); } sid_t HousekeepingMessage::getHkReportMessage(const CommandMessage *message, store_address_t *storeIdToSet) { if(storeIdToSet != nullptr) { - *storeIdToSet = getParameter(message); + *storeIdToSet = message->getParameter3(); } return getSid(message); } @@ -37,12 +37,3 @@ void HousekeepingMessage::setSid(CommandMessage *message, sid_t sid) { std::memcpy(message->getData(), &sid.raw, sizeof(sid.raw)); } - -void HousekeepingMessage::setParameter(CommandMessage *message, - uint32_t parameter) { - message->setParameter3(parameter); -} - -uint32_t HousekeepingMessage::getParameter(const CommandMessage *message) { - return message->getParameter3(); -} diff --git a/housekeeping/HousekeepingMessage.h b/housekeeping/HousekeepingMessage.h index db6d3ab8..f62beafa 100644 --- a/housekeeping/HousekeepingMessage.h +++ b/housekeeping/HousekeepingMessage.h @@ -112,8 +112,6 @@ public: private: static void setSid(CommandMessage* message, sid_t sid); - static void setParameter(CommandMessage* message, uint32_t parameter); - static uint32_t getParameter(const CommandMessage* message); }; diff --git a/osal/FreeRTOS/MessageQueue.cpp b/osal/FreeRTOS/MessageQueue.cpp index e9f3871e..398d1300 100644 --- a/osal/FreeRTOS/MessageQueue.cpp +++ b/osal/FreeRTOS/MessageQueue.cpp @@ -132,6 +132,7 @@ ReturnValue_t MessageQueue::sendMessageFromMessageQueue(MessageQueueId_t sendTo, else { destination = reinterpret_cast(sendTo); } + message->setSender(sentFrom);