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 <zimri.leisher@fireflyspace.com>

* 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 cc6371d03c8f65fa130212d589812cf4ab3714fe.

* 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 <zimri.leisher@fireflyspace.com>

* 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 <49786685+thomas-bc@users.noreply.github.com>

* 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 <LeStarch@googlemail.com>

* 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 <49786685+thomas-bc@users.noreply.github.com>

* Add missing initialization to ActiveTextLogger constructor

---------

Co-authored-by: Ian Brault <ian.r.brault@jpl.nasa.gov>
Co-authored-by: Thomas Boyer-Chammard <49786685+thomas-bc@users.noreply.github.com>
Co-authored-by: M Starch <LeStarch@googlemail.com>

* 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 <49786685+thomas-bc@users.noreply.github.com>

* Update project structure in cookiecutters CI (#3991)

* Update project structure

* Fix sourcing path

* fix paths

---------

Co-authored-by: Thomas Boyer-Chammard <49786685+thomas-bc@users.noreply.github.com>

* 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 <chuynh@jpl.nasa.gov>
Co-authored-by: M Starch <LeStarch@googlemail.com>
Co-authored-by: Thomas Boyer-Chammard <49786685+thomas-bc@users.noreply.github.com>
Co-authored-by: Kevin F. Ortega <kevin.f.ortega@jpl.nasa.gov>

* 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 <zimri.leisher@fireflyspace.com>

* 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 <49786685+thomas-bc@users.noreply.github.com>

* Add SDD for ComCcsds subtopology (#4128)

* Create SDD for ComCcsds subtopology

* Update Svc/Subtopologies/ComCcsds/docs/sdd.md

Co-authored-by: Thomas Boyer-Chammard <49786685+thomas-bc@users.noreply.github.com>

* Update Svc/Subtopologies/ComCcsds/docs/sdd.md

Co-authored-by: Thomas Boyer-Chammard <49786685+thomas-bc@users.noreply.github.com>

* Update Svc/Subtopologies/ComCcsds/docs/sdd.md

Co-authored-by: Thomas Boyer-Chammard <49786685+thomas-bc@users.noreply.github.com>

* Revise CCSDS subtopology entries and limitations

Updated descriptions for CCSDS subtopologies and clarified limitations.

---------

Co-authored-by: Thomas Boyer-Chammard <49786685+thomas-bc@users.noreply.github.com>

* 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 <bocchino@icloud.com>

* Review updates

* Update links in define-state-machines.md

* sp

---------

Co-authored-by: Rob Bocchino <bocchino@icloud.com>

* 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 <49786685+thomas-bc@users.noreply.github.com>

* 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 <LeStarch@googlemail.com>

* 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 1690e51e125477d032e07fa8cd3882d6db2b8b3b.

* PRIVATE -> private

* Add friend class declaration for ActivePhaserTester

* Fix FIXMEs where possible

* Formatting

* Fix minor UT issues

* Remove (void)

---------

Co-authored-by: ZIIIKT <shaokail@jpl.nasa.gov>
Co-authored-by: M Starch <LeStarch@googlemail.com>
Co-authored-by: Michael D Starch <Michael.D.Starch@jpl.nasa.gov>

* 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 <zimri.leisher@gmail.com>
Co-authored-by: Zimri Leisher <zimri.leisher@fireflyspace.com>
Co-authored-by: M Starch <LeStarch@googlemail.com>
Co-authored-by: Rob Bocchino <bocchino@jpl.nasa.gov>
Co-authored-by: kevin-f-ortega <kevin.f.ortega@gmail.com>
Co-authored-by: Philip Romano <pjromano94@gmail.com>
Co-authored-by: Kyle Jones <kylej@jpl.nasa.gov>
Co-authored-by: Ian Brault <ian@brault.dev>
Co-authored-by: Ian Brault <ian.r.brault@jpl.nasa.gov>
Co-authored-by: chuynh4duarte <chuynh4duarte@gmail.com>
Co-authored-by: Cindy T Huynh <chuynh@jpl.nasa.gov>
Co-authored-by: Kevin F. Ortega <kevin.f.ortega@jpl.nasa.gov>
Co-authored-by: Rob Bocchino <bocchino@icloud.com>
Co-authored-by: Isaac Garibay <144189484+Isaac-G5900@users.noreply.github.com>
Co-authored-by: Shaokai (Jerry) Lin <shaokai@berkeley.edu>
Co-authored-by: ZIIIKT <shaokail@jpl.nasa.gov>
Co-authored-by: Michael D Starch <Michael.D.Starch@jpl.nasa.gov>
This commit is contained in:
Thomas Boyer-Chammard 2025-09-12 14:41:44 -07:00 committed by GitHub
parent 6190d9610b
commit ade6cc5ff3
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
26 changed files with 75 additions and 76 deletions

View File

@ -9,15 +9,15 @@
#define COMPACKET_HPP_
#include <Fw/Types/Serializable.hpp>
#include "config/APIDEnumAc.hpp"
#include "config/ApidEnumAc.hpp"
// Packet format:
// |32-bit packet type|packet type-specific data|
// | packet type (width = FwPacketDescriptorType) | packet type-specific data |
namespace Fw {
// This type is defined in config/ComCfg.fpp
using ComPacketType = ComCfg::APID::T;
using ComPacketType = ComCfg::Apid::T;
class ComPacket : public Serializable {
public:

View File

@ -276,7 +276,7 @@ def test_seqgen(fprime_test_api):
subprocess.run(
[
"fprime-seqgen",
"-d",
"--dictionary",
str(fprime_test_api.dictionaries.dictionary_path),
str(sequence),
"/tmp/ref_test_int.bin",

View File

@ -21,7 +21,7 @@ ApidManager ::ApidManager(const char* const compName) : ApidManagerComponentBase
// Handler implementations for typed input ports
// ----------------------------------------------------------------------
U16 ApidManager ::validateApidSeqCountIn_handler(FwIndexType portNum, const ComCfg::APID& apid, U16 receivedSeqCount) {
U16 ApidManager ::validateApidSeqCountIn_handler(FwIndexType portNum, const ComCfg::Apid& apid, U16 receivedSeqCount) {
U16 expectedSequenceCount = this->getAndIncrementSeqCount(apid);
if (receivedSeqCount != expectedSequenceCount && receivedSeqCount != SEQUENCE_COUNT_ERROR) {
// Likely a packet was dropped or out of order
@ -32,7 +32,7 @@ U16 ApidManager ::validateApidSeqCountIn_handler(FwIndexType portNum, const ComC
return receivedSeqCount;
}
U16 ApidManager ::getApidSeqCountIn_handler(FwIndexType portNum, const ComCfg::APID& apid, U16 unused) {
U16 ApidManager ::getApidSeqCountIn_handler(FwIndexType portNum, const ComCfg::Apid& apid, U16 unused) {
return this->getAndIncrementSeqCount(apid);
}
@ -40,7 +40,7 @@ U16 ApidManager ::getApidSeqCountIn_handler(FwIndexType portNum, const ComCfg::A
// Helpers
// ----------------------------------------------------------------------
U16 ApidManager ::getAndIncrementSeqCount(ComCfg::APID::T apid) {
U16 ApidManager ::getAndIncrementSeqCount(ComCfg::Apid::T apid) {
U16 seqCount = SEQUENCE_COUNT_ERROR; // Default to error value
// Search the APID in the sequence table
for (U16 i = 0; i < MAX_TRACKED_APIDS; i++) {
@ -54,7 +54,7 @@ U16 ApidManager ::getAndIncrementSeqCount(ComCfg::APID::T apid) {
}
// If not found, search for an uninitialized entry to track this APID
for (U16 i = 0; i < MAX_TRACKED_APIDS; i++) {
if (this->m_apidSequences[i].apid == ComCfg::APID::INVALID_UNINITIALIZED) {
if (this->m_apidSequences[i].apid == ComCfg::Apid::INVALID_UNINITIALIZED) {
this->m_apidSequences[i].apid = apid; // Initialize this entry with the new APID
seqCount = this->m_apidSequences[i].sequenceCount; // Entries default to 0 unless otherwise specified
// Increment entry for next call
@ -67,7 +67,7 @@ U16 ApidManager ::getAndIncrementSeqCount(ComCfg::APID::T apid) {
return SEQUENCE_COUNT_ERROR;
}
void ApidManager::setNextSeqCount(ComCfg::APID::T apid, U16 seqCount) {
void ApidManager::setNextSeqCount(ComCfg::Apid::T apid, U16 seqCount) {
for (U16 i = 0; i < MAX_TRACKED_APIDS; i++) {
if (this->m_apidSequences[i].apid == apid) {
this->m_apidSequences[i].sequenceCount = seqCount;

View File

@ -14,28 +14,28 @@ namespace Svc {
namespace Ccsds {
static_assert(ComCfg::APID::SPP_IDLE_PACKET == 0x07FF,
static_assert(ComCfg::Apid::SPP_IDLE_PACKET == 0x07FF,
"SPP_IDLE_PACKET must exist and equal 0x07FF (as specified by standard)");
static_assert(ComCfg::APID::INVALID_UNINITIALIZED == 0x0800,
static_assert(ComCfg::Apid::INVALID_UNINITIALIZED == 0x0800,
"Invalid APID must be 0x0800 (11 bits values allow 0-2047)");
static_assert(ComCfg::APID::FW_PACKET_COMMAND == Fw::ComPacketType::FW_PACKET_COMMAND,
static_assert(ComCfg::Apid::FW_PACKET_COMMAND == Fw::ComPacketType::FW_PACKET_COMMAND,
"APID FW_PACKET_COMMAND must exist, used by the Framework");
static_assert(ComCfg::APID::FW_PACKET_TELEM == Fw::ComPacketType::FW_PACKET_TELEM,
static_assert(ComCfg::Apid::FW_PACKET_TELEM == Fw::ComPacketType::FW_PACKET_TELEM,
"APID FW_PACKET_TELEM must exist, used by the Framework");
static_assert(ComCfg::APID::FW_PACKET_LOG == Fw::ComPacketType::FW_PACKET_LOG,
static_assert(ComCfg::Apid::FW_PACKET_LOG == Fw::ComPacketType::FW_PACKET_LOG,
"APID FW_PACKET_LOG must exist, used by the Framework");
static_assert(ComCfg::APID::FW_PACKET_FILE == Fw::ComPacketType::FW_PACKET_FILE,
static_assert(ComCfg::Apid::FW_PACKET_FILE == Fw::ComPacketType::FW_PACKET_FILE,
"APID FW_PACKET_FILE must exist, used by the Framework");
static_assert(ComCfg::APID::FW_PACKET_PACKETIZED_TLM == Fw::ComPacketType::FW_PACKET_PACKETIZED_TLM,
static_assert(ComCfg::Apid::FW_PACKET_PACKETIZED_TLM == Fw::ComPacketType::FW_PACKET_PACKETIZED_TLM,
"APID FW_PACKET_PACKETIZED_TLM must exist, used by the Framework");
static_assert(ComCfg::APID::FW_PACKET_UNKNOWN == Fw::ComPacketType::FW_PACKET_UNKNOWN,
static_assert(ComCfg::Apid::FW_PACKET_UNKNOWN == Fw::ComPacketType::FW_PACKET_UNKNOWN,
"APID FW_PACKET_UNKNOWN must exist, used by the Framework");
class ApidManager final : public ApidManagerComponentBase {
friend class ApidManagerTester; //!< Friend class for testing
public:
static constexpr U16 MAX_TRACKED_APIDS = ComCfg::APID::NUM_CONSTANTS;
static constexpr U16 MAX_TRACKED_APIDS = ComCfg::Apid::NUM_CONSTANTS;
static constexpr U16 SEQUENCE_COUNT_ERROR = std::numeric_limits<U16>::max();
// ----------------------------------------------------------------------
// Component construction and destruction
@ -55,12 +55,12 @@ class ApidManager final : public ApidManagerComponentBase {
//! Handler implementation for validateApidSeqCountIn
U16 validateApidSeqCountIn_handler(FwIndexType portNum, //!< The port number
const ComCfg::APID& apid,
const ComCfg::Apid& apid,
U16 seqCount) override;
//! Handler implementation for validateApidSeqCountIn
U16 getApidSeqCountIn_handler(FwIndexType portNum, //!< The port number
const ComCfg::APID& apid,
const ComCfg::Apid& apid,
U16 seqCount) override;
private:
@ -69,15 +69,15 @@ class ApidManager final : public ApidManagerComponentBase {
// ----------------------------------------------------------------------
//! Get the sequence count for a given APID and increment it for the next
//! Wraps around at 14 bits
U16 getAndIncrementSeqCount(ComCfg::APID::T apid);
U16 getAndIncrementSeqCount(ComCfg::Apid::T apid);
//! Set the next expected sequence count for a given APID
void setNextSeqCount(ComCfg::APID::T apid, U16 seqCount);
void setNextSeqCount(ComCfg::Apid::T apid, U16 seqCount);
//! This struct helps track sequence counts per APID
//! Future work: update to using a map from Fw/DataStructures when available
struct ApidSequenceEntry {
ComCfg::APID::T apid = ComCfg::APID::INVALID_UNINITIALIZED;
ComCfg::Apid::T apid = ComCfg::Apid::INVALID_UNINITIALIZED;
U16 sequenceCount = 0;
};

View File

@ -12,9 +12,9 @@ namespace Svc {
namespace Ccsds {
static constexpr ComCfg::APID::T TEST_REGISTERED_APIDS[] = {ComCfg::APID::FW_PACKET_COMMAND,
ComCfg::APID::FW_PACKET_TELEM, ComCfg::APID::FW_PACKET_LOG,
ComCfg::APID::FW_PACKET_FILE};
static constexpr ComCfg::Apid::T TEST_REGISTERED_APIDS[] = {ComCfg::Apid::FW_PACKET_COMMAND,
ComCfg::Apid::FW_PACKET_TELEM, ComCfg::Apid::FW_PACKET_LOG,
ComCfg::Apid::FW_PACKET_FILE};
// ----------------------------------------------------------------------
// Construction and destruction
@ -43,7 +43,7 @@ bool ApidManagerTester::GetExistingSeqCount::precondition(const ApidManagerTeste
void ApidManagerTester::GetExistingSeqCount::action(ApidManagerTester& testerState) {
testerState.clearHistory();
ComCfg::APID::T apid = testerState.shadow_getRandomTrackedApid();
ComCfg::Apid::T apid = testerState.shadow_getRandomTrackedApid();
U16 seqCount = testerState.invoke_to_getApidSeqCountIn(0, apid, 0);
U16 shadowSeqCount = testerState.shadow_getAndIncrementSeqCount(apid);
ASSERT_EQ(seqCount, shadowSeqCount) << "Sequence count for APID " << static_cast<U16>(apid)
@ -65,7 +65,7 @@ void ApidManagerTester::GetNewSeqCountOk::action(ApidManagerTester& testerState)
return; // Cannot get new sequence count if table is full - skip action
}
ComCfg::APID::T apid = testerState.shadow_getRandomUntrackedApid();
ComCfg::Apid::T apid = testerState.shadow_getRandomUntrackedApid();
U16 seqCount = testerState.invoke_to_getApidSeqCountIn(0, apid, 0);
U16 shadowSeqCount = testerState.shadow_getAndIncrementSeqCount(apid);
ASSERT_EQ(seqCount, shadowSeqCount) << "Sequence count for APID " << static_cast<U16>(apid)
@ -79,7 +79,7 @@ bool ApidManagerTester::GetNewSeqCountTableFull::precondition(const ApidManagerT
void ApidManagerTester::GetNewSeqCountTableFull::action(ApidManagerTester& testerState) {
testerState.clearHistory();
ComCfg::APID::T apid = testerState.shadow_getRandomUntrackedApid();
ComCfg::Apid::T apid = testerState.shadow_getRandomUntrackedApid();
U16 seqCount = testerState.invoke_to_getApidSeqCountIn(0, apid, 0);
// Use local constexpr to potentially avoid ODR-use of ApidManager::SEQUENCE_COUNT_ERROR
constexpr U16 sequenceCountErrorVal = ApidManager::SEQUENCE_COUNT_ERROR;
@ -95,7 +95,7 @@ bool ApidManagerTester::ValidateSeqCountOk::precondition(const ApidManagerTester
void ApidManagerTester::ValidateSeqCountOk::action(ApidManagerTester& testerState) {
testerState.clearHistory();
ComCfg::APID::T apid = testerState.shadow_getRandomTrackedApid();
ComCfg::Apid::T apid = testerState.shadow_getRandomTrackedApid();
U16 shadow_expectedSeqCount = testerState.shadow_seqCounts[apid];
testerState.invoke_to_validateApidSeqCountIn(0, apid, shadow_expectedSeqCount);
testerState.shadow_validateApidSeqCount(apid, shadow_expectedSeqCount); // keep shadow state in sync
@ -109,7 +109,7 @@ bool ApidManagerTester::ValidateSeqCountFailure::precondition(const ApidManagerT
void ApidManagerTester::ValidateSeqCountFailure::action(ApidManagerTester& testerState) {
testerState.clearHistory();
ComCfg::APID::T apid = testerState.shadow_getRandomTrackedApid();
ComCfg::Apid::T apid = testerState.shadow_getRandomTrackedApid();
U16 shadow_expectedSeqCount = testerState.shadow_seqCounts.at(apid);
U16 invalidSeqCount = static_cast<U16>(
(shadow_expectedSeqCount + 1) %
@ -128,7 +128,7 @@ void ApidManagerTester::ValidateSeqCountFailure::action(ApidManagerTester& teste
// Helpers
// ----------------------------------------------------------------------
U16 ApidManagerTester::shadow_getAndIncrementSeqCount(ComCfg::APID::T apid) {
U16 ApidManagerTester::shadow_getAndIncrementSeqCount(ComCfg::Apid::T apid) {
// This is a shadow function to simulate the getAndIncrementSeqCount behavior
// without modifying the actual component state.
auto found = this->shadow_seqCounts.find(apid);
@ -147,7 +147,7 @@ U16 ApidManagerTester::shadow_getAndIncrementSeqCount(ComCfg::APID::T apid) {
return this->component.SEQUENCE_COUNT_ERROR; // Return error if APID not found
}
void ApidManagerTester::shadow_validateApidSeqCount(ComCfg::APID::T apid, U16 expectedSeqCount) {
void ApidManagerTester::shadow_validateApidSeqCount(ComCfg::Apid::T apid, U16 expectedSeqCount) {
// This simply updates the shadow state to the next expected sequence count
auto found = this->shadow_seqCounts.find(apid);
if (found != this->shadow_seqCounts.end()) {
@ -155,19 +155,19 @@ void ApidManagerTester::shadow_validateApidSeqCount(ComCfg::APID::T apid, U16 ex
}
}
ComCfg::APID::T ApidManagerTester::shadow_getRandomTrackedApid() {
ComCfg::Apid::T ApidManagerTester::shadow_getRandomTrackedApid() {
// Select a random APID from the sequence counts map
U32 mapSize = static_cast<U32>(this->shadow_seqCounts.size());
U32 randomIndex = STest::Random::lowerUpper(0, mapSize - 1);
ComCfg::APID apid = std::next(this->shadow_seqCounts.begin(), randomIndex)->first;
ComCfg::Apid apid = std::next(this->shadow_seqCounts.begin(), randomIndex)->first;
return apid;
}
ComCfg::APID::T ApidManagerTester::shadow_getRandomUntrackedApid() {
ComCfg::Apid::T ApidManagerTester::shadow_getRandomUntrackedApid() {
// Select a random APID that is not currently tracked
ComCfg::APID::T apid;
ComCfg::Apid::T apid;
do {
apid = static_cast<ComCfg::APID::T>(STest::Random::lowerUpper(10, ComCfg::APID::SPP_IDLE_PACKET));
apid = static_cast<ComCfg::Apid::T>(STest::Random::lowerUpper(10, ComCfg::Apid::SPP_IDLE_PACKET));
} while (this->shadow_seqCounts.find(apid) != this->shadow_seqCounts.end());
return apid;
}

View File

@ -59,20 +59,20 @@ class ApidManagerTester : public ApidManagerGTestBase {
ApidManager component;
// Shadow test state
std::map<ComCfg::APID::T, U16> shadow_seqCounts; //!< Map to hold expected sequence counts for APIDs
std::map<ComCfg::Apid::T, U16> shadow_seqCounts; //!< Map to hold expected sequence counts for APIDs
bool shadow_isTableFull = false;
// ----------------------------------------------------------------------
// Helpers for tracking the shadow test state
// ----------------------------------------------------------------------
U16 shadow_getAndIncrementSeqCount(ComCfg::APID::T apid);
U16 shadow_getAndIncrementSeqCount(ComCfg::Apid::T apid);
void shadow_validateApidSeqCount(ComCfg::APID::T apid, U16 expectedSeqCount);
void shadow_validateApidSeqCount(ComCfg::Apid::T apid, U16 expectedSeqCount);
ComCfg::APID::T shadow_getRandomTrackedApid();
ComCfg::Apid::T shadow_getRandomTrackedApid();
ComCfg::APID::T shadow_getRandomUntrackedApid();
ComCfg::Apid::T shadow_getRandomUntrackedApid();
// ----------------------------------------------------------------------
// Tests: Rule Based Testing

View File

@ -2,7 +2,7 @@ module Svc {
module Ccsds {
@ Port for requesting a sequence count for a given APID
port ApidSequenceCount (apid: ComCfg.APID, sequenceCount: U16) -> U16
port ApidSequenceCount (apid: ComCfg.Apid, sequenceCount: U16) -> U16
}
}

View File

@ -57,7 +57,7 @@ void SpacePacketDeframer ::dataIn_handler(FwIndexType portNum, Fw::Buffer& data,
}
U16 apidValue = header.get_packetIdentification() & SpacePacketSubfields::ApidMask;
ComCfg::APID::T apid = static_cast<ComCfg::APID::T>(apidValue);
ComCfg::Apid::T apid = static_cast<ComCfg::Apid::T>(apidValue);
ComCfg::FrameContext contextCopy = context;
contextCopy.set_apid(apid);

View File

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

View File

@ -44,7 +44,7 @@ void SpacePacketFramer ::dataIn_handler(FwIndexType portNum, Fw::Buffer& data, c
// PVN is always 0 per Standard - Packet Type is 0 for Telemetry (downlink) - SecHdr flag is 0 for no secondary
// header
U16 packetIdentification = 0;
ComCfg::APID::T apid = context.get_apid();
ComCfg::Apid::T apid = context.get_apid();
FW_ASSERT((apid >> SpacePacketSubfields::ApidWidth) == 0,
static_cast<FwAssertArgType>(apid)); // apid must fit in 11 bits
packetIdentification |= static_cast<U16>(apid) & static_cast<U16>(SpacePacketSubfields::ApidMask); // 11 bit APID

View File

@ -8,7 +8,7 @@
#define Svc_Ccsds_SpacePacketFramer_HPP
#include "Svc/Ccsds/SpacePacketFramer/SpacePacketFramerComponentAc.hpp"
#include "config/APIDEnumAc.hpp"
#include "config/ApidEnumAc.hpp"
namespace Svc {

View File

@ -59,7 +59,7 @@ void SpacePacketFramerTester::testNominalFraming() {
payload[i] = static_cast<U8>(STest::Random::lowerUpper(0, 0xFF));
}
Fw::Buffer data(payload, sizeof(payload));
ComCfg::APID::T apid = static_cast<ComCfg::APID::T>(STest::Random::lowerUpper(0, 0x7FF)); // random 11 bit APID
ComCfg::Apid::T apid = static_cast<ComCfg::Apid::T>(STest::Random::lowerUpper(0, 0x7FF)); // random 11 bit APID
U16 seqCount = static_cast<U8>(STest::Random::lowerUpper(0, 0x3FFF)); // random 14 bit sequence count
ComCfg::FrameContext context;
context.set_apid(apid);
@ -86,7 +86,7 @@ void SpacePacketFramerTester::testNominalFraming() {
// ----------------------------------------------------------------------
U16 SpacePacketFramerTester ::from_getApidSeqCount_handler(FwIndexType portNum,
const ComCfg::APID& apid,
const ComCfg::Apid& apid,
U16 sequenceCount) {
return this->m_nextSeqCount;
}

View File

@ -62,7 +62,7 @@ class SpacePacketFramerTester final : public SpacePacketFramerGTestBase {
// Test Harness: output port overrides
// ----------------------------------------------------------------------
U16 from_getApidSeqCount_handler(FwIndexType portNum, //!< The port number
const ComCfg::APID& apid,
const ComCfg::Apid& apid,
U16 sequenceCount) override;
Fw::Buffer from_bufferAllocate_handler(FwIndexType portNum, FwSizeType size) override;

View File

@ -107,7 +107,7 @@ void TmFramer ::dataReturnIn_handler(FwIndexType portNum,
void TmFramer ::fill_with_idle_packet(Fw::SerializeBufferBase& serializer) {
constexpr U16 endIndex = ComCfg::TmFrameFixedSize - TMTrailer::SERIALIZED_SIZE;
constexpr U16 idleApid = static_cast<U16>(ComCfg::APID::SPP_IDLE_PACKET);
constexpr U16 idleApid = static_cast<U16>(ComCfg::Apid::SPP_IDLE_PACKET);
const U16 startIndex = static_cast<U16>(serializer.getBuffLength());
const U16 idlePacketSize = static_cast<U16>(endIndex - startIndex);
// Length token is defined as the number of bytes of payload data minus 1

View File

@ -648,7 +648,9 @@ void CommandDispatcherTester::runInvalidCommand() {
FwOpcodeType testOpCode = 0x50;
this->clearEvents();
Fw::ComBuffer buff;
ASSERT_EQ(buff.serializeFrom(static_cast<FwOpcodeType>(100)), Fw::FW_SERIALIZE_OK);
// Serialize a log packet type instead of command packet type to cause flawed command
ASSERT_EQ(buff.serializeFrom(static_cast<FwPacketDescriptorType>(Fw::ComPacketType::FW_PACKET_LOG)),
Fw::FW_SERIALIZE_OK);
ASSERT_EQ(buff.serializeFrom(testOpCode), Fw::FW_SERIALIZE_OK);
ASSERT_EQ(buff.serializeFrom(testCmdArg), Fw::FW_SERIALIZE_OK);

View File

@ -139,7 +139,7 @@ def test_seqgen(fprime_test_api):
subprocess.run(
[
"fprime-seqgen",
"-d",
"--dictionary",
str(fprime_test_api.pipeline.dictionary_path),
str(sequence),
"ref_test_seq.bin",

View File

@ -257,7 +257,7 @@ void ComQueue::sendComBuffer(Fw::ComBuffer& comBuffer, FwIndexType queueIndex) {
FwPacketDescriptorType descriptor;
Fw::SerializeStatus status = comBuffer.deserializeTo(descriptor);
FW_ASSERT(status == Fw::FW_SERIALIZE_OK, static_cast<FwAssertArgType>(status));
context.set_apid(static_cast<ComCfg::APID::T>(descriptor));
context.set_apid(static_cast<ComCfg::Apid::T>(descriptor));
context.set_comQueueIndex(queueIndex);
this->dataOut_out(0, outBuffer, context);
@ -274,7 +274,7 @@ void ComQueue::sendBuffer(Fw::Buffer& buffer, FwIndexType queueIndex) {
FwPacketDescriptorType descriptor;
Fw::SerializeStatus status = buffer.getDeserializer().deserializeTo(descriptor);
FW_ASSERT(status == Fw::FW_SERIALIZE_OK, static_cast<FwAssertArgType>(status));
context.set_apid(static_cast<ComCfg::APID::T>(descriptor));
context.set_apid(static_cast<ComCfg::Apid::T>(descriptor));
context.set_comQueueIndex(queueIndex);
this->dataOut_out(0, buffer, context);

View File

@ -65,8 +65,8 @@ void FprimeDeframer ::dataIn_handler(FwIndexType portNum, Fw::Buffer& data, cons
FW_ASSERT(status == Fw::SerializeStatus::FW_SERIALIZE_OK, status);
ComCfg::FrameContext contextCopy = context;
// If a valid descriptor is deserialized, set it in the context
if (packetDescriptor < ComCfg::APID::INVALID_UNINITIALIZED) {
contextCopy.set_apid(static_cast<ComCfg::APID::T>(packetDescriptor));
if (packetDescriptor < ComCfg::Apid::INVALID_UNINITIALIZED) {
contextCopy.set_apid(static_cast<ComCfg::Apid::T>(packetDescriptor));
}
// ---------------- Validate Frame Trailer ----------------

View File

@ -40,16 +40,15 @@ void FprimeDeframerTester ::testNominalFrame() {
// Assert that the data that was emitted on dataOut is equal to Data field above (randomByte)
ASSERT_EQ(this->fromPortHistory_dataOut->at(0).data.getData()[0], randomByte);
// Not enough data to read a valid APID -> should default to FW_PACKET_UNKNOWN
ASSERT_EQ(this->fromPortHistory_dataOut->at(0).context.get_apid(), ComCfg::APID::FW_PACKET_UNKNOWN);
ASSERT_EQ(this->fromPortHistory_dataOut->at(0).context.get_apid(), ComCfg::Apid::FW_PACKET_UNKNOWN);
ASSERT_EVENTS_SIZE(0); // no events emitted
}
void FprimeDeframerTester ::testNominalFrameApid() {
// Get random byte of data which represents the APID (PacketDescriptor)
U8 randomByte = static_cast<U8>(STest::Random::lowerUpper(0, 255));
// | F´ start word | Length (= 4) | PacketDescriptor (APID) | Checksum (4 bytes) |
U8 data[16] = {0xDE, 0xAD, 0xBE, 0xEF, 0x00, 0x00, 0x00, 0x04,
0x00, 0x00, 0x00, randomByte, 0x00, 0x00, 0x00, 0x00};
// | F´ start word | Length (= 2) | Data (APID) | Checksum (4 bytes) |
U8 data[14] = {0xDE, 0xAD, 0xBE, 0xEF, 0x00, 0x00, 0x00, 0x02, 0x00, randomByte, 0x00, 0x00, 0x00, 0x00};
// Inject the checksum into the data and send it to the component under test
this->injectChecksum(data, sizeof(data));
this->mockReceiveData(data, sizeof(data));

View File

@ -8,7 +8,7 @@
#include "Fw/Com/ComPacket.hpp"
#include "Fw/FPrimeBasicTypes.hpp"
#include "Fw/Logger/Logger.hpp"
#include "config/APIDEnumAc.hpp"
#include "config/ApidEnumAc.hpp"
namespace Svc {

View File

@ -90,7 +90,7 @@ void FprimeRouterTester::mockReceivePacketType(Fw::ComPacketType packetType) {
U8 data[sizeof descriptorType];
Fw::Buffer buffer(data, sizeof(data));
ComCfg::FrameContext context;
context.set_apid(static_cast<ComCfg::APID::T>(descriptorType));
context.set_apid(static_cast<ComCfg::Apid::T>(descriptorType));
this->invoke_to_dataIn(0, buffer, context);
}

View File

@ -201,7 +201,8 @@ TEST_F(FpySequencerTester, cmd) {
ASSERT_EQ(result, Signal::stmtResponse_keepWaiting);
Fw::ComBuffer expected;
ASSERT_EQ(expected.serialize(Fw::ComPacketType::FW_PACKET_COMMAND), Fw::SerializeStatus::FW_SERIALIZE_OK);
ASSERT_EQ(expected.serialize(static_cast<FwPacketDescriptorType>(Fw::ComPacketType::FW_PACKET_COMMAND)),
Fw::SerializeStatus::FW_SERIALIZE_OK);
ASSERT_EQ(expected.serialize(directive.get_opCode()), Fw::SerializeStatus::FW_SERIALIZE_OK);
ASSERT_EQ(expected.serialize(data, sizeof(data), Fw::Serialization::OMIT_LENGTH),
Fw::SerializeStatus::FW_SERIALIZE_OK);

View File

@ -67,9 +67,6 @@ type FwEventIdType = FwIdType
@ The type of a command opcode
type FwOpcodeType = FwIdType
@ The type of a com packet descriptor
type FwPacketDescriptorType = FwIdType
@ The type of a parameter identifier
type FwPrmIdType = FwIdType

View File

@ -6,6 +6,9 @@
# defined
# ======================================================================
@ The width of packet descriptors when they are serialized by the framework
type FwPacketDescriptorType = U16
module ComCfg {
# Needed in dictionary:
@ -16,7 +19,7 @@ module ComCfg {
constant TmFrameFixedSize = 1024 # Needs to be at least COM_BUFFER_MAX_SIZE + (2 * SpacePacketHeaderSize) + 1
@ APIDs are 11 bits in the Space Packet protocol, so we use U16. Max value 7FF
enum APID : U16 {
enum Apid : FwPacketDescriptorType {
# APIDs prefixed with FW are reserved for F Prime and need to be present
# in the enumeration. Their values can be changed
FW_PACKET_COMMAND = 0x0000 @< Command packet type - incoming
@ -35,12 +38,12 @@ module ComCfg {
@ Type used to pass context info between components during framing/deframing
struct FrameContext {
comQueueIndex: FwIndexType @< Queue Index used by the ComQueue, other components shall not modify
apid: APID @< 11 bits APID in CCSDS
apid: Apid @< 11 bits APID in CCSDS
sequenceCount: U16 @< 14 bit Sequence count - sequence count is incremented per APID
vcId: U8 @< 6 bit Virtual Channel ID - used for TC and TM
} default {
comQueueIndex = 0
apid = APID.FW_PACKET_UNKNOWN
apid = Apid.FW_PACKET_UNKNOWN
sequenceCount = 0
vcId = 1
}

View File

@ -64,9 +64,6 @@ type FwEventIdType = FwIdType
@ The type of a command opcode
type FwOpcodeType = FwIdType
@ The type of a com packet descriptor
type FwPacketDescriptorType = FwIdType
@ The type of a parameter identifier
type FwPrmIdType = FwIdType

View File

@ -21,7 +21,7 @@ Flask-RESTful==0.3.10
fprime-fpl-layout==1.0.3
fprime-fpl-write-pic==1.0.3
fprime-fpp==3.0.1a1
fprime-gds==4.0.2a4
fprime-gds==4.0.2a6
fprime-tools==4.0.2a1
fprime-visual==1.0.2
gcovr==8.2