Minimal ECSS Packet Utilisation Standard (PUS) implementation in C, designed for small-scale academic space missions.
Zero dynamic allocation, no global state, C99 with C++-compatible headers — and 100% line & branch test coverage.
Standards Compliance
ECSS-E-ST-70-41C: Packet Utilisation Standard (PUS)
Features
Implemented Services
Service
Name
Subtypes
ST[01]
Request Verification
Acceptance, Start, Completion (success & failure), Routing failure; Progress reports must be emitted manually by the handler
ST[03]
Housekeeping
TM[3,25] HK report, TM[3,26] diagnostic report
ST[05]
Event Reporting
Info, Low/Medium/High severity
ST[17]
Test
TC[17,1] are-you-alive, TC[17,3] on-board connection test
ST[20]
Parameter Management
TC[20,1] request report, TC[20,3] set values, TM[20,2] value report
Design Principles
Transport-agnostic — a pure PUS layer operating on the secondary header and application data; wrap its packets in a CCSDS Space Packet primary header or carry them in CCSDS SDLP TC/TM transfer frames
No heap — all memory is caller-supplied or statically declared
No global state — everything lives in a pus_context_t you own
Composable — each service has its own context struct; mix and match what you need
Portable C — no platform-specific dependencies
C99, C++-friendly — compiles as C99; every public header is wrapped in extern "C" for direct use from C++
make # build and run tests
make example # build and run the OBC example
make clean # remove build artifacts
Testing & Coverage
make compiles and runs the full unit-test suite under a strict warning set
(-Wall -Wextra -Wpedantic -Wconversion and more). Coverage is maintained at 100% of
lines and branches; regenerate the report with gcovr:
sudo apt install gcovr
make coverage-html
# Prints a console summary and writes an HTML report to build/coverage/index.html
No heap: zero dynamic allocation; all buffers are caller-supplied
Limitations
Single-threaded: pus_context_t is not thread-safe; protect with a mutex if used from multiple tasks
Fixed-capacity tables: handler slots and service contexts are bounded by PUS_MAX_TC_HANDLERS, PUS_SERVICE_3_MAX_STRUCTURES, PUS_SERVICE_20_MAX_PARAMS (all overridable at compile time via -D)
References
ECSS-E-ST-70-41C — Telemetry and Telecommand Packet Utilization, European Cooperation for Space Standardization (local copy)
License
Licensed under the Apache License 2.0. See LICENSE.
关于
EmbeddedPUS:极简嵌入式 CCSDS/ECSS 协议 C 实现(OpenSpaceCode 系列组件)。镜像收录自 https://github.com/OpenSpaceCode/EmbeddedPUS,License:Apache-2.0
EmbeddedPUS
Minimal ECSS Packet Utilisation Standard (PUS) implementation in C, designed for small-scale academic space missions.
Zero dynamic allocation, no global state, C99 with C++-compatible headers — and 100% line & branch test coverage.
Standards Compliance
Features
Implemented Services
Design Principles
pus_context_tyou ownextern "C"for direct use from C++Project Structure
Building
Testing & Coverage
makecompiles and runs the full unit-test suite under a strict warning set (-Wall -Wextra -Wpedantic -Wconversionand more). Coverage is maintained at 100% of lines and branches; regenerate the report withgcovr:Quick Start
See example/obc_example.c for a more complete scenario covering all five services.
Memory
.textfor all services (x86-64-O2, unstripped; varies by target and flags)sizeof(pus_context_t)— handler table + countersLimitations
pus_context_tis not thread-safe; protect with a mutex if used from multiple tasksPUS_MAX_TC_HANDLERS,PUS_SERVICE_3_MAX_STRUCTURES,PUS_SERVICE_20_MAX_PARAMS(all overridable at compile time via-D)References
License
Licensed under the Apache License 2.0. See LICENSE.