From dea2da9eee6519486c8128b5434f996ad4077f72 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Thu, 14 Nov 2024 17:23:14 +0100 Subject: [PATCH] add helper method --- src/fsfw/housekeeping/PeriodicHkHelper.cpp | 4 ++++ src/fsfw/housekeeping/PeriodicHkHelper.h | 1 + src/fsfw/housekeeping/PeriodicHkHelperIF.h | 8 ++++++++ 3 files changed, 13 insertions(+) diff --git a/src/fsfw/housekeeping/PeriodicHkHelper.cpp b/src/fsfw/housekeeping/PeriodicHkHelper.cpp index 3949045d..e0813b53 100644 --- a/src/fsfw/housekeeping/PeriodicHkHelper.cpp +++ b/src/fsfw/housekeeping/PeriodicHkHelper.cpp @@ -323,6 +323,10 @@ ReturnValue_t PeriodicHelper::enablePeriodicPacket(const dp::structure_id_t stru return returnvalue::OK; } +ReturnValue_t PeriodicHelper::enablePeriodicPacket(const dp::structure_id_t structureId) { + return enablePeriodicPacket(structureId, std::nullopt); +} + ReturnValue_t PeriodicHelper::disablePeriodicPacket(const dp::structure_id_t structureId) { // Get and check dataset first. const auto optSetSpec = getMutSetSpecification(structureId); diff --git a/src/fsfw/housekeeping/PeriodicHkHelper.h b/src/fsfw/housekeeping/PeriodicHkHelper.h index 92d72944..5700d76f 100644 --- a/src/fsfw/housekeeping/PeriodicHkHelper.h +++ b/src/fsfw/housekeeping/PeriodicHkHelper.h @@ -135,6 +135,7 @@ class PeriodicHelper : public PeriodicHelperIF { */ ReturnValue_t enablePeriodicPacket(dp::sid_t structureId, std::optional frequencyMs) override; + ReturnValue_t enablePeriodicPacket(dp::sid_t structureId) override; ReturnValue_t disablePeriodicPacket(dp::sid_t structureId) override; ReturnValue_t collectionEnabled(dp::sid_t structureId, bool& collectionEnabled) const override; diff --git a/src/fsfw/housekeeping/PeriodicHkHelperIF.h b/src/fsfw/housekeeping/PeriodicHkHelperIF.h index 29bd81c3..7153f663 100644 --- a/src/fsfw/housekeeping/PeriodicHkHelperIF.h +++ b/src/fsfw/housekeeping/PeriodicHkHelperIF.h @@ -17,6 +17,14 @@ class PeriodicHelperIF { dur_millis_t newCollectionIntervalMs) = 0; virtual ReturnValue_t enablePeriodicPacket(dp::sid_t structureId, std::optional frequencyMs) = 0; + /** + * @brief Enables periodic packet generation for a given structure, and + * keeps the previous configured collection interval. + * + * @param structureId + * @return ReturnValue_t + */ + virtual ReturnValue_t enablePeriodicPacket(dp::sid_t structureId) = 0; virtual ReturnValue_t disablePeriodicPacket(dp::sid_t structureId) = 0; virtual ReturnValue_t collectionEnabled(dp::sid_t structureId, bool& collectionEnabled) const = 0; };