Compare commits

...

154 Commits

Author SHA1 Message Date
dependabot[bot]
94b4457154
Bump urllib3 from 2.5.0 to 2.6.0 (#4528)
Bumps [urllib3](https://github.com/urllib3/urllib3) from 2.5.0 to 2.6.0.
- [Release notes](https://github.com/urllib3/urllib3/releases)
- [Changelog](https://github.com/urllib3/urllib3/blob/main/CHANGES.rst)
- [Commits](https://github.com/urllib3/urllib3/compare/2.5.0...2.6.0)

---
updated-dependencies:
- dependency-name: urllib3
  dependency-version: 2.6.0
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-12-09 14:09:27 -08:00
budhe888
1f860de821
Added missing undef for m_len in VxWorks collision fix (#4520)
Co-authored-by: Adit Sahasrabudhe <adit.sahasrabudhe@jpl.nasa.gov>
Co-authored-by: kevin-f-ortega <kevin.f.ortega@gmail.com>
2025-12-09 08:56:49 -08:00
Thomas Boyer-Chammard
f3b191beff
Address student review of Device Driver docs (#4509)
* First pass at addressing student review

* nits and pieces
2025-12-05 14:12:11 -08:00
Thomas Boyer-Chammard
59e1baa9d8
Add website navigability updates (#4504)
* Add minor website navigability updates

* Add navigation hint to User manual landing page

* add an arrow

* spelling
2025-12-05 14:08:24 -08:00
kevin-f-ortega
43de02bafd
Update docs for AssertHook (#4505) 2025-12-04 10:53:07 -08:00
Thomas Boyer-Chammard
6c80056596
Bump requirements.txt ahead of v4.1.0 release (#4488)
* Bump requirements.txt for v4.1.0 release

* Update GDS pointer to v4.1.0
2025-12-03 12:17:44 -08:00
M Starch
a8fe137283
Fix FPrimeRouter potential usage of invalid buffer (#4493)
* Fix #4491

* Formatting and enum size
2025-12-03 12:17:00 -08:00
Rob Bocchino
3a293cd705
FPP v3.1.0 (#4483)
* Update FPP version

* Update fpp version
2025-12-02 17:57:14 -08:00
mshahabn
e0afd3c3fb
Add missing implementation of GenericHub (#4420)
* Revise GenericHub model

* Revise GenericHub model

* Revise GenericHub model

* Update spelling

* Revise annotations

* Revise annotations for GenericHub model

* Revise annotations in GenericHub model

* Revise GenericHub model

* Revise GenericHub model

* Revise GenericHub model

* Revise GenericHub

* Revise GenericHub

* Revise GenericHub model

* Revise GenericHub model

* Revise GenericHub config

* Revise GenericHub model

* Revise GenericHub model

* Clean up naming in GenericHub implementation

* Revise GenericHub port names

* Revise annotations in GenericHub model

* Revise annotations in GenericHub model

* Revise annotations in GenericHub model

* Add ByteStreamDriverClient

* Revise ByteStreamDriverClient

* Revise ByteStreamDriverClient

* Revise driver interfaces

* Add PassiveByteStreamDriverClientSendAsync interface

* Add PassiveAsyncByteStreamDriverClient interface

* Add PassiveBufferDriver

* Revise PassiveByteStreamDriverClient interfaces

* Revise PassiveBufferDriver

* Revise Drv interfaces

* Revise PassiveBufferDriver

* Add PassiveBufferDriverClient

* Revise GenericHub model

Use interfaces from Drv

* Revise annotations in GenericHub model

* Revise FPP models

Point FPP to a non-released version with a bug fix

* Add ByteStreamBufferAdapter

* Revise ByteStreamBufferAdapter model

* Revise ByteStreamBufferAdapter

* Revise ByteStreamBufferAdapter

* Add AsyncByteStreamBufferAdapter

* Revise AsyncByteStreamBufferAdapter

* Revsie AsyncByteStreamBufferAdapter

* Revise AsyncByteStreamBufferAdapter

* Revise annotations in FPP model

* Revise ByteStreamBufferAdapter

* Bump fpp version

* Revise GenericHub model

* Revise GenericHub interface

* Revise GenericHub interface

* Fix typo in FPP annotations

* Revise Generic Hub model

* Fix spelling and formatting

* Review recommendations

---------

Co-authored-by: Rob Bocchino <bocchino@jpl.nasa.gov>
Co-authored-by: thomas-bc <thomas.boyerchammard@gmail.com>
2025-12-02 17:56:34 -08:00
M Starch
cddf38bb6f
Make Os::Queues use Fw::MemAllocator pattern for memory (#4451)
* Queues use MemAllocator pattern

* Derive queue allocation from MallocRegistry

* Formatting

* Fix UTs

* Fix CI

* Fix alignment in UT

* Formatting and sp

* Formatting, bad header

* More formatting

* Add queue teardown

* Deinit components

* Fix priority queue test

* Fix bug in priority queue allocation

* Correct comments

* Fix FppTest and Ref UTs

* Fix max heap teardown

* Fix review comment on max heap

* Fix null -> nullptr
2025-12-02 17:36:15 -08:00
dependabot[bot]
89a9e3247b
Bump werkzeug from 3.0.6 to 3.1.4 (#4480)
Bumps [werkzeug](https://github.com/pallets/werkzeug) from 3.0.6 to 3.1.4.
- [Release notes](https://github.com/pallets/werkzeug/releases)
- [Changelog](https://github.com/pallets/werkzeug/blob/main/CHANGES.rst)
- [Commits](https://github.com/pallets/werkzeug/compare/3.0.6...3.1.4)

---
updated-dependencies:
- dependency-name: werkzeug
  dependency-version: 3.1.4
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-12-02 14:27:49 -08:00
bevinduckett
a9e05045da
Add missing cstring includes (#4486)
* Modified the fprime-fpp version for fpp branch

* Fixes for missing includes

* Removed include from Fw/FPrimeBasicTypes.hpp and modified fprime-fpp version

* Fixed files that failed to include cstring header

* Changed string.h to cstring in BufferRepeater.cpp

* Updated formatting in ActivePhaser.cpp & BufferManagerComponentImpl.cpp

* Fixed formatting in FpySequencerStack.cpp & FpySequencerDirectives.cpp
2025-12-02 14:27:10 -08:00
djbyrne17
9fbf5800ab
Update Spi component to return a status on device access (#4452)
* Update Spi component to return a status on device access

* Format LinuxSpiDriver files and update comments from TODO to DEPRECATED

* Add assertions to LinuxSpiDriver

* Add assertions to LinuxSpiDriver

---------

Co-authored-by: djbyrne <djbyrne@jpl.nasa.gov>
2025-12-02 10:42:06 -08:00
M Starch
08f43279da
Fix improper file dependencies in the build (#4479) 2025-12-02 10:27:49 -08:00
Will MacCormack
e8c3fea70c
Add one more ifdef to allow POSIX_THREAD_ENABLE_NAMES off to compile (#4482) 2025-12-02 10:23:41 -08:00
Will MacCormack
b9a7059667
Set the Name of Fprime Tasks on Linux (#4428)
* Set the Name of Fprime Tasks on Linux

* prefix thread name w/ process name

* Revert "prefix thread name w/ process name"

This reverts commit 5867602f135c69022469c985b6de13458686e6a2.

* Add `setname` to spelling expected list

* Format My Changes

* Add in opt-out configuration

* Enable POSIX_THREADS_ENABLE_NAMES and fix ut

* Remove warning when flag set off

* UT thread names

* Add tmate session setup to build workflow

* Disable thread names on Ip UTs

* Use random thread ids in UTs

* Fix race condition

* Fix improper string set

---------

Co-authored-by: M Starch <LeStarch@googlemail.com>
Co-authored-by: Michael D Starch <Michael.D.Starch@jpl.nasa.gov>
2025-12-01 10:15:35 -08:00
Rob Bocchino
aed0837c9c
Merge FPP v3.1.0a12 (#4474)
* Bump fpp version to v3.1.0a11

* Update FPP version to v3.1.0a12
2025-11-24 10:07:44 -08:00
M Starch
f5902583ce
Add component send only test (configSend, open) (#4465)
* Add component send only (configSend, open) test

* Formatting
2025-11-20 17:08:21 -08:00
Thomas Boyer-Chammard
5baf4076ab
Add best practice to CONTRIBUTING.md (#4464)
* Add best practice to CONTRIBUTING.md

* mention clang-tidy optional

* Add code formatting command
2025-11-20 11:11:29 -08:00
kevin-f-ortega
ba95054a24
missing more comments (#4463) 2025-11-20 08:20:17 -08:00
kevin-f-ortega
081a2f8654
Add missing argument description to Os::RawTime (#4461) 2025-11-19 16:22:25 -08:00
djbyrne17
027b658208
Update UT guidelines in Contributing guide (#4421)
* Add clang-tidy to requirement.txt, and update Unit Test guideline

* Leave out of requirements until rPI is supported or avoided

* Fix spelling of macOS

---------

Co-authored-by: djbyrne <djbyrne@jpl.nasa.gov>
2025-11-19 15:31:50 -08:00
Thomas Boyer-Chammard
6d756f7431
Specify dictionary types as required by GDS (#4442)
* Specify dictionary types as required by GDS

* Update requirements.txt for fprime-tools

* Update documentation referencing type
2025-11-19 12:13:28 -08:00
M Starch
8cbba542fc
Make fpp-to-json opt-in by default (#4449) 2025-11-19 12:02:15 -08:00
Will MacCormack
31b6488723
Print the task name when socket open/recv fails (#4434)
* Log task name of socket that failed to open port

* Give failed to recv the same treatment

* Format my changes
2025-11-18 16:56:22 -08:00
M Starch
62dd7445db
Restrict core C and DH when turning off text loggers (#4438) 2025-11-18 16:56:11 -08:00
M Starch
afb6f13853
Add convienence functions to MemoryAllocator (#4439)
* Add convienence functions to MemoryAllocator

* Fix comments
2025-11-18 16:55:57 -08:00
kevin-f-ortega
6388f046e1
Add undef to fix VxWorks collision problem (#4424)
* adding undef to fix collission problem.

* Fix comment typo in UdpSocket.hpp
2025-11-18 10:05:11 -08:00
Joseph Perez
6a132c5df4
Remove redundant line from ActiveRateGroup SDD (#4435) 2025-11-18 10:02:15 -08:00
Tristan
317ba3d7e0
Update fprime-gds version to 4.0.2a10 (#4433) 2025-11-18 09:48:15 -08:00
djbyrne17
402c0317b6
Update obsolete link in docs (#4423)
* Update obsolete link and screenshots

* Revert image updates

---------

Co-authored-by: djbyrne <djbyrne@jpl.nasa.gov>
Co-authored-by: chammard <thomas.boyer.chammard@jpl.nasa.gov>
2025-11-17 10:40:58 -08:00
Rob Bocchino
589871a957
Update FPP version to 3.1.0a10 (#4418) 2025-11-13 09:03:22 -08:00
M Starch
cc2522b257
Add fpp-to-json to FPP model sub-build (#4268)
* Add fpp-to-json to FPP model subbuild

* Update fprime-fpp version to 3.1.0a9
2025-11-11 17:59:32 -08:00
M Starch
6af7bcd5a9
ComAggregator updates (#4402)
* Fix timeout queue overflow with long transmissions

* Fix aggregator existing design

* Fix exactly full edge case

* Bump FPP version
2025-11-11 17:20:18 -08:00
Zimri Leisher
1c87278b6b
Clean up FpySequencer directives (#4395)
* Remove assert and float floor div

* Rename add/sub/mul

---------

Co-authored-by: M Starch <LeStarch@googlemail.com>
2025-11-11 17:20:01 -08:00
Rob Bocchino
a587677fae
Fix FppTest (#4410)
* Fix regression in FppTest

* Rename SerializeBufferBase to LinearBufferBase

* Revise FppTest

Add missing tests to CMakeLists
2025-11-11 10:50:37 -08:00
Rob Bocchino
a46fccf54d
Fix Ref build (#4409)
CMake directives were out of order
2025-11-11 10:49:12 -08:00
Ian Brault
2b65cc83cf
Add new Fw::ConstStringBase type for strings backed by immutable string literals (#4269)
* Add new Fw::StringBase type StaticString for strings backed my immutable literals

* Spellcheck fix

* Add disclaimer comment about use of StaticString

* Refactor the StringBase interface into an immutable ConstStringBase abstract base class and the now mutable StringBase class

* Rename StaticString to ConstExternalString and inherit from ConstStringBase

* Fix typo

* Change references from StringBase to ConstStringBase where applicable

* Updates following review meeting: add missing deserialize function and add new error status, move length function implementation into ConstStringBase so it is not pure virtual

* Clang format fix

* Additional clang-format fixes

* Fix the copy-assignment operator for StringBase not being correctly evaluated

* Clang format fix

* Explicitly delete the Serializable assignment operator and provide a skeleton implementation for RawTimeInterface to appease the compiler

* Revert "Explicitly delete the Serializable assignment operator and provide a skeleton implementation for RawTimeInterface to appease the compiler"

This reverts commit 086d7bcd3ca9c4f6e553d7fc34d0d126a69a165b.

* Move ConstStringBase to separate hpp/cpp files, plus other pull request feedback

* Clang format fix

* Update length implementation for ConstStringBase and ConstExternalString

* Improved asserts in ConstExternalString constructor

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

* Fixed ConstStringBase length implementation

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

* Clang format fix

* Add some UTs for ConstExternalString, fix non-overridden interfaces, and fix ConstStringBase::maxLength asserting for zero capacity strings

* Spell-check fix for ConstExternalString UTs

* Revise length implementation in ConstStringBase

If the capacity is zero, return zero

* Format

---------

Co-authored-by: Ian Brault <ian.r.brault@jpl.nasa.gov>
Co-authored-by: Rob Bocchino <bocchino@icloud.com>
Co-authored-by: Rob Bocchino <bocchino@jpl.nasa.gov>
Co-authored-by: M Starch <LeStarch@googlemail.com>
2025-11-07 09:50:05 -08:00
dependabot[bot]
90bac90821
Bump brotli from 1.1.0 to 1.2.0 (#4400)
Bumps [brotli](https://github.com/google/brotli) from 1.1.0 to 1.2.0.
- [Release notes](https://github.com/google/brotli/releases)
- [Changelog](https://github.com/google/brotli/blob/master/CHANGELOG.md)
- [Commits](https://github.com/google/brotli/compare/go/cbrotli/v1.1.0...v1.2.0)

---
updated-dependencies:
- dependency-name: brotli
  dependency-version: 1.2.0
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-11-07 08:27:05 -08:00
Thomas Boyer-Chammard
ba5988bfcd
Add How-To Implement a Bus Driver guide (device driver 2 of 2) (#4398)
* initial changes

* v0.1

* More improvements

* fix spelling
2025-11-06 16:29:40 -08:00
Thomas Boyer-Chammard
d669ea2c5a
Replace FpConfig.h header with FPP model elements (#4393)
* Update FpConfig.h

* Update AcConstants.fpp

* Update FPrimeBasicTypes.hpp

* Update BasicTypes.h

* Update FpySequencer.hpp

* Update FpConfig.h

* Update FPrimeBasicTypes.hpp

* Update BasicTypes.h

* Update BasicTypes.h

* Update BasicTypes.h

* Update BasicTypes.h

* Update BasicTypes.h

* Update BasicTypes.h

* Update BasicTypes.h

* Update FPrimeBasicTypes.hpp

* Update FPrimeBasicTypes.hpp

* Update FpConfig.h

* Update AcConstants.fpp

* Revert casts

* Add static_cast in asserts, reorganize files per feature

* Fix static_assert after merging devel

* Add assert to static cast

* clean up comments and TODOs

* formatting

* Fix formatting

* Fix RHEL8 error

* Other UT cast fix

* cast one side only

* fix spelling and move assert count to FpConstants

* Reorder and comments

* rob test

* re-add double cast

* Revert testing static_cast

* Update docs

* use SIZE_OF variables instead of hardcoding value

* Update FpConfig in CMake tests

---------

Co-authored-by: ekswang <eric.k.wang@jpl.nasa.gov>
2025-11-06 16:29:15 -08:00
Vince Woo
48e4720419
Created new SerialBufferBase as a parent of SerializeBufferBase (now renamed LinearBufferBase). (#4288)
* Created new SerialBufferBase as a parent of SerializeBufferBase. Renaming interface functions to be less confusing.

* Deprecating copyRawOffset. No direct use-cases in F' core.

* Make SerialBufferBase a true pure virtual interface.

* Changing Serializable to work with SerialBufferBase parent interface.

* Changing copyRaw and copyRawOffset to work with SerialBufferBase

* Updating documentation for SerialBufferBase usage

* Adding some documentation. Adding missing ASSERT in copyRaw. Fixing some bugs that new ASSERT uncovered.

* Renaming SerializeBufferBase to LinearBufferBase. Add a using declaration to maintain backwards compatability. Properly mark LinearBufferBase functions as override.

* Filling in the rest of the docstrings for the classes in Serializable

* Removing redundant virtual keyword on override function

* Applying clang formatting

* Incorporating PR comments

* Fix compile issues

* Bump version to alpha

* Format

* v

---------

Co-authored-by: M Starch <LeStarch@googlemail.com>
2025-11-06 16:23:20 -08:00
M Starch
b254e981a1
Update directives documentation with requirements (#4385)
* Update directives documentation with requirements

Added requirements for various directives and updated documentation.

* Refine sequencer requirements for clarity

* sp, missing exit requirement

* Update requirement references in directives.md

* Adding missing stack results as N/A

* Update requirements and descriptions in directives.md

Updated requirements for various directives and clarified descriptions. Removed unused directives and added TODOs for further specification.

* Update sequencer requirements in sdd.md

* Add in 2's complement notes.

Updated integer operations to use unsigned 64-bit integers and clarified handling of integers with 2's complement representation.

* Update documentation with 2's complement caution

Added caution note about 2's complement representation requirement.

* sp
2025-11-04 09:29:06 -08:00
Zimri Leisher
b1b613fd0c
FpySequencer Add DUMP_STACK_TO_FILE command (#4384)
* Add DUMP_STACK_TO_FILE command

* Add docstring

* Fix bug in directive

* format
2025-11-04 09:18:55 -08:00
Saransh Chopra
903677e97d
Fix clang-tidy checks (#4379)
* fix(.clang-tidy): `Checks` is supposed to be a comma separated list of checks

* fix clang-tidy warning

* fix a few lint warnings

* run clang-format

* more format
2025-11-03 17:45:54 -08:00
Thomas Boyer-Chammard
d6f43b02ff
Add How-To implement a Device Manager (device driver 1 of 2) (#4378)
* Add guide for developing device drivers in F Prime

* Add develop-device-driver.md

* Update device driver docs

* small fixes

* Polish things up

* more polishing

* spelling and link fixes

* Address review comments
2025-11-03 11:41:06 -08:00
Zimri Leisher
d0e9508988
FpySequencer new directives for loops (#4356)
* Rework exit, push tlm and push prm

* Rename store to store const offset

* Add new dirs for loops

* Compiling again

* Add UTs, passing

* Format

* sp

* Update schema version

* Update error code names

* Update directives documentation

* Add new stack class, switch DUPLICATE to PEEK

* Update peek docs

* Remove old docs

* sp

* sp, format
2025-11-03 10:03:38 -08:00
Copilot
aa4517c69b
Add Configuration section to BufferManager SDD (#4355)
* Initial plan

* Add Configuration section to BufferManager SDD

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

* Improve example by adding component instantiation

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

* Simplify configuration example and remove TBD sections per review feedback

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

* Manual updates

* add link

* Address review feedback: clarify memID, bin entry wording, and numBuffers description

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

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: thomas-bc <49786685+thomas-bc@users.noreply.github.com>
Co-authored-by: thomas-bc <thomas.boyerchammard@gmail.com>
2025-11-03 09:36:28 -08:00
M Starch
edf5c85d09
Allow bypass of posix_fallocate with FPRIME_SYNTHETIC_FALLOCATE (#4380) 2025-11-03 09:33:34 -08:00
M Starch
695478d1a1
Bump fprime-gds to 4.0.2a9 for FileUplink fix (#4382) 2025-11-03 09:30:44 -08:00
M Starch
c51921aca3
Add more error checking to Fpy arithmetic directives (#4331)
* Add more error checking to arithmetic directives

* sp

* Inadvertant double literal fix

* Add missing std::
2025-10-30 10:43:08 -07:00
M Starch
cb9f3a982b
Clarify Fpy float operation behavior in documentation (#4328)
* Clarify float operation behavior in documentation

Updated float operations to specify handling of NaN and infinity.  Fixes #3892, #3893.

* sp correcting neq definition

* sp
2025-10-30 10:42:20 -07:00
M Starch
033f504418
Document sequencer requirements and directives (#4373)
* Document sequencer requirements and directives

Added detailed requirements for the sequencer, including support for various directives and operations.

* Reorganize sequencer requirements in documentation
2025-10-29 13:13:12 -07:00
Thomas Boyer-Chammard
fdc582bc56
Update CI for top-level namespace structure (#4353)
* Update CI for top-level namespace structure

* update deployment expect file

* Fix other led-blinker workflows

* Fix dictionary name

* formatting to trigger CI

* Update MathTutorial CI build location

* add fprime location
2025-10-29 11:07:36 -07:00
Thomas Boyer-Chammard
0d78cd407c
Fix macOS CI intermittent failure (#4347)
* Attempt CI fix and test debug setup

* Sleep longer to wait for downlink

* why tho?

* revert misc debug things
2025-10-22 17:26:25 -07:00
Philip Romano
bf12f48c27
Adjust task priorities to fit within supported platform priority ranges (#4337)
* Adjust task priorities to fit in supported platforms' priority ranges

Darwin's task priority range is most restrictive (15-47); adjusted priorities
to reside within that range.

* Add comment clarifying TASK_PRIORITY_DEFAULT and TASK_DEFAULT

* Adjust relative task priorities for uplink and downlink

This moves uplink tasks to higher priority than downlink tasks and places
consumer tasks at higher priority than producer tasks.
2025-10-22 15:46:05 -07:00
Philip Romano
3f25d8b535
Change FPP enums to smallest representation (#4342)
For all FPP enums in the framework, set the representing type to the minimum
width that can represent the enum's member constants.
2025-10-22 15:44:10 -07:00
Thomas Boyer-Chammard
c0b75fb06a
Refactor FrameAccumulator not to assert on incorrect size_out (#4340)
* Refactor FrameAccumulator not to assert on incorrect size_out

* spelling

* revert port names

* Update check logic
2025-10-22 15:17:27 -07:00
Andrei Tumbar
6bdd79f290
Time Limited Event Throttle (#4306)
* Time Limited Event Throttle

* Bump fpp version

* Bump fpp version to include dictionary fix

* Bump fpp
2025-10-21 11:19:09 -07:00
Thomas Boyer-Chammard
38361bebd1
Fix RawTime UT oversight on initialization (#4330)
* Fix RawTime UT oversight on initialization

* fix include path

* update calculation method

* revert to 5000 steps
2025-10-21 09:52:25 -07:00
Thomas Boyer-Chammard
4261f9d815
Update RawTime UTs to require a platform-specific helper (#4323)
* tmp

* Update RawTime.Now test to require a platform-specific helper

* Fix ordering for GitHub rendering not to trip up

* spelling
2025-10-20 14:16:12 -07:00
M Starch
c909a19a54
Add alignment to memory allocator (#4319)
* Add alignment to memory allocator

* Fix undefined reference

* Fix enum type comparison

* Switch to enum class

* format

* Fix time

* Update Fw/Types/MallocAllocator.hpp

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

* Update Fw/Types/MmapAllocator.hpp

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

---------

Co-authored-by: Thomas Boyer-Chammard <49786685+thomas-bc@users.noreply.github.com>
2025-10-20 12:51:36 -07:00
M Starch
4705b6c989
Fix O_SYNC on systems without the definition (#4322) 2025-10-20 11:10:35 -07:00
Thomas Boyer-Chammard
626473fc4e
Add News page to nav.yml (#4317) 2025-10-16 16:08:30 -07:00
Thomas Boyer-Chammard
1ff13ac93f
Address student feedback for How-To Framing protocol (#4314)
* Address student review feedback for How-To Framing protocol

* last couple nits

* fix spelling

* ugh

* add review comments
2025-10-16 15:51:00 -07:00
M Starch
a8328b95cf
Enhance Fpy docs with state machine diagram (#4315)
* Enhance documentation with state machine diagram

* sp
2025-10-16 15:34:37 -07:00
M Starch
4afac326ba
Update contribution guidelines for clarity and CCB process (#4312)
* Update contribution guidelines for clarity and process

Clarified the process for submitting pull requests and emphasized the importance of opening an issue first. Updated the note about F´ Autocoder Python and its replacement by FPP.

* Fix typo and reorganize CONTRIBUTING.md structure

Corrected a typo in the Code Contribution Process section and reorganized the structure of the CONTRIBUTING.md file for clarity.

* Update CONTRIBUTING.md

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

---------

Co-authored-by: Thomas Boyer-Chammard <49786685+thomas-bc@users.noreply.github.com>
2025-10-16 10:47:33 -07:00
Zimri Leisher
2fca863e4d
FpySequencer flag system (#4259)
* Much work on set flags

* Little more work on flags

* Get UTs passing

* Defaults for flags

* Add uts for set flag

* Switch from bitfield to boolean array

* fix ut

* more work on flag system

* Add some uts

* Add getflag dir

* format

* Update docs

* sp

* Remove update on change from bool tlm

* pr feedback

---------

Co-authored-by: Zimri Leisher <zimri.leisher@fireflyspace.com>
2025-10-14 13:49:22 -07:00
Mishaal
0fc995fefd
Provide ability to update parameters via a file (#4165)
* Save point for PRM_SET_FILE work, add basic infrastruture

* fprime-format

* Create prime and backup DB, initial implementation of file based set, some UT updates

* More work on Prime and Backup DBs including helper methods, utilizing those for copy, and UTs

* spelling

* printf in Tester fix

* printf in Tester fix

* printf in Tester fix

* Remove a debug printf, update new method args, additional offNom Set File tests

* Spelling and format

* Clean up comments

* Sync with upstream devel updates

* Add additional UT for reverting parameter db on set file failure

* Spelling and format

* Updates to PrmDb after first review; change to active/staging design

* Spelling

* Remove FIXME comment

* Review fixes

* Fix UT

* Format

* Format II

* Format III

---------

Co-authored-by: M Starch <LeStarch@googlemail.com>
2025-10-14 13:40:27 -07:00
Cel Skeggs
9c11872889
Mark SwAssert declarations as noinline (#4304)
* Mark SwAssert declarations as noinline

Without this change, a compiler using LTO may inline the zeros that are
inserted as additional parameters for the call to defaultSwAssert. This
increases code size to optimize for the off-nominal condition where an
assertion is tripped.

In my testing, this single change reduces my largest deployment's
code size by 11%.

* Add 'noinline' to dictionary

* Update Fw/Types/Assert.hpp

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

---------

Co-authored-by: M Starch <LeStarch@googlemail.com>
Co-authored-by: Rob Bocchino <bocchino@icloud.com>
2025-10-14 12:55:33 -07:00
M Starch
2ee27f82f3
Add Communication Aggregator Component (#4264)
* Add aggregator component

* Add com aggregator to subtopology

* Fix aggregator issues

* Format and SDD

* Add basic UTs

* Fix not-empty check, test

* sp

* Fix author tag

* Bump GDS for aggregation; timeout aggregator

* Bump comQueue event size

* Increase timeout for integration tests

* Update Fw/Buffer/Buffer.hpp

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

* Update Svc/ComAggregator/CMakeLists.txt

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

* Update Svc/ComAggregator/docs/sdd.md

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

* Update Svc/ComAggregator/docs/sdd.md

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

* Remove unused variable 'good' in action doClear

* A usage note about APID.

---------

Co-authored-by: Thomas Boyer-Chammard <49786685+thomas-bc@users.noreply.github.com>
2025-10-13 16:28:57 -07:00
Will MacCormack
9a7123c190
Little Endian Serialization (#4294)
* Passing the Default BIG Arg to Serialize Functions

* Fails on Ac Files

* Compiles w/ little endian autocode

* Unit Tests Pass

* Little Endian deserializeTo & Unit Test Little Endian SerDes

* Add little-endian SerDes examples to docs

* Add & Respect Endianness for Array Lengths & Remove unneeded Fw:: Prefix

* Switch to enum class Endianness

* Fixes for enum class Endianness

* Run code formatter

* Bump fpp to v3.1.0a4

* Update Fw/Time/Time.hpp

* Update Fw/Time/Time.hpp

---------

Co-authored-by: Rob Bocchino <bocchino@jpl.nasa.gov>
Co-authored-by: M Starch <LeStarch@googlemail.com>
2025-10-13 14:15:06 -07:00
Will MacCormack
d385cb45ac
Bump fprime-gds to 4.0.2a8 in requirements.txt (#4299)
Co-authored-by: M Starch <LeStarch@googlemail.com>
2025-10-13 13:18:24 -07:00
djbyrne17
2de91b0916
NonASCII characters removed (#4298)
Co-authored-by: djbyrne <djbyrne@jpl.nasa.gov>
2025-10-13 09:41:41 -07:00
Andrei Tumbar
e1098018e2
Bump FPP with unified tool (#4287) 2025-10-09 17:00:24 -07:00
Angelina-2007
e34c019c3b
Fix typos in cross-compiling docs (#4280) 2025-10-09 10:38:41 -07:00
M Starch
74dd80e2b7
Add FPRIME_CMAKE_QUIET option (#4276)
* Add FPRIME_CMAKE_QUIET option

* Remove makefile deadcode

* Attempt CI debug

Add debugging message for FPRIME_SUB_BUILD_JOBS variable.

* Fix argument passing for sub-build jobs

* Update cmake/sub-build/sub-build.cmake

* Update cmake/sub-build/sub-build.cmake

---------

Co-authored-by: Thomas Boyer-Chammard <49786685+thomas-bc@users.noreply.github.com>
2025-10-08 16:30:36 -07:00
M Starch
7aa034c526
Add option for installing static libs (#4277) 2025-10-08 13:43:31 -07:00
M Starch
6c2698cea1
Bump C++ to 14 (#4278) 2025-10-08 13:39:20 -07:00
Thomas Boyer-Chammard
a4579d2fca
Add ErrorNotify port to CCSDS deframers (#4267)
* Add ErrorNotify port to CCSDS deframers

* Rename ErrorType to FrameError

* Update SDDs
2025-10-08 13:38:43 -07:00
Zimri Leisher
896803ad20
Add PUSH_TIME directive (#4275)
* Add push_time dir

* Add docs and UT

* format
2025-10-08 13:32:33 -07:00
Zimri Leisher
35840d549d
Add STEP command to FpySequencer (#4239)
* Remove debug prefix from breakpoint commands, start working on line by line step

* Actually add teh step cmd, some uts, update docs

* Fix step ut

* Split up tlm chans, add more for breakpoint stuff

* format

* Remove update on change from bool telemetry channels
2025-10-08 13:22:03 -07:00
Will MacCormack
589ed5d437
Switch to U64 Logger Tests (#4262)
* Use U64 for LoggerTests

* Switch `%llu` to PRI_U64

* Add back the `%` before PRI_U64

* clang-format LoggerRules.cpp
2025-10-06 13:26:36 -07:00
Rob Bocchino
e9d7f3ab66
Data structure library, phase 2 (#4062)
* Revise RedBlackTree impl docs

* Revise RedBlackTree impl docs

* Revise RedBlackTree impl docs

* Revise RedBlackTree impl docs

* Revise RedBlackTree impl

* Revise RedBlackTree impl

* Revise RedBlackTree impl

* Revise RedBlackTree impl

* Revise RedBlackTree impl

* Revise RedBlackTree impl

* Revise RedBlackTree impl

* Revise RedBlackTree impl

* Revise RedBlackTree impl

* Revise RedBlackTree impl

* Revise RedBlackTree impl

* Revise RedBlackTree impl

* Revise RedBlackTree impl

* Revise RedBlackTree impl

* Revise RedBlackTree impl

* Revise RedBlackTree impl

* Revise RedBlackTree impl

* Revise RedBlackTree impl docs

* Revise RedBlackTree impl

* Revise RedBlackTree impl

* Fix typo

* Revise RedBlackTree impl

* Revise RedBlackTree impl

* Revise RedBlackTree impl

* Revise RedBlackTree impl

* Revise RedBlackTree impl

* Revise RedBlackTree impl

* Revise RedBlackTree impl

* Revise RedBlackTree impl

* Revise RedBlackTree impl docs

* Revise RedBlackTree impl docs

* Revise RedBlackTree impl

* Revise RedBlackTreeImpl docs

* 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 RedBlackTree impl docs

* Start adding RedBlackTree impl

* Revise tests for ArraySetOrMapImpl

* Revise RedBlackTree impl

* Revise comment

* Revise comment

* Revise RedBlackTree impl

* Revise RedBlackTree impl

* Revise RedBlackTree impl

* Revise RedBlackTree impl

* Revise RedBlackTree impl

* Revise RedBlackTree impl

* Revise ArraySetOrMap impl

* Revise RedBlackTree impl

* Revise RedBlackTree impl

* Revise RedBlackTree impl

* Revise RedBlackTree impl

* Revise RedBlackTree impl

* Revise RedBlackTree impl

* Add RedBlackTree impl tester

* Revise RedBlackTree impl

* Revise RedBlackTree impl

* Revise RedBlackTree impl

* Revise RedBlackTree impl

* Revise RedBlackTree impl

* Fix comments

* Revise RedBlackTree impl

* Fix comments

* Revise comments

* Revise comments

* Revise comments

* Revise statement order for clarity

* Revise unit tests for RedBlackTree impl

* Revise RedBlackTree impl tests

* Revise RedBlackTree impl

* Revise RedBlackTree impl

* Revise RedBlackTree impl

* Add build and clean scripts

Working around regressions in the F Prime build system

* Revise build

Fix warnings

* Revise RedBlackTree impl and tests

* Revise tests for RedBlackTree impl

* Revise RedBlackTree impl and tests

* Revise RedBlackTree tests

Remove debug print statements

* Revise RedBlackTree impl tester

* Revise RedBlackTree impl

* Revise RedBlackTree impl

* Revise RedBlackTree impl

* Revise RedBlackTree impl

* Revise build script

* Revise RedBlackTree tests

* Revise RedBlackTree tests

* Revise RedBlackTree tests

* Revise RedBlackTree tests

* Revise RedBlackTree tests

* Revise RedBlackTree impl tests

* Revise RedBlackTree impl tests

* Revise RedBlackTree impl

* Revise RedBlackTree impl

* Revise RedBlackTree impl tests

* Revise RedBlackTree impl tests

* Revise RedBlackTree impl tests

* Revise RedBlackTree impl tests

* Revise RedBlackTree impl tests

* Revise RedBlackTree impl tests

* Revise RedBlackTree impl test

* Revise RedBlackTree impl

* Revise RedBlackTree impl

* Revise RedBlackTree impl

* Revise RedBlackTree impl

* Revise comment

* Revise RedBlackTree impl and tests

* Revise RedBlackTree impl

* Revise RedBlackTree impl

* Revise RedBlackTree impl

* Revise RedBlackTree impl tests

* Revise RedBlackTree impl tests

* Revise RedBlackTree impl

* Revise RedBlackTree impl tests

* Revise formatting

* Format code

* 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 docs for ExternalRedBlackTreeMap

* Revise docs for ExternalRedBlackTreeSet

* Revise docs for RedBlackTreeMap

* Revise docs for RedBlackTreeSet

* Revise ExternalRedBlackTreeMap tests

* Refactor ExternalStackTester

* Revise ArrayMap tests

* Add RedBlackTreeMap

* Revise RedBlackTreeMap tests

* Revise RedBlackTreeMap

* Add ExternalRedBlackTreeSet

* Add missing file

* Revise SetConstIterator

* Revise ExternalRedBlackTreeSet tests

* Revise ExternalRedBlackTreeSet tests

* Revise ExternalRedBlackTreeSet tests

* Revise ExternalRedBlackTreeSet tests

* Revise ExternalRedBlackTreeSet tests

* Revise ExternalRedBlackTree tests

* Revise ExternalArraySet tests

* Revise ExternalArraySet tests

* Add RedBlackTreeSet

* Revise RedBlackTreeSet tests

* Refactor ArraySetTest

* Revise RedBlackTreeSetOrMapImpl docs

* 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

* Format code

* Fix spelling

* Fix spelling

* Add -Wno-comment to suppress warnings for now

* Revise comments

* Revise diagrams

* Fix comment warnings on gcc

* Eliminate tabs

* Remove utility scripts

* Revise placement of break statements

* Rename function

getParentDirection --> getDirectionFromParent

* Add comment

* Add svg diagram

* Add svg diagram

* Add svg files

* Revise diagram

* Replace png with svg

* Replace png with svg

* Replace png with svg

* Revise comment

* Revise SDD for red-black tree

* Revise SDD for red-black tree
2025-10-06 13:26:23 -07:00
M Starch
20477ad9c8
Make GenericHub EXCLUDE_FROM_ALL (#4178)
* Make GenericHub EXCLUDE_FROM_ALL

* Add a build stage for Svc_GenericHub

CppCheck requires every target to be built.

* sp

---------

Co-authored-by: Thomas Boyer-Chammard <49786685+thomas-bc@users.noreply.github.com>
2025-10-06 10:48:05 -07:00
Andrei Tumbar
498546eac9
Bump FPP to 3.1.0a2 (#4263) 2025-10-06 10:19:51 -07:00
Ian Brault
c7048d0b9c
Fix for PosixFileTest UT failure (#4254)
Co-authored-by: Ian Brault <ian.r.brault@jpl.nasa.gov>
2025-10-06 10:19:08 -07:00
kevin-f-ortega
0a945a55c9
must be explicit when using unions otherwise size mispatch could occur (#4256)
* must be explicit when using unions otherwise size mispatch could occur

* fixed formatting
2025-10-06 10:18:20 -07:00
Cel Skeggs
7fbe13086a
Clear up encoding and newline errors (#4252)
* Require and add newlines at EOF in all C++ code

* Fix use of UTF-8 encoding in ci/config.xml

* Add missing newlines to ends of other files
2025-10-02 13:34:25 -07:00
Thomas Boyer-Chammard
1786ffee01
Update CI to use latest macOS intel runners (#4251) 2025-10-02 13:27:47 -07:00
Zimri Leisher
9139148de2
FpySequencer Add push tlm val and time dir (#4230)
* Add push tlm val and time dir

* Update sdd with latest directives

* format

* Rework overflow check
2025-09-30 13:47:43 -07:00
Steven Doran
43ed537106
CWE 453 cmd buffer assert (#4198)
* Initial fix for CWE-453-CmdBufferAssert

* Added EVR throttle; updated ut

* Updated unit tests

* Updated UT to check for TLM update

* Implemented finding from pull request

* Removed Test Directory

* Update model and SDD

* Move telemetry to rate group to prevent flood

* Fix Ref topology

* Format

* sp

---------

Co-authored-by: bitWarrior <bitWarrior@protonmail.com>
Co-authored-by: M Starch <LeStarch@googlemail.com>
2025-09-30 13:26:04 -07:00
Ian Brault
157f0f4d23
Fix inconsistencies in Drv.LinuxUartDriver SDD (#4237)
Co-authored-by: Ian Brault <ian.r.brault@jpl.nasa.gov>
2025-09-30 11:20:54 -07:00
kevin-f-ortega
3fa2ed9716
Bump fprime-gds dependency (#4236) 2025-09-30 11:19:55 -07:00
Thomas Boyer-Chammard
0e40726440
Add nomenclature document (#4200)
* Add nomenclature document

* whitespaces

* whitespaces

* fix spelling

* Update nomenclature with software slug representation

Added software slug representation for F Prime.

* sp

---------

Co-authored-by: M Starch <LeStarch@googlemail.com>
2025-09-29 13:48:44 -07:00
Pavly Gerges (pavl_g)
6433f694c7
RateGroup Docs Enhancements (#4196)
* Update rate-group.md

* Update expect.txt

* Added a word to the dictionary.
2025-09-26 15:01:57 -07:00
M Starch
8b1d627139
Add improvements to ComQueue (#4190)
* Move dequeued ComBuffer to persistent memory

* Add ordering notes to com interface docs

* Add buffer ownership tracking

* Assert dequeue status for serialized buffer

Added status check for dequeue operation to ensure successful serialization.

* Fix static_assert -> static_cast

* Fix format
2025-09-25 15:05:08 -07:00
M Starch
73ab9621e4
Ci zephyr (#4141)
* Add reusable action and workflow for CI and set up

* Add branch for testing

* Call correct workflow

* Remove superfluous input (tmp)

* Switch to fprime-actions

* Add with

* Actions typo

* Add plugin package installation

* Add build stage

* Fix container

* Remove container

* Trial of West

* Add custom setup

* Add push event

* Fix event data mining for push

* Fix push payload usage

* Fix branch detection

* Fix bash-foo

* Fix resuable project CI

* Add custom runner set up

* Typo

* Add intgration step

* Fix archive download

* Debug commands

* Download after setup

* Fix download path

* adding workflow for pico2 zephyr

* updated reusable workflow to clean up when done, otherwise garbase is left and it causes issues with subsequent runs

* fixing formatting because it matters

* Remove erroneous clean-up

* sp

* Add make space step

* Fix review requests

---------

Co-authored-by: Kevin F. Ortega <kevin.f.ortega@jpl.nasa.gov>
2025-09-25 13:29:58 -07:00
kevin-f-ortega
8ad0b830e8
regex is a bit wrong. It never would work with 'Os/File.hpp' (#4193) 2025-09-25 12:34:31 -07:00
Thomas Boyer-Chammard
9141f01919
Fix Intermittent UT failure in FprimeDeframer (#4177)
* Fix random UT failure in FprimeDeframer

* Update UTs and docs to reflect expectations
2025-09-23 09:28:30 -04:00
chuynh4duarte
b377be2a9f
Update Int to match PR4079 and clean-up Int Misc (#4111)
* update seq_gen to match PR 4079

* comment-out check specific number of events.  re-run multi without cause error

* fixed format

* change warn_hi to greater_or_equal_to 1 and put back 2 extra AppendFile

---------

Co-authored-by: Cindy T Huynh <chuynh@jpl.nasa.gov>
Co-authored-by: M Starch <LeStarch@googlemail.com>
2025-09-22 10:21:39 -07:00
Mishaal
bae7d2573c
Socket automatic reconnections in dedicated thread (#4136)
* Initial addition of dedicated reconnect task in SocketComponentHelper

* Updates to fix UT errors, address FIXMEs, update comments

* Additional FIXMEs and doc updates

* Spelling fix

* Format

* Format and some delay updates

* Address second request FIXMEs (remove)

* Unconditional stop & join in UDP tester cleanup

* Address FIXMEs and update Task to init singleton in a thread and address sanitizer safe manner

* Spelling

* Address PR review comments
2025-09-22 10:09:35 -07:00
jp
40142d7d39
Add system resources integration test (#4126) 2025-09-22 08:40:45 -07:00
Vince Woo
3422cfa117
Mark legacy serialize and deserialize methods as DEPRECATED. Upgrade remaining references to legacy methods. (#4145)
* Mark legacy serialize and deserialize functions as deprecated. Clean up of remaining legacy references.

* Upgrading serialization in FppTestProject and Ref

* Fixed formatting issues
2025-09-22 07:57:34 -07:00
Mishaal
01e3d70925
Add support to set socket options for IP sockets (#4146)
* Add setsockopt support

* Format

* format and spelling in cfg
2025-09-22 07:27:06 -07:00
Andrei Tumbar
5bee1a1151
Add Fw::TimeInterval constructor for computing delta between start/en… (#4172)
* Add Fw::TimeInterval constructor for computing delta between start/end time

* Format code

* Make the constructor better
2025-09-22 07:17:10 -07:00
Rob Royce
241e74ea1d
Fix grammatical error in F' introduction (#4174) 2025-09-21 13:12:20 -07:00
Andrei Tumbar
b28709cbdb
FPP 3.1.0a1 (#4161) 2025-09-17 14:14:14 -07:00
kevin-f-ortega
38f0c1f3b2
Update supported platforms document (#4152)
* moving feather m4 to the supported target table

* udpated dates
2025-09-15 16:36:05 -07:00
M Starch
e21fa7b109
Add Svc.BufferAllocation FPP interface (#4148)
* Add Fw::Buffer allocation interface

* Update Svc/Interfaces/Allocation.fpp

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

* Rename BufferAllocation.fpp interface file

* Update input file for Svc_Interfaces module

---------

Co-authored-by: Thomas Boyer-Chammard <49786685+thomas-bc@users.noreply.github.com>
2025-09-15 16:35:24 -07:00
Thomas Boyer-Chammard
ade6cc5ff3
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>
2025-09-12 14:41:44 -07:00
Thomas Boyer-Chammard
6190d9610b
Update custom framing How-To guide (#4144) 2025-09-12 11:52:41 -07:00
Rob Bocchino
9871fd5608
Call destructors when ExternalArray releases memory for which it has called constructors (#4143)
* Revise SDD for ExternalArray

Add element destructor calls

* Revise ExternalArray

Destroy array elements allocated as bare memory

* Refactor ExternalArray

* Refactor ExternalArray

* Revise commment

* Revise comment

* Revise SDD for ExternalArray
2025-09-11 19:16:45 -07:00
Thomas Boyer-Chammard
942c9eb6ac
Bump fprime-tools (#4142) 2025-09-11 16:28:26 -07:00
Copilot
965109bc50
Add SDD documentation for LinuxUartDriver component (#4124)
* Initial plan

* Add complete SDD documentation for LinuxUartDriver component

Co-authored-by: LeStarch <995330+LeStarch@users.noreply.github.com>

* Address all SDD review comments: numbering, requirement IDs, FPP examples

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

* manual fixes

* Remove one level of section numbering in LinuxUartDriver SDD

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

* woop woop

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: LeStarch <995330+LeStarch@users.noreply.github.com>
Co-authored-by: thomas-bc <49786685+thomas-bc@users.noreply.github.com>
2025-09-11 14:52:52 -07:00
Thomas Boyer-Chammard
054c51ad3e
Revise install instructions with latest project structure (#4139) 2025-09-11 14:51:08 -07:00
Vince Woo
4f381110a1
Fixing LinuxSpiDriver issues; Adding function argument check and completing read-after-write checks (#4137)
* Fixing read-after-write checks for SPI configuration. Adding UT.

* Add assert to validate the read and write buffers are the same size in SpiReadWrite_handler

* Corrected WARNING_LOW -> WARNING_LO

* Fixing event Strings and invalid SpiFrequency

* Reverting changes to LinuxSpiDriverTester

* Removing redundant variable write_clock
2025-09-10 18:26:02 -07:00
Thomas Boyer-Chammard
31919e6931
Fix test logic for TcDeframer CRC check (#4138) 2025-09-10 17:58:01 -07:00
Thomas Boyer-Chammard
ba65039fff
Finish code formatting (#4134) 2025-09-10 15:02:07 -07:00
Shaokai (Jerry) Lin
c8e2d44877
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>
2025-09-10 09:39:39 -07:00
M Starch
82fff1abc8
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.
2025-09-09 21:36:26 -07:00
Isaac Garibay
fff0e0bf77
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>
2025-09-09 14:46:07 -07:00
M Starch
1ee55a0c90
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>
2025-09-09 13:08:02 -07:00
M Starch
aabfa56193
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>
2025-09-09 12:31:21 -07:00
M Starch
3e41e2052b
Add Software Design Document for FileHandling subtopology (#4125) 2025-09-09 09:27:38 -07:00
M Starch
4c0092751c
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
2025-09-08 18:09:23 -07:00
M Starch
d9ecb8b637
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.
2025-09-08 18:04:07 -07:00
M Starch
4429614ea4
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>
2025-09-08 17:53:50 -07:00
M Starch
9cb948ed5d
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>
2025-09-08 10:41:06 -07:00
M Starch
0dbc4febbc
Update fprime-gds version to 4.0.2a4 (#4118) 2025-09-04 17:05:39 -07:00
M Starch
bce0b5de79
Incorporate student feedback for ground derived channels (#4117) 2025-09-04 13:27:51 -07:00
Thomas Boyer-Chammard
d014f30a96
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
2025-09-03 18:04:37 -07:00
Zimri Leisher
77f286f3ed
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>
2025-09-03 15:53:28 -07:00
M Starch
10f2b49d3f
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
2025-09-02 15:22:07 -07:00
chuynh4duarte
8b9ac2197d
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>
2025-08-29 10:29:39 -07:00
M Starch
b90345e9df
Add test driven development how-to (#4090)
* Add test driven development how-to

* sp; review
2025-08-29 10:28:55 -07:00
M Starch
976ad2b28e
Fix #3397 (#4086) 2025-08-27 18:11:14 -07:00
M Starch
42c665f080
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>
2025-08-27 15:42:51 -07:00
Rob Bocchino
9ec8c559de
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>
2025-08-27 15:24:32 -07:00
M Starch
287a0211eb
Bump GDS to v4.0.2a3 (#4079)
* Bump to v4.0.2a2 (GDS)

* Fix integration tests

* Fix requirements.txt
2025-08-27 14:25:41 -07:00
Ian Brault
d911fb903f
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>
2025-08-27 12:22:53 -07:00
Thomas Boyer-Chammard
373f81d0f3
Add subtopology documentation (#4072)
* Add subtopology guide

* fix typo and how-to

* Add reference link
2025-08-27 12:13:51 -07:00
Kyle Jones
513582f420
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>
2025-08-27 09:56:06 -07:00
Philip Romano
a20535ea42
Add environment setup to CONTRIBUTING.md (#4078)
* Fix typo `cp` to `cd` in CONTRIBUTING.md

* Mention Python venv requirements for running tests
2025-08-26 17:33:24 -07:00
M Starch
475f323525
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
2025-08-26 14:41:55 -07:00
kevin-f-ortega
94f67e4e21
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>
2025-08-25 17:32:20 -07:00
Zimri Leisher
f4439a8cc9
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>
2025-08-21 14:08:40 -07:00
Rob Bocchino
bdade025d0
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
2025-08-21 13:56:35 -07:00
Thomas Boyer-Chammard
6915c93c10
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
2025-08-21 08:55:17 -07:00
Rob Bocchino
7972392cf4
Reformat FppTest (#4048) 2025-08-19 17:48:16 -07:00
M Starch
d6cd606e66
Update NOTICE.txt references (#4045)
With the removal of the Autocoders directory, we also remove the pyparsestring usage.
2025-08-19 10:54:26 -07:00
Thomas Boyer-Chammard
a070ee768a
Fix AI Policy link in PR template (#4019) 2025-08-13 14:25:03 -07:00
Zimri Leisher
30a3902e3e
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>
2025-08-13 09:51:30 -07:00
Ethan Chee
2dea8abedf
Add static_cast to ambiguous serialize call in FpySequencer (#4008) 2025-08-10 13:46:44 -07:00
938 changed files with 48918 additions and 12112 deletions

View File

@ -2,4 +2,5 @@
BasedOnStyle: Chromium
IndentWidth: 4
ColumnLimit: 120
AccessModifierOffset: -2
AccessModifierOffset: -2
InsertNewlineAtEOF: true

View File

@ -6,6 +6,6 @@ Checks: >
modernize-redundant-void-arg,
modernize-use-bool-literals,
modernize-use-nullptr,
readability-braces-around-statements
-clang-analyzer-security.insecureAPI.rand,
readability-braces-around-statements,
-clang-analyzer-security.insecureAPI.rand
WarningsAsErrors: '*'

View File

@ -1,5 +1,7 @@
set timeout 180
spawn fprime-bootstrap project
expect -re {.*Project name.*}
expect -re {.*Project repository name.*}
send "my-project\r"
expect -re {.*Project top-level namespace.*}
send "MyProject\r"
expect eof

View File

@ -2,6 +2,8 @@ set timeout 60
spawn fprime-util new --deployment
expect -re {Deployment name.*}
send "MyDeployment\r"
expect -re {Deployment namespace.*}
send "MyNamespace\r"
expect -re {.*Select communication driver type}
send "1\r"
expect -re "Add .*MyDeployment.*"

View File

@ -32,13 +32,19 @@ baremetal
batchmode
BDV
bfree
BHn
bibtex
Bies
binaryfile
BINDIR
bitmaps
bitshifts
bitwidth
bocchino
boolt
bsd
BSDI
bst
BUFFERALLOCATE
BUFFERALLOCATIONFAILED
BUFFERGETOUT
@ -58,6 +64,7 @@ Campuzano
carg
CBF
CBLOCK
CCACHE
CCB
CComponent
ccsds
@ -110,6 +117,7 @@ coravy
coreutils
Coverity
CPHA
CPIU
cplusplus
CPOL
cppcheck
@ -136,6 +144,7 @@ CYCLEOUT
DATAPRODUCTS
DATAPRODUCTSSUBTOPOLOGY
DATAROOTDIR
datasheet
DDDTHH
Debian
deconstructor
@ -177,6 +186,7 @@ DPWRITER
DRAINBUFFERS
drv
drvtcpserversocket
DSL
dspal
DSSC
Dstate
@ -189,6 +199,7 @@ ECLIPSEHELP
EHAs
eip
Elts
emptydir
endcond
endfunction
endmacro
@ -209,6 +220,7 @@ externalproject
FAKELOGGER
fbuild
fdp
featherm
fecf
FEEDNAME
feq
@ -222,17 +234,20 @@ FILEDOWNLINKCFG
FILEHANDLING
FILEHANDLINGSUBTOPOLOGY
FILEID
FILEMANAGERCONFIG
FILEOPENERROR
FILEWRITEERROR
fio
fle
FNDELAY
fne
fontcolor
FONTPATH
foodoodie
foodoodiehoo
FPCONFIG
fpext
fpow
fpp
fppi
fpptest
@ -243,13 +258,12 @@ fptr
fptrunc
fputil
fpy
fpyc
FPYSEQUENCER
freeram
Fregoso
fres
frsize
fsblkcnt
fsrc
fsw
FWCASSERT
gcda
@ -270,6 +284,7 @@ gpiochip
gpioevent
gpiohandle
gpioline
GPT
Graphviz
grayscales
GROUNDINTERFACERULES
@ -277,9 +292,9 @@ GSE
gtags
gtest
gtimeout
GTK
Guire
GVCID
GPT
HACKSM
Handcoded
handleflags
@ -304,34 +319,34 @@ HTMLHELP
ibd
ieeetr
ieq
iext
iflag
ifstr
ilhs
imple
inbool
INCLUDEDIR
ine
initstate
inkscape
inorder
installable
intlimits
inttypes
INVALIDBUFFER
INVALIDHEADER
INVALIDHEADERHASH
invis
invisi
ioc
ioctl
ipas
IPCFG
IPHELPER
irhs
isf
isgreater
isgreaterequal
isless
islessequal
isr
isrc
isunordered
itimerspec
itr
@ -369,12 +384,15 @@ LINEEVENT
LINEHANDLE
linelength
lineoffset
LISTDIRECTORY
lld
llu
LOCALSTATEDIR
LOGGERRULES
LOGPACKET
lseek
LTK
lvar
LVL
lxml
MACROFILE
@ -402,6 +420,7 @@ MMAPALLOCATOR
MML
modbus
MOVEFILE
Mpu
msc
mscfile
mseconds
@ -419,6 +438,8 @@ ncsl
newtio
nmsgs
NOBLOCK
NODELABEL
noinline
NOLINT
NOLINTNEXTLINE
noparent
@ -477,6 +498,7 @@ patsubst
pdflatex
penv
PERLMOD
PHASERMEMBEROUT
PINGENTRIES
PINGSEND
pkill
@ -491,6 +513,7 @@ PORTOUT
PORTSELECTOR
ppandian
pregen
prescaler
prioritization
PRIORITYQUEUE
prm
@ -534,6 +557,7 @@ RATELIMITERTESTER
rawtime
RAWTIMETESTER
RBF
rbt
RCHILD
rcvd
rdwr
@ -563,6 +587,7 @@ sbom
scid
scm
sdd
sdiv
searchdata
SENDPARTIAL
seqgen
@ -570,10 +595,10 @@ serializables
setaffinity
setinheritsched
SETLOGGING
setname
setprotocol
setschedparam
setschedpolicy
setser
setstacksize
settime
sev
@ -585,11 +610,13 @@ SHAREDSTATEDIR
SHELLCOMMAND
showinitializer
sideeffect
siext
Signedness
Silveira
sitofp
sle
sloc
smod
socio
SOCKETHELPER
SOCKETIPDRIVER
@ -680,13 +707,15 @@ tparam
TPP
trinomials
tts
typedef'ed
typedef
typedef'ed
uart
udiv
UDPSOCKET
uge
uitofp
UML
umod
UNEXP
unistd
UNITTESTASSERT
@ -713,9 +742,11 @@ wrs
wxgui
wxy
Xapian
XBee
xdf
xdffe
xsltproc
xxxx
XXYY
ziext
zimri

View File

@ -22,6 +22,6 @@
<!-- Note any additional work that will be done relating to this issue. -->
## AI Usage ([policy](../AI_POLICY.md))
## AI Usage (see [policy](https://github.com/nasa/fprime/blob/devel/AI_POLICY.md))
<!-- If AI was used, please describe how it was utilized (e.g., code generation, documentation, testing, debugging assistance, etc.). -->

View File

@ -38,7 +38,7 @@ jobs:
- uses: ./.github/actions/setup
- name: Build Framework
run: |
fprime-util generate
fprime-util generate -DFPRIME_ENABLE_JSON_MODEL_GENERATION=ON
fprime-util build --all -j4
Ref:
@ -59,7 +59,7 @@ jobs:
- name: Build Ref
run: |
cd Ref
fprime-util generate
fprime-util generate -DFPRIME_ENABLE_JSON_MODEL_GENERATION=ON
fprime-util build -j4
UTs:

View File

@ -48,8 +48,9 @@ jobs:
fprime-util generate -DCMAKE_EXPORT_COMPILE_COMMANDS=ON
fprime-util build --all --jobs "$(nproc || printf '%s\n' 1)"
# Since our subtopologies have EXCLUDE_FROM_ALL, we need to explicitly build them
# Add EXCLUDE_FROM_ALL targets as we need to explicitly build them
fprime-util build --target Svc_Subtopologies --jobs "$(nproc || printf '%s\n' 1)"
fprime-util build --target Svc_GenericHub --jobs "$(nproc || printf '%s\n' 1)"
echo CPPCHECK_OPTS=--project="$GITHUB_WORKSPACE/build-fprime-automatic-native/compile_commands.json" >> $GITHUB_ENV
- name: Run cppcheck

View File

@ -68,8 +68,8 @@ jobs:
run: |
mkdir -p aarch64-linux-artifacts
cp -r ./build-artifacts aarch64-linux-artifacts
cp -r Components/Led/test/int aarch64-linux-artifacts
- name: 'Archive Build Artifacts'
cp -r LedBlinker/Components/Led/test/int aarch64-linux-artifacts
- name: "Archive Build Artifacts"
uses: actions/upload-artifact@v4
with:
name: aarch64-linux-artifacts
@ -84,7 +84,7 @@ jobs:
- name: "Checkout F´ Repository"
uses: actions/checkout@v4
with:
sparse-checkout: 'requirements.txt'
sparse-checkout: "requirements.txt"
sparse-checkout-cone-mode: false
- name: "Setup environment"
run: |
@ -97,13 +97,14 @@ jobs:
name: aarch64-linux-artifacts
- name: Run Integration Tests
run: |
DEPLOYMENT=LedBlinker_LedBlinkerDeployment
. venv/bin/activate
mkdir -p ci-logs
chmod +x ./build-artifacts/aarch64-linux/LedBlinker/bin/LedBlinker
fprime-gds --ip-client -d ./build-artifacts/aarch64-linux/LedBlinker --logs ./ci-logs &
chmod +x ./build-artifacts/aarch64-linux/${DEPLOYMENT}/bin/${DEPLOYMENT}
fprime-gds --ip-client -d ./build-artifacts/aarch64-linux/${DEPLOYMENT} --logs ./ci-logs &
sleep 10
pytest --dictionary ./build-artifacts/aarch64-linux/LedBlinker/dict/LedBlinkerTopologyDictionary.json ./int/led_integration_tests.py
- name: 'Archive logs'
pytest --dictionary ./build-artifacts/aarch64-linux/${DEPLOYMENT}/dict/LedBlinkerDeploymentTopologyDictionary.json ./int/led_integration_tests.py
- name: "Archive logs"
uses: actions/upload-artifact@v4
if: always()
with:

View File

@ -32,6 +32,6 @@ jobs:
with:
target_repository: fprime-community/fprime-tutorial-hello-world
fprime_location: ./lib/fprime
build_location: HelloWorldDeployment
build_location: Hello/HelloWorldDeployment
run_unit_tests: false # no UTs in HelloWorld project
target_ref: ${{ needs.get-branch.outputs.target-branch }}

View File

@ -32,6 +32,6 @@ jobs:
with:
target_repository: fprime-community/fprime-workshop-led-blinker
fprime_location: lib/fprime
build_location: LedBlinker
build_location: LedBlinker/LedBlinkerDeployment
run_unit_tests: true
target_ref: ${{ needs.get-branch.outputs.target-branch }}

View File

@ -31,6 +31,7 @@ jobs:
uses: ./.github/workflows/reusable-project-builder.yml
with:
target_repository: fprime-community/fprime-tutorial-math-component
build_location: MathDeployment
build_location: MathProject/MathDeployment
fprime_location: ./lib/fprime
run_unit_tests: true
target_ref: ${{ needs.get-branch.outputs.target-branch }}

View File

@ -73,41 +73,43 @@ jobs:
uses: actions/checkout@v4
with:
submodules: true
path: ./MyProject/lib/fprime
path: ./my-project/lib/fprime
fetch-depth: 0
- name: "Update dependencies and install fprime-tools"
run: |
cd MyProject
cd my-project
. fprime-venv/bin/activate
pip install -U -r ./lib/fprime/requirements.txt
pip install -U -r ./requirements.txt
pip install git+https://github.com/nasa/fprime-tools@${{ needs.get-tools-branch.outputs.target-branch }}
- name: "Version Check"
run: |
cd MyProject
cd my-project
. fprime-venv/bin/activate
fprime-util version-check
- name: "Test Generate and Build Project"
run: |
cd MyProject
cd my-project
. fprime-venv/bin/activate
fprime-util generate
fprime-util build -j4
- name: "Test New Deployment and Build"
run: |
cd MyProject
cd my-project
. fprime-venv/bin/activate
expect ./lib/fprime/.github/actions/cookiecutter-check/deployment.expect
cd MyProject
expect ../lib/fprime/.github/actions/cookiecutter-check/deployment.expect
cd MyDeployment
fprime-util build -j4
- name: "Test New Component and Build"
run: |
cd MyProject
cd my-project
. fprime-venv/bin/activate
expect ./lib/fprime/.github/actions/cookiecutter-check/component.expect
cd MyProject
expect ../lib/fprime/.github/actions/cookiecutter-check/component.expect
cd MyComponent
fprime-util build -j4

View File

@ -0,0 +1,36 @@
# Cross-compile https://github.com/fprime-community/fprime-zephyr-reference
name: "External Repo: Zephyr Reference (Pico 2)"
on:
push:
branches: [ devel, release/** ]
pull_request:
# The branches below must be a subset of the branches above
branches: [ devel, release/** ]
paths-ignore:
- 'docs/**'
- '**.md'
- '.github/actions/spelling/**'
- '.github/ISSUE_TEMPLATE/**'
# Cancel in-progress runs if a newer run is started on a given PR
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: ${{ !contains(github.ref, 'devel') && !contains(github.ref, 'release/')}}
jobs:
get-branch:
name: "Get target branch"
uses: ./.github/workflows/reusable-get-pr-branch.yml
with:
target_repository: fprime-community/fprime-zephyr-reference
build:
name: "Zephyr Build"
needs: get-branch
uses: ./.github/workflows/reusable-project-ci.yml
with:
target_repository: fprime-community/fprime-zephyr-reference
target_ref: ${{ needs.get-branch.outputs.target-branch }}
ci_config_file: ./lib/fprime-zephyr/ci/sample-configs/pico2.yml

View File

@ -0,0 +1,36 @@
# Cross-compile https://github.com/fprime-community/fprime-zephyr-reference
name: "External Repo: Zephyr Reference (Teensy 4.1)"
on:
push:
branches: [ devel, release/** ]
pull_request:
# The branches below must be a subset of the branches above
branches: [ devel, release/** ]
paths-ignore:
- 'docs/**'
- '**.md'
- '.github/actions/spelling/**'
- '.github/ISSUE_TEMPLATE/**'
# Cancel in-progress runs if a newer run is started on a given PR
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: ${{ !contains(github.ref, 'devel') && !contains(github.ref, 'release/')}}
jobs:
get-branch:
name: "Get target branch"
uses: ./.github/workflows/reusable-get-pr-branch.yml
with:
target_repository: fprime-community/fprime-zephyr-reference
build:
name: "Zephyr Build"
needs: get-branch
uses: ./.github/workflows/reusable-project-ci.yml
with:
target_repository: fprime-community/fprime-zephyr-reference
target_ref: ${{ needs.get-branch.outputs.target-branch }}
ci_config_file: ./lib/fprime-zephyr/ci/sample-configs/teensy41.yml

View File

@ -57,13 +57,14 @@ jobs:
fprime-util generate raspberrypi
- name: "Build RPI"
run: |
cd LedBlinker/LedBlinkerDeployment
fprime-util build raspberrypi
- name: "Prepare artifacts"
run: |
mkdir -p rpi-artifacts
cp -r ./build-artifacts rpi-artifacts
cp -r Components/Led/test/int rpi-artifacts
- name: 'Archive Build Artifacts'
cp -r LedBlinker/Components/Led/test/int rpi-artifacts
- name: "Archive Build Artifacts"
uses: actions/upload-artifact@v4
with:
name: rpi-artifacts
@ -78,7 +79,7 @@ jobs:
- name: "Checkout F´ Repository"
uses: actions/checkout@v4
with:
sparse-checkout: 'requirements.txt'
sparse-checkout: "requirements.txt"
sparse-checkout-cone-mode: false
- name: "Setup environment"
run: |
@ -91,13 +92,14 @@ jobs:
name: rpi-artifacts
- name: Run Integration Tests
run: |
DEPLOYMENT=LedBlinker_LedBlinkerDeployment
. venv/bin/activate
mkdir -p ci-logs
chmod +x ./build-artifacts/raspberrypi/LedBlinker/bin/LedBlinker
fprime-gds --ip-client -d ./build-artifacts/raspberrypi/LedBlinker --logs ./ci-logs &
chmod +x ./build-artifacts/raspberrypi/${DEPLOYMENT}/bin/${DEPLOYMENT}
fprime-gds --ip-client -d ./build-artifacts/raspberrypi/${DEPLOYMENT} --logs ./ci-logs &
sleep 10
pytest --dictionary ./build-artifacts/raspberrypi/LedBlinker/dict/LedBlinkerTopologyDictionary.json ./int/led_integration_tests.py
- name: 'Archive logs'
pytest --dictionary ./build-artifacts/raspberrypi/${DEPLOYMENT}/dict/LedBlinkerDeploymentTopologyDictionary.json ./int/led_integration_tests.py
- name: "Archive logs"
uses: actions/upload-artifact@v4
if: always()
with:

View File

@ -31,67 +31,16 @@ jobs:
env:
# Svc is currently listing all but Svc/FpySequencer
CHECKED_DIRS: >-
CFDP
default
Drv
FppTestProject
Fw
Os
Svc/ActiveRateGroup
Svc/ActiveTextLogger
Svc/AssertFatalAdapter
Svc/BufferAccumulator
Svc/BufferLogger
Svc/BufferManager
Svc/BufferRepeater
Svc/Ccsds
Svc/ChronoTime
Svc/CmdDispatcher
Svc/CmdSequencer
Svc/CmdSplitter
Svc/ComLogger
Svc/ComQueue
Svc/ComSplitter
Svc/ComStub
Svc/Cycle
Svc/DpCatalog
Svc/DpManager
Svc/DpPorts
Svc/DpWriter
Svc/EventManager
Svc/Fatal
Svc/FatalHandler
Svc/FileDownlink
Svc/FileDownlinkPorts
Svc/FileManager
Svc/FileUplink
Svc/FprimeDeframer
Svc/FprimeFramer
Svc/FprimeProtocol
Svc/FprimeRouter
Svc/FrameAccumulator
Svc/FramingProtocol
Svc/GenericHub
Svc/Health
Svc/Interfaces
Svc/LinuxTimer
Svc/OsTime
Svc/PassiveConsoleTextLogger
Svc/PassiveRateGroup
Svc/Ping
Svc/PolyDb
Svc/PolyIf
Svc/Ports
Svc/PosixTime
Svc/PrmDb
Svc/RateGroupDriver
Svc/Sched
Svc/Seq
Svc/SeqDispatcher
Svc/StaticMemory
Svc/Subtopologies
Svc/SystemResources
Svc/TlmChan
Svc/TlmPacketizer
Svc/Version
Svc/WatchDog
Ref
Svc
TestUtils
Utils
run: |
fprime-util format --check --dirs $CHECKED_DIRS

View File

@ -33,7 +33,7 @@ jobs:
- name: "Generate UT build cache"
working-directory: ./FppTestProject
run: |
fprime-util generate --ut
fprime-util generate --ut -DFPRIME_ENABLE_JSON_MODEL_GENERATION=ON
shell: bash
- name: "Build UTs"
working-directory: ./FppTestProject/FppTest

View File

@ -30,7 +30,7 @@ jobs:
- name: "Generate Ref Deployment"
working-directory: ./Ref
run: |
fprime-util generate
fprime-util generate -DFPRIME_ENABLE_JSON_MODEL_GENERATION=ON
shell: bash
- name: "Run fpp-to-json on Ref topology"
working-directory: ./Ref/Top

View File

@ -6,10 +6,10 @@ name: Python Dependency Check
on:
push:
paths:
- 'requirements.txt'
- "requirements.txt"
pull_request:
paths:
- 'requirements.txt'
- "requirements.txt"
# Cancel in-progress runs if a newer run is started on a given PR
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
@ -21,8 +21,8 @@ jobs:
strategy:
matrix:
python-version: ["3.9", "3.10", "3.11", "3.12", "3.13"]
# macos-13 is the last Intel-family runner; macos-latest is ARM
runner: [macos-13, macos-latest, ubuntu-22.04, ubuntu-latest]
# Purposefully test on both ARM and Intel macOS (macos-latest is ARM)
runner: [macos-15-intel, macos-latest, ubuntu-22.04, ubuntu-latest]
steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}

View File

@ -34,14 +34,16 @@ jobs:
- name: "Get target branch"
id: get_target_branch
run: |
BRANCH_NAME="${GITHUB_REF#refs/heads/}"
echo "Looking for 'pr-${{ github.event.number }}'/'${BRANCH_NAME}'"
response_code_pr=`curl -w '%{response_code}' https://api.github.com/repos/${{ inputs.target_repository }}/branches/pr-${{ github.event.number }} -o /dev/null`
response_code_base=`curl -w '%{response_code}' https://api.github.com/repos/${{ inputs.target_repository }}/branches/${{ github.event.pull_request.base.ref }} -o /dev/null`
response_code_branch=`curl -w '%{response_code}' https://api.github.com/repos/${{ inputs.target_repository }}/branches/${BRANCH_NAME} -o /dev/null`
if [[ "${{ github.event_name }}" == "pull_request" && "$response_code_pr" == "200" ]]; then
echo "TARGET_BRANCH=pr-${{ github.event.number }}" >> $GITHUB_OUTPUT
echo "PR branch found, using pr-${{ github.event.number }}"
elif [[ "${{ github.event_name }}" == "pull_request" && "$response_code_base" == "200" ]]; then
echo "TARGET_BRANCH=${{ github.event.pull_request.base.ref }}" >> $GITHUB_OUTPUT
echo "Base branch found, using ${{ github.event.pull_request.base.ref }}"
elif [[ "$response_code_branch" == "200" ]]; then
echo "TARGET_BRANCH=${BRANCH_NAME}" >> $GITHUB_OUTPUT
echo "Base branch found, using ${BRANCH_NAME}"
else
echo "TARGET_BRANCH=${{ inputs.default_target_ref }}" >> $GITHUB_OUTPUT
echo "PR branch not found, using ${{ inputs.default_target_ref }}"

View File

@ -0,0 +1,85 @@
# This workflow is intended for reuse by other workflows and will not run directly (no triggers).
# The behavior is to run the steps of fprime-ci.
name: "F´ CI - Reusable Workflow"
on:
workflow_call:
inputs:
target_repository:
description: "Additional external repository to checkout (<owner>/<repo>)"
required: true
type: string
fprime_location:
description: "Relative path from the external project root to its F´ submodule"
required: false
type: string
default: "./lib/fprime"
target_ref:
description: "Branch on target to checkout"
required: false
type: string
default: "devel"
ci_config_file:
required: true
type: string
run_unit_tests:
description: "Run an additional job in parallel to run unit tests."
required: false
type: boolean
default: true
runs_on:
description: "Platform to run on. Defaults to ubuntu-22.04"
required: false
type: string
default: "ubuntu-22.04"
runs_on_int:
description: "Platform to run integration tests on. Defaults to: apple-ci"
required: false
type: string
default: "apple-ci"
runs_on_ut:
description: "Platform to run UTs on. Defaults to ubuntu-22.04"
required: false
type: string
default: "ubuntu-22.04"
jobs:
build:
runs-on: ${{ inputs.runs_on }}
name: "Build"
steps:
- name: "Make Space"
uses: nasa/fprime-actions/make-space@devel
- name: "Set up target repository"
uses: nasa/fprime-actions/external-repository-setup@devel
with:
target_repository: ${{ inputs.target_repository }}
fprime_location: ${{ inputs.fprime_location }}
target_ref: ${{ inputs.target_ref }}
stage: build
- name: "Build Binary"
run: |
CCACHE_DISABLE=1 fprime-ci -c ${{ inputs.ci_config_file }} --add-stage build
- name: Archive Results
uses: actions/upload-artifact@v4
with:
name: archive.tar.gz
path: ./archive.tar.gz
integration-tests:
needs: build
name: "Integration Tests"
runs-on: ${{ inputs.runs_on_int }}
steps:
- name: "Set up target repository"
uses: nasa/fprime-actions/external-repository-setup@devel
with:
target_repository: ${{ inputs.target_repository }}
fprime_location: ${{ inputs.fprime_location }}
target_ref: ${{ inputs.target_ref }}
stage: int
- name: Pull Archive Results
uses: actions/download-artifact@v4
with:
name: archive.tar.gz
- name: "Integration tests"
run: |
fprime-ci -c ${{ inputs.ci_config_file }} --skip-stage build

1
.gitignore vendored
View File

@ -26,6 +26,7 @@ RemoteSystemsTempFiles
*.stackdump
Dict
*.core
*.swp
**/coverage/
*.gcov

View File

@ -38,6 +38,8 @@ nav:
- Svc:
- "Svc/**/docs/sdd.md"
- Fw:
- DataStructures:
- "Fw/DataStructures/docs/**.md"
- "Fw/**/docs/sdd.md"
- Drv:
- "Drv/**/docs/sdd.md"
@ -47,3 +49,4 @@ nav:
- "docs/reference/*.md"
- Support: '../support'
- Events: '../events'
- News: "../news"

View File

@ -14,133 +14,83 @@
#include "Fw/Types/Assert.hpp"
static U32 min(const U32 a, const U32 b) {
return (a < b) ? a : b;
return (a < b) ? a : b;
}
namespace CFDP {
Checksum ::
Checksum() : m_value(0)
{
Checksum ::Checksum() : m_value(0) {}
}
Checksum ::Checksum(const U32 value) : m_value(value) {}
Checksum ::
Checksum(const U32 value) : m_value(value)
{
}
Checksum ::
Checksum(const Checksum &original)
{
Checksum ::Checksum(const Checksum& original) {
this->m_value = original.getValue();
}
}
Checksum ::
~Checksum()
{
Checksum ::~Checksum() {}
}
Checksum& Checksum ::
operator=(const Checksum& checksum)
{
Checksum& Checksum ::operator=(const Checksum& checksum) {
this->m_value = checksum.m_value;
return *this;
}
}
bool Checksum ::
operator==(const Checksum& checksum) const
{
bool Checksum ::operator==(const Checksum& checksum) const {
return this->m_value == checksum.m_value;
}
}
bool Checksum ::
operator!=(const Checksum& checksum) const
{
return not (*this == checksum);
}
bool Checksum ::operator!=(const Checksum& checksum) const {
return not(*this == checksum);
}
U32 Checksum ::
getValue() const
{
U32 Checksum ::getValue() const {
return this->m_value;
}
}
void Checksum ::
update(
const U8 *const data,
const U32 offset,
const U32 length
)
{
void Checksum ::update(const U8* const data, const U32 offset, const U32 length) {
U32 index = 0;
// Add the first word unaligned if necessary
const U32 offsetMod4 = offset % 4;
if (offsetMod4 != 0) {
const U8 wordLength = static_cast<U8>(min(length, 4 - offsetMod4));
this->addWordUnaligned(
&data[index],
static_cast<U8>(offset + index),
wordLength
);
index += wordLength;
const U8 wordLength = static_cast<U8>(min(length, 4 - offsetMod4));
this->addWordUnaligned(&data[index], static_cast<U8>(offset + index), wordLength);
index += wordLength;
}
// Add the middle words aligned
for ( ; index + 4 <= length; index += 4) {
addWordAligned(&data[index]);
for (; index + 4 <= length; index += 4) {
addWordAligned(&data[index]);
}
// Add the last word unaligned if necessary
if (index < length) {
const U8 wordLength = static_cast<U8>(length - index);
this->addWordUnaligned(
&data[index],
static_cast<U8>(offset + index),
wordLength
);
const U8 wordLength = static_cast<U8>(length - index);
this->addWordUnaligned(&data[index], static_cast<U8>(offset + index), wordLength);
}
}
}
void Checksum ::
addWordAligned(const U8 *const word)
{
void Checksum ::addWordAligned(const U8* const word) {
for (U8 i = 0; i < 4; ++i) {
addByteAtOffset(word[i], i);
addByteAtOffset(word[i], i);
}
}
}
void Checksum ::
addWordUnaligned(
const U8 *word,
const U8 position,
const U8 length
)
{
void Checksum ::addWordUnaligned(const U8* word, const U8 position, const U8 length) {
FW_ASSERT(length < 4);
U8 offset = position % 4;
for (U8 i = 0; i < length; ++i) {
addByteAtOffset(word[i], offset);
++offset;
if (offset == 4) {
offset = 0;
}
addByteAtOffset(word[i], offset);
++offset;
if (offset == 4) {
offset = 0;
}
}
}
void Checksum ::
addByteAtOffset(
const U8 byte,
const U8 offset
)
{
FW_ASSERT(offset < 4);
const U32 addend = static_cast<U32>(byte) << (8*(3-offset));
this->m_value += addend;
}
}
void Checksum ::addByteAtOffset(const U8 byte, const U8 offset) {
FW_ASSERT(offset < 4);
const U32 addend = static_cast<U32>(byte) << (8 * (3 - offset));
this->m_value += addend;
}
} // namespace CFDP

View File

@ -17,130 +17,120 @@
namespace CFDP {
//! \class Checksum
//! \brief Class representing a 32-bit checksum as mandated by the CCSDS File
//! Delivery Protocol.
//!
//! This checksum is calculated by update of an existing 32-bit value
//! with the "next" 32-bit string drawn from the file data. Beginning
//! at the start of the file, a 4-byte window moves up the file by four
//! bytes per update. The update itself replaces the existing checksum
//! with the byte-wise sum of the existing checksum and the file data
//! contained in the window. Overflows in the addition are permitted
//! and the carry discarded.
//!
//! If an update is to be made beginning at an offset into the file
//! which is not aligned to a 4-byte boundary, the window is treated
//! as beginning at the last 4-byte boundary, but is left-zero-padded.
//! Similarly, where the file data for an update ends on an unaligned
//! byte, the window extends up to the next boundary and is
//! right-zero-padded.
//!
//! ## Example
//!
//! For buffer 0xDE 0xAD 0xBE 0xEF 0xCA 0xFE and initial zero checksum:
//!
//! ------------------------------------ Update 1
//! Window 0xDE 0xAD 0xBE 0xEF
//! Checksum 0xDEADBEEF
//!
//! ------------------------------------ Update 2
//! Window 0xCA 0xFE
//! Checksum 0xDEADBEEF+
//! 0xCAFE0000
//! ----------
//! 0xA8ABBEEF <- Final value
class Checksum {
//! \class Checksum
//! \brief Class representing a 32-bit checksum as mandated by the CCSDS File
//! Delivery Protocol.
//!
//! This checksum is calculated by update of an existing 32-bit value
//! with the "next" 32-bit string drawn from the file data. Beginning
//! at the start of the file, a 4-byte window moves up the file by four
//! bytes per update. The update itself replaces the existing checksum
//! with the byte-wise sum of the existing checksum and the file data
//! contained in the window. Overflows in the addition are permitted
//! and the carry discarded.
//!
//! If an update is to be made beginning at an offset into the file
//! which is not aligned to a 4-byte boundary, the window is treated
//! as beginning at the last 4-byte boundary, but is left-zero-padded.
//! Similarly, where the file data for an update ends on an unaligned
//! byte, the window extends up to the next boundary and is
//! right-zero-padded.
//!
//! ## Example
//!
//! For buffer 0xDE 0xAD 0xBE 0xEF 0xCA 0xFE and initial zero checksum:
//!
//! ------------------------------------ Update 1
//! Window 0xDE 0xAD 0xBE 0xEF
//! Checksum 0xDEADBEEF
//!
//! ------------------------------------ Update 2
//! Window 0xCA 0xFE
//! Checksum 0xDEADBEEF+
//! 0xCAFE0000
//! ----------
//! 0xA8ABBEEF <- Final value
class Checksum {
public:
// ----------------------------------------------------------------------
// Types
// ----------------------------------------------------------------------
public:
public:
// ----------------------------------------------------------------------
// Construction and destruction
// ----------------------------------------------------------------------
// ----------------------------------------------------------------------
// Types
// ----------------------------------------------------------------------
//! Construct a fresh Checksum object.
Checksum();
public:
//! Construct a Checksum object and initialize it with a value.
Checksum(const U32 value);
// ----------------------------------------------------------------------
// Construction and destruction
// ----------------------------------------------------------------------
//! Copy a Checksum object.
Checksum(const Checksum& original);
//! Construct a fresh Checksum object.
Checksum();
//! Destroy a Checksum object.
~Checksum();
//! Construct a Checksum object and initialize it with a value.
Checksum(const U32 value);
public:
// ----------------------------------------------------------------------
// Public instance methods
// ----------------------------------------------------------------------
//! Copy a Checksum object.
Checksum(const Checksum &original);
//! Assign checksum to this.
Checksum& operator=(const Checksum& checksum);
//! Destroy a Checksum object.
~Checksum();
//! Compare checksum and this for equality.
bool operator==(const Checksum& checksum) const;
public:
//! Compare checksum and this for inequality.
bool operator!=(const Checksum& checksum) const;
// ----------------------------------------------------------------------
// Public instance methods
// ----------------------------------------------------------------------
//! Update the checksum value by accumulating words in the given data.
//!
//! \important The data and data-length passed to this method are specifically
//! those over which the update is made, rather than the entire
//! file. Typically, therefore, `data` will be a pointer to the
//! byte given by the offset, e.g. `&file_buffer[offset]`.
//!
void update(const U8* const data, //!< Beginning of the data over which to update.
const U32 offset, //!< Offset into the file at which the data begins.
const U32 length //!< Length of the update data in bytes.
);
//! Assign checksum to this.
Checksum& operator=(const Checksum& checksum);
//! Get the checksum value
U32 getValue() const;
//! Compare checksum and this for equality.
bool operator==(const Checksum& checksum) const;
private:
// ----------------------------------------------------------------------
// Private instance methods
// ----------------------------------------------------------------------
//! Compare checksum and this for inequality.
bool operator!=(const Checksum& checksum) const;
//! Add a four-byte aligned word to the checksum value
void addWordAligned(const U8* const word //! The word
);
//! Update the checksum value by accumulating words in the given data.
//!
//! \important The data and data-length passed to this method are specifically
//! those over which the update is made, rather than the entire
//! file. Typically, therefore, `data` will be a pointer to the
//! byte given by the offset, e.g. `&file_buffer[offset]`.
//!
void update(const U8* const data, //!< Beginning of the data over which to update.
const U32 offset, //!< Offset into the file at which the data begins.
const U32 length //!< Length of the update data in bytes.
);
//! Add a four-byte unaligned word to the checksum value
void addWordUnaligned(const U8* const word, //! The word
const U8 position, //! The position of the word relative to the start of the file
const U8 length //! The number of valid bytes in the word
);
//! Get the checksum value
U32 getValue() const;
//! Add byte to value at offset in word
void addByteAtOffset(const U8 byte, //! The byte
const U8 offset //! The offset
);
private:
private:
// ----------------------------------------------------------------------
// Private member variables
// ----------------------------------------------------------------------
// ----------------------------------------------------------------------
// Private instance methods
// ----------------------------------------------------------------------
//! The accumulated checksum value
U32 m_value;
};
//! Add a four-byte aligned word to the checksum value
void addWordAligned(
const U8 *const word //! The word
);
//! Add a four-byte unaligned word to the checksum value
void addWordUnaligned(
const U8 *const word, //! The word
const U8 position, //! The position of the word relative to the start of the file
const U8 length //! The number of valid bytes in the word
);
//! Add byte to value at offset in word
void addByteAtOffset(
const U8 byte, //! The byte
const U8 offset //! The offset
);
private:
// ----------------------------------------------------------------------
// Private member variables
// ----------------------------------------------------------------------
//! The accumulated checksum value
U32 m_value;
};
}
} // namespace CFDP
#endif

View File

@ -1,4 +1,4 @@
// ======================================================================
// ======================================================================
// \title CFDP/Checksum/GTest/Checksums.cpp
// \author bocchino
// \brief cpp file for CFDP Checksum gtest utilities
@ -7,26 +7,21 @@
// Copyright (C) 2016, California Institute of Technology.
// ALL RIGHTS RESERVED. United States Government Sponsorship
// acknowledged.
//
// ======================================================================
//
// ======================================================================
#include "CFDP/Checksum/GTest/Checksums.hpp"
namespace CFDP {
namespace GTest {
void Checksums ::
compare(
const CFDP::Checksum& expected,
const CFDP::Checksum& actual
)
{
const U32 expectedValue = expected.getValue();
const U32 actualValue = actual.getValue();
ASSERT_EQ(expectedValue, actualValue);
}
}
namespace GTest {
void Checksums ::compare(const CFDP::Checksum& expected, const CFDP::Checksum& actual) {
const U32 expectedValue = expected.getValue();
const U32 actualValue = actual.getValue();
ASSERT_EQ(expectedValue, actualValue);
}
} // namespace GTest
} // namespace CFDP

View File

@ -1,4 +1,4 @@
// ======================================================================
// ======================================================================
// \title CFDP/Checksum/GTest/Checksums.hpp
// \author bocchino
// \brief hpp file for CFDP Checksum gtest utilities
@ -7,8 +7,8 @@
// Copyright (C) 2016 California Institute of Technology.
// ALL RIGHTS RESERVED. United States Government Sponsorship
// acknowledged.
//
// ======================================================================
//
// ======================================================================
#ifndef GTest_CFDP_Checksums_HPP
#define GTest_CFDP_Checksums_HPP
@ -19,21 +19,20 @@
namespace CFDP {
namespace GTest {
namespace GTest {
//! Utilities for testing Checksum operations
//!
namespace Checksums {
//! Utilities for testing Checksum operations
//!
namespace Checksums {
void compare(
const CFDP::Checksum& expected, //!< Expected value
const CFDP::Checksum& actual //!< Actual value
);
}
}
void compare(const CFDP::Checksum& expected, //!< Expected value
const CFDP::Checksum& actual //!< Actual value
);
}
} // namespace GTest
} // namespace CFDP
#endif

View File

@ -1,5 +1,5 @@
// ----------------------------------------------------------------------
// Main.cpp
// Main.cpp
// ----------------------------------------------------------------------
#include "gtest/gtest.h"
@ -8,49 +8,47 @@
using namespace CFDP;
const U8 data[] = { 0, 1, 2, 3, 4, 5, 6, 7, 8 };
const U8 data[] = {0, 1, 2, 3, 4, 5, 6, 7, 8};
const U32 expectedValue =
(data[0] << 3*8) + (data[1] << 2*8) + (data[2] << 1*8) + data[3] +
(data[4] << 3*8) + (data[5] << 2*8) + (data[6] << 1*8) + data[7];
const U32 expectedValue = (data[0] << 3 * 8) + (data[1] << 2 * 8) + (data[2] << 1 * 8) + data[3] + (data[4] << 3 * 8) +
(data[5] << 2 * 8) + (data[6] << 1 * 8) + data[7];
TEST(Checksum, OnePacket) {
Checksum checksum;
checksum.update(data, 0, 8);
ASSERT_EQ(expectedValue, checksum.getValue());
Checksum checksum;
checksum.update(data, 0, 8);
ASSERT_EQ(expectedValue, checksum.getValue());
}
TEST(Checksum, TwoPacketsAligned) {
Checksum checksum;
checksum.update(&data[0], 0, 4);
checksum.update(&data[4], 4, 4);
ASSERT_EQ(expectedValue, checksum.getValue());
Checksum checksum;
checksum.update(&data[0], 0, 4);
checksum.update(&data[4], 4, 4);
ASSERT_EQ(expectedValue, checksum.getValue());
}
TEST(Checksum, TwoPacketsUnaligned1) {
Checksum checksum;
checksum.update(&data[0], 0, 3);
checksum.update(&data[3], 3, 5);
ASSERT_EQ(expectedValue, checksum.getValue());
Checksum checksum;
checksum.update(&data[0], 0, 3);
checksum.update(&data[3], 3, 5);
ASSERT_EQ(expectedValue, checksum.getValue());
}
TEST(Checksum, TwoPacketsUnaligned2) {
Checksum checksum;
checksum.update(&data[0], 0, 5);
checksum.update(&data[5], 5, 3);
ASSERT_EQ(expectedValue, checksum.getValue());
Checksum checksum;
checksum.update(&data[0], 0, 5);
checksum.update(&data[5], 5, 3);
ASSERT_EQ(expectedValue, checksum.getValue());
}
TEST(Checksum, ThreePackets) {
Checksum checksum;
checksum.update(&data[0], 0, 2);
checksum.update(&data[2], 2, 3);
checksum.update(&data[5], 5, 3);
ASSERT_EQ(expectedValue, checksum.getValue());
Checksum checksum;
checksum.update(&data[0], 0, 2);
checksum.update(&data[2], 2, 3);
checksum.update(&data[5], 5, 3);
ASSERT_EQ(expectedValue, checksum.getValue());
}
int main(int argc, char **argv) {
::testing::InitGoogleTest(&argc, argv);
return RUN_ALL_TESTS();
int main(int argc, char** argv) {
::testing::InitGoogleTest(&argc, argv);
return RUN_ALL_TESTS();
}

View File

@ -16,20 +16,11 @@ Specific Ways to Contribute:
- [Ask a Question or Suggest Improvements](https://github.com/nasa/fprime/discussions/new)
- [Report a Bug or Mistake](https://github.com/nasa/fprime/issues/new/choose)
- [Review Contributions](https://github.com/nasa/fprime/pulls)
- Submit a Pull Request
- Submit a Pull Request see: [Code Contribution Process](#cod-ontribution-process)
- Contribute to Ongoing Discussions and Reviews
Feel free to contribute any way that suits your skills and enjoy.
> **Note:** [F´ Autocoder Python](https://github.com/nasa/fprime/tree/master/Autocoders) is being actively replaced
> by [FPP](https://github.com/fprime-community/fpp). Thus we will no longer accept changes to this code except for
> security and critical bug fixes done in the most minimal fashion.
>
> We do love Python fixes, please consider contributing to
> [fprime-tools](https://github.com/fprime-community/fprime-tools) or
> [fprime-gds](https://github.com/fprime-community/fprime-gds)
## Where to Start
First, contributors should build some understanding of F´. Read through the documentation, try a tutorial, or run a
@ -44,28 +35,13 @@ with an [easy first issue](https://github.com/nasa/fprime/issues?q=is%3Aissue+is
When starting to modify F´ directly, ask questions, seek help, and be patient. Remember to review the project structure,
development process, and helpful tips sections below.
## Project Structure
## Code Contribution Process
The F´ project is designed as a base software [framework](https://github.com/nasa/fprime) with additional
[packages](https://github.com/fprime-community) designed to extend the framework. This means that occasionally we may
move contributions in or out of these packages.
All code contributions to F´ begin with an issue. Whether you're fixing a bug, adding a feature, or improving documentation, please start by opening an issue describing your proposal. The Change Control Board (CCB) reviews and approves issues before work begins to ensure alignment with project goals and standards. Once approved, you can proceed with implementation and submit a pull request (PR).
Key packages include:
If a PR is opened for work that does not correspond to an approved issue, the PR will be routed through the CCB process first—reviewed on a best-effort basis—and may be delayed or declined depending on CCB decisions.You can read more about how this process works in the [F´ Governance document](https://github.com/nasa/fprime/blob/devel/GOVERNANCE.md).
- [fpp](https://github.com/fprime-community/fpp): fpp development repository
- [fprime-tools](https://github.com/fprime-community/fprime-tools): `fprime-util` development repository
- [fprime-gds](https://github.com/fprime-community/fprime-gds): `fprime-gds` development repository
### F´ Repository Structure
Contributors to the [fprime](https://github.com/nasa/fprime) repository should understand the following key folders:
- [docs/UsersGuide](https://github.com/nasa/fprime/tree/devel/docs/UsersGuide): add new documentation in this or a subfolder
- [Fw](https://github.com/nasa/fprime/tree/devel/Fw): changes here will be reviewed carefully because this code is critical across F
- [Ref](https://github.com/nasa/fprime/tree/devel/Ref): update and maintain the Reference application here
## Development Process
### Development Process
F´ follows a standard git flow development model. Developers should start with a
[fork](https://docs.github.com/en/get-started/quickstart/fork-a-repo) of one of the F´ repositories and then develop
@ -84,6 +60,11 @@ git checkout -b <desired branch name>
Once a pull request has been submitted the following process will begin.
**Best practice: commit messages and PRs**
We recommend users to use an [imperative-style phrasing](https://cbea.ms/git-commit/#imperative) when writing commit messages. F´ uses the "Squash & Merge" strategy, meaning that all commits made on a PR branch will be combined into one squashed commit when merged into F´. The commit message for the squashed commit defaults to use the title of the Pull Request, so we do ask contributors to please follow the imperative-style phrasing for the title of their Pull Requests.
When opening a Pull Request, please fill in the given template, and link to any relevant issue on the repository.
### Submission Review
The pull request changes will be reviewed by the team and community supporting F´. Often this means that a discussion on
@ -121,13 +102,31 @@ The checks are configured to run on the `devel` branch of each external reposito
Maintainers will gladly help you in this process.
## Final Approval and Submission
### Final Approval and Submission
Once all corrections have been made, automated checks are passing, and a maintainer has given final approval, it is time
to contribute the submission. A maintainer will handle this final step and once complete changes should appear in the
`devel` branch. You can help this process by submitting any deferred or future work items as issues using the links
above.
## Project Structure
The F´ project is designed as a base software [framework](https://github.com/nasa/fprime) with additional
[packages](https://github.com/fprime-community) designed to extend the framework. This means that occasionally we may
move contributions in or out of these packages.
Key packages include:
- [fpp](https://github.com/fprime-community/fpp): fpp development repository
- [fprime-tools](https://github.com/fprime-community/fprime-tools): `fprime-util` development repository
- [fprime-gds](https://github.com/fprime-community/fprime-gds): `fprime-gds` development repository
### F´ Repository Structure
Contributors to the [fprime](https://github.com/nasa/fprime) repository should refer to the following guide to understand the repository structure: [A Tour of the Source Tree](docs/user-manual/overview/source-tree.md)
## Helpful Tips
This section will describe some helpful tips for contributing to F´.
@ -141,42 +140,54 @@ changes across many files.
Keep in mind that editors that fix whitespace automatically can cause many small changes. Even with advanced GitHub
tools this can increase the effort required to review a submission. Be careful with the changes you are submitting.
## Run Tests
### Run Tests
The automatic checking system will run all our unit tests and integration tests across several systems. However, this
process will take time. Try to run the unit tests locally during development before submitting a PR and use the
automatic checks as a safety net.
Building and running the tests has the same Python virtual environment requirements as developing an F´ project, which
is usually set up by fprime-bootstrap. Steps to set up the environment outside a project are included below.
The tests can be run using the following commands:
```bash
# Go into the fprime directory
cp MY_FPRIME_DIRECTORY
cd MY_FPRIME_DIRECTORY
# Run CI tests on fprime
./ci/tests/Framework.bash
# Set up and activate a Python virtual environment, if none already:
python3 -m venv .venv
source .venv/bin/activate
# Run CI tests on the reference application
./ci/tests/Ref.bash
# Make sure Python packages from ./requirements.txt are installed and up-to-date:
pip install -Ur requirements.txt
# Initialize googletest submodule:
git submodule update --init --recursive
# Run the static analyzer with the basic configuration
# Purge unit test directory
fprime-util purge
# Generate the build files for clang-tidy. Make sure clang-tidy is installed.
fprime-util generate --ut -DCMAKE_CXX_CLANG_TIDY=clang-tidy-12
# Generate the build files. Using clang-tidy is optional, but recommended to match the CI checks.
# On macOS, expect a CMake Warning 'Leak sanitizer is not supported on macOS in cmake/sanitizers.cmake'
fprime-util generate --ut -DCMAKE_CXX_CLANG_TIDY=clang-tidy
# Build fprime with the static analyzer
fprime-util build --all --ut -j16
fprime-util build --all --ut
# Run the static analyzer with additional flight code checks
# Purge release directory
fprime-util purge
# Generate the build files for clang-tidy. Make sure clang-tidy is installed.
fprime-util generate -DCMAKE_CXX_CLANG_TIDY="clang-tidy-12;--config-file=$PWD/release.clang-tidy"
# Build fprime with the static analyzer
fprime-util build --all -j16
# Run Unit Tests
fprime-util check --all
```
## Development with modified FPP version
### Code formatting
The F´ repository enforces formatting with `clang-format`. Most IDEs offer tools to format on demand or auto-format on "Save". To run formatting yourself, `fprime-util` provides a quick way to format all files that have been modified since you branched off of `devel`:
```bash
git diff --name-only devel...HEAD | fprime-util format --stdin
```
### Development with modified FPP version
In case FPP needs to be locally changed, first uninstall all `fprime-fpp-*` `pip` packages, and install FPP
using the procedure mentioned in the [FPP readme](https://github.com/nasa/fpp/blob/main/compiler/README.adoc).
@ -190,5 +201,5 @@ cp MY_FPRIME_DIRECTORY
# Generate the build files without checking the FPP version
fprime-util generate -DFPRIME_SKIP_TOOLS_VERSION_CHECK=1
# Build the project
fprime-util build -j4
```
fprime-util build
```

View File

@ -0,0 +1,52 @@
// ======================================================================
// \title AsyncByteStreamBufferAdapter.cpp
// \author bocchino
// \brief cpp file for AsyncByteStreamBufferAdapter component implementation class
// ======================================================================
#include "Drv/AsyncByteStreamBufferAdapter/AsyncByteStreamBufferAdapter.hpp"
namespace Drv {
// ----------------------------------------------------------------------
// Component construction and destruction
// ----------------------------------------------------------------------
AsyncByteStreamBufferAdapter::AsyncByteStreamBufferAdapter(const char* const compName)
: AsyncByteStreamBufferAdapterComponentBase(compName) {}
AsyncByteStreamBufferAdapter::~AsyncByteStreamBufferAdapter() {}
// ----------------------------------------------------------------------
// Handler implementations for typed input ports
// ----------------------------------------------------------------------
void AsyncByteStreamBufferAdapter::bufferIn_handler(FwIndexType portNum, Fw::Buffer& fwBuffer) {
// TODO: If m_driverIsReady then send fwBuffer on toByteStreamDriver_out
// TODO: Otherwise
// TODO: Log the error
// TODO: Send fwBuffer on bufferInReturn_out
}
void AsyncByteStreamBufferAdapter::bufferOutReturn_handler(FwIndexType portNum, Fw::Buffer& fwBuffer) {
// TODO: Send fwBuffer on fromByteStreamDriverReturn_out
}
void AsyncByteStreamBufferAdapter::byteStreamDriverReady_handler(FwIndexType portNum) {
this->m_driverIsReady = true;
}
void AsyncByteStreamBufferAdapter::fromByteStreamDriver_handler(FwIndexType portNum,
Fw::Buffer& buffer,
const Drv::ByteStreamStatus& status) {
// TODO: If the status is OK, then send buffer on toByteStreamDriver_out
// TODO: Otherwise log the error and send buffer on fromByteStreamDriverReturn_out
}
void AsyncByteStreamBufferAdapter::toByteStreamDriverReturn_handler(FwIndexType portNum,
Fw::Buffer& buffer,
const Drv::ByteStreamStatus& status) {
// TODO: Send fwBuffer on bufferInReturn_out
}
} // namespace Drv

View File

@ -0,0 +1,33 @@
module Drv {
@ A passive component for mediating between the AsyncByteStreamDriver
@ interface and the PassiveBufferDriver interface
@
@ Sample topology:
@
@ -----------------------------------------------------------
@ | |
@ | AsyncByteStreamDriver <--> AsyncByteStreamBufferAdapter | <--> PassiveBufferDriverClient
@ | |
@ -----------------------------------------------------------
@
@ The two components in the box function together as a PassiveBufferDriver:
@
@ -------------------------------------------------
@ | |
@ | PassiveBufferDriver | <--> PassiveBufferDriverClient
@ | |
@ -------------------------------------------------
@
passive component AsyncByteStreamBufferAdapter {
@ AsyncByteStreamBufferAdapter is a passive client of the
@ AsyncByteStreamDriver interface
import PassiveAsyncByteStreamDriverClient
@ AsyncByteStreamBufferAdapter is a PassiveBufferDriver
import PassiveBufferDriver
}
}

View File

@ -0,0 +1,80 @@
// ======================================================================
// \title AsyncByteStreamBufferAdapter.hpp
// \author bocchino
// \brief hpp file for AsyncByteStreamBufferAdapter component implementation class
// ======================================================================
#ifndef Drv_AsyncByteStreamBufferAdapter_HPP
#define Drv_AsyncByteStreamBufferAdapter_HPP
#include "Drv/AsyncByteStreamBufferAdapter/AsyncByteStreamBufferAdapterComponentAc.hpp"
namespace Drv {
class AsyncByteStreamBufferAdapter final : public AsyncByteStreamBufferAdapterComponentBase {
public:
// ----------------------------------------------------------------------
// Component construction and destruction
// ----------------------------------------------------------------------
//! Construct AsyncByteStreamBufferAdapter object
AsyncByteStreamBufferAdapter(const char* const compName //!< The component name
);
//! Destroy AsyncByteStreamBufferAdapter object
~AsyncByteStreamBufferAdapter();
private:
// ----------------------------------------------------------------------
// Handler implementations for typed input ports
// ----------------------------------------------------------------------
//! Handler implementation for bufferIn
//!
//! Port for receiving buffers
void bufferIn_handler(FwIndexType portNum, //!< The port number
Fw::Buffer& fwBuffer //!< The buffer
) override;
//! Handler implementation for bufferOutReturn
//!
//! Port for receiving buffers sent on bufferOut and then returned
void bufferOutReturn_handler(FwIndexType portNum, //!< The port number
Fw::Buffer& fwBuffer //!< The buffer
) override;
//! Handler implementation for byteStreamDriver
//!
//! Port for receiving ready signals from the driver
//! Sample connection: byteStreamDriver.ready -> byteStreamDriverClient.byteStreamReady
void byteStreamDriverReady_handler(FwIndexType portNum //!< The port number
) override;
//! Handler implementation for fromByteStreamDriver
//!
//! Port for receiving data from the driver
//! Sample connection: byteStreamDriver.$recv -> byteStreamDriverClient.fromDriver
void fromByteStreamDriver_handler(FwIndexType portNum, //!< The port number
Fw::Buffer& buffer,
const Drv::ByteStreamStatus& status) override;
//! Handler implementation for toByteStreamDriverReturn
//!
//! Port for receiving buffers sent on toByteStreamDriver and then returned
//! Sample connection: driver.sendReturnOut -> client.toByteStreamDriverReturn
void toByteStreamDriverReturn_handler(FwIndexType portNum, //!< The port number
Fw::Buffer& buffer,
const Drv::ByteStreamStatus& status) override;
private:
// ----------------------------------------------------------------------
// Private member variables
// ----------------------------------------------------------------------
//! Whether the driver is ready
bool m_driverIsReady = false;
};
} // namespace Drv
#endif

View File

@ -0,0 +1,10 @@
set(SOURCE_FILES
"${CMAKE_CURRENT_LIST_DIR}/AsyncByteStreamBufferAdapter.fpp"
"${CMAKE_CURRENT_LIST_DIR}/AsyncByteStreamBufferAdapter.cpp"
)
set(MOD_DEPS
"Fw/Logger"
)
register_fprime_module()

View File

@ -0,0 +1,47 @@
// ======================================================================
// \title ByteStreamBufferAdapter.cpp
// \author bocchino
// \brief cpp file for ByteStreamBufferAdapter component implementation class
// ======================================================================
#include "Drv/ByteStreamBufferAdapter/ByteStreamBufferAdapter.hpp"
namespace Drv {
// ----------------------------------------------------------------------
// Component construction and destruction
// ----------------------------------------------------------------------
ByteStreamBufferAdapter::ByteStreamBufferAdapter(const char* const compName)
: ByteStreamBufferAdapterComponentBase(compName) {}
ByteStreamBufferAdapter::~ByteStreamBufferAdapter() {}
// ----------------------------------------------------------------------
// Handler implementations for typed input ports
// ----------------------------------------------------------------------
void ByteStreamBufferAdapter::bufferIn_handler(FwIndexType portNum, Fw::Buffer& fwBuffer) {
// TODO: If m_driverIsReady then
// TODO: Send fwBuffer on toByteStreamDriver_out
// TODO: Check the return status. If there is an error, then log it to the Logger.
// TODO: Otherwise log the error
// TODO: Send fwBuffer on bufferInReturn_out
}
void ByteStreamBufferAdapter::bufferOutReturn_handler(FwIndexType portNum, Fw::Buffer& fwBuffer) {
// TODO: Send fwBuffer on fromByteStreamDriverReturn_out
}
void ByteStreamBufferAdapter::fromByteStreamDriver_handler(FwIndexType portNum,
Fw::Buffer& buffer,
const Drv::ByteStreamStatus& status) {
// TODO: If the status is OK, then send buffer on toByteStreamDriver_out
// TODO: Otherwise log the error and send buffer on fromByteStreamDriverReturn_out
}
void ByteStreamBufferAdapter::byteStreamDriverReady_handler(FwIndexType portNum) {
this->m_driverIsReady = true;
}
} // namespace Drv

View File

@ -0,0 +1,33 @@
module Drv {
@ A passive component for mediating between the ByteStreamDriver
@ interface and the PassiveBufferDriver interface
@
@ Sample topology:
@
@ -------------------------------------------------
@ | |
@ | ByteStreamDriver <--> ByteStreamBufferAdapter | <--> PassiveBufferDriverClient
@ | |
@ -------------------------------------------------
@
@ The two components in the box function together as a PassiveBufferDriver:
@
@ -------------------------------------------------
@ | |
@ | PassiveBufferDriver | <--> PassiveBufferDriverClient
@ | |
@ -------------------------------------------------
@
passive component ByteStreamBufferAdapter {
@ ByteStreamBufferAdapter is a passive client of the ByteStreamDriver
@ interface
import PassiveByteStreamDriverClient
@ ByteStreamBufferAdapter is a PassiveBufferDriver
import PassiveBufferDriver
}
}

View File

@ -0,0 +1,72 @@
// ======================================================================
// \title ByteStreamBufferAdapter.hpp
// \author bocchino
// \brief hpp file for ByteStreamBufferAdapter component implementation class
// ======================================================================
#ifndef Drv_ByteStreamBufferAdapter_HPP
#define Drv_ByteStreamBufferAdapter_HPP
#include "Drv/ByteStreamBufferAdapter/ByteStreamBufferAdapterComponentAc.hpp"
namespace Drv {
class ByteStreamBufferAdapter final : public ByteStreamBufferAdapterComponentBase {
public:
// ----------------------------------------------------------------------
// Component construction and destruction
// ----------------------------------------------------------------------
//! Construct ByteStreamBufferAdapter object
ByteStreamBufferAdapter(const char* const compName //!< The component name
);
//! Destroy ByteStreamBufferAdapter object
~ByteStreamBufferAdapter();
private:
// ----------------------------------------------------------------------
// Handler implementations for typed input ports
// ----------------------------------------------------------------------
//! Handler implementation for bufferIn
//!
//! Port for receiving buffers
void bufferIn_handler(FwIndexType portNum, //!< The port number
Fw::Buffer& fwBuffer //!< The buffer
) override;
//! Handler implementation for bufferOutReturn
//!
//! Port for receiving buffers sent on bufferOut and then returned
void bufferOutReturn_handler(FwIndexType portNum, //!< The port number
Fw::Buffer& fwBuffer //!< The buffer
) override;
//! Handler implementation for byteStreamIn
//!
//! Port for receiving data from the driver
//! Sample connection: byteStreamDriver.$recv -> byteStreamDriverClient.byteStreamIn
void fromByteStreamDriver_handler(FwIndexType portNum, //!< The port number
Fw::Buffer& buffer,
const Drv::ByteStreamStatus& status) override;
//! Handler implementation for byteStreamReady
//!
//! Port for receiving ready signals from the driver
//! Sample connection: byteStreamDriver.ready -> byteStreamDriverClient.byteStreamDriverReady
void byteStreamDriverReady_handler(FwIndexType portNum //!< The port number
) override;
private:
// ----------------------------------------------------------------------
// Private member variables
// ----------------------------------------------------------------------
//! Whether the driver is ready
bool m_driverIsReady = false;
};
} // namespace Drv
#endif

View File

@ -0,0 +1,10 @@
set(SOURCE_FILES
"${CMAKE_CURRENT_LIST_DIR}/ByteStreamBufferAdapter.fpp"
"${CMAKE_CURRENT_LIST_DIR}/ByteStreamBufferAdapter.cpp"
)
set(MOD_DEPS
"Fw/Logger"
)
register_fprime_module()

View File

@ -1,7 +1,7 @@
module Drv {
@ Status returned by the send call
enum ByteStreamStatus {
enum ByteStreamStatus : U8 {
OP_OK @< Operation worked as expected
SEND_RETRY @< Data send should be retried
RECV_NO_DATA @< Receive worked, but there was no data

View File

@ -37,7 +37,7 @@ The following components implement the byte stream model using the synchronous i
- [`Drv::TcpClient`](../../TcpClient/docs/sdd.md): a F´ component wrapper of the tcp client
- [`Drv::TcpServer`](../../TcpServer/docs/sdd.md): a F´ component wrapper of the tcp server
- [`Drv::Udp`](../../Udp/docs/sdd.md): a F´ component wrapper of the udp
- `Drv::LinuxUartDriver`
- [`Drv::LinuxUartDriver`](../../LinuxUartDriver/docs/sdd.md): a F´ component wrapper of the Linux UART driver
## Requirements

View File

@ -5,11 +5,13 @@ add_fprime_subdirectory("${CMAKE_CURRENT_LIST_DIR}/Interfaces/")
add_fprime_subdirectory("${CMAKE_CURRENT_LIST_DIR}/Ports/")
# Components
add_fprime_subdirectory("${CMAKE_CURRENT_LIST_DIR}/AsyncByteStreamBufferAdapter/")
add_fprime_subdirectory("${CMAKE_CURRENT_LIST_DIR}/ByteStreamBufferAdapter/")
add_fprime_subdirectory("${CMAKE_CURRENT_LIST_DIR}/ByteStreamDriverModel/")
add_fprime_subdirectory("${CMAKE_CURRENT_LIST_DIR}/LinuxGpioDriver/")
add_fprime_subdirectory("${CMAKE_CURRENT_LIST_DIR}/LinuxUartDriver/")
add_fprime_subdirectory("${CMAKE_CURRENT_LIST_DIR}/LinuxSpiDriver/")
add_fprime_subdirectory("${CMAKE_CURRENT_LIST_DIR}/LinuxI2cDriver/")
add_fprime_subdirectory("${CMAKE_CURRENT_LIST_DIR}/LinuxSpiDriver/")
add_fprime_subdirectory("${CMAKE_CURRENT_LIST_DIR}/LinuxUartDriver/")
add_fprime_subdirectory("${CMAKE_CURRENT_LIST_DIR}/Ip/")
add_fprime_subdirectory("${CMAKE_CURRENT_LIST_DIR}/TcpClient/")

View File

@ -12,6 +12,11 @@ register_fprime_module(
"${CMAKE_CURRENT_LIST_DIR}/ByteStreamDriver.fpp"
"${CMAKE_CURRENT_LIST_DIR}/Gpio.fpp"
"${CMAKE_CURRENT_LIST_DIR}/I2c.fpp"
"${CMAKE_CURRENT_LIST_DIR}/PassiveAsyncByteStreamDriverClient.fpp"
"${CMAKE_CURRENT_LIST_DIR}/PassiveBufferDriver.fpp"
"${CMAKE_CURRENT_LIST_DIR}/PassiveBufferDriverClient.fpp"
"${CMAKE_CURRENT_LIST_DIR}/PassiveByteStreamDriverClient.fpp"
"${CMAKE_CURRENT_LIST_DIR}/PassiveByteStreamDriverClientReadyRecv.fpp"
"${CMAKE_CURRENT_LIST_DIR}/Spi.fpp"
"${CMAKE_CURRENT_LIST_DIR}/Tick.fpp"
INTERFACE

View File

@ -0,0 +1,25 @@
module Drv {
@ The send interface of passive client of an asynchronous byte stream driver
interface PassiveByteStreamDriverClientSendAsync {
@ Port for sending data to the driver
@ Sample connection: client.toByteStreamDriver -> driver.$send
output port toByteStreamDriver: Fw.BufferSend
@ Port for receiving buffers sent on toByteStreamDriver and then returned
@ Sample connection: driver.sendReturnOut -> client.toByteStreamDriverReturn
sync input port toByteStreamDriverReturn: Drv.ByteStreamData
}
@ A passive client of an asynchronous byte stream driver
interface PassiveAsyncByteStreamDriverClient {
import PassiveByteStreamDriverClientReadyRecv
import PassiveByteStreamDriverClientSendAsync
}
}

View File

@ -0,0 +1,14 @@
module Drv {
@ A passive buffer driver
interface PassiveBufferDriver {
@ The interface for sending data to the driver
import Fw.PassiveBufferIn
@ The interface for receiving data from the driver
import Fw.PassiveBufferOut
}
}

View File

@ -0,0 +1,40 @@
module Drv {
@ The send interface of passive client of a buffer driver
interface PassiveBufferDriverClientSend {
@ Port for sending data to the driver
@ Sample connection: client.toBufferDriver -> driver.bufferIn
output port toBufferDriver: Fw.BufferSend
@ Port for receiving buffers sent on toBufferDriver and then returned
@ Sample connection: driver.bufferInReturn -> client.toBufferDriverReturn
sync input port toBufferDriverReturn: Fw.BufferSend
}
@ The receive interface of passive client of a buffer driver
interface PassiveBufferDriverClientRecv {
@ Port for receiving data from the driver
@ Sample connection: driver.bufferOut -> client.fromBufferDriver
sync input port fromBufferDriver: Fw.BufferSend
@ Port for returning buffers received on fromBufferDriver
@ Sample connection: client.fromBufferDriverReturn -> driver.bufferOutReturn
output port fromBufferDriverReturn: Fw.BufferSend
}
@ A passive client of a buffer driver
interface PassiveBufferDriverClient {
@ The interface for sending data to the driver
import PassiveBufferDriverClientSend
@ The interface for receiving data from the driver
import PassiveBufferDriverClientRecv
}
}

View File

@ -0,0 +1,22 @@
module Drv {
@ The send interface of passive client of a synchronous byte stream driver
interface PassiveByteStreamDriverClientSendSync {
@ Port for sending data to the driver
@ Sample connection: client.toByteStreamDriver -> driver.$send
output port toByteStreamDriver: Drv.ByteStreamSend
}
@ A passive client of a synchronous byte stream driver
interface PassiveByteStreamDriverClient {
@ The ready and receive interfaces
import PassiveByteStreamDriverClientReadyRecv
@ The send interface
import PassiveByteStreamDriverClientSendSync
}
}

View File

@ -0,0 +1,26 @@
module Drv {
@ The ready and receive interfaces for a byte stream driver client
interface PassiveByteStreamDriverClientReadyRecv {
# ----------------------------------------------------------------------
# Ready interface
# ----------------------------------------------------------------------
@ Port for receiving ready signals from the driver
@ Sample connection: byteStreamDriver.ready -> byteStreamDriverClient.byteStreamDriverReady
sync input port byteStreamDriverReady: Drv.ByteStreamReady
# ----------------------------------------------------------------------
# Receive interface
# ----------------------------------------------------------------------
@ Port for receiving data from the driver
@ Sample connection: byteStreamDriver.$recv -> byteStreamDriverClient.fromDriver
sync input port fromByteStreamDriver: Drv.ByteStreamData
@ Port for returning ownership of buffers received on fromDriver
@ Sample connection: byteStreamDriverClient.byteStreamReturn -> byteStreamDriver.recvReturnIn
output port fromByteStreamDriverReturn: Fw.BufferSend
}
}

View File

@ -1,5 +1,9 @@
module Drv {
interface Spi {
@ Port to perform a synchronous write/read operation over the SPI bus
guarded input port SpiWriteRead: Drv.SpiWriteRead
@ DEPRECATED Use SpiWriteRead port instead (same operation with a return value)
@ Port to perform a synchronous read/write operation over the SPI bus
sync input port SpiReadWrite: Drv.SpiReadWrite
}

View File

@ -129,14 +129,14 @@ SocketIpStatus IpSocket::open(SocketDescriptor& socketDescriptor) {
return status;
}
SocketIpStatus IpSocket::send(const SocketDescriptor& socketDescriptor, const U8* const data, const U32 size) {
SocketIpStatus IpSocket::send(const SocketDescriptor& socketDescriptor, const U8* const data, const FwSizeType size) {
FW_ASSERT(data != nullptr);
FW_ASSERT(size > 0);
U32 total = 0;
I32 sent = 0;
FwSizeType total = 0;
FwSignedSizeType sent = 0;
// Attempt to send out data and retry as necessary
for (U32 i = 0; (i < SOCKET_MAX_ITERATIONS) && (total < size); i++) {
for (FwSizeType i = 0; (i < SOCKET_MAX_ITERATIONS) && (total < size); i++) {
errno = 0;
// Send using my specific protocol
sent = this->sendProtocol(socketDescriptor, data + total, size - total);
@ -153,7 +153,7 @@ SocketIpStatus IpSocket::send(const SocketDescriptor& socketDescriptor, const U8
return SOCK_SEND_ERROR;
}
FW_ASSERT(sent > 0, static_cast<FwAssertArgType>(sent));
total += static_cast<U32>(sent);
total += static_cast<FwSizeType>(sent);
}
// Failed to retry enough to send all data
if (total < size) {
@ -164,16 +164,16 @@ SocketIpStatus IpSocket::send(const SocketDescriptor& socketDescriptor, const U8
return SOCK_SUCCESS;
}
SocketIpStatus IpSocket::recv(const SocketDescriptor& socketDescriptor, U8* data, U32& req_read) {
SocketIpStatus IpSocket::recv(const SocketDescriptor& socketDescriptor, U8* data, FwSizeType& req_read) {
// TODO: Uncomment FW_ASSERT for socketDescriptor.fd once we fix TcpClientTester to not pass in uninitialized
// socketDescriptor
// FW_ASSERT(socketDescriptor.fd != -1, static_cast<FwAssertArgType>(socketDescriptor.fd));
FW_ASSERT(data != nullptr);
I32 bytes_received_or_status; // Stores the return value from recvProtocol
FwSignedSizeType bytes_received_or_status; // Stores the return value from recvProtocol
// Loop primarily for EINTR. Other conditions should lead to an earlier exit.
for (U32 i = 0; i < SOCKET_MAX_ITERATIONS; i++) {
for (FwSizeType i = 0; i < SOCKET_MAX_ITERATIONS; i++) {
errno = 0;
// Pass the current value of req_read (max buffer size) to recvProtocol.
// recvProtocol returns bytes read or -1 on error.
@ -181,7 +181,7 @@ SocketIpStatus IpSocket::recv(const SocketDescriptor& socketDescriptor, U8* data
if (bytes_received_or_status > 0) {
// Successfully read data
req_read = static_cast<U32>(bytes_received_or_status);
req_read = static_cast<FwSizeType>(bytes_received_or_status);
return SOCK_SUCCESS;
} else if (bytes_received_or_status == 0) {
// Handle zero return based on protocol-specific behavior
@ -214,4 +214,22 @@ SocketIpStatus IpSocket::handleZeroReturn() {
return SOCK_DISCONNECTED;
}
SocketIpStatus IpSocket::setupSocketOptions(int socketFd) {
// Iterate over the socket options and set them
for (const auto& options : IP_SOCKET_OPTIONS) {
int status = 0;
if (options.type == SOCK_OPT_INT) {
status = setsockopt(socketFd, options.level, options.option, &options.value.intVal,
sizeof(options.value.intVal));
} else {
status = setsockopt(socketFd, options.level, options.option, &options.value.sizeVal,
sizeof(options.value.sizeVal));
}
if (status) {
return SOCK_FAILED_TO_SET_SOCKET_OPTIONS;
}
}
return SOCK_SUCCESS;
}
} // namespace Drv

View File

@ -116,7 +116,7 @@ class IpSocket {
* \param size: size of data to send
* \return status of the send, SOCK_DISCONNECTED to reopen, SOCK_SUCCESS on success, something else on error
*/
virtual SocketIpStatus send(const SocketDescriptor& socketDescriptor, const U8* const data, const U32 size);
virtual SocketIpStatus send(const SocketDescriptor& socketDescriptor, const U8* const data, const FwSizeType size);
/**
* \brief receive data from the IP socket from the given buffer
*
@ -133,7 +133,7 @@ class IpSocket {
* \param size: maximum size of data buffer to fill
* \return status of the send, SOCK_DISCONNECTED to reopen, SOCK_SUCCESS on success, something else on error
*/
SocketIpStatus recv(const SocketDescriptor& fd, U8* const data, U32& size);
SocketIpStatus recv(const SocketDescriptor& fd, U8* const data, FwSizeType& size);
/**
* \brief closes the socket
@ -198,7 +198,9 @@ class IpSocket {
* \param size: size of data to send
* \return: size of data sent, or -1 on error.
*/
virtual I32 sendProtocol(const SocketDescriptor& socketDescriptor, const U8* const data, const U32 size) = 0;
virtual FwSignedSizeType sendProtocol(const SocketDescriptor& socketDescriptor,
const U8* const data,
const FwSizeType size) = 0;
/**
* \brief Protocol specific implementation of recv. Called directly with error handling from recv.
@ -207,7 +209,9 @@ class IpSocket {
* \param size: size of data buffer
* \return: size of data received, or -1 on error.
*/
virtual I32 recvProtocol(const SocketDescriptor& socketDescriptor, U8* const data, const U32 size) = 0;
virtual FwSignedSizeType recvProtocol(const SocketDescriptor& socketDescriptor,
U8* const data,
const FwSizeType size) = 0;
/**
* \brief Handle zero return from recvProtocol
@ -220,6 +224,13 @@ class IpSocket {
*/
virtual SocketIpStatus handleZeroReturn();
/**
* \brief setup the socket options of the input socket as defined in IpCfg.hpp
* \param socketFd: socket file descriptor
* \return status of setup options
*/
SocketIpStatus setupSocketOptions(int socketFd);
U32 m_timeoutSeconds;
U32 m_timeoutMicroseconds;
U16 m_port; //!< IP address port used

View File

@ -21,10 +21,25 @@ SocketComponentHelper::SocketComponentHelper() {}
SocketComponentHelper::~SocketComponentHelper() {}
void SocketComponentHelper::start(const Fw::StringBase& name,
void SocketComponentHelper::start(const Fw::ConstStringBase& name,
const FwTaskPriorityType priority,
const Os::Task::ParamType stack,
const Os::Task::ParamType cpuAffinity) {
const Os::Task::ParamType cpuAffinity,
const FwTaskPriorityType priorityReconnect,
const Os::Task::ParamType stackReconnect,
const Os::Task::ParamType cpuAffinityReconnect) {
// Reconnect Thread
FW_ASSERT(m_reconnectTask.getState() ==
Os::Task::State::NOT_STARTED); // It is a coding error to start this task multiple times
this->m_reconnectStop = false;
Fw::String reconnectName;
reconnectName.format("%s_reconnect", name.toChar());
Os::Task::Arguments reconnectArguments(reconnectName, SocketComponentHelper::reconnectTask, this, priorityReconnect,
stackReconnect, cpuAffinityReconnect);
Os::Task::Status reconnectStat = m_reconnectTask.start(reconnectArguments);
FW_ASSERT(Os::Task::OP_OK == reconnectStat, static_cast<FwAssertArgType>(reconnectStat));
// Read Thread
FW_ASSERT(m_task.getState() ==
Os::Task::State::NOT_STARTED); // It is a coding error to start this task multiple times
this->m_stop = false;
@ -80,18 +95,19 @@ void SocketComponentHelper::setAutomaticOpen(bool auto_open) {
this->m_reopen = auto_open;
}
bool SocketComponentHelper::getAutomaticOpen() {
Os::ScopeLock scopedLock(this->m_lock);
return this->m_reopen;
}
SocketIpStatus SocketComponentHelper::reopen() {
SocketIpStatus status = SOCK_SUCCESS;
if (not this->isOpened()) {
// Check for auto-open before attempting to reopen
bool reopen = false;
{
Os::ScopeLock scopedLock(this->m_lock);
reopen = this->m_reopen;
}
// Open a network connection if it has not already been open
bool reopen = this->getAutomaticOpen();
if (not reopen) {
status = SOCK_AUTO_CONNECT_DISABLED;
// Open a network connection if it has not already been open
} else {
status = this->open();
if (status == SocketIpStatus::SOCK_ANOTHER_THREAD_OPENING) {
@ -102,22 +118,23 @@ SocketIpStatus SocketComponentHelper::reopen() {
return status;
}
SocketIpStatus SocketComponentHelper::send(const U8* const data, const U32 size) {
SocketIpStatus SocketComponentHelper::send(const U8* const data, const FwSizeType size) {
SocketIpStatus status = SOCK_SUCCESS;
this->m_lock.lock();
SocketDescriptor descriptor = this->m_descriptor;
this->m_lock.unlock();
// Prevent transmission before connection, or after a disconnect
if (descriptor.fd == -1) {
status = this->reopen();
// if reopen wasn't successful, pass the that up to the caller
if (status != SOCK_SUCCESS) {
return status;
this->requestReconnect();
SocketIpStatus reconnectStat = this->waitForReconnect();
if (reconnectStat == SOCK_SUCCESS) {
// Refresh local copy after reopen
this->m_lock.lock();
descriptor = this->m_descriptor;
this->m_lock.unlock();
} else {
return reconnectStat;
}
// Refresh local copy after reopen
this->m_lock.lock();
descriptor = this->m_descriptor;
this->m_lock.unlock();
}
status = this->getSocketHandler().send(descriptor, data, size);
if (status == SOCK_DISCONNECTED) {
@ -138,8 +155,15 @@ void SocketComponentHelper::close() {
this->m_open = OpenState::NOT_OPEN;
}
/* Read Thread */
Os::Task::Status SocketComponentHelper::join() {
return m_task.join();
Os::Task::Status stat = m_task.join();
Os::Task::Status reconnectStat = this->joinReconnect();
if (stat == Os::Task::Status::OP_OK) {
return reconnectStat;
}
return stat;
}
void SocketComponentHelper::stop() {
@ -148,6 +172,7 @@ void SocketComponentHelper::stop() {
Os::ScopeLock scopeLock(m_lock);
this->m_stop = true;
}
this->stopReconnect();
this->shutdown(); // Break out of any receives and fully shutdown
}
@ -157,7 +182,7 @@ bool SocketComponentHelper::running() {
return running;
}
SocketIpStatus SocketComponentHelper::recv(U8* data, U32& size) {
SocketIpStatus SocketComponentHelper::recv(U8* data, FwSizeType& size) {
SocketIpStatus status = SOCK_SUCCESS;
// Check for previously disconnected socket
this->m_lock.lock();
@ -178,30 +203,25 @@ void SocketComponentHelper::readLoop() {
do {
// Prevent transmission before connection, or after a disconnect
if ((not this->isOpened()) and this->running()) {
status = this->reopen();
this->requestReconnect();
status = this->waitForReconnect();
// When reopen is disabled, just break as this is a exit condition for the loop
if (status == SOCK_AUTO_CONNECT_DISABLED) {
break;
}
// If the reconnection failed in any other way, warn, wait, and retry
else if (status != SOCK_SUCCESS) {
Fw::Logger::log("[WARNING] Failed to open port with status %d and errno %d\n", status, errno);
(void)Os::Task::delay(SOCKET_RETRY_INTERVAL);
continue;
}
}
// If the network connection is open, read from it
if (this->isOpened() and this->running()) {
Fw::Buffer buffer = this->getBuffer();
U8* data = buffer.getData();
FW_ASSERT(data);
FW_ASSERT_NO_OVERFLOW(buffer.getSize(), U32);
U32 size = static_cast<U32>(buffer.getSize());
FwSizeType size = buffer.getSize();
// recv blocks, so it may have been a while since its done an isOpened check
status = this->recv(data, size);
if ((status != SOCK_SUCCESS) && (status != SOCK_INTERRUPTED_TRY_AGAIN) &&
(status != SOCK_NO_DATA_AVAILABLE)) {
Fw::Logger::log("[WARNING] Failed to recv from port with status %d and errno %d\n", status, errno);
Fw::Logger::log("[WARNING] %s failed to recv from port with status %d and errno %d\n",
this->m_task.getName().toChar(), status, errno);
this->close();
buffer.setSize(0);
} else {
@ -222,4 +242,124 @@ void SocketComponentHelper::readTask(void* pointer) {
SocketComponentHelper* self = reinterpret_cast<SocketComponentHelper*>(pointer);
self->readLoop();
}
/* Reconnect Thread */
Os::Task::Status SocketComponentHelper::joinReconnect() {
return m_reconnectTask.join();
}
void SocketComponentHelper::stopReconnect() {
Os::ScopeLock scopeLock(this->m_reconnectLock);
this->m_reconnectState = ReconnectState::NOT_RECONNECTING;
this->m_reconnectStop = true;
}
bool SocketComponentHelper::runningReconnect() {
Os::ScopeLock scopedLock(this->m_reconnectLock);
bool running = not this->m_reconnectStop;
return running;
}
void SocketComponentHelper::reconnectLoop() {
SocketIpStatus status = SOCK_SUCCESS;
while (this->runningReconnect()) {
// Check if we need to reconnect
bool reconnect = false;
{
Os::ScopeLock scopedLock(this->m_reconnectLock);
if (this->m_reconnectState == ReconnectState::REQUEST_RECONNECT) {
this->m_reconnectState = ReconnectState::RECONNECT_IN_PROGRESS;
reconnect = true;
}
// If we were already in or are now in RECONNECT_IN_PROGRESS we
// need to try to reconnect, again
else if (this->m_reconnectState == ReconnectState::RECONNECT_IN_PROGRESS) {
reconnect = true;
}
}
if (reconnect) {
status = this->reopen();
// Reopen Case 1: Auto Connect is disabled, so no longer
// try to reconnect
if (status == SOCK_AUTO_CONNECT_DISABLED) {
Os::ScopeLock scopedLock(this->m_reconnectLock);
this->m_reconnectState = ReconnectState::NOT_RECONNECTING;
}
// Reopen Case 2: Success, so no longer
// try to reconnect
else if (status == SOCK_SUCCESS) {
Os::ScopeLock scopedLock(this->m_reconnectLock);
this->m_reconnectState = ReconnectState::NOT_RECONNECTING;
}
// Reopen Case 3: Keep trying to reconnect - NO reconnect
// state change
else {
Fw::Logger::log("[WARNING] %s failed to open port with status %d and errno %d\n",
this->m_task.getName().toChar(), status, errno);
(void)Os::Task::delay(SOCKET_RETRY_INTERVAL);
}
} else {
// After a brief delay, we will loop again
(void)Os::Task::delay(this->m_reconnectCheckInterval);
}
}
}
void SocketComponentHelper::reconnectTask(void* pointer) {
FW_ASSERT(pointer);
SocketComponentHelper* self = reinterpret_cast<SocketComponentHelper*>(pointer);
self->reconnectLoop();
}
void SocketComponentHelper::requestReconnect() {
Os::ScopeLock scopedLock(this->m_reconnectLock);
if (m_reconnectState == ReconnectState::NOT_RECONNECTING) {
m_reconnectState = ReconnectState::REQUEST_RECONNECT;
}
return;
}
SocketIpStatus SocketComponentHelper::waitForReconnect(Fw::TimeInterval timeout) {
// Do not attempt to reconnect if auto reconnect config flag is disabled
if (!this->getAutomaticOpen()) {
return SOCK_AUTO_CONNECT_DISABLED;
}
Fw::TimeInterval elapsed = Fw::TimeInterval(0, 0);
while (elapsed < timeout) {
// If the reconnect thread is NOT reconnecting, we are done waiting
// If we are no longer running the reconnect thread, we are done waiting
{
Os::ScopeLock scopedLock(this->m_reconnectLock);
if (this->m_reconnectState == ReconnectState::NOT_RECONNECTING) {
break;
}
if (this->m_reconnectStop) {
break;
}
}
// Wait a bit before checking again
(void)Os::Task::delay(this->m_reconnectWaitInterval);
elapsed.add(this->m_reconnectWaitInterval.getSeconds(), this->m_reconnectWaitInterval.getUSeconds());
}
// If we have completed our loop, check if we are connected or if
// auto connect was disabled during our wait
if (this->isOpened()) {
return SOCK_SUCCESS;
}
// Check one more time if auto reconnect config flag got disabled
if (!this->getAutomaticOpen()) {
return SOCK_AUTO_CONNECT_DISABLED;
}
return SOCK_DISCONNECTED; // Indicates failure of this attempt, another reopen needed
}
} // namespace Drv

View File

@ -14,6 +14,7 @@
#include <Drv/Ip/IpSocket.hpp>
#include <Fw/Buffer/Buffer.hpp>
#include <Os/Condition.hpp>
#include <Os/Mutex.hpp>
#include <Os/Task.hpp>
@ -28,6 +29,7 @@ namespace Drv {
class SocketComponentHelper {
public:
enum OpenState { NOT_OPEN, OPENING, OPEN, SKIP };
enum ReconnectState { NOT_RECONNECTING, REQUEST_RECONNECT, RECONNECT_IN_PROGRESS };
/**
* \brief constructs the socket read task
*/
@ -47,15 +49,25 @@ class SocketComponentHelper {
* default behavior is to automatically open connections.
*
* \param name: name of the task
* \param priority: priority of the started task. See: Os::Task::start. Default: TASK_PRIORITY_DEFAULT, not
* \param priority: priority of the started read task. See: Os::Task::start. Default: TASK_PRIORITY_DEFAULT, not
* prioritized
* \param stack: stack size provided to the task. See: Os::Task::start. Default: TASK_DEFAULT, posix threads default
* \param cpuAffinity: cpu affinity provided to task. See: Os::Task::start. Default: TASK_DEFAULT, don't care
* \param stack: stack size provided to the read task. See: Os::Task::start. Default: TASK_DEFAULT, posix threads
* default
* \param cpuAffinity: cpu affinity provided to read task. See: Os::Task::start. Default: TASK_DEFAULT, don't care
* \param priorityReconnect: priority of the started reconnect task. See: Os::Task::start. Default:
* TASK_PRIORITY_DEFAULT, not prioritized
* \param stackReconnect: stack size provided to the reconnect task. See: Os::Task::start. Default: TASK_DEFAULT,
* posix threads default
* \param cpuAffinityReconnect: cpu affinity provided to reconnect task. See: Os::Task::start. Default:
* TASK_DEFAULT, don't care
*/
void start(const Fw::StringBase& name,
void start(const Fw::ConstStringBase& name,
const FwTaskPriorityType priority = Os::Task::TASK_PRIORITY_DEFAULT,
const Os::Task::ParamType stack = Os::Task::TASK_DEFAULT,
const Os::Task::ParamType cpuAffinity = Os::Task::TASK_DEFAULT);
const Os::Task::ParamType cpuAffinity = Os::Task::TASK_DEFAULT,
const FwTaskPriorityType priorityReconnect = Os::Task::TASK_PRIORITY_DEFAULT,
const Os::Task::ParamType stackReconnect = Os::Task::TASK_DEFAULT,
const Os::Task::ParamType cpuAffinityReconnect = Os::Task::TASK_DEFAULT);
/**
* \brief open the socket for communications
@ -91,6 +103,13 @@ class SocketComponentHelper {
*/
void setAutomaticOpen(bool auto_open);
/**
* \brief get socket automatically open connections status
*
* \return status of auto_open
*/
bool getAutomaticOpen();
/**
* \brief send data to the IP socket from the given buffer
*
@ -99,7 +118,7 @@ class SocketComponentHelper {
* \param size: size of data to send
* \return status of send, SOCK_SUCCESS for success, something else on error
*/
SocketIpStatus send(const U8* const data, const U32 size);
SocketIpStatus send(const U8* const data, const FwSizeType size);
/**
* \brief receive data from the IP socket from the given buffer
@ -109,7 +128,7 @@ class SocketComponentHelper {
* \param size: maximum size of data buffer to fill
* \return status of the send, SOCK_DISCONNECTED to reopen, SOCK_SUCCESS on success, something else on error
*/
SocketIpStatus recv(U8* data, U32& size);
SocketIpStatus recv(U8* data, FwSizeType& size);
/**
* \brief close the socket communications
@ -134,6 +153,7 @@ class SocketComponentHelper {
* \brief is the read loop running
*/
bool running();
bool runningReconnect();
/**
* \brief stop the socket read task and close the associated socket.
@ -143,6 +163,8 @@ class SocketComponentHelper {
*/
void stop();
void stopReconnect();
/**
* \brief joins to the stopping read task to wait for it to close
*
@ -153,11 +175,19 @@ class SocketComponentHelper {
*/
Os::Task::Status join();
Os::Task::Status joinReconnect();
protected:
/**
* \brief receive off the TCP socket
*/
virtual void readLoop();
/**
* \brief reconnect TCP socket
*/
virtual void reconnectLoop();
/**
* \brief returns a reference to the socket handler
*
@ -206,6 +236,33 @@ class SocketComponentHelper {
*/
static void readTask(void* pointer);
/**
* \brief a task designed for socket reconnection
*
* \param pointer: pointer to "this" component
*/
static void reconnectTask(void* pointer);
/**
* \brief signal to reconnect task that a reconnect is needed
*
*/
void requestReconnect();
/**
* \brief wait method for a task to wait for a reconnect request to complete
*
* After requesting a reconnect, tasks should call this method
* to wait for the reconnect thread to complete
*
*
* \param timeout: timeout so that the wait doesn't hang indefinitely
*
* \return status of the reconnect request, SOCK_DISCONNECTED for
* reopen again, or SOCK_SUCCESS on success, something else on error
*/
SocketIpStatus waitForReconnect(Fw::TimeInterval timeout = Fw::TimeInterval(1, 0));
private:
/**
* \brief Re-open port if it has been disconnected
@ -219,12 +276,24 @@ class SocketComponentHelper {
SocketIpStatus reopen();
protected:
bool m_reopen = true; //!< Force reopen on disconnect
SocketDescriptor m_descriptor;
// Read/recv
Os::Task m_task;
Os::Mutex m_lock;
SocketDescriptor m_descriptor;
bool m_reopen = true; //!< Force reopen on disconnect
bool m_stop = true; //!< Stops the task when set to true
OpenState m_open = OpenState::NOT_OPEN; //!< Have we successfully opened
// Reconnect
Os::Task m_reconnectTask;
Os::Mutex m_reconnectLock;
bool m_reconnectStop = true;
ReconnectState m_reconnectState = ReconnectState::NOT_RECONNECTING;
Fw::TimeInterval m_reconnectCheckInterval =
Fw::TimeInterval(0, 50000); // 50 ms, Interval at which reconnect task loop checks for requests
Fw::TimeInterval m_reconnectWaitInterval =
Fw::TimeInterval(0, 10000); // 10 ms, Interval at which reconnect requesters wait for response
};
} // namespace Drv
#endif // DRV_SocketComponentHelper_HPP

View File

@ -69,6 +69,11 @@ SocketIpStatus TcpClientSocket::openProtocol(SocketDescriptor& socketDescriptor)
return SOCK_INVALID_IP_ADDRESS;
};
if (IpSocket::setupSocketOptions(socketFd) != SOCK_SUCCESS) {
::close(socketFd);
return SOCK_FAILED_TO_SET_SOCKET_OPTIONS;
}
// Now apply timeouts
if (IpSocket::setupTimeouts(socketFd) != SOCK_SUCCESS) {
::close(socketFd);
@ -85,12 +90,18 @@ SocketIpStatus TcpClientSocket::openProtocol(SocketDescriptor& socketDescriptor)
return SOCK_SUCCESS;
}
I32 TcpClientSocket::sendProtocol(const SocketDescriptor& socketDescriptor, const U8* const data, const U32 size) {
return static_cast<I32>(::send(socketDescriptor.fd, data, size, SOCKET_IP_SEND_FLAGS));
FwSignedSizeType TcpClientSocket::sendProtocol(const SocketDescriptor& socketDescriptor,
const U8* const data,
const FwSizeType size) {
return static_cast<FwSignedSizeType>(
::send(socketDescriptor.fd, data, static_cast<size_t>(size), SOCKET_IP_SEND_FLAGS));
}
I32 TcpClientSocket::recvProtocol(const SocketDescriptor& socketDescriptor, U8* const data, const U32 size) {
return static_cast<I32>(::recv(socketDescriptor.fd, data, size, SOCKET_IP_RECV_FLAGS));
FwSignedSizeType TcpClientSocket::recvProtocol(const SocketDescriptor& socketDescriptor,
U8* const data,
const FwSizeType size) {
return static_cast<FwSignedSizeType>(
::recv(socketDescriptor.fd, data, static_cast<size_t>(size), SOCKET_IP_RECV_FLAGS));
}
} // namespace Drv

View File

@ -56,7 +56,9 @@ class TcpClientSocket : public IpSocket {
* \param size: size of data to send
* \return: size of data sent, or -1 on error.
*/
I32 sendProtocol(const SocketDescriptor& socketDescriptor, const U8* const data, const U32 size) override;
FwSignedSizeType sendProtocol(const SocketDescriptor& socketDescriptor,
const U8* const data,
const FwSizeType size) override;
/**
* \brief Protocol specific implementation of recv. Called directly with error handling from recv.
* \param socketDescriptor: descriptor to recv from
@ -64,7 +66,9 @@ class TcpClientSocket : public IpSocket {
* \param size: size of data buffer
* \return: size of data received, or -1 on error.
*/
I32 recvProtocol(const SocketDescriptor& socketDescriptor, U8* const data, const U32 size) override;
FwSignedSizeType recvProtocol(const SocketDescriptor& socketDescriptor,
U8* const data,
const FwSizeType size) override;
};
} // namespace Drv

View File

@ -66,6 +66,11 @@ SocketIpStatus TcpServerSocket::startup(SocketDescriptor& socketDescriptor) {
return SOCK_INVALID_IP_ADDRESS;
};
if (IpSocket::setupSocketOptions(serverFd) != SOCK_SUCCESS) {
::close(serverFd);
return SOCK_FAILED_TO_SET_SOCKET_OPTIONS;
}
// TCP requires bind to an address to the socket
if (::bind(serverFd, reinterpret_cast<struct sockaddr*>(&address), sizeof(address)) < 0) {
::close(serverFd);
@ -119,15 +124,19 @@ SocketIpStatus TcpServerSocket::openProtocol(SocketDescriptor& socketDescriptor)
return SOCK_SUCCESS;
}
I32 TcpServerSocket::sendProtocol(const SocketDescriptor& socketDescriptor, const U8* const data, const U32 size) {
return static_cast<I32>(::send(socketDescriptor.fd, data, size, SOCKET_IP_SEND_FLAGS));
FwSignedSizeType TcpServerSocket::sendProtocol(const SocketDescriptor& socketDescriptor,
const U8* const data,
const FwSizeType size) {
return static_cast<FwSignedSizeType>(
::send(socketDescriptor.fd, data, static_cast<size_t>(size), SOCKET_IP_SEND_FLAGS));
}
I32 TcpServerSocket::recvProtocol(const SocketDescriptor& socketDescriptor, U8* const data, const U32 size) {
I32 size_buf;
FwSignedSizeType TcpServerSocket::recvProtocol(const SocketDescriptor& socketDescriptor,
U8* const data,
const FwSizeType size) {
// recv will return 0 if the client has done an orderly shutdown
size_buf = static_cast<I32>(::recv(socketDescriptor.fd, data, size, SOCKET_IP_RECV_FLAGS));
return size_buf;
return static_cast<FwSignedSizeType>(
::recv(socketDescriptor.fd, data, static_cast<size_t>(size), SOCKET_IP_RECV_FLAGS));
}
} // namespace Drv

View File

@ -76,7 +76,9 @@ class TcpServerSocket : public IpSocket {
* \param size: size of data to send
* \return: size of data sent, or -1 on error.
*/
I32 sendProtocol(const SocketDescriptor& socketDescriptor, const U8* const data, const U32 size) override;
FwSignedSizeType sendProtocol(const SocketDescriptor& socketDescriptor,
const U8* const data,
const FwSizeType size) override;
/**
* \brief Protocol specific implementation of recv. Called directly with error handling from recv.
* \param socketDescriptor: descriptor to recv from
@ -84,7 +86,9 @@ class TcpServerSocket : public IpSocket {
* \param size: size of data buffer
* \return: size of data received, or -1 on error.
*/
I32 recvProtocol(const SocketDescriptor& socketDescriptor, U8* const data, const U32 size) override;
FwSignedSizeType recvProtocol(const SocketDescriptor& socketDescriptor,
U8* const data,
const FwSizeType size) override;
};
} // namespace Drv

View File

@ -151,6 +151,11 @@ SocketIpStatus UdpSocket::openProtocol(SocketDescriptor& socketDescriptor) {
return status;
};
if (IpSocket::setupSocketOptions(socketFd) != SOCK_SUCCESS) {
::close(socketFd);
return SOCK_FAILED_TO_SET_SOCKET_OPTIONS;
}
// Now apply timeouts
status = this->setupTimeouts(socketFd);
if (status != SOCK_SUCCESS) {
@ -192,17 +197,21 @@ SocketIpStatus UdpSocket::openProtocol(SocketDescriptor& socketDescriptor) {
return status;
}
I32 UdpSocket::sendProtocol(const SocketDescriptor& socketDescriptor, const U8* const data, const U32 size) {
FwSignedSizeType UdpSocket::sendProtocol(const SocketDescriptor& socketDescriptor,
const U8* const data,
const FwSizeType size) {
FW_ASSERT(this->m_addr_send.sin_family != 0); // Make sure the address was previously setup
FW_ASSERT(socketDescriptor.fd >= 0); // File descriptor should be valid
FW_ASSERT(data != nullptr); // Data pointer should not be null
return static_cast<I32>(::sendto(socketDescriptor.fd, data, size, SOCKET_IP_SEND_FLAGS,
reinterpret_cast<struct sockaddr*>(&this->m_addr_send),
sizeof(this->m_addr_send)));
return static_cast<FwSignedSizeType>(
::sendto(socketDescriptor.fd, data, static_cast<size_t>(size), SOCKET_IP_SEND_FLAGS,
reinterpret_cast<struct sockaddr*>(&this->m_addr_send), sizeof(this->m_addr_send)));
}
I32 UdpSocket::recvProtocol(const SocketDescriptor& socketDescriptor, U8* const data, const U32 size) {
FwSignedSizeType UdpSocket::recvProtocol(const SocketDescriptor& socketDescriptor,
U8* const data,
const FwSizeType size) {
FW_ASSERT(this->m_addr_recv.sin_family != 0); // Make sure the address was previously setup
FW_ASSERT(socketDescriptor.fd >= 0); // File descriptor should be valid
FW_ASSERT(data != nullptr); // Data pointer should not be null
@ -212,8 +221,9 @@ I32 UdpSocket::recvProtocol(const SocketDescriptor& socketDescriptor, U8* const
(void)::memset(&sender_addr, 0, sizeof(sender_addr));
socklen_t sender_addr_len = sizeof(sender_addr);
I32 received = static_cast<I32>(::recvfrom(socketDescriptor.fd, data, size, SOCKET_IP_RECV_FLAGS,
reinterpret_cast<struct sockaddr*>(&sender_addr), &sender_addr_len));
FwSignedSizeType received = static_cast<FwSignedSizeType>(
::recvfrom(socketDescriptor.fd, data, static_cast<size_t>(size), SOCKET_IP_RECV_FLAGS,
reinterpret_cast<struct sockaddr*>(&sender_addr), &sender_addr_len));
// If we have not configured a send port, set it to the source of the last received packet
if (received >= 0 && this->m_addr_send.sin_port == 0) {
this->m_addr_send = sender_addr;
@ -223,14 +233,14 @@ I32 UdpSocket::recvProtocol(const SocketDescriptor& socketDescriptor, U8* const
return received;
}
SocketIpStatus UdpSocket::send(const SocketDescriptor& socketDescriptor, const U8* const data, const U32 size) {
SocketIpStatus UdpSocket::send(const SocketDescriptor& socketDescriptor, const U8* const data, const FwSizeType size) {
// Note: socketDescriptor.fd can be -1 in some test cases
FW_ASSERT((size == 0) || (data != nullptr));
// Special case for zero-length datagrams in UDP
if (size == 0) {
errno = 0;
I32 sent = this->sendProtocol(socketDescriptor, data, 0);
FwSignedSizeType sent = this->sendProtocol(socketDescriptor, data, 0);
if (sent == -1) {
if (errno == EINTR) {
// For zero-length datagrams, we'll just try once more if interrupted

View File

@ -20,6 +20,14 @@
#ifdef TGT_OS_TYPE_VXWORKS
#include <inetLib.h>
#include <socket.h>
// Undefine these Vxworks-defined macros because
// they collide with member variables in F Prime.
// These macros are defined somewhere in inetLib.h.
#undef m_type
#undef m_data
#undef m_len
#else
#include <arpa/inet.h>
#include <sys/socket.h>
@ -109,7 +117,7 @@ class UdpSocket : public IpSocket {
* \param size: size of data to send
* \return: status of the send operation
*/
SocketIpStatus send(const SocketDescriptor& socketDescriptor, const U8* const data, const U32 size) override;
SocketIpStatus send(const SocketDescriptor& socketDescriptor, const U8* const data, const FwSizeType size) override;
protected:
/**
@ -131,7 +139,9 @@ class UdpSocket : public IpSocket {
* \param size: size of data to send
* \return: size of data sent, or -1 on error.
*/
I32 sendProtocol(const SocketDescriptor& socketDescriptor, const U8* const data, const U32 size) override;
FwSignedSizeType sendProtocol(const SocketDescriptor& socketDescriptor,
const U8* const data,
const FwSizeType size) override;
/**
* \brief Protocol specific implementation of recv. Called directly with error handling from recv.
* \param socketDescriptor: descriptor to recv from
@ -139,7 +149,9 @@ class UdpSocket : public IpSocket {
* \param size: size of data buffer
* \return: size of data received, or -1 on error.
*/
I32 recvProtocol(const SocketDescriptor& socketDescriptor, U8* const data, const U32 size) override;
FwSignedSizeType recvProtocol(const SocketDescriptor& socketDescriptor,
U8* const data,
const FwSizeType size) override;
/**
* \brief Handle zero return from recvProtocol for UDP
*

View File

@ -154,11 +154,11 @@ socketBoth.configureRecv(127.0.0.1, 60212);
```
### Support for Ephemeral Ports
Drv::UdpSocket supports ephemeral ports through passing a 0 as the port argument for either `Drv::UdpSocket::configureSend`
Drv::UdpSocket supports ephemeral ports through passing a 0 as the port argument for either `Drv::UdpSocket::configureSend`
or `Drv::UdpSocket::configureRecv`.
For `Drv::UdpSocket::configureSend` this means that you would like to set up the UdpSocket to be able to respond to the source
port that is indicated in the UDP datagrams you receive. Note that this configuration will set up the send port to the port
For `Drv::UdpSocket::configureSend` this means that you would like to set up the UdpSocket to be able to respond to the source
port that is indicated in the UDP datagrams you receive. Note that this configuration will set up the send port to the port
specified only in the first message received.
For `Drv::UdpSocket::configureRecv` this means that you would like to be assigned an ephemeral port. This would generally be used
@ -168,16 +168,17 @@ for setting up a sender that would like to receive responses to messages on an e
The Drv::SocketComponentHelper is intended as a base class used to add in the functionality of an automatically reconnecting
receive thread to another class (typically an F´ component) as well as an interface between the component using an IP socket
and the IP socket library functions implemented in this folder. In order for this thread to function, the inheritor must
and the IP socket library functions implemented in this folder. In order for the receive thread to function, the inheritor must
implement several methods to provide the necessary interaction of this thread. These functions are described in the next
section.
section. The automatic reconnection is handled by a separate dedicated thread upon request from either the receive thread
or a send request.
In order to start the receiving thread a call to the `Drv::SocketComponentHelper::start` method is performed passing
in a name, and all arguments to `Os::Task::start` to start the task. An optional parameter, reconnect, will determine if
this read task will reconnect to sockets should a disconnect or error occur. Once started the read task will continue
in a name, and all arguments to `Os::Task::start` to start the receive and reconnect tasks. An optional parameter, reconnect,
will determine if this read task will request reconnects to sockets should a disconnect or error occur. Once started, the read task will continue
until a `Drv::SocketComponentHelper::stop` has been called or an error occurred when started without reconnect set to
`true`. Once the socket stop call has been made, the user should call `Drv::SocketComponentHelper::join` in order to
wait until the full task has finished. `Drv::SocketComponentHelper::stop` will call `Drv::SocketComponentHelper::close` on the
wait until the full tasks have finished. `Drv::SocketComponentHelper::stop` will call `Drv::SocketComponentHelper::close` on the
provided Drv::IpSocket to ensure that any blocking reads exit freeing the thread to completely stop. Normal usage of
a Drv::SocketComponentHelper derived class is shown below.
@ -187,7 +188,7 @@ uplinkComm.start(name); // Default reconnect=true
...
uplinkComm.stop();
(void) uplinkComm.join();
(void) uplinkComm.join(); // this will join the receive and reconnect tasks
```
`Drv::SocketComponentHelper::open` and `Drv::SocketComponentHelper::close` convenience methods are also provided to open and close the

View File

@ -15,7 +15,7 @@
namespace Drv {
namespace Test {
const U32 MAX_DRV_TEST_MESSAGE_SIZE = 1024;
const FwSizeType MAX_DRV_TEST_MESSAGE_SIZE = 1024;
void force_recv_timeout(int fd, Drv::IpSocket& socket) {
// Set timeout socket option
@ -43,10 +43,10 @@ void validate_random_buffer(Fw::Buffer& buffer, U8* data) {
buffer.setSize(0);
}
U32 fill_random_buffer(Fw::Buffer& buffer) {
FwSizeType fill_random_buffer(Fw::Buffer& buffer) {
buffer.setSize(static_cast<FwSizeType>(STest::Pick::lowerUpper(1, static_cast<U32>(buffer.getSize()))));
fill_random_data(buffer.getData(), buffer.getSize());
return static_cast<U32>(buffer.getSize());
return buffer.getSize();
}
void drain(Drv::IpSocket& receiver, Drv::SocketDescriptor& receiver_fd) {
@ -54,18 +54,18 @@ void drain(Drv::IpSocket& receiver, Drv::SocketDescriptor& receiver_fd) {
// Drain the server in preparation for close
while (status == Drv::SOCK_SUCCESS || status == Drv::SOCK_NO_DATA_AVAILABLE) {
U8 buffer[1];
U32 size = sizeof buffer;
FwSizeType size = sizeof buffer;
status = receiver.recv(receiver_fd, buffer, size);
}
ASSERT_EQ(status, Drv::SocketIpStatus::SOCK_DISCONNECTED) << "Socket did not disconnect as expected";
}
void receive_all(Drv::IpSocket& receiver, Drv::SocketDescriptor& receiver_fd, U8* buffer, U32 size) {
void receive_all(Drv::IpSocket& receiver, Drv::SocketDescriptor& receiver_fd, U8* buffer, FwSizeType size) {
ASSERT_NE(buffer, nullptr);
U32 received_size = 0;
FwSizeType received_size = 0;
Drv::SocketIpStatus status;
do {
U32 size_in_out = size - received_size;
FwSizeType size_in_out = size - received_size;
status = receiver.recv(receiver_fd, buffer + received_size, size_in_out);
ASSERT_TRUE((status == Drv::SOCK_NO_DATA_AVAILABLE || status == Drv::SOCK_SUCCESS));
received_size += size_in_out;
@ -77,7 +77,7 @@ void send_recv(Drv::IpSocket& sender,
Drv::IpSocket& receiver,
Drv::SocketDescriptor& sender_fd,
Drv::SocketDescriptor& receiver_fd) {
U32 size = MAX_DRV_TEST_MESSAGE_SIZE;
FwSizeType size = MAX_DRV_TEST_MESSAGE_SIZE;
U8 buffer_out[MAX_DRV_TEST_MESSAGE_SIZE] = {0};
U8 buffer_in[MAX_DRV_TEST_MESSAGE_SIZE] = {0};

View File

@ -47,7 +47,7 @@ void validate_random_buffer(Fw::Buffer& buffer, U8* data);
* Fill random data into the buffer (using a random length).
* @param buffer: buffer to fill.
*/
U32 fill_random_buffer(Fw::Buffer& buffer);
FwSizeType fill_random_buffer(Fw::Buffer& buffer);
/**
* Send/receive pair.
@ -75,7 +75,7 @@ void drain(Drv::IpSocket& receiver, Drv::SocketDescriptor& drain_fd);
* @param buffer: buffer
* @param size: size to receive
*/
void receive_all(Drv::IpSocket& receiver, Drv::SocketDescriptor& receiver_fd, U8* buffer, U32 size);
void receive_all(Drv::IpSocket& receiver, Drv::SocketDescriptor& receiver_fd, U8* buffer, FwSizeType size);
/**
* Wait on socket change.

View File

@ -120,8 +120,8 @@ TEST(UdpZeroLength, TestZeroLengthUdpDatagram) {
// Receive the zero-length datagram using the F' socket wrapper
U8 recv_buf[1] = {0xFF};
U32 recv_buf_len = 1;
I32 recv_status = receiver.recv(recv_fd, recv_buf, recv_buf_len);
FwSizeType recv_buf_len = 1;
FwSignedSizeType recv_status = receiver.recv(recv_fd, recv_buf, recv_buf_len);
// Expect 0 (success) for a zero-length datagram.
ASSERT_EQ(recv_status, 0) << "Expected recv_status 0 for zero-length datagram, but got " << recv_status
@ -159,23 +159,23 @@ TEST(Ephemeral, TestEphemeralPorts) {
// Send a test message
const char* msg = "hello from ephemeral sender";
U32 msg_len = static_cast<U32>(strlen(msg) + 1);
FwSizeType msg_len = static_cast<FwSizeType>(strlen(msg) + 1);
ASSERT_EQ(sender.send(send_fd, reinterpret_cast<const U8*>(msg), msg_len), Drv::SOCK_SUCCESS);
// Receive the message and capture sender's port
char recv_buf[64] = {0};
U32 recv_buf_len = sizeof(recv_buf);
FwSizeType recv_buf_len = sizeof(recv_buf);
ASSERT_EQ(receiver.recv(recv_fd, reinterpret_cast<U8*>(recv_buf), recv_buf_len), Drv::SOCK_SUCCESS);
ASSERT_STREQ(msg, recv_buf);
// Receiver sends a response back to sender
const char* reply = "reply from receiver";
U32 reply_len = static_cast<U32>(strlen(reply) + 1);
FwSizeType reply_len = static_cast<FwSizeType>(strlen(reply) + 1);
ASSERT_EQ(receiver.send(recv_fd, reinterpret_cast<const U8*>(reply), reply_len), Drv::SOCK_SUCCESS);
// Sender receives the response
char reply_buf[64] = {0};
U32 reply_buf_len = sizeof(reply_buf);
FwSizeType reply_buf_len = sizeof(reply_buf);
ASSERT_EQ(sender.recv(send_fd, reinterpret_cast<U8*>(reply_buf), reply_buf_len), Drv::SOCK_SUCCESS);
ASSERT_STREQ(reply, reply_buf);

View File

@ -20,6 +20,7 @@
#include <sys/ioctl.h>
#include <unistd.h>
#include <cerrno>
#include <cstring>
#include <type_traits>
namespace Drv {

View File

@ -29,6 +29,18 @@ event SPI_WriteError(
format "Error writing/reading SPI device {}.{}: {}" \
throttle 5
@ SPI configuration mismatch
event SPI_ConfigMismatch(
device: I32 @< The device
select: I32 @< The chip select
parameter: string @< The parameter being configured
write_value: U32 @< The value written
read_value: U32 @< The value read
) \
severity warning low \
id 3 \
format "SPI device {}.{} configuration mismatch for {}: wrote {}, read {}"
@ SPI open notification
event SPI_PortOpened(
device: I32 @< The device

View File

@ -19,10 +19,12 @@
#include <Fw/FPrimeBasicTypes.hpp>
#include <Fw/Types/Assert.hpp>
#include <Fw/Types/FileNameString.hpp>
#include <Fw/Types/String.hpp>
#include <cerrno>
#include <cstdint>
#include <cstdio>
#include <cstdlib>
#include <cstring>
static_assert(FW_USE_PRINTF_FAMILY_FUNCTIONS_IN_STRING_FORMATTING,
"Cannot use SPI driver without full string formatting");
@ -33,11 +35,26 @@ namespace Drv {
// Handler implementations for user-defined typed input ports
// ----------------------------------------------------------------------
// @ DEPRECATED: Use SpiWriteRead port instead (same operation with a return value)
void LinuxSpiDriverComponentImpl::SpiReadWrite_handler(const FwIndexType portNum,
Fw::Buffer& writeBuffer,
Fw::Buffer& readBuffer) {
FW_ASSERT(portNum >= 0, static_cast<FwAssertArgType>(portNum));
FW_ASSERT(writeBuffer.isValid());
FW_ASSERT(readBuffer.isValid());
(void)SpiWriteRead_handler(portNum, writeBuffer, readBuffer);
}
SpiStatus LinuxSpiDriverComponentImpl::SpiWriteRead_handler(const FwIndexType portNum,
Fw::Buffer& writeBuffer,
Fw::Buffer& readBuffer) {
FW_ASSERT(portNum >= 0, static_cast<FwAssertArgType>(portNum));
FW_ASSERT(writeBuffer.isValid());
FW_ASSERT(readBuffer.isValid());
FW_ASSERT(writeBuffer.getSize() == readBuffer.getSize());
if (this->m_fd == -1) {
return;
return SpiStatus::SPI_OPEN_ERR;
}
spi_ioc_transfer tr;
@ -61,9 +78,12 @@ void LinuxSpiDriverComponentImpl::SpiReadWrite_handler(const FwIndexType portNum
if (stat < 1) {
this->log_WARNING_HI_SPI_WriteError(this->m_device, this->m_select, stat);
return SpiStatus::SPI_OTHER_ERR;
}
this->m_bytes += readBuffer.getSize();
this->tlmWrite_SPI_Bytes(this->m_bytes);
return SpiStatus::SPI_OK;
}
bool LinuxSpiDriverComponentImpl::open(FwIndexType device, FwIndexType select, SpiFrequency clock, SpiMode spiMode) {
@ -120,12 +140,17 @@ bool LinuxSpiDriverComponentImpl::open(FwIndexType device, FwIndexType select, S
return false;
}
ret = ioctl(fd, SPI_IOC_RD_MODE, &mode);
U8 read_mode = 0;
ret = ioctl(fd, SPI_IOC_RD_MODE, &read_mode);
if (ret == -1) {
this->log_WARNING_HI_SPI_ConfigError(device, select, ret);
return false;
}
if (mode != read_mode) {
this->log_WARNING_LO_SPI_ConfigMismatch(device, select, Fw::String("MODE"), mode, read_mode);
}
/*
* 8 bits per word
*/
@ -136,12 +161,17 @@ bool LinuxSpiDriverComponentImpl::open(FwIndexType device, FwIndexType select, S
return false;
}
ret = ioctl(fd, SPI_IOC_RD_BITS_PER_WORD, &bits);
U8 read_bits = 0;
ret = ioctl(fd, SPI_IOC_RD_BITS_PER_WORD, &read_bits);
if (ret == -1) {
this->log_WARNING_HI_SPI_ConfigError(device, select, ret);
return false;
}
if (bits != read_bits) {
this->log_WARNING_LO_SPI_ConfigMismatch(device, select, Fw::String("BITS_PER_WORD"), bits, read_bits);
}
/*
* Max speed in Hz
*/
@ -151,12 +181,17 @@ bool LinuxSpiDriverComponentImpl::open(FwIndexType device, FwIndexType select, S
return false;
}
ret = ioctl(fd, SPI_IOC_RD_MAX_SPEED_HZ, &clock);
SpiFrequency read_clock;
ret = ioctl(fd, SPI_IOC_RD_MAX_SPEED_HZ, &read_clock);
if (ret == -1) {
this->log_WARNING_HI_SPI_ConfigError(device, select, ret);
return false;
}
if (clock != read_clock) {
this->log_WARNING_LO_SPI_ConfigMismatch(device, select, Fw::String("MAX_SPEED_HZ"), clock, read_clock);
}
return true;
}

View File

@ -76,6 +76,13 @@ class LinuxSpiDriverComponentImpl final : public LinuxSpiDriverComponentBase {
// Handler implementations for user-defined typed input ports
// ----------------------------------------------------------------------
//! Handler implementation for SpiWriteRead
//!
SpiStatus SpiWriteRead_handler(const FwIndexType portNum, /*!< The port number*/
Fw::Buffer& WriteBuffer,
Fw::Buffer& readBuffer);
// @ DEPRECATED: Use SpiWriteRead port instead (same operation with a return value)
//! Handler implementation for SpiReadWrite
//!
void SpiReadWrite_handler(const FwIndexType portNum, /*!< The port number*/

View File

@ -23,6 +23,13 @@ bool LinuxSpiDriverComponentImpl::open(FwIndexType device, FwIndexType select, S
// Handler implementations for user-defined typed input ports
// ----------------------------------------------------------------------
SpiStatus LinuxSpiDriverComponentImpl::SpiWriteRead_handler(const FwIndexType portNum,
Fw::Buffer& WriteBuffer,
Fw::Buffer& readBuffer) {
return SpiStatus::SPI_OK;
}
// @ DEPRECATED: Use SpiWriteRead port instead (same operation with a return value)
void LinuxSpiDriverComponentImpl::SpiReadWrite_handler(const FwIndexType portNum,
Fw::Buffer& WriteBuffer,
Fw::Buffer& readBuffer) {}

View File

@ -19,6 +19,7 @@
#include <fcntl.h>
#include <termios.h>
#include <cerrno>
#include <cstring>
namespace Drv {

View File

@ -0,0 +1,177 @@
# Drv::LinuxUartDriver
## 1. Introduction
The LinuxUartDriver component provides a Linux-specific implementation of a UART (Universal Asynchronous Receiver-Transmitter) serial communication driver. It implements the byte stream driver model interface (see [`Drv.ByteStreamDriver`](../../Interfaces/ByteStreamDriver.fpp)) to enable serial communication with external devices through UART ports on Linux systems.
The component wraps Linux termios API functionality to provide configurable serial communication with support for various baud rates, flow control options, and parity settings. It implements bidirectional communication using a dedicated receive thread and synchronous send operations.
For more information on the ByteStreamDriverModel see: [`Drv::ByteStreamDriverModel`](../../ByteStreamDriverModel/docs/sdd.md).
## 2. Requirements
| Name | Description | Validation |
|---|---|---|
| LINUX-UART-COMP-001 | The LinuxUartDriver component shall implement the Drv.ByteStreamDriver interface | inspection |
| LINUX-UART-COMP-002 | The LinuxUartDriver component shall provide configurable baud rates from 9600 to 4MHz | inspection |
| LINUX-UART-COMP-003 | The LinuxUartDriver component shall provide configurable flow control (none/hardware) | inspection |
| LINUX-UART-COMP-004 | The LinuxUartDriver component shall provide configurable parity (none/odd/even) | inspection |
| LINUX-UART-COMP-005 | The LinuxUartDriver component shall provide a dedicated read thread for receiving data | inspection |
| LINUX-UART-COMP-006 | The LinuxUartDriver component shall report telemetry for bytes sent and received | inspection |
| LINUX-UART-COMP-007 | The LinuxUartDriver component shall handle UART errors and report them via events | inspection |
| LINUX-UART-COMP-008 | The LinuxUartDriver component shall support buffer allocation for receive operations | inspection |
## 3. Design
The LinuxUartDriver component implements the design specified by the [`Drv.ByteStreamDriver`](../../Interfaces/ByteStreamDriver.fpp) interface.
### 3.1 Architecture
The component consists of the following key elements:
- **UART Configuration**: Handles device opening, baud rate, flow control, and parity settings using Linux termios API
- **Send Handler**: Synchronous transmission of data via the `send` port (guarded input port)
- **Receive Thread**: Asynchronous reception of data via a dedicated thread that calls the `recv` output port
- **Buffer Management**: Integration with F´ buffer allocation system for memory management
- **Telemetry Reporting**: Tracks and reports bytes sent and received statistics
- **Error Handling**: Comprehensive error detection and event reporting
### 3.2 Send Operation
When data is sent via the `send` input port:
1. The component validates the file descriptor and buffer
2. Data is written to the UART device using the Linux `write()` system call
3. Bytes sent counter is updated for telemetry
4. Status is returned indicating success or failure
### 3.3 Receive Operation
The receive operation runs in a separate thread:
1. A buffer is allocated from the buffer manager
2. The thread blocks on `read()` waiting for incoming data
3. Received data is packaged in the buffer and sent via `recv` output port
4. Bytes received counter is updated for telemetry
5. Errors are logged and reported via events
### 3.4 Threading Model
The component uses a single dedicated thread for receive operations (`serialReadTaskEntry`). This thread:
- Runs continuously until `quitReadThread()` is called
- Allocates buffers for each receive operation
- Handles timeouts and errors gracefully
- Can be started with configurable priority and stack size
## 4. Usage
The LinuxUartDriver must be configured with device parameters before use. The typical usage pattern is:
1. **Open Device**: Configure the UART device with desired parameters
2. **Start Receive Thread**: Begin the receive thread for incoming data
3. **Send/Receive Data**: Use the ByteStreamDriverModel ports for communication
4. **Shutdown**: Stop the receive thread and close the device
### 4.1 Configuration Example
The LinuxUartDriver should be instantiated in the FPP topology and configured using separate functions following F´ patterns:
```cpp
// Configuration function - called during topology setup
void configureTopology() {
// Open UART device with configuration
bool success = uart.open("/dev/ttyUSB0", // Device path
Drv::LinuxUartDriver::BAUD_115K, // 115200 baud rate
Drv::LinuxUartDriver::NO_FLOW, // No flow control
Drv::LinuxUartDriver::PARITY_NONE, // No parity
1024); // Buffer size
if (!success) {
// Handle configuration error
}
...
}
// Startup function - called when starting tasks
void setupTopology() {
// Start receive thread
uart.start(UART_PRIORITY, // Thread priority
32 * 1024, // Thread stack size
Os::Task::TASK_DEFAULT); // Thread CPU affinity mask
}
// Shutdown function - called during teardown
void teardownTopology() {
uart.quitReadThread();
uart.join();
}
```
### 4.2 Integration with Rate Groups
The component includes a `run` input port for telemetry reporting that should be connected to a rate group in the FPP topology:
```fpp
# In topology.fpp connections section
connections RateGroups {
# Connect UART driver to rate group for telemetry
rateGroup1Comp.RateGroupMemberOut[N] -> uart.run
}
```
## 5. Configuration
### 5.1 Device Parameters
| Parameter | Type | Description | Valid Values |
|-----------|------|-------------|--------------|
| device | const char* | Path to UART device | Linux device path (e.g., "/dev/ttyUSB0") |
| baud | Drv::LinuxUartDriver::UartBaudRate | Communication baud rate | See baud rate enumeration |
| fc | Drv::LinuxUartDriver::UartFlowControl | Flow control setting | NO_FLOW, HW_FLOW |
| parity | Drv::LinuxUartDriver::UartParity | Parity setting | PARITY_NONE, PARITY_ODD, PARITY_EVEN |
| allocationSize | FwSizeType | Receive buffer size | Positive integer (bytes) |
### 5.2 Baud Rate Options
The component supports the following baud rates:
| Enumeration | Numeric Value | Availability |
|-------------|---------------|--------------|
| BAUD_9600 | 9600 | All platforms |
| BAUD_19200 | 19200 | All platforms |
| BAUD_38400 | 38400 | All platforms |
| BAUD_57600 | 57600 | All platforms |
| BAUD_115K | 115200 | All platforms |
| BAUD_230K | 230400 | All platforms |
| BAUD_460K | 460800 | Linux only |
| BAUD_921K | 921600 | Linux only |
| BAUD_1000K | 1000000 | Linux only |
| BAUD_1152K | 1152000 | Linux only |
| BAUD_1500K | 1500000 | Linux only |
| BAUD_2000K | 2000000 | Linux only |
| BAUD_2500K | 2500000 | Linux only (if supported) |
| BAUD_3000K | 3000000 | Linux only (if supported) |
| BAUD_3500K | 3500000 | Linux only (if supported) |
| BAUD_4000K | 4000000 | Linux only (if supported) |
### 5.3 Thread Configuration
The receive thread can be configured with:
| Parameter | Type | Default | Description |
|-----------|------|---------|-------------|
| priority | FwTaskPriorityType | TASK_PRIORITY_DEFAULT | Thread priority |
| stackSize | Os::Task::ParamType | TASK_DEFAULT | Thread stack size |
| cpuAffinity | Os::Task::ParamType | TASK_DEFAULT | CPU affinity mask |
### 5.4 Events and Telemetry
The component generates the following events:
- **OpenError**: UART device open failures
- **ConfigError**: UART configuration failures
- **WriteError**: Data transmission errors
- **ReadError**: Data reception errors
- **PortOpened**: Successful device configuration
- **NoBuffers**: Buffer allocation failures
- **BufferTooSmall**: Insufficient buffer size
The component reports the following telemetry:
- **BytesSent**: Total bytes transmitted
- **BytesRecv**: Total bytes received

View File

@ -13,7 +13,7 @@ DataBuffer::DataBuffer() {}
DataBuffer::~DataBuffer() {}
DataBuffer::DataBuffer(const DataBuffer& other) : Fw::SerializeBufferBase() {
Fw::SerializeStatus stat = Fw::SerializeBufferBase::setBuff(other.m_data, other.getBuffLength());
Fw::SerializeStatus stat = Fw::SerializeBufferBase::setBuff(other.m_data, other.getSize());
FW_ASSERT(Fw::FW_SERIALIZE_OK == stat, static_cast<FwAssertArgType>(stat));
}
@ -22,15 +22,19 @@ DataBuffer& DataBuffer::operator=(const DataBuffer& other) {
return *this;
}
Fw::SerializeStatus stat = Fw::SerializeBufferBase::setBuff(other.m_data, other.getBuffLength());
Fw::SerializeStatus stat = Fw::SerializeBufferBase::setBuff(other.m_data, other.getSize());
FW_ASSERT(Fw::FW_SERIALIZE_OK == stat, static_cast<FwAssertArgType>(stat));
return *this;
}
FwSizeType DataBuffer::getBuffCapacity() const {
FwSizeType DataBuffer::getCapacity() const {
return sizeof(this->m_data);
}
FwSizeType DataBuffer::getBuffCapacity() const {
return this->getCapacity();
}
const U8* DataBuffer::getBuffAddr() const {
return this->m_data;
}

View File

@ -20,7 +20,9 @@ class DataBuffer : public Fw::SerializeBufferBase {
virtual ~DataBuffer();
DataBuffer& operator=(const DataBuffer& other);
FwSizeType getBuffCapacity() const; // !< returns capacity, not current size, of buffer
DEPRECATED(FwSizeType getBuffCapacity() const, "Use getCapacity() instead");
FwSizeType getCapacity() const;
U8* getBuffAddr();
const U8* getBuffAddr() const;

View File

@ -1,5 +1,5 @@
module Drv {
enum GpioStatus {
enum GpioStatus : U8 {
OP_OK @< Operation succeeded
NOT_OPENED @< Pin was never opened
INVALID_MODE @< Operation not permitted with current configuration

View File

@ -11,7 +11,7 @@ module Drv {
module Drv {
enum I2cStatus {
enum I2cStatus : U8 {
I2C_OK = 0 @< Transaction okay
I2C_ADDRESS_ERR = 1 @< I2C address invalid
I2C_WRITE_ERR = 2 @< I2C write failed

View File

@ -1,8 +1,28 @@
module Drv {
port SpiWriteRead(
ref writeBuffer: Fw.Buffer
ref readBuffer: Fw.Buffer
) -> Drv.SpiStatus
@ DEPRECATED: Use SpiWriteRead port instead (same operation with a return value)
port SpiReadWrite(
ref writeBuffer: Fw.Buffer
ref readBuffer: Fw.Buffer
ref readBuffer: Fw.Buffer
)
}
module Drv {
enum SpiStatus : U8 {
SPI_OK = 0 @< Transaction okay
SPI_OPEN_ERR = 1 @< SPI driver failed to open device
SPI_CONFIG_ERR = 2 @< SPI read failed
SPI_MISMATCH_ERR = 3 @< SPI read failed
SPI_WRITE_ERR = 4 @< SPI write failed
SPI_OTHER_ERR = 5 @< Other errors that do not fit
}
}

View File

@ -28,8 +28,6 @@ SocketIpStatus TcpClientComponentImpl::configure(const char* hostname,
const U32 send_timeout_seconds,
const U32 send_timeout_microseconds,
FwSizeType buffer_size) {
// Check that ensures the configured buffer size fits within the limits fixed-width type, U32
FW_ASSERT(buffer_size <= std::numeric_limits<U32>::max(), static_cast<FwAssertArgType>(buffer_size));
m_allocation_size = buffer_size; // Store the buffer size
return m_socket.configure(hostname, port, send_timeout_seconds, send_timeout_microseconds);
}
@ -45,7 +43,7 @@ IpSocket& TcpClientComponentImpl::getSocketHandler() {
}
Fw::Buffer TcpClientComponentImpl::getBuffer() {
return allocate_out(0, static_cast<U32>(m_allocation_size));
return allocate_out(0, m_allocation_size);
}
void TcpClientComponentImpl::sendBuffer(Fw::Buffer buffer, SocketIpStatus status) {
@ -71,8 +69,7 @@ void TcpClientComponentImpl::connected() {
// ----------------------------------------------------------------------
Drv::ByteStreamStatus TcpClientComponentImpl::send_handler(const FwIndexType portNum, Fw::Buffer& fwBuffer) {
FW_ASSERT_NO_OVERFLOW(fwBuffer.getSize(), U32);
Drv::SocketIpStatus status = send(fwBuffer.getData(), static_cast<U32>(fwBuffer.getSize()));
Drv::SocketIpStatus status = send(fwBuffer.getData(), fwBuffer.getSize());
Drv::ByteStreamStatus returnStatus;
switch (status) {
case SOCK_INTERRUPTED_TRY_AGAIN:

View File

@ -57,7 +57,7 @@ void TcpClientTester ::test_with_loop(U32 iterations, bool recv_thread) {
// Loop through a bunch of client disconnects
for (U32 i = 0; i < iterations; i++) {
U32 size = sizeof(m_data_storage);
FwSizeType size = sizeof(m_data_storage);
// Not testing with reconnect thread, we will need to open ourselves
if (not recv_thread) {

View File

@ -23,7 +23,7 @@ namespace Drv {
class TcpClientTester : public TcpClientGTestBase {
// Maximum size of histories storing events, telemetry, and port outputs
static const U32 MAX_HISTORY_SIZE = 1000;
static const FwSizeType MAX_HISTORY_SIZE = 1000;
// Instance ID supplied to the component instance under test
static const FwEnumStoreType TEST_INSTANCE_ID = 0;
// Queue depth supplied to component instance under test

View File

@ -29,11 +29,7 @@ SocketIpStatus TcpServerComponentImpl::configure(const char* hostname,
const U32 send_timeout_seconds,
const U32 send_timeout_microseconds,
FwSizeType buffer_size) {
// Check that ensures the configured buffer size fits within the limits fixed-width type, U32
FW_ASSERT(buffer_size <= std::numeric_limits<U32>::max(), static_cast<FwAssertArgType>(buffer_size));
m_allocation_size = buffer_size; // Store the buffer size
//
(void)m_socket.configure(hostname, port, send_timeout_seconds, send_timeout_microseconds);
return startup();
}
@ -53,7 +49,7 @@ IpSocket& TcpServerComponentImpl::getSocketHandler() {
}
Fw::Buffer TcpServerComponentImpl::getBuffer() {
return allocate_out(0, static_cast<U32>(m_allocation_size));
return allocate_out(0, m_allocation_size);
}
void TcpServerComponentImpl::sendBuffer(Fw::Buffer buffer, SocketIpStatus status) {
@ -120,8 +116,7 @@ void TcpServerComponentImpl::readLoop() {
// ----------------------------------------------------------------------
Drv::ByteStreamStatus TcpServerComponentImpl::send_handler(const FwIndexType portNum, Fw::Buffer& fwBuffer) {
FW_ASSERT_NO_OVERFLOW(fwBuffer.getSize(), U32);
Drv::SocketIpStatus status = this->send(fwBuffer.getData(), static_cast<U32>(fwBuffer.getSize()));
Drv::SocketIpStatus status = this->send(fwBuffer.getData(), fwBuffer.getSize());
Drv::ByteStreamStatus returnStatus;
switch (status) {
case SOCK_INTERRUPTED_TRY_AGAIN:

View File

@ -58,7 +58,7 @@ void TcpServerTester ::test_with_loop(U32 iterations, bool recv_thread) {
client.configure("127.0.0.1", this->component.getListenPort(), 0, 100);
status2 = client.open(client_fd);
EXPECT_EQ(status2, Drv::SocketIpStatus::SOCK_SUCCESS) << "Failed to connect client";
U32 size = sizeof(m_data_storage);
FwSizeType size = sizeof(m_data_storage);
// Not testing with reconnect thread, we will need to open ourselves
if (not recv_thread) {
@ -151,7 +151,10 @@ TcpServerTester ::TcpServerTester()
::memset(m_data_storage, 0, sizeof(m_data_storage));
}
TcpServerTester ::~TcpServerTester() {}
TcpServerTester ::~TcpServerTester() {
this->component.stop();
this->component.join();
}
// ----------------------------------------------------------------------
// Tests

View File

@ -23,7 +23,7 @@ namespace Drv {
class TcpServerTester : public TcpServerGTestBase {
// Maximum size of histories storing events, telemetry, and port outputs
static const U32 MAX_HISTORY_SIZE = 1000;
static const FwSizeType MAX_HISTORY_SIZE = 1000;
// Instance ID supplied to the component instance under test
static const FwEnumStoreType TEST_INSTANCE_ID = 0;
// Queue depth supplied to component instance under test

View File

@ -32,9 +32,7 @@ SocketIpStatus UdpComponentImpl::configureSend(const char* hostname,
}
SocketIpStatus UdpComponentImpl::configureRecv(const char* hostname, const U16 port, FwSizeType buffer_size) {
FW_ASSERT(buffer_size <= std::numeric_limits<U32>::max(), static_cast<FwAssertArgType>(buffer_size));
m_allocation_size = buffer_size; // Store the buffer size
return m_socket.configureRecv(hostname, port);
}
@ -53,7 +51,7 @@ IpSocket& UdpComponentImpl::getSocketHandler() {
}
Fw::Buffer UdpComponentImpl::getBuffer() {
return allocate_out(0, static_cast<U32>(m_allocation_size));
return allocate_out(0, m_allocation_size);
}
void UdpComponentImpl::sendBuffer(Fw::Buffer buffer, SocketIpStatus status) {
@ -79,8 +77,7 @@ void UdpComponentImpl::connected() {
// ----------------------------------------------------------------------
Drv::ByteStreamStatus UdpComponentImpl::send_handler(const FwIndexType portNum, Fw::Buffer& fwBuffer) {
FW_ASSERT_NO_OVERFLOW(fwBuffer.getSize(), U32);
Drv::SocketIpStatus status = send(fwBuffer.getData(), static_cast<U32>(fwBuffer.getSize()));
Drv::SocketIpStatus status = send(fwBuffer.getData(), fwBuffer.getSize());
Drv::ByteStreamStatus returnStatus;
switch (status) {
case SOCK_INTERRUPTED_TRY_AGAIN:

View File

@ -9,6 +9,11 @@ TEST(Nominal, UdpBasicMessaging) {
tester.test_basic_messaging();
}
TEST(Nominal, UdpBasicUnidirectionalMessaging) {
Drv::UdpTester tester;
tester.test_basic_unidirectional_messaging();
}
TEST(Nominal, UdpBasicReceiveThread) {
Drv::UdpTester tester;
tester.test_receive_thread();
@ -19,6 +24,11 @@ TEST(Reconnect, UdpMultiMessaging) {
tester.test_multiple_messaging();
}
TEST(Reconnect, UdpMultiUnidirectionalMessaging) {
Drv::UdpTester tester;
tester.test_multiple_unidirectional_messaging();
}
TEST(Reconnect, UdpReceiveThreadReconnect) {
Drv::UdpTester tester;
tester.test_advanced_reconnect();

View File

@ -24,7 +24,7 @@ namespace Drv {
// Construction and destruction
// ----------------------------------------------------------------------
void UdpTester::test_with_loop(U32 iterations, bool recv_thread) {
void UdpTester::test_with_loop(U32 iterations, bool recv_thread, bool send_only) {
U8 buffer[sizeof(m_data_storage)] = {};
Drv::SocketIpStatus status1 = Drv::SOCK_SUCCESS;
Drv::SocketIpStatus status2 = Drv::SOCK_SUCCESS;
@ -47,8 +47,9 @@ void UdpTester::test_with_loop(U32 iterations, bool recv_thread) {
// Configure the component
this->component.configureSend("127.0.0.1", port1, 0, 100);
this->component.configureRecv("127.0.0.1", port2);
if (not send_only) {
this->component.configureRecv("127.0.0.1", port2);
}
// Start up a receive thread
if (recv_thread) {
Os::TaskString name("receiver thread");
@ -58,7 +59,7 @@ void UdpTester::test_with_loop(U32 iterations, bool recv_thread) {
// Loop through a bunch of client disconnects
for (U32 i = 0; i < iterations; i++) {
Drv::UdpSocket udp2;
U32 size = sizeof(m_data_storage);
FwSizeType size = sizeof(m_data_storage);
// Not testing with reconnect thread, we will need to open ourselves
if (not recv_thread) {
@ -72,8 +73,10 @@ void UdpTester::test_with_loop(U32 iterations, bool recv_thread) {
Drv::Test::get_configured_delay_ms() / 10 + 1));
}
EXPECT_TRUE(this->component.isOpened());
udp2.configureSend("127.0.0.1", port2, 0, 100);
// Other side socket only receives when component is send-only
if (not send_only) {
udp2.configureSend("127.0.0.1", port2, 0, 100);
}
udp2.configureRecv("127.0.0.1", port1);
status2 = udp2.open(udp2_fd);
@ -93,7 +96,7 @@ void UdpTester::test_with_loop(U32 iterations, bool recv_thread) {
Drv::Test::receive_all(udp2, udp2_fd, buffer, size);
Drv::Test::validate_random_buffer(m_data_buffer, buffer);
// If receive thread is live, try the other way
if (recv_thread) {
if (recv_thread and not send_only) {
m_spinner = false;
m_data_buffer.setSize(sizeof(m_data_storage));
udp2.send(udp2_fd, m_data_buffer.getData(), m_data_buffer.getSize());
@ -144,6 +147,14 @@ void UdpTester ::test_multiple_messaging() {
test_with_loop(100);
}
void UdpTester ::test_basic_unidirectional_messaging() {
test_with_loop(1, false, true);
}
void UdpTester ::test_multiple_unidirectional_messaging() {
test_with_loop(100, false, true);
}
void UdpTester ::test_receive_thread() {
test_with_loop(1, true);
}

View File

@ -23,7 +23,7 @@ namespace Drv {
class UdpTester : public UdpGTestBase {
// Maximum size of histories storing events, telemetry, and port outputs
static const U32 MAX_HISTORY_SIZE = 1000;
static const FwSizeType MAX_HISTORY_SIZE = 1000;
// Instance ID supplied to the component instance under test
static const FwEnumStoreType TEST_INSTANCE_ID = 0;
// Queue depth supplied to component instance under test
@ -57,6 +57,14 @@ class UdpTester : public UdpGTestBase {
//!
void test_multiple_messaging();
//! Test basic messaging in unidirectional mode
//!
void test_basic_unidirectional_messaging();
//! Test basic reconnection behavior in unidirectional mode
//!
void test_multiple_unidirectional_messaging();
//! Test receive via thread
//!
void test_receive_thread();
@ -69,7 +77,7 @@ class UdpTester : public UdpGTestBase {
void test_buffer_deallocation();
// Helpers
void test_with_loop(U32 iterations, bool recv_thread = false);
void test_with_loop(U32 iterations, bool recv_thread = false, bool send_only = false);
bool wait_on_change(Drv::IpSocket& socket, bool open, U32 iterations);

View File

@ -2,7 +2,7 @@ module Fpp {
module ToCpp {
enum Phases {
enum Phases : U8 {
configConstants
configObjects
instances

View File

@ -24,6 +24,7 @@ set(MOD_DEPS
${PROJECT_NAME}/state_machine/external_instance
${PROJECT_NAME}/state_machine/internal/initial
${PROJECT_NAME}/state_machine/internal/state
${PROJECT_NAME}/state_machine/internal_instance/choice
${PROJECT_NAME}/state_machine/internal_instance/initial
${PROJECT_NAME}/state_machine/internal_instance/state
${PROJECT_NAME}/struct

View File

@ -10,12 +10,12 @@
//
// ======================================================================
#include "FppTest/array/AliasOfArrayAliasAc.hpp"
#include "FppTest/array/AliasStringArrayAc.hpp"
#include "FppTest/array/EnumArrayAc.hpp"
#include "FppTest/array/StringArrayAc.hpp"
#include "FppTest/array/StructArrayAc.hpp"
#include "FppTest/array/Uint32ArrayArrayAc.hpp"
#include "FppTest/array/AliasOfArrayAliasAc.hpp"
#include "FppTest/array/AliasStringArrayAc.hpp"
#include "FppTest/typed_tests/ArrayTest.hpp"
@ -26,22 +26,13 @@
// Test array string functions
template <typename ArrayType>
class ArrayToStringTest : public ::testing::Test {
protected:
void SetUp() override {
FppTest::Array::setTestVals<ArrayType>(testVals);
}
protected:
void SetUp() override { FppTest::Array::setTestVals<ArrayType>(testVals); }
typename ArrayType::ElementType testVals[ArrayType::SIZE];
};
using ArrayTypes = ::testing::Types<
Enum,
String,
Struct,
Uint32Array,
AliasString,
AliasOfArray
>;
using ArrayTypes = ::testing::Types<Enum, String, Struct, Uint32Array, AliasString, AliasOfArray>;
TYPED_TEST_SUITE(ArrayToStringTest, ArrayTypes);
// Test array toString() and ostream operator functions
@ -60,8 +51,5 @@ TYPED_TEST(ArrayToStringTest, ToString) {
}
buf2 << " ]";
ASSERT_STREQ(
buf1.str().c_str(),
buf2.str().c_str()
);
ASSERT_STREQ(buf1.str().c_str(), buf2.str().c_str());
}

View File

@ -28,15 +28,13 @@
#include "gtest/gtest.h"
#include <sstream>
#include <limits>
#include <sstream>
// Tests FPP format strings
class FormatTest : public ::testing::Test {
protected:
void SetUp() override {
buf2 << "[ ";
}
protected:
void SetUp() override { buf2 << "[ "; }
std::stringstream buf1, buf2;
};
@ -54,10 +52,7 @@ TEST_F(FormatTest, Bool) {
}
buf2 << " ]";
ASSERT_STREQ(
buf1.str().c_str(),
buf2.str().c_str()
);
ASSERT_STREQ(buf1.str().c_str(), buf2.str().c_str());
}
TEST_F(FormatTest, U8) {
@ -73,16 +68,13 @@ TEST_F(FormatTest, U8) {
}
buf2 << " ]";
ASSERT_STREQ(
buf1.str().c_str(),
buf2.str().c_str()
);
ASSERT_STREQ(buf1.str().c_str(), buf2.str().c_str());
}
TEST_F(FormatTest, U16Dec) {
U16 testVals[FormatU16Dec::SIZE] = {0, 100, std::numeric_limits<U16>::max()};
FormatU16Dec a(testVals);
buf1 << a;
for (U32 i = 0; i < FormatU16Dec::SIZE; i++) {
if (i > 0) {
@ -92,16 +84,13 @@ TEST_F(FormatTest, U16Dec) {
}
buf2 << " ]";
ASSERT_STREQ(
buf1.str().c_str(),
buf2.str().c_str()
);
ASSERT_STREQ(buf1.str().c_str(), buf2.str().c_str());
}
TEST_F(FormatTest, U32Oct) {
U32 testVals[FormatU32Oct::SIZE] = {0, 100, std::numeric_limits<U32>::max()};
FormatU32Oct a(testVals);
buf1 << a;
for (U32 i = 0; i < FormatU32Oct::SIZE; i++) {
if (i > 0) {
@ -111,17 +100,13 @@ TEST_F(FormatTest, U32Oct) {
}
buf2 << " ]";
ASSERT_STREQ(
buf1.str().c_str(),
buf2.str().c_str()
);
ASSERT_STREQ(buf1.str().c_str(), buf2.str().c_str());
}
TEST_F(FormatTest, U64Hex) {
U64 testVals[FormatU64Hex::SIZE] =
{0, 100, std::numeric_limits<U64>::max()};
U64 testVals[FormatU64Hex::SIZE] = {0, 100, std::numeric_limits<U64>::max()};
FormatU64Hex a(testVals);
buf1 << a;
for (U32 i = 0; i < FormatU64Hex::SIZE; i++) {
if (i > 0) {
@ -131,15 +116,11 @@ TEST_F(FormatTest, U64Hex) {
}
buf2 << " ]";
ASSERT_STREQ(
buf1.str().c_str(),
buf2.str().c_str()
);
ASSERT_STREQ(buf1.str().c_str(), buf2.str().c_str());
}
TEST_F(FormatTest, I8) {
I8 testVals[FormatI8::SIZE] =
{std::numeric_limits<I8>::min(), 0, std::numeric_limits<I8>::max()};
I8 testVals[FormatI8::SIZE] = {std::numeric_limits<I8>::min(), 0, std::numeric_limits<I8>::max()};
FormatI8 a(testVals);
buf1 << a;
@ -151,15 +132,11 @@ TEST_F(FormatTest, I8) {
}
buf2 << " ]";
ASSERT_STREQ(
buf1.str().c_str(),
buf2.str().c_str()
);
ASSERT_STREQ(buf1.str().c_str(), buf2.str().c_str());
}
TEST_F(FormatTest, I16Dec) {
I16 testVals[FormatI16Dec::SIZE] =
{std::numeric_limits<I16>::min(), 0, std::numeric_limits<I16>::max()};
I16 testVals[FormatI16Dec::SIZE] = {std::numeric_limits<I16>::min(), 0, std::numeric_limits<I16>::max()};
FormatI16Dec a(testVals);
buf1 << a;
@ -171,15 +148,11 @@ TEST_F(FormatTest, I16Dec) {
}
buf2 << " ]";
ASSERT_STREQ(
buf1.str().c_str(),
buf2.str().c_str()
);
ASSERT_STREQ(buf1.str().c_str(), buf2.str().c_str());
}
TEST_F(FormatTest, I32Oct) {
I32 testVals[FormatI32Oct::SIZE] =
{std::numeric_limits<I32>::min(), 0, std::numeric_limits<I32>::max()};
I32 testVals[FormatI32Oct::SIZE] = {std::numeric_limits<I32>::min(), 0, std::numeric_limits<I32>::max()};
FormatI32Oct a(testVals);
buf1 << a;
@ -191,16 +164,11 @@ TEST_F(FormatTest, I32Oct) {
}
buf2 << " ]";
ASSERT_STREQ(
buf1.str().c_str(),
buf2.str().c_str()
);
ASSERT_STREQ(buf1.str().c_str(), buf2.str().c_str());
}
TEST_F(FormatTest, I64Hex) {
I64 testVals[FormatI64Hex::SIZE] =
{std::numeric_limits<I64>::min(), 0, std::numeric_limits<I64>::max()};
I64 testVals[FormatI64Hex::SIZE] = {std::numeric_limits<I64>::min(), 0, std::numeric_limits<I64>::max()};
FormatI64Hex a(testVals);
buf1 << a;
@ -212,15 +180,11 @@ TEST_F(FormatTest, I64Hex) {
}
buf2 << " ]";
ASSERT_STREQ(
buf1.str().c_str(),
buf2.str().c_str()
);
ASSERT_STREQ(buf1.str().c_str(), buf2.str().c_str());
}
TEST_F(FormatTest, F32E) {
F32 testVals[FormatF32e::SIZE] =
{std::numeric_limits<F32>::min(), 0.0, std::numeric_limits<F32>::max()};
F32 testVals[FormatF32e::SIZE] = {std::numeric_limits<F32>::min(), 0.0, std::numeric_limits<F32>::max()};
FormatF32e a(testVals);
buf1 << a;
@ -232,15 +196,11 @@ TEST_F(FormatTest, F32E) {
}
buf2 << " ]";
ASSERT_STREQ(
buf1.str().c_str(),
buf2.str().c_str()
);
ASSERT_STREQ(buf1.str().c_str(), buf2.str().c_str());
}
TEST_F(FormatTest, F32F) {
F32 testVals[FormatF32f::SIZE] =
{std::numeric_limits<F32>::min(), 0.0, std::numeric_limits<F32>::max()};
F32 testVals[FormatF32f::SIZE] = {std::numeric_limits<F32>::min(), 0.0, std::numeric_limits<F32>::max()};
FormatF32f a(testVals);
buf1 << a;
@ -252,15 +212,11 @@ TEST_F(FormatTest, F32F) {
}
buf2 << " ]";
ASSERT_STREQ(
buf1.str().c_str(),
buf2.str().c_str()
);
ASSERT_STREQ(buf1.str().c_str(), buf2.str().c_str());
}
TEST_F(FormatTest, F64G) {
F64 testVals[FormatF64g::SIZE] =
{std::numeric_limits<F64>::min(), 0.0, std::numeric_limits<F64>::max()};
F64 testVals[FormatF64g::SIZE] = {std::numeric_limits<F64>::min(), 0.0, std::numeric_limits<F64>::max()};
FormatF64g a(testVals);
buf1 << a;
@ -272,10 +228,7 @@ TEST_F(FormatTest, F64G) {
}
buf2 << " ]";
ASSERT_STREQ(
buf1.str().c_str(),
buf2.str().c_str()
);
ASSERT_STREQ(buf1.str().c_str(), buf2.str().c_str());
}
TEST_F(FormatTest, String) {
@ -297,15 +250,12 @@ TEST_F(FormatTest, String) {
}
buf2 << " ]";
ASSERT_STREQ(
buf1.str().c_str(),
buf2.str().c_str()
);
ASSERT_STREQ(buf1.str().c_str(), buf2.str().c_str());
}
TEST_F(FormatTest, Char) {
U8 testVals[FormatChar::SIZE] =
{FppTest::Utils::getNonzeroU8(), FppTest::Utils::getNonzeroU8(), FppTest::Utils::getNonzeroU8()};
U8 testVals[FormatChar::SIZE] = {FppTest::Utils::getNonzeroU8(), FppTest::Utils::getNonzeroU8(),
FppTest::Utils::getNonzeroU8()};
FormatChar a(testVals);
buf1 << a;
@ -317,8 +267,5 @@ TEST_F(FormatTest, Char) {
}
buf2 << " ]";
ASSERT_STREQ(
buf1.str().c_str(),
buf2.str().c_str()
);
ASSERT_STREQ(buf1.str().c_str(), buf2.str().c_str());
}

View File

@ -10,12 +10,12 @@
//
// ======================================================================
#include "FppTest/array/AliasOfArrayAliasAc.hpp"
#include "FppTest/array/AliasStringArrayAc.hpp"
#include "FppTest/array/EnumArrayAc.hpp"
#include "FppTest/array/StringArrayAc.hpp"
#include "FppTest/array/StructArrayAc.hpp"
#include "FppTest/array/Uint32ArrayArrayAc.hpp"
#include "FppTest/array/AliasOfArrayAliasAc.hpp"
#include "FppTest/array/AliasStringArrayAc.hpp"
#include "FppTest/typed_tests/ArrayTest.hpp"
#include "FppTest/typed_tests/StringTest.hpp"
#include "FppTest/utils/Utils.hpp"
@ -25,12 +25,7 @@
#include "gtest/gtest.h"
// Instantiate array tests
using ArrayTestImplementations = ::testing::Types<
Enum,
String,
Struct,
Uint32Array
>;
using ArrayTestImplementations = ::testing::Types<Enum, String, Struct, Uint32Array>;
INSTANTIATE_TYPED_TEST_SUITE_P(FppTest, ArrayTest, ArrayTestImplementations);
// Specializations for default values
@ -42,52 +37,35 @@ void FppTest::Array::setDefaultVals<Enum>(E (&a)[Enum::SIZE]) {
}
// Specialization for test values
template<>
template <>
void FppTest::Array::setTestVals<Enum>(E (&a)[Enum::SIZE]) {
a[0] = static_cast<E::T>(STest::Pick::startLength(
E::B,
E::NUM_CONSTANTS - 1
));
a[0] = static_cast<E::T>(STest::Pick::startLength(E::B, E::NUM_CONSTANTS - 1));
for (U32 i = 1; i < Enum::SIZE; i++) {
a[i] = static_cast<E::T>(STest::Pick::startLength(
E::A,
E::NUM_CONSTANTS - 1
));
a[i] = static_cast<E::T>(STest::Pick::startLength(E::A, E::NUM_CONSTANTS - 1));
}
}
static char stringDefaultValsBuffer[::String::SIZE][::String::ELEMENT_BUFFER_SIZE];
template<>
void FppTest::Array::setDefaultVals<String>
(Fw::ExternalString (&a)[::String::SIZE]) {
template <>
void FppTest::Array::setDefaultVals<String>(Fw::ExternalString (&a)[::String::SIZE]) {
for (U32 i = 0; i < ::String::SIZE; i++) {
a[i].setBuffer(
stringDefaultValsBuffer[i],
::String::ELEMENT_BUFFER_SIZE
);
a[i].setBuffer(stringDefaultValsBuffer[i], ::String::ELEMENT_BUFFER_SIZE);
}
}
static char stringTestValsBuffer[::String::SIZE][::String::ELEMENT_BUFFER_SIZE];
template<>
void FppTest::Array::setTestVals<String>
(Fw::ExternalString (&a)[::String::SIZE]) {
template <>
void FppTest::Array::setTestVals<String>(Fw::ExternalString (&a)[::String::SIZE]) {
for (U32 i = 0; i < ::String::SIZE; i++) {
a[i].setBuffer(
stringTestValsBuffer[i],
::String::ELEMENT_BUFFER_SIZE
);
FppTest::Utils::setString(
stringTestValsBuffer[i],
::String::ELEMENT_BUFFER_SIZE, 1
);
a[i].setBuffer(stringTestValsBuffer[i], ::String::ELEMENT_BUFFER_SIZE);
FppTest::Utils::setString(stringTestValsBuffer[i], ::String::ELEMENT_BUFFER_SIZE, 1);
}
}
template<>
template <>
void FppTest::Array::setTestVals<Struct>(S (&a)[Struct::SIZE]) {
U32 b[3];
for (U32 i = 0; i < Struct::SIZE; i++) {
@ -98,7 +76,7 @@ void FppTest::Array::setTestVals<Struct>(S (&a)[Struct::SIZE]) {
}
}
template<>
template <>
void FppTest::Array::setTestVals<Uint32Array>(Uint32 (&a)[Uint32Array::SIZE]) {
Uint32 b;
for (U32 i = 0; i < Uint32Array::SIZE; i++) {
@ -111,77 +89,56 @@ void FppTest::Array::setTestVals<Uint32Array>(Uint32 (&a)[Uint32Array::SIZE]) {
static char stringAliasDefaultValsBuffer[::String::SIZE][::String::ELEMENT_BUFFER_SIZE];
template<>
void FppTest::Array::setDefaultVals<AliasString>
(Fw::ExternalString (&a)[::AliasString::SIZE]) {
template <>
void FppTest::Array::setDefaultVals<AliasString>(Fw::ExternalString (&a)[::AliasString::SIZE]) {
for (U32 i = 0; i < ::AliasString::SIZE; i++) {
a[i].setBuffer(
stringAliasDefaultValsBuffer[i],
::AliasString::ELEMENT_BUFFER_SIZE
);
a[i].setBuffer(stringAliasDefaultValsBuffer[i], ::AliasString::ELEMENT_BUFFER_SIZE);
}
}
static char stringAliasTestValsBuffer[::String::SIZE][::String::ELEMENT_BUFFER_SIZE];
template<>
template <>
void FppTest::Array::setTestVals<AliasString>(Fw::ExternalString (&a)[AliasString::SIZE]) {
for (U32 i = 0; i < ::AliasString::SIZE; i++) {
a[i].setBuffer(
stringAliasTestValsBuffer[i],
::AliasString::ELEMENT_BUFFER_SIZE
);
FppTest::Utils::setString(
stringAliasTestValsBuffer[i],
::AliasString::ELEMENT_BUFFER_SIZE, 1
);
a[i].setBuffer(stringAliasTestValsBuffer[i], ::AliasString::ELEMENT_BUFFER_SIZE);
FppTest::Utils::setString(stringAliasTestValsBuffer[i], ::AliasString::ELEMENT_BUFFER_SIZE, 1);
}
}
template<>
template <>
void FppTest::Array::setTestVals<AliasOfArray>(EA (&a)[AliasOfArray::SIZE]) {
a[0] = static_cast<EA::T>(STest::Pick::startLength(
EA::B,
EA::NUM_CONSTANTS - 1
));
a[0] = static_cast<EA::T>(STest::Pick::startLength(EA::B, EA::NUM_CONSTANTS - 1));
for (U32 i = 1; i < Enum::SIZE; i++) {
a[i] = static_cast<EA::T>(STest::Pick::startLength(
EA::A,
EA::NUM_CONSTANTS - 1
));
a[i] = static_cast<EA::T>(STest::Pick::startLength(EA::A, EA::NUM_CONSTANTS - 1));
}
}
// Specializations for multi element constructor
template<>
Enum FppTest::Array::getMultiElementConstructedArray<Enum>
(E (&a)[Enum::SIZE]) {
return Enum(a[0], a[1], a[2]);
template <>
Enum FppTest::Array::getMultiElementConstructedArray<Enum>(E (&a)[Enum::SIZE]) {
return Enum({a[0], a[1], a[2]});
}
template<>
::String FppTest::Array::getMultiElementConstructedArray<::String>
(Fw::ExternalString (&a)[::String::SIZE]) {
return ::String(a[0], a[1], a[2]);
template <>
::String FppTest::Array::getMultiElementConstructedArray<::String>(Fw::ExternalString (&a)[::String::SIZE]) {
return ::String({Fw::String(a[0]), Fw::String(a[1]), Fw::String(a[2])});
}
template<>
Struct FppTest::Array::getMultiElementConstructedArray<Struct>
(S (&a)[Struct::SIZE]) {
return Struct(a[0], a[1], a[2]);
template <>
Struct FppTest::Array::getMultiElementConstructedArray<Struct>(S (&a)[Struct::SIZE]) {
return Struct({a[0], a[1], a[2]});
}
template<>
Uint32Array FppTest::Array::getMultiElementConstructedArray<Uint32Array>
(Uint32 (&a)[Uint32Array::SIZE]) {
return Uint32Array(a[0], a[1], a[2]);
template <>
Uint32Array FppTest::Array::getMultiElementConstructedArray<Uint32Array>(Uint32 (&a)[Uint32Array::SIZE]) {
return Uint32Array({a[0], a[1], a[2]});
}
// Specializations for serialized size
template <>
U32 FppTest::Array::getSerializedSize<::String>
(Fw::ExternalString (&a)[::String::SIZE]) {
U32 FppTest::Array::getSerializedSize<::String>(Fw::ExternalString (&a)[::String::SIZE]) {
U32 serializedSize = 0;
for (U32 i = 0; i < ::String::SIZE; i++) {
@ -192,10 +149,7 @@ U32 FppTest::Array::getSerializedSize<::String>
}
// Instantiate string tests for arrays
using StringTestImplementations = ::testing::Types<
Fw::StringTemplate<80>,
Fw::StringTemplate<100>
>;
using StringTestImplementations = ::testing::Types<Fw::StringTemplate<80>, Fw::StringTemplate<100>>;
INSTANTIATE_TYPED_TEST_SUITE_P(Array, StringTest, StringTestImplementations);
int main(int argc, char* argv[]) {

View File

@ -4,117 +4,79 @@
// \brief cpp file for ActiveTest component implementation class
// ======================================================================
#include "ActiveTest.hpp"
#include <Fw/FPrimeBasicTypes.hpp>
#include "FppTest/component/active/SerialPortIndexEnumAc.hpp"
// ----------------------------------------------------------------------
// Construction, initialization, and destruction
// ----------------------------------------------------------------------
// ----------------------------------------------------------------------
// Construction, initialization, and destruction
// ----------------------------------------------------------------------
ActiveTest ::
ActiveTest(
const char *const compName
) : ActiveTestComponentBase(compName)
{
ActiveTest ::ActiveTest(const char* const compName) : ActiveTestComponentBase(compName) {}
}
ActiveTest ::~ActiveTest() {}
ActiveTest ::
~ActiveTest()
{
#define TestComponentName ActiveTest
#include "FppTest/component/common/typed.cpp"
#include "FppTest/component/common/typed_async.cpp"
}
// ----------------------------------------------------------------------
// Handler implementations for user-defined serial input ports
// ----------------------------------------------------------------------
#define TestComponentName ActiveTest
#include "FppTest/component/common/typed_async.cpp"
#include "FppTest/component/common/typed.cpp"
// ----------------------------------------------------------------------
// Handler implementations for user-defined serial input ports
// ----------------------------------------------------------------------
void ActiveTest ::
serialAsync_handler(
FwIndexType portNum, //!< The port number
Fw::SerializeBufferBase &Buffer //!< The serialization buffer
)
{
void ActiveTest ::serialAsync_handler(FwIndexType portNum, //!< The port number
Fw::LinearBufferBase& Buffer //!< The serialization buffer
) {
this->serializeStatus = this->serialOut_out(portNum, Buffer);
}
}
void ActiveTest ::
serialAsyncAssert_handler(
FwIndexType portNum, //!< The port number
Fw::SerializeBufferBase &Buffer //!< The serialization buffer
)
{
void ActiveTest ::serialAsyncAssert_handler(FwIndexType portNum, //!< The port number
Fw::LinearBufferBase& Buffer //!< The serialization buffer
) {
this->serializeStatus = this->serialOut_out(SerialPortIndex::ENUM, Buffer);
}
}
void ActiveTest ::
serialAsyncBlockPriority_handler(
FwIndexType portNum, //!< The port number
Fw::SerializeBufferBase &Buffer //!< The serialization buffer
)
{
void ActiveTest ::serialAsyncBlockPriority_handler(FwIndexType portNum, //!< The port number
Fw::LinearBufferBase& Buffer //!< The serialization buffer
) {
this->serializeStatus = this->serialOut_out(SerialPortIndex::ARRAY, Buffer);
}
}
void ActiveTest ::
serialAsyncDropPriority_handler(
FwIndexType portNum, //!< The port number
Fw::SerializeBufferBase &Buffer //!< The serialization buffer
)
{
void ActiveTest ::serialAsyncDropPriority_handler(FwIndexType portNum, //!< The port number
Fw::LinearBufferBase& Buffer //!< The serialization buffer
) {
this->serializeStatus = this->serialOut_out(SerialPortIndex::STRUCT, Buffer);
}
}
void ActiveTest ::
serialGuarded_handler(
FwIndexType portNum, //!< The port number
Fw::SerializeBufferBase &Buffer //!< The serialization buffer
)
{
void ActiveTest ::serialGuarded_handler(FwIndexType portNum, //!< The port number
Fw::LinearBufferBase& Buffer //!< The serialization buffer
) {
this->serializeStatus = this->serialOut_out(portNum, Buffer);
}
}
void ActiveTest ::
serialSync_handler(
FwIndexType portNum, //!< The port number
Fw::SerializeBufferBase &Buffer //!< The serialization buffer
)
{
void ActiveTest ::serialSync_handler(FwIndexType portNum, //!< The port number
Fw::LinearBufferBase& Buffer //!< The serialization buffer
) {
this->serializeStatus = this->serialOut_out(portNum, Buffer);
}
}
// ----------------------------------------------------------------------
// Command handler implementations
// ----------------------------------------------------------------------
// ----------------------------------------------------------------------
// Command handler implementations
// ----------------------------------------------------------------------
void ActiveTest ::
CMD_ASYNC_NO_ARGS_cmdHandler(
const FwOpcodeType opCode,
const U32 cmdSeq
)
{
this->cmdResponse_out(opCode,cmdSeq,Fw::CmdResponse::OK);
}
void ActiveTest ::CMD_ASYNC_NO_ARGS_cmdHandler(const FwOpcodeType opCode, const U32 cmdSeq) {
this->cmdResponse_out(opCode, cmdSeq, Fw::CmdResponse::OK);
}
void ActiveTest ::
CMD_ASYNC_PRIMITIVE_cmdHandler(
const FwOpcodeType opCode,
const U32 cmdSeq,
U32 u32_1,
U32 u32_2,
F32 f32_1,
F32 f32_2,
bool b1,
bool b2
)
{
void ActiveTest ::CMD_ASYNC_PRIMITIVE_cmdHandler(const FwOpcodeType opCode,
const U32 cmdSeq,
U32 u32_1,
U32 u32_2,
F32 f32_1,
F32 f32_2,
bool b1,
bool b2) {
this->primitiveCmd.args.val1 = u32_1;
this->primitiveCmd.args.val2 = u32_2;
this->primitiveCmd.args.val3 = f32_1;
@ -122,80 +84,49 @@
this->primitiveCmd.args.val5 = b1;
this->primitiveCmd.args.val6 = b2;
this->cmdResponse_out(opCode,cmdSeq,Fw::CmdResponse::OK);
}
this->cmdResponse_out(opCode, cmdSeq, Fw::CmdResponse::OK);
}
void ActiveTest ::
CMD_ASYNC_STRINGS_cmdHandler(
const FwOpcodeType opCode,
const U32 cmdSeq,
const Fw::CmdStringArg& str1,
const Fw::CmdStringArg& str2
)
{
void ActiveTest ::CMD_ASYNC_STRINGS_cmdHandler(const FwOpcodeType opCode,
const U32 cmdSeq,
const Fw::CmdStringArg& str1,
const Fw::CmdStringArg& str2) {
this->stringCmd.args.val1 = str1;
this->stringCmd.args.val2 = str2;
this->cmdResponse_out(opCode,cmdSeq,Fw::CmdResponse::OK);
}
this->cmdResponse_out(opCode, cmdSeq, Fw::CmdResponse::OK);
}
void ActiveTest ::
CMD_ASYNC_ENUM_cmdHandler(
const FwOpcodeType opCode,
const U32 cmdSeq,
FormalParamEnum en
)
{
void ActiveTest ::CMD_ASYNC_ENUM_cmdHandler(const FwOpcodeType opCode, const U32 cmdSeq, FormalParamEnum en) {
this->enumCmd.args.val = en;
this->cmdResponse_out(opCode,cmdSeq,Fw::CmdResponse::OK);
}
this->cmdResponse_out(opCode, cmdSeq, Fw::CmdResponse::OK);
}
void ActiveTest ::
CMD_ASYNC_ARRAY_cmdHandler(
const FwOpcodeType opCode,
const U32 cmdSeq,
FormalParamArray arr
)
{
void ActiveTest ::CMD_ASYNC_ARRAY_cmdHandler(const FwOpcodeType opCode, const U32 cmdSeq, FormalParamArray arr) {
this->arrayCmd.args.val = arr;
this->cmdResponse_out(opCode,cmdSeq,Fw::CmdResponse::OK);
}
this->cmdResponse_out(opCode, cmdSeq, Fw::CmdResponse::OK);
}
void ActiveTest ::
CMD_ASYNC_STRUCT_cmdHandler(
const FwOpcodeType opCode,
const U32 cmdSeq,
FormalParamStruct str
)
{
void ActiveTest ::CMD_ASYNC_STRUCT_cmdHandler(const FwOpcodeType opCode, const U32 cmdSeq, FormalParamStruct str) {
this->structCmd.args.val = str;
this->cmdResponse_out(opCode,cmdSeq,Fw::CmdResponse::OK);
}
this->cmdResponse_out(opCode, cmdSeq, Fw::CmdResponse::OK);
}
void ActiveTest ::
CMD_NO_ARGS_cmdHandler(
const FwOpcodeType opCode,
const U32 cmdSeq
)
{
this->cmdResponse_out(opCode,cmdSeq,Fw::CmdResponse::OK);
}
void ActiveTest ::CMD_NO_ARGS_cmdHandler(const FwOpcodeType opCode, const U32 cmdSeq) {
this->cmdResponse_out(opCode, cmdSeq, Fw::CmdResponse::OK);
}
void ActiveTest ::
CMD_PRIMITIVE_cmdHandler(
const FwOpcodeType opCode,
const U32 cmdSeq,
U32 u32_1,
U32 u32_2,
F32 f32_1,
F32 f32_2,
bool b1,
bool b2
)
{
void ActiveTest ::CMD_PRIMITIVE_cmdHandler(const FwOpcodeType opCode,
const U32 cmdSeq,
U32 u32_1,
U32 u32_2,
F32 f32_1,
F32 f32_2,
bool b1,
bool b2) {
this->primitiveCmd.args.val1 = u32_1;
this->primitiveCmd.args.val2 = u32_2;
this->primitiveCmd.args.val3 = f32_1;
@ -203,138 +134,94 @@
this->primitiveCmd.args.val5 = b1;
this->primitiveCmd.args.val6 = b2;
this->cmdResponse_out(opCode,cmdSeq,Fw::CmdResponse::OK);
}
this->cmdResponse_out(opCode, cmdSeq, Fw::CmdResponse::OK);
}
void ActiveTest ::
CMD_STRINGS_cmdHandler(
const FwOpcodeType opCode,
const U32 cmdSeq,
const Fw::CmdStringArg& str1,
const Fw::CmdStringArg& str2
)
{
void ActiveTest ::CMD_STRINGS_cmdHandler(const FwOpcodeType opCode,
const U32 cmdSeq,
const Fw::CmdStringArg& str1,
const Fw::CmdStringArg& str2) {
this->stringCmd.args.val1 = str1;
this->stringCmd.args.val2 = str2;
this->cmdResponse_out(opCode,cmdSeq,Fw::CmdResponse::OK);
}
this->cmdResponse_out(opCode, cmdSeq, Fw::CmdResponse::OK);
}
void ActiveTest ::
CMD_ENUM_cmdHandler(
const FwOpcodeType opCode,
const U32 cmdSeq,
FormalParamEnum en
)
{
void ActiveTest ::CMD_ENUM_cmdHandler(const FwOpcodeType opCode, const U32 cmdSeq, FormalParamEnum en) {
this->enumCmd.args.val = en;
this->cmdResponse_out(opCode,cmdSeq,Fw::CmdResponse::OK);
}
this->cmdResponse_out(opCode, cmdSeq, Fw::CmdResponse::OK);
}
void ActiveTest ::
CMD_ARRAY_cmdHandler(
const FwOpcodeType opCode,
const U32 cmdSeq,
FormalParamArray arr
)
{
void ActiveTest ::CMD_ARRAY_cmdHandler(const FwOpcodeType opCode, const U32 cmdSeq, FormalParamArray arr) {
this->arrayCmd.args.val = arr;
this->cmdResponse_out(opCode,cmdSeq,Fw::CmdResponse::OK);
}
this->cmdResponse_out(opCode, cmdSeq, Fw::CmdResponse::OK);
}
void ActiveTest ::
CMD_STRUCT_cmdHandler(
const FwOpcodeType opCode,
const U32 cmdSeq,
FormalParamStruct str
)
{
void ActiveTest ::CMD_STRUCT_cmdHandler(const FwOpcodeType opCode, const U32 cmdSeq, FormalParamStruct str) {
this->structCmd.args.val = str;
this->cmdResponse_out(opCode,cmdSeq,Fw::CmdResponse::OK);
}
this->cmdResponse_out(opCode, cmdSeq, Fw::CmdResponse::OK);
}
// ----------------------------------------------------------------------
// Internal interface handlers
// ----------------------------------------------------------------------
// ----------------------------------------------------------------------
// Internal interface handlers
// ----------------------------------------------------------------------
//! Internal interface handler for internalArray
void ActiveTest ::
internalArray_internalInterfaceHandler(
const FormalParamArray& arr //!< An array
)
{
//! Internal interface handler for internalArray
void ActiveTest ::internalArray_internalInterfaceHandler(const FormalParamArray& arr //!< An array
) {
this->arrayInterface.args.val = arr;
}
}
//! Internal interface handler for internalEnum
void ActiveTest ::
internalEnum_internalInterfaceHandler(
const FormalParamEnum& en //!< An enum
)
{
//! Internal interface handler for internalEnum
void ActiveTest ::internalEnum_internalInterfaceHandler(const FormalParamEnum& en //!< An enum
) {
this->enumInterface.args.val = en;
}
}
//! Internal interface handler for internalNoArgs
void ActiveTest ::
internalNoArgs_internalInterfaceHandler()
{
}
//! Internal interface handler for internalNoArgs
void ActiveTest ::internalNoArgs_internalInterfaceHandler() {}
//! Internal interface handler for internalPrimitive
void ActiveTest ::
internalPrimitive_internalInterfaceHandler(
U32 u32_1, //!< A U32
U32 u32_2, //!< A U32
F32 f32_1, //!< An F32
F32 f32_2, //!< An F32
bool b1, //!< A boolean
bool b2 //!< A boolean
)
{
//! Internal interface handler for internalPrimitive
void ActiveTest ::internalPrimitive_internalInterfaceHandler(U32 u32_1, //!< A U32
U32 u32_2, //!< A U32
F32 f32_1, //!< An F32
F32 f32_2, //!< An F32
bool b1, //!< A boolean
bool b2 //!< A boolean
) {
this->primitiveInterface.args.val1 = u32_1;
this->primitiveInterface.args.val2 = u32_2;
this->primitiveInterface.args.val3 = f32_1;
this->primitiveInterface.args.val4 = f32_2;
this->primitiveInterface.args.val5 = b1;
this->primitiveInterface.args.val6 = b2;
}
}
//! Internal interface handler for internalString
void ActiveTest ::
internalString_internalInterfaceHandler(
const Fw::InternalInterfaceString& str1, //!< A string
const Fw::InternalInterfaceString& str2 //!< Another string
)
{
//! Internal interface handler for internalString
void ActiveTest ::internalString_internalInterfaceHandler(const Fw::InternalInterfaceString& str1, //!< A string
const Fw::InternalInterfaceString& str2 //!< Another string
) {
this->stringInterface.args.val1 = str1;
this->stringInterface.args.val2 = str2;
}
}
//! Internal interface handler for internalStruct
void ActiveTest ::
internalStruct_internalInterfaceHandler(
const FormalParamStruct& str //!< A struct
)
{
//! Internal interface handler for internalStruct
void ActiveTest ::internalStruct_internalInterfaceHandler(const FormalParamStruct& str //!< A struct
) {
this->structInterface.args.val = str;
}
}
// ----------------------------------------------------------------------
// Overflow hook implementations for user-defined async ports interfaces
// ----------------------------------------------------------------------
// ----------------------------------------------------------------------
// Overflow hook implementations for user-defined async ports interfaces
// ----------------------------------------------------------------------
void ActiveTest ::
enumArgsHook_overflowHook(
const FwIndexType portNum,
const FormalParamEnum &en,
FormalParamEnum &enRef,
const FormalAliasEnum& enA,
FormalAliasEnum& enARef
)
{
this->enumArgsHookOverflowed_out(portNum, en, enRef, enA, enARef);
}
void ActiveTest ::enumArgsHook_overflowHook(const FwIndexType portNum,
const FormalParamEnum& en,
FormalParamEnum& enRef,
const FormalAliasEnum& enA,
FormalAliasEnum& enARef) {
this->enumArgsHookOverflowed_out(portNum, en, enRef, enA, enARef);
}

View File

@ -10,230 +10,194 @@
#include "FppTest/component/active/ActiveTestComponentAc.hpp"
#include "FppTest/component/types/FormalParamTypes.hpp"
class ActiveTest :
public ActiveTestComponentBase
{
class ActiveTest : public ActiveTestComponentBase {
public:
// ----------------------------------------------------------------------
// Component construction and destruction
// ----------------------------------------------------------------------
//! Construct ActiveTest object
ActiveTest(
const char* const compName //!< The component name
ActiveTest(const char* const compName //!< The component name
);
//! Destroy ActiveTest object
~ActiveTest();
private:
#define HAS_ASYNC
#include "FppTest/component/common/typed_async.hpp"
#include "FppTest/component/common/typed.hpp"
#define HAS_ASYNC
#include "FppTest/component/common/typed.hpp"
#include "FppTest/component/common/typed_async.hpp"
private:
// ----------------------------------------------------------------------
// Handler implementations for user-defined serial input ports
// ----------------------------------------------------------------------
//! Handler implementation for serialAsync
void serialAsync_handler(
FwIndexType portNum, //!< The port number
Fw::SerializeBufferBase& buffer //!< The serialization buffer
) override;
void serialAsync_handler(FwIndexType portNum, //!< The port number
Fw::LinearBufferBase& buffer //!< The serialization buffer
) override;
//! Handler implementation for serialAsyncAssert
void serialAsyncAssert_handler(
FwIndexType portNum, //!< The port number
Fw::SerializeBufferBase& buffer //!< The serialization buffer
) override;
void serialAsyncAssert_handler(FwIndexType portNum, //!< The port number
Fw::LinearBufferBase& buffer //!< The serialization buffer
) override;
//! Handler implementation for serialAsyncBlockPriority
void serialAsyncBlockPriority_handler(
FwIndexType portNum, //!< The port number
Fw::SerializeBufferBase& buffer //!< The serialization buffer
) override;
void serialAsyncBlockPriority_handler(FwIndexType portNum, //!< The port number
Fw::LinearBufferBase& buffer //!< The serialization buffer
) override;
//! Handler implementation for serialAsyncDropPriority
void serialAsyncDropPriority_handler(
FwIndexType portNum, //!< The port number
Fw::SerializeBufferBase& buffer //!< The serialization buffer
) override;
void serialAsyncDropPriority_handler(FwIndexType portNum, //!< The port number
Fw::LinearBufferBase& buffer //!< The serialization buffer
) override;
//! Handler implementation for serialGuarded
void serialGuarded_handler(
FwIndexType portNum, //!< The port number
Fw::SerializeBufferBase& buffer //!< The serialization buffer
) override;
void serialGuarded_handler(FwIndexType portNum, //!< The port number
Fw::LinearBufferBase& buffer //!< The serialization buffer
) override;
//! Handler implementation for serialSync
void serialSync_handler(
FwIndexType portNum, //!< The port number
Fw::SerializeBufferBase& buffer //!< The serialization buffer
) override;
void serialSync_handler(FwIndexType portNum, //!< The port number
Fw::LinearBufferBase& buffer //!< The serialization buffer
) override;
private:
// ----------------------------------------------------------------------
// Handler implementations for commands
// ----------------------------------------------------------------------
//! Handler implementation for command CMD_NO_ARGS
void CMD_NO_ARGS_cmdHandler(
FwOpcodeType opCode, //!< The opcode
U32 cmdSeq //!< The command sequence number
) override;
void CMD_NO_ARGS_cmdHandler(FwOpcodeType opCode, //!< The opcode
U32 cmdSeq //!< The command sequence number
) override;
//! Handler implementation for command CMD_PRIMITIVE
void CMD_PRIMITIVE_cmdHandler(
FwOpcodeType opCode, //!< The opcode
U32 cmdSeq, //!< The command sequence number
U32 u32_1, //!< A U32
U32 u32_2, //!< A U32
F32 f32_1, //!< An F32
F32 f32_2, //!< An F32
bool b1, //!< A boolean
bool b2 //!< A boolean
) override;
void CMD_PRIMITIVE_cmdHandler(FwOpcodeType opCode, //!< The opcode
U32 cmdSeq, //!< The command sequence number
U32 u32_1, //!< A U32
U32 u32_2, //!< A U32
F32 f32_1, //!< An F32
F32 f32_2, //!< An F32
bool b1, //!< A boolean
bool b2 //!< A boolean
) override;
//! Handler implementation for command CMD_STRINGS
void CMD_STRINGS_cmdHandler(
FwOpcodeType opCode, //!< The opcode
U32 cmdSeq, //!< The command sequence number
const Fw::CmdStringArg& str1, //!< A string
const Fw::CmdStringArg& str2 //!< Another string
) override;
void CMD_STRINGS_cmdHandler(FwOpcodeType opCode, //!< The opcode
U32 cmdSeq, //!< The command sequence number
const Fw::CmdStringArg& str1, //!< A string
const Fw::CmdStringArg& str2 //!< Another string
) override;
//! Handler implementation for command CMD_ENUM
void CMD_ENUM_cmdHandler(
FwOpcodeType opCode, //!< The opcode
U32 cmdSeq, //!< The command sequence number
FormalParamEnum en //!< An enum
) override;
void CMD_ENUM_cmdHandler(FwOpcodeType opCode, //!< The opcode
U32 cmdSeq, //!< The command sequence number
FormalParamEnum en //!< An enum
) override;
//! Handler implementation for command CMD_ARRAY
void CMD_ARRAY_cmdHandler(
FwOpcodeType opCode, //!< The opcode
U32 cmdSeq, //!< The command sequence number
FormalParamArray arr //!< An array
) override;
void CMD_ARRAY_cmdHandler(FwOpcodeType opCode, //!< The opcode
U32 cmdSeq, //!< The command sequence number
FormalParamArray arr //!< An array
) override;
//! Handler implementation for command CMD_STRUCT
void CMD_STRUCT_cmdHandler(
FwOpcodeType opCode, //!< The opcode
U32 cmdSeq, //!< The command sequence number
FormalParamStruct str //!< A struct
) override;
void CMD_STRUCT_cmdHandler(FwOpcodeType opCode, //!< The opcode
U32 cmdSeq, //!< The command sequence number
FormalParamStruct str //!< A struct
) override;
//! Handler implementation for command CMD_ASYNC_NO_ARGS
void CMD_ASYNC_NO_ARGS_cmdHandler(
FwOpcodeType opCode, //!< The opcode
U32 cmdSeq //!< The command sequence number
) override;
void CMD_ASYNC_NO_ARGS_cmdHandler(FwOpcodeType opCode, //!< The opcode
U32 cmdSeq //!< The command sequence number
) override;
//! Handler implementation for command CMD_ASYNC_PRIMITIVE
void CMD_ASYNC_PRIMITIVE_cmdHandler(
FwOpcodeType opCode, //!< The opcode
U32 cmdSeq, //!< The command sequence number
U32 u32_1, //!< A U32
U32 u32_2, //!< A U32
F32 f32_1, //!< An F32
F32 f32_2, //!< An F32
bool b1, //!< A boolean
bool b2 //!< A boolean
) override;
void CMD_ASYNC_PRIMITIVE_cmdHandler(FwOpcodeType opCode, //!< The opcode
U32 cmdSeq, //!< The command sequence number
U32 u32_1, //!< A U32
U32 u32_2, //!< A U32
F32 f32_1, //!< An F32
F32 f32_2, //!< An F32
bool b1, //!< A boolean
bool b2 //!< A boolean
) override;
//! Handler implementation for command CMD_ASYNC_STRINGS
void CMD_ASYNC_STRINGS_cmdHandler(
FwOpcodeType opCode, //!< The opcode
U32 cmdSeq, //!< The command sequence number
const Fw::CmdStringArg& str1, //!< A string
const Fw::CmdStringArg& str2 //!< Another string
) override;
void CMD_ASYNC_STRINGS_cmdHandler(FwOpcodeType opCode, //!< The opcode
U32 cmdSeq, //!< The command sequence number
const Fw::CmdStringArg& str1, //!< A string
const Fw::CmdStringArg& str2 //!< Another string
) override;
//! Handler implementation for command CMD_ASYNC_ENUM
void CMD_ASYNC_ENUM_cmdHandler(
FwOpcodeType opCode, //!< The opcode
U32 cmdSeq, //!< The command sequence number
FormalParamEnum en //!< An enum
) override;
void CMD_ASYNC_ENUM_cmdHandler(FwOpcodeType opCode, //!< The opcode
U32 cmdSeq, //!< The command sequence number
FormalParamEnum en //!< An enum
) override;
//! Handler implementation for command CMD_ASYNC_ARRAY
void CMD_ASYNC_ARRAY_cmdHandler(
FwOpcodeType opCode, //!< The opcode
U32 cmdSeq, //!< The command sequence number
FormalParamArray arr //!< An array
) override;
void CMD_ASYNC_ARRAY_cmdHandler(FwOpcodeType opCode, //!< The opcode
U32 cmdSeq, //!< The command sequence number
FormalParamArray arr //!< An array
) override;
//! Handler implementation for command CMD_ASYNC_STRUCT
void CMD_ASYNC_STRUCT_cmdHandler(
FwOpcodeType opCode, //!< The opcode
U32 cmdSeq, //!< The command sequence number
FormalParamStruct str //!< A struct
) override;
void CMD_ASYNC_STRUCT_cmdHandler(FwOpcodeType opCode, //!< The opcode
U32 cmdSeq, //!< The command sequence number
FormalParamStruct str //!< A struct
) override;
private:
// ----------------------------------------------------------------------
// Handler implementations for user-defined internal interfaces
// ----------------------------------------------------------------------
//! Handler implementation for internalArray
void internalArray_internalInterfaceHandler(
const FormalParamArray& arr //!< An array
) override;
void internalArray_internalInterfaceHandler(const FormalParamArray& arr //!< An array
) override;
//! Handler implementation for internalEnum
void internalEnum_internalInterfaceHandler(
const FormalParamEnum& en //!< An enum
) override;
void internalEnum_internalInterfaceHandler(const FormalParamEnum& en //!< An enum
) override;
//! Handler implementation for internalNoArgs
void internalNoArgs_internalInterfaceHandler() override;
//! Handler implementation for internalPrimitive
void internalPrimitive_internalInterfaceHandler(
U32 u32_1, //!< A U32
U32 u32_2, //!< A U32
F32 f32_1, //!< An F32
F32 f32_2, //!< An F32
bool b1, //!< A boolean
bool b2 //!< A boolean
) override;
void internalPrimitive_internalInterfaceHandler(U32 u32_1, //!< A U32
U32 u32_2, //!< A U32
F32 f32_1, //!< An F32
F32 f32_2, //!< An F32
bool b1, //!< A boolean
bool b2 //!< A boolean
) override;
//! Handler implementation for internalString
void internalString_internalInterfaceHandler(
const Fw::InternalInterfaceString& str1, //!< A string
const Fw::InternalInterfaceString& str2 //!< Another string
) override;
void internalString_internalInterfaceHandler(const Fw::InternalInterfaceString& str1, //!< A string
const Fw::InternalInterfaceString& str2 //!< Another string
) override;
//! Handler implementation for internalStruct
void internalStruct_internalInterfaceHandler(
const FormalParamStruct& str //!< A struct
) override;
void internalStruct_internalInterfaceHandler(const FormalParamStruct& str //!< A struct
) override;
private:
// ----------------------------------------------------------------------
// Overflow hook implementations for user-defined async ports interfaces
// ----------------------------------------------------------------------
//! Overflow hook implementation for enumArgsOverflow
void enumArgsHook_overflowHook(
FwIndexType portNum, //!< The port number
const FormalParamEnum& en, //!< An enum
FormalParamEnum& enRef, //!< An enum ref
const FormalAliasEnum& enA, //!< An enum alias
FormalAliasEnum& enARef //!< An enum alias ref
) override;
void enumArgsHook_overflowHook(FwIndexType portNum, //!< The port number
const FormalParamEnum& en, //!< An enum
FormalParamEnum& enRef, //!< An enum ref
const FormalAliasEnum& enA, //!< An enum alias
FormalAliasEnum& enARef //!< An enum alias ref
) override;
public:
//! Enables checking the serialization status of serial port invocations
Fw::SerializeStatus serializeStatus;
@ -250,8 +214,6 @@ class ActiveTest :
FppTest::Types::EnumParam enumInterface;
FppTest::Types::ArrayParam arrayInterface;
FppTest::Types::StructParam structInterface;
};
#endif

View File

@ -20,14 +20,16 @@ ActiveTestTester ::ActiveTestTester()
arrayBuf(arrayData, sizeof(arrayData)),
structBuf(structData, sizeof(structData)),
serialBuf(serialData, sizeof(serialData)),
time(STest::Pick::any(), STest::Pick::any()) {
time(STest::Pick::any(), STest::Pick::lowerUpper(0, 999999)) {
this->initComponents();
this->connectPorts();
this->connectAsyncPorts();
this->component.registerExternalParameters(&this->paramTesterDelegate);
}
ActiveTestTester ::~ActiveTestTester() {}
ActiveTestTester ::~ActiveTestTester() {
this->component.deinit();
}
void ActiveTestTester ::initComponents() {
this->init();
@ -46,32 +48,32 @@ Fw::ParamValid ActiveTestTester ::from_prmGetIn_handler(const FwIndexType portNu
switch (id - id_base) {
case ActiveTestComponentBase::PARAMID_PARAMBOOL:
status = val.serialize(boolPrm.args.val);
status = val.serializeFrom(boolPrm.args.val);
FW_ASSERT(status == Fw::FW_SERIALIZE_OK);
break;
case ActiveTestComponentBase::PARAMID_PARAMU32:
status = val.serialize(u32Prm.args.val);
status = val.serializeFrom(u32Prm.args.val);
FW_ASSERT(status == Fw::FW_SERIALIZE_OK);
break;
case ActiveTestComponentBase::PARAMID_PARAMSTRING:
status = val.serialize(stringPrm.args.val);
status = val.serializeFrom(stringPrm.args.val);
FW_ASSERT(status == Fw::FW_SERIALIZE_OK);
break;
case ActiveTestComponentBase::PARAMID_PARAMENUM:
status = val.serialize(enumPrm.args.val);
status = val.serializeFrom(enumPrm.args.val);
FW_ASSERT(status == Fw::FW_SERIALIZE_OK);
break;
case ActiveTestComponentBase::PARAMID_PARAMARRAY:
status = val.serialize(arrayPrm.args.val);
status = val.serializeFrom(arrayPrm.args.val);
FW_ASSERT(status == Fw::FW_SERIALIZE_OK);
break;
case ActiveTestComponentBase::PARAMID_PARAMSTRUCT:
status = val.serialize(structPrm.args.val);
status = val.serializeFrom(structPrm.args.val);
FW_ASSERT(status == Fw::FW_SERIALIZE_OK);
break;
}
@ -89,32 +91,32 @@ void ActiveTestTester ::from_prmSetIn_handler(const FwIndexType portNum, FwPrmId
switch (id - id_base) {
case ActiveTestComponentBase::PARAMID_PARAMBOOL:
status = val.deserialize(boolPrm.args.val);
status = val.deserializeTo(boolPrm.args.val);
FW_ASSERT(status == Fw::FW_SERIALIZE_OK);
break;
case ActiveTestComponentBase::PARAMID_PARAMU32:
status = val.deserialize(u32Prm.args.val);
status = val.deserializeTo(u32Prm.args.val);
FW_ASSERT(status == Fw::FW_SERIALIZE_OK);
break;
case ActiveTestComponentBase::PARAMID_PARAMSTRING:
status = val.deserialize(stringPrm.args.val);
status = val.deserializeTo(stringPrm.args.val);
FW_ASSERT(status == Fw::FW_SERIALIZE_OK);
break;
case ActiveTestComponentBase::PARAMID_PARAMENUM:
status = val.deserialize(enumPrm.args.val);
status = val.deserializeTo(enumPrm.args.val);
FW_ASSERT(status == Fw::FW_SERIALIZE_OK);
break;
case ActiveTestComponentBase::PARAMID_PARAMARRAY:
status = val.deserialize(arrayPrm.args.val);
status = val.deserializeTo(arrayPrm.args.val);
FW_ASSERT(status == Fw::FW_SERIALIZE_OK);
break;
case ActiveTestComponentBase::PARAMID_PARAMSTRUCT:
status = val.deserialize(structPrm.args.val);
status = val.deserializeTo(structPrm.args.val);
FW_ASSERT(status == Fw::FW_SERIALIZE_OK);
break;
}
@ -130,7 +132,7 @@ Fw::SerializeStatus ActiveTestTester::ActiveTestComponentBaseParamExternalDelega
const FwPrmIdType base_id,
const FwPrmIdType local_id,
const Fw::ParamValid prmStat,
Fw::SerializeBufferBase& buff) {
Fw::SerialBufferBase& buff) {
Fw::SerializeStatus stat;
(void)base_id;
@ -138,27 +140,27 @@ Fw::SerializeStatus ActiveTestTester::ActiveTestComponentBaseParamExternalDelega
switch (local_id) {
// ParamBoolExternal
case ActiveTestComponentBase::PARAMID_PARAMBOOLEXTERNAL:
stat = buff.deserialize(this->m_param_ParamBoolExternal);
stat = buff.deserializeTo(this->m_param_ParamBoolExternal);
break;
// ParamI32External
case ActiveTestComponentBase::PARAMID_PARAMI32EXTERNAL:
stat = buff.deserialize(this->m_param_ParamI32External);
stat = buff.deserializeTo(this->m_param_ParamI32External);
break;
// ParamStringExternal
case ActiveTestComponentBase::PARAMID_PARAMSTRINGEXTERNAL:
stat = buff.deserialize(this->m_param_ParamStringExternal);
stat = buff.deserializeTo(this->m_param_ParamStringExternal);
break;
// ParamEnumExternal
case ActiveTestComponentBase::PARAMID_PARAMENUMEXTERNAL:
stat = buff.deserialize(this->m_param_ParamEnumExternal);
stat = buff.deserializeTo(this->m_param_ParamEnumExternal);
break;
// ParamArrayExternal
case ActiveTestComponentBase::PARAMID_PARAMARRAYEXTERNAL:
stat = buff.deserialize(this->m_param_ParamArrayExternal);
stat = buff.deserializeTo(this->m_param_ParamArrayExternal);
break;
// ParamStructExternal
case ActiveTestComponentBase::PARAMID_PARAMSTRUCTEXTERNAL:
stat = buff.deserialize(this->m_param_ParamStructExternal);
stat = buff.deserializeTo(this->m_param_ParamStructExternal);
break;
default:
// Unknown ID should not have gotten here
@ -171,7 +173,7 @@ Fw::SerializeStatus ActiveTestTester::ActiveTestComponentBaseParamExternalDelega
Fw::SerializeStatus ActiveTestTester::ActiveTestComponentBaseParamExternalDelegate ::serializeParam(
const FwPrmIdType base_id,
const FwPrmIdType local_id,
Fw::SerializeBufferBase& buff) const {
Fw::SerialBufferBase& buff) const {
Fw::SerializeStatus stat;
(void)base_id;
@ -179,27 +181,27 @@ Fw::SerializeStatus ActiveTestTester::ActiveTestComponentBaseParamExternalDelega
switch (local_id) {
// ParamBoolExternal
case ActiveTestComponentBase::PARAMID_PARAMBOOLEXTERNAL:
stat = buff.serialize(this->m_param_ParamBoolExternal);
stat = buff.serializeFrom(this->m_param_ParamBoolExternal);
break;
// ParamI32External
case ActiveTestComponentBase::PARAMID_PARAMI32EXTERNAL:
stat = buff.serialize(this->m_param_ParamI32External);
stat = buff.serializeFrom(this->m_param_ParamI32External);
break;
// ParamStringExternal
case ActiveTestComponentBase::PARAMID_PARAMSTRINGEXTERNAL:
stat = buff.serialize(this->m_param_ParamStringExternal);
stat = buff.serializeFrom(this->m_param_ParamStringExternal);
break;
// ParamEnumExternal
case ActiveTestComponentBase::PARAMID_PARAMENUMEXTERNAL:
stat = buff.serialize(this->m_param_ParamEnumExternal);
stat = buff.serializeFrom(this->m_param_ParamEnumExternal);
break;
// ParamArrayExternal
case ActiveTestComponentBase::PARAMID_PARAMARRAYEXTERNAL:
stat = buff.serialize(this->m_param_ParamArrayExternal);
stat = buff.serializeFrom(this->m_param_ParamArrayExternal);
break;
// ParamStructExternal
case ActiveTestComponentBase::PARAMID_PARAMSTRUCTEXTERNAL:
stat = buff.serialize(this->m_param_ParamStructExternal);
stat = buff.serializeFrom(this->m_param_ParamStructExternal);
break;
default:
// Unknown ID should not have gotten here

View File

@ -82,8 +82,8 @@ class ActiveTestTester : public ActiveTestGTestBase {
//! Handler for from_serialOut
//!
void from_serialOut_handler(FwIndexType portNum, //!< The port number
Fw::SerializeBufferBase& Buffer //!< The serialization buffer
void from_serialOut_handler(FwIndexType portNum, //!< The port number
Fw::LinearBufferBase& Buffer //!< The serialization buffer
) final;
public:
@ -226,14 +226,13 @@ class ActiveTestTester : public ActiveTestGTestBase {
const FwPrmIdType base_id, //!< The component base parameter ID to deserialize
const FwPrmIdType local_id, //!< The parameter local ID to deserialize
const Fw::ParamValid prmStat, //!< The parameter validity status
Fw::SerializeBufferBase& buff //!< The buffer containing the parameter to deserialize
Fw::SerialBufferBase& buff //!< The buffer containing the parameter to deserialize
) override;
//! Parameter serialization function for external parameter unit testing
Fw::SerializeStatus serializeParam(
const FwPrmIdType base_id, //!< The component base parameter ID to serialize
const FwPrmIdType local_id, //!< The parameter local ID to serialize
Fw::SerializeBufferBase& buff //!< The buffer to serialize the parameter into
Fw::SerializeStatus serializeParam(const FwPrmIdType base_id, //!< The component base parameter ID to serialize
const FwPrmIdType local_id, //!< The parameter local ID to serialize
Fw::SerialBufferBase& buff //!< The buffer to serialize the parameter into
) const override;
};

View File

@ -4,140 +4,124 @@
//! Handler for from_arrayArgsOut
//!
void from_arrayArgsOut_handler(
FwIndexType portNum, //!< The port number
const FormalParamArray& a, //!< An array
FormalParamArray& aRef, //!< An array ref
const FormalAliasArray& b, //!< alias of an array
FormalAliasArray& bRef, //!< alias of array ref
const FormalAliasStringArray& c, //!< array of string aliases
FormalAliasStringArray& cRef //!< array of string aliases ref
) final;
void from_arrayArgsOut_handler(FwIndexType portNum, //!< The port number
const FormalParamArray& a, //!< An array
FormalParamArray& aRef, //!< An array ref
const FormalAliasArray& b, //!< alias of an array
FormalAliasArray& bRef, //!< alias of array ref
const FormalAliasStringArray& c, //!< array of string aliases
FormalAliasStringArray& cRef //!< array of string aliases ref
) final;
//! Handler for from_arrayReturnOut
//!
FormalParamArray from_arrayReturnOut_handler(
const FwIndexType portNum, //!< The port number
const FormalParamArray& a, //!< An array
FormalParamArray& aRef //!< An array ref
) final;
FormalParamArray from_arrayReturnOut_handler(const FwIndexType portNum, //!< The port number
const FormalParamArray& a, //!< An array
FormalParamArray& aRef //!< An array ref
) final;
//! Handler for from_enumArgsOut
//!
void from_enumArgsOut_handler(
const FwIndexType portNum, //!< The port number
const FormalParamEnum& en, //!< An enum
FormalParamEnum& enRef, //!< An enum ref
const FormalAliasEnum& enA, //!< An enum alias
FormalAliasEnum& enARef //!< An enum alias ref
) final;
void from_enumArgsOut_handler(const FwIndexType portNum, //!< The port number
const FormalParamEnum& en, //!< An enum
FormalParamEnum& enRef, //!< An enum ref
const FormalAliasEnum& enA, //!< An enum alias
FormalAliasEnum& enARef //!< An enum alias ref
) final;
//! Handler for from_enumReturnOut
//!
FormalParamEnum from_enumReturnOut_handler(
const FwIndexType portNum, //!< The port number
const FormalParamEnum& en, //!<An enum
FormalParamEnum& enRef //!< An enum ref
) final;
FormalParamEnum from_enumReturnOut_handler(const FwIndexType portNum, //!< The port number
const FormalParamEnum& en, //!< An enum
FormalParamEnum& enRef //!< An enum ref
) final;
//! Handler base-class function for from_arrayStringAliasReturnOut
FormalAliasStringArray from_arrayStringAliasReturnOut_handler(
FwIndexType portNum, //!< The port number
const FormalParamArray& a, //!< An array
FormalParamArray& aRef //!< An array ref
) final;
FormalAliasStringArray from_arrayStringAliasReturnOut_handler(FwIndexType portNum, //!< The port number
const FormalParamArray& a, //!< An array
FormalParamArray& aRef //!< An array ref
) final;
//! Handler base-class function for from_arrayStringAliasReturnOut
FormalAliasString from_stringAliasReturnOut_handler(
FwIndexType portNum, //!< The port number
const Fw::StringBase& str, //!< A string
Fw::StringBase& strRef //!< A string ref
) final;
FormalAliasString from_stringAliasReturnOut_handler(FwIndexType portNum, //!< The port number
const Fw::StringBase& str, //!< A string
Fw::StringBase& strRef //!< A string ref
) final;
//! Handler for from_stringArgsOut
//!
void from_stringArgsOut_handler(
const FwIndexType portNum,
const Fw::StringBase &str80,
Fw::StringBase &str80Ref,
const Fw::StringBase &str100,
Fw::StringBase &str100Ref
) final;
void from_stringArgsOut_handler(const FwIndexType portNum,
const Fw::StringBase& str80,
Fw::StringBase& str80Ref,
const Fw::StringBase& str100,
Fw::StringBase& str100Ref) final;
//! Handler for from_stringReturnOut
//!
Fw::String from_stringReturnOut_handler(
const FwIndexType portNum,
const Fw::StringBase &str,
Fw::StringBase &strRef
) final;
Fw::String from_stringReturnOut_handler(const FwIndexType portNum,
const Fw::StringBase& str,
Fw::StringBase& strRef) final;
//! Handler for from_noArgsOut
//!
void from_noArgsOut_handler(
const FwIndexType portNum //!< The port number
) final;
void from_noArgsOut_handler(const FwIndexType portNum //!< The port number
) final;
//! Handler for from_noArgsReturnOut
//!
bool from_noArgsReturnOut_handler(
const FwIndexType portNum //!< The port number
) final;
bool from_noArgsReturnOut_handler(const FwIndexType portNum //!< The port number
) final;
//! Handler for from_primitiveArgsOut
//!
void from_primitiveArgsOut_handler(const FwIndexType portNum, //!< The port number
U32 u32,
U32& u32Ref,
F32 f32,
F32& f32Ref,
bool b,
bool& bRef
) final;
void from_primitiveArgsOut_handler(const FwIndexType portNum, //!< The port number
U32 u32,
U32& u32Ref,
F32 f32,
F32& f32Ref,
bool b,
bool& bRef) final;
//! Handler for from_primitiveReturnOut
//!
U32 from_primitiveReturnOut_handler(const FwIndexType portNum, //!< The port number
U32 u32,
U32& u32Ref,
F32 f32,
F32& f32Ref,
bool b,
bool& bRef
) final;
U32 from_primitiveReturnOut_handler(const FwIndexType portNum, //!< The port number
U32 u32,
U32& u32Ref,
F32 f32,
F32& f32Ref,
bool b,
bool& bRef) final;
//! Handler for from_prmGetIn
//!
Fw::ParamValid from_prmGetIn_handler(const FwIndexType portNum, //!< The port number
FwPrmIdType id, //!< Parameter ID
Fw::ParamBuffer& val //!< Buffer containing serialized parameter value
) final;
Fw::ParamValid from_prmGetIn_handler(const FwIndexType portNum, //!< The port number
FwPrmIdType id, //!< Parameter ID
Fw::ParamBuffer& val //!< Buffer containing serialized parameter value
) final;
//! Handler for from_prmGetIn
//!
void from_prmSetIn_handler(const FwIndexType portNum, //!< The port number
FwPrmIdType id, //!< Parameter ID
Fw::ParamBuffer& val //!< Buffer containing serialized parameter value
) final;
void from_prmSetIn_handler(const FwIndexType portNum, //!< The port number
FwPrmIdType id, //!< Parameter ID
Fw::ParamBuffer& val //!< Buffer containing serialized parameter value
) final;
//! Handler for from_structArgsOut
//!
void from_structArgsOut_handler(const FwIndexType portNum, //!< The port number
const FormalParamStruct& s, //!< A struct
FormalParamStruct& sRef //!< A struct ref
) final;
void from_structArgsOut_handler(const FwIndexType portNum, //!< The port number
const FormalParamStruct& s, //!< A struct
FormalParamStruct& sRef //!< A struct ref
) final;
//! Handler for from_structReturnOut
//!
FormalParamStruct from_structReturnOut_handler(const FwIndexType portNum, //!< The port number
const FormalParamStruct& s, //!< A struct
FormalParamStruct& sRef //!< A struct ref
) final;
FormalParamStruct from_structReturnOut_handler(const FwIndexType portNum, //!< The port number
const FormalParamStruct& s, //!< A struct
FormalParamStruct& sRef //!< A struct ref
) final;
void from_enumArgsHookOverflowed_handler(const FwIndexType portNum,
const FormalParamEnum& en,
FormalParamEnum& enRef,
const FormalAliasEnum& enA,
FormalAliasEnum& enARef
);
const FormalParamEnum& en,
FormalParamEnum& enRef,
const FormalAliasEnum& enA,
FormalAliasEnum& enARef);

View File

@ -6,341 +6,194 @@
// Handler implementations for user-defined typed input ports
// ----------------------------------------------------------------------
Fw::String TestComponentName ::stringReturnGuarded_handler(
FwIndexType portNum,
const Fw::StringBase& str,
Fw::StringBase& strRef
) {
return this->stringReturnOut_out(portNum, str, strRef);
Fw::String TestComponentName ::stringReturnGuarded_handler(FwIndexType portNum,
const Fw::StringBase& str,
Fw::StringBase& strRef) {
return this->stringReturnOut_out(portNum, str, strRef);
}
void TestComponentName :: enumArgsSync_handler(
const FwIndexType portNum,
const FormalParamEnum &en,
FormalParamEnum &enRef,
const FormalAliasEnum& enA,
FormalAliasEnum& enARef
)
{
void TestComponentName ::enumArgsSync_handler(const FwIndexType portNum,
const FormalParamEnum& en,
FormalParamEnum& enRef,
const FormalAliasEnum& enA,
FormalAliasEnum& enARef) {
this->enumArgsOut_out(portNum, en, enRef, enA, enARef);
}
Fw::String TestComponentName ::stringReturnSync_handler(
FwIndexType portNum,
const Fw::StringBase& str,
Fw::StringBase& strRef
) {
return this->stringReturnOut_out(portNum, str, strRef);
Fw::String TestComponentName ::stringReturnSync_handler(FwIndexType portNum,
const Fw::StringBase& str,
Fw::StringBase& strRef) {
return this->stringReturnOut_out(portNum, str, strRef);
}
FormalAliasString TestComponentName ::stringAliasReturnGuarded_handler(
FwIndexType portNum,
const Fw::StringBase& str,
Fw::StringBase& strRef
) {
return this->stringAliasReturnOut_out(portNum, str, strRef);
FormalAliasString TestComponentName ::stringAliasReturnGuarded_handler(FwIndexType portNum,
const Fw::StringBase& str,
Fw::StringBase& strRef) {
return this->stringAliasReturnOut_out(portNum, str, strRef);
}
FormalAliasString TestComponentName ::stringAliasReturnSync_handler(
FwIndexType portNum,
const Fw::StringBase& str,
Fw::StringBase& strRef
) {
return this->stringAliasReturnOut_out(portNum, str, strRef);
FormalAliasString TestComponentName ::stringAliasReturnSync_handler(FwIndexType portNum,
const Fw::StringBase& str,
Fw::StringBase& strRef) {
return this->stringAliasReturnOut_out(portNum, str, strRef);
}
void TestComponentName ::
arrayArgsGuarded_handler(
const FwIndexType portNum,
const FormalParamArray &a,
FormalParamArray &aRef,
const FormalAliasArray& b,
FormalAliasArray& bRef,
const FormalAliasStringArray& c,
FormalAliasStringArray& cRef
)
{
this->arrayArgsOut_out(portNum, a, aRef, b, bRef, c, cRef);
}
void TestComponentName ::
arrayArgsSync_handler(
const FwIndexType portNum,
const FormalParamArray &a,
FormalParamArray &aRef,
const FormalAliasArray& b,
FormalAliasArray& bRef,
const FormalAliasStringArray& c,
FormalAliasStringArray& cRef
)
{
void TestComponentName ::arrayArgsGuarded_handler(const FwIndexType portNum,
const FormalParamArray& a,
FormalParamArray& aRef,
const FormalAliasArray& b,
FormalAliasArray& bRef,
const FormalAliasStringArray& c,
FormalAliasStringArray& cRef) {
this->arrayArgsOut_out(portNum, a, aRef, b, bRef, c, cRef);
}
FormalParamArray TestComponentName ::
arrayReturnGuarded_handler(
const FwIndexType portNum,
const FormalParamArray &a,
FormalParamArray &aRef
)
{
void TestComponentName ::arrayArgsSync_handler(const FwIndexType portNum,
const FormalParamArray& a,
FormalParamArray& aRef,
const FormalAliasArray& b,
FormalAliasArray& bRef,
const FormalAliasStringArray& c,
FormalAliasStringArray& cRef) {
this->arrayArgsOut_out(portNum, a, aRef, b, bRef, c, cRef);
}
FormalParamArray TestComponentName ::arrayReturnGuarded_handler(const FwIndexType portNum,
const FormalParamArray& a,
FormalParamArray& aRef) {
return this->arrayReturnOut_out(portNum, a, aRef);
}
FormalParamArray TestComponentName ::
arrayReturnSync_handler(
const FwIndexType portNum,
const FormalParamArray &a,
FormalParamArray &aRef
)
{
FormalParamArray TestComponentName ::arrayReturnSync_handler(const FwIndexType portNum,
const FormalParamArray& a,
FormalParamArray& aRef) {
return this->arrayReturnOut_out(portNum, a, aRef);
}
FormalAliasStringArray TestComponentName ::
arrayStringAliasReturnGuarded_handler(
const FwIndexType portNum,
const FormalParamArray& a,
FormalParamArray& aRef
)
{
FormalAliasStringArray TestComponentName ::arrayStringAliasReturnGuarded_handler(const FwIndexType portNum,
const FormalParamArray& a,
FormalParamArray& aRef) {
return this->arrayStringAliasReturnOut_out(portNum, a, aRef);
}
FormalAliasStringArray TestComponentName ::
arrayStringAliasReturnSync_handler(
const FwIndexType portNum,
const FormalParamArray& a,
FormalParamArray& aRef
)
{
FormalAliasStringArray TestComponentName ::arrayStringAliasReturnSync_handler(const FwIndexType portNum,
const FormalParamArray& a,
FormalParamArray& aRef) {
return this->arrayStringAliasReturnOut_out(portNum, a, aRef);
}
void TestComponentName ::
enumArgsGuarded_handler(
const FwIndexType portNum,
const FormalParamEnum &en,
FormalParamEnum &enRef,
const FormalAliasEnum& enA,
FormalAliasEnum& enARef
)
{
this->enumArgsOut_out(portNum, en, enRef, enA, enARef);
void TestComponentName ::enumArgsGuarded_handler(const FwIndexType portNum,
const FormalParamEnum& en,
FormalParamEnum& enRef,
const FormalAliasEnum& enA,
FormalAliasEnum& enARef) {
this->enumArgsOut_out(portNum, en, enRef, enA, enARef);
}
FormalParamEnum TestComponentName ::
enumReturnGuarded_handler(
const FwIndexType portNum,
const FormalParamEnum &en,
FormalParamEnum &enRef
)
{
return this->enumReturnOut_out(portNum, en, enRef);
FormalParamEnum TestComponentName ::enumReturnGuarded_handler(const FwIndexType portNum,
const FormalParamEnum& en,
FormalParamEnum& enRef) {
return this->enumReturnOut_out(portNum, en, enRef);
}
FormalParamEnum TestComponentName ::
enumReturnSync_handler(
const FwIndexType portNum,
const FormalParamEnum &en,
FormalParamEnum &enRef
)
{
return this->enumReturnOut_out(portNum, en, enRef);
FormalParamEnum TestComponentName ::enumReturnSync_handler(const FwIndexType portNum,
const FormalParamEnum& en,
FormalParamEnum& enRef) {
return this->enumReturnOut_out(portNum, en, enRef);
}
void TestComponentName ::
noArgsGuarded_handler(
const FwIndexType portNum
)
{
this->noArgsOut_out(portNum);
void TestComponentName ::noArgsGuarded_handler(const FwIndexType portNum) {
this->noArgsOut_out(portNum);
}
bool TestComponentName ::
noArgsReturnGuarded_handler(
const FwIndexType portNum
)
{
return this->noArgsReturnOut_out(portNum);
bool TestComponentName ::noArgsReturnGuarded_handler(const FwIndexType portNum) {
return this->noArgsReturnOut_out(portNum);
}
bool TestComponentName ::
noArgsReturnSync_handler(
const FwIndexType portNum
)
{
return this->noArgsReturnOut_out(portNum);
bool TestComponentName ::noArgsReturnSync_handler(const FwIndexType portNum) {
return this->noArgsReturnOut_out(portNum);
}
void TestComponentName ::
noArgsSync_handler(
const FwIndexType portNum
)
{
this->noArgsOut_out(portNum);
void TestComponentName ::noArgsSync_handler(const FwIndexType portNum) {
this->noArgsOut_out(portNum);
}
void TestComponentName ::
primitiveArgsGuarded_handler(
const FwIndexType portNum,
U32 u32,
U32 &u32Ref,
F32 f32,
F32 &f32Ref,
bool b,
bool &bRef
)
{
this->primitiveArgsOut_out(
portNum,
u32,
u32Ref,
f32,
f32Ref,
b,
bRef
);
void TestComponentName ::primitiveArgsGuarded_handler(const FwIndexType portNum,
U32 u32,
U32& u32Ref,
F32 f32,
F32& f32Ref,
bool b,
bool& bRef) {
this->primitiveArgsOut_out(portNum, u32, u32Ref, f32, f32Ref, b, bRef);
}
void TestComponentName ::
primitiveArgsSync_handler(
const FwIndexType portNum,
U32 u32,
U32 &u32Ref,
F32 f32,
F32 &f32Ref,
bool b,
bool &bRef
)
{
this->primitiveArgsOut_out(
portNum,
u32,
u32Ref,
f32,
f32Ref,
b,
bRef
);
void TestComponentName ::primitiveArgsSync_handler(const FwIndexType portNum,
U32 u32,
U32& u32Ref,
F32 f32,
F32& f32Ref,
bool b,
bool& bRef) {
this->primitiveArgsOut_out(portNum, u32, u32Ref, f32, f32Ref, b, bRef);
}
U32 TestComponentName ::
primitiveReturnGuarded_handler(
const FwIndexType portNum,
U32 u32,
U32 &u32Ref,
F32 f32,
F32 &f32Ref,
bool b,
bool &bRef
)
{
return this->primitiveReturnOut_out(
portNum,
u32,
u32Ref,
f32,
f32Ref,
b,
bRef
);
U32 TestComponentName ::primitiveReturnGuarded_handler(const FwIndexType portNum,
U32 u32,
U32& u32Ref,
F32 f32,
F32& f32Ref,
bool b,
bool& bRef) {
return this->primitiveReturnOut_out(portNum, u32, u32Ref, f32, f32Ref, b, bRef);
}
U32 TestComponentName ::
primitiveReturnSync_handler(
const FwIndexType portNum,
U32 u32,
U32 &u32Ref,
F32 f32,
F32 &f32Ref,
bool b,
bool &bRef
)
{
return this->primitiveReturnOut_out(
portNum,
u32,
u32Ref,
f32,
f32Ref,
b,
bRef
);
U32 TestComponentName ::primitiveReturnSync_handler(const FwIndexType portNum,
U32 u32,
U32& u32Ref,
F32 f32,
F32& f32Ref,
bool b,
bool& bRef) {
return this->primitiveReturnOut_out(portNum, u32, u32Ref, f32, f32Ref, b, bRef);
}
void TestComponentName ::
stringArgsGuarded_handler(
const FwIndexType portNum,
const Fw::StringBase &str80,
Fw::StringBase &str80Ref,
const Fw::StringBase &str100,
Fw::StringBase &str100Ref
)
{
this->stringArgsOut_out(
portNum,
str80,
str80Ref,
str100,
str100Ref
);
void TestComponentName ::stringArgsGuarded_handler(const FwIndexType portNum,
const Fw::StringBase& str80,
Fw::StringBase& str80Ref,
const Fw::StringBase& str100,
Fw::StringBase& str100Ref) {
this->stringArgsOut_out(portNum, str80, str80Ref, str100, str100Ref);
}
void TestComponentName ::
stringArgsSync_handler(
const FwIndexType portNum,
const Fw::StringBase &str80,
Fw::StringBase &str80Ref,
const Fw::StringBase &str100,
Fw::StringBase &str100Ref
)
{
this->stringArgsOut_out(
portNum,
str80,
str80Ref,
str100,
str100Ref
);
void TestComponentName ::stringArgsSync_handler(const FwIndexType portNum,
const Fw::StringBase& str80,
Fw::StringBase& str80Ref,
const Fw::StringBase& str100,
Fw::StringBase& str100Ref) {
this->stringArgsOut_out(portNum, str80, str80Ref, str100, str100Ref);
}
void TestComponentName ::
structArgsGuarded_handler(
const FwIndexType portNum,
const FormalParamStruct &s,
FormalParamStruct &sRef
)
{
this->structArgsOut_out(portNum, s, sRef);
void TestComponentName ::structArgsGuarded_handler(const FwIndexType portNum,
const FormalParamStruct& s,
FormalParamStruct& sRef) {
this->structArgsOut_out(portNum, s, sRef);
}
void TestComponentName ::
structArgsSync_handler(
const FwIndexType portNum,
const FormalParamStruct &s,
FormalParamStruct &sRef
)
{
this->structArgsOut_out(portNum, s, sRef);
void TestComponentName ::structArgsSync_handler(const FwIndexType portNum,
const FormalParamStruct& s,
FormalParamStruct& sRef) {
this->structArgsOut_out(portNum, s, sRef);
}
FormalParamStruct TestComponentName ::
structReturnGuarded_handler(
const FwIndexType portNum,
const FormalParamStruct &s,
FormalParamStruct &sRef
)
{
return this->structReturnOut_out(portNum, s, sRef);
FormalParamStruct TestComponentName ::structReturnGuarded_handler(const FwIndexType portNum,
const FormalParamStruct& s,
FormalParamStruct& sRef) {
return this->structReturnOut_out(portNum, s, sRef);
}
FormalParamStruct TestComponentName ::
structReturnSync_handler(
const FwIndexType portNum,
const FormalParamStruct &s,
FormalParamStruct &sRef
)
{
return this->structReturnOut_out(portNum, s, sRef);
FormalParamStruct TestComponentName ::structReturnSync_handler(const FwIndexType portNum,
const FormalParamStruct& s,
FormalParamStruct& sRef) {
return this->structReturnOut_out(portNum, s, sRef);
}

View File

@ -3,221 +3,187 @@
// ----------------------------------------------------------------------
//! Handler implementation for arrayArgsGuarded
void arrayArgsGuarded_handler(
FwIndexType portNum, //!< The port number
const FormalParamArray& a, //!< An array
FormalParamArray& aRef, //!< An array ref
const FormalAliasArray& b, //!< alias of an array
FormalAliasArray& bRef, //!< alias of array ref
const FormalAliasStringArray& c, //!< array of string aliases
FormalAliasStringArray& cRef //!< array of string aliases ref
) override;
void arrayArgsGuarded_handler(FwIndexType portNum, //!< The port number
const FormalParamArray& a, //!< An array
FormalParamArray& aRef, //!< An array ref
const FormalAliasArray& b, //!< alias of an array
FormalAliasArray& bRef, //!< alias of array ref
const FormalAliasStringArray& c, //!< array of string aliases
FormalAliasStringArray& cRef //!< array of string aliases ref
) override;
//! Handler implementation for arrayArgsSync
void arrayArgsSync_handler(
FwIndexType portNum, //!< The port number
const FormalParamArray& a, //!< An array
FormalParamArray& aRef, //!< An array ref
const FormalAliasArray& b, //!< alias of an array
FormalAliasArray& bRef, //!< alias of array ref
const FormalAliasStringArray& c, //!< array of string aliases
FormalAliasStringArray& cRef //!< array of string aliases ref
) override;
void arrayArgsSync_handler(FwIndexType portNum, //!< The port number
const FormalParamArray& a, //!< An array
FormalParamArray& aRef, //!< An array ref
const FormalAliasArray& b, //!< alias of an array
FormalAliasArray& bRef, //!< alias of array ref
const FormalAliasStringArray& c, //!< array of string aliases
FormalAliasStringArray& cRef //!< array of string aliases ref
) override;
//! Handler implementation for arrayReturnGuarded
FormalParamArray arrayReturnGuarded_handler(
FwIndexType portNum, //!< The port number
const FormalParamArray& a, //!< An array
FormalParamArray& aRef //!< An array ref
) override;
FormalParamArray arrayReturnGuarded_handler(FwIndexType portNum, //!< The port number
const FormalParamArray& a, //!< An array
FormalParamArray& aRef //!< An array ref
) override;
//! Handler implementation for arrayReturnSync
FormalParamArray arrayReturnSync_handler(
FwIndexType portNum, //!< The port number
const FormalParamArray& a, //!< An array
FormalParamArray& aRef //!< An array ref
) override;
FormalParamArray arrayReturnSync_handler(FwIndexType portNum, //!< The port number
const FormalParamArray& a, //!< An array
FormalParamArray& aRef //!< An array ref
) override;
//! Handler implementation for arrayReturnGuarded
FormalAliasStringArray arrayStringAliasReturnGuarded_handler(
FwIndexType portNum, //!< The port number
const FormalParamArray& a, //!< A string
FormalParamArray& aRef //!< A string ref
) override;
FormalAliasStringArray arrayStringAliasReturnGuarded_handler(FwIndexType portNum, //!< The port number
const FormalParamArray& a, //!< A string
FormalParamArray& aRef //!< A string ref
) override;
//! Handler implementation for arrayReturnSync
FormalAliasStringArray arrayStringAliasReturnSync_handler(
FwIndexType portNum, //!< The port number
const FormalParamArray& a, //!< A string
FormalParamArray& aRef //!< A string ref
) override;
FormalAliasStringArray arrayStringAliasReturnSync_handler(FwIndexType portNum, //!< The port number
const FormalParamArray& a, //!< A string
FormalParamArray& aRef //!< A string ref
) override;
//! Handler implementation for enumArgsGuarded
void enumArgsGuarded_handler(
FwIndexType portNum, //!< The port number
const FormalParamEnum& en, //!< An enum
FormalParamEnum& enRef, //!< An enum ref
const FormalAliasEnum& enA, //!< An enum alias
FormalAliasEnum& enARef //!< An enum alias ref
) override;
void enumArgsGuarded_handler(FwIndexType portNum, //!< The port number
const FormalParamEnum& en, //!< An enum
FormalParamEnum& enRef, //!< An enum ref
const FormalAliasEnum& enA, //!< An enum alias
FormalAliasEnum& enARef //!< An enum alias ref
) override;
//! Handler implementation for enumArgsSync
void enumArgsSync_handler(
FwIndexType portNum, //!< The port number
const FormalParamEnum& en, //!< An enum
FormalParamEnum& enRef, //!< An enum ref
const FormalAliasEnum& enA, //!< An enum alias
FormalAliasEnum& enARef //!< An enum alias ref
) override;
void enumArgsSync_handler(FwIndexType portNum, //!< The port number
const FormalParamEnum& en, //!< An enum
FormalParamEnum& enRef, //!< An enum ref
const FormalAliasEnum& enA, //!< An enum alias
FormalAliasEnum& enARef //!< An enum alias ref
) override;
//! Handler implementation for enumReturnGuarded
FormalParamEnum enumReturnGuarded_handler(
FwIndexType portNum, //!< The port number
const FormalParamEnum& en, //!< An enum
FormalParamEnum& enRef //!< An enum ref
) override;
FormalParamEnum enumReturnGuarded_handler(FwIndexType portNum, //!< The port number
const FormalParamEnum& en, //!< An enum
FormalParamEnum& enRef //!< An enum ref
) override;
//! Handler implementation for enumReturnSync
FormalParamEnum enumReturnSync_handler(
FwIndexType portNum, //!< The port number
const FormalParamEnum& en, //!< An enum
FormalParamEnum& enRef //!< An enum ref
) override;
FormalParamEnum enumReturnSync_handler(FwIndexType portNum, //!< The port number
const FormalParamEnum& en, //!< An enum
FormalParamEnum& enRef //!< An enum ref
) override;
//! Handler implementation for noArgsGuarded
void noArgsGuarded_handler(
FwIndexType portNum //!< The port number
) override;
void noArgsGuarded_handler(FwIndexType portNum //!< The port number
) override;
//! Handler implementation for noArgsReturnGuarded
bool noArgsReturnGuarded_handler(
FwIndexType portNum //!< The port number
) override;
bool noArgsReturnGuarded_handler(FwIndexType portNum //!< The port number
) override;
//! Handler implementation for noArgsReturnSync
bool noArgsReturnSync_handler(
FwIndexType portNum //!< The port number
) override;
bool noArgsReturnSync_handler(FwIndexType portNum //!< The port number
) override;
//! Handler implementation for noArgsSync
void noArgsSync_handler(
FwIndexType portNum //!< The port number
) override;
void noArgsSync_handler(FwIndexType portNum //!< The port number
) override;
//! Handler implementation for primitiveArgsGuarded
void primitiveArgsGuarded_handler(
FwIndexType portNum, //!< The port number
U32 u32,
U32& u32Ref,
F32 f32,
F32& f32Ref,
bool b,
bool& bRef
) override;
void primitiveArgsGuarded_handler(FwIndexType portNum, //!< The port number
U32 u32,
U32& u32Ref,
F32 f32,
F32& f32Ref,
bool b,
bool& bRef) override;
//! Handler implementation for primitiveArgsSync
void primitiveArgsSync_handler(
FwIndexType portNum, //!< The port number
U32 u32,
U32& u32Ref,
F32 f32,
F32& f32Ref,
bool b,
bool& bRef
) override;
void primitiveArgsSync_handler(FwIndexType portNum, //!< The port number
U32 u32,
U32& u32Ref,
F32 f32,
F32& f32Ref,
bool b,
bool& bRef) override;
//! Handler implementation for primitiveReturnGuarded
U32 primitiveReturnGuarded_handler(
FwIndexType portNum, //!< The port number
U32 u32,
U32& u32Ref,
F32 f32,
F32& f32Ref,
bool b,
bool& bRef
) override;
U32 primitiveReturnGuarded_handler(FwIndexType portNum, //!< The port number
U32 u32,
U32& u32Ref,
F32 f32,
F32& f32Ref,
bool b,
bool& bRef) override;
//! Handler implementation for primitiveReturnSync
U32 primitiveReturnSync_handler(
FwIndexType portNum, //!< The port number
U32 u32,
U32& u32Ref,
F32 f32,
F32& f32Ref,
bool b,
bool& bRef
) override;
U32 primitiveReturnSync_handler(FwIndexType portNum, //!< The port number
U32 u32,
U32& u32Ref,
F32 f32,
F32& f32Ref,
bool b,
bool& bRef) override;
//! Handler implementation for stringArgsGuarded
void stringArgsGuarded_handler(
FwIndexType portNum, //!< The port number
const Fw::StringBase& str80, //!< A string of size 80
Fw::StringBase& str80Ref,
const Fw::StringBase& str100, //!< A string of size 100
Fw::StringBase& str100Ref
) override;
void stringArgsGuarded_handler(FwIndexType portNum, //!< The port number
const Fw::StringBase& str80, //!< A string of size 80
Fw::StringBase& str80Ref,
const Fw::StringBase& str100, //!< A string of size 100
Fw::StringBase& str100Ref) override;
//! Handler implementation for stringArgsSync
void stringArgsSync_handler(
FwIndexType portNum, //!< The port number
const Fw::StringBase& str80, //!< A string of size 80
Fw::StringBase& str80Ref,
const Fw::StringBase& str100, //!< A string of size 100
Fw::StringBase& str100Ref
) override;
void stringArgsSync_handler(FwIndexType portNum, //!< The port number
const Fw::StringBase& str80, //!< A string of size 80
Fw::StringBase& str80Ref,
const Fw::StringBase& str100, //!< A string of size 100
Fw::StringBase& str100Ref) override;
//! Handler implementation for structArgsGuarded
void structArgsGuarded_handler(
FwIndexType portNum, //!< The port number
const FormalParamStruct& s, //!< A struct
FormalParamStruct& sRef //!< A struct ref
) override;
void structArgsGuarded_handler(FwIndexType portNum, //!< The port number
const FormalParamStruct& s, //!< A struct
FormalParamStruct& sRef //!< A struct ref
) override;
//! Handler implementation for stringReturnGuarded
Fw::String stringReturnGuarded_handler(
FwIndexType portNum, //!< The port number
const Fw::StringBase& str, //!< A string
Fw::StringBase& strRef //!< A string ref
) override;
Fw::String stringReturnGuarded_handler(FwIndexType portNum, //!< The port number
const Fw::StringBase& str, //!< A string
Fw::StringBase& strRef //!< A string ref
) override;
//! Handler implementation for stringReturnSync
Fw::String stringReturnSync_handler(
FwIndexType portNum, //!< The port number
const Fw::StringBase& str, //!< A string
Fw::StringBase& strRef //!< A string ref
) override;
Fw::String stringReturnSync_handler(FwIndexType portNum, //!< The port number
const Fw::StringBase& str, //!< A string
Fw::StringBase& strRef //!< A string ref
) override;
//! Handler implementation for stringAliasReturnGuarded
FormalAliasString stringAliasReturnGuarded_handler(
FwIndexType portNum, //!< The port number
const Fw::StringBase& str, //!< A string
Fw::StringBase& strRef //!< A string ref
) override;
FormalAliasString stringAliasReturnGuarded_handler(FwIndexType portNum, //!< The port number
const Fw::StringBase& str, //!< A string
Fw::StringBase& strRef //!< A string ref
) override;
//! Handler implementation for stringAliasReturnSync
FormalAliasString stringAliasReturnSync_handler(
FwIndexType portNum, //!< The port number
const Fw::StringBase& str, //!< A string
Fw::StringBase& strRef //!< A string ref
) override;
FormalAliasString stringAliasReturnSync_handler(FwIndexType portNum, //!< The port number
const Fw::StringBase& str, //!< A string
Fw::StringBase& strRef //!< A string ref
) override;
//! Handler implementation for structArgsSync
void structArgsSync_handler(
FwIndexType portNum, //!< The port number
const FormalParamStruct& s, //!< A struct
FormalParamStruct& sRef //!< A struct ref
) override;
void structArgsSync_handler(FwIndexType portNum, //!< The port number
const FormalParamStruct& s, //!< A struct
FormalParamStruct& sRef //!< A struct ref
) override;
//! Handler implementation for structReturnGuarded
FormalParamStruct structReturnGuarded_handler(
FwIndexType portNum, //!< The port number
const FormalParamStruct& s, //!< A struct
FormalParamStruct& sRef //!< A struct ref
) override;
FormalParamStruct structReturnGuarded_handler(FwIndexType portNum, //!< The port number
const FormalParamStruct& s, //!< A struct
FormalParamStruct& sRef //!< A struct ref
) override;
//! Handler implementation for structReturnSync
FormalParamStruct structReturnSync_handler(
FwIndexType portNum, //!< The port number
const FormalParamStruct& s, //!< A struct
FormalParamStruct& sRef //!< A struct ref
) override;
FormalParamStruct structReturnSync_handler(FwIndexType portNum, //!< The port number
const FormalParamStruct& s, //!< A struct
FormalParamStruct& sRef //!< A struct ref
) override;

View File

@ -1,91 +1,51 @@
void TestComponentName ::
arrayArgsAsync_handler(
const FwIndexType portNum,
const FormalParamArray &a,
FormalParamArray &aRef,
const FormalAliasArray& b,
FormalAliasArray& bRef,
const FormalAliasStringArray& c,
FormalAliasStringArray& cRef)
{
void TestComponentName ::arrayArgsAsync_handler(const FwIndexType portNum,
const FormalParamArray& a,
FormalParamArray& aRef,
const FormalAliasArray& b,
FormalAliasArray& bRef,
const FormalAliasStringArray& c,
FormalAliasStringArray& cRef) {
this->arrayArgsOut_out(portNum, a, aRef, b, bRef, c, cRef);
}
void TestComponentName ::
enumArgsAsync_handler(
const FwIndexType portNum,
const FormalParamEnum &en,
FormalParamEnum &enRef,
const FormalAliasEnum& enA,
FormalAliasEnum& enARef
)
{
void TestComponentName ::enumArgsAsync_handler(const FwIndexType portNum,
const FormalParamEnum& en,
FormalParamEnum& enRef,
const FormalAliasEnum& enA,
FormalAliasEnum& enARef) {
this->enumArgsOut_out(portNum, en, enRef, enA, enARef);
}
void TestComponentName ::
noArgsAsync_handler(
const FwIndexType portNum
)
{
void TestComponentName ::noArgsAsync_handler(const FwIndexType portNum) {
this->noArgsOut_out(portNum);
}
void TestComponentName ::
primitiveArgsAsync_handler(
const FwIndexType portNum,
U32 u32,
U32 &u32Ref,
F32 f32,
F32 &f32Ref,
bool b,
bool &bRef
)
{
this->primitiveArgsOut_out(
portNum,
u32,
u32Ref,
f32,
f32Ref,
b,
bRef
);
void TestComponentName ::primitiveArgsAsync_handler(const FwIndexType portNum,
U32 u32,
U32& u32Ref,
F32 f32,
F32& f32Ref,
bool b,
bool& bRef) {
this->primitiveArgsOut_out(portNum, u32, u32Ref, f32, f32Ref, b, bRef);
}
void TestComponentName ::
structArgsAsync_handler(
const FwIndexType portNum,
const FormalParamStruct &s,
FormalParamStruct &sRef
)
{
void TestComponentName ::structArgsAsync_handler(const FwIndexType portNum,
const FormalParamStruct& s,
FormalParamStruct& sRef) {
this->structArgsOut_out(portNum, s, sRef);
}
void TestComponentName ::
stringArgsAsync_handler(
const FwIndexType portNum,
const Fw::StringBase &str80,
Fw::StringBase &str80Ref,
const Fw::StringBase &str100,
Fw::StringBase &str100Ref
)
{
this->stringArgsOut_out(
portNum,
str80,
str80Ref,
str100,
str100Ref
);
void TestComponentName ::stringArgsAsync_handler(const FwIndexType portNum,
const Fw::StringBase& str80,
Fw::StringBase& str80Ref,
const Fw::StringBase& str100,
Fw::StringBase& str100Ref) {
this->stringArgsOut_out(portNum, str80, str80Ref, str100, str100Ref);
}
void TestComponentName ::
enumArgsHook_handler(
const FwIndexType portNum,
const FormalParamEnum &en,
FormalParamEnum &enRef,
const FormalAliasEnum& enA,
FormalAliasEnum& enARef
) {}
void TestComponentName ::enumArgsHook_handler(const FwIndexType portNum,
const FormalParamEnum& en,
FormalParamEnum& enRef,
const FormalAliasEnum& enA,
FormalAliasEnum& enARef) {}

View File

@ -1,60 +1,51 @@
//! Handler implementation for arrayArgsAsync
void arrayArgsAsync_handler(
FwIndexType portNum, //!< The port number
const FormalParamArray& a, //!< An array
FormalParamArray& aRef, //!< An array ref
const FormalAliasArray& b, //!< alias of an array
FormalAliasArray& bRef, //!< alias of array ref
const FormalAliasStringArray& c, //!< array of string aliases
FormalAliasStringArray& cRef //!< array of string aliases ref
) override;
void arrayArgsAsync_handler(FwIndexType portNum, //!< The port number
const FormalParamArray& a, //!< An array
FormalParamArray& aRef, //!< An array ref
const FormalAliasArray& b, //!< alias of an array
FormalAliasArray& bRef, //!< alias of array ref
const FormalAliasStringArray& c, //!< array of string aliases
FormalAliasStringArray& cRef //!< array of string aliases ref
) override;
//! Handler implementation for enumArgsAsync
void enumArgsAsync_handler(
FwIndexType portNum, //!< The port number
const FormalParamEnum& en, //!< An enum
FormalParamEnum& enRef, //!< An enum ref
const FormalAliasEnum& enA, //!< An enum alias
FormalAliasEnum& enARef //!< An enum alias ref
) override;
void enumArgsAsync_handler(FwIndexType portNum, //!< The port number
const FormalParamEnum& en, //!< An enum
FormalParamEnum& enRef, //!< An enum ref
const FormalAliasEnum& enA, //!< An enum alias
FormalAliasEnum& enARef //!< An enum alias ref
) override;
//! Handler implementation for noArgsAsync
void noArgsAsync_handler(
FwIndexType portNum //!< The port number
) override;
void noArgsAsync_handler(FwIndexType portNum //!< The port number
) override;
//! Handler implementation for primitiveArgsAsync
void primitiveArgsAsync_handler(
FwIndexType portNum, //!< The port number
U32 u32,
U32& u32Ref,
F32 f32,
F32& f32Ref,
bool b,
bool& bRef
) override;
void primitiveArgsAsync_handler(FwIndexType portNum, //!< The port number
U32 u32,
U32& u32Ref,
F32 f32,
F32& f32Ref,
bool b,
bool& bRef) override;
//! Handler implementation for stringArgsAsync
void stringArgsAsync_handler(
FwIndexType portNum, //!< The port number
const Fw::StringBase& str80, //!< A string of size 80
Fw::StringBase& str80Ref,
const Fw::StringBase& str100, //!< A string of size 100
Fw::StringBase& str100Ref
) override;
void stringArgsAsync_handler(FwIndexType portNum, //!< The port number
const Fw::StringBase& str80, //!< A string of size 80
Fw::StringBase& str80Ref,
const Fw::StringBase& str100, //!< A string of size 100
Fw::StringBase& str100Ref) override;
//! Handler implementation for structArgsAsync
void structArgsAsync_handler(
FwIndexType portNum, //!< The port number
const FormalParamStruct& s, //!< A struct
FormalParamStruct& sRef //!< A struct ref
) override;
void structArgsAsync_handler(FwIndexType portNum, //!< The port number
const FormalParamStruct& s, //!< A struct
FormalParamStruct& sRef //!< A struct ref
) override;
//! Handler implementation for enumArgsOverflow
void enumArgsHook_handler(
FwIndexType portNum, //!< The port number
const FormalParamEnum& en, //!< An enum
FormalParamEnum& enRef, //!< An enum ref
const FormalAliasEnum& enA, //!< An enum alias
FormalAliasEnum& enARef //!< An enum alias ref
) override;
void enumArgsHook_handler(FwIndexType portNum, //!< The port number
const FormalParamEnum& en, //!< An enum
FormalParamEnum& enRef, //!< An enum ref
const FormalAliasEnum& enA, //!< An enum alias
FormalAliasEnum& enARef //!< An enum alias ref
) override;

View File

@ -4,26 +4,13 @@
// \brief cpp file for Empty component implementation class
// ======================================================================
#include "Empty.hpp"
#include <Fw/FPrimeBasicTypes.hpp>
// ----------------------------------------------------------------------
// Construction, initialization, and destruction
// ----------------------------------------------------------------------
Empty ::
Empty(
const char *const compName
) : EmptyComponentBase(compName)
{
}
Empty ::
~Empty()
{
}
Empty ::Empty(const char* const compName) : EmptyComponentBase(compName) {}
Empty ::~Empty() {}

View File

@ -9,24 +9,18 @@
#include "FppTest/component/empty/EmptyComponentAc.hpp"
class Empty :
public EmptyComponentBase
{
class Empty : public EmptyComponentBase {
public:
// ----------------------------------------------------------------------
// Component construction, initialization, and destruction
// ----------------------------------------------------------------------
//! Construct Empty object
Empty(
const char* const compName //!< The component name
Empty(const char* const compName //!< The component name
);
//! Destroy Empty object
~Empty();
};
#endif

Some files were not shown because too many files have changed in this diff Show More