Skip to content

Add support for CCSDS TC/TM and SpacePacket protocols #3684

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 108 commits into from
Jun 11, 2025

Conversation

thomas-bc
Copy link
Collaborator

Related Issue(s) #3443
Has Unit Tests (y/n) yes
Documentation Included (y/n) yes

Change Description

Fix #3443 #3491 #3492

Add Framers and Deframers (and helpers) to support encapsulating F´ data in CCSDS Space Packets + TC and TM frames.

Each protocol is supported as described by the component SDD.

Rationale

A long standing request by the community.
#1397 #2507 #3026

Future Work

TBD

@thomas-bc thomas-bc requested review from LeStarch and Copilot June 7, 2025 01:35
Copilot

This comment was marked as resolved.

LeStarch
LeStarch previously approved these changes Jun 11, 2025
Copy link
Collaborator

@LeStarch LeStarch left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing some annotations, but otherwise looks good!

@LeStarch LeStarch merged commit 728a022 into nasa:devel Jun 11, 2025
68 of 69 checks passed
@thomas-bc thomas-bc deleted the ccsds-protocols branch June 11, 2025 18:04
packetSequenceControl |= sequenceCount & SpacePacketSubfields::SeqCountMask; // 14 bit sequence count

FW_ASSERT(data.getSize() <= std::numeric_limits<U16>::max(), static_cast<FwAssertArgType>(data.getSize()));
U16 packetDataLength = static_cast<U16>(data.getSize() - 1); // Standard specifies length is number of bytes minus 1
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Won't this do the wrong thing if data.getSize() == 0?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@celskeggs the standard doesn't allow for 0 size packets (https://ccsds.org/Pubs/133x0b2e2.pdf paragraph 4.1.2.1)

We are definitely missing an assert on that - good catch, thanks!


It receives payload data (such as a Space Packet or a VCA_SDU) on input and produces a TC frame on its output port as a result. Please refer to the CCSDS [TC specification (CCSDS 232.0-B-4)](https://ccsds.org/Pubs/232x0b4e1c1.pdf) for details on the frame format and protocol.

The `Svc::CCSDS::TcDeframer` is designed to work in the common F Prime telemetry stack, receiving data from an upstream [`Svc::ComQueue`](../../../ComQueue/docs/sdd.md) and passing frames to a [Communications Adapter](../../../Interfaces/docs/sdd.md), such as a Radio manager component or [`Svc::ComStub`](../../../ComStub/docs/sdd.md), for transmission on the wire. It is commonly coupled with the [`Svc::CCSDS::SpacePacketFramer`](../../SpacePacketFramer/docs/sdd.md) to wrap CCSDS Space Packets into TM frames.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seems to describe the TmFramer, not the TcDeframer.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Correct, thanks. I'll make a follow-up PR

thomas-bc added a commit that referenced this pull request Jun 12, 2025
* De-conflict Ref instance IDs

* Assert Space Packet data length at least 1

* Fix TcDeframer SDD
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Convert F Prime frames to use CCSDS
3 participants