Compare commits

...

1007 Commits

Author SHA1 Message Date
42867ad0cb remove unuseed include 2024-04-30 15:10:40 +02:00
6381d9a83c Merge branch 'develop' of https://egit.irs.uni-stuttgart.de/eive/fsfw into develop 2024-04-29 13:18:54 +02:00
73bf1cc229
add setter function for source seq counter 2024-04-29 13:18:29 +02:00
222f02aefd Merge pull request 'Some more fixes' (#174) from fdir-fix-fresh-dhb into develop
Reviewed-on: #174
Reviewed-by: Marius Eggert <eggertm@irs.uni-stuttgart.de>
2024-04-29 11:45:28 +02:00
e9b4fc9825 Merge branch 'develop' into fdir-fix-fresh-dhb 2024-04-17 20:47:33 +02:00
0660457c92
check for FDIR failures 2024-04-17 12:11:07 +02:00
7c9b9e4cd8
initialize FDIR component properly 2024-04-17 12:08:08 +02:00
3b0ee7ca31
i forgot to push.. 2024-04-17 10:07:09 +02:00
fb2e480705 did i forgot to push? 2024-04-16 13:58:10 +02:00
b8ae646060 this include might be missing 2024-04-16 13:53:35 +02:00
f307a86d9a
improve linux interface 2024-04-11 13:11:51 +02:00
8b21dd276d Merge pull request 'implement relative timeshift' (#173) from time-service-relative-timeshift into develop
Reviewed-on: #173
Reviewed-by: Marius Eggert <eggertm@irs.uni-stuttgart.de>
2024-04-09 13:31:13 +02:00
e00da212cd Merge branch 'develop' into time-service-relative-timeshift 2024-04-09 11:11:59 +02:00
a229748aa4 distinct clock dump events 2024-04-09 10:57:00 +02:00
e6e3753324 Merge pull request 're-work some FDIR logic' (#172) from improve-dev-fdir into develop
Reviewed-on: #172
2024-04-09 10:47:32 +02:00
94bd1ba2ab fix comment blocks 2024-04-08 13:38:14 +02:00
e12a8cfa29 make this change downwards compatible 2024-04-08 13:31:21 +02:00
efbcddc2e5 improvements for time service 2024-04-08 13:26:55 +02:00
31d4b85523 some optimizations 2024-04-08 13:14:20 +02:00
aff6bb673b
make marius the happies man alive 2024-04-08 10:34:28 +02:00
f8e3777c43
more fixes 2024-04-03 16:23:21 +02:00
0e2fa8dc83
lets not forget error handling 2024-04-03 16:19:40 +02:00
0cfe559b93
implement relative timeshift 2024-04-03 16:15:07 +02:00
c5159fb645
optimize docs 2024-04-03 12:52:32 +02:00
203c0bac5c
re-work some FDIR logic 2024-04-03 12:47:11 +02:00
43ea29cb84 Merge pull request 'Function to prevent Quaternion Sign Jump' (#171) from quat-no-sign-jump into develop
Reviewed-on: #171
Reviewed-by: Robin Müller <muellerr@irs.uni-stuttgart.de>
2024-03-18 10:59:19 +01:00
27c8a97d45 added function to prevent quaternion sign jump 2024-03-13 16:59:14 +01:00
47b21caf5f Merge pull request 'Removed duplicate Code' (#170) from cleanup into develop
Reviewed-on: #170
Reviewed-by: Robin Müller <muellerr@irs.uni-stuttgart.de>
2024-03-06 10:54:12 +01:00
2673070204 actually do something with this rtval 2024-03-06 09:41:02 +01:00
518a07d05b removed duplicate code 2024-03-05 14:29:47 +01:00
516357d855 Merge pull request 'Expand Globalfunctions' (#168) from expand-globalfunctions into develop
Reviewed-on: #168
Reviewed-by: Robin Müller <muellerr@irs.uni-stuttgart.de>
2024-02-27 12:50:28 +01:00
ac28b7e00d Merge branch 'develop' into expand-globalfunctions 2024-02-26 13:57:04 +01:00
0d4a862c1a Merge pull request 'Increase configurability of PusServiceBase' (#169) from psb-update into develop
Reviewed-on: #169
Reviewed-by: Marius Eggert <eggertm@irs.uni-stuttgart.de>
2024-02-26 13:56:46 +01:00
b2576d3422 why are we ignoring usec 2024-02-23 11:33:20 +01:00
bccaf4a9ea capital 2024-02-23 11:31:11 +01:00
7d4e77843b frmt 2024-02-23 11:09:59 +01:00
cd2cd61ba5 Increase configurability of PusServiceBase 2024-02-13 15:57:43 +01:00
90f3f8ef1f removed printout 2024-02-12 14:51:54 +01:00
9894935e99 time systems 2024-02-12 14:42:58 +01:00
a3a6c0720c fixes 2024-02-12 14:36:14 +01:00
d5a52eadbb i should have done this ages ago 2024-02-12 14:20:04 +01:00
b5e7179af1 Merge pull request 'Rotation from Quaternions' (#167) from rotation-from-quaternions into develop
Reviewed-on: #167
Reviewed-by: Robin Müller <muellerr@irs.uni-stuttgart.de>
2024-01-29 14:11:08 +01:00
5879eb7f7b rotation from quaternions 2024-01-26 11:06:05 +01:00
e64e8b274d Merge pull request 'check whether map is full on insert' (#166) from insert-full-check into develop
Reviewed-on: #166
Reviewed-by: Marius Eggert <eggertm@irs.uni-stuttgart.de>
2023-12-12 17:53:14 +01:00
48bcce65b1 check whether map is full on insert 2023-12-12 11:24:35 +01:00
7105e199c6 Merge pull request 'SLERP for antiparallel Quaternions' (#165) from slerp-fix-antiparallel-quaternions into develop
Reviewed-on: #165
Reviewed-by: Robin Müller <muellerr@irs.uni-stuttgart.de>
2023-12-06 10:41:02 +01:00
94de483836 small fix 2023-12-06 09:26:22 +01:00
c648229c99 Merge pull request 'SLERP' (#163) from slerp into develop
Reviewed-on: #163
Reviewed-by: Robin Müller <muellerr@irs.uni-stuttgart.de>
2023-12-05 09:25:48 +01:00
5b661551a8 fixes 2023-12-04 17:52:24 +01:00
3978524181 Merge branch 'develop' into slerp 2023-11-29 15:19:09 +01:00
7187f2b5cd Merge pull request 'TLE turns too old after just 7 Days' (#164) from tle-too-old into develop
Reviewed-on: #164
2023-11-29 15:17:39 +01:00
8e367abb47 Merge branch 'develop' into tle-too-old 2023-11-29 15:17:19 +01:00
b28174db24 Merge pull request 'Fresh DHB pre-queue check hook' (#162) from fresh-dhb-pre-queue-hook into develop
Reviewed-on: #162
Reviewed-by: Marius Eggert <eggertm@irs.uni-stuttgart.de>
2023-11-29 14:18:23 +01:00
c906acd659 tle turns too old after just 7 days 2023-11-29 09:48:11 +01:00
8dfc84c0b5 smoll fix 2023-11-27 10:52:47 +01:00
74775bb59d slerp 2023-11-27 10:38:25 +01:00
c02d9e009e docs improvements and fix 2023-11-21 17:40:06 +01:00
0021aa29f5 pre-queue hook 2023-11-21 17:37:02 +01:00
41d67bff63 Merge pull request 'New simpler DHB' (#161) from new-dhb into develop
Reviewed-on: #161
Reviewed-by: Ulrich Mohr <mohr@irs.uni-stuttgart.de>
2023-11-16 11:02:44 +01:00
8d7bb51d44
add missing call to perform HK op 2023-11-15 11:39:04 +01:00
7673d8b396
add paramHelper 2023-11-15 10:03:56 +01:00
91b194d8eb Merge branch 'new-dhb' of https://egit.irs.uni-stuttgart.de/eive/fsfw into new-dhb 2023-11-14 11:48:20 +01:00
698897bfc5 default args 2023-11-14 11:48:17 +01:00
d554062b86
trigger event default arguments 2023-11-13 15:32:42 +01:00
bf7fac071c add mode setters 2023-11-09 17:18:33 +01:00
35be7da353
some more docs 2023-11-09 11:28:59 +01:00
18cc870c8e
add FDIR handling 2023-11-09 11:04:45 +01:00
133ca51d18
visibility changes 2023-11-09 10:45:21 +01:00
0a40391a75
thats the baseline 2023-11-09 10:36:45 +01:00
cc3e64e70d Merge pull request 'CFDP SOURCE handler' (#157) from cfdp-source-handler into develop
Reviewed-on: #157
Reviewed-by: Marius Eggert <eggertm@irs.uni-stuttgart.de>
2023-10-19 10:59:53 +02:00
6021257a87
unittest fix 2023-10-19 10:21:18 +02:00
63c238005e Merge remote-tracking branch 'origin/develop' into cfdp-source-handler 2023-10-11 12:57:14 +02:00
0f604b35c6 improved readability 2023-10-09 09:26:56 +02:00
e3a815444e checkModeCommand to protected 2023-09-29 15:26:43 +02:00
19093866ee rtval for non op soc 2023-09-29 14:27:54 +02:00
497f947237
add missing 0 termination 2023-09-14 15:04:54 +02:00
5bd020193b
initialize result 2023-09-11 15:38:46 +02:00
420c0625a5
result was not stored properly 2023-09-11 15:38:06 +02:00
42a0b15303
hardcore bug 2023-09-06 20:49:53 +02:00
c199cbedaa
some improvements, remove debugging stuff 2023-09-06 13:40:18 +02:00
c4e18cc2f3
what was i thinking here? 2023-09-06 11:45:02 +02:00
c143198494
debugging 2023-09-06 10:11:09 +02:00
448fbd0d38
this should be less confusing, saner defaults 2023-09-05 16:04:48 +02:00
470f589bde
need to rework this fsm.. but works now 2023-09-04 11:01:55 +02:00
dfcfb035be
fix some retval duplications 2023-08-31 15:09:22 +02:00
6e53582dc9
split up CFDP retval domains 2023-08-31 14:59:09 +02:00
fb1500e041
continue 2023-08-30 11:34:38 +02:00
ea2e58249d
API improvements 2023-08-30 11:18:49 +02:00
9ef63825f3
optimization 2023-08-16 13:15:34 +02:00
073cb4b3d5
adaptions for reserved message handling 2023-08-16 13:10:21 +02:00
8c11685240
introduce handling for full target queue 2023-08-14 21:19:35 +02:00
cb1aaea6cd
add more checks 2023-08-14 21:04:22 +02:00
22df8f6147
fix the tests 2023-08-14 21:01:29 +02:00
60dcacf432
further tweaks for both CFDP handlers 2023-08-14 20:47:27 +02:00
b39e1c7e07 Merge remote-tracking branch 'origin/develop' into cfdp-source-handler 2023-08-14 15:59:13 +02:00
036667a969
type improvements 2023-08-14 15:58:01 +02:00
67c38f327e
rename source file 2023-08-14 13:54:11 +02:00
e1816ed230
that should be all indications 2023-08-14 13:45:13 +02:00
5ff464252f
added some user checks 2023-08-14 13:40:25 +02:00
cd8d64830c
more checks 2023-08-14 13:33:47 +02:00
b7056a7467
additional checks 2023-08-14 13:24:22 +02:00
0fc2c7b5e9
oops 2023-08-14 13:19:48 +02:00
eae7c44874
reset error count 2023-08-14 13:19:32 +02:00
e4aae75747
more checks 2023-08-14 12:19:55 +02:00
b094ba145f
multi file segment works 2023-08-14 12:15:35 +02:00
15629abf19
the joys of UB or whatever that crap was 2023-08-14 12:13:29 +02:00
7aeb25e064
unittest for transfer with 2 segments 2023-08-14 11:26:57 +02:00
d246ce34d0 Merge pull request 'Change TLE validity duration' (#159) from spg4-tle-too-old into develop
Reviewed-on: #159
Reviewed-by: Robin Müller <muellerr@irs.uni-stuttgart.de>
2023-08-14 10:09:00 +02:00
796c7a9e37 tle is too old after 30 days now 2023-08-09 11:42:11 +02:00
7c875f1067
unittest for small file transfer done 2023-08-04 15:17:53 +02:00
e8451cac31
add one test condition 2023-08-04 14:21:36 +02:00
8ddd6eb18d
some improvements for test 2023-08-03 17:44:30 +02:00
6c6b552059
start small file transfer test 2023-08-03 17:43:03 +02:00
9a1437980f
add empty stubs 2023-08-03 15:50:27 +02:00
12e52a92f2
empty file transfer test done 2023-08-03 15:49:23 +02:00
dffce43e6b
metadata PDU seems to be correct 2023-08-03 15:30:38 +02:00
daf75547a4
insidious bug 2023-08-03 15:13:26 +02:00
0cccf26021
should not be problematic but somehow is.. 2023-08-03 14:34:21 +02:00
c075f27e20
start verifying metadata PDU 2023-08-03 13:57:55 +02:00
3167988951
continue source handler 2023-08-03 13:03:58 +02:00
a856f91c67
nice 2023-07-27 17:15:01 +02:00
f49e607881
finally it works 2023-07-27 15:07:14 +02:00
0f208ec75a
seems to work well 2023-07-27 14:55:46 +02:00
5679b139ad
reserved message unittest working 2023-07-26 18:20:32 +02:00
947f2b8685
add some additional API 2023-07-26 17:47:27 +02:00
291c75c01f
test put request 2023-07-26 17:29:35 +02:00
fde277cd06
start adding dedicated put request handler 2023-07-26 17:17:51 +02:00
bb186fc965
more bugfixes 2023-07-26 16:58:58 +02:00
e8bf8b9575
looking good 2023-07-26 16:36:21 +02:00
8f5a8b13d3
parsing finally works 2023-07-26 16:25:42 +02:00
314cba363f
contnue msg parser unittest 2023-07-25 16:16:35 +02:00
244e2d0737
start adding message parser unittests 2023-07-25 13:58:22 +02:00
8f0974d83e
finished reserved msg creator function 2023-07-24 18:07:20 +02:00
8581f9a6f3
start implementing reserved message creator 2023-07-24 18:01:25 +02:00
844c90a625
constructor fix 2023-07-24 16:42:13 +02:00
437851db3e
naming 2023-07-24 16:40:44 +02:00
e8b9897ee3
even better name 2023-07-24 16:40:25 +02:00
33df8e8cc5
this parser should do the job 2023-07-24 16:38:11 +02:00
52fc0958f7
iniitalize field 2023-07-24 11:58:06 +02:00
66704dc571
getting tricky again.. 2023-07-24 11:57:33 +02:00
0943863ec6
need to think about that parser again.. 2023-07-24 11:35:26 +02:00
2585028e75
put request serializable now 2023-07-24 11:33:37 +02:00
7bf7336d4a
almost done 2023-07-24 11:15:50 +02:00
b0b6c68720
we already have CFDP messages 2023-07-24 11:05:11 +02:00
a1f36a0dd8
put request 2023-07-24 10:58:18 +02:00
e4665c9394
continue with the msg to user / put request architecture 2023-07-24 10:52:38 +02:00
98cbf38432
this is going to be complex.. 2023-07-24 10:11:16 +02:00
5d3f00da7f
that should do the job 2023-07-24 10:06:45 +02:00
69fd6d0f6a
lets see how we can do this 2023-07-21 16:35:05 +02:00
045054fce0
start implementing metadata parser 2023-07-21 16:12:17 +02:00
4c9e731113 Merge branch 'cfdp-source-handler' of https://egit.irs.uni-stuttgart.de/eive/fsfw into cfdp-source-handler 2023-07-21 16:09:59 +02:00
e00e198ff1
this seems to work 2023-07-21 16:09:52 +02:00
9c8434d856
LOOKING GOOOD 2023-07-19 23:43:40 +02:00
42c215ef70
some additional notes 2023-07-19 23:24:43 +02:00
273fd3ebfd
added sequence count provider abstraction 2023-07-19 23:22:55 +02:00
6c9c4ee047
add EOF impl 2023-07-19 14:06:15 +02:00
1bfb695b41
some minor tweaks 2023-07-19 14:02:03 +02:00
1561b9a247
implemented fle data PDUs 2023-07-19 13:44:52 +02:00
896b7a7358
start FD PDU handling 2023-07-19 00:12:14 +02:00
8e62143ac8
continue impl 2023-07-18 09:38:46 +02:00
1d97327f79
start implementing metadata PDU generation 2023-07-17 18:56:10 +02:00
5e9d402598
getFileSize API for fsfw 2023-07-17 16:40:44 +02:00
b53c48863f
start introducing FSM result 2023-07-17 15:21:22 +02:00
4dc6398fd5
continue source FSM 2023-07-17 15:11:51 +02:00
8fcc4eab60
some internal state handling 2023-07-17 15:03:08 +02:00
972dc7e19e
continue source handler 2023-07-17 14:54:45 +02:00
06ef498a18
start implementing put request function 2023-07-17 14:48:37 +02:00
6322a31566
some fixes 2023-07-17 13:43:48 +02:00
95b77ed826
put request support baseline 2023-07-17 13:28:32 +02:00
3b1da85229
start setting up source handler 2023-07-17 11:37:20 +02:00
1cbcfc08ff
reorder includes 2023-07-17 10:46:12 +02:00
d575da8540 Merge pull request 'Small tweak to allow immediate HK generation' (#158) from small-hk-tweak into develop
Reviewed-on: #158
Reviewed-by: Marius Eggert <eggertm@irs.uni-stuttgart.de>
2023-07-17 10:37:39 +02:00
ca27cef2ee
Merge branch 'small-hk-tweak' into cfdp-source-handler 2023-07-17 10:37:03 +02:00
62ace649a7
fix unittest 2023-07-17 10:35:35 +02:00
aac74fae38
shared cmake file 2023-07-17 10:34:19 +02:00
a26b0c38ac
small tweak to allow immediate HK generation 2023-07-17 10:31:02 +02:00
f44110a7f5
share the FSFW Param block 2023-07-17 10:25:09 +02:00
35712070cf
source handler 2023-07-17 10:15:06 +02:00
1b79713430 Merge branch 'cfdp-source-handler' of https://egit.irs.uni-stuttgart.de/eive/fsfw into cfdp-source-handler 2023-07-17 09:53:51 +02:00
a6cc5171da
continue source handler 2023-07-17 09:53:23 +02:00
9994c46e47 Merge branch 'develop' into cfdp-source-handler 2023-07-14 16:01:51 +02:00
cf927ecee7
added bare structure of FSM 2023-07-14 15:56:38 +02:00
42e74d22cc Merge pull request 'countdown based HK generation' (#156) from hk-generation-countdown-based into develop
Reviewed-on: #156
Reviewed-by: Marius Eggert <eggertm@irs.uni-stuttgart.de>
2023-07-11 17:35:10 +02:00
36caa58043 Merge branch 'develop' into hk-generation-countdown-based 2023-07-11 17:34:24 +02:00
988e07f0be
countdown 2023-07-11 15:40:43 +02:00
88e8665280
important bugfix for PUS TM creator 2023-07-10 17:45:02 +02:00
9c8b1c697b
added back missing function 2023-07-10 14:20:02 +02:00
110cb903a6
countdown based HK generation 2023-07-10 14:14:31 +02:00
1b23aa4246
bugfixes and improvements for dest handler 2023-06-30 12:01:18 +02:00
7d713219c5
continue source handler 2023-06-30 11:59:22 +02:00
1be09a2310
the C++ tooling is shit 2023-06-30 11:48:25 +02:00
7add782470
start CFDP source handler 2023-06-30 11:36:19 +02:00
8da89eba80 Merge pull request 'add API to set msg counter' (#155) from pus-msg-counter-mutable into develop
Reviewed-on: #155
Reviewed-by: Marius Eggert <eggertm@irs.uni-stuttgart.de>
2023-06-28 13:19:28 +02:00
7e8845f2c2 Merge remote-tracking branch 'origin/develop' into pus-msg-counter-mutable 2023-06-26 18:12:36 +02:00
6aff3250c2 Merge pull request 'Internal Error Reporter Configurability' (#154) from internal-error-reporter-set into develop
Reviewed-on: #154
2023-06-26 18:10:06 +02:00
c3572e31a8
add API to set msg counter 2023-06-25 12:35:50 +02:00
2293e7f2bb
typo 2023-06-22 16:12:41 +02:00
a85a38c882
some thnings are configurable now 2023-06-22 16:08:29 +02:00
0f76cdb3ba
typo 2023-06-20 20:36:03 +02:00
268c2e87c9 Merge pull request 'max value calc fix' (#153) from max-value-fix-v2 into develop
Reviewed-on: #153
2023-06-20 18:20:00 +02:00
87f94a252f Merge branch 'develop' into max-value-fix-v2 2023-06-20 18:19:19 +02:00
c7037d417a nullptr check for optional argument 2023-06-20 11:54:15 +02:00
f80c5980ea max value calc fix 2023-06-19 17:04:45 +02:00
ad01642fee Merge pull request 'specify truncate flag explicitely' (#151) from specify-truncate-flag-explicitely into develop
Reviewed-on: #151
Reviewed-by: Marius Eggert <eggertm@irs.uni-stuttgart.de>
2023-06-19 09:32:19 +02:00
f2947bc78e
specify truncate flag explicitely 2023-06-18 19:04:36 +02:00
0a977ea688 Merge pull request 'make number of parallel cmds configurable' (#149) from make-srv3-num-parallel-cmds-configurable into develop
Reviewed-on: #149
2023-06-14 03:37:02 +02:00
74b164b1da make number of parallel cmds configurable 2023-06-13 08:09:04 +02:00
5322de0599 Merge pull request 'Pull CFPD bugfix in dev branch' (#147) from pull-cfdp-fix-into-dev-branch into obsw-v3.0.0-dev
Reviewed-on: #147
2023-06-09 13:41:29 +02:00
9a4bf51006 Merge branch 'develop' into obsw-v3.0.0-dev 2023-06-09 13:11:30 +02:00
3a70229510 Merge pull request 'configurable queue depth' (#146) from service-8-configurable-queue-depth into obsw-v3.0.0-dev
Reviewed-on: #146
2023-06-09 13:03:17 +02:00
b3beedad9f Merge branch 'obsw-v3.0.0-dev' into service-8-configurable-queue-depth 2023-06-09 13:03:08 +02:00
efe217a197 Merge pull request 'Rework L3GD20H Config' (#143) from gyr-config-rework into obsw-v3.0.0-dev
Reviewed-on: #143
2023-06-09 13:01:23 +02:00
b442ca09b9 configurable queue depth 2023-06-07 13:46:46 +02:00
9372b2a575
Merge remote-tracking branch 'upstream/development' into develop 2023-05-25 15:03:54 +02:00
aafa53148e Merge pull request 'CFDP Bugfix' (#144) from cfdp-bugfix-unittest-fixes into develop
Reviewed-on: #144
Reviewed-by: Marius Eggert <eggertm@irs.uni-stuttgart.de>
2023-05-22 10:40:44 +02:00
e0adb3325f
werks 2023-05-22 10:37:26 +02:00
4391823f01
changelog 2023-05-15 16:14:36 +02:00
1a77e6bb09
proper floating point comparison 2023-05-15 16:13:05 +02:00
cae131edcf
CFDP and unittest bugfixes 2023-05-15 16:02:55 +02:00
4518fec65c CHANGELOG 2023-05-08 15:25:47 +02:00
dac1aacab2 Merge pull request 'Update Power Switch IF' (#743) from eive/fsfw:update_power_switch_if into development
Reviewed-on: fsfw/fsfw#743
2023-05-08 15:00:47 +02:00
0042f92fdf Merge pull request 'bump ETL version' (#748) from KSat/fsfw:bump_etl_dep into development
Reviewed-on: fsfw/fsfw#748
2023-05-08 14:53:02 +02:00
656faf8169 Merge remote-tracking branch 'upstream/development' into update_power_switch_if 2023-05-08 14:44:27 +02:00
f84431e965 Merge pull request 'bugfix and changelog for Linux getUptime' (#745) from eive/fsfw:important_bugfix_linux_get_uptime into development
Reviewed-on: fsfw/fsfw#745
2023-05-08 14:29:55 +02:00
0cec9ebb73 Merge pull request 'small tweak for version getter' (#744) from eive/fsfw:small_version_getter_tweak into development
Reviewed-on: fsfw/fsfw#744
2023-05-08 14:13:06 +02:00
a440b7c394 Merge pull request 'add CFDP subsystem ID' (#742) from eive/fsfw:add_cfdp_subsystem_id into development
Reviewed-on: fsfw/fsfw#742
2023-05-08 14:09:04 +02:00
bbfc1b2b34 Merge pull request 'FixedArrayList compile time assert' (#740) from eive/fsfw:container_additional_assert into development
Reviewed-on: fsfw/fsfw#740
2023-05-08 14:04:56 +02:00
025b379e8b
bump ETL version 2023-05-04 14:04:55 +02:00
258f0d3313 use both LPFs 2023-04-19 15:25:14 +02:00
5eb9ee8bc1
DHB fdir: event queue depth confgurable 2023-04-14 21:22:24 +02:00
7f61d17cee
even better event manager printout 2023-04-14 21:08:44 +02:00
ffa2fa477f Merge pull request 'move CFDP handler' (#142) from move_cfdp_handler into develop
Reviewed-on: #142
2023-04-11 16:50:46 +02:00
894d1e3b87
move CFDP handler 2023-04-11 16:36:54 +02:00
285d327b97
clean up spi retval defs 2023-04-07 17:42:44 +02:00
e97fa5ac84
add skip directive for retvals 2023-04-07 11:03:46 +02:00
5a9304765f
accepts action commands without ipc data 2023-04-06 22:34:57 +02:00
6650c293da
change collection interval is public now 2023-04-04 15:59:26 +02:00
9fca7581dd Merge branch 'develop' of https://egit.irs.uni-stuttgart.de/eive/fsfw into develop 2023-04-04 01:52:29 +02:00
4af90f99f3
changelog 2023-04-04 01:52:26 +02:00
94cdf67a80
make health functions virtual 2023-04-04 01:51:58 +02:00
7966ede11b
add O_SYNC flag for UioMapper 2023-04-03 21:57:18 +02:00
7a392dc33a
new register function 2023-04-03 18:54:35 +02:00
1e3c89b672
i dont think ths needs to be public 2023-04-03 17:59:14 +02:00
e2e87b149d
initialize switch state list 2023-04-03 14:31:45 +02:00
4f632e2c68
ctrl base bugfix 2023-03-28 19:37:47 +02:00
314f0fa2cd
start power switch component in undefined mode 2023-03-28 15:27:48 +02:00
b31e1037fb
HK service configurable queue depth 2023-03-26 20:05:10 +02:00
b814e7198f Merge pull request 'Allow creating regular threads' (#140) from allow_creating_regular_threads into develop
Reviewed-on: #140
2023-03-24 14:15:53 +01:00
6328b70d7b Merge branch 'develop' into allow_creating_regular_threads 2023-03-24 14:15:39 +01:00
a937b457f9
this is so confusing 2023-03-24 14:10:47 +01:00
4415dc24e1
fix host OSAL 2023-03-24 13:25:34 +01:00
e704295cce
default value 2023-03-24 11:58:23 +01:00
d16b3c7e67
try to do this cleanly 2023-03-24 11:53:41 +01:00
3b86545725 Merge pull request 'add BUSY retval' (#141) from busy_retval_dhb_com into develop
Reviewed-on: #141
2023-03-24 11:35:09 +01:00
cf6150cc18
add BUSY retval 2023-03-24 00:57:44 +01:00
bfb5c2ff03 Merge branch 'develop' into allow_creating_regular_threads 2023-03-23 18:45:49 +01:00
bf02061d47 Merge pull request 'use RR sched instead of FIFO for Linux RT' (#139) from use_rr_sched into develop
Reviewed-on: #139
2023-03-23 18:45:09 +01:00
2c4e110254 Merge branch 'develop' into use_rr_sched 2023-03-23 18:44:59 +01:00
7ed75ea87b Merge remote-tracking branch 'origin/develop' into allow_creating_regular_threads 2023-03-23 18:44:06 +01:00
db4587bb59
allow creating regular threads 2023-03-23 18:29:17 +01:00
33ac395072
use RR sched instead of FIFO for Linux RT 2023-03-23 15:42:14 +01:00
f8a7c1d4ed
rename namespace 2023-03-22 01:03:49 +01:00
341437df13
add flush functions for serial helpers 2023-03-21 20:20:13 +01:00
227524a21d
transition source submode is tricky 2023-03-20 15:49:09 +01:00
0f81d5e458
Merge remote-tracking branch 'upstream/development' into container_additional_assert 2023-03-15 12:34:36 +01:00
b50f092939
Merge remote-tracking branch 'upstream/development' into update_power_switch_if 2023-03-15 12:33:08 +01:00
2f90e12179
Merge remote-tracking branch 'upstream/development' into important_bugfix_linux_get_uptime 2023-03-15 12:32:25 +01:00
8b77fac099 Merge pull request 'health service fixes and changelog' (#746) from eive/fsfw:health_service_fixes into development
Reviewed-on: fsfw/fsfw#746
2023-03-15 12:29:31 +01:00
47503824d7
health service fixes and changelog 2023-03-15 12:27:39 +01:00
5e3f5c4121
fuse update 2023-03-15 12:25:39 +01:00
1f36c082ef
bugfix and changelog for Linux getUptime 2023-03-15 12:21:50 +01:00
aa84e93603
small tweak for version getter 2023-03-15 12:17:36 +01:00
8f63a0e747
changelog 2023-03-15 12:15:21 +01:00
6fc8f756a7
update power switch IF 2023-03-15 12:13:55 +01:00
d98ed40e3d
add CFDP subsystem ID 2023-03-15 12:09:30 +01:00
b057250bfb
changelog 2023-03-15 11:53:12 +01:00
066dd0d397
changelog 2023-03-15 11:52:20 +01:00
f735c2e9d4
assert size larger than 0 2023-03-15 11:51:51 +01:00
43fd0b2f59
resolve some more merge conflicts 2023-03-15 11:48:50 +01:00
d0607824ad
Merge remote-tracking branch 'upstream/development' into develop 2023-03-15 11:40:48 +01:00
cf27954a86
changelog 2023-03-14 19:55:01 +01:00
f84e3284ab
just hardcode spill option to true 2023-03-14 19:54:21 +01:00
5250423d1d Merge pull request 'Periodic HK helper simplification' (#136) from periodic_hk_helper_simplification into develop
Reviewed-on: #136
2023-03-14 18:27:14 +01:00
522bd41d6e
changelog 2023-03-14 18:26:44 +01:00
c61c85280b
remove more code 2023-03-14 18:26:04 +01:00
afbe5e1f65
Merge remote-tracking branch 'origin/develop' into periodic_hk_helper_simplification 2023-03-14 18:23:57 +01:00
4c88ab80c8 Merge pull request 'Pool Manager spill to higher pools option' (#135) from pool_manager_spilling_opt into develop
Reviewed-on: #135
2023-03-14 18:22:31 +01:00
5ba69b169f
changelog 2023-03-14 18:22:00 +01:00
40405fe6c7
add spill option 2023-03-14 18:21:16 +01:00
aac32e763c
some compile fixes 2023-03-14 18:20:17 +01:00
bf980d74c0
HK helper simplification 2023-03-14 17:40:39 +01:00
b6b9d1d790
make dataset enable idempotent 2023-03-14 16:49:46 +01:00
0973ba6bf2 Merge pull request 'basic faulty cb for power switcher component' (#134) from feature_power_switch_faulty_cb into develop
Reviewed-on: #134
2023-03-14 14:15:11 +01:00
1cfebb5d47 Merge branch 'develop' into feature_power_switch_faulty_cb 2023-03-14 14:14:50 +01:00
0b0a0299bc
power switch IF improvements 2023-03-14 13:45:03 +01:00
8382d61b92
possible fix for power switch component 2023-03-14 11:44:13 +01:00
7208343b6d
basic faulty cb for power switcher component 2023-03-13 16:01:13 +01:00
9a8d775eb1
optimization for cmd executor 2023-03-12 20:49:34 +01:00
4d6f6e6b23
event manager queue depth configurable 2023-03-10 14:58:20 +01:00
55f6825a03 Revert "Modes: reusing submode for mode mask, more unittests"
This reverts commit f0bddfcb21.
2023-03-10 14:50:16 +01:00
c162acb7df Merge branch 'develop' of https://egit.irs.uni-stuttgart.de/eive/fsfw into develop 2023-03-10 14:23:51 +01:00
87462afe6d
better error printout for i2c write error 2023-03-10 14:23:40 +01:00
a8de395ea0 Merge pull request 'Modes: reusing submode for mode mask, more unittests' (#133) from mohr/submode_mask into develop
Reviewed-on: #133
Reviewed-by: Robin Müller <muellerr@irs.uni-stuttgart.de>
2023-03-10 11:22:11 +01:00
f0bddfcb21 Modes: reusing submode for mode mask, more unittests 2023-03-09 16:43:45 +01:00
23d9b44b3e Merge pull request 'exceptionless host filesystem' (#132) from avoid_exceptions into develop
Reviewed-on: #132
2023-03-08 14:55:18 +01:00
26e4445189
exceptionless host filesystem 2023-03-08 14:47:03 +01:00
9ee3cdf729 Merge pull request 'OFF -> NORMAL: Set transition source modes' (#131) from off_to_normal_transition_sources into develop
Reviewed-on: #131
2023-03-08 01:24:54 +01:00
1b7493f945
OFF -> NORMAL: Set transition source modes 2023-03-08 01:18:11 +01:00
7f6ba5f40b Merge pull request 'Feature: Allowed Submodes Mask for Mode List Entry' (#130) from feature_allow_submodes_mode_list_entry into develop
Reviewed-on: #130
Reviewed-by: Steffen Gaisser <gaisser@irs.uni-stuttgart.de>
2023-03-07 17:20:47 +01:00
070b48ada2
review improvements 2023-03-07 17:15:34 +01:00
d9a139e1ef Merge remote-tracking branch 'origin/develop' into feature_allow_submodes_mode_list_entry 2023-03-07 16:31:28 +01:00
c80a3752d9
afmt 2023-03-07 16:31:08 +01:00
af58c414fc
bugfix in submode check logic 2023-03-07 16:29:10 +01:00
4c48668125
add copy and assignment ctor for mode definition 2023-03-07 16:03:28 +01:00
2745b2080d
allow submode mask now 2023-03-07 13:55:40 +01:00
e9d9f44605
added length check 2023-03-06 14:01:45 +01:00
2c5af91db1 Merge pull request 'new monotonic clock API' (#128) from feature_monotonic_clock_api into develop
Reviewed-on: #128
Reviewed-by: Marius Eggert <eggertm@irs.uni-stuttgart.de>
2023-03-04 11:47:37 +01:00
5cd7b98ba7
more todo docs 2023-03-04 11:38:16 +01:00
a39f1271ec
return FAILED for win 2023-03-04 11:32:32 +01:00
bbf0d7a0d2
add basic impl (no windows) for host 2023-03-04 11:31:54 +01:00
04ee3c7362
renaming 2023-03-04 11:04:55 +01:00
95dab69b35
new monotonic clock API 2023-03-04 11:03:22 +01:00
33de15205b Merge pull request 'configurable queue depth' (#127) from feature_configurable_queue_depth_tcpip_servers into develop
Reviewed-on: #127
2023-03-03 16:33:29 +01:00
4d353a1ad2
remove obsolete constant 2023-03-03 16:36:30 +01:00
6006c97e48
configurable queue depth 2023-03-03 15:45:44 +01:00
6e17e45506 Merge pull request 'timeval: Use system clock' (#126) from feature_timeval_use_sysclock into develop
Reviewed-on: #126
2023-03-03 15:25:38 +01:00
64537d442a extneded and fixed countdown unittests 2023-03-03 14:54:52 +01:00
78cf00315d use sys clock for Countdown 2023-03-03 14:30:35 +01:00
245886c555
add lock context for pool manager 2023-03-02 15:33:49 +01:00
f84097543e
allow passing context to mutex guard 2023-03-02 15:20:59 +01:00
511d07c0c7
refactored MGM device code 2023-02-26 21:26:24 +01:00
cf735143fe
update for SPI/gyro dev handler code 2023-02-26 14:54:35 +01:00
bdfe31dba4 Merge branch 'mueller/pus-15-tm-storage' into develop 2023-02-24 19:03:21 +01:00
216f603d62 Merge remote-tracking branch 'origin/develop' into mueller/pus-15-tm-storage 2023-02-24 16:56:32 +01:00
174a6aa862 Merge pull request 'use timeval instead of uptime for stopwatch' (#125) from stopwatch-fix into develop
Reviewed-on: #125
Reviewed-by: Robin Müller <muellerr@irs.uni-stuttgart.de>
2023-02-24 16:51:28 +01:00
c2d9370aa1 Merge branch 'develop' into stopwatch-fix 2023-02-24 16:51:08 +01:00
893b434728
allow dest handler to handle folder destinations 2023-02-24 16:49:23 +01:00
6eba84566d use timeval instead of uptime 2023-02-24 16:39:49 +01:00
f0415a97b1
some fixes and improvements 2023-02-24 15:49:05 +01:00
abcf1b29b2
execution complete 2023-02-24 14:50:36 +01:00
dc7afc5415 Version bump, CHANGELOG update, format 2023-02-23 13:38:24 +01:00
9bf3ff95b7 Merge pull request 'Add Health Service Announce All Health Info' (#725) from eive/fsfw:add_health_service_announce_all into development
Reviewed-on: fsfw/fsfw#725
2023-02-23 13:13:56 +01:00
61562b18ab Merge branch 'development' into add_health_service_announce_all 2023-02-23 12:56:12 +01:00
d76d97a36b changed health table parameter to objectId 2023-02-23 12:44:42 +01:00
d373c45d36 Merge branch 'develop' into mueller/pus-15-tm-storage 2023-02-22 15:45:54 +01:00
bd208038dd
printout fixes 2023-02-22 15:45:39 +01:00
206af00c8b Merge remote-tracking branch 'origin/develop' into mueller/pus-15-tm-storage 2023-02-21 11:14:19 +01:00
2efff4d2c5
missing include 2023-02-21 02:59:13 +01:00
2a0c244468
add pus 15 store ID 2023-02-20 16:10:21 +01:00
e1711f0345 Merge remote-tracking branch 'origin/develop' into mueller/pus-15-tm-storage 2023-02-20 15:04:13 +01:00
c327985222
printout tweak 2023-02-20 15:02:00 +01:00
76b377c4c0 Merge pull request 'Mode Service: Add allowed subservice' (#739) from eive/fsfw:small_mode_service_fix into development
Reviewed-on: fsfw/fsfw#739
2023-02-20 13:40:53 +01:00
b45206ccd6 Merge remote-tracking branch 'origin/develop' into mueller/pus-15-tm-storage 2023-02-20 13:33:10 +01:00
c8469ca647 a lot of bug potential here 2023-02-18 14:03:19 +01:00
2d6622b8b8 wtf is this interface 2023-02-18 13:51:24 +01:00
5f9eb01d94
better naming 2023-02-18 13:46:51 +01:00
3568bdbecf
lets see if this fixes the issue 2023-02-18 13:45:49 +01:00
fcd84b59ae how the hell does this break anything 2023-02-18 13:37:39 +01:00
e3c968096b i2c small improvements 2023-02-18 13:07:38 +01:00
c745c0c8b4 Merge remote-tracking branch 'origin/develop' into mueller/pus-15-tm-storage 2023-02-17 13:18:09 +01:00
be015b4c66
service 11: cast to fix warning 2023-02-17 12:07:50 +01:00
dae5e988fd Merge remote-tracking branch 'origin/develop' into mueller/pus-15-tm-storage 2023-02-17 11:52:23 +01:00
a6d707a7db
SubsystemBase: Add function to update child modes 2023-02-17 02:04:17 +01:00
fe41d73895
remove obsolete mode 2023-02-16 17:57:03 +01:00
70b785984c Merge remote-tracking branch 'origin/develop' into mueller/pus-15-tm-storage 2023-02-14 17:33:59 +01:00
9de6c4b3aa
printout corrections 2023-02-14 14:33:02 +01:00
d256ede8c1
fix cppcheck lint 2023-02-14 10:33:22 +01:00
f0b8457ba2
bugfix for SPI
- Set transfer length to 0 for failed transfers
2023-02-13 13:51:52 +01:00
dac2d210b5
updates for thermal module in DHB 2023-02-13 00:36:54 +01:00
8b4f73a97b
better error msg 2023-02-12 21:07:11 +01:00
7fae6cbd6d
added missing CS unlock 2023-02-12 20:06:32 +01:00
d302ba7185
afmt 2023-02-10 13:51:16 +01:00
3562bf11b9 CHANGELOG update 2023-02-10 11:06:46 +01:00
fffb2b61e5 release check helper 2023-02-10 11:06:30 +01:00
94e5f62331
add allowed subservice 2023-02-09 18:30:08 +01:00
14a92b3d89
typo 2023-02-09 18:28:16 +01:00
e4fd424d66
Merge branch 'possible_tc_sched_fixes' into develop 2023-02-09 18:25:44 +01:00
341a66c265
changelog 2023-02-09 18:22:00 +01:00
b9b076aa4c logic error 2023-02-09 18:18:25 +01:00
d93486a340 that time margin check is possible broken 2023-02-09 18:18:05 +01:00
820a7f059c
logic error 2023-02-09 18:13:58 +01:00
f4d188c36f
that time margin check is possible broken 2023-02-09 18:12:43 +01:00
1841f92944
important bugfix for thermal set 2023-02-09 17:17:42 +01:00
b279985859
refactor DHB: Bugfix for thermal module 2023-02-09 16:42:38 +01:00
0a9c563bbc format 2023-02-09 15:58:48 +01:00
fa7675897d Merge pull request 'Mode Service Bugfixes' (#736) from eive/fsfw:mode_service_fixes into development
Reviewed-on: fsfw/fsfw#736
2023-02-09 15:56:26 +01:00
3a2393885f more style 2023-02-09 15:44:39 +01:00
c752b6d143 Merge pull request 'Generic TMTC Bridge Update' (#734) from eive/fsfw:tmtcbridge_tweaks into development
Reviewed-on: fsfw/fsfw#734
2023-02-09 15:37:35 +01:00
b676040c7c Merge pull request 'CMakeLists file updates' (#731) from eive/fsfw:cmakelists_update into development
Reviewed-on: fsfw/fsfw#731
2023-02-09 15:29:46 +01:00
010509efb4 removed unneeded find_package parameter for etl 2023-02-09 13:50:16 +01:00
dfb1633f00 Merge branch 'development' into mode_service_fixes 2023-02-09 13:46:19 +01:00
5f7172e130 Merge pull request 'TCP/IP TMTC bridge memory leak fixes' (#737) from eive/fsfw:possible_tcpip_bridge_fixes into development
Reviewed-on: fsfw/fsfw#737
2023-02-09 12:15:45 +01:00
0c6465cd95 Merge pull request 'time stamper empty ctor' (#730) from eive/fsfw:empty_cds_short_ctor into development
Reviewed-on: fsfw/fsfw#730
2023-02-09 11:45:49 +01:00
f94987c46d Merge pull request 'RM3100 important bugfix' (#733) from eive/fsfw:rm3100_fixes into development
Reviewed-on: fsfw/fsfw#733
2023-02-09 11:41:53 +01:00
1809ce359b Merge pull request 'comment tweak to event parser can read everything' (#732) from eive/fsfw:health_if_update into development
Reviewed-on: fsfw/fsfw#732
2023-02-09 11:39:53 +01:00
8c712441ab Making fetch Catch2 quiet as well. 2023-02-09 11:34:58 +01:00
6ce80ea6c5
Merge branch 'possible_tcpip_bridge_fixes' into develop 2023-02-08 21:27:26 +01:00
f1b0ca7cff
add PR link 2023-02-08 21:26:37 +01:00
000df85556
bump changelog 2023-02-08 21:24:00 +01:00
1fffcc2229 possiible leak fixes 2023-02-08 21:23:21 +01:00
6f05d6b7b0
possiible leak fixes 2023-02-08 20:38:32 +01:00
7f907fb9d3 Merge remote-tracking branch 'origin/develop' into mueller/pus-15-tm-storage 2023-02-08 17:17:33 +01:00
a419806a05
Merge remote-tracking branch 'upstream/development' into mode_service_fixes 2023-02-08 09:33:13 +01:00
84bbef0167
make it consistent 2023-02-08 09:27:14 +01:00
88b2b0e005
Merge branch 'mode_service_fixes' into develop 2023-02-08 09:26:38 +01:00
6445debfa1
bump changelog 2023-02-08 09:24:55 +01:00
8014e4adf9
mode service fixes 2023-02-08 09:23:48 +01:00
84dc7ac0ce
bump changelog 2023-02-08 01:31:32 +01:00
ec12ab5daa
mode service fixes 2023-02-08 01:20:28 +01:00
134d908f26
that stuff is not in upstream yet.. 2023-02-07 12:52:18 +01:00
40a9e12416
1000 is a bit much 2023-02-07 12:47:40 +01:00
f39054edd4
introduce warning switch 2023-02-07 12:45:29 +01:00
5adf89b911
changelog update 2023-02-07 12:41:42 +01:00
c2e6a22dec
important bugfix for RM3100 2023-02-07 12:39:43 +01:00
c8e065a713
comment tweak to event parser can read everything 2023-02-07 12:36:42 +01:00
69c94645df
add back HAL section 2023-02-07 12:36:01 +01:00
37e850c5a7
use upstream changelog 2023-02-07 12:31:19 +01:00
3ed49dbae3
Merge remote-tracking branch 'upstream/development' into empty_cds_short_ctor 2023-02-07 12:24:02 +01:00
a1567de9e8 Merge branch 'develop' into mueller/pus-15-tm-storage 2023-02-07 12:21:35 +01:00
4cf52d5dfe Merge pull request 'Time Service 9 update' (#726) from eive/fsfw:updates_fixes_pus_time_service into development
Reviewed-on: fsfw/fsfw#726
2023-02-07 12:19:45 +01:00
2646707d3f Merge branch 'cmakelists_update' into develop 2023-02-07 12:18:49 +01:00
539d7aac9e
suppress error if ETL is not found 2023-02-07 12:17:03 +01:00
0a23f2c85a
correction for printout, add prefix 2023-02-07 12:15:44 +01:00
06e30684fe
Merge remote-tracking branch 'upstream/development' into develop 2023-02-07 12:14:31 +01:00
46230e6c6d
Merge remote-tracking branch 'upstream/development' into updates_fixes_pus_time_service 2023-02-07 12:11:29 +01:00
b22d439300
bump changelog 2023-02-07 12:10:11 +01:00
7e7b3bbbc9
time stamper empty ctor 2023-02-07 12:07:41 +01:00
06dca7608a
time stamper empty ctor 2023-02-07 12:06:34 +01:00
6af5274b68 Merge remote-tracking branch 'origin/develop' into mueller/pus-15-tm-storage 2023-02-07 10:51:17 +01:00
5b92247fbd Merge branch 'development' into add_health_service_announce_all 2023-02-06 16:31:05 +01:00
e2b66df72e Merge pull request 'various fixes related to linux Unittests and memory leaks' (#715) from eive/fsfw:unittest_fix_semaphore into development
Reviewed-on: fsfw/fsfw#715
2023-02-06 16:30:37 +01:00
d9da55fdab Merge branch 'development' into add_health_service_announce_all 2023-02-06 15:03:52 +01:00
7b828f233a Merge pull request 'I2C Linux: remove duplicate printout' (#718) from eive/fsfw:i2c_remove_duplicate_printout into development
Reviewed-on: fsfw/fsfw#718
2023-02-06 14:54:58 +01:00
c3d1000cd5 Merge branch 'development' into unittest_fix_semaphore 2023-02-06 14:46:45 +01:00
8e0e57714d Merge pull request 'allow using SO_REUSEADDR and SO_REUSEPORT on TCP server' (#722) from eive/fsfw:tcp_server_reuseaddr_reusesocket into development
Reviewed-on: fsfw/fsfw#722
2023-02-06 14:45:40 +01:00
066f7a6f9b
remove unreachable code 2023-02-06 14:41:14 +01:00
cc9e54ea6b Merge pull request 'improve srv20 error messages' (#723) from eive/fsfw:srv20_error_msgs into development
Reviewed-on: fsfw/fsfw#723
2023-02-06 14:37:26 +01:00
31465a4e0f Merge pull request 'MGM: small tweak, gain factor was always them same' (#724) from eive/fsfw:mgm_handler_small_fix into development
Reviewed-on: fsfw/fsfw#724
2023-02-06 14:36:34 +01:00
c0e5d1eb99 Merge branch 'development' into tcp_server_reuseaddr_reusesocket 2023-02-06 14:34:52 +01:00
3bc5d4a2e0
Merge remote-tracking branch 'upstream/development' into mgm_handler_small_fix 2023-02-06 14:25:33 +01:00
b1e9dd9e4a
Merge remote-tracking branch 'upstream/development' into updates_fixes_pus_time_service 2023-02-06 14:24:38 +01:00
ab86599db3 Merge pull request 'Bugfix DHB setNormalDatapoolEntriesInvalid' (#728) from eive/fsfw:bugfix_dhb_set_datapool_entries_invalid into development
Reviewed-on: fsfw/fsfw#728
2023-02-06 14:20:34 +01:00
034eb34c2e
small tweak 2023-02-03 16:05:50 +01:00
38789e053b
Merge branch 'bugfix_dhb_set_datapool_entries_invalid' into develop 2023-02-03 16:05:29 +01:00
4374c7c4f4
changelog 2023-02-03 16:01:56 +01:00
5343844be5 bugfix in setNormalDataPoolEntriesInvalid
Do not forget to call read and write to actually update the
validity state
2023-02-03 16:00:55 +01:00
e11eabdbcf
bugfix in setNormalDataPoolEntriesInvalid
Do not forget to call read and write to actually update the
validity state
2023-02-03 15:58:26 +01:00
3250bbf269
changelog update 2023-02-02 18:34:24 +01:00
a78fe0a7f3 Merge pull request 'RM3100 Z-Value fix' (#123) from RM3100-fix into develop
Reviewed-on: #123
Reviewed-by: Robin Müller <muellerr@irs.uni-stuttgart.de>
2023-02-02 18:33:13 +01:00
acfc1cbf21 bump changelog 2023-02-02 18:31:40 +01:00
d17ec02cf0 fixed Z value calculation 2023-02-02 18:26:08 +01:00
e300490b93 Merge pull request 'Bugfix PUS packet creators Sequence flags' (#727) from eive/fsfw:bugfix_pus_packets_seq_flags into development
Reviewed-on: fsfw/fsfw#727
2023-02-02 17:22:29 +01:00
f2461cd7e9
helper method for commanding mode 2023-02-02 16:22:29 +01:00
01cc619e67
Merge branch 'bugfix_pus_packets_seq_flags' into develop 2023-02-01 20:52:08 +01:00
0f811777a7
changelog update 2023-02-01 20:49:53 +01:00
e93137939e set sequence flags for PUS TMTC to unsegmented 2023-02-01 20:48:26 +01:00
2339712373
set sequence flags for PUS TMTC to unsegmented 2023-02-01 20:46:48 +01:00
c1f42618db small but important bugfix for health service 2023-02-01 19:59:32 +01:00
d9d253d3bb
small but important bugfix for health service 2023-02-01 19:58:27 +01:00
bd586f6564 Merge branch 'updates_fixes_pus_time_service' into develop 2023-02-01 18:42:18 +01:00
1f88c006d9
update changelog 2023-02-01 18:42:09 +01:00
5f481739d8
Merge branch 'updates_fixes_pus_time_service' into develop 2023-02-01 18:39:51 +01:00
7e94baceef
service 9 update
- fix time info event
- add time dump subservice
2023-02-01 18:39:23 +01:00
7ee83e4e5d
service 9 update
- fix time info event
- add time dump subservice
2023-02-01 18:10:07 +01:00
64787f85ca update changelog 2023-02-01 17:42:06 +01:00
61df451dd8
update changelog 2023-02-01 17:41:47 +01:00
29ea89044e beatufil 2023-02-01 17:35:49 +01:00
e487f5be87
proper announce all impl 2023-02-01 17:35:32 +01:00
1cacceddad
beatufil 2023-02-01 17:33:24 +01:00
5c35b8e3cd
proper announce all impl 2023-02-01 17:07:38 +01:00
9b05e8f274 re-order fields in TcpConfig 2023-01-30 14:24:48 +01:00
7766b24a1d
re-order fields in TcpConfig 2023-01-30 14:24:28 +01:00
eb223dae88
bump changelog 2023-01-30 14:20:28 +01:00
3656662d88 small tweak, gain factory was always them same 2023-01-30 14:18:03 +01:00
fe71978467 improve srv20 error messages 2023-01-30 14:15:37 +01:00
b646717a76
bump changelog 2023-01-30 14:11:00 +01:00
99d8c845f2 allow using SO_REUSEADDR and SO_REUSEPORT on TCP server 2023-01-30 14:07:41 +01:00
9a4ae550ab Merge branch 'develop' of https://egit.irs.uni-stuttgart.de/eive/fsfw into develop 2023-01-30 14:07:10 +01:00
c64b9b3e71
allow using SO_REUSEADDR and SO_REUSEPORT on TCP server 2023-01-30 14:05:39 +01:00
226818886f
improve srv20 error messages 2023-01-28 14:31:32 +01:00
da12495335
connect mode tree parent: make health helper optional 2023-01-27 15:08:24 +01:00
0cc3231ceb Merge remote-tracking branch 'origin/develop' into mueller/pus-15-tm-storage 2023-01-23 14:20:38 +01:00
049e3b431d
small tweak for printout 2023-01-23 11:31:00 +01:00
bd189518b6
small tweak, gain factory was always them same 2023-01-20 11:10:05 +01:00
0e7c6b117f Merge pull request 'Service 11 TC Scheduler Robustness Improvements' (#720) from service_11_bugfixes into development
Reviewed-on: fsfw/fsfw#720
2023-01-13 13:33:19 +01:00
accaf855ee Merge remote-tracking branch 'upstream/service_11_bugfixes' into develop 2023-01-13 11:19:17 +01:00
75fa7caf25
Merge remote-tracking branch 'upstream/development' into develop 2023-01-13 11:19:09 +01:00
d16c5024dc
small include improvement 2023-01-13 11:15:36 +01:00
a4531e4ced
typo 2023-01-13 10:59:39 +01:00
97c629ad84
update changelog 2023-01-13 10:53:36 +01:00
bf12f284fa
add size and crc check for contained TC 2023-01-13 10:53:04 +01:00
ba62c28b64 adding linux ci and fixing problems 2023-01-12 15:40:52 +01:00
041d1b8795 Merge remote-tracking branch 'origin/develop' into mueller/pus-15-tm-storage 2023-01-11 09:17:57 +01:00
7adb47aecb remove duplicate printout 2023-01-11 08:45:37 +01:00
5bb66c9723 remove duplicate printout 2023-01-10 11:55:54 +01:00
8589f4d63a Merge pull request 'updates for source sequence counter' (#714) from eive/fsfw:source_seq_counter_update into development
Reviewed-on: fsfw/fsfw#714
2022-12-19 15:00:28 +01:00
ca80589233
make get const 2022-12-19 14:58:08 +01:00
f2ebaed092 Merge pull request 'vec getter, reset for content' (#716) from eive/fsfw:get_cmd_exec_read_buf into development
Reviewed-on: fsfw/fsfw#716
2022-12-19 14:56:11 +01:00
f0b89e98df Merge pull request 'printout handling improvements' (#717) from eive/fsfw:i2c_printout_improvements into development
Reviewed-on: fsfw/fsfw#717
2022-12-19 14:45:04 +01:00
2aa4af6974
make function public 2022-12-14 13:50:57 +01:00
75fc7a056d Merge remote-tracking branch 'origin/develop' into mueller/pus-15-tm-storage 2022-12-12 09:02:04 +01:00
05cad893a2 introduce error counter to avoid spam 2022-12-06 10:05:23 +01:00
5557d95994 Merge branch 'development' into i2c_printout_improvements 2022-12-05 14:20:58 +01:00
fc24c9b5d8 Merge branch 'development' into get_cmd_exec_read_buf 2022-12-05 14:20:52 +01:00
1b005d706a Merge remote-tracking branch 'origin/develop' into mueller/pus-15-tm-storage 2022-12-01 16:40:39 +01:00
5b0ea91222
statically assert MAX_SIZE > 0 2022-11-29 23:24:29 +01:00
7ef69c839c Merge pull request 'small fix to allow teardown handling' (#713) from eive/fsfw:mueller/shutdown_for_failed_to_on_transition into development
Reviewed-on: fsfw/fsfw#713
2022-11-28 14:30:15 +01:00
9b798d798e Merge pull request 'DLE parser' (#711) from eive/fsfw:mueller/dle_parser into development
Reviewed-on: fsfw/fsfw#711
2022-11-28 14:13:18 +01:00
e68f54b9bd Merge remote-tracking branch 'origin/develop' into mueller/pus-15-tm-storage 2022-11-28 11:37:15 +01:00
8eb869e073
run black 2022-11-28 11:21:36 +01:00
b13453f46b
vec getter, reset for content 2022-11-28 08:43:54 +01:00
d0e322d7e2
printout handling improvements 2022-11-28 08:42:08 +01:00
46a1c2bace
remove data wrapper 2022-11-28 08:35:10 +01:00
2643ff194c
Merge remote-tracking branch 'upstream/development' into develop 2022-11-28 08:34:04 +01:00
ecde164f68
updates for source sequence counter 2022-11-28 08:30:45 +01:00
50930b41ba
Merge remote-tracking branch 'upstream/development' into mueller/dle_parser 2022-11-28 08:27:24 +01:00
296bc56e2a Merge remote-tracking branch 'origin/develop' into mueller/pus-15-tm-storage 2022-11-24 15:16:34 +01:00
d6ee2ed400 Merge pull request 'AcceptsTelemetryIF tweaks' (#712) from eive/fsfw:mueller/accepts_tm_if_adaptions into development
Reviewed-on: fsfw/fsfw#712
2022-11-21 16:30:43 +01:00
f2150ff9c2 Merge pull request 'only delete table entry if not nullptr' (#710) from eive/fsfw:mueller/health_helper_bugfix into development
Reviewed-on: fsfw/fsfw#710
2022-11-21 16:24:13 +01:00
1b9c98f3fe Merge pull request 'uio able to resolve symlinks now' (#709) from eive/fsfw:mueller/uio_mapper_handle_symlinks into development
Reviewed-on: fsfw/fsfw#709
2022-11-21 16:14:36 +01:00
742152b28e Merge branch 'development' into mueller/accepts_tm_if_adaptions 2022-11-21 15:29:35 +01:00
bf4ca56658 Merge branch 'development' into mueller/shutdown_for_failed_to_on_transition 2022-11-21 15:29:11 +01:00
16ffa00155 Merge branch 'development' into mueller/dle_parser 2022-11-21 15:28:34 +01:00
14c681c93a Merge branch 'development' into mueller/uio_mapper_handle_symlinks 2022-11-21 15:27:06 +01:00
0958c3a00e Merge branch 'development' into mueller/health_helper_bugfix 2022-11-21 15:24:51 +01:00
d699d16307 Merge pull request 'SP reader getPacketData is const now' (#708) from eive/fsfw:mueller/sp_reader_const_get_data into development
Reviewed-on: fsfw/fsfw#708
2022-11-21 15:23:39 +01:00
3b0fed733f Merge branch 'development' into mueller/uio_mapper_handle_symlinks 2022-11-21 15:23:15 +01:00
23d3812fe3
this is actually important 2022-11-21 15:22:25 +01:00
dec7db3ae2
Merge remote-tracking branch 'upstream/development' into mueller/accepts_tm_if_adaptions 2022-11-21 15:00:06 +01:00
65a5abab49
move free call 2022-11-21 14:56:08 +01:00
0129783e34 Merge branch 'development' into mueller/sp_reader_const_get_data 2022-11-21 14:50:44 +01:00
cabe0868ec Merge pull request 'move container returnvalues to namespace' (#707) from eive/fsfw:mueller/update_containers_retval into development
Reviewed-on: fsfw/fsfw#707
2022-11-21 14:49:44 +01:00
f05295bada small fix to allow teardown handling 2022-11-17 15:16:29 +01:00
160ff799ac
small fix to allow teardown handling 2022-11-17 15:09:08 +01:00
b85ca64690
update changelog 2022-11-15 11:48:28 +01:00
3bc3da5a8d
update changelog 2022-11-15 11:47:26 +01:00
f8c07ec9cf
update changelog 2022-11-15 11:46:43 +01:00
8199b8f359
bump changelog 2022-11-15 11:45:39 +01:00
cbc8dbcdd4
update changelog 2022-11-15 11:44:45 +01:00
d31a5306f0
fix mock 2022-11-15 11:41:03 +01:00
a236a5ec50
adaptions for AcceptsTelemetryIF 2022-11-15 11:40:26 +01:00
03620970e2
function to get queue is const now 2022-11-15 11:38:32 +01:00
8fe8d810e9
only delete table if not nullptr 2022-11-15 11:27:31 +01:00
9483c2809d
DLE parser 2022-11-15 11:26:53 +01:00
fe3d6bd432
uio able to resolve symlinks now 2022-11-15 10:56:46 +01:00
c5f91926c9
remove includes 2022-11-15 10:54:47 +01:00
be4a87535d
remove data wrapper 2022-11-15 10:54:11 +01:00
99927b8e95
afmt 2022-11-15 10:53:38 +01:00
5e5eb82830
make warning switch protected 2022-11-15 10:53:14 +01:00
686dc97234
this is better / more correct 2022-11-15 10:52:47 +01:00
2a842666d5
SP reader getPacketData is const now 2022-11-15 10:46:46 +01:00
c013fcc1f5
move container retvals to namespace 2022-11-15 10:01:37 +01:00
1f58ba1f9b
update changelog 2022-11-15 09:58:15 +01:00
002845108d Merge remote-tracking branch 'upstream/development' into develop_update 2022-11-14 15:05:47 +01:00
1b8fc2af19 Merge pull request 'CFDP Update' (#682) from mueller/cfdp-update-without-handlers into development
Reviewed-on: fsfw/fsfw#682
2022-11-14 15:04:43 +01:00
72d7c43445
updates for storage manager mock 2022-11-14 14:57:37 +01:00
ab9b6c8c89
Merge remote-tracking branch 'origin/development' into mueller/cfdp-update-without-handlers 2022-11-14 14:51:33 +01:00
69d338f9bb Merge pull request 'Local Pool Update Remove Add Data Ignore Fault Argument' (#701) from eive/fsfw:mueller/local-pool-update-remove-ignore-fault-arg into development
Reviewed-on: fsfw/fsfw#701
2022-11-14 14:49:34 +01:00
68223869d5 Merge branch 'development' into mueller/local-pool-update-remove-ignore-fault-arg 2022-11-14 14:47:07 +01:00
93fda71989 Merge pull request 'refactoring of serial drivers for linux' (#705) from eive/fsfw:mueller/refactor_serial_linux into development
Reviewed-on: fsfw/fsfw#705
2022-11-14 14:39:41 +01:00
7b0db08962 Merge branch 'development' into mueller/refactor_serial_linux 2022-11-14 14:36:31 +01:00
0956fbc740 Merge pull request 'fix compiler warning for fixed array list copy ctor' (#704) from eive/fsfw:mueller/fixed_array_list_copy_ctor into development
Reviewed-on: fsfw/fsfw#704
2022-11-14 14:28:46 +01:00
b48e0fdc0d
Merge remote-tracking branch 'origin/development' into mueller/cfdp-update-without-handlers 2022-11-14 14:25:36 +01:00
1d084ee22f Merge branch 'development' into mueller/fixed_array_list_copy_ctor 2022-11-14 14:21:04 +01:00
1bea2344f6
remove using declaraction 2022-11-14 14:21:00 +01:00
d7e16a67a7 Merge pull request 'Windows Tweaks' (#691) from eive/fsfw:windows-tweaks-upstream into development
Reviewed-on: fsfw/fsfw#691
2022-11-14 14:18:47 +01:00
6021d897b8 Merge branch 'development' into windows-tweaks-upstream 2022-11-14 14:13:57 +01:00
83a6f0b5f8
reenable setup function call 2022-11-14 14:12:26 +01:00
a9c6c088f2
remove leftover debugging code 2022-11-14 14:08:38 +01:00
2b6a33e718
afmt 2022-11-11 14:13:46 +01:00
61fd5d1b62
impl function to generate ASCII timestamp sec accuracy 2022-11-11 14:12:42 +01:00
046dbe1deb
Merge branch 'develop' into mueller/pus-15-tm-storage 2022-11-11 11:38:32 +01:00
e03e7f5260
Merge branch 'mueller/refactor_serial_linux' into develop 2022-11-11 11:37:55 +01:00
b6a3c206cc
smaller include tweaks 2022-11-11 11:34:58 +01:00
5b352978c5
rename cookie class 2022-11-11 11:33:35 +01:00
0303c1a885
remove file 2022-11-11 11:31:22 +01:00
4d2802a470
Merge remote-tracking branch 'origin/develop' into mueller/pus-15-tm-storage 2022-11-11 11:29:29 +01:00
819a298b19
refactoring of serial drivers for linux 2022-11-10 17:50:21 +01:00
39946bff58
some renaming and tweaks for linux serial driver 2022-11-10 17:31:11 +01:00
16246d6ece
replace other memcpy 2022-11-10 16:18:36 +01:00
5c84f12440 this not crash 2022-11-10 16:15:52 +01:00
2a203ae13d
this not crash 2022-11-10 16:15:28 +01:00
6ca1a5c796
fix unittests 2022-11-10 16:11:05 +01:00
83c2c4825c fix compiler error for fixed array list copy ctor 2022-11-10 15:54:03 +01:00
194b3e100a
fix compiler error for fixed array list copy ctor 2022-11-10 15:53:18 +01:00
177c39dd53
helper interface implementations 2022-11-10 15:38:34 +01:00
530a261e14
dedicated header file for container retvals 2022-11-10 15:12:18 +01:00
c913fe40bf tweaks 2022-11-09 17:54:08 +01:00
70ec08bf1d Merge pull request 'missing include' (#703) from KSat/fsfw:mueller/time_reader_include into development
Reviewed-on: fsfw/fsfw#703
2022-11-09 16:59:25 +01:00
ef23665d9c Merge branch 'development' into mueller/time_reader_include 2022-11-09 16:39:55 +01:00
eefc122292 Merge pull request 'defaultconfig did not build anymore' (#702) from mohr/fix_defaultconfig into development
Reviewed-on: fsfw/fsfw#702
2022-11-09 14:12:41 +01:00
bee33526a1
missing include 2022-11-09 13:49:40 +01:00
0e8f5ddd26
added missing const specifier 2022-11-08 11:07:56 +01:00
672fca5169
extend uart helper a bit 2022-11-04 11:08:23 +01:00
84b9d1ce21 Merge pull request 'dhb2normal' (#115) from eive/dhb2normal into develop
Reviewed-on: #115
2022-11-03 15:32:26 +01:00
e5b5c7d253
higher default MQ depth for events, printout tweak 2022-11-03 10:33:52 +01:00
9a0cc64be3 Merge branch 'develop' into eive/dhb2normal 2022-11-03 10:12:19 +01:00
00f1c5bbe9
missing replacements 2022-11-03 10:12:05 +01:00
8a61af779d Merge remote-tracking branch 'origin/develop' into eive/dhb2normal 2022-11-03 10:10:47 +01:00
6efa482eb0
use uniform uart api 2022-11-03 10:10:36 +01:00
f0fa1bf477 Merge remote-tracking branch 'origin/develop' into eive/dhb2normal 2022-11-03 10:08:35 +01:00
91ebf98c28
add new ping with data TC 2022-11-02 19:35:22 +01:00
e1d4209fbe missing fifo pop command 2022-11-02 16:07:00 +01:00
e302c89f74 health helper dtor bugfix 2022-11-02 15:48:13 +01:00
a38279f813 Merge branch 'develop' into eive/dhb2normal 2022-11-02 10:47:25 +01:00
7600ed1ea7 Merge pull request 'Improve Subsystem DHB logic' (#112) from mueller/improve-ss-dhb-logic into develop
Reviewed-on: #112
2022-11-02 10:32:25 +01:00
61ab770d9d Merge branch 'develop' into mueller/improve-ss-dhb-logic 2022-11-02 10:31:43 +01:00
033676ad3b
smaller fixes for DHB 2022-10-28 10:30:48 +02:00
e2eeccce50
Merge remote-tracking branch 'upstream/mohr/dhb2normal' into mohr/dhb2normal 2022-10-28 10:17:37 +02:00
f805667779
afmt 2022-10-28 10:16:59 +02:00
af06969905
Merge remote-tracking branch 'upstream/mohr/dhb2normal' into mohr/dhb2normal 2022-10-28 10:15:40 +02:00
2461209169
Merge remote-tracking branch 'upstream/development' into develop 2022-10-28 10:10:20 +02:00
f715b65d6e
Merge remote-tracking branch 'upstream/development' into mueller/local-pool-update-remove-ignore-fault-arg 2022-10-28 10:06:04 +02:00
c11af63015
Merge remote-tracking branch 'origin/development' into mueller/cfdp-update-without-handlers 2022-10-28 10:04:21 +02:00
852f27cec2 Merge remote-tracking branch 'origin/develop' into mueller/improve-ss-dhb-logic 2022-10-27 16:58:30 +02:00
226dc4d8b7
UIO mapper can handle symlinks now 2022-10-27 14:01:35 +02:00
fa01798ebb Merge remote-tracking branch 'origin/develop' into mueller/improve-ss-dhb-logic 2022-10-27 08:30:30 +02:00
1b7e94d718 this api works as well 2022-10-26 18:26:48 +02:00
60ff411721 improvements for HAL com IFs 2022-10-26 17:06:24 +02:00
bddc7a7ca6 minimal first version 2022-10-26 13:22:16 +02:00
819a2bfac4
add prototype for new ToAscii CCSDSTime function 2022-10-25 18:20:48 +02:00
1f05e6b297
fs retval 2022-10-25 11:30:44 +02:00
11a22577be defaultconfig did not build anymore 2022-10-25 11:28:13 +02:00
dc1583c932 Merge branch 'development' into windows-tweaks-upstream 2022-10-24 17:10:44 +02:00
94f1f1f908 Merge pull request 'Refactor TM and TC acceptor interfaces' (#684) from mueller/refactor-accepts-tc-tm-if into development
Reviewed-on: fsfw/fsfw#684
2022-10-24 17:10:03 +02:00
81a7de2814
make dtor virtual 2022-10-24 16:39:32 +02:00
d26f230bee
builds 2022-10-24 15:43:20 +02:00
4db124c680
ignore fault 2022-10-24 15:41:29 +02:00
955579c856 Merge branch 'development' into mueller/refactor-accepts-tc-tm-if 2022-10-24 14:57:38 +02:00
2df66c9304 Merge branch 'mueller/local-pool-update' of https://egit.irs.uni-stuttgart.de/fsfw/fsfw into mueller/local-pool-update 2022-10-24 14:39:11 +02:00
54ad6b3016
add some docs 2022-10-24 14:39:05 +02:00
73e313c35b Merge branch 'development' into mueller/local-pool-update 2022-10-24 14:35:24 +02:00
c6585c8645 Merge pull request 'important bugfix for linux i2c device com IF' (#700) from eive/fsfw:mueller/i2c-com-if-bugfix into development
Reviewed-on: fsfw/fsfw#700
2022-10-24 14:35:01 +02:00
dd2f42d22b Merge branch 'development' into mueller/local-pool-update 2022-10-24 14:34:56 +02:00
d8a4675842
bump changelog 2022-10-24 14:30:14 +02:00
b0c5a49b50
iter not a member anymore, more bugfixes 2022-10-24 14:24:57 +02:00
1164c21ddd
iter not a member anymore, more bugfixes 2022-10-24 14:23:43 +02:00
096af44e39
needs some fixing 2022-10-24 10:56:01 +02:00
56e8e5a8b3
dont know if I am going to need this 2022-10-24 10:39:43 +02:00
11422a658c Merge remote-tracking branch 'origin/develop' into mueller/improve-ss-dhb-logic 2022-10-21 15:35:27 +02:00
754b71a35f Merge pull request 'Update CFDP components' (#113) from mueller/update-cfdp-components into develop
Reviewed-on: #113
2022-10-21 15:27:40 +02:00
2de9e25ceb Merge remote-tracking branch 'upstream/mueller/new-cfdp-update-with-handlers' into mueller/update-cfdp-components 2022-10-21 11:21:26 +02:00
ec7566fb8c Merge remote-tracking branch 'origin/develop' into mueller/improve-ss-dhb-logic 2022-10-20 16:59:53 +02:00
73454c629c
oh god 2022-10-20 16:05:45 +02:00
77b1a85b47 important bugfix for i2c device com IF 2022-10-20 14:24:40 +02:00
0c5c2f6c4f
important bugfix for i2c device com IF 2022-10-20 14:24:03 +02:00
009700ce80
remove info printout 2022-10-17 17:29:10 +02:00
652c31a683 missing validity check 2022-10-17 17:25:27 +02:00
1e43296f2b
missing validity check 2022-10-17 17:24:46 +02:00
1aa062df7f
const specifier for AcceptsTelemetryIF 2022-10-17 16:27:41 +02:00
bfe120636c
this should have the same effect 2022-10-17 15:08:46 +02:00
a8041f220f Merge branch 'development' into mueller/cfdp-update-without-handlers 2022-10-17 14:44:28 +02:00
dd636b186b size check bugfix 2022-10-17 14:30:27 +02:00
3349fc36f8 Merge branch 'development' into windows-tweaks-upstream 2022-10-17 14:20:48 +02:00
14a8924a83
size check bugfix 2022-10-17 14:01:21 +02:00
9f81926aec
some more basic error handling 2022-10-17 12:22:01 +02:00
79c38b45df
events for FSFW specific errors 2022-10-17 12:20:26 +02:00
e893e73f86
add first CFDP events 2022-10-17 12:19:31 +02:00
f3e9277e59 Merge branch 'development' into mueller/refactor-accepts-tc-tm-if 2022-10-10 15:45:05 +02:00
d592f1ecbc Merge pull request 'Minor API tweak' (#689) from eive/fsfw:mueller/smaller-tweaks into development
Reviewed-on: fsfw/fsfw#689
2022-10-10 15:10:57 +02:00
6ec18171a8 Merge pull request 'now that doc server is up, remove markdown files' (#688) from mueller/remove-markdown-docs into development
Reviewed-on: fsfw/fsfw#688
2022-10-10 15:04:11 +02:00
518dcdef4b Merge branch 'development' into mueller/smaller-tweaks 2022-10-10 15:03:04 +02:00
d9730032fd Merge pull request 'DHB Countdown Bug' (#693) from eive/fsfw:mueller/dhb-countdown-bug into development
Reviewed-on: fsfw/fsfw#693
2022-10-10 14:55:43 +02:00
b3ac72b7db Merge pull request 'missing retval conv' (#697) from mueller/missing-retval-conversion into development
Reviewed-on: fsfw/fsfw#697
2022-10-10 14:54:26 +02:00
cd0cb43412 Merge branch 'development' into mueller/missing-retval-conversion 2022-10-10 14:46:10 +02:00
32c12b3dbf Merge pull request 'small fix for helper' (#698) from mueller/small-helper-script-fix into development
Reviewed-on: fsfw/fsfw#698
2022-10-10 14:43:59 +02:00
3e9acf476e Merge branch 'development' into mueller/small-helper-script-fix 2022-10-10 14:25:49 +02:00
99101ce2bf Merge pull request 'hotfix' (#699) from eive/fsfw:mueller/dhb-some-more-fixes into development
Reviewed-on: fsfw/fsfw#699
2022-10-10 14:22:30 +02:00
6b991045f7 Merge branch 'development' into mueller/smaller-tweaks 2022-10-10 13:41:47 +02:00
df06064df0 Merge branch 'development' into windows-tweaks-upstream 2022-10-10 13:41:09 +02:00
1d6ccfe5ab
Service 200: Add mode announcement support 2022-10-10 11:06:58 +02:00
221df7ece6
allow recursive mode announcements 2022-10-10 10:46:29 +02:00
7f180ac1fa
Merge remote-tracking branch 'origin/develop' into mueller/improve-ss-dhb-logic 2022-10-10 10:29:08 +02:00
337cb0d6c9
hotfix 2022-10-10 10:21:17 +02:00
692be9df8d DHB bugfix and addition 2022-10-06 16:57:47 +02:00
8195587604 Merge branch 'mueller/uart-helper-module' into mueller/simplify-dle-parser 2022-10-06 11:14:54 +02:00
40e7b2dc31
new uart helper module 2022-10-06 11:14:00 +02:00
1c53b60442
small additional tweak 2022-10-04 23:04:28 +02:00
d1630cdc4c
something is wrong 2022-10-04 21:17:35 +02:00
49747fc8a4
some bugfixes 2022-10-04 20:51:58 +02:00
cfc00d0260
try to do this in a simpler way 2022-10-04 18:38:20 +02:00
c283e0c988
okay this is correct 2022-10-04 11:02:08 +02:00
448d20f3bd
small fix for helper 2022-10-04 10:55:46 +02:00
2316728d74 Merge branch 'development' into mueller/dhb-countdown-bug 2022-10-04 10:53:26 +02:00
6f562e5f3e
missing retval conv 2022-10-04 10:25:58 +02:00
1eceef4645
move retvals 2022-09-30 15:05:32 +02:00
176f243194 Merge pull request 'Switch to new documentation server' (#694) from mohr/documentation_ci into development
Reviewed-on: fsfw/fsfw#694
2022-09-30 15:05:16 +02:00
d964fa2107 Merge branch 'development' into mohr/documentation_ci 2022-09-30 14:50:20 +02:00
7b5ae6a445 done? 2022-09-30 14:40:59 +02:00
8e362a000c Revert "one last check"
This reverts commit 7877776e24.
2022-09-30 14:36:25 +02:00
7877776e24 one last check 2022-09-30 14:34:25 +02:00
acab5f6bce
added missing health and mode helper init 2022-09-30 14:14:45 +02:00
10dd855244
expose child itself in interface 2022-09-30 13:30:07 +02:00
f824004897
need to fix all of these TODOs 2022-09-29 19:39:37 +02:00
7c5308429c
this seems to work 2022-09-29 19:21:24 +02:00
f78344b8fb Merge remote-tracking branch 'origin/develop' into mueller/improve-ss-dhb-logic 2022-09-29 17:46:54 +02:00
3de0ae5a48 DHB bug 2022-09-29 17:22:44 +02:00
b9d0ff8fb7
DHB bug 2022-09-29 17:20:18 +02:00
77f7fa2ef1
typo 2022-09-29 16:48:23 +02:00
78314ad966
this makes a bit more sense 2022-09-29 16:47:23 +02:00
227535c461
formatting and smaller stuff 2022-09-29 16:46:55 +02:00
c47bed0760 small important bugfix for DLE parser 2022-09-28 17:04:11 +02:00
9927dbb2e4 Merge branch 'windows-tweaks' into develop 2022-09-28 10:06:08 +02:00
e0c780f21c better comment 2022-09-28 09:59:31 +02:00
876815b1c9 another small windows tweak 2022-09-28 09:59:22 +02:00
b0ecf87580 last windows tweak 2022-09-28 09:59:12 +02:00
68ce8b5b08 tweaks to make windows build again 2022-09-28 09:59:02 +02:00
14a48fe41d
better comment 2022-09-28 09:56:20 +02:00
c932e51818 Merge branch 'windows-tweaks' into develop 2022-09-28 00:03:51 +02:00
2ca8d72e83
another small windows tweak 2022-09-28 00:03:12 +02:00
03e1a93250
last windows tweak 2022-09-27 23:57:58 +02:00
6d2f44a432
tweaks to make windows build again 2022-09-27 21:46:11 +02:00
fe03da6def
Merge remote-tracking branch 'origin/development' into mueller/cfdp-update-without-handlers 2022-09-26 15:38:45 +02:00
95ac53c417 Merge branch 'development' into mueller/smaller-tweaks 2022-09-26 14:40:29 +02:00
62f638a3d2 Merge pull request 'doc corrections' (#687) from mueller/doc-corrections into development
Reviewed-on: fsfw/fsfw#687
2022-09-26 14:38:39 +02:00
bd64591f30 Merge branch 'development' into mueller/smaller-tweaks 2022-09-26 14:34:38 +02:00
e6a877f048 Merge branch 'development' into mueller/doc-corrections 2022-09-26 14:26:48 +02:00
ea8c557ee8 Merge pull request 'better error printout' (#686) from eive/fsfw:mueller/local-pool-obj-base-better-warning into development
Reviewed-on: fsfw/fsfw#686
2022-09-26 14:26:20 +02:00
0bdd780f82 Merge branch 'development' into mueller/doc-corrections 2022-09-26 14:17:24 +02:00
9ec397c8b7 Merge branch 'development' into mueller/local-pool-obj-base-better-warning 2022-09-26 14:17:19 +02:00
c54d9d7ba6
add some tests 2022-09-26 14:15:11 +02:00
30c03c110c Merge pull request 'include correction' (#683) from mueller/service-interface-include-correction into development
Reviewed-on: fsfw/fsfw#683
2022-09-26 14:14:57 +02:00
69f1be263a Merge branch 'development' into mueller/local-pool-obj-base-better-warning 2022-09-26 14:10:21 +02:00
c7b5309dcb Merge branch 'development' into mueller/service-interface-include-correction 2022-09-26 14:08:38 +02:00
775d5632de update to ssh connection to doc server 2022-09-23 20:26:45 +02:00
4f3361eb2b another ci check 2022-09-23 18:33:47 +02:00
9e6c1d60e5 another ci check 2022-09-23 17:54:41 +02:00
12d0c23c13 Revert "testing deployment of documentation"
This reverts commit 5488ee715f.
2022-09-23 17:31:17 +02:00
5c3bb13834 Revert "testing deployment of both development and master doc"
This reverts commit c0000a8635.
2022-09-23 17:31:07 +02:00
292fe3e5e4 forgot epilog file 2022-09-23 17:11:57 +02:00
33530f2819 adding Impressum and Datenschutz to lcov output 2022-09-23 17:04:35 +02:00
c0000a8635 testing deployment of both development and master doc 2022-09-23 14:14:10 +02:00
5488ee715f testing deployment of documentation 2022-09-23 14:07:12 +02:00
0fea22d031 switching to rsync and deploying to web documentation 2022-09-23 14:06:28 +02:00
3b8ca09299 prepared docker for documentation rsync 2022-09-23 13:46:03 +02:00
9a2146fa2d added impressum and datenschutz in sphinx documentation 2022-09-23 11:36:29 +02:00
808e3e0462
remove unused variable 2022-09-16 18:54:48 +02:00
558550ecb9 Merge branch 'development' into mueller/smaller-tweaks 2022-09-16 18:37:39 +02:00
79ab0c4aa5 Merge branch 'mueller/smaller-tweaks' into develop 2022-09-16 18:24:39 +02:00
72172a972b
update changelog 2022-09-16 18:24:23 +02:00
b4b11ebd3b fixes and tweaks 2022-09-16 18:20:42 +02:00
c5b24f2516
fixes and tweaks 2022-09-16 18:08:20 +02:00
bdbe0cc9da pass message queue externally 2022-09-16 16:28:41 +02:00
e2c1158337
pass message queue externally 2022-09-16 16:27:57 +02:00
95aac7dc8d Merge pull request 'CFDP FSFW Integration' (#111) from cfdp-integration into develop
Reviewed-on: #111
2022-09-16 11:11:20 +02:00
3d2fc28468
Merge remote-tracking branch 'upstream/mueller/new-cfdp-update-with-handlers' into cfdp-integration 2022-09-16 11:10:35 +02:00
1898b4f2db Merge remote-tracking branch 'upstream/development' into update-from-upstream 2022-09-16 11:06:05 +02:00
c38088c64b
adaptions for enum renaming 2022-09-15 18:44:00 +02:00
7eb63d6d79 Merge branch 'mueller/cfdp-update-without-handlers' into mueller/new-cfdp-update-with-handlers 2022-09-15 18:41:29 +02:00
6f8ccf83e7
use singular enum names 2022-09-15 18:41:15 +02:00
67f1cd0b5f Merge branch 'development' into mueller/cfdp-update-without-handlers 2022-09-15 18:35:22 +02:00
1d54507517 Merge pull request 'merge upstream development' (#110) from mohr/merge-upstream into develop
Reviewed-on: #110
Reviewed-by: Robin Müller <muellerr@irs.uni-stuttgart.de>
2022-09-15 18:34:50 +02:00
ef9ed95fd1 Merge branch 'develop' into mohr/merge-upstream 2022-09-15 18:34:37 +02:00
ed68268c0c
generic cfdp handler wrapper 2022-09-15 16:53:04 +02:00
c549914efb
include helpers 2022-09-15 16:50:06 +02:00
753d5ff39e
adaptions for enum renaming 2022-09-15 16:47:09 +02:00
36ca35da77 Merge branch 'mueller/cfdp-update-without-handlers' into mueller/new-cfdp-update-with-handlers 2022-09-15 16:46:25 +02:00
54762232a4
refactoring and condition code to strin converter 2022-09-15 16:46:09 +02:00
4fb7375492 Merge branch 'mueller/cfdp-update-without-handlers' into mueller/new-cfdp-update-with-handlers 2022-09-15 16:21:32 +02:00
2fee2fdff5
unittest which would have caught this 2022-09-15 16:20:52 +02:00
47df9e8b5b Merge branch 'mueller/cfdp-update-without-handlers' into mueller/new-cfdp-update-with-handlers 2022-09-15 16:03:06 +02:00
954c749de0
additional docs 2022-09-15 16:02:46 +02:00
bcbbc9763a
markdown update not required, will be removed 2022-09-15 14:00:01 +02:00
0042372cb6
now that doc server is up, remove markdown files 2022-09-15 13:58:13 +02:00
8dea13742f
update rst file 2022-09-15 13:57:39 +02:00
0f027d29d2 doc corrections 2022-09-15 13:53:42 +02:00
131e3ff1e3 Revert "doc corrections"
This reverts commit 423a9540ed.
2022-09-15 13:52:28 +02:00
423a9540ed
doc corrections 2022-09-15 13:51:59 +02:00
ce7146e468
printout tweak 2022-09-15 13:40:12 +02:00
a681a4a797 better error printout 2022-09-15 13:38:38 +02:00
86aafe4422 Merge branch 'mueller/cfdp-update-without-handlers' into mueller/new-cfdp-update-with-handlers 2022-09-15 11:02:46 +02:00
e585c1d84a
Merge remote-tracking branch 'origin/development' into mueller/cfdp-update-without-handlers 2022-09-15 11:02:04 +02:00
83b7b8707c
Merge remote-tracking branch 'origin/development' into mueller/refactor-accepts-tc-tm-if 2022-09-15 11:01:19 +02:00
4002b74ea2 Merge branch 'development' into mueller/service-interface-include-correction 2022-09-15 11:01:06 +02:00
4f7f8310c9
Merge remote-tracking branch 'origin/development' into mueller/local-pool-update 2022-09-15 11:00:43 +02:00
1a833e2d45
another missing changelog entry 2022-09-15 10:59:10 +02:00
8df6d934d7
another missing changelog entry 2022-09-15 10:56:52 +02:00
5363868120
added another missing changelog entry 2022-09-15 10:54:45 +02:00
36cf59cc8e
Merge branch 'mueller/refactor-accepts-tc-tm-if' into mueller/cfdp-update-without-handlers 2022-09-15 10:52:13 +02:00
97fec909f2
Merge branch 'mueller/local-pool-update' into mueller/cfdp-update-without-handlers 2022-09-15 10:50:35 +02:00
1db77753e3
Merge remote-tracking branch 'origin/development' into mueller/local-pool-update 2022-09-15 10:49:24 +02:00
8501477a78
Merge remote-tracking branch 'origin/development' into mueller/refactor-accepts-tc-tm-if 2022-09-15 10:48:42 +02:00
6eea711d9f Merge branch 'development' into mueller/service-interface-include-correction 2022-09-15 10:48:28 +02:00
9a181aa6a8
another missing changelog entry 2022-09-15 10:47:50 +02:00
655c944c0e
another missing changelog entry 2022-09-15 10:45:35 +02:00
2e310fca8d
add another missing changelog entry 2022-09-15 10:43:45 +02:00
37390dfc74
add missing changelog entry 2022-09-15 10:42:35 +02:00
75ddfdc65d
Merge branch 'mueller/refactor-accepts-tc-tm-if' into mueller/cfdp-update-without-handlers 2022-09-15 10:41:16 +02:00
1efc0d2855
update changelog 2022-09-15 10:38:40 +02:00
e063b44899
add link to PR 2022-09-15 10:32:38 +02:00
b3c0e24611
bump changelog 2022-09-15 10:31:55 +02:00
ab7c3480f5
storage manager update 2022-09-15 10:30:22 +02:00
237e29cc59
all necessary modifications 2022-09-14 20:21:03 +02:00
0849c8a08d
adding files manually 2022-09-14 20:10:41 +02:00
9d626e0a5d
include correction 2022-09-14 19:59:02 +02:00
723f8749d4
bump changelog 2022-09-14 19:52:33 +02:00
dbaeed83af Merge branch 'mueller/cfdp-update-without-handlers' into mueller/new-cfdp-update-with-handlers 2022-09-14 19:48:25 +02:00
2e27a85c95
finished renaming operation 2022-09-14 19:48:11 +02:00
385a0ffd73
add CFDP handlers manually 2022-09-14 19:29:43 +02:00
73f1917c81
update changelog 2022-09-14 19:26:07 +02:00
3a52454949
removed handlers 2022-09-14 19:15:52 +02:00
ac7dc55fc1
fix unittest 2022-09-14 19:07:17 +02:00
389d804735 Merge remote-tracking branch 'origin/development' into mueller/cfdp-routers 2022-09-14 19:05:59 +02:00
44615c150b
add printout capabilities 2022-09-14 14:00:20 +02:00
bd594123a2 Merge remote-tracking branch 'upstream/development' into mohr/merge-upstream 2022-09-14 12:54:15 +02:00
0ce568ad26 Merge pull request 'publish documentation for development and master branch' (#681) from mohr/documentation_ci into development
Reviewed-on: fsfw/fsfw#681
2022-09-14 11:22:35 +02:00
6970068d56 small fix in README 2022-09-13 18:19:35 +02:00
af282c7d3e reverting to only publish development 2022-09-13 18:17:56 +02:00
21a9d89fb3 pushing code coverage report to documentation server 2022-09-13 18:14:26 +02:00
3257935150 fixing scp yet again again 2022-09-13 18:06:16 +02:00
f34cf9095d fixing scp yet again 2022-09-13 18:02:38 +02:00
24ecf125a3 fixing scp command again 2022-09-13 17:55:12 +02:00
6451a16888 fixing scp command 2022-09-13 17:51:01 +02:00
4dadef34fd Merge remote-tracking branch 'origin/development' into mueller/cfdp-routers 2022-09-13 15:35:59 +02:00
382543fc59
important bugfix 2022-09-13 15:26:14 +02:00
fa5605c959 testing Jenkinsfile 2022-09-13 14:50:37 +02:00
a1ea671e2f
header include update 2022-09-13 14:46:41 +02:00
8e835be55f testing Jenkinsfile 2022-09-13 14:46:12 +02:00
9bd600c488 testing Jenkinsfile 2022-09-13 14:32:10 +02:00
9c7248e78e typo in Dockerfile 2022-09-13 14:20:30 +02:00
ecf51b2913 testing Jenkinsfile 2022-09-13 14:09:08 +02:00
8bbde05413 add jenkins user in docker so that ssh will work 2022-09-13 14:08:04 +02:00
d79b5348d8 testing Jenkinsfile 2022-09-13 14:00:36 +02:00
92e3ab04f3 testing Jenkinsfile 2022-09-13 13:54:23 +02:00
003a6d00fa Documentation build tools in docker 2022-09-13 13:13:18 +02:00
26b3e5a013
fix misc def config 2022-09-12 15:14:42 +02:00
3e9b47d3a2
update docs release in conf.py 2022-09-12 15:12:26 +02:00
9ee1896553 Merge pull request 'Refactor Local Pool API' (#667) from mueller/refactor-local-pool-api into development
Reviewed-on: fsfw/fsfw#667
2022-09-12 14:32:08 +02:00
a5b5523111 Merge pull request 'Refactor TMTC Stack, improve test framework' (#655) from mueller/refactor-tmtc-stack into development
Reviewed-on: fsfw/fsfw#655
2022-09-12 14:31:22 +02:00
62cd39e573 Merge pull request 'SerialBufferAdapter refactoring' (#677) from mueller/refactor-serial-buffer-adapter into development
Reviewed-on: fsfw/fsfw#677
2022-09-12 14:30:51 +02:00
278ed36db8 Merge pull request 'bump catch2 version' (#678) from mueller/bump-catch2 into development
Reviewed-on: fsfw/fsfw#678
2022-09-12 14:24:28 +02:00
aed30d54ef Merge pull request 'remove bsp specific code' (#679) from mueller/remove-bsp-specific-code into development
Reviewed-on: fsfw/fsfw#679
2022-09-12 14:23:48 +02:00
1126db2c8a Merge pull request 'remove user includes' (#675) from mueller/remove-user-includes into development
Reviewed-on: fsfw/fsfw#675
2022-09-12 14:15:18 +02:00
a64a04d7fe Merge branch 'development' into mueller/refactor-tmtc-stack 2022-09-12 14:14:49 +02:00
80467bf097 Merge pull request 'sif::buffer: if disabeld do not print' (#680) from mohr/enableDisable into development
Reviewed-on: fsfw/fsfw#680
2022-09-12 14:12:13 +02:00
6a6aa7fdd6 Merge branch 'development' into mohr/enableDisable 2022-09-12 14:11:38 +02:00
7e379d2159 Merge pull request 'provide a weak print char impl' (#674) from mueller/provide-weak-print-char into development
Reviewed-on: fsfw/fsfw#674
2022-09-12 14:10:31 +02:00
6ae709acc3 Merge branch 'development' into mueller/remove-user-includes 2022-09-12 14:07:09 +02:00
34dd478848
helper class OneRemoteConfigProvider 2022-09-08 16:25:19 +02:00
b73754dfd6
implemented basic PDU forwarding 2022-09-08 12:07:16 +02:00
ec1e07b466
some more returncodes 2022-09-08 11:53:06 +02:00
d52f335455 sif::buffer: if disabeld do not print 2022-09-08 11:47:40 +02:00
c87667c03f
some API improvements 2022-09-08 11:26:17 +02:00
683cf8a047
some additional tests 2022-09-08 11:08:40 +02:00
11a4b27642
allow deferred init 2022-09-07 18:20:38 +02:00
770463e618
remove old code 2022-09-07 18:04:46 +02:00
04b619a15c
update header as well 2022-09-07 17:58:49 +02:00
282704e0fd
remove bsp specific code 2022-09-07 17:54:04 +02:00
8971eb386e
retval replacement 2022-09-07 17:40:22 +02:00
c54caf134a
segmented file transfer working 2022-09-06 16:33:38 +02:00
aebd401d5b
start segmentes file unittest 2022-09-06 16:14:39 +02:00
67439b4285
refactor away some duplication 2022-09-06 16:03:26 +02:00
07ef9a0ec3
bump catch2 version 2022-09-06 15:47:04 +02:00
af851165b4
continue basic small file transfer unittest 2022-09-06 15:45:51 +02:00
94c9800fae
refactored out generic metadata part 2022-09-06 14:33:01 +02:00
ba046cebd9
empty file unittest complete 2022-09-06 14:06:22 +02:00
428da017ba
empty file transfer unittest almost done 2022-09-06 13:45:43 +02:00
806ae9b41a
check that indication was called 2022-09-06 13:16:00 +02:00
7b97c8a182
continue tests 2022-09-06 11:56:05 +02:00
2e4cdb7366
additional filesystem abstractions 2022-09-05 17:42:56 +02:00
5a3f05fa79
return struct ref instead of code 2022-09-05 17:20:29 +02:00
80464f2a81
Merge branch 'mueller/refactor-serial-buffer-adapter' into mueller/refactor-tmtc-stack 2022-09-05 16:38:58 +02:00
16688316a8
rename setBuffer to setConstBuffer 2022-09-05 16:31:56 +02:00
ead22c8bd6
Merge branch 'mueller/refactor-tmtc-stack' into mueller/cfdp-routers 2022-09-05 16:29:10 +02:00
3583e30ee6
rename const buf setter 2022-09-05 16:27:20 +02:00
61db018a74
Merge branch 'mueller/refactor-tmtc-stack' into mueller/cfdp-routers 2022-09-05 16:26:29 +02:00
1e395dc402
set buffer expects const pointer now 2022-09-05 16:25:02 +02:00
afc48726b9
comment out check 2022-09-05 16:23:13 +02:00
ece5ae59e4
compile fixes 2022-09-05 16:22:41 +02:00
a5d1c38b22
Merge branch 'mueller/refactor-tmtc-stack' into mueller/cfdp-routers 2022-09-05 16:19:34 +02:00
f5421e9abd
refactor tm helper 2022-09-05 16:10:06 +02:00
4c3f9feb93
explicit include 2022-09-05 16:06:24 +02:00
b7ed8ff390 Merge branch 'mueller/refactor-tmtc-stack' of https://egit.irs.uni-stuttgart.de/fsfw/fsfw into mueller/refactor-tmtc-stack 2022-09-05 16:02:41 +02:00
75dc7a405d
del data wrapper 2022-09-05 16:02:32 +02:00
b7a1f79d5b
update FSFWCnfig.h 2022-09-05 15:36:12 +02:00
f0b7a103d4
refactor ctors 2022-09-05 15:30:53 +02:00
fb96250e36
Merge branch 'mueller/refactor-tmtc-stack' into mueller/cfdp-routers 2022-09-05 14:50:43 +02:00
ee93f4a4ca Merge branch 'development' into mueller/refactor-tmtc-stack 2022-09-05 14:46:51 +02:00
d64ad71529
Some improvements for time stamper API 2022-09-05 14:44:35 +02:00
5ce1e76723
init dest handler unittests 2022-09-05 14:20:01 +02:00
26bc80964e Merge branch 'development' into mueller/provide-weak-print-char 2022-09-05 14:14:06 +02:00
eb03bf52a6 Merge pull request 'better warning for missing include paths' (#676) from mueller/better-missing-inc-path-warning into development
Reviewed-on: fsfw/fsfw#676
2022-09-05 14:13:19 +02:00
52802f127b
basic test stubs 2022-09-05 11:40:22 +02:00
d2c4d546c3
first dest handler unittests
- Add new mock class for event reporting proxies
- Add basic setup for unittesting the CFDP destination handler
2022-09-05 11:37:41 +02:00
0dd2b5ddd4
need an event reporter proxy 2022-09-05 11:19:23 +02:00
3dfc882226
impl finish PDU sending 2022-09-05 11:03:25 +02:00
b984128de5
stub for creating finished PDU 2022-09-05 10:30:55 +02:00
134d5a1411
basic impl which allows naked no closure file transfer 2022-09-05 10:26:35 +02:00
3147f67fbd
basic dest handler framework almost complete 2022-09-02 18:03:52 +02:00
108e7737e2
continued dest handler 2022-09-02 17:54:25 +02:00
c90d1c8071
continue dest handler impl 2022-09-02 14:39:53 +02:00
eae75b29e7
start file data pdu processing 2022-09-02 11:58:16 +02:00
dc79b7ba00
delete metadata after processing 2022-09-02 11:38:46 +02:00
db84dcd3ce
afmt 2022-09-02 11:12:16 +02:00
80355910ee
better warning 2022-09-02 09:05:10 +02:00
04800df31e
another user-level-include 2022-09-02 09:04:37 +02:00
1e85cdadfd
remove user includes 2022-09-02 08:55:33 +02:00
ebc02673dd
provide a weak print char impl 2022-09-02 08:50:39 +02:00
935f35a40d Merge branch 'mueller/refactor-tmtc-stack' into mueller/cfdp-routers 2022-09-01 17:52:17 +02:00
348af0124b Merge remote-tracking branch 'origin/development' into mueller/cfdp-routers 2022-09-01 17:52:11 +02:00
9202c6c17f Merge branch 'mueller/refactor-tmtc-stack' into mueller/refactor-local-pool-api 2022-09-01 17:51:50 +02:00
5f8c549993 Merge remote-tracking branch 'origin/development' into mueller/refactor-local-pool-api 2022-09-01 17:51:44 +02:00
04bff7a522
test fix 2022-09-01 17:51:09 +02:00
5c20cc804e Merge remote-tracking branch 'origin/development' into mueller/refactor-tmtc-stack 2022-09-01 17:48:40 +02:00
eb8e236cd4 Merge pull request 'Bugfix for Space Packet Parser' (#673) from eive/fsfw:mueller/fixes-tmtc-server-sp-parser into development
Reviewed-on: fsfw/fsfw#673
2022-09-01 14:12:16 +02:00
7dec45ccf2 Merge pull request 'Service 11 regression' (#670) from eive/fsfw:mueller/service-11-issues into development
Reviewed-on: fsfw/fsfw#670
2022-09-01 11:59:18 +02:00
2b01e86f9c one small additional precaution 2022-09-01 11:56:07 +02:00
60fd3d43c0 Merge pull request 'DHB TM handler alternative API raw buffer' (#671) from mueller/dhb-handle-device-tm-2 into development
Reviewed-on: fsfw/fsfw#671
2022-09-01 11:22:17 +02:00
67980cb592 Merge branch 'development' into mueller/fixes-tmtc-server-sp-parser 2022-09-01 11:21:02 +02:00
3010f2f925 Merge pull request 'DHB set action commander before buildCommandFromCommand' (#672) from eive/fsfw:mueller/dhb-set-action-commander-before-building-cmd into development
Reviewed-on: fsfw/fsfw#672
2022-09-01 11:18:32 +02:00
01651f0521 more simplfications 2022-09-01 10:52:48 +02:00
c7f300671f
update header 2022-09-01 10:45:10 +02:00
7d3223d766
add comment blocks 2022-09-01 10:44:57 +02:00
7ae82a5cb4
do not cache previous recipient 2022-09-01 08:58:18 +02:00
28ecd0e5c6
bugfix for SP parser 2022-09-01 08:51:12 +02:00
7345c18b04 small fix which allows sending action reply immediately 2022-08-31 16:50:48 +02:00
0de7b66218
new retval for permission errors 2022-08-31 13:26:44 +02:00
64a7fde301 this is annoying 2022-08-30 15:19:01 +02:00
9131ca688b
make two helper functions protected 2022-08-30 15:01:10 +02:00
80e8511a43 Merge branch 'mueller/cfdp-routers' of https://egit.irs.uni-stuttgart.de/fsfw/fsfw into mueller/cfdp-routers 2022-08-30 11:21:12 +02:00
4a06f11582 Merge branch 'mueller/refactor-local-pool-api' into mueller/cfdp-routers 2022-08-30 11:12:59 +02:00
32c53b932d
Merge branch 'mueller/refactor-tmtc-stack' into mueller/cfdp-routers 2022-08-30 11:12:53 +02:00
9a9085b9e6
avoid duplicate code 2022-08-29 20:08:59 +02:00
81a7c21cd1
continued router component 2022-08-24 17:31:26 +02:00
267466be9d
pass const references to user handler now 2022-08-24 15:43:58 +02:00
2c730c8632
use const struct ref instead 2022-08-24 12:11:03 +02:00
eb29b79467
some more docs 2022-08-24 08:44:20 +02:00
26ea6606bf
metadata recvd indication 2022-08-23 20:56:09 +02:00
b1bd631322
implemented metadata handler 2022-08-23 20:30:41 +02:00
9441b4a70e
continue dest handler 2022-08-23 19:37:30 +02:00
95457b1760 Merge branch 'mueller/refactor-tmtc-stack' into mueller/cfdp-routers 2022-08-22 16:38:41 +02:00
d12c59c8ac
all retval replacements 2022-08-22 16:35:53 +02:00
9e5dddf79c
Merge branch 'mueller/refactor-tmtc-stack' into mueller/cfdp-routers 2022-08-22 16:24:20 +02:00
52f8c5038b
Merge branch 'mueller/refactor-tmtc-stack' into mueller/cfdp-routers 2022-08-22 16:21:41 +02:00
3b33b429e6 Merge branch 'mueller/refactor-tmtc-stack' into mueller/cfdp-routers 2022-08-18 11:21:16 +02:00
11a699c3ce
a list should do the job 2022-08-17 18:49:51 +02:00
6930656d4e
added some more basic tests 2022-08-17 17:09:39 +02:00
0bb82e0da2
add fs mock feed function 2022-08-17 16:47:46 +02:00
12c452e7ce
finished host FS unittests 2022-08-17 16:10:52 +02:00
23f514039a
host filesystem continued 2022-08-17 11:39:15 +02:00
2e52d7a31d Merge branch 'mueller/refactor-tmtc-stack' into mueller/cfdp-routers 2022-08-16 17:23:52 +02:00
e76e109bdb Merge branch 'mueller/refactor-tmtc-stack' into mueller/cfdp-routers 2022-08-15 19:17:15 +02:00
2339c48756
Merge branch 'mueller/refactor-tmtc-stack' into mueller/cfdp-routers 2022-08-15 19:07:22 +02:00
c12492df03
continued host FS test 2022-08-11 10:19:25 +02:00
8aaabc5d73
basic host FS unittests 2022-08-11 10:10:05 +02:00
e796e025b6
continue host fs unittests 2022-08-11 09:59:14 +02:00
20eee2c469
finished host FS impl 2022-08-11 09:32:18 +02:00
aca8b53a59
start host FS impl 2022-08-10 17:03:23 +02:00
3df1161560
this should do the job 2022-08-10 15:03:53 +02:00
ea6e5d9971 Merge branch 'mueller/cfdp-routers' of https://egit.irs.uni-stuttgart.de/fsfw/fsfw into mueller/cfdp-routers 2022-08-10 13:36:51 +02:00
46a4203d00
testLvs fix 2022-08-10 13:36:41 +02:00
c86adf8e10 Merge branch 'development' into mueller/cfdp-routers 2022-08-10 13:10:09 +02:00
a2e0646ed4
fix duplicate naming error 2022-08-10 13:05:07 +02:00
28c8248f26
add FS mock and improve HasFilesystemIF 2022-08-10 11:09:07 +02:00
3e1fd15613
completed all indication parameters 2022-08-10 10:34:02 +02:00
e45a99143c
added const char* test 2022-08-10 09:45:24 +02:00
96dfe46e25
added string LV tests 2022-08-10 09:39:57 +02:00
507c6ddff1
added some param structs 2022-08-09 21:03:56 +02:00
0cb15e901e
new cfdp mock folder, added additional cfdp mocks 2022-08-09 19:00:47 +02:00
d45108e3c2
add remote config table provider class 2022-08-09 18:51:44 +02:00
8c059f8f32
new filesystem module 2022-08-09 16:36:35 +02:00
5bea92d2a4
some doc updates 2022-08-09 16:26:37 +02:00
bba2d883b6
added some documentation 2022-08-09 16:18:45 +02:00
7a20412305
add user base documentation 2022-08-09 15:51:01 +02:00
dce1ebcf65
add CFDP user base 2022-08-09 15:46:42 +02:00
4ee01e395b
finished fault handler unit tests 2022-08-09 15:29:22 +02:00
7f9401cf63
some bugfixes 2022-08-09 15:09:43 +02:00
dba3f9960e
add CFDP fault handler mock 2022-08-09 14:55:08 +02:00
eccb629ba8
fnished fault handler base 2022-08-09 14:39:03 +02:00
7fb906a0ac
add first fault handler base class 2022-08-09 14:05:43 +02:00
0d26a0f54b
fnish CFDP distributor unittests 2022-08-09 13:04:23 +02:00
192956c2c7
use new storage manager mock 2022-08-09 12:50:50 +02:00
22e1555f50
basic storage manager mock 2022-08-09 12:45:05 +02:00
bddf5bded1
move some storage manager impl to IF
- Add StorageManagerMock
2022-08-09 12:36:29 +02:00
1c0b778848
continue CFDP distrib unittests 2022-08-09 12:13:10 +02:00
c832bffdb0
clean up header test 2022-08-09 11:17:57 +02:00
2f8020baac
move parsing steps into parse function 2022-08-09 11:03:22 +02:00
06bea2f621
test inNull and bool operator 2022-08-09 10:59:24 +02:00
4f1fe39182
fix unittests 2022-08-08 18:36:10 +02:00
904abfba28
clean up CFDP stack a bit 2022-08-08 18:29:32 +02:00
202d9341d8
add CFDP unit tests 2022-08-08 17:53:42 +02:00
37c60d1dd0
add source and dest test stubs 2022-08-08 12:41:05 +02:00
43fb6ef5cb
some tag replacements 2022-08-08 12:35:58 +02:00
65a47c7c57
add distributor test stub 2022-08-08 12:34:54 +02:00
fdb0cc0e44
tweaks for CFDP distributor 2022-08-08 12:31:19 +02:00
269a3052ca
added stubs for source and dest handler 2022-08-03 18:18:01 +02:00
c6a7a0fec8
use distributor instead of router 2022-08-03 18:14:49 +02:00
acf5c2a56d
better names 2022-08-03 16:00:48 +02:00
7fb9e14555
better names for CFDP components 2022-08-03 15:22:39 +02:00
b20e8a9679
continue new cfdp router 2022-08-03 15:12:29 +02:00
29bcaee196
some tests for new var len field 2022-08-03 13:34:49 +02:00
cc98512caf
use tags properly 2022-08-03 13:23:49 +02:00
60ea9a9a7c
clean up a few tests 2022-08-03 13:15:49 +02:00
df690b9628
some re-ordering 2022-08-03 11:36:56 +02:00
b0c479cab9
remove some shadowing warnings 2022-08-03 11:34:30 +02:00
a426aef7c7
add some more tests for CCSDS distributor 2022-08-03 11:33:10 +02:00
902a4bfa9c
unittests for TC and CCSDS distributor 2022-08-01 17:16:37 +02:00
bf540ebb49
use sanitized include file 2022-08-01 14:23:52 +02:00
aa978205d8
Merge branch 'mueller/cfdp-routers' of https://egit.irs.uni-stuttgart.de/fsfw/fsfw into mueller/cfdp-routers 2022-08-01 13:05:56 +02:00
4334106ad1
applied auto-formatter 2022-08-01 11:05:46 +02:00
458fe460eb
TMTC Routing Refactoring
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
83d71548ec
CCSDS unpacker implementation 2022-07-29 16:32:50 +02:00
f4beef8c9f
run auto-formatter 2022-07-29 15:54:17 +02:00
c7b4dc349a
using uint32_t for getIdentifier of AcceptsTcIF 2022-07-29 15:53:39 +02:00
f75379fceb Merge branch 'mueller/new-object-id-class' into mueller/cfdp-routers 2022-07-29 14:27:59 +02:00
cd4d92b12c Merge branch 'mueller/new-object-id-class' into mueller/cfdp-routers 2022-07-29 14:22:52 +02:00
6c5bbfa080
some renaming 2022-07-29 12:03:14 +02:00
544 changed files with 12936 additions and 6733 deletions

2
.gitignore vendored
View File

@ -1,5 +1,5 @@
# PyCharm and CLion
/.idea/*
.idea/*
!/.idea/runConfigurations
!/.idea/cmake.xml
!/.idea/codeStyles

8
.idea/cmake.xml Normal file
View File

@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="CMakeSharedSettings">
<configurations>
<configuration PROFILE_NAME="Debug Test" ENABLED="true" CONFIG_NAME="Debug" GENERATION_OPTIONS="-DFSFW_OSAL=host -DFSFW_BUILD_TESTS=ON" NO_GENERATOR="true" />
</configurations>
</component>
</project>

View File

@ -8,23 +8,169 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
# [unreleased]
# [v6.0.0]
## Fixes
- The `PusTmCreator` API only accepted 255 bytes of source data. It can now accept source
data with a size limited only by the size of `size_t`.
- Important bugfix in CFDP PDU header format: The entity length field and the transaction sequence
number fields stored the actual length of the field instead of the length minus 1 like specified
in the CFDP standard.
- PUS Health Service: Size check for set health command.
Perform operation completion for announce health command.
https://egit.irs.uni-stuttgart.de/fsfw/fsfw/pulls/746
- Linux OSAL `getUptime` fix: Check validity of `/proc/uptime` file before reading uptime.
https://egit.irs.uni-stuttgart.de/fsfw/fsfw/pulls/745
- Small tweak for version getter
https://egit.irs.uni-stuttgart.de/fsfw/fsfw/pulls/744
## Added
- DHB TM handler `handleDeviceTM` renamed to `handleDeviceTm` and now takes
`util::DataWrapper` as the data input argument. This allows more flexibility in the possible
types of telemetry.
PR: https://egit.irs.uni-stuttgart.de/fsfw/fsfw/pulls/669
- Add `util::DataWrapper` class inside the `util` module. This is a tagged union which allows
to specify raw data either as a classic C-style raw pointer and size or as a `SerializeIF`
pointer.
PR: https://egit.irs.uni-stuttgart.de/fsfw/fsfw/pulls/668
- add CFDP subsystem ID
https://egit.irs.uni-stuttgart.de/fsfw/fsfw/pulls/742
- `PusTmZcWriter` now exposes API to set message counter field.
- Relative timeshift in the PUS time service.
## Changed
- The PUS time service now dumps the time before setting a new time and after having set the
time.
- HK generation is now countdown based.
- Bump ETL version to 20.35.14
https://egit.irs.uni-stuttgart.de/fsfw/fsfw/pulls/748
- Renamed `PCDU_2` subsystem ID to `POWER_SWITCH_IF`.
https://egit.irs.uni-stuttgart.de/fsfw/fsfw/pulls/743
- Add new `PowerSwitchIF::SWITCH_UNKNOWN` returnvalue.
https://egit.irs.uni-stuttgart.de/fsfw/fsfw/pulls/743
- Assert that `FixedArrayList` is larger than 0 at compile time.
https://egit.irs.uni-stuttgart.de/fsfw/fsfw/pulls/740
- Health functions are virtual now.
- PUS Service Base request queue depth and maximum number of handled packets per cycle is now
configurable.
# [v6.0.0] 2023-02-10
## Fixes
- Mode Service: Add allowed subservice
PR: https://egit.irs.uni-stuttgart.de/fsfw/fsfw/pulls/739
- `CService200ModeManagement`: Various bugfixes which lead to now execution complete being generated
on mode announcements, duplicate mode reply generated on announce commands, and the mode read
subservice not working properly.
PR: https://egit.irs.uni-stuttgart.de/fsfw/fsfw/pulls/736
- Memory leak fixes for the TCP/IP TMTC bridge.
PR: https://egit.irs.uni-stuttgart.de/fsfw/fsfw/pulls/737
- `Service9TimeManagement`: Fix the time dump at the `SET_TIME` subservice: Include clock timeval
seconds instead of uptime.
PR: https://egit.irs.uni-stuttgart.de/fsfw/fsfw/pulls/726
- HAL MGM3100 Handler: Use axis specific gain/scaling factors. Previously,
only the X scaling factor was used.
PR: https://egit.irs.uni-stuttgart.de/fsfw/fsfw/pulls/724
- HAL MGM3100 Handler: Z value was previously calculated with bytes of the X value.
PR: https://egit.irs.uni-stuttgart.de/fsfw/fsfw/pulls/733
- DHB `setNormalDatapoolEntriesInvalid`: The default implementation did not set the validity
to false correctly because the `read` and `write` calls were missing.
PR: https://egit.irs.uni-stuttgart.de/fsfw/fsfw/pulls/728
- PUS TMTC creator module: Sequence flags were set to continuation segment (0b00) instead
of the correct unsegmented flags (0b11) as specified in the standard.
PR: https://egit.irs.uni-stuttgart.de/fsfw/fsfw/pulls/727
- TC Scheduler Service 11: Add size and CRC check for contained TC.
Bug: https://egit.irs.uni-stuttgart.de/fsfw/fsfw/issues/719
PR: https://egit.irs.uni-stuttgart.de/fsfw/fsfw/pulls/720
- Only delete health table entry in `HealthHelper` destructor if
health table was set.
PR: https://egit.irs.uni-stuttgart.de/fsfw/fsfw/pulls/710
- I2C Bugfixes: Do not keep iterator as member and fix some incorrect handling with the iterator.
Also properly reset the reply size for successfull transfers and erroneous transfers.
PR: https://egit.irs.uni-stuttgart.de/fsfw/fsfw/pulls/700
- Bugfix for Serial Buffer Stream: Setting `doActive` to false now
actually fully disables printing.
PR: https://egit.irs.uni-stuttgart.de/fsfw/fsfw/pulls/680
- `TcpTmTcServer.cpp`: The server was actually not able to handle
CCSDS packets which were clumped together. This has been fixed now.
PR: https://egit.irs.uni-stuttgart.de/fsfw/fsfw/pulls/673
- `CServiceHealthCommanding`: Add announce all health info implementation
PR: https://egit.irs.uni-stuttgart.de/fsfw/fsfw/pulls/725
- various fixes related to linux Unittests and memory leaks
PR: https://egit.irs.uni-stuttgart.de/fsfw/fsfw/pulls/715
- small fix to allow teardown handling
PR: https://egit.irs.uni-stuttgart.de/fsfw/fsfw/pulls/713
- fix compiler warning for fixed array list copy ctor
PR: https://egit.irs.uni-stuttgart.de/fsfw/fsfw/pulls/704
- missing include
PR: https://egit.irs.uni-stuttgart.de/fsfw/fsfw/pulls/703
- defaultconfig did not build anymore
PR: https://egit.irs.uni-stuttgart.de/fsfw/fsfw/pulls/702
- hotfix
PR: https://egit.irs.uni-stuttgart.de/fsfw/fsfw/pulls/699
- small fix for helper
PR: https://egit.irs.uni-stuttgart.de/fsfw/fsfw/pulls/698
- missing retval conv
PR: https://egit.irs.uni-stuttgart.de/fsfw/fsfw/pulls/697
- DHB Countdown Bug
PR: https://egit.irs.uni-stuttgart.de/fsfw/fsfw/pulls/693
- doc corrections
PR: https://egit.irs.uni-stuttgart.de/fsfw/fsfw/pulls/687
- better error printout
PR: https://egit.irs.uni-stuttgart.de/fsfw/fsfw/pulls/686
- include correction
PR: https://egit.irs.uni-stuttgart.de/fsfw/fsfw/pulls/683
- better warning for missing include paths
PR: https://egit.irs.uni-stuttgart.de/fsfw/fsfw/pulls/676
- Service 11 regression
PR: https://egit.irs.uni-stuttgart.de/fsfw/fsfw/pulls/670
## Added
- `CServiceHealthCommanding`: Add announce all health info implementation
PR: https://egit.irs.uni-stuttgart.de/eive/fsfw/pulls/122
- Empty constructor for `CdsShortTimeStamper` which does not do an object manager registration.
PR: https://egit.irs.uni-stuttgart.de/fsfw/fsfw/pulls/730
- `Service9TimeManagement`: Add `DUMP_TIME` (129) subservice.
- `TcpTmTcServer`: Allow setting the `SO_REUSEADDR` and `SO_REUSEPORT`
option on the TCP server. CTOR prototype has changed and expects an explicit
TCP configuration struct to be passed.
PR: https://egit.irs.uni-stuttgart.de/fsfw/fsfw/pulls/722
- `DleParser` helper class to parse DLE encoded packets from a byte stream.
PR: https://egit.irs.uni-stuttgart.de/fsfw/fsfw/pulls/711
- `UioMapper` is able to resolve symlinks now.
PR: https://egit.irs.uni-stuttgart.de/fsfw/fsfw/pulls/709
- Add new `UnsignedByteField` class
PR: https://egit.irs.uni-stuttgart.de/fsfw/fsfw/pulls/660
- publish documentation for development and master branch
PR: https://egit.irs.uni-stuttgart.de/fsfw/fsfw/pulls/681
- Add Linux HAL options
PR: https://egit.irs.uni-stuttgart.de/fsfw/fsfw/pulls/663
- Expand SerializeIF
PR: https://egit.irs.uni-stuttgart.de/fsfw/fsfw/pulls/656
- PUS Service 11: Additional Safety Check
PR: https://egit.irs.uni-stuttgart.de/fsfw/fsfw/pulls/666
- improvements for auto-formatter script
PR: https://egit.irs.uni-stuttgart.de/fsfw/fsfw/pulls/665
- provide a weak print char impl
PR: https://egit.irs.uni-stuttgart.de/fsfw/fsfw/pulls/674
## Removed
- now that doc server is up, remove markdown files
PR: https://egit.irs.uni-stuttgart.de/fsfw/fsfw/pulls/688
- remove bsp specific code
PR: https://egit.irs.uni-stuttgart.de/fsfw/fsfw/pulls/679
## Changes
- `CService201HealthCommanding` renamed to `CServiceHealthCommanding`,
service ID customizable now. `CServiceHealthCommanding` expects configuration struct
`HealthServiceCfg` now
PR: https://egit.irs.uni-stuttgart.de/fsfw/fsfw/pulls/725
- `AcceptsTelemetryIF`: `getReportReceptionQueue` is const now
PR: https://egit.irs.uni-stuttgart.de/fsfw/fsfw/pulls/712
- Moved some container returnvalues to dedicated header and namespace
so they can be used without template specification.
PR: https://egit.irs.uni-stuttgart.de/fsfw/fsfw/pulls/707
- Remove default secondary header argument for
`uint16_t getTcSpacePacketIdFromApid(uint16_t apid, bool secondaryHeaderFlag)` and
`uint16_t getTmSpacePacketIdFromApid(uint16_t apid, bool secondaryHeaderFlag)`
PR: https://egit.irs.uni-stuttgart.de/fsfw/fsfw/pulls/689
- Removed `HasReturnvaluesIF` class in favor of `returnvalue` namespace with `OK` and `FAILED`
constants.
PR: https://egit.irs.uni-stuttgart.de/fsfw/fsfw/pulls/659
@ -32,8 +178,78 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
for other modules
PR: https://egit.irs.uni-stuttgart.de/fsfw/fsfw/pulls/655
which also includes a migration guide
- Bump Catch2 dependency to regular version `v3.1.0`
PR: https://egit.irs.uni-stuttgart.de/fsfw/fsfw/pulls/678
- `SerialBufferAdapter`: Rename `setBuffer` to `setConstBuffer` and update
API to expect `const uint8_t*` accordingly.
PR: https://egit.irs.uni-stuttgart.de/fsfw/fsfw/pulls/677
- Remove the following user includes from `fsfw/events/Event.h` and
`fsfw/returnvalues/returnvalue.h`:
- `#include "events/subsystemIdRanges.h"`
- `#include "returnvalues/classIds.h"`
The user has to include those themselves now
PR: https://egit.irs.uni-stuttgart.de/fsfw/fsfw/pulls/675
- `DeviceHandlerBase`: Set command sender before calling `buildCommandFromCommand`.
This allows finishing action commands immediately inside the function.
PR: https://egit.irs.uni-stuttgart.de/fsfw/fsfw/pulls/672
- `DeviceHandlerBase`: New signature of `handleDeviceTm` which expects
a `const SerializeIF&` and additional helper variant which expects `const uint8_t*`
PR: https://egit.irs.uni-stuttgart.de/fsfw/fsfw/pulls/671
- Improvements for `AcceptsTelemetryIF` and `AcceptsTelecommandsIF`:
- Make functions `const` where it makes sense
- Add `const char* getName const` abstract function
PR: https://egit.irs.uni-stuttgart.de/fsfw/fsfw/pulls/684
- Generic TMTC Bridge Update
PR: https://egit.irs.uni-stuttgart.de/fsfw/fsfw/pulls/734
- comment tweak to event parser can read everything
PR: https://egit.irs.uni-stuttgart.de/fsfw/fsfw/pulls/732
- CMakeLists file updates
PR: https://egit.irs.uni-stuttgart.de/fsfw/fsfw/pulls/731
- improve srv20 error messages
PR: https://egit.irs.uni-stuttgart.de/fsfw/fsfw/pulls/723
- I2C Linux: remove duplicate printout
PR: https://egit.irs.uni-stuttgart.de/fsfw/fsfw/pulls/718
- printout handling improvements
PR: https://egit.irs.uni-stuttgart.de/fsfw/fsfw/pulls/717
- vec getter, reset for content
PR: https://egit.irs.uni-stuttgart.de/fsfw/fsfw/pulls/716
- updates for source sequence counter
PR: https://egit.irs.uni-stuttgart.de/fsfw/fsfw/pulls/714
- SP reader getPacketData is const now
PR: https://egit.irs.uni-stuttgart.de/fsfw/fsfw/pulls/708
- refactoring of serial drivers for linux
PR: https://egit.irs.uni-stuttgart.de/fsfw/fsfw/pulls/705
- Local Pool Update Remove Add Data Ignore Fault Argument
PR: https://egit.irs.uni-stuttgart.de/fsfw/fsfw/pulls/701
- Switch to new documentation server
PR: https://egit.irs.uni-stuttgart.de/fsfw/fsfw/pulls/694
- Windows Tweaks
PR: https://egit.irs.uni-stuttgart.de/fsfw/fsfw/pulls/691
- Refactor Local Pool API
PR: https://egit.irs.uni-stuttgart.de/fsfw/fsfw/pulls/667
- group MGM data in local pool vectors
PR: https://egit.irs.uni-stuttgart.de/fsfw/fsfw/pulls/664
# [v5.0.0] 25.07.2022
## CFDP
- Refactoring of CFDP stack which was done during implementation of the CFDP source and destination
handlers.
- New filesystem module, changes for filesystem abstraction `HasFileSystemIF` to better
fit requirements of CFDP
- New `HostFilesystem` implementation of the `HasFileSystemIF`
- New `cfdp::UserBase` class which is the abstraction for the CFDP user in an OBSW context.
- mib module for the CFDP stack
- PDU classes renamed from `...Serializer`/`...Deserializer` to `...Creator`/`...Reader`
respetively
- Renamed `TcDistributor` to `TcDistributorBase` to prevent confusion
- Refactored `TcDisitributorBase` to be more flexible and usable for CFDP distribution
- Renamed `CCSDSDistributor` to `CcsdsDistributor` and add feature which allows it
to remove the CCSDS header when routing a packet. This allows CCSDS agnostic receiver
implementation without an extra component
PR: https://egit.irs.uni-stuttgart.de/fsfw/fsfw/pulls/682
# [v5.0.0] 2022-07-25
## Changes
@ -166,6 +382,7 @@ https://egit.irs.uni-stuttgart.de/fsfw/fsfw/pulls/593
- https://gitlab.kitware.com/cmake/cmake/-/issues/21696
Easiest solution for now: Keep this option OFF by default.
PR: https://egit.irs.uni-stuttgart.de/fsfw/fsfw/pulls/616
- Linux HAL: Add wiretapping option for I2C. Enabled with `FSFW_HAL_I2C_WIRETAPPING` defined to 1
- Dedicated Version class and constant `fsfw::FSFW_VERSION` containing version information
inside `fsfw/version.h`
PR: https://egit.irs.uni-stuttgart.de/fsfw/fsfw/pulls/559
@ -180,17 +397,6 @@ https://egit.irs.uni-stuttgart.de/fsfw/fsfw/pulls/593
PR: https://egit.irs.uni-stuttgart.de/fsfw/fsfw/pulls/590
- `Subsystem`: New API to add table and sequence entries
## HAL
- SPI: Cache the SPI device in the communication interface. Architecturally, this makes a
lot more sense because each ComIF should be responsible for one SPI bus.
- SPI: Move the empty transfer to update the line polarity to separate function. This means
it is not automatically called when calling the setter function for SPI speed and mode.
The user should call this function after locking the CS mutex if multiple SPI devices with
differing speeds and modes are attached to one bus.
- SPI: Getter functions for SPI speed and mode.
- I2C: Add wiretapping option for I2C. Enabled with `FSFW_HAL_I2C_WIRETAPPING` defined to 1.
## Fixed
- TCP TMTC Server: `MutexGuard` was not created properly in

View File

@ -13,7 +13,7 @@ list(APPEND CMAKE_MODULE_PATH
# Version file handling #
# ##############################################################################
set(FSFW_VERSION_IF_GIT_FAILS 5)
set(FSFW_VERSION_IF_GIT_FAILS 6)
set(FSFW_SUBVERSION_IF_GIT_FAILS 0)
set(FSFW_REVISION_IF_GIT_FAILS 0)
@ -72,7 +72,7 @@ set(FSFW_ETL_LIB_MAJOR_VERSION
20
CACHE STRING "ETL library major version requirement")
set(FSFW_ETL_LIB_VERSION
${FSFW_ETL_LIB_MAJOR_VERSION}.28.0
${FSFW_ETL_LIB_MAJOR_VERSION}.35.14
CACHE STRING "ETL library exact version requirement")
set(FSFW_ETL_LINK_TARGET etl::etl)
@ -80,7 +80,7 @@ set(FSFW_CATCH2_LIB_MAJOR_VERSION
3
CACHE STRING "Catch2 library major version requirement")
set(FSFW_CATCH2_LIB_VERSION
v${FSFW_CATCH2_LIB_MAJOR_VERSION}.0.0-preview5
v${FSFW_CATCH2_LIB_MAJOR_VERSION}.1.0
CACHE STRING "Catch2 library exact version requirement")
# Keep this off by default for now. See PR:
@ -104,7 +104,8 @@ if(FSFW_GENERATE_SECTIONS)
option(FSFW_REMOVE_UNUSED_CODE "Remove unused code" ON)
endif()
option(FSFW_BUILD_TESTS "Build unittest binary in addition to static library"
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)
@ -115,13 +116,13 @@ 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)
option(FSFW_HAL_LINUX_ADD_SERIAL_DRIVERS "Add serial drivers" ON)
endif()
# Optional sources
@ -152,12 +153,12 @@ if(FSFW_BUILD_TESTS)
"${MSG_PREFIX} Building the FSFW unittests in addition to the static library"
)
# Check whether the user has already installed Catch2 first
find_package(Catch2 ${FSFW_CATCH2_LIB_MAJOR_VERSION})
find_package(Catch2 ${FSFW_CATCH2_LIB_MAJOR_VERSION} QUIET)
# Not installed, so use FetchContent to download and provide Catch2
if(NOT Catch2_FOUND)
message(
STATUS
"${MSG_PREFIX} Catch2 installation not found. Downloading Catch2 library with FetchContent"
"${MSG_PREFIX} Catch2 installation not found. Downloading Catch2 library with FetchContent."
)
include(FetchContent)
@ -195,13 +196,13 @@ message(
)
# Check whether the user has already installed ETL first
find_package(${FSFW_ETL_LIB_NAME} ${FSFW_ETL_LIB_MAJOR_VERSION} CONFIG QUIET)
find_package(${FSFW_ETL_LIB_NAME} ${FSFW_ETL_LIB_MAJOR_VERSION} QUIET)
# Not installed, so use FetchContent to download and provide etl
if(NOT ${FSFW_ETL_LIB_NAME}_FOUND)
message(
STATUS
"${MSG_PREFIX} No ETL installation was found with find_package. Installing and providing "
"etl with FindPackage")
"${MSG_PREFIX} ETL installation not found. Downloading ETL with FetchContent."
)
include(FetchContent)
FetchContent_Declare(
@ -326,7 +327,8 @@ if(FSFW_BUILD_TESTS)
"/usr/local/include/*"
"*/fsfw_tests/*"
"*/catch2-src/*"
"*/fsfw_hal/*")
"*/fsfw_hal/*"
"unittests/*")
endif()
target_link_options(${FSFW_TEST_TGT} PRIVATE -fprofile-arcs
@ -344,8 +346,15 @@ if(FSFW_BUILD_TESTS)
DEPENDENCIES ${FSFW_TEST_TGT})
else()
setup_target_for_coverage_lcov(
NAME ${FSFW_TEST_TGT}_coverage EXECUTABLE ${FSFW_TEST_TGT}
DEPENDENCIES ${FSFW_TEST_TGT})
NAME
${FSFW_TEST_TGT}_coverage
EXECUTABLE
${FSFW_TEST_TGT}
DEPENDENCIES
${FSFW_TEST_TGT}
GENHTML_ARGS
--html-epilog
${CMAKE_SOURCE_DIR}/unittests/lcov_epilog.html)
endif()
endif()
endif()
@ -360,7 +369,8 @@ if(NOT FSFW_CONFIG_PATH)
if(NOT FSFW_BUILD_DOCS)
message(
WARNING
"${MSG_PREFIX} Flight Software Framework configuration path not set")
"${MSG_PREFIX} Flight Software Framework configuration path FSFW_CONFIG_PATH not set"
)
message(
WARNING
"${MSG_PREFIX} Setting default configuration from ${DEF_CONF_PATH} ..")

View File

@ -175,7 +175,7 @@ cmake -DFSFW_BUILD_DOCS=ON -DFSFW_OSAL=host ..
Then you can generate the documentation using
```sh
cmake --build . -j
cmake --build . -- Sphinx -j
```
You can find the generated documentation inside the `docs/sphinx` folder inside the build

View File

@ -5,16 +5,25 @@ RUN apt-get --yes upgrade
#tzdata is a dependency, won't install otherwise
ARG DEBIAN_FRONTEND=noninteractive
RUN apt-get --yes install gcc g++ cmake make lcov git valgrind nano iputils-ping
RUN apt-get --yes install gcc g++ cmake make lcov git valgrind nano iputils-ping python3 pip doxygen graphviz rsync
RUN python3 -m pip install sphinx breathe
RUN git clone https://github.com/catchorg/Catch2.git && \
cd Catch2 && \
git checkout v3.0.0-preview5 && \
cmake -Bbuild -H. -DBUILD_TESTING=OFF && \
cmake --build build/ --target install
cd Catch2 && \
git checkout v3.1.0 && \
cmake -Bbuild -H. -DBUILD_TESTING=OFF && \
cmake --build build/ --target install
RUN git clone https://github.com/ETLCPP/etl.git && \
cd etl && \
git checkout 20.28.0 && \
cmake -B build . && \
cmake --install build/
cd etl && \
git checkout 20.28.0 && \
cmake -B build . && \
cmake --install build/
#ssh needs a valid user to work
RUN adduser --uid 114 jenkins
#add documentation server to known hosts
RUN echo "|1|/LzCV4BuTmTb2wKnD146l9fTKgQ=|NJJtVjvWbtRt8OYqFgcYRnMQyVw= ecdsa-sha2-nistp256 AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBNL8ssTonYtgiR/6RRlSIK9WU1ywOcJmxFTLcEblAwH7oifZzmYq3XRfwXrgfMpylEfMFYfCU8JRqtmi19xc21A=" >> /etc/ssh/ssh_known_hosts
RUN echo "|1|CcBvBc3EG03G+XM5rqRHs6gK/Gg=|oGeJQ+1I8NGI2THIkJsW92DpTzs= ecdsa-sha2-nistp256 AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBNL8ssTonYtgiR/6RRlSIK9WU1ywOcJmxFTLcEblAwH7oifZzmYq3XRfwXrgfMpylEfMFYfCU8JRqtmi19xc21A=" >> /etc/ssh/ssh_known_hosts

122
automation/Jenkinsfile vendored
View File

@ -1,41 +1,125 @@
pipeline {
environment {
BUILDDIR = 'cmake-build-tests'
BUILDDIR_HOST = 'cmake-build-tests-host'
BUILDDIR_LINUX = 'cmake-build-tests-linux'
DOCDDIR = 'cmake-build-documentation'
}
agent {
docker { image 'fsfw-ci:d3'}
docker {
image 'fsfw-ci:d6'
args '--network host --sysctl fs.mqueue.msg_max=100'
}
}
stages {
stage('Clean') {
steps {
sh 'rm -rf $BUILDDIR'
}
}
stage('Configure') {
steps {
dir(BUILDDIR) {
sh 'cmake -DFSFW_OSAL=host -DFSFW_BUILD_TESTS=ON -DFSFW_CICD_BUILD=ON ..'
stage('Host') {
stages{
stage('Clean') {
steps {
sh 'rm -rf $BUILDDIR_HOST'
}
}
stage('Configure') {
steps {
dir(BUILDDIR_HOST) {
sh 'cmake -DFSFW_OSAL=host -DFSFW_BUILD_TESTS=ON -DFSFW_CICD_BUILD=ON ..'
}
}
}
stage('Build') {
steps {
dir(BUILDDIR_HOST) {
sh 'cmake --build . -j4'
}
}
}
stage('Unittests') {
steps {
dir(BUILDDIR_HOST) {
sh 'cmake --build . -- fsfw-tests_coverage -j4'
}
}
}
stage('Valgrind') {
steps {
dir(BUILDDIR_HOST) {
sh 'valgrind --leak-check=full --error-exitcode=1 ./fsfw-tests'
}
}
}
}
}
stage('Build') {
steps {
dir(BUILDDIR) {
sh 'cmake --build . -j4'
stage('Linux') {
stages{
stage('Clean') {
steps {
sh 'rm -rf $BUILDDIR_LINUX'
}
}
stage('Configure') {
steps {
dir(BUILDDIR_LINUX) {
sh 'cmake -DFSFW_OSAL=linux -DFSFW_BUILD_TESTS=ON -DFSFW_CICD_BUILD=ON ..'
}
}
}
stage('Build') {
steps {
dir(BUILDDIR_LINUX) {
sh 'cmake --build . -j4'
}
}
}
stage('Unittests') {
steps {
dir(BUILDDIR_LINUX) {
sh 'cmake --build . -- fsfw-tests_coverage -j4'
}
}
}
stage('Valgrind') {
steps {
dir(BUILDDIR_LINUX) {
sh 'valgrind --leak-check=full --error-exitcode=1 ./fsfw-tests'
}
}
}
}
}
stage('Unittests') {
stage('Documentation') {
when {
branch 'development'
}
steps {
dir(DOCDDIR) {
sh 'cmake -DFSFW_BUILD_DOCS=ON -DFSFW_OSAL=host ..'
sh 'make Sphinx'
sshagent(credentials: ['documentation-buildfix']) {
sh 'rsync -r --delete docs/sphinx/* buildfix@documentation.irs.uni-stuttgart.de:/fsfw/development'
}
}
dir(BUILDDIR) {
sh 'cmake --build . -- fsfw-tests_coverage -j4'
sshagent(credentials: ['documentation-buildfix']) {
sh 'rsync -r --delete fsfw-tests_coverage/* buildfix@documentation.irs.uni-stuttgart.de:/fsfw/coverage/development'
}
}
}
}
stage('Valgrind') {
stage('Master Documentation') {
when {
branch 'master'
}
steps {
dir(DOCDDIR) {
sh 'cmake -DFSFW_BUILD_DOCS=ON -DFSFW_OSAL=host ..'
sh 'make Sphinx'
sshagent(credentials: ['documentation-buildfix']) {
sh 'rsync -r --delete docs/sphinx/* buildfix@documentation.irs.uni-stuttgart.de:/fsfw/master'
}
}
dir(BUILDDIR) {
sh 'valgrind --leak-check=full --error-exitcode=1 ./fsfw-tests'
sshagent(credentials: ['documentation-buildfix']) {
sh 'rsync -r --delete fsfw-tests_coverage/* buildfix@documentation.irs.uni-stuttgart.de:/fsfw/coverage/master'
}
}
}
}

View File

@ -140,7 +140,7 @@ find_program( GCOV_PATH gcov )
find_program( LCOV_PATH NAMES lcov lcov.bat lcov.exe lcov.perl)
find_program( FASTCOV_PATH NAMES fastcov fastcov.py )
find_program( GENHTML_PATH NAMES genhtml genhtml.perl genhtml.bat )
find_program( GCOVR_PATH gcovr PATHS ${CMAKE_SOURCE_DIR}/scripts/test)
find_program( GCOVR_PATH gcovr )
find_program( CPPFILT_PATH NAMES c++filt )
if(NOT GCOV_PATH)

View File

@ -1,40 +0,0 @@
Configuring the FSFW
======
The FSFW can be configured via the `fsfwconfig` folder. A template folder has
been provided to have a starting point for this. The folder should be added
to the include path. The primary configuration file is the `FSFWConfig.h` folder. Some
of the available options will be explained in more detail here.
# Auto-Translation of Events
The FSFW allows the automatic translation of events, which allows developers to track triggered
events directly via console output. Using this feature requires:
1. `FSFW_OBJ_EVENT_TRANSLATION` set to 1 in the configuration file.
2. Special auto-generated translation files which translate event IDs and object IDs into
human readable strings. These files can be generated using the
[modgen Python scripts](https://git.ksat-stuttgart.de/source/modgen.git).
3. The generated translation files for the object IDs should be named `translatesObjects.cpp`
and `translateObjects.h` and should be copied to the `fsfwconfig/objects` folder
4. The generated translation files for the event IDs should be named `translateEvents.cpp` and
`translateEvents.h` and should be copied to the `fsfwconfig/events` folder
An example implementations of these translation file generators can be found as part
of the [SOURCE project here](https://git.ksat-stuttgart.de/source/sourceobsw/-/tree/development/generators)
or the [FSFW example](https://egit.irs.uni-stuttgart.de/fsfw/fsfw_example_public/src/branch/master/generators)
## Configuring the Event Manager
The number of allowed subscriptions can be modified with the following
parameters:
``` c++
namespace fsfwconfig {
//! Configure the allocated pool sizes for the event manager.
static constexpr size_t FSFW_EVENTMGMR_MATCHTREE_NODES = 240;
static constexpr size_t FSFW_EVENTMGMT_EVENTIDMATCHERS = 120;
static constexpr size_t FSFW_EVENTMGMR_RANGEMATCHERS = 120;
}
```

View File

@ -1 +0,0 @@
## Controllers

View File

@ -1,55 +0,0 @@
## FSFW Core Modules
These core modules provide the most important functionalities of the
Flight Software Framework
### Clock
* This is a class of static functions that can be used at anytime
* Leap Seconds must be set if any time conversions from UTC to other times is used
### ObjectManager
* Must be created during program startup
* The component which handles all references. All SystemObjects register at this component.
* Any SystemObject needs to have a unique ObjectId. Those can be managed like objects::framework_objects.
* A reference to an object can be get by calling the following function. T must be the specific Interface you want to call.
A nullptr check of the returning Pointer must be done. This function is based on Run-time type information.
```cpp
template <typename T> T* ObjectManagerIF::get( object_id_t id )
```
* A typical way to create all objects on startup is a handing a static produce function to the
ObjectManager on creation. By calling objectManager->initialize() the produce function will be
called and all SystemObjects will be initialized afterwards.
### Event Manager
* Component which allows routing of events
* Other objects can subscribe to specific events, ranges of events or all events of an object.
* Subscriptions can be done during runtime but should be done during initialization
* Amounts of allowed subscriptions can be configured in `FSFWConfig.h`
### Health Table
* A component which holds every health state
* Provides a thread safe way to access all health states without the need of message exchanges
### Stores
* The message based communication can only exchange a few bytes of information inside the message
itself. Therefore, additional information can be exchanged with Stores. With this, only the
store address must be exchanged in the message.
* Internally, the FSFW uses an IPC Store to exchange data between processes. For incoming TCs a TC
Store is used. For outgoing TM a TM store is used.
* All of them should use the Thread Safe Class storagemanager/PoolManager
### Tasks
There are two different types of tasks:
* The PeriodicTask just executes objects that are of type ExecutableObjectIF in the order of the
insertion to the Tasks.
* FixedTimeslotTask executes a list of calls in the order of the given list. This is intended for
DeviceHandlers, where polling should be in a defined order. An example can be found in
`defaultcfg/fsfwconfig/pollingSequence` folder

View File

@ -1 +0,0 @@
## Device Handlers

View File

@ -1,135 +0,0 @@
High-level overview
======
# 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.
# 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 `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.
# OSAL
The FSFW provides operation system abstraction layers for Linux, FreeRTOS and RTEMS.
The OSAL provides periodic tasks, message queues, clocks and semaphores as well as mutexes.
The [OSAL README](doc/README-osal.md#top) provides more detailed information on provided components
and how to use them.
# Core Components
The FSFW has following core components. More detailed informations can be found in the
[core component section](doc/README-core.md#top):
1. Tasks: Abstraction for different (periodic) task types like periodic tasks or tasks
with fixed timeslots
2. ObjectManager: This module stores all `SystemObjects` by mapping a provided unique object ID
to the object handles.
3. Static Stores: Different stores are provided to store data of variable size (like telecommands
or small telemetry) in a pool structure without using dynamic memory allocation.
These pools are allocated up front.
3. Clock: This module provided common time related functions
4. EventManager: This module allows routing of events generated by `SystemObjects`
5. HealthTable: A component which stores the health states of objects
# Static IDs in the framework
Some parts of the framework use a static routing address for communication.
An example setup of ids can be found in the example config in `defaultcft/fsfwconfig/objects`
inside the function `Factory::setStaticFrameworkObjectIds()`.
# Events
Events are tied to objects. EventIds can be generated by calling the Macro MAKE_EVENT.
This works analog to the returnvalues. Every object that needs own EventIds has to get a
unique SUBSYSTEM_ID. Every SystemObject can call triggerEvent from the parent class.
Therefore, event messages contain the specific EventId and the objectId of the object that
has triggered.
# Internal Communication
Components communicate mostly via Messages through Queues.
Those queues are created by calling the singleton `QueueFactory::instance()->create()` which
will create `MessageQueue` instances for the used OSAL.
# External Communication
The external communication with the mission control system is mostly up to the user implementation.
The FSFW provides PUS Services which can be used to but don't need to be used.
The services can be seen as a conversion from a TC to a message based communication and back.
## TMTC Communication
The FSFW provides some components to facilitate TMTC handling via the PUS commands.
For example, a UDP or TCP PUS server socket can be opened on a specific port using the
files located in `osal/common`. The FSFW example uses this functionality to allow sending telecommands
and receiving telemetry using the [TMTC commander application](https://github.com/spacefisch/tmtccmd).
Simple commands like the PUS Service 17 ping service can be tested by simply running the
`tmtc_client_cli.py` or `tmtc_client_gui.py` utility in
the [example tmtc folder](https://egit.irs.uni-stuttgart.de/fsfw/fsfw_example_public/src/branch/master/tmtc)
while the `fsfw_example` application is running.
More generally, any class responsible for handling incoming telecommands and sending telemetry
can implement the generic `TmTcBridge` class located in `tmtcservices`. Many applications
also use a dedicated polling task for reading telecommands which passes telecommands
to the `TmTcBridge` implementation.
## CCSDS Frames, CCSDS Space Packets and PUS
If the communication is based on CCSDS Frames and Space Packets, several classes can be used to
distributed the packets to the corresponding services. Those can be found in `tcdistribution`.
If Space Packets are used, a timestamper has to be provided by the user.
An example can be found in the `timemanager` folder, which uses `CCSDSTime::CDS_short`.
# Device Handlers
DeviceHandlers are another important component of the FSFW.
The idea is, to have a software counterpart of every physical device to provide a simple mode,
health and commanding interface. By separating the underlying Communication Interface with
`DeviceCommunicationIF`, a device handler (DH) can be tested on different hardware.
The DH has mechanisms to monitor the communication with the physical device which allow
for FDIR reaction. Device Handlers can be created by implementing `DeviceHandlerBase`.
A standard FDIR component for the DH will be created automatically but can
be overwritten by the user. More information on DeviceHandlers can be found in the
related [documentation section](doc/README-devicehandlers.md#top).
# Modes and Health
The two interfaces `HasModesIF` and `HasHealthIF` provide access for commanding and monitoring
of components. On-board Mode Management is implement in hierarchy system.
DeviceHandlers and Controllers are the lowest part of the hierarchy.
The next layer are Assemblies. Those assemblies act as a component which handle
redundancies of handlers. Assemblies share a common core with the next level which
are the Subsystems.
Those Assemblies are intended to act as auto-generated components from a database which describes
the subsystem modes. The definitions contain transition and target tables which contain the DH,
Assembly and Controller Modes to be commanded.
Transition tables contain as many steps as needed to reach the mode from any other mode, e.g. a
switch into any higher AOCS mode might first turn on the sensors, than the actuators and the
controller as last component.
The target table is used to describe the state that is checked continuously by the subsystem.
All of this allows System Modes to be generated as Subsystem object as well from the same database.
This System contains list of subsystem modes in the transition and target tables.
Therefore, it allows a modular system to create system modes and easy commanding of those, because
only the highest components must be commanded.
The health state represents if the component is able to perform its tasks.
This can be used to signal the system to avoid using this component instead of a redundant one.
The on-board FDIR uses the health state for isolation and recovery.
# Unit Tests
Unit Tests are provided in the unittest folder. Those use the catch2 framework but do not include
catch2 itself. More information on how to run these tests can be found in the separate
[`fsfw_tests` reposoitory](https://egit.irs.uni-stuttgart.de/fsfw/fsfw_tests)

View File

@ -1,174 +0,0 @@
## Local Data Pools Developer Information
The following text is targeted towards mission software developers which would like
to use the local data pools provided by the FSFW to store data like sensor values so they can be
used by other software objects like controllers as well. If a custom class should have a local
pool which can be used by other software objects as well, following steps have to be performed:
1. Create a `LocalDataPoolManager` member object in the custom class
2. Implement the `HasLocalDataPoolIF` with specifies the interface between the local pool manager
and the class owning the local pool.
The local data pool manager is also able to process housekeeping service requests in form
of messages, generate periodic housekeeping packet, generate notification and snapshots of changed
variables and datasets and process notifications and snapshots coming from other objects.
The two former tasks are related to the external interface using telemetry and telecommands (TMTC)
while the later two are related to data consumers like controllers only acting on data change
detected by the data creator instead of checking the data manually each cycle. Two important
framework classes `DeviceHandlerBase` and `ExtendedControllerBase` already perform the two steps
shown above so the steps required are altered slightly.
### Storing and Accessing pool data
The pool manager is responsible for thread-safe access of the pool data, but the actual
access to the pool data from the point of view of a mission software developer happens via proxy
classes like pool variable classes. These classes store a copy
of the pool variable with the matching datatype and copy the actual data from the local pool
on a `read` call. Changed variables can then be written to the local pool with a `commit` call.
The `read` and `commit` calls are thread-safe and can be called concurrently from data creators
and data consumers. Generally, a user will create a dataset class which in turn groups all
cohesive pool variables. These sets simply iterator over the list of variables and call the
`read` and `commit` functions of each variable. The following diagram shows the
high-level architecture of the local data pools.
.. image:: ../misc/logo/FSFW_Logo_V3_bw.png
:alt: FSFW Logo
An example is shown for using the local data pools with a Gyroscope.
For example, the following code shows an implementation to access data from a Gyroscope taken
from the SOURCE CubeSat project:
```cpp
class GyroPrimaryDataset: public StaticLocalDataSet<3 * sizeof(float)> {
public:
/**
* Constructor for data users
* @param gyroId
*/
GyroPrimaryDataset(object_id_t gyroId):
StaticLocalDataSet(sid_t(gyroId, gyrodefs::GYRO_DATA_SET_ID)) {
setAllVariablesReadOnly();
}
lp_var_t<float> angVelocityX = lp_var_t<float>(sid.objectId,
gyrodefs::ANGULAR_VELOCITY_X, this);
lp_var_t<float> angVelocityY = lp_var_t<float>(sid.objectId,
gyrodefs::ANGULAR_VELOCITY_Y, this);
lp_var_t<float> angVelocityZ = lp_var_t<float>(sid.objectId,
gyrodefs::ANGULAR_VELOCITY_Z, this);
private:
friend class GyroHandler;
/**
* Constructor for data creator
* @param hkOwner
*/
GyroPrimaryDataset(HasLocalDataPoolIF* hkOwner):
StaticLocalDataSet(hkOwner, gyrodefs::GYRO_DATA_SET_ID) {}
};
```
There is a public constructor for users which sets all variables to read-only and there is a
constructor for the GyroHandler data creator by marking it private and declaring the `GyroHandler`
as a friend class. Both the atittude controller and the `GyroHandler` can now
use the same class definition to access the pool variables with `read` and `commit` semantics
in a thread-safe way. Generally, each class requiring access will have the set class as a member
class. The data creator will also be generally a `DeviceHandlerBase` subclass and some additional
steps are necessary to expose the set for housekeeping purposes.
### Using the local data pools in a `DeviceHandlerBase` subclass
It is very common to store data generated by devices like a sensor into a pool which can
then be used by other objects. Therefore, the `DeviceHandlerBase` already has a
local pool. Using the aforementioned example, our `GyroHandler` will now have the set class
as a member:
```cpp
class GyroHandler: ... {
public:
...
private:
...
GyroPrimaryDataset gyroData;
...
};
```
The constructor used for the creators expects the owner class as a parameter, so we initialize
the object in the `GyroHandler` constructor like this:
```cpp
GyroHandler::GyroHandler(object_id_t objectId, object_id_t comIF,
CookieIF *comCookie, uint8_t switchId):
DeviceHandlerBase(objectId, comIF, comCookie), switchId(switchId),
gyroData(this) {}
```
We need to assign the set to a reply ID used in the `DeviceHandlerBase`.
The combination of the `GyroHandler` object ID and the reply ID will be the 64-bit structure ID
`sid_t` and is used to globally identify the set, for example when requesting housekeeping data or
generating update messages. We need to assign our custom set class in some way so that the local
pool manager can access the custom data sets as well.
By default, the `getDataSetHandle` will take care of this tasks. The default implementation for a
`DeviceHandlerBase` subclass will use the internal command map to retrieve
a handle to a dataset from a given reply ID. Therefore,
we assign the set in the `fillCommandAndReplyMap` function:
```cpp
void GyroHandler::fillCommandAndReplyMap() {
...
this->insertInCommandAndReplyMap(gyrodefs::GYRO_DATA, 3, &gyroData);
...
}
```
Now, we need to create the actual pool entries as well, using the `initializeLocalDataPool`
function. Here, we also immediately subscribe for periodic housekeeping packets
with an interval of 4 seconds. They are still disabled in this example and can be enabled
with a housekeeping service command.
```cpp
ReturnValue_t GyroHandler::initializeLocalDataPool(localpool::DataPool &localDataPoolMap,
LocalDataPoolManager &poolManager) {
localDataPoolMap.emplace(gyrodefs::ANGULAR_VELOCITY_X,
new PoolEntry<float>({0.0}));
localDataPoolMap.emplace(gyrodefs::ANGULAR_VELOCITY_Y,
new PoolEntry<float>({0.0}));
localDataPoolMap.emplace(gyrodefs::ANGULAR_VELOCITY_Z,
new PoolEntry<float>({0.0}));
localDataPoolMap.emplace(gyrodefs::GENERAL_CONFIG_REG42,
new PoolEntry<uint8_t>({0}));
localDataPoolMap.emplace(gyrodefs::RANGE_CONFIG_REG43,
new PoolEntry<uint8_t>({0}));
poolManager.subscribeForPeriodicPacket(gyroData.getSid(), false, 4.0, false);
return returnvalue::OK;
}
```
Now, if we receive some sensor data and converted them into the right format,
we can write it into the pool like this, using a guard class to ensure the set is commited back
in any case:
```cpp
PoolReadGuard readHelper(&gyroData);
if(readHelper.getReadResult() == returnvalue::OK) {
if(not gyroData.isValid()) {
gyroData.setValidity(true, true);
}
gyroData.angVelocityX = angularVelocityX;
gyroData.angVelocityY = angularVelocityY;
gyroData.angVelocityZ = angularVelocityZ;
}
```
The guard class will commit the changed data on destruction automatically.
### Using the local data pools in a `ExtendedControllerBase` subclass
Coming soon

View File

@ -1,32 +0,0 @@
# Operating System Abstraction Layer (OSAL)
Some specific information on the provided OSALs are provided.
## Linux OSAL
This OSAL can be used to compile for Linux host systems like Ubuntu 20.04 or for
embedded Linux targets like the Raspberry Pi. This OSAL generally requires threading support
and real-time functionalities. For most UNIX systems, this is done by adding `-lrt` and `-lpthread` to the linked libraries in the compilation process. The CMake build support provided will do this automatically for the `fsfw` target. It should be noted that most UNIX systems need to be configured specifically to allow the real-time functionalities required by the FSFW.
More information on how to set up a Linux system accordingly can be found in the
[Linux README of the FSFW example application](https://egit.irs.uni-stuttgart.de/fsfw/fsfw_example/src/branch/master/doc/README-linux.md#top)
## Hosted OSAL
This is the newest OSAL. Support for Semaphores has not been implemented yet and will propably be implemented as soon as C++20 with Semaphore support has matured. This OSAL can be used to run the FSFW on any host system, but currently has only been tested on Windows 10 and Ubuntu 20.04. Unlike the other OSALs, it uses dynamic memory allocation (e.g. for the message queue implementation). Cross-platform serial port (USB) support might be added soon.
## FreeRTOS OSAL
FreeRTOS is not included and the developer needs to take care of compiling the FreeRTOS sources and adding the `FreeRTOSConfig.h` file location to the include path. This OSAL has only been tested extensively with the pre-emptive scheduler configuration so far but it should in principle also be possible to use a cooperative scheduler. It is recommended to use the `heap_4` allocation scheme. When using newlib (nano), it is also recommended to add `#define configUSE_NEWLIB_REENTRANT` to the FreeRTOS configuration file to ensure thread-safety.
When using this OSAL, developers also need to provide an implementation for the `vRequestContextSwitchFromISR` function. This has been done because the call to request a context switch from an ISR is generally located in the `portmacro.h` header and is different depending on the target architecture or device.
## RTEMS OSAL
The RTEMS OSAL was the first implemented OSAL which is also used on the active satellite Flying Laptop.
## TCP/IP socket abstraction
The Linux and Host OSAL provide abstraction layers for the socket API. Currently, only UDP sockets have been imlemented. This is very useful to test TMTC handling either on the host computer directly (targeting localhost with a TMTC application) or on embedded Linux devices, sending TMTC packets via Ethernet.

View File

@ -1 +0,0 @@
## PUS Services

View File

@ -4,6 +4,7 @@ API
.. toctree::
:maxdepth: 4
api/cfdp
api/objectmanager
api/task
api/ipc

8
docs/api/cfdp.rst Normal file
View File

@ -0,0 +1,8 @@
CFDP API
=================
``UserBase``
-----------------
.. doxygenclass:: cfdp::UserBase
:members:

View File

@ -17,12 +17,12 @@
# -- Project information -----------------------------------------------------
project = 'Flight Software Framework'
copyright = '2021, Institute of Space Systems (IRS)'
author = 'Institute of Space Systems (IRS)'
project = "Flight Software Framework"
copyright = "2021, Institute of Space Systems (IRS)"
author = "Institute of Space Systems (IRS)"
# The full version, including alpha/beta/rc tags
release = '2.0.1'
release = "5.0.0"
# -- General configuration ---------------------------------------------------
@ -30,17 +30,17 @@ release = '2.0.1'
# Add any Sphinx extension module names here, as strings. They can be
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
# ones.
extensions = [ "breathe" ]
extensions = ["breathe"]
breathe_default_project = "fsfw"
# Add any paths that contain templates here, relative to this directory.
templates_path = ['_templates']
templates_path = ["_templates"]
# List of patterns, relative to source directory, that match files and
# directories to ignore when looking for source files.
# This pattern also affects html_static_path and html_extra_path.
exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store']
exclude_patterns = ["_build", "Thumbs.db", ".DS_Store"]
# -- Options for HTML output -------------------------------------------------
@ -48,7 +48,15 @@ exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store']
# The theme to use for HTML and HTML Help pages. See the documentation for
# a list of builtin themes.
#
html_theme = 'alabaster'
html_theme = "alabaster"
html_theme_options = {
"extra_nav_links": {
"Impressum": "https://www.uni-stuttgart.de/impressum",
"Datenschutz": "https://info.irs.uni-stuttgart.de/datenschutz/datenschutzWebmit.html",
}
}
# Add any paths that contain custom static files (such as style sheets) here,
# relative to this directory. They are copied after the builtin static files,

View File

@ -7,12 +7,13 @@ 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. Most modern compilers like GCC should have support for this
standard, even for micocontrollers.
The FSFW might use dynamic allocation during program initialization but not during runtime.
It offers pool objects, static containers and it also exposes the
`Embedded Template Library <https://www.etlcpp.com/>`_ to allow writing code which does not perform
allocation during runtime. The fsfw uses run-time type information but will not throw exceptions.
Failure Handling
-----------------

View File

@ -4,6 +4,10 @@
#include <cstddef>
#include <cstdint>
// It is assumed the user has a subsystem and class ID list in some user header files.
// #include "events/subsystemIdRanges.h"
// #include "returnvalues/classIds.h"
//! Used to determine whether C++ ostreams are used which can increase
//! the binary size significantly. If this is disabled,
//! the C stdio functions can be used alternatively

View File

@ -4,7 +4,6 @@
#include <fsfw/devicehandlers/DeviceHandlerBase.h>
#include <fsfw/events/EventManager.h>
#include <fsfw/health/HealthTable.h>
#include <fsfw/tmtcpacket/pus/tm/TmPacketStored.h>
#include <fsfw/tmtcservices/CommandingServiceBase.h>
#include <fsfw/tmtcservices/PusServiceBase.h>
#include <fsfw/internalerror/InternalErrorReporter.h>
@ -41,13 +40,9 @@ void Factory::setStaticFrameworkObjectIds() {
CommandingServiceBase::defaultPacketSource = objects::NO_OBJECT;
CommandingServiceBase::defaultPacketDestination = objects::NO_OBJECT;
VerificationReporter::messageReceiver = objects::PUS_SERVICE_1_VERIFICATION;
DeviceHandlerBase::powerSwitcherId = objects::NO_OBJECT;
DeviceHandlerBase::rawDataReceiverId = objects::PUS_SERVICE_2_DEVICE_ACCESS;
DeviceHandlerFailureIsolation::powerConfirmationId = objects::NO_OBJECT;
TmPacketBase::timeStamperId = objects::NO_OBJECT;
}

View File

@ -12,7 +12,8 @@ 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

110
scripts/check_release.py Executable file
View File

@ -0,0 +1,110 @@
#! /bin/python
import argparse
import json
import urllib.request
import re
from pathlib import Path
def main() -> None:
parser = argparse.ArgumentParser(
description="List undocumented PRs"
)
parser.add_argument("-v", "--version", type=str, required=True)
args = parser.parse_args()
match = re.search("([0-9]+\.[0-9]+\.[0-9]+)", args.version)
if not match:
print("invalid version")
exit(1)
version = "v" + match.group(1)
print("looking for milestone for " + version + " ...")
with urllib.request.urlopen("https://egit.irs.uni-stuttgart.de/api/v1/repos/fsfw/fsfw/milestones?name=" + version) as milestone_json:
milestones = json.load(milestone_json)
if (len(milestones) == 0):
print("did not find any milestone")
exit(1)
if (len(milestones) > 1):
print("found multiple milestons")
milestone_title = milestones[0]['title']
milestone = str(milestones[0]['id'])
print("Using Milestone \""+ milestone_title + "\" with id " + milestone)
milestone_prs = []
page = 1
last_count = 1;
while last_count != 0:
with urllib.request.urlopen("https://egit.irs.uni-stuttgart.de/api/v1/repos/fsfw/fsfw/pulls?state=closed&milestone=" + str(milestone) + "&limit=100&page=" + str(page)) as pull_requests_json:
pull_requests = json.load(pull_requests_json)
for pr in pull_requests:
milestone_prs.append({'number': str(pr['number']), 'title' : pr['title']})
page += 1
last_count = len(pull_requests)
print("Found " + str(len(milestone_prs)) + " closed PRs in Milestone")
print("looking for CHANGELOG.md ...")
path = Path(".")
files = list(path.glob("CHANGELOG.md"))
if (len(files) != 1):
files = list(path.glob("../CHANGELOG.md"))
if (len(files) != 1):
print("did not find CHANGELOG.md. Run script in either root directory or scripts subfolder.")
exit(1)
print("Scanning CHANGELOG.md ...")
changelog_prs = []
with open(files[0]) as changelog:
line = changelog.readline()
while (line):
#print("line: " + line)
match = re.search("\#.+(v[0-9]+\.[0-9]+\.[0-9]+)", line)
if (match):
if match.group(1) == version:
#print("found version")
line = changelog.readline()
continue
else:
#print("done with " + match.group(1))
break
match = re.search("PR: https://egit\.irs\.uni-stuttgart\.de/fsfw/fsfw/pulls/([0-9]+)", line)
if match:
changelog_prs.append(match.group(1))
line = changelog.readline()
print("Found " + str(len(changelog_prs)) + " PRs in CHANGELOG.md")
print("")
copy_array = changelog_prs.copy()
print("PRs in CHANGELOG.md that are not in Milestone:")
for pr in milestone_prs:
if pr['number'] in copy_array:
copy_array.remove(pr['number'])
for pr in copy_array:
print("https://egit.irs.uni-stuttgart.de/fsfw/fsfw/pulls/" + pr)
print("")
print("PRs in milestone that are not in CHANGELOG.md:")
for pr in milestone_prs:
if pr['number'] not in changelog_prs:
print("- " + pr['title'] + "\n PR: https://egit.irs.uni-stuttgart.de/fsfw/fsfw/pulls/" + pr['number'])
main()

View File

@ -51,7 +51,7 @@ def main():
parser.add_argument(
"-g",
"--generators",
default = "Ninja",
default="Ninja",
action="store",
help="CMake generators",
)
@ -165,10 +165,18 @@ def create_tests_build_cfg(args):
os.mkdir(UNITTEST_FOLDER_NAME)
os.chdir(UNITTEST_FOLDER_NAME)
if args.windows:
cmake_cmd = 'cmake -G "' + args.generators + '" -DFSFW_OSAL=host -DFSFW_BUILD_TESTS=ON \
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 ..'
cmake_cmd = (
'cmake -G "'
+ args.generators
+ '" -DFSFW_OSAL=host -DFSFW_BUILD_TESTS=ON ..'
)
cmd_runner(cmake_cmd)
os.chdir("..")
@ -199,7 +207,7 @@ def check_for_cmake_build_dir(build_dir_list: list) -> list:
def perform_lcov_operation(directory: str, chdir: bool):
if chdir:
os.chdir(directory)
cmd_runner("cmake --build . -- fsfw-tests_coverage -j")
cmd_runner("cmake --build . -j -- fsfw-tests_coverage")
def determine_build_dir(build_dir_list: List[str]):

View File

@ -31,6 +31,8 @@ add_subdirectory(thermal)
add_subdirectory(timemanager)
add_subdirectory(tmtcpacket)
add_subdirectory(tmtcservices)
add_subdirectory(filesystem)
add_subdirectory(util)
# Optional

View File

@ -59,17 +59,24 @@ void ActionHelper::setQueueToUse(MessageQueueIF* queue) { queueToUse = queue; }
void ActionHelper::prepareExecution(MessageQueueId_t commandedBy, ActionId_t actionId,
store_address_t dataAddress) {
bool hasAdditionalData = false;
const uint8_t* dataPtr = nullptr;
size_t size = 0;
ReturnValue_t result = ipcStore->getData(dataAddress, &dataPtr, &size);
if (result != returnvalue::OK) {
CommandMessage reply;
ActionMessage::setStepReply(&reply, actionId, 0, result);
queueToUse->sendMessage(commandedBy, &reply);
return;
ReturnValue_t result;
if (dataAddress != store_address_t::invalid()) {
hasAdditionalData = true;
ReturnValue_t result = ipcStore->getData(dataAddress, &dataPtr, &size);
if (result != returnvalue::OK) {
CommandMessage reply;
ActionMessage::setStepReply(&reply, actionId, 0, result);
queueToUse->sendMessage(commandedBy, &reply);
return;
}
}
result = owner->executeAction(actionId, commandedBy, dataPtr, size);
ipcStore->deleteData(dataAddress);
if (hasAdditionalData) {
ipcStore->deleteData(dataAddress);
}
if (result == HasActionsIF::EXECUTION_FINISHED) {
CommandMessage reply;
ActionMessage::setCompletionReply(&reply, actionId, true, result);

12
src/fsfw/cfdp.h Normal file
View File

@ -0,0 +1,12 @@
#ifndef FSFW_CFDP_H
#define FSFW_CFDP_H
#include "cfdp/definitions.h"
#include "cfdp/handler/DestHandler.h"
#include "cfdp/handler/FaultHandlerBase.h"
#include "cfdp/helpers.h"
#include "cfdp/tlv/Lv.h"
#include "cfdp/tlv/StringLv.h"
#include "cfdp/tlv/Tlv.h"
#endif // FSFW_CFDP_H

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 helpers.cpp)
add_subdirectory(pdu)
add_subdirectory(tlv)
add_subdirectory(handler)

View File

@ -0,0 +1,55 @@
#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.setReadOnlyData(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(); }

View File

@ -0,0 +1,76 @@
#ifndef FSFW_TCDISTRIBUTION_CFDPDISTRIBUTOR_H_
#define FSFW_TCDISTRIBUTION_CFDPDISTRIBUTOR_H_
#include <utility>
#include <vector>
#include "fsfw/cfdp/pdu/PduHeaderReader.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;
};
PduHeaderReader 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_ */

View File

@ -1,58 +0,0 @@
#include "fsfw/cfdp/CfdpHandler.h"
#include "fsfw/cfdp/CfdpMessage.h"
#include "fsfw/ipc/CommandMessage.h"
#include "fsfw/ipc/QueueFactory.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) {
auto mqArgs = MqArgs(setObjectId, static_cast<void*>(this));
requestQueue = QueueFactory::instance()->createMessageQueue(
CFDP_HANDLER_MAX_RECEPTION, MessageQueueMessage::MAX_MESSAGE_SIZE, &mqArgs);
distributor = dist;
}
CfdpHandler::~CfdpHandler() = default;
ReturnValue_t CfdpHandler::initialize() {
ReturnValue_t result = SystemObject::initialize();
if (result != returnvalue::OK) {
return result;
}
this->distributor->registerHandler(this);
return returnvalue::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 returnvalue::OK;
}
ReturnValue_t CfdpHandler::performOperation(uint8_t opCode) {
ReturnValue_t status = returnvalue::OK;
CommandMessage currentMessage;
for (status = this->requestQueue->receiveMessage(&currentMessage); status == returnvalue::OK;
status = this->requestQueue->receiveMessage(&currentMessage)) {
store_address_t storeId = CfdpMessage::getStoreId(&currentMessage);
this->handleRequest(storeId);
}
return returnvalue::OK;
}
uint16_t CfdpHandler::getIdentifier() { return 0; }
MessageQueueId_t CfdpHandler::getRequestQueue() { return this->requestQueue->getId(); }

View File

@ -1,60 +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/returnvalue.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 {
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_ */

View File

@ -4,8 +4,9 @@ CfdpMessage::CfdpMessage() = default;
CfdpMessage::~CfdpMessage() = default;
void CfdpMessage::setCommand(CommandMessage *message, store_address_t cfdpPacket) {
message->setParameter(cfdpPacket.raw);
void CfdpMessage::setPutRequest(CommandMessage *message, store_address_t putRequest) {
message->setCommand(PUT_REQUEST);
message->setParameter(putRequest.raw);
}
store_address_t CfdpMessage::getStoreId(const CommandMessage *message) {

View File

@ -11,9 +11,11 @@ class CfdpMessage {
public:
static const uint8_t MESSAGE_ID = messagetypes::CFDP;
static const Command_t PUT_REQUEST = MAKE_COMMAND_ID(1);
static const Command_t CANCEL_REQUEST = MAKE_COMMAND_ID(1);
virtual ~CfdpMessage();
static void setCommand(CommandMessage* message, store_address_t cfdpPacket);
static void setPutRequest(CommandMessage* message, store_address_t putRequest);
static store_address_t getStoreId(const CommandMessage* message);

View File

@ -1,16 +1,23 @@
#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 <optional>
#include "fsfw/serialize/SerializeAdapter.h"
#include "fsfw/serialize/SerializeIF.h"
namespace cfdp {
struct FileSize : public SerializeIF {
/**
* Helper type for the CFDP File Size Sensitive (FSS) fields.
*/
struct Fss : public SerializeIF {
public:
FileSize() : largeFile(false){};
Fss() = default;
FileSize(uint64_t fileSize, bool isLarge = false) { setFileSize(fileSize, isLarge); };
explicit Fss(uint64_t fileSize, bool isLarge = false) { setFileSize(fileSize, isLarge); };
[[nodiscard]] uint64_t value() const { return fileSize; }
ReturnValue_t serialize(bool isLarge, uint8_t **buffer, size_t *size, size_t maxSize,
Endianness streamEndianness) {
@ -27,7 +34,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 {
@ -50,20 +57,22 @@ struct FileSize : public SerializeIF {
}
}
ReturnValue_t setFileSize(uint64_t fileSize, bool largeFile) {
ReturnValue_t setFileSize(uint64_t fileSize_, std::optional<bool> largeFile_) {
if (largeFile_) {
largeFile = largeFile_.value();
}
if (not largeFile and fileSize > UINT32_MAX) {
// TODO: emit warning here
return returnvalue::FAILED;
}
this->fileSize = fileSize;
this->largeFile = largeFile;
this->fileSize = fileSize_;
return returnvalue::OK;
}
bool isLargeFile() const { return largeFile; }
uint64_t getSize(bool *largeFile = nullptr) const {
if (largeFile != nullptr) {
*largeFile = this->largeFile;
[[nodiscard]] bool isLargeFile() const { return largeFile; }
uint64_t getSize(bool *largeFile_ = nullptr) const {
if (largeFile_ != nullptr) {
*largeFile_ = this->largeFile;
}
return fileSize;
}
@ -75,4 +84,4 @@ struct FileSize : public SerializeIF {
} // namespace cfdp
#endif /* FSFW_SRC_FSFW_CFDP_FILESIZE_H_ */
#endif /* FSFW_CFDP_FILESIZE_H_ */

View File

@ -1,11 +1,10 @@
#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);
cfdp::VarLenField::VarLenField(cfdp::WidthInBytes width, uint64_t value) : VarLenField() {
ReturnValue_t result = this->setValueAndWidth(width, value);
if (result != returnvalue::OK) {
#if FSFW_DISABLE_PRINTOUT == 0
#if FSFW_CPP_OSTREAM_ENABLED == 1
@ -21,38 +20,41 @@ 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) {
switch (widthInBytes) {
ReturnValue_t cfdp::VarLenField::setValueAndWidth(cfdp::WidthInBytes width_, uint64_t value_) {
switch (width_) {
case (cfdp::WidthInBytes::ONE_BYTE): {
if (value > UINT8_MAX) {
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) {
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) {
if (value_ > UINT32_MAX) {
return returnvalue::FAILED;
}
this->value.fourBytes = value;
this->value.fourBytes = value_;
break;
}
case (cfdp::WidthInBytes::EIGHT_BYTES): {
this->value.eightBytes = value_;
}
default: {
break;
}
}
this->width = widthInBytes;
this->width = width_;
return returnvalue::OK;
}
size_t cfdp::VarLenField::getValue() const {
uint64_t cfdp::VarLenField::getValue() const {
switch (width) {
case (cfdp::WidthInBytes::ONE_BYTE): {
return value.oneByte;
@ -63,6 +65,9 @@ size_t cfdp::VarLenField::getValue() const {
case (cfdp::WidthInBytes::FOUR_BYTES): {
return value.fourBytes;
}
case (cfdp::WidthInBytes::EIGHT_BYTES): {
return value.eightBytes;
}
}
return 0;
}
@ -85,6 +90,10 @@ ReturnValue_t cfdp::VarLenField::serialize(uint8_t **buffer, size_t *size, size_
case (cfdp::WidthInBytes::FOUR_BYTES): {
return SerializeAdapter::serialize(&value.fourBytes, buffer, size, maxSize, streamEndianness);
}
case (cfdp::WidthInBytes::EIGHT_BYTES): {
return SerializeAdapter::serialize(&value.eightBytes, buffer, size, maxSize,
streamEndianness);
}
default: {
return returnvalue::FAILED;
}
@ -93,17 +102,22 @@ ReturnValue_t cfdp::VarLenField::serialize(uint8_t **buffer, size_t *size, size_
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);
}
ReturnValue_t cfdp::VarLenField::setValue(uint64_t value_) {
return setValueAndWidth(getWidth(), value_);
}
ReturnValue_t cfdp::VarLenField::deSerialize(const uint8_t **buffer, size_t *size,
Endianness streamEndianness) {
switch (width) {
case (cfdp::WidthInBytes::ONE_BYTE): {
value.oneByte = **buffer;
*buffer += 1;
*size += 1;
return returnvalue::OK;
}
@ -113,8 +127,31 @@ ReturnValue_t cfdp::VarLenField::deSerialize(const uint8_t **buffer, size_t *siz
case (cfdp::WidthInBytes::FOUR_BYTES): {
return SerializeAdapter::deSerialize(&value.fourBytes, buffer, size, streamEndianness);
}
case (cfdp::WidthInBytes::EIGHT_BYTES): {
return SerializeAdapter::deSerialize(&value.eightBytes, buffer, size, streamEndianness);
}
default: {
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();
}
bool cfdp::VarLenField::operator!=(const cfdp::VarLenField &other) const {
return not(*this == other);
}
void cfdp::VarLenField::setWidth(cfdp::WidthInBytes width_) { this->width = width_; }

View File

@ -0,0 +1,135 @@
#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/serviceinterface.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, uint64_t value);
bool operator==(const VarLenField &other) const;
bool operator!=(const VarLenField &other) const;
bool operator<(const VarLenField &other) const;
ReturnValue_t setValueAndWidth(cfdp::WidthInBytes width, uint64_t value);
void setWidth(cfdp::WidthInBytes width);
ReturnValue_t setValue(uint64_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]] uint64_t getValue() const;
#if FSFW_CPP_OSTREAM_ENABLED == 1
friend std::ostream &operator<<(std::ostream &os, const VarLenField &id) {
os << "dec: " << id.getValue() << ", hex: " << std::hex << std::setw(id.getWidth())
<< std::setfill('0') << id.getValue() << std::dec << std::setfill('0');
return os;
}
#endif
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);
setValueAndWidth(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) {}
ReturnValue_t serializeAsLv(uint8_t **buffer, size_t *size, size_t maxSize) const {
if (buffer == nullptr or size == nullptr) {
return returnvalue::FAILED;
}
if (*size + 1 + getWidth() > maxSize) {
return SerializeIF::BUFFER_TOO_SHORT;
}
**buffer = getWidth();
*buffer += 1;
*size += 1;
return serialize(buffer, size, maxSize, SerializeIF::Endianness::NETWORK);
}
ReturnValue_t deSerializeFromLv(const uint8_t **buffer, size_t *deserLen) {
if (buffer == nullptr or deserLen == nullptr) {
return returnvalue::FAILED;
}
if (*deserLen < 2) {
return SerializeIF::STREAM_TOO_SHORT;
}
auto width = static_cast<WidthInBytes>(**buffer);
*buffer += 1;
*deserLen -= 1;
return VarLenField::deSerialize(width, buffer, deserLen, SerializeIF::Endianness::NETWORK);
}
};
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) const {
return entityId == other.entityId and seqNum == other.seqNum;
}
#if FSFW_CPP_OSTREAM_ENABLED == 1
friend std::ostream &operator<<(std::ostream &os, const TransactionId &id) {
os << "Source ID { " << id.entityId << " }, Sequence Number " << id.seqNum.getValue();
return os;
}
#endif
EntityId entityId;
TransactionSeqNum seqNum;
};
} // namespace cfdp
#endif /* FSFW_CFDP_PDU_VARLENFIELD_H_ */

View File

@ -11,12 +11,16 @@
namespace cfdp {
static constexpr uint8_t VERSION_BITS = 0b00100000;
static constexpr char CFDP_VERSION_2_NAME[] = "CCSDS 727.0-B-5";
static constexpr uint8_t CFDP_CLASS_ID = CLASS_ID::CFDP;
// 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_BASE;
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_DIRECTIVE_FIELD = 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 =
returnvalue::makeCode(CFDP_CLASS_ID, 4);
@ -26,13 +30,14 @@ static constexpr ReturnValue_t METADATA_CANT_PARSE_OPTIONS =
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 =
returnvalue::makeCode(CFDP_CLASS_ID, 6);
returnvalue::makeCode(CFDP_CLASS_ID, 7);
static constexpr ReturnValue_t FILESTORE_REQUIRES_SECOND_FILE =
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 =
returnvalue::makeCode(CFDP_CLASS_ID, 9);
static constexpr ReturnValue_t INVALID_PDU_FORMAT = returnvalue::makeCode(CFDP_CLASS_ID, 10);
//! Checksum types according to the SANA Checksum Types registry
//! https://sanaregistry.org/r/checksum_identifiers/
@ -45,17 +50,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 TransmissionMode : 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 {
@ -63,10 +68,12 @@ enum WidthInBytes : uint8_t {
ONE_BYTE = 1,
TWO_BYTES = 2,
FOUR_BYTES = 4,
EIGHT_BYTES = 8
};
enum FileDirectives : uint8_t {
enum FileDirective : uint8_t {
INVALID_DIRECTIVE = 0x0f,
// The _DIRECTIVE suffix is mandatory here because of some nameclash!
EOF_DIRECTIVE = 0x04,
FINISH = 0x05,
ACK = 0x06,
@ -93,6 +100,14 @@ enum ConditionCode : uint8_t {
CANCEL_REQUEST_RECEIVED = 0b1111
};
enum FaultHandlerCode {
RESERVED = 0b0000,
NOTICE_OF_CANCELLATION = 0b0001,
NOTICE_OF_SUSPENSION = 0b0010,
IGNORE_ERROR = 0b0011,
ABANDON_TRANSACTION = 0b0100
};
enum AckTransactionStatus {
UNDEFINED = 0b00,
ACTIVE = 0b01,
@ -100,18 +115,18 @@ 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 {
enum TlvType : uint8_t {
FILESTORE_REQUEST = 0x00,
FILESTORE_RESPONSE = 0x01,
MSG_TO_USER = 0x02,
@ -128,6 +143,20 @@ enum RecordContinuationState {
CONTAINS_START_AND_END = 0b11
};
enum class ProxyOpMessageType : uint8_t {
PUT_REQUEST = 0x00,
MSG_TO_USR = 0x01,
FS_REQUEST = 0x02,
FAULT_HANDLER_OVERRIDE = 0x03,
TRANSMISSION_MODE = 0x04,
FLOW_LABEL = 0x05,
SEG_CTRL = 0x06,
PUT_RESPONSE = 0x07,
FS_RESPONSE = 0x08,
PUT_CANCEL = 0x09,
CLOSURE = 0x0b
};
} // namespace cfdp
#endif /* FSFW_SRC_FSFW_CFDP_PDU_DEFINITIONS_H_ */

View File

@ -0,0 +1,4 @@
target_sources(
${LIB_FSFW_NAME}
PRIVATE SourceHandler.cpp DestHandler.cpp PutRequest.cpp
ReservedMessageParser.cpp FaultHandlerBase.cpp UserBase.cpp)

View File

@ -0,0 +1,574 @@
#include "DestHandler.h"
#include <etl/crc32.h>
#include <utility>
#include "fsfw/FSFW.h"
#include "fsfw/cfdp/pdu/EofPduReader.h"
#include "fsfw/cfdp/pdu/FileDataReader.h"
#include "fsfw/cfdp/pdu/FinishedPduCreator.h"
#include "fsfw/cfdp/pdu/PduHeaderReader.h"
#include "fsfw/objectmanager.h"
#include "fsfw/tmtcservices/TmTcMessage.h"
using namespace returnvalue;
cfdp::DestHandler::DestHandler(DestHandlerParams params, FsfwParams fsfwParams)
: tlvVec(params.maxTlvsInOnePdu),
msgToUserVec(params.maxTlvsInOnePdu),
transactionParams(params.maxFilenameLen),
destParams(std::move(params)),
fsfwParams(fsfwParams) {
transactionParams.pduConf.direction = cfdp::Direction::TOWARDS_SENDER;
}
const cfdp::DestHandler::FsmResult& cfdp::DestHandler::stateMachine() {
ReturnValue_t result;
uint8_t errorIdx = 0;
fsmRes.resetOfIteration();
if (fsmRes.step == TransactionStep::IDLE) {
for (auto infoIter = destParams.packetListRef.begin();
infoIter != destParams.packetListRef.end();) {
if (infoIter->pduType == PduType::FILE_DIRECTIVE and
infoIter->directiveType == FileDirective::METADATA) {
result = handleMetadataPdu(*infoIter);
checkAndHandleError(result, errorIdx);
// Store data was deleted in PDU handler because a store guard is used
destParams.packetListRef.erase(infoIter++);
} else {
infoIter++;
}
}
if (fsmRes.step == TransactionStep::IDLE) {
// To decrease the already high complexity of the software, all packets arriving before
// a metadata PDU are deleted.
for (auto infoIter = destParams.packetListRef.begin();
infoIter != destParams.packetListRef.end();) {
fsfwParams.tcStore->deleteData(infoIter->storeId);
infoIter++;
}
destParams.packetListRef.clear();
}
if (fsmRes.step != TransactionStep::IDLE) {
fsmRes.callStatus = CallStatus::CALL_AGAIN;
}
return updateFsmRes(errorIdx);
}
if (fsmRes.state == CfdpState::BUSY_CLASS_1_NACKED) {
if (fsmRes.step == TransactionStep::RECEIVING_FILE_DATA_PDUS) {
for (auto infoIter = destParams.packetListRef.begin();
infoIter != destParams.packetListRef.end();) {
if (infoIter->pduType == PduType::FILE_DATA) {
result = handleFileDataPdu(*infoIter);
checkAndHandleError(result, errorIdx);
// Store data was deleted in PDU handler because a store guard is used
destParams.packetListRef.erase(infoIter++);
} else if (infoIter->pduType == PduType::FILE_DIRECTIVE and
infoIter->directiveType == FileDirective::EOF_DIRECTIVE) {
// TODO: Support for check timer missing
result = handleEofPdu(*infoIter);
checkAndHandleError(result, errorIdx);
// Store data was deleted in PDU handler because a store guard is used
destParams.packetListRef.erase(infoIter++);
} else {
infoIter++;
}
}
}
if (fsmRes.step == TransactionStep::TRANSFER_COMPLETION) {
result = handleTransferCompletion();
checkAndHandleError(result, errorIdx);
}
if (fsmRes.step == TransactionStep::SENDING_FINISHED_PDU) {
result = sendFinishedPdu();
checkAndHandleError(result, errorIdx);
finish();
}
return updateFsmRes(errorIdx);
}
if (fsmRes.state == CfdpState::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 updateFsmRes(errorIdx);
}
ReturnValue_t cfdp::DestHandler::passPacket(PacketInfo packet) {
if (destParams.packetListRef.full()) {
return FAILED;
}
destParams.packetListRef.push_back(packet);
return OK;
}
ReturnValue_t cfdp::DestHandler::initialize() {
if (fsfwParams.tmStore == nullptr) {
fsfwParams.tmStore = ObjectManager::instance()->get<StorageManagerIF>(objects::TM_STORE);
if (fsfwParams.tmStore == nullptr) {
return FAILED;
}
}
if (fsfwParams.tcStore == nullptr) {
fsfwParams.tcStore = ObjectManager::instance()->get<StorageManagerIF>(objects::TC_STORE);
if (fsfwParams.tcStore == nullptr) {
return FAILED;
}
}
if (fsfwParams.msgQueue == nullptr) {
return FAILED;
}
return OK;
}
ReturnValue_t cfdp::DestHandler::handleMetadataPdu(const PacketInfo& info) {
// Process metadata PDU
auto constAccessorPair = fsfwParams.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;
MetadataGenericInfo metadataInfo(transactionParams.fileSize);
MetadataPduReader reader(constAccessorPair.second.data(), constAccessorPair.second.size(),
metadataInfo, tlvVec.data(), tlvVec.size());
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(result, constAccessorPair.second.data(),
constAccessorPair.second.size());
}
return startTransaction(reader);
}
ReturnValue_t cfdp::DestHandler::handleFileDataPdu(const cfdp::PacketInfo& info) {
// Process file data PDU
auto constAccessorPair = fsfwParams.tcStore->getData(info.storeId);
if (constAccessorPair.first != OK) {
// TODO: This is not a CFDP error. Event and/or warning?
return constAccessorPair.first;
}
FileDataInfo fdInfo;
FileDataReader reader(constAccessorPair.second.data(), constAccessorPair.second.size(), fdInfo);
ReturnValue_t result = reader.parseData();
if (result != OK) {
return result;
}
size_t fileSegmentLen = 0;
const uint8_t* fileData = fdInfo.getFileData(&fileSegmentLen);
FileOpParams fileOpParams(transactionParams.destName.data(), fileSegmentLen);
fileOpParams.offset = fdInfo.getOffset().value();
if (destParams.cfg.indicCfg.fileSegmentRecvIndicRequired) {
FileSegmentRecvdParams segParams;
segParams.offset = fdInfo.getOffset().value();
segParams.id = transactionParams.transactionId;
segParams.length = fileSegmentLen;
segParams.recContState = fdInfo.getRecordContinuationState();
size_t segmentMetadatLen = 0;
auto* segMetadata = fdInfo.getSegmentMetadata(&segmentMetadatLen);
segParams.segmentMetadata = {segMetadata, segmentMetadatLen};
destParams.user.fileSegmentRecvdIndication(segParams);
}
result = destParams.user.vfs.writeToFile(fileOpParams, fileData);
if (result != returnvalue::OK) {
// TODO: Proper Error handling
#if FSFW_CPP_OSTREAM_ENABLED == 1
sif::error << "cfdp::DestHandler: VFS file write error with code 0x" << std::hex << std::setw(2)
<< result << std::endl;
#endif
transactionParams.vfsErrorCount++;
if (transactionParams.vfsErrorCount < 3) {
// TODO: Provide execution step as parameter
fsfwParams.eventReporter->forwardEvent(events::FILESTORE_ERROR,
static_cast<uint8_t>(fsmRes.step), result);
}
return result;
} else {
transactionParams.deliveryStatus = FileDeliveryStatus::RETAINED_IN_FILESTORE;
transactionParams.vfsErrorCount = 0;
}
if (fdInfo.getOffset().value() + fileSegmentLen > transactionParams.progress) {
transactionParams.progress = fdInfo.getOffset().value() + fileSegmentLen;
}
return result;
}
ReturnValue_t cfdp::DestHandler::handleEofPdu(const cfdp::PacketInfo& info) {
// Process EOF PDU
auto constAccessorPair = fsfwParams.tcStore->getData(info.storeId);
if (constAccessorPair.first != OK) {
// TODO: This is not a CFDP error. Event and/or warning?
return constAccessorPair.first;
}
EofInfo eofInfo(nullptr);
EofPduReader reader(constAccessorPair.second.data(), constAccessorPair.second.size(), eofInfo);
ReturnValue_t result = reader.parseData();
if (result != OK) {
return result;
}
// TODO: Error handling
if (eofInfo.getConditionCode() == ConditionCode::NO_ERROR) {
transactionParams.crc = eofInfo.getChecksum();
uint64_t fileSizeFromEof = eofInfo.getFileSize().value();
// CFDP 4.6.1.2.9: Declare file size error if progress exceeds file size
if (fileSizeFromEof > transactionParams.progress) {
// TODO: File size error
}
transactionParams.fileSize.setFileSize(fileSizeFromEof, std::nullopt);
}
if (destParams.cfg.indicCfg.eofRecvIndicRequired) {
destParams.user.eofRecvIndication(getTransactionId());
}
if (fsmRes.step == TransactionStep::RECEIVING_FILE_DATA_PDUS) {
if (fsmRes.state == CfdpState::BUSY_CLASS_1_NACKED) {
fsmRes.step = TransactionStep::TRANSFER_COMPLETION;
} else if (fsmRes.state == CfdpState::BUSY_CLASS_2_ACKED) {
fsmRes.step = TransactionStep::SENDING_ACK_PDU;
}
}
return returnvalue::OK;
}
ReturnValue_t cfdp::DestHandler::handleMetadataParseError(ReturnValue_t result,
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
PduHeaderReader headerReader(rawData, maxSize);
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 destParams.remoteCfgTable.getRemoteCfg(destId, &remoteCfg)) {
// TODO: No remote config for dest ID. I consider this a configuration error, which is not
// covered by the standard.
// 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(const MetadataPduReader& reader) {
if (fsmRes.state != CfdpState::IDLE) {
// According to standard, discard metadata PDU if we are busy
return OK;
}
ReturnValue_t result = OK;
size_t sourceNameSize = 0;
if (not reader.getSourceFileName().isEmpty()) {
const uint8_t* sourceNamePtr = reader.getSourceFileName().getValue(&sourceNameSize);
if (sourceNameSize + 1 > transactionParams.sourceName.size()) {
fileErrorHandler(events::FILENAME_TOO_LARGE_ERROR, 0, "source filename too large");
return FAILED;
}
std::memcpy(transactionParams.sourceName.data(), sourceNamePtr, sourceNameSize);
transactionParams.sourceName[sourceNameSize] = '\0';
}
size_t destNameSize = 0;
if (not reader.getDestFileName().isEmpty()) {
const uint8_t* destNamePtr = reader.getDestFileName().getValue(&destNameSize);
if (destNameSize + 1 > transactionParams.destName.size()) {
fileErrorHandler(events::FILENAME_TOO_LARGE_ERROR, 0, "dest filename too large");
return FAILED;
}
std::memcpy(transactionParams.destName.data(), destNamePtr, destNameSize);
transactionParams.destName[destNameSize] = '\0';
}
transactionParams.metadataOnly = true;
// If both dest name size and source name size are 0, we are dealing with a metadata only PDU,
// so there is no need to create a file or truncate an existing file
if (destNameSize > 0 and sourceNameSize > 0) {
transactionParams.metadataOnly = false;
FilesystemParams fparams(transactionParams.destName.data());
// handling to allow only specifying target directory. Example:
// Source path /test/hello.txt, dest path /tmp -> dest path /tmp/hello.txt
if (destParams.user.vfs.isDirectory(transactionParams.destName.data())) {
result = tryBuildingAbsoluteDestName(destNameSize);
if (result != OK) {
return result;
}
}
if (destParams.user.vfs.fileExists(fparams)) {
result = destParams.user.vfs.truncateFile(fparams);
if (result != returnvalue::OK) {
fileErrorHandler(events::FILESTORE_ERROR, result, "file truncation error");
return FAILED;
// TODO: Relevant for filestore rejection error?
}
} else {
result = destParams.user.vfs.createFile(fparams);
if (result != OK) {
fileErrorHandler(events::FILESTORE_ERROR, result, "file creation error");
return FAILED;
// TODO: Relevant for filestore rejection error?
}
}
}
EntityId sourceId;
reader.getSourceId(sourceId);
if (not destParams.remoteCfgTable.getRemoteCfg(sourceId, &transactionParams.remoteCfg)) {
// TODO: Warning, event etc.
#if FSFW_CPP_OSTREAM_ENABLED == 1
sif::warning << "cfdp::DestHandler" << __func__
<< ": No remote configuration found for destination ID "
<< transactionParams.pduConf.sourceId.getValue() << std::endl;
#endif
return FAILED;
}
if (reader.getTransmissionMode() == TransmissionMode::UNACKNOWLEDGED) {
fsmRes.state = CfdpState::BUSY_CLASS_1_NACKED;
} else if (reader.getTransmissionMode() == TransmissionMode::ACKNOWLEDGED) {
fsmRes.state = CfdpState::BUSY_CLASS_2_ACKED;
}
if (transactionParams.metadataOnly) {
fsmRes.step = TransactionStep::TRANSFER_COMPLETION;
} else {
// Kind of ugly, make FSM working on packet per packet basis..
fsmRes.step = TransactionStep::TRANSACTION_START;
fsmRes.step = TransactionStep::RECEIVING_FILE_DATA_PDUS;
}
auto& info = reader.getGenericInfo();
transactionParams.checksumType = info.getChecksumType();
transactionParams.closureRequested = info.isClosureRequested();
reader.fillConfig(transactionParams.pduConf);
transactionParams.pduConf.direction = Direction::TOWARDS_SENDER;
transactionParams.transactionId.entityId = transactionParams.pduConf.sourceId;
transactionParams.transactionId.seqNum = transactionParams.pduConf.seqNum;
transactionParams.fileSize = info.getFileSize();
MetadataRecvdParams params(transactionParams.transactionId, transactionParams.pduConf.sourceId,
transactionParams.fileSize);
params.destFileName = transactionParams.destName.data();
params.sourceFileName = transactionParams.sourceName.data();
params.numberOfMsgsToUser = 0;
for (const auto& opt : tlvVec) {
if (opt.getType() == TlvType::MSG_TO_USER) {
msgToUserVec[params.numberOfMsgsToUser] =
MessageToUserTlv(opt.getValue(), opt.getLengthField());
params.numberOfMsgsToUser++;
}
}
params.msgsToUserArray = msgToUserVec.data();
destParams.user.metadataRecvdIndication(params);
return result;
}
cfdp::CfdpState cfdp::DestHandler::getCfdpState() const { return fsmRes.state; }
ReturnValue_t cfdp::DestHandler::handleTransferCompletion() {
ReturnValue_t result;
if (transactionParams.checksumType != ChecksumType::NULL_CHECKSUM) {
result = checksumVerification();
if (result != OK) {
// TODO: Warning / error handling?
}
} else {
transactionParams.conditionCode = ConditionCode::NO_ERROR;
}
result = noticeOfCompletion();
if (result != OK) {
}
if (fsmRes.state == CfdpState::BUSY_CLASS_1_NACKED) {
if (transactionParams.closureRequested) {
fsmRes.step = TransactionStep::SENDING_FINISHED_PDU;
} else {
finish();
}
} else if (fsmRes.state == CfdpState::BUSY_CLASS_2_ACKED) {
fsmRes.step = TransactionStep::SENDING_FINISHED_PDU;
}
return OK;
}
ReturnValue_t cfdp::DestHandler::tryBuildingAbsoluteDestName(size_t destNameSize) {
// A path may only have a maximum of 256 characters in CFDP, so this buffer should be sufficient
// for all use-cases.
char baseNameBuf[512]{};
FilesystemParams fparamsSrc(transactionParams.sourceName.data());
size_t baseNameLen = 0;
ReturnValue_t result = destParams.user.vfs.getBaseFilename(fparamsSrc, baseNameBuf,
sizeof(baseNameBuf), baseNameLen);
if (result != returnvalue::OK or baseNameLen == 0) {
fileErrorHandler(events::FILENAME_TOO_LARGE_ERROR, 0, "error retrieving source base name");
return FAILED;
}
// Destination name + slash + base name + null termination
if (destNameSize + 1 + baseNameLen + 1 > transactionParams.destName.size()) {
fileErrorHandler(events::FILENAME_TOO_LARGE_ERROR, 0,
"dest filename too large after adding source base name");
return FAILED;
}
transactionParams.destName[destNameSize++] = '/';
std::memcpy(transactionParams.destName.data() + destNameSize, baseNameBuf, baseNameLen);
destNameSize += baseNameLen;
transactionParams.destName[destNameSize++] = '\0';
return OK;
}
void cfdp::DestHandler::fileErrorHandler(Event event, ReturnValue_t result,
const char* info) const {
fsfwParams.eventReporter->forwardEvent(event, static_cast<uint8_t>(fsmRes.step), result);
#if FSFW_CPP_OSTREAM_ENABLED == 1
sif::warning << "cfdp::DestHandler: " << info << std::endl;
#endif
}
void cfdp::DestHandler::finish() {
transactionParams.reset();
destParams.packetListRef.clear();
fsmRes.state = CfdpState::IDLE;
fsmRes.step = TransactionStep::IDLE;
}
ReturnValue_t cfdp::DestHandler::checksumVerification() {
std::array<uint8_t, 1024> buf{};
etl::crc32 crcCalc;
uint64_t currentOffset = 0;
FileOpParams params(transactionParams.destName.data(), transactionParams.fileSize.value());
while (currentOffset < transactionParams.fileSize.value()) {
uint64_t readLen;
if (currentOffset + buf.size() > transactionParams.fileSize.value()) {
readLen = transactionParams.fileSize.value() - currentOffset;
} else {
readLen = buf.size();
}
if (readLen > 0) {
params.offset = currentOffset;
params.size = readLen;
auto result = destParams.user.vfs.readFromFile(params, buf.data(), buf.size());
if (result != OK) {
// TODO: I think this is a case for a filestore rejection, but it might sense to print
// a warning or trigger an event because this should generally not happen
return FAILED;
}
crcCalc.add(buf.begin(), buf.begin() + readLen);
}
currentOffset += readLen;
}
uint32_t value = crcCalc.value();
if (value == transactionParams.crc) {
transactionParams.conditionCode = ConditionCode::NO_ERROR;
transactionParams.deliveryCode = FileDeliveryCode::DATA_COMPLETE;
} else {
// TODO: Proper error handling
#if FSFW_CPP_OSTREAM_ENABLED == 1
sif::warning << "CRC check for file " << transactionParams.destName.data() << " failed"
<< std::endl;
#endif
transactionParams.conditionCode = ConditionCode::FILE_CHECKSUM_FAILURE;
}
return OK;
}
ReturnValue_t cfdp::DestHandler::noticeOfCompletion() {
if (destParams.cfg.indicCfg.transactionFinishedIndicRequired) {
TransactionFinishedParams params(
transactionParams.transactionId, transactionParams.conditionCode,
transactionParams.deliveryCode, transactionParams.deliveryStatus);
destParams.user.transactionFinishedIndication(params);
}
return OK;
}
ReturnValue_t cfdp::DestHandler::sendFinishedPdu() {
FinishedInfo info(transactionParams.conditionCode, transactionParams.deliveryCode,
transactionParams.deliveryStatus);
FinishPduCreator finishedPdu(transactionParams.pduConf, info);
store_address_t storeId;
uint8_t* dataPtr = nullptr;
ReturnValue_t result =
fsfwParams.tmStore->getFreeElement(&storeId, finishedPdu.getSerializedSize(), &dataPtr);
if (result != OK) {
#if FSFW_CPP_OSTREAM_ENABLED == 1
sif::warning << "cfdp::DestHandler:sendFinishedPdu: Getting store slot failed" << std::endl;
#endif
fsfwParams.eventReporter->forwardEvent(events::STORE_ERROR, result, 0);
return result;
}
size_t serLen = 0;
result = finishedPdu.serialize(dataPtr, serLen, finishedPdu.getSerializedSize());
if (result != OK) {
#if FSFW_CPP_OSTREAM_ENABLED == 1
sif::warning << "cfdp::DestHandler::sendFinishedPdu: Serializing Finished PDU failed"
<< std::endl;
#endif
fsfwParams.eventReporter->forwardEvent(events::SERIALIZATION_ERROR, result, 0);
return result;
}
TmTcMessage msg(storeId);
result = fsfwParams.msgQueue->sendMessage(fsfwParams.packetDest.getReportReceptionQueue(), &msg);
if (result != OK) {
#if FSFW_CPP_OSTREAM_ENABLED == 1
sif::warning << "cfdp::DestHandler::sendFinishedPdu: Sending PDU failed" << std::endl;
#endif
fsfwParams.eventReporter->forwardEvent(events::MSG_QUEUE_ERROR, result, 0);
return result;
}
fsmRes.packetsSent++;
return OK;
}
cfdp::DestHandler::TransactionStep cfdp::DestHandler::getTransactionStep() const {
return fsmRes.step;
}
const cfdp::DestHandler::FsmResult& cfdp::DestHandler::updateFsmRes(uint8_t errors) {
fsmRes.errors = errors;
fsmRes.result = OK;
if (fsmRes.errors > 0) {
fsmRes.result = FAILED;
}
return fsmRes;
}
const cfdp::TransactionId& cfdp::DestHandler::getTransactionId() const {
return transactionParams.transactionId;
}
void cfdp::DestHandler::checkAndHandleError(ReturnValue_t result, uint8_t& errorIdx) {
if (result != OK and errorIdx < 3) {
fsmRes.errorCodes[errorIdx] = result;
errorIdx++;
}
}
void cfdp::DestHandler::setMsgQueue(MessageQueueIF& queue) { fsfwParams.msgQueue = &queue; }
void cfdp::DestHandler::setEventReporter(EventReportingProxyIF& reporter) {
fsfwParams.eventReporter = &reporter;
}
const cfdp::DestHandlerParams& cfdp::DestHandler::getDestHandlerParams() const {
return destParams;
}
StorageManagerIF* cfdp::DestHandler::getTmStore() const { return fsfwParams.tmStore; }
StorageManagerIF* cfdp::DestHandler::getTcStore() const { return fsfwParams.tcStore; }

View File

@ -0,0 +1,177 @@
#ifndef FSFW_CFDP_CFDPDESTHANDLER_H
#define FSFW_CFDP_CFDPDESTHANDLER_H
#include <etl/list.h>
#include <etl/set.h>
#include <optional>
#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/cfdp/tlv/MessageToUserTlv.h"
#include "fsfw/container/DynamicFIFO.h"
#include "fsfw/storagemanager/StorageManagerIF.h"
#include "fsfw/storagemanager/storeAddress.h"
#include "fsfw/tmtcservices/AcceptsTelemetryIF.h"
namespace cfdp {
template <size_t SIZE>
using LostSegmentsList = etl::set<etl::pair<uint64_t, uint64_t>, SIZE>;
using LostSegmentsListBase = etl::iset<etl::pair<uint64_t, uint64_t>>;
struct DestHandlerParams {
DestHandlerParams(LocalEntityCfg cfg, UserBase& user, RemoteConfigTableIF& remoteCfgTable,
PacketInfoListBase& packetList,
// TODO: This container can potentially take tons of space. For a better
// memory efficient implementation, an additional abstraction could be
// be used so users can use uint32_t as the pair type
// TODO: Actually, we can provide a better abstraction via interface, which
// allows using something like a bounded map. This simplifies
// the implementation significantly.
LostSegmentsListBase& lostSegmentsContainer)
: cfg(std::move(cfg)),
user(user),
remoteCfgTable(remoteCfgTable),
packetListRef(packetList),
lostSegmentsContainer(lostSegmentsContainer) {}
LocalEntityCfg cfg;
UserBase& user;
RemoteConfigTableIF& remoteCfgTable;
PacketInfoListBase& packetListRef;
LostSegmentsListBase& lostSegmentsContainer;
uint8_t maxTlvsInOnePdu = 20;
size_t maxFilenameLen = 255;
};
class DestHandler {
public:
enum class TransactionStep : uint8_t {
IDLE = 0,
TRANSACTION_START = 1,
RECEIVING_FILE_DATA_PDUS = 2,
SENDING_ACK_PDU = 3,
TRANSFER_COMPLETION = 4,
SENDING_FINISHED_PDU = 5
};
struct FsmResult {
public:
ReturnValue_t result = returnvalue::OK;
CallStatus callStatus = CallStatus::CALL_AFTER_DELAY;
TransactionStep step = TransactionStep::IDLE;
CfdpState state = CfdpState::IDLE;
uint32_t packetsSent = 0;
uint8_t errors = 0;
std::array<ReturnValue_t, 3> errorCodes = {};
void resetOfIteration() {
result = returnvalue::OK;
callStatus = CallStatus::CALL_AFTER_DELAY;
packetsSent = 0;
errors = 0;
errorCodes.fill(returnvalue::OK);
}
};
/**
* Will be returned if it is advisable to call the state machine operation call again
*/
ReturnValue_t PARTIAL_SUCCESS = returnvalue::makeCode(0, 2);
ReturnValue_t FAILURE = returnvalue::makeCode(0, 3);
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.
*/
const FsmResult& stateMachine();
void setMsgQueue(MessageQueueIF& queue);
void setEventReporter(EventReportingProxyIF& reporter);
ReturnValue_t passPacket(PacketInfo packet);
ReturnValue_t initialize();
[[nodiscard]] CfdpState getCfdpState() const;
[[nodiscard]] TransactionStep getTransactionStep() const;
[[nodiscard]] const TransactionId& getTransactionId() const;
[[nodiscard]] const DestHandlerParams& getDestHandlerParams() const;
[[nodiscard]] StorageManagerIF* getTcStore() const;
[[nodiscard]] StorageManagerIF* getTmStore() const;
private:
struct TransactionParams {
// Initialize char vectors with length + 1 for 0 termination
explicit TransactionParams(size_t maxFileNameLen)
: sourceName(maxFileNameLen + 1), destName(maxFileNameLen + 1) {}
void reset() {
pduConf = PduConfig();
transactionId = TransactionId();
std::fill(sourceName.begin(), sourceName.end(), '\0');
std::fill(destName.begin(), destName.end(), '\0');
fileSize.setFileSize(0, false);
conditionCode = ConditionCode::NO_ERROR;
deliveryCode = FileDeliveryCode::DATA_INCOMPLETE;
deliveryStatus = FileDeliveryStatus::DISCARDED_DELIBERATELY;
crc = 0;
progress = 0;
remoteCfg = nullptr;
metadataOnly = false;
closureRequested = false;
vfsErrorCount = 0;
checksumType = ChecksumType::NULL_CHECKSUM;
}
bool metadataOnly = false;
ChecksumType checksumType = ChecksumType::NULL_CHECKSUM;
bool closureRequested = false;
uint16_t vfsErrorCount = 0;
std::vector<char> sourceName;
std::vector<char> destName;
cfdp::Fss fileSize;
TransactionId transactionId;
PduConfig pduConf;
ConditionCode conditionCode = ConditionCode::NO_ERROR;
FileDeliveryCode deliveryCode = FileDeliveryCode::DATA_INCOMPLETE;
FileDeliveryStatus deliveryStatus = FileDeliveryStatus::DISCARDED_DELIBERATELY;
uint32_t crc = 0;
uint64_t progress = 0;
RemoteEntityCfg* remoteCfg = nullptr;
};
std::vector<cfdp::Tlv> tlvVec;
std::vector<MessageToUserTlv> msgToUserVec;
TransactionParams transactionParams;
DestHandlerParams destParams;
cfdp::FsfwParams fsfwParams;
FsmResult fsmRes;
ReturnValue_t startTransaction(const MetadataPduReader& reader);
ReturnValue_t handleMetadataPdu(const PacketInfo& info);
ReturnValue_t handleFileDataPdu(const PacketInfo& info);
ReturnValue_t handleEofPdu(const PacketInfo& info);
ReturnValue_t handleMetadataParseError(ReturnValue_t result, const uint8_t* rawData,
size_t maxSize);
ReturnValue_t handleTransferCompletion();
ReturnValue_t tryBuildingAbsoluteDestName(size_t destNameSize);
ReturnValue_t sendFinishedPdu();
ReturnValue_t noticeOfCompletion();
ReturnValue_t checksumVerification();
void fileErrorHandler(Event event, ReturnValue_t result, const char* info) const;
const FsmResult& updateFsmRes(uint8_t errors);
void checkAndHandleError(ReturnValue_t result, uint8_t& errorIdx);
void finish();
};
} // namespace cfdp
#endif // FSFW_CFDP_CFDPDESTHANDLER_H

View File

@ -0,0 +1,51 @@
#include "FaultHandlerBase.h"
namespace cfdp {
FaultHandlerBase::FaultHandlerBase() = default;
FaultHandlerBase::~FaultHandlerBase() = default;
bool FaultHandlerBase::getFaultHandler(cfdp::ConditionCode code,
cfdp::FaultHandlerCode& 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::FaultHandlerCode handler) {
if (not faultHandlerMap.contains(code)) {
return false;
}
if (handler != FaultHandlerCode::NOTICE_OF_SUSPENSION and
handler != FaultHandlerCode::ABANDON_TRANSACTION and
handler != FaultHandlerCode::NOTICE_OF_CANCELLATION and
handler != FaultHandlerCode::IGNORE_ERROR) {
return false;
}
faultHandlerMap[code] = handler;
return true;
}
bool FaultHandlerBase::reportFault(cfdp::TransactionId& id, cfdp::ConditionCode code) {
if (not faultHandlerMap.contains(code)) {
return false;
}
cfdp::FaultHandlerCode fh = faultHandlerMap[code];
if (fh == cfdp::FaultHandlerCode::IGNORE_ERROR) {
ignoreCb(id, code);
} else if (fh == cfdp::FaultHandlerCode::ABANDON_TRANSACTION) {
abandonCb(id, code);
} else if (fh == cfdp::FaultHandlerCode::NOTICE_OF_CANCELLATION) {
noticeOfCancellationCb(id, code);
} else if (fh == cfdp::FaultHandlerCode::NOTICE_OF_SUSPENSION) {
noticeOfSuspensionCb(id, code);
} else {
// Should never happen, but use defensive programming
return false;
}
return true;
}
} // namespace cfdp

View File

@ -0,0 +1,77 @@
#ifndef FSFW_CFDP_FAULTHANDLERBASE_H
#define FSFW_CFDP_FAULTHANDLERBASE_H
#include <etl/flat_map.h>
#include "fsfw/cfdp/VarLenFields.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::FaultHandlerCode& handler) const;
bool setFaultHandler(cfdp::ConditionCode code, cfdp::FaultHandlerCode handler);
bool reportFault(cfdp::TransactionId& id, cfdp::ConditionCode code);
virtual void noticeOfSuspensionCb(cfdp::TransactionId& id, cfdp::ConditionCode code) = 0;
virtual void noticeOfCancellationCb(cfdp::TransactionId& id, cfdp::ConditionCode code) = 0;
virtual void abandonCb(cfdp::TransactionId& id, cfdp::ConditionCode code) = 0;
virtual void ignoreCb(cfdp::TransactionId& id, cfdp::ConditionCode code) = 0;
private:
etl::flat_map<cfdp::ConditionCode, cfdp::FaultHandlerCode, 10> faultHandlerMap = {
etl::pair{cfdp::ConditionCode::POSITIVE_ACK_LIMIT_REACHED,
cfdp::FaultHandlerCode::IGNORE_ERROR},
etl::pair{cfdp::ConditionCode::KEEP_ALIVE_LIMIT_REACHED,
cfdp::FaultHandlerCode::IGNORE_ERROR},
etl::pair{cfdp::ConditionCode::INVALID_TRANSMISSION_MODE,
cfdp::FaultHandlerCode::IGNORE_ERROR},
etl::pair{cfdp::ConditionCode::FILE_CHECKSUM_FAILURE, cfdp::FaultHandlerCode::IGNORE_ERROR},
etl::pair{cfdp::ConditionCode::FILE_SIZE_ERROR, cfdp::FaultHandlerCode::IGNORE_ERROR},
etl::pair{cfdp::ConditionCode::NAK_LIMIT_REACHED, cfdp::FaultHandlerCode::IGNORE_ERROR},
etl::pair{cfdp::ConditionCode::INACTIVITY_DETECTED, cfdp::FaultHandlerCode::IGNORE_ERROR},
etl::pair{cfdp::ConditionCode::UNSUPPORTED_CHECKSUM_TYPE,
cfdp::FaultHandlerCode::IGNORE_ERROR},
etl::pair{cfdp::ConditionCode::FILESTORE_REJECTION, cfdp::FaultHandlerCode::IGNORE_ERROR},
etl::pair{cfdp::ConditionCode::CHECK_LIMIT_REACHED, cfdp::FaultHandlerCode::IGNORE_ERROR}};
};
} // namespace cfdp
#endif // FSFW_CFDP_FAULTHANDLERBASE_H

View File

@ -0,0 +1,201 @@
#include "PutRequest.h"
using namespace returnvalue;
cfdp::PutRequest::PutRequest(cfdp::EntityId destId, const uint8_t *msgsToUser,
size_t msgsToUserTotalSize, const uint8_t *fsRequests,
size_t fsRequestsSize)
: destId(std::move(destId)),
metadataOnly(true),
msgsToUsersTotalSize(msgsToUserTotalSize),
msgsToUserStartPtr(msgsToUser),
fsRequestsTotalSize(fsRequestsSize),
fsRequestStartPtr(fsRequests) {}
cfdp::PutRequest::PutRequest(cfdp::EntityId destId, cfdp::StringLv &sourceName,
cfdp::StringLv &destName)
: destId(std::move(destId)), sourceName(std::move(sourceName)), destName(std::move(destName)) {}
[[nodiscard]] bool cfdp::PutRequest::isMetadataOnly() const { return metadataOnly; }
ReturnValue_t cfdp::PutRequest::serialize(uint8_t **buffer, size_t *size, size_t maxSize,
SerializeIF::Endianness streamEndianness) const {
if (buffer == nullptr or size == nullptr) {
return FAILED;
}
if (*size + getSerializedSize() > maxSize) {
return SerializeIF::BUFFER_TOO_SHORT;
}
ReturnValue_t result = destId.serializeAsLv(buffer, size, maxSize);
if (result != OK) {
return result;
}
result = SerializeAdapter::serialize(&metadataOnly, buffer, size, maxSize, streamEndianness);
if (result != OK) {
return result;
}
if (!metadataOnly) {
result = sourceName.serialize(buffer, size, maxSize, streamEndianness);
if (result != OK) {
return result;
}
result = destName.serialize(buffer, size, maxSize, streamEndianness);
if (result != OK) {
return result;
}
result =
SerializeAdapter::serialize(&hasTransmissionMode, buffer, size, maxSize, streamEndianness);
if (result != OK) {
return result;
}
result =
SerializeAdapter::serialize(&transmissionMode, buffer, size, maxSize, streamEndianness);
if (result != OK) {
return result;
}
result =
SerializeAdapter::serialize(&hasClosureRequested, buffer, size, maxSize, streamEndianness);
if (result != OK) {
return result;
}
result =
SerializeAdapter::serialize(&closureRequested, buffer, size, maxSize, streamEndianness);
if (result != OK) {
return result;
}
}
result =
SerializeAdapter::serialize(&msgsToUsersTotalSize, buffer, size, maxSize, streamEndianness);
if (result != OK) {
return result;
}
std::memcpy(*buffer, msgsToUserStartPtr, msgsToUsersTotalSize);
*buffer += msgsToUsersTotalSize;
*size += msgsToUsersTotalSize;
result =
SerializeAdapter::serialize(&fsRequestsTotalSize, buffer, size, maxSize, streamEndianness);
if (result != OK) {
return result;
}
std::memcpy(*buffer, fsRequestStartPtr, fsRequestsTotalSize);
*buffer += fsRequestsTotalSize;
*size += fsRequestsTotalSize;
return OK;
}
ReturnValue_t cfdp::PutRequest::deSerialize(const uint8_t **buffer, size_t *size,
SerializeIF::Endianness streamEndianness) {
if (buffer == nullptr or size == nullptr) {
return FAILED;
}
ReturnValue_t result = destId.deSerializeFromLv(buffer, size);
if (result != OK) {
return result;
}
result = SerializeAdapter::deSerialize(&metadataOnly, buffer, size, streamEndianness);
if (result != OK) {
return result;
}
if (!metadataOnly) {
result = sourceName.deSerialize(buffer, size, streamEndianness);
if (result != OK) {
return result;
}
result = destName.deSerialize(buffer, size, streamEndianness);
if (result != OK) {
return result;
}
result = SerializeAdapter::deSerialize(&hasTransmissionMode, buffer, size, streamEndianness);
if (result != OK) {
return result;
}
result = SerializeAdapter::deSerialize(&transmissionMode, buffer, size, streamEndianness);
if (result != OK) {
return result;
}
result = SerializeAdapter::deSerialize(&hasClosureRequested, buffer, size, streamEndianness);
if (result != OK) {
return result;
}
result = SerializeAdapter::deSerialize(&closureRequested, buffer, size, streamEndianness);
if (result != OK) {
return result;
}
}
result = SerializeAdapter::deSerialize(&msgsToUsersTotalSize, buffer, size, streamEndianness);
if (result != OK) {
return result;
}
msgsToUserStartPtr = *buffer;
*buffer += msgsToUsersTotalSize;
*size += msgsToUsersTotalSize;
result = SerializeAdapter::deSerialize(&fsRequestsTotalSize, buffer, size, streamEndianness);
if (result != OK) {
return result;
}
fsRequestStartPtr = *buffer;
*buffer += fsRequestsTotalSize;
*size += fsRequestsTotalSize;
return OK;
}
size_t cfdp::PutRequest::getSerializedSize() const {
// Entity ID LV (1 leading size byte) and the metadata only flag.
size_t baseSize = 1 + destId.getSerializedSize() + 1;
if (!metadataOnly) {
baseSize += sourceName.getSerializedSize() + destName.getSerializedSize() + 4;
}
baseSize += sizeof(msgsToUsersTotalSize) + msgsToUsersTotalSize + sizeof(fsRequestsTotalSize) +
fsRequestsTotalSize;
return baseSize;
}
void cfdp::PutRequest::setSourceAndDestName(cfdp::StringLv &sourceName_,
cfdp::StringLv &destName_) {
metadataOnly = false;
this->sourceName = std::move(sourceName_);
this->destName = std::move(destName_);
}
const cfdp::StringLv &cfdp::PutRequest::getSourceName() const { return sourceName; }
const cfdp::StringLv &cfdp::PutRequest::getDestName() const { return destName; }
const cfdp::EntityId &cfdp::PutRequest::getDestId() const { return destId; }
void cfdp::PutRequest::setDestId(cfdp::EntityId id) { destId = std::move(id); }
void cfdp::PutRequest::setTransmissionMode(cfdp::TransmissionMode transmissionMode_) {
this->transmissionMode = transmissionMode_;
hasTransmissionMode = true;
}
void cfdp::PutRequest::clearTransmissionMode() { hasTransmissionMode = false; }
void cfdp::PutRequest::clearClosureRequest() { hasClosureRequested = false; }
void cfdp::PutRequest::setClosureRequest(bool closureRequested_) {
this->closureRequested = closureRequested_;
hasClosureRequested = true;
}
const uint8_t *cfdp::PutRequest::getMessagesToUser(size_t &totalSize) {
totalSize = this->msgsToUsersTotalSize;
return msgsToUserStartPtr;
}
bool cfdp::PutRequest::getClosureRequested(bool &closureRequested_) const {
if (hasClosureRequested) {
closureRequested_ = this->closureRequested;
}
return hasClosureRequested;
}
bool cfdp::PutRequest::getTransmissionMode(cfdp::TransmissionMode &mode) const {
if (hasTransmissionMode) {
mode = static_cast<cfdp::TransmissionMode>(this->transmissionMode);
}
return hasTransmissionMode;
}

View File

@ -0,0 +1,82 @@
#pragma once
#include <optional>
#include <vector>
#include "fsfw/cfdp/VarLenFields.h"
#include "fsfw/cfdp/tlv/FilestoreRequestTlv.h"
#include "fsfw/cfdp/tlv/MessageToUserTlv.h"
namespace cfdp {
class PutRequest : public SerializeIF {
public:
/**
* Metadata only constructor.
* @param destId
* @param msgsToUser
* @param msgsToUserTotalSize
* @param fsRequests
* @param fsRequestsSize
*/
PutRequest(EntityId destId, const uint8_t* msgsToUser, size_t msgsToUserTotalSize,
const uint8_t* fsRequests, size_t fsRequestsSize);
/**
* Put request to initiate file transfers. By default, the transmission mode and closure requested
* parameter are not present, thereby being derived from the remote configuration for a
* particular destination ID.
* @param destId
* @param sourceName
* @param destName
*/
PutRequest(EntityId destId, cfdp::StringLv& sourceName, cfdp::StringLv& destName);
/**
* Default constructor for deserialization.
*/
PutRequest() = default;
[[nodiscard]] ReturnValue_t serialize(uint8_t** buffer, size_t* size, size_t maxSize,
Endianness streamEndianness) const override;
ReturnValue_t deSerialize(const uint8_t** buffer, size_t* size,
Endianness streamEndianness) override;
[[nodiscard]] size_t getSerializedSize() const override;
void setSourceAndDestName(cfdp::StringLv& sourceName, cfdp::StringLv& destName);
[[nodiscard]] const cfdp::StringLv& getSourceName() const;
[[nodiscard]] const cfdp::StringLv& getDestName() const;
void setTransmissionMode(cfdp::TransmissionMode transmissionMode);
void clearTransmissionMode();
void setClosureRequest(bool closureRequested);
void clearClosureRequest();
const uint8_t* getMessagesToUser(size_t& msgSize);
[[nodiscard]] bool isMetadataOnly() const;
bool getTransmissionMode(TransmissionMode& mode) const;
bool getClosureRequested(bool& closureRequested) const;
[[nodiscard]] const EntityId& getDestId() const;
void setDestId(EntityId id);
private:
EntityId destId;
uint8_t metadataOnly = true;
// Transaction parameters. Omitted if the put request is metadata only.
cfdp::StringLv sourceName;
cfdp::StringLv destName;
bool hasTransmissionMode = false;
uint8_t transmissionMode = TransmissionMode::UNACKNOWLEDGED;
bool hasClosureRequested = false;
uint8_t closureRequested = false;
// Metadata
size_t msgsToUsersTotalSize = 0;
const uint8_t* msgsToUserStartPtr = nullptr;
size_t fsRequestsTotalSize = 0;
const uint8_t* fsRequestStartPtr = nullptr;
};
} // namespace cfdp

View File

@ -0,0 +1,35 @@
#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;
};
/**
* Helper class for the common case that there is exactly one remote entity
*/
class OneRemoteConfigProvider : public RemoteConfigTableIF {
public:
explicit OneRemoteConfigProvider(RemoteEntityCfg& cfg) : cfg(cfg) {}
bool getRemoteCfg(const EntityId& remoteId, cfdp::RemoteEntityCfg** cfg_) override {
if (remoteId != cfg.remoteId) {
return false;
}
*cfg_ = &cfg;
return true;
}
private:
RemoteEntityCfg& cfg;
};
} // namespace cfdp
#endif // FSFW_CFDP_HANDLER_REMOTECONFIGTABLEIF_H

View File

@ -0,0 +1,74 @@
#include "ReservedMessageParser.h"
#include "fsfw/cfdp/CfdpMessage.h"
#include "fsfw/cfdp/handler/PutRequest.h"
#include "fsfw/cfdp/tlv/MessageToUserTlv.h"
#include "fsfw/ipc/CommandMessage.h"
#include "fsfw/ipc/QueueFactory.h"
using namespace returnvalue;
cfdp::ReservedMessageParser::ReservedMessageParser(StorageManagerIF& ipcStore,
MessageQueueIF& msgQueue,
MessageQueueId_t userDestination)
: msgQueue(msgQueue), ipcStore(ipcStore), userDestination(userDestination) {}
ReturnValue_t cfdp::ReservedMessageParser::parse(const MessageToUserTlv* msgsToUserArray,
size_t numMsgToUser) {
ReturnValue_t result = returnvalue::OK;
cfdp::StringLv sourceFileName;
cfdp::StringLv destFileName;
PutRequest putRequest;
const uint8_t* currentPtr = nullptr;
size_t deserSize = 0;
bool needToSendPutRequest = false;
for (size_t idx = 0; idx < numMsgToUser; idx++) {
if (&msgsToUserArray[idx] == nullptr) {
continue;
}
uint8_t messageType = 0;
if (msgsToUserArray[idx].isReservedCfdpMessage(messageType, &currentPtr, deserSize)) {
if (messageType == static_cast<uint8_t>(ProxyOpMessageType::PUT_REQUEST)) {
EntityId entityIdLv;
result = entityIdLv.deSerializeFromLv(&currentPtr, &deserSize);
if (result != returnvalue::OK) {
return result;
}
putRequest.setDestId(entityIdLv);
result =
sourceFileName.deSerialize(&currentPtr, &deserSize, SerializeIF::Endianness::NETWORK);
if (result != OK) {
return result;
}
result =
destFileName.deSerialize(&currentPtr, &deserSize, SerializeIF::Endianness::NETWORK);
if (result != OK) {
return result;
}
putRequest.setSourceAndDestName(sourceFileName, destFileName);
needToSendPutRequest = true;
}
}
}
if (needToSendPutRequest) {
store_address_t storeId;
uint8_t* dataPtr;
result = ipcStore.getFreeElement(&storeId, putRequest.getSerializedSize(), &dataPtr);
if (result != OK) {
return result;
}
size_t serLen = 0;
result = putRequest.serialize(&dataPtr, &serLen, putRequest.getSerializedSize(),
SerializeIF::Endianness::MACHINE);
if (result != OK) {
return result;
}
CommandMessage msg;
CfdpMessage::setPutRequest(&msg, storeId);
result = msgQueue.sendMessage(userDestination, &msg);
if (result != OK) {
return result;
}
}
return OK;
}

View File

@ -0,0 +1,27 @@
#pragma once
#include "fsfw/cfdp/tlv/MessageToUserTlv.h"
#include "fsfw/ipc/MessageQueueIF.h"
#include "fsfw/storagemanager/StorageManagerIF.h"
namespace cfdp {
/**
* This class parses messages to user for special CFDP messages and converts them to appropriate
* CFDP requests sent via the IPC store where applicable. It also provides an API to retrieve
* custom messages which are not special CFDP messages from a provided bytestream.
*/
class ReservedMessageParser {
public:
ReservedMessageParser(StorageManagerIF& ipcStore, MessageQueueIF& msgQueue,
MessageQueueId_t userDestination);
ReturnValue_t parse(const MessageToUserTlv* msgsToUserArray, size_t numMsgsToUser);
private:
MessageQueueIF& msgQueue;
StorageManagerIF& ipcStore;
MessageQueueId_t userDestination;
};
} // namespace cfdp

View File

@ -0,0 +1,376 @@
#include "SourceHandler.h"
#include <etl/crc32.h>
#include <array>
#include "fsfw/cfdp/pdu/EofPduCreator.h"
#include "fsfw/cfdp/pdu/FileDataCreator.h"
#include "fsfw/cfdp/pdu/MetadataPduCreator.h"
#include "fsfw/filesystem/HasFileSystemIF.h"
#include "fsfw/globalfunctions/arrayprinter.h"
#include "fsfw/objectmanager.h"
#include "fsfw/serviceinterface.h"
#include "fsfw/tasks/TaskFactory.h"
#include "fsfw/tmtcservices/TmTcMessage.h"
using namespace returnvalue;
cfdp::SourceHandler::SourceHandler(SourceHandlerParams params, FsfwParams fsfwParams)
: sourceParams(std::move(params)), fsfwParams(fsfwParams) {
// The entity ID portion of the transaction ID will always remain fixed.
transactionParams.id.entityId = sourceParams.cfg.localId;
transactionParams.pduConf.sourceId = sourceParams.cfg.localId;
if (sourceParams.seqCountProvider.bitWidth() == 8) {
transactionParams.pduConf.seqNum.setWidth(cfdp::WidthInBytes::ONE_BYTE);
} else if (sourceParams.seqCountProvider.bitWidth() == 16) {
transactionParams.pduConf.seqNum.setWidth(cfdp::WidthInBytes::TWO_BYTES);
} else if (sourceParams.seqCountProvider.bitWidth() == 32) {
transactionParams.pduConf.seqNum.setWidth(cfdp::WidthInBytes::FOUR_BYTES);
} else if (sourceParams.seqCountProvider.bitWidth() == 64) {
transactionParams.pduConf.seqNum.setWidth(cfdp::WidthInBytes::EIGHT_BYTES);
} else {
#if FSFW_CPP_OSTREAM_ENABLED == 1
sif::error << "cfdp::SourceHandler: Seq count provider bit width "
<< sourceParams.seqCountProvider.bitWidth() << " not allowed" << std::endl;
#else
sif::printError("cfdp::SourceHandler: Seq count provider bit width %d not allowed\n",
sourceParams.seqCountProvider.bitWidth());
#endif
// Yeah, what am I supposed to do here? Can't throw an exception in the FSFW..
transactionParams.pduConf.seqNum.setWidth(cfdp::WidthInBytes::ONE_BYTE);
}
transactionParams.pduConf.seqNum.setValue(0);
}
cfdp::SourceHandler::FsmResult& cfdp::SourceHandler::fsmNacked() {
ReturnValue_t result;
if (step == TransactionStep::IDLE) {
step = TransactionStep::TRANSACTION_START;
}
if (step == TransactionStep::TRANSACTION_START) {
sourceParams.user.transactionIndication(transactionParams.id);
result = checksumGeneration();
if (result != OK) {
addError(result);
}
step = TransactionStep::SENDING_METADATA;
}
if (step == TransactionStep::SENDING_METADATA) {
result = prepareAndSendMetadataPdu();
if (result != OK) {
addError(result);
}
fsmResult.callStatus = CallStatus::CALL_AGAIN;
return fsmResult;
}
if (step == TransactionStep::SENDING_FILE_DATA) {
bool noFdPdu = false;
result = prepareAndSendNextFileDataPdu(noFdPdu);
if (result == OK and !noFdPdu) {
fsmResult.callStatus = CallStatus::CALL_AGAIN;
return fsmResult;
}
}
if (step == TransactionStep::SENDING_EOF) {
result = prepareAndSendEofPdu();
if (result != OK) {
addError(result);
}
if (sourceParams.cfg.indicCfg.eofSentIndicRequired) {
sourceParams.user.eofSentIndication(transactionParams.id);
}
if (transactionParams.closureRequested) {
step = TransactionStep::WAIT_FOR_FINISH;
fsmResult.callStatus = CallStatus::CALL_AFTER_DELAY;
} else {
step = TransactionStep::NOTICE_OF_COMPLETION;
fsmResult.callStatus = CallStatus::CALL_AGAIN;
}
return fsmResult;
}
if (step == TransactionStep::WAIT_FOR_FINISH) {
// TODO: In case this is a request with closure, wait for finish.
// Done, issue notice of completion
step = TransactionStep::NOTICE_OF_COMPLETION;
}
if (step == TransactionStep::NOTICE_OF_COMPLETION) {
noticeOfCompletion();
reset();
}
return fsmResult;
}
const cfdp::SourceHandler::FsmResult& cfdp::SourceHandler::stateMachine() {
fsmResult.packetsSent = 0;
fsmResult.errors = 0;
fsmResult.callStatus = CallStatus::DONE;
if (state == cfdp::CfdpState::IDLE) {
return fsmResult;
}
if (state == cfdp::CfdpState::BUSY_CLASS_1_NACKED) {
return fsmNacked();
}
return fsmResult;
}
ReturnValue_t cfdp::SourceHandler::checksumGeneration() {
if (transactionParams.fileSize.value() == 0) {
// NULL checksum for empty file.
transactionParams.crc = 0;
return OK;
}
std::array<uint8_t, 1024> buf{};
etl::crc32 crcCalc;
uint64_t currentOffset = 0;
FileOpParams params(transactionParams.sourceName.data(), transactionParams.fileSize.value());
while (currentOffset < transactionParams.fileSize.value()) {
uint64_t readLen;
if (currentOffset + buf.size() > transactionParams.fileSize.value()) {
readLen = transactionParams.fileSize.value() - currentOffset;
} else {
readLen = buf.size();
}
if (readLen > 0) {
params.offset = currentOffset;
params.size = readLen;
auto result = sourceParams.user.vfs.readFromFile(params, buf.data(), buf.size());
if (result != OK) {
addError(result);
return FAILED;
}
crcCalc.add(buf.begin(), buf.begin() + readLen);
}
currentOffset += readLen;
}
transactionParams.crc = crcCalc.value();
return OK;
}
ReturnValue_t cfdp::SourceHandler::transactionStart(PutRequest& putRequest, RemoteEntityCfg& cfg) {
if (state != CfdpState::IDLE) {
return SOURCE_TRANSACTION_PENDING;
}
if (cfg.remoteId != putRequest.getDestId()) {
return WRONG_REMOTE_CFG_ENTITY_ID;
}
if (putRequest.getSourceName().getValueLen() == 0) {
return SOURCE_NAME_EMPTY;
}
if (putRequest.getDestName().getValueLen() == 0) {
return DEST_NAME_EMPTY;
}
const char* srcNamePtr = putRequest.getSourceName().getCString(transactionParams.sourceNameSize);
const char* destNamePtr = putRequest.getDestName().getCString(transactionParams.destNameSize);
std::strncpy(transactionParams.sourceName.data(), srcNamePtr, transactionParams.sourceNameSize);
std::strncpy(transactionParams.destName.data(), destNamePtr, transactionParams.destNameSize);
// Add 0 termination. The source and dest name size can not be larger than UINT8_MAX, so this
// operation is safe.
transactionParams.sourceName[transactionParams.sourceNameSize] = '\0';
transactionParams.destName[transactionParams.destNameSize] = '\0';
FilesystemParams params(transactionParams.sourceName.data());
if (!sourceParams.user.vfs.fileExists(params)) {
return FILE_DOES_NOT_EXIST;
}
if (cfg.maxFileSegmentLen > fileBuf.size() or cfg.maxFileSegmentLen == 0) {
return FILE_SEGMENT_LEN_INVALID;
}
// If transmission mode is not set, use default transmission mode for the remote entity.
if (not putRequest.getTransmissionMode(transactionParams.pduConf.mode)) {
transactionParams.pduConf.mode = cfg.defaultTransmissionMode;
}
// If closure request field is not set, use default option for the remote entity.
if (not putRequest.getClosureRequested(transactionParams.closureRequested)) {
transactionParams.closureRequested = cfg.closureRequested;
}
const EntityId& destId = putRequest.getDestId();
// The width of the source and destination ID must be the same. Use the larger ID value to
// ensure the width is large enough for both IDs
if (destId.getWidth() > transactionParams.pduConf.sourceId.getWidth()) {
transactionParams.pduConf.destId = destId;
transactionParams.pduConf.sourceId.setWidth(destId.getWidth());
} else {
transactionParams.pduConf.destId.setValueAndWidth(transactionParams.pduConf.sourceId.getWidth(),
destId.getValue());
}
// Only used for PDU forwarding, file is sent to file receiver regularly here.
transactionParams.pduConf.direction = Direction::TOWARDS_RECEIVER;
transactionParams.pduConf.seqNum.setValue(sourceParams.seqCountProvider.getAndIncrement());
transactionParams.id.seqNum = transactionParams.pduConf.seqNum;
if (transactionParams.pduConf.mode == TransmissionMode::ACKNOWLEDGED) {
state = cfdp::CfdpState::BUSY_CLASS_2_ACKED;
} else if (transactionParams.pduConf.mode == TransmissionMode::UNACKNOWLEDGED) {
state = cfdp::CfdpState::BUSY_CLASS_1_NACKED;
}
step = TransactionStep::IDLE;
uint64_t fileSize = 0;
sourceParams.user.vfs.getFileSize(params, fileSize);
transactionParams.pduConf.largeFile = false;
if (fileSize > UINT32_MAX) {
transactionParams.pduConf.largeFile = true;
}
if (fileSize == 0) {
transactionParams.checksumType = ChecksumType::NULL_CHECKSUM;
} else {
transactionParams.checksumType = ChecksumType::CRC_32;
}
transactionParams.fileSize.setFileSize(fileSize, transactionParams.pduConf.largeFile);
transactionParams.progress = 0;
transactionParams.remoteCfg = cfg;
return OK;
}
ReturnValue_t cfdp::SourceHandler::prepareAndSendMetadataPdu() {
cfdp::StringLv sourceName(transactionParams.sourceName.data(), transactionParams.sourceNameSize);
cfdp::StringLv destName(transactionParams.destName.data(), transactionParams.destNameSize);
auto metadataInfo =
MetadataGenericInfo(transactionParams.closureRequested, transactionParams.checksumType,
transactionParams.fileSize);
auto metadataPdu =
MetadataPduCreator(transactionParams.pduConf, metadataInfo, sourceName, destName, nullptr, 0);
ReturnValue_t result = sendGenericPdu(metadataPdu);
if (result != OK) {
return result;
}
// Advance FSM if everything works
step = TransactionStep::SENDING_FILE_DATA;
return OK;
}
ReturnValue_t cfdp::SourceHandler::prepareAndSendNextFileDataPdu(bool& noFileDataPdu) {
cfdp::Fss offset(transactionParams.progress);
uint64_t readLen;
uint64_t fileSize = transactionParams.fileSize.value();
noFileDataPdu = false;
if (fileSize == 0) {
// We are done, no need to send file data PDUs for an empty file.
step = TransactionStep::SENDING_EOF;
noFileDataPdu = true;
return OK;
}
if (fileSize < transactionParams.remoteCfg.maxFileSegmentLen) {
readLen = transactionParams.fileSize.value();
} else {
if (transactionParams.progress + transactionParams.remoteCfg.maxFileSegmentLen > fileSize) {
readLen = fileSize - transactionParams.progress;
} else {
readLen = transactionParams.remoteCfg.maxFileSegmentLen;
}
}
FileOpParams fileParams(transactionParams.sourceName.data(), readLen);
fileParams.offset = transactionParams.progress;
ReturnValue_t result =
sourceParams.user.vfs.readFromFile(fileParams, fileBuf.data(), fileBuf.size());
if (result != returnvalue::OK) {
addError(result);
return result;
}
auto fileDataInfo = FileDataInfo(offset, fileBuf.data(), readLen);
auto fileDataPdu = FileDataCreator(transactionParams.pduConf, fileDataInfo);
result = sendGenericPdu(fileDataPdu);
if (result != OK) {
return result;
}
transactionParams.progress += readLen;
if (transactionParams.progress >= fileSize) {
// Advance FSM after all file data PDUs were sent.
step = TransactionStep::SENDING_EOF;
}
return OK;
}
ReturnValue_t cfdp::SourceHandler::prepareAndSendEofPdu() {
auto eofInfo =
EofInfo(ConditionCode::NO_ERROR, transactionParams.crc, transactionParams.fileSize);
auto eofPdu = EofPduCreator(transactionParams.pduConf, eofInfo);
ReturnValue_t result = sendGenericPdu(eofPdu);
if (result != OK) {
return result;
}
return OK;
}
ReturnValue_t cfdp::SourceHandler::initialize() {
if (fsfwParams.tmStore == nullptr) {
fsfwParams.tmStore = ObjectManager::instance()->get<StorageManagerIF>(objects::TM_STORE);
if (fsfwParams.tmStore == nullptr) {
return FAILED;
}
}
if (fsfwParams.tcStore == nullptr) {
fsfwParams.tcStore = ObjectManager::instance()->get<StorageManagerIF>(objects::TC_STORE);
if (fsfwParams.tcStore == nullptr) {
return FAILED;
}
}
if (fsfwParams.msgQueue == nullptr) {
return FAILED;
}
return OK;
}
ReturnValue_t cfdp::SourceHandler::sendGenericPdu(const SerializeIF& pdu) {
uint8_t* dataPtr;
store_address_t storeId;
ReturnValue_t result =
fsfwParams.tmStore->getFreeElement(&storeId, pdu.getSerializedSize(), &dataPtr);
if (result != OK) {
addError(result);
fsmResult.callStatus = CallStatus::CALL_AFTER_DELAY;
if (result == StorageManagerIF::DATA_STORAGE_FULL) {
return TM_STORE_FULL;
}
return result;
}
size_t serializedLen = 0;
result = pdu.serializeBe(dataPtr, serializedLen, pdu.getSerializedSize());
if (result != OK) {
addError(result);
return result;
}
TmTcMessage tmMsg(storeId);
result =
fsfwParams.msgQueue->sendMessage(fsfwParams.packetDest.getReportReceptionQueue(), &tmMsg);
if (result != OK) {
fsmResult.callStatus = CallStatus::CALL_AFTER_DELAY;
}
if (result == MessageQueueIF::FULL) {
return TARGET_MSG_QUEUE_FULL;
} else if (result == OK) {
fsmResult.packetsSent += 1;
}
return result;
}
ReturnValue_t cfdp::SourceHandler::noticeOfCompletion() {
if (sourceParams.cfg.indicCfg.transactionFinishedIndicRequired) {
cfdp::TransactionFinishedParams params(transactionParams.id, ConditionCode::NO_ERROR,
FileDeliveryCode::DATA_COMPLETE,
FileDeliveryStatus::RETAINED_IN_FILESTORE);
sourceParams.user.transactionFinishedIndication(params);
}
return OK;
}
ReturnValue_t cfdp::SourceHandler::reset() {
step = TransactionStep::IDLE;
state = cfdp::CfdpState::IDLE;
fsmResult.callStatus = CallStatus::DONE;
transactionParams.reset();
return OK;
}
cfdp::CfdpState cfdp::SourceHandler::getState() const { return state; }
cfdp::SourceHandler::TransactionStep cfdp::SourceHandler::getStep() const { return step; }
void cfdp::SourceHandler::addError(ReturnValue_t error) {
if (fsmResult.errors < fsmResult.errorCodes.size()) {
fsmResult.errorCodes[fsmResult.errors] = error;
fsmResult.errors++;
fsmResult.result = error;
}
}

View File

@ -0,0 +1,110 @@
#ifndef FSFW_CFDP_CFDPSOURCEHANDLER_H
#define FSFW_CFDP_CFDPSOURCEHANDLER_H
#include <cstdint>
#include <vector>
#include "UserBase.h"
#include "defs.h"
#include "fsfw/cfdp/Fss.h"
#include "fsfw/cfdp/handler/PutRequest.h"
#include "fsfw/cfdp/handler/mib.h"
#include "fsfw/events/EventReportingProxyIF.h"
#include "fsfw/storagemanager/StorageManagerIF.h"
#include "fsfw/tmtcservices/AcceptsTelemetryIF.h"
#include "fsfw/util/ProvidesSeqCountIF.h"
namespace cfdp {
struct SourceHandlerParams {
SourceHandlerParams(LocalEntityCfg cfg, UserBase& user, ProvidesSeqCountIF& seqCountProvider)
: cfg(std::move(cfg)), user(user), seqCountProvider(seqCountProvider) {}
LocalEntityCfg cfg;
UserBase& user;
ProvidesSeqCountIF& seqCountProvider;
};
class SourceHandler {
public:
enum class TransactionStep : uint8_t {
IDLE = 0,
TRANSACTION_START = 1,
SENDING_METADATA = 3,
SENDING_FILE_DATA = 4,
SENDING_EOF = 5,
WAIT_FOR_ACK = 6,
WAIT_FOR_FINISH = 7,
NOTICE_OF_COMPLETION = 8
};
struct FsmResult {
public:
ReturnValue_t result = returnvalue::OK;
CallStatus callStatus = CallStatus::CALL_AFTER_DELAY;
CfdpState state = CfdpState::IDLE;
uint32_t packetsSent = 0;
uint8_t errors = 0;
std::array<ReturnValue_t, 3> errorCodes = {};
};
SourceHandler(SourceHandlerParams params, FsfwParams fsfwParams);
[[nodiscard]] CfdpState getState() const;
[[nodiscard]] TransactionStep getStep() const;
/**
* Pass a put request to the source handler, which might initiate a CFDP transaction and start
* the state machine
* @return
*/
ReturnValue_t transactionStart(PutRequest& putRequest, RemoteEntityCfg& cfg);
const FsmResult& stateMachine();
ReturnValue_t initialize();
private:
struct TransactionParams {
uint32_t crc{};
std::array<char, UINT8_MAX + 1> sourceName{};
size_t sourceNameSize = 0;
std::array<char, UINT8_MAX + 1> destName{};
size_t destNameSize = 0;
cfdp::Fss fileSize;
size_t progress = 0;
bool closureRequested = false;
ChecksumType checksumType = ChecksumType::NULL_CHECKSUM;
RemoteEntityCfg remoteCfg;
PduConfig pduConf;
cfdp::TransactionId id{};
void reset() {
sourceNameSize = 0;
destNameSize = 0;
fileSize.setFileSize(0, false);
progress = 0;
closureRequested = false;
}
} transactionParams;
cfdp::CfdpState state = cfdp::CfdpState::IDLE;
TransactionStep step = TransactionStep::IDLE;
std::array<uint8_t, 4096> fileBuf{};
SourceHandlerParams sourceParams;
cfdp::FsfwParams fsfwParams;
FsmResult fsmResult;
FsmResult& fsmNacked();
ReturnValue_t checksumGeneration();
ReturnValue_t prepareAndSendMetadataPdu();
ReturnValue_t prepareAndSendNextFileDataPdu(bool& noFileDataPdu);
ReturnValue_t prepareAndSendEofPdu();
ReturnValue_t noticeOfCompletion();
ReturnValue_t reset();
[[nodiscard]] ReturnValue_t sendGenericPdu(const SerializeIF& pdu);
void addError(ReturnValue_t error);
};
} // namespace cfdp
#endif // FSFW_CFDP_CFDPSOURCEHANDLER_H

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

View File

@ -0,0 +1,3 @@
#include "UserBase.h"
cfdp::UserBase::UserBase(HasFileSystemIF& vfs) : vfs(vfs) {}

View File

@ -0,0 +1,103 @@
#ifndef FSFW_CFDP_USERBASE_H
#define FSFW_CFDP_USERBASE_H
#include <optional>
#include <utility>
#include <vector>
#include "StatusReportIF.h"
#include "fsfw/cfdp/Fss.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(const TransactionId& id, ConditionCode code, FileDeliveryCode delivCode,
FileDeliveryStatus status)
: id(id), condCode(code), status(status), deliveryCode(delivCode) {}
const TransactionId& id;
ConditionCode condCode;
FileDeliveryStatus status;
FileDeliveryCode deliveryCode;
std::vector<FilestoreResponseTlv*> fsResponses;
StatusReportIF* statusReport = nullptr;
};
struct MetadataRecvdParams {
MetadataRecvdParams(const TransactionId& id, const EntityId& sourceId, Fss fileSize)
: id(id), sourceId(sourceId), fileSize(std::move(fileSize)) {}
const TransactionId& id;
const EntityId& sourceId;
Fss fileSize{};
const char* sourceFileName = "";
const char* destFileName = "";
size_t numberOfMsgsToUser = 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 {
friend class DestHandler;
friend class SourceHandler;
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

View File

@ -0,0 +1,76 @@
#ifndef FSFW_CFDP_HANDLER_DEFS_H
#define FSFW_CFDP_HANDLER_DEFS_H
#include <etl/list.h>
#include "fsfw/storagemanager/StorageManagerIF.h"
#include "fsfw/storagemanager/storeAddress.h"
#include "fsfw/tmtcservices/AcceptsTelemetryIF.h"
namespace cfdp {
enum class CfdpState { IDLE, BUSY_CLASS_1_NACKED, BUSY_CLASS_2_ACKED, SUSPENDED };
static constexpr uint8_t SSID = SUBSYSTEM_ID::CFDP;
static constexpr uint8_t CID = CLASS_ID::CFDP_HANDLER;
struct PacketInfo {
PacketInfo(PduType type, store_address_t storeId,
std::optional<FileDirective> directive = std::nullopt)
: pduType(type), directiveType(directive), storeId(storeId) {}
PduType pduType = PduType::FILE_DATA;
std::optional<FileDirective> directiveType = FileDirective::INVALID_DIRECTIVE;
store_address_t storeId = store_address_t::invalid();
PacketInfo() = default;
};
struct FsfwParams {
FsfwParams(AcceptsTelemetryIF& packetDest, MessageQueueIF* msgQueue,
EventReportingProxyIF* eventReporter, StorageManagerIF& tcStore,
StorageManagerIF& tmStore)
: FsfwParams(packetDest, msgQueue, eventReporter) {
this->tcStore = &tcStore;
this->tmStore = &tmStore;
}
FsfwParams(AcceptsTelemetryIF& packetDest, MessageQueueIF* msgQueue,
EventReportingProxyIF* eventReporter)
: packetDest(packetDest), msgQueue(msgQueue), eventReporter(eventReporter) {}
AcceptsTelemetryIF& packetDest;
MessageQueueIF* msgQueue;
EventReportingProxyIF* eventReporter = nullptr;
StorageManagerIF* tcStore = nullptr;
StorageManagerIF* tmStore = nullptr;
};
template <size_t SIZE>
using PacketInfoList = etl::list<PacketInfo, SIZE>;
using PacketInfoListBase = etl::ilist<PacketInfo>;
enum class CallStatus { DONE, CALL_AFTER_DELAY, CALL_AGAIN };
namespace events {
static constexpr Event STORE_ERROR = event::makeEvent(SSID, 0, severity::LOW);
static constexpr Event MSG_QUEUE_ERROR = event::makeEvent(SSID, 1, severity::LOW);
static constexpr Event SERIALIZATION_ERROR = event::makeEvent(SSID, 2, severity::LOW);
static constexpr Event FILESTORE_ERROR = event::makeEvent(SSID, 3, severity::LOW);
//! [EXPORT] : [COMMENT] P1: Transaction step ID, P2: 0 for source file name, 1 for dest file name
static constexpr Event FILENAME_TOO_LARGE_ERROR = event::makeEvent(SSID, 4, severity::LOW);
//! [EXPORT] : [COMMENT] CFDP request handling failed. P2: Returncode.
static constexpr Event HANDLING_CFDP_REQUEST_FAILED = event::makeEvent(SSID, 5, severity::LOW);
} // namespace events
static constexpr ReturnValue_t SOURCE_TRANSACTION_PENDING = returnvalue::makeCode(CID, 0);
static constexpr ReturnValue_t FILE_DOES_NOT_EXIST = returnvalue::makeCode(CID, 1);
static constexpr ReturnValue_t FILE_SEGMENT_LEN_INVALID = returnvalue::makeCode(CID, 2);
static constexpr ReturnValue_t SOURCE_NAME_EMPTY = returnvalue::makeCode(CID, 3);
static constexpr ReturnValue_t DEST_NAME_EMPTY = returnvalue::makeCode(CID, 4);
static constexpr ReturnValue_t WRONG_REMOTE_CFG_ENTITY_ID = returnvalue::makeCode(CID, 5);
static constexpr ReturnValue_t TARGET_MSG_QUEUE_FULL = returnvalue::makeCode(CID, 6);
static constexpr ReturnValue_t TM_STORE_FULL = returnvalue::makeCode(CID, 7);
} // namespace cfdp
#endif // FSFW_CFDP_HANDLER_DEFS_H

View File

@ -0,0 +1,43 @@
#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 {
RemoteEntityCfg() = default;
explicit RemoteEntityCfg(EntityId id) : remoteId(std::move(id)) {}
EntityId remoteId;
size_t maxFileSegmentLen = 1024;
bool closureRequested = false;
bool crcOnTransmission = false;
TransmissionMode defaultTransmissionMode = TransmissionMode::UNACKNOWLEDGED;
ChecksumType defaultChecksum = ChecksumType::NULL_CHECKSUM;
uint8_t version = CFDP_VERSION_2;
};
} // namespace cfdp
#endif // FSFW_CFDP_MIB_H

50
src/fsfw/cfdp/helpers.cpp Normal file
View File

@ -0,0 +1,50 @@
#include "helpers.h"
const char* COND_CODE_STRINGS[14] = {"Unknown",
"No Error",
"Positive ACK Limit Reached",
"Keep Alive Limit Reached",
"Invalid Transmission Mode",
"Filestore Rejection",
"File Checksum Failure",
"File Size Error",
"NAK limit reached",
"Inactivity Detected",
"Check Limit Reached",
"Unsupported Checksum Type",
"Suspend Request Received",
"Cancel Request Received"};
const char* cfdp::getConditionCodeString(cfdp::ConditionCode code) {
switch (code) {
case NO_CONDITION_FIELD:
return COND_CODE_STRINGS[0];
case NO_ERROR:
return COND_CODE_STRINGS[1];
case POSITIVE_ACK_LIMIT_REACHED:
return COND_CODE_STRINGS[2];
case KEEP_ALIVE_LIMIT_REACHED:
return COND_CODE_STRINGS[3];
case INVALID_TRANSMISSION_MODE:
return COND_CODE_STRINGS[4];
case FILESTORE_REJECTION:
return COND_CODE_STRINGS[5];
case FILE_CHECKSUM_FAILURE:
return COND_CODE_STRINGS[6];
case FILE_SIZE_ERROR:
return COND_CODE_STRINGS[7];
case NAK_LIMIT_REACHED:
return COND_CODE_STRINGS[8];
case INACTIVITY_DETECTED:
return COND_CODE_STRINGS[9];
case CHECK_LIMIT_REACHED:
return COND_CODE_STRINGS[10];
case UNSUPPORTED_CHECKSUM_TYPE:
return COND_CODE_STRINGS[11];
case SUSPEND_REQUEST_RECEIVED:
return COND_CODE_STRINGS[12];
case CANCEL_REQUEST_RECEIVED:
return COND_CODE_STRINGS[13];
}
return "Unknown";
}

11
src/fsfw/cfdp/helpers.h Normal file
View File

@ -0,0 +1,11 @@
#ifndef FSFW_EXAMPLE_HOSTED_HELPER_H
#define FSFW_EXAMPLE_HOSTED_HELPER_H
#include "definitions.h"
namespace cfdp {
const char* getConditionCodeString(cfdp::ConditionCode code);
}
#endif // FSFW_EXAMPLE_HOSTED_HELPER_H

View File

@ -1,12 +1,12 @@
#include "AckInfo.h"
AckInfo::AckInfo(cfdp::FileDirectives ackedDirective, cfdp::ConditionCode ackedConditionCode,
AckInfo::AckInfo(cfdp::FileDirective ackedDirective, cfdp::ConditionCode ackedConditionCode,
cfdp::AckTransactionStatus transactionStatus, uint8_t directiveSubtypeCode)
: ackedDirective(ackedDirective),
ackedConditionCode(ackedConditionCode),
transactionStatus(transactionStatus),
directiveSubtypeCode(directiveSubtypeCode) {
if (ackedDirective == cfdp::FileDirectives::FINISH) {
if (ackedDirective == cfdp::FileDirective::FINISH) {
this->directiveSubtypeCode = 0b0001;
} else {
this->directiveSubtypeCode = 0b0000;
@ -17,16 +17,16 @@ cfdp::ConditionCode AckInfo::getAckedConditionCode() const { return ackedConditi
void AckInfo::setAckedConditionCode(cfdp::ConditionCode ackedConditionCode) {
this->ackedConditionCode = ackedConditionCode;
if (ackedDirective == cfdp::FileDirectives::FINISH) {
if (ackedDirective == cfdp::FileDirective::FINISH) {
this->directiveSubtypeCode = 0b0001;
} else {
this->directiveSubtypeCode = 0b0000;
}
}
cfdp::FileDirectives AckInfo::getAckedDirective() const { return ackedDirective; }
cfdp::FileDirective AckInfo::getAckedDirective() const { return ackedDirective; }
void AckInfo::setAckedDirective(cfdp::FileDirectives ackedDirective) {
void AckInfo::setAckedDirective(cfdp::FileDirective ackedDirective) {
this->ackedDirective = ackedDirective;
}

View File

@ -6,14 +6,14 @@
class AckInfo {
public:
AckInfo();
AckInfo(cfdp::FileDirectives ackedDirective, cfdp::ConditionCode ackedConditionCode,
AckInfo(cfdp::FileDirective ackedDirective, cfdp::ConditionCode ackedConditionCode,
cfdp::AckTransactionStatus transactionStatus, uint8_t directiveSubtypeCode = 0);
cfdp::ConditionCode getAckedConditionCode() const;
void setAckedConditionCode(cfdp::ConditionCode ackedConditionCode);
cfdp::FileDirectives getAckedDirective() const;
void setAckedDirective(cfdp::FileDirectives ackedDirective);
cfdp::FileDirective getAckedDirective() const;
void setAckedDirective(cfdp::FileDirective ackedDirective);
uint8_t getDirectiveSubtypeCode() const;
void setDirectiveSubtypeCode(uint8_t directiveSubtypeCode);
@ -22,7 +22,7 @@ class AckInfo {
void setTransactionStatus(cfdp::AckTransactionStatus transactionStatus);
private:
cfdp::FileDirectives ackedDirective = cfdp::FileDirectives::INVALID_DIRECTIVE;
cfdp::FileDirective ackedDirective = cfdp::FileDirective::INVALID_DIRECTIVE;
cfdp::ConditionCode ackedConditionCode = cfdp::ConditionCode::NO_CONDITION_FIELD;
cfdp::AckTransactionStatus transactionStatus = cfdp::AckTransactionStatus::UNDEFINED;
uint8_t directiveSubtypeCode = 0;

View File

@ -0,0 +1,33 @@
#include "AckPduCreator.h"
AckPduCreator::AckPduCreator(AckInfo &ackInfo, PduConfig &pduConf)
: FileDirectiveCreator(pduConf, cfdp::FileDirective::ACK, 2), ackInfo(ackInfo) {}
size_t AckPduCreator::getSerializedSize() const { return FileDirectiveCreator::getWholePduSize(); }
ReturnValue_t AckPduCreator::serialize(uint8_t **buffer, size_t *size, size_t maxSize,
Endianness streamEndianness) const {
ReturnValue_t result = FileDirectiveCreator::serialize(buffer, size, maxSize, streamEndianness);
if (result != returnvalue::OK) {
return result;
}
cfdp::FileDirective ackedDirective = ackInfo.getAckedDirective();
uint8_t directiveSubtypeCode = ackInfo.getDirectiveSubtypeCode();
cfdp::ConditionCode ackedConditionCode = ackInfo.getAckedConditionCode();
cfdp::AckTransactionStatus transactionStatus = ackInfo.getTransactionStatus();
if (ackedDirective != cfdp::FileDirective::FINISH and
ackedDirective != cfdp::FileDirective::EOF_DIRECTIVE) {
// TODO: better returncode
return returnvalue::FAILED;
}
if (*size + 2 > maxSize) {
return SerializeIF::BUFFER_TOO_SHORT;
}
**buffer = ackedDirective << 4 | directiveSubtypeCode;
*buffer += 1;
*size += 1;
**buffer = ackedConditionCode << 4 | transactionStatus;
*buffer += 1;
*size += 1;
return returnvalue::OK;
}

View File

@ -1,11 +1,11 @@
#ifndef FSFW_SRC_FSFW_CFDP_PDU_ACKPDUSERIALIZER_H_
#define FSFW_SRC_FSFW_CFDP_PDU_ACKPDUSERIALIZER_H_
#ifndef FSFW_CFDP_PDU_ACKPDUSERIALIZER_H_
#define 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 AckPduCreator : public FileDirectiveCreator {
public:
/**
* @brief Serializer to pack ACK PDUs
@ -16,9 +16,9 @@ class AckPduSerializer : public FileDirectiveSerializer {
* @param transactionStatus
* @param pduConf
*/
AckPduSerializer(AckInfo& ackInfo, PduConfig& pduConf);
AckPduCreator(AckInfo& ackInfo, PduConfig& pduConf);
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;
@ -27,4 +27,4 @@ class AckPduSerializer : public FileDirectiveSerializer {
AckInfo& ackInfo;
};
#endif /* FSFW_SRC_FSFW_CFDP_PDU_ACKPDUSERIALIZER_H_ */
#endif /* FSFW_CFDP_PDU_ACKPDUSERIALIZER_H_ */

View File

@ -1,37 +0,0 @@
#include "AckPduDeserializer.h"
AckPduDeserializer::AckPduDeserializer(const uint8_t* pduBuf, size_t maxSize, AckInfo& info)
: FileDirectiveDeserializer(pduBuf, maxSize), info(info) {}
ReturnValue_t AckPduDeserializer::parseData() {
ReturnValue_t result = FileDirectiveDeserializer::parseData();
if (result != returnvalue::OK) {
return result;
}
size_t currentIdx = FileDirectiveDeserializer::getHeaderSize();
if (currentIdx + 2 > this->maxSize) {
return SerializeIF::BUFFER_TOO_SHORT;
}
if (not checkAndSetCodes(rawPtr[currentIdx], rawPtr[currentIdx + 1])) {
return cfdp::INVALID_ACK_DIRECTIVE_FIELDS;
}
return returnvalue::OK;
}
bool AckPduDeserializer::checkAndSetCodes(uint8_t firstByte, uint8_t secondByte) {
uint8_t ackedDirective = static_cast<cfdp::FileDirectives>(firstByte >> 4);
if (ackedDirective != cfdp::FileDirectives::EOF_DIRECTIVE and
ackedDirective != cfdp::FileDirectives::FINISH) {
return false;
}
this->info.setAckedDirective(static_cast<cfdp::FileDirectives>(ackedDirective));
uint8_t directiveSubtypeCode = firstByte & 0x0f;
if (directiveSubtypeCode != 0b0000 and directiveSubtypeCode != 0b0001) {
return false;
}
this->info.setDirectiveSubtypeCode(directiveSubtypeCode);
this->info.setAckedConditionCode(static_cast<cfdp::ConditionCode>(secondByte >> 4));
this->info.setTransactionStatus(static_cast<cfdp::AckTransactionStatus>(secondByte & 0x0f));
return true;
}

View File

@ -0,0 +1,45 @@
#include "AckPduReader.h"
AckPduReader::AckPduReader(const uint8_t* pduBuf, size_t maxSize, AckInfo& info)
: FileDirectiveReader(pduBuf, maxSize), info(info) {}
ReturnValue_t AckPduReader::parseData() {
ReturnValue_t result = FileDirectiveReader::parseData();
if (result != returnvalue::OK) {
return result;
}
size_t currentIdx = FileDirectiveReader::getHeaderSize();
if (currentIdx + 2 > this->maxSize) {
return SerializeIF::BUFFER_TOO_SHORT;
}
if (not checkAndSetCodes(pointers.rawPtr[currentIdx], pointers.rawPtr[currentIdx + 1])) {
return cfdp::INVALID_ACK_DIRECTIVE_FIELDS;
}
return returnvalue::OK;
}
bool AckPduReader::checkAndSetCodes(uint8_t firstByte, uint8_t secondByte) {
cfdp::FileDirective directive;
if (not checkAckedDirectiveField(firstByte, directive)) {
return false;
}
this->info.setAckedDirective(directive);
uint8_t directiveSubtypeCode = firstByte & 0x0f;
if (directiveSubtypeCode != 0b0000 and directiveSubtypeCode != 0b0001) {
return false;
}
this->info.setDirectiveSubtypeCode(directiveSubtypeCode);
this->info.setAckedConditionCode(static_cast<cfdp::ConditionCode>(secondByte >> 4));
this->info.setTransactionStatus(static_cast<cfdp::AckTransactionStatus>(secondByte & 0x0f));
return true;
}
bool AckPduReader::checkAckedDirectiveField(uint8_t firstPduDataByte,
cfdp::FileDirective& ackedDirective) {
uint8_t ackedDirectiveRaw = static_cast<cfdp::FileDirective>(firstPduDataByte >> 4);
if (ackedDirectiveRaw != cfdp::FileDirective::EOF_DIRECTIVE and
ackedDirectiveRaw != cfdp::FileDirective::FINISH) {
return false;
}
ackedDirective = (static_cast<cfdp::FileDirective>(ackedDirectiveRaw));
return true;
}

View File

@ -2,18 +2,21 @@
#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 AckPduReader : public FileDirectiveReader {
public:
AckPduDeserializer(const uint8_t* pduBuf, size_t maxSize, AckInfo& info);
AckPduReader(const uint8_t* pduBuf, size_t maxSize, AckInfo& info);
/**
*
* @return
* - cfdp::INVALID_DIRECTIVE_FIELDS: Invalid fields
*/
ReturnValue_t parseData();
ReturnValue_t parseData() override;
static bool checkAckedDirectiveField(uint8_t firstPduDataByte,
cfdp::FileDirective& ackedDirective);
private:
bool checkAndSetCodes(uint8_t rawAckedByte, uint8_t rawAckedConditionCode);

View File

@ -1,36 +0,0 @@
#include "AckPduSerializer.h"
AckPduSerializer::AckPduSerializer(AckInfo &ackInfo, PduConfig &pduConf)
: FileDirectiveSerializer(pduConf, cfdp::FileDirectives::ACK, 2), ackInfo(ackInfo) {}
size_t AckPduSerializer::getSerializedSize() const {
return FileDirectiveSerializer::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 != returnvalue::OK) {
return result;
}
cfdp::FileDirectives ackedDirective = ackInfo.getAckedDirective();
uint8_t directiveSubtypeCode = ackInfo.getDirectiveSubtypeCode();
cfdp::ConditionCode ackedConditionCode = ackInfo.getAckedConditionCode();
cfdp::AckTransactionStatus transactionStatus = ackInfo.getTransactionStatus();
if (ackedDirective != cfdp::FileDirectives::FINISH and
ackedDirective != cfdp::FileDirectives::EOF_DIRECTIVE) {
// TODO: better returncode
return returnvalue::FAILED;
}
if (*size + 2 > maxSize) {
return SerializeIF::BUFFER_TOO_SHORT;
}
**buffer = ackedDirective << 4 | directiveSubtypeCode;
*buffer += 1;
*size += 1;
**buffer = ackedConditionCode << 4 | transactionStatus;
*buffer += 1;
*size += 1;
return returnvalue::OK;
}

View File

@ -1,30 +1,29 @@
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
AckPduCreator.cpp
AckPduReader.cpp
EofInfo.cpp
EofPduSerializer.cpp
EofPduDeserializer.cpp
EofPduCreator.cpp
EofPduReader.cpp
NakInfo.cpp
NakPduSerializer.cpp
NakPduDeserializer.cpp
NakPduCreator.cpp
NakPduReader.cpp
FinishedInfo.cpp
FinishedPduSerializer.cpp
FinishedPduDeserializer.cpp
MetadataInfo.cpp
MetadataPduSerializer.cpp
MetadataPduDeserializer.cpp
KeepAlivePduSerializer.cpp
KeepAlivePduDeserializer.cpp
PromptPduSerializer.cpp
PromptPduDeserializer.cpp
FileDataSerializer.cpp
FileDataDeserializer.cpp
FinishedPduCreator.cpp
FinishedPduReader.cpp
MetadataGenericInfo.cpp
MetadataPduCreator.cpp
MetadataPduReader.cpp
KeepAlivePduCreator.cpp
KeepAlivePduReader.cpp
PromptPduCreator.cpp
PromptPduReader.cpp
FileDataCreator.cpp
FileDataReader.cpp
FileDataInfo.cpp)

View File

@ -1,8 +1,13 @@
#include "EofInfo.h"
EofInfo::EofInfo(cfdp::ConditionCode conditionCode, uint32_t checksum, cfdp::FileSize fileSize,
#include <utility>
EofInfo::EofInfo(cfdp::ConditionCode conditionCode, uint32_t checksum, cfdp::Fss fileSize,
EntityIdTlv* faultLoc)
: conditionCode(conditionCode), checksum(checksum), fileSize(fileSize), faultLoc(faultLoc) {}
: conditionCode(conditionCode),
checksum(checksum),
fileSize(std::move(fileSize)),
faultLoc(faultLoc) {}
EofInfo::EofInfo(EntityIdTlv* faultLoc)
: conditionCode(cfdp::ConditionCode::NO_CONDITION_FIELD),
@ -16,15 +21,15 @@ cfdp::ConditionCode EofInfo::getConditionCode() const { return conditionCode; }
EntityIdTlv* EofInfo::getFaultLoc() const { return faultLoc; }
cfdp::FileSize& EofInfo::getFileSize() { return fileSize; }
cfdp::Fss& EofInfo::getFileSize() { return fileSize; }
void EofInfo::setChecksum(uint32_t checksum) { this->checksum = checksum; }
void EofInfo::setChecksum(uint32_t checksum_) { this->checksum = checksum_; }
void EofInfo::setConditionCode(cfdp::ConditionCode conditionCode) {
this->conditionCode = conditionCode;
void EofInfo::setConditionCode(cfdp::ConditionCode conditionCode_) {
this->conditionCode = conditionCode_;
}
void EofInfo::setFaultLoc(EntityIdTlv* faultLoc) { this->faultLoc = faultLoc; }
void EofInfo::setFaultLoc(EntityIdTlv* faultLoc_) { this->faultLoc = faultLoc_; }
size_t EofInfo::getSerializedSize(bool fssLarge) {
// Condition code + spare + 4 byte checksum
@ -42,6 +47,6 @@ size_t EofInfo::getSerializedSize(bool fssLarge) {
return size;
}
ReturnValue_t EofInfo::setFileSize(size_t fileSize, bool isLarge) {
return this->fileSize.setFileSize(fileSize, isLarge);
ReturnValue_t EofInfo::setFileSize(size_t fileSize_, bool isLarge) {
return this->fileSize.setFileSize(fileSize_, isLarge);
}

View File

@ -1,23 +1,23 @@
#ifndef FSFW_SRC_FSFW_CFDP_PDU_EOFINFO_H_
#define FSFW_SRC_FSFW_CFDP_PDU_EOFINFO_H_
#include "../FileSize.h"
#include "../Fss.h"
#include "../definitions.h"
#include "fsfw/cfdp/tlv/EntityIdTlv.h"
struct EofInfo {
public:
EofInfo(EntityIdTlv* faultLoc = nullptr);
EofInfo(cfdp::ConditionCode conditionCode, uint32_t checksum, cfdp::FileSize fileSize,
explicit EofInfo(EntityIdTlv* faultLoc = nullptr);
EofInfo(cfdp::ConditionCode conditionCode, uint32_t checksum, cfdp::Fss fileSize,
EntityIdTlv* faultLoc = nullptr);
size_t getSerializedSize(bool fssLarge = false);
uint32_t getChecksum() const;
cfdp::ConditionCode getConditionCode() const;
[[nodiscard]] uint32_t getChecksum() const;
[[nodiscard]] cfdp::ConditionCode getConditionCode() const;
EntityIdTlv* getFaultLoc() const;
cfdp::FileSize& getFileSize();
[[nodiscard]] EntityIdTlv* getFaultLoc() const;
cfdp::Fss& getFileSize();
void setChecksum(uint32_t checksum);
void setConditionCode(cfdp::ConditionCode conditionCode);
void setFaultLoc(EntityIdTlv* faultLoc);
@ -26,7 +26,7 @@ struct EofInfo {
private:
cfdp::ConditionCode conditionCode;
uint32_t checksum;
cfdp::FileSize fileSize;
cfdp::Fss fileSize;
EntityIdTlv* faultLoc = nullptr;
};

View File

@ -1,21 +1,17 @@
#include "EofPduSerializer.h"
#include "EofPduCreator.h"
#include "fsfw/FSFW.h"
#include "fsfw/serviceinterface.h"
EofPduSerializer::EofPduSerializer(PduConfig &conf, EofInfo &info)
: FileDirectiveSerializer(conf, cfdp::FileDirectives::EOF_DIRECTIVE, 9), info(info) {
setDirectiveDataFieldLen(info.getSerializedSize(getLargeFileFlag()));
EofPduCreator::EofPduCreator(PduConfig &conf, EofInfo &info)
: FileDirectiveCreator(conf, cfdp::FileDirective::EOF_DIRECTIVE, 9), info(info) {
setDirectiveDataFieldLen(info.getSerializedSize(HeaderCreator::getLargeFileFlag()));
}
size_t EofPduSerializer::getSerializedSize() const {
return FileDirectiveSerializer::getWholePduSize();
}
size_t EofPduCreator::getSerializedSize() const { 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);
ReturnValue_t EofPduCreator::serialize(uint8_t **buffer, size_t *size, size_t maxSize,
Endianness streamEndianness) const {
ReturnValue_t result = FileDirectiveCreator::serialize(buffer, size, maxSize, streamEndianness);
if (result != returnvalue::OK) {
return result;
}

View File

@ -2,18 +2,20 @@
#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 EofPduCreator : public FileDirectiveCreator {
public:
EofPduSerializer(PduConfig& conf, EofInfo& info);
EofPduCreator(PduConfig& conf, EofInfo& info);
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;
using FileDirectiveCreator::serialize;
private:
EofInfo& info;
};

View File

@ -1,17 +0,0 @@
#ifndef FSFW_SRC_FSFW_CFDP_PDU_EOFPDUDESERIALIZER_H_
#define FSFW_SRC_FSFW_CFDP_PDU_EOFPDUDESERIALIZER_H_
#include "EofInfo.h"
#include "fsfw/cfdp/pdu/FileDirectiveDeserializer.h"
class EofPduDeserializer : public FileDirectiveDeserializer {
public:
EofPduDeserializer(const uint8_t* pduBuf, size_t maxSize, EofInfo& eofInfo);
virtual ReturnValue_t parseData() override;
private:
EofInfo& info;
};
#endif /* FSFW_SRC_FSFW_CFDP_PDU_EOFPDUDESERIALIZER_H_ */

View File

@ -1,23 +1,23 @@
#include "EofPduDeserializer.h"
#include "EofPduReader.h"
#include "fsfw/FSFW.h"
#include "fsfw/serviceinterface.h"
EofPduDeserializer::EofPduDeserializer(const uint8_t* pduBuf, size_t maxSize, EofInfo& eofInfo)
: FileDirectiveDeserializer(pduBuf, maxSize), info(eofInfo) {}
EofPduReader::EofPduReader(const uint8_t* pduBuf, size_t maxSize, EofInfo& eofInfo)
: FileDirectiveReader(pduBuf, maxSize), info(eofInfo) {}
ReturnValue_t EofPduDeserializer::parseData() {
ReturnValue_t result = FileDirectiveDeserializer::parseData();
ReturnValue_t EofPduReader::parseData() {
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;

View File

@ -0,0 +1,17 @@
#ifndef FSFW_SRC_FSFW_CFDP_PDU_EOFPDUDESERIALIZER_H_
#define FSFW_SRC_FSFW_CFDP_PDU_EOFPDUDESERIALIZER_H_
#include "EofInfo.h"
#include "fsfw/cfdp/pdu/FileDirectiveReader.h"
class EofPduReader : public FileDirectiveReader {
public:
EofPduReader(const uint8_t* pduBuf, size_t maxSize, EofInfo& eofInfo);
ReturnValue_t parseData() override;
private:
EofInfo& info;
};
#endif /* FSFW_SRC_FSFW_CFDP_PDU_EOFPDUDESERIALIZER_H_ */

View File

@ -1,28 +1,31 @@
#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);
ReturnValue_t FileDataCreator::serialize(uint8_t** buffer, size_t* size, size_t maxSize,
Endianness streamEndianness) const {
if (buffer == nullptr or size == nullptr) {
return returnvalue::FAILED;
}
if (*size + getSerializedSize() > maxSize) {
return SerializeIF::BUFFER_TOO_SHORT;
}
ReturnValue_t result = HeaderCreator::serialize(buffer, size, maxSize, streamEndianness);
if (result != returnvalue::OK) {
return result;
}
if (*size + this->getSerializedSize() > maxSize) {
return SerializeIF::BUFFER_TOO_SHORT;
}
const uint8_t* readOnlyPtr = nullptr;
if (this->hasSegmentMetadataFlag()) {
size_t segmentMetadataLen = info.getSegmentMetadataLen();
@ -34,7 +37,7 @@ ReturnValue_t FileDataSerializer::serialize(uint8_t** buffer, size_t* size, size
*buffer += segmentMetadataLen;
*size += segmentMetadataLen;
}
cfdp::FileSize& offset = info.getOffset();
cfdp::Fss& offset = info.getOffset();
result = offset.serialize(this->getLargeFileFlag(), buffer, size, maxSize, streamEndianness);
if (result != returnvalue::OK) {
return result;
@ -50,6 +53,6 @@ ReturnValue_t FileDataSerializer::serialize(uint8_t** buffer, size_t* size, size
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());
}

View File

@ -0,0 +1,27 @@
#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* buf, size_t& serLen, size_t maxSize) const {
return SerializeIF::serialize(buf, serLen, maxSize, SerializeIF::Endianness::NETWORK);
}
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_ */

View File

@ -1,9 +1,9 @@
#include "FileDataInfo.h"
FileDataInfo::FileDataInfo(cfdp::FileSize &offset, const uint8_t *fileData, size_t fileSize)
: offset(offset), fileData(fileData), fileSize(fileSize) {}
#include <utility>
FileDataInfo::FileDataInfo(cfdp::FileSize &offset) : offset(offset) {}
FileDataInfo::FileDataInfo(cfdp::Fss offset, const uint8_t *fileData, size_t fileSize)
: offset(std::move(offset)), fileData(fileData), fileSize(fileSize) {}
void FileDataInfo::setSegmentMetadataFlag(bool enable) {
if (enable) {
@ -57,21 +57,21 @@ ReturnValue_t FileDataInfo::addSegmentMetadataInfo(cfdp::RecordContinuationState
return returnvalue::OK;
}
const uint8_t *FileDataInfo::getFileData(size_t *fileSize) const {
if (fileSize != nullptr) {
*fileSize = this->fileSize;
const uint8_t *FileDataInfo::getFileData(size_t *fileSize_) const {
if (fileSize_ != nullptr) {
*fileSize_ = this->fileSize;
}
return fileData;
}
const uint8_t *FileDataInfo::getSegmentMetadata(size_t *segmentMetadataLen) {
if (segmentMetadataLen != nullptr) {
*segmentMetadataLen = this->segmentMetadataLen;
const uint8_t *FileDataInfo::getSegmentMetadata(size_t *segmentMetadataLen_) {
if (segmentMetadataLen_ != nullptr) {
*segmentMetadataLen_ = this->segmentMetadataLen;
}
return segmentMetadata;
}
cfdp::FileSize &FileDataInfo::getOffset() { return offset; }
cfdp::Fss &FileDataInfo::getOffset() { return offset; }
void FileDataInfo::setRecordContinuationState(cfdp::RecordContinuationState recContState) {
this->recContState = recContState;

View File

@ -1,30 +1,30 @@
#ifndef FSFW_SRC_FSFW_CFDP_PDU_FILEDATAINFO_H_
#define FSFW_SRC_FSFW_CFDP_PDU_FILEDATAINFO_H_
#include <fsfw/cfdp/FileSize.h>
#include <fsfw/cfdp/Fss.h>
#include <fsfw/cfdp/definitions.h>
class FileDataInfo {
public:
FileDataInfo(cfdp::FileSize& offset);
FileDataInfo(cfdp::FileSize& offset, const uint8_t* fileData, size_t fileSize);
FileDataInfo() = default;
FileDataInfo(cfdp::Fss offset, const uint8_t* fileData, size_t fileSize);
size_t getSerializedSize(bool largeFile = false) const;
[[nodiscard]] size_t getSerializedSize(bool largeFile = false) const;
cfdp::FileSize& getOffset();
cfdp::Fss& getOffset();
const uint8_t* getFileData(size_t* fileSize = nullptr) const;
void setFileData(const uint8_t* fileData, size_t fileSize);
cfdp::SegmentMetadataFlag getSegmentMetadataFlag() const;
cfdp::SegmentationControl getSegmentationControl() const;
cfdp::RecordContinuationState getRecordContinuationState() const;
[[nodiscard]] cfdp::SegmentMetadataFlag getSegmentMetadataFlag() const;
[[nodiscard]] cfdp::SegmentationControl getSegmentationControl() const;
[[nodiscard]] cfdp::RecordContinuationState getRecordContinuationState() const;
void setRecordContinuationState(cfdp::RecordContinuationState recContState);
void setSegmentationControl(cfdp::SegmentationControl segCtrl);
size_t getSegmentMetadataLen() const;
[[nodiscard]] size_t getSegmentMetadataLen() const;
void setSegmentMetadataLen(size_t len);
void setSegmentMetadata(const uint8_t* ptr);
bool hasSegmentMetadata() const;
[[nodiscard]] bool hasSegmentMetadata() const;
void setSegmentMetadataFlag(bool enable);
ReturnValue_t addSegmentMetadataInfo(cfdp::RecordContinuationState recContState,
const uint8_t* segmentMetadata, size_t segmentMetadataLen);
@ -33,7 +33,7 @@ class FileDataInfo {
private:
cfdp::SegmentMetadataFlag segmentMetadataFlag = cfdp::SegmentMetadataFlag::NOT_PRESENT;
cfdp::SegmentationControl segCtrl = cfdp::SegmentationControl::NO_RECORD_BOUNDARIES_PRESERVATION;
cfdp::FileSize& offset;
cfdp::Fss offset;
const uint8_t* fileData = nullptr;
size_t fileSize = 0;
cfdp::RecordContinuationState recContState = cfdp::RecordContinuationState::NO_START_NO_END;

View File

@ -1,17 +1,16 @@
#include "FileDataDeserializer.h"
#include "FileDataReader.h"
FileDataDeserializer::FileDataDeserializer(const uint8_t* pduBuf, size_t maxSize,
FileDataInfo& info)
: HeaderDeserializer(pduBuf, maxSize), info(info) {}
FileDataReader::FileDataReader(const uint8_t* pduBuf, size_t maxSize, FileDataInfo& info)
: PduHeaderReader(pduBuf, maxSize), info(info) {}
ReturnValue_t FileDataDeserializer::parseData() {
ReturnValue_t result = HeaderDeserializer::parseData();
ReturnValue_t FileDataReader::parseData() {
ReturnValue_t result = PduHeaderReader::parseData();
if (result != returnvalue::OK) {
return result;
}
size_t currentIdx = HeaderDeserializer::getHeaderSize();
const uint8_t* buf = rawPtr + currentIdx;
size_t remSize = HeaderDeserializer::getWholePduSize() - currentIdx;
size_t currentIdx = PduHeaderReader::getHeaderSize();
const uint8_t* buf = pointers.rawPtr + currentIdx;
size_t remSize = PduHeaderReader::getWholePduSize() - currentIdx;
if (remSize < 1) {
return SerializeIF::STREAM_TOO_SHORT;
}
@ -41,8 +40,8 @@ ReturnValue_t FileDataDeserializer::parseData() {
return returnvalue::OK;
}
SerializeIF::Endianness FileDataDeserializer::getEndianness() const { return endianness; }
SerializeIF::Endianness FileDataReader::getEndianness() const { return endianness; }
void FileDataDeserializer::setEndianness(SerializeIF::Endianness endianness) {
this->endianness = endianness;
void FileDataReader::setEndianness(SerializeIF::Endianness endianness_) {
endianness = endianness_;
}

View File

@ -3,14 +3,14 @@
#include "../definitions.h"
#include "FileDataInfo.h"
#include "HeaderDeserializer.h"
#include "PduHeaderReader.h"
class FileDataDeserializer : public HeaderDeserializer {
class FileDataReader : public PduHeaderReader {
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:

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_ */

View File

@ -0,0 +1,39 @@
#include "FileDirectiveCreator.h"
FileDirectiveCreator::FileDirectiveCreator(PduConfig &pduConf, cfdp::FileDirective 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);
}
cfdp::FileDirective FileDirectiveCreator::getDirectiveCode() const { return directiveCode; }

View File

@ -0,0 +1,34 @@
#ifndef FSFW_SRC_FSFW_CFDP_PDU_FILEDIRECTIVESERIALIZER_H_
#define FSFW_SRC_FSFW_CFDP_PDU_FILEDIRECTIVESERIALIZER_H_
#include "fsfw/cfdp/pdu/HeaderCreator.h"
class FileDirectiveCreator : public HeaderCreator {
public:
FileDirectiveCreator(PduConfig& pduConf, cfdp::FileDirective directiveCode,
size_t directiveParamFieldLen);
[[nodiscard]] cfdp::FileDirective getDirectiveCode() const;
/**
* This only returns the size of the PDU header + 1 for the directive code octet.
* Use FileDirectiveCreator::getWholePduSize to get the full packet length, assuming
* the length fields was set correctly
* @return
*/
[[nodiscard]] size_t getSerializedSize() const override;
[[nodiscard]] ReturnValue_t serialize(uint8_t* buffer, size_t& serLen, size_t maxSize) const {
return SerializeIF::serialize(buffer, serLen, maxSize, SerializeIF::Endianness::NETWORK);
}
ReturnValue_t serialize(uint8_t** buffer, size_t* size, size_t maxSize,
Endianness streamEndianness) const override;
void setDirectiveDataFieldLen(size_t len);
private:
cfdp::FileDirective directiveCode = cfdp::FileDirective::INVALID_DIRECTIVE;
};
#endif /* FSFW_SRC_FSFW_CFDP_PDU_FILEDIRECTIVESERIALIZER_H_ */

View File

@ -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 != returnvalue::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 returnvalue::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; }

View File

@ -0,0 +1,49 @@
#include "FileDirectiveReader.h"
FileDirectiveReader::FileDirectiveReader(const uint8_t *pduBuf, size_t maxSize)
: PduHeaderReader(pduBuf, maxSize) {}
cfdp::FileDirective FileDirectiveReader::getFileDirective() const { return fileDirective; }
ReturnValue_t FileDirectiveReader::parseData() {
ReturnValue_t result = PduHeaderReader::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 = PduHeaderReader::getHeaderSize();
if (not checkFileDirective(pointers.rawPtr[currentIdx])) {
return cfdp::INVALID_DIRECTIVE_FIELD;
}
setFileDirective(static_cast<cfdp::FileDirective>(pointers.rawPtr[currentIdx]));
return returnvalue::OK;
}
size_t FileDirectiveReader::getHeaderSize() const {
// return size of header plus the directive byte
return PduHeaderReader::getHeaderSize() + 1;
}
bool FileDirectiveReader::checkFileDirective(uint8_t rawByte) {
if (rawByte < cfdp::FileDirective::EOF_DIRECTIVE or
(rawByte > cfdp::FileDirective::PROMPT and rawByte != cfdp::FileDirective::KEEP_ALIVE)) {
// Invalid directive field
return false;
}
return true;
}
void FileDirectiveReader::setFileDirective(cfdp::FileDirective fileDirective_) {
fileDirective = fileDirective_;
}
void FileDirectiveReader::setEndianness(SerializeIF::Endianness endianness_) {
endianness = endianness_;
}
SerializeIF::Endianness FileDirectiveReader::getEndianness() const { return endianness; }

View File

@ -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/PduHeaderReader.h"
/**
* @brief This class is used to deserialize a PDU file directive header from raw memory.
@ -11,28 +11,27 @@
* 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 PduHeaderReader {
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::FileDirective getFileDirective() const;
void setEndianness(SerializeIF::Endianness endianness);
SerializeIF::Endianness getEndianness() const;
[[nodiscard]] SerializeIF::Endianness getEndianness() const;
static bool checkFileDirective(uint8_t rawByte);
protected:
bool checkFileDirective(uint8_t rawByte);
private:
void setFileDirective(cfdp::FileDirectives fileDirective);
cfdp::FileDirectives fileDirective = cfdp::FileDirectives::INVALID_DIRECTIVE;
void setFileDirective(cfdp::FileDirective fileDirective);
cfdp::FileDirective fileDirective = cfdp::FileDirective::INVALID_DIRECTIVE;
SerializeIF::Endianness endianness = SerializeIF::Endianness::NETWORK;
};

View File

@ -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 returnvalue::FAILED;
}
if (FileDirectiveSerializer::getWholePduSize() > maxSize) {
return BUFFER_TOO_SHORT;
}
ReturnValue_t result = HeaderSerializer::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 FileDirectiveSerializer::setDirectiveDataFieldLen(size_t len) {
// Set length of data field plus 1 byte for the directive octet
HeaderSerializer::setPduDataFieldLen(len + 1);
}

View File

@ -1,28 +0,0 @@
#ifndef FSFW_SRC_FSFW_CFDP_PDU_FILEDIRECTIVESERIALIZER_H_
#define FSFW_SRC_FSFW_CFDP_PDU_FILEDIRECTIVESERIALIZER_H_
#include "fsfw/cfdp/pdu/HeaderSerializer.h"
class FileDirectiveSerializer : public HeaderSerializer {
public:
FileDirectiveSerializer(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
* the length fields was set correctly
* @return
*/
size_t getSerializedSize() const override;
ReturnValue_t serialize(uint8_t** buffer, size_t* size, size_t maxSize,
Endianness streamEndianness) const override;
void setDirectiveDataFieldLen(size_t len);
private:
cfdp::FileDirectives directiveCode = cfdp::FileDirectives::INVALID_DIRECTIVE;
};
#endif /* FSFW_SRC_FSFW_CFDP_PDU_FILEDIRECTIVESERIALIZER_H_ */

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 {
@ -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;
}

View File

@ -8,13 +8,13 @@
class FinishedInfo {
public:
FinishedInfo();
FinishedInfo(cfdp::ConditionCode conditionCode, cfdp::FinishedDeliveryCode deliveryCode,
cfdp::FinishedFileStatus fileStatus);
FinishedInfo(cfdp::ConditionCode conditionCode, cfdp::FileDeliveryCode deliveryCode,
cfdp::FileDeliveryStatus fileStatus);
size_t getSerializedSize() const;
[[nodiscard]] size_t getSerializedSize() const;
bool hasFsResponses() const;
bool canHoldFsResponses() const;
[[nodiscard]] bool hasFsResponses() const;
[[nodiscard]] bool canHoldFsResponses() const;
ReturnValue_t setFilestoreResponsesArray(FilestoreResponseTlv** fsResponses,
size_t* fsResponsesLen, const size_t* maxFsResponseLen);
@ -22,20 +22,20 @@ class FinishedInfo {
ReturnValue_t getFilestoreResonses(FilestoreResponseTlv*** fsResponses, size_t* fsResponsesLen,
size_t* fsResponsesMaxLen);
size_t getFsResponsesLen() const;
[[nodiscard]] size_t getFsResponsesLen() const;
void setFilestoreResponsesArrayLen(size_t fsResponsesLen);
ReturnValue_t getFaultLocation(EntityIdTlv** entityId);
cfdp::ConditionCode getConditionCode() const;
[[nodiscard]] cfdp::ConditionCode getConditionCode() const;
void setConditionCode(cfdp::ConditionCode conditionCode);
cfdp::FinishedDeliveryCode getDeliveryCode() const;
void setDeliveryCode(cfdp::FinishedDeliveryCode deliveryCode);
cfdp::FinishedFileStatus getFileStatus() const;
void setFileStatus(cfdp::FinishedFileStatus fileStatus);
[[nodiscard]] cfdp::FileDeliveryCode getDeliveryCode() const;
void setDeliveryCode(cfdp::FileDeliveryCode deliveryCode);
[[nodiscard]] cfdp::FileDeliveryStatus getFileStatus() const;
void setFileStatus(cfdp::FileDeliveryStatus fileStatus);
private:
cfdp::ConditionCode conditionCode = cfdp::ConditionCode::NO_CONDITION_FIELD;
cfdp::FinishedDeliveryCode deliveryCode = cfdp::FinishedDeliveryCode::DATA_COMPLETE;
cfdp::FinishedFileStatus fileStatus = cfdp::FinishedFileStatus::DISCARDED_DELIBERATELY;
cfdp::FileDeliveryCode deliveryCode = cfdp::FileDeliveryCode::DATA_COMPLETE;
cfdp::FileDeliveryStatus fileStatus = cfdp::FileDeliveryStatus::DISCARDED_DELIBERATELY;
FilestoreResponseTlv** fsResponses = nullptr;
size_t fsResponsesLen = 0;
size_t fsResponsesMaxLen = 0;

View File

@ -1,26 +1,23 @@
#include "FinishedPduSerializer.h"
#include "FinishedPduCreator.h"
FinishPduSerializer::FinishPduSerializer(PduConfig &conf, FinishedInfo &finishInfo)
: FileDirectiveSerializer(conf, cfdp::FileDirectives::FINISH, 0), finishInfo(finishInfo) {
FinishPduCreator::FinishPduCreator(PduConfig &conf, FinishedInfo &finishInfo)
: FileDirectiveCreator(conf, cfdp::FileDirective::FINISH, 0), finishInfo(finishInfo) {
updateDirectiveFieldLen();
}
size_t FinishPduSerializer::getSerializedSize() const {
return FinishPduSerializer::getWholePduSize();
}
size_t FinishPduCreator::getSerializedSize() const { return FinishPduCreator::getWholePduSize(); }
void FinishPduSerializer::updateDirectiveFieldLen() {
void FinishPduCreator::updateDirectiveFieldLen() {
setDirectiveDataFieldLen(finishInfo.getSerializedSize());
}
ReturnValue_t FinishPduSerializer::serialize(uint8_t **buffer, size_t *size, size_t maxSize,
Endianness streamEndianness) const {
ReturnValue_t result =
FileDirectiveSerializer::serialize(buffer, size, maxSize, streamEndianness);
ReturnValue_t FinishPduCreator::serialize(uint8_t **buffer, size_t *size, size_t maxSize,
Endianness streamEndianness) const {
ReturnValue_t result = FileDirectiveCreator::serialize(buffer, size, maxSize, streamEndianness);
if (result != returnvalue::OK) {
return result;
}
if (*size + 1 >= maxSize) {
if (*size + 1 > maxSize) {
return SerializeIF::BUFFER_TOO_SHORT;
}
**buffer = finishInfo.getConditionCode() << 4 | finishInfo.getDeliveryCode() << 2 |

View File

@ -0,0 +1,24 @@
#ifndef FSFW_CFDP_PDU_FINISHEDPDUSERIALIZER_H_
#define FSFW_CFDP_PDU_FINISHEDPDUSERIALIZER_H_
#include "FinishedInfo.h"
#include "fsfw/cfdp/pdu/FileDataCreator.h"
#include "fsfw/cfdp/pdu/FileDirectiveCreator.h"
class FinishPduCreator : public FileDirectiveCreator {
public:
FinishPduCreator(PduConfig& pduConf, FinishedInfo& finishInfo);
void updateDirectiveFieldLen();
[[nodiscard]] size_t getSerializedSize() const override;
ReturnValue_t serialize(uint8_t** buffer, size_t* size, size_t maxSize,
Endianness streamEndianness) const override;
using FileDirectiveCreator::serialize;
private:
FinishedInfo& finishInfo;
};
#endif /* FSFW_CFDP_PDU_FINISHEDPDUSERIALIZER_H_ */

View File

@ -1,22 +0,0 @@
#ifndef FSFW_SRC_FSFW_CFDP_PDU_FINISHEDPDUDESERIALIZER_H_
#define FSFW_SRC_FSFW_CFDP_PDU_FINISHEDPDUDESERIALIZER_H_
#include "fsfw/cfdp/pdu/FileDirectiveDeserializer.h"
#include "fsfw/cfdp/pdu/FinishedInfo.h"
class FinishPduDeserializer : public FileDirectiveDeserializer {
public:
FinishPduDeserializer(const uint8_t* pduBuf, size_t maxSize, FinishedInfo& info);
ReturnValue_t parseData() override;
FinishedInfo& getInfo();
private:
FinishedInfo& finishedInfo;
ReturnValue_t parseTlvs(size_t remLen, size_t currentIdx, const uint8_t* buf,
cfdp::ConditionCode conditionCode);
};
#endif /* FSFW_SRC_FSFW_CFDP_PDU_FINISHEDPDUDESERIALIZER_H_ */

View File

@ -1,25 +1,24 @@
#include "FinishedPduDeserializer.h"
#include "FinishedPduReader.h"
FinishPduDeserializer::FinishPduDeserializer(const uint8_t* pduBuf, size_t maxSize,
FinishedInfo& info)
: FileDirectiveDeserializer(pduBuf, maxSize), finishedInfo(info) {}
FinishPduReader::FinishPduReader(const uint8_t* pduBuf, size_t maxSize, FinishedInfo& info)
: FileDirectiveReader(pduBuf, maxSize), finishedInfo(info) {}
ReturnValue_t FinishPduDeserializer::parseData() {
ReturnValue_t result = FileDirectiveDeserializer::parseData();
ReturnValue_t FinishPduReader::parseData() {
ReturnValue_t result = FileDirectiveReader::parseData();
if (result != returnvalue::OK) {
return result;
}
size_t currentIdx = FileDirectiveDeserializer::getHeaderSize();
const uint8_t* buf = rawPtr + currentIdx;
size_t remSize = FileDirectiveDeserializer::getWholePduSize() - currentIdx;
size_t currentIdx = FileDirectiveReader::getHeaderSize();
const uint8_t* buf = pointers.rawPtr + currentIdx;
size_t remSize = FileDirectiveReader::getWholePduSize() - currentIdx;
if (remSize < 1) {
return SerializeIF::STREAM_TOO_SHORT;
}
uint8_t firstByte = *buf;
cfdp::ConditionCode condCode = static_cast<cfdp::ConditionCode>((firstByte >> 4) & 0x0f);
auto condCode = static_cast<cfdp::ConditionCode>((firstByte >> 4) & 0x0f);
finishedInfo.setConditionCode(condCode);
finishedInfo.setDeliveryCode(static_cast<cfdp::FinishedDeliveryCode>(firstByte >> 2 & 0b1));
finishedInfo.setFileStatus(static_cast<cfdp::FinishedFileStatus>(firstByte & 0b11));
finishedInfo.setDeliveryCode(static_cast<cfdp::FileDeliveryCode>(firstByte >> 2 & 0b1));
finishedInfo.setFileStatus(static_cast<cfdp::FileDeliveryStatus>(firstByte & 0b11));
buf += 1;
remSize -= 1;
currentIdx += 1;
@ -29,17 +28,17 @@ ReturnValue_t FinishPduDeserializer::parseData() {
return result;
}
FinishedInfo& FinishPduDeserializer::getInfo() { return finishedInfo; }
FinishedInfo& FinishPduReader::getInfo() { return finishedInfo; }
ReturnValue_t FinishPduDeserializer::parseTlvs(size_t remLen, size_t currentIdx, const uint8_t* buf,
cfdp::ConditionCode conditionCode) {
ReturnValue_t FinishPduReader::parseTlvs(size_t remLen, size_t currentIdx, const uint8_t* buf,
cfdp::ConditionCode conditionCode) {
ReturnValue_t result = returnvalue::OK;
size_t fsResponsesIdx = 0;
auto endianness = getEndianness();
FilestoreResponseTlv** fsResponseArray = nullptr;
size_t fsResponseMaxArrayLen = 0;
EntityIdTlv* faultLocation = nullptr;
cfdp::TlvTypes nextTlv = cfdp::TlvTypes::INVALID_TLV;
cfdp::TlvType nextTlv = cfdp::TlvType::INVALID_TLV;
while (remLen > 0) {
// Simply forward parse the TLV type. Every TLV type except the last one must be a Filestore
// Response TLV, and even the last one can be a Filestore Response TLV if the fault
@ -47,8 +46,8 @@ ReturnValue_t FinishPduDeserializer::parseTlvs(size_t remLen, size_t currentIdx,
if (currentIdx + 2 > maxSize) {
return SerializeIF::STREAM_TOO_SHORT;
}
nextTlv = static_cast<cfdp::TlvTypes>(*buf);
if (nextTlv == cfdp::TlvTypes::FILESTORE_RESPONSE) {
nextTlv = static_cast<cfdp::TlvType>(*buf);
if (nextTlv == cfdp::TlvType::FILESTORE_RESPONSE) {
if (fsResponseArray == nullptr) {
if (not finishedInfo.canHoldFsResponses()) {
return cfdp::FINISHED_CANT_PARSE_FS_RESPONSES;
@ -64,7 +63,7 @@ ReturnValue_t FinishPduDeserializer::parseTlvs(size_t remLen, size_t currentIdx,
return result;
}
fsResponsesIdx += 1;
} else if (nextTlv == cfdp::TlvTypes::ENTITY_ID) {
} else if (nextTlv == cfdp::TlvType::ENTITY_ID) {
// This needs to be the last TLV and it should not be here if the condition code
// is "No Error" or "Unsupported Checksum Type"
if (conditionCode == cfdp::ConditionCode::NO_ERROR or

View File

@ -0,0 +1,22 @@
#ifndef FSFW_CFDP_PDU_FINISHEDPDUDESERIALIZER_H_
#define FSFW_CFDP_PDU_FINISHEDPDUDESERIALIZER_H_
#include "fsfw/cfdp/pdu/FileDirectiveReader.h"
#include "fsfw/cfdp/pdu/FinishedInfo.h"
class FinishPduReader : public FileDirectiveReader {
public:
FinishPduReader(const uint8_t* pduBuf, size_t maxSize, FinishedInfo& info);
ReturnValue_t parseData() override;
FinishedInfo& getInfo();
private:
FinishedInfo& finishedInfo;
ReturnValue_t parseTlvs(size_t remLen, size_t currentIdx, const uint8_t* buf,
cfdp::ConditionCode conditionCode);
};
#endif /* FSFW_CFDP_PDU_FINISHEDPDUDESERIALIZER_H_ */

View File

@ -1,23 +0,0 @@
#ifndef FSFW_SRC_FSFW_CFDP_PDU_FINISHEDPDUSERIALIZER_H_
#define FSFW_SRC_FSFW_CFDP_PDU_FINISHEDPDUSERIALIZER_H_
#include "FinishedInfo.h"
#include "fsfw/cfdp/pdu/FileDataSerializer.h"
#include "fsfw/cfdp/pdu/FileDirectiveSerializer.h"
class FinishPduSerializer : public FileDirectiveSerializer {
public:
FinishPduSerializer(PduConfig& pduConf, FinishedInfo& finishInfo);
void updateDirectiveFieldLen();
size_t getSerializedSize() const override;
ReturnValue_t serialize(uint8_t** buffer, size_t* size, size_t maxSize,
Endianness streamEndianness) const override;
private:
FinishedInfo& finishInfo;
};
#endif /* FSFW_SRC_FSFW_CFDP_PDU_FINISHEDPDUSERIALIZER_H_ */

View File

@ -0,0 +1,111 @@
#include "HeaderCreator.h"
HeaderCreator::HeaderCreator(PduConfig &pduConf, cfdp::PduType pduType, size_t initPduDataFieldLen,
cfdp::SegmentMetadataFlag segmentMetadataFlag,
cfdp::SegmentationControl segCtrl)
: pduType(pduType),
segmentMetadataFlag(segmentMetadataFlag),
segmentationCtrl(segCtrl),
pduDataFieldLen(initPduDataFieldLen),
pduConf(pduConf) {}
ReturnValue_t HeaderCreator::serialize(uint8_t **buffer, size_t *size, size_t maxSize,
Endianness streamEndianness) const {
if (buffer == nullptr or size == nullptr) {
return returnvalue::FAILED;
}
if (maxSize < this->getSerializedSize()) {
return BUFFER_TOO_SHORT;
}
**buffer = cfdp::VERSION_BITS | this->pduType << 4 | pduConf.direction << 3 | pduConf.mode << 2 |
pduConf.crcFlag << 1 | pduConf.largeFile;
*buffer += 1;
**buffer = (pduDataFieldLen & 0xff00) >> 8;
*buffer += 1;
**buffer = pduDataFieldLen & 0x00ff;
*buffer += 1;
**buffer = segmentationCtrl << 7 | ((pduConf.sourceId.getWidth() - 1) << 4) |
segmentMetadataFlag << 3 | (pduConf.seqNum.getWidth() - 1);
*buffer += 1;
*size += 4;
ReturnValue_t result = pduConf.sourceId.serialize(buffer, size, maxSize, streamEndianness);
if (result != returnvalue::OK) {
return result;
}
result = pduConf.seqNum.serialize(buffer, size, maxSize, streamEndianness);
if (result != returnvalue::OK) {
return result;
}
result = pduConf.destId.serialize(buffer, size, maxSize, streamEndianness);
if (result != returnvalue::OK) {
return result;
}
return returnvalue::OK;
}
size_t HeaderCreator::getSerializedSize() const {
return pduConf.seqNum.getWidth() + pduConf.sourceId.getWidth() * 2 + 4;
}
ReturnValue_t HeaderCreator::deSerialize(const uint8_t **buffer, size_t *size,
Endianness streamEndianness) {
// We could implement this, but I prefer dedicated classes
return returnvalue::FAILED;
}
size_t HeaderCreator::getWholePduSize() const {
// Return size of header plus the PDU data field length
return pduDataFieldLen + HeaderCreator::getSerializedSize();
}
size_t HeaderCreator::getPduDataFieldLen() const { return pduDataFieldLen; }
void HeaderCreator::setPduDataFieldLen(size_t pduDataFieldLen_) {
pduDataFieldLen = pduDataFieldLen_;
}
void HeaderCreator::setPduType(cfdp::PduType pduType_) { pduType = pduType_; }
void HeaderCreator::setSegmentMetadataFlag(cfdp::SegmentMetadataFlag segmentMetadataFlag_) {
segmentMetadataFlag = segmentMetadataFlag_;
}
cfdp::PduType HeaderCreator::getPduType() const { return pduType; }
cfdp::Direction HeaderCreator::getDirection() const { return pduConf.direction; }
cfdp::TransmissionMode HeaderCreator::getTransmissionMode() const { return pduConf.mode; }
bool HeaderCreator::getCrcFlag() const { return pduConf.crcFlag; }
bool HeaderCreator::getLargeFileFlag() const { return pduConf.largeFile; }
cfdp::SegmentationControl HeaderCreator::getSegmentationControl() const { return segmentationCtrl; }
cfdp::WidthInBytes HeaderCreator::getLenEntityIds() const { return pduConf.sourceId.getWidth(); }
cfdp::WidthInBytes HeaderCreator::getLenSeqNum() const { return pduConf.seqNum.getWidth(); }
cfdp::SegmentMetadataFlag HeaderCreator::getSegmentMetadataFlag() const {
return segmentMetadataFlag;
}
void HeaderCreator::getSourceId(cfdp::EntityId &sourceId) const { sourceId = pduConf.sourceId; }
void HeaderCreator::getDestId(cfdp::EntityId &destId) const { destId = pduConf.destId; }
void HeaderCreator::setSegmentationControl(cfdp::SegmentationControl segmentationControl) {
this->segmentationCtrl = segmentationControl;
}
void HeaderCreator::getTransactionSeqNum(cfdp::TransactionSeqNum &seqNum) const {
seqNum = pduConf.seqNum;
}
bool HeaderCreator::hasSegmentMetadataFlag() const {
if (this->segmentMetadataFlag == cfdp::SegmentMetadataFlag::PRESENT) {
return true;
}
return false;
}

View File

@ -1,14 +1,14 @@
#ifndef FSFW_SRC_FSFW_CFDP_PDU_HEADERSERIALIZER_H_
#define FSFW_SRC_FSFW_CFDP_PDU_HEADERSERIALIZER_H_
#include "../definitions.h"
#include "PduConfig.h"
#include "PduHeaderIF.h"
#include "fsfw/cfdp/definitions.h"
#include "fsfw/serialize/SerializeIF.h"
class HeaderSerializer : public SerializeIF, public PduHeaderIF {
class HeaderCreator : public SerializeIF, public PduHeaderIF {
public:
HeaderSerializer(
HeaderCreator(
PduConfig& pduConf, cfdp::PduType pduType, size_t initPduDataFieldLen,
cfdp::SegmentMetadataFlag segmentMetadataFlag = cfdp::SegmentMetadataFlag::NOT_PRESENT,
cfdp::SegmentationControl segCtrl =
@ -23,7 +23,7 @@ class HeaderSerializer : public SerializeIF, public PduHeaderIF {
* data field length was not properly.
* @return
*/
size_t getSerializedSize() const override;
[[nodiscard]] size_t getSerializedSize() const override;
ReturnValue_t deSerialize(const uint8_t** buffer, size_t* size,
Endianness streamEndianness) override;
@ -32,19 +32,19 @@ class HeaderSerializer : public SerializeIF, public PduHeaderIF {
void setPduType(cfdp::PduType pduType);
void setSegmentMetadataFlag(cfdp::SegmentMetadataFlag);
size_t getPduDataFieldLen() const override;
size_t getWholePduSize() const override;
[[nodiscard]] size_t getPduDataFieldLen() const override;
[[nodiscard]] size_t getWholePduSize() const override;
cfdp::PduType getPduType() const override;
cfdp::Direction getDirection() const override;
cfdp::TransmissionModes getTransmissionMode() const override;
bool getCrcFlag() const override;
bool getLargeFileFlag() const override;
cfdp::SegmentationControl getSegmentationControl() const override;
cfdp::WidthInBytes getLenEntityIds() const override;
cfdp::WidthInBytes getLenSeqNum() const override;
cfdp::SegmentMetadataFlag getSegmentMetadataFlag() const override;
bool hasSegmentMetadataFlag() const override;
[[nodiscard]] cfdp::PduType getPduType() const override;
[[nodiscard]] cfdp::Direction getDirection() const override;
[[nodiscard]] cfdp::TransmissionMode getTransmissionMode() const override;
[[nodiscard]] bool getCrcFlag() const override;
[[nodiscard]] bool getLargeFileFlag() const override;
[[nodiscard]] cfdp::SegmentationControl getSegmentationControl() const override;
[[nodiscard]] cfdp::WidthInBytes getLenEntityIds() const override;
[[nodiscard]] cfdp::WidthInBytes getLenSeqNum() const override;
[[nodiscard]] cfdp::SegmentMetadataFlag getSegmentMetadataFlag() const override;
[[nodiscard]] bool hasSegmentMetadataFlag() const override;
void setSegmentationControl(cfdp::SegmentationControl);
void getSourceId(cfdp::EntityId& sourceId) const override;

View File

@ -1,128 +0,0 @@
#include "HeaderDeserializer.h"
#include <fsfw/serialize/SerializeAdapter.h>
#include <cstring>
HeaderDeserializer::HeaderDeserializer(const uint8_t *pduBuf, size_t maxSize)
: rawPtr(pduBuf), maxSize(maxSize) {}
ReturnValue_t HeaderDeserializer::parseData() {
if (maxSize < 7) {
return SerializeIF::STREAM_TOO_SHORT;
}
return setData(const_cast<uint8_t *>(rawPtr), maxSize);
}
ReturnValue_t HeaderDeserializer::setData(uint8_t *dataPtr, size_t maxSize, void *args) {
if (dataPtr == nullptr) {
// Allowed for now
this->fixedHeader = nullptr;
return returnvalue::OK;
}
this->fixedHeader = reinterpret_cast<PduHeaderFixedStruct *>(const_cast<uint8_t *>(dataPtr));
sourceIdRaw = static_cast<uint8_t *>(&fixedHeader->variableFieldsStart);
cfdp::WidthInBytes widthEntityIds = getLenEntityIds();
cfdp::WidthInBytes widthSeqNum = getLenSeqNum();
seqNumRaw = static_cast<uint8_t *>(sourceIdRaw) + static_cast<uint8_t>(widthEntityIds);
destIdRaw = static_cast<uint8_t *>(seqNumRaw) + static_cast<uint8_t>(widthSeqNum);
this->maxSize = maxSize;
return returnvalue::OK;
}
size_t HeaderDeserializer::getHeaderSize() const {
if (fixedHeader != nullptr) {
return getLenEntityIds() * 2 + getLenSeqNum() + 4;
}
return 0;
}
size_t HeaderDeserializer::getPduDataFieldLen() const {
uint16_t pduFiedlLen = (fixedHeader->pduDataFieldLenH << 8) | fixedHeader->pduDataFieldLenL;
return pduFiedlLen;
}
size_t HeaderDeserializer::getWholePduSize() const {
return getPduDataFieldLen() + getHeaderSize();
}
cfdp::PduType HeaderDeserializer::getPduType() const {
return static_cast<cfdp::PduType>((fixedHeader->firstByte >> 4) & 0x01);
}
cfdp::Direction HeaderDeserializer::getDirection() const {
return static_cast<cfdp::Direction>((fixedHeader->firstByte >> 3) & 0x01);
}
cfdp::TransmissionModes HeaderDeserializer::getTransmissionMode() const {
return static_cast<cfdp::TransmissionModes>((fixedHeader->firstByte >> 2) & 0x01);
}
bool HeaderDeserializer::getCrcFlag() const { return (fixedHeader->firstByte >> 1) & 0x01; }
bool HeaderDeserializer::getLargeFileFlag() const { return fixedHeader->firstByte & 0x01; }
cfdp::SegmentationControl HeaderDeserializer::getSegmentationControl() const {
return static_cast<cfdp::SegmentationControl>((fixedHeader->fourthByte >> 7) & 0x01);
}
cfdp::WidthInBytes HeaderDeserializer::getLenEntityIds() const {
return static_cast<cfdp::WidthInBytes>((fixedHeader->fourthByte >> 4) & 0x07);
}
cfdp::WidthInBytes HeaderDeserializer::getLenSeqNum() const {
return static_cast<cfdp::WidthInBytes>(fixedHeader->fourthByte & 0x07);
}
cfdp::SegmentMetadataFlag HeaderDeserializer::getSegmentMetadataFlag() const {
return static_cast<cfdp::SegmentMetadataFlag>((fixedHeader->fourthByte >> 3) & 0x01);
}
void HeaderDeserializer::getSourceId(cfdp::EntityId &sourceId) const {
assignVarLenField(dynamic_cast<cfdp::VarLenField *>(&sourceId), getLenEntityIds(),
this->sourceIdRaw);
}
void HeaderDeserializer::getDestId(cfdp::EntityId &destId) const {
assignVarLenField(dynamic_cast<cfdp::VarLenField *>(&destId), getLenEntityIds(), this->destIdRaw);
}
void HeaderDeserializer::getTransactionSeqNum(cfdp::TransactionSeqNum &seqNum) const {
assignVarLenField(dynamic_cast<cfdp::VarLenField *>(&seqNum), getLenSeqNum(), this->seqNumRaw);
}
void HeaderDeserializer::assignVarLenField(cfdp::VarLenField *field, cfdp::WidthInBytes width,
void *sourcePtr) const {
switch (width) {
case (cfdp::WidthInBytes::ONE_BYTE): {
uint8_t *fieldTyped = static_cast<uint8_t *>(sourcePtr);
field->setValue(width, *fieldTyped);
break;
}
case (cfdp::WidthInBytes::TWO_BYTES): {
uint16_t fieldTyped = 0;
size_t deserSize = 0;
SerializeAdapter::deSerialize(&fieldTyped, static_cast<uint8_t *>(sourcePtr), &deserSize,
SerializeIF::Endianness::NETWORK);
field->setValue(width, fieldTyped);
break;
}
case (cfdp::WidthInBytes::FOUR_BYTES): {
uint32_t fieldTyped = 0;
size_t deserSize = 0;
SerializeAdapter::deSerialize(&fieldTyped, static_cast<uint8_t *>(sourcePtr), &deserSize,
SerializeIF::Endianness::NETWORK);
field->setValue(width, fieldTyped);
break;
}
}
}
size_t HeaderDeserializer::getMaxSize() const { return maxSize; }
bool HeaderDeserializer::hasSegmentMetadataFlag() const {
if (this->getSegmentMetadataFlag() == cfdp::SegmentMetadataFlag::PRESENT) {
return true;
}
return false;
}

View File

@ -1,90 +0,0 @@
#ifndef FSFW_SRC_FSFW_CFDP_PDU_HEADERDESERIALIZER_H_
#define FSFW_SRC_FSFW_CFDP_PDU_HEADERDESERIALIZER_H_
#include <cstddef>
#include <cstdint>
#include "PduConfig.h"
#include "PduHeaderIF.h"
#include "fsfw/serialize/SerializeIF.h"
#include "fsfw/tmtcpacket/RedirectableDataPointerIF.h"
struct PduHeaderFixedStruct {
uint8_t firstByte;
uint8_t pduDataFieldLenH;
uint8_t pduDataFieldLenL;
uint8_t fourthByte;
uint8_t variableFieldsStart;
};
/**
* @brief This class is used to deserialize a PDU header from raw memory.
* @details
* This is a zero-copy implementation and #parseData needs to be called to ensure the data is
* valid.
*/
class HeaderDeserializer : public RedirectableDataPointerIF, public PduHeaderIF {
public:
/**
* Initialize a PDU header from raw data. This is a zero-copy implementation and #parseData
* needs to be called to ensure the data is valid
* @param pduBuf
* @param maxSize
*/
HeaderDeserializer(const uint8_t* pduBuf, size_t maxSize);
/**
* This needs to be called before accessing the PDU fields to avoid segmentation faults.
* @return
* - returnvalue::OK on parse success
* - returnvalue::FAILED Invalid raw data
* - SerializeIF::BUFFER_TOO_SHORT if buffer is shorter than expected
*/
virtual ReturnValue_t parseData();
size_t getHeaderSize() const;
size_t getPduDataFieldLen() const override;
size_t getWholePduSize() const override;
cfdp::PduType getPduType() const override;
cfdp::Direction getDirection() const override;
cfdp::TransmissionModes getTransmissionMode() const override;
bool getCrcFlag() const override;
bool getLargeFileFlag() const override;
cfdp::SegmentationControl getSegmentationControl() const override;
cfdp::WidthInBytes getLenEntityIds() const override;
cfdp::WidthInBytes getLenSeqNum() const override;
cfdp::SegmentMetadataFlag getSegmentMetadataFlag() const override;
bool hasSegmentMetadataFlag() const override;
void getSourceId(cfdp::EntityId& sourceId) const override;
void getDestId(cfdp::EntityId& destId) const override;
void getTransactionSeqNum(cfdp::TransactionSeqNum& seqNum) const override;
ReturnValue_t deserResult = returnvalue::OK;
/**
* Can also be used to reset the pointer to a nullptr, but the getter functions will not
* perform nullptr checks!
* @param dataPtr
* @param maxSize
* @param args
* @return
*/
ReturnValue_t setData(uint8_t* dataPtr, size_t maxSize, void* args = nullptr) override;
size_t getMaxSize() const;
protected:
PduHeaderFixedStruct* fixedHeader = nullptr;
const uint8_t* rawPtr = nullptr;
size_t maxSize = 0;
private:
void assignVarLenField(cfdp::VarLenField* field, cfdp::WidthInBytes width, void* sourcePtr) const;
void* sourceIdRaw = nullptr;
void* seqNumRaw = nullptr;
void* destIdRaw = nullptr;
};
#endif /* FSFW_SRC_FSFW_CFDP_PDU_HEADERDESERIALIZER_H_ */

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