diff --git a/src/fsfw/controller/ExtendedControllerBase.cpp b/src/fsfw/controller/ExtendedControllerBase.cpp index 961a4f63..e03c7cba 100644 --- a/src/fsfw/controller/ExtendedControllerBase.cpp +++ b/src/fsfw/controller/ExtendedControllerBase.cpp @@ -80,4 +80,6 @@ ReturnValue_t ExtendedControllerBase::performOperation(uint8_t opCode) { return returnvalue::OK; } -MessageQueueId_t ExtendedControllerBase::getCommandQueue() const { return commandQueue->getId(); } \ No newline at end of file +MessageQueueId_t ExtendedControllerBase::getCommandQueue() const { return commandQueue->getId(); } + +datapool::SharedPool *ExtendedControllerBase::getOptionalSharedPool() { return nullptr; } \ No newline at end of file diff --git a/src/fsfw/controller/ExtendedControllerBase.h b/src/fsfw/controller/ExtendedControllerBase.h index 23afe7b7..47824ea9 100644 --- a/src/fsfw/controller/ExtendedControllerBase.h +++ b/src/fsfw/controller/ExtendedControllerBase.h @@ -33,6 +33,13 @@ class ExtendedControllerBase : public ControllerBase, hk::PeriodicHelper hkHelper; ActionHelper actionHelper; + // Periodic HK methods, default method assumes that no shared pool is required. + virtual datapool::SharedPool* getOptionalSharedPool() override; + + // Periodic HK abstract methods. + ReturnValue_t serializeHkDataset(dp::sid_t structureId, uint8_t* buf, size_t maxSize) = 0; + ReturnValue_t specifyHkDatasets(std::vector& setList) = 0; + /** * Implemented by child class. Handle all command messages which are * not health, mode, action or housekeeping messages. diff --git a/src/fsfw/datapool/definitions.h b/src/fsfw/datapool/definitions.h index cee79e80..eacab98a 100644 --- a/src/fsfw/datapool/definitions.h +++ b/src/fsfw/datapool/definitions.h @@ -16,7 +16,7 @@ using id_t = uint32_t; static constexpr uint32_t INVALID_LPID = -1; -static constexpr uint8_t INTERFACE_ID = CLASS_ID::LOCAL_POOL_OWNER_IF; +static constexpr uint8_t INTERFACE_ID = CLASS_ID::DATAPOOL_IF; static constexpr ReturnValue_t POOL_ENTRY_NOT_FOUND = MAKE_RETURN_CODE(0x00); static constexpr ReturnValue_t POOL_ENTRY_TYPE_CONFLICT = MAKE_RETURN_CODE(0x01); diff --git a/src/fsfw/devicehandlers/FreshDeviceHandlerBase.cpp b/src/fsfw/devicehandlers/FreshDeviceHandlerBase.cpp index d6bd6a55..a245fa5f 100644 --- a/src/fsfw/devicehandlers/FreshDeviceHandlerBase.cpp +++ b/src/fsfw/devicehandlers/FreshDeviceHandlerBase.cpp @@ -189,3 +189,5 @@ ReturnValue_t FreshDeviceHandlerBase::getParameter(uint8_t domainId, uint8_t uni } return INVALID_DOMAIN_ID; } + +datapool::SharedPool* FreshDeviceHandlerBase::getOptionalSharedPool() { return nullptr; } \ No newline at end of file diff --git a/src/fsfw/devicehandlers/FreshDeviceHandlerBase.h b/src/fsfw/devicehandlers/FreshDeviceHandlerBase.h index 6ccc0bd3..b0348a9f 100644 --- a/src/fsfw/devicehandlers/FreshDeviceHandlerBase.h +++ b/src/fsfw/devicehandlers/FreshDeviceHandlerBase.h @@ -104,6 +104,13 @@ class FreshDeviceHandlerBase : public SystemObject, // System Object overrides. ReturnValue_t initialize() override; + // Default implementation assumes that no optional shared pool is required. + virtual datapool::SharedPool* getOptionalSharedPool(); + + // Implemented by child, required for periodic HK. + ReturnValue_t serializeHkDataset(dp::sid_t structureId, uint8_t* buf, size_t maxSize) = 0; + ReturnValue_t specifyHkDatasets(std::vector& setList) = 0; + /** * Implemented by child class. Handle all command messages which are * not health, mode, action or housekeeping messages. diff --git a/src/fsfw/housekeeping/GeneratesPeriodicHkIF.h b/src/fsfw/housekeeping/GeneratesPeriodicHkIF.h index ab8fe41b..339ee087 100644 --- a/src/fsfw/housekeeping/GeneratesPeriodicHkIF.h +++ b/src/fsfw/housekeeping/GeneratesPeriodicHkIF.h @@ -50,7 +50,6 @@ class GeneratesPeriodicHkIF { static constexpr uint32_t INVALID_LPID = dp::INVALID_LPID; virtual ReturnValue_t serializeHkDataset(dp::sid_t structureId, uint8_t* buf, size_t maxSize) = 0; - virtual ReturnValue_t specifyHkDatasets(std::vector& setList) = 0; /** diff --git a/src/fsfw/housekeeping/PeriodicHkHelper.cpp b/src/fsfw/housekeeping/PeriodicHkHelper.cpp index e690ebff..3949045d 100644 --- a/src/fsfw/housekeeping/PeriodicHkHelper.cpp +++ b/src/fsfw/housekeeping/PeriodicHkHelper.cpp @@ -122,9 +122,9 @@ ReturnValue_t PeriodicHelper::handleHousekeepingMessage(CommandMessage* message) CommandMessage reply; if (result != returnvalue::OK) { - if (result == WRONG_HK_PACKET_TYPE) { + if (result == INVALID_HK_REQUEST) { printWarningOrError(sif::OutputTypes::OUT_WARNING, "handleHousekeepingMessage", - WRONG_HK_PACKET_TYPE); + INVALID_HK_REQUEST); } HousekeepingMessage::setHkRequestFailureReply(&reply, sid, result); } else { @@ -353,10 +353,8 @@ void PeriodicHelper::printWarningOrError(sif::OutputTypes outputType, const char if (errorPrint == nullptr) { if (error == DATASET_NOT_FOUND) { errorPrint = "Dataset not found"; - } else if (error == POOLOBJECT_NOT_FOUND) { - errorPrint = "Pool Object not found"; - } else if (error == WRONG_HK_PACKET_TYPE) { - errorPrint = "Wrong Packet Type"; + } else if (error == INVALID_HK_REQUEST) { + errorPrint = "Invalid HK request"; } else if (error == returnvalue::FAILED) { if (outputType == sif::OutputTypes::OUT_WARNING) { errorPrint = "Generic Warning"; diff --git a/src/fsfw/housekeeping/PeriodicHkHelper.h b/src/fsfw/housekeeping/PeriodicHkHelper.h index 837bb751..92d72944 100644 --- a/src/fsfw/housekeeping/PeriodicHkHelper.h +++ b/src/fsfw/housekeeping/PeriodicHkHelper.h @@ -49,15 +49,6 @@ class PeriodicHelper : public PeriodicHelperIF { friend class SharedPoolAttorney; public: - static constexpr uint8_t INTERFACE_ID = CLASS_ID::HOUSEKEEPING_MANAGER; - - static constexpr ReturnValue_t QUEUE_OR_DESTINATION_INVALID = MAKE_RETURN_CODE(0); - static constexpr ReturnValue_t WRONG_HK_PACKET_TYPE = MAKE_RETURN_CODE(1); - static constexpr ReturnValue_t REPORTING_STATUS_UNCHANGED = MAKE_RETURN_CODE(2); - static constexpr ReturnValue_t PERIODIC_HELPER_INVALID = MAKE_RETURN_CODE(3); - static constexpr ReturnValue_t POOLOBJECT_NOT_FOUND = MAKE_RETURN_CODE(4); - static constexpr ReturnValue_t DATASET_NOT_FOUND = MAKE_RETURN_CODE(5); - /** * This constructor is used by a class which wants to implement * a personal local data pool. The queueToUse can be supplied if it diff --git a/src/fsfw/housekeeping/definitions.h b/src/fsfw/housekeeping/definitions.h index d832f9cf..98b68e06 100644 --- a/src/fsfw/housekeeping/definitions.h +++ b/src/fsfw/housekeeping/definitions.h @@ -11,6 +11,12 @@ namespace hk { +static constexpr uint8_t INTERFACE_ID = CLASS_ID::PERIODIC_HK_IF; + +static constexpr ReturnValue_t DATASET_NOT_FOUND = MAKE_RETURN_CODE(0); +static constexpr ReturnValue_t QUEUE_OR_DESTINATION_INVALID = MAKE_RETURN_CODE(1); +static constexpr ReturnValue_t INVALID_HK_REQUEST = MAKE_RETURN_CODE(2); + /** * Different types of housekeeping reporting are possible. * 1. PERIODIC: diff --git a/src/fsfw/returnvalues/FwClassIds.h b/src/fsfw/returnvalues/FwClassIds.h index 9a4fa992..45a1c3f7 100644 --- a/src/fsfw/returnvalues/FwClassIds.h +++ b/src/fsfw/returnvalues/FwClassIds.h @@ -68,9 +68,9 @@ enum : uint8_t { MUTEX_IF, // MUX MESSAGE_QUEUE_IF, // MQI SEMAPHORE_IF, // SPH - LOCAL_POOL_OWNER_IF, // LPIF + DATAPOOL_IF, // LPIF POOL_VARIABLE_IF, // PVA - HOUSEKEEPING_MANAGER, // HKM + PERIODIC_HK_IF, // HKM DLE_ENCODER, // DLEE PUS_SERVICE_3, // PUS3 PUS_SERVICE_9, // PUS9