From 9d626e0a5d8656671f7a846f15186f1d6830c841 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Wed, 14 Sep 2022 19:59:02 +0200 Subject: [PATCH 01/32] include correction --- src/fsfw/serviceinterface/ServiceInterfaceStream.h | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/fsfw/serviceinterface/ServiceInterfaceStream.h b/src/fsfw/serviceinterface/ServiceInterfaceStream.h index 0b3d6745..ca746e7d 100644 --- a/src/fsfw/serviceinterface/ServiceInterfaceStream.h +++ b/src/fsfw/serviceinterface/ServiceInterfaceStream.h @@ -1,9 +1,8 @@ #ifndef FRAMEWORK_SERVICEINTERFACE_SERVICEINTERFACESTREAM_H_ #define FRAMEWORK_SERVICEINTERFACE_SERVICEINTERFACESTREAM_H_ -#include - #include "ServiceInterfaceBuffer.h" +#include "fsfw/FSFW.h" #if FSFW_CPP_OSTREAM_ENABLED == 1 From a681a4a797cbec134d03289e0845a13eb79d5925 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Thu, 15 Sep 2022 13:37:10 +0200 Subject: [PATCH 02/32] better error printout --- src/fsfw/datapoollocal/LocalPoolObjectBase.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/fsfw/datapoollocal/LocalPoolObjectBase.cpp b/src/fsfw/datapoollocal/LocalPoolObjectBase.cpp index 82aefc18..9edf02c5 100644 --- a/src/fsfw/datapoollocal/LocalPoolObjectBase.cpp +++ b/src/fsfw/datapoollocal/LocalPoolObjectBase.cpp @@ -48,12 +48,12 @@ LocalPoolObjectBase::LocalPoolObjectBase(object_id_t poolOwner, lp_id_t poolId, if (hkOwner == nullptr) { #if FSFW_CPP_OSTREAM_ENABLED == 1 sif::error << "LocalPoolVariable: The supplied pool owner 0x" << std::hex << poolOwner - << std::dec << " did not implement the correct interface " + << std::dec << " does not exists or did not implement the correct interface " << "HasLocalDataPoolIF" << std::endl; #else sif::printError( - "LocalPoolVariable: The supplied pool owner 0x%08x did not implement the correct " - "interface HasLocalDataPoolIF\n", + "LocalPoolVariable: The supplied pool owner 0x%08x does not exists or does not implement " + "the correct interface HasLocalDataPoolIF\n", poolOwner); #endif return; From ce7146e468dbe7cb1ad5073e5374288b366105c5 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Thu, 15 Sep 2022 13:40:12 +0200 Subject: [PATCH 03/32] printout tweak --- src/fsfw/datapoollocal/LocalPoolObjectBase.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/fsfw/datapoollocal/LocalPoolObjectBase.cpp b/src/fsfw/datapoollocal/LocalPoolObjectBase.cpp index 9edf02c5..5575c3d8 100644 --- a/src/fsfw/datapoollocal/LocalPoolObjectBase.cpp +++ b/src/fsfw/datapoollocal/LocalPoolObjectBase.cpp @@ -48,11 +48,11 @@ LocalPoolObjectBase::LocalPoolObjectBase(object_id_t poolOwner, lp_id_t poolId, if (hkOwner == nullptr) { #if FSFW_CPP_OSTREAM_ENABLED == 1 sif::error << "LocalPoolVariable: The supplied pool owner 0x" << std::hex << poolOwner - << std::dec << " does not exists or did not implement the correct interface " + << std::dec << " does not exist or does not implement the correct interface " << "HasLocalDataPoolIF" << std::endl; #else sif::printError( - "LocalPoolVariable: The supplied pool owner 0x%08x does not exists or does not implement " + "LocalPoolVariable: The supplied pool owner 0x%08x does not exist or does not implement " "the correct interface HasLocalDataPoolIF\n", poolOwner); #endif From 423a9540edaad417416479b02f47e3c603bd4b16 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Thu, 15 Sep 2022 13:51:59 +0200 Subject: [PATCH 04/32] doc corrections --- docs/README-highlevel.md | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/docs/README-highlevel.md b/docs/README-highlevel.md index 9005af8d..cf2daee7 100644 --- a/docs/README-highlevel.md +++ b/docs/README-highlevel.md @@ -4,12 +4,14 @@ High-level overview # Structure The general structure is driven by the usage of interfaces provided by objects. -The FSFW uses C++11 as baseline. The intention behind this is that this C++ Standard should be -widely available, even with older compilers. -The FSFW uses dynamic allocation during the initialization but provides static containers during runtime. -This simplifies the instantiation of objects and allows the usage of some standard containers. -Dynamic Allocation after initialization is discouraged and different solutions are provided in the -FSFW to achieve that. The fsfw uses run-time type information but exceptions are not allowed. +The FSFW uses C++17 as baseline. Most modern compilers like GCC should have support for this +standard, even for micocontrollers. + +The FSFW uses dynamic allocation during the initialization but provides static containers during +runtime.This simplifies the instantiation of objects and allows the usage of some standard +containers. Dynamic Allocation after initialization is discouraged and different solutions are +provided in the FSFW to achieve that. The fsfw uses run-time type information but will not throw +exceptions. # Failure Handling From 131e3ff1e3fb7f9846b39aac4c6ff06db57da1d0 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Thu, 15 Sep 2022 13:52:28 +0200 Subject: [PATCH 05/32] Revert "doc corrections" This reverts commit 423a9540edaad417416479b02f47e3c603bd4b16. --- docs/README-highlevel.md | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/docs/README-highlevel.md b/docs/README-highlevel.md index cf2daee7..9005af8d 100644 --- a/docs/README-highlevel.md +++ b/docs/README-highlevel.md @@ -4,14 +4,12 @@ High-level overview # Structure The general structure is driven by the usage of interfaces provided by objects. -The FSFW uses C++17 as baseline. Most modern compilers like GCC should have support for this -standard, even for micocontrollers. - -The FSFW uses dynamic allocation during the initialization but provides static containers during -runtime.This simplifies the instantiation of objects and allows the usage of some standard -containers. Dynamic Allocation after initialization is discouraged and different solutions are -provided in the FSFW to achieve that. The fsfw uses run-time type information but will not throw -exceptions. +The FSFW uses C++11 as baseline. The intention behind this is that this C++ Standard should be +widely available, even with older compilers. +The FSFW uses dynamic allocation during the initialization but provides static containers during runtime. +This simplifies the instantiation of objects and allows the usage of some standard containers. +Dynamic Allocation after initialization is discouraged and different solutions are provided in the +FSFW to achieve that. The fsfw uses run-time type information but exceptions are not allowed. # Failure Handling From 0f027d29d27fd111a0be1e9ba3d683781ad4d6b0 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Thu, 15 Sep 2022 13:51:59 +0200 Subject: [PATCH 06/32] doc corrections --- docs/README-highlevel.md | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/docs/README-highlevel.md b/docs/README-highlevel.md index 9005af8d..cf2daee7 100644 --- a/docs/README-highlevel.md +++ b/docs/README-highlevel.md @@ -4,12 +4,14 @@ High-level overview # Structure The general structure is driven by the usage of interfaces provided by objects. -The FSFW uses C++11 as baseline. The intention behind this is that this C++ Standard should be -widely available, even with older compilers. -The FSFW uses dynamic allocation during the initialization but provides static containers during runtime. -This simplifies the instantiation of objects and allows the usage of some standard containers. -Dynamic Allocation after initialization is discouraged and different solutions are provided in the -FSFW to achieve that. The fsfw uses run-time type information but exceptions are not allowed. +The FSFW uses C++17 as baseline. Most modern compilers like GCC should have support for this +standard, even for micocontrollers. + +The FSFW uses dynamic allocation during the initialization but provides static containers during +runtime.This simplifies the instantiation of objects and allows the usage of some standard +containers. Dynamic Allocation after initialization is discouraged and different solutions are +provided in the FSFW to achieve that. The fsfw uses run-time type information but will not throw +exceptions. # Failure Handling From 8dea13742fa9f469507945f8cacf369eba4f7cfd Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Thu, 15 Sep 2022 13:57:39 +0200 Subject: [PATCH 07/32] update rst file --- docs/README-highlevel.md | 9 ++++----- docs/highlevel.rst | 15 ++++++++------- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/docs/README-highlevel.md b/docs/README-highlevel.md index cf2daee7..23e27da3 100644 --- a/docs/README-highlevel.md +++ b/docs/README-highlevel.md @@ -7,11 +7,10 @@ The general structure is driven by the usage of interfaces provided by objects. The FSFW uses C++17 as baseline. Most modern compilers like GCC should have support for this standard, even for micocontrollers. -The FSFW uses dynamic allocation during the initialization but provides static containers during -runtime.This simplifies the instantiation of objects and allows the usage of some standard -containers. Dynamic Allocation after initialization is discouraged and different solutions are -provided in the FSFW to achieve that. The fsfw uses run-time type information but will not throw -exceptions. +The FSFW might use dynamic allocation during program initialization but not during runtime. +It offers pool objects, static containers and it also exposes the Embedded Template Library +to allow writing code which does not perform allocation during runtime. The fsfw uses run-time type +information but will not throw exceptions. # Failure Handling diff --git a/docs/highlevel.rst b/docs/highlevel.rst index 3c9baae2..ee35c549 100644 --- a/docs/highlevel.rst +++ b/docs/highlevel.rst @@ -6,13 +6,14 @@ High-level overview Structure ---------- -The general structure is driven by the usage of interfaces provided by objects. -The FSFW uses C++11 as baseline. The intention behind this is that this C++ Standard should be -widely available, even with older compilers. -The FSFW uses dynamic allocation during the initialization but provides static containers during runtime. -This simplifies the instantiation of objects and allows the usage of some standard containers. -Dynamic Allocation after initialization is discouraged and different solutions are provided in the -FSFW to achieve that. The fsfw uses run-time type information but exceptions are not allowed. +The general structure is driven by the usage of interfaces provided by objects. +The FSFW uses C++17 as baseline. Most modern compilers like GCC should have support for this +standard, even for micocontrollers. + +The FSFW might use dynamic allocation during program initialization but not during runtime. +It offers pool objects, static containers and it also exposes the +`Embedded Template Library `_ to allow writing code which does not perform +allocation during runtime. The fsfw uses run-time type information but will not throw exceptions. Failure Handling ----------------- From 0042372cb6426f92ab56e93e37ae63015c2d2609 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Thu, 15 Sep 2022 13:58:13 +0200 Subject: [PATCH 08/32] now that doc server is up, remove markdown files --- docs/README-config.md | 40 -------- docs/README-controllers.md | 1 - docs/README-core.md | 55 ----------- docs/README-devicehandlers.md | 1 - docs/README-highlevel.md | 135 -------------------------- docs/README-localpools.md | 174 ---------------------------------- docs/README-osal.md | 32 ------- docs/README-pus.md | 1 - 8 files changed, 439 deletions(-) delete mode 100644 docs/README-config.md delete mode 100644 docs/README-controllers.md delete mode 100644 docs/README-core.md delete mode 100644 docs/README-devicehandlers.md delete mode 100644 docs/README-highlevel.md delete mode 100644 docs/README-localpools.md delete mode 100644 docs/README-osal.md delete mode 100644 docs/README-pus.md diff --git a/docs/README-config.md b/docs/README-config.md deleted file mode 100644 index d71feb97..00000000 --- a/docs/README-config.md +++ /dev/null @@ -1,40 +0,0 @@ -Configuring the FSFW -====== - -The FSFW can be configured via the `fsfwconfig` folder. A template folder has -been provided to have a starting point for this. The folder should be added -to the include path. The primary configuration file is the `FSFWConfig.h` folder. Some -of the available options will be explained in more detail here. - -# Auto-Translation of Events - -The FSFW allows the automatic translation of events, which allows developers to track triggered -events directly via console output. Using this feature requires: - -1. `FSFW_OBJ_EVENT_TRANSLATION` set to 1 in the configuration file. -2. Special auto-generated translation files which translate event IDs and object IDs into - human readable strings. These files can be generated using the - [modgen Python scripts](https://git.ksat-stuttgart.de/source/modgen.git). -3. The generated translation files for the object IDs should be named `translatesObjects.cpp` - and `translateObjects.h` and should be copied to the `fsfwconfig/objects` folder -4. The generated translation files for the event IDs should be named `translateEvents.cpp` and - `translateEvents.h` and should be copied to the `fsfwconfig/events` folder - -An example implementations of these translation file generators can be found as part -of the [SOURCE project here](https://git.ksat-stuttgart.de/source/sourceobsw/-/tree/development/generators) -or the [FSFW example](https://egit.irs.uni-stuttgart.de/fsfw/fsfw_example_public/src/branch/master/generators) - -## Configuring the Event Manager - -The number of allowed subscriptions can be modified with the following -parameters: - -``` c++ -namespace fsfwconfig { -//! Configure the allocated pool sizes for the event manager. -static constexpr size_t FSFW_EVENTMGMR_MATCHTREE_NODES = 240; -static constexpr size_t FSFW_EVENTMGMT_EVENTIDMATCHERS = 120; -static constexpr size_t FSFW_EVENTMGMR_RANGEMATCHERS = 120; -} -``` - diff --git a/docs/README-controllers.md b/docs/README-controllers.md deleted file mode 100644 index 7af0652d..00000000 --- a/docs/README-controllers.md +++ /dev/null @@ -1 +0,0 @@ -## Controllers diff --git a/docs/README-core.md b/docs/README-core.md deleted file mode 100644 index e34890ae..00000000 --- a/docs/README-core.md +++ /dev/null @@ -1,55 +0,0 @@ -## FSFW Core Modules - -These core modules provide the most important functionalities of the -Flight Software Framework - -### Clock - - * This is a class of static functions that can be used at anytime - * Leap Seconds must be set if any time conversions from UTC to other times is used - -### ObjectManager - -* Must be created during program startup -* The component which handles all references. All SystemObjects register at this component. -* Any SystemObject needs to have a unique ObjectId. Those can be managed like objects::framework_objects. -* A reference to an object can be get by calling the following function. T must be the specific Interface you want to call. -A nullptr check of the returning Pointer must be done. This function is based on Run-time type information. - -```cpp -template T* ObjectManagerIF::get( object_id_t id ) -``` -* A typical way to create all objects on startup is a handing a static produce function to the - ObjectManager on creation. By calling objectManager->initialize() the produce function will be - called and all SystemObjects will be initialized afterwards. - -### Event Manager - -* Component which allows routing of events -* Other objects can subscribe to specific events, ranges of events or all events of an object. -* Subscriptions can be done during runtime but should be done during initialization -* Amounts of allowed subscriptions can be configured in `FSFWConfig.h` - -### Health Table - -* A component which holds every health state -* Provides a thread safe way to access all health states without the need of message exchanges - -### Stores - -* The message based communication can only exchange a few bytes of information inside the message - itself. Therefore, additional information can be exchanged with Stores. With this, only the - store address must be exchanged in the message. -* Internally, the FSFW uses an IPC Store to exchange data between processes. For incoming TCs a TC - Store is used. For outgoing TM a TM store is used. -* All of them should use the Thread Safe Class storagemanager/PoolManager - -### Tasks - -There are two different types of tasks: - * The PeriodicTask just executes objects that are of type ExecutableObjectIF in the order of the - insertion to the Tasks. - * FixedTimeslotTask executes a list of calls in the order of the given list. This is intended for - DeviceHandlers, where polling should be in a defined order. An example can be found in - `defaultcfg/fsfwconfig/pollingSequence` folder - diff --git a/docs/README-devicehandlers.md b/docs/README-devicehandlers.md deleted file mode 100644 index 8b6551aa..00000000 --- a/docs/README-devicehandlers.md +++ /dev/null @@ -1 +0,0 @@ -## Device Handlers diff --git a/docs/README-highlevel.md b/docs/README-highlevel.md deleted file mode 100644 index 9005af8d..00000000 --- a/docs/README-highlevel.md +++ /dev/null @@ -1,135 +0,0 @@ -High-level overview -====== - -# Structure - -The general structure is driven by the usage of interfaces provided by objects. -The FSFW uses C++11 as baseline. The intention behind this is that this C++ Standard should be -widely available, even with older compilers. -The FSFW uses dynamic allocation during the initialization but provides static containers during runtime. -This simplifies the instantiation of objects and allows the usage of some standard containers. -Dynamic Allocation after initialization is discouraged and different solutions are provided in the -FSFW to achieve that. The fsfw uses run-time type information but exceptions are not allowed. - -# Failure Handling - -Functions should return a defined `ReturnValue_t` to signal to the caller that something has -gone wrong. Returnvalues must be unique. For this the function `returnvalue::makeCode` -or the macro `MAKE_RETURN` can be used. The `CLASS_ID` is a unique id for that type of object. -See `returnvalues/FwClassIds` folder. The user can add custom `CLASS_ID`s via the -`fsfwconfig` folder. - -# OSAL - -The FSFW provides operation system abstraction layers for Linux, FreeRTOS and RTEMS. -The OSAL provides periodic tasks, message queues, clocks and semaphores as well as mutexes. -The [OSAL README](doc/README-osal.md#top) provides more detailed information on provided components -and how to use them. - -# Core Components - -The FSFW has following core components. More detailed informations can be found in the -[core component section](doc/README-core.md#top): - -1. Tasks: Abstraction for different (periodic) task types like periodic tasks or tasks - with fixed timeslots -2. ObjectManager: This module stores all `SystemObjects` by mapping a provided unique object ID - to the object handles. -3. Static Stores: Different stores are provided to store data of variable size (like telecommands - or small telemetry) in a pool structure without using dynamic memory allocation. - These pools are allocated up front. -3. Clock: This module provided common time related functions -4. EventManager: This module allows routing of events generated by `SystemObjects` -5. HealthTable: A component which stores the health states of objects - -# Static IDs in the framework - -Some parts of the framework use a static routing address for communication. -An example setup of ids can be found in the example config in `defaultcft/fsfwconfig/objects` - inside the function `Factory::setStaticFrameworkObjectIds()`. - -# Events - -Events are tied to objects. EventIds can be generated by calling the Macro MAKE_EVENT. -This works analog to the returnvalues. Every object that needs own EventIds has to get a -unique SUBSYSTEM_ID. Every SystemObject can call triggerEvent from the parent class. -Therefore, event messages contain the specific EventId and the objectId of the object that -has triggered. - -# Internal Communication - -Components communicate mostly via Messages through Queues. -Those queues are created by calling the singleton `QueueFactory::instance()->create()` which -will create `MessageQueue` instances for the used OSAL. - -# External Communication - -The external communication with the mission control system is mostly up to the user implementation. -The FSFW provides PUS Services which can be used to but don't need to be used. -The services can be seen as a conversion from a TC to a message based communication and back. - -## TMTC Communication - -The FSFW provides some components to facilitate TMTC handling via the PUS commands. -For example, a UDP or TCP PUS server socket can be opened on a specific port using the -files located in `osal/common`. The FSFW example uses this functionality to allow sending telecommands -and receiving telemetry using the [TMTC commander application](https://github.com/spacefisch/tmtccmd). -Simple commands like the PUS Service 17 ping service can be tested by simply running the -`tmtc_client_cli.py` or `tmtc_client_gui.py` utility in -the [example tmtc folder](https://egit.irs.uni-stuttgart.de/fsfw/fsfw_example_public/src/branch/master/tmtc) -while the `fsfw_example` application is running. - -More generally, any class responsible for handling incoming telecommands and sending telemetry -can implement the generic `TmTcBridge` class located in `tmtcservices`. Many applications -also use a dedicated polling task for reading telecommands which passes telecommands -to the `TmTcBridge` implementation. - -## CCSDS Frames, CCSDS Space Packets and PUS - -If the communication is based on CCSDS Frames and Space Packets, several classes can be used to -distributed the packets to the corresponding services. Those can be found in `tcdistribution`. -If Space Packets are used, a timestamper has to be provided by the user. -An example can be found in the `timemanager` folder, which uses `CCSDSTime::CDS_short`. - -# Device Handlers - -DeviceHandlers are another important component of the FSFW. -The idea is, to have a software counterpart of every physical device to provide a simple mode, -health and commanding interface. By separating the underlying Communication Interface with -`DeviceCommunicationIF`, a device handler (DH) can be tested on different hardware. -The DH has mechanisms to monitor the communication with the physical device which allow -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). - -# Modes and Health - -The two interfaces `HasModesIF` and `HasHealthIF` provide access for commanding and monitoring -of components. On-board Mode Management is implement in hierarchy system. -DeviceHandlers and Controllers are the lowest part of the hierarchy. -The next layer are Assemblies. Those assemblies act as a component which handle -redundancies of handlers. Assemblies share a common core with the next level which -are the Subsystems. - -Those Assemblies are intended to act as auto-generated components from a database which describes -the subsystem modes. The definitions contain transition and target tables which contain the DH, -Assembly and Controller Modes to be commanded. -Transition tables contain as many steps as needed to reach the mode from any other mode, e.g. a -switch into any higher AOCS mode might first turn on the sensors, than the actuators and the -controller as last component. -The target table is used to describe the state that is checked continuously by the subsystem. -All of this allows System Modes to be generated as Subsystem object as well from the same database. -This System contains list of subsystem modes in the transition and target tables. -Therefore, it allows a modular system to create system modes and easy commanding of those, because -only the highest components must be commanded. - -The health state represents if the component is able to perform its tasks. -This can be used to signal the system to avoid using this component instead of a redundant one. -The on-board FDIR uses the health state for isolation and recovery. - -# Unit Tests - -Unit Tests are provided in the unittest folder. Those use the catch2 framework but do not include -catch2 itself. More information on how to run these tests can be found in the separate -[`fsfw_tests` reposoitory](https://egit.irs.uni-stuttgart.de/fsfw/fsfw_tests) diff --git a/docs/README-localpools.md b/docs/README-localpools.md deleted file mode 100644 index 1770efb9..00000000 --- a/docs/README-localpools.md +++ /dev/null @@ -1,174 +0,0 @@ -## Local Data Pools Developer Information - -The following text is targeted towards mission software developers which would like -to use the local data pools provided by the FSFW to store data like sensor values so they can be -used by other software objects like controllers as well. If a custom class should have a local -pool which can be used by other software objects as well, following steps have to be performed: - -1. Create a `LocalDataPoolManager` member object in the custom class -2. Implement the `HasLocalDataPoolIF` with specifies the interface between the local pool manager -and the class owning the local pool. - -The local data pool manager is also able to process housekeeping service requests in form -of messages, generate periodic housekeeping packet, generate notification and snapshots of changed -variables and datasets and process notifications and snapshots coming from other objects. -The two former tasks are related to the external interface using telemetry and telecommands (TMTC) -while the later two are related to data consumers like controllers only acting on data change -detected by the data creator instead of checking the data manually each cycle. Two important -framework classes `DeviceHandlerBase` and `ExtendedControllerBase` already perform the two steps -shown above so the steps required are altered slightly. - -### Storing and Accessing pool data - -The pool manager is responsible for thread-safe access of the pool data, but the actual -access to the pool data from the point of view of a mission software developer happens via proxy -classes like pool variable classes. These classes store a copy -of the pool variable with the matching datatype and copy the actual data from the local pool -on a `read` call. Changed variables can then be written to the local pool with a `commit` call. -The `read` and `commit` calls are thread-safe and can be called concurrently from data creators -and data consumers. Generally, a user will create a dataset class which in turn groups all -cohesive pool variables. These sets simply iterator over the list of variables and call the -`read` and `commit` functions of each variable. The following diagram shows the -high-level architecture of the local data pools. - -.. image:: ../misc/logo/FSFW_Logo_V3_bw.png - :alt: FSFW Logo - - -An example is shown for using the local data pools with a Gyroscope. -For example, the following code shows an implementation to access data from a Gyroscope taken -from the SOURCE CubeSat project: - -```cpp -class GyroPrimaryDataset: public StaticLocalDataSet<3 * sizeof(float)> { -public: - /** - * Constructor for data users - * @param gyroId - */ - GyroPrimaryDataset(object_id_t gyroId): - StaticLocalDataSet(sid_t(gyroId, gyrodefs::GYRO_DATA_SET_ID)) { - setAllVariablesReadOnly(); - } - - lp_var_t angVelocityX = lp_var_t(sid.objectId, - gyrodefs::ANGULAR_VELOCITY_X, this); - lp_var_t angVelocityY = lp_var_t(sid.objectId, - gyrodefs::ANGULAR_VELOCITY_Y, this); - lp_var_t angVelocityZ = lp_var_t(sid.objectId, - gyrodefs::ANGULAR_VELOCITY_Z, this); -private: - - friend class GyroHandler; - /** - * Constructor for data creator - * @param hkOwner - */ - GyroPrimaryDataset(HasLocalDataPoolIF* hkOwner): - StaticLocalDataSet(hkOwner, gyrodefs::GYRO_DATA_SET_ID) {} -}; -``` - -There is a public constructor for users which sets all variables to read-only and there is a -constructor for the GyroHandler data creator by marking it private and declaring the `GyroHandler` -as a friend class. Both the atittude controller and the `GyroHandler` can now -use the same class definition to access the pool variables with `read` and `commit` semantics -in a thread-safe way. Generally, each class requiring access will have the set class as a member -class. The data creator will also be generally a `DeviceHandlerBase` subclass and some additional -steps are necessary to expose the set for housekeeping purposes. - -### Using the local data pools in a `DeviceHandlerBase` subclass - -It is very common to store data generated by devices like a sensor into a pool which can -then be used by other objects. Therefore, the `DeviceHandlerBase` already has a -local pool. Using the aforementioned example, our `GyroHandler` will now have the set class -as a member: - -```cpp -class GyroHandler: ... { - -public: - ... -private: - ... - GyroPrimaryDataset gyroData; - ... -}; -``` - -The constructor used for the creators expects the owner class as a parameter, so we initialize -the object in the `GyroHandler` constructor like this: - -```cpp -GyroHandler::GyroHandler(object_id_t objectId, object_id_t comIF, - CookieIF *comCookie, uint8_t switchId): - DeviceHandlerBase(objectId, comIF, comCookie), switchId(switchId), - gyroData(this) {} -``` - -We need to assign the set to a reply ID used in the `DeviceHandlerBase`. -The combination of the `GyroHandler` object ID and the reply ID will be the 64-bit structure ID -`sid_t` and is used to globally identify the set, for example when requesting housekeeping data or -generating update messages. We need to assign our custom set class in some way so that the local -pool manager can access the custom data sets as well. -By default, the `getDataSetHandle` will take care of this tasks. The default implementation for a -`DeviceHandlerBase` subclass will use the internal command map to retrieve -a handle to a dataset from a given reply ID. Therefore, -we assign the set in the `fillCommandAndReplyMap` function: - -```cpp -void GyroHandler::fillCommandAndReplyMap() { - ... - this->insertInCommandAndReplyMap(gyrodefs::GYRO_DATA, 3, &gyroData); - ... -} -``` - -Now, we need to create the actual pool entries as well, using the `initializeLocalDataPool` -function. Here, we also immediately subscribe for periodic housekeeping packets -with an interval of 4 seconds. They are still disabled in this example and can be enabled -with a housekeeping service command. - -```cpp -ReturnValue_t GyroHandler::initializeLocalDataPool(localpool::DataPool &localDataPoolMap, - LocalDataPoolManager &poolManager) { - localDataPoolMap.emplace(gyrodefs::ANGULAR_VELOCITY_X, - new PoolEntry({0.0})); - localDataPoolMap.emplace(gyrodefs::ANGULAR_VELOCITY_Y, - new PoolEntry({0.0})); - localDataPoolMap.emplace(gyrodefs::ANGULAR_VELOCITY_Z, - new PoolEntry({0.0})); - localDataPoolMap.emplace(gyrodefs::GENERAL_CONFIG_REG42, - new PoolEntry({0})); - localDataPoolMap.emplace(gyrodefs::RANGE_CONFIG_REG43, - new PoolEntry({0})); - - poolManager.subscribeForPeriodicPacket(gyroData.getSid(), false, 4.0, false); - return returnvalue::OK; -} -``` - -Now, if we receive some sensor data and converted them into the right format, -we can write it into the pool like this, using a guard class to ensure the set is commited back -in any case: - -```cpp -PoolReadGuard readHelper(&gyroData); -if(readHelper.getReadResult() == returnvalue::OK) { - if(not gyroData.isValid()) { - gyroData.setValidity(true, true); - } - - gyroData.angVelocityX = angularVelocityX; - gyroData.angVelocityY = angularVelocityY; - gyroData.angVelocityZ = angularVelocityZ; -} -``` - -The guard class will commit the changed data on destruction automatically. - -### Using the local data pools in a `ExtendedControllerBase` subclass - -Coming soon - - diff --git a/docs/README-osal.md b/docs/README-osal.md deleted file mode 100644 index 6f8ce60f..00000000 --- a/docs/README-osal.md +++ /dev/null @@ -1,32 +0,0 @@ -# Operating System Abstraction Layer (OSAL) - -Some specific information on the provided OSALs are provided. - -## Linux OSAL - -This OSAL can be used to compile for Linux host systems like Ubuntu 20.04 or for -embedded Linux targets like the Raspberry Pi. This OSAL generally requires threading support -and real-time functionalities. For most UNIX systems, this is done by adding `-lrt` and `-lpthread` to the linked libraries in the compilation process. The CMake build support provided will do this automatically for the `fsfw` target. It should be noted that most UNIX systems need to be configured specifically to allow the real-time functionalities required by the FSFW. - -More information on how to set up a Linux system accordingly can be found in the -[Linux README of the FSFW example application](https://egit.irs.uni-stuttgart.de/fsfw/fsfw_example/src/branch/master/doc/README-linux.md#top) - -## Hosted OSAL - -This is the newest OSAL. Support for Semaphores has not been implemented yet and will propably be implemented as soon as C++20 with Semaphore support has matured. This OSAL can be used to run the FSFW on any host system, but currently has only been tested on Windows 10 and Ubuntu 20.04. Unlike the other OSALs, it uses dynamic memory allocation (e.g. for the message queue implementation). Cross-platform serial port (USB) support might be added soon. - -## FreeRTOS OSAL - -FreeRTOS is not included and the developer needs to take care of compiling the FreeRTOS sources and adding the `FreeRTOSConfig.h` file location to the include path. This OSAL has only been tested extensively with the pre-emptive scheduler configuration so far but it should in principle also be possible to use a cooperative scheduler. It is recommended to use the `heap_4` allocation scheme. When using newlib (nano), it is also recommended to add `#define configUSE_NEWLIB_REENTRANT` to the FreeRTOS configuration file to ensure thread-safety. - -When using this OSAL, developers also need to provide an implementation for the `vRequestContextSwitchFromISR` function. This has been done because the call to request a context switch from an ISR is generally located in the `portmacro.h` header and is different depending on the target architecture or device. - -## RTEMS OSAL - -The RTEMS OSAL was the first implemented OSAL which is also used on the active satellite Flying Laptop. - -## TCP/IP socket abstraction - -The Linux and Host OSAL provide abstraction layers for the socket API. Currently, only UDP sockets have been imlemented. This is very useful to test TMTC handling either on the host computer directly (targeting localhost with a TMTC application) or on embedded Linux devices, sending TMTC packets via Ethernet. - - diff --git a/docs/README-pus.md b/docs/README-pus.md deleted file mode 100644 index 928d2eda..00000000 --- a/docs/README-pus.md +++ /dev/null @@ -1 +0,0 @@ -## PUS Services From bcbbc9763a80af27e7ccd0d1ebd0342d13ad5eb0 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Thu, 15 Sep 2022 14:00:01 +0200 Subject: [PATCH 09/32] markdown update not required, will be removed --- docs/README-highlevel.md | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/docs/README-highlevel.md b/docs/README-highlevel.md index 23e27da3..9005af8d 100644 --- a/docs/README-highlevel.md +++ b/docs/README-highlevel.md @@ -4,13 +4,12 @@ High-level overview # Structure The general structure is driven by the usage of interfaces provided by objects. -The FSFW uses C++17 as baseline. Most modern compilers like GCC should have support for this -standard, even for micocontrollers. - -The FSFW might use dynamic allocation during program initialization but not during runtime. -It offers pool objects, static containers and it also exposes the Embedded Template Library -to allow writing code which does not perform allocation during runtime. The fsfw uses run-time type -information but will not throw exceptions. +The FSFW uses C++11 as baseline. The intention behind this is that this C++ Standard should be +widely available, even with older compilers. +The FSFW uses dynamic allocation during the initialization but provides static containers during runtime. +This simplifies the instantiation of objects and allows the usage of some standard containers. +Dynamic Allocation after initialization is discouraged and different solutions are provided in the +FSFW to achieve that. The fsfw uses run-time type information but exceptions are not allowed. # Failure Handling From b4b11ebd3b46603584a9f4d7722b66715a4c3e6a Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Fri, 16 Sep 2022 18:08:20 +0200 Subject: [PATCH 10/32] fixes and tweaks --- src/fsfw/tcdistribution/definitions.h | 10 +++++----- src/fsfw/tmtcpacket/ccsds/defs.h | 4 ++-- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/fsfw/tcdistribution/definitions.h b/src/fsfw/tcdistribution/definitions.h index 3d455077..1da1f8ab 100644 --- a/src/fsfw/tcdistribution/definitions.h +++ b/src/fsfw/tcdistribution/definitions.h @@ -14,11 +14,11 @@ static constexpr ReturnValue_t INVALID_PACKET_TYPE = MAKE_RETURN_CODE(2); static constexpr ReturnValue_t INVALID_SEC_HEADER_FIELD = MAKE_RETURN_CODE(3); static constexpr ReturnValue_t INCORRECT_PRIMARY_HEADER = MAKE_RETURN_CODE(4); -static constexpr ReturnValue_t INCOMPLETE_PACKET = MAKE_RETURN_CODE(5); -static constexpr ReturnValue_t INVALID_PUS_VERSION = MAKE_RETURN_CODE(6); -static constexpr ReturnValue_t INCORRECT_CHECKSUM = MAKE_RETURN_CODE(7); -static constexpr ReturnValue_t ILLEGAL_PACKET_SUBTYPE = MAKE_RETURN_CODE(8); -static constexpr ReturnValue_t INCORRECT_SECONDARY_HEADER = MAKE_RETURN_CODE(9); +static constexpr ReturnValue_t INCOMPLETE_PACKET = MAKE_RETURN_CODE(7); +static constexpr ReturnValue_t INVALID_PUS_VERSION = MAKE_RETURN_CODE(8); +static constexpr ReturnValue_t INCORRECT_CHECKSUM = MAKE_RETURN_CODE(9); +static constexpr ReturnValue_t ILLEGAL_PACKET_SUBTYPE = MAKE_RETURN_CODE(10); +static constexpr ReturnValue_t INCORRECT_SECONDARY_HEADER = MAKE_RETURN_CODE(11); }; // namespace tcdistrib #endif // FSFW_TMTCPACKET_DEFINITIONS_H diff --git a/src/fsfw/tmtcpacket/ccsds/defs.h b/src/fsfw/tmtcpacket/ccsds/defs.h index 1c7de540..da7c524d 100644 --- a/src/fsfw/tmtcpacket/ccsds/defs.h +++ b/src/fsfw/tmtcpacket/ccsds/defs.h @@ -23,11 +23,11 @@ constexpr uint16_t getSpacePacketIdFromApid(bool isTc, uint16_t apid, return ((isTc << 4) | (secondaryHeaderFlag << 3) | ((apid >> 8) & 0x07)) << 8 | (apid & 0x00ff); } -constexpr uint16_t getTcSpacePacketIdFromApid(uint16_t apid, bool secondaryHeaderFlag = true) { +constexpr uint16_t getTcSpacePacketIdFromApid(uint16_t apid, bool secondaryHeaderFlag) { return getSpacePacketIdFromApid(true, apid, secondaryHeaderFlag); } -constexpr uint16_t getTmSpacePacketIdFromApid(uint16_t apid, bool secondaryHeaderFlag = true) { +constexpr uint16_t getTmSpacePacketIdFromApid(uint16_t apid, bool secondaryHeaderFlag) { return getSpacePacketIdFromApid(false, apid, secondaryHeaderFlag); } From 72172a972bca7a2026a30d5a87289ab0510b1e31 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Fri, 16 Sep 2022 18:24:23 +0200 Subject: [PATCH 11/32] update changelog --- CHANGELOG.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 03cc0613..44e2262b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -26,6 +26,10 @@ and this project adheres to [Semantic Versioning](http://semver.org/). ## Changes +- Remove default secondary header argument for + `uint16_t getTcSpacePacketIdFromApid(uint16_t apid, bool secondaryHeaderFlag)` and + `uint16_t getTmSpacePacketIdFromApid(uint16_t apid, bool secondaryHeaderFlag)` + PR: https://egit.irs.uni-stuttgart.de/fsfw/fsfw/pulls/689 - Removed `HasReturnvaluesIF` class in favor of `returnvalue` namespace with `OK` and `FAILED` constants. PR: https://egit.irs.uni-stuttgart.de/fsfw/fsfw/pulls/659 From 9a2146fa2df0a5e5e5a5d5bc61e24c7b344b06d3 Mon Sep 17 00:00:00 2001 From: Ulrich Mohr Date: Fri, 23 Sep 2022 11:36:29 +0200 Subject: [PATCH 12/32] added impressum and datenschutz in sphinx documentation --- docs/conf.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/docs/conf.py b/docs/conf.py index 62b17192..eb0f94cd 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -50,6 +50,11 @@ exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store'] # html_theme = 'alabaster' +html_theme_options = { + "extra_nav_links": {"Impressum" : "https://www.uni-stuttgart.de/impressum", "Datenschutz": "https://info.irs.uni-stuttgart.de/datenschutz/datenschutzWebmit.html"} +} + + # Add any paths that contain custom static files (such as style sheets) here, # relative to this directory. They are copied after the builtin static files, # so a file named "default.css" will overwrite the builtin "default.css". From 3b8ca09299cbe3de03364c0f622a8d8cf2ecebce Mon Sep 17 00:00:00 2001 From: Ulrich Mohr Date: Fri, 23 Sep 2022 13:46:03 +0200 Subject: [PATCH 13/32] prepared docker for documentation rsync --- automation/Dockerfile | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/automation/Dockerfile b/automation/Dockerfile index 5bd7d382..1bd39b3f 100644 --- a/automation/Dockerfile +++ b/automation/Dockerfile @@ -5,7 +5,7 @@ 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 python3 pip doxygen graphviz +RUN apt-get --yes install gcc g++ cmake make lcov git valgrind nano iputils-ping python3 pip doxygen graphviz rsync RUN python3 -m pip install sphinx breathe @@ -23,3 +23,7 @@ RUN git clone https://github.com/ETLCPP/etl.git && \ #ssh needs a valid user to work RUN adduser --uid 114 jenkins + +#add documentation server to known hosts +RUN echo "|1|/LzCV4BuTmTb2wKnD146l9fTKgQ=|NJJtVjvWbtRt8OYqFgcYRnMQyVw= ecdsa-sha2-nistp256 AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBNL8ssTonYtgiR/6RRlSIK9WU1ywOcJmxFTLcEblAwH7oifZzmYq3XRfwXrgfMpylEfMFYfCU8JRqtmi19xc21A=" >> /etc/ssh/ssh_known_hosts +RUN echo "|1|CcBvBc3EG03G+XM5rqRHs6gK/Gg=|oGeJQ+1I8NGI2THIkJsW92DpTzs= ecdsa-sha2-nistp256 AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBNL8ssTonYtgiR/6RRlSIK9WU1ywOcJmxFTLcEblAwH7oifZzmYq3XRfwXrgfMpylEfMFYfCU8JRqtmi19xc21A=" >> /etc/ssh/ssh_known_hosts \ No newline at end of file From 0fea22d0319a86304ebe83805f9adfdfeaccc2ee Mon Sep 17 00:00:00 2001 From: Ulrich Mohr Date: Fri, 23 Sep 2022 14:06:28 +0200 Subject: [PATCH 14/32] switching to rsync and deploying to web documentation --- automation/Jenkinsfile | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/automation/Jenkinsfile b/automation/Jenkinsfile index 8b123fa9..63acab58 100644 --- a/automation/Jenkinsfile +++ b/automation/Jenkinsfile @@ -5,7 +5,7 @@ pipeline { } agent { docker { - image 'fsfw-ci:d5' + image 'fsfw-ci:d6' args '--network host' } } @@ -52,14 +52,12 @@ pipeline { sh 'cmake -DFSFW_BUILD_DOCS=ON -DFSFW_OSAL=host ..' sh 'make Sphinx' sshagent(credentials: ['documentation-buildfix']) { - sh 'ssh -o StrictHostKeyChecking=no buildfix@documentation.intra.irs.uni-stuttgart.de rm -rf /mnt/data/www/html/fsfw/development/*' - sh 'scp -o StrictHostKeyChecking=no -r docs/sphinx/* buildfix@documentation.intra.irs.uni-stuttgart.de:/mnt/data/www/html/fsfw/development' + sh 'rsync -r --delete docs/sphinx/* buildfix@documentation.irs.uni-stuttgart.de:~/www/fsfw/development' } } dir(BUILDDIR) { sshagent(credentials: ['documentation-buildfix']) { - sh 'ssh -o StrictHostKeyChecking=no buildfix@documentation.intra.irs.uni-stuttgart.de rm -rf /mnt/data/www/html/fsfw/coverage/development/*' - sh 'scp -o StrictHostKeyChecking=no -r fsfw-tests_coverage/* buildfix@documentation.intra.irs.uni-stuttgart.de:/mnt/data/www/html/fsfw/coverage/development' + sh 'rsync -r --delete fsfw-tests_coverage/* buildfix@documentation.irs.uni-stuttgart.de:~/www/fsfw/coverage/development' } } } @@ -73,14 +71,12 @@ pipeline { sh 'cmake -DFSFW_BUILD_DOCS=ON -DFSFW_OSAL=host ..' sh 'make Sphinx' sshagent(credentials: ['documentation-buildfix']) { - sh 'ssh -o StrictHostKeyChecking=no buildfix@documentation.intra.irs.uni-stuttgart.de rm -rf /mnt/data/www/html/fsfw/master/*' - sh 'scp -o StrictHostKeyChecking=no -r docs/sphinx/* buildfix@documentation.intra.irs.uni-stuttgart.de:/mnt/data/www/html/fsfw/master' + sh 'rsync -r --delete docs/sphinx/* buildfix@documentation.irs.uni-stuttgart.de:~/www/fsfw/master' } } dir(BUILDDIR) { sshagent(credentials: ['documentation-buildfix']) { - sh 'ssh -o StrictHostKeyChecking=no buildfix@documentation.intra.irs.uni-stuttgart.de rm -rf /mnt/data/www/html/fsfw/coverage/master/*' - sh 'scp -o StrictHostKeyChecking=no -r fsfw-tests_coverage/* buildfix@documentation.intra.irs.uni-stuttgart.de:/mnt/data/www/html/fsfw/coverage/master' + sh 'rsync -r --delete fsfw-tests_coverage/* buildfix@documentation.irs.uni-stuttgart.de:~/www/fsfw/coverage/master' } } } From 5488ee715f9327c9f7d791adb762b8d7d0eebf48 Mon Sep 17 00:00:00 2001 From: Ulrich Mohr Date: Fri, 23 Sep 2022 14:07:12 +0200 Subject: [PATCH 15/32] testing deployment of documentation --- automation/Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/automation/Jenkinsfile b/automation/Jenkinsfile index 63acab58..fcbe1a7b 100644 --- a/automation/Jenkinsfile +++ b/automation/Jenkinsfile @@ -45,7 +45,7 @@ pipeline { } stage('Documentation') { when { - branch 'development' + branch 'mohr/documentation_ci' } steps { dir(DOCDDIR) { From c0000a863595490d7a6c420c4b8729133bc2c263 Mon Sep 17 00:00:00 2001 From: Ulrich Mohr Date: Fri, 23 Sep 2022 14:14:10 +0200 Subject: [PATCH 16/32] testing deployment of both development and master doc --- automation/Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/automation/Jenkinsfile b/automation/Jenkinsfile index fcbe1a7b..022bbad0 100644 --- a/automation/Jenkinsfile +++ b/automation/Jenkinsfile @@ -64,7 +64,7 @@ pipeline { } stage('Master Documentation') { when { - branch 'master' + branch 'mohr/documentation_ci' } steps { dir(DOCDDIR) { From 33530f2819bb84566f9d105d2284a898d924e219 Mon Sep 17 00:00:00 2001 From: Ulrich Mohr Date: Fri, 23 Sep 2022 17:04:35 +0200 Subject: [PATCH 17/32] adding Impressum and Datenschutz to lcov output --- CMakeLists.txt | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index b5e45a8c..e2572b20 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -326,7 +326,8 @@ if(FSFW_BUILD_TESTS) "/usr/local/include/*" "*/fsfw_tests/*" "*/catch2-src/*" - "*/fsfw_hal/*") + "*/fsfw_hal/*" + "unittests/*") endif() target_link_options(${FSFW_TEST_TGT} PRIVATE -fprofile-arcs @@ -345,7 +346,8 @@ if(FSFW_BUILD_TESTS) else() setup_target_for_coverage_lcov( NAME ${FSFW_TEST_TGT}_coverage EXECUTABLE ${FSFW_TEST_TGT} - DEPENDENCIES ${FSFW_TEST_TGT}) + DEPENDENCIES ${FSFW_TEST_TGT} + GENHTML_ARGS --html-epilog ${CMAKE_SOURCE_DIR}/unittests/lcov_epilog.html) endif() endif() endif() From 292fe3e5e4526c5aa35049033dd50c1851f66a93 Mon Sep 17 00:00:00 2001 From: Ulrich Mohr Date: Fri, 23 Sep 2022 17:11:57 +0200 Subject: [PATCH 18/32] forgot epilog file --- unittests/lcov_epilog.html | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 unittests/lcov_epilog.html diff --git a/unittests/lcov_epilog.html b/unittests/lcov_epilog.html new file mode 100644 index 00000000..6ed9a1b2 --- /dev/null +++ b/unittests/lcov_epilog.html @@ -0,0 +1,2 @@ +
Impressum Datenschutz
+ From 5c3bb13834933dedbaca62013b14776d2ea1221a Mon Sep 17 00:00:00 2001 From: Ulrich Mohr Date: Fri, 23 Sep 2022 17:31:07 +0200 Subject: [PATCH 19/32] Revert "testing deployment of both development and master doc" This reverts commit c0000a863595490d7a6c420c4b8729133bc2c263. --- automation/Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/automation/Jenkinsfile b/automation/Jenkinsfile index 022bbad0..fcbe1a7b 100644 --- a/automation/Jenkinsfile +++ b/automation/Jenkinsfile @@ -64,7 +64,7 @@ pipeline { } stage('Master Documentation') { when { - branch 'mohr/documentation_ci' + branch 'master' } steps { dir(DOCDDIR) { From 12d0c23c13c36774cadaf8a264f7396497960105 Mon Sep 17 00:00:00 2001 From: Ulrich Mohr Date: Fri, 23 Sep 2022 17:31:17 +0200 Subject: [PATCH 20/32] Revert "testing deployment of documentation" This reverts commit 5488ee715f9327c9f7d791adb762b8d7d0eebf48. --- automation/Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/automation/Jenkinsfile b/automation/Jenkinsfile index fcbe1a7b..63acab58 100644 --- a/automation/Jenkinsfile +++ b/automation/Jenkinsfile @@ -45,7 +45,7 @@ pipeline { } stage('Documentation') { when { - branch 'mohr/documentation_ci' + branch 'development' } steps { dir(DOCDDIR) { From 9e6c1d60e51a927f0e9efe49bbebf1363e6570cd Mon Sep 17 00:00:00 2001 From: Ulrich Mohr Date: Fri, 23 Sep 2022 17:54:41 +0200 Subject: [PATCH 21/32] another ci check --- automation/Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/automation/Jenkinsfile b/automation/Jenkinsfile index 63acab58..fcbe1a7b 100644 --- a/automation/Jenkinsfile +++ b/automation/Jenkinsfile @@ -45,7 +45,7 @@ pipeline { } stage('Documentation') { when { - branch 'development' + branch 'mohr/documentation_ci' } steps { dir(DOCDDIR) { From 4f3361eb2b3af9554ac0d2f154a4c434b7eae21c Mon Sep 17 00:00:00 2001 From: Ulrich Mohr Date: Fri, 23 Sep 2022 18:33:47 +0200 Subject: [PATCH 22/32] another ci check --- automation/Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/automation/Jenkinsfile b/automation/Jenkinsfile index fcbe1a7b..022bbad0 100644 --- a/automation/Jenkinsfile +++ b/automation/Jenkinsfile @@ -64,7 +64,7 @@ pipeline { } stage('Master Documentation') { when { - branch 'master' + branch 'mohr/documentation_ci' } steps { dir(DOCDDIR) { From 775d5632de48fa4c6fb549f0c2b8d1bff4cfd362 Mon Sep 17 00:00:00 2001 From: Ulrich Mohr Date: Fri, 23 Sep 2022 20:26:45 +0200 Subject: [PATCH 23/32] update to ssh connection to doc server --- automation/Jenkinsfile | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/automation/Jenkinsfile b/automation/Jenkinsfile index 022bbad0..0f457213 100644 --- a/automation/Jenkinsfile +++ b/automation/Jenkinsfile @@ -52,12 +52,12 @@ pipeline { sh 'cmake -DFSFW_BUILD_DOCS=ON -DFSFW_OSAL=host ..' sh 'make Sphinx' sshagent(credentials: ['documentation-buildfix']) { - sh 'rsync -r --delete docs/sphinx/* buildfix@documentation.irs.uni-stuttgart.de:~/www/fsfw/development' + sh 'rsync -r --delete docs/sphinx/* buildfix@documentation.irs.uni-stuttgart.de:/fsfw/development' } } dir(BUILDDIR) { sshagent(credentials: ['documentation-buildfix']) { - sh 'rsync -r --delete fsfw-tests_coverage/* buildfix@documentation.irs.uni-stuttgart.de:~/www/fsfw/coverage/development' + sh 'rsync -r --delete fsfw-tests_coverage/* buildfix@documentation.irs.uni-stuttgart.de:/fsfw/coverage/development' } } } @@ -71,12 +71,12 @@ pipeline { sh 'cmake -DFSFW_BUILD_DOCS=ON -DFSFW_OSAL=host ..' sh 'make Sphinx' sshagent(credentials: ['documentation-buildfix']) { - sh 'rsync -r --delete docs/sphinx/* buildfix@documentation.irs.uni-stuttgart.de:~/www/fsfw/master' + sh 'rsync -r --delete docs/sphinx/* buildfix@documentation.irs.uni-stuttgart.de:/fsfw/master' } } dir(BUILDDIR) { sshagent(credentials: ['documentation-buildfix']) { - sh 'rsync -r --delete fsfw-tests_coverage/* buildfix@documentation.irs.uni-stuttgart.de:~/www/fsfw/coverage/master' + sh 'rsync -r --delete fsfw-tests_coverage/* buildfix@documentation.irs.uni-stuttgart.de:/fsfw/coverage/master' } } } From c54d9d7ba684f046d784fe35c3f0eafa7cd5f2e4 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Mon, 26 Sep 2022 14:15:11 +0200 Subject: [PATCH 24/32] add some tests --- unittests/tmtcpacket/testCcsdsCreator.cpp | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/unittests/tmtcpacket/testCcsdsCreator.cpp b/unittests/tmtcpacket/testCcsdsCreator.cpp index 2b043717..d73e5252 100644 --- a/unittests/tmtcpacket/testCcsdsCreator.cpp +++ b/unittests/tmtcpacket/testCcsdsCreator.cpp @@ -14,11 +14,17 @@ TEST_CASE("CCSDS Creator", "[ccsds-creator]") { size_t serLen = 0; SECTION("Constexpr Helpers") { - REQUIRE(ccsds::getTcSpacePacketIdFromApid(0x22) == 0x1822); - REQUIRE(ccsds::getTmSpacePacketIdFromApid(0x22) == 0x0822); + REQUIRE(ccsds::getTcSpacePacketIdFromApid(0x22, true) == 0x1822); + REQUIRE(ccsds::getTmSpacePacketIdFromApid(0x22, true) == 0x0822); - REQUIRE(ccsds::getTcSpacePacketIdFromApid(0x7ff) == 0x1fff); - REQUIRE(ccsds::getTmSpacePacketIdFromApid(0x7ff) == 0xfff); + REQUIRE(ccsds::getTcSpacePacketIdFromApid(0x22, false) == 0x1022); + REQUIRE(ccsds::getTmSpacePacketIdFromApid(0x22, false) == 0x0022); + + REQUIRE(ccsds::getTcSpacePacketIdFromApid(0x7ff, true) == 0x1fff); + REQUIRE(ccsds::getTmSpacePacketIdFromApid(0x7ff, true) == 0xfff); + + REQUIRE(ccsds::getTcSpacePacketIdFromApid(0x7ff, false) == 0x17ff); + REQUIRE(ccsds::getTmSpacePacketIdFromApid(0x7ff, false) == 0x7ff); } SECTION("Basic Test") { From 3de0ae5a485b8538e178fef1c5bd33441b54ceb7 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Thu, 29 Sep 2022 17:20:18 +0200 Subject: [PATCH 25/32] DHB bug --- src/fsfw/devicehandlers/DeviceHandlerBase.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/fsfw/devicehandlers/DeviceHandlerBase.cpp b/src/fsfw/devicehandlers/DeviceHandlerBase.cpp index 3968142c..4f1c4367 100644 --- a/src/fsfw/devicehandlers/DeviceHandlerBase.cpp +++ b/src/fsfw/devicehandlers/DeviceHandlerBase.cpp @@ -517,16 +517,16 @@ ReturnValue_t DeviceHandlerBase::updatePeriodicReply(bool enable, DeviceCommandI if (enable) { info->active = true; if (info->countdown != nullptr) { - info->delayCycles = info->maxDelayCycles; - } else { info->countdown->resetTimer(); + } else { + info->delayCycles = info->maxDelayCycles; } } else { info->active = false; if (info->countdown != nullptr) { - info->delayCycles = 0; - } else { info->countdown->timeOut(); + } else { + info->delayCycles = 0; } } } From 7877776e248aad4c2a6fcbc5f51f8f791616e6a0 Mon Sep 17 00:00:00 2001 From: Ulrich Mohr Date: Fri, 30 Sep 2022 14:34:25 +0200 Subject: [PATCH 26/32] one last check --- automation/Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/automation/Jenkinsfile b/automation/Jenkinsfile index 0f457213..ec3148bd 100644 --- a/automation/Jenkinsfile +++ b/automation/Jenkinsfile @@ -45,7 +45,7 @@ pipeline { } stage('Documentation') { when { - branch 'mohr/documentation_ci' + branch 'development' } steps { dir(DOCDDIR) { From 8e362a000c56618335145d159ab97883c53b33a0 Mon Sep 17 00:00:00 2001 From: Ulrich Mohr Date: Fri, 30 Sep 2022 14:36:25 +0200 Subject: [PATCH 27/32] Revert "one last check" This reverts commit 7877776e248aad4c2a6fcbc5f51f8f791616e6a0. --- automation/Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/automation/Jenkinsfile b/automation/Jenkinsfile index ec3148bd..0f457213 100644 --- a/automation/Jenkinsfile +++ b/automation/Jenkinsfile @@ -45,7 +45,7 @@ pipeline { } stage('Documentation') { when { - branch 'development' + branch 'mohr/documentation_ci' } steps { dir(DOCDDIR) { From 7b5ae6a445d9de7d8f4af57370000d091faee407 Mon Sep 17 00:00:00 2001 From: Ulrich Mohr Date: Fri, 30 Sep 2022 14:40:59 +0200 Subject: [PATCH 28/32] done? --- automation/Jenkinsfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/automation/Jenkinsfile b/automation/Jenkinsfile index 0f457213..27136606 100644 --- a/automation/Jenkinsfile +++ b/automation/Jenkinsfile @@ -45,7 +45,7 @@ pipeline { } stage('Documentation') { when { - branch 'mohr/documentation_ci' + branch 'development' } steps { dir(DOCDDIR) { @@ -64,7 +64,7 @@ pipeline { } stage('Master Documentation') { when { - branch 'mohr/documentation_ci' + branch 'master' } steps { dir(DOCDDIR) { From 6f562e5f3ed6ff971cad6e95f3f689f0a9c6e953 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Tue, 4 Oct 2022 10:25:58 +0200 Subject: [PATCH 29/32] missing retval conv --- src/fsfw_tests/integration/devices/TestDeviceHandler.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/fsfw_tests/integration/devices/TestDeviceHandler.cpp b/src/fsfw_tests/integration/devices/TestDeviceHandler.cpp index 01f0494b..fdf02a70 100644 --- a/src/fsfw_tests/integration/devices/TestDeviceHandler.cpp +++ b/src/fsfw_tests/integration/devices/TestDeviceHandler.cpp @@ -646,7 +646,7 @@ ReturnValue_t TestDevice::initializeLocalDataPool(localpool::DataPool& localData /* Subscribe for periodic HK packets but do not enable reporting for now. Non-diangostic with a period of one second */ poolManager.subscribeForRegularPeriodicPacket({sid, false, 1.0}); - return HasReturnvaluesIF::RETURN_OK; + return returnvalue::OK; } ReturnValue_t TestDevice::getParameter(uint8_t domainId, uint8_t uniqueId, From 448d20f3bd3d8844c0a6ee2a0396ba6765b49302 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Tue, 4 Oct 2022 10:55:46 +0200 Subject: [PATCH 30/32] small fix for helper --- scripts/helper.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/helper.py b/scripts/helper.py index 0ced7186..1b03161b 100755 --- a/scripts/helper.py +++ b/scripts/helper.py @@ -199,7 +199,7 @@ def check_for_cmake_build_dir(build_dir_list: list) -> list: def perform_lcov_operation(directory: str, chdir: bool): if chdir: os.chdir(directory) - cmd_runner("cmake --build . -- fsfw-tests_coverage -j") + cmd_runner("cmake --build -j . -- fsfw-tests_coverage") def determine_build_dir(build_dir_list: List[str]): From c283e0c98889530ac5779d11d8bec816edd5ed80 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Tue, 4 Oct 2022 11:02:08 +0200 Subject: [PATCH 31/32] okay this is correct --- scripts/helper.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/helper.py b/scripts/helper.py index 1b03161b..9e7a1607 100755 --- a/scripts/helper.py +++ b/scripts/helper.py @@ -199,7 +199,7 @@ def check_for_cmake_build_dir(build_dir_list: list) -> list: def perform_lcov_operation(directory: str, chdir: bool): if chdir: os.chdir(directory) - cmd_runner("cmake --build -j . -- fsfw-tests_coverage") + cmd_runner("cmake --build . -j -- fsfw-tests_coverage") def determine_build_dir(build_dir_list: List[str]): From 337cb0d6c96ecbeec44ff4b08919dd6a5624dc30 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Mon, 10 Oct 2022 10:21:17 +0200 Subject: [PATCH 32/32] hotfix --- src/fsfw/devicehandlers/DeviceHandlerBase.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/fsfw/devicehandlers/DeviceHandlerBase.cpp b/src/fsfw/devicehandlers/DeviceHandlerBase.cpp index 3968142c..046b61a3 100644 --- a/src/fsfw/devicehandlers/DeviceHandlerBase.cpp +++ b/src/fsfw/devicehandlers/DeviceHandlerBase.cpp @@ -458,7 +458,7 @@ ReturnValue_t DeviceHandlerBase::insertInCommandMap(DeviceCommandId_t deviceComm info.expectedReplies = 0; info.isExecuting = false; info.sendReplyTo = NO_COMMANDER; - info.useAlternativeReplyId = alternativeReplyId; + info.useAlternativeReplyId = useAlternativeReply; info.alternativeReplyId = alternativeReplyId; auto resultPair = deviceCommandMap.emplace(deviceCommand, info); if (resultPair.second) {