forked from nasa/fprime
-
Notifications
You must be signed in to change notification settings - Fork 0
Add CFDP support to Fprime #11
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
pepepr08
wants to merge
185
commits into
monarch
Choose a base branch
from
cfdp_manager
base: monarch
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 184 commits
Commits
Show all changes
185 commits
Select commit
Hold shift + click to select a range
fea5c79
Added CfdpManager skeleton
Brian-Campuzano 7210036
Copy PDU packet layer as-is
Brian-Campuzano e43b38a
Bring in other header dependencies
Brian-Campuzano 2600d2f
Updates to get the packet layer to compile
Brian-Campuzano 4f88fcc
Bring in CFDP engine files
Brian-Campuzano a3e5388
Bring in addititional CF depedencies and refactor CF asserts into FW_…
Brian-Campuzano f37d4af
c -> c++ updates
Brian-Campuzano 9ad7fa3
c to c++ conversion checkpoint
Brian-Campuzano 7e2cb25
Os directory checkpoint
Brian-Campuzano 430d729
Add custom timer soloution to replace CFE timer implementation
Brian-Campuzano 9c87f41
Os File stub completion
Brian-Campuzano feedb58
Update CRC
Brian-Campuzano 1551013
Added buffer management and removed pipes/semaphores
Brian-Campuzano 46071c6
Beggining of buffer refactor
Brian-Campuzano 69c38ad
Buffer management checkpoint
Brian-Campuzano 331d83c
Brought in cf_utils for list traversals
Brian-Campuzano 3757bf6
Convert CfdpEngine into a class
Brian-Campuzano cd7e799
Revert "Convert CfdpEngine into a class"
Brian-Campuzano a9fe74c
Additional CFE OS stubs
Brian-Campuzano 9d06019
Fixed container pointer arithmatic for C++
Brian-Campuzano 4c50ca8
Completed refactor of cf_utils
Brian-Campuzano 69fe755
Beginning of adding parameters
Brian-Campuzano 8356a3e
Refactor CF_CFDP_S_CheckAndRespondNak to separate out error logic and…
Brian-Campuzano ccfb9ae
CFDP send checkpoint
Brian-Campuzano 739eb7a
Completed CFDP send updates
Brian-Campuzano d26b713
Completed CFDP receive refactor
Brian-Campuzano ef241a2
CFDP refactor checkpoint
Brian-Campuzano 1ea5039
Playback directory checkpoint
Brian-Campuzano e1f5f25
CfdpManager compiles!
Brian-Campuzano ade7fb2
Added PDU receive data paths/hooks
Brian-Campuzano 53f8236
CF -> CFDP file rename
Brian-Campuzano 3fad49c
CF -> CFDP file rename complete
Brian-Campuzano 543f2e7
Remove header comments
Brian-Campuzano 710cf82
Refactor CFDP variable size types
Brian-Campuzano 0b5b839
Refactor default_cf_extern_typedefs.hpp into CfdpTypes.fpp and CfdpTy…
Brian-Campuzano 4cbf3ab
Refactor default_cf_interface_cfg.hpp to CfdpCfg.hpp
Brian-Campuzano d3a93ba
Revert history init
Brian-Campuzano 29939f4
Move CFDP types and configs
Brian-Campuzano 74a0c2e
UT skeleton
Brian-Campuzano b1c8af0
Split parameters to separate include file
Brian-Campuzano 6ac17b4
Implemented the SendFile command
Brian-Campuzano 9ac0f43
Added CFDP playback directory command
Brian-Campuzano a3f8ee8
Added freeze/thaw command
Brian-Campuzano d94df63
Add buffer return for failure to send case
Brian-Campuzano 0a544de
Added polling directory commands
Brian-Campuzano 2668bab
Fixed comment offsets
Brian-Campuzano d7d7622
Converted CF_WrappedOpenCreate calls to Os::File::open
Brian-Campuzano 155e8b5
Convert CF_WrappedWrite to Os::File::write
Brian-Campuzano 27df902
Replaced CF_WrappedRead with Os::File::Read
Brian-Campuzano c921a51
Replaced CF_WrappedClose with Os::File::close
Brian-Campuzano e18bb88
Replaced OS_ObjectIdDefined with Os::File::isOpen
Brian-Campuzano fe08fa2
Replaced CF_WrappedLseek with Os::File::seek
Brian-Campuzano 6497c81
Refactor CF_CFDP_MoveFile to Os::FileSystem::moveFile + string refact…
Brian-Campuzano 01f2cc5
Refactored OS_remove to Os::FileSystem::removeFile
Brian-Campuzano 37b036c
Refactored OS_mv to Os::FileSystem::moveFile
Brian-Campuzano 6fab913
Replaced OS_DirectoryOpen with Os::Directory::open
Brian-Campuzano 8a287cc
Replaced OS_DirectoryRead with Os::Directory::read
Brian-Campuzano b331ef5
Replaced OS_DirectoryClose with Os::Directory::close
Brian-Campuzano 868c4ca
Deleted CfeStubs
Brian-Campuzano 1ee2a22
Remove CfeStubs.hpp includes and add CfdpMaxPduSize constants
Brian-Campuzano 1f6083d
Data pointer refactor to remove void*
Brian-Campuzano 590ea13
Rework receive init to use Fw::String
Brian-Campuzano bbbb6cd
Fix compilation errors
Brian-Campuzano 86a4b49
Made include paths absolute and moved file size type def to config
Brian-Campuzano 732ac69
Added separate metadata serailizable
Brian-Campuzano 8a7654e
Rework enums that did not need to serializables
Brian-Campuzano 3f39ef6
Completed metadata UT
Brian-Campuzano 4788860
Split PDUs to separate whitespace
Brian-Campuzano e49539b
Added FileData PDU and UTs
Brian-Campuzano 409a99e
Added file data PDU test
Brian-Campuzano ae8b574
Added end-of-file PDU and UTs
Brian-Campuzano 3a129c9
Added missing file
Brian-Campuzano 598951e
Added end of file PDU UT to CfdpManager
Brian-Campuzano 0be648c
Refactor UTs to separate out validation functions
Brian-Campuzano d512ef1
Implemented FinPdu class and UTs
Brian-Campuzano 48f7ef6
Added CfdpManager FinPdu UT
Brian-Campuzano 91be718
Added AckPdu implementation and UTs
Brian-Campuzano 0bfb001
Added AckPdu UT for CfdpManager
Brian-Campuzano fba8b22
Added missing CRC check
Brian-Campuzano 7c8af63
Added NakPdu implementaiton and UTs
Brian-Campuzano 2ce3bc3
Added CfdpManager NackPdu UT
Brian-Campuzano 9642f74
Refactor PDU tests to a new file
Brian-Campuzano 44108bf
Refactored test helpers to deserialize and validate PDUs
Brian-Campuzano dd11db9
Added class 1 TX transaction text
Brian-Campuzano af0f1bc
Added output PDU throttling
Brian-Campuzano 4e8d696
Started a class 2 TX UT and added helper functions for uplinking PDUs
Brian-Campuzano c48a9bd
Code cleanup
Brian-Campuzano 9b5b504
Debugging failed chunk allocation for class 2 transactions
Brian-Campuzano f182891
Updated class 1 transaction UT to expire the inactivity timer. Also s…
Brian-Campuzano 5d01adf
Updated class 2 TX UT to have correct PDU ordering
Brian-Campuzano 23a219e
Added CFDP subtopology
Brian-Campuzano 5061c01
Completed TX class 2 transaction UT
Brian-Campuzano 0c20f12
Added class 2 transaction UT with a nack
Brian-Campuzano 128c635
Refactor UTs to make them more readable
Brian-Campuzano 1e4fa60
Added a class 1 RX unit test
Brian-Campuzano eb83642
Added class 2 RX transaction UT
Brian-Campuzano f9bddd2
Add RX transaction UT with NAck
Brian-Campuzano 2090e33
Refactored CfdpEngine into child-class of CfdpManager
Brian-Campuzano b188146
Created CfdpChannel class
Brian-Campuzano 2e9b2c6
Refactor CfdpEngineData to be CfdpEngine member variables
Brian-Campuzano 104ff16
Moved CF_Channel_t data into CfdpChannel member variables. There is s…
Brian-Campuzano b95c593
Fixed testMetaDataPdu UT
Brian-Campuzano 1e1f7f3
Updated remaining PDU tests
Brian-Campuzano b8aaf7b
Removed lingering CF_Channel_t references and functions
Brian-Campuzano aab3cce
Created new CfdpTransaction class and skeletons
Brian-Campuzano 9f075b5
Ported TX functions to new class
Brian-Campuzano f295d6f
Ported RX functions to new Transaciton class
Brian-Campuzano d593b66
Additional transaction class rework
Brian-Campuzano 3ff48f6
Refactor CfdpTransaction as stepping stone toward struct removal
Brian-Campuzano f062e00
Moved CF dispatch functions into the CfdpTransaction class
Brian-Campuzano 2e076ac
Completed CfdpTransaction refactor
Brian-Campuzano a2d87c5
Rework memory initialization for better encapsulation
Brian-Campuzano eabed81
Friend class cleanup
Brian-Campuzano df34674
Refactored CfdpChunk into a C++ class
Brian-Campuzano 5d18ba9
Additional C++ refactor cleanup
Brian-Campuzano 6730a7e
Moved CFDP types and renames Pdu folder to Types folder
Brian-Campuzano 08c5d75
Removed internal buffer test pool
Brian-Campuzano e6b0e1e
Refactored Tx functions to use Pdu classes instead of the CF codec fu…
Brian-Campuzano c708389
Refactored Rx functions to use Pdu classes
Brian-Campuzano 031e5e7
Completed deprecated codec removal and fixed UTs
Brian-Campuzano 38e41a7
Added TLV support and refactor cleanup
Brian-Campuzano 42634fc
Added CF attribution file
Brian-Campuzano 614fbdd
Removed PDU union wrapper in-favor of PDU class inheritance. Updated …
Brian-Campuzano b627b2e
Cleanup post class refactor
Brian-Campuzano b02d9cf
Code cleanup and file size type updates
Brian-Campuzano cd3a1f0
Start of CF -> CFDP rename/refactor
Brian-Campuzano 8a41bd3
Remove last vestigages of CF types
Brian-Campuzano 153ea5e
Updated UTs post CF -> CFDP rename
Brian-Campuzano 8bf4634
Start of CFDP class addition, starting removal of deprecated CF types
Brian-Campuzano 4bea27c
Completed Cfdp namespace addition
Brian-Campuzano ab2350d
Consolidate Cfdp types to a single file
Brian-Campuzano a71a994
Renamed transaction files so they will sort correctly
Brian-Campuzano cf18349
Cleanup some todos and make comment style consistent
Brian-Campuzano 99778fe
Added CFDP overview SDD section
Brian-Campuzano 1e6e1db
Added port based file transfer requests similar to FileDownlink
Brian-Campuzano b017ae8
Added Tx port based file transfer UT
Brian-Campuzano e83fb1e
Added additional UTs
Brian-Campuzano 1ed86df
Added ping port and fixed issues from fprime sync
Brian-Campuzano fb44beb
Added CfdpManager class diagram
Brian-Campuzano aab447f
Fixed component class diagram
Brian-Campuzano e805ae9
Reworked class diagram
Brian-Campuzano b6537f0
Added CfdpManager usage diagram and updated port naming to be consistent
Brian-Campuzano 1febea0
Playing with color themes
Brian-Campuzano f9f813a
Another theme iteration
Brian-Campuzano bb1dfa9
Added component design section
Brian-Campuzano e837b67
Added TX transaction sequence diagrams
Brian-Campuzano ea03d2e
Added class 2 RX sequence diagram
Brian-Campuzano ad4cd84
Fixed bug in file deletion
Brian-Campuzano 53d9f2b
Added command and telemetry section
Brian-Campuzano 44a3921
Added proposed telemetry
Brian-Campuzano 98a26ad
Populated requirements section
Brian-Campuzano 6d5139a
SDD rework and added section numbers
Brian-Campuzano cad4531
Add configuration section to the SDD and took a pass at cleaning up t…
Brian-Campuzano 0c402f3
First pass a getting the spell check to pass
Brian-Campuzano 8e39947
Added new CFDP terms
Brian-Campuzano 6d79e11
Another spelling iteration. EVS will be removed with F' events are im…
Brian-Campuzano a3505e4
Fix spelling goofs
Brian-Campuzano 9c64fa5
Removed duplicate spelling exceptions
Brian-Campuzano ecbe333
Replace commented out cFE Events with F' Events
a96f293
Directly use Cfdp.Class for events
b0d5040
Remove recvAck()
ad0a6d6
Added TX/RX throttling SDD section and made class, keep, and priority…
Brian-Campuzano 49a6b85
Updated class 2 sequence diagrams to make timer values explicit. Also…
Brian-Campuzano 8f17d01
Added transaction management commands
Brian-Campuzano 89b2ae1
Move tmp_dir and fail_dir from global parameters to per-channel param…
Brian-Campuzano 0cbb6fe
Purge the terms configuration table and wakeup which were CF terminology
Brian-Campuzano 35ba5c6
Added Deep Space Timer Configuration section to account for light spe…
Brian-Campuzano 794d41b
Added documentation on NAK behavior during file data transmission
Brian-Campuzano bd0dcdd
Remove AI slop
Brian-Campuzano f702d35
Rewording to make spell checker happy
Brian-Campuzano 0901d83
Swap SUSPEND and RESUME enum
8ff8223
Clarify success criteria doesn't care about current state
06b0ba0
Update transaction canceled comment
ee7772c
Implement CfdpManager telemetry
59d0a70
Send events when transaction completes successfully
753158a
Add size to TxFileTransferStarted event
59c6a87
Update cached_pos right after successful file read
5a281d5
Rename channel current transaction variable
ccc3798
Fix issue when reaching max_outgoing_pdus_per_cycle
8cb4c21
Strip packet type descriptor before reading PDU
8c886c0
Reset timer during CRC calculation period
047d93b
Fix spelling check CI pipeline
b971f32
Connect CfdpManager directly to ComQueue
99340f8
Remove duplicate words
6634aac
Update defaults to speed up transactions
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,58 @@ | ||
| # CFDP Manager Attribution | ||
|
|
||
| This component implements the CCSDS File Delivery Protocol (CFDP) for F-Prime (F'). It includes both ported code from NASA's Core Flight System (cFS) CFDP application and new F' implementations. | ||
|
|
||
| ## Source Attribution | ||
|
|
||
| Portions of this code are derived from the NASA Core Flight System (cFS) CFDP (CF) Application: | ||
| - **Repository**: https://github.com/nasa/CF | ||
| - **Version**: 3.0.0 | ||
| - **License**: Apache License 2.0 | ||
| - **Copyright**: Copyright (c) 2019 United States Government as represented by the Administrator of the National Aeronautics and Space Administration | ||
| - **NASA Docket**: GSC-18,447-1 | ||
|
|
||
| ## Files Ported from CF | ||
|
|
||
| The following files are ports/adaptations from CF source code and retain the original NASA copyright: | ||
|
|
||
| ### Core Engine & Transaction Management | ||
| - `Engine.hpp` / `.cpp` - from `cf_cfdp.c` / `cf_cfdp.h` | ||
| - `Transaction.hpp` - from `cf_cfdp_r.h` / `cf_cfdp_s.h` / `cf_cfdp_dispatch.h` | ||
| - `TransactionTx.cpp` - from `cf_cfdp_s.c` / `cf_cfdp_dispatch.c` | ||
| - `TransactionRx.cpp` - from `cf_cfdp_r.c` / `cf_cfdp_dispatch.c` | ||
|
|
||
| ### Data Structures & Utilities | ||
| - `Types/Types.hpp` - from `cf_cfdp_types.h` | ||
| - `Utils.hpp` / `.cpp` - from `cf_utils.h` / `cf_utils.c` | ||
| - `Channel.hpp` / `.cpp` - from channel functions in `cf_cfdp.c` / `cf_utils.c` | ||
| - `Chunk.hpp` / `.cpp` - from `cf_chunks.h` / `cf_chunks.c` | ||
| - `Clist.hpp` / `.cpp` - from `cf_clist.h` / `cf_clist.c` | ||
|
|
||
| Each of these files includes the full NASA copyright notice and Apache 2.0 license text in its header. | ||
|
|
||
| ## New F-Prime Implementations | ||
|
|
||
| The following files are new implementations for F-Prime and do not contain CF-derived code: | ||
|
|
||
| ### Integration Layer | ||
| - `CfdpManager.hpp` / `.cpp` - F-Prime component wrapper | ||
| - `Timer.hpp` / `.cpp` - F-Prime timer implementation | ||
|
|
||
| ### PDU Object-Oriented Implementation | ||
| All files in the `Types/` directory are new F' serializable implementations based on the CFDP Blue Book specification (CCSDS 727.0-B-5): | ||
| - `Types/PduBase.hpp` - Base class for all PDU types | ||
| - `Types/PduHeader.hpp` / `.cpp` - PDU header encoding/decoding | ||
| - `Types/MetadataPdu.hpp` / `.cpp` - Metadata PDU | ||
| - `Types/FileDataPdu.hpp` / `.cpp` - File Data PDU | ||
| - `Types/EofPdu.hpp` / `.cpp` - End of File PDU | ||
| - `Types/FinPdu.hpp` / `.cpp` - Finished PDU | ||
| - `Types/AckPdu.hpp` / `.cpp` - Acknowledge PDU | ||
| - `Types/NakPdu.hpp` / `.cpp` - Negative Acknowledge PDU | ||
|
|
||
| These files implement CFDP PDU encoding/decoding based on the specification rather than porting CF's C-style codec. | ||
|
|
||
| ## License | ||
|
|
||
| This component as a whole is licensed under the Apache License 2.0. See the top-level [LICENSE.txt](../../../LICENSE.txt) for the full license text. | ||
|
|
||
| The CF-derived portions retain their original NASA copyright and Apache 2.0 license as documented in their file headers. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,43 @@ | ||
| #### | ||
| # F Prime CMakeLists.txt: | ||
| # | ||
| # SOURCES: list of source files (to be compiled) | ||
| # AUTOCODER_INPUTS: list of files to be passed to the autocoders | ||
| # DEPENDS: list of libraries that this module depends on | ||
| # | ||
| # More information in the F´ CMake API documentation: | ||
| # https://fprime.jpl.nasa.gov/latest/docs/reference/api/cmake/API/ | ||
| # | ||
| #### | ||
|
|
||
| register_fprime_library( | ||
| AUTOCODER_INPUTS | ||
| "${CMAKE_CURRENT_LIST_DIR}/CfdpManager.fpp" | ||
| SOURCES | ||
| "${CMAKE_CURRENT_LIST_DIR}/CfdpManager.cpp" | ||
| "${CMAKE_CURRENT_LIST_DIR}/Engine.cpp" | ||
| "${CMAKE_CURRENT_LIST_DIR}/Chunk.cpp" | ||
| "${CMAKE_CURRENT_LIST_DIR}/Clist.cpp" | ||
| "${CMAKE_CURRENT_LIST_DIR}/Utils.cpp" | ||
| "${CMAKE_CURRENT_LIST_DIR}/Timer.cpp" | ||
| "${CMAKE_CURRENT_LIST_DIR}/Channel.cpp" | ||
| "${CMAKE_CURRENT_LIST_DIR}/TransactionTx.cpp" | ||
| "${CMAKE_CURRENT_LIST_DIR}/TransactionRx.cpp" | ||
| DEPENDS | ||
| CFDP_Checksum | ||
| Svc_Ccsds_CfdpManager_Types | ||
| ) | ||
|
|
||
| ### Subdirectories ### | ||
| add_fprime_subdirectory("${CMAKE_CURRENT_LIST_DIR}/Types/") | ||
|
|
||
| ### Unit Tests ### | ||
| register_fprime_ut( | ||
| AUTOCODER_INPUTS | ||
| "${CMAKE_CURRENT_LIST_DIR}/CfdpManager.fpp" | ||
| SOURCES | ||
| "${CMAKE_CURRENT_LIST_DIR}/test/ut/CfdpManagerTestMain.cpp" | ||
| "${CMAKE_CURRENT_LIST_DIR}/test/ut/CfdpManagerTester.cpp" | ||
| "${CMAKE_CURRENT_LIST_DIR}/test/ut/PduTester.cpp" | ||
| UT_AUTO_HELPERS | ||
| ) |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you do a pass to make sure that there's no diff where there doesn't need to be?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Brian-Campuzano Any chance you remember why it was needed to fix the comment offsets? 2668bab
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pretty sure it was just the inconsistency triggering my OCD.