From ad5bb4c69452e10ab9afdf56f3f9011198661ca2 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Wed, 2 Feb 2022 10:40:00 +0100 Subject: [PATCH 01/15] update changelog.md --- CHANGELOG => CHANGELOG.md | 168 +++++++++++++++++++++++++++++++++++++- 1 file changed, 166 insertions(+), 2 deletions(-) rename CHANGELOG => CHANGELOG.md (57%) diff --git a/CHANGELOG b/CHANGELOG.md similarity index 57% rename from CHANGELOG rename to CHANGELOG.md index 8f86c147d..e7d4f8804 100644 --- a/CHANGELOG +++ b/CHANGELOG.md @@ -1,4 +1,168 @@ -# Changed from ASTP 1.1.0 to 1.2.0 +Change Log +======= + +All notable changes to this project will be documented in this file. + +The format is based on [Keep a Changelog](http://keepachangelog.com/) +and this project adheres to [Semantic Versioning](http://semver.org/). + +# [unreleased] + +# [v4.0.0] + +## Additions + +- CFDP Packet Stack and related tests added. It also refactors the existing TMTC infastructure to + allow sending of CFDP packets to the CCSDS handlers. + PR: https://egit.irs.uni-stuttgart.de/fsfw/fsfw/pulls/528 + +## Changes + +- Applied the `clang-format` auto-formatter to all source code + +## Bugfix + +- CMake fixes in PR https://egit.irs.uni-stuttgart.de/fsfw/fsfw/pulls/533 , was problematic + if the uppermost user `CMakeLists.txt` did not have the include paths set up properly, which + could lead to compile errors that `#include "fsfw/FSFW.h"` was not found. + +## API Changes + +- Aforementioned changes to existing TMTC stack + +# [v3.0.0] + +## API Changes + +#### TCP Socket Changes + +* Keep Open TCP Implementation #496 + * The socket will now kept open after disconnect. This allows reconnecting. + * Only one connection is allowed + * No internal influence but clients need to change their Code. + +### GPIO IF + +* Add feature to open GPIO by line name #506 + +### Bitutil + +* Unittests for Op Divider and Bitutility #510 + +### Filesystem IF changed + +* Filesystem Base Interface: Use IF instead of void pointer #511 + +### STM32 + +* STM32 SPI Updates #518 + +## Bugfixes + +* Small bugfix for LIS3 handler #504 +* Spelling fixed for function names #509 +* CMakeLists fixes #517 +* Out of bound reads and writes in unittests #519 +* Bug in TmPacketStoredPusC (#478) +* Windows ifdef fixed #529 + +## Enhancement + +* FSFW.h.in more default values #491 +* Minor updates for PUS services #498 +* HasReturnvaluesIF naming for parameter #499 +* Tests can now be built as part of FSFW and versioning moved to CMake #500 +* Added integration test code #508 +* More printouts for rejected TC packets #505 +* Arrayprinter format improvements #514 +* Adding code for CI with docker and jenkins #520 +* Added new function in SerializeAdapter #513 + * Enables simple deSerialize if you keep track of the buffer position yourself + * `` static ReturnValue_t deSerialize(T *object, const uint8_t* buffer, + size_t* deserSize, SerializeIF::Endianness streamEndianness) `` +* Unittest helper scripts has a new Parameter to open the coverage html in the webrowser #525 + * ``'-o', '--open', Open coverage data in webbrowser`` +* Documentation updated. Sphinx Documentation can now be build with python script #526 + +## Known bugs + +* + + +All Pull Requests: + +Milestone: https://egit.irs.uni-stuttgart.de/fsfw/fsfw/milestone/19 + +# [v2.0.0] + +## API Changes + + +### File Structure changed to fit more common structure + +* See pull request (#445) + * HAL is now part of the main project + * **See Instructions below:** + +#### Instruction how to update existing / user code + +* Changes in `#include`: + * Rename `internalError` in includes to `internalerror` + * Rename `fsfw/hal` to `fsfw_hal` + * Rename `fsfw/tests` to `fsfw_tests` + * Rename `osal/FreeRTOS` to `osal/freertos` + +* Changes in `CMakeLists.txt`: + * Rename `OS_FSFW` to `FSFW_OSAL` + +* Changes in `DleEncoder.cpp` + * Create an instance of the `DleEncoder` first before calling the `encode` and `decode` functions + +### Removed osal/linux/Timer (#486) + +* Was redundant to timemanager/Countdown + +#### Instruction how to update existing / user code + +* Use timemanager/Countdown instead + +## Bugfixes + +### TM Stack + +* Increased TM stack robustness by introducing `nullptr` checks and more printouts (#483) + +#### Host OSAL / FreeRTOS + +* QueueMapManager Bugfix (NO_QUEUE was used as MessageQueueId) (#444) + +#### Events + +* Event output is now consistent (#447) + +#### DLE Encoder + +* Fixed possible out of bounds access in DLE Encoder (#492) + +## Enhancment + +* HAL as major new feature, also includes three MEMS devicehandlers as part of #481 +* Linux HAL updates (#456) +* FreeRTOS Header cleaning update and Cmake tweaks (#442) +* Printer updates (#453) +* New returnvalue for for empty PST (#485) +* TMTC Bridge: Increase limit of packets stored (#484) + +## Known bugs + +* Bug in TmPacketStoredPusC (#478) + + +All Pull Requests: + +Milestone: https://egit.irs.uni-stuttgart.de/fsfw/fsfw/milestone/5 + +# [v1.2.0] ## API Changes @@ -27,7 +191,7 @@ - See API changes chapter. This change will keep the internal API consistent in the future -# Changes from ASTP 1.0.0 to 1.1.0 +# [v1.1.0] ## API Changes From e9b0951a95aeb7e4aa1f16e7cf38bb4851b9b7f6 Mon Sep 17 00:00:00 2001 From: Jakob Meier Date: Thu, 3 Feb 2022 10:37:07 +0100 Subject: [PATCH 02/15] virtual function to print datasets --- src/fsfw/datapoollocal/LocalPoolDataSetBase.cpp | 2 ++ src/fsfw/datapoollocal/LocalPoolDataSetBase.h | 5 +++++ 2 files changed, 7 insertions(+) diff --git a/src/fsfw/datapoollocal/LocalPoolDataSetBase.cpp b/src/fsfw/datapoollocal/LocalPoolDataSetBase.cpp index e2fe7d39e..4a0762126 100644 --- a/src/fsfw/datapoollocal/LocalPoolDataSetBase.cpp +++ b/src/fsfw/datapoollocal/LocalPoolDataSetBase.cpp @@ -291,3 +291,5 @@ float LocalPoolDataSetBase::getCollectionInterval() const { return 0.0; } } + +void LocalPoolDataSetBase::printSet() { return; } diff --git a/src/fsfw/datapoollocal/LocalPoolDataSetBase.h b/src/fsfw/datapoollocal/LocalPoolDataSetBase.h index c2de2c542..17cf8be2e 100644 --- a/src/fsfw/datapoollocal/LocalPoolDataSetBase.h +++ b/src/fsfw/datapoollocal/LocalPoolDataSetBase.h @@ -171,6 +171,11 @@ class LocalPoolDataSetBase : public PoolDataSetBase, public MarkChangedIF { */ float getCollectionInterval() const; + /** + * @brief Can be overwritten by a specific implementation of a dataset to print the set. + */ + virtual void printSet(); + protected: sid_t sid; //! This mutex is used if the data is created by one object only. From 06ffe27fcc5e8008d5a1b8d53cbead2e08951aef Mon Sep 17 00:00:00 2001 From: Jakob Meier Date: Thu, 3 Feb 2022 10:46:14 +0100 Subject: [PATCH 03/15] do send read hook --- src/fsfw/devicehandlers/DeviceHandlerBase.cpp | 7 +++++++ src/fsfw/devicehandlers/DeviceHandlerBase.h | 6 ++++++ 2 files changed, 13 insertions(+) diff --git a/src/fsfw/devicehandlers/DeviceHandlerBase.cpp b/src/fsfw/devicehandlers/DeviceHandlerBase.cpp index 08d7c1d8d..ea1fcdf1d 100644 --- a/src/fsfw/devicehandlers/DeviceHandlerBase.cpp +++ b/src/fsfw/devicehandlers/DeviceHandlerBase.cpp @@ -665,6 +665,11 @@ void DeviceHandlerBase::doGetWrite() { void DeviceHandlerBase::doSendRead() { ReturnValue_t result; + result = doSendReadHook(); + if (result != RETURN_OK) { + return; + } + size_t replyLen = 0; if (cookieInfo.pendingCommand != deviceCommandMap.end()) { replyLen = getNextReplyLength(cookieInfo.pendingCommand->first); @@ -920,6 +925,8 @@ void DeviceHandlerBase::commandSwitch(ReturnValue_t onOff) { } } +ReturnValue_t DeviceHandlerBase::doSendReadHook() { return RETURN_OK; } + ReturnValue_t DeviceHandlerBase::getSwitches(const uint8_t** switches, uint8_t* numberOfSwitches) { return DeviceHandlerBase::NO_SWITCH; } diff --git a/src/fsfw/devicehandlers/DeviceHandlerBase.h b/src/fsfw/devicehandlers/DeviceHandlerBase.h index f3dda5c84..037f4bd75 100644 --- a/src/fsfw/devicehandlers/DeviceHandlerBase.h +++ b/src/fsfw/devicehandlers/DeviceHandlerBase.h @@ -1082,6 +1082,12 @@ class DeviceHandlerBase : public DeviceHandlerIF, */ void commandSwitch(ReturnValue_t onOff); + /** + * @brief This function can be used to insert device specific code during the do-send-read + * step. + */ + virtual ReturnValue_t doSendReadHook(); + private: /** * State a cookie is in. From 43b7a314b6d965915850489f96f9c3982c1e4626 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Wed, 2 Feb 2022 18:41:44 +0100 Subject: [PATCH 04/15] bump version --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index bb3d48b83..2d65637f1 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,6 +1,6 @@ cmake_minimum_required(VERSION 3.13) -set(FSFW_VERSION 2) +set(FSFW_VERSION 3) set(FSFW_SUBVERSION 0) set(FSFW_REVISION 0) From bd296883078e188fce44bc87e1013d930d129dbc Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Fri, 4 Feb 2022 10:11:24 +0100 Subject: [PATCH 05/15] bump revision --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 2d65637f1..8a2301336 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -2,7 +2,7 @@ cmake_minimum_required(VERSION 3.13) set(FSFW_VERSION 3) set(FSFW_SUBVERSION 0) -set(FSFW_REVISION 0) +set(FSFW_REVISION 1) # Add the cmake folder so the FindSphinx module is found set(CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake" ${CMAKE_MODULE_PATH}) From 80a610141ae21dda993fe960ff170d14d433f083 Mon Sep 17 00:00:00 2001 From: Ulrich Mohr Date: Fri, 4 Feb 2022 13:45:09 +0100 Subject: [PATCH 06/15] added v3.0.1 to changelog --- CHANGELOG.md | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index e7d4f8804..b6adddf02 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -30,6 +30,24 @@ and this project adheres to [Semantic Versioning](http://semver.org/). - Aforementioned changes to existing TMTC stack +# [v3.0.1] + +## API Changes + +* + +## Bugfixes + +* Version number was not updated for v3.0.0 #542 + +## Enhancement + +* + +## Known bugs + +* + # [v3.0.0] ## API Changes @@ -86,7 +104,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/). ## Known bugs -* +* Version number was not updated for v3.0.0 #542 All Pull Requests: From baddbf7340c78223e1494dac71dc735dfbef403d Mon Sep 17 00:00:00 2001 From: Ulrich Mohr Date: Mon, 7 Feb 2022 13:44:25 +0100 Subject: [PATCH 07/15] Updated changelog for v4.0.0 --- CHANGELOG.md | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index b6adddf02..c3cb934d7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -15,10 +15,17 @@ and this project adheres to [Semantic Versioning](http://semver.org/). - CFDP Packet Stack and related tests added. It also refactors the existing TMTC infastructure to allow sending of CFDP packets to the CCSDS handlers. PR: https://egit.irs.uni-stuttgart.de/fsfw/fsfw/pulls/528 +- Linux Command Executor, which can execute shell commands in blocking and non-blocking mode + PR: https://egit.irs.uni-stuttgart.de/fsfw/fsfw/pulls/536 +- added virtual function to print datasets + PR: https://egit.irs.uni-stuttgart.de/fsfw/fsfw/pulls/544 ## Changes - Applied the `clang-format` auto-formatter to all source code + PR: https://egit.irs.uni-stuttgart.de/fsfw/fsfw/pulls/534 +- Updated Catch2 to v3.0.0-preview4, might fail installing with cmake, see known bugs below + PR: https://egit.irs.uni-stuttgart.de/fsfw/fsfw/pulls/538 ## Bugfix @@ -30,6 +37,11 @@ and this project adheres to [Semantic Versioning](http://semver.org/). - Aforementioned changes to existing TMTC stack +## Known bugs + +* on some platforms building Catch2 from cmake might fail. In this case, it is advised to build and + install locally from git, see automation/Dockerfile for an example + # [v3.0.1] ## API Changes From 6dc34fc1f006d147555af68c4dfc1e52c3865f03 Mon Sep 17 00:00:00 2001 From: Ulrich Mohr Date: Mon, 7 Feb 2022 15:41:10 +0100 Subject: [PATCH 08/15] removed cmake warning as I have a workaround --- CHANGELOG.md | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index c3cb934d7..5869a0a98 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -15,16 +15,23 @@ and this project adheres to [Semantic Versioning](http://semver.org/). - CFDP Packet Stack and related tests added. It also refactors the existing TMTC infastructure to allow sending of CFDP packets to the CCSDS handlers. PR: https://egit.irs.uni-stuttgart.de/fsfw/fsfw/pulls/528 -- Linux Command Executor, which can execute shell commands in blocking and non-blocking mode - PR: https://egit.irs.uni-stuttgart.de/fsfw/fsfw/pulls/536 - added virtual function to print datasets PR: https://egit.irs.uni-stuttgart.de/fsfw/fsfw/pulls/544 +- doSendRead Hook + PR: https://egit.irs.uni-stuttgart.de/fsfw/fsfw/pulls/545 + +### HAL additions + +- Linux Command Executor, which can execute shell commands in blocking and non-blocking mode + PR: https://egit.irs.uni-stuttgart.de/fsfw/fsfw/pulls/536 +- uio Mapper + PR: https://egit.irs.uni-stuttgart.de/fsfw/fsfw/pulls/543 ## Changes - Applied the `clang-format` auto-formatter to all source code PR: https://egit.irs.uni-stuttgart.de/fsfw/fsfw/pulls/534 -- Updated Catch2 to v3.0.0-preview4, might fail installing with cmake, see known bugs below +- Updated Catch2 to v3.0.0-preview4 PR: https://egit.irs.uni-stuttgart.de/fsfw/fsfw/pulls/538 ## Bugfix @@ -39,8 +46,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/). ## Known bugs -* on some platforms building Catch2 from cmake might fail. In this case, it is advised to build and - install locally from git, see automation/Dockerfile for an example +- # [v3.0.1] From 2e4cd8055617568bc66725aa43f63b6125631b03 Mon Sep 17 00:00:00 2001 From: Ulrich Mohr Date: Mon, 7 Feb 2022 15:51:06 +0100 Subject: [PATCH 09/15] workaround for build regression catch2-v3.0.0-preview4 --- CMakeLists.txt | 2 ++ automation/Dockerfile | 6 ------ 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 9b090ca8c..19fedb64a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -60,6 +60,8 @@ if(FSFW_BUILD_UNITTESTS) ) FetchContent_MakeAvailable(Catch2) + #fixes regression -preview4, to be confirmed in later releases + set_target_properties(Catch2 PROPERTIES DEBUG_POSTFIX "") endif() set(FSFW_CONFIG_PATH tests/src/fsfw_tests/unit/testcfg) diff --git a/automation/Dockerfile b/automation/Dockerfile index a530a671f..9df67fc82 100644 --- a/automation/Dockerfile +++ b/automation/Dockerfile @@ -6,9 +6,3 @@ RUN apt-get --yes upgrade #tzdata is a dependency, won't install otherwise ARG DEBIAN_FRONTEND=noninteractive RUN apt-get --yes install gcc g++ cmake make lcov git valgrind nano iputils-ping - -RUN git clone https://github.com/catchorg/Catch2.git && \ - cd Catch2 && \ - git checkout v3.0.0-preview4 && \ - cmake -Bbuild -H. -DBUILD_TESTING=OFF && \ - cmake --build build/ --target install From 7a83289b3d4e62a20547c1652d850533756a5291 Mon Sep 17 00:00:00 2001 From: Ulrich Mohr Date: Mon, 7 Feb 2022 16:48:41 +0100 Subject: [PATCH 10/15] using prebuild, static docker image --- automation/Jenkinsfile | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/automation/Jenkinsfile b/automation/Jenkinsfile index dae2da2cb..f76496d11 100644 --- a/automation/Jenkinsfile +++ b/automation/Jenkinsfile @@ -3,13 +3,7 @@ pipeline { BUILDDIR = 'build-tests' } agent { - dockerfile { - dir 'automation' - //force docker to redownload base image and rebuild all steps instead of caching them - //this way, we always get an up to date docker image one each build - additionalBuildArgs '--no-cache --pull' - reuseNode true - } + docker { image: fsfw-ci:d1} } stages { stage('Clean') { From 54f3d7bd2df092776d0e3ae2170428a18e7896b7 Mon Sep 17 00:00:00 2001 From: Ulrich Mohr Date: Mon, 7 Feb 2022 16:49:42 +0100 Subject: [PATCH 11/15] Jenkinsfile typo --- automation/Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/automation/Jenkinsfile b/automation/Jenkinsfile index f76496d11..abd4532b9 100644 --- a/automation/Jenkinsfile +++ b/automation/Jenkinsfile @@ -3,7 +3,7 @@ pipeline { BUILDDIR = 'build-tests' } agent { - docker { image: fsfw-ci:d1} + docker { image: 'fsfw-ci:d1'} } stages { stage('Clean') { From 720813963090b28faa66a08b6e324aa99830e6ca Mon Sep 17 00:00:00 2001 From: Ulrich Mohr Date: Mon, 7 Feb 2022 16:50:59 +0100 Subject: [PATCH 12/15] Jenkinsfile another typo --- automation/Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/automation/Jenkinsfile b/automation/Jenkinsfile index abd4532b9..3424f986c 100644 --- a/automation/Jenkinsfile +++ b/automation/Jenkinsfile @@ -3,7 +3,7 @@ pipeline { BUILDDIR = 'build-tests' } agent { - docker { image: 'fsfw-ci:d1'} + docker { image 'fsfw-ci:d1'} } stages { stage('Clean') { From c6d152a01d9e1691065040883df7ffcf7aa358e1 Mon Sep 17 00:00:00 2001 From: Ulrich Mohr Date: Mon, 7 Feb 2022 17:11:04 +0100 Subject: [PATCH 13/15] updated changelog --- CHANGELOG.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 5869a0a98..cda8037cd 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -33,12 +33,16 @@ and this project adheres to [Semantic Versioning](http://semver.org/). PR: https://egit.irs.uni-stuttgart.de/fsfw/fsfw/pulls/534 - Updated Catch2 to v3.0.0-preview4 PR: https://egit.irs.uni-stuttgart.de/fsfw/fsfw/pulls/538 +- Changed CI to use prebuilt docker image + PR: https://egit.irs.uni-stuttgart.de/fsfw/fsfw/pulls/549 ## Bugfix - CMake fixes in PR https://egit.irs.uni-stuttgart.de/fsfw/fsfw/pulls/533 , was problematic if the uppermost user `CMakeLists.txt` did not have the include paths set up properly, which could lead to compile errors that `#include "fsfw/FSFW.h"` was not found. +- Fix for build regression in Catch2 v3.0.0-preview4 + PR: https://egit.irs.uni-stuttgart.de/fsfw/fsfw/pulls/548 ## API Changes From b25555a533dfd20c8b36bff409a4af963a79e7b8 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Thu, 10 Feb 2022 13:53:01 +0100 Subject: [PATCH 14/15] started DHB docs --- docs/devicehandlers.rst | 102 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 102 insertions(+) diff --git a/docs/devicehandlers.rst b/docs/devicehandlers.rst index 58c2df786..d1a5fb673 100644 --- a/docs/devicehandlers.rst +++ b/docs/devicehandlers.rst @@ -1,3 +1,105 @@ Device Handlers ================== +Device handler components rerpresent, control and monitor equipment, for example sensors or actuators of a spacecraft or the payload. + +Most device handlers have the same common functionality or +requirements, which are fulfilled by implementing an certain interface: + +- The handler/device needs to be commandable: :cpp:class:`HasActionsIF` +- The handler needs to communicate with the physical device via a dedicated + communication bus, for example SpaceWire, UART or SPI: :cpp:class:`DeviceCommunicationIF` +- The handler has housekeeping data which has to be exposed to the operator and/or other software + components: :cpp:class:`HasLocalDataPoolIF` +- The handler has configurable parameters +- The handler has health states, for example to indicate a broken device: + :cpp:class:`HasHealthIF` +- The handler has modes. For example there are the core modes `MODE_ON`, `MODE_OFF` + and `MODE_NORMAL` provided by the FSFW. `MODE_ON` means that a device is physically powered + but that it is not periodically polling data from the + physical device, `MODE_NORMAL` means that it is able to do that: :cpp:class`HasModesIF` + +The device handler base therefore provides abstractions for a lot of common +functionality, which can potentially avoid high amounts or logic and code duplication. + +Template Device Handler Base File +---------------------------------- + +This is an example template device handler header file with all necessary +functions implemented: + +.. code-block:: cpp + + #ifndef __TESTDEVICEHANDLER_H_ + #define __TESTDEVICEHANDLER_H_ + + #include + + class TestDeviceHandler: DeviceHandlerBase { + public: + TestDeviceHandler(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 /* __TESTDEVICEHANDLER_H_ */ + +and the respective source file with sensible default return values: + +.. code-block:: cpp + #include "TestDeviceHandler.h" + + TestDeviceHandler::TestDeviceHandler(object_id_t objectId, object_id_t comIF, CookieIF* cookie) + : DeviceHandlerBase(objectId, comIF, cookie) {} + + void TestDeviceHandler::doStartUp() {} + + void TestDeviceHandler::doShutDown() {} + + ReturnValue_t TestDeviceHandler::buildNormalDeviceCommand(DeviceCommandId_t* id) { + return HasReturnvaluesIF::RETURN_OK; + } + + ReturnValue_t TestDeviceHandler::buildTransitionDeviceCommand(DeviceCommandId_t* id) { + return HasReturnvaluesIF::RETURN_OK; + } + + void TestDeviceHandler::fillCommandAndReplyMap() {} + + ReturnValue_t TestDeviceHandler::buildCommandFromCommand(DeviceCommandId_t deviceCommand, + const uint8_t* commandData, + size_t commandDataLen) { + return HasReturnvaluesIF::RETURN_OK; + } + + ReturnValue_t TestDeviceHandler::scanForReply(const uint8_t* start, size_t remainingSize, + DeviceCommandId_t* foundId, size_t* foundLen) { + return HasReturnvaluesIF::RETURN_OK; + } + + ReturnValue_t TestDeviceHandler::interpretDeviceReply(DeviceCommandId_t id, + const uint8_t* packet) { + return HasReturnvaluesIF::RETURN_OK; + } + + uint32_t TestDeviceHandler::getTransitionDelayMs(Mode_t modeFrom, Mode_t modeTo) { + return 10000; + } + + ReturnValue_t TestDeviceHandler::initializeLocalDataPool(localpool::DataPool& localDataPoolMap, + LocalDataPoolManager& poolManager) { + return HasReturnvaluesIF::RETURN_OK; + } From cdf2a90f90ed8119a6d23e05efc40b4220b8e7c5 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Thu, 10 Feb 2022 14:02:30 +0100 Subject: [PATCH 15/15] fixed up cross-ref --- docs/devicehandlers.rst | 8 ++++++-- docs/highlevel.rst | 2 +- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/docs/devicehandlers.rst b/docs/devicehandlers.rst index d1a5fb673..affaa6d90 100644 --- a/docs/devicehandlers.rst +++ b/docs/devicehandlers.rst @@ -1,7 +1,10 @@ +.. _dhb-prim-doc: + Device Handlers ================== -Device handler components rerpresent, control and monitor equipment, for example sensors or actuators of a spacecraft or the payload. +Device handler components represent, control and monitor equipment, for example sensors or actuators +of a spacecraft or the payload. Most device handlers have the same common functionality or requirements, which are fulfilled by implementing an certain interface: @@ -17,7 +20,7 @@ requirements, which are fulfilled by implementing an certain interface: - The handler has modes. For example there are the core modes `MODE_ON`, `MODE_OFF` and `MODE_NORMAL` provided by the FSFW. `MODE_ON` means that a device is physically powered but that it is not periodically polling data from the - physical device, `MODE_NORMAL` means that it is able to do that: :cpp:class`HasModesIF` + physical device, `MODE_NORMAL` means that it is able to do that: :cpp:class:`HasModesIF` The device handler base therefore provides abstractions for a lot of common functionality, which can potentially avoid high amounts or logic and code duplication. @@ -60,6 +63,7 @@ functions implemented: and the respective source file with sensible default return values: .. code-block:: cpp + #include "TestDeviceHandler.h" TestDeviceHandler::TestDeviceHandler(object_id_t objectId, object_id_t comIF, CookieIF* cookie) diff --git a/docs/highlevel.rst b/docs/highlevel.rst index 08f447772..04eb5e7b3 100644 --- a/docs/highlevel.rst +++ b/docs/highlevel.rst @@ -118,7 +118,7 @@ The DH has mechanisms to monitor the communication with the physical device whic for FDIR reaction. Device Handlers can be created by implementing ``DeviceHandlerBase``. A standard FDIR component for the DH will be created automatically but can be overwritten by the user. More information on DeviceHandlers can be found in the -related [documentation section](doc/README-devicehandlers.md#top). +related :ref:`documentation section `. Modes and Health --------------------