Compile time const event definitions and compile error for unique IDs above limit #53
Loading…
x
Reference in New Issue
Block a user
No description provided.
Delete Branch "baumgartl/events"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
See attached, a nice screenshot of what can happen if you don't limit the unique id to 100 entries (
PCDU ID = 193 ; Syrlinks ID = 194
. Given that i started the syrlinks unique IDs at 2).I.e: given any two adjacent subsystem IDs, if the lower one chooses to select a unique ID above 99, it may (based on the selected severity) bleed into the next subsystem IDs namespace.
To at least warn the user of this happening, i've templated the
makeEvent
function to be truly compile time const, to then be able tostatic_assert
the unique ID.Please Note, that the generators must also be updated for the export to function properly. See this PR fsfw/fsfwgen#4 for the required adjustment.
I've kept the generator changes minimal and backwards compatible.
This fix as well as backwards compatibility has been tested on
https://git.ksat-stuttgart.de/source/source-obdh_obsw/sourceobsw/-/merge_requests/220
and
https://git.ksat-stuttgart.de/source/source-obdh_obsw/sourceobsw/-/merge_requests/181