Compare commits

...

389 Commits

Author SHA1 Message Date
muellerr dc79b7ba00 delete metadata after processing
fsfw/fsfw/pipeline/pr-development This commit looks good
2022-09-02 11:38:46 +02:00
muellerr db84dcd3ce afmt
fsfw/fsfw/pipeline/pr-development This commit looks good
2022-09-02 11:12:16 +02:00
muellerr 935f35a40d Merge branch 'mueller/refactor-tmtc-stack' into mueller/cfdp-routers
fsfw/fsfw/pipeline/pr-development This commit looks good
2022-09-01 17:52:17 +02:00
muellerr 348af0124b Merge remote-tracking branch 'origin/development' into mueller/cfdp-routers 2022-09-01 17:52:11 +02:00
muellerr 04bff7a522 test fix
fsfw/fsfw/pipeline/pr-development This commit looks good
2022-09-01 17:51:09 +02:00
muellerr 5c20cc804e Merge remote-tracking branch 'origin/development' into mueller/refactor-tmtc-stack
fsfw/fsfw/pipeline/pr-development There was a failure building this commit
2022-09-01 17:48:40 +02:00
mohr eb8e236cd4 Merge pull request 'Bugfix for Space Packet Parser' (#673) from eive/fsfw:mueller/fixes-tmtc-server-sp-parser into development
fsfw/fsfw/pipeline/head This commit looks good
Reviewed-on: #673
2022-09-01 14:12:16 +02:00
mohr 7dec45ccf2 Merge pull request 'Service 11 regression' (#670) from eive/fsfw:mueller/service-11-issues into development
fsfw/fsfw/pipeline/head This commit looks good
Reviewed-on: #670
2022-09-01 11:59:18 +02:00
mohr 2b01e86f9c one small additional precaution
fsfw/fsfw/pipeline/pr-development This commit looks good
2022-09-01 11:56:07 +02:00
mohr 60fd3d43c0 Merge pull request 'DHB TM handler alternative API raw buffer' (#671) from mueller/dhb-handle-device-tm-2 into development
fsfw/fsfw/pipeline/head This commit looks good
Reviewed-on: #671
2022-09-01 11:22:17 +02:00
muellerr 67980cb592 Merge branch 'development' into mueller/fixes-tmtc-server-sp-parser
fsfw/fsfw/pipeline/pr-development This commit looks good
2022-09-01 11:21:02 +02:00
mohr 3010f2f925 Merge pull request 'DHB set action commander before buildCommandFromCommand' (#672) from eive/fsfw:mueller/dhb-set-action-commander-before-building-cmd into development
fsfw/fsfw/pipeline/head This commit looks good
Reviewed-on: #672
2022-09-01 11:18:32 +02:00
muellerr 01651f0521 more simplfications
fsfw/fsfw/pipeline/pr-development This commit looks good
2022-09-01 10:52:48 +02:00
muellerr c7f300671f update header
fsfw/fsfw/pipeline/pr-development This commit looks good
2022-09-01 10:45:10 +02:00
muellerr 7d3223d766 add comment blocks 2022-09-01 10:44:57 +02:00
muellerr 7ae82a5cb4 do not cache previous recipient
fsfw/fsfw/pipeline/pr-development This commit looks good
2022-09-01 08:58:18 +02:00
muellerr 28ecd0e5c6 bugfix for SP parser
fsfw/fsfw/pipeline/pr-development This commit looks good
2022-09-01 08:51:12 +02:00
muellerr 7345c18b04 small fix which allows sending action reply immediately
fsfw/fsfw/pipeline/pr-development This commit looks good
2022-08-31 16:50:48 +02:00
muellerr 0de7b66218 new retval for permission errors
fsfw/fsfw/pipeline/pr-development There was a failure building this commit
2022-08-31 13:26:44 +02:00
muellerr 158007fa7f const correct API
fsfw/fsfw/pipeline/pr-development This commit looks good
2022-08-31 00:02:25 +02:00
muellerr ab719a3e59 alternative solution
fsfw/fsfw/pipeline/head Build started...
fsfw/fsfw/pipeline/pr-development This commit looks good
2022-08-30 23:38:55 +02:00
muellerr 64a7fde301 this is annoying
fsfw/fsfw/pipeline/pr-development This commit looks good
2022-08-30 15:19:01 +02:00
muellerr 8e6cee7761 Merge branch 'mueller/data-wrapper' into mueller/refactor-tmtc-stack
fsfw/fsfw/pipeline/pr-development There was a failure building this commit
2022-08-30 13:46:03 +02:00
muellerr c756297e5c data wrapper update
fsfw/fsfw/pipeline/pr-development This commit looks good
2022-08-30 13:39:44 +02:00
muellerr 0f27c7e7e7 extend data wrapper
fsfw/fsfw/pipeline/pr-development This commit looks good
2022-08-30 13:24:29 +02:00
muellerr 20d42add03 add new data wrapper helper type
fsfw/fsfw/pipeline/head Build started...
fsfw/fsfw/pipeline/pr-development This commit looks good
2022-08-30 12:07:09 +02:00
muellerr a9277622ce move data wrapper
fsfw/fsfw/pipeline/pr-development This commit looks good
2022-08-30 12:04:15 +02:00
muellerr 80e8511a43 Merge branch 'mueller/cfdp-routers' of https://egit.irs.uni-stuttgart.de/fsfw/fsfw into mueller/cfdp-routers
fsfw/fsfw/pipeline/pr-development This commit looks good
2022-08-30 11:21:12 +02:00
muellerr 4a06f11582 Merge branch 'mueller/refactor-local-pool-api' into mueller/cfdp-routers
fsfw/fsfw/pipeline/pr-development This commit looks good
2022-08-30 11:12:59 +02:00
muellerr 32c53b932d Merge branch 'mueller/refactor-tmtc-stack' into mueller/cfdp-routers 2022-08-30 11:12:53 +02:00
muellerr aea9db75cb better name
fsfw/fsfw/pipeline/pr-development This commit looks good
2022-08-30 11:12:06 +02:00
muellerr 9fedd03ed8 use cfg struct for local pool API
fsfw/fsfw/pipeline/head This commit looks good
fsfw/fsfw/pipeline/pr-development This commit looks good
2022-08-30 11:02:21 +02:00
muellerr 10fc4dd89d Merge branch 'mueller/refactor-tmtc-stack' of https://egit.irs.uni-stuttgart.de/fsfw/fsfw into mueller/refactor-tmtc-stack
fsfw/fsfw/pipeline/pr-development This commit looks good
2022-08-30 10:58:06 +02:00
muellerr 0cc8af5eb0 afmt 2022-08-30 10:57:17 +02:00
muellerr 92d65aa3a5 use old lpm api 2022-08-30 10:57:02 +02:00
muellerr 342a56410c delete commented function 2022-08-30 10:28:55 +02:00
muellerr 2cab73d972 avoid duplicate code
fsfw/fsfw/pipeline/pr-development This commit looks good
2022-08-29 20:09:28 +02:00
muellerr 9a9085b9e6 avoid duplicate code 2022-08-29 20:08:59 +02:00
muellerr cb23911ccd default initialization of CDS short struct
fsfw/fsfw/pipeline/pr-development This commit looks good
2022-08-29 15:30:45 +02:00
muellerr b499dedd76 remove TODO
fsfw/fsfw/pipeline/pr-development This commit looks good
2022-08-29 15:27:53 +02:00
muellerr 1bb487373d Merge branch 'mueller/refactor-tmtc-stack' of https://egit.irs.uni-stuttgart.de/fsfw/fsfw into mueller/refactor-tmtc-stack
fsfw/fsfw/pipeline/pr-development This commit looks good
2022-08-29 15:20:51 +02:00
muellerr 3bffb4f968 fix for static fw obj setter 2022-08-29 15:20:33 +02:00
Steffen Gaisser 6bcb208968 Merge branch 'development' into mueller/refactor-tmtc-stack
fsfw/fsfw/pipeline/pr-development This commit looks good
2022-08-29 15:11:50 +02:00
Steffen Gaisser 6c2b5ab39e Merge pull request 'improvements for auto-formatter script' (#665) from eive/fsfw:mueller/update-afmt-script into development
fsfw/fsfw/pipeline/head This commit looks good
Reviewed-on: #665
2022-08-29 15:06:56 +02:00
Steffen Gaisser a7039bad41 Merge pull request 'PUS Service 11: Additional Safety Check' (#666) from eive/fsfw:mueller/service-11-tweak into development
fsfw/fsfw/pipeline/head This commit looks good
Reviewed-on: #666
2022-08-29 14:59:24 +02:00
mohr 6605ffb6b1 Fixing check in Srv 11 Filer
fsfw/fsfw/pipeline/pr-development This commit looks good
2022-08-29 14:55:50 +02:00
mohr e2e0190cae Revert "additional safety check"
This reverts commit fd278e410b.
2022-08-29 14:51:14 +02:00
muellerr fd278e410b additional safety check
fsfw/fsfw/pipeline/pr-development This commit looks good
2022-08-29 13:18:54 +02:00
muellerr ff4cbea571 improvements for auto-formatter script
fsfw/fsfw/pipeline/pr-development This commit looks good
2022-08-24 17:44:55 +02:00
muellerr 81a7c21cd1 continued router component
fsfw/fsfw/pipeline/pr-development This commit looks good
2022-08-24 17:31:26 +02:00
muellerr 267466be9d pass const references to user handler now
fsfw/fsfw/pipeline/pr-development This commit looks good
2022-08-24 15:43:58 +02:00
muellerr 2c730c8632 use const struct ref instead
fsfw/fsfw/pipeline/pr-development This commit looks good
2022-08-24 12:11:03 +02:00
muellerr eb29b79467 some more docs
fsfw/fsfw/pipeline/pr-development This commit looks good
2022-08-24 08:44:20 +02:00
muellerr 26ea6606bf metadata recvd indication
fsfw/fsfw/pipeline/pr-development This commit looks good
2022-08-23 20:56:09 +02:00
muellerr b1bd631322 implemented metadata handler
fsfw/fsfw/pipeline/pr-development This commit looks good
2022-08-23 20:30:41 +02:00
muellerr 9441b4a70e continue dest handler
fsfw/fsfw/pipeline/pr-development This commit looks good
2022-08-23 19:37:30 +02:00
muellerr 95457b1760 Merge branch 'mueller/refactor-tmtc-stack' into mueller/cfdp-routers
fsfw/fsfw/pipeline/pr-development This commit looks good
2022-08-22 16:38:41 +02:00
muellerr a46d8c34d9 small changelog update
fsfw/fsfw/pipeline/pr-development This commit looks good
2022-08-22 16:37:53 +02:00
muellerr d12c59c8ac all retval replacements
fsfw/fsfw/pipeline/pr-development This commit looks good
2022-08-22 16:35:53 +02:00
muellerr 9e5dddf79c Merge branch 'mueller/refactor-tmtc-stack' into mueller/cfdp-routers
fsfw/fsfw/pipeline/pr-development There was a failure building this commit
2022-08-22 16:24:20 +02:00
muellerr ba5c6410d6 tests running again
fsfw/fsfw/pipeline/pr-development This commit looks good
2022-08-22 16:23:36 +02:00
muellerr 52f8c5038b Merge branch 'mueller/refactor-tmtc-stack' into mueller/cfdp-routers
fsfw/fsfw/pipeline/pr-development There was a failure building this commit
2022-08-22 16:21:41 +02:00
muellerr 10f34e5a48 Merge remote-tracking branch 'origin/development' into mueller/refactor-tmtc-stack-with-retval-refactoring
fsfw/fsfw/pipeline/head There was a failure building this commit
fsfw/fsfw/pipeline/pr-development There was a failure building this commit
2022-08-22 15:57:22 +02:00
muellerr dab1b1d067 apply auto-formatter
fsfw/fsfw/pipeline/pr-development There was a failure building this commit
fsfw/fsfw/pipeline/head There was a failure building this commit
2022-08-22 15:02:53 +02:00
muellerr 8c8d1cfa84 apply auto-formatter
fsfw/fsfw/pipeline/head This commit looks good
2022-08-22 15:02:16 +02:00
muellerr 2a4ab0af7b Merge branch 'mueller/refactor-tmtc-stack' into mueller/refactor-tmtc-stack-with-retval-refactoring
fsfw/fsfw/pipeline/head There was a failure building this commit
fsfw/fsfw/pipeline/pr-development There was a failure building this commit
2022-08-22 14:17:24 +02:00
Steffen Gaisser 7c59df3f1c Merge pull request 'returnvalue namespace' (#659) from mueller/expand-retval-if into development
fsfw/fsfw/pipeline/head This commit looks good
Reviewed-on: #659
2022-08-22 14:14:06 +02:00
muellerr 3b33b429e6 Merge branch 'mueller/refactor-tmtc-stack' into mueller/cfdp-routers
fsfw/fsfw/pipeline/pr-development There was a failure building this commit
2022-08-18 11:21:16 +02:00
muellerr ff6de8e378 important bugfix for verif reporter
fsfw/fsfw/pipeline/pr-development There was a failure building this commit
2022-08-18 11:20:27 +02:00
muellerr 11a699c3ce a list should do the job
fsfw/fsfw/pipeline/pr-development This commit looks good
2022-08-17 18:49:51 +02:00
muellerr 6930656d4e added some more basic tests
fsfw/fsfw/pipeline/pr-development This commit looks good
2022-08-17 17:09:39 +02:00
muellerr 0bb82e0da2 add fs mock feed function
fsfw/fsfw/pipeline/pr-development This commit looks good
2022-08-17 16:47:46 +02:00
muellerr 12c452e7ce finished host FS unittests
fsfw/fsfw/pipeline/pr-development This commit looks good
2022-08-17 16:10:52 +02:00
muellerr 23f514039a host filesystem continued
fsfw/fsfw/pipeline/pr-development This commit looks good
2022-08-17 11:39:15 +02:00
muellerr 2e52d7a31d Merge branch 'mueller/refactor-tmtc-stack' into mueller/cfdp-routers
fsfw/fsfw/pipeline/pr-development This commit looks good
2022-08-16 17:23:52 +02:00
muellerr 239d053562 update changelog
fsfw/fsfw/pipeline/pr-development This commit looks good
2022-08-16 17:23:10 +02:00
muellerr 875174c4ad better name for global object
fsfw/fsfw/pipeline/pr-development This commit looks good
2022-08-16 17:17:45 +02:00
muellerr 8fd8a37f59 flip verif reporter ctor arguments
fsfw/fsfw/pipeline/pr-development This commit looks good
2022-08-16 17:10:48 +02:00
mohr 217276d50c renamed returnvalue header
fsfw/fsfw/pipeline/pr-development This commit looks good
2022-08-16 12:48:22 +02:00
mohr d2ac3603a5 some more occurences
fsfw/fsfw/pipeline/pr-development This commit looks good
2022-08-16 12:29:53 +02:00
mohr f63f3fa564 more occurences in comments
fsfw/fsfw/pipeline/head This commit looks good
fsfw/fsfw/pipeline/pr-development This commit looks good
2022-08-16 12:12:21 +02:00
muellerr fc34d56239 cicd fix
fsfw/fsfw/pipeline/pr-development This commit looks good
2022-08-16 01:12:50 +02:00
muellerr 1037102349 merge retval refactoring
fsfw/fsfw/pipeline/head This commit looks good
2022-08-16 01:08:26 +02:00
muellerr 221361eb9c Merge remote-tracking branch 'origin/development' into mueller/expand-retval-if
fsfw/fsfw/pipeline/pr-development There was a failure building this commit
2022-08-15 20:32:38 +02:00
muellerr 7f9269b387 fix for def cfg
fsfw/fsfw/pipeline/pr-development There was a failure building this commit
2022-08-15 20:30:59 +02:00
muellerr 4224c3d009 bump changelog
fsfw/fsfw/pipeline/pr-development There was a failure building this commit
2022-08-15 20:29:23 +02:00
muellerr 62fe75ee40 perform renaming 2022-08-15 20:28:16 +02:00
muellerr e76e109bdb Merge branch 'mueller/refactor-tmtc-stack' into mueller/cfdp-routers
fsfw/fsfw/pipeline/pr-development This commit looks good
2022-08-15 19:17:15 +02:00
muellerr 9e064fe800 fix unittests
fsfw/fsfw/pipeline/pr-development This commit looks good
2022-08-15 19:16:31 +02:00
muellerr 2339c48756 Merge branch 'mueller/refactor-tmtc-stack' into mueller/cfdp-routers
fsfw/fsfw/pipeline/pr-development There was a failure building this commit
2022-08-15 19:07:22 +02:00
muellerr d7ec04bf4b Merge remote-tracking branch 'origin/development' into mueller/refactor-tmtc-stack
fsfw/fsfw/pipeline/pr-development There was a failure building this commit
2022-08-15 19:05:50 +02:00
mohr adcc375f25 Merge pull request 'New UnsignedByte Field class' (#660) from mueller/new-object-id-class into development
fsfw/fsfw/pipeline/head This commit looks good
Reviewed-on: #660
2022-08-15 15:22:30 +02:00
muellerr 94a718ff19 Merge remote-tracking branch 'origin/development' into mueller/expand-retval-if
fsfw/fsfw/pipeline/pr-development This commit looks good
2022-08-15 15:15:51 +02:00
muellerr 4a10f76784 Merge remote-tracking branch 'origin/development' into mueller/new-object-id-class
fsfw/fsfw/pipeline/pr-development This commit looks good
2022-08-15 15:15:00 +02:00
mohr 57ce5d1f34 Merge pull request 'Expand SerializeIF' (#656) from mueller/expand-serialize-if into development
fsfw/fsfw/pipeline/head This commit looks good
Reviewed-on: #656
2022-08-15 15:13:50 +02:00
mohr 90963b3940 Merge pull request 'group MGM data in local pool vectors' (#664) from eive/fsfw:mueller/group-mgm-data into development
fsfw/fsfw/pipeline/head This commit looks good
Reviewed-on: #664
2022-08-15 15:07:16 +02:00
muellerr 71ed95b09a Merge branch 'development' into mueller/group-mgm-data
fsfw/fsfw/pipeline/pr-development This commit looks good
2022-08-15 15:03:35 +02:00
muellerr 7ac4f1c64d Merge branch 'development' into mueller/new-object-id-class
fsfw/fsfw/pipeline/pr-development This commit looks good
2022-08-15 15:03:11 +02:00
muellerr 9d64b96e9a update changelog
fsfw/fsfw/pipeline/pr-development This commit looks good
2022-08-15 15:02:39 +02:00
muellerr 5de2c6af66 Merge branch 'mueller/new-object-id-class' of https://egit.irs.uni-stuttgart.de/fsfw/fsfw into mueller/new-object-id-class
fsfw/fsfw/pipeline/pr-development This commit looks good
2022-08-15 15:02:12 +02:00
muellerr ca2efb6021 remove object ID 2022-08-15 15:02:05 +02:00
muellerr 3b000d924a Merge branch 'development' into mueller/expand-retval-if
fsfw/fsfw/pipeline/pr-development This commit looks good
2022-08-15 14:36:04 +02:00
muellerr deeeef553b remove implicit machine endianness variants
fsfw/fsfw/pipeline/pr-development This commit looks good
2022-08-15 14:34:04 +02:00
mohr 0e7ec79af9 Merge pull request 'Add Linux HAL options' (#663) from eive/fsfw:mueller/cmake-linux-hal-options into development
fsfw/fsfw/pipeline/head This commit looks good
Reviewed-on: #663
2022-08-15 13:58:09 +02:00
muellerr d3cabd8984 afmt
fsfw/fsfw/pipeline/pr-development This commit looks good
2022-08-15 11:26:29 +02:00
muellerr 8efe85cb15 Merge branch 'development' into mueller/new-object-id-class
fsfw/fsfw/pipeline/pr-development This commit looks good
2022-08-15 11:25:51 +02:00
muellerr b28c26b288 group MGM data in local pool vectors
fsfw/fsfw/pipeline/pr-development This commit looks good
2022-08-15 10:49:00 +02:00
muellerr 8b4253bc46 update cmakelists.txt
fsfw/fsfw/pipeline/pr-development This commit looks good
2022-08-12 13:02:30 +02:00
muellerr c12492df03 continued host FS test
fsfw/fsfw/pipeline/pr-development There was a failure building this commit
2022-08-11 10:19:25 +02:00
muellerr 8aaabc5d73 basic host FS unittests
fsfw/fsfw/pipeline/pr-development This commit looks good
2022-08-11 10:10:05 +02:00
muellerr e796e025b6 continue host fs unittests
fsfw/fsfw/pipeline/pr-development This commit looks good
2022-08-11 09:59:14 +02:00
muellerr 20eee2c469 finished host FS impl
fsfw/fsfw/pipeline/pr-development This commit looks good
2022-08-11 09:32:18 +02:00
muellerr aca8b53a59 start host FS impl
fsfw/fsfw/pipeline/pr-development This commit looks good
2022-08-10 17:03:23 +02:00
muellerr 3df1161560 this should do the job
fsfw/fsfw/pipeline/pr-development This commit looks good
2022-08-10 15:03:53 +02:00
muellerr ea6e5d9971 Merge branch 'mueller/cfdp-routers' of https://egit.irs.uni-stuttgart.de/fsfw/fsfw into mueller/cfdp-routers
fsfw/fsfw/pipeline/pr-development This commit looks good
2022-08-10 13:36:51 +02:00
muellerr 46a4203d00 testLvs fix 2022-08-10 13:36:41 +02:00
muellerr c86adf8e10 Merge branch 'development' into mueller/cfdp-routers
fsfw/fsfw/pipeline/pr-development There was a failure building this commit
2022-08-10 13:10:09 +02:00
muellerr a2e0646ed4 fix duplicate naming error
fsfw/fsfw/pipeline/pr-development There was a failure building this commit
2022-08-10 13:05:07 +02:00
muellerr 28c8248f26 add FS mock and improve HasFilesystemIF
fsfw/fsfw/pipeline/pr-development There was a failure building this commit
2022-08-10 11:09:07 +02:00
muellerr 3e1fd15613 completed all indication parameters
fsfw/fsfw/pipeline/pr-development There was a failure building this commit
2022-08-10 10:34:02 +02:00
muellerr e45a99143c added const char* test
fsfw/fsfw/pipeline/pr-development There was a failure building this commit
2022-08-10 09:45:24 +02:00
muellerr 96dfe46e25 added string LV tests
fsfw/fsfw/pipeline/pr-development There was a failure building this commit
2022-08-10 09:39:57 +02:00
muellerr 507c6ddff1 added some param structs
fsfw/fsfw/pipeline/pr-development There was a failure building this commit
2022-08-09 21:03:56 +02:00
muellerr 0cb15e901e new cfdp mock folder, added additional cfdp mocks
fsfw/fsfw/pipeline/pr-development This commit looks good
2022-08-09 19:00:47 +02:00
muellerr d45108e3c2 add remote config table provider class
fsfw/fsfw/pipeline/pr-development This commit looks good
2022-08-09 18:51:44 +02:00
muellerr 8c059f8f32 new filesystem module
fsfw/fsfw/pipeline/pr-development This commit looks good
2022-08-09 16:36:35 +02:00
muellerr 5bea92d2a4 some doc updates
fsfw/fsfw/pipeline/pr-development This commit looks good
2022-08-09 16:26:37 +02:00
muellerr bba2d883b6 added some documentation
fsfw/fsfw/pipeline/pr-development There was a failure building this commit
2022-08-09 16:18:45 +02:00
muellerr 7a20412305 add user base documentation
fsfw/fsfw/pipeline/pr-development There was a failure building this commit
2022-08-09 15:51:01 +02:00
muellerr dce1ebcf65 add CFDP user base
fsfw/fsfw/pipeline/pr-development There was a failure building this commit
2022-08-09 15:46:42 +02:00
muellerr 4ee01e395b finished fault handler unit tests
fsfw/fsfw/pipeline/pr-development This commit looks good
2022-08-09 15:29:22 +02:00
muellerr 7f9401cf63 some bugfixes
fsfw/fsfw/pipeline/pr-development This commit looks good
2022-08-09 15:09:43 +02:00
muellerr dba3f9960e add CFDP fault handler mock
fsfw/fsfw/pipeline/pr-development This commit looks good
2022-08-09 14:55:08 +02:00
muellerr eccb629ba8 fnished fault handler base
fsfw/fsfw/pipeline/pr-development This commit looks good
2022-08-09 14:39:03 +02:00
muellerr 7fb906a0ac add first fault handler base class
fsfw/fsfw/pipeline/pr-development There was a failure building this commit
2022-08-09 14:05:43 +02:00
muellerr 9796abfc7d Merge branch 'development' into mueller/refactor-tmtc-stack
fsfw/fsfw/pipeline/pr-development There was a failure building this commit
2022-08-09 13:06:08 +02:00
muellerr 0d26a0f54b fnish CFDP distributor unittests
fsfw/fsfw/pipeline/pr-development This commit looks good
2022-08-09 13:04:23 +02:00
muellerr 192956c2c7 use new storage manager mock
fsfw/fsfw/pipeline/pr-development This commit looks good
2022-08-09 12:50:50 +02:00
muellerr 22e1555f50 basic storage manager mock
fsfw/fsfw/pipeline/pr-development This commit looks good
2022-08-09 12:45:05 +02:00
muellerr bddf5bded1 move some storage manager impl to IF
fsfw/fsfw/pipeline/pr-development This commit looks good
- Add StorageManagerMock
2022-08-09 12:36:29 +02:00
muellerr 1c0b778848 continue CFDP distrib unittests
fsfw/fsfw/pipeline/pr-development This commit looks good
2022-08-09 12:13:10 +02:00
muellerr c832bffdb0 clean up header test
fsfw/fsfw/pipeline/pr-development This commit looks good
2022-08-09 11:17:57 +02:00
muellerr 2f8020baac move parsing steps into parse function
fsfw/fsfw/pipeline/pr-development This commit looks good
2022-08-09 11:03:22 +02:00
muellerr 06bea2f621 test inNull and bool operator
fsfw/fsfw/pipeline/pr-development This commit looks good
2022-08-09 10:59:24 +02:00
muellerr 4f1fe39182 fix unittests
fsfw/fsfw/pipeline/pr-development This commit looks good
2022-08-08 18:36:10 +02:00
muellerr 904abfba28 clean up CFDP stack a bit
fsfw/fsfw/pipeline/pr-development There was a failure building this commit
2022-08-08 18:29:32 +02:00
muellerr 202d9341d8 add CFDP unit tests
fsfw/fsfw/pipeline/pr-development There was a failure building this commit
2022-08-08 17:53:42 +02:00
muellerr 37c60d1dd0 add source and dest test stubs
fsfw/fsfw/pipeline/pr-development This commit looks good
2022-08-08 12:41:05 +02:00
muellerr 43fb6ef5cb some tag replacements
fsfw/fsfw/pipeline/pr-development This commit looks good
2022-08-08 12:35:58 +02:00
muellerr 65a47c7c57 add distributor test stub
fsfw/fsfw/pipeline/pr-development This commit looks good
2022-08-08 12:34:54 +02:00
muellerr fdb0cc0e44 tweaks for CFDP distributor
fsfw/fsfw/pipeline/pr-development This commit looks good
2022-08-08 12:31:19 +02:00
muellerr e6957de166 Merge branch 'development' into mueller/expand-retval-if
fsfw/fsfw/pipeline/pr-development This commit looks good
2022-08-05 14:02:50 +02:00
muellerr cc56b00df3 Merge branch 'development' into mueller/expand-serialize-if
fsfw/fsfw/pipeline/pr-development This commit looks good
2022-08-05 14:02:31 +02:00
muellerr 269a3052ca added stubs for source and dest handler
fsfw/fsfw/pipeline/pr-development This commit looks good
2022-08-03 18:18:01 +02:00
muellerr c6a7a0fec8 use distributor instead of router
fsfw/fsfw/pipeline/pr-development This commit looks good
2022-08-03 18:14:49 +02:00
muellerr acf5c2a56d better names
fsfw/fsfw/pipeline/pr-development This commit looks good
2022-08-03 16:00:48 +02:00
muellerr 7fb9e14555 better names for CFDP components
fsfw/fsfw/pipeline/pr-development This commit looks good
2022-08-03 15:22:39 +02:00
muellerr b20e8a9679 continue new cfdp router
fsfw/fsfw/pipeline/pr-development This commit looks good
2022-08-03 15:12:29 +02:00
muellerr 29bcaee196 some tests for new var len field
fsfw/fsfw/pipeline/pr-development This commit looks good
2022-08-03 13:34:49 +02:00
muellerr cc98512caf use tags properly
fsfw/fsfw/pipeline/pr-development This commit looks good
2022-08-03 13:23:49 +02:00
muellerr 60ea9a9a7c clean up a few tests
fsfw/fsfw/pipeline/pr-development This commit looks good
2022-08-03 13:15:49 +02:00
muellerr df690b9628 some re-ordering
fsfw/fsfw/pipeline/pr-development This commit looks good
2022-08-03 11:36:56 +02:00
muellerr b0c479cab9 remove some shadowing warnings
fsfw/fsfw/pipeline/pr-development This commit looks good
2022-08-03 11:34:30 +02:00
muellerr a426aef7c7 add some more tests for CCSDS distributor
fsfw/fsfw/pipeline/pr-development This commit looks good
2022-08-03 11:33:10 +02:00
muellerr 43048c852a Merge pull request 'Fixed cmake variable for tests in README.md' (#661) from gaisser/fsfw:gaisser_readme_fix into development
fsfw/fsfw/pipeline/head This commit looks good
Reviewed-on: #661
2022-08-01 20:55:26 +02:00
muellerr 19817bd3a5 Update 'docs/getting_started.rst'
fsfw/fsfw/pipeline/pr-development This commit looks good
Actually, this version still uses old folder names
2022-08-01 20:47:53 +02:00
muellerr 1db04cf20c Update 'docs/getting_started.rst'
Update for new recommended build folder and cmake define name
2022-08-01 20:45:39 +02:00
muellerr 902a4bfa9c unittests for TC and CCSDS distributor
fsfw/fsfw/pipeline/head This commit looks good
fsfw/fsfw/pipeline/pr-development This commit looks good
2022-08-01 17:16:37 +02:00
Steffen Gaisser 52ee50ba8c Fixed cmake variable for tests in README.md
fsfw/fsfw/pipeline/pr-development This commit looks good
2022-08-01 16:21:07 +02:00
muellerr bf540ebb49 use sanitized include file 2022-08-01 14:23:52 +02:00
muellerr aa978205d8 Merge branch 'mueller/cfdp-routers' of https://egit.irs.uni-stuttgart.de/fsfw/fsfw into mueller/cfdp-routers
fsfw/fsfw/pipeline/head There was a failure building this commit
2022-08-01 13:05:56 +02:00
muellerr 4334106ad1 applied auto-formatter
fsfw/fsfw/pipeline/head There was a failure building this commit
2022-08-01 11:05:46 +02:00
muellerr 458fe460eb TMTC Routing Refactoring
fsfw/fsfw/pipeline/head There was a failure building this commit
1. Make TcDistributor less powerful / more flexible and rename it to TcDistributorBase
2. Require AcceptsTelecommandsIF to have an abstract function returning the name
3. Allows the CCSDS distributor to remove the CCSDS header before rerouting. This is useful
for protocols like CFDP which are CCSDS agnostic.

WIP: Still need to implement the removal of the CCSDS header
2022-08-01 11:00:36 +02:00
muellerr 83d71548ec CCSDS unpacker implementation 2022-07-29 16:32:50 +02:00
muellerr f4beef8c9f run auto-formatter
fsfw/fsfw/pipeline/head This commit looks good
2022-07-29 15:54:17 +02:00
muellerr c7b4dc349a using uint32_t for getIdentifier of AcceptsTcIF 2022-07-29 15:53:39 +02:00
muellerr 96f092ef75 type correction
fsfw/fsfw/pipeline/pr-development This commit looks good
2022-07-29 14:30:58 +02:00
muellerr f75379fceb Merge branch 'mueller/new-object-id-class' into mueller/cfdp-routers
fsfw/fsfw/pipeline/head This commit looks good
2022-07-29 14:27:59 +02:00
muellerr 4a4d23573d verify correct key behaviour
fsfw/fsfw/pipeline/pr-development This commit looks good
2022-07-29 14:24:16 +02:00
muellerr cd4d92b12c Merge branch 'mueller/new-object-id-class' into mueller/cfdp-routers
fsfw/fsfw/pipeline/head This commit looks good
2022-07-29 14:22:52 +02:00
muellerr 47e148af8f decoupling
fsfw/fsfw/pipeline/head Build started...
fsfw/fsfw/pipeline/pr-development This commit looks good
2022-07-29 14:19:10 +02:00
muellerr c9bec03f00 Merge branch 'mueller/expand-serialize-if' into mueller/new-object-id-type
fsfw/fsfw/pipeline/head There was a failure building this commit
2022-07-29 14:16:22 +02:00
muellerr 6c5c59cad8 Merge branch 'mueller/expand-serialize-if' into mueller/new-object-id-type 2022-07-29 14:15:14 +02:00
muellerr 03e12a2388 new object ID type 2022-07-29 14:15:05 +02:00
muellerr 6c5bbfa080 some renaming
fsfw/fsfw/pipeline/head This commit looks good
2022-07-29 12:03:14 +02:00
muellerr da106fd96f do not use TC info for failed TC retrieval
fsfw/fsfw/pipeline/head This commit looks good
fsfw/fsfw/pipeline/pr-development This commit looks good
2022-07-29 10:23:59 +02:00
muellerr fc3412fa35 set sec header flag and add unit test for it
fsfw/fsfw/pipeline/pr-development This commit looks good
2022-07-28 15:13:27 +02:00
muellerr 8f6f0e1d45 some more fail tests
fsfw/fsfw/pipeline/pr-development This commit looks good
2022-07-28 13:42:34 +02:00
muellerr 1b5fa2a8fa test no crc generation
fsfw/fsfw/pipeline/pr-development This commit looks good
2022-07-28 13:37:07 +02:00
muellerr cb118176a0 completed ZcWriter unittests
fsfw/fsfw/pipeline/pr-development There was a failure building this commit
2022-07-28 13:24:50 +02:00
muellerr 30ba9ab916 some more fixes
fsfw/fsfw/pipeline/pr-development This commit looks good
2022-07-28 13:00:53 +02:00
muellerr fb4ba487b5 Merge remote-tracking branch 'origin/mueller/expand-retval-if' into mueller/refactor-tmtc-stack 2022-07-28 12:55:42 +02:00
muellerr 72bc5d4d60 add tm zc test 2022-07-28 12:52:20 +02:00
muellerr 5355e63711 use result instead of retval
fsfw/fsfw/pipeline/pr-development This commit looks good
2022-07-27 21:43:32 +02:00
muellerr b11cdf6184 update unittests
fsfw/fsfw/pipeline/pr-development This commit looks good
2022-07-27 21:32:22 +02:00
muellerr dc31358d52 adaption for SerializeIF
- Returns serialized and deserialized size now
2022-07-27 21:31:09 +02:00
muellerr b485afea57 Simple SerializeIF adaptions
fsfw/fsfw/pipeline/pr-development This commit looks good
- Returns serialized or deserialized size
2022-07-27 21:29:05 +02:00
muellerr 5bb7023ff3 improvements for creator API
fsfw/fsfw/pipeline/pr-development This commit looks good
2022-07-27 21:11:12 +02:00
muellerr 85dbef20b0 update serialize IF
fsfw/fsfw/pipeline/pr-development This commit looks good
2022-07-27 21:07:34 +02:00
muellerr 93acac02f5 tests running again
fsfw/fsfw/pipeline/pr-development This commit looks good
2022-07-27 21:06:23 +02:00
muellerr 7e8afcc12f remove nullptr check
fsfw/fsfw/pipeline/pr-development There was a failure building this commit
2022-07-27 20:37:21 +02:00
muellerr f03b7cd660 another bugfix in CSB
fsfw/fsfw/pipeline/pr-development There was a failure building this commit
2022-07-27 20:10:15 +02:00
muellerr d641d63531 set queue of tm send helper
fsfw/fsfw/pipeline/pr-development There was a failure building this commit
2022-07-27 19:56:11 +02:00
muellerr 4e571e5082 some more minor fixes
fsfw/fsfw/pipeline/pr-development There was a failure building this commit
2022-07-27 19:40:54 +02:00
muellerr 356d778743 afmt
fsfw/fsfw/pipeline/pr-development There was a failure building this commit
2022-07-27 18:03:17 +02:00
muellerr 0a38d2e22d small bugfix
fsfw/fsfw/pipeline/pr-development There was a failure building this commit
2022-07-27 17:56:16 +02:00
muellerr 234ccdf764 send time stampers properly now
fsfw/fsfw/pipeline/pr-development There was a failure building this commit
2022-07-27 17:48:59 +02:00
muellerr f591b9793c pass timeReader to Pus ZC writer
fsfw/fsfw/pipeline/pr-development There was a failure building this commit
2022-07-27 17:33:39 +02:00
muellerr c5ad9b5fa9 switch off debugging switches
fsfw/fsfw/pipeline/pr-development There was a failure building this commit
2022-07-27 17:13:42 +02:00
muellerr 083d08ae2a various bugs and improvements 2022-07-27 17:00:43 +02:00
muellerr 740644f2c8 updates for PusDistributor
fsfw/fsfw/pipeline/pr-development There was a failure building this commit
2022-07-27 14:40:51 +02:00
muellerr 059fb10558 add helper methods to disable crc calculation
fsfw/fsfw/pipeline/pr-development There was a failure building this commit
2022-07-27 11:41:06 +02:00
muellerr 86692e202d this gets rid of some warnings
fsfw/fsfw/pipeline/pr-development There was a failure building this commit
2022-07-27 11:35:35 +02:00
muellerr 064b195c75 some of the deprecation warnings run amok
fsfw/fsfw/pipeline/pr-development There was a failure building this commit
2022-07-27 11:33:19 +02:00
muellerr 18ee2ab903 example compiles again
fsfw/fsfw/pipeline/pr-development There was a failure building this commit
2022-07-27 11:26:47 +02:00
muellerr 9eb652e585 some printout fixes
fsfw/fsfw/pipeline/pr-development This commit looks good
2022-07-27 10:49:49 +02:00
muellerr e7d9979078 Merge branch 'development' into mueller/expand-serialize-if
fsfw/fsfw/pipeline/pr-development This commit looks good
2022-07-26 19:09:06 +02:00
muellerr 681738dcc6 PSB unittests complete
fsfw/fsfw/pipeline/pr-development This commit looks good
2022-07-26 19:08:12 +02:00
muellerr 152c01b2ec psb unittests almost complete
fsfw/fsfw/pipeline/pr-development This commit looks good
2022-07-26 18:58:36 +02:00
muellerr 8bf0fb9885 test auto-initializers
fsfw/fsfw/pipeline/pr-development This commit looks good
2022-07-26 18:46:28 +02:00
muellerr 1954ce0ea4 default PUS receiver set automatically now
fsfw/fsfw/pipeline/pr-development This commit looks good
2022-07-26 17:41:10 +02:00
muellerr d98b79cf5e adapt PSB so it can be unittested properly
fsfw/fsfw/pipeline/pr-development There was a failure building this commit
2022-07-26 16:49:46 +02:00
muellerr f14c812aff removed some obsolete code
fsfw/fsfw/pipeline/pr-development This commit looks good
2022-07-26 14:14:00 +02:00
muellerr 146a0e3828 created PSB mock
fsfw/fsfw/pipeline/pr-development This commit looks good
2022-07-26 14:10:24 +02:00
muellerr 75c824ec80 add new VerificationReporterIF
fsfw/fsfw/pipeline/pr-development This commit looks good
2022-07-26 13:59:09 +02:00
muellerr 332e9dbfd5 add new tests 2022-07-26 11:19:36 +02:00
muellerr f1c37203a4 some more API improvements and replacements
fsfw/fsfw/pipeline/pr-development This commit looks good
2022-07-26 11:14:40 +02:00
muellerr 500a5602bd added additional TM store and send helper
fsfw/fsfw/pipeline/pr-development This commit looks good
2022-07-26 11:09:57 +02:00
muellerr 4ed028000d Merge branch 'mueller/expand-retval-if' into mueller/refactor-tmtc-stack
fsfw/fsfw/pipeline/pr-development There was a failure building this commit
2022-07-26 10:29:51 +02:00
muellerr 88ebb67c8d fix deprecation warnings
fsfw/fsfw/pipeline/head Build started...
fsfw/fsfw/pipeline/pr-development This commit looks good
2022-07-26 10:27:44 +02:00
muellerr b827bd8370 update HasReturnvaluesIF
fsfw/fsfw/pipeline/head There was a failure building this commit
1. Add new retval namespace which contains OK and FAIL returnvalue
2. Also contains makeCode constexpr function
3. Mark HasReturnvaluesIF::makeReturnCode deprecated

This prevents from having to implement an interface just to use a shorter
version of the general returnvalues. A namespace is better suited for this
I think
2022-07-26 10:22:05 +02:00
muellerr bdf71d4e66 add new HasReturnvaluesIF features
fsfw/fsfw/pipeline/pr-development There was a failure building this commit
2022-07-26 10:21:16 +02:00
muellerr e48b6f1432 possible double delete
fsfw/fsfw/pipeline/pr-development This commit looks good
2022-07-25 22:36:53 +02:00
muellerr 747243684d more leaks
fsfw/fsfw/pipeline/pr-development There was a failure building this commit
2022-07-25 22:29:18 +02:00
muellerr db33f9cc7e maybe this teardown fixes the leak
fsfw/fsfw/pipeline/pr-development There was a failure building this commit
2022-07-25 22:22:08 +02:00
muellerr c12669fe50 this should fix the mmeory leak
fsfw/fsfw/pipeline/pr-development There was a failure building this commit
2022-07-25 22:10:20 +02:00
muellerr 6d00fc65c0 fix memory leak
fsfw/fsfw/pipeline/pr-development There was a failure building this commit
2022-07-25 21:08:04 +02:00
muellerr 7d87274844 add old api but mark it deprecated
fsfw/fsfw/pipeline/pr-development There was a failure building this commit
2022-07-25 20:53:18 +02:00
muellerr c83f75c515 some more tests using TM send helper
fsfw/fsfw/pipeline/pr-development There was a failure building this commit
2022-07-25 20:41:01 +02:00
muellerr 586993c081 completed send helper tests
fsfw/fsfw/pipeline/pr-development There was a failure building this commit
2022-07-25 20:31:06 +02:00
muellerr a88f767cca all tests running again
fsfw/fsfw/pipeline/pr-development There was a failure building this commit
2022-07-25 19:49:19 +02:00
muellerr 935e135f1c normal queue sufficient
fsfw/fsfw/pipeline/pr-development There was a failure building this commit
2022-07-25 19:42:05 +02:00
muellerr 6d0fa36f8a cleaning up message queue mock and subscription API
fsfw/fsfw/pipeline/pr-development There was a failure building this commit
2022-07-25 19:36:56 +02:00
muellerr 8f07133e2c Merge branch 'development' into mueller/expand-serialize-if
fsfw/fsfw/pipeline/pr-development This commit looks good
2022-07-25 15:08:04 +02:00
Steffen Gaisser f11433e50f Merge pull request 'Release v5.0.0' (#657) from development into master
fsfw/fsfw/pipeline/pr-development This commit looks good
fsfw/fsfw/pipeline/head This commit looks good
Reviewed-on: #657
2022-07-25 15:05:56 +02:00
muellerr 5fd5d488ff Merge remote-tracking branch 'origin/development' into mueller/refactor-tmtc-stack
fsfw/fsfw/pipeline/pr-development There was a failure building this commit
2022-07-25 14:57:28 +02:00
Steffen Gaisser edc5a314b8 Merge pull request 'v5.0.0' (#654) from v5.0.0 into development
fsfw/fsfw/pipeline/pr-master This commit looks good
fsfw/fsfw/pipeline/head This commit looks good
Reviewed-on: #654
2022-07-25 14:53:35 +02:00
muellerr f80be9e9fa run afmt
fsfw/fsfw/pipeline/pr-development This commit looks good
2022-07-25 14:44:49 +02:00
muellerr f3af88ae40 add [[nodiscard]] and const specifiers
fsfw/fsfw/pipeline/pr-development This commit looks good
2022-07-25 14:44:19 +02:00
muellerr 380f1d0206 remove obsolete returns
fsfw/fsfw/pipeline/pr-development This commit looks good
2022-07-25 14:40:10 +02:00
muellerr 54fc35eae7 re-run afmt
fsfw/fsfw/pipeline/pr-development This commit looks good
2022-07-25 14:36:18 +02:00
muellerr 05d4162f5b Merge branch 'development' into v5.0.0
fsfw/fsfw/pipeline/pr-development This commit looks good
2022-07-25 14:35:36 +02:00
muellerr e030878023 changelog
fsfw/fsfw/pipeline/pr-development This commit looks good
2022-07-25 14:33:10 +02:00
muellerr 9ee6da47e9 improving mocks 2022-07-25 14:31:57 +02:00
muellerr 1a7d7b172b set up new internal error reporter mock
fsfw/fsfw/pipeline/pr-development There was a failure building this commit
2022-07-25 14:04:06 +02:00
muellerr 36e3956efb finished tm store helper tests
fsfw/fsfw/pipeline/pr-development This commit looks good
2022-07-25 13:39:07 +02:00
muellerr 180210dc38 Merge branch 'development' into mueller/expand-serialize-if
fsfw/fsfw/pipeline/pr-development This commit looks good
2022-07-25 11:39:19 +02:00
muellerr ca1e921b94 Merge branch 'mueller/expand-serialize-if' into mueller/refactor-tmtc-stack
fsfw/fsfw/pipeline/pr-development This commit looks good
2022-07-25 11:35:32 +02:00
muellerr 2a34c831b1 use Be instead of Ne, which could be confused
fsfw/fsfw/pipeline/head This commit looks good
fsfw/fsfw/pipeline/pr-development This commit looks good
2022-07-25 11:33:12 +02:00
muellerr e2ad37e3e6 more ref replacements
fsfw/fsfw/pipeline/pr-development This commit looks good
2022-07-25 11:26:45 +02:00
muellerr 973d4ee8a5 some more ref replacements
fsfw/fsfw/pipeline/pr-development This commit looks good
2022-07-25 11:24:13 +02:00
muellerr 899d021e00 using uint32_t as store_address requires explicit cast
fsfw/fsfw/pipeline/pr-development This commit looks good
2022-07-25 11:15:45 +02:00
muellerr 4989bd0f02 fixes for Linux OSAL clock
fsfw/fsfw/pipeline/pr-development This commit looks good
2022-07-25 10:56:19 +02:00
muellerr 832367fb30 replace some API components with references
fsfw/fsfw/pipeline/pr-development This commit looks good
2022-07-25 10:50:52 +02:00
muellerr 63ee88af17 added base for tm store test
fsfw/fsfw/pipeline/pr-development This commit looks good
2022-07-25 10:38:44 +02:00
muellerr 4921527022 replace c include
fsfw/fsfw/pipeline/pr-development This commit looks good
2022-07-25 10:31:49 +02:00
muellerr f0c8fd2688 some renaming
fsfw/fsfw/pipeline/pr-development This commit looks good
2022-07-25 10:24:43 +02:00
muellerr c96e304b68 Merge pull request 'Possible Ring Buffer Fix' (#586) from eive/fsfw:mueller/possible-ring-buffer-fix into development
fsfw/fsfw/pipeline/head This commit looks good
Merged to avoid crashing bug until full functionality is fixed.

Reviewed-on: #586
2022-07-25 10:12:39 +02:00
muellerr d474c4a7ee store helper 2022-07-23 11:43:48 +02:00
muellerr 3708df2423 small fix 2022-07-23 11:15:55 +02:00
muellerr f629d60aaf Merge branch 'mueller/expand-serialize-if' into mueller/refactor-tmtc-stack 2022-07-23 11:15:20 +02:00
muellerr b809f90e72 added unittests for new helpers 2022-07-23 11:10:44 +02:00
muellerr f2bf4b463e expand serializeIF tests 2022-07-23 10:34:19 +02:00
muellerr b66fd63cb4 remove doubly defines 2022-07-23 10:29:19 +02:00
muellerr fd55de9e95 Merge branch 'mueller/expand-serialize-if' into mueller/refactor-tmtc-stack 2022-07-23 10:28:13 +02:00
muellerr 8e05fc0417 added a few more methods 2022-07-23 10:28:01 +02:00
muellerr 55a238d553 extended serialize if further 2022-07-23 10:24:56 +02:00
muellerr 9ccd9fd775 Merge branch 'mueller/expand-serialize-if' into mueller/refactor-tmtc-stack 2022-07-23 10:07:10 +02:00
muellerr ddad97033d expand serialize IF further 2022-07-23 10:06:42 +02:00
muellerr 99aaf7068d some tests 2022-07-23 10:05:57 +02:00
muellerr c9d37e8d62 Merge branch 'mueller/expand-serialize-if' into mueller/refactor-tmtc-stack 2022-07-23 10:05:14 +02:00
muellerr 42a1d6cccd default implementation of simple serialize/deserialize 2022-07-23 10:03:42 +02:00
muellerr 133894f4ba add basic CCSDS tests
fsfw/fsfw/pipeline/pr-development This commit looks good
2022-07-22 18:46:58 +02:00
muellerr cb05329dd9 completed baseline PUS TM unittests
fsfw/fsfw/pipeline/pr-development This commit looks good
2022-07-22 18:31:00 +02:00
muellerr b350018cad completed basic test set
fsfw/fsfw/pipeline/pr-development This commit looks good
2022-07-22 18:22:35 +02:00
muellerr 2dfbce6174 start TM reader unittests
fsfw/fsfw/pipeline/pr-development This commit looks good
2022-07-22 17:11:55 +02:00
muellerr cecaec6007 PUS TM creator tests done
fsfw/fsfw/pipeline/pr-development This commit looks good
2022-07-22 17:09:44 +02:00
muellerr f28b9ea61b APID getter bugfix
fsfw/fsfw/pipeline/pr-development This commit looks good
2022-07-22 16:41:32 +02:00
muellerr 9275ccb79b added some missing implementations
fsfw/fsfw/pipeline/pr-development This commit looks good
2022-07-22 16:09:18 +02:00
muellerr 67776241de verify successfull TM serialization
fsfw/fsfw/pipeline/pr-development This commit looks good
2022-07-22 16:06:31 +02:00
muellerr bfee4fd90a add empty test files
fsfw/fsfw/pipeline/pr-development This commit looks good
2022-07-21 19:16:44 +02:00
muellerr 0dfaba81f9 finished basic TC unittests
fsfw/fsfw/pipeline/pr-development This commit looks good
2022-07-21 19:10:15 +02:00
muellerr affde6bad5 rename namespace
fsfw/fsfw/pipeline/pr-development This commit looks good
2022-07-21 18:21:10 +02:00
muellerr 0981ee6f7e minor changes, virtual dtors added
fsfw/fsfw/pipeline/pr-development There was a failure building this commit
2022-07-21 18:17:37 +02:00
muellerr 61bc867bed delete code which is not used anymore
fsfw/fsfw/pipeline/pr-development There was a failure building this commit
2022-07-21 17:57:31 +02:00
muellerr 5af3138e81 fnished PUS TC creator unittests
fsfw/fsfw/pipeline/pr-development There was a failure building this commit
2022-07-21 17:48:11 +02:00
muellerr 08e0b0f1a0 added sp reader unittests
fsfw/fsfw/pipeline/pr-development There was a failure building this commit
2022-07-21 14:40:00 +02:00
muellerr 23f264096c delete a few old classes
fsfw/fsfw/pipeline/pr-development There was a failure building this commit
2022-07-21 14:05:31 +02:00
muellerr e5ee96259d some fixes
fsfw/fsfw/pipeline/head There was a failure building this commit
fsfw/fsfw/pipeline/pr-development There was a failure building this commit
2022-07-21 13:48:58 +02:00
muellerr 9bbe1dc716 Merge branch 'development' into mueller/possible-ring-buffer-fix
fsfw/fsfw/pipeline/pr-development This commit looks good
2022-07-21 13:23:44 +02:00
muellerr d8b6cb39ac various bugfixes and improvements
fsfw/fsfw/pipeline/head There was a failure building this commit
2022-07-21 11:34:11 +02:00
muellerr be35bd53a6 switched to new tmtc stack API
fsfw/fsfw/pipeline/head There was a failure building this commit
2022-07-20 22:21:15 +02:00
muellerr 9860061fc6 create new TmSendHelper
fsfw/fsfw/pipeline/head There was a failure building this commit
2022-07-20 11:45:50 +02:00
muellerr d80941514f start refactoring PUS TM handling
fsfw/fsfw/pipeline/head There was a failure building this commit
2022-07-20 11:43:16 +02:00
muellerr 6c636661b6 a lot of refactoring
fsfw/fsfw/pipeline/head There was a failure building this commit
2022-07-19 18:13:25 +02:00
muellerr 5fffbd4a90 start PUS TC refactoring
fsfw/fsfw/pipeline/head There was a failure building this commit
2022-07-18 18:36:41 +02:00
muellerr 95b476d4bd start ccsds reader unittests 2022-07-18 16:21:00 +02:00
muellerr 3d2af203f2 finished creator unittests
fsfw/fsfw/pipeline/head This commit looks good
2022-07-18 16:18:04 +02:00
muellerr 74794bb71b apply auto-formatter
fsfw/fsfw/pipeline/pr-development This commit looks good
2022-07-18 16:08:06 +02:00
muellerr ddf38b65c3 apply auto-formatter
fsfw/fsfw/pipeline/head This commit looks good
2022-07-18 16:07:26 +02:00
muellerr 490a80e49f Merge remote-tracking branch 'origin/development' into mueller/refactor-tmtc-stack
fsfw/fsfw/pipeline/head There was a failure building this commit
2022-07-18 15:26:31 +02:00
muellerr 6f751c2cf9 Merge branch 'development' into v5.0.0
fsfw/fsfw/pipeline/pr-development This commit looks good
2022-07-18 15:12:21 +02:00
muellerr 9a2e68b37e Merge pull request 'Move HAL and Tests folder' (#653) from mueller/move-hal-tests-folder into development
fsfw/fsfw/pipeline/head This commit looks good
Reviewed-on: #653
2022-07-18 15:05:25 +02:00
muellerr 91067cde98 typo
fsfw/fsfw/pipeline/pr-development This commit looks good
fsfw/fsfw/pipeline/head Build queued...
2022-07-18 15:00:40 +02:00
muellerr 428018e4f1 update changelog
fsfw/fsfw/pipeline/pr-development This commit looks good
2022-07-18 14:59:25 +02:00
muellerr e4d7182d93 update changelog
fsfw/fsfw/pipeline/head There was a failure building this commit
2022-07-18 14:58:47 +02:00
muellerr 8b6dd3f868 add date to changelog
fsfw/fsfw/pipeline/pr-development There was a failure building this commit
2022-07-18 14:49:27 +02:00
muellerr f6ede7cd3e bump version
fsfw/fsfw/pipeline/head This commit looks good
fsfw/fsfw/pipeline/pr-development This commit looks good
2022-07-18 14:46:36 +02:00
muellerr 4da18172b3 Merge branch 'development' into mueller/possible-ring-buffer-fix
fsfw/fsfw/pipeline/pr-development This commit looks good
2022-07-18 14:37:56 +02:00
muellerr 6e5239e9a0 update jenkinsfile
fsfw/fsfw/pipeline/pr-development This commit looks good
2022-07-18 14:36:40 +02:00
muellerr 7e2fdc06cd hmm this is problematic
fsfw/fsfw/pipeline/head There was a failure building this commit
2022-07-18 14:05:43 +02:00
muellerr 3c72a42ce1 added basic sp creator test
fsfw/fsfw/pipeline/head This commit looks good
2022-07-18 13:51:02 +02:00
muellerr 78b09ed0c9 fixes includes
fsfw/fsfw/pipeline/pr-development There was a failure building this commit
2022-07-18 11:58:55 +02:00
muellerr fdf35232ee some fixes 2022-07-18 11:47:00 +02:00
muellerr 8465670374 separate unittest folder
fsfw/fsfw/pipeline/pr-development There was a failure building this commit
2022-07-18 11:42:51 +02:00
muellerr 0c5f623780 additional ctor for space packet creator
fsfw/fsfw/pipeline/head This commit looks good
2022-07-18 10:53:55 +02:00
muellerr d7a2eada94 add space packet creator class
fsfw/fsfw/pipeline/head There was a failure building this commit
2022-07-18 10:42:56 +02:00
muellerr 546e173cef add new PUS TC IF 2022-07-18 10:29:39 +02:00
muellerr 0a7f2c6646 refactored space packet interface 2022-07-18 10:20:26 +02:00
muellerr 3b23fb77b4 add obsolete add_subdirectory calls
fsfw/fsfw/pipeline/head There was a failure building this commit
fsfw/fsfw/pipeline/pr-development There was a failure building this commit
2022-07-18 09:01:45 +02:00
muellerr 6f7be281ef move HAL and tests folder
fsfw/fsfw/pipeline/head There was a failure building this commit
2022-07-18 08:59:40 +02:00
meierj 3686bbc486 Merge pull request 'DHB Reply Timeout' (#637) from meier/dhbReplyTimeout into development
fsfw/fsfw/pipeline/head This commit looks good
Reviewed-on: #637
2022-07-14 09:17:18 +02:00
meierj ecac08814e better naming for functions which reset states of replies
fsfw/fsfw/pipeline/pr-development This commit looks good
fsfw/fsfw/pipeline/head This commit looks good
2022-07-14 09:15:13 +02:00
meierj e8b8fff0b5 Merge branch 'development' into meier/dhbReplyTimeout
fsfw/fsfw/pipeline/pr-development This commit looks good
2022-07-14 09:01:28 +02:00
meierj 4d34f93cfc missing reset of timedOut value in loop of decrementDeviceReplyMap 2022-07-14 08:58:23 +02:00
mohr adbf375f38 some small fixes to dhb countdown addition
fsfw/fsfw/pipeline/pr-development There was a failure building this commit
2022-07-13 21:58:07 +02:00
mohr 2e42f53682 Merge pull request 'New PoolEntry constructor' (#651) from eive/fsfw:mueller/new-pool-entry-ctor into development
fsfw/fsfw/pipeline/head This commit looks good
Reviewed-on: #651
2022-07-13 17:43:56 +02:00
mohr c519b70302 Merge pull request 'printout tweak' (#652) from mueller/printout-tweak-mq-linux-osal into development
fsfw/fsfw/pipeline/head This commit looks good
Reviewed-on: #652
2022-07-13 17:35:53 +02:00
mohr 45ee307bc4 Merge pull request 'remove duplicate CHANGELOG entries' (#649) from eive/fsfw:mueller/clean-changelog into development
fsfw/fsfw/pipeline/head This commit looks good
Reviewed-on: #649
2022-07-13 16:50:50 +02:00
mohr 8a2068aca6 Merge pull request 'clang-tidy changes for controller module' (#648) from clang-tidy-controllers into development
Reviewed-on: #648
2022-07-13 16:49:15 +02:00
mohr aa60484111 Merge pull request 'clang-tidy changes for actions module' (#647) from clang-tidy-actions into development
Reviewed-on: #647
2022-07-13 16:42:39 +02:00
mohr e99c7f3824 Merge pull request 'Install ETL library in CI/CD' (#645) from mueller/install-etl-cicd into development
Reviewed-on: #645
2022-07-13 16:39:29 +02:00
mohr 2ee3ef1f1d Merge branch 'development' into mueller/install-etl-cicd 2022-07-13 16:38:30 +02:00
muellerr ce48827ee5 Merge branch 'development' into clang-tidy-actions 2022-07-13 16:00:50 +02:00
muellerr 0d80fad685 Merge branch 'development' into clang-tidy-controllers 2022-07-13 16:00:42 +02:00
muellerr c6253bf0dd Merge branch 'development' into mueller/new-pool-entry-ctor
fsfw/fsfw/pipeline/pr-development This commit looks good
2022-07-13 15:41:47 +02:00
mohr 93933dee02 Merge pull request 'delete run configs' (#646) from mueller/del-cmake-run-cfgs into development
Reviewed-on: #646
2022-07-13 15:37:55 +02:00
muellerr 0e49640306 update CHANGELOG
fsfw/fsfw/pipeline/pr-development This commit looks good
2022-07-08 17:59:43 +02:00
muellerr 32fea9838e add new pool entry constructor
- This constructor allows to simply specify the length.
  This is also the new default constructor for scalar values
  which are initially invalid
2022-07-08 17:56:44 +02:00
muellerr 0519083894 remove duplicate entries
fsfw/fsfw/pipeline/pr-development This commit looks good
2022-07-08 17:48:06 +02:00
muellerr 14bac9a418 clang-tidy changes for controller module
fsfw/fsfw/pipeline/head Build started...
fsfw/fsfw/pipeline/pr-development This commit looks good
2022-07-04 11:48:36 +02:00
muellerr 3bef73708f clang-tidy changes for actions module
fsfw/fsfw/pipeline/head Build started...
fsfw/fsfw/pipeline/pr-development This commit looks good
2022-07-04 11:44:26 +02:00
muellerr fef6ddceff delete run configs
fsfw/fsfw/pipeline/head Build started...
fsfw/fsfw/pipeline/pr-development This commit looks good
2022-07-04 11:16:13 +02:00
muellerr 5a9db72814 test public linkage
fsfw/fsfw/pipeline/pr-development This commit looks good
2022-07-04 10:27:14 +02:00
muellerr 5cccd5caba bump used container
fsfw/fsfw/pipeline/head Build started...
fsfw/fsfw/pipeline/pr-development This commit looks good
2022-07-04 10:21:47 +02:00
meierj df97bbc691 run auto-formatter
fsfw/fsfw/pipeline/pr-development This commit looks good
2022-06-23 11:56:46 +02:00
meierj 2d2f65bf89 moved activation of periodic replies to updatePeriodicReply
fsfw/fsfw/pipeline/pr-development This commit looks good
2022-06-23 11:54:51 +02:00
muellerr 3e9ae62b28 Merge branch 'development' into meier/dhbReplyTimeout
fsfw/fsfw/pipeline/pr-development This commit looks good
2022-06-21 10:49:06 +02:00
muellerr 2ebefdffae Merge remote-tracking branch 'upstream/development' into mueller/possible-ring-buffer-fix
fsfw/fsfw/pipeline/pr-development This commit looks good
2022-06-21 10:49:03 +02:00
muellerr 45792e86b9 Merge remote-tracking branch 'upstream/development' into mueller/possible-ring-buffer-fix
fsfw/fsfw/pipeline/pr-development There was a failure building this commit
2022-06-21 10:48:04 +02:00
meierj 21eb386f3c changed reply timeouts
fsfw/fsfw/pipeline/pr-development There was a failure building this commit
2022-06-06 12:34:57 +02:00
meierj ade36e65c6 missed reply check in simple command nominal test case
fsfw/fsfw/pipeline/pr-development There was a failure building this commit
2022-06-06 12:30:27 +02:00
meierj 103661facc deugging
fsfw/fsfw/pipeline/pr-development This commit looks good
2022-06-06 12:26:00 +02:00
meierj ae2f7219fd run auto-formatter
fsfw/fsfw/pipeline/pr-development There was a failure building this commit
2022-06-06 11:55:42 +02:00
meierj 4fba2704aa unit test for detection of missed reply when commanded externally
fsfw/fsfw/pipeline/head There was a failure building this commit
fsfw/fsfw/pipeline/pr-development There was a failure building this commit
2022-06-06 10:53:08 +02:00
meierj 161dbde0d7 fixed merge conflicts
fsfw/fsfw/pipeline/head This commit looks good
2022-06-06 10:30:17 +02:00
meierj 2fa4fd61d0 device fdir mock 2022-06-05 12:54:13 +02:00
meierj bf673c56c6 unit test for dhb 2022-06-05 12:52:55 +02:00
muellerr d871f55a89 Merge remote-tracking branch 'upstream/development' into mueller/possible-ring-buffer-fix
fsfw/fsfw/pipeline/pr-development There was a failure building this commit
2022-05-16 15:13:47 +02:00
Jakob Meier 1611a4e1f0 device handler unittest wip
fsfw/fsfw/pipeline/head This commit looks good
2022-05-16 11:10:35 +02:00
muellerr ff40a71582 Merge remote-tracking branch 'upstream/development' into mueller/possible-ring-buffer-fix
fsfw/fsfw/pipeline/pr-development There was a failure building this commit
2022-05-13 11:30:32 +02:00
muellerr e1604b292c Merge branch 'development' into mueller/possible-ring-buffer-fix
fsfw/fsfw/pipeline/pr-development There was a failure building this commit
2022-05-11 11:34:32 +02:00
Jakob Meier 7afe30ea88 fixed merge conflict 2022-05-09 12:56:22 +02:00
muellerr d3e7037759 Merge branch 'development' into mueller/possible-ring-buffer-fix
fsfw/fsfw/pipeline/pr-development This commit looks good
2022-04-27 08:42:24 +02:00
Jakob Meier 0aee86442e typo in readme
fsfw/fsfw/pipeline/head This commit looks good
2022-04-26 11:48:18 +02:00
Jakob Meier 951c077abc option to use Countdown object to time out replies
fsfw/fsfw/pipeline/head This commit looks good
2022-04-26 10:03:04 +02:00
muellerr 755dcf66a3 Merge remote-tracking branch 'upstream/development' into mueller/possible-ring-buffer-fix
fsfw/fsfw/pipeline/pr-development This commit looks good
2022-04-25 15:16:52 +02:00
muellerr b7ffd2653b Merge remote-tracking branch 'upstream/development' into mueller/possible-ring-buffer-fix
fsfw/fsfw/pipeline/pr-development This commit looks good
2022-04-25 15:11:52 +02:00
muellerr 7a5ce57bbc Merge branch 'development' into mueller/possible-ring-buffer-fix
fsfw/fsfw/pipeline/pr-development This commit looks good
2022-04-11 17:35:42 +02:00
Robin Mueller adfefdd93f printout tweak
fsfw/fsfw/pipeline/pr-development This commit looks good
fsfw/fsfw/pipeline/head This commit looks good
2022-04-11 14:19:01 +02:00
muellerr b7a316008a increase allowed read bytes
fsfw/fsfw/pipeline/pr-development This commit looks good
2022-03-28 15:07:46 +02:00
muellerr f598f7030f Merge remote-tracking branch 'upstream/development' into mueller/possible-ring-buffer-fix
fsfw/fsfw/pipeline/pr-development There was a failure building this commit
2022-03-28 15:03:01 +02:00
Steffen Gaisser 70f575396d Added changelog
fsfw/fsfw/pipeline/pr-development There was a failure building this commit
2022-03-25 15:27:22 +01:00
Steffen Gaisser ad57e6713e Fixed Unittests
fsfw/fsfw/pipeline/pr-development This commit looks good
2022-03-25 15:20:06 +01:00
muellerr 23f8e5cb41 some more tests fail
fsfw/fsfw/pipeline/pr-development There was a failure building this commit
2022-03-24 21:01:21 +01:00
muellerr 879223f38f added nullptr check
fsfw/fsfw/pipeline/pr-development There was a failure building this commit
2022-03-24 20:57:42 +01:00
Cleanroom Laptop L590 8a44c498c5 add two additional tests for ring buffer
fsfw/fsfw/pipeline/pr-development There was a failure building this commit
2022-03-24 16:50:59 +01:00
muellerr a891769a02 ring buffer cfg error warning
fsfw/fsfw/pipeline/pr-development There was a failure building this commit
2022-03-24 11:32:27 +01:00
muellerr df97c582d7 possibly important fix for ring buffer write 2022-03-23 16:48:17 +01:00
896 changed files with 15853 additions and 10161 deletions
-7
View File
@@ -1,7 +0,0 @@
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="fsfw-tests_coverage" type="CMakeRunConfiguration" factoryName="Application" REDIRECT_INPUT="false" ELEVATE="false" USE_EXTERNAL_CONSOLE="false" PASS_PARENT_ENVS_2="true" PROJECT_NAME="fsfw-tests" TARGET_NAME="fsfw-tests_coverage" CONFIG_NAME="Debug Unittest" RUN_TARGET_PROJECT_NAME="fsfw-tests" RUN_TARGET_NAME="fsfw-tests">
<method v="2">
<option name="com.jetbrains.cidr.execution.CidrBuildBeforeRunTaskProvider$BuildBeforeRunTask" enabled="true" />
</method>
</configuration>
</component>
-7
View File
@@ -1,7 +0,0 @@
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="fsfw" type="CMakeRunConfiguration" factoryName="Application" REDIRECT_INPUT="false" ELEVATE="false" USE_EXTERNAL_CONSOLE="false" PASS_PARENT_ENVS_2="true" PROJECT_NAME="fsfw-tests" TARGET_NAME="fsfw" CONFIG_NAME="Debug Unittest" RUN_TARGET_PROJECT_NAME="fsfw-tests" RUN_TARGET_NAME="fsfw-tests">
<method v="2">
<option name="com.jetbrains.cidr.execution.CidrBuildBeforeRunTaskProvider$BuildBeforeRunTask" enabled="true" />
</method>
</configuration>
</component>
+26 -7
View File
@@ -8,7 +8,24 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
# [unreleased]
# [v5.0.0]
# [v6.0.0]
## Added
- Add new `UnsignedByteField` class
PR: https://egit.irs.uni-stuttgart.de/fsfw/fsfw/pulls/660
## Changes
- Removed `HasReturnvaluesIF` class in favor of `returnvalue` namespace with `OK` and `FAILED`
constants.
PR: https://egit.irs.uni-stuttgart.de/fsfw/fsfw/pulls/659
- Overhaul of the TMTC stack, including various changes and improvements
for other modules
PR: https://egit.irs.uni-stuttgart.de/fsfw/fsfw/pulls/655
which also includes a migration guide
# [v5.0.0] 25.07.2022
## Changes
@@ -19,16 +36,13 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
- Bump C++ required version to C++17. Every project which uses the FSFW and every modern
compiler supports it
PR: https://egit.irs.uni-stuttgart.de/fsfw/fsfw/pulls/622
- HAL Linux SPI: Set the Clock Default State when setting new SPI speed
and mode
PR: https://egit.irs.uni-stuttgart.de/fsfw/fsfw/pulls/573
- GPIO HAL: `Direction`, `GpioOperation` and `Levels` are enum classes now, which prevents
name clashes with Windows defines.
PR: https://egit.irs.uni-stuttgart.de/fsfw/fsfw/pulls/572
- New CMake option `FSFW_HAL_LINUX_ADD_LIBGPIOD` to specifically exclude `gpiod` code.
PR: https://egit.irs.uni-stuttgart.de/fsfw/fsfw/pulls/572
- HAL Devicehandlers: Periodic printout is run-time configurable now
- `oneShotAction` flag in the `TestTask` class is not static anymore
- `SimpleRingBuffer::writeData` now checks if the amount is larger than the total size of the
Buffer and rejects such writeData calls with `returnvalue::FAILED`
PR: https://egit.irs.uni-stuttgart.de/fsfw/fsfw/pulls/586
- Major update for version handling, using `git describe` to fetch version information with git.
PR: https://egit.irs.uni-stuttgart.de/fsfw/fsfw/pulls/601
- Add helper functions provided by [`cmake-modules`](https://github.com/bilke/cmake-modules)
@@ -46,6 +60,9 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
creation call. It allows passing context information and an arbitrary user argument into
the message queue. Also streamlined and simplified `MessageQueue` implementation for all OSALs
PR: https://egit.irs.uni-stuttgart.de/fsfw/fsfw/pulls/583
- Internal API change: Moved the `fsfw_hal` to the `src` folder and integration and internal
tests part of `fsfw_tests` to `src`. Unittests are now in a dedicated folder called `unittests`
PR: https://egit.irs.uni-stuttgart.de/fsfw/fsfw/pulls/653
### Task Module Refactoring
@@ -120,6 +137,8 @@ https://egit.irs.uni-stuttgart.de/fsfw/fsfw/pulls/593
## Additions
- New constructor for PoolEntry which allows to simply specify the length of the pool entry.
This is also the new default constructor for scalar value with 0 as an initial value
- Added options for CI/CD builds: `FSFW_CICD_BUILD`. This allows the source code to know
whether it is running in CI/CD
PR: https://egit.irs.uni-stuttgart.de/fsfw/fsfw/pulls/623
+27 -19
View File
@@ -13,7 +13,7 @@ list(APPEND CMAKE_MODULE_PATH
# Version file handling #
# ##############################################################################
set(FSFW_VERSION_IF_GIT_FAILS 4)
set(FSFW_VERSION_IF_GIT_FAILS 5)
set(FSFW_SUBVERSION_IF_GIT_FAILS 0)
set(FSFW_REVISION_IF_GIT_FAILS 0)
@@ -67,6 +67,7 @@ endif()
set(FSFW_SOURCES_DIR "${CMAKE_SOURCE_DIR}/src/fsfw")
set(FSFW_ETL_LIB_NAME etl)
set(FSFW_ETL_LINK_TARGET etl::etl)
set(FSFW_ETL_LIB_MAJOR_VERSION
20
CACHE STRING "ETL library major version requirement")
@@ -103,20 +104,26 @@ if(FSFW_GENERATE_SECTIONS)
option(FSFW_REMOVE_UNUSED_CODE "Remove unused code" ON)
endif()
option(FSFW_BUILD_UNITTESTS
"Build unittest binary in addition to static library" OFF)
option(FSFW_BUILD_TESTS
"Build unittest binary in addition to static library. Requires Catch2"
OFF)
option(FSFW_CICD_BUILD "Build for CI/CD. This can disable problematic test" OFF)
option(FSFW_BUILD_DOCS "Build documentation with Sphinx and Doxygen" OFF)
if(FSFW_BUILD_UNITTESTS)
if(FSFW_BUILD_TESTS)
option(FSFW_TESTS_GEN_COV "Generate coverage data for unittests" ON)
endif()
option(FSFW_WARNING_SHADOW_LOCAL_GCC "Enable -Wshadow=local warning in GCC" ON)
# Options to exclude parts of the FSFW from compilation.
option(FSFW_ADD_INTERNAL_TESTS "Add internal unit tests" ON)
option(FSFW_ADD_UNITTESTS "Add regular unittests. Requires Catch2" OFF)
option(FSFW_ADD_HAL "Add Hardware Abstraction Layer" ON)
if(UNIX)
option(FSFW_HAL_LINUX_ADD_PERIPHERAL_DRIVERS "Add Linux peripheral drivers"
OFF)
option(FSFW_HAL_LINUX_ADD_LIBGPIOD "Attempt to add Linux GPIOD drivers" OFF)
endif()
# Optional sources
option(FSFW_ADD_PUS "Compile with PUS sources" ON)
option(FSFW_ADD_MONITORING "Compile with monitoring components" ON)
@@ -139,7 +146,7 @@ if(IPO_SUPPORTED AND FSFW_ENABLE_IPO)
TRUE)
endif()
if(FSFW_BUILD_UNITTESTS)
if(FSFW_BUILD_TESTS)
message(
STATUS
"${MSG_PREFIX} Building the FSFW unittests in addition to the static library"
@@ -162,10 +169,9 @@ if(FSFW_BUILD_UNITTESTS)
list(APPEND FSFW_FETCH_CONTENT_TARGETS Catch2)
endif()
set(FSFW_CONFIG_PATH tests/src/fsfw_tests/unit/testcfg)
configure_file(tests/src/fsfw_tests/unit/testcfg/FSFWConfig.h.in FSFWConfig.h)
configure_file(tests/src/fsfw_tests/unit/testcfg/TestsConfig.h.in
tests/TestsConfig.h)
set(FSFW_CONFIG_PATH unittests/testcfg)
configure_file(unittests/testcfg/FSFWConfig.h.in FSFWConfig.h)
configure_file(unittests/testcfg/TestsConfig.h.in tests/TestsConfig.h)
project(${FSFW_TEST_TGT} CXX C)
add_executable(${FSFW_TEST_TGT})
@@ -183,7 +189,10 @@ if(FSFW_BUILD_UNITTESTS)
endif()
endif()
message(STATUS "${MSG_PREFIX} Finding and/or providing ETL library")
message(
STATUS
"${MSG_PREFIX} Finding and/or providing etl library with version ${FSFW_ETL_LIB_MAJOR_VERSION}"
)
# Check whether the user has already installed ETL first
find_package(${FSFW_ETL_LIB_NAME} ${FSFW_ETL_LIB_MAJOR_VERSION} QUIET)
@@ -191,7 +200,7 @@ find_package(${FSFW_ETL_LIB_NAME} ${FSFW_ETL_LIB_MAJOR_VERSION} QUIET)
if(NOT ${FSFW_ETL_LIB_NAME}_FOUND)
message(
STATUS
"No ETL installation was found with find_package. Installing and providing "
"${MSG_PREFIX} No ETL installation was found with find_package. Installing and providing "
"etl with FindPackage")
include(FetchContent)
@@ -281,16 +290,15 @@ message(
)
add_subdirectory(src)
add_subdirectory(tests)
if(FSFW_ADD_HAL)
add_subdirectory(hal)
endif()
add_subdirectory(contrib)
if(FSFW_BUILD_TESTS)
add_subdirectory(unittests)
endif()
if(FSFW_BUILD_DOCS)
add_subdirectory(docs)
endif()
if(FSFW_BUILD_UNITTESTS)
if(FSFW_BUILD_TESTS)
if(FSFW_TESTS_GEN_COV)
if(CMAKE_COMPILER_IS_GNUCXX)
include(CodeCoverage)
@@ -447,8 +455,8 @@ target_include_directories(
target_compile_options(${LIB_FSFW_NAME} PRIVATE ${FSFW_WARNING_FLAGS}
${COMPILER_FLAGS})
target_link_libraries(${LIB_FSFW_NAME} PRIVATE ${FSFW_ETL_LINK_TARGET}
${FSFW_ADDITIONAL_LINK_LIBS})
target_link_libraries(${LIB_FSFW_NAME} PRIVATE ${FSFW_ADDITIONAL_LINK_LIBS})
target_link_libraries(${LIB_FSFW_NAME} PUBLIC ${FSFW_ETL_LINK_TARGET})
string(
CONCAT
+6 -3
View File
@@ -132,14 +132,14 @@ You can use the following commands inside the `fsfw` folder to set up the build
```sh
mkdir build-tests && cd build-tests
cmake -DFSFW_BUILD_UNITTESTS=ON -DFSFW_OSAL=host -DCMAKE_BUILD_TYPE=Debug ..
cmake -DFSFW_BUILD_TESTS=ON -DFSFW_OSAL=host -DCMAKE_BUILD_TYPE=Debug ..
```
You can also use `-DFSFW_OSAL=linux` on Linux systems.
Coverage data in HTML format can be generated using the `CodeCoverage`
[CMake module](https://github.com/bilke/cmake-modules/tree/master).
To build the unittests, run them and then generare the coverage data in this format,
To build the unittests, run them and then generate the coverage data in this format,
the following command can be used inside the build directory after the build system was set up
```sh
@@ -188,7 +188,10 @@ and open the documentation conveniently. Try `helper.py -h for more information.
The formatting is done by the `clang-format` tool. The configuration is contained within the
`.clang-format` file in the repository root. As long as `clang-format` is installed, you
can run the `apply-clang-format.sh` helper script to format all source files consistently.
can run the `auto-format.sh` helper script to format all source files consistently. Furthermore cmake-format is required to format CMake files which can be installed with:
````sh
sudo pip install cmakelang
````
## Index
+3 -3
View File
@@ -1,9 +1,9 @@
pipeline {
environment {
BUILDDIR = 'build-tests'
BUILDDIR = 'cmake-build-tests'
}
agent {
docker { image 'fsfw-ci:d2'}
docker { image 'fsfw-ci:d3'}
}
stages {
stage('Clean') {
@@ -14,7 +14,7 @@ pipeline {
stage('Configure') {
steps {
dir(BUILDDIR) {
sh 'cmake -DFSFW_OSAL=host -DFSFW_BUILD_UNITTESTS=ON -DFSFW_CICD_BUILD=ON ..'
sh 'cmake -DFSFW_OSAL=host -DFSFW_BUILD_TESTS=ON -DFSFW_CICD_BUILD=ON ..'
}
}
}
+1 -1
View File
@@ -14,7 +14,7 @@ FSFW to achieve that. The fsfw uses run-time type information but exceptions are
# Failure Handling
Functions should return a defined `ReturnValue_t` to signal to the caller that something has
gone wrong. Returnvalues must be unique. For this the function `HasReturnvaluesIF::makeReturnCode`
gone wrong. Returnvalues must be unique. For this the function `returnvalue::makeCode`
or the macro `MAKE_RETURN` can be used. The `CLASS_ID` is a unique id for that type of object.
See `returnvalues/FwClassIds` folder. The user can add custom `CLASS_ID`s via the
`fsfwconfig` folder.
+2 -2
View File
@@ -144,7 +144,7 @@ ReturnValue_t GyroHandler::initializeLocalDataPool(localpool::DataPool &localDat
new PoolEntry<uint8_t>({0}));
poolManager.subscribeForPeriodicPacket(gyroData.getSid(), false, 4.0, false);
return HasReturnvaluesIF::RETURN_OK;
return returnvalue::OK;
}
```
@@ -154,7 +154,7 @@ in any case:
```cpp
PoolReadGuard readHelper(&gyroData);
if(readHelper.getReadResult() == HasReturnvaluesIF::RETURN_OK) {
if(readHelper.getReadResult() == returnvalue::OK) {
if(not gyroData.isValid()) {
gyroData.setValidity(true, true);
}
+1
View File
@@ -4,6 +4,7 @@ API
.. toctree::
:maxdepth: 4
api/cfdp
api/objectmanager
api/task
api/ipc
+8
View File
@@ -0,0 +1,8 @@
CFDP API
=================
``UserBase``
-----------------
.. doxygenclass:: cfdp::UserBase
:members:
+1 -1
View File
@@ -3,7 +3,7 @@
Returnvalue API
==================
.. doxygenfile:: HasReturnvaluesIF.h
.. doxygenfile:: returnvalue.h
.. _fwclassids:
+6 -6
View File
@@ -75,11 +75,11 @@ and the respective source file with sensible default return values:
void TestDeviceHandler::doShutDown() {}
ReturnValue_t TestDeviceHandler::buildNormalDeviceCommand(DeviceCommandId_t* id) {
return HasReturnvaluesIF::RETURN_OK;
return returnvalue::OK;
}
ReturnValue_t TestDeviceHandler::buildTransitionDeviceCommand(DeviceCommandId_t* id) {
return HasReturnvaluesIF::RETURN_OK;
return returnvalue::OK;
}
void TestDeviceHandler::fillCommandAndReplyMap() {}
@@ -87,17 +87,17 @@ and the respective source file with sensible default return values:
ReturnValue_t TestDeviceHandler::buildCommandFromCommand(DeviceCommandId_t deviceCommand,
const uint8_t* commandData,
size_t commandDataLen) {
return HasReturnvaluesIF::RETURN_OK;
return returnvalue::OK;
}
ReturnValue_t TestDeviceHandler::scanForReply(const uint8_t* start, size_t remainingSize,
DeviceCommandId_t* foundId, size_t* foundLen) {
return HasReturnvaluesIF::RETURN_OK;
return returnvalue::OK;
}
ReturnValue_t TestDeviceHandler::interpretDeviceReply(DeviceCommandId_t id,
const uint8_t* packet) {
return HasReturnvaluesIF::RETURN_OK;
return returnvalue::OK;
}
uint32_t TestDeviceHandler::getTransitionDelayMs(Mode_t modeFrom, Mode_t modeTo) {
@@ -106,5 +106,5 @@ and the respective source file with sensible default return values:
ReturnValue_t TestDeviceHandler::initializeLocalDataPool(localpool::DataPool& localDataPoolMap,
LocalDataPoolManager& poolManager) {
return HasReturnvaluesIF::RETURN_OK;
return returnvalue::OK;
}
+1 -1
View File
@@ -106,7 +106,7 @@ You can use the following commands inside the ``fsfw`` folder to set up the buil
.. code-block:: console
mkdir build-tests && cd build-tests
cmake -DFSFW_BUILD_UNITTESTS=ON -DFSFW_OSAL=host ..
cmake -DFSFW_BUILD_TESTS=ON -DFSFW_OSAL=host ..
You can also use ``-DFSFW_OSAL=linux`` on Linux systems.
+9 -7
View File
@@ -7,18 +7,20 @@ Structure
----------
The general structure is driven by the usage of interfaces provided by objects.
The FSFW uses C++11 as baseline. The intention behind this is that this C++ Standard should be
widely available, even with older compilers.
The FSFW uses dynamic allocation during the initialization but provides static containers during runtime.
This simplifies the instantiation of objects and allows the usage of some standard containers.
Dynamic Allocation after initialization is discouraged and different solutions are provided in the
FSFW to achieve that. The fsfw uses run-time type information but exceptions are not allowed.
The FSFW uses C++17 as baseline.
It also uses dynamic allocation during the initialization but provides
static containers during runtime.
This simplifies the instantiation of objects and allows the usage of some
standard containers.
Dynamic Allocation after initialization is discouraged and different solutions
are provided in the FSFW to achieve that. The fsfw uses run-time type
information but will not throw exceptions.
Failure Handling
-----------------
Functions should return a defined :cpp:type:`ReturnValue_t` to signal to the caller that something has
gone wrong. Returnvalues must be unique. For this the function :cpp:func:`HasReturnvaluesIF::makeReturnCode`
gone wrong. Returnvalues must be unique. For this the function :cpp:func:`returnvalue::makeCode`
or the :ref:`macro MAKE_RETURN_CODE <retvalapi>` can be used. The ``CLASS_ID`` is a unique ID for that type of object.
See the :ref:`FSFW Class IDs file <fwclassids>`. The user can add custom ``CLASS_ID``\s via the
``fsfwconfig`` folder.
+2 -2
View File
@@ -150,7 +150,7 @@ with a housekeeping service command.
new PoolEntry<uint8_t>({0}));
poolManager.subscribeForPeriodicPacket(gyroData.getSid(), false, 4.0, false);
return HasReturnvaluesIF::RETURN_OK;
return returnvalue::OK;
}
Now, if we receive some sensor data and converted them into the right format,
@@ -160,7 +160,7 @@ in any case:
.. code-block:: cpp
PoolReadGuard readHelper(&gyroData);
if(readHelper.getReadResult() == HasReturnvaluesIF::RETURN_OK) {
if(readHelper.getReadResult() == returnvalue::OK) {
if(not gyroData.isValid()) {
gyroData.setValidity(true, true);
}
-48
View File
@@ -1,48 +0,0 @@
cmake_minimum_required(VERSION 3.13)
# Can also be changed by upper CMakeLists.txt file
find_library(LIB_FSFW_NAME fsfw REQUIRED)
option(FSFW_HAL_ADD_LINUX "Add the Linux HAL to the sources. Requires gpiod library" OFF)
# On by default for now because I did not have an issue including and compiling those files
# and libraries on a Desktop Linux system and the primary target of the FSFW is still embedded
# Linux. The only exception from this is the gpiod library which requires a dedicated installation,
# but CMake is able to determine whether this library is installed with find_library.
option(FSFW_HAL_LINUX_ADD_PERIPHERAL_DRIVERS "Add peripheral drivers for embedded Linux" ON)
option(FSFW_HAL_LINUX_ADD_LIBGPIOD "Target implements libgpiod" ON)
option(FSFW_HAL_ADD_RASPBERRY_PI "Add Raspberry Pi specific code to the sources" OFF)
option(FSFW_HAL_ADD_STM32H7 "Add the STM32H7 HAL to the sources" OFF)
option(FSFW_HAL_WARNING_SHADOW_LOCAL_GCC "Enable -Wshadow=local warning in GCC" ON)
set(LINUX_HAL_PATH_NAME linux)
set(STM32H7_PATH_NAME stm32h7)
add_subdirectory(src)
foreach(INCLUDE_PATH ${FSFW_HAL_ADDITIONAL_INC_PATHS})
if(IS_ABSOLUTE ${INCLUDE_PATH})
set(CURR_ABS_INC_PATH "${INCLUDE_PATH}")
else()
get_filename_component(CURR_ABS_INC_PATH
${INCLUDE_PATH} REALPATH BASE_DIR ${CMAKE_SOURCE_DIR})
endif()
if(CMAKE_VERBOSE)
message(STATUS "FSFW include path: ${CURR_ABS_INC_PATH}")
endif()
list(APPEND FSFW_HAL_ADD_INC_PATHS_ABS ${CURR_ABS_INC_PATH})
endforeach()
target_include_directories(${LIB_FSFW_NAME} PRIVATE
${FSFW_HAL_ADD_INC_PATHS_ABS}
)
target_compile_definitions(${LIB_FSFW_NAME} PRIVATE
${FSFW_HAL_DEFINES}
)
target_link_libraries(${LIB_FSFW_NAME} PRIVATE
${FSFW_HAL_LINK_LIBS}
)
-9
View File
@@ -1,9 +0,0 @@
target_include_directories(${LIB_FSFW_NAME} PRIVATE
${CMAKE_CURRENT_SOURCE_DIR}
)
target_include_directories(${LIB_FSFW_NAME} INTERFACE
${CMAKE_CURRENT_SOURCE_DIR}
)
add_subdirectory(fsfw_hal)
@@ -1,3 +0,0 @@
target_sources(${LIB_FSFW_NAME} PRIVATE
GpioCookie.cpp
)
@@ -1,5 +0,0 @@
target_sources(${LIB_FSFW_NAME} PRIVATE
GyroL3GD20Handler.cpp
MgmRM3100Handler.cpp
MgmLIS3MDLHandler.cpp
)
-1
View File
@@ -1 +0,0 @@
-25
View File
@@ -1,25 +0,0 @@
if(FSFW_HAL_ADD_RASPBERRY_PI)
add_subdirectory(rpi)
endif()
target_sources(${LIB_FSFW_NAME} PRIVATE
UnixFileGuard.cpp
CommandExecutor.cpp
utility.cpp
)
if(FSFW_HAL_LINUX_ADD_PERIPHERAL_DRIVERS)
if(FSFW_HAL_LINUX_ADD_LIBGPIOD)
add_subdirectory(gpio)
endif()
add_subdirectory(uart)
# Adding those does not really make sense on Apple systems which
# are generally host systems. It won't even compile as the headers
# are missing
if(NOT APPLE)
add_subdirectory(i2c)
add_subdirectory(spi)
endif()
endif()
add_subdirectory(uio)
@@ -1,16 +0,0 @@
# This abstraction layer requires the gpiod library. You can install this library
# with "sudo apt-get install -y libgpiod-dev". If you are cross-compiling, you need
# to install the package before syncing the sysroot to your host computer.
find_library(LIB_GPIO gpiod)
if(${LIB_GPIO} MATCHES LIB_GPIO-NOTFOUND)
message(STATUS "gpiod library not found, not linking against it")
else()
target_sources(${LIB_FSFW_NAME} PRIVATE
LinuxLibgpioIF.cpp
)
target_link_libraries(${LIB_FSFW_NAME} PRIVATE
${LIB_GPIO}
)
endif()
@@ -1,8 +0,0 @@
target_sources(${LIB_FSFW_NAME} PUBLIC
I2cComIF.cpp
I2cCookie.cpp
)
@@ -1,3 +0,0 @@
target_sources(${LIB_FSFW_NAME} PRIVATE
GpioRPi.cpp
)
@@ -1,8 +0,0 @@
target_sources(${LIB_FSFW_NAME} PUBLIC
SpiComIF.cpp
SpiCookie.cpp
)
@@ -1,4 +0,0 @@
target_sources(${LIB_FSFW_NAME} PUBLIC
UartComIF.cpp
UartCookie.cpp
)
@@ -1,3 +0,0 @@
target_sources(${LIB_FSFW_NAME} PUBLIC
UioMapper.cpp
)
@@ -1,3 +0,0 @@
target_sources(${LIB_FSFW_NAME} PRIVATE
GyroL3GD20H.cpp
)
@@ -1,3 +0,0 @@
target_sources(${LIB_FSFW_NAME} PRIVATE
gpio.cpp
)
@@ -1,2 +0,0 @@
target_sources(${LIB_FSFW_NAME} PRIVATE
)
@@ -1,9 +0,0 @@
target_sources(${LIB_FSFW_NAME} PRIVATE
spiCore.cpp
spiDefinitions.cpp
spiInterrupts.cpp
mspInit.cpp
SpiCookie.cpp
SpiComIF.cpp
stm32h743zi.cpp
)
@@ -1,2 +0,0 @@
target_sources(${LIB_FSFW_NAME} PRIVATE
)
@@ -35,8 +35,8 @@ void Factory::produceFsfwObjects(void) {
}
void Factory::setStaticFrameworkObjectIds() {
PusServiceBase::packetSource = objects::NO_OBJECT;
PusServiceBase::packetDestination = objects::NO_OBJECT;
PusServiceBase::PUS_DISTRIBUTOR = objects::NO_OBJECT;
PusServiceBase::PACKET_DESTINATION = objects::NO_OBJECT;
CommandingServiceBase::defaultPacketSource = objects::NO_OBJECT;
CommandingServiceBase::defaultPacketDestination = objects::NO_OBJECT;
@@ -11,15 +11,15 @@ ReturnValue_t pst::pollingSequenceInitDefault(
/* Add polling sequence table here */
if (thisSequence->checkSequence() == HasReturnvaluesIF::RETURN_OK) {
return HasReturnvaluesIF::RETURN_OK;
if (thisSequence->checkSequence() == returnvalue::OK) {
return returnvalue::OK;
}
else {
#if FSFW_CPP_OSTREAM_ENABLED == 1
sif::error << "pst::pollingSequenceInitDefault: Sequence invalid!"
<< std::endl;
#endif
return HasReturnvaluesIF::RETURN_FAILED;
return returnvalue::FAILED;
}
}
@@ -1,7 +1,7 @@
#ifndef POLLINGSEQUENCEFACTORY_H_
#define POLLINGSEQUENCEFACTORY_H_
#include <fsfw/returnvalues/HasReturnvaluesIF.h>
#include <fsfw/returnvalues/returnvalue.h>
class FixedTimeslotTaskIF;
+11 -4
View File
@@ -3,11 +3,17 @@ if [[ ! -f README.md ]]; then
cd ..
fi
folder_list=(
"./src"
"./unittests"
)
cmake_fmt="cmake-format"
file_selectors="-iname CMakeLists.txt"
if command -v ${cmake_fmt} &> /dev/null; then
${cmake_fmt} -i CMakeLists.txt
find ./src ${file_selectors} | xargs ${cmake_fmt} -i
find ./src ${file_selectors} | xargs ${cmake_fmt} -i
find ./unittests ${file_selectors} | xargs ${cmake_fmt} -i
else
echo "No ${cmake_fmt} tool found, not formatting CMake files"
fi
@@ -15,9 +21,10 @@ fi
cpp_format="clang-format"
file_selectors="-iname *.h -o -iname *.cpp -o -iname *.c -o -iname *.tpp"
if command -v ${cpp_format} &> /dev/null; then
find ./src ${file_selectors} | xargs ${cpp_format} --style=file -i
find ./hal ${file_selectors} | xargs ${cpp_format} --style=file -i
find ./tests ${file_selectors} | xargs ${cpp_format} --style=file -i
for dir in ${folder_list[@]}; do
echo "Auto-formatting ${dir} recursively"
find ${dir} ${file_selectors} | xargs clang-format --style=file -i
done
else
echo "No ${cpp_format} tool found, not formatting C++/C files"
fi
+24 -5
View File
@@ -13,7 +13,7 @@ from shutil import which
from typing import List
UNITTEST_FOLDER_NAME = "build-tests"
UNITTEST_FOLDER_NAME = "cmake-build-tests"
DOCS_FOLDER_NAME = "build-docs"
@@ -48,6 +48,20 @@ def main():
action="store_true",
help="Run valgrind on generated test binary",
)
parser.add_argument(
"-g",
"--generators",
default = "Ninja",
action="store",
help="CMake generators",
)
parser.add_argument(
"-w",
"--windows",
default=False,
action="store_true",
help="Run on windows",
)
args = parser.parse_args()
if args.all:
@@ -115,14 +129,14 @@ def handle_tests_type(args, build_dir_list: list):
if args.create:
if os.path.exists(UNITTEST_FOLDER_NAME):
shutil.rmtree(UNITTEST_FOLDER_NAME)
create_tests_build_cfg()
create_tests_build_cfg(args)
build_directory = UNITTEST_FOLDER_NAME
elif len(build_dir_list) == 0:
print(
"No valid CMake tests build directory found. "
"Trying to set up test build system"
)
create_tests_build_cfg()
create_tests_build_cfg(args)
build_directory = UNITTEST_FOLDER_NAME
elif len(build_dir_list) == 1:
build_directory = build_dir_list[0]
@@ -147,10 +161,15 @@ def handle_tests_type(args, build_dir_list: list):
os.chdir("..")
def create_tests_build_cfg():
def create_tests_build_cfg(args):
os.mkdir(UNITTEST_FOLDER_NAME)
os.chdir(UNITTEST_FOLDER_NAME)
cmd_runner("cmake -DFSFW_OSAL=host -DFSFW_BUILD_UNITTESTS=ON ..")
if args.windows:
cmake_cmd = 'cmake -G "' + args.generators + '" -DFSFW_OSAL=host -DFSFW_BUILD_TESTS=ON \
-DGCOVR_PATH="py -m gcovr" ..'
else:
cmake_cmd = 'cmake -G "' + args.generators + '" -DFSFW_OSAL=host -DFSFW_BUILD_TESTS=ON ..'
cmd_runner(cmake_cmd)
os.chdir("..")
+5
View File
@@ -4,3 +4,8 @@ target_include_directories(${LIB_FSFW_NAME}
INTERFACE ${CMAKE_CURRENT_SOURCE_DIR})
add_subdirectory(fsfw)
if(FSFW_ADD_HAL)
add_subdirectory(fsfw_hal)
endif()
add_subdirectory(fsfw_tests)
+1
View File
@@ -31,6 +31,7 @@ add_subdirectory(thermal)
add_subdirectory(timemanager)
add_subdirectory(tmtcpacket)
add_subdirectory(tmtcservices)
add_subdirectory(filesystem)
# Optional
+14 -14
View File
@@ -6,13 +6,13 @@
ActionHelper::ActionHelper(HasActionsIF* setOwner, MessageQueueIF* useThisQueue)
: owner(setOwner), queueToUse(useThisQueue) {}
ActionHelper::~ActionHelper() {}
ActionHelper::~ActionHelper() = default;
ReturnValue_t ActionHelper::handleActionMessage(CommandMessage* command) {
if (command->getCommand() == ActionMessage::EXECUTE_ACTION) {
ActionId_t currentAction = ActionMessage::getActionId(command);
prepareExecution(command->getSender(), currentAction, ActionMessage::getStoreId(command));
return HasReturnvaluesIF::RETURN_OK;
return returnvalue::OK;
} else {
return CommandMessage::UNKNOWN_COMMAND;
}
@@ -21,7 +21,7 @@ ReturnValue_t ActionHelper::handleActionMessage(CommandMessage* command) {
ReturnValue_t ActionHelper::initialize(MessageQueueIF* queueToUse_) {
ipcStore = ObjectManager::instance()->get<StorageManagerIF>(objects::IPC_STORE);
if (ipcStore == nullptr) {
return HasReturnvaluesIF::RETURN_FAILED;
return returnvalue::FAILED;
}
if (queueToUse_ != nullptr) {
setQueueToUse(queueToUse_);
@@ -35,10 +35,10 @@ ReturnValue_t ActionHelper::initialize(MessageQueueIF* queueToUse_) {
sif::printWarning("ActionHelper::initialize: No queue set\n");
#endif
#endif /* FSFW_VERBOSE_LEVEL >= 1 */
return HasReturnvaluesIF::RETURN_FAILED;
return returnvalue::FAILED;
}
return HasReturnvaluesIF::RETURN_OK;
return returnvalue::OK;
}
void ActionHelper::step(uint8_t step, MessageQueueId_t reportTo, ActionId_t commandId,
@@ -59,10 +59,10 @@ void ActionHelper::setQueueToUse(MessageQueueIF* queue) { queueToUse = queue; }
void ActionHelper::prepareExecution(MessageQueueId_t commandedBy, ActionId_t actionId,
store_address_t dataAddress) {
const uint8_t* dataPtr = NULL;
const uint8_t* dataPtr = nullptr;
size_t size = 0;
ReturnValue_t result = ipcStore->getData(dataAddress, &dataPtr, &size);
if (result != HasReturnvaluesIF::RETURN_OK) {
if (result != returnvalue::OK) {
CommandMessage reply;
ActionMessage::setStepReply(&reply, actionId, 0, result);
queueToUse->sendMessage(commandedBy, &reply);
@@ -75,7 +75,7 @@ void ActionHelper::prepareExecution(MessageQueueId_t commandedBy, ActionId_t act
ActionMessage::setCompletionReply(&reply, actionId, true, result);
queueToUse->sendMessage(commandedBy, &reply);
}
if (result != HasReturnvaluesIF::RETURN_OK) {
if (result != returnvalue::OK) {
CommandMessage reply;
ActionMessage::setStepReply(&reply, actionId, 0, result);
queueToUse->sendMessage(commandedBy, &reply);
@@ -91,11 +91,11 @@ ReturnValue_t ActionHelper::reportData(MessageQueueId_t reportTo, ActionId_t rep
size_t maxSize = data->getSerializedSize();
if (maxSize == 0) {
/* No error, there's simply nothing to report. */
return HasReturnvaluesIF::RETURN_OK;
return returnvalue::OK;
}
size_t size = 0;
ReturnValue_t result = ipcStore->getFreeElement(&storeAddress, maxSize, &dataPtr);
if (result != HasReturnvaluesIF::RETURN_OK) {
if (result != returnvalue::OK) {
#if FSFW_CPP_OSTREAM_ENABLED == 1
sif::warning << "ActionHelper::reportData: Getting free element from IPC store failed!"
<< std::endl;
@@ -107,7 +107,7 @@ ReturnValue_t ActionHelper::reportData(MessageQueueId_t reportTo, ActionId_t rep
return result;
}
result = data->serialize(&dataPtr, &size, maxSize, SerializeIF::Endianness::BIG);
if (result != HasReturnvaluesIF::RETURN_OK) {
if (result != returnvalue::OK) {
ipcStore->deleteData(storeAddress);
return result;
}
@@ -124,7 +124,7 @@ ReturnValue_t ActionHelper::reportData(MessageQueueId_t reportTo, ActionId_t rep
result = queueToUse->sendMessage(reportTo, &reply);
}
if (result != HasReturnvaluesIF::RETURN_OK) {
if (result != returnvalue::OK) {
ipcStore->deleteData(storeAddress);
}
return result;
@@ -137,7 +137,7 @@ ReturnValue_t ActionHelper::reportData(MessageQueueId_t reportTo, ActionId_t rep
CommandMessage reply;
store_address_t storeAddress;
ReturnValue_t result = ipcStore->addData(&storeAddress, data, dataSize);
if (result != HasReturnvaluesIF::RETURN_OK) {
if (result != returnvalue::OK) {
#if FSFW_CPP_OSTREAM_ENABLED == 1
sif::warning << "ActionHelper::reportData: Adding data to IPC store failed!" << std::endl;
#else
@@ -158,7 +158,7 @@ ReturnValue_t ActionHelper::reportData(MessageQueueId_t reportTo, ActionId_t rep
result = queueToUse->sendMessage(reportTo, &reply);
}
if (result != HasReturnvaluesIF::RETURN_OK) {
if (result != returnvalue::OK) {
ipcStore->deleteData(storeAddress);
}
return result;
+8 -8
View File
@@ -1,9 +1,9 @@
#ifndef FSFW_ACTION_ACTIONHELPER_H_
#define FSFW_ACTION_ACTIONHELPER_H_
#include "../ipc/MessageQueueIF.h"
#include "../serialize/SerializeIF.h"
#include "ActionMessage.h"
#include "fsfw/ipc/MessageQueueIF.h"
#include "fsfw/serialize/SerializeIF.h"
/**
* @brief Action Helper is a helper class which handles action messages
*
@@ -36,7 +36,7 @@ class ActionHelper {
* send to the sender of the message automatically.
*
* @param command Pointer to a command message received by the owner
* @return HasReturnvaluesIF::RETURN_OK if the message is a action message,
* @return returnvalue::OK if the message is a action message,
* CommandMessage::UNKNOW_COMMAND if this message ID is unkown
*/
ReturnValue_t handleActionMessage(CommandMessage* command);
@@ -45,7 +45,7 @@ class ActionHelper {
* helper function
* @param queueToUse_ Pointer to the messageQueue to be used, optional
* if queue was set in constructor
* @return Returns RETURN_OK if successful
* @return Returns returnvalue::OK if successful
*/
ReturnValue_t initialize(MessageQueueIF* queueToUse_ = nullptr);
/**
@@ -58,7 +58,7 @@ class ActionHelper {
* @param result Result of the execution
*/
void step(uint8_t step, MessageQueueId_t reportTo, ActionId_t commandId,
ReturnValue_t result = HasReturnvaluesIF::RETURN_OK);
ReturnValue_t result = returnvalue::OK);
/**
* Function to be called by the owner to send a action completion message
* @param success Specify whether action was completed successfully or not.
@@ -67,7 +67,7 @@ class ActionHelper {
* @param result Result of the execution
*/
void finish(bool success, MessageQueueId_t reportTo, ActionId_t commandId,
ReturnValue_t result = HasReturnvaluesIF::RETURN_OK);
ReturnValue_t result = returnvalue::OK);
/**
* Function to be called by the owner if an action does report data.
* Takes a SerializeIF* pointer and serializes it into the IPC store.
@@ -75,7 +75,7 @@ class ActionHelper {
* message to
* @param replyId ID of the executed command
* @param data Pointer to the data
* @return Returns RETURN_OK if successful, otherwise failure code
* @return Returns returnvalue::OK if successful, otherwise failure code
*/
ReturnValue_t reportData(MessageQueueId_t reportTo, ActionId_t replyId, SerializeIF* data,
bool hideSender = false);
@@ -86,7 +86,7 @@ class ActionHelper {
* message to
* @param replyId ID of the executed command
* @param data Pointer to the data
* @return Returns RETURN_OK if successful, otherwise failure code
* @return Returns returnvalue::OK if successful, otherwise failure code
*/
ReturnValue_t reportData(MessageQueueId_t reportTo, ActionId_t replyId, const uint8_t* data,
size_t dataSize, bool hideSender = false);
+5 -6
View File
@@ -2,9 +2,9 @@
#include "fsfw/objectmanager/ObjectManager.h"
#include "fsfw/storagemanager/StorageManagerIF.h"
ActionMessage::ActionMessage() {}
ActionMessage::ActionMessage() = default;
ActionMessage::~ActionMessage() {}
ActionMessage::~ActionMessage() = default;
void ActionMessage::setCommand(CommandMessage* message, ActionId_t fid,
store_address_t parameters) {
@@ -25,7 +25,7 @@ store_address_t ActionMessage::getStoreId(const CommandMessage* message) {
void ActionMessage::setStepReply(CommandMessage* message, ActionId_t fid, uint8_t step,
ReturnValue_t result) {
if (result == HasReturnvaluesIF::RETURN_OK) {
if (result == returnvalue::OK) {
message->setCommand(STEP_SUCCESS);
} else {
message->setCommand(STEP_FAILED);
@@ -64,9 +64,8 @@ void ActionMessage::clear(CommandMessage* message) {
switch (message->getCommand()) {
case EXECUTE_ACTION:
case DATA_REPLY: {
StorageManagerIF* ipcStore =
ObjectManager::instance()->get<StorageManagerIF>(objects::IPC_STORE);
if (ipcStore != NULL) {
auto* ipcStore = ObjectManager::instance()->get<StorageManagerIF>(objects::IPC_STORE);
if (ipcStore != nullptr) {
ipcStore->deleteData(getStoreId(message));
}
break;
+2 -2
View File
@@ -33,12 +33,12 @@ class ActionMessage {
static store_address_t getStoreId(const CommandMessage* message);
static void setStepReply(CommandMessage* message, ActionId_t fid, uint8_t step,
ReturnValue_t result = HasReturnvaluesIF::RETURN_OK);
ReturnValue_t result = returnvalue::OK);
static uint8_t getStep(const CommandMessage* message);
static ReturnValue_t getReturnCode(const CommandMessage* message);
static void setDataReply(CommandMessage* message, ActionId_t actionId, store_address_t data);
static void setCompletionReply(CommandMessage* message, ActionId_t fid, bool success,
ReturnValue_t result = HasReturnvaluesIF::RETURN_OK);
ReturnValue_t result = returnvalue::OK);
static void clear(CommandMessage* message);
};
+24 -27
View File
@@ -2,26 +2,26 @@
#include "fsfw/objectmanager/ObjectManager.h"
CommandActionHelper::CommandActionHelper(CommandsActionsIF *setOwner)
: owner(setOwner), queueToUse(NULL), ipcStore(NULL), commandCount(0), lastTarget(0) {}
: owner(setOwner), queueToUse(nullptr), ipcStore(nullptr), commandCount(0), lastTarget(0) {}
CommandActionHelper::~CommandActionHelper() {}
CommandActionHelper::~CommandActionHelper() = default;
ReturnValue_t CommandActionHelper::commandAction(object_id_t commandTo, ActionId_t actionId,
SerializeIF *data) {
HasActionsIF *receiver = ObjectManager::instance()->get<HasActionsIF>(commandTo);
if (receiver == NULL) {
auto *receiver = ObjectManager::instance()->get<HasActionsIF>(commandTo);
if (receiver == nullptr) {
return CommandsActionsIF::OBJECT_HAS_NO_FUNCTIONS;
}
store_address_t storeId;
uint8_t *storePointer;
size_t maxSize = data->getSerializedSize();
ReturnValue_t result = ipcStore->getFreeElement(&storeId, maxSize, &storePointer);
if (result != HasReturnvaluesIF::RETURN_OK) {
if (result != returnvalue::OK) {
return result;
}
size_t size = 0;
result = data->serialize(&storePointer, &size, maxSize, SerializeIF::Endianness::BIG);
if (result != HasReturnvaluesIF::RETURN_OK) {
if (result != returnvalue::OK) {
return result;
}
return sendCommand(receiver->getCommandQueue(), actionId, storeId);
@@ -29,16 +29,13 @@ ReturnValue_t CommandActionHelper::commandAction(object_id_t commandTo, ActionId
ReturnValue_t CommandActionHelper::commandAction(object_id_t commandTo, ActionId_t actionId,
const uint8_t *data, uint32_t size) {
// if (commandCount != 0) {
// return CommandsFunctionsIF::ALREADY_COMMANDING;
// }
HasActionsIF *receiver = ObjectManager::instance()->get<HasActionsIF>(commandTo);
if (receiver == NULL) {
auto *receiver = ObjectManager::instance()->get<HasActionsIF>(commandTo);
if (receiver == nullptr) {
return CommandsActionsIF::OBJECT_HAS_NO_FUNCTIONS;
}
store_address_t storeId;
ReturnValue_t result = ipcStore->addData(&storeId, data, size);
if (result != HasReturnvaluesIF::RETURN_OK) {
if (result != returnvalue::OK) {
return result;
}
return sendCommand(receiver->getCommandQueue(), actionId, storeId);
@@ -49,7 +46,7 @@ ReturnValue_t CommandActionHelper::sendCommand(MessageQueueId_t queueId, ActionI
CommandMessage command;
ActionMessage::setCommand(&command, actionId, storeId);
ReturnValue_t result = queueToUse->sendMessage(queueId, &command);
if (result != HasReturnvaluesIF::RETURN_OK) {
if (result != returnvalue::OK) {
ipcStore->deleteData(storeId);
}
lastTarget = queueId;
@@ -59,55 +56,55 @@ ReturnValue_t CommandActionHelper::sendCommand(MessageQueueId_t queueId, ActionI
ReturnValue_t CommandActionHelper::initialize() {
ipcStore = ObjectManager::instance()->get<StorageManagerIF>(objects::IPC_STORE);
if (ipcStore == NULL) {
return HasReturnvaluesIF::RETURN_FAILED;
if (ipcStore == nullptr) {
return returnvalue::FAILED;
}
queueToUse = owner->getCommandQueuePtr();
if (queueToUse == NULL) {
return HasReturnvaluesIF::RETURN_FAILED;
if (queueToUse == nullptr) {
return returnvalue::FAILED;
}
return HasReturnvaluesIF::RETURN_OK;
return returnvalue::OK;
}
ReturnValue_t CommandActionHelper::handleReply(CommandMessage *reply) {
if (reply->getSender() != lastTarget) {
return HasReturnvaluesIF::RETURN_FAILED;
return returnvalue::FAILED;
}
switch (reply->getCommand()) {
case ActionMessage::COMPLETION_SUCCESS:
commandCount--;
owner->completionSuccessfulReceived(ActionMessage::getActionId(reply));
return HasReturnvaluesIF::RETURN_OK;
return returnvalue::OK;
case ActionMessage::COMPLETION_FAILED:
commandCount--;
owner->completionFailedReceived(ActionMessage::getActionId(reply),
ActionMessage::getReturnCode(reply));
return HasReturnvaluesIF::RETURN_OK;
return returnvalue::OK;
case ActionMessage::STEP_SUCCESS:
owner->stepSuccessfulReceived(ActionMessage::getActionId(reply),
ActionMessage::getStep(reply));
return HasReturnvaluesIF::RETURN_OK;
return returnvalue::OK;
case ActionMessage::STEP_FAILED:
commandCount--;
owner->stepFailedReceived(ActionMessage::getActionId(reply), ActionMessage::getStep(reply),
ActionMessage::getReturnCode(reply));
return HasReturnvaluesIF::RETURN_OK;
return returnvalue::OK;
case ActionMessage::DATA_REPLY:
extractDataForOwner(ActionMessage::getActionId(reply), ActionMessage::getStoreId(reply));
return HasReturnvaluesIF::RETURN_OK;
return returnvalue::OK;
default:
return HasReturnvaluesIF::RETURN_FAILED;
return returnvalue::FAILED;
}
}
uint8_t CommandActionHelper::getCommandCount() const { return commandCount; }
void CommandActionHelper::extractDataForOwner(ActionId_t actionId, store_address_t storeId) {
const uint8_t *data = NULL;
const uint8_t *data = nullptr;
size_t size = 0;
ReturnValue_t result = ipcStore->getData(storeId, &data, &size);
if (result != HasReturnvaluesIF::RETURN_OK) {
if (result != returnvalue::OK) {
return;
}
owner->dataReceived(actionId, data, size);
+3 -3
View File
@@ -4,7 +4,7 @@
#include "ActionMessage.h"
#include "fsfw/ipc/MessageQueueIF.h"
#include "fsfw/objectmanager/ObjectManagerIF.h"
#include "fsfw/returnvalues/HasReturnvaluesIF.h"
#include "fsfw/returnvalues/returnvalue.h"
#include "fsfw/serialize/SerializeIF.h"
#include "fsfw/storagemanager/StorageManagerIF.h"
@@ -14,14 +14,14 @@ class CommandActionHelper {
friend class CommandsActionsIF;
public:
CommandActionHelper(CommandsActionsIF* owner);
explicit CommandActionHelper(CommandsActionsIF* owner);
virtual ~CommandActionHelper();
ReturnValue_t commandAction(object_id_t commandTo, ActionId_t actionId, const uint8_t* data,
uint32_t size);
ReturnValue_t commandAction(object_id_t commandTo, ActionId_t actionId, SerializeIF* data);
ReturnValue_t initialize();
ReturnValue_t handleReply(CommandMessage* reply);
uint8_t getCommandCount() const;
[[nodiscard]] uint8_t getCommandCount() const;
private:
CommandsActionsIF* owner;
+3 -3
View File
@@ -1,9 +1,9 @@
#ifndef FSFW_ACTION_COMMANDSACTIONSIF_H_
#define FSFW_ACTION_COMMANDSACTIONSIF_H_
#include "../ipc/MessageQueueIF.h"
#include "../returnvalues/HasReturnvaluesIF.h"
#include "CommandActionHelper.h"
#include "fsfw/ipc/MessageQueueIF.h"
#include "fsfw/returnvalues/returnvalue.h"
/**
* Interface to separate commanding actions of other objects.
@@ -21,7 +21,7 @@ class CommandsActionsIF {
static const uint8_t INTERFACE_ID = CLASS_ID::COMMANDS_ACTIONS_IF;
static const ReturnValue_t OBJECT_HAS_NO_FUNCTIONS = MAKE_RETURN_CODE(1);
static const ReturnValue_t ALREADY_COMMANDING = MAKE_RETURN_CODE(2);
virtual ~CommandsActionsIF() {}
virtual ~CommandsActionsIF() = default;
virtual MessageQueueIF* getCommandQueuePtr() = 0;
protected:
+5 -5
View File
@@ -1,11 +1,11 @@
#ifndef FSFW_ACTION_HASACTIONSIF_H_
#define FSFW_ACTION_HASACTIONSIF_H_
#include "../ipc/MessageQueueIF.h"
#include "../returnvalues/HasReturnvaluesIF.h"
#include "ActionHelper.h"
#include "ActionMessage.h"
#include "SimpleActionHelper.h"
#include "fsfw/ipc/MessageQueueIF.h"
#include "fsfw/returnvalues/returnvalue.h"
/**
* @brief
@@ -40,12 +40,12 @@ class HasActionsIF {
static const ReturnValue_t INVALID_PARAMETERS = MAKE_RETURN_CODE(2);
static const ReturnValue_t EXECUTION_FINISHED = MAKE_RETURN_CODE(3);
static const ReturnValue_t INVALID_ACTION_ID = MAKE_RETURN_CODE(4);
virtual ~HasActionsIF() {}
virtual ~HasActionsIF() = default;
/**
* Function to get the MessageQueueId_t of the implementing object
* @return MessageQueueId_t of the object
*/
virtual MessageQueueId_t getCommandQueue() const = 0;
[[nodiscard]] virtual MessageQueueId_t getCommandQueue() const = 0;
/**
* Execute or initialize the execution of a certain function.
* The ActionHelpers will execute this function and behave differently
@@ -53,7 +53,7 @@ class HasActionsIF {
*
* @return
* -@c EXECUTION_FINISHED Finish reply will be generated
* -@c Not RETURN_OK Step failure reply will be generated
* -@c Not returnvalue::OK Step failure reply will be generated
*/
virtual ReturnValue_t executeAction(ActionId_t actionId, MessageQueueId_t commandedBy,
const uint8_t* data, size_t size) = 0;
+6 -6
View File
@@ -3,13 +3,13 @@
SimpleActionHelper::SimpleActionHelper(HasActionsIF* setOwner, MessageQueueIF* useThisQueue)
: ActionHelper(setOwner, useThisQueue), isExecuting(false) {}
SimpleActionHelper::~SimpleActionHelper() {}
SimpleActionHelper::~SimpleActionHelper() = default;
void SimpleActionHelper::step(ReturnValue_t result) {
// STEP_OFFESET is subtracted to compensate for adding offset in base
// method, which is not necessary here.
ActionHelper::step(stepCount - STEP_OFFSET, lastCommander, lastAction, result);
if (result != HasReturnvaluesIF::RETURN_OK) {
if (result != returnvalue::OK) {
resetHelper();
}
}
@@ -38,10 +38,10 @@ void SimpleActionHelper::prepareExecution(MessageQueueId_t commandedBy, ActionId
ActionMessage::setStepReply(&reply, actionId, 0, HasActionsIF::IS_BUSY);
queueToUse->sendMessage(commandedBy, &reply);
}
const uint8_t* dataPtr = NULL;
const uint8_t* dataPtr = nullptr;
size_t size = 0;
ReturnValue_t result = ipcStore->getData(dataAddress, &dataPtr, &size);
if (result != HasReturnvaluesIF::RETURN_OK) {
if (result != returnvalue::OK) {
ActionMessage::setStepReply(&reply, actionId, 0, result);
queueToUse->sendMessage(commandedBy, &reply);
return;
@@ -51,12 +51,12 @@ void SimpleActionHelper::prepareExecution(MessageQueueId_t commandedBy, ActionId
result = owner->executeAction(actionId, commandedBy, dataPtr, size);
ipcStore->deleteData(dataAddress);
switch (result) {
case HasReturnvaluesIF::RETURN_OK:
case returnvalue::OK:
isExecuting = true;
stepCount++;
break;
case HasActionsIF::EXECUTION_FINISHED:
ActionMessage::setCompletionReply(&reply, actionId, true, HasReturnvaluesIF::RETURN_OK);
ActionMessage::setCompletionReply(&reply, actionId, true, returnvalue::OK);
queueToUse->sendMessage(commandedBy, &reply);
break;
default:
+6 -6
View File
@@ -11,15 +11,15 @@
class SimpleActionHelper : public ActionHelper {
public:
SimpleActionHelper(HasActionsIF* setOwner, MessageQueueIF* useThisQueue);
virtual ~SimpleActionHelper();
void step(ReturnValue_t result = HasReturnvaluesIF::RETURN_OK);
void finish(ReturnValue_t result = HasReturnvaluesIF::RETURN_OK);
~SimpleActionHelper() override;
void step(ReturnValue_t result = returnvalue::OK);
void finish(ReturnValue_t result = returnvalue::OK);
ReturnValue_t reportData(SerializeIF* data);
protected:
void prepareExecution(MessageQueueId_t commandedBy, ActionId_t actionId,
store_address_t dataAddress);
virtual void resetHelper();
store_address_t dataAddress) override;
void resetHelper() override;
private:
bool isExecuting;
@@ -28,4 +28,4 @@ class SimpleActionHelper : public ActionHelper {
uint8_t stepCount = 0;
};
#endif /* SIMPLEACTIONHELPER_H_ */
#endif /* FSFW_ACTION_SIMPLEACTIONHELPER_H_ */
+11
View File
@@ -0,0 +1,11 @@
#ifndef FSFW_CFDP_H
#define FSFW_CFDP_H
#include "cfdp/definitions.h"
#include "cfdp/handler/DestHandler.h"
#include "cfdp/handler/FaultHandlerBase.h"
#include "cfdp/tlv/Lv.h"
#include "cfdp/tlv/StringLv.h"
#include "cfdp/tlv/Tlv.h"
#endif // FSFW_CFDP_H
-57
View File
@@ -1,57 +0,0 @@
#include "fsfw/cfdp/CFDPHandler.h"
#include "fsfw/cfdp/CFDPMessage.h"
#include "fsfw/ipc/CommandMessage.h"
#include "fsfw/ipc/QueueFactory.h"
#include "fsfw/objectmanager/ObjectManager.h"
#include "fsfw/storagemanager/storeAddress.h"
#include "fsfw/tmtcservices/AcceptsTelemetryIF.h"
object_id_t CFDPHandler::packetSource = 0;
object_id_t CFDPHandler::packetDestination = 0;
CFDPHandler::CFDPHandler(object_id_t setObjectId, CFDPDistributor* dist)
: SystemObject(setObjectId) {
requestQueue = QueueFactory::instance()->createMessageQueue(CFDP_HANDLER_MAX_RECEPTION);
distributor = dist;
}
CFDPHandler::~CFDPHandler() {}
ReturnValue_t CFDPHandler::initialize() {
ReturnValue_t result = SystemObject::initialize();
if (result != RETURN_OK) {
return result;
}
this->distributor->registerHandler(this);
return HasReturnvaluesIF::RETURN_OK;
}
ReturnValue_t CFDPHandler::handleRequest(store_address_t storeId) {
#if FSFW_VERBOSE_LEVEL >= 1
#if FSFW_CPP_OSTREAM_ENABLED == 1
sif::debug << "CFDPHandler::handleRequest" << std::endl;
#else
sif::printDebug("CFDPHandler::handleRequest\n");
#endif /* !FSFW_CPP_OSTREAM_ENABLED == 1 */
#endif
// TODO read out packet from store using storeId
return RETURN_OK;
}
ReturnValue_t CFDPHandler::performOperation(uint8_t opCode) {
ReturnValue_t status = RETURN_OK;
CommandMessage currentMessage;
for (status = this->requestQueue->receiveMessage(&currentMessage); status == RETURN_OK;
status = this->requestQueue->receiveMessage(&currentMessage)) {
store_address_t storeId = CFDPMessage::getStoreId(&currentMessage);
this->handleRequest(storeId);
}
return RETURN_OK;
}
uint16_t CFDPHandler::getIdentifier() { return 0; }
MessageQueueId_t CFDPHandler::getRequestQueue() { return this->requestQueue->getId(); }
-63
View File
@@ -1,63 +0,0 @@
#ifndef FSFW_CFDP_CFDPHANDLER_H_
#define FSFW_CFDP_CFDPHANDLER_H_
#include "fsfw/ipc/MessageQueueIF.h"
#include "fsfw/objectmanager/SystemObject.h"
#include "fsfw/returnvalues/HasReturnvaluesIF.h"
#include "fsfw/tasks/ExecutableObjectIF.h"
#include "fsfw/tcdistribution/CFDPDistributor.h"
#include "fsfw/tmtcservices/AcceptsTelecommandsIF.h"
namespace Factory {
void setStaticFrameworkObjectIds();
}
class CFDPHandler : public ExecutableObjectIF,
public AcceptsTelecommandsIF,
public SystemObject,
public HasReturnvaluesIF {
friend void(Factory::setStaticFrameworkObjectIds)();
public:
CFDPHandler(object_id_t setObjectId, CFDPDistributor* distributor);
/**
* The destructor is empty.
*/
virtual ~CFDPHandler();
virtual ReturnValue_t handleRequest(store_address_t storeId);
virtual ReturnValue_t initialize() override;
virtual uint16_t getIdentifier() override;
MessageQueueId_t getRequestQueue() override;
ReturnValue_t performOperation(uint8_t opCode) override;
protected:
/**
* This is a complete instance of the telecommand reception queue
* of the class. It is initialized on construction of the class.
*/
MessageQueueIF* requestQueue = nullptr;
CFDPDistributor* distributor = nullptr;
/**
* The current CFDP packet to be processed.
* It is deleted after handleRequest was executed.
*/
CFDPPacketStored currentPacket;
static object_id_t packetSource;
static object_id_t packetDestination;
private:
/**
* This constant sets the maximum number of packets accepted per call.
* Remember that one packet must be completely handled in one
* #handleRequest call.
*/
static const uint8_t CFDP_HANDLER_MAX_RECEPTION = 100;
};
#endif /* FSFW_CFDP_CFDPHANDLER_H_ */
-17
View File
@@ -1,17 +0,0 @@
#include "CFDPMessage.h"
CFDPMessage::CFDPMessage() {}
CFDPMessage::~CFDPMessage() {}
void CFDPMessage::setCommand(CommandMessage *message, store_address_t cfdpPacket) {
message->setParameter(cfdpPacket.raw);
}
store_address_t CFDPMessage::getStoreId(const CommandMessage *message) {
store_address_t storeAddressCFDPPacket;
storeAddressCFDPPacket = message->getParameter();
return storeAddressCFDPPacket;
}
void CFDPMessage::clear(CommandMessage *message) {}
+3 -1
View File
@@ -1,4 +1,6 @@
target_sources(${LIB_FSFW_NAME} PRIVATE CFDPHandler.cpp CFDPMessage.cpp)
target_sources(${LIB_FSFW_NAME} PRIVATE CfdpMessage.cpp CfdpDistributor.cpp
VarLenFields.cpp)
add_subdirectory(pdu)
add_subdirectory(tlv)
add_subdirectory(handler)
+54
View File
@@ -0,0 +1,54 @@
#include "CfdpDistributor.h"
#include "fsfw/tcdistribution/definitions.h"
CfdpDistributor::CfdpDistributor(CfdpDistribCfg cfg)
: TcDistributorBase(cfg.objectId, cfg.tcQueue), cfg(cfg) {}
ReturnValue_t CfdpDistributor::registerTcDestination(const cfdp::EntityId& address,
AcceptsTelecommandsIF& tcDest) {
for (const auto& dest : tcDestinations) {
if (dest.id == address) {
return returnvalue::FAILED;
}
}
tcDestinations.emplace_back(address, tcDest.getName(), tcDest.getRequestQueue());
return returnvalue::OK;
}
ReturnValue_t CfdpDistributor::selectDestination(MessageQueueId_t& destId) {
auto accessorPair = cfg.tcStore.getData(currentMessage.getStorageId());
if (accessorPair.first != returnvalue::OK) {
return accessorPair.first;
}
ReturnValue_t result = pduReader.setData(accessorPair.second.data(), accessorPair.second.size());
if (result != returnvalue::OK) {
return result;
}
result = pduReader.parseData();
if (result != returnvalue::OK) {
return result;
}
cfdp::EntityId foundId;
pduReader.getDestId(foundId);
bool destFound = false;
for (const auto& dest : tcDestinations) {
if (dest.id == foundId) {
destId = dest.queueId;
destFound = true;
}
}
if (not destFound) {
// TODO: Warning and event?
return tmtcdistrib::NO_DESTINATION_FOUND;
}
// Packet was forwarded successfully, so do not delete it.
accessorPair.second.release();
return returnvalue::OK;
}
const char* CfdpDistributor::getName() const { return "CFDP Distributor"; }
uint32_t CfdpDistributor::getIdentifier() const { return 0; }
MessageQueueId_t CfdpDistributor::getRequestQueue() const { return tcQueue->getId(); }
+76
View File
@@ -0,0 +1,76 @@
#ifndef FSFW_TCDISTRIBUTION_CFDPDISTRIBUTOR_H_
#define FSFW_TCDISTRIBUTION_CFDPDISTRIBUTOR_H_
#include <utility>
#include <vector>
#include "fsfw/cfdp/pdu/HeaderReader.h"
#include "fsfw/returnvalues/returnvalue.h"
#include "fsfw/tcdistribution/CfdpPacketChecker.h"
#include "fsfw/tcdistribution/TcDistributorBase.h"
#include "fsfw/tmtcpacket/cfdp/CfdpPacketStored.h"
#include "fsfw/tmtcservices/AcceptsTelecommandsIF.h"
#include "fsfw/tmtcservices/VerificationReporter.h"
struct CfdpDistribCfg {
CfdpDistribCfg(object_id_t objectId, StorageManagerIF& tcStore, MessageQueueIF* tcQueue)
: objectId(objectId), tcStore(tcStore), tcQueue(tcQueue) {}
object_id_t objectId;
StorageManagerIF& tcStore;
MessageQueueIF* tcQueue;
};
/**
* This will be the primary component to perform PDU forwading procedures. This includes forwarding
* CFDP TC packets to registered source or destination handlers, and forwarding all telemetry
* generated by them to registered TM sinks.
* @ingroup tc_distribution
*/
class CfdpDistributor : public TcDistributorBase, public AcceptsTelecommandsIF {
public:
/**
* The ctor passes @c set_apid to the checker class and calls the
* TcDistribution ctor with a certain object id.
* @param setApid The APID of this receiving Application.
* @param setObjectId Object ID of the distributor itself
* @param setPacketSource Object ID of the source of TC packets.
* Must implement CcsdsDistributorIF.
*/
explicit CfdpDistributor(CfdpDistribCfg cfg);
[[nodiscard]] const char* getName() const override;
[[nodiscard]] uint32_t getIdentifier() const override;
[[nodiscard]] MessageQueueId_t getRequestQueue() const override;
/**
* Register a new CFDP entity which can receive PDUs.
* @param address
* @param tcDest
* @return
* - @c RETURN_FAILED: Entry already exists for the given address
*/
ReturnValue_t registerTcDestination(const cfdp::EntityId& address, AcceptsTelecommandsIF& tcDest);
protected:
struct EntityInfo {
EntityInfo(cfdp::EntityId id, const char* name, MessageQueueId_t queueId)
: id(std::move(id)), name(name), queueId(queueId) {}
cfdp::EntityId id;
const char* name;
MessageQueueId_t queueId;
};
HeaderReader pduReader;
ReturnValue_t lastTcError = returnvalue::OK;
ReturnValue_t lastTmError = returnvalue::OK;
// I don't think a regular OBSW will have more than 1 or 2 of these destinations, so I think
// it is okay to accept the overhead here
std::vector<EntityInfo> tcDestinations;
CfdpDistribCfg cfg;
ReturnValue_t selectDestination(MessageQueueId_t& destId) override;
private:
};
#endif /* FSFW_TCDISTRIBUTION_CFDPDISTRIBUTOR_H_ */
+54
View File
@@ -0,0 +1,54 @@
//#include "fsfw/cfdp/CfdpHandler.h"
//
//#include "fsfw/cfdp/CfdpMessage.h"
//#include "fsfw/ipc/CommandMessage.h"
//#include "fsfw/ipc/QueueFactory.h"
//#include "fsfw/objectmanager/ObjectManager.h"
//#include "fsfw/storagemanager/storeAddress.h"
//#include "fsfw/tmtcservices/AcceptsTelemetryIF.h"
//
// CfdpHandler::CfdpHandler(object_id_t setObjectId, CfdpHandler* dist)
// : SystemObject(setObjectId) {
// requestQueue = QueueFactory::instance()->createMessageQueue(CFDP_HANDLER_MAX_RECEPTION);
// distributor = dist;
//}
//
// CfdpHandler::~CfdpHandler() = default;
//
// ReturnValue_t CfdpHandler::initialize() {
// ReturnValue_t result = SystemObject::initialize();
// if (result != RETURN_OK) {
// return result;
// }
// this->distributor->registerHandler(this);
// return HasReturnvaluesIF::RETURN_OK;
//}
//
// ReturnValue_t CfdpHandler::handleRequest(store_address_t storeId) {
//#if FSFW_VERBOSE_LEVEL >= 1
//#if FSFW_CPP_OSTREAM_ENABLED == 1
// sif::debug << "CFDPHandler::handleRequest" << std::endl;
//#else
// sif::printDebug("CFDPHandler::handleRequest\n");
//#endif /* !FSFW_CPP_OSTREAM_ENABLED == 1 */
//#endif
//
// // TODO read out packet from store using storeId
//
// return RETURN_OK;
//}
//
// ReturnValue_t CfdpHandler::performOperation(uint8_t opCode) {
// ReturnValue_t status = RETURN_OK;
// CommandMessage currentMessage;
// for (status = this->requestQueue->receiveMessage(&currentMessage); status == RETURN_OK;
// status = this->requestQueue->receiveMessage(&currentMessage)) {
// store_address_t storeId = CfdpMessage::getStoreId(&currentMessage);
// this->handleRequest(storeId);
// }
// return RETURN_OK;
//}
//
// uint32_t CfdpHandler::getIdentifier() const { return 0; }
//
// MessageQueueId_t CfdpHandler::getRequestQueue() const { return this->requestQueue->getId(); }
+63
View File
@@ -0,0 +1,63 @@
//#ifndef FSFW_CFDP_CFDPHANDLER_H_
//#define FSFW_CFDP_CFDPHANDLER_H_
//
//#include "fsfw/ipc/MessageQueueIF.h"
//#include "fsfw/objectmanager/SystemObject.h"
//#include "fsfw/returnvalues/HasReturnvaluesIF.h"
//#include "fsfw/storagemanager/storeAddress.h"
//#include "fsfw/tasks/ExecutableObjectIF.h"
//#include "fsfw/tmtcservices/AcceptsTelecommandsIF.h"
//
// namespace Factory {
// void setStaticFrameworkObjectIds();
//}
//
// class CfdpHandler : public ExecutableObjectIF,
// public AcceptsTelecommandsIF,
// public SystemObject,
// public HasReturnvaluesIF {
// friend void(Factory::setStaticFrameworkObjectIds)();
//
// public:
// CfdpHandler(object_id_t setObjectId, CfdpHandler* distributor);
// /**
// * The destructor is empty.
// */
// virtual ~CfdpHandler();
//
// virtual ReturnValue_t handleRequest(store_address_t storeId);
//
// virtual ReturnValue_t initialize() override;
// virtual uint32_t getIdentifier() const override;
// MessageQueueId_t getRequestQueue() const override;
// ReturnValue_t performOperation(uint8_t opCode) override;
//
// protected:
// /**
// * This is a complete instance of the telecommand reception queue
// * of the class. It is initialized on construction of the class.
// */
// MessageQueueIF* requestQueue = nullptr;
//
// CfdpHandler* distributor = nullptr;
//
// /**
// * The current CFDP packet to be processed.
// * It is deleted after handleRequest was executed.
// */
// CfdpPacketStored currentPacket;
//
// static object_id_t packetSource;
//
// static object_id_t packetDestination;
//
// private:
// /**
// * This constant sets the maximum number of packets accepted per call.
// * Remember that one packet must be completely handled in one
// * #handleRequest call.
// */
// static const uint8_t CFDP_HANDLER_MAX_RECEPTION = 100;
//};
//
//#endif /* FSFW_CFDP_CFDPHANDLER_H_ */
+17
View File
@@ -0,0 +1,17 @@
#include "CfdpMessage.h"
CfdpMessage::CfdpMessage() = default;
CfdpMessage::~CfdpMessage() = default;
void CfdpMessage::setCommand(CommandMessage *message, store_address_t cfdpPacket) {
message->setParameter(cfdpPacket.raw);
}
store_address_t CfdpMessage::getStoreId(const CommandMessage *message) {
store_address_t storeId;
storeId = static_cast<store_address_t>(message->getParameter());
return storeId;
}
void CfdpMessage::clear(CommandMessage *message) {}
@@ -5,14 +5,14 @@
#include "fsfw/objectmanager/ObjectManagerIF.h"
#include "fsfw/storagemanager/StorageManagerIF.h"
class CFDPMessage {
class CfdpMessage {
private:
CFDPMessage();
CfdpMessage();
public:
static const uint8_t MESSAGE_ID = messagetypes::CFDP;
virtual ~CFDPMessage();
virtual ~CfdpMessage();
static void setCommand(CommandMessage* message, store_address_t cfdpPacket);
static store_address_t getStoreId(const CommandMessage* message);
+9 -9
View File
@@ -1,5 +1,5 @@
#ifndef FSFW_SRC_FSFW_CFDP_FILESIZE_H_
#define FSFW_SRC_FSFW_CFDP_FILESIZE_H_
#ifndef FSFW_CFDP_FILESIZE_H_
#define FSFW_CFDP_FILESIZE_H_
#include "fsfw/serialize/SerializeAdapter.h"
#include "fsfw/serialize/SerializeIF.h"
@@ -10,7 +10,7 @@ struct FileSize : public SerializeIF {
public:
FileSize() : largeFile(false){};
FileSize(uint64_t fileSize, bool isLarge = false) { setFileSize(fileSize, isLarge); };
explicit FileSize(uint64_t fileSize, bool isLarge = false) { setFileSize(fileSize, isLarge); };
ReturnValue_t serialize(bool isLarge, uint8_t **buffer, size_t *size, size_t maxSize,
Endianness streamEndianness) {
@@ -27,7 +27,7 @@ struct FileSize : public SerializeIF {
return SerializeAdapter::serialize(&fileSize, buffer, size, maxSize, streamEndianness);
}
size_t getSerializedSize() const override {
[[nodiscard]] size_t getSerializedSize() const override {
if (largeFile) {
return 8;
} else {
@@ -43,7 +43,7 @@ struct FileSize : public SerializeIF {
uint32_t sizeTmp = 0;
ReturnValue_t result =
SerializeAdapter::deSerialize(&sizeTmp, buffer, size, streamEndianness);
if (result == HasReturnvaluesIF::RETURN_OK) {
if (result == returnvalue::OK) {
fileSize = sizeTmp;
}
return result;
@@ -53,14 +53,14 @@ struct FileSize : public SerializeIF {
ReturnValue_t setFileSize(uint64_t fileSize, bool largeFile) {
if (not largeFile and fileSize > UINT32_MAX) {
// TODO: emit warning here
return HasReturnvaluesIF::RETURN_FAILED;
return returnvalue::FAILED;
}
this->fileSize = fileSize;
this->largeFile = largeFile;
return HasReturnvaluesIF::RETURN_OK;
return returnvalue::OK;
}
bool isLargeFile() const { return largeFile; }
[[nodiscard]] bool isLargeFile() const { return largeFile; }
uint64_t getSize(bool *largeFile = nullptr) const {
if (largeFile != nullptr) {
*largeFile = this->largeFile;
@@ -75,4 +75,4 @@ struct FileSize : public SerializeIF {
} // namespace cfdp
#endif /* FSFW_SRC_FSFW_CFDP_FILESIZE_H_ */
#endif /* FSFW_CFDP_FILESIZE_H_ */
@@ -1,12 +1,11 @@
#include "VarLenField.h"
#include "VarLenFields.h"
#include "fsfw/FSFW.h"
#include "fsfw/serialize/SerializeAdapter.h"
#include "fsfw/serviceinterface.h"
cfdp::VarLenField::VarLenField(cfdp::WidthInBytes width, size_t value) : VarLenField() {
ReturnValue_t result = this->setValue(width, value);
if (result != HasReturnvaluesIF::RETURN_OK) {
if (result != returnvalue::OK) {
#if FSFW_DISABLE_PRINTOUT == 0
#if FSFW_CPP_OSTREAM_ENABLED == 1
sif::warning << "cfdp::VarLenField: Setting value failed" << std::endl;
@@ -21,27 +20,27 @@ cfdp::VarLenField::VarLenField() : width(cfdp::WidthInBytes::ONE_BYTE) { value.o
cfdp::WidthInBytes cfdp::VarLenField::getWidth() const { return width; }
ReturnValue_t cfdp::VarLenField::setValue(cfdp::WidthInBytes widthInBytes, size_t value) {
ReturnValue_t cfdp::VarLenField::setValue(cfdp::WidthInBytes widthInBytes, size_t value_) {
switch (widthInBytes) {
case (cfdp::WidthInBytes::ONE_BYTE): {
if (value > UINT8_MAX) {
return HasReturnvaluesIF::RETURN_FAILED;
if (value_ > UINT8_MAX) {
return returnvalue::FAILED;
}
this->value.oneByte = value;
this->value.oneByte = value_;
break;
}
case (cfdp::WidthInBytes::TWO_BYTES): {
if (value > UINT16_MAX) {
return HasReturnvaluesIF::RETURN_FAILED;
if (value_ > UINT16_MAX) {
return returnvalue::FAILED;
}
this->value.twoBytes = value;
this->value.twoBytes = value_;
break;
}
case (cfdp::WidthInBytes::FOUR_BYTES): {
if (value > UINT32_MAX) {
return HasReturnvaluesIF::RETURN_FAILED;
if (value_ > UINT32_MAX) {
return returnvalue::FAILED;
}
this->value.fourBytes = value;
this->value.fourBytes = value_;
break;
}
default: {
@@ -49,7 +48,7 @@ ReturnValue_t cfdp::VarLenField::setValue(cfdp::WidthInBytes widthInBytes, size_
}
}
this->width = widthInBytes;
return HasReturnvaluesIF::RETURN_OK;
return returnvalue::OK;
}
size_t cfdp::VarLenField::getValue() const {
@@ -77,7 +76,7 @@ ReturnValue_t cfdp::VarLenField::serialize(uint8_t **buffer, size_t *size, size_
**buffer = value.oneByte;
*size += 1;
*buffer += 1;
return HasReturnvaluesIF::RETURN_OK;
return returnvalue::OK;
}
case (cfdp::WidthInBytes::TWO_BYTES): {
return SerializeAdapter::serialize(&value.twoBytes, buffer, size, maxSize, streamEndianness);
@@ -86,16 +85,16 @@ ReturnValue_t cfdp::VarLenField::serialize(uint8_t **buffer, size_t *size, size_
return SerializeAdapter::serialize(&value.fourBytes, buffer, size, maxSize, streamEndianness);
}
default: {
return HasReturnvaluesIF::RETURN_FAILED;
return returnvalue::FAILED;
}
}
}
size_t cfdp::VarLenField::getSerializedSize() const { return width; }
ReturnValue_t cfdp::VarLenField::deSerialize(cfdp::WidthInBytes width, const uint8_t **buffer,
ReturnValue_t cfdp::VarLenField::deSerialize(cfdp::WidthInBytes width_, const uint8_t **buffer,
size_t *size, Endianness streamEndianness) {
this->width = width;
this->width = width_;
return deSerialize(buffer, size, streamEndianness);
}
@@ -105,7 +104,7 @@ ReturnValue_t cfdp::VarLenField::deSerialize(const uint8_t **buffer, size_t *siz
case (cfdp::WidthInBytes::ONE_BYTE): {
value.oneByte = **buffer;
*size += 1;
return HasReturnvaluesIF::RETURN_OK;
return returnvalue::OK;
}
case (cfdp::WidthInBytes::TWO_BYTES): {
return SerializeAdapter::deSerialize(&value.twoBytes, buffer, size, streamEndianness);
@@ -114,7 +113,21 @@ ReturnValue_t cfdp::VarLenField::deSerialize(const uint8_t **buffer, size_t *siz
return SerializeAdapter::deSerialize(&value.fourBytes, buffer, size, streamEndianness);
}
default: {
return HasReturnvaluesIF::RETURN_FAILED;
return returnvalue::FAILED;
}
}
}
bool cfdp::VarLenField::operator<(const cfdp::VarLenField &other) const {
if (getWidth() < other.getWidth()) {
return true;
} else if (getWidth() == other.getWidth()) {
return getValue() < other.getValue();
} else {
return false;
}
}
bool cfdp::VarLenField::operator==(const cfdp::VarLenField &other) const {
return getWidth() == other.getWidth() and getValue() == other.getValue();
}
+91
View File
@@ -0,0 +1,91 @@
#ifndef FSFW_CFDP_PDU_VARLENFIELD_H_
#define FSFW_CFDP_PDU_VARLENFIELD_H_
#include <cstddef>
#include <cstdint>
#include <utility>
#include "fsfw/cfdp/definitions.h"
#include "fsfw/serialize/SerializeIF.h"
#include "fsfw/util/UnsignedByteField.h"
namespace cfdp {
class VarLenField : public SerializeIF {
public:
union LengthFieldLen {
uint8_t oneByte;
uint16_t twoBytes;
uint32_t fourBytes;
uint64_t eightBytes;
};
VarLenField();
template <typename T>
explicit VarLenField(UnsignedByteField<T> byteField);
VarLenField(cfdp::WidthInBytes width, size_t value);
bool operator==(const VarLenField &other) const;
bool operator<(const VarLenField &other) const;
ReturnValue_t setValue(cfdp::WidthInBytes, size_t value);
ReturnValue_t serialize(uint8_t **buffer, size_t *size, size_t maxSize,
Endianness streamEndianness) const override;
[[nodiscard]] size_t getSerializedSize() const override;
ReturnValue_t deSerialize(cfdp::WidthInBytes width, const uint8_t **buffer, size_t *size,
Endianness streamEndianness);
[[nodiscard]] cfdp::WidthInBytes getWidth() const;
[[nodiscard]] size_t getValue() const;
private:
ReturnValue_t deSerialize(const uint8_t **buffer, size_t *size,
Endianness streamEndianness) override;
cfdp::WidthInBytes width;
LengthFieldLen value{};
};
template <typename T>
cfdp::VarLenField::VarLenField(UnsignedByteField<T> byteField)
: width(static_cast<cfdp::WidthInBytes>(sizeof(T))) {
static_assert((sizeof(T) % 2) == 0);
setValue(width, byteField.getValue());
}
struct EntityId : public VarLenField {
public:
EntityId() : VarLenField() {}
template <typename T>
explicit EntityId(UnsignedByteField<T> byteField) : VarLenField(byteField) {}
EntityId(cfdp::WidthInBytes width, size_t entityId) : VarLenField(width, entityId) {}
};
struct TransactionSeqNum : public VarLenField {
public:
TransactionSeqNum() : VarLenField() {}
template <typename T>
explicit TransactionSeqNum(UnsignedByteField<T> byteField) : VarLenField(byteField) {}
TransactionSeqNum(cfdp::WidthInBytes width, size_t seqNum) : VarLenField(width, seqNum) {}
};
struct TransactionId {
TransactionId() = default;
TransactionId(EntityId entityId, TransactionSeqNum seqNum)
: entityId(std::move(entityId)), seqNum(std::move(seqNum)) {}
bool operator==(const TransactionId &other) {
return entityId == other.entityId and seqNum == other.seqNum;
}
EntityId entityId;
TransactionSeqNum seqNum;
};
} // namespace cfdp
#endif /* FSFW_CFDP_PDU_VARLENFIELD_H_ */
+32 -24
View File
@@ -7,36 +7,36 @@
#include <cstdint>
#include "fsfw/returnvalues/FwClassIds.h"
#include "fsfw/returnvalues/HasReturnvaluesIF.h"
#include "fsfw/returnvalues/returnvalue.h"
namespace cfdp {
static constexpr uint8_t VERSION_BITS = 0b00100000;
static constexpr char CFDP_VERSION_2_NAME[] = "CCSDS 727.0-B-5";
// Second version of the protocol, only this one is supported here
static constexpr uint8_t CFDP_VERSION_2 = 0b001;
static constexpr uint8_t VERSION_BITS = CFDP_VERSION_2 << 5;
static constexpr uint8_t CFDP_CLASS_ID = CLASS_ID::CFDP;
static constexpr ReturnValue_t INVALID_TLV_TYPE =
HasReturnvaluesIF::makeReturnCode(CFDP_CLASS_ID, 1);
static constexpr ReturnValue_t INVALID_DIRECTIVE_FIELDS =
HasReturnvaluesIF::makeReturnCode(CFDP_CLASS_ID, 2);
static constexpr ReturnValue_t INVALID_PDU_DATAFIELD_LEN =
HasReturnvaluesIF::makeReturnCode(CFDP_CLASS_ID, 3);
static constexpr ReturnValue_t INVALID_TLV_TYPE = returnvalue::makeCode(CFDP_CLASS_ID, 1);
static constexpr ReturnValue_t INVALID_DIRECTIVE_FIELDS = returnvalue::makeCode(CFDP_CLASS_ID, 2);
static constexpr ReturnValue_t INVALID_PDU_DATAFIELD_LEN = returnvalue::makeCode(CFDP_CLASS_ID, 3);
static constexpr ReturnValue_t INVALID_ACK_DIRECTIVE_FIELDS =
HasReturnvaluesIF::makeReturnCode(CFDP_CLASS_ID, 4);
returnvalue::makeCode(CFDP_CLASS_ID, 4);
//! Can not parse options. This can also occur because there are options
//! available but the user did not pass a valid options array
static constexpr ReturnValue_t METADATA_CANT_PARSE_OPTIONS =
HasReturnvaluesIF::makeReturnCode(CFDP_CLASS_ID, 5);
static constexpr ReturnValue_t NAK_CANT_PARSE_OPTIONS =
HasReturnvaluesIF::makeReturnCode(CFDP_CLASS_ID, 6);
returnvalue::makeCode(CFDP_CLASS_ID, 5);
static constexpr ReturnValue_t NAK_CANT_PARSE_OPTIONS = returnvalue::makeCode(CFDP_CLASS_ID, 6);
static constexpr ReturnValue_t FINISHED_CANT_PARSE_FS_RESPONSES =
HasReturnvaluesIF::makeReturnCode(CFDP_CLASS_ID, 6);
returnvalue::makeCode(CFDP_CLASS_ID, 6);
static constexpr ReturnValue_t FILESTORE_REQUIRES_SECOND_FILE =
HasReturnvaluesIF::makeReturnCode(CFDP_CLASS_ID, 8);
returnvalue::makeCode(CFDP_CLASS_ID, 8);
//! Can not parse filestore response because user did not pass a valid instance
//! or remaining size is invalid
static constexpr ReturnValue_t FILESTORE_RESPONSE_CANT_PARSE_FS_MESSAGE =
HasReturnvaluesIF::makeReturnCode(CFDP_CLASS_ID, 9);
returnvalue::makeCode(CFDP_CLASS_ID, 9);
//! Checksum types according to the SANA Checksum Types registry
//! https://sanaregistry.org/r/checksum_identifiers/
@@ -49,17 +49,17 @@ enum ChecksumType {
NULL_CHECKSUM = 15
};
enum PduType : bool { FILE_DIRECTIVE = 0, FILE_DATA = 1 };
enum PduType : uint8_t { FILE_DIRECTIVE = 0, FILE_DATA = 1 };
enum TransmissionModes : bool { ACKNOWLEDGED = 0, UNACKNOWLEDGED = 1 };
enum TransmissionModes : uint8_t { ACKNOWLEDGED = 0, UNACKNOWLEDGED = 1 };
enum SegmentMetadataFlag : bool { NOT_PRESENT = 0, PRESENT = 1 };
enum SegmentMetadataFlag : bool { NOT_PRESENT = false, PRESENT = true };
enum Direction : bool { TOWARDS_RECEIVER = 0, TOWARDS_SENDER = 1 };
enum Direction : uint8_t { TOWARDS_RECEIVER = 0, TOWARDS_SENDER = 1 };
enum SegmentationControl : bool {
NO_RECORD_BOUNDARIES_PRESERVATION = 0,
RECORD_BOUNDARIES_PRESERVATION = 1
NO_RECORD_BOUNDARIES_PRESERVATION = false,
RECORD_BOUNDARIES_PRESERVATION = true
};
enum WidthInBytes : uint8_t {
@@ -97,6 +97,14 @@ enum ConditionCode : uint8_t {
CANCEL_REQUEST_RECEIVED = 0b1111
};
enum FaultHandlerCodes {
RESERVED = 0b0000,
NOTICE_OF_CANCELLATION = 0b0001,
NOTICE_OF_SUSPENSION = 0b0010,
IGNORE_ERROR = 0b0011,
ABANDON_TRANSACTION = 0b0100
};
enum AckTransactionStatus {
UNDEFINED = 0b00,
ACTIVE = 0b01,
@@ -104,16 +112,16 @@ enum AckTransactionStatus {
UNRECOGNIZED = 0b11
};
enum FinishedDeliveryCode { DATA_COMPLETE = 0, DATA_INCOMPLETE = 1 };
enum FileDeliveryCode { DATA_COMPLETE = 0, DATA_INCOMPLETE = 1 };
enum FinishedFileStatus {
enum FileDeliveryStatus {
DISCARDED_DELIBERATELY = 0,
DISCARDED_FILESTORE_REJECTION = 1,
RETAINED_IN_FILESTORE = 2,
FILE_STATUS_UNREPORTED = 3
};
enum PromptResponseRequired : bool { PROMPT_NAK = 0, PROMPT_KEEP_ALIVE = 1 };
enum PromptResponseRequired : uint8_t { PROMPT_NAK = 0, PROMPT_KEEP_ALIVE = 1 };
enum TlvTypes : uint8_t {
FILESTORE_REQUEST = 0x00,
+2
View File
@@ -0,0 +1,2 @@
target_sources(${LIB_FSFW_NAME} PRIVATE SourceHandler.cpp DestHandler.cpp
FaultHandlerBase.cpp UserBase.cpp)
+188
View File
@@ -0,0 +1,188 @@
#include "DestHandler.h"
#include <utility>
#include "fsfw/cfdp/pdu/HeaderReader.h"
#include "fsfw/objectmanager.h"
#include "fsfw/serviceinterface.h"
using namespace returnvalue;
cfdp::DestHandler::DestHandler(DestHandlerParams params, FsfwParams fsfwParams)
: tlvVec(params.maxTlvsInOnePdu),
userTlvVec(params.maxTlvsInOnePdu),
dp(std::move(params)),
fp(fsfwParams),
tp(params.maxFilenameLen) {
tp.pduConf.direction = cfdp::Direction::TOWARDS_SENDER;
}
ReturnValue_t cfdp::DestHandler::performStateMachine() {
if (step == TransactionStep::IDLE) {
ReturnValue_t status = returnvalue::OK;
ReturnValue_t result;
for(auto infoIter = dp.packetListRef.begin(); infoIter != dp.packetListRef.end();) {
if (infoIter->pduType == PduType::FILE_DIRECTIVE and
infoIter->directiveType == FileDirectives::METADATA) {
result = handleMetadataPdu(*infoIter);
if (result != OK) {
status = result;
}
fp.tcStore->deleteData(infoIter->storeId);
dp.packetListRef.erase(infoIter++);
}
}
if (step != TransactionStep::IDLE) {
return CALL_FSM_AGAIN;
}
return status;
}
if (cfdpState == CfdpStates::BUSY_CLASS_1_NACKED) {
for (const auto& info : dp.packetListRef) {
if (info.pduType == PduType::FILE_DATA) {
}
}
return returnvalue::OK;
}
if (cfdpState == CfdpStates::BUSY_CLASS_2_ACKED) {
// TODO: Will be implemented at a later stage
#if FSFW_CPP_OSTREAM_ENABLED == 1
sif::warning << "CFDP state machine for acknowledged mode not implemented yet" << std::endl;
#endif
}
return returnvalue::OK;
}
ReturnValue_t cfdp::DestHandler::passPacket(PacketInfo packet) {
if (dp.packetListRef.full()) {
return returnvalue::FAILED;
}
dp.packetListRef.push_back(packet);
return returnvalue::OK;
}
ReturnValue_t cfdp::DestHandler::initialize() {
if (fp.tmStore == nullptr) {
fp.tmStore = ObjectManager::instance()->get<StorageManagerIF>(objects::TM_STORE);
if (fp.tmStore == nullptr) {
return returnvalue::FAILED;
}
}
if (fp.tcStore == nullptr) {
fp.tcStore = ObjectManager::instance()->get<StorageManagerIF>(objects::TC_STORE);
if (fp.tcStore == nullptr) {
return returnvalue::FAILED;
}
}
return returnvalue::OK;
}
ReturnValue_t cfdp::DestHandler::handleMetadataPdu(const PacketInfo& info) {
// Process metadata PDU
auto constAccessorPair = fp.tcStore->getData(info.storeId);
if (constAccessorPair.first != OK) {
// TODO: This is not a CFDP error. Event and/or warning?
return constAccessorPair.first;
}
cfdp::StringLv sourceFileName;
cfdp::StringLv destFileName;
MetadataInfo metadataInfo(tp.fileSize, sourceFileName, destFileName);
cfdp::Tlv* tlvArrayAsPtr = tlvVec.data();
metadataInfo.setOptionsArray(&tlvArrayAsPtr, std::nullopt, tlvVec.size());
MetadataPduReader reader(constAccessorPair.second.data(), constAccessorPair.second.size(),
metadataInfo);
ReturnValue_t result = reader.parseData();
// TODO: The standard does not really specify what happens if this kind of error happens
// I think it might be a good idea to cache some sort of error code, which
// is translated into a warning and/or event by an upper layer
if (result != OK) {
return handleMetadataParseError(constAccessorPair.second.data(),
constAccessorPair.second.size());
}
return startTransaction(reader, metadataInfo);
}
ReturnValue_t cfdp::DestHandler::handleMetadataParseError(const uint8_t* rawData, size_t maxSize) {
// TODO: try to extract destination ID for error
// TODO: Invalid metadata PDU.
#if FSFW_CPP_OSTREAM_ENABLED == 1
sif::warning << "Parsing Metadata PDU failed with code " << result << std::endl;
#else
#endif
HeaderReader headerReader(rawData, maxSize);
ReturnValue_t result = headerReader.parseData();
if (result != OK) {
// TODO: Now this really should not happen. Warning or error,
// yield or cache appropriate returnvalue
#if FSFW_CPP_OSTREAM_ENABLED == 1
sif::warning << "Parsing Header failed" << std::endl;
#else
#endif
// TODO: Trigger appropriate event
return result;
}
cfdp::EntityId destId;
headerReader.getDestId(destId);
RemoteEntityCfg* remoteCfg;
if (not dp.remoteCfgTable.getRemoteCfg(destId, &remoteCfg)) {
// TODO: No remote config for dest ID. I consider this a configuration error.
// Warning or error, yield or cache appropriate returnvalue
#if FSFW_CPP_OSTREAM_ENABLED == 1
sif::warning << "No remote config exists for destination ID" << std::endl;
#else
#endif
// TODO: Trigger appropriate event
}
// TODO: Appropriate returnvalue?
return returnvalue::FAILED;
}
ReturnValue_t cfdp::DestHandler::startTransaction(MetadataPduReader& reader, MetadataInfo& info) {
if (cfdpState != CfdpStates::IDLE) {
// According to standard, discard metadata PDU if we are busy
return returnvalue::OK;
}
step = TransactionStep::TRANSACTION_START;
if (reader.getTransmissionMode() == TransmissionModes::UNACKNOWLEDGED) {
cfdpState = CfdpStates::BUSY_CLASS_1_NACKED;
} else if (reader.getTransmissionMode() == TransmissionModes::ACKNOWLEDGED) {
cfdpState = CfdpStates::BUSY_CLASS_2_ACKED;
}
tp.checksumType = info.getChecksumType();
tp.closureRequested = info.isClosureRequested();
size_t sourceNameSize = 0;
const uint8_t* sourceNamePtr = info.getSourceFileName().getValue(&sourceNameSize);
if (sourceNameSize > tp.sourceName.size()) {
// TODO: Warning, event etc.
return FAILED;
}
std::memcpy(tp.sourceName.data(), sourceNamePtr, sourceNameSize);
tp.sourceName[sourceNameSize] = '\0';
size_t destNameSize = 0;
const uint8_t* destNamePtr = info.getDestFileName().getValue(&destNameSize);
if (destNameSize > tp.destName.size()) {
// TODO: Warning, event etc.
return FAILED;
}
std::memcpy(tp.destName.data(), destNamePtr, destNameSize);
tp.destName[destNameSize] = '\0';
reader.fillConfig(tp.pduConf);
tp.pduConf.direction = Direction::TOWARDS_SENDER;
tp.transactionId.entityId = tp.pduConf.sourceId;
tp.transactionId.seqNum = tp.pduConf.seqNum;
if (not dp.remoteCfgTable.getRemoteCfg(tp.pduConf.destId, &tp.remoteCfg)) {
// TODO: Warning, event etc.
return FAILED;
}
step = TransactionStep::RECEIVING_FILE_DATA_PDUS;
MetadataRecvdParams params(tp.transactionId, tp.pduConf.sourceId);
params.fileSize = tp.fileSize.getSize();
params.destFileName = tp.destName.data();
params.sourceFileName = tp.sourceName.data();
params.msgsToUserArray = dynamic_cast<MessageToUserTlv*>(userTlvVec.data());
params.msgsToUserLen = info.getOptionsLen();
dp.user.metadataRecvdIndication(params);
return OK;
}
cfdp::CfdpStates cfdp::DestHandler::getCfdpState() const { return cfdpState; }
+120
View File
@@ -0,0 +1,120 @@
#ifndef FSFW_CFDP_CFDPDESTHANDLER_H
#define FSFW_CFDP_CFDPDESTHANDLER_H
#include <etl/list.h>
#include <utility>
#include "RemoteConfigTableIF.h"
#include "UserBase.h"
#include "defs.h"
#include "fsfw/cfdp/handler/mib.h"
#include "fsfw/cfdp/pdu/MetadataPduReader.h"
#include "fsfw/cfdp/pdu/PduConfig.h"
#include "fsfw/container/DynamicFIFO.h"
#include "fsfw/storagemanager/StorageManagerIF.h"
#include "fsfw/storagemanager/storeAddress.h"
#include "fsfw/tmtcservices/AcceptsTelemetryIF.h"
namespace cfdp {
struct PacketInfo {
PacketInfo(PduType type, FileDirectives directive, store_address_t storeId)
: pduType(type), directiveType(directive), storeId(storeId) {}
PduType pduType = PduType::FILE_DATA;
FileDirectives directiveType = FileDirectives::INVALID_DIRECTIVE;
store_address_t storeId = store_address_t::invalid();
PacketInfo() = default;
};
struct DestHandlerParams {
DestHandlerParams(LocalEntityCfg cfg, UserBase& user, RemoteConfigTableIF& remoteCfgTable,
etl::ilist<PacketInfo>& packetList)
: cfg(std::move(cfg)),
user(user),
remoteCfgTable(remoteCfgTable),
packetListRef(packetList) {}
LocalEntityCfg cfg;
UserBase& user;
RemoteConfigTableIF& remoteCfgTable;
etl::ilist<PacketInfo>& packetListRef;
uint8_t maxTlvsInOnePdu = 10;
size_t maxFilenameLen = 255;
};
struct FsfwParams {
FsfwParams(AcceptsTelemetryIF& packetDest, MessageQueueIF& msgQueue,
EventReportingProxyIF& eventReporter)
: packetDest(packetDest), msgQueue(msgQueue), eventReporter(eventReporter) {}
AcceptsTelemetryIF& packetDest;
MessageQueueIF& msgQueue;
EventReportingProxyIF& eventReporter;
StorageManagerIF* tcStore = nullptr;
StorageManagerIF* tmStore = nullptr;
};
class DestHandler {
public:
/**
* Will be returned if it is advisable to call the state machine operation call again
*/
ReturnValue_t CALL_FSM_AGAIN = returnvalue::makeCode(1, 0);
explicit DestHandler(DestHandlerParams handlerParams, FsfwParams fsfwParams);
/**
*
* @return
* - @c returnvalue::OK State machine OK for this execution cycle
* - @c CALL_FSM_AGAIN State machine should be called again.
*/
ReturnValue_t performStateMachine();
ReturnValue_t passPacket(PacketInfo packet);
ReturnValue_t initialize();
ReturnValue_t handleMetadataPdu(const PacketInfo& info);
ReturnValue_t handleMetadataParseError(const uint8_t* rawData, size_t maxSize);
[[nodiscard]] CfdpStates getCfdpState() const;
private:
enum class TransactionStep {
IDLE = 0,
TRANSACTION_START = 1,
RECEIVING_FILE_DATA_PDUS = 2,
SENDING_ACK_PDU = 3,
TRANSFER_COMPLETION = 4,
SENDING_FINISHED_PDU = 5
};
struct TransactionParams {
explicit TransactionParams(size_t maxFileNameLen)
: sourceName(maxFileNameLen), destName(maxFileNameLen) {}
ChecksumType checksumType = ChecksumType::NULL_CHECKSUM;
bool closureRequested{};
std::vector<char> sourceName;
std::vector<char> destName;
cfdp::FileSize fileSize;
TransactionId transactionId;
PduConfig pduConf;
RemoteEntityCfg* remoteCfg = nullptr;
};
TransactionStep step = TransactionStep::IDLE;
CfdpStates cfdpState = CfdpStates::IDLE;
std::vector<cfdp::Tlv> tlvVec;
std::vector<cfdp::Tlv> userTlvVec;
DestHandlerParams dp;
FsfwParams fp;
TransactionParams tp;
ReturnValue_t startTransaction(MetadataPduReader& reader, MetadataInfo& info);
};
} // namespace cfdp
#endif // FSFW_CFDP_CFDPDESTHANDLER_H
@@ -0,0 +1,51 @@
#include "FaultHandlerBase.h"
namespace cfdp {
FaultHandlerBase::FaultHandlerBase() = default;
FaultHandlerBase::~FaultHandlerBase() = default;
bool FaultHandlerBase::getFaultHandler(cfdp::ConditionCode code,
cfdp::FaultHandlerCodes& handler) const {
auto iter = faultHandlerMap.find(code);
if (iter == faultHandlerMap.end()) {
return false;
}
handler = iter->second;
return true;
}
bool FaultHandlerBase::setFaultHandler(cfdp::ConditionCode code, cfdp::FaultHandlerCodes handler) {
if (not faultHandlerMap.contains(code)) {
return false;
}
if (handler != FaultHandlerCodes::NOTICE_OF_SUSPENSION and
handler != FaultHandlerCodes::ABANDON_TRANSACTION and
handler != FaultHandlerCodes::NOTICE_OF_CANCELLATION and
handler != FaultHandlerCodes::IGNORE_ERROR) {
return false;
}
faultHandlerMap[code] = handler;
return true;
}
bool FaultHandlerBase::reportFault(cfdp::ConditionCode code) {
if (not faultHandlerMap.contains(code)) {
return false;
}
cfdp::FaultHandlerCodes fh = faultHandlerMap[code];
if (fh == cfdp::FaultHandlerCodes::IGNORE_ERROR) {
ignoreCb(code);
} else if (fh == cfdp::FaultHandlerCodes::ABANDON_TRANSACTION) {
abandonCb(code);
} else if (fh == cfdp::FaultHandlerCodes::NOTICE_OF_CANCELLATION) {
noticeOfCancellationCb(code);
} else if (fh == cfdp::FaultHandlerCodes::NOTICE_OF_SUSPENSION) {
noticeOfSuspensionCb(code);
} else {
// Should never happen, but use defensive programming
return false;
}
return true;
}
} // namespace cfdp
+76
View File
@@ -0,0 +1,76 @@
#ifndef FSFW_CFDP_FAULTHANDLERBASE_H
#define FSFW_CFDP_FAULTHANDLERBASE_H
#include <etl/flat_map.h>
#include "fsfw/cfdp/definitions.h"
namespace cfdp {
/**
* @brief Provides a way to implement the fault handling procedures as specified
* in chapter 4.8 of the CFDP standard.
*
* @details
* It is passed into the CFDP handlers as part of the local entity configuration and provides
* a way to specify custom user error handlers.
*
* It does so by mapping each applicable CFDP condition code to a fault handler which
* is denoted by the four @cfdp::FaultHandlerCodes. This code is used to dispatch
* to a user-provided callback function:
*
* 1. @FaultHandlerCodes::IGNORE_ERROR -> @ignore_cb
* 2. @FaultHandlerCodes::NOTICE_OF_CANCELLATION` -> @notice_of_cancellation_cb
* 3. @FaultHandlerCodes::NOTICE_OF_SUSPENSION` -> @notice_of_suspension_cb
* 4. @FaultHandlerCodes::ABANDON_TRANSACTION` -> @abandon_transaction_cb
*
* For each error reported by @reportError, the appropriate fault handler callback
* will be called. The user provides the callbacks by providing a custom class which implements
* these base class and all abstract fault handler callbacks.
*/
class FaultHandlerBase {
public:
virtual ~FaultHandlerBase();
FaultHandlerBase();
/**
* Get the fault handler code for the given condition code
* @param code
* @param handler [out] Will be set to the approrpiate handler for the condition code if
* it is valid
* @return
* - true if the condition code is valid
* - false otherwise
*/
bool getFaultHandler(cfdp::ConditionCode code, cfdp::FaultHandlerCodes& handler) const;
bool setFaultHandler(cfdp::ConditionCode code, cfdp::FaultHandlerCodes handler);
bool reportFault(cfdp::ConditionCode code);
virtual void noticeOfSuspensionCb(cfdp::ConditionCode code) = 0;
virtual void noticeOfCancellationCb(cfdp::ConditionCode code) = 0;
virtual void abandonCb(cfdp::ConditionCode code) = 0;
virtual void ignoreCb(cfdp::ConditionCode code) = 0;
private:
etl::flat_map<cfdp::ConditionCode, cfdp::FaultHandlerCodes, 10> faultHandlerMap = {
etl::pair{cfdp::ConditionCode::POSITIVE_ACK_LIMIT_REACHED,
cfdp::FaultHandlerCodes::IGNORE_ERROR},
etl::pair{cfdp::ConditionCode::KEEP_ALIVE_LIMIT_REACHED,
cfdp::FaultHandlerCodes::IGNORE_ERROR},
etl::pair{cfdp::ConditionCode::INVALID_TRANSMISSION_MODE,
cfdp::FaultHandlerCodes::IGNORE_ERROR},
etl::pair{cfdp::ConditionCode::FILE_CHECKSUM_FAILURE, cfdp::FaultHandlerCodes::IGNORE_ERROR},
etl::pair{cfdp::ConditionCode::FILE_SIZE_ERROR, cfdp::FaultHandlerCodes::IGNORE_ERROR},
etl::pair{cfdp::ConditionCode::NAK_LIMIT_REACHED, cfdp::FaultHandlerCodes::IGNORE_ERROR},
etl::pair{cfdp::ConditionCode::INACTIVITY_DETECTED, cfdp::FaultHandlerCodes::IGNORE_ERROR},
etl::pair{cfdp::ConditionCode::UNSUPPORTED_CHECKSUM_TYPE,
cfdp::FaultHandlerCodes::IGNORE_ERROR},
etl::pair{cfdp::ConditionCode::FILESTORE_REJECTION, cfdp::FaultHandlerCodes::IGNORE_ERROR},
etl::pair{cfdp::ConditionCode::CHECK_LIMIT_REACHED, cfdp::FaultHandlerCodes::IGNORE_ERROR}};
};
} // namespace cfdp
#endif // FSFW_CFDP_FAULTHANDLERBASE_H
@@ -0,0 +1,16 @@
#ifndef FSFW_CFDP_HANDLER_REMOTECONFIGTABLEIF_H
#define FSFW_CFDP_HANDLER_REMOTECONFIGTABLEIF_H
#include "fsfw/cfdp/handler/mib.h"
namespace cfdp {
class RemoteConfigTableIF {
public:
virtual ~RemoteConfigTableIF() = default;
virtual bool getRemoteCfg(const cfdp::EntityId& remoteId, cfdp::RemoteEntityCfg** cfg) = 0;
};
} // namespace cfdp
#endif // FSFW_CFDP_HANDLER_REMOTECONFIGTABLEIF_H
+1
View File
@@ -0,0 +1 @@
#include "SourceHandler.h"
+6
View File
@@ -0,0 +1,6 @@
#ifndef FSFW_CFDP_CFDPSOURCEHANDLER_H
#define FSFW_CFDP_CFDPSOURCEHANDLER_H
class SourceHandler {};
#endif // FSFW_CFDP_CFDPSOURCEHANDLER_H
+12
View File
@@ -0,0 +1,12 @@
#ifndef FSFW_CFDP_HANDLER_STATUSREPORTIF_H
#define FSFW_CFDP_HANDLER_STATUSREPORTIF_H
namespace cfdp {
class StatusReportIF {
virtual ~StatusReportIF() = default;
};
} // namespace cfdp
#endif // FSFW_CFDP_HANDLER_STATUSREPORTIF_H
+3
View File
@@ -0,0 +1,3 @@
#include "UserBase.h"
cfdp::UserBase::UserBase(HasFileSystemIF& vfs) : vfs(vfs) {}
+99
View File
@@ -0,0 +1,99 @@
#ifndef FSFW_CFDP_USERBASE_H
#define FSFW_CFDP_USERBASE_H
#include <optional>
#include <utility>
#include <vector>
#include "StatusReportIF.h"
#include "fsfw/cfdp/VarLenFields.h"
#include "fsfw/cfdp/tlv/FilestoreResponseTlv.h"
#include "fsfw/cfdp/tlv/MessageToUserTlv.h"
#include "fsfw/filesystem/HasFileSystemIF.h"
namespace cfdp {
struct TransactionFinishedParams {
TransactionFinishedParams(TransactionId id, ConditionCode code, FileDeliveryStatus status,
FileDeliveryCode delivCode)
: id(std::move(id)), condCode(code), status(status), deliveryCode(delivCode) {}
TransactionId id;
ConditionCode condCode;
FileDeliveryStatus status;
FileDeliveryCode deliveryCode;
std::vector<FilestoreResponseTlv*> fsResponses;
StatusReportIF* statusReport = nullptr;
};
struct MetadataRecvdParams {
MetadataRecvdParams(const TransactionId& id, const EntityId& sourceId)
: id(id), sourceId(sourceId) {}
const TransactionId& id;
const EntityId& sourceId;
uint64_t fileSize = 0;
const char* sourceFileName = "";
const char* destFileName = "";
size_t msgsToUserLen = 0;
const MessageToUserTlv* msgsToUserArray = nullptr;
};
struct FileSegmentRecvdParams {
TransactionId id;
size_t offset;
size_t length;
std::optional<RecordContinuationState> recContState = std::nullopt;
std::pair<const uint8_t*, size_t> segmentMetadata;
};
/**
* @brief Base class which provides a user interface to interact with CFDP handlers.
*
* @details
* This class is also used to pass the Virtual Filestore (VFS) Implementation to the CFDP
* handlers so the filestore operations can be mapped to the underlying filestore.
*
* It is used by implementing it in a child class and then passing it to the CFDP
* handler objects. The base class provides default implementation for the user indication
* primitives specified in the CFDP standard. The user can override these implementations
* to provide custom indication handlers.
*
* Please note that for all indication callbacks, the passed transaction ID reference will
* become invalid shortly after the function has been executed. If the transaction ID is to be
* cached or used, create an own copy of it.
* @param vfs Virtual Filestore Object. Will be used for all file operations
*/
class UserBase {
public:
explicit UserBase(HasFileSystemIF& vfs);
virtual void transactionIndication(const TransactionId& id) = 0;
virtual void eofSentIndication(const TransactionId& id) = 0;
virtual void transactionFinishedIndication(const TransactionFinishedParams& params) = 0;
/**
* Will be called if metadata was received.
*
* IMPORTANT: The passed struct contains the messages to the user in form of a raw C array.
* The TLVs in these arrays are zero-copy types, which means that they point to the raw data
* inside the metadata packet directly. The metadata packet will be deleted from the TC store
* shortly after it was processed. If some of the data is to be cached and/or used after the
* function call, it needs to be copied into another user-provided buffer.
* @param params
*/
virtual void metadataRecvdIndication(const MetadataRecvdParams& params) = 0;
virtual void fileSegmentRecvdIndication(const FileSegmentRecvdParams& params) = 0;
virtual void reportIndication(const TransactionId& id, StatusReportIF& report) = 0;
virtual void suspendedIndication(const TransactionId& id, ConditionCode code) = 0;
virtual void resumedIndication(const TransactionId& id, size_t progress) = 0;
virtual void faultIndication(const TransactionId& id, ConditionCode code, size_t progress) = 0;
virtual void abandonedIndication(const TransactionId& id, ConditionCode code,
size_t progress) = 0;
virtual void eofRecvIndication(const TransactionId& id) = 0;
private:
HasFileSystemIF& vfs;
};
} // namespace cfdp
#endif // FSFW_CFDP_USERBASE_H
+9
View File
@@ -0,0 +1,9 @@
#ifndef FSFW_CFDP_HANDLER_DEFS_H
#define FSFW_CFDP_HANDLER_DEFS_H
namespace cfdp {
enum class CfdpStates { IDLE, BUSY_CLASS_1_NACKED, BUSY_CLASS_2_ACKED, SUSPENDED };
}
#endif // FSFW_CFDP_HANDLER_DEFS_H
+41
View File
@@ -0,0 +1,41 @@
#ifndef FSFW_CFDP_MIB_H
#define FSFW_CFDP_MIB_H
#include <utility>
#include "FaultHandlerBase.h"
#include "fsfw/cfdp/pdu/PduConfig.h"
namespace cfdp {
struct IndicationCfg {
bool eofSentIndicRequired = true;
bool eofRecvIndicRequired = true;
bool fileSegmentRecvIndicRequired = true;
bool transactionFinishedIndicRequired = true;
bool suspendedIndicRequired = true;
bool resumedIndicRequired = true;
};
struct LocalEntityCfg {
LocalEntityCfg(EntityId localId, IndicationCfg indicationCfg, FaultHandlerBase& fhBase)
: localId(std::move(localId)), indicCfg(indicationCfg), fhBase(fhBase) {}
EntityId localId;
IndicationCfg indicCfg;
FaultHandlerBase& fhBase;
};
struct RemoteEntityCfg {
EntityId remoteId;
size_t maxFileSegmentLen = 2048;
bool closureRequested = false;
bool crcOnTransmission = false;
TransmissionModes defaultTransmissionMode = TransmissionModes::UNACKNOWLEDGED;
ChecksumType defaultChecksum = ChecksumType::NULL_CHECKSUM;
const uint8_t version = CFDP_VERSION_2;
};
} // namespace cfdp
#endif // FSFW_CFDP_MIB_H
+6 -6
View File
@@ -1,21 +1,21 @@
#include "AckPduDeserializer.h"
AckPduDeserializer::AckPduDeserializer(const uint8_t* pduBuf, size_t maxSize, AckInfo& info)
: FileDirectiveDeserializer(pduBuf, maxSize), info(info) {}
: FileDirectiveReader(pduBuf, maxSize), info(info) {}
ReturnValue_t AckPduDeserializer::parseData() {
ReturnValue_t result = FileDirectiveDeserializer::parseData();
if (result != HasReturnvaluesIF::RETURN_OK) {
ReturnValue_t result = FileDirectiveReader::parseData();
if (result != returnvalue::OK) {
return result;
}
size_t currentIdx = FileDirectiveDeserializer::getHeaderSize();
size_t currentIdx = FileDirectiveReader::getHeaderSize();
if (currentIdx + 2 > this->maxSize) {
return SerializeIF::BUFFER_TOO_SHORT;
}
if (not checkAndSetCodes(rawPtr[currentIdx], rawPtr[currentIdx + 1])) {
if (not checkAndSetCodes(pointers.rawPtr[currentIdx], pointers.rawPtr[currentIdx + 1])) {
return cfdp::INVALID_ACK_DIRECTIVE_FIELDS;
}
return HasReturnvaluesIF::RETURN_OK;
return returnvalue::OK;
}
bool AckPduDeserializer::checkAndSetCodes(uint8_t firstByte, uint8_t secondByte) {
+2 -2
View File
@@ -2,9 +2,9 @@
#define FSFW_SRC_FSFW_CFDP_PDU_ACKPDUDESERIALIZER_H_
#include "AckInfo.h"
#include "fsfw/cfdp/pdu/FileDirectiveDeserializer.h"
#include "fsfw/cfdp/pdu/FileDirectiveReader.h"
class AckPduDeserializer : public FileDirectiveDeserializer {
class AckPduDeserializer : public FileDirectiveReader {
public:
AckPduDeserializer(const uint8_t* pduBuf, size_t maxSize, AckInfo& info);
+6 -7
View File
@@ -1,17 +1,16 @@
#include "AckPduSerializer.h"
AckPduSerializer::AckPduSerializer(AckInfo &ackInfo, PduConfig &pduConf)
: FileDirectiveSerializer(pduConf, cfdp::FileDirectives::ACK, 2), ackInfo(ackInfo) {}
: FileDirectiveCreator(pduConf, cfdp::FileDirectives::ACK, 2), ackInfo(ackInfo) {}
size_t AckPduSerializer::getSerializedSize() const {
return FileDirectiveSerializer::getWholePduSize();
return FileDirectiveCreator::getWholePduSize();
}
ReturnValue_t AckPduSerializer::serialize(uint8_t **buffer, size_t *size, size_t maxSize,
Endianness streamEndianness) const {
ReturnValue_t result =
FileDirectiveSerializer::serialize(buffer, size, maxSize, streamEndianness);
if (result != HasReturnvaluesIF::RETURN_OK) {
ReturnValue_t result = FileDirectiveCreator::serialize(buffer, size, maxSize, streamEndianness);
if (result != returnvalue::OK) {
return result;
}
cfdp::FileDirectives ackedDirective = ackInfo.getAckedDirective();
@@ -21,7 +20,7 @@ ReturnValue_t AckPduSerializer::serialize(uint8_t **buffer, size_t *size, size_t
if (ackedDirective != cfdp::FileDirectives::FINISH and
ackedDirective != cfdp::FileDirectives::EOF_DIRECTIVE) {
// TODO: better returncode
return HasReturnvaluesIF::RETURN_FAILED;
return returnvalue::FAILED;
}
if (*size + 2 > maxSize) {
return SerializeIF::BUFFER_TOO_SHORT;
@@ -32,5 +31,5 @@ ReturnValue_t AckPduSerializer::serialize(uint8_t **buffer, size_t *size, size_t
**buffer = ackedConditionCode << 4 | transactionStatus;
*buffer += 1;
*size += 1;
return HasReturnvaluesIF::RETURN_OK;
return returnvalue::OK;
}
+3 -3
View File
@@ -2,10 +2,10 @@
#define FSFW_SRC_FSFW_CFDP_PDU_ACKPDUSERIALIZER_H_
#include "AckInfo.h"
#include "FileDirectiveDeserializer.h"
#include "FileDirectiveSerializer.h"
#include "FileDirectiveCreator.h"
#include "FileDirectiveReader.h"
class AckPduSerializer : public FileDirectiveSerializer {
class AckPduSerializer : public FileDirectiveCreator {
public:
/**
* @brief Serializer to pack ACK PDUs
+8 -9
View File
@@ -1,11 +1,10 @@
target_sources(
${LIB_FSFW_NAME}
PRIVATE PduConfig.cpp
VarLenField.cpp
HeaderSerializer.cpp
HeaderDeserializer.cpp
FileDirectiveDeserializer.cpp
FileDirectiveSerializer.cpp
HeaderCreator.cpp
HeaderReader.cpp
FileDirectiveReader.cpp
FileDirectiveCreator.cpp
AckInfo.cpp
AckPduSerializer.cpp
AckPduDeserializer.cpp
@@ -19,12 +18,12 @@ target_sources(
FinishedPduSerializer.cpp
FinishedPduDeserializer.cpp
MetadataInfo.cpp
MetadataPduSerializer.cpp
MetadataPduDeserializer.cpp
MetadataPduCreator.cpp
MetadataPduReader.cpp
KeepAlivePduSerializer.cpp
KeepAlivePduDeserializer.cpp
PromptPduSerializer.cpp
PromptPduDeserializer.cpp
FileDataSerializer.cpp
FileDataDeserializer.cpp
FileDataCreator.cpp
FileDataReader.cpp
FileDataInfo.cpp)
+8 -8
View File
@@ -4,20 +4,20 @@
#include "fsfw/serviceinterface.h"
EofPduDeserializer::EofPduDeserializer(const uint8_t* pduBuf, size_t maxSize, EofInfo& eofInfo)
: FileDirectiveDeserializer(pduBuf, maxSize), info(eofInfo) {}
: FileDirectiveReader(pduBuf, maxSize), info(eofInfo) {}
ReturnValue_t EofPduDeserializer::parseData() {
ReturnValue_t result = FileDirectiveDeserializer::parseData();
if (result != HasReturnvaluesIF::RETURN_OK) {
ReturnValue_t result = FileDirectiveReader::parseData();
if (result != returnvalue::OK) {
return result;
}
const uint8_t* bufPtr = rawPtr;
const uint8_t* bufPtr = pointers.rawPtr;
size_t expectedFileFieldLen = 4;
if (this->getLargeFileFlag()) {
expectedFileFieldLen = 8;
}
size_t currentIdx = FileDirectiveDeserializer::getHeaderSize();
size_t currentIdx = FileDirectiveReader::getHeaderSize();
size_t deserLen = maxSize;
if (maxSize < currentIdx + 5 + expectedFileFieldLen) {
return SerializeIF::STREAM_TOO_SHORT;
@@ -31,7 +31,7 @@ ReturnValue_t EofPduDeserializer::parseData() {
uint32_t checksum = 0;
auto endianness = getEndianness();
result = SerializeAdapter::deSerialize(&checksum, &bufPtr, &deserLen, endianness);
if (result != HasReturnvaluesIF::RETURN_OK) {
if (result != returnvalue::OK) {
return result;
}
info.setChecksum(checksum);
@@ -44,7 +44,7 @@ ReturnValue_t EofPduDeserializer::parseData() {
result = SerializeAdapter::deSerialize(&fileSizeValue, &bufPtr, &deserLen, endianness);
info.setFileSize(fileSizeValue, false);
}
if (result != HasReturnvaluesIF::RETURN_OK) {
if (result != returnvalue::OK) {
return result;
}
if (info.getConditionCode() != cfdp::ConditionCode::NO_ERROR) {
@@ -61,7 +61,7 @@ ReturnValue_t EofPduDeserializer::parseData() {
" given TLV pointer invalid");
#endif
#endif /* FSFW_VERBOSE_LEVEL >= 1 */
return HasReturnvaluesIF::RETURN_FAILED;
return returnvalue::FAILED;
}
result = tlvPtr->deSerialize(&bufPtr, &deserLen, endianness);
}
+2 -2
View File
@@ -2,9 +2,9 @@
#define FSFW_SRC_FSFW_CFDP_PDU_EOFPDUDESERIALIZER_H_
#include "EofInfo.h"
#include "fsfw/cfdp/pdu/FileDirectiveDeserializer.h"
#include "fsfw/cfdp/pdu/FileDirectiveReader.h"
class EofPduDeserializer : public FileDirectiveDeserializer {
class EofPduDeserializer : public FileDirectiveReader {
public:
EofPduDeserializer(const uint8_t* pduBuf, size_t maxSize, EofInfo& eofInfo);
+5 -6
View File
@@ -4,19 +4,18 @@
#include "fsfw/serviceinterface.h"
EofPduSerializer::EofPduSerializer(PduConfig &conf, EofInfo &info)
: FileDirectiveSerializer(conf, cfdp::FileDirectives::EOF_DIRECTIVE, 9), info(info) {
: FileDirectiveCreator(conf, cfdp::FileDirectives::EOF_DIRECTIVE, 9), info(info) {
setDirectiveDataFieldLen(info.getSerializedSize(getLargeFileFlag()));
}
size_t EofPduSerializer::getSerializedSize() const {
return FileDirectiveSerializer::getWholePduSize();
return FileDirectiveCreator::getWholePduSize();
}
ReturnValue_t EofPduSerializer::serialize(uint8_t **buffer, size_t *size, size_t maxSize,
Endianness streamEndianness) const {
ReturnValue_t result =
FileDirectiveSerializer::serialize(buffer, size, maxSize, streamEndianness);
if (result != HasReturnvaluesIF::RETURN_OK) {
ReturnValue_t result = FileDirectiveCreator::serialize(buffer, size, maxSize, streamEndianness);
if (result != returnvalue::OK) {
return result;
}
if (*size + 1 > maxSize) {
@@ -27,7 +26,7 @@ ReturnValue_t EofPduSerializer::serialize(uint8_t **buffer, size_t *size, size_t
*size += 1;
uint32_t checksum = info.getChecksum();
result = SerializeAdapter::serialize(&checksum, buffer, size, maxSize, streamEndianness);
if (result != HasReturnvaluesIF::RETURN_OK) {
if (result != returnvalue::OK) {
return result;
}
if (info.getFileSize().isLargeFile()) {
+2 -2
View File
@@ -2,10 +2,10 @@
#define FSFW_SRC_FSFW_CFDP_PDU_EOFPDUSERIALIZER_H_
#include "EofInfo.h"
#include "fsfw/cfdp/pdu/FileDirectiveSerializer.h"
#include "fsfw/cfdp/pdu/FileDirectiveCreator.h"
#include "fsfw/cfdp/tlv/EntityIdTlv.h"
class EofPduSerializer : public FileDirectiveSerializer {
class EofPduSerializer : public FileDirectiveCreator {
public:
EofPduSerializer(PduConfig& conf, EofInfo& info);
@@ -1,23 +1,22 @@
#include "FileDataSerializer.h"
#include "FileDataCreator.h"
#include <cstring>
FileDataSerializer::FileDataSerializer(PduConfig& conf, FileDataInfo& info)
: HeaderSerializer(conf, cfdp::PduType::FILE_DATA, 0, info.getSegmentMetadataFlag()),
info(info) {
FileDataCreator::FileDataCreator(PduConfig& conf, FileDataInfo& info)
: HeaderCreator(conf, cfdp::PduType::FILE_DATA, 0, info.getSegmentMetadataFlag()), info(info) {
update();
}
void FileDataSerializer::update() {
void FileDataCreator::update() {
this->setSegmentMetadataFlag(info.getSegmentMetadataFlag());
this->setSegmentationControl(info.getSegmentationControl());
setPduDataFieldLen(info.getSerializedSize(this->getLargeFileFlag()));
}
ReturnValue_t FileDataSerializer::serialize(uint8_t** buffer, size_t* size, size_t maxSize,
Endianness streamEndianness) const {
ReturnValue_t result = HeaderSerializer::serialize(buffer, size, maxSize, streamEndianness);
if (result != HasReturnvaluesIF::RETURN_OK) {
ReturnValue_t FileDataCreator::serialize(uint8_t** buffer, size_t* size, size_t maxSize,
Endianness streamEndianness) const {
ReturnValue_t result = HeaderCreator::serialize(buffer, size, maxSize, streamEndianness);
if (result != returnvalue::OK) {
return result;
}
if (*size + this->getSerializedSize() > maxSize) {
@@ -36,7 +35,7 @@ ReturnValue_t FileDataSerializer::serialize(uint8_t** buffer, size_t* size, size
}
cfdp::FileSize& offset = info.getOffset();
result = offset.serialize(this->getLargeFileFlag(), buffer, size, maxSize, streamEndianness);
if (result != HasReturnvaluesIF::RETURN_OK) {
if (result != returnvalue::OK) {
return result;
}
size_t fileSize = 0;
@@ -47,9 +46,9 @@ ReturnValue_t FileDataSerializer::serialize(uint8_t** buffer, size_t* size, size
std::memcpy(*buffer, readOnlyPtr, fileSize);
*buffer += fileSize;
*size += fileSize;
return HasReturnvaluesIF::RETURN_OK;
return returnvalue::OK;
}
size_t FileDataSerializer::getSerializedSize() const {
return HeaderSerializer::getSerializedSize() + info.getSerializedSize(this->getLargeFileFlag());
size_t FileDataCreator::getSerializedSize() const {
return HeaderCreator::getSerializedSize() + info.getSerializedSize(this->getLargeFileFlag());
}
+23
View File
@@ -0,0 +1,23 @@
#ifndef FSFW_CFDP_PDU_FILEDATASERIALIZER_H_
#define FSFW_CFDP_PDU_FILEDATASERIALIZER_H_
#include "../definitions.h"
#include "FileDataInfo.h"
#include "HeaderCreator.h"
class FileDataCreator : public HeaderCreator {
public:
FileDataCreator(PduConfig& conf, FileDataInfo& info);
void update();
ReturnValue_t serialize(uint8_t** buffer, size_t* size, size_t maxSize,
Endianness streamEndianness) const override;
[[nodiscard]] size_t getSerializedSize() const override;
private:
FileDataInfo& info;
};
#endif /* FSFW_CFDP_PDU_FILEDATASERIALIZER_H_ */
@@ -1,48 +0,0 @@
#include "FileDataDeserializer.h"
FileDataDeserializer::FileDataDeserializer(const uint8_t* pduBuf, size_t maxSize,
FileDataInfo& info)
: HeaderDeserializer(pduBuf, maxSize), info(info) {}
ReturnValue_t FileDataDeserializer::parseData() {
ReturnValue_t result = HeaderDeserializer::parseData();
if (result != HasReturnvaluesIF::RETURN_OK) {
return result;
}
size_t currentIdx = HeaderDeserializer::getHeaderSize();
const uint8_t* buf = rawPtr + currentIdx;
size_t remSize = HeaderDeserializer::getWholePduSize() - currentIdx;
if (remSize < 1) {
return SerializeIF::STREAM_TOO_SHORT;
}
if (hasSegmentMetadataFlag()) {
info.setSegmentMetadataFlag(true);
info.setRecordContinuationState(static_cast<cfdp::RecordContinuationState>((*buf >> 6) & 0b11));
size_t segmentMetadataLen = *buf & 0b00111111;
info.setSegmentMetadataLen(segmentMetadataLen);
if (remSize < segmentMetadataLen + 1) {
return SerializeIF::STREAM_TOO_SHORT;
}
if (segmentMetadataLen > 0) {
buf += 1;
remSize -= 1;
info.setSegmentMetadata(buf);
buf += segmentMetadataLen;
remSize -= segmentMetadataLen;
}
}
result = info.getOffset().deSerialize(&buf, &remSize, this->getEndianness());
if (result != HasReturnvaluesIF::RETURN_OK) {
return result;
}
if (remSize > 0) {
info.setFileData(buf, remSize);
}
return HasReturnvaluesIF::RETURN_OK;
}
SerializeIF::Endianness FileDataDeserializer::getEndianness() const { return endianness; }
void FileDataDeserializer::setEndianness(SerializeIF::Endianness endianness) {
this->endianness = endianness;
}
+2 -2
View File
@@ -50,11 +50,11 @@ ReturnValue_t FileDataInfo::addSegmentMetadataInfo(cfdp::RecordContinuationState
this->segmentMetadataFlag = cfdp::SegmentMetadataFlag::PRESENT;
this->recContState = recContState;
if (segmentMetadataLen > 63) {
return HasReturnvaluesIF::RETURN_FAILED;
return returnvalue::FAILED;
}
this->segmentMetadata = segmentMetadata;
this->segmentMetadataLen = segmentMetadataLen;
return HasReturnvaluesIF::RETURN_OK;
return returnvalue::OK;
}
const uint8_t *FileDataInfo::getFileData(size_t *fileSize) const {
+47
View File
@@ -0,0 +1,47 @@
#include "FileDataReader.h"
FileDataReader::FileDataReader(const uint8_t* pduBuf, size_t maxSize, FileDataInfo& info)
: HeaderReader(pduBuf, maxSize), info(info) {}
ReturnValue_t FileDataReader::parseData() {
ReturnValue_t result = HeaderReader::parseData();
if (result != returnvalue::OK) {
return result;
}
size_t currentIdx = HeaderReader::getHeaderSize();
const uint8_t* buf = pointers.rawPtr + currentIdx;
size_t remSize = HeaderReader::getWholePduSize() - currentIdx;
if (remSize < 1) {
return SerializeIF::STREAM_TOO_SHORT;
}
if (hasSegmentMetadataFlag()) {
info.setSegmentMetadataFlag(true);
info.setRecordContinuationState(static_cast<cfdp::RecordContinuationState>((*buf >> 6) & 0b11));
size_t segmentMetadataLen = *buf & 0b00111111;
info.setSegmentMetadataLen(segmentMetadataLen);
if (remSize < segmentMetadataLen + 1) {
return SerializeIF::STREAM_TOO_SHORT;
}
if (segmentMetadataLen > 0) {
buf += 1;
remSize -= 1;
info.setSegmentMetadata(buf);
buf += segmentMetadataLen;
remSize -= segmentMetadataLen;
}
}
result = info.getOffset().deSerialize(&buf, &remSize, this->getEndianness());
if (result != returnvalue::OK) {
return result;
}
if (remSize > 0) {
info.setFileData(buf, remSize);
}
return returnvalue::OK;
}
SerializeIF::Endianness FileDataReader::getEndianness() const { return endianness; }
void FileDataReader::setEndianness(SerializeIF::Endianness endianness_) {
endianness = endianness_;
}
@@ -3,14 +3,14 @@
#include "../definitions.h"
#include "FileDataInfo.h"
#include "HeaderDeserializer.h"
#include "HeaderReader.h"
class FileDataDeserializer : public HeaderDeserializer {
class FileDataReader : public HeaderReader {
public:
FileDataDeserializer(const uint8_t* pduBuf, size_t maxSize, FileDataInfo& info);
FileDataReader(const uint8_t* pduBuf, size_t maxSize, FileDataInfo& info);
ReturnValue_t parseData();
SerializeIF::Endianness getEndianness() const;
ReturnValue_t parseData() override;
[[nodiscard]] SerializeIF::Endianness getEndianness() const;
void setEndianness(SerializeIF::Endianness endianness = SerializeIF::Endianness::NETWORK);
private:
-23
View File
@@ -1,23 +0,0 @@
#ifndef FSFW_SRC_FSFW_CFDP_PDU_FILEDATASERIALIZER_H_
#define FSFW_SRC_FSFW_CFDP_PDU_FILEDATASERIALIZER_H_
#include "../definitions.h"
#include "FileDataInfo.h"
#include "HeaderSerializer.h"
class FileDataSerializer : public HeaderSerializer {
public:
FileDataSerializer(PduConfig& conf, FileDataInfo& info);
void update();
ReturnValue_t serialize(uint8_t** buffer, size_t* size, size_t maxSize,
Endianness streamEndianness) const override;
size_t getSerializedSize() const override;
private:
FileDataInfo& info;
};
#endif /* FSFW_SRC_FSFW_CFDP_PDU_FILEDATADESERIALIZER_H_ */
@@ -0,0 +1,37 @@
#include "FileDirectiveCreator.h"
FileDirectiveCreator::FileDirectiveCreator(PduConfig &pduConf, cfdp::FileDirectives directiveCode,
size_t directiveParamFieldLen)
: HeaderCreator(pduConf, cfdp::PduType::FILE_DIRECTIVE, directiveParamFieldLen + 1),
directiveCode(directiveCode) {}
size_t FileDirectiveCreator::getSerializedSize() const {
return HeaderCreator::getSerializedSize() + 1;
}
ReturnValue_t FileDirectiveCreator::serialize(uint8_t **buffer, size_t *size, size_t maxSize,
Endianness streamEndianness) const {
if (buffer == nullptr or size == nullptr) {
return returnvalue::FAILED;
}
if (FileDirectiveCreator::getWholePduSize() > maxSize) {
return BUFFER_TOO_SHORT;
}
ReturnValue_t result = HeaderCreator::serialize(buffer, size, maxSize, streamEndianness);
if (result != returnvalue::OK) {
return result;
}
if (*size >= maxSize) {
return BUFFER_TOO_SHORT;
}
**buffer = directiveCode;
*buffer += 1;
*size += 1;
return returnvalue::OK;
}
void FileDirectiveCreator::setDirectiveDataFieldLen(size_t len) {
// Set length of data field plus 1 byte for the directive octet
HeaderCreator::setPduDataFieldLen(len + 1);
}
@@ -1,20 +1,20 @@
#ifndef FSFW_SRC_FSFW_CFDP_PDU_FILEDIRECTIVESERIALIZER_H_
#define FSFW_SRC_FSFW_CFDP_PDU_FILEDIRECTIVESERIALIZER_H_
#include "fsfw/cfdp/pdu/HeaderSerializer.h"
#include "fsfw/cfdp/pdu/HeaderCreator.h"
class FileDirectiveSerializer : public HeaderSerializer {
class FileDirectiveCreator : public HeaderCreator {
public:
FileDirectiveSerializer(PduConfig& pduConf, cfdp::FileDirectives directiveCode,
size_t directiveParamFieldLen);
FileDirectiveCreator(PduConfig& pduConf, cfdp::FileDirectives directiveCode,
size_t directiveParamFieldLen);
/**
* This only returns the size of the PDU header + 1 for the directive code octet.
* Use FileDirectiveSerializer::getWholePduSize to get the full packet length, assuming
* Use FileDirectiveCreator::getWholePduSize to get the full packet length, assuming
* the length fields was set correctly
* @return
*/
size_t getSerializedSize() const override;
[[nodiscard]] size_t getSerializedSize() const override;
ReturnValue_t serialize(uint8_t** buffer, size_t* size, size_t maxSize,
Endianness streamEndianness) const override;
@@ -1,49 +0,0 @@
#include "FileDirectiveDeserializer.h"
FileDirectiveDeserializer::FileDirectiveDeserializer(const uint8_t *pduBuf, size_t maxSize)
: HeaderDeserializer(pduBuf, maxSize) {}
cfdp::FileDirectives FileDirectiveDeserializer::getFileDirective() const { return fileDirective; }
ReturnValue_t FileDirectiveDeserializer::parseData() {
ReturnValue_t result = HeaderDeserializer::parseData();
if (result != HasReturnvaluesIF::RETURN_OK) {
return result;
}
if (this->getPduDataFieldLen() < 1) {
return cfdp::INVALID_PDU_DATAFIELD_LEN;
}
if (FileDirectiveDeserializer::getWholePduSize() > maxSize) {
return SerializeIF::STREAM_TOO_SHORT;
}
size_t currentIdx = HeaderDeserializer::getHeaderSize();
if (not checkFileDirective(rawPtr[currentIdx])) {
return cfdp::INVALID_DIRECTIVE_FIELDS;
}
setFileDirective(static_cast<cfdp::FileDirectives>(rawPtr[currentIdx]));
return HasReturnvaluesIF::RETURN_OK;
}
size_t FileDirectiveDeserializer::getHeaderSize() const {
// return size of header plus the directive byte
return HeaderDeserializer::getHeaderSize() + 1;
}
bool FileDirectiveDeserializer::checkFileDirective(uint8_t rawByte) {
if (rawByte < cfdp::FileDirectives::EOF_DIRECTIVE or
(rawByte > cfdp::FileDirectives::PROMPT and rawByte != cfdp::FileDirectives::KEEP_ALIVE)) {
// Invalid directive field. TODO: Custom returnvalue
return false;
}
return true;
}
void FileDirectiveDeserializer::setFileDirective(cfdp::FileDirectives fileDirective) {
this->fileDirective = fileDirective;
}
void FileDirectiveDeserializer::setEndianness(SerializeIF::Endianness endianness) {
this->endianness = endianness;
}
SerializeIF::Endianness FileDirectiveDeserializer::getEndianness() const { return endianness; }
+49
View File
@@ -0,0 +1,49 @@
#include "FileDirectiveReader.h"
FileDirectiveReader::FileDirectiveReader(const uint8_t *pduBuf, size_t maxSize)
: HeaderReader(pduBuf, maxSize) {}
cfdp::FileDirectives FileDirectiveReader::getFileDirective() const { return fileDirective; }
ReturnValue_t FileDirectiveReader::parseData() {
ReturnValue_t result = HeaderReader::parseData();
if (result != returnvalue::OK) {
return result;
}
if (this->getPduDataFieldLen() < 1) {
return cfdp::INVALID_PDU_DATAFIELD_LEN;
}
if (FileDirectiveReader::getWholePduSize() > maxSize) {
return SerializeIF::STREAM_TOO_SHORT;
}
size_t currentIdx = HeaderReader::getHeaderSize();
if (not checkFileDirective(pointers.rawPtr[currentIdx])) {
return cfdp::INVALID_DIRECTIVE_FIELDS;
}
setFileDirective(static_cast<cfdp::FileDirectives>(pointers.rawPtr[currentIdx]));
return returnvalue::OK;
}
size_t FileDirectiveReader::getHeaderSize() const {
// return size of header plus the directive byte
return HeaderReader::getHeaderSize() + 1;
}
bool FileDirectiveReader::checkFileDirective(uint8_t rawByte) {
if (rawByte < cfdp::FileDirectives::EOF_DIRECTIVE or
(rawByte > cfdp::FileDirectives::PROMPT and rawByte != cfdp::FileDirectives::KEEP_ALIVE)) {
// Invalid directive field. TODO: Custom returnvalue
return false;
}
return true;
}
void FileDirectiveReader::setFileDirective(cfdp::FileDirectives fileDirective_) {
fileDirective = fileDirective_;
}
void FileDirectiveReader::setEndianness(SerializeIF::Endianness endianness_) {
endianness = endianness_;
}
SerializeIF::Endianness FileDirectiveReader::getEndianness() const { return endianness; }
@@ -2,7 +2,7 @@
#define FSFW_SRC_FSFW_CFDP_PDU_FILEDIRECTIVEDESERIALIZER_H_
#include "../definitions.h"
#include "fsfw/cfdp/pdu/HeaderDeserializer.h"
#include "fsfw/cfdp/pdu/HeaderReader.h"
/**
* @brief This class is used to deserialize a PDU file directive header from raw memory.
@@ -11,24 +11,24 @@
* This is a zero-copy implementation and #parseData needs to be called to ensure the data is
* valid.
*/
class FileDirectiveDeserializer : public HeaderDeserializer {
class FileDirectiveReader : public HeaderReader {
public:
FileDirectiveDeserializer(const uint8_t* pduBuf, size_t maxSize);
FileDirectiveReader(const uint8_t* pduBuf, size_t maxSize);
/**
* This needs to be called before accessing the PDU fields to avoid segmentation faults.
* @return
*/
virtual ReturnValue_t parseData();
size_t getHeaderSize() const;
ReturnValue_t parseData() override;
[[nodiscard]] size_t getHeaderSize() const override;
cfdp::FileDirectives getFileDirective() const;
[[nodiscard]] cfdp::FileDirectives getFileDirective() const;
void setEndianness(SerializeIF::Endianness endianness);
SerializeIF::Endianness getEndianness() const;
[[nodiscard]] SerializeIF::Endianness getEndianness() const;
protected:
bool checkFileDirective(uint8_t rawByte);
static bool checkFileDirective(uint8_t rawByte);
private:
void setFileDirective(cfdp::FileDirectives fileDirective);
@@ -1,38 +0,0 @@
#include "FileDirectiveSerializer.h"
FileDirectiveSerializer::FileDirectiveSerializer(PduConfig &pduConf,
cfdp::FileDirectives directiveCode,
size_t directiveParamFieldLen)
: HeaderSerializer(pduConf, cfdp::PduType::FILE_DIRECTIVE, directiveParamFieldLen + 1),
directiveCode(directiveCode) {}
size_t FileDirectiveSerializer::getSerializedSize() const {
return HeaderSerializer::getSerializedSize() + 1;
}
ReturnValue_t FileDirectiveSerializer::serialize(uint8_t **buffer, size_t *size, size_t maxSize,
Endianness streamEndianness) const {
if (buffer == nullptr or size == nullptr) {
return HasReturnvaluesIF::RETURN_FAILED;
}
if (FileDirectiveSerializer::getWholePduSize() > maxSize) {
return BUFFER_TOO_SHORT;
}
ReturnValue_t result = HeaderSerializer::serialize(buffer, size, maxSize, streamEndianness);
if (result != HasReturnvaluesIF::RETURN_OK) {
return result;
}
if (*size >= maxSize) {
return BUFFER_TOO_SHORT;
}
**buffer = directiveCode;
*buffer += 1;
*size += 1;
return HasReturnvaluesIF::RETURN_OK;
}
void FileDirectiveSerializer::setDirectiveDataFieldLen(size_t len) {
// Set length of data field plus 1 byte for the directive octet
HeaderSerializer::setPduDataFieldLen(len + 1);
}
+11 -12
View File
@@ -2,9 +2,8 @@
FinishedInfo::FinishedInfo() {}
FinishedInfo::FinishedInfo(cfdp::ConditionCode conditionCode,
cfdp::FinishedDeliveryCode deliveryCode,
cfdp::FinishedFileStatus fileStatus)
FinishedInfo::FinishedInfo(cfdp::ConditionCode conditionCode, cfdp::FileDeliveryCode deliveryCode,
cfdp::FileDeliveryStatus fileStatus)
: conditionCode(conditionCode), deliveryCode(deliveryCode), fileStatus(fileStatus) {}
size_t FinishedInfo::getSerializedSize() const {
@@ -46,14 +45,14 @@ ReturnValue_t FinishedInfo::setFilestoreResponsesArray(FilestoreResponseTlv** fs
if (maxFsResponsesLen != nullptr) {
this->fsResponsesMaxLen = *maxFsResponsesLen;
}
return HasReturnvaluesIF::RETURN_OK;
return returnvalue::OK;
}
ReturnValue_t FinishedInfo::getFilestoreResonses(FilestoreResponseTlv*** fsResponses,
size_t* fsResponsesLen,
size_t* fsResponsesMaxLen) {
if (fsResponses == nullptr) {
return HasReturnvaluesIF::RETURN_FAILED;
return returnvalue::FAILED;
}
*fsResponses = this->fsResponses;
if (fsResponsesLen != nullptr) {
@@ -62,7 +61,7 @@ ReturnValue_t FinishedInfo::getFilestoreResonses(FilestoreResponseTlv*** fsRespo
if (fsResponsesMaxLen != nullptr) {
*fsResponsesMaxLen = this->fsResponsesMaxLen;
}
return HasReturnvaluesIF::RETURN_OK;
return returnvalue::OK;
}
void FinishedInfo::setFaultLocation(EntityIdTlv* faultLocation) {
@@ -71,10 +70,10 @@ void FinishedInfo::setFaultLocation(EntityIdTlv* faultLocation) {
ReturnValue_t FinishedInfo::getFaultLocation(EntityIdTlv** faultLocation) {
if (this->faultLocation == nullptr) {
return HasReturnvaluesIF::RETURN_FAILED;
return returnvalue::FAILED;
}
*faultLocation = this->faultLocation;
return HasReturnvaluesIF::RETURN_OK;
return returnvalue::OK;
}
cfdp::ConditionCode FinishedInfo::getConditionCode() const { return conditionCode; }
@@ -83,13 +82,13 @@ void FinishedInfo::setConditionCode(cfdp::ConditionCode conditionCode) {
this->conditionCode = conditionCode;
}
cfdp::FinishedDeliveryCode FinishedInfo::getDeliveryCode() const { return deliveryCode; }
cfdp::FileDeliveryCode FinishedInfo::getDeliveryCode() const { return deliveryCode; }
void FinishedInfo::setDeliveryCode(cfdp::FinishedDeliveryCode deliveryCode) {
void FinishedInfo::setDeliveryCode(cfdp::FileDeliveryCode deliveryCode) {
this->deliveryCode = deliveryCode;
}
cfdp::FinishedFileStatus FinishedInfo::getFileStatus() const { return fileStatus; }
cfdp::FileDeliveryStatus FinishedInfo::getFileStatus() const { return fileStatus; }
void FinishedInfo::setFilestoreResponsesArrayLen(size_t fsResponsesLen) {
this->fsResponsesLen = fsResponsesLen;
@@ -97,6 +96,6 @@ void FinishedInfo::setFilestoreResponsesArrayLen(size_t fsResponsesLen) {
size_t FinishedInfo::getFsResponsesLen() const { return fsResponsesLen; }
void FinishedInfo::setFileStatus(cfdp::FinishedFileStatus fileStatus) {
void FinishedInfo::setFileStatus(cfdp::FileDeliveryStatus fileStatus) {
this->fileStatus = fileStatus;
}

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