From 1f70b1159d39527d58cbcd2a0e85ca46c2d66695 Mon Sep 17 00:00:00 2001 From: "Robin.Mueller" Date: Mon, 28 Sep 2020 23:21:21 +0200 Subject: [PATCH] another small bugfix --- datapoollocal/LocalDataPoolManager.h | 14 ++++++++------ housekeeping/HousekeepingMessage.cpp | 2 +- housekeeping/PeriodicHousekeepingHelper.cpp | 2 +- internalError/InternalErrorDataset.h | 9 ++++++--- internalError/InternalErrorReporter.cpp | 4 ++-- 5 files changed, 18 insertions(+), 13 deletions(-) diff --git a/datapoollocal/LocalDataPoolManager.h b/datapoollocal/LocalDataPoolManager.h index c3b385e81..779e30500 100644 --- a/datapoollocal/LocalDataPoolManager.h +++ b/datapoollocal/LocalDataPoolManager.h @@ -90,6 +90,14 @@ public: */ ReturnValue_t initializeAfterTaskCreation(uint8_t nonDiagInvlFactor = 5); + /** + * This should be called in the periodic handler of the owner. + * It performs all the periodic functionalities of the data pool manager, + * for example generating periodic HK packets. + * @return + */ + ReturnValue_t performHkOperation(); + /** * @return */ @@ -108,12 +116,6 @@ public: */ void setNonDiagnosticIntervalFactor(uint8_t nonDiagInvlFactor); - /** - * This should be called in the periodic handler of the owner. - * It performs all the periodic functionalities of the data pool manager. - * @return - */ - ReturnValue_t performHkOperation(); /** * Generate a housekeeping packet with a given SID. diff --git a/housekeeping/HousekeepingMessage.cpp b/housekeeping/HousekeepingMessage.cpp index b07368e61..d2ab546b0 100644 --- a/housekeeping/HousekeepingMessage.cpp +++ b/housekeeping/HousekeepingMessage.cpp @@ -148,7 +148,7 @@ void HousekeepingMessage::clear(CommandMessage* message) { case(DIAGNOSTICS_REPORT): case(HK_DEFINITIONS_REPORT): case(DIAGNOSTICS_DEFINITION_REPORT): - case(UPDATE_SNAPSHOT):{ + case(UPDATE_SNAPSHOT): { store_address_t storeId; getHkDataReply(message, &storeId); StorageManagerIF *ipcStore = objectManager->get( diff --git a/housekeeping/PeriodicHousekeepingHelper.cpp b/housekeeping/PeriodicHousekeepingHelper.cpp index d184489b5..37349f815 100644 --- a/housekeeping/PeriodicHousekeepingHelper.cpp +++ b/housekeeping/PeriodicHousekeepingHelper.cpp @@ -10,7 +10,7 @@ void PeriodicHousekeepingHelper::initialize(float collectionInterval, dur_millis_t minimumPeriodicInterval, bool isDiagnostics, uint8_t nonDiagIntervalFactor) { this->minimumPeriodicInterval = minimumPeriodicInterval; - if(isDiagnostics) { + if(not isDiagnostics) { this->minimumPeriodicInterval = this->minimumPeriodicInterval * nonDiagIntervalFactor; } diff --git a/internalError/InternalErrorDataset.h b/internalError/InternalErrorDataset.h index c5dc3d73f..6bba11719 100644 --- a/internalError/InternalErrorDataset.h +++ b/internalError/InternalErrorDataset.h @@ -21,9 +21,12 @@ public: InternalErrorDataset(sid_t sid): StaticLocalDataSet(sid) {} - lp_var_t tmHits = lp_var_t(TM_HITS, sid.objectId, this); - lp_var_t queueHits = lp_var_t(QUEUE_HITS, sid.objectId, this); - lp_var_t storeHits = lp_var_t(STORE_HITS, sid.objectId, this); + lp_var_t tmHits = lp_var_t(TM_HITS, + hkManager->getOwner(), this); + lp_var_t queueHits = lp_var_t(QUEUE_HITS, + hkManager->getOwner(), this); + lp_var_t storeHits = lp_var_t(STORE_HITS, + hkManager->getOwner(), this); }; diff --git a/internalError/InternalErrorReporter.cpp b/internalError/InternalErrorReporter.cpp index 943ae8b30..a41d45689 100644 --- a/internalError/InternalErrorReporter.cpp +++ b/internalError/InternalErrorReporter.cpp @@ -50,6 +50,8 @@ ReturnValue_t InternalErrorReporter::performOperation(uint8_t opCode) { internalErrorDataset.commit(INTERNAL_ERROR_MUTEX_TIMEOUT); + poolManager.performHkOperation(); + CommandMessage message; ReturnValue_t result = commandQueue->receiveMessage(&message); if(result != MessageQueueIF::EMPTY) { @@ -155,8 +157,6 @@ ReturnValue_t InternalErrorReporter::initializeLocalDataPool( new PoolEntry()); localDataPoolMap.emplace(errorPoolIds::STORE_HITS, new PoolEntry()); - // todo: Only send HK if values have changed, will be supported by - // pool manager soon. poolManager.subscribeForPeriodicPacket(internalErrorSid, false, getPeriodicOperationFrequency(), true); return HasReturnvaluesIF::RETURN_OK;