From 02a8fd124f4706969269b6908a5c1cb9884f7ff2 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Thu, 10 Feb 2022 14:24:34 +0100 Subject: [PATCH] added empty PL PCDU handler --- fsfw | 2 +- linux/devices/CMakeLists.txt | 1 + linux/devices/PayloadPcduHandler.cpp | 43 ++++++++++++++++++++++++++++ linux/devices/PayloadPcduHandler.h | 26 +++++++++++++++++ linux/devices/SusHandler.h | 9 +++--- 5 files changed, 76 insertions(+), 5 deletions(-) create mode 100644 linux/devices/PayloadPcduHandler.cpp create mode 100644 linux/devices/PayloadPcduHandler.h diff --git a/fsfw b/fsfw index 32a9e0c7..81f5b0c3 160000 --- a/fsfw +++ b/fsfw @@ -1 +1 @@ -Subproject commit 32a9e0c7044665f0265c10108c8d62d45c047769 +Subproject commit 81f5b0c3bf3e602f5cc459dc39bc1e8885c932a7 diff --git a/linux/devices/CMakeLists.txt b/linux/devices/CMakeLists.txt index b02c8e57..86b4f44c 100644 --- a/linux/devices/CMakeLists.txt +++ b/linux/devices/CMakeLists.txt @@ -1,4 +1,5 @@ target_sources(${TARGET_NAME} PRIVATE SolarArrayDeploymentHandler.cpp + PayloadPcduHandler.cpp SusHandler.cpp ) diff --git a/linux/devices/PayloadPcduHandler.cpp b/linux/devices/PayloadPcduHandler.cpp new file mode 100644 index 00000000..9a1dd292 --- /dev/null +++ b/linux/devices/PayloadPcduHandler.cpp @@ -0,0 +1,43 @@ +#include "PayloadPcduHandler.h" + +PayloadPcduHandler::PayloadPcduHandler(object_id_t objectId, object_id_t comIF, CookieIF* cookie) + : DeviceHandlerBase(objectId, comIF, cookie) {} + +void PayloadPcduHandler::doStartUp() {} + +void PayloadPcduHandler::doShutDown() {} + +ReturnValue_t PayloadPcduHandler::buildNormalDeviceCommand(DeviceCommandId_t* id) { + return HasReturnvaluesIF::RETURN_OK; +} + +ReturnValue_t PayloadPcduHandler::buildTransitionDeviceCommand(DeviceCommandId_t* id) { + return HasReturnvaluesIF::RETURN_OK; +} + +void PayloadPcduHandler::fillCommandAndReplyMap() {} + +ReturnValue_t PayloadPcduHandler::buildCommandFromCommand(DeviceCommandId_t deviceCommand, + const uint8_t* commandData, + size_t commandDataLen) { + return HasReturnvaluesIF::RETURN_OK; +} + +ReturnValue_t PayloadPcduHandler::scanForReply(const uint8_t* start, size_t remainingSize, + DeviceCommandId_t* foundId, size_t* foundLen) { + return HasReturnvaluesIF::RETURN_OK; +} + +ReturnValue_t PayloadPcduHandler::interpretDeviceReply(DeviceCommandId_t id, + const uint8_t* packet) { + return HasReturnvaluesIF::RETURN_OK; +} + +uint32_t PayloadPcduHandler::getTransitionDelayMs(Mode_t modeFrom, Mode_t modeTo) { + return 10000; +} + +ReturnValue_t PayloadPcduHandler::initializeLocalDataPool(localpool::DataPool& localDataPoolMap, + LocalDataPoolManager& poolManager) { + return HasReturnvaluesIF::RETURN_OK; +} diff --git a/linux/devices/PayloadPcduHandler.h b/linux/devices/PayloadPcduHandler.h new file mode 100644 index 00000000..61bfa225 --- /dev/null +++ b/linux/devices/PayloadPcduHandler.h @@ -0,0 +1,26 @@ +#ifndef LINUX_DEVICES_PLPCDUHANDLER_H_ +#define LINUX_DEVICES_PLPCDUHANDLER_H_ + +#include + +class PayloadPcduHandler: DeviceHandlerBase { +public: + PayloadPcduHandler(object_id_t objectId, object_id_t comIF, CookieIF* cookie); +private: + void doStartUp() override; + void doShutDown() override; + ReturnValue_t buildNormalDeviceCommand(DeviceCommandId_t* id) override; + ReturnValue_t buildTransitionDeviceCommand(DeviceCommandId_t* id) override; + void fillCommandAndReplyMap() override; + ReturnValue_t buildCommandFromCommand(DeviceCommandId_t deviceCommand, const uint8_t* commandData, + size_t commandDataLen) override; + ReturnValue_t scanForReply(const uint8_t* start, size_t remainingSize, DeviceCommandId_t* foundId, + size_t* foundLen) override; + ReturnValue_t interpretDeviceReply(DeviceCommandId_t id, const uint8_t* packet) override; + uint32_t getTransitionDelayMs(Mode_t modeFrom, Mode_t modeTo) override; + ReturnValue_t initializeLocalDataPool(localpool::DataPool& localDataPoolMap, + LocalDataPoolManager& poolManager) override; + +}; + +#endif /* LINUX_DEVICES_PLPCDUHANDLER_H_ */ diff --git a/linux/devices/SusHandler.h b/linux/devices/SusHandler.h index 0eab5fd0..9968f301 100644 --- a/linux/devices/SusHandler.h +++ b/linux/devices/SusHandler.h @@ -7,11 +7,12 @@ #include "devicedefinitions/SusDefinitions.h" /** - * @brief This is the device handler class for the SUS sensor. The sensor is - * based on the MAX1227 ADC. Details about the SUS electronic can be found at - * https://egit.irs.uni-stuttgart.de/eive/eive_dokumente/src/branch/master/400_Raumsegment/443_SunSensorDocumentation/release + * @brief This is the device handler class for the SUS sensor based on the MAX1227 ADC. * - * @details Datasheet of MAX1227: https://datasheets.maximintegrated.com/en/ds/MAX1227-MAX1231.pdf + * @details + * Datasheet of MAX1227: https://datasheets.maximintegrated.com/en/ds/MAX1227-MAX1231.pdf + * Details about the SUS electronic can be found at + * https://egit.irs.uni-stuttgart.de/eive/eive_dokumente/src/branch/master/400_Raumsegment/443_SunSensorDocumentation/release * * @note When adding a SusHandler to the polling sequence table make sure to add a slot with * the executionStep FIRST_WRITE. Otherwise the communication sequence will never be