PHASMA: keeping XTCE packet layouts aligned with C++ serializers

Hi all,

I’ve been spending some time looking through the PHASMA repositories, especially at the boundary between the flight-side telemetry implementation and the XTCE mission database used on the ground.

One commit in particular caught my attention: 93774279, Reorder telemetry aggregates to match C++ serializers.

If I understood the change correctly, during the WOD telemetry work some previously flat XTCE parameters were grouped into aggregates, but the resulting field order no longer matched the order used by the C++ serializers.

The subsys_status_t case makes this very easy to see.

The XTCE aggregate had temporarily become roughly:

EPS_state
ADCS_state
GNSS_state
CLK_TREE_state
GNSS_ETH_state
Payload_state

EPS_error_code
ADCS_error_code
GNSS_error_code
CLK_TREE_error_code
GNSS_ETH_error_code
Payload_error_code

while the flight serializer emits:

EPS_state
EPS_error_code
ADCS_state
ADCS_error_code
GNSS_state
GNSS_error_code
...

So all the individual fields and semantics were still there, but the wire ordering was no longer the same.

The fixing commit restores the XTCE order to match the serializer and also corrects the adcs_cubecomputer_tlm_t aggregate.

I found this a really interesting case because it shows how a mismatch can hide between two otherwise perfectly reasonable representations of the same telemetry, and only become visible once the actual byte layout is exercised.

That made me curious about the current workflow around this boundary.

If one side changed again today, is there now some check in the PHASMA / SatNOGS-COMMS flow that would catch this directly? For example, serializing known packets and checking them against the XTCE/Yamcs interpretation, using golden packet vectors, or comparing the layout mechanically?

Or is the alignment mainly maintained by changing the C++ and XTCE definitions together and relying on the end-to-end integration tests to catch mismatches?

I’m mostly curious about how this is handled in practice today, especially after seeing this concrete case in the repository history.

I may also be misunderstanding part of the intended ownership between the serializer and XTCE, so corrections are very welcome.

References:

Commit 5ed760a, Add WOD telemetry capabilities:

Commit 93774279, Reorder telemetry aggregates to match C++ serializers:

1 Like