Skip to content

A C++ implementation of the ECSS Packet Utilization Standard to be used aboard the AcubeSAT nanosatellite

License

Notifications You must be signed in to change notification settings

AcubeSAT/ecss-services

Repository files navigation

ECSS-E-ST-70-41C Services

In this repository you can find the implementation of the ECSS services, based on the ECSS-E-ST-70-41C standard.

Documentation

You can read the complete documentation of this project at https://acubesat.gitlab.io/obc/ecss-services/docs/. This includes installation instructions, a usage guide, and detailed descriptions of all public functions and definitions.

Directories

  • ci: GitLab CI configuration files
  • docs: Source code usage and development documentation
  • inc: All headers and libraries used in the code
  • lib: External libraries used in the code
  • src: All source files are included here
  • test: Unit test implementation

Implementation status

Service Type Service Name Implementation
ST[01] Request Verification Full
ST[03] Housekeeping Partial
ST[04] Parameter Statistics Reporting Partial
ST[05] Event Reporting Partial
ST[06] Memory Management Partial
ST[08] Function Management Full
ST[11] Time-based Scheduling Partial
ST[12] On-board Monitoring Work in progress
ST[13] Large Packer Transfer Partial
ST[15] On-board Storage and Retrieval Work in progress
ST[17] Test Partial
ST[19] Event-action Partial
ST[20] Parameter Management Partial
ST[23] File Management Work in progress

Build

The ecss-services repository can be built and tested without any access to specialised hardware. We provide build instructions for Linux (or WSL) command-line, and the CLion IDE.

The dependencies of this repository are managed through the conan package manager, with repositories from ConanCenter and SpaceDot's packages.

For more detailed installation instructions, including how to integrate with a microcontroller, visit the corresponding documentation page.

From the Command Line (CLI)

  1. Install a modern C++ compiler, CMake, and Conan.
    CMake >= 3.23 and Conan >= 2.0 are recommended.

    Getting conan

    You can install conan following the instructions from here.

  2. Clone the repository and enter the directory:

    git clone https://gitlab.com/acubesat/obc/ecss-services.git
    cd ecss-services
  3. (If you haven't already) create a conan profile for your system:

    conan profile detect
  4. (If you haven't already) add the SpaceDot repository to conan:

    conan remote add spacedot https://artifactory.spacedot.gr/artifactory/api/conan/conan
  5. Download all dependencies and build the project through conan:

    conan build . --output-folder=build --build=missing --update --settings=build_type=Debug
  6. Run the tests or the produced executable:

    build/Debug/tests
    build/Debug/x86_services

From CLion

CLion will automatically try to set up a CMake project for you. However, without the conan packages installed, this will quickly fail. Follow these steps to set up the conan project:

  1. Follow steps 1-4 from the CLI instructions above.
  2. Run the following command to install relevant packages and create the CMakePreset.json files
conan install . --output-folder=cmake-build-debug -u --build="*" -pr conan-profile --settings=build_type=Debug
  1. Add the following to the CMake Options (File -> Settings -> Build, Execution, Deployment -> CMake -> CMake Options):
    --preset=cmake-build-debug-debug
  2. If your CMake project doesn't reload automatically, reload it manually (Tools -> CMake -> Reload CMake Project).

We do not recommend using a Conan plugin for your IDE, as it may tamper with the default configuration for this repository.

Static Analysis

Before pushing online, you can run the static analysis tools locally to avoid waiting for the CI jobs to finish. You can do so by running .ci/clang-tidy.sh and .ci/cppcheck.sh from the root of the repository. This will create two output files, clang-tidy-output.log and report.xml, which you can inspect to see the results. You have to search for errors in clang-tidy-output.log, as it includes warnings and notes. The report.xml is a cppcheck report, which you can convert to HTML with cppcheck-htmlreport, or open locally. Any item in that file will cause failure of the pipeline.

Tests

Before pushing online, you can run the tests locally to avoid waiting for the CI jobs to finish. You can do this by running:

./ci/cppcheck.sh

clang-tidy

Make sure clang-tidy is installed. It can be installed with the following command:

sudo apt-get install clang-tidy

For clang-tidy to run according to the set configuration in ci/.clang-tidy, follow these steps if you use CLion:

  1. Add -DCMAKE_EXPORT_COMPILE_COMMANDS=ON in CLion -> File -> Settings -> Build, Execution, Deployment -> CMake -> CMake Options. In case you use CLI, add it as argument to the cmake command.
  2. Reload the CMake project in CLion (Tools -> CMake -> Reload CMake Project), or run the cmake command again in the CLI, with all the needed arguments.
  3. Run the following command from the root of the repository:
./ci/clang-tidy.sh <build-directory>

where the <build-directory> is the directory where the compile_commands.json file is located. This is usually the cmake-build-debug directory if CLion is used, or the build directory if the CLI is used.

Finally, check the output files for errors. The clang-tidy-output.log file will contain all the warnings, notes and errors. Any error in that file will cause failure of the pipeline.