Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
199 commits
Select commit Hold shift + click to select a range
e7d9b28
Added CfdpManager skeleton
Brian-Campuzano Dec 12, 2025
a8d20de
Copy PDU packet layer as-is
Brian-Campuzano Dec 12, 2025
676c595
Bring in other header dependencies
Brian-Campuzano Dec 15, 2025
7b7b248
Updates to get the packet layer to compile
Brian-Campuzano Dec 16, 2025
a8417b3
Bring in CFDP engine files
Brian-Campuzano Dec 16, 2025
44d0660
Bring in addititional CF depedencies and refactor CF asserts into FW_…
Brian-Campuzano Dec 16, 2025
a81d937
c -> c++ updates
Brian-Campuzano Dec 16, 2025
2194258
c to c++ conversion checkpoint
Brian-Campuzano Dec 17, 2025
89fcab3
Os directory checkpoint
Brian-Campuzano Dec 17, 2025
ffaccb8
Add custom timer soloution to replace CFE timer implementation
Brian-Campuzano Dec 18, 2025
e5542e5
Os File stub completion
Brian-Campuzano Dec 18, 2025
cec7325
Update CRC
Brian-Campuzano Dec 18, 2025
1111a33
Added buffer management and removed pipes/semaphores
Brian-Campuzano Dec 19, 2025
8364b49
Beggining of buffer refactor
Brian-Campuzano Dec 19, 2025
fa2548c
Buffer management checkpoint
Brian-Campuzano Dec 19, 2025
4ef83b9
Brought in cf_utils for list traversals
Brian-Campuzano Dec 19, 2025
36423d7
Convert CfdpEngine into a class
Brian-Campuzano Dec 22, 2025
5afba79
Revert "Convert CfdpEngine into a class"
Brian-Campuzano Dec 22, 2025
d733f34
Additional CFE OS stubs
Brian-Campuzano Dec 22, 2025
e5ac3b4
Fixed container pointer arithmatic for C++
Brian-Campuzano Dec 23, 2025
1cbf9e5
Completed refactor of cf_utils
Brian-Campuzano Dec 23, 2025
68ed031
Beginning of adding parameters
Brian-Campuzano Dec 23, 2025
07a2bee
Refactor CF_CFDP_S_CheckAndRespondNak to separate out error logic and…
Brian-Campuzano Dec 26, 2025
eb29119
CFDP send checkpoint
Brian-Campuzano Dec 26, 2025
385f5e7
Completed CFDP send updates
Brian-Campuzano Dec 26, 2025
b2e2b44
Completed CFDP receive refactor
Brian-Campuzano Dec 29, 2025
2886c73
CFDP refactor checkpoint
Brian-Campuzano Dec 30, 2025
85976a8
Playback directory checkpoint
Brian-Campuzano Dec 30, 2025
64ddc57
CfdpManager compiles!
Brian-Campuzano Dec 31, 2025
d1d6ee0
Added PDU receive data paths/hooks
Brian-Campuzano Jan 2, 2026
8bc9f66
CF -> CFDP file rename
Brian-Campuzano Jan 2, 2026
e29f932
CF -> CFDP file rename complete
Brian-Campuzano Jan 2, 2026
b7c88d6
Remove header comments
Brian-Campuzano Jan 2, 2026
e3300df
Refactor CFDP variable size types
Brian-Campuzano Jan 5, 2026
db525b2
Refactor default_cf_extern_typedefs.hpp into CfdpTypes.fpp and CfdpTy…
Brian-Campuzano Jan 5, 2026
4666674
Refactor default_cf_interface_cfg.hpp to CfdpCfg.hpp
Brian-Campuzano Jan 5, 2026
28e6dba
Revert history init
Brian-Campuzano Jan 5, 2026
04a7dd4
Move CFDP types and configs
Brian-Campuzano Jan 5, 2026
9d2d037
UT skeleton
Brian-Campuzano Jan 5, 2026
0dc4928
Split parameters to separate include file
Brian-Campuzano Jan 5, 2026
e41c94a
Implemented the SendFile command
Brian-Campuzano Jan 6, 2026
f029f40
Added CFDP playback directory command
Brian-Campuzano Jan 6, 2026
1113fe2
Added freeze/thaw command
Brian-Campuzano Jan 6, 2026
f46f354
Add buffer return for failure to send case
Brian-Campuzano Jan 6, 2026
0401851
Added polling directory commands
Brian-Campuzano Jan 6, 2026
9939696
Fixed comment offsets
Brian-Campuzano Jan 6, 2026
50aee70
Converted CF_WrappedOpenCreate calls to Os::File::open
Brian-Campuzano Jan 6, 2026
ccaf0df
Convert CF_WrappedWrite to Os::File::write
Brian-Campuzano Jan 6, 2026
0313fdf
Replaced CF_WrappedRead with Os::File::Read
Brian-Campuzano Jan 6, 2026
8f2611a
Replaced CF_WrappedClose with Os::File::close
Brian-Campuzano Jan 6, 2026
35001e0
Replaced OS_ObjectIdDefined with Os::File::isOpen
Brian-Campuzano Jan 6, 2026
cb306e0
Replaced CF_WrappedLseek with Os::File::seek
Brian-Campuzano Jan 7, 2026
ff0e9f9
Refactor CF_CFDP_MoveFile to Os::FileSystem::moveFile + string refact…
Brian-Campuzano Jan 7, 2026
7000c06
Refactored OS_remove to Os::FileSystem::removeFile
Brian-Campuzano Jan 7, 2026
ec92b85
Refactored OS_mv to Os::FileSystem::moveFile
Brian-Campuzano Jan 7, 2026
39c9da6
Replaced OS_DirectoryOpen with Os::Directory::open
Brian-Campuzano Jan 7, 2026
fb11e82
Replaced OS_DirectoryRead with Os::Directory::read
Brian-Campuzano Jan 7, 2026
37bf9f3
Replaced OS_DirectoryClose with Os::Directory::close
Brian-Campuzano Jan 7, 2026
544fdd8
Deleted CfeStubs
Brian-Campuzano Jan 8, 2026
5e66eae
Remove CfeStubs.hpp includes and add CfdpMaxPduSize constants
Brian-Campuzano Jan 15, 2026
66b4941
Data pointer refactor to remove void*
Brian-Campuzano Jan 16, 2026
8281ba0
Rework receive init to use Fw::String
Brian-Campuzano Jan 16, 2026
bd518d4
Fix compilation errors
Brian-Campuzano Jan 16, 2026
53f26ef
Made include paths absolute and moved file size type def to config
Brian-Campuzano Jan 21, 2026
d20d9f7
Added separate metadata serailizable
Brian-Campuzano Jan 21, 2026
77eea4c
Rework enums that did not need to serializables
Brian-Campuzano Jan 22, 2026
7a92fff
Completed metadata UT
Brian-Campuzano Jan 22, 2026
7d8408c
Split PDUs to separate whitespace
Brian-Campuzano Jan 22, 2026
3299e7d
Added FileData PDU and UTs
Brian-Campuzano Jan 22, 2026
339cf30
Added file data PDU test
Brian-Campuzano Jan 22, 2026
d46fd86
Added end-of-file PDU and UTs
Brian-Campuzano Jan 22, 2026
830f7f8
Added missing file
Brian-Campuzano Jan 22, 2026
b838dce
Added end of file PDU UT to CfdpManager
Brian-Campuzano Jan 22, 2026
576e7d1
Refactor UTs to separate out validation functions
Brian-Campuzano Jan 22, 2026
c5af8a6
Implemented FinPdu class and UTs
Brian-Campuzano Jan 22, 2026
257d3e0
Added CfdpManager FinPdu UT
Brian-Campuzano Jan 22, 2026
1d995a6
Added AckPdu implementation and UTs
Brian-Campuzano Jan 22, 2026
261a0fa
Added AckPdu UT for CfdpManager
Brian-Campuzano Jan 22, 2026
b8e8036
Added missing CRC check
Brian-Campuzano Jan 22, 2026
1b7805c
Added NakPdu implementaiton and UTs
Brian-Campuzano Jan 22, 2026
6a501bd
Added CfdpManager NackPdu UT
Brian-Campuzano Jan 22, 2026
6b85467
Refactor PDU tests to a new file
Brian-Campuzano Jan 22, 2026
fb0ceb8
Refactored test helpers to deserialize and validate PDUs
Brian-Campuzano Jan 22, 2026
2ae9028
Added class 1 TX transaction text
Brian-Campuzano Jan 23, 2026
1753f20
Added output PDU throttling
Brian-Campuzano Jan 23, 2026
0fbfd4c
Started a class 2 TX UT and added helper functions for uplinking PDUs
Brian-Campuzano Jan 23, 2026
b2ac193
Code cleanup
Brian-Campuzano Jan 23, 2026
2552beb
Debugging failed chunk allocation for class 2 transactions
Brian-Campuzano Jan 26, 2026
5dd5661
Updated class 1 transaction UT to expire the inactivity timer. Also s…
Brian-Campuzano Jan 26, 2026
db2f95a
Updated class 2 TX UT to have correct PDU ordering
Brian-Campuzano Jan 26, 2026
5254ed5
Added CFDP subtopology
Brian-Campuzano Jan 26, 2026
816055e
Completed TX class 2 transaction UT
Brian-Campuzano Jan 26, 2026
3fada10
Added class 2 transaction UT with a nack
Brian-Campuzano Jan 26, 2026
2a7b922
Refactor UTs to make them more readable
Brian-Campuzano Jan 26, 2026
838fe1d
Added a class 1 RX unit test
Brian-Campuzano Jan 26, 2026
9c9cd65
Added class 2 RX transaction UT
Brian-Campuzano Jan 27, 2026
97d5150
Add RX transaction UT with NAck
Brian-Campuzano Jan 27, 2026
0a4ba78
Refactored CfdpEngine into child-class of CfdpManager
Brian-Campuzano Jan 27, 2026
d81d623
Created CfdpChannel class
Brian-Campuzano Jan 28, 2026
17f90a9
Refactor CfdpEngineData to be CfdpEngine member variables
Brian-Campuzano Jan 28, 2026
0d55888
Moved CF_Channel_t data into CfdpChannel member variables. There is s…
Brian-Campuzano Jan 28, 2026
eed08fd
Fixed testMetaDataPdu UT
Brian-Campuzano Jan 28, 2026
8f144e2
Updated remaining PDU tests
Brian-Campuzano Jan 28, 2026
64e5f36
Removed lingering CF_Channel_t references and functions
Brian-Campuzano Jan 28, 2026
bab01f1
Created new CfdpTransaction class and skeletons
Brian-Campuzano Jan 28, 2026
668895e
Ported TX functions to new class
Brian-Campuzano Jan 29, 2026
4db19fb
Ported RX functions to new Transaciton class
Brian-Campuzano Jan 29, 2026
9a7465e
Additional transaction class rework
Brian-Campuzano Jan 29, 2026
054ab76
Refactor CfdpTransaction as stepping stone toward struct removal
Brian-Campuzano Jan 29, 2026
08769de
Moved CF dispatch functions into the CfdpTransaction class
Brian-Campuzano Jan 29, 2026
202b24b
Completed CfdpTransaction refactor
Brian-Campuzano Jan 29, 2026
aedd4cb
Rework memory initialization for better encapsulation
Brian-Campuzano Jan 29, 2026
2abe732
Friend class cleanup
Brian-Campuzano Jan 29, 2026
0db83af
Refactored CfdpChunk into a C++ class
Brian-Campuzano Jan 29, 2026
b6ddf58
Additional C++ refactor cleanup
Brian-Campuzano Jan 29, 2026
3cd0d9c
Moved CFDP types and renames Pdu folder to Types folder
Brian-Campuzano Jan 29, 2026
75a6688
Removed internal buffer test pool
Brian-Campuzano Jan 30, 2026
f82d309
Refactored Tx functions to use Pdu classes instead of the CF codec fu…
Brian-Campuzano Jan 30, 2026
93ea44d
Refactored Rx functions to use Pdu classes
Brian-Campuzano Jan 30, 2026
ecaddce
Completed deprecated codec removal and fixed UTs
Brian-Campuzano Jan 30, 2026
c954822
Added TLV support and refactor cleanup
Brian-Campuzano Jan 30, 2026
6e2b510
Added CF attribution file
Brian-Campuzano Jan 30, 2026
c921ebe
Removed PDU union wrapper in-favor of PDU class inheritance. Updated …
Brian-Campuzano Feb 3, 2026
2b0cb92
Cleanup post class refactor
Brian-Campuzano Feb 3, 2026
53c5eff
Code cleanup and file size type updates
Brian-Campuzano Feb 5, 2026
8eecaa1
Start of CF -> CFDP rename/refactor
Brian-Campuzano Feb 5, 2026
bf0133f
Remove last vestigages of CF types
Brian-Campuzano Feb 5, 2026
5507a57
Updated UTs post CF -> CFDP rename
Brian-Campuzano Feb 5, 2026
15929e9
Start of CFDP class addition, starting removal of deprecated CF types
Brian-Campuzano Feb 9, 2026
95971ad
Completed Cfdp namespace addition
Brian-Campuzano Feb 9, 2026
a450176
Consolidate Cfdp types to a single file
Brian-Campuzano Feb 9, 2026
59d6193
Renamed transaction files so they will sort correctly
Brian-Campuzano Feb 9, 2026
113aa04
Cleanup some todos and make comment style consistent
Brian-Campuzano Feb 9, 2026
3e34927
Added CFDP overview SDD section
Brian-Campuzano Feb 9, 2026
68c551c
Added port based file transfer requests similar to FileDownlink
Brian-Campuzano Feb 9, 2026
8c1ef2f
Added Tx port based file transfer UT
Brian-Campuzano Feb 9, 2026
c8b8737
Added additional UTs
Brian-Campuzano Feb 9, 2026
222d71a
Added ping port and fixed issues from fprime sync
Brian-Campuzano Feb 9, 2026
f11f36a
Added CfdpManager class diagram
Brian-Campuzano Feb 9, 2026
b9989f1
Fixed component class diagram
Brian-Campuzano Feb 9, 2026
86116d8
Reworked class diagram
Brian-Campuzano Feb 9, 2026
80ff04b
Added CfdpManager usage diagram and updated port naming to be consistent
Brian-Campuzano Feb 9, 2026
f809fcb
Playing with color themes
Brian-Campuzano Feb 9, 2026
6bd7920
Another theme iteration
Brian-Campuzano Feb 10, 2026
4ad0650
Added component design section
Brian-Campuzano Feb 10, 2026
0466a3c
Added TX transaction sequence diagrams
Brian-Campuzano Feb 10, 2026
b9f4d98
Added class 2 RX sequence diagram
Brian-Campuzano Feb 10, 2026
7b48ee8
Fixed bug in file deletion
Brian-Campuzano Feb 10, 2026
a311693
Added command and telemetry section
Brian-Campuzano Feb 10, 2026
bcbdd0c
Added proposed telemetry
Brian-Campuzano Feb 10, 2026
dbe7065
Populated requirements section
Brian-Campuzano Feb 10, 2026
c360794
SDD rework and added section numbers
Brian-Campuzano Feb 10, 2026
7eb48ee
Add configuration section to the SDD and took a pass at cleaning up t…
Brian-Campuzano Feb 10, 2026
2a9af07
First pass a getting the spell check to pass
Brian-Campuzano Feb 10, 2026
ba3a789
Another spelling iteration. EVS will be removed with F' events are im…
Brian-Campuzano Feb 10, 2026
130d4ae
Replace commented out cFE Events with F' Events
pepepr08 Feb 13, 2026
e40839f
Directly use Cfdp.Class for events
pepepr08 Feb 16, 2026
885487d
Remove recvAck()
pepepr08 Feb 17, 2026
e1c3dd1
Added TX/RX throttling SDD section and made class, keep, and priority…
Brian-Campuzano Feb 12, 2026
b39a8c8
Updated class 2 sequence diagrams to make timer values explicit. Also…
Brian-Campuzano Feb 19, 2026
6b42e1a
Added transaction management commands
Brian-Campuzano Feb 19, 2026
9f5c2d3
Move tmp_dir and fail_dir from global parameters to per-channel param…
Brian-Campuzano Feb 12, 2026
feb79d2
Purge the terms configuration table and wakeup which were CF terminology
Brian-Campuzano Feb 12, 2026
8db30ec
Added Deep Space Timer Configuration section to account for light spe…
Brian-Campuzano Feb 12, 2026
9c76d92
Added documentation on NAK behavior during file data transmission
Brian-Campuzano Feb 12, 2026
06f2229
Remove AI slop
Brian-Campuzano Feb 12, 2026
a4181ea
Rewording to make spell checker happy
Brian-Campuzano Feb 19, 2026
ce5d0e4
Swap SUSPEND and RESUME enum
pepepr08 Mar 26, 2026
790dd02
Clarify success criteria doesn't care about current state
pepepr08 Mar 26, 2026
5eb4087
Update transaction canceled comment
pepepr08 Mar 26, 2026
905429e
Implement CfdpManager telemetry
pepepr08 Feb 26, 2026
440b315
Send events when transaction completes successfully
pepepr08 Mar 5, 2026
49bc976
Add size to TxFileTransferStarted event
pepepr08 Mar 6, 2026
f0e620d
Update cached_pos right after successful file read
pepepr08 Mar 6, 2026
77870ad
Rename channel current transaction variable
pepepr08 Mar 12, 2026
7693fb3
Fix issue when reaching max_outgoing_pdus_per_cycle
pepepr08 Mar 12, 2026
c7ae709
Strip packet type descriptor before reading PDU
pepepr08 Apr 1, 2026
974cde6
Reset timer during CRC calculation period
pepepr08 Apr 6, 2026
24f214f
Connect CfdpManager directly to ComQueue
pepepr08 Apr 10, 2026
d4050db
Update defaults to speed up transactions
pepepr08 Apr 30, 2026
b40fde9
Add README to clarify the CFDP/Checksum usage
pepepr08 May 1, 2026
1c8fb28
Updating Documentation (port type)
pepepr08 May 1, 2026
97dc5c8
Spelling check update
pepepr08 May 1, 2026
a5a4b77
Increase PDU buffer size to include Descriptor
pepepr08 May 4, 2026
310525f
Add helper function for sending PDUs
pepepr08 May 4, 2026
e397fef
Move PDU Type Enum to FPP
pepepr08 May 5, 2026
8a72a58
Assert to nullptr instead of just NULL
pepepr08 May 8, 2026
82515ba
phase 1 of implementing "per packet" enable+rate+etc control "knobs" …
stevencarpenter102 Aug 12, 2026
3d41df1
Make the cmake dictionary flow track inputs and outputs
Willmac16 Aug 6, 2026
3509b8e
Metadata clear our root dir (avoid ninja nothing to do spam)
Willmac16 Aug 7, 2026
ff83a11
touch dict after install (cmake natively writes whole seconds to modi…
Willmac16 Aug 7, 2026
f3be4d3
phase 2 complete - introduced per-packet tlmpacktizer config overrides
stevencarpenter102 Aug 17, 2026
9ad6b8e
merge origin/monarch attempt! this was quite messy, lol
stevencarpenter102 Aug 19, 2026
43b8057
revert mistaken from previous commit's merge attempt
stevencarpenter102 Aug 19, 2026
346181b
last touches from last commit's attempt to fix
stevencarpenter102 Aug 19, 2026
18d87a1
she builds now! before after origin/dev merge in monarch...this would…
stevencarpenter102 Aug 24, 2026
5212390
merge in latest origin/monarch
stevencarpenter102 Aug 24, 2026
8a87c59
switched direction of TlmPacketizer's port (now it's an output, was a…
stevencarpenter102 Aug 25, 2026
b9d5b82
introducing the configIn port in order to get persisted packet overri…
stevencarpenter102 Aug 25, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 23 additions & 0 deletions Svc/Ports/TlmPacketizerPorts/TlmPacketizerPorts.fpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,27 @@ module Svc {
minDelta: U32 @< Minimum Sched Ticks to send packets on updates when using ON_CHANGE logic
maxDelta: U32 @< Maximum Sched Ticks between packets to send when using EVERY_MAX logic
)

@ Maximum number of per-packet config entries carried in a single push batch.
@ Sized so one fully-serialized batch stays well within FW_COM_BUFFER_MAX_SIZE.
constant TLM_PACKET_CONFIG_BATCH_MAX = 32

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

note this "batched config write" feature is required b/c of the FW_COM_BUFFER_MAX_SIZE (~2k) limitation means we can only send out the configOut port so many per-packet override configs serialized at a time...

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This should be moved to TlmPackizerCfg.fpp


@ A single per-packet configuration record: which packet, which section, and its policy.
@ packetId matches the packet id used by the TlmPacketizer SEND_PKT command.
struct PacketConfigEntry {
packetId: U32 @< Packet identifier
section: TelemetrySection @< Section the policy applies to
config: PacketConfig @< Enable + rate policy for this packet/section
}

@ A fixed-capacity batch of per-packet config entries. Only the first `count` are valid.
array PacketConfigBatch = [TLM_PACKET_CONFIG_BATCH_MAX] PacketConfigEntry

@ Port pushing a batch of per-packet configuration from the config persistent-memory owner
@ to the packetizer (TlmPacketizer). Batching bounds the number of async messages required
@ to synchronize many packets (e.g. the full push at boot).
port TlmPacketConfigUpdate(
count: FwSizeType @< Number of valid entries in `batch`, in [0, TLM_PACKET_CONFIG_BATCH_MAX]
batch: PacketConfigBatch @< Batch of config entries; entries [0, count) are valid
)
}
2 changes: 2 additions & 0 deletions Svc/TlmPacketizer/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ register_fprime_module(
"${CMAKE_CURRENT_LIST_DIR}/TlmPacketizer.cpp"
DEPENDS
Svc_TlmPacketizer_config_TlmPacketizerConfig
Svc_Ports_TlmPacketizerPorts
Svc_Types_TlmPacketizerTypes
)


Expand Down
177 changes: 175 additions & 2 deletions Svc/TlmPacketizer/TlmPacketizer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -305,8 +305,8 @@ void TlmPacketizer ::Run_handler(const FwIndexType portNum, U32 context) {

for (FwIndexType section = 0; section < TelemetrySection::NUM_SECTIONS; section++) {
PktSendCounters& pktEntryFlags = this->m_packetFlags[static_cast<FwSizeType>(section)][pkt];
TlmPacketizer_GroupConfig& entryGroupConfig =
this->m_groupConfigs[static_cast<FwSizeType>(section)][entryGroup];
// Per-packet override if one is set (via ENABLE/FORCE/CONFIGURE_PACKET*), else the group-derived policy.
const Svc::PacketConfig entryGroupConfig = this->effectiveConfig(section, pkt, entryGroup);

// Packet is updated and not REQUESTED (Keep REQUESTED marking to bypass disable checks)
if (isNewData && pktEntryFlags.updateFlag != UpdateFlag::REQUESTED) {
Expand Down Expand Up @@ -535,6 +535,85 @@ void TlmPacketizer ::CONFIGURE_GROUP_RATES_cmdHandler(FwOpcodeType opCode,
this->cmdResponse_out(opCode, cmdSeq, Fw::CmdResponse::OK);
}

void TlmPacketizer ::GET_PACKET_CONFIG_cmdHandler(FwOpcodeType opCode,
U32 cmdSeq,
U32 packetId,
const Svc::TelemetrySection& section) {
FW_ASSERT(section.isValid());
if (section < 0 or section >= TelemetrySection::NUM_SECTIONS) {
this->cmdResponse_out(opCode, cmdSeq, Fw::CmdResponse::VALIDATION_ERROR);
return;
}
FwChanIdType pkt = 0;
if (not this->findPacketIndexById(packetId, pkt)) {
this->log_WARNING_LO_UnknownPacketId(packetId);
this->cmdResponse_out(opCode, cmdSeq, Fw::CmdResponse::VALIDATION_ERROR);
return;
}
const Svc::PacketConfig eff =
this->effectiveConfig(static_cast<FwIndexType>(section.e), pkt, this->m_fillBuffers[pkt].level);
Svc::PacketConfigEntry entry;
entry.set_packetId(packetId);
entry.set_section(section.e);
entry.set_config(eff);
this->tlmWrite_QueriedPacketConfig(entry);

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Nit: might need a note:
Should anything be dependent on looking at the telemetry value after sending this command (e.g. FDIR), the tlmpacketizer's own telemetry must be outputting at an ON_CHANGE config, and the dependency must be SLOWER than the rategroup of the TlmPacketizer

this->cmdResponse_out(opCode, cmdSeq, Fw::CmdResponse::OK);
}

void TlmPacketizer ::ENABLE_PACKET_cmdHandler(FwOpcodeType opCode,
U32 cmdSeq,
U32 packetId,
const Svc::TelemetrySection& section,
const Fw::Enabled& enable) {
FwSizeType s = 0;
FwChanIdType pkt = 0;
// Validate on ground data (no assert): bad enable / section / unknown id -> VALIDATION_ERROR.
if (not enable.isValid() or not this->resolveAndSeedOverride(section, packetId, s, pkt)) {
this->cmdResponse_out(opCode, cmdSeq, Fw::CmdResponse::VALIDATION_ERROR);
return;
}
this->m_packetOverride[s][pkt].set_enabled(enable);
this->mirrorOverride(section, pkt, packetId);
this->cmdResponse_out(opCode, cmdSeq, Fw::CmdResponse::OK);
}

void TlmPacketizer ::FORCE_PACKET_cmdHandler(FwOpcodeType opCode,
U32 cmdSeq,
U32 packetId,
const Svc::TelemetrySection& section,
const Fw::Enabled& enable) {
FwSizeType s = 0;
FwChanIdType pkt = 0;
if (not enable.isValid() or not this->resolveAndSeedOverride(section, packetId, s, pkt)) {
this->cmdResponse_out(opCode, cmdSeq, Fw::CmdResponse::VALIDATION_ERROR);
return;
}
this->m_packetOverride[s][pkt].set_forceEnabled(enable);
this->mirrorOverride(section, pkt, packetId);
this->cmdResponse_out(opCode, cmdSeq, Fw::CmdResponse::OK);
}

void TlmPacketizer ::CONFIGURE_PACKET_RATES_cmdHandler(FwOpcodeType opCode,
U32 cmdSeq,
U32 packetId,
const Svc::TelemetrySection& section,
const Svc::RateLogic& rateLogic,
U32 minDelta,
U32 maxDelta) {
FwSizeType s = 0;
FwChanIdType pkt = 0;
if (not rateLogic.isValid() or not this->resolveAndSeedOverride(section, packetId, s, pkt)) {
this->cmdResponse_out(opCode, cmdSeq, Fw::CmdResponse::VALIDATION_ERROR);
return;
}
Svc::PacketConfig& cfg = this->m_packetOverride[s][pkt];
cfg.set_rateLogic(rateLogic);
cfg.set_min(minDelta);
cfg.set_max(maxDelta);
this->mirrorOverride(section, pkt, packetId);
this->cmdResponse_out(opCode, cmdSeq, Fw::CmdResponse::OK);
}

void TlmPacketizer::configureSectionGroupRate(
const Svc::TelemetrySection& section, //!< Section grouping
FwChanIdType tlmGroup, //!< Group Identifier
Expand Down Expand Up @@ -567,6 +646,100 @@ FwIndexType TlmPacketizer::sectionGroupToPort(const FwIndexType section, const F
return outIndex;
}

Svc::PacketConfig TlmPacketizer::effectiveConfig(FwIndexType section, FwChanIdType pkt, FwChanIdType group) const {

@stevencarpenter102 stevencarpenter102 Aug 25, 2026

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

"effective" in the sense of prioritize the per-packet override...and if there's none -> then use the group config of which the packet is a part

const FwSizeType s = static_cast<FwSizeType>(section);
if (this->m_packetOverridden[s][pkt]) {
return this->m_packetOverride[s][pkt];
Comment on lines +651 to +652

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Once a packet has been overridden, how is it cleared? Do we need a new command?

}
// Not overridden: derive from the group policy for this packet's level (legacy behavior).
const TlmPacketizer_GroupConfig& gc = this->m_groupConfigs[s][group];
Svc::PacketConfig eff;
eff.set_enabled(gc.get_enabled());
eff.set_forceEnabled(gc.get_forceEnabled());
eff.set_rateLogic(gc.get_rateLogic());
eff.set_min(gc.get_min());
eff.set_max(gc.get_max());
return eff;
Comment on lines +654 to +662

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This and the return on 652 is building/copying a new PacketConfig and returning by value every evaluation cycle. Consider refactoring to return a reference a performance improvement.

}
Comment on lines +651 to +663

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This definitely needs to be documented in the SDD. Overwritten disabled packets have a higher "authority" than Forced Enabled Groups.


bool TlmPacketizer::findPacketIndexById(U32 packetId, FwChanIdType& pkt) const {
for (FwChanIdType p = 0; p < this->m_numPackets; p++) {
if (this->m_fillBuffers[p].id == packetId) {
pkt = p;
return true;
}
}
return false;
}

Svc::PacketConfig TlmPacketizer::defaultPacketConfig() {
// seeds the default the first time the packet is overridden, assuming these parameters
// were not configured ahead of this packet being enabled: enabled, not forced,
// output-on-change, no thresholds.
Svc::PacketConfig cfg;
cfg.set_enabled(Fw::Enabled(Fw::Enabled::ENABLED));
cfg.set_forceEnabled(Fw::Enabled(Fw::Enabled::DISABLED));
cfg.set_rateLogic(Svc::RateLogic(Svc::RateLogic::ON_CHANGE_MIN));
cfg.set_min(0);
cfg.set_max(0);
return cfg;
}

bool TlmPacketizer::resolveAndSeedOverride(const Svc::TelemetrySection& section,
U32 packetId,
FwSizeType& s,
FwChanIdType& pkt) {
if (not(section.isValid() and section >= 0 and section < TelemetrySection::NUM_SECTIONS)) {
return false;
}
if (not this->findPacketIndexById(packetId, pkt)) {
this->log_WARNING_LO_UnknownPacketId(packetId);
return false;
}
s = static_cast<FwSizeType>(section.e);
if (not this->m_packetOverridden[s][pkt]) {
this->m_packetOverride[s][pkt] = TlmPacketizer::defaultPacketConfig();

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Should this be overriding with the effectiveConfig() instead of the defaultPacketConfig()?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

+1, This also ignores the current group level config

this->m_packetOverridden[s][pkt] = true;
}
return true;
}

void TlmPacketizer ::configIn_handler(FwIndexType portNum, FwSizeType count, const Svc::PacketConfigBatch& batch) {
// load overrides from an external component's persistant storage of the overrides (intended to be used after a reboot)
const FwSizeType cap = static_cast<FwSizeType>(Svc::PacketConfigBatch::SIZE);
const FwSizeType n = (count < cap) ? count : cap;

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Consider a warning EVR if the cap is exceeded.

for (FwSizeType i = 0; i < n; i++) {
const Svc::PacketConfigEntry& entry = batch[i];
const Svc::TelemetrySection section = entry.get_section();
if (not(section.isValid() and section >= 0 and section < TelemetrySection::NUM_SECTIONS)) {
continue;
}
FwChanIdType pkt = 0;
if (not this->findPacketIndexById(entry.get_packetId(), pkt)) {
this->log_WARNING_LO_UnknownPacketId(entry.get_packetId());
continue;
}
const FwSizeType s = static_cast<FwSizeType>(section.e);
this->m_packetOverride[s][pkt] = entry.get_config();
this->m_packetOverridden[s][pkt] = true;
}
}

void TlmPacketizer::mirrorOverride(const Svc::TelemetrySection& section, FwChanIdType pkt, U32 packetId) {
// persistent storage component should mirror this state; skip if not wired
if (not this->isConnected_configOut_OutputPort(0)) {
return;
}
const FwSizeType s = static_cast<FwSizeType>(section.e);
Svc::PacketConfigEntry entry;
entry.set_packetId(packetId);
entry.set_section(section);
entry.set_config(this->m_packetOverride[s][pkt]);
Svc::PacketConfigBatch batch;
batch[0] = entry;
this->configOut_out(0, 1, batch);
}

void TlmPacketizer::missingChannel(FwChanIdType id) {
// search to see if missing channel has already been sent
for (FwChanIdType slot = 0; slot < TLMPACKETIZER_MAX_MISSING_TLM_CHECK; slot++) {
Expand Down
56 changes: 56 additions & 0 deletions Svc/TlmPacketizer/TlmPacketizer.fpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,15 @@ module Svc {
@ Input configuration port
async input port configureSectionGroupRate: ConfigureGroupRate

@ Per-packet configuration mirror to persistent storage managed by an external component
@ Each entry carries the full override for the addressed packet/section and is pushed
@ whenever an ENABLE_PACKET / FORCE_PACKET / CONFIGURE_PACKET_RATES command changes it.
output port configOut: TlmPacketConfigUpdate

@ Per-packet configuration reload from the persistence storage component
@ That storage component pushes it's config into this port when commanded to do so (usually at boot-up)
async input port configIn: TlmPacketConfigUpdate

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

this was motivated by the use-case...

somehow the TlmPacketizer needs to get the persisted packet-overrides after a reboot...this port is the way you get this config in here

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Nit: Might need a note here:
The tlmpacketizer queue must also be able to withstand the bulk of multiple TlmPacketConfigUpdates (batches of 32), otherwise configurations may be dropped / asserted.


@ Telemetry input port
sync input port TlmRecv: Fw.Tlm

Expand Down Expand Up @@ -125,6 +134,41 @@ module Svc {
maxDelta: U32 @< Maximum Sched Ticks between packets to send when using EVERY_MAX logic
) \
opcode 5

@ Query the effective per-packet configuration. The result is emitted on the
@ QueriedPacketConfig telemetry channel; unknown ids raise UnknownPacketId.
async command GET_PACKET_CONFIG(
packetId: U32 @< Packet identifier
section: TelemetrySection @< Section to query
) \

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

after sending this command check the QueriedPacketConfig telemetry channel for the latest packet config asked for!

opcode 6

@ Enable / disable a single packet in a section (per-packet override)
async command ENABLE_PACKET(
packetId: U32 @< Packet identifier
section: TelemetrySection @< Section to configure
enable: Fw.Enabled @< Enable / disable this packet
) \
opcode 7

@ Force telemeter a single packet even when it (or its section) is disabled
async command FORCE_PACKET(
packetId: U32 @< Packet identifier
section: TelemetrySection @< Section to configure
enable: Fw.Enabled @< Force enable / disable
) \
opcode 8

@ Configure the rate logic and thresholds for a single packet
async command CONFIGURE_PACKET_RATES(

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Feel like there should also be a command to "reset" or "default" the overwritten packet --> or is that a design decision that the user MUST reconfigure via a manager if they want to revert to group configs?

packetId: U32 @< Packet identifier
section: TelemetrySection @< Section to configure
rateLogic: RateLogic @< Rate logic
minDelta: U32 @< Minimum Sched ticks between sends (ON_CHANGE_MIN logic)
maxDelta: U32 @< Maximum Sched ticks between sends (EVERY_MAX logic)
) \

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

the three functions above mirror the same functionality available for the "group"-level...now we're exposes the "per-packet" more 'fine-grain' level

opcode 9

@ Parameter to control section enable flags
external param SECTION_ENABLED: SectionEnabled default TELEMETRY_SECTION_ENABLED_DEFAULTS
@ Parameter to control section configuration
Expand Down Expand Up @@ -194,6 +238,15 @@ module Svc {
format "Telemetry ID 0x{x} update of size {} exceeds configured size {}" \
throttle 10


@ A configuration command or query referenced a packet id not present in this deployment
event UnknownPacketId(
packetId: U32 @< The packet id
) \
severity warning low \
id 7 \
format "Packet id {} not found in packet list"

# ----------------------------------------------------------------------
# Telemetry
# ----------------------------------------------------------------------
Expand All @@ -202,6 +255,9 @@ module Svc {
telemetry GroupConfigs: SectionConfigs id 0
telemetry SectionEnabled: SectionEnabled id 1

@ Effective per-packet configuration, emitted in response to GET_PACKET_CONFIG
telemetry QueriedPacketConfig: PacketConfigEntry id 2

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

notice the comment here...esp useful for debugging


array TelemetrySendSection = [NUM_CONFIGURABLE_TLMPACKETIZER_GROUPS] FwIndexType
array TelemetrySendPortMap = [TelemetrySection.NUM_SECTIONS] TelemetrySendSection default TELEMETRY_SEND_PORT_MAPPING

Expand Down
Loading