From 6eaade239579ca814bb3aaded0f858b8f7bf47d7 Mon Sep 17 00:00:00 2001 From: "Robin.Mueller" Date: Sat, 26 Sep 2020 17:28:03 +0200 Subject: [PATCH] added new mode for local datapool manager --- datapoollocal/LocalDataPoolManager.h | 2 ++ internalError/InternalErrorReporter.cpp | 5 +++++ internalError/InternalErrorReporter.h | 1 + 3 files changed, 8 insertions(+) diff --git a/datapoollocal/LocalDataPoolManager.h b/datapoollocal/LocalDataPoolManager.h index 3b9b6cd9..6fb51b3e 100644 --- a/datapoollocal/LocalDataPoolManager.h +++ b/datapoollocal/LocalDataPoolManager.h @@ -146,6 +146,8 @@ public: enum class ReportingType: uint8_t { //! Periodic generation of HK packets. PERIODIC, + //! Housekeeping packet will be generated if values have changed. + UPDATE_HK, //! Update notification will be sent out as message. UPDATE_NOTIFICATION, //! Notification will be sent out as message and a snapshot of the diff --git a/internalError/InternalErrorReporter.cpp b/internalError/InternalErrorReporter.cpp index 3f7a0619..767ece51 100644 --- a/internalError/InternalErrorReporter.cpp +++ b/internalError/InternalErrorReporter.cpp @@ -12,6 +12,7 @@ InternalErrorReporter::InternalErrorReporter(object_id_t setObjectId, commandQueue(QueueFactory::instance()-> createMessageQueue(messageQueueDepth)), poolManager(this, commandQueue), + internalErrorSid(setObjectId, InternalErrorDataset::ERROR_SET_ID), internalErrorDataset(this) { mutex = MutexFactory::instance()->createMutex(); } @@ -154,6 +155,10 @@ 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(), false); return HasReturnvaluesIF::RETURN_OK; } diff --git a/internalError/InternalErrorReporter.h b/internalError/InternalErrorReporter.h index 1deb1422..85ac0836 100644 --- a/internalError/InternalErrorReporter.h +++ b/internalError/InternalErrorReporter.h @@ -60,6 +60,7 @@ protected: PeriodicTaskIF* executingTask = nullptr; MutexIF* mutex = nullptr; + sid_t internalErrorSid; InternalErrorDataset internalErrorDataset; bool diagnosticPrintout = true;