Skip to content

Commit ade6cc5

Browse files
thomas-bczimri-leisherZimri LeisherLeStarchbocchino
authored
Make APID and FwPacketDescriptorType the same width (#4076)
* Make APID same width as FwPacketDescriptorType * Rename ComCfg.APID to ComCfg.Apid * Fix FprimeDeframer UTs * FpySequencer stack based architecture (#3975) * Some work towards stack based arch * Bring fp/int conv up to date * Get compiling with stack based arch * Start trying to fix UTs * Start adding store/load dirs * Add push val dir * UTs are running * UTs passing * Make exit stack based * Fix more uts * Fix final UTs * sp * Fix overflow potential err * Fix another overflow * same error fix * Update sdd * sp * Fix undefined behavior with bitshift of signed integer * sp --------- Co-authored-by: Zimri Leisher <[email protected]> * Fix AI Policy link in PR template (#4019) * Update NOTICE.txt references (#4045) With the removal of the Autocoders directory, we also remove the pyparsestring usage. * Reformat FppTest (#4048) * Update Drv IP stack to use FwSizeType instead of U32 (#4013) * Update IP stack source to use SizeType instead of I/U32 * Update UTs reflecting U32/I32 change to SizeType * Static cast sizes per review * Fix commented out thing * Basic data structure library, phase 1 (#3927) * Revise SDD for SetBase * Revise SDD for SetBase * Revise SDD for Fw/DataStructures * Revise SDD for FifoQueue * Revise SDD for Fw/DataStructures * Revise SDD for MapBase * Revise SDD for StackBase * Revise SDD for Fw/DataStructures * Revise SDD for Fw/DataStructures * Add StackBase.hpp * Add ExternalStack.hpp * Add Stack.hpp * Add ExternalStackTest * Revise Stack tests * Revise ExternalStack * Revise ExternalStackTest * Revise ExternalStackTest * Revise ExternalStackTest * Revise ExternalStackTest * Add StackTest * Revise SDD for Fw/DataStructures * Revise SDD for Fw/DataStructures * Revise SDD for Fw/DataStructures * Add MapIterator * Add SetIterator * Add SetOrMapIterator * Add MapBase.hpp * Revise SDD for Fw/DataStructures * Revise SDD for ArraySetOrMapImpl * Revise SDD for ArraySetOrMapImpl * Revise SDD for ExternalArray * Revise SDD for Fw/DataStructures * Revise SDD for Fw/DataStructures * Revise MapBase * Revise MapBase * Revise comments * Revise SDD for ArraySetOrMapImpl * Revise Fw/DataStructures * Add ArraySetOrMapImpl * Add ExternalArrayMap * Revise ExternalArrayMap * Revise Fw/DataStructures * Revise SetBase * Revise SDD for Fw/DataStructures * Revise SDD for ExternalArraySet * Revise SDD for ExternalArraySet * Revise SDD for ArraySetOrMapImpl * Revise Fw/DataStructures * Revise SDD for Fw/DataStructures * Revise Fw/DataStructures tests * Revise unit tests for Fw/DataStructures * Revise tests for ArraySetOrMapImpl * Revise unit tests for Fw/DataStructures * Revise unit tests for Fw/DataStructures * Revise unit tests for ArraySetOrMapImpl * Revise unit tests for ArraySetOrMapImpl * Revise unit tests for ArraySetOrMapImpl * Revise unit tests for ArraySetOrMapImpl * Revise unit tests for ArraySetOrMapImpl * Revise unit tests for ArraySetOrMapImpl * Revise unit tests for Fw/DataStructures * Revise SDD for SetOrMapIterator * Add ExternalArrayMapTest * Revise ExternalArrayMapTest * Revise design for sets and maps * Revert changes to design * Revise unit tests for Fw/DataStructures * Revise unit tests for Fw/DataStructures * Revise ExternalArrayMapTest * Revise ExternalArrayMapTest * Revise unit tests for ArraySetOrMapImpl * Revise ExternalArrayMapTest * Revise ExternalArrayMapTest and MapTest * Revise MapTestScenarios * Revise ExternalArrayMapTest * Revise ExternalArrayMapTest * Revise ExternalArrayMapTest * Revise array set and map Remove at function from interface. It breaks the array or set abstraction. It provides little value, since one can use the iterator provided by SetBase or MapBase to range over the elements. * Revise ExternalArrayMapTest * Add ExternalArraySetTest * Revise ExternalArraySet and ExternalArrayMap * Revise ExternalArraySetTest * Revise ExternalArraySetTest * Revise ExternalArraySetTest * Revise ExternalArraySetTest * Revise ExternalArraySetTest * Revise ExternalArraySetTest * Revise ExternalArraySetTest and ExternalArrayMapTest * Revise ArraySetOrMapImplTest * Revise ExternalArrayMapTest * Revise ExternalArraySetTest * Revise SDD for ArrayMap * Revise SDD for ArraySet * Revise SDD for ArraySet * Add ArrayMap * Revise ArrayMapTest * Revise Fw/DataStructures * Revise SDDs for ArrayMap and ArraySet * Revise Fw/DataStructures * Refactor map test scenarios * Refactor data structures tests * Refactor SetTestScenarios * Refactor FifoQueueTestScenarios * Refactor ExternalFifoQueueTest * Revise Fifo Queue tests * Refactor ExternalFifoQueueTest * Revise comments * Revise Stack tests * Revise Stack tests * Refactor Stack tests * Revise Stack tests * Revise Array Remove getStaticSize * Refactor Fifo tests * Refactor ArraySetOrMapImplTest * Revise data structures design Rename Iterator to Entry * Revise data structures implementation Rename Iterator to Entry * Revise data structures impl and test Rename Iterator to Entry throughout * Revise data structures implementation Rename SetOrMapEntry to SetOrMapImplEntry * Revise data structure implementation Rename Entry to ImplEntry * Revise data structures design Rename symbols to match implementation * Revise design for data structures Add ConstIterator to Map * Revise ArraySetOrMapImpl Add ConstIterator * Add iterators to DS implementation * Revise map iteration * Revise unit tests Use iterators for maps * Revise iterators * Revise iterators * Rename MapEntry to MapConstEntry * Revise map interface * Rename SetOrMapImplEntry to SetOrMapImplConstEntry * Revert "Rename SetOrMapImplEntry to SetOrMapImplConstEntry" This reverts commit cc6371d. * Rename SetEntry to SetConstEntry * Add SetConstIterator * Revise SetBase and unit tests Use iterators * Revise set interface * Revise comments * Reformat code * Revise array set and map impl Remove forward links * Revise data structures tests * Revise Set iterator * Remove SetConstEntry * Refactor SetOrMapImplEntry * Pull in changes from rb-tree branch * Revise MapBase * Revise MapBase and docs * Revise MapBase * Revise MapBase * Revise iterators * Revise MapConstIterator docs * Rename MapConstEntry to MapEntry * Revise MapEntry * Fix MapBase docs * Revise MapConstIterator * Revise MapEntry * Revise MapConstIterator docs * Revise docs for ExternalArrayMap * Revise ArrayMap docs * Revise ArraySetOrMapImpl * Revise SetOrMapImplEntry * Revise MapEntry * Revise map and set interfaces * Revert changes to map interface * Rename MapEntry to MapEntryBase * Revise type aliases * Reformat code * Revise SetBase * Revise map interface * Revise set and map interface * Revise ExternalArraySet docs * Revise ArraySet * Revise ArraySet docs * Revise SetConstIterator * Revise SetBase * Revise SetBase docs * Revise SetBase * Revise ArraySet * Revise ArraySet docs * Revise ExternalArraySet docs * Add SetOrMapImplEntry * Revise ArraySetOrMapImpl * Revise Fw/DataStructures Reformat code * Revise Fw/DataStructures Fix compile errors on Linux * Revise Fw/DataStructures Fix compile errors on Linux * Revise Fw/DataStructures Fix compile errors on Linux * Revise Fw/DataStructures Fix compile errors on Linux * Fix comments * Revise Fw/DataStructures Fix compile errors on Linux * Revise ArrayMap docs * Remove helper scripts * Revise tests for Fw/DataStructures * Fix spelling * Fix Markdown link * Fix uninitialized variable in test * Fix uninitialized variable in test * Fix "spelling" Why is the spelling check enforcing arbitrary rules of style? * Fix comments * Revise tests for ArraySetOrMapImpl * Revise comment * Revise ArraySetOrMap impl * Revise formatting * Revise docs * Revise docs for Fw/DataStructures * Revise Array and ExternalArray Add static assertions * Revise FifoQueue and Stack Add static assertions * Revise ArraySet and ArrayMap Add static assertions * Revise ArrayMap tests * Revise ExternalArraySet tests * Refactor ArraySetTest * Revise array initialization * Revise comments * Revise Array initialization * Revise Array design and implementation * Revert changes to Fw/DataStructures * Revise Array * Revise Array * Revise Array * Fix formatting * Add SizedContainer base class * Revise StackBase Make it inherit from SizedContainer Revise stack tests * Revise MapBase Make it inherit from SizedContainer Revise tests * Revise SetBase Make it inherit from SizedContainer Revise tests * Revise DataStructures design Add SizedContainer * Revise SDD for DataStructures * Revise DataStructures design * Revise DataStructures design * Revise DataStructures design * Revise DataStructures design * Fix spelling * Revise zero-arg constructor for Array * Revise Array interface Make it consistent with the arrays generated by FPP * Fix to assertion * FpySequencer arithmetic (#4025) * Some work towards stack based arch * Bring fp/int conv up to date * Get compiling with stack based arch * Start trying to fix UTs * Start adding store/load dirs * Add push val dir * UTs are running * UTs passing * Make exit stack based * Fix more uts * Fix final UTs * sp * Fix overflow potential err * Fix another overflow * same error fix * Format * Also add to format checker * Add math directives * Add integer extension and truncation * Also check correct size on stack * Fix comment * Push cmd response to stack * Cast cmd response code to i32 * Add stack cmd, memcmp, discard dirs * Fix some bugs with stack cmd * Fix lil bug in sgtack cmd * same bug * Fix another bug sry * Update sdd * sp * Fix undefined behavior with bitshift of signed integer * sp * Fix lil bug in timeout detection of stack cmd * Switch format check to do all Svc dirs * Reformat, and fix packet descriptor serialize bug * Add UTs for all of arith ops * Add tests for disc, memcmp, stack cmd * Add deser tests for those three dirs * sp * Format * Replace magic numbers with sizeofs * Add currentStatementIdx helper function * Format * Split imod into smod and umod * sp * Add fmod, copy python behavior for fmod and smod --------- Co-authored-by: Zimri Leisher <[email protected]> * Update supported platforms (#4071) * improved step to contribute back * added delivery date for targeted platforms * added tbd since we are not sure at the moment * fixed column data * updating list of supported targets. This reflects how F Prime runs on these hardware with zephyr. * alphabetized list and added link for freertos * fix spelling * rename Apple M* to Apple Silicon --------- Co-authored-by: Thomas Boyer-Chammard <[email protected]> * Add ground derived channels how-to guide (#4074) * Initial derived channel work * Write ground-derived channels * Update plugin handler * Updating publishChannel case Updated method name to follow naming conventions. * Fix method name to use snake_case in documentation * Add environment setup to CONTRIBUTING.md (#4078) * Fix typo `cp` to `cd` in CONTRIBUTING.md * Mention Python venv requirements for running tests * Add logic for assert failure short circuiting in `AssertFatalAdapter` (#4042) * Add logic for assertion short circuiting - Add guard logic to AssertFatalAdapter to prevent a cascading FW_ASSERT chain from occurring - If any assert checks fail while handling an in-progress assert check failure, reportAssert will log the additional assert and execute the system-specific assert handler before returning * Update assert guard logic to counter based - Instead of using a bool guard to determine when to off-ramp from a series of FW_ASSERT check failures, use a counter that is configurable in a program's FpConfig.h file --------- Co-authored-by: M Starch <[email protected]> * Add subtopology documentation (#4072) * Add subtopology guide * fix typo and how-to * Add reference link * Add event ID filters to text logger components (#4028) * Add event ID filter to PassiveConsoleTextLogger * Add event ID filter to ActiveTextLogger * Add const qualifier to filtered event list pointers * Fix assert argument types * Fix clang format errors * Fix copy-paste error on include file Co-authored-by: Thomas Boyer-Chammard <[email protected]> * Add missing initialization to ActiveTextLogger constructor --------- Co-authored-by: Ian Brault <[email protected]> Co-authored-by: Thomas Boyer-Chammard <[email protected]> Co-authored-by: M Starch <[email protected]> * Bump GDS to v4.0.2a3 (#4079) * Bump to v4.0.2a2 (GDS) * Fix integration tests * Fix requirements.txt * Allow FPP arrays of arbitrary size (#4073) * Revise array tests Update constructor calls to conform to new code gen Format the code * Reformat FppTest * Revise requirements.txt * Update requirements.txt * Update fpp version * Revise Ref to conform to FPP changes * Remove trailing spaces --------- Co-authored-by: Thomas Boyer-Chammard <[email protected]> * Update project structure in cookiecutters CI (#3991) * Update project structure * Fix sourcing path * fix paths --------- Co-authored-by: Thomas Boyer-Chammard <[email protected]> * Fix #3397 (#4086) * Add test driven development how-to (#4090) * Add test driven development how-to * sp; review * Add reusable InT test scripts (#3923) * add deployment function * update file to use config json file * remove unuse function * fix typos * fixed spelling * update to use get_mnemonic * rm shellcmd from fileManager and add health & systemResources testcase * check memory usage and number of CPUs * remove Ref.PingReceiver and fixed typos * fixed spelling fileDownlink,health,systemResources and add config.json file * Update config.json * replace ActiveLogger to EventManager * Updated config.json use lowercase CdhCore and FileHandling(fileDownlink,fileManager,prmDb) and ComCcsds(cmdSeq) etc * update test_cmd_version to compare version of telemetry channel vs. evr version * extend max_delay to work with Raspberry pi * rename config.json to int_config.json * delete Ref/config.json new file name int_config.json * add time.sleep between AppendFile cmd to work with rasberry Pi * fix int_config.json and add new Int DpMgr, DpWriter and DpCatalog * add comments to confirm /tmp/1MiB.txt and /tmp/test_seq.seq exist before execute script * add send uplink files * Rename config.json, fix spelling * python formatting --------- Co-authored-by: Cindy T Huynh <[email protected]> Co-authored-by: M Starch <[email protected]> Co-authored-by: Thomas Boyer-Chammard <[email protected]> Co-authored-by: Kevin F. Ortega <[email protected]> * Modify LinuxTimer interface for consistency (#4087) * Use Fw::TimeInterval in LinuxTimer * Fix Linux FD typo * Fix interval timer UT * Format * Fix assert casts * Fix ComLogger UTs * Fix FppTest microseconds * Fix casting * Fix overflow * FpySequencer U32 stack size + some error telemetry (#4065) * Switch everything that references stack size or offset to U32 * Add dir err tlm * Rename tlm point to be consistent * Update state tlm type to enumstoretype * Make new Fpy::StackSizeType alias * Add explanation for why we chose U32 * Fix one more static cast * Bump schema vers to 2 --------- Co-authored-by: Zimri Leisher <[email protected]> * Add Framing subtopologies and use them within Com subtopologies (#4113) * Update ComX subtopologies to not include ComStub and update Ref * Cosmetic updates * Working FramingCcsds subtopology used in ComCcsds * Revert Ref to use ComCcsds * Move FramingSubtopology into ComCcsds build module * Working ComFprime subtopology * Cosmetic updates * formatting * Incorporate student feedback for ground derived channels (#4117) * Update fprime-gds version to 4.0.2a4 (#4118) * Revise subtopology development documentation (#4119) * Revise subtopology development documentation * Document subtopology configuration process Added detailed instructions for configuring subtopologies, including module setup and CMake integration. * Enhance documentation on subtopology structure Added recommendations for including documentation and optional files in subtopology. * fix spelling * fix spelling v2 final --------- Co-authored-by: Thomas Boyer-Chammard <[email protected]> * Add SDD for ComCcsds subtopology (#4128) * Create SDD for ComCcsds subtopology * Update Svc/Subtopologies/ComCcsds/docs/sdd.md Co-authored-by: Thomas Boyer-Chammard <[email protected]> * Update Svc/Subtopologies/ComCcsds/docs/sdd.md Co-authored-by: Thomas Boyer-Chammard <[email protected]> * Update Svc/Subtopologies/ComCcsds/docs/sdd.md Co-authored-by: Thomas Boyer-Chammard <[email protected]> * Revise CCSDS subtopology entries and limitations Updated descriptions for CCSDS subtopologies and clarified limitations. --------- Co-authored-by: Thomas Boyer-Chammard <[email protected]> * Create SDD for CdhCore subtopology (#4121) * Create SDD for CdhCore subtopology Added a comprehensive Software Design Document (SDD) for the CdhCore subtopology, detailing requirements, design, usage, configuration, and traceability. * sp * Update SDD with review feedback Added section for rate-group connection points and updated instance requirements. * Feedback updates on common port patters, health, and worker (#4115) * Feedback updates on common port patters, health, and worker * Fix typos and improve clarity in documentation * Fix typo in health-checking documentation - pt 2 Corrected a typo in the description of Svc.Health regarding configurable timeouts. * Fix typo in manager-worker documentation - pt 3 * Fix formatting in health-checking documentation * Add Software Design Document for FileHandling subtopology (#4125) * Add FPP state machine How-To (#4096) * Add FPP state machine How-To * Fix state definitions in state diagram for newlines * sp Clarified wording regarding state transitions in the documentation. * Missing `.` Co-authored-by: Rob Bocchino <[email protected]> * Review updates * Update links in define-state-machines.md * sp --------- Co-authored-by: Rob Bocchino <[email protected]> * Add Software Design Document for ComFprime subtopology (#4127) * Add Software Design Document for ComFprime subtopology * sp * fix spelling and same feedback as ComCcsds * Update instance summary in sdd.md documentation --------- Co-authored-by: Thomas Boyer-Chammard <[email protected]> * Add file size and subdirectory support to FileManager directory listing feature (#4041) * Enhancement: Added file size and subdirectory support to FileManager directory listing feature * Refactor to directory listing feature using rategroup 2 component * Spelling fixes to expect.txt, config feilds for schedin call, fixes on comments/types * Fix for spellcheck * Replace fixed size with FileNameStringSize for commands * Fix minor nits * Formatting * Remove fileManager instance, use FileHandling.fileManager * Fix review feedback --------- Co-authored-by: M Starch <[email protected]> * Revise Communication Adapter Interface documentation (#4133) Updated reference to the Communication Adapter Interface in the documentation to reflect changes in the interface file names and added usage instructions. * Add ActivePhaser to Svc (#3974) * Initial open source review of active phaser * Start working on ActivePhaser's FPP model * Add ActivePhaser implementation * Start working on unit tests * Fill in test logic * Add comments * Guard against writing outside of container * Add comment * Update comments * Fix comment on overflow * Comment on the use of actual_start and others * Add comments and max connection count * Add comments * Phaser updates * Add telemetry channels * Update comments, fix FPP, update API calls in tester * Apply formatter * Minor comment change * Fix spelling * First draft of SDD * Revert "Add telemetry channels" This reverts commit 1690e51. * PRIVATE -> private * Add friend class declaration for ActivePhaserTester * Fix FIXMEs where possible * Formatting * Fix minor UT issues * Remove (void) --------- Co-authored-by: ZIIIKT <[email protected]> Co-authored-by: M Starch <[email protected]> Co-authored-by: Michael D Starch <[email protected]> * Fix other UTs * Bump GDS dependency to latest v4.0.2a5 * Bump fprime-gds to v4.0.2a6 * Update dictionary command in seqgen tests --------- Co-authored-by: Zimri Leisher <[email protected]> Co-authored-by: Zimri Leisher <[email protected]> Co-authored-by: M Starch <[email protected]> Co-authored-by: Rob Bocchino <[email protected]> Co-authored-by: kevin-f-ortega <[email protected]> Co-authored-by: Philip Romano <[email protected]> Co-authored-by: Kyle Jones <[email protected]> Co-authored-by: Ian Brault <[email protected]> Co-authored-by: Ian Brault <[email protected]> Co-authored-by: chuynh4duarte <[email protected]> Co-authored-by: Cindy T Huynh <[email protected]> Co-authored-by: Kevin F. Ortega <[email protected]> Co-authored-by: Rob Bocchino <[email protected]> Co-authored-by: Isaac Garibay <[email protected]> Co-authored-by: Shaokai (Jerry) Lin <[email protected]> Co-authored-by: ZIIIKT <[email protected]> Co-authored-by: Michael D Starch <[email protected]>
1 parent 6190d96 commit ade6cc5

File tree

26 files changed

+75
-76
lines changed

26 files changed

+75
-76
lines changed

Fw/Com/ComPacket.hpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,15 +9,15 @@
99
#define COMPACKET_HPP_
1010

1111
#include <Fw/Types/Serializable.hpp>
12-
#include "config/APIDEnumAc.hpp"
12+
#include "config/ApidEnumAc.hpp"
1313

1414
// Packet format:
15-
// |32-bit packet type|packet type-specific data|
15+
// | packet type (width = FwPacketDescriptorType) | packet type-specific data |
1616

1717
namespace Fw {
1818

1919
// This type is defined in config/ComCfg.fpp
20-
using ComPacketType = ComCfg::APID::T;
20+
using ComPacketType = ComCfg::Apid::T;
2121

2222
class ComPacket : public Serializable {
2323
public:

Ref/test/int/ref_integration_test.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -276,7 +276,7 @@ def test_seqgen(fprime_test_api):
276276
subprocess.run(
277277
[
278278
"fprime-seqgen",
279-
"-d",
279+
"--dictionary",
280280
str(fprime_test_api.dictionaries.dictionary_path),
281281
str(sequence),
282282
"/tmp/ref_test_int.bin",

Svc/Ccsds/ApidManager/ApidManager.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ ApidManager ::ApidManager(const char* const compName) : ApidManagerComponentBase
2121
// Handler implementations for typed input ports
2222
// ----------------------------------------------------------------------
2323

24-
U16 ApidManager ::validateApidSeqCountIn_handler(FwIndexType portNum, const ComCfg::APID& apid, U16 receivedSeqCount) {
24+
U16 ApidManager ::validateApidSeqCountIn_handler(FwIndexType portNum, const ComCfg::Apid& apid, U16 receivedSeqCount) {
2525
U16 expectedSequenceCount = this->getAndIncrementSeqCount(apid);
2626
if (receivedSeqCount != expectedSequenceCount && receivedSeqCount != SEQUENCE_COUNT_ERROR) {
2727
// Likely a packet was dropped or out of order
@@ -32,15 +32,15 @@ U16 ApidManager ::validateApidSeqCountIn_handler(FwIndexType portNum, const ComC
3232
return receivedSeqCount;
3333
}
3434

35-
U16 ApidManager ::getApidSeqCountIn_handler(FwIndexType portNum, const ComCfg::APID& apid, U16 unused) {
35+
U16 ApidManager ::getApidSeqCountIn_handler(FwIndexType portNum, const ComCfg::Apid& apid, U16 unused) {
3636
return this->getAndIncrementSeqCount(apid);
3737
}
3838

3939
// ----------------------------------------------------------------------
4040
// Helpers
4141
// ----------------------------------------------------------------------
4242

43-
U16 ApidManager ::getAndIncrementSeqCount(ComCfg::APID::T apid) {
43+
U16 ApidManager ::getAndIncrementSeqCount(ComCfg::Apid::T apid) {
4444
U16 seqCount = SEQUENCE_COUNT_ERROR; // Default to error value
4545
// Search the APID in the sequence table
4646
for (U16 i = 0; i < MAX_TRACKED_APIDS; i++) {
@@ -54,7 +54,7 @@ U16 ApidManager ::getAndIncrementSeqCount(ComCfg::APID::T apid) {
5454
}
5555
// If not found, search for an uninitialized entry to track this APID
5656
for (U16 i = 0; i < MAX_TRACKED_APIDS; i++) {
57-
if (this->m_apidSequences[i].apid == ComCfg::APID::INVALID_UNINITIALIZED) {
57+
if (this->m_apidSequences[i].apid == ComCfg::Apid::INVALID_UNINITIALIZED) {
5858
this->m_apidSequences[i].apid = apid; // Initialize this entry with the new APID
5959
seqCount = this->m_apidSequences[i].sequenceCount; // Entries default to 0 unless otherwise specified
6060
// Increment entry for next call
@@ -67,7 +67,7 @@ U16 ApidManager ::getAndIncrementSeqCount(ComCfg::APID::T apid) {
6767
return SEQUENCE_COUNT_ERROR;
6868
}
6969

70-
void ApidManager::setNextSeqCount(ComCfg::APID::T apid, U16 seqCount) {
70+
void ApidManager::setNextSeqCount(ComCfg::Apid::T apid, U16 seqCount) {
7171
for (U16 i = 0; i < MAX_TRACKED_APIDS; i++) {
7272
if (this->m_apidSequences[i].apid == apid) {
7373
this->m_apidSequences[i].sequenceCount = seqCount;

Svc/Ccsds/ApidManager/ApidManager.hpp

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -14,28 +14,28 @@ namespace Svc {
1414

1515
namespace Ccsds {
1616

17-
static_assert(ComCfg::APID::SPP_IDLE_PACKET == 0x07FF,
17+
static_assert(ComCfg::Apid::SPP_IDLE_PACKET == 0x07FF,
1818
"SPP_IDLE_PACKET must exist and equal 0x07FF (as specified by standard)");
19-
static_assert(ComCfg::APID::INVALID_UNINITIALIZED == 0x0800,
19+
static_assert(ComCfg::Apid::INVALID_UNINITIALIZED == 0x0800,
2020
"Invalid APID must be 0x0800 (11 bits values allow 0-2047)");
21-
static_assert(ComCfg::APID::FW_PACKET_COMMAND == Fw::ComPacketType::FW_PACKET_COMMAND,
21+
static_assert(ComCfg::Apid::FW_PACKET_COMMAND == Fw::ComPacketType::FW_PACKET_COMMAND,
2222
"APID FW_PACKET_COMMAND must exist, used by the Framework");
23-
static_assert(ComCfg::APID::FW_PACKET_TELEM == Fw::ComPacketType::FW_PACKET_TELEM,
23+
static_assert(ComCfg::Apid::FW_PACKET_TELEM == Fw::ComPacketType::FW_PACKET_TELEM,
2424
"APID FW_PACKET_TELEM must exist, used by the Framework");
25-
static_assert(ComCfg::APID::FW_PACKET_LOG == Fw::ComPacketType::FW_PACKET_LOG,
25+
static_assert(ComCfg::Apid::FW_PACKET_LOG == Fw::ComPacketType::FW_PACKET_LOG,
2626
"APID FW_PACKET_LOG must exist, used by the Framework");
27-
static_assert(ComCfg::APID::FW_PACKET_FILE == Fw::ComPacketType::FW_PACKET_FILE,
27+
static_assert(ComCfg::Apid::FW_PACKET_FILE == Fw::ComPacketType::FW_PACKET_FILE,
2828
"APID FW_PACKET_FILE must exist, used by the Framework");
29-
static_assert(ComCfg::APID::FW_PACKET_PACKETIZED_TLM == Fw::ComPacketType::FW_PACKET_PACKETIZED_TLM,
29+
static_assert(ComCfg::Apid::FW_PACKET_PACKETIZED_TLM == Fw::ComPacketType::FW_PACKET_PACKETIZED_TLM,
3030
"APID FW_PACKET_PACKETIZED_TLM must exist, used by the Framework");
31-
static_assert(ComCfg::APID::FW_PACKET_UNKNOWN == Fw::ComPacketType::FW_PACKET_UNKNOWN,
31+
static_assert(ComCfg::Apid::FW_PACKET_UNKNOWN == Fw::ComPacketType::FW_PACKET_UNKNOWN,
3232
"APID FW_PACKET_UNKNOWN must exist, used by the Framework");
3333

3434
class ApidManager final : public ApidManagerComponentBase {
3535
friend class ApidManagerTester; //!< Friend class for testing
3636

3737
public:
38-
static constexpr U16 MAX_TRACKED_APIDS = ComCfg::APID::NUM_CONSTANTS;
38+
static constexpr U16 MAX_TRACKED_APIDS = ComCfg::Apid::NUM_CONSTANTS;
3939
static constexpr U16 SEQUENCE_COUNT_ERROR = std::numeric_limits<U16>::max();
4040
// ----------------------------------------------------------------------
4141
// Component construction and destruction
@@ -55,12 +55,12 @@ class ApidManager final : public ApidManagerComponentBase {
5555

5656
//! Handler implementation for validateApidSeqCountIn
5757
U16 validateApidSeqCountIn_handler(FwIndexType portNum, //!< The port number
58-
const ComCfg::APID& apid,
58+
const ComCfg::Apid& apid,
5959
U16 seqCount) override;
6060

6161
//! Handler implementation for validateApidSeqCountIn
6262
U16 getApidSeqCountIn_handler(FwIndexType portNum, //!< The port number
63-
const ComCfg::APID& apid,
63+
const ComCfg::Apid& apid,
6464
U16 seqCount) override;
6565

6666
private:
@@ -69,15 +69,15 @@ class ApidManager final : public ApidManagerComponentBase {
6969
// ----------------------------------------------------------------------
7070
//! Get the sequence count for a given APID and increment it for the next
7171
//! Wraps around at 14 bits
72-
U16 getAndIncrementSeqCount(ComCfg::APID::T apid);
72+
U16 getAndIncrementSeqCount(ComCfg::Apid::T apid);
7373

7474
//! Set the next expected sequence count for a given APID
75-
void setNextSeqCount(ComCfg::APID::T apid, U16 seqCount);
75+
void setNextSeqCount(ComCfg::Apid::T apid, U16 seqCount);
7676

7777
//! This struct helps track sequence counts per APID
7878
//! Future work: update to using a map from Fw/DataStructures when available
7979
struct ApidSequenceEntry {
80-
ComCfg::APID::T apid = ComCfg::APID::INVALID_UNINITIALIZED;
80+
ComCfg::Apid::T apid = ComCfg::Apid::INVALID_UNINITIALIZED;
8181
U16 sequenceCount = 0;
8282
};
8383

Svc/Ccsds/ApidManager/test/ut/ApidManagerTester.cpp

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,9 @@ namespace Svc {
1212

1313
namespace Ccsds {
1414

15-
static constexpr ComCfg::APID::T TEST_REGISTERED_APIDS[] = {ComCfg::APID::FW_PACKET_COMMAND,
16-
ComCfg::APID::FW_PACKET_TELEM, ComCfg::APID::FW_PACKET_LOG,
17-
ComCfg::APID::FW_PACKET_FILE};
15+
static constexpr ComCfg::Apid::T TEST_REGISTERED_APIDS[] = {ComCfg::Apid::FW_PACKET_COMMAND,
16+
ComCfg::Apid::FW_PACKET_TELEM, ComCfg::Apid::FW_PACKET_LOG,
17+
ComCfg::Apid::FW_PACKET_FILE};
1818

1919
// ----------------------------------------------------------------------
2020
// Construction and destruction
@@ -43,7 +43,7 @@ bool ApidManagerTester::GetExistingSeqCount::precondition(const ApidManagerTeste
4343

4444
void ApidManagerTester::GetExistingSeqCount::action(ApidManagerTester& testerState) {
4545
testerState.clearHistory();
46-
ComCfg::APID::T apid = testerState.shadow_getRandomTrackedApid();
46+
ComCfg::Apid::T apid = testerState.shadow_getRandomTrackedApid();
4747
U16 seqCount = testerState.invoke_to_getApidSeqCountIn(0, apid, 0);
4848
U16 shadowSeqCount = testerState.shadow_getAndIncrementSeqCount(apid);
4949
ASSERT_EQ(seqCount, shadowSeqCount) << "Sequence count for APID " << static_cast<U16>(apid)
@@ -65,7 +65,7 @@ void ApidManagerTester::GetNewSeqCountOk::action(ApidManagerTester& testerState)
6565
return; // Cannot get new sequence count if table is full - skip action
6666
}
6767

68-
ComCfg::APID::T apid = testerState.shadow_getRandomUntrackedApid();
68+
ComCfg::Apid::T apid = testerState.shadow_getRandomUntrackedApid();
6969
U16 seqCount = testerState.invoke_to_getApidSeqCountIn(0, apid, 0);
7070
U16 shadowSeqCount = testerState.shadow_getAndIncrementSeqCount(apid);
7171
ASSERT_EQ(seqCount, shadowSeqCount) << "Sequence count for APID " << static_cast<U16>(apid)
@@ -79,7 +79,7 @@ bool ApidManagerTester::GetNewSeqCountTableFull::precondition(const ApidManagerT
7979

8080
void ApidManagerTester::GetNewSeqCountTableFull::action(ApidManagerTester& testerState) {
8181
testerState.clearHistory();
82-
ComCfg::APID::T apid = testerState.shadow_getRandomUntrackedApid();
82+
ComCfg::Apid::T apid = testerState.shadow_getRandomUntrackedApid();
8383
U16 seqCount = testerState.invoke_to_getApidSeqCountIn(0, apid, 0);
8484
// Use local constexpr to potentially avoid ODR-use of ApidManager::SEQUENCE_COUNT_ERROR
8585
constexpr U16 sequenceCountErrorVal = ApidManager::SEQUENCE_COUNT_ERROR;
@@ -95,7 +95,7 @@ bool ApidManagerTester::ValidateSeqCountOk::precondition(const ApidManagerTester
9595

9696
void ApidManagerTester::ValidateSeqCountOk::action(ApidManagerTester& testerState) {
9797
testerState.clearHistory();
98-
ComCfg::APID::T apid = testerState.shadow_getRandomTrackedApid();
98+
ComCfg::Apid::T apid = testerState.shadow_getRandomTrackedApid();
9999
U16 shadow_expectedSeqCount = testerState.shadow_seqCounts[apid];
100100
testerState.invoke_to_validateApidSeqCountIn(0, apid, shadow_expectedSeqCount);
101101
testerState.shadow_validateApidSeqCount(apid, shadow_expectedSeqCount); // keep shadow state in sync
@@ -109,7 +109,7 @@ bool ApidManagerTester::ValidateSeqCountFailure::precondition(const ApidManagerT
109109

110110
void ApidManagerTester::ValidateSeqCountFailure::action(ApidManagerTester& testerState) {
111111
testerState.clearHistory();
112-
ComCfg::APID::T apid = testerState.shadow_getRandomTrackedApid();
112+
ComCfg::Apid::T apid = testerState.shadow_getRandomTrackedApid();
113113
U16 shadow_expectedSeqCount = testerState.shadow_seqCounts.at(apid);
114114
U16 invalidSeqCount = static_cast<U16>(
115115
(shadow_expectedSeqCount + 1) %
@@ -128,7 +128,7 @@ void ApidManagerTester::ValidateSeqCountFailure::action(ApidManagerTester& teste
128128
// Helpers
129129
// ----------------------------------------------------------------------
130130

131-
U16 ApidManagerTester::shadow_getAndIncrementSeqCount(ComCfg::APID::T apid) {
131+
U16 ApidManagerTester::shadow_getAndIncrementSeqCount(ComCfg::Apid::T apid) {
132132
// This is a shadow function to simulate the getAndIncrementSeqCount behavior
133133
// without modifying the actual component state.
134134
auto found = this->shadow_seqCounts.find(apid);
@@ -147,27 +147,27 @@ U16 ApidManagerTester::shadow_getAndIncrementSeqCount(ComCfg::APID::T apid) {
147147
return this->component.SEQUENCE_COUNT_ERROR; // Return error if APID not found
148148
}
149149

150-
void ApidManagerTester::shadow_validateApidSeqCount(ComCfg::APID::T apid, U16 expectedSeqCount) {
150+
void ApidManagerTester::shadow_validateApidSeqCount(ComCfg::Apid::T apid, U16 expectedSeqCount) {
151151
// This simply updates the shadow state to the next expected sequence count
152152
auto found = this->shadow_seqCounts.find(apid);
153153
if (found != this->shadow_seqCounts.end()) {
154154
found->second = static_cast<U16>((expectedSeqCount + 1) % (1 << SpacePacketSubfields::SeqCountWidth));
155155
}
156156
}
157157

158-
ComCfg::APID::T ApidManagerTester::shadow_getRandomTrackedApid() {
158+
ComCfg::Apid::T ApidManagerTester::shadow_getRandomTrackedApid() {
159159
// Select a random APID from the sequence counts map
160160
U32 mapSize = static_cast<U32>(this->shadow_seqCounts.size());
161161
U32 randomIndex = STest::Random::lowerUpper(0, mapSize - 1);
162-
ComCfg::APID apid = std::next(this->shadow_seqCounts.begin(), randomIndex)->first;
162+
ComCfg::Apid apid = std::next(this->shadow_seqCounts.begin(), randomIndex)->first;
163163
return apid;
164164
}
165165

166-
ComCfg::APID::T ApidManagerTester::shadow_getRandomUntrackedApid() {
166+
ComCfg::Apid::T ApidManagerTester::shadow_getRandomUntrackedApid() {
167167
// Select a random APID that is not currently tracked
168-
ComCfg::APID::T apid;
168+
ComCfg::Apid::T apid;
169169
do {
170-
apid = static_cast<ComCfg::APID::T>(STest::Random::lowerUpper(10, ComCfg::APID::SPP_IDLE_PACKET));
170+
apid = static_cast<ComCfg::Apid::T>(STest::Random::lowerUpper(10, ComCfg::Apid::SPP_IDLE_PACKET));
171171
} while (this->shadow_seqCounts.find(apid) != this->shadow_seqCounts.end());
172172
return apid;
173173
}

Svc/Ccsds/ApidManager/test/ut/ApidManagerTester.hpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -59,20 +59,20 @@ class ApidManagerTester : public ApidManagerGTestBase {
5959
ApidManager component;
6060

6161
// Shadow test state
62-
std::map<ComCfg::APID::T, U16> shadow_seqCounts; //!< Map to hold expected sequence counts for APIDs
62+
std::map<ComCfg::Apid::T, U16> shadow_seqCounts; //!< Map to hold expected sequence counts for APIDs
6363
bool shadow_isTableFull = false;
6464

6565
// ----------------------------------------------------------------------
6666
// Helpers for tracking the shadow test state
6767
// ----------------------------------------------------------------------
6868

69-
U16 shadow_getAndIncrementSeqCount(ComCfg::APID::T apid);
69+
U16 shadow_getAndIncrementSeqCount(ComCfg::Apid::T apid);
7070

71-
void shadow_validateApidSeqCount(ComCfg::APID::T apid, U16 expectedSeqCount);
71+
void shadow_validateApidSeqCount(ComCfg::Apid::T apid, U16 expectedSeqCount);
7272

73-
ComCfg::APID::T shadow_getRandomTrackedApid();
73+
ComCfg::Apid::T shadow_getRandomTrackedApid();
7474

75-
ComCfg::APID::T shadow_getRandomUntrackedApid();
75+
ComCfg::Apid::T shadow_getRandomUntrackedApid();
7676

7777
// ----------------------------------------------------------------------
7878
// Tests: Rule Based Testing

Svc/Ccsds/Ports/Ports.fpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ module Svc {
22
module Ccsds {
33

44
@ Port for requesting a sequence count for a given APID
5-
port ApidSequenceCount (apid: ComCfg.APID, sequenceCount: U16) -> U16
5+
port ApidSequenceCount (apid: ComCfg.Apid, sequenceCount: U16) -> U16
66

77
}
88
}

Svc/Ccsds/SpacePacketDeframer/SpacePacketDeframer.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ void SpacePacketDeframer ::dataIn_handler(FwIndexType portNum, Fw::Buffer& data,
5757
}
5858

5959
U16 apidValue = header.get_packetIdentification() & SpacePacketSubfields::ApidMask;
60-
ComCfg::APID::T apid = static_cast<ComCfg::APID::T>(apidValue);
60+
ComCfg::Apid::T apid = static_cast<ComCfg::Apid::T>(apidValue);
6161
ComCfg::FrameContext contextCopy = context;
6262
contextCopy.set_apid(apid);
6363

Svc/Ccsds/SpacePacketDeframer/test/ut/SpacePacketDeframerTester.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ void SpacePacketDeframerTester ::testDataReturnPassthrough() {
4141
}
4242

4343
void SpacePacketDeframerTester ::testNominalDeframing() {
44-
ComCfg::APID::T apid = static_cast<ComCfg::APID::T>(STest::Random::lowerUpper(0, 0x7FF)); // random 11 bit APID
44+
ComCfg::Apid::T apid = static_cast<ComCfg::Apid::T>(STest::Random::lowerUpper(0, 0x7FF)); // random 11 bit APID
4545
U16 seqCount = static_cast<U8>(STest::Random::lowerUpper(0, 0x3FFF)); // random 14 bit sequence count
4646
U16 dataLength =
4747
static_cast<U8>(STest::Random::lowerUpper(1, MAX_TEST_PACKET_DATA_SIZE)); // bytes of data, random length
@@ -72,7 +72,7 @@ void SpacePacketDeframerTester ::testNominalDeframing() {
7272
}
7373

7474
void SpacePacketDeframerTester ::testDeframingIncorrectLength() {
75-
ComCfg::APID::T apid = static_cast<ComCfg::APID::T>(STest::Random::lowerUpper(0, 0x7FF)); // random 11 bit APID
75+
ComCfg::Apid::T apid = static_cast<ComCfg::Apid::T>(STest::Random::lowerUpper(0, 0x7FF)); // random 11 bit APID
7676
U16 seqCount = static_cast<U8>(STest::Random::lowerUpper(0, 0x3FFF)); // random 14 bit sequence count
7777
U16 realDataLength =
7878
static_cast<U8>(STest::Random::lowerUpper(1, MAX_TEST_PACKET_DATA_SIZE)); // bytes of data, random length

Svc/Ccsds/SpacePacketFramer/SpacePacketFramer.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ void SpacePacketFramer ::dataIn_handler(FwIndexType portNum, Fw::Buffer& data, c
4444
// PVN is always 0 per Standard - Packet Type is 0 for Telemetry (downlink) - SecHdr flag is 0 for no secondary
4545
// header
4646
U16 packetIdentification = 0;
47-
ComCfg::APID::T apid = context.get_apid();
47+
ComCfg::Apid::T apid = context.get_apid();
4848
FW_ASSERT((apid >> SpacePacketSubfields::ApidWidth) == 0,
4949
static_cast<FwAssertArgType>(apid)); // apid must fit in 11 bits
5050
packetIdentification |= static_cast<U16>(apid) & static_cast<U16>(SpacePacketSubfields::ApidMask); // 11 bit APID

0 commit comments

Comments
 (0)