From 0021aa29f54838a21658dbbaca98fe0e54318d8a Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Tue, 21 Nov 2023 17:37:02 +0100 Subject: [PATCH 1/2] pre-queue hook --- src/fsfw/devicehandlers/FreshDeviceHandlerBase.cpp | 5 +++++ src/fsfw/devicehandlers/FreshDeviceHandlerBase.h | 2 ++ 2 files changed, 7 insertions(+) diff --git a/src/fsfw/devicehandlers/FreshDeviceHandlerBase.cpp b/src/fsfw/devicehandlers/FreshDeviceHandlerBase.cpp index c113bee9..20e79b80 100644 --- a/src/fsfw/devicehandlers/FreshDeviceHandlerBase.cpp +++ b/src/fsfw/devicehandlers/FreshDeviceHandlerBase.cpp @@ -28,12 +28,17 @@ FreshDeviceHandlerBase::~FreshDeviceHandlerBase() { } ReturnValue_t FreshDeviceHandlerBase::performOperation(uint8_t opCode) { + performDeviceOperationPreQueueHandling(); handleQueue(); performDeviceOperation(opCode); poolManager.performHkOperation(); return returnvalue::OK; } +ReturnValue_t FreshDeviceHandlerBase::performDeviceOperationPreQueueHandling(uint8_t opCode) { + return returnvalue::OK; +} + void FreshDeviceHandlerBase::startTransition(Mode_t mode_, Submode_t submode_) { triggerEvent(CHANGING_MODE, mode_, submode_); // Complete mode transition immediately by default. diff --git a/src/fsfw/devicehandlers/FreshDeviceHandlerBase.h b/src/fsfw/devicehandlers/FreshDeviceHandlerBase.h index 97f672b1..ab6019c4 100644 --- a/src/fsfw/devicehandlers/FreshDeviceHandlerBase.h +++ b/src/fsfw/devicehandlers/FreshDeviceHandlerBase.h @@ -153,6 +153,8 @@ class FreshDeviceHandlerBase : public SystemObject, ReturnValue_t getParameter(uint8_t domainId, uint8_t uniqueId, ParameterWrapper* parameterWrapper, const ParameterWrapper* newValues, uint16_t startAtIndex) override; + virtual ReturnValue_t performDeviceOperationPreQueueHandling(uint8_t opCode); + private: // Executable Overrides. void setTaskIF(PeriodicTaskIF* task) override; -- 2.43.0 From c02d9e009efed98e5cbf8fd1eeeaedd98d3e6649 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Tue, 21 Nov 2023 17:40:06 +0100 Subject: [PATCH 2/2] docs improvements and fix --- src/fsfw/devicehandlers/FreshDeviceHandlerBase.cpp | 2 +- src/fsfw/devicehandlers/FreshDeviceHandlerBase.h | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/src/fsfw/devicehandlers/FreshDeviceHandlerBase.cpp b/src/fsfw/devicehandlers/FreshDeviceHandlerBase.cpp index 20e79b80..2b4ab27b 100644 --- a/src/fsfw/devicehandlers/FreshDeviceHandlerBase.cpp +++ b/src/fsfw/devicehandlers/FreshDeviceHandlerBase.cpp @@ -28,7 +28,7 @@ FreshDeviceHandlerBase::~FreshDeviceHandlerBase() { } ReturnValue_t FreshDeviceHandlerBase::performOperation(uint8_t opCode) { - performDeviceOperationPreQueueHandling(); + performDeviceOperationPreQueueHandling(opCode); handleQueue(); performDeviceOperation(opCode); poolManager.performHkOperation(); diff --git a/src/fsfw/devicehandlers/FreshDeviceHandlerBase.h b/src/fsfw/devicehandlers/FreshDeviceHandlerBase.h index ab6019c4..c911c1dd 100644 --- a/src/fsfw/devicehandlers/FreshDeviceHandlerBase.h +++ b/src/fsfw/devicehandlers/FreshDeviceHandlerBase.h @@ -82,6 +82,12 @@ class FreshDeviceHandlerBase : public SystemObject, MessageQueueIF* messageQueue; + /** + * The default queue handler will process all messages for the interfaces implemented + * by this class. If there are special requirements, for example that action commands are + * received on a different queue, the user can override this function for those special + * requirements. + */ virtual ReturnValue_t handleQueue(); // Mode Helpers. -- 2.43.0