Compare commits
1679 Commits
mueller/sp
...
develop
Author | SHA1 | Date | |
---|---|---|---|
42867ad0cb | |||
6381d9a83c | |||
73bf1cc229 | |||
222f02aefd | |||
e9b4fc9825 | |||
0660457c92 | |||
7c9b9e4cd8 | |||
3b0ee7ca31 | |||
fb2e480705 | |||
b8ae646060 | |||
f307a86d9a | |||
8b21dd276d | |||
e00da212cd | |||
a229748aa4 | |||
e6e3753324 | |||
94bd1ba2ab | |||
e12a8cfa29 | |||
efbcddc2e5 | |||
31d4b85523 | |||
aff6bb673b | |||
f8e3777c43 | |||
0e2fa8dc83 | |||
0cfe559b93 | |||
c5159fb645 | |||
203c0bac5c | |||
43ea29cb84 | |||
27c8a97d45 | |||
47b21caf5f | |||
2673070204 | |||
518a07d05b | |||
516357d855 | |||
ac28b7e00d | |||
0d4a862c1a | |||
b2576d3422 | |||
bccaf4a9ea | |||
7d4e77843b | |||
cd2cd61ba5 | |||
90f3f8ef1f | |||
9894935e99 | |||
a3a6c0720c | |||
d5a52eadbb | |||
b5e7179af1 | |||
5879eb7f7b | |||
e64e8b274d | |||
48bcce65b1 | |||
7105e199c6 | |||
94de483836 | |||
c648229c99 | |||
5b661551a8 | |||
3978524181 | |||
7187f2b5cd | |||
8e367abb47 | |||
b28174db24 | |||
c906acd659 | |||
8dfc84c0b5 | |||
74775bb59d | |||
c02d9e009e | |||
0021aa29f5 | |||
41d67bff63 | |||
8d7bb51d44 | |||
7673d8b396 | |||
91b194d8eb | |||
698897bfc5 | |||
d554062b86 | |||
bf7fac071c | |||
35be7da353 | |||
18cc870c8e | |||
133ca51d18 | |||
0a40391a75 | |||
cc3e64e70d | |||
6021257a87 | |||
63c238005e | |||
0f604b35c6 | |||
e3a815444e | |||
19093866ee | |||
497f947237 | |||
5bd020193b | |||
420c0625a5 | |||
42a0b15303 | |||
c199cbedaa | |||
c4e18cc2f3 | |||
c143198494 | |||
448fbd0d38 | |||
470f589bde | |||
dfcfb035be | |||
6e53582dc9 | |||
fb1500e041 | |||
ea2e58249d | |||
9ef63825f3 | |||
073cb4b3d5 | |||
8c11685240 | |||
cb1aaea6cd | |||
22df8f6147 | |||
60dcacf432 | |||
b39e1c7e07 | |||
036667a969 | |||
67c38f327e | |||
e1816ed230 | |||
5ff464252f | |||
cd8d64830c | |||
b7056a7467 | |||
0fc2c7b5e9 | |||
eae7c44874 | |||
e4aae75747 | |||
b094ba145f | |||
15629abf19 | |||
7aeb25e064 | |||
d246ce34d0 | |||
796c7a9e37 | |||
7c875f1067 | |||
e8451cac31 | |||
8ddd6eb18d | |||
6c6b552059 | |||
9a1437980f | |||
12e52a92f2 | |||
dffce43e6b | |||
daf75547a4 | |||
0cccf26021 | |||
c075f27e20 | |||
3167988951 | |||
a856f91c67 | |||
f49e607881 | |||
0f208ec75a | |||
5679b139ad | |||
947f2b8685 | |||
291c75c01f | |||
fde277cd06 | |||
bb186fc965 | |||
e8bf8b9575 | |||
8f5a8b13d3 | |||
314cba363f | |||
244e2d0737 | |||
8f0974d83e | |||
8581f9a6f3 | |||
844c90a625 | |||
437851db3e | |||
e8b9897ee3 | |||
33df8e8cc5 | |||
52fc0958f7 | |||
66704dc571 | |||
0943863ec6 | |||
2585028e75 | |||
7bf7336d4a | |||
b0b6c68720 | |||
a1f36a0dd8 | |||
e4665c9394 | |||
98cbf38432 | |||
5d3f00da7f | |||
69fd6d0f6a | |||
045054fce0 | |||
4c9e731113 | |||
e00e198ff1 | |||
9c8434d856 | |||
42c215ef70 | |||
273fd3ebfd | |||
6c9c4ee047 | |||
1bfb695b41 | |||
1561b9a247 | |||
896b7a7358 | |||
8e62143ac8 | |||
1d97327f79 | |||
5e9d402598 | |||
b53c48863f | |||
4dc6398fd5 | |||
8fcc4eab60 | |||
972dc7e19e | |||
06ef498a18 | |||
6322a31566 | |||
95b77ed826 | |||
3b1da85229 | |||
1cbcfc08ff | |||
d575da8540 | |||
ca27cef2ee | |||
62ace649a7 | |||
aac74fae38 | |||
a26b0c38ac | |||
f44110a7f5 | |||
35712070cf | |||
1b79713430 | |||
a6cc5171da | |||
9994c46e47 | |||
cf927ecee7 | |||
42e74d22cc | |||
36caa58043 | |||
988e07f0be | |||
88e8665280 | |||
9c8b1c697b | |||
110cb903a6 | |||
1b23aa4246 | |||
7d713219c5 | |||
1be09a2310 | |||
7add782470 | |||
8da89eba80 | |||
7e8845f2c2 | |||
6aff3250c2 | |||
c3572e31a8 | |||
2293e7f2bb | |||
a85a38c882 | |||
0f76cdb3ba | |||
268c2e87c9 | |||
87f94a252f | |||
c7037d417a | |||
f80c5980ea | |||
ad01642fee | |||
f2947bc78e | |||
0a977ea688 | |||
74b164b1da | |||
5322de0599 | |||
9a4bf51006 | |||
3a70229510 | |||
b3beedad9f | |||
efe217a197 | |||
b442ca09b9 | |||
9372b2a575 | |||
aafa53148e | |||
e0adb3325f | |||
4391823f01 | |||
1a77e6bb09 | |||
cae131edcf | |||
4518fec65c | |||
dac1aacab2 | |||
0042f92fdf | |||
656faf8169 | |||
f84431e965 | |||
0cec9ebb73 | |||
a440b7c394 | |||
bbfc1b2b34 | |||
025b379e8b | |||
258f0d3313 | |||
5eb9ee8bc1 | |||
7f61d17cee | |||
ffa2fa477f | |||
894d1e3b87 | |||
285d327b97 | |||
e97fa5ac84 | |||
5a9304765f | |||
6650c293da | |||
9fca7581dd | |||
4af90f99f3 | |||
94cdf67a80 | |||
7966ede11b | |||
7a392dc33a | |||
1e3c89b672 | |||
e2e87b149d | |||
4f632e2c68 | |||
314f0fa2cd | |||
b31e1037fb | |||
b814e7198f | |||
6328b70d7b | |||
a937b457f9 | |||
4415dc24e1 | |||
e704295cce | |||
d16b3c7e67 | |||
3b86545725 | |||
cf6150cc18 | |||
bfb5c2ff03 | |||
bf02061d47 | |||
2c4e110254 | |||
7ed75ea87b | |||
db4587bb59 | |||
33ac395072 | |||
f8a7c1d4ed | |||
341437df13 | |||
227524a21d | |||
0f81d5e458 | |||
b50f092939 | |||
2f90e12179 | |||
8b77fac099 | |||
47503824d7 | |||
5e3f5c4121 | |||
1f36c082ef | |||
aa84e93603 | |||
8f63a0e747 | |||
6fc8f756a7 | |||
d98ed40e3d | |||
b057250bfb | |||
066dd0d397 | |||
f735c2e9d4 | |||
43fd0b2f59 | |||
d0607824ad | |||
cf27954a86 | |||
f84e3284ab | |||
5250423d1d | |||
522bd41d6e | |||
c61c85280b | |||
afbe5e1f65 | |||
4c88ab80c8 | |||
5ba69b169f | |||
40405fe6c7 | |||
aac32e763c | |||
bf980d74c0 | |||
b6b9d1d790 | |||
0973ba6bf2 | |||
1cfebb5d47 | |||
0b0a0299bc | |||
8382d61b92 | |||
7208343b6d | |||
9a8d775eb1 | |||
4d6f6e6b23 | |||
55f6825a03 | |||
c162acb7df | |||
87462afe6d | |||
a8de395ea0 | |||
f0bddfcb21 | |||
23d9b44b3e | |||
26e4445189 | |||
9ee3cdf729 | |||
1b7493f945 | |||
7f6ba5f40b | |||
070b48ada2 | |||
d9a139e1ef | |||
c80a3752d9 | |||
af58c414fc | |||
4c48668125 | |||
2745b2080d | |||
e9d9f44605 | |||
2c5af91db1 | |||
5cd7b98ba7 | |||
a39f1271ec | |||
bbf0d7a0d2 | |||
04ee3c7362 | |||
95dab69b35 | |||
33de15205b | |||
4d353a1ad2 | |||
6006c97e48 | |||
6e17e45506 | |||
64537d442a | |||
78cf00315d | |||
245886c555 | |||
f84097543e | |||
511d07c0c7 | |||
cf735143fe | |||
bdfe31dba4 | |||
216f603d62 | |||
174a6aa862 | |||
c2d9370aa1 | |||
893b434728 | |||
6eba84566d | |||
f0415a97b1 | |||
abcf1b29b2 | |||
dc7afc5415 | |||
9bf3ff95b7 | |||
61562b18ab | |||
d76d97a36b | |||
d373c45d36 | |||
bd208038dd | |||
206af00c8b | |||
2efff4d2c5 | |||
2a0c244468 | |||
e1711f0345 | |||
c327985222 | |||
76b377c4c0 | |||
b45206ccd6 | |||
c8469ca647 | |||
2d6622b8b8 | |||
5f9eb01d94 | |||
3568bdbecf | |||
fcd84b59ae | |||
e3c968096b | |||
c745c0c8b4 | |||
be015b4c66 | |||
dae5e988fd | |||
a6d707a7db | |||
fe41d73895 | |||
70b785984c | |||
9de6c4b3aa | |||
d256ede8c1 | |||
f0b8457ba2 | |||
dac2d210b5 | |||
8b4f73a97b | |||
7fae6cbd6d | |||
d302ba7185 | |||
3562bf11b9 | |||
fffb2b61e5 | |||
94e5f62331 | |||
14a92b3d89 | |||
e4fd424d66 | |||
341a66c265 | |||
b9b076aa4c | |||
d93486a340 | |||
820a7f059c | |||
f4d188c36f | |||
1841f92944 | |||
b279985859 | |||
0a9c563bbc | |||
fa7675897d | |||
3a2393885f | |||
c752b6d143 | |||
b676040c7c | |||
010509efb4 | |||
dfb1633f00 | |||
5f7172e130 | |||
0c6465cd95 | |||
f94987c46d | |||
1809ce359b | |||
8c712441ab | |||
6ce80ea6c5 | |||
f1b0ca7cff | |||
000df85556 | |||
1fffcc2229 | |||
6f05d6b7b0 | |||
7f907fb9d3 | |||
a419806a05 | |||
84bbef0167 | |||
88b2b0e005 | |||
6445debfa1 | |||
8014e4adf9 | |||
84dc7ac0ce | |||
ec12ab5daa | |||
134d908f26 | |||
40a9e12416 | |||
f39054edd4 | |||
5adf89b911 | |||
c2e6a22dec | |||
c8e065a713 | |||
69c94645df | |||
37e850c5a7 | |||
3ed49dbae3 | |||
a1567de9e8 | |||
4cf52d5dfe | |||
2646707d3f | |||
539d7aac9e | |||
0a23f2c85a | |||
06e30684fe | |||
46230e6c6d | |||
b22d439300 | |||
7e7b3bbbc9 | |||
06dca7608a | |||
6af5274b68 | |||
5b92247fbd | |||
e2b66df72e | |||
d9da55fdab | |||
7b828f233a | |||
c3d1000cd5 | |||
8e0e57714d | |||
066f7a6f9b | |||
cc9e54ea6b | |||
31465a4e0f | |||
c0e5d1eb99 | |||
3bc5d4a2e0 | |||
b1e9dd9e4a | |||
ab86599db3 | |||
034eb34c2e | |||
38789e053b | |||
4374c7c4f4 | |||
5343844be5 | |||
e11eabdbcf | |||
3250bbf269 | |||
a78fe0a7f3 | |||
acfc1cbf21 | |||
d17ec02cf0 | |||
e300490b93 | |||
f2461cd7e9 | |||
01cc619e67 | |||
0f811777a7 | |||
e93137939e | |||
2339712373 | |||
c1f42618db | |||
d9d253d3bb | |||
bd586f6564 | |||
1f88c006d9 | |||
5f481739d8 | |||
7e94baceef | |||
7ee83e4e5d | |||
64787f85ca | |||
61df451dd8 | |||
29ea89044e | |||
e487f5be87 | |||
1cacceddad | |||
5c35b8e3cd | |||
9b05e8f274 | |||
7766b24a1d | |||
eb223dae88 | |||
3656662d88 | |||
fe71978467 | |||
b646717a76 | |||
99d8c845f2 | |||
9a4ae550ab | |||
c64b9b3e71 | |||
226818886f | |||
da12495335 | |||
0cc3231ceb | |||
049e3b431d | |||
bd189518b6 | |||
0e7c6b117f | |||
accaf855ee | |||
75fa7caf25 | |||
d16c5024dc | |||
a4531e4ced | |||
97c629ad84 | |||
bf12f284fa | |||
ba62c28b64 | |||
041d1b8795 | |||
7adb47aecb | |||
5bb66c9723 | |||
8589f4d63a | |||
ca80589233 | |||
f2ebaed092 | |||
f0b89e98df | |||
2aa4af6974 | |||
75fc7a056d | |||
05cad893a2 | |||
5557d95994 | |||
fc24c9b5d8 | |||
1b005d706a | |||
5b0ea91222 | |||
7ef69c839c | |||
9b798d798e | |||
e68f54b9bd | |||
8eb869e073 | |||
b13453f46b | |||
d0e322d7e2 | |||
46a1c2bace | |||
2643ff194c | |||
ecde164f68 | |||
50930b41ba | |||
296bc56e2a | |||
d6ee2ed400 | |||
f2150ff9c2 | |||
1b9c98f3fe | |||
742152b28e | |||
bf4ca56658 | |||
16ffa00155 | |||
14c681c93a | |||
0958c3a00e | |||
d699d16307 | |||
3b0fed733f | |||
23d3812fe3 | |||
dec7db3ae2 | |||
65a5abab49 | |||
0129783e34 | |||
cabe0868ec | |||
f05295bada | |||
160ff799ac | |||
b85ca64690 | |||
3bc3da5a8d | |||
f8c07ec9cf | |||
8199b8f359 | |||
cbc8dbcdd4 | |||
d31a5306f0 | |||
a236a5ec50 | |||
03620970e2 | |||
8fe8d810e9 | |||
9483c2809d | |||
fe3d6bd432 | |||
c5f91926c9 | |||
be4a87535d | |||
99927b8e95 | |||
5e5eb82830 | |||
686dc97234 | |||
2a842666d5 | |||
c013fcc1f5 | |||
1f58ba1f9b | |||
002845108d | |||
1b8fc2af19 | |||
72d7c43445 | |||
ab9b6c8c89 | |||
69d338f9bb | |||
68223869d5 | |||
93fda71989 | |||
7b0db08962 | |||
0956fbc740 | |||
b48e0fdc0d | |||
1d084ee22f | |||
1bea2344f6 | |||
d7e16a67a7 | |||
6021d897b8 | |||
83a6f0b5f8 | |||
a9c6c088f2 | |||
2b6a33e718 | |||
61fd5d1b62 | |||
046dbe1deb | |||
e03e7f5260 | |||
b6a3c206cc | |||
5b352978c5 | |||
0303c1a885 | |||
4d2802a470 | |||
819a298b19 | |||
39946bff58 | |||
16246d6ece | |||
5c84f12440 | |||
2a203ae13d | |||
6ca1a5c796 | |||
83c2c4825c | |||
194b3e100a | |||
177c39dd53 | |||
530a261e14 | |||
c913fe40bf | |||
70ec08bf1d | |||
ef23665d9c | |||
eefc122292 | |||
bee33526a1 | |||
0e8f5ddd26 | |||
672fca5169 | |||
84b9d1ce21 | |||
e5b5c7d253 | |||
9a0cc64be3 | |||
00f1c5bbe9 | |||
8a61af779d | |||
6efa482eb0 | |||
f0fa1bf477 | |||
91ebf98c28 | |||
e1d4209fbe | |||
e302c89f74 | |||
a38279f813 | |||
7600ed1ea7 | |||
61ab770d9d | |||
033676ad3b | |||
e2eeccce50 | |||
f805667779 | |||
af06969905 | |||
2461209169 | |||
f715b65d6e | |||
c11af63015 | |||
852f27cec2 | |||
226dc4d8b7 | |||
fa01798ebb | |||
1b7e94d718 | |||
60ff411721 | |||
bddc7a7ca6 | |||
819a2bfac4 | |||
1f05e6b297 | |||
11a22577be | |||
dc1583c932 | |||
94f1f1f908 | |||
81a7de2814 | |||
d26f230bee | |||
4db124c680 | |||
955579c856 | |||
2df66c9304 | |||
54ad6b3016 | |||
73e313c35b | |||
c6585c8645 | |||
dd2f42d22b | |||
d8a4675842 | |||
b0c5a49b50 | |||
1164c21ddd | |||
096af44e39 | |||
56e8e5a8b3 | |||
11422a658c | |||
754b71a35f | |||
2de9e25ceb | |||
ec7566fb8c | |||
73454c629c | |||
77b1a85b47 | |||
0c5c2f6c4f | |||
009700ce80 | |||
652c31a683 | |||
1e43296f2b | |||
1aa062df7f | |||
bfe120636c | |||
a8041f220f | |||
dd636b186b | |||
3349fc36f8 | |||
14a8924a83 | |||
9f81926aec | |||
79c38b45df | |||
e893e73f86 | |||
f3e9277e59 | |||
d592f1ecbc | |||
6ec18171a8 | |||
518dcdef4b | |||
d9730032fd | |||
b3ac72b7db | |||
cd0cb43412 | |||
32c12b3dbf | |||
3e9acf476e | |||
99101ce2bf | |||
6b991045f7 | |||
df06064df0 | |||
1d6ccfe5ab | |||
221df7ece6 | |||
7f180ac1fa | |||
337cb0d6c9 | |||
692be9df8d | |||
8195587604 | |||
40e7b2dc31 | |||
1c53b60442 | |||
d1630cdc4c | |||
49747fc8a4 | |||
cfc00d0260 | |||
c283e0c988 | |||
448d20f3bd | |||
2316728d74 | |||
6f562e5f3e | |||
1eceef4645 | |||
176f243194 | |||
d964fa2107 | |||
7b5ae6a445 | |||
8e362a000c | |||
7877776e24 | |||
acab5f6bce | |||
10dd855244 | |||
f824004897 | |||
7c5308429c | |||
f78344b8fb | |||
3de0ae5a48 | |||
b9d0ff8fb7 | |||
77f7fa2ef1 | |||
78314ad966 | |||
227535c461 | |||
c47bed0760 | |||
9927dbb2e4 | |||
e0c780f21c | |||
876815b1c9 | |||
b0ecf87580 | |||
68ce8b5b08 | |||
14a48fe41d | |||
c932e51818 | |||
2ca8d72e83 | |||
03e1a93250 | |||
6d2f44a432 | |||
fe03da6def | |||
95ac53c417 | |||
62f638a3d2 | |||
bd64591f30 | |||
e6a877f048 | |||
ea8c557ee8 | |||
0bdd780f82 | |||
9ec397c8b7 | |||
c54d9d7ba6 | |||
30c03c110c | |||
69f1be263a | |||
c7b5309dcb | |||
775d5632de | |||
4f3361eb2b | |||
9e6c1d60e5 | |||
12d0c23c13 | |||
5c3bb13834 | |||
292fe3e5e4 | |||
33530f2819 | |||
c0000a8635 | |||
5488ee715f | |||
0fea22d031 | |||
3b8ca09299 | |||
9a2146fa2d | |||
808e3e0462 | |||
558550ecb9 | |||
79ab0c4aa5 | |||
72172a972b | |||
b4b11ebd3b | |||
c5b24f2516 | |||
bdbe0cc9da | |||
e2c1158337 | |||
95aac7dc8d | |||
3d2fc28468 | |||
1898b4f2db | |||
c38088c64b | |||
7eb63d6d79 | |||
6f8ccf83e7 | |||
67f1cd0b5f | |||
1d54507517 | |||
ef9ed95fd1 | |||
ed68268c0c | |||
c549914efb | |||
753d5ff39e | |||
36ca35da77 | |||
54762232a4 | |||
4fb7375492 | |||
2fee2fdff5 | |||
47df9e8b5b | |||
954c749de0 | |||
bcbbc9763a | |||
0042372cb6 | |||
8dea13742f | |||
0f027d29d2 | |||
131e3ff1e3 | |||
423a9540ed | |||
7e0a5d5a9e | |||
ce7146e468 | |||
a681a4a797 | |||
ee1c6a3f04 | |||
86aafe4422 | |||
e585c1d84a | |||
83b7b8707c | |||
4002b74ea2 | |||
4f7f8310c9 | |||
1a833e2d45 | |||
8df6d934d7 | |||
5363868120 | |||
36cf59cc8e | |||
97fec909f2 | |||
1db77753e3 | |||
8501477a78 | |||
6eea711d9f | |||
9a181aa6a8 | |||
655c944c0e | |||
2e310fca8d | |||
37390dfc74 | |||
75ddfdc65d | |||
1efc0d2855 | |||
e063b44899 | |||
b3c0e24611 | |||
ab7c3480f5 | |||
237e29cc59 | |||
0849c8a08d | |||
9d626e0a5d | |||
723f8749d4 | |||
dbaeed83af | |||
2e27a85c95 | |||
385a0ffd73 | |||
73f1917c81 | |||
3a52454949 | |||
ac7dc55fc1 | |||
389d804735 | |||
44615c150b | |||
bd594123a2 | |||
0ce568ad26 | |||
6970068d56 | |||
af282c7d3e | |||
21a9d89fb3 | |||
3257935150 | |||
f34cf9095d | |||
24ecf125a3 | |||
6451a16888 | |||
4dadef34fd | |||
382543fc59 | |||
fa5605c959 | |||
a1ea671e2f | |||
8e835be55f | |||
9bd600c488 | |||
9c7248e78e | |||
ecf51b2913 | |||
8bbde05413 | |||
d79b5348d8 | |||
92e3ab04f3 | |||
003a6d00fa | |||
26b3e5a013 | |||
3e9b47d3a2 | |||
9ee1896553 | |||
a5b5523111 | |||
62cd39e573 | |||
278ed36db8 | |||
aed30d54ef | |||
1126db2c8a | |||
a64a04d7fe | |||
80467bf097 | |||
6a6aa7fdd6 | |||
7e379d2159 | |||
6ae709acc3 | |||
34dd478848 | |||
b73754dfd6 | |||
ec1e07b466 | |||
d52f335455 | |||
c87667c03f | |||
683cf8a047 | |||
11a4b27642 | |||
770463e618 | |||
04b619a15c | |||
282704e0fd | |||
8971eb386e | |||
c54caf134a | |||
aebd401d5b | |||
67439b4285 | |||
07ef9a0ec3 | |||
af851165b4 | |||
94c9800fae | |||
ba046cebd9 | |||
428da017ba | |||
806ae9b41a | |||
7b97c8a182 | |||
2e4cdb7366 | |||
5a3f05fa79 | |||
80464f2a81 | |||
16688316a8 | |||
ead22c8bd6 | |||
3583e30ee6 | |||
61db018a74 | |||
1e395dc402 | |||
afc48726b9 | |||
ece5ae59e4 | |||
a5d1c38b22 | |||
f5421e9abd | |||
4c3f9feb93 | |||
b7ed8ff390 | |||
75dc7a405d | |||
b7a1f79d5b | |||
f0b7a103d4 | |||
fb96250e36 | |||
ee93f4a4ca | |||
d64ad71529 | |||
5ce1e76723 | |||
26bc80964e | |||
eb03bf52a6 | |||
52802f127b | |||
d2c4d546c3 | |||
0dd2b5ddd4 | |||
3dfc882226 | |||
b984128de5 | |||
134d5a1411 | |||
3147f67fbd | |||
108e7737e2 | |||
c90d1c8071 | |||
eae75b29e7 | |||
dc79b7ba00 | |||
db84dcd3ce | |||
80355910ee | |||
04800df31e | |||
1e85cdadfd | |||
ebc02673dd | |||
935f35a40d | |||
348af0124b | |||
9202c6c17f | |||
5f8c549993 | |||
04bff7a522 | |||
5c20cc804e | |||
eb8e236cd4 | |||
7dec45ccf2 | |||
2b01e86f9c | |||
60fd3d43c0 | |||
67980cb592 | |||
3010f2f925 | |||
01651f0521 | |||
cf8fe7ea72 | |||
c7f300671f | |||
7d3223d766 | |||
7ae82a5cb4 | |||
28ecd0e5c6 | |||
496dac89e4 | |||
7345c18b04 | |||
cfca27542a | |||
0de7b66218 | |||
2fa76d3663 | |||
158007fa7f | |||
726f44cafe | |||
ab719a3e59 | |||
141dcb1f14 | |||
6ebd6a965b | |||
20f0707813 | |||
8d1777fa0c | |||
21ac86619e | |||
eedf57624f | |||
64a7fde301 | |||
ae40543e3a | |||
9131ca688b | |||
efd2994dc5 | |||
3ebebbd493 | |||
a8c066dccc | |||
4d17f1c4bb | |||
d4ed528426 | |||
e10e71cee9 | |||
d675a789a2 | |||
6b8c83be29 | |||
093052604a | |||
192255df1c | |||
bdd79d060d | |||
8e6cee7761 | |||
c756297e5c | |||
3a47062f2a | |||
0f27c7e7e7 | |||
20d42add03 | |||
a9277622ce | |||
80e8511a43 | |||
4a06f11582 | |||
32c53b932d | |||
aea9db75cb | |||
9fedd03ed8 | |||
10fc4dd89d | |||
0cc8af5eb0 | |||
92d65aa3a5 | |||
342a56410c | |||
2cab73d972 | |||
9a9085b9e6 | |||
cb23911ccd | |||
b499dedd76 | |||
1bb487373d | |||
3bffb4f968 | |||
6bcb208968 | |||
6c2b5ab39e | |||
a7039bad41 | |||
6605ffb6b1 | |||
e2e0190cae | |||
fd278e410b | |||
9a590a3fcd | |||
2a75440b32 | |||
ff4cbea571 | |||
81a7c21cd1 | |||
f5866ddace | |||
f91ad84bdc | |||
267466be9d | |||
2c730c8632 | |||
eb29b79467 | |||
26ea6606bf | |||
b1bd631322 | |||
9441b4a70e | |||
95457b1760 | |||
a46d8c34d9 | |||
d12c59c8ac | |||
9e5dddf79c | |||
ba5c6410d6 | |||
52f8c5038b | |||
10f34e5a48 | |||
dab1b1d067 | |||
8c8d1cfa84 | |||
2a4ab0af7b | |||
7c59df3f1c | |||
3b33b429e6 | |||
ff6de8e378 | |||
7881f5bab8 | |||
11a699c3ce | |||
6930656d4e | |||
0bb82e0da2 | |||
12c452e7ce | |||
23f514039a | |||
34c714eb17 | |||
7205885357 | |||
42c5881c50 | |||
cdd0ca70ed | |||
e3648b6e30 | |||
2e52d7a31d | |||
239d053562 | |||
875174c4ad | |||
8fd8a37f59 | |||
d815f422c3 | |||
217276d50c | |||
d2ac3603a5 | |||
f63f3fa564 | |||
d975958120 | |||
fc34d56239 | |||
1037102349 | |||
221361eb9c | |||
7f9269b387 | |||
4224c3d009 | |||
62fe75ee40 | |||
c57e95c698 | |||
e76e109bdb | |||
9e064fe800 | |||
2339c48756 | |||
d7ec04bf4b | |||
4d82d0e4c1 | |||
adcc375f25 | |||
94a718ff19 | |||
4a10f76784 | |||
57ce5d1f34 | |||
90963b3940 | |||
71ed95b09a | |||
7ac4f1c64d | |||
9d64b96e9a | |||
5de2c6af66 | |||
ca2efb6021 | |||
3b000d924a | |||
deeeef553b | |||
0e7ec79af9 | |||
007f958a0b | |||
d022ce82c5 | |||
d3cabd8984 | |||
8efe85cb15 | |||
b28091e05b | |||
f4c4f9946c | |||
7f89022f5b | |||
b28c26b288 | |||
8b4253bc46 | |||
fdcfd89ed2 | |||
03fa77e2b3 | |||
8970a7379a | |||
c12492df03 | |||
8aaabc5d73 | |||
e796e025b6 | |||
20eee2c469 | |||
aca8b53a59 | |||
3df1161560 | |||
ea6e5d9971 | |||
46a4203d00 | |||
c86adf8e10 | |||
a2e0646ed4 | |||
28c8248f26 | |||
3e1fd15613 | |||
e45a99143c | |||
96dfe46e25 | |||
507c6ddff1 | |||
0cb15e901e | |||
d45108e3c2 | |||
8c059f8f32 | |||
5bea92d2a4 | |||
bba2d883b6 | |||
7a20412305 | |||
dce1ebcf65 | |||
4ee01e395b | |||
7f9401cf63 | |||
dba3f9960e | |||
eccb629ba8 | |||
7fb906a0ac | |||
9796abfc7d | |||
0d26a0f54b | |||
192956c2c7 | |||
22e1555f50 | |||
bddf5bded1 | |||
1c0b778848 | |||
c832bffdb0 | |||
2f8020baac | |||
06bea2f621 | |||
4f1fe39182 | |||
904abfba28 | |||
202d9341d8 | |||
37c60d1dd0 | |||
43fb6ef5cb | |||
65a47c7c57 | |||
fdb0cc0e44 | |||
e6957de166 | |||
cc56b00df3 | |||
269a3052ca | |||
c6a7a0fec8 | |||
acf5c2a56d | |||
7fb9e14555 | |||
b20e8a9679 | |||
29bcaee196 | |||
cc98512caf | |||
60ea9a9a7c | |||
df690b9628 | |||
b0c479cab9 | |||
a426aef7c7 | |||
43048c852a | |||
19817bd3a5 | |||
1db04cf20c | |||
902a4bfa9c | |||
52ee50ba8c | |||
bf540ebb49 | |||
aa978205d8 | |||
4334106ad1 | |||
458fe460eb | |||
83d71548ec | |||
f4beef8c9f | |||
c7b4dc349a | |||
96f092ef75 | |||
f75379fceb | |||
4a4d23573d | |||
cd4d92b12c | |||
47e148af8f | |||
c9bec03f00 | |||
6c5c59cad8 | |||
03e12a2388 | |||
6c5bbfa080 | |||
da106fd96f | |||
fc3412fa35 | |||
8f6f0e1d45 | |||
1b5fa2a8fa | |||
cb118176a0 | |||
30ba9ab916 | |||
fb4ba487b5 | |||
72bc5d4d60 | |||
5355e63711 | |||
b11cdf6184 | |||
dc31358d52 | |||
b485afea57 | |||
5bb7023ff3 | |||
85dbef20b0 | |||
93acac02f5 | |||
7e8afcc12f | |||
f03b7cd660 | |||
d641d63531 | |||
4e571e5082 | |||
356d778743 | |||
0a38d2e22d | |||
234ccdf764 | |||
f591b9793c | |||
c5ad9b5fa9 | |||
083d08ae2a | |||
740644f2c8 | |||
059fb10558 | |||
86692e202d | |||
064b195c75 | |||
18ee2ab903 | |||
9eb652e585 | |||
e7d9979078 | |||
681738dcc6 | |||
152c01b2ec | |||
8bf0fb9885 | |||
1954ce0ea4 | |||
d98b79cf5e | |||
f14c812aff | |||
146a0e3828 | |||
75c824ec80 | |||
332e9dbfd5 | |||
f1c37203a4 | |||
500a5602bd | |||
4ed028000d | |||
88ebb67c8d | |||
b827bd8370 | |||
bdf71d4e66 | |||
e48b6f1432 | |||
747243684d | |||
db33f9cc7e | |||
c12669fe50 | |||
6d00fc65c0 | |||
7d87274844 | |||
c83f75c515 | |||
586993c081 | |||
a88f767cca | |||
935e135f1c | |||
6d0fa36f8a | |||
8f07133e2c | |||
f11433e50f | |||
5fd5d488ff | |||
edc5a314b8 | |||
f80be9e9fa | |||
f3af88ae40 | |||
380f1d0206 | |||
54fc35eae7 | |||
05d4162f5b | |||
e030878023 | |||
9ee6da47e9 | |||
1a7d7b172b | |||
36e3956efb | |||
180210dc38 | |||
ca1e921b94 | |||
2a34c831b1 | |||
e2ad37e3e6 | |||
973d4ee8a5 | |||
899d021e00 | |||
4989bd0f02 | |||
832367fb30 | |||
63ee88af17 | |||
4921527022 | |||
f0c8fd2688 | |||
c96e304b68 | |||
d474c4a7ee | |||
3708df2423 | |||
f629d60aaf | |||
b809f90e72 | |||
f2bf4b463e | |||
b66fd63cb4 | |||
fd55de9e95 | |||
8e05fc0417 | |||
55a238d553 | |||
9ccd9fd775 | |||
ddad97033d | |||
99aaf7068d | |||
c9d37e8d62 | |||
42a1d6cccd | |||
133894f4ba | |||
cb05329dd9 | |||
b350018cad | |||
2dfbce6174 | |||
cecaec6007 | |||
f28b9ea61b | |||
9275ccb79b | |||
67776241de | |||
bfee4fd90a | |||
0dfaba81f9 | |||
affde6bad5 | |||
0981ee6f7e | |||
61bc867bed | |||
5af3138e81 | |||
08e0b0f1a0 | |||
23f264096c | |||
e5ee96259d | |||
9bbe1dc716 | |||
d8b6cb39ac | |||
be35bd53a6 | |||
9860061fc6 | |||
d80941514f | |||
6c636661b6 | |||
5fffbd4a90 | |||
95b476d4bd | |||
3d2af203f2 | |||
74794bb71b | |||
ddf38b65c3 | |||
490a80e49f | |||
6f751c2cf9 | |||
9a2e68b37e | |||
91067cde98 | |||
428018e4f1 | |||
e4d7182d93 | |||
8b6dd3f868 | |||
f6ede7cd3e | |||
4da18172b3 | |||
6e5239e9a0 | |||
7e2fdc06cd | |||
3c72a42ce1 | |||
78b09ed0c9 | |||
fdf35232ee | |||
8465670374 | |||
0c5f623780 | |||
d7a2eada94 | |||
546e173cef | |||
0a7f2c6646 | |||
3b23fb77b4 | |||
6f7be281ef | |||
3686bbc486 | |||
ecac08814e | |||
e8b8fff0b5 | |||
4d34f93cfc | |||
adbf375f38 | |||
2e42f53682 | |||
c519b70302 | |||
45ee307bc4 | |||
8a2068aca6 | |||
aa60484111 | |||
e99c7f3824 | |||
2ee3ef1f1d | |||
ce48827ee5 | |||
0d80fad685 | |||
c6253bf0dd | |||
93933dee02 | |||
0e49640306 | |||
32fea9838e | |||
0519083894 | |||
904ae2cc0e | |||
4a2012ac30 | |||
6a62cf7f1e | |||
14bac9a418 | |||
3bef73708f | |||
fef6ddceff | |||
c5eb09314f | |||
682abd1b5b | |||
a4247cd723 | |||
5a9db72814 | |||
5cccd5caba | |||
7de56f189b | |||
df97bbc691 | |||
2d2f65bf89 | |||
3e9ae62b28 | |||
2ebefdffae | |||
45792e86b9 | |||
39881e7671 | |||
541f563683 | |||
5abbf42e9f | |||
28ea71a077 | |||
a044d7d724 | |||
687700cee8 | |||
732b615cb3 | |||
394ce2ec3e | |||
dde96ae220 | |||
c3aaab4b93 | |||
edf1d5ae8d | |||
690991b4b5 | |||
1a294e6a13 | |||
8c4e34153b | |||
b60e4bcb90 | |||
b18410aa63 | |||
7f57a8784a | |||
4b33aa8262 | |||
|
1910a7838c | ||
|
ba3a99466a | ||
d47a908117 | |||
fce95e04a8 | |||
438efe074e | |||
1759700b6a | |||
c7618294ac | |||
af890c6218 | |||
7f3e5e42bb | |||
fc742e4270 | |||
b5183a19fc | |||
ca453a8f16 | |||
b7c0c07141 | |||
0158102f11 | |||
69859fdbc9 | |||
90bccc744e | |||
ab89108c55 | |||
a682bbe400 | |||
e67fc2ab0d | |||
71ce966531 | |||
6b0f4a159f | |||
4a06b558c1 | |||
6d921f03fd | |||
65bc8213fe | |||
a0ee86ace8 | |||
a07a368272 | |||
cb8a4bbbec | |||
17f54006b8 | |||
395cf9cfa7 | |||
a3c0b441ec | |||
b4132800ae | |||
ad53b48fcb | |||
dee40f9079 | |||
92ec24352f | |||
3f9e459f48 | |||
e0c7f8d51d | |||
eb79386c92 | |||
4542f31c40 | |||
689fb378d8 | |||
98b711a872 | |||
800aa131fa | |||
6983980304 | |||
7c0ba59993 | |||
28873fc87b | |||
24e849ed9c | |||
d8985c141e | |||
7602b15256 | |||
d1a82bceed | |||
7292b02907 | |||
347714d53a | |||
f230fa1617 | |||
93615b100c | |||
e18d3d559e | |||
08ff061d07 | |||
cc351c1066 | |||
664a548c53 | |||
e9895559a3 | |||
eda5b8f593 | |||
e03f55604a | |||
51d7df2dba | |||
12046a2db6 | |||
21eb386f3c | |||
ade36e65c6 | |||
103661facc | |||
ae2f7219fd | |||
4fba2704aa | |||
161dbde0d7 | |||
2fa4fd61d0 | |||
bf673c56c6 | |||
cda81fc841 | |||
c697d0f8ab | |||
5a69c1f8b9 | |||
1d1d91f591 | |||
043b8b5b3f | |||
|
95a64e1da3 | ||
|
ab68817e9a | ||
|
36652e6fce | ||
|
3749f31ab4 | ||
ebbe08639c | |||
d286fc1855 | |||
cf35cca923 | |||
2058817ba5 | |||
c328891030 | |||
76a459a02c | |||
fbec1b3dc9 | |||
c4fa7281ae | |||
ac62443f31 | |||
8cfe848dfe | |||
c7cf8e710d | |||
af7c6c57a3 | |||
c835525196 | |||
7dddcdfd55 | |||
261eea381e | |||
24069dfd78 | |||
40cc557978 | |||
e59f1f26bf | |||
f7cde80088 | |||
e60a665de4 | |||
34658ef7db | |||
4b128d2435 | |||
f35b0ffbbd | |||
940fd6f465 | |||
f288d5120d | |||
5a425a1c58 | |||
5e62258aa6 | |||
b8b7756a3e | |||
4cc108f3a1 | |||
c0292f072e | |||
336ad9b7be | |||
942bfafaa3 | |||
0b53b4873f | |||
8e2597f609 | |||
dac700b80a | |||
d0fc360697 | |||
3a16290707 | |||
08f1ebf9fc | |||
64e7d4bb5e | |||
1886da0d3f | |||
b47eb0a7ff | |||
b1e30ae9ff | |||
86ca4f246b | |||
e87b5a0207 | |||
d504589c3c | |||
7b3de87364 | |||
576414438c | |||
13cda86d23 | |||
e758f0be2e | |||
18b342e94b | |||
f9c42d3583 | |||
d267a3651b | |||
e8023886f6 | |||
14a1b4a7ac | |||
e49de9422a | |||
e1dd27b9dd | |||
0ea044c203 | |||
8e9d4b451c | |||
4b323053ec | |||
d871f55a89 | |||
816550b69c | |||
7fee852dbd | |||
1e7032f89c | |||
f0debecbbc | |||
ef9d7aa7d3 | |||
b8fd2db434 | |||
878e32cbe8 | |||
4821706561 | |||
|
1611a4e1f0 | ||
55ed7ab93e | |||
bcd19045cc | |||
dba08fed7a | |||
7df1922633 | |||
eed6a64597 | |||
4841d5d92d | |||
5736023ffa | |||
ac78a79ca2 | |||
bf7388c059 | |||
8a12a5097e | |||
87e4a57ef7 | |||
0375ee1881 | |||
c8e034d975 | |||
e98aa005cb | |||
52310f7d32 | |||
e3d1308205 | |||
970f039e85 | |||
99c72fd00b | |||
2708b71d77 | |||
5a4539def4 | |||
13a34cd677 | |||
811287aac8 | |||
23fb06578b | |||
c86e99e6dc | |||
4092de911c | |||
00952e15b0 | |||
6366283ce2 | |||
01ebf0f4d3 | |||
99fe6487c8 | |||
d4a6f987bc | |||
57bac4f262 | |||
cfa6843c8f | |||
b6b3221b22 | |||
8dc640c162 | |||
deee4c43c0 | |||
ad0b6f1ed1 | |||
ec03a674bd | |||
9e3d5b6a0c | |||
994c7299b9 | |||
57a830cb46 | |||
ff40a71582 | |||
271057ca6b | |||
c2de911efa | |||
861335212e | |||
038e47a46e | |||
c215508a12 | |||
ccadbb5942 | |||
fc2b709148 | |||
02473a0cd7 | |||
ab45aa1296 | |||
171c48495c | |||
a83b86ccd2 | |||
2e4b9bcd7c | |||
3046822e88 | |||
6442dd0c38 | |||
9b6fa646ed | |||
e77bde459b | |||
2d9d83a1c5 | |||
c561271070 | |||
70d4fc1e0a | |||
b8cfb36426 | |||
e5c140e0ae | |||
b99160e850 | |||
c4c340fde1 | |||
9a4c7589cc | |||
d11f898f70 | |||
c0ff84bb9d | |||
d1ff32bf96 | |||
dafcaa6007 | |||
5eb52133ac | |||
025e7647d3 | |||
0a97077a0e | |||
|
bc994595da | ||
e1604b292c | |||
34e124f2db | |||
ab2d7ca98f | |||
56e4fca06f | |||
e06c457743 | |||
5941c21adf | |||
0e880de0d0 | |||
29c3a43760 | |||
e05c72b062 | |||
377c3325d2 | |||
2ca8523215 | |||
25775614de | |||
efb3d982f3 | |||
0410ecd9e3 | |||
dd986fefd3 | |||
b38329aa0e | |||
0fe1b70bae | |||
c5b4499d98 | |||
458aa5c265 | |||
4499c9bf04 | |||
eb0223bc51 | |||
be6a492022 | |||
d8bd08dd8c | |||
18c2847b08 | |||
d45cda93b2 | |||
3448292e8a | |||
d983305ea5 | |||
c83cc492c0 | |||
ece32f88f4 | |||
dd9e28fca1 | |||
46cfe65321 | |||
7b7f5d7e0a | |||
fd112ed597 | |||
96eb8fc21f | |||
88fa4f1d9d | |||
5989c88c88 | |||
da8a108cb7 | |||
75132c1e39 | |||
eb494707af | |||
736f8d0238 | |||
f1acf8e18b | |||
281f91ec5d | |||
15352b539d | |||
4015e85506 | |||
aacaf52fd9 | |||
118f1da8dd | |||
89f83f4e3d | |||
39b7976056 | |||
8b0508d50a | |||
8a40878eb5 | |||
220469a2dd | |||
83de5b4ec1 | |||
fe1c51ae6d | |||
10cc954d27 | |||
73ff9b97db | |||
b0d71597f0 | |||
226f28dc7b | |||
|
7afe30ea88 | ||
6308427d03 | |||
398d04dc50 | |||
80a5ed3c5b | |||
5d5a355110 | |||
c78b7c432b | |||
6bfdace512 | |||
16e55a98ce | |||
79f17843d8 | |||
e5e163bdbf | |||
4e4820af05 | |||
637512ad77 | |||
a4bd5a2aaa | |||
a943e4eebb | |||
cb0c80d8dc | |||
3332f68ce7 | |||
2fbf847367 | |||
54feb77770 | |||
57e6c46e72 | |||
a3617cad11 | |||
7801c6effe | |||
b62c19a364 | |||
bf2e0f2d73 | |||
e98857fab4 | |||
8e4ad10627 | |||
496bc665d6 | |||
2c8531ea48 | |||
d3e7037759 | |||
|
0aee86442e | ||
|
951c077abc | ||
b94685e045 | |||
572d602b72 | |||
88051c9302 | |||
d62ee6a611 | |||
|
91ef4ff30b | ||
755dcf66a3 | |||
4032228005 | |||
50ce13d596 | |||
|
68302e7c5e | ||
b7ffd2653b | |||
e0c9bf5871 | |||
|
35f257800e | ||
7a5ce57bbc | |||
|
d0b7c22afc | ||
|
a18bc15cbb | ||
4ed9cc933f | |||
7af1c86f1c | |||
bd0b7aa230 | |||
72e0938f9a | |||
dd1b0a9380 | |||
|
adfefdd93f | ||
4dee913d51 | |||
b764194ed0 | |||
2d0e4ba951 | |||
0d549b687d | |||
738f572043 | |||
cab508fd64 | |||
c7daf697a8 | |||
c20be13733 | |||
82fc7f33a8 | |||
bfa77cf810 | |||
b7a316008a | |||
f598f7030f | |||
70f575396d | |||
ad57e6713e | |||
23f8e5cb41 | |||
879223f38f | |||
|
8a44c498c5 | ||
a891769a02 | |||
df97c582d7 |
8
.gitignore
vendored
8
.gitignore
vendored
@ -1,6 +1,14 @@
|
|||||||
|
# PyCharm and CLion
|
||||||
|
.idea/*
|
||||||
|
!/.idea/runConfigurations
|
||||||
|
!/.idea/cmake.xml
|
||||||
|
!/.idea/codeStyles
|
||||||
|
|
||||||
|
# Eclipse
|
||||||
.cproject
|
.cproject
|
||||||
.project
|
.project
|
||||||
.settings
|
.settings
|
||||||
.metadata
|
.metadata
|
||||||
|
|
||||||
/build*
|
/build*
|
||||||
|
/cmake-build*
|
||||||
|
8
.idea/cmake.xml
Normal file
8
.idea/cmake.xml
Normal 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>
|
14
.idea/codeStyles/Project.xml
Normal file
14
.idea/codeStyles/Project.xml
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
<component name="ProjectCodeStyleConfiguration">
|
||||||
|
<code_scheme name="Project" version="173">
|
||||||
|
<clangFormatSettings>
|
||||||
|
<option name="ENABLED" value="true" />
|
||||||
|
</clangFormatSettings>
|
||||||
|
<codeStyleSettings language="CMake">
|
||||||
|
<indentOptions>
|
||||||
|
<option name="INDENT_SIZE" value="2" />
|
||||||
|
<option name="CONTINUATION_INDENT_SIZE" value="0" />
|
||||||
|
<option name="TAB_SIZE" value="2" />
|
||||||
|
</indentOptions>
|
||||||
|
</codeStyleSettings>
|
||||||
|
</code_scheme>
|
||||||
|
</component>
|
5
.idea/codeStyles/codeStyleConfig.xml
Normal file
5
.idea/codeStyles/codeStyleConfig.xml
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
<component name="ProjectCodeStyleConfiguration">
|
||||||
|
<state>
|
||||||
|
<option name="USE_PER_PROJECT_SETTINGS" value="true" />
|
||||||
|
</state>
|
||||||
|
</component>
|
373
CHANGELOG.md
373
CHANGELOG.md
@ -8,25 +8,267 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
|
|||||||
|
|
||||||
# [unreleased]
|
# [unreleased]
|
||||||
|
|
||||||
# [v5.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
|
||||||
|
|
||||||
|
- 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
|
## Changes
|
||||||
|
|
||||||
- HAL Linux SPI: Set the Clock Default State when setting new SPI speed
|
- `CService201HealthCommanding` renamed to `CServiceHealthCommanding`,
|
||||||
and mode
|
service ID customizable now. `CServiceHealthCommanding` expects configuration struct
|
||||||
PR: https://egit.irs.uni-stuttgart.de/fsfw/fsfw/pulls/573
|
`HealthServiceCfg` now
|
||||||
- GPIO HAL: `Direction`, `GpioOperation` and `Levels` are enum classes now, which prevents
|
PR: https://egit.irs.uni-stuttgart.de/fsfw/fsfw/pulls/725
|
||||||
name clashes with Windows defines.
|
- `AcceptsTelemetryIF`: `getReportReceptionQueue` is const now
|
||||||
PR: https://egit.irs.uni-stuttgart.de/fsfw/fsfw/pulls/572
|
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
|
||||||
|
- Overhaul of the TMTC stack, including various changes and improvements
|
||||||
|
for other modules
|
||||||
|
PR: https://egit.irs.uni-stuttgart.de/fsfw/fsfw/pulls/655
|
||||||
|
which also includes a migration guide
|
||||||
|
- 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
|
||||||
|
|
||||||
|
|
||||||
|
## 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
|
||||||
|
|
||||||
|
- Renamed auto-formatting script to `auto-formatter.sh` and made it more robust.
|
||||||
|
If `cmake-format` is installed, it will also auto-format the `CMakeLists.txt` files now.
|
||||||
|
PR: https://egit.irs.uni-stuttgart.de/fsfw/fsfw/pulls/625
|
||||||
|
PR: https://egit.irs.uni-stuttgart.de/fsfw/fsfw/pulls/626
|
||||||
|
- Bump C++ required version to C++17. Every project which uses the FSFW and every modern
|
||||||
|
compiler supports it
|
||||||
|
PR: https://egit.irs.uni-stuttgart.de/fsfw/fsfw/pulls/622
|
||||||
- New CMake option `FSFW_HAL_LINUX_ADD_LIBGPIOD` to specifically exclude `gpiod` code.
|
- New CMake option `FSFW_HAL_LINUX_ADD_LIBGPIOD` to specifically exclude `gpiod` code.
|
||||||
PR: https://egit.irs.uni-stuttgart.de/fsfw/fsfw/pulls/572
|
PR: https://egit.irs.uni-stuttgart.de/fsfw/fsfw/pulls/572
|
||||||
- HAL Devicehandlers: Periodic printout is run-time configurable now
|
- HAL Devicehandlers: Periodic printout is run-time configurable now
|
||||||
- `oneShotAction` flag in the `TestTask` class is not static anymore
|
- `oneShotAction` flag in the `TestTask` class is not static anymore
|
||||||
- HAL Linux Uart: Baudrate and bits per word are enums now, avoiding misconfigurations
|
- `SimpleRingBuffer::writeData` now checks if the amount is larger than the total size of the
|
||||||
PR: https://egit.irs.uni-stuttgart.de/fsfw/fsfw/pulls/585
|
Buffer and rejects such writeData calls with `returnvalue::FAILED`
|
||||||
|
PR: https://egit.irs.uni-stuttgart.de/fsfw/fsfw/pulls/586
|
||||||
- Major update for version handling, using `git describe` to fetch version information with git.
|
- Major update for version handling, using `git describe` to fetch version information with git.
|
||||||
PR: https://egit.irs.uni-stuttgart.de/fsfw/fsfw/pulls/601
|
PR: https://egit.irs.uni-stuttgart.de/fsfw/fsfw/pulls/601
|
||||||
- Place `Version` class outside of `fsfw` namespace. It is generic
|
|
||||||
- Add helper functions provided by [`cmake-modules`](https://github.com/bilke/cmake-modules)
|
- Add helper functions provided by [`cmake-modules`](https://github.com/bilke/cmake-modules)
|
||||||
manually now. Those should not change too often and only a small subset is needed
|
manually now. Those should not change too often and only a small subset is needed
|
||||||
- Separate folder for easier update and for distinction
|
- Separate folder for easier update and for distinction
|
||||||
@ -42,12 +284,74 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
|
|||||||
creation call. It allows passing context information and an arbitrary user argument into
|
creation call. It allows passing context information and an arbitrary user argument into
|
||||||
the message queue. Also streamlined and simplified `MessageQueue` implementation for all OSALs
|
the message queue. Also streamlined and simplified `MessageQueue` implementation for all OSALs
|
||||||
PR: https://egit.irs.uni-stuttgart.de/fsfw/fsfw/pulls/583
|
PR: https://egit.irs.uni-stuttgart.de/fsfw/fsfw/pulls/583
|
||||||
- Clock:
|
- Internal API change: Moved the `fsfw_hal` to the `src` folder and integration and internal
|
||||||
- `timeval` to `TimeOfDay_t`
|
tests part of `fsfw_tests` to `src`. Unittests are now in a dedicated folder called `unittests`
|
||||||
- Added Mutex for gmtime calls: (compare http://www.opengate.at/blog/2020/01/timeless/)
|
PR: https://egit.irs.uni-stuttgart.de/fsfw/fsfw/pulls/653
|
||||||
- Moved the statics used by Clock in ClockCommon.cpp to this file
|
|
||||||
- Better check for leap seconds
|
### Task Module Refactoring
|
||||||
- Added Unittests for Clock (only getter)
|
|
||||||
|
PR: https://egit.irs.uni-stuttgart.de/fsfw/fsfw/pulls/636
|
||||||
|
|
||||||
|
**Refactoring general task code**
|
||||||
|
|
||||||
|
- There was a lot of duplicate/boilerplate code inside the individual task IF OSAL implementations.
|
||||||
|
Remove it by introducing base classes `PeriodicTaskBase` and `FixedTimeslotTaskBase`.
|
||||||
|
|
||||||
|
**Refactor PeriodicTaskIF**
|
||||||
|
|
||||||
|
- Convert `virtual ReturnValue_t addComponent(object_id_t object)` to
|
||||||
|
`virtual ReturnValue_t addComponent(object_id_t object, uint8_t opCode = 0)`, allowing to pass
|
||||||
|
the operation code passed to `performOperation`. Updated API taking
|
||||||
|
an `ExecutableObjectIF` accordingly
|
||||||
|
|
||||||
|
**Refactor FixedTimeslotTaskIF**
|
||||||
|
|
||||||
|
- Add additional `addSlot` function which takes an `ExecutableObjectIF` pointer and its Object ID
|
||||||
|
|
||||||
|
**Refactor FixedSequenceSlot**
|
||||||
|
|
||||||
|
- Introduce typedef `CustomCheckFunc` for `ReturnValue_t (*customCheckFunction)(const SlotList&)`.
|
||||||
|
- Convert `ReturnValue_t (*customCheckFunction)(const SlotList&)` to
|
||||||
|
`ReturnValue_t (*customCheckFunction)(const SlotList&, void*)`, allowing arbitrary user arguments
|
||||||
|
for the custom checker
|
||||||
|
|
||||||
|
**Linux Task Module**
|
||||||
|
|
||||||
|
- Use composition instead of inheritance for the `PeriodicPosixTask` and make the `PosixTask` a
|
||||||
|
member of the class
|
||||||
|
|
||||||
|
### HAL
|
||||||
|
|
||||||
|
- HAL Linux Uart: Baudrate and bits per word are enums now, avoiding misconfigurations
|
||||||
|
PR: https://egit.irs.uni-stuttgart.de/fsfw/fsfw/pulls/585
|
||||||
|
- HAL Linux SPI: Set the Clock Default State when setting new SPI speed
|
||||||
|
and mode
|
||||||
|
PR: https://egit.irs.uni-stuttgart.de/fsfw/fsfw/pulls/573
|
||||||
|
- GPIO HAL: `Direction`, `GpioOperation` and `Levels` are enum classes now, which prevents
|
||||||
|
name clashes with Windows defines.
|
||||||
|
PR: https://egit.irs.uni-stuttgart.de/fsfw/fsfw/pulls/572
|
||||||
|
- HAL Linux Uart: Baudrate and bits per word are enums now, avoiding misconfigurations
|
||||||
|
PR: https://egit.irs.uni-stuttgart.de/fsfw/fsfw/pulls/585
|
||||||
|
|
||||||
|
### Time
|
||||||
|
|
||||||
|
PR: https://egit.irs.uni-stuttgart.de/fsfw/fsfw/pulls/584 and
|
||||||
|
https://egit.irs.uni-stuttgart.de/fsfw/fsfw/pulls/593
|
||||||
|
|
||||||
|
- `timeval` to `TimeOfDay_t`
|
||||||
|
- Added Mutex for gmtime calls: (compare http://www.opengate.at/blog/2020/01/timeless/)
|
||||||
|
- Moved the statics used by Clock in ClockCommon.cpp to this file
|
||||||
|
- Better check for leap seconds
|
||||||
|
- Added Unittests for Clock (only getter)
|
||||||
|
|
||||||
|
### Power
|
||||||
|
|
||||||
|
- `PowerSwitchIF`: Remove `const` specifier from `sendSwitchCommand` and `sendFuseOnCommand` and
|
||||||
|
also specify a `ReturnValue_t` return type
|
||||||
|
PR: https://egit.irs.uni-stuttgart.de/fsfw/fsfw/pulls/590
|
||||||
|
- Extend `PowerSwitcher` module to optionally check current state when calling `turnOn` or
|
||||||
|
`turnOff`. Tis can be helpful to avoid commanding switches which do not need commanding
|
||||||
|
PR: https://egit.irs.uni-stuttgart.de/fsfw/fsfw/pulls/590
|
||||||
|
|
||||||
## Removed
|
## Removed
|
||||||
|
|
||||||
@ -57,15 +361,52 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
|
|||||||
|
|
||||||
## Additions
|
## Additions
|
||||||
|
|
||||||
|
- New constructor for PoolEntry which allows to simply specify the length of the pool entry.
|
||||||
|
This is also the new default constructor for scalar value with 0 as an initial value
|
||||||
|
- Added options for CI/CD builds: `FSFW_CICD_BUILD`. This allows the source code to know
|
||||||
|
whether it is running in CI/CD
|
||||||
|
PR: https://egit.irs.uni-stuttgart.de/fsfw/fsfw/pulls/623
|
||||||
|
- Basic `clion` support: Update `.gitignore` and add some basic run configurations
|
||||||
|
PR: https://egit.irs.uni-stuttgart.de/fsfw/fsfw/pulls/625
|
||||||
|
- LTO support: Allow using LTO/IPO by setting `FSFW_ENABLE_LTO=1`. CMake is able to detect whether
|
||||||
|
the user compiler supports IPO/LPO. LTO is on by default now. Most modern compilers support it,
|
||||||
|
can make good use of it and it usually makes the code faster and/or smaller.
|
||||||
|
After some more research:
|
||||||
|
Enabling LTO will actually cause the compiler to only produce thin LTO by adding
|
||||||
|
`-flto -fno-fat-lto-objects` to the compiler options. I am not sure this is an ideal choice
|
||||||
|
because if an application linking against the FSFW does not use LTO, there can be compile
|
||||||
|
issues (e.g. observed when compiling the FSFW tests without LTO). This is a known issue as
|
||||||
|
can be seen in the multiple CMake issues for it:
|
||||||
|
- https://gitlab.kitware.com/cmake/cmake/-/issues/22913,
|
||||||
|
- https://gitlab.kitware.com/cmake/cmake/-/issues/16808,
|
||||||
|
- 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
|
- 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
|
- Dedicated Version class and constant `fsfw::FSFW_VERSION` containing version information
|
||||||
inside `fsfw/version.h`
|
inside `fsfw/version.h`
|
||||||
PR: https://egit.irs.uni-stuttgart.de/fsfw/fsfw/pulls/559
|
PR: https://egit.irs.uni-stuttgart.de/fsfw/fsfw/pulls/559
|
||||||
|
- Added generic PUS TC Scheduler Service 11. It depends on the new added Emebeded Template Library
|
||||||
|
(ETL) dependency.
|
||||||
|
PR: https://egit.irs.uni-stuttgart.de/fsfw/fsfw/pulls/594
|
||||||
- Added ETL dependency and improved library dependency management
|
- Added ETL dependency and improved library dependency management
|
||||||
PR: https://egit.irs.uni-stuttgart.de/fsfw/fsfw/pulls/592
|
PR: https://egit.irs.uni-stuttgart.de/fsfw/fsfw/pulls/592
|
||||||
|
- Add a `DummyPowerSwitcher` module which can be useful for test setups when no PCDU is available
|
||||||
|
PR: https://egit.irs.uni-stuttgart.de/fsfw/fsfw/pulls/590
|
||||||
|
- New typedef for switcher type
|
||||||
|
PR: https://egit.irs.uni-stuttgart.de/fsfw/fsfw/pulls/590
|
||||||
|
- `Subsystem`: New API to add table and sequence entries
|
||||||
|
|
||||||
## Fixed
|
## Fixed
|
||||||
|
|
||||||
|
- TCP TMTC Server: `MutexGuard` was not created properly in
|
||||||
|
`TcpTmTcServer::handleTmSending(socket_t connSocket, bool& tmSent)` call.
|
||||||
|
PR: https://egit.irs.uni-stuttgart.de/fsfw/fsfw/pulls/618
|
||||||
|
- Fix infinite recursion in `prepareHealthSetReply` of PUS Health Service 201.
|
||||||
|
Is not currently used right now but might be used in the future
|
||||||
|
PR: https://egit.irs.uni-stuttgart.de/fsfw/fsfw/pulls/617
|
||||||
|
- Move some CMake directives further up top so they are not ignored
|
||||||
|
PR: https://egit.irs.uni-stuttgart.de/fsfw/fsfw/pulls/621
|
||||||
- Small bugfix in STM32 HAL for SPI
|
- Small bugfix in STM32 HAL for SPI
|
||||||
PR: https://egit.irs.uni-stuttgart.de/fsfw/fsfw/pulls/599
|
PR: https://egit.irs.uni-stuttgart.de/fsfw/fsfw/pulls/599
|
||||||
- HAL GPIO: Improved error checking in `LinuxLibgpioIF::configureGpios(...)`. If a GPIO
|
- HAL GPIO: Improved error checking in `LinuxLibgpioIF::configureGpios(...)`. If a GPIO
|
||||||
|
699
CMakeLists.txt
699
CMakeLists.txt
@ -1,52 +1,130 @@
|
|||||||
cmake_minimum_required(VERSION 3.13)
|
cmake_minimum_required(VERSION 3.13)
|
||||||
set(LIB_FSFW_NAME fsfw)
|
|
||||||
project(${LIB_FSFW_NAME})
|
|
||||||
|
|
||||||
set(FSFW_VERSION_IF_GIT_FAILS 4)
|
set(MSG_PREFIX "fsfw |")
|
||||||
|
|
||||||
|
# Add the cmake folder so the FindSphinx module is found
|
||||||
|
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake")
|
||||||
|
list(APPEND CMAKE_MODULE_PATH
|
||||||
|
"${CMAKE_CURRENT_SOURCE_DIR}/cmake/cmake-modules/bilke")
|
||||||
|
list(APPEND CMAKE_MODULE_PATH
|
||||||
|
"${CMAKE_CURRENT_SOURCE_DIR}/cmake/cmake-modules/rpavlik")
|
||||||
|
|
||||||
|
# ##############################################################################
|
||||||
|
# Version file handling #
|
||||||
|
# ##############################################################################
|
||||||
|
|
||||||
|
set(FSFW_VERSION_IF_GIT_FAILS 6)
|
||||||
set(FSFW_SUBVERSION_IF_GIT_FAILS 0)
|
set(FSFW_SUBVERSION_IF_GIT_FAILS 0)
|
||||||
set(FSFW_REVISION_IF_GIT_FAILS 0)
|
set(FSFW_REVISION_IF_GIT_FAILS 0)
|
||||||
|
|
||||||
# Add the cmake folder so the FindSphinx module is found
|
set(FSFW_GIT_VER_HANDLING_OK FALSE)
|
||||||
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake" )
|
# Version handling
|
||||||
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake/cmake-modules")
|
if(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/.git)
|
||||||
set(MSG_PREFIX "fsfw |")
|
message(STATUS "${MSG_PREFIX} Determining version information with git")
|
||||||
|
include(FsfwHelpers)
|
||||||
set(FSFW_ETL_LIB_MAJOR_VERSION 20 CACHE STRING
|
determine_version_with_git("--exclude" "docker_*")
|
||||||
"ETL library major version requirement"
|
if(GIT_INFO)
|
||||||
)
|
set(FSFW_GIT_INFO
|
||||||
set(FSFW_ETL_LIB_VERSION ${FSFW_ETL_LIB_MAJOR_VERSION}.27.3 CACHE STRING
|
${GIT_INFO}
|
||||||
"ETL library exact version requirement"
|
CACHE STRING "Version information retrieved with git describe")
|
||||||
)
|
list(GET FSFW_GIT_INFO 1 FSFW_VERSION)
|
||||||
set(FSFW_ETL_LINK_TARGET etl::etl)
|
list(GET FSFW_GIT_INFO 2 FSFW_SUBVERSION)
|
||||||
|
list(GET FSFW_GIT_INFO 3 FSFW_REVISION)
|
||||||
set(FSFW_CATCH2_LIB_MAJOR_VERSION 3 CACHE STRING
|
list(GET FSFW_GIT_INFO 4 FSFW_VCS_INFO)
|
||||||
"Catch2 library major version requirement"
|
if(NOT FSFW_VERSION)
|
||||||
)
|
set(FSFW_VERSION ${FSFW_VERSION_IF_GIT_FAILS})
|
||||||
set(FSFW_CATCH2_LIB_VERSION v${FSFW_CATCH2_LIB_MAJOR_VERSION}.0.0-preview5 CACHE STRING
|
endif()
|
||||||
"Catch2 library exact version requirement"
|
if(NOT FSFW_SUBVERSION)
|
||||||
)
|
set(FSFW_SUBVERSION ${FSFW_SUBVERSION_IF_GIT_FAILS})
|
||||||
|
endif()
|
||||||
set(FSFW_ETL_LIB_NAME etl)
|
if(NOT FSFW_REVISION)
|
||||||
|
set(FSFW_REVISION ${FSFW_REVISION_IF_GIT_FAILS})
|
||||||
option(FSFW_GENERATE_SECTIONS
|
endif()
|
||||||
"Generate function and data sections. Required to remove unused code" ON
|
set(FSFW_GIT_VER_HANDLING_OK TRUE)
|
||||||
)
|
else()
|
||||||
if(FSFW_GENERATE_SECTIONS)
|
set(FSFW_GIT_VER_HANDLING_OK FALSE)
|
||||||
option(FSFW_REMOVE_UNUSED_CODE "Remove unused code" ON)
|
endif()
|
||||||
|
endif()
|
||||||
|
if(NOT FSFW_GIT_VER_HANDLING_OK)
|
||||||
|
set(FSFW_VERSION ${FSFW_VERSION_IF_GIT_FAILS})
|
||||||
|
set(FSFW_SUBVERSION ${FSFW_SUBVERSION_IF_GIT_FAILS})
|
||||||
|
set(FSFW_REVISION ${FSFW_REVISION_IF_GIT_FAILS})
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
option(FSFW_BUILD_UNITTESTS "Build unittest binary in addition to static library" OFF)
|
set(LIB_FSFW_NAME fsfw)
|
||||||
|
project(${LIB_FSFW_NAME}
|
||||||
|
VERSION ${FSFW_VERSION}.${FSFW_SUBVERSION}.${FSFW_REVISION})
|
||||||
|
|
||||||
|
if(NOT CMAKE_CXX_STANDARD)
|
||||||
|
set(CMAKE_CXX_STANDARD 17)
|
||||||
|
set(CMAKE_CXX_STANDARD_REQUIRED True)
|
||||||
|
elseif(${CMAKE_CXX_STANDARD} LESS 17)
|
||||||
|
message(
|
||||||
|
FATAL_ERROR
|
||||||
|
"${MSG_PREFIX} Compiling the FSFW requires a minimum of C++17 support")
|
||||||
|
endif()
|
||||||
|
|
||||||
|
set(FSFW_SOURCES_DIR "${CMAKE_SOURCE_DIR}/src/fsfw")
|
||||||
|
|
||||||
|
set(FSFW_ETL_LIB_NAME etl)
|
||||||
|
set(FSFW_ETL_LINK_TARGET etl::etl)
|
||||||
|
set(FSFW_ETL_LIB_MAJOR_VERSION
|
||||||
|
20
|
||||||
|
CACHE STRING "ETL library major version requirement")
|
||||||
|
set(FSFW_ETL_LIB_VERSION
|
||||||
|
${FSFW_ETL_LIB_MAJOR_VERSION}.35.14
|
||||||
|
CACHE STRING "ETL library exact version requirement")
|
||||||
|
set(FSFW_ETL_LINK_TARGET etl::etl)
|
||||||
|
|
||||||
|
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}.1.0
|
||||||
|
CACHE STRING "Catch2 library exact version requirement")
|
||||||
|
|
||||||
|
# Keep this off by default for now. See PR:
|
||||||
|
# https://egit.irs.uni-stuttgart.de/fsfw/fsfw/pulls/616 for information which
|
||||||
|
# keeping this on by default is problematic
|
||||||
|
option(
|
||||||
|
FSFW_ENABLE_IPO
|
||||||
|
"Enable interprocedural optimization or link-time optimization if available"
|
||||||
|
OFF)
|
||||||
|
if(FSFW_ENABLE_IPO)
|
||||||
|
include(CheckIPOSupported)
|
||||||
|
check_ipo_supported(RESULT IPO_SUPPORTED OUTPUT IPO_ERROR)
|
||||||
|
if(NOT IPO_SUPPORTED)
|
||||||
|
message(STATUS "FSFW | IPO/LTO not supported: ${IPO_ERROR}")
|
||||||
|
endif()
|
||||||
|
endif()
|
||||||
|
|
||||||
|
option(FSFW_GENERATE_SECTIONS
|
||||||
|
"Generate function and data sections. Required to remove unused code" ON)
|
||||||
|
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. 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)
|
option(FSFW_BUILD_DOCS "Build documentation with Sphinx and Doxygen" OFF)
|
||||||
if(FSFW_BUILD_UNITTESTS)
|
if(FSFW_BUILD_TESTS)
|
||||||
option(FSFW_TESTS_GEN_COV "Generate coverage data for unittests" ON)
|
option(FSFW_TESTS_GEN_COV "Generate coverage data for unittests" ON)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
option(FSFW_WARNING_SHADOW_LOCAL_GCC "Enable -Wshadow=local warning in GCC" ON)
|
option(FSFW_WARNING_SHADOW_LOCAL_GCC "Enable -Wshadow=local warning in GCC" ON)
|
||||||
# Options to exclude parts of the FSFW from compilation.
|
# Options to exclude parts of the FSFW from compilation.
|
||||||
option(FSFW_ADD_INTERNAL_TESTS "Add internal unit tests" ON)
|
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)
|
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
|
# Optional sources
|
||||||
option(FSFW_ADD_PUS "Compile with PUS sources" ON)
|
option(FSFW_ADD_PUS "Compile with PUS sources" ON)
|
||||||
option(FSFW_ADD_MONITORING "Compile with monitoring components" ON)
|
option(FSFW_ADD_MONITORING "Compile with monitoring components" ON)
|
||||||
@ -59,111 +137,95 @@ option(FSFW_ADD_TMSTORAGE "Compile with tm storage components" OFF)
|
|||||||
# Contrib sources
|
# Contrib sources
|
||||||
option(FSFW_ADD_SGP4_PROPAGATOR "Add SGP4 propagator code" OFF)
|
option(FSFW_ADD_SGP4_PROPAGATOR "Add SGP4 propagator code" OFF)
|
||||||
|
|
||||||
|
|
||||||
set(FSFW_TEST_TGT fsfw-tests)
|
set(FSFW_TEST_TGT fsfw-tests)
|
||||||
set(FSFW_DUMMY_TGT fsfw-dummy)
|
set(FSFW_DUMMY_TGT fsfw-dummy)
|
||||||
|
|
||||||
add_library(${LIB_FSFW_NAME})
|
add_library(${LIB_FSFW_NAME})
|
||||||
|
|
||||||
set(FSFW_GIT_VER_HANDLING_OK FALSE)
|
if(IPO_SUPPORTED AND FSFW_ENABLE_IPO)
|
||||||
# Version handling
|
set_property(TARGET ${LIB_FSFW_NAME} PROPERTY INTERPROCEDURAL_OPTIMIZATION
|
||||||
if(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/.git)
|
TRUE)
|
||||||
message(STATUS "${MSG_PREFIX} Determining version information with git")
|
|
||||||
include(FsfwHelpers)
|
|
||||||
determine_version_with_git("--exclude" "docker_*")
|
|
||||||
if(GIT_INFO)
|
|
||||||
set(FSFW_GIT_INFO ${GIT_INFO} CACHE STRING "Version information retrieved with git describe")
|
|
||||||
list(GET FSFW_GIT_INFO 1 FSFW_VERSION)
|
|
||||||
list(GET FSFW_GIT_INFO 2 FSFW_SUBVERSION)
|
|
||||||
list(GET FSFW_GIT_INFO 3 FSFW_REVISION)
|
|
||||||
list(GET FSFW_GIT_INFO 4 FSFW_VERSION_CST_GIT_SHA1)
|
|
||||||
if(NOT FSFW_VERSION)
|
|
||||||
set(FSFW_VERSION ${FSFW_VERSION_IF_GIT_FAILS})
|
|
||||||
endif()
|
|
||||||
if(NOT FSFW_SUBVERSION)
|
|
||||||
set(FSFW_SUBVERSION ${FSFW_SUBVERSION_IF_GIT_FAILS})
|
|
||||||
endif()
|
|
||||||
if(NOT FSFW_REVISION)
|
|
||||||
set(FSFW_REVISION ${FSFW_REVISION_IF_GIT_FAILS})
|
|
||||||
endif()
|
|
||||||
set(FSFW_GIT_VER_HANDLING_OK TRUE)
|
|
||||||
else()
|
|
||||||
set(FSFW_GIT_VER_HANDLING_OK FALSE)
|
|
||||||
endif()
|
|
||||||
endif()
|
|
||||||
if(NOT FSFW_GIT_VER_HANDLING_OK)
|
|
||||||
set(FSFW_VERSION ${FSFW_VERSION_IF_GIT_FAILS})
|
|
||||||
set(FSFW_SUBVERSION ${FSFW_SUBVERSION_IF_GIT_FAILS})
|
|
||||||
set(FSFW_REVISION ${FSFW_REVISION_IF_GIT_FAILS})
|
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(FSFW_BUILD_UNITTESTS)
|
if(FSFW_BUILD_TESTS)
|
||||||
message(STATUS "${MSG_PREFIX} Building the FSFW unittests in addition to the static library")
|
message(
|
||||||
# Check whether the user has already installed Catch2 first
|
STATUS
|
||||||
find_package(Catch2 ${FSFW_CATCH2_LIB_MAJOR_VERSION} CONFIG QUIET)
|
"${MSG_PREFIX} Building the FSFW unittests in addition to the static library"
|
||||||
# Not installed, so use FetchContent to download and provide Catch2
|
)
|
||||||
if(NOT Catch2_FOUND)
|
# Check whether the user has already installed Catch2 first
|
||||||
message(STATUS "${MSG_PREFIX} Catch2 installation not found. Downloading Catch2 library with FetchContent")
|
find_package(Catch2 ${FSFW_CATCH2_LIB_MAJOR_VERSION} QUIET)
|
||||||
include(FetchContent)
|
# Not installed, so use FetchContent to download and provide Catch2
|
||||||
|
if(NOT Catch2_FOUND)
|
||||||
FetchContent_Declare(
|
message(
|
||||||
Catch2
|
STATUS
|
||||||
GIT_REPOSITORY https://github.com/catchorg/Catch2.git
|
"${MSG_PREFIX} Catch2 installation not found. Downloading Catch2 library with FetchContent."
|
||||||
GIT_TAG ${FSFW_CATCH2_LIB_VERSION}
|
|
||||||
)
|
|
||||||
|
|
||||||
list(APPEND FSFW_FETCH_CONTENT_TARGETS Catch2)
|
|
||||||
endif()
|
|
||||||
|
|
||||||
set(FSFW_CONFIG_PATH tests/src/fsfw_tests/unit/testcfg)
|
|
||||||
configure_file(tests/src/fsfw_tests/unit/testcfg/FSFWConfig.h.in FSFWConfig.h)
|
|
||||||
configure_file(tests/src/fsfw_tests/unit/testcfg/TestsConfig.h.in tests/TestsConfig.h)
|
|
||||||
|
|
||||||
project(${FSFW_TEST_TGT} CXX C)
|
|
||||||
add_executable(${FSFW_TEST_TGT})
|
|
||||||
|
|
||||||
if(FSFW_TESTS_GEN_COV)
|
|
||||||
message(STATUS "${MSG_PREFIX} Generating coverage data for the library")
|
|
||||||
message(STATUS "${MSG_PREFIX} Targets linking against ${LIB_FSFW_NAME} "
|
|
||||||
"will be compiled with coverage data as well"
|
|
||||||
)
|
|
||||||
set(CMAKE_BUILD_TYPE "Debug")
|
|
||||||
include(CodeCoverage)
|
|
||||||
endif()
|
|
||||||
endif()
|
|
||||||
|
|
||||||
message(STATUS "Finding and/or providing etl library with version ${FSFW_ETL_LIB_MAJOR_VERSION}")
|
|
||||||
|
|
||||||
# Check whether the user has already installed ETL first
|
|
||||||
find_package(${FSFW_ETL_LIB_NAME} ${FSFW_ETL_LIB_MAJOR_VERSION} CONFIG QUIET)
|
|
||||||
# Not installed, so use FetchContent to download and provide etl
|
|
||||||
if(NOT ${FSFW_ETL_LIB_NAME}_FOUND)
|
|
||||||
message(STATUS
|
|
||||||
"No ETL installation was found with find_package. Installing and providing "
|
|
||||||
"etl with FindPackage"
|
|
||||||
)
|
)
|
||||||
include(FetchContent)
|
include(FetchContent)
|
||||||
|
|
||||||
FetchContent_Declare(
|
FetchContent_Declare(
|
||||||
${FSFW_ETL_LIB_NAME}
|
Catch2
|
||||||
GIT_REPOSITORY https://github.com/ETLCPP/etl
|
GIT_REPOSITORY https://github.com/catchorg/Catch2.git
|
||||||
GIT_TAG ${FSFW_ETL_LIB_VERSION}
|
GIT_TAG ${FSFW_CATCH2_LIB_VERSION})
|
||||||
)
|
|
||||||
list(APPEND FSFW_FETCH_CONTENT_TARGETS ${FSFW_ETL_LIB_NAME})
|
list(APPEND FSFW_FETCH_CONTENT_TARGETS Catch2)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
set(FSFW_CONFIG_PATH unittests/testcfg)
|
||||||
|
configure_file(unittests/testcfg/FSFWConfig.h.in FSFWConfig.h)
|
||||||
|
configure_file(unittests/testcfg/TestsConfig.h.in tests/TestsConfig.h)
|
||||||
|
|
||||||
|
project(${FSFW_TEST_TGT} CXX C)
|
||||||
|
add_executable(${FSFW_TEST_TGT})
|
||||||
|
if(IPO_SUPPORTED AND FSFW_ENABLE_IPO)
|
||||||
|
set_property(TARGET ${FSFW_TEST_TGT} PROPERTY INTERPROCEDURAL_OPTIMIZATION
|
||||||
|
TRUE)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
if(FSFW_TESTS_GEN_COV)
|
||||||
|
message(STATUS "${MSG_PREFIX} Generating coverage data for the library")
|
||||||
|
message(STATUS "${MSG_PREFIX} Targets linking against ${LIB_FSFW_NAME} "
|
||||||
|
"will be compiled with coverage data as well")
|
||||||
|
set(CMAKE_BUILD_TYPE "Debug")
|
||||||
|
include(CodeCoverage)
|
||||||
|
endif()
|
||||||
|
endif()
|
||||||
|
|
||||||
|
message(
|
||||||
|
STATUS
|
||||||
|
"${MSG_PREFIX} Finding and/or providing etl library with version ${FSFW_ETL_LIB_MAJOR_VERSION}"
|
||||||
|
)
|
||||||
|
|
||||||
|
# Check whether the user has already installed ETL first
|
||||||
|
find_package(${FSFW_ETL_LIB_NAME} ${FSFW_ETL_LIB_MAJOR_VERSION} QUIET)
|
||||||
|
# Not installed, so use FetchContent to download and provide etl
|
||||||
|
if(NOT ${FSFW_ETL_LIB_NAME}_FOUND)
|
||||||
|
message(
|
||||||
|
STATUS
|
||||||
|
"${MSG_PREFIX} ETL installation not found. Downloading ETL with FetchContent."
|
||||||
|
)
|
||||||
|
include(FetchContent)
|
||||||
|
|
||||||
|
FetchContent_Declare(
|
||||||
|
${FSFW_ETL_LIB_NAME}
|
||||||
|
GIT_REPOSITORY https://github.com/ETLCPP/etl
|
||||||
|
GIT_TAG ${FSFW_ETL_LIB_VERSION})
|
||||||
|
|
||||||
|
list(APPEND FSFW_FETCH_CONTENT_TARGETS ${FSFW_ETL_LIB_NAME})
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
# The documentation for FetchContent recommends declaring all the dependencies
|
# The documentation for FetchContent recommends declaring all the dependencies
|
||||||
# before making them available. We make all declared dependency available here
|
# before making them available. We make all declared dependency available here
|
||||||
# after their declaration
|
# after their declaration
|
||||||
if(FSFW_FETCH_CONTENT_TARGETS)
|
if(FSFW_FETCH_CONTENT_TARGETS)
|
||||||
FetchContent_MakeAvailable(${FSFW_FETCH_CONTENT_TARGETS})
|
FetchContent_MakeAvailable(${FSFW_FETCH_CONTENT_TARGETS})
|
||||||
if(TARGET ${FSFW_ETL_LIB_NAME})
|
if(TARGET ${FSFW_ETL_LIB_NAME})
|
||||||
add_library(${FSFW_ETL_LINK_TARGET} ALIAS ${FSFW_ETL_LIB_NAME})
|
add_library(${FSFW_ETL_LINK_TARGET} ALIAS ${FSFW_ETL_LIB_NAME})
|
||||||
endif()
|
endif()
|
||||||
if(TARGET Catch2)
|
if(TARGET Catch2)
|
||||||
# Fixes regression -preview4, to be confirmed in later releases
|
# Fixes regression -preview4, to be confirmed in later releases Related
|
||||||
# Related GitHub issue: https://github.com/catchorg/Catch2/issues/2417
|
# GitHub issue: https://github.com/catchorg/Catch2/issues/2417
|
||||||
set_target_properties(Catch2 PROPERTIES DEBUG_POSTFIX "")
|
set_target_properties(Catch2 PROPERTIES DEBUG_POSTFIX "")
|
||||||
endif()
|
endif()
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
set(FSFW_CORE_INC_PATH "inc")
|
set(FSFW_CORE_INC_PATH "inc")
|
||||||
@ -171,275 +233,250 @@ set(FSFW_CORE_INC_PATH "inc")
|
|||||||
set_property(CACHE FSFW_OSAL PROPERTY STRINGS host linux rtems freertos)
|
set_property(CACHE FSFW_OSAL PROPERTY STRINGS host linux rtems freertos)
|
||||||
|
|
||||||
# For configure files
|
# For configure files
|
||||||
target_include_directories(${LIB_FSFW_NAME} PRIVATE
|
target_include_directories(${LIB_FSFW_NAME} PRIVATE ${CMAKE_CURRENT_BINARY_DIR})
|
||||||
${CMAKE_CURRENT_BINARY_DIR}
|
target_include_directories(${LIB_FSFW_NAME}
|
||||||
)
|
INTERFACE ${CMAKE_CURRENT_BINARY_DIR})
|
||||||
target_include_directories(${LIB_FSFW_NAME} INTERFACE
|
|
||||||
${CMAKE_CURRENT_BINARY_DIR}
|
|
||||||
)
|
|
||||||
|
|
||||||
if(NOT CMAKE_CXX_STANDARD)
|
|
||||||
set(CMAKE_CXX_STANDARD 11)
|
|
||||||
set(CMAKE_CXX_STANDARD_REQUIRED True)
|
|
||||||
elseif(${CMAKE_CXX_STANDARD} LESS 11)
|
|
||||||
message(FATAL_ERROR "${MSG_PREFIX} Compiling the FSFW requires a minimum of C++11 support")
|
|
||||||
endif()
|
|
||||||
|
|
||||||
# Backwards comptability
|
# Backwards comptability
|
||||||
if(OS_FSFW AND NOT FSFW_OSAL)
|
if(OS_FSFW AND NOT FSFW_OSAL)
|
||||||
message(WARNING "${MSG_PREFIX} Please pass the FSFW OSAL as FSFW_OSAL instead of OS_FSFW")
|
message(
|
||||||
set(FSFW_OSAL OS_FSFW)
|
WARNING
|
||||||
|
"${MSG_PREFIX} Please pass the FSFW OSAL as FSFW_OSAL instead of OS_FSFW")
|
||||||
|
set(FSFW_OSAL OS_FSFW)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(NOT FSFW_OSAL)
|
if(NOT FSFW_OSAL)
|
||||||
message(STATUS "${MSG_PREFIX} No OS for FSFW via FSFW_OSAL set. Assuming host OS")
|
message(STATUS "No OS for FSFW via FSFW_OSAL set. Assuming host OS")
|
||||||
# Assume host OS and autodetermine from OS_FSFW
|
# Assume host OS and autodetermine from OS_FSFW
|
||||||
if(UNIX)
|
if(UNIX)
|
||||||
set(FSFW_OSAL "linux"
|
set(FSFW_OSAL
|
||||||
CACHE STRING
|
"linux"
|
||||||
"OS abstraction layer used in the FSFW"
|
CACHE STRING "OS abstraction layer used in the FSFW")
|
||||||
)
|
elseif(WIN32)
|
||||||
elseif(WIN32)
|
set(FSFW_OSAL
|
||||||
set(FSFW_OSAL "host"
|
"host"
|
||||||
CACHE STRING "OS abstraction layer used in the FSFW"
|
CACHE STRING "OS abstraction layer used in the FSFW")
|
||||||
)
|
endif()
|
||||||
endif()
|
|
||||||
|
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
set(FSFW_OSAL_DEFINITION FSFW_OSAL_HOST)
|
set(FSFW_OSAL_DEFINITION FSFW_OSAL_HOST)
|
||||||
|
|
||||||
if(FSFW_OSAL MATCHES host)
|
if(FSFW_OSAL MATCHES host)
|
||||||
set(FSFW_OS_NAME "Host")
|
set(FSFW_OS_NAME "Host")
|
||||||
set(FSFW_OSAL_HOST ON)
|
set(FSFW_OSAL_HOST ON)
|
||||||
elseif(FSFW_OSAL MATCHES linux)
|
elseif(FSFW_OSAL MATCHES linux)
|
||||||
set(FSFW_OS_NAME "Linux")
|
set(FSFW_OS_NAME "Linux")
|
||||||
set(FSFW_OSAL_LINUX ON)
|
set(FSFW_OSAL_LINUX ON)
|
||||||
elseif(FSFW_OSAL MATCHES freertos)
|
elseif(FSFW_OSAL MATCHES freertos)
|
||||||
set(FSFW_OS_NAME "FreeRTOS")
|
set(FSFW_OS_NAME "FreeRTOS")
|
||||||
set(FSFW_OSAL_FREERTOS ON)
|
set(FSFW_OSAL_FREERTOS ON)
|
||||||
target_link_libraries(${LIB_FSFW_NAME} PRIVATE
|
target_link_libraries(${LIB_FSFW_NAME} PRIVATE ${LIB_OS_NAME})
|
||||||
${LIB_OS_NAME}
|
|
||||||
)
|
|
||||||
elseif(FSFW_OSAL STREQUAL rtems)
|
elseif(FSFW_OSAL STREQUAL rtems)
|
||||||
set(FSFW_OS_NAME "RTEMS")
|
set(FSFW_OS_NAME "RTEMS")
|
||||||
set(FSFW_OSAL_RTEMS ON)
|
set(FSFW_OSAL_RTEMS ON)
|
||||||
else()
|
else()
|
||||||
message(WARNING
|
message(
|
||||||
"${MSG_PREFIX} Invalid operating system for FSFW specified! Setting to host.."
|
WARNING
|
||||||
)
|
"${MSG_PREFIX} Invalid operating system for FSFW specified! Setting to host.."
|
||||||
set(FSFW_OS_NAME "Host")
|
)
|
||||||
set(OS_FSFW "host")
|
set(FSFW_OS_NAME "Host")
|
||||||
|
set(OS_FSFW "host")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
configure_file(src/fsfw/FSFW.h.in fsfw/FSFW.h)
|
configure_file(src/fsfw/FSFW.h.in fsfw/FSFW.h)
|
||||||
configure_file(src/fsfw/FSFWVersion.h.in fsfw/FSFWVersion.h)
|
configure_file(src/fsfw/FSFWVersion.h.in fsfw/FSFWVersion.h)
|
||||||
|
|
||||||
message(STATUS "${MSG_PREFIX} Compiling FSFW for the ${FSFW_OS_NAME} operating system")
|
message(
|
||||||
|
STATUS "${MSG_PREFIX} Compiling FSFW for the ${FSFW_OS_NAME} operating system"
|
||||||
|
)
|
||||||
|
|
||||||
add_subdirectory(src)
|
add_subdirectory(src)
|
||||||
add_subdirectory(tests)
|
|
||||||
if(FSFW_ADD_HAL)
|
|
||||||
add_subdirectory(hal)
|
|
||||||
endif()
|
|
||||||
add_subdirectory(contrib)
|
add_subdirectory(contrib)
|
||||||
|
if(FSFW_BUILD_TESTS)
|
||||||
|
add_subdirectory(unittests)
|
||||||
|
endif()
|
||||||
if(FSFW_BUILD_DOCS)
|
if(FSFW_BUILD_DOCS)
|
||||||
add_subdirectory(docs)
|
add_subdirectory(docs)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(FSFW_BUILD_UNITTESTS)
|
if(FSFW_BUILD_TESTS)
|
||||||
if(FSFW_TESTS_GEN_COV)
|
if(FSFW_TESTS_GEN_COV)
|
||||||
if(CMAKE_COMPILER_IS_GNUCXX)
|
if(CMAKE_COMPILER_IS_GNUCXX)
|
||||||
include(CodeCoverage)
|
include(CodeCoverage)
|
||||||
|
|
||||||
# Remove quotes.
|
# Remove quotes.
|
||||||
separate_arguments(COVERAGE_COMPILER_FLAGS
|
separate_arguments(COVERAGE_COMPILER_FLAGS NATIVE_COMMAND
|
||||||
NATIVE_COMMAND "${COVERAGE_COMPILER_FLAGS}"
|
"${COVERAGE_COMPILER_FLAGS}")
|
||||||
)
|
|
||||||
|
|
||||||
# Add compile options manually, we don't want coverage for Catch2
|
# Add compile options manually, we don't want coverage for Catch2
|
||||||
target_compile_options(${FSFW_TEST_TGT} PRIVATE
|
target_compile_options(${FSFW_TEST_TGT}
|
||||||
"${COVERAGE_COMPILER_FLAGS}"
|
PRIVATE "${COVERAGE_COMPILER_FLAGS}")
|
||||||
)
|
target_compile_options(${LIB_FSFW_NAME}
|
||||||
target_compile_options(${LIB_FSFW_NAME} PRIVATE
|
PRIVATE "${COVERAGE_COMPILER_FLAGS}")
|
||||||
"${COVERAGE_COMPILER_FLAGS}"
|
|
||||||
)
|
|
||||||
|
|
||||||
# Exclude directories here
|
# Exclude directories here
|
||||||
if(WIN32)
|
if(WIN32)
|
||||||
set(GCOVR_ADDITIONAL_ARGS
|
set(GCOVR_ADDITIONAL_ARGS "--exclude-throw-branches"
|
||||||
"--exclude-throw-branches"
|
"--exclude-unreachable-branches")
|
||||||
"--exclude-unreachable-branches"
|
set(COVERAGE_EXCLUDES "/c/msys64/mingw64/*" "*/fsfw_hal/*")
|
||||||
)
|
elseif(UNIX)
|
||||||
set(COVERAGE_EXCLUDES
|
set(COVERAGE_EXCLUDES
|
||||||
"/c/msys64/mingw64/*" "*/fsfw_hal/*"
|
"/usr/include/*"
|
||||||
)
|
"/usr/bin/*"
|
||||||
elseif(UNIX)
|
"Catch2/*"
|
||||||
set(COVERAGE_EXCLUDES
|
"/usr/local/include/*"
|
||||||
"/usr/include/*" "/usr/bin/*" "Catch2/*"
|
"*/fsfw_tests/*"
|
||||||
"/usr/local/include/*" "*/fsfw_tests/*"
|
"*/catch2-src/*"
|
||||||
"*/catch2-src/*" "*/fsfw_hal/*"
|
"*/fsfw_hal/*"
|
||||||
)
|
"unittests/*")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
target_link_options(${FSFW_TEST_TGT} PRIVATE
|
target_link_options(${FSFW_TEST_TGT} PRIVATE -fprofile-arcs
|
||||||
-fprofile-arcs
|
-ftest-coverage)
|
||||||
-ftest-coverage
|
target_link_options(${LIB_FSFW_NAME} PRIVATE -fprofile-arcs
|
||||||
)
|
-ftest-coverage)
|
||||||
target_link_options(${LIB_FSFW_NAME} PRIVATE
|
# Need to specify this as an interface, otherwise there will the compile
|
||||||
-fprofile-arcs
|
# issues
|
||||||
-ftest-coverage
|
target_link_options(${LIB_FSFW_NAME} INTERFACE -fprofile-arcs
|
||||||
)
|
-ftest-coverage)
|
||||||
# Need to specify this as an interface, otherwise there will the compile issues
|
|
||||||
target_link_options(${LIB_FSFW_NAME} INTERFACE
|
|
||||||
-fprofile-arcs
|
|
||||||
-ftest-coverage
|
|
||||||
)
|
|
||||||
|
|
||||||
if(WIN32)
|
if(WIN32)
|
||||||
setup_target_for_coverage_gcovr_html(
|
setup_target_for_coverage_gcovr_html(
|
||||||
NAME ${FSFW_TEST_TGT}_coverage
|
NAME ${FSFW_TEST_TGT}_coverage EXECUTABLE ${FSFW_TEST_TGT}
|
||||||
EXECUTABLE ${FSFW_TEST_TGT}
|
DEPENDENCIES ${FSFW_TEST_TGT})
|
||||||
DEPENDENCIES ${FSFW_TEST_TGT}
|
else()
|
||||||
)
|
setup_target_for_coverage_lcov(
|
||||||
else()
|
NAME
|
||||||
setup_target_for_coverage_lcov(
|
${FSFW_TEST_TGT}_coverage
|
||||||
NAME ${FSFW_TEST_TGT}_coverage
|
EXECUTABLE
|
||||||
EXECUTABLE ${FSFW_TEST_TGT}
|
${FSFW_TEST_TGT}
|
||||||
DEPENDENCIES ${FSFW_TEST_TGT}
|
DEPENDENCIES
|
||||||
)
|
${FSFW_TEST_TGT}
|
||||||
endif()
|
GENHTML_ARGS
|
||||||
endif()
|
--html-epilog
|
||||||
|
${CMAKE_SOURCE_DIR}/unittests/lcov_epilog.html)
|
||||||
|
endif()
|
||||||
endif()
|
endif()
|
||||||
target_link_libraries(${FSFW_TEST_TGT} PRIVATE Catch2::Catch2 ${LIB_FSFW_NAME})
|
endif()
|
||||||
|
target_link_libraries(${FSFW_TEST_TGT} PRIVATE Catch2::Catch2
|
||||||
|
${LIB_FSFW_NAME})
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
# The project CMakeLists file has to set the FSFW_CONFIG_PATH and add it.
|
# The project CMakeLists file has to set the FSFW_CONFIG_PATH and add it. If
|
||||||
# If this is not given, we include the default configuration and emit a warning.
|
# this is not given, we include the default configuration and emit a warning.
|
||||||
if(NOT FSFW_CONFIG_PATH)
|
if(NOT FSFW_CONFIG_PATH)
|
||||||
set(DEF_CONF_PATH misc/defaultcfg/fsfwconfig)
|
set(DEF_CONF_PATH misc/defaultcfg/fsfwconfig)
|
||||||
if(NOT FSFW_BUILD_DOCS)
|
if(NOT FSFW_BUILD_DOCS)
|
||||||
message(WARNING "${MSG_PREFIX} Flight Software Framework configuration path not set")
|
message(
|
||||||
message(WARNING "${MSG_PREFIX} Setting default configuration from ${DEF_CONF_PATH} ..")
|
WARNING
|
||||||
endif()
|
"${MSG_PREFIX} Flight Software Framework configuration path FSFW_CONFIG_PATH not set"
|
||||||
add_subdirectory(${DEF_CONF_PATH})
|
)
|
||||||
set(FSFW_CONFIG_PATH ${DEF_CONF_PATH})
|
message(
|
||||||
|
WARNING
|
||||||
|
"${MSG_PREFIX} Setting default configuration from ${DEF_CONF_PATH} ..")
|
||||||
|
endif()
|
||||||
|
add_subdirectory(${DEF_CONF_PATH})
|
||||||
|
set(FSFW_CONFIG_PATH ${DEF_CONF_PATH})
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
# FSFW might be part of a possibly complicated folder structure, so we
|
# FSFW might be part of a possibly complicated folder structure, so we extract
|
||||||
# extract the absolute path of the fsfwconfig folder.
|
# the absolute path of the fsfwconfig folder.
|
||||||
if(IS_ABSOLUTE ${FSFW_CONFIG_PATH})
|
if(IS_ABSOLUTE ${FSFW_CONFIG_PATH})
|
||||||
set(FSFW_CONFIG_PATH_ABSOLUTE ${FSFW_CONFIG_PATH})
|
set(FSFW_CONFIG_PATH_ABSOLUTE ${FSFW_CONFIG_PATH})
|
||||||
else()
|
else()
|
||||||
get_filename_component(FSFW_CONFIG_PATH_ABSOLUTE
|
get_filename_component(FSFW_CONFIG_PATH_ABSOLUTE ${FSFW_CONFIG_PATH} REALPATH
|
||||||
${FSFW_CONFIG_PATH} REALPATH BASE_DIR ${CMAKE_SOURCE_DIR}
|
BASE_DIR ${CMAKE_SOURCE_DIR})
|
||||||
)
|
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
foreach(INCLUDE_PATH ${FSFW_ADDITIONAL_INC_PATHS})
|
foreach(INCLUDE_PATH ${FSFW_ADDITIONAL_INC_PATHS})
|
||||||
if(IS_ABSOLUTE ${INCLUDE_PATH})
|
if(IS_ABSOLUTE ${INCLUDE_PATH})
|
||||||
set(CURR_ABS_INC_PATH "${INCLUDE_PATH}")
|
set(CURR_ABS_INC_PATH "${INCLUDE_PATH}")
|
||||||
else()
|
else()
|
||||||
get_filename_component(CURR_ABS_INC_PATH
|
get_filename_component(CURR_ABS_INC_PATH ${INCLUDE_PATH} REALPATH BASE_DIR
|
||||||
${INCLUDE_PATH} REALPATH BASE_DIR ${CMAKE_SOURCE_DIR})
|
${CMAKE_SOURCE_DIR})
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(CMAKE_VERBOSE)
|
if(CMAKE_VERBOSE)
|
||||||
message(STATUS "FSFW include path: ${CURR_ABS_INC_PATH}")
|
message(STATUS "FSFW include path: ${CURR_ABS_INC_PATH}")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
list(APPEND FSFW_ADD_INC_PATHS_ABS ${CURR_ABS_INC_PATH})
|
list(APPEND FSFW_ADD_INC_PATHS_ABS ${CURR_ABS_INC_PATH})
|
||||||
endforeach()
|
endforeach()
|
||||||
|
|
||||||
if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
|
if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
|
||||||
if(NOT DEFINED FSFW_WARNING_FLAGS)
|
if(NOT DEFINED FSFW_WARNING_FLAGS)
|
||||||
set(FSFW_WARNING_FLAGS
|
set(FSFW_WARNING_FLAGS
|
||||||
-Wall
|
-Wall
|
||||||
-Wextra
|
-Wextra
|
||||||
-Wimplicit-fallthrough=1
|
-Wimplicit-fallthrough=1
|
||||||
-Wno-unused-parameter
|
-Wno-unused-parameter
|
||||||
-Wno-psabi
|
-Wno-psabi
|
||||||
-Wduplicated-cond # check for duplicate conditions
|
-Wduplicated-cond # check for duplicate conditions
|
||||||
-Wduplicated-branches # check for duplicate branches
|
-Wduplicated-branches # check for duplicate branches
|
||||||
-Wlogical-op # Search for bitwise operations instead of logical
|
-Wlogical-op # Search for bitwise operations instead of logical
|
||||||
-Wnull-dereference # Search for NULL dereference
|
-Wnull-dereference # Search for NULL dereference
|
||||||
-Wundef # Warn if undefind marcos are used
|
-Wundef # Warn if undefind marcos are used
|
||||||
-Wformat=2 # Format string problem detection
|
-Wformat=2 # Format string problem detection
|
||||||
-Wformat-overflow=2 # Formatting issues in printf
|
-Wformat-overflow=2 # Formatting issues in printf
|
||||||
-Wformat-truncation=2 # Formatting issues in printf
|
-Wformat-truncation=2 # Formatting issues in printf
|
||||||
-Wformat-security # Search for dangerous printf operations
|
-Wformat-security # Search for dangerous printf operations
|
||||||
-Wstrict-overflow=3 # Warn if integer overflows might happen
|
-Wstrict-overflow=3 # Warn if integer overflows might happen
|
||||||
-Warray-bounds=2 # Some array bounds violations will be found
|
-Warray-bounds=2 # Some array bounds violations will be found
|
||||||
-Wshift-overflow=2 # Search for bit left shift overflows (<c++14)
|
-Wshift-overflow=2 # Search for bit left shift overflows (<c++14)
|
||||||
-Wcast-qual # Warn if the constness is cast away
|
-Wcast-qual # Warn if the constness is cast away
|
||||||
-Wstringop-overflow=4
|
-Wstringop-overflow=4
|
||||||
# -Wstack-protector # Emits a few false positives for low level access
|
# -Wstack-protector # Emits a few false positives for low level access
|
||||||
# -Wconversion # Creates many false positives
|
# -Wconversion # Creates many false positives -Warith-conversion # Use
|
||||||
# -Warith-conversion # Use with Wconversion to find more implicit conversions
|
# with Wconversion to find more implicit conversions -fanalyzer # Should
|
||||||
# -fanalyzer # Should be used to look through problems
|
# be used to look through problems
|
||||||
)
|
)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(FSFW_GENERATE_SECTIONS)
|
if(FSFW_GENERATE_SECTIONS)
|
||||||
target_compile_options(${LIB_FSFW_NAME} PRIVATE
|
target_compile_options(${LIB_FSFW_NAME} PRIVATE "-ffunction-sections"
|
||||||
"-ffunction-sections"
|
"-fdata-sections")
|
||||||
"-fdata-sections"
|
endif()
|
||||||
)
|
|
||||||
endif()
|
if(FSFW_REMOVE_UNUSED_CODE)
|
||||||
|
target_link_options(${LIB_FSFW_NAME} PRIVATE "Wl,--gc-sections")
|
||||||
|
endif()
|
||||||
|
|
||||||
|
if(FSFW_WARNING_SHADOW_LOCAL_GCC)
|
||||||
|
list(APPEND WARNING_FLAGS "-Wshadow=local")
|
||||||
|
endif()
|
||||||
|
|
||||||
if(FSFW_REMOVE_UNUSED_CODE)
|
|
||||||
target_link_options(${LIB_FSFW_NAME} PRIVATE
|
|
||||||
"Wl,--gc-sections"
|
|
||||||
)
|
|
||||||
endif()
|
|
||||||
|
|
||||||
if(FSFW_WARNING_SHADOW_LOCAL_GCC)
|
|
||||||
list(APPEND WARNING_FLAGS "-Wshadow=local")
|
|
||||||
endif()
|
|
||||||
|
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC")
|
if(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC")
|
||||||
set(COMPILER_FLAGS "/permissive-")
|
set(COMPILER_FLAGS "/permissive-")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
# Required include paths to compile the FSFW
|
# Required include paths to compile the FSFW
|
||||||
target_include_directories(${LIB_FSFW_NAME} INTERFACE
|
target_include_directories(
|
||||||
${CMAKE_SOURCE_DIR}
|
${LIB_FSFW_NAME} INTERFACE ${CMAKE_SOURCE_DIR} ${FSFW_CONFIG_PATH_ABSOLUTE}
|
||||||
${FSFW_CONFIG_PATH_ABSOLUTE}
|
${FSFW_CORE_INC_PATH} ${FSFW_ADD_INC_PATHS_ABS})
|
||||||
${FSFW_CORE_INC_PATH}
|
|
||||||
${FSFW_ADD_INC_PATHS_ABS}
|
|
||||||
)
|
|
||||||
|
|
||||||
# Includes path required to compile FSFW itself as well
|
# Includes path required to compile FSFW itself as well We assume that the
|
||||||
# We assume that the fsfwconfig folder uses include relative to the project
|
# fsfwconfig folder uses include relative to the project root here!
|
||||||
# root here!
|
target_include_directories(
|
||||||
target_include_directories(${LIB_FSFW_NAME} PRIVATE
|
${LIB_FSFW_NAME} PRIVATE ${CMAKE_SOURCE_DIR} ${FSFW_CONFIG_PATH_ABSOLUTE}
|
||||||
${CMAKE_SOURCE_DIR}
|
${FSFW_CORE_INC_PATH} ${FSFW_ADD_INC_PATHS_ABS})
|
||||||
${FSFW_CONFIG_PATH_ABSOLUTE}
|
|
||||||
${FSFW_CORE_INC_PATH}
|
|
||||||
${FSFW_ADD_INC_PATHS_ABS}
|
|
||||||
)
|
|
||||||
|
|
||||||
target_compile_options(${LIB_FSFW_NAME} PRIVATE
|
target_compile_options(${LIB_FSFW_NAME} PRIVATE ${FSFW_WARNING_FLAGS}
|
||||||
${FSFW_WARNING_FLAGS}
|
${COMPILER_FLAGS})
|
||||||
${COMPILER_FLAGS}
|
|
||||||
)
|
|
||||||
|
|
||||||
target_link_libraries(${LIB_FSFW_NAME} PRIVATE
|
target_link_libraries(${LIB_FSFW_NAME} PRIVATE ${FSFW_ADDITIONAL_LINK_LIBS})
|
||||||
${FSFW_ETL_LINK_TARGET}
|
target_link_libraries(${LIB_FSFW_NAME} PUBLIC ${FSFW_ETL_LINK_TARGET})
|
||||||
${FSFW_ADDITIONAL_LINK_LIBS}
|
|
||||||
)
|
|
||||||
|
|
||||||
string(CONCAT POST_BUILD_COMMENT
|
string(
|
||||||
|
CONCAT
|
||||||
|
POST_BUILD_COMMENT
|
||||||
"######################################################################\n"
|
"######################################################################\n"
|
||||||
"Built FSFW v${FSFW_VERSION}.${FSFW_SUBVERSION}.${FSFW_REVISION}, "
|
"Built FSFW v${FSFW_VERSION}.${FSFW_SUBVERSION}.${FSFW_REVISION}, "
|
||||||
"Target OSAL: ${FSFW_OS_NAME}\n"
|
"Target OSAL: ${FSFW_OS_NAME}\n"
|
||||||
"######################################################################\n"
|
"######################################################################\n")
|
||||||
)
|
|
||||||
|
|
||||||
add_custom_command(
|
add_custom_command(
|
||||||
TARGET ${LIB_FSFW_NAME}
|
TARGET ${LIB_FSFW_NAME}
|
||||||
POST_BUILD
|
POST_BUILD
|
||||||
COMMENT ${POST_BUILD_COMMENT}
|
COMMENT ${POST_BUILD_COMMENT})
|
||||||
)
|
|
||||||
|
0
FSFWVersion.h.in
Normal file
0
FSFWVersion.h.in
Normal file
15
README.md
15
README.md
@ -99,7 +99,7 @@ add and link against the FSFW library in general.
|
|||||||
|
|
||||||
4. Link against the FSFW library
|
4. Link against the FSFW library
|
||||||
|
|
||||||
```cmake
|
```sh
|
||||||
target_link_libraries(${YourProjectName} PRIVATE fsfw)
|
target_link_libraries(${YourProjectName} PRIVATE fsfw)
|
||||||
```
|
```
|
||||||
|
|
||||||
@ -131,15 +131,15 @@ default. This can be disabled by setting the `FSFW_TESTS_COV_GEN` option to `OFF
|
|||||||
You can use the following commands inside the `fsfw` folder to set up the build system
|
You can use the following commands inside the `fsfw` folder to set up the build system
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
mkdir build-Unittest && cd build-Unittest
|
mkdir build-tests && cd build-tests
|
||||||
cmake -DFSFW_BUILD_UNITTESTS=ON -DFSFW_OSAL=host -DCMAKE_BUILD_TYPE=Debug ..
|
cmake -DFSFW_BUILD_TESTS=ON -DFSFW_OSAL=host -DCMAKE_BUILD_TYPE=Debug ..
|
||||||
```
|
```
|
||||||
|
|
||||||
You can also use `-DFSFW_OSAL=linux` on Linux systems.
|
You can also use `-DFSFW_OSAL=linux` on Linux systems.
|
||||||
|
|
||||||
Coverage data in HTML format can be generated using the `CodeCoverage`
|
Coverage data in HTML format can be generated using the `CodeCoverage`
|
||||||
[CMake module](https://github.com/bilke/cmake-modules/tree/master).
|
[CMake module](https://github.com/bilke/cmake-modules/tree/master).
|
||||||
To build the unittests, run them and then generare the coverage data in this format,
|
To build the unittests, run them and then generate the coverage data in this format,
|
||||||
the following command can be used inside the build directory after the build system was set up
|
the following command can be used inside the build directory after the build system was set up
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
@ -175,7 +175,7 @@ cmake -DFSFW_BUILD_DOCS=ON -DFSFW_OSAL=host ..
|
|||||||
Then you can generate the documentation using
|
Then you can generate the documentation using
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
cmake --build . -j
|
cmake --build . -- Sphinx -j
|
||||||
```
|
```
|
||||||
|
|
||||||
You can find the generated documentation inside the `docs/sphinx` folder inside the build
|
You can find the generated documentation inside the `docs/sphinx` folder inside the build
|
||||||
@ -188,7 +188,10 @@ and open the documentation conveniently. Try `helper.py -h for more information.
|
|||||||
|
|
||||||
The formatting is done by the `clang-format` tool. The configuration is contained within the
|
The formatting is done by the `clang-format` tool. The configuration is contained within the
|
||||||
`.clang-format` file in the repository root. As long as `clang-format` is installed, you
|
`.clang-format` file in the repository root. As long as `clang-format` is installed, you
|
||||||
can run the `apply-clang-format.sh` helper script to format all source files consistently.
|
can run the `auto-format.sh` helper script to format all source files consistently. Furthermore cmake-format is required to format CMake files which can be installed with:
|
||||||
|
````sh
|
||||||
|
sudo pip install cmakelang
|
||||||
|
````
|
||||||
|
|
||||||
## Index
|
## Index
|
||||||
|
|
||||||
|
@ -5,10 +5,25 @@ RUN apt-get --yes upgrade
|
|||||||
|
|
||||||
#tzdata is a dependency, won't install otherwise
|
#tzdata is a dependency, won't install otherwise
|
||||||
ARG DEBIAN_FRONTEND=noninteractive
|
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 && \
|
RUN git clone https://github.com/catchorg/Catch2.git && \
|
||||||
cd Catch2 && \
|
cd Catch2 && \
|
||||||
git checkout v3.0.0-preview5 && \
|
git checkout v3.1.0 && \
|
||||||
cmake -Bbuild -H. -DBUILD_TESTING=OFF && \
|
cmake -Bbuild -H. -DBUILD_TESTING=OFF && \
|
||||||
cmake --build build/ --target install
|
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/
|
||||||
|
|
||||||
|
#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
122
automation/Jenkinsfile
vendored
@ -1,41 +1,125 @@
|
|||||||
pipeline {
|
pipeline {
|
||||||
environment {
|
environment {
|
||||||
BUILDDIR = 'build-tests'
|
BUILDDIR_HOST = 'cmake-build-tests-host'
|
||||||
|
BUILDDIR_LINUX = 'cmake-build-tests-linux'
|
||||||
|
DOCDDIR = 'cmake-build-documentation'
|
||||||
}
|
}
|
||||||
agent {
|
agent {
|
||||||
docker { image 'fsfw-ci:d2'}
|
docker {
|
||||||
|
image 'fsfw-ci:d6'
|
||||||
|
args '--network host --sysctl fs.mqueue.msg_max=100'
|
||||||
|
}
|
||||||
}
|
}
|
||||||
stages {
|
stages {
|
||||||
stage('Clean') {
|
stage('Host') {
|
||||||
steps {
|
stages{
|
||||||
sh 'rm -rf $BUILDDIR'
|
stage('Clean') {
|
||||||
}
|
steps {
|
||||||
}
|
sh 'rm -rf $BUILDDIR_HOST'
|
||||||
stage('Configure') {
|
}
|
||||||
steps {
|
}
|
||||||
dir(BUILDDIR) {
|
stage('Configure') {
|
||||||
sh 'cmake -DFSFW_OSAL=host -DFSFW_BUILD_UNITTESTS=ON ..'
|
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') {
|
stage('Linux') {
|
||||||
steps {
|
stages{
|
||||||
dir(BUILDDIR) {
|
stage('Clean') {
|
||||||
sh 'cmake --build . -j4'
|
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 {
|
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) {
|
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 {
|
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) {
|
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'
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,141 +0,0 @@
|
|||||||
# - Returns a version string from Git
|
|
||||||
#
|
|
||||||
# These functions force a re-configure on each git commit so that you can
|
|
||||||
# trust the values of the variables in your build system.
|
|
||||||
#
|
|
||||||
# get_git_head_revision(<refspecvar> <hashvar> [<additional arguments to git describe> ...])
|
|
||||||
#
|
|
||||||
# Returns the refspec and sha hash of the current head revision
|
|
||||||
#
|
|
||||||
# git_describe(<var> [<additional arguments to git describe> ...])
|
|
||||||
#
|
|
||||||
# Returns the results of git describe on the source tree, and adjusting
|
|
||||||
# the output so that it tests false if an error occurs.
|
|
||||||
#
|
|
||||||
# git_get_exact_tag(<var> [<additional arguments to git describe> ...])
|
|
||||||
#
|
|
||||||
# Returns the results of git describe --exact-match on the source tree,
|
|
||||||
# and adjusting the output so that it tests false if there was no exact
|
|
||||||
# matching tag.
|
|
||||||
#
|
|
||||||
# Requires CMake 2.6 or newer (uses the 'function' command)
|
|
||||||
#
|
|
||||||
# Original Author:
|
|
||||||
# 2009-2010 Ryan Pavlik <rpavlik@iastate.edu> <abiryan@ryand.net>
|
|
||||||
# http://academic.cleardefinition.com
|
|
||||||
# Iowa State University HCI Graduate Program/VRAC
|
|
||||||
#
|
|
||||||
# Copyright Iowa State University 2009-2010.
|
|
||||||
# Distributed under the Boost Software License, Version 1.0.
|
|
||||||
# (See accompanying file LICENSE_1_0.txt or copy at
|
|
||||||
# http://www.boost.org/LICENSE_1_0.txt)
|
|
||||||
|
|
||||||
if(__get_git_revision_description)
|
|
||||||
return()
|
|
||||||
endif()
|
|
||||||
set(__get_git_revision_description YES)
|
|
||||||
|
|
||||||
# We must run the following at "include" time, not at function call time,
|
|
||||||
# to find the path to this module rather than the path to a calling list file
|
|
||||||
get_filename_component(_gitdescmoddir ${CMAKE_CURRENT_LIST_FILE} PATH)
|
|
||||||
|
|
||||||
function(get_git_head_revision _refspecvar _hashvar)
|
|
||||||
set(GIT_PARENT_DIR "${CMAKE_CURRENT_SOURCE_DIR}")
|
|
||||||
set(GIT_DIR "${GIT_PARENT_DIR}/.git")
|
|
||||||
while(NOT EXISTS "${GIT_DIR}") # .git dir not found, search parent directories
|
|
||||||
set(GIT_PREVIOUS_PARENT "${GIT_PARENT_DIR}")
|
|
||||||
get_filename_component(GIT_PARENT_DIR ${GIT_PARENT_DIR} PATH)
|
|
||||||
if(GIT_PARENT_DIR STREQUAL GIT_PREVIOUS_PARENT)
|
|
||||||
# We have reached the root directory, we are not in git
|
|
||||||
set(${_refspecvar} "GITDIR-NOTFOUND" PARENT_SCOPE)
|
|
||||||
set(${_hashvar} "GITDIR-NOTFOUND" PARENT_SCOPE)
|
|
||||||
return()
|
|
||||||
endif()
|
|
||||||
set(GIT_DIR "${GIT_PARENT_DIR}/.git")
|
|
||||||
endwhile()
|
|
||||||
# check if this is a submodule
|
|
||||||
if(NOT IS_DIRECTORY ${GIT_DIR})
|
|
||||||
file(READ ${GIT_DIR} submodule)
|
|
||||||
string(REGEX REPLACE "gitdir: (.*)\n$" "\\1" GIT_DIR_RELATIVE ${submodule})
|
|
||||||
get_filename_component(SUBMODULE_DIR ${GIT_DIR} PATH)
|
|
||||||
|
|
||||||
if (IS_ABSOLUTE ${GIT_DIR_RELATIVE})
|
|
||||||
set(GIT_DIR ${GIT_DIR_RELATIVE})
|
|
||||||
else()
|
|
||||||
get_filename_component(GIT_DIR ${SUBMODULE_DIR}/${GIT_DIR_RELATIVE} ABSOLUTE)
|
|
||||||
endif()
|
|
||||||
|
|
||||||
endif()
|
|
||||||
set(GIT_DATA "${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/git-data")
|
|
||||||
if(NOT EXISTS "${GIT_DATA}")
|
|
||||||
file(MAKE_DIRECTORY "${GIT_DATA}")
|
|
||||||
endif()
|
|
||||||
|
|
||||||
if(NOT EXISTS "${GIT_DIR}/HEAD")
|
|
||||||
return()
|
|
||||||
endif()
|
|
||||||
set(HEAD_FILE "${GIT_DATA}/HEAD")
|
|
||||||
configure_file("${GIT_DIR}/HEAD" "${HEAD_FILE}" COPYONLY)
|
|
||||||
|
|
||||||
configure_file("${_gitdescmoddir}/GetGitRevisionDescription.cmake.in"
|
|
||||||
"${GIT_DATA}/grabRef.cmake"
|
|
||||||
@ONLY)
|
|
||||||
include("${GIT_DATA}/grabRef.cmake")
|
|
||||||
|
|
||||||
set(${_refspecvar} "${HEAD_REF}" PARENT_SCOPE)
|
|
||||||
set(${_hashvar} "${HEAD_HASH}" PARENT_SCOPE)
|
|
||||||
endfunction()
|
|
||||||
|
|
||||||
function(git_describe _var)
|
|
||||||
if(NOT GIT_FOUND)
|
|
||||||
find_package(Git QUIET)
|
|
||||||
endif()
|
|
||||||
get_git_head_revision(refspec hash)
|
|
||||||
if(NOT GIT_FOUND)
|
|
||||||
set(${_var} "GIT-NOTFOUND" PARENT_SCOPE)
|
|
||||||
return()
|
|
||||||
endif()
|
|
||||||
if(NOT hash)
|
|
||||||
set(${_var} "HEAD-HASH-NOTFOUND" PARENT_SCOPE)
|
|
||||||
return()
|
|
||||||
endif()
|
|
||||||
|
|
||||||
# TODO sanitize
|
|
||||||
#if((${ARGN}" MATCHES "&&") OR
|
|
||||||
# (ARGN MATCHES "||") OR
|
|
||||||
# (ARGN MATCHES "\\;"))
|
|
||||||
# message("Please report the following error to the project!")
|
|
||||||
# message(FATAL_ERROR "Looks like someone's doing something nefarious with git_describe! Passed arguments ${ARGN}")
|
|
||||||
#endif()
|
|
||||||
|
|
||||||
#message(STATUS "Arguments to execute_process: ${ARGN}")
|
|
||||||
|
|
||||||
execute_process(COMMAND
|
|
||||||
${GIT_EXECUTABLE}
|
|
||||||
describe
|
|
||||||
${hash}
|
|
||||||
${ARGN}
|
|
||||||
WORKING_DIRECTORY
|
|
||||||
"${CMAKE_SOURCE_DIR}"
|
|
||||||
RESULT_VARIABLE
|
|
||||||
res
|
|
||||||
OUTPUT_VARIABLE
|
|
||||||
out
|
|
||||||
ERROR_QUIET
|
|
||||||
OUTPUT_STRIP_TRAILING_WHITESPACE)
|
|
||||||
if(NOT res EQUAL 0)
|
|
||||||
set(out "${out}-${res}-NOTFOUND")
|
|
||||||
endif()
|
|
||||||
|
|
||||||
set(${_var} "${out}" PARENT_SCOPE)
|
|
||||||
endfunction()
|
|
||||||
|
|
||||||
function(git_get_exact_tag _var)
|
|
||||||
git_describe(out --exact-match ${ARGN})
|
|
||||||
set(${_var} "${out}" PARENT_SCOPE)
|
|
||||||
endfunction()
|
|
||||||
|
|
||||||
function(git_get_tag _var)
|
|
||||||
git_describe(out --tags ${ARGN})
|
|
||||||
set(${_var} "${out}" PARENT_SCOPE)
|
|
||||||
endfunction()
|
|
@ -1,5 +1,7 @@
|
|||||||
The files in these folder were manually copy and pasted from the
|
The files in the `bilke` folder were manually copy and pasted from the
|
||||||
[cmake-modules repository](https://github.com/bilke/cmake-modules). It was decided to do
|
[cmake-modules repository](https://github.com/bilke/cmake-modules). It was decided to do
|
||||||
this because only a small subset of its provided functions are needed.
|
this because only a small subset of its provided functions are needed.
|
||||||
|
|
||||||
The license file in included here as well.
|
The files in the `rpavlik` folder were manually copy and pasted from the
|
||||||
|
[cmake-modules repository](https://github.com/rpavlik/cmake-modules). It was decided to do
|
||||||
|
this because only a small subset of its provided functions are needed.
|
||||||
|
@ -140,7 +140,7 @@ find_program( GCOV_PATH gcov )
|
|||||||
find_program( LCOV_PATH NAMES lcov lcov.bat lcov.exe lcov.perl)
|
find_program( LCOV_PATH NAMES lcov lcov.bat lcov.exe lcov.perl)
|
||||||
find_program( FASTCOV_PATH NAMES fastcov fastcov.py )
|
find_program( FASTCOV_PATH NAMES fastcov fastcov.py )
|
||||||
find_program( GENHTML_PATH NAMES genhtml genhtml.perl genhtml.bat )
|
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 )
|
find_program( CPPFILT_PATH NAMES c++filt )
|
||||||
|
|
||||||
if(NOT GCOV_PATH)
|
if(NOT GCOV_PATH)
|
284
cmake/cmake-modules/rpavlik/GetGitRevisionDescription.cmake
Normal file
284
cmake/cmake-modules/rpavlik/GetGitRevisionDescription.cmake
Normal file
@ -0,0 +1,284 @@
|
|||||||
|
# - Returns a version string from Git
|
||||||
|
#
|
||||||
|
# These functions force a re-configure on each git commit so that you can
|
||||||
|
# trust the values of the variables in your build system.
|
||||||
|
#
|
||||||
|
# get_git_head_revision(<refspecvar> <hashvar> [ALLOW_LOOKING_ABOVE_CMAKE_SOURCE_DIR])
|
||||||
|
#
|
||||||
|
# Returns the refspec and sha hash of the current head revision
|
||||||
|
#
|
||||||
|
# git_describe(<var> [<additional arguments to git describe> ...])
|
||||||
|
#
|
||||||
|
# Returns the results of git describe on the source tree, and adjusting
|
||||||
|
# the output so that it tests false if an error occurs.
|
||||||
|
#
|
||||||
|
# git_describe_working_tree(<var> [<additional arguments to git describe> ...])
|
||||||
|
#
|
||||||
|
# Returns the results of git describe on the working tree (--dirty option),
|
||||||
|
# and adjusting the output so that it tests false if an error occurs.
|
||||||
|
#
|
||||||
|
# git_get_exact_tag(<var> [<additional arguments to git describe> ...])
|
||||||
|
#
|
||||||
|
# Returns the results of git describe --exact-match on the source tree,
|
||||||
|
# and adjusting the output so that it tests false if there was no exact
|
||||||
|
# matching tag.
|
||||||
|
#
|
||||||
|
# git_local_changes(<var>)
|
||||||
|
#
|
||||||
|
# Returns either "CLEAN" or "DIRTY" with respect to uncommitted changes.
|
||||||
|
# Uses the return code of "git diff-index --quiet HEAD --".
|
||||||
|
# Does not regard untracked files.
|
||||||
|
#
|
||||||
|
# Requires CMake 2.6 or newer (uses the 'function' command)
|
||||||
|
#
|
||||||
|
# Original Author:
|
||||||
|
# 2009-2020 Ryan Pavlik <ryan.pavlik@gmail.com> <abiryan@ryand.net>
|
||||||
|
# http://academic.cleardefinition.com
|
||||||
|
#
|
||||||
|
# Copyright 2009-2013, Iowa State University.
|
||||||
|
# Copyright 2013-2020, Ryan Pavlik
|
||||||
|
# Copyright 2013-2020, Contributors
|
||||||
|
# SPDX-License-Identifier: BSL-1.0
|
||||||
|
# Distributed under the Boost Software License, Version 1.0.
|
||||||
|
# (See accompanying file LICENSE_1_0.txt or copy at
|
||||||
|
# http://www.boost.org/LICENSE_1_0.txt)
|
||||||
|
|
||||||
|
if(__get_git_revision_description)
|
||||||
|
return()
|
||||||
|
endif()
|
||||||
|
set(__get_git_revision_description YES)
|
||||||
|
|
||||||
|
# We must run the following at "include" time, not at function call time,
|
||||||
|
# to find the path to this module rather than the path to a calling list file
|
||||||
|
get_filename_component(_gitdescmoddir ${CMAKE_CURRENT_LIST_FILE} PATH)
|
||||||
|
|
||||||
|
# Function _git_find_closest_git_dir finds the next closest .git directory
|
||||||
|
# that is part of any directory in the path defined by _start_dir.
|
||||||
|
# The result is returned in the parent scope variable whose name is passed
|
||||||
|
# as variable _git_dir_var. If no .git directory can be found, the
|
||||||
|
# function returns an empty string via _git_dir_var.
|
||||||
|
#
|
||||||
|
# Example: Given a path C:/bla/foo/bar and assuming C:/bla/.git exists and
|
||||||
|
# neither foo nor bar contain a file/directory .git. This wil return
|
||||||
|
# C:/bla/.git
|
||||||
|
#
|
||||||
|
function(_git_find_closest_git_dir _start_dir _git_dir_var)
|
||||||
|
set(cur_dir "${_start_dir}")
|
||||||
|
set(git_dir "${_start_dir}/.git")
|
||||||
|
while(NOT EXISTS "${git_dir}")
|
||||||
|
# .git dir not found, search parent directories
|
||||||
|
set(git_previous_parent "${cur_dir}")
|
||||||
|
get_filename_component(cur_dir "${cur_dir}" DIRECTORY)
|
||||||
|
if(cur_dir STREQUAL git_previous_parent)
|
||||||
|
# We have reached the root directory, we are not in git
|
||||||
|
set(${_git_dir_var}
|
||||||
|
""
|
||||||
|
PARENT_SCOPE)
|
||||||
|
return()
|
||||||
|
endif()
|
||||||
|
set(git_dir "${cur_dir}/.git")
|
||||||
|
endwhile()
|
||||||
|
set(${_git_dir_var}
|
||||||
|
"${git_dir}"
|
||||||
|
PARENT_SCOPE)
|
||||||
|
endfunction()
|
||||||
|
|
||||||
|
function(get_git_head_revision _refspecvar _hashvar)
|
||||||
|
_git_find_closest_git_dir("${CMAKE_CURRENT_SOURCE_DIR}" GIT_DIR)
|
||||||
|
|
||||||
|
if("${ARGN}" STREQUAL "ALLOW_LOOKING_ABOVE_CMAKE_SOURCE_DIR")
|
||||||
|
set(ALLOW_LOOKING_ABOVE_CMAKE_SOURCE_DIR TRUE)
|
||||||
|
else()
|
||||||
|
set(ALLOW_LOOKING_ABOVE_CMAKE_SOURCE_DIR FALSE)
|
||||||
|
endif()
|
||||||
|
if(NOT "${GIT_DIR}" STREQUAL "")
|
||||||
|
file(RELATIVE_PATH _relative_to_source_dir "${CMAKE_SOURCE_DIR}"
|
||||||
|
"${GIT_DIR}")
|
||||||
|
if("${_relative_to_source_dir}" MATCHES "[.][.]" AND NOT ALLOW_LOOKING_ABOVE_CMAKE_SOURCE_DIR)
|
||||||
|
# We've gone above the CMake root dir.
|
||||||
|
set(GIT_DIR "")
|
||||||
|
endif()
|
||||||
|
endif()
|
||||||
|
if("${GIT_DIR}" STREQUAL "")
|
||||||
|
set(${_refspecvar}
|
||||||
|
"GITDIR-NOTFOUND"
|
||||||
|
PARENT_SCOPE)
|
||||||
|
set(${_hashvar}
|
||||||
|
"GITDIR-NOTFOUND"
|
||||||
|
PARENT_SCOPE)
|
||||||
|
return()
|
||||||
|
endif()
|
||||||
|
|
||||||
|
# Check if the current source dir is a git submodule or a worktree.
|
||||||
|
# In both cases .git is a file instead of a directory.
|
||||||
|
#
|
||||||
|
if(NOT IS_DIRECTORY ${GIT_DIR})
|
||||||
|
# The following git command will return a non empty string that
|
||||||
|
# points to the super project working tree if the current
|
||||||
|
# source dir is inside a git submodule.
|
||||||
|
# Otherwise the command will return an empty string.
|
||||||
|
#
|
||||||
|
execute_process(
|
||||||
|
COMMAND "${GIT_EXECUTABLE}" rev-parse
|
||||||
|
--show-superproject-working-tree
|
||||||
|
WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}"
|
||||||
|
OUTPUT_VARIABLE out
|
||||||
|
ERROR_QUIET OUTPUT_STRIP_TRAILING_WHITESPACE)
|
||||||
|
if(NOT "${out}" STREQUAL "")
|
||||||
|
# If out is empty, GIT_DIR/CMAKE_CURRENT_SOURCE_DIR is in a submodule
|
||||||
|
file(READ ${GIT_DIR} submodule)
|
||||||
|
string(REGEX REPLACE "gitdir: (.*)$" "\\1" GIT_DIR_RELATIVE
|
||||||
|
${submodule})
|
||||||
|
string(STRIP ${GIT_DIR_RELATIVE} GIT_DIR_RELATIVE)
|
||||||
|
get_filename_component(SUBMODULE_DIR ${GIT_DIR} PATH)
|
||||||
|
get_filename_component(GIT_DIR ${SUBMODULE_DIR}/${GIT_DIR_RELATIVE}
|
||||||
|
ABSOLUTE)
|
||||||
|
set(HEAD_SOURCE_FILE "${GIT_DIR}/HEAD")
|
||||||
|
else()
|
||||||
|
# GIT_DIR/CMAKE_CURRENT_SOURCE_DIR is in a worktree
|
||||||
|
file(READ ${GIT_DIR} worktree_ref)
|
||||||
|
# The .git directory contains a path to the worktree information directory
|
||||||
|
# inside the parent git repo of the worktree.
|
||||||
|
#
|
||||||
|
string(REGEX REPLACE "gitdir: (.*)$" "\\1" git_worktree_dir
|
||||||
|
${worktree_ref})
|
||||||
|
string(STRIP ${git_worktree_dir} git_worktree_dir)
|
||||||
|
_git_find_closest_git_dir("${git_worktree_dir}" GIT_DIR)
|
||||||
|
set(HEAD_SOURCE_FILE "${git_worktree_dir}/HEAD")
|
||||||
|
endif()
|
||||||
|
else()
|
||||||
|
set(HEAD_SOURCE_FILE "${GIT_DIR}/HEAD")
|
||||||
|
endif()
|
||||||
|
set(GIT_DATA "${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/git-data")
|
||||||
|
if(NOT EXISTS "${GIT_DATA}")
|
||||||
|
file(MAKE_DIRECTORY "${GIT_DATA}")
|
||||||
|
endif()
|
||||||
|
|
||||||
|
if(NOT EXISTS "${HEAD_SOURCE_FILE}")
|
||||||
|
return()
|
||||||
|
endif()
|
||||||
|
set(HEAD_FILE "${GIT_DATA}/HEAD")
|
||||||
|
configure_file("${HEAD_SOURCE_FILE}" "${HEAD_FILE}" COPYONLY)
|
||||||
|
|
||||||
|
configure_file("${_gitdescmoddir}/GetGitRevisionDescription.cmake.in"
|
||||||
|
"${GIT_DATA}/grabRef.cmake" @ONLY)
|
||||||
|
include("${GIT_DATA}/grabRef.cmake")
|
||||||
|
|
||||||
|
set(${_refspecvar}
|
||||||
|
"${HEAD_REF}"
|
||||||
|
PARENT_SCOPE)
|
||||||
|
set(${_hashvar}
|
||||||
|
"${HEAD_HASH}"
|
||||||
|
PARENT_SCOPE)
|
||||||
|
endfunction()
|
||||||
|
|
||||||
|
function(git_describe _var)
|
||||||
|
if(NOT GIT_FOUND)
|
||||||
|
find_package(Git QUIET)
|
||||||
|
endif()
|
||||||
|
get_git_head_revision(refspec hash)
|
||||||
|
if(NOT GIT_FOUND)
|
||||||
|
set(${_var}
|
||||||
|
"GIT-NOTFOUND"
|
||||||
|
PARENT_SCOPE)
|
||||||
|
return()
|
||||||
|
endif()
|
||||||
|
if(NOT hash)
|
||||||
|
set(${_var}
|
||||||
|
"HEAD-HASH-NOTFOUND"
|
||||||
|
PARENT_SCOPE)
|
||||||
|
return()
|
||||||
|
endif()
|
||||||
|
|
||||||
|
# TODO sanitize
|
||||||
|
#if((${ARGN}" MATCHES "&&") OR
|
||||||
|
# (ARGN MATCHES "||") OR
|
||||||
|
# (ARGN MATCHES "\\;"))
|
||||||
|
# message("Please report the following error to the project!")
|
||||||
|
# message(FATAL_ERROR "Looks like someone's doing something nefarious with git_describe! Passed arguments ${ARGN}")
|
||||||
|
#endif()
|
||||||
|
|
||||||
|
#message(STATUS "Arguments to execute_process: ${ARGN}")
|
||||||
|
|
||||||
|
execute_process(
|
||||||
|
COMMAND "${GIT_EXECUTABLE}" describe --tags --always ${hash} ${ARGN}
|
||||||
|
WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}"
|
||||||
|
RESULT_VARIABLE res
|
||||||
|
OUTPUT_VARIABLE out
|
||||||
|
ERROR_QUIET OUTPUT_STRIP_TRAILING_WHITESPACE)
|
||||||
|
if(NOT res EQUAL 0)
|
||||||
|
set(out "${out}-${res}-NOTFOUND")
|
||||||
|
endif()
|
||||||
|
|
||||||
|
set(${_var}
|
||||||
|
"${out}"
|
||||||
|
PARENT_SCOPE)
|
||||||
|
endfunction()
|
||||||
|
|
||||||
|
function(git_describe_working_tree _var)
|
||||||
|
if(NOT GIT_FOUND)
|
||||||
|
find_package(Git QUIET)
|
||||||
|
endif()
|
||||||
|
if(NOT GIT_FOUND)
|
||||||
|
set(${_var}
|
||||||
|
"GIT-NOTFOUND"
|
||||||
|
PARENT_SCOPE)
|
||||||
|
return()
|
||||||
|
endif()
|
||||||
|
|
||||||
|
execute_process(
|
||||||
|
COMMAND "${GIT_EXECUTABLE}" describe --dirty ${ARGN}
|
||||||
|
WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}"
|
||||||
|
RESULT_VARIABLE res
|
||||||
|
OUTPUT_VARIABLE out
|
||||||
|
ERROR_QUIET OUTPUT_STRIP_TRAILING_WHITESPACE)
|
||||||
|
if(NOT res EQUAL 0)
|
||||||
|
set(out "${out}-${res}-NOTFOUND")
|
||||||
|
endif()
|
||||||
|
|
||||||
|
set(${_var}
|
||||||
|
"${out}"
|
||||||
|
PARENT_SCOPE)
|
||||||
|
endfunction()
|
||||||
|
|
||||||
|
function(git_get_exact_tag _var)
|
||||||
|
git_describe(out --exact-match ${ARGN})
|
||||||
|
set(${_var}
|
||||||
|
"${out}"
|
||||||
|
PARENT_SCOPE)
|
||||||
|
endfunction()
|
||||||
|
|
||||||
|
function(git_local_changes _var)
|
||||||
|
if(NOT GIT_FOUND)
|
||||||
|
find_package(Git QUIET)
|
||||||
|
endif()
|
||||||
|
get_git_head_revision(refspec hash)
|
||||||
|
if(NOT GIT_FOUND)
|
||||||
|
set(${_var}
|
||||||
|
"GIT-NOTFOUND"
|
||||||
|
PARENT_SCOPE)
|
||||||
|
return()
|
||||||
|
endif()
|
||||||
|
if(NOT hash)
|
||||||
|
set(${_var}
|
||||||
|
"HEAD-HASH-NOTFOUND"
|
||||||
|
PARENT_SCOPE)
|
||||||
|
return()
|
||||||
|
endif()
|
||||||
|
|
||||||
|
execute_process(
|
||||||
|
COMMAND "${GIT_EXECUTABLE}" diff-index --quiet HEAD --
|
||||||
|
WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}"
|
||||||
|
RESULT_VARIABLE res
|
||||||
|
OUTPUT_VARIABLE out
|
||||||
|
ERROR_QUIET OUTPUT_STRIP_TRAILING_WHITESPACE)
|
||||||
|
if(res EQUAL 0)
|
||||||
|
set(${_var}
|
||||||
|
"CLEAN"
|
||||||
|
PARENT_SCOPE)
|
||||||
|
else()
|
||||||
|
set(${_var}
|
||||||
|
"DIRTY"
|
||||||
|
PARENT_SCOPE)
|
||||||
|
endif()
|
||||||
|
endfunction()
|
@ -1,4 +1,4 @@
|
|||||||
#
|
#
|
||||||
# Internal file for GetGitRevisionDescription.cmake
|
# Internal file for GetGitRevisionDescription.cmake
|
||||||
#
|
#
|
||||||
# Requires CMake 2.6 or newer (uses the 'function' command)
|
# Requires CMake 2.6 or newer (uses the 'function' command)
|
||||||
@ -8,10 +8,12 @@
|
|||||||
# http://academic.cleardefinition.com
|
# http://academic.cleardefinition.com
|
||||||
# Iowa State University HCI Graduate Program/VRAC
|
# Iowa State University HCI Graduate Program/VRAC
|
||||||
#
|
#
|
||||||
# Copyright Iowa State University 2009-2010.
|
# Copyright 2009-2012, Iowa State University
|
||||||
|
# Copyright 2011-2015, Contributors
|
||||||
# Distributed under the Boost Software License, Version 1.0.
|
# Distributed under the Boost Software License, Version 1.0.
|
||||||
# (See accompanying file LICENSE_1_0.txt or copy at
|
# (See accompanying file LICENSE_1_0.txt or copy at
|
||||||
# http://www.boost.org/LICENSE_1_0.txt)
|
# http://www.boost.org/LICENSE_1_0.txt)
|
||||||
|
# SPDX-License-Identifier: BSL-1.0
|
||||||
|
|
||||||
set(HEAD_HASH)
|
set(HEAD_HASH)
|
||||||
|
|
||||||
@ -22,10 +24,13 @@ if(HEAD_CONTENTS MATCHES "ref")
|
|||||||
# named branch
|
# named branch
|
||||||
string(REPLACE "ref: " "" HEAD_REF "${HEAD_CONTENTS}")
|
string(REPLACE "ref: " "" HEAD_REF "${HEAD_CONTENTS}")
|
||||||
if(EXISTS "@GIT_DIR@/${HEAD_REF}")
|
if(EXISTS "@GIT_DIR@/${HEAD_REF}")
|
||||||
configure_file("@GIT_DIR@/${HEAD_REF}" "@GIT_DATA@/head-ref" COPYONLY)
|
configure_file("@GIT_DIR@/${HEAD_REF}" "@GIT_DATA@/head-ref" COPYONLY)
|
||||||
elseif(EXISTS "@GIT_DIR@/logs/${HEAD_REF}")
|
else()
|
||||||
configure_file("@GIT_DIR@/logs/${HEAD_REF}" "@GIT_DATA@/head-ref" COPYONLY)
|
configure_file("@GIT_DIR@/packed-refs" "@GIT_DATA@/packed-refs" COPYONLY)
|
||||||
set(HEAD_HASH "${HEAD_REF}")
|
file(READ "@GIT_DATA@/packed-refs" PACKED_REFS)
|
||||||
|
if(${PACKED_REFS} MATCHES "([0-9a-z]*) ${HEAD_REF}")
|
||||||
|
set(HEAD_HASH "${CMAKE_MATCH_1}")
|
||||||
|
endif()
|
||||||
endif()
|
endif()
|
||||||
else()
|
else()
|
||||||
# detached HEAD
|
# detached HEAD
|
||||||
@ -33,6 +38,6 @@ else()
|
|||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(NOT HEAD_HASH)
|
if(NOT HEAD_HASH)
|
||||||
file(READ "@GIT_DATA@/head-ref" HEAD_HASH LIMIT 1024)
|
file(READ "@GIT_DATA@/head-ref" HEAD_HASH LIMIT 1024)
|
||||||
string(STRIP "${HEAD_HASH}" HEAD_HASH)
|
string(STRIP "${HEAD_HASH}" HEAD_HASH)
|
||||||
endif()
|
endif()
|
26
cmake/cmake-modules/rpavlik/LICENSES/BSD-3-Clause.txt
Normal file
26
cmake/cmake-modules/rpavlik/LICENSES/BSD-3-Clause.txt
Normal file
@ -0,0 +1,26 @@
|
|||||||
|
Copyright (c) <year> <owner>. All rights reserved.
|
||||||
|
|
||||||
|
Redistribution and use in source and binary forms, with or without modification,
|
||||||
|
are permitted provided that the following conditions are met:
|
||||||
|
|
||||||
|
1. Redistributions of source code must retain the above copyright notice,
|
||||||
|
this list of conditions and the following disclaimer.
|
||||||
|
|
||||||
|
2. Redistributions in binary form must reproduce the above copyright notice,
|
||||||
|
this list of conditions and the following disclaimer in the documentation
|
||||||
|
and/or other materials provided with the distribution.
|
||||||
|
|
||||||
|
3. Neither the name of the copyright holder nor the names of its contributors
|
||||||
|
may be used to endorse or promote products derived from this software without
|
||||||
|
specific prior written permission.
|
||||||
|
|
||||||
|
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||||
|
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||||
|
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||||
|
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
|
||||||
|
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||||
|
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
||||||
|
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
||||||
|
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
||||||
|
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
|
||||||
|
USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
23
cmake/cmake-modules/rpavlik/LICENSES/BSL-1.0.txt
Normal file
23
cmake/cmake-modules/rpavlik/LICENSES/BSL-1.0.txt
Normal file
@ -0,0 +1,23 @@
|
|||||||
|
Boost Software License - Version 1.0 - August 17th, 2003
|
||||||
|
|
||||||
|
Permission is hereby granted, free of charge, to any person or organization
|
||||||
|
obtaining a copy of the software and accompanying documentation covered by
|
||||||
|
this license (the "Software") to use, reproduce, display, distribute, execute,
|
||||||
|
and transmit the Software, and to prepare derivative works of the Software,
|
||||||
|
and to permit third-parties to whom the Software is furnished to do so, all
|
||||||
|
subject to the following:
|
||||||
|
|
||||||
|
The copyright notices in the Software and this entire statement, including
|
||||||
|
the above license grant, this restriction and the following disclaimer, must
|
||||||
|
be included in all copies of the Software, in whole or in part, and all derivative
|
||||||
|
works of the Software, unless such copies or derivative works are solely in
|
||||||
|
the form of machine-executable object code generated by a source language
|
||||||
|
processor.
|
||||||
|
|
||||||
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||||
|
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
|
||||||
|
FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE
|
||||||
|
COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE FOR ANY DAMAGES
|
||||||
|
OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||||
|
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||||
|
THE SOFTWARE.
|
23
cmake/cmake-modules/rpavlik/LICENSE_1_0.txt
Normal file
23
cmake/cmake-modules/rpavlik/LICENSE_1_0.txt
Normal file
@ -0,0 +1,23 @@
|
|||||||
|
Boost Software License - Version 1.0 - August 17th, 2003
|
||||||
|
|
||||||
|
Permission is hereby granted, free of charge, to any person or organization
|
||||||
|
obtaining a copy of the software and accompanying documentation covered by
|
||||||
|
this license (the "Software") to use, reproduce, display, distribute,
|
||||||
|
execute, and transmit the Software, and to prepare derivative works of the
|
||||||
|
Software, and to permit third-parties to whom the Software is furnished to
|
||||||
|
do so, all subject to the following:
|
||||||
|
|
||||||
|
The copyright notices in the Software and this entire statement, including
|
||||||
|
the above license grant, this restriction and the following disclaimer,
|
||||||
|
must be included in all copies of the Software, in whole or in part, and
|
||||||
|
all derivative works of the Software, unless such copies or derivative
|
||||||
|
works are solely in the form of machine-executable object code generated by
|
||||||
|
a source language processor.
|
||||||
|
|
||||||
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||||
|
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||||
|
FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT
|
||||||
|
SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE
|
||||||
|
FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE,
|
||||||
|
ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||||
|
DEALINGS IN THE SOFTWARE.
|
@ -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;
|
|
||||||
}
|
|
||||||
```
|
|
||||||
|
|
@ -1 +0,0 @@
|
|||||||
## Controllers
|
|
@ -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
|
|
||||||
|
|
@ -1 +0,0 @@
|
|||||||
## Device Handlers
|
|
@ -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 `HasReturnvaluesIF::makeReturnCode`
|
|
||||||
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)
|
|
@ -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 HasReturnvaluesIF::RETURN_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() == HasReturnvaluesIF::RETURN_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
|
|
||||||
|
|
||||||
|
|
@ -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.
|
|
||||||
|
|
||||||
|
|
@ -1 +0,0 @@
|
|||||||
## PUS Services
|
|
@ -4,6 +4,7 @@ API
|
|||||||
.. toctree::
|
.. toctree::
|
||||||
:maxdepth: 4
|
:maxdepth: 4
|
||||||
|
|
||||||
|
api/cfdp
|
||||||
api/objectmanager
|
api/objectmanager
|
||||||
api/task
|
api/task
|
||||||
api/ipc
|
api/ipc
|
||||||
|
8
docs/api/cfdp.rst
Normal file
8
docs/api/cfdp.rst
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
CFDP API
|
||||||
|
=================
|
||||||
|
|
||||||
|
``UserBase``
|
||||||
|
-----------------
|
||||||
|
|
||||||
|
.. doxygenclass:: cfdp::UserBase
|
||||||
|
:members:
|
@ -3,7 +3,7 @@
|
|||||||
Returnvalue API
|
Returnvalue API
|
||||||
==================
|
==================
|
||||||
|
|
||||||
.. doxygenfile:: HasReturnvaluesIF.h
|
.. doxygenfile:: returnvalue.h
|
||||||
|
|
||||||
.. _fwclassids:
|
.. _fwclassids:
|
||||||
|
|
||||||
|
26
docs/conf.py
26
docs/conf.py
@ -17,12 +17,12 @@
|
|||||||
|
|
||||||
# -- Project information -----------------------------------------------------
|
# -- Project information -----------------------------------------------------
|
||||||
|
|
||||||
project = 'Flight Software Framework'
|
project = "Flight Software Framework"
|
||||||
copyright = '2021, Institute of Space Systems (IRS)'
|
copyright = "2021, Institute of Space Systems (IRS)"
|
||||||
author = 'Institute of Space Systems (IRS)'
|
author = "Institute of Space Systems (IRS)"
|
||||||
|
|
||||||
# The full version, including alpha/beta/rc tags
|
# The full version, including alpha/beta/rc tags
|
||||||
release = '2.0.1'
|
release = "5.0.0"
|
||||||
|
|
||||||
|
|
||||||
# -- General configuration ---------------------------------------------------
|
# -- General configuration ---------------------------------------------------
|
||||||
@ -30,17 +30,17 @@ release = '2.0.1'
|
|||||||
# Add any Sphinx extension module names here, as strings. They can be
|
# Add any Sphinx extension module names here, as strings. They can be
|
||||||
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
|
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
|
||||||
# ones.
|
# ones.
|
||||||
extensions = [ "breathe" ]
|
extensions = ["breathe"]
|
||||||
|
|
||||||
breathe_default_project = "fsfw"
|
breathe_default_project = "fsfw"
|
||||||
|
|
||||||
# Add any paths that contain templates here, relative to this directory.
|
# 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
|
# List of patterns, relative to source directory, that match files and
|
||||||
# directories to ignore when looking for source files.
|
# directories to ignore when looking for source files.
|
||||||
# This pattern also affects html_static_path and html_extra_path.
|
# 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 -------------------------------------------------
|
# -- Options for HTML output -------------------------------------------------
|
||||||
@ -48,9 +48,17 @@ exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store']
|
|||||||
# The theme to use for HTML and HTML Help pages. See the documentation for
|
# The theme to use for HTML and HTML Help pages. See the documentation for
|
||||||
# a list of builtin themes.
|
# 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,
|
# 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,
|
# relative to this directory. They are copied after the builtin static files,
|
||||||
# so a file named "default.css" will overwrite the builtin "default.css".
|
# so a file named "default.css" will overwrite the builtin "default.css".
|
||||||
html_static_path = []
|
html_static_path = []
|
||||||
|
@ -75,11 +75,11 @@ and the respective source file with sensible default return values:
|
|||||||
void TestDeviceHandler::doShutDown() {}
|
void TestDeviceHandler::doShutDown() {}
|
||||||
|
|
||||||
ReturnValue_t TestDeviceHandler::buildNormalDeviceCommand(DeviceCommandId_t* id) {
|
ReturnValue_t TestDeviceHandler::buildNormalDeviceCommand(DeviceCommandId_t* id) {
|
||||||
return HasReturnvaluesIF::RETURN_OK;
|
return returnvalue::OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
ReturnValue_t TestDeviceHandler::buildTransitionDeviceCommand(DeviceCommandId_t* id) {
|
ReturnValue_t TestDeviceHandler::buildTransitionDeviceCommand(DeviceCommandId_t* id) {
|
||||||
return HasReturnvaluesIF::RETURN_OK;
|
return returnvalue::OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
void TestDeviceHandler::fillCommandAndReplyMap() {}
|
void TestDeviceHandler::fillCommandAndReplyMap() {}
|
||||||
@ -87,17 +87,17 @@ and the respective source file with sensible default return values:
|
|||||||
ReturnValue_t TestDeviceHandler::buildCommandFromCommand(DeviceCommandId_t deviceCommand,
|
ReturnValue_t TestDeviceHandler::buildCommandFromCommand(DeviceCommandId_t deviceCommand,
|
||||||
const uint8_t* commandData,
|
const uint8_t* commandData,
|
||||||
size_t commandDataLen) {
|
size_t commandDataLen) {
|
||||||
return HasReturnvaluesIF::RETURN_OK;
|
return returnvalue::OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
ReturnValue_t TestDeviceHandler::scanForReply(const uint8_t* start, size_t remainingSize,
|
ReturnValue_t TestDeviceHandler::scanForReply(const uint8_t* start, size_t remainingSize,
|
||||||
DeviceCommandId_t* foundId, size_t* foundLen) {
|
DeviceCommandId_t* foundId, size_t* foundLen) {
|
||||||
return HasReturnvaluesIF::RETURN_OK;
|
return returnvalue::OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
ReturnValue_t TestDeviceHandler::interpretDeviceReply(DeviceCommandId_t id,
|
ReturnValue_t TestDeviceHandler::interpretDeviceReply(DeviceCommandId_t id,
|
||||||
const uint8_t* packet) {
|
const uint8_t* packet) {
|
||||||
return HasReturnvaluesIF::RETURN_OK;
|
return returnvalue::OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
uint32_t TestDeviceHandler::getTransitionDelayMs(Mode_t modeFrom, Mode_t modeTo) {
|
uint32_t TestDeviceHandler::getTransitionDelayMs(Mode_t modeFrom, Mode_t modeTo) {
|
||||||
@ -106,5 +106,5 @@ and the respective source file with sensible default return values:
|
|||||||
|
|
||||||
ReturnValue_t TestDeviceHandler::initializeLocalDataPool(localpool::DataPool& localDataPoolMap,
|
ReturnValue_t TestDeviceHandler::initializeLocalDataPool(localpool::DataPool& localDataPoolMap,
|
||||||
LocalDataPoolManager& poolManager) {
|
LocalDataPoolManager& poolManager) {
|
||||||
return HasReturnvaluesIF::RETURN_OK;
|
return returnvalue::OK;
|
||||||
}
|
}
|
||||||
|
@ -106,7 +106,7 @@ You can use the following commands inside the ``fsfw`` folder to set up the buil
|
|||||||
.. code-block:: console
|
.. code-block:: console
|
||||||
|
|
||||||
mkdir build-tests && cd build-tests
|
mkdir build-tests && cd build-tests
|
||||||
cmake -DFSFW_BUILD_UNITTESTS=ON -DFSFW_OSAL=host ..
|
cmake -DFSFW_BUILD_TESTS=ON -DFSFW_OSAL=host ..
|
||||||
|
|
||||||
|
|
||||||
You can also use ``-DFSFW_OSAL=linux`` on Linux systems.
|
You can also use ``-DFSFW_OSAL=linux`` on Linux systems.
|
||||||
|
@ -6,19 +6,20 @@ High-level overview
|
|||||||
Structure
|
Structure
|
||||||
----------
|
----------
|
||||||
|
|
||||||
The general structure is driven by the usage of interfaces provided by objects.
|
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
|
The FSFW uses C++17 as baseline. Most modern compilers like GCC should have support for this
|
||||||
widely available, even with older compilers.
|
standard, even for micocontrollers.
|
||||||
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.
|
The FSFW might use dynamic allocation during program initialization but not during runtime.
|
||||||
Dynamic Allocation after initialization is discouraged and different solutions are provided in the
|
It offers pool objects, static containers and it also exposes the
|
||||||
FSFW to achieve that. The fsfw uses run-time type information but exceptions are not allowed.
|
`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
|
Failure Handling
|
||||||
-----------------
|
-----------------
|
||||||
|
|
||||||
Functions should return a defined :cpp:type:`ReturnValue_t` to signal to the caller that something has
|
Functions should return a defined :cpp:type:`ReturnValue_t` to signal to the caller that something has
|
||||||
gone wrong. Returnvalues must be unique. For this the function :cpp:func:`HasReturnvaluesIF::makeReturnCode`
|
gone wrong. Returnvalues must be unique. For this the function :cpp:func:`returnvalue::makeCode`
|
||||||
or the :ref:`macro MAKE_RETURN_CODE <retvalapi>` can be used. The ``CLASS_ID`` is a unique ID for that type of object.
|
or the :ref:`macro MAKE_RETURN_CODE <retvalapi>` can be used. The ``CLASS_ID`` is a unique ID for that type of object.
|
||||||
See the :ref:`FSFW Class IDs file <fwclassids>`. The user can add custom ``CLASS_ID``\s via the
|
See the :ref:`FSFW Class IDs file <fwclassids>`. The user can add custom ``CLASS_ID``\s via the
|
||||||
``fsfwconfig`` folder.
|
``fsfwconfig`` folder.
|
||||||
|
@ -150,7 +150,7 @@ with a housekeeping service command.
|
|||||||
new PoolEntry<uint8_t>({0}));
|
new PoolEntry<uint8_t>({0}));
|
||||||
|
|
||||||
poolManager.subscribeForPeriodicPacket(gyroData.getSid(), false, 4.0, false);
|
poolManager.subscribeForPeriodicPacket(gyroData.getSid(), false, 4.0, false);
|
||||||
return HasReturnvaluesIF::RETURN_OK;
|
return returnvalue::OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
Now, if we receive some sensor data and converted them into the right format,
|
Now, if we receive some sensor data and converted them into the right format,
|
||||||
@ -160,7 +160,7 @@ in any case:
|
|||||||
.. code-block:: cpp
|
.. code-block:: cpp
|
||||||
|
|
||||||
PoolReadGuard readHelper(&gyroData);
|
PoolReadGuard readHelper(&gyroData);
|
||||||
if(readHelper.getReadResult() == HasReturnvaluesIF::RETURN_OK) {
|
if(readHelper.getReadResult() == returnvalue::OK) {
|
||||||
if(not gyroData.isValid()) {
|
if(not gyroData.isValid()) {
|
||||||
gyroData.setValidity(true, true);
|
gyroData.setValidity(true, true);
|
||||||
}
|
}
|
||||||
|
@ -1,48 +0,0 @@
|
|||||||
cmake_minimum_required(VERSION 3.13)
|
|
||||||
|
|
||||||
# Can also be changed by upper CMakeLists.txt file
|
|
||||||
find_library(LIB_FSFW_NAME fsfw REQUIRED)
|
|
||||||
|
|
||||||
option(FSFW_HAL_ADD_LINUX "Add the Linux HAL to the sources. Requires gpiod library" OFF)
|
|
||||||
# On by default for now because I did not have an issue including and compiling those files
|
|
||||||
# and libraries on a Desktop Linux system and the primary target of the FSFW is still embedded
|
|
||||||
# Linux. The only exception from this is the gpiod library which requires a dedicated installation,
|
|
||||||
# but CMake is able to determine whether this library is installed with find_library.
|
|
||||||
option(FSFW_HAL_LINUX_ADD_PERIPHERAL_DRIVERS "Add peripheral drivers for embedded Linux" ON)
|
|
||||||
option(FSFW_HAL_LINUX_ADD_LIBGPIOD "Target implements libgpiod" ON)
|
|
||||||
|
|
||||||
option(FSFW_HAL_ADD_RASPBERRY_PI "Add Raspberry Pi specific code to the sources" OFF)
|
|
||||||
option(FSFW_HAL_ADD_STM32H7 "Add the STM32H7 HAL to the sources" OFF)
|
|
||||||
option(FSFW_HAL_WARNING_SHADOW_LOCAL_GCC "Enable -Wshadow=local warning in GCC" ON)
|
|
||||||
|
|
||||||
set(LINUX_HAL_PATH_NAME linux)
|
|
||||||
set(STM32H7_PATH_NAME stm32h7)
|
|
||||||
|
|
||||||
add_subdirectory(src)
|
|
||||||
|
|
||||||
foreach(INCLUDE_PATH ${FSFW_HAL_ADDITIONAL_INC_PATHS})
|
|
||||||
if(IS_ABSOLUTE ${INCLUDE_PATH})
|
|
||||||
set(CURR_ABS_INC_PATH "${INCLUDE_PATH}")
|
|
||||||
else()
|
|
||||||
get_filename_component(CURR_ABS_INC_PATH
|
|
||||||
${INCLUDE_PATH} REALPATH BASE_DIR ${CMAKE_SOURCE_DIR})
|
|
||||||
endif()
|
|
||||||
|
|
||||||
if(CMAKE_VERBOSE)
|
|
||||||
message(STATUS "FSFW include path: ${CURR_ABS_INC_PATH}")
|
|
||||||
endif()
|
|
||||||
|
|
||||||
list(APPEND FSFW_HAL_ADD_INC_PATHS_ABS ${CURR_ABS_INC_PATH})
|
|
||||||
endforeach()
|
|
||||||
|
|
||||||
target_include_directories(${LIB_FSFW_NAME} PRIVATE
|
|
||||||
${FSFW_HAL_ADD_INC_PATHS_ABS}
|
|
||||||
)
|
|
||||||
|
|
||||||
target_compile_definitions(${LIB_FSFW_NAME} PRIVATE
|
|
||||||
${FSFW_HAL_DEFINES}
|
|
||||||
)
|
|
||||||
|
|
||||||
target_link_libraries(${LIB_FSFW_NAME} PRIVATE
|
|
||||||
${FSFW_HAL_LINK_LIBS}
|
|
||||||
)
|
|
@ -1,9 +0,0 @@
|
|||||||
target_include_directories(${LIB_FSFW_NAME} PRIVATE
|
|
||||||
${CMAKE_CURRENT_SOURCE_DIR}
|
|
||||||
)
|
|
||||||
|
|
||||||
target_include_directories(${LIB_FSFW_NAME} INTERFACE
|
|
||||||
${CMAKE_CURRENT_SOURCE_DIR}
|
|
||||||
)
|
|
||||||
|
|
||||||
add_subdirectory(fsfw_hal)
|
|
@ -1 +0,0 @@
|
|||||||
add_subdirectory(gpio)
|
|
@ -1,3 +0,0 @@
|
|||||||
target_sources(${LIB_FSFW_NAME} PRIVATE
|
|
||||||
GpioCookie.cpp
|
|
||||||
)
|
|
@ -1,12 +0,0 @@
|
|||||||
#ifndef FSFW_HAL_COMMON_SPI_SPICOMMON_H_
|
|
||||||
#define FSFW_HAL_COMMON_SPI_SPICOMMON_H_
|
|
||||||
|
|
||||||
#include <cstdint>
|
|
||||||
|
|
||||||
namespace spi {
|
|
||||||
|
|
||||||
enum SpiModes : uint8_t { MODE_0, MODE_1, MODE_2, MODE_3 };
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
#endif /* FSFW_HAL_COMMON_SPI_SPICOMMON_H_ */
|
|
@ -1,5 +0,0 @@
|
|||||||
target_sources(${LIB_FSFW_NAME} PRIVATE
|
|
||||||
GyroL3GD20Handler.cpp
|
|
||||||
MgmRM3100Handler.cpp
|
|
||||||
MgmLIS3MDLHandler.cpp
|
|
||||||
)
|
|
@ -1 +0,0 @@
|
|||||||
|
|
@ -1,25 +0,0 @@
|
|||||||
if(FSFW_HAL_ADD_RASPBERRY_PI)
|
|
||||||
add_subdirectory(rpi)
|
|
||||||
endif()
|
|
||||||
|
|
||||||
target_sources(${LIB_FSFW_NAME} PRIVATE
|
|
||||||
UnixFileGuard.cpp
|
|
||||||
CommandExecutor.cpp
|
|
||||||
utility.cpp
|
|
||||||
)
|
|
||||||
|
|
||||||
if(FSFW_HAL_LINUX_ADD_PERIPHERAL_DRIVERS)
|
|
||||||
if(FSFW_HAL_LINUX_ADD_LIBGPIOD)
|
|
||||||
add_subdirectory(gpio)
|
|
||||||
endif()
|
|
||||||
add_subdirectory(uart)
|
|
||||||
# Adding those does not really make sense on Apple systems which
|
|
||||||
# are generally host systems. It won't even compile as the headers
|
|
||||||
# are missing
|
|
||||||
if(NOT APPLE)
|
|
||||||
add_subdirectory(i2c)
|
|
||||||
add_subdirectory(spi)
|
|
||||||
endif()
|
|
||||||
endif()
|
|
||||||
|
|
||||||
add_subdirectory(uio)
|
|
@ -1,16 +0,0 @@
|
|||||||
# This abstraction layer requires the gpiod library. You can install this library
|
|
||||||
# with "sudo apt-get install -y libgpiod-dev". If you are cross-compiling, you need
|
|
||||||
# to install the package before syncing the sysroot to your host computer.
|
|
||||||
find_library(LIB_GPIO gpiod)
|
|
||||||
|
|
||||||
if(${LIB_GPIO} MATCHES LIB_GPIO-NOTFOUND)
|
|
||||||
message(STATUS "gpiod library not found, not linking against it")
|
|
||||||
else()
|
|
||||||
target_sources(${LIB_FSFW_NAME} PRIVATE
|
|
||||||
LinuxLibgpioIF.cpp
|
|
||||||
)
|
|
||||||
target_link_libraries(${LIB_FSFW_NAME} PRIVATE
|
|
||||||
${LIB_GPIO}
|
|
||||||
)
|
|
||||||
endif()
|
|
||||||
|
|
@ -1,8 +0,0 @@
|
|||||||
target_sources(${LIB_FSFW_NAME} PUBLIC
|
|
||||||
I2cComIF.cpp
|
|
||||||
I2cCookie.cpp
|
|
||||||
)
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -1,3 +0,0 @@
|
|||||||
target_sources(${LIB_FSFW_NAME} PRIVATE
|
|
||||||
GpioRPi.cpp
|
|
||||||
)
|
|
@ -1,8 +0,0 @@
|
|||||||
target_sources(${LIB_FSFW_NAME} PUBLIC
|
|
||||||
SpiComIF.cpp
|
|
||||||
SpiCookie.cpp
|
|
||||||
)
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -1,4 +0,0 @@
|
|||||||
target_sources(${LIB_FSFW_NAME} PUBLIC
|
|
||||||
UartComIF.cpp
|
|
||||||
UartCookie.cpp
|
|
||||||
)
|
|
@ -1,51 +0,0 @@
|
|||||||
#include "UartCookie.h"
|
|
||||||
|
|
||||||
#include <fsfw/serviceinterface.h>
|
|
||||||
|
|
||||||
UartCookie::UartCookie(object_id_t handlerId, std::string deviceFile, UartBaudRate baudrate,
|
|
||||||
size_t maxReplyLen, UartModes uartMode)
|
|
||||||
: handlerId(handlerId),
|
|
||||||
deviceFile(deviceFile),
|
|
||||||
uartMode(uartMode),
|
|
||||||
baudrate(baudrate),
|
|
||||||
maxReplyLen(maxReplyLen) {}
|
|
||||||
|
|
||||||
UartCookie::~UartCookie() {}
|
|
||||||
|
|
||||||
UartBaudRate UartCookie::getBaudrate() const { return baudrate; }
|
|
||||||
|
|
||||||
size_t UartCookie::getMaxReplyLen() const { return maxReplyLen; }
|
|
||||||
|
|
||||||
std::string UartCookie::getDeviceFile() const { return deviceFile; }
|
|
||||||
|
|
||||||
void UartCookie::setParityOdd() { parity = Parity::ODD; }
|
|
||||||
|
|
||||||
void UartCookie::setParityEven() { parity = Parity::EVEN; }
|
|
||||||
|
|
||||||
Parity UartCookie::getParity() const { return parity; }
|
|
||||||
|
|
||||||
void UartCookie::setBitsPerWord(BitsPerWord bitsPerWord_) { bitsPerWord = bitsPerWord_; }
|
|
||||||
|
|
||||||
BitsPerWord UartCookie::getBitsPerWord() const { return bitsPerWord; }
|
|
||||||
|
|
||||||
StopBits UartCookie::getStopBits() const { return stopBits; }
|
|
||||||
|
|
||||||
void UartCookie::setTwoStopBits() { stopBits = StopBits::TWO_STOP_BITS; }
|
|
||||||
|
|
||||||
void UartCookie::setOneStopBit() { stopBits = StopBits::ONE_STOP_BIT; }
|
|
||||||
|
|
||||||
UartModes UartCookie::getUartMode() const { return uartMode; }
|
|
||||||
|
|
||||||
void UartCookie::setReadCycles(uint8_t readCycles) { this->readCycles = readCycles; }
|
|
||||||
|
|
||||||
void UartCookie::setToFlushInput(bool enable) { this->flushInput = enable; }
|
|
||||||
|
|
||||||
uint8_t UartCookie::getReadCycles() const { return readCycles; }
|
|
||||||
|
|
||||||
bool UartCookie::getInputShouldBeFlushed() { return this->flushInput; }
|
|
||||||
|
|
||||||
object_id_t UartCookie::getHandlerId() const { return this->handlerId; }
|
|
||||||
|
|
||||||
void UartCookie::setNoFixedSizeReply() { replySizeFixed = false; }
|
|
||||||
|
|
||||||
bool UartCookie::isReplySizeFixed() { return replySizeFixed; }
|
|
@ -1,3 +0,0 @@
|
|||||||
target_sources(${LIB_FSFW_NAME} PUBLIC
|
|
||||||
UioMapper.cpp
|
|
||||||
)
|
|
@ -1,3 +0,0 @@
|
|||||||
target_sources(${LIB_FSFW_NAME} PRIVATE
|
|
||||||
GyroL3GD20H.cpp
|
|
||||||
)
|
|
@ -1,3 +0,0 @@
|
|||||||
target_sources(${LIB_FSFW_NAME} PRIVATE
|
|
||||||
gpio.cpp
|
|
||||||
)
|
|
@ -1,2 +0,0 @@
|
|||||||
target_sources(${LIB_FSFW_NAME} PRIVATE
|
|
||||||
)
|
|
@ -1,9 +0,0 @@
|
|||||||
target_sources(${LIB_FSFW_NAME} PRIVATE
|
|
||||||
spiCore.cpp
|
|
||||||
spiDefinitions.cpp
|
|
||||||
spiInterrupts.cpp
|
|
||||||
mspInit.cpp
|
|
||||||
SpiCookie.cpp
|
|
||||||
SpiComIF.cpp
|
|
||||||
stm32h743zi.cpp
|
|
||||||
)
|
|
@ -1,2 +0,0 @@
|
|||||||
target_sources(${LIB_FSFW_NAME} PRIVATE
|
|
||||||
)
|
|
@ -4,6 +4,10 @@
|
|||||||
#include <cstddef>
|
#include <cstddef>
|
||||||
#include <cstdint>
|
#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
|
//! Used to determine whether C++ ostreams are used which can increase
|
||||||
//! the binary size significantly. If this is disabled,
|
//! the binary size significantly. If this is disabled,
|
||||||
//! the C stdio functions can be used alternatively
|
//! the C stdio functions can be used alternatively
|
||||||
|
@ -4,7 +4,6 @@
|
|||||||
#include <fsfw/devicehandlers/DeviceHandlerBase.h>
|
#include <fsfw/devicehandlers/DeviceHandlerBase.h>
|
||||||
#include <fsfw/events/EventManager.h>
|
#include <fsfw/events/EventManager.h>
|
||||||
#include <fsfw/health/HealthTable.h>
|
#include <fsfw/health/HealthTable.h>
|
||||||
#include <fsfw/tmtcpacket/pus/tm/TmPacketStored.h>
|
|
||||||
#include <fsfw/tmtcservices/CommandingServiceBase.h>
|
#include <fsfw/tmtcservices/CommandingServiceBase.h>
|
||||||
#include <fsfw/tmtcservices/PusServiceBase.h>
|
#include <fsfw/tmtcservices/PusServiceBase.h>
|
||||||
#include <fsfw/internalerror/InternalErrorReporter.h>
|
#include <fsfw/internalerror/InternalErrorReporter.h>
|
||||||
@ -35,19 +34,15 @@ void Factory::produceFsfwObjects(void) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void Factory::setStaticFrameworkObjectIds() {
|
void Factory::setStaticFrameworkObjectIds() {
|
||||||
PusServiceBase::packetSource = objects::NO_OBJECT;
|
PusServiceBase::PUS_DISTRIBUTOR = objects::NO_OBJECT;
|
||||||
PusServiceBase::packetDestination = objects::NO_OBJECT;
|
PusServiceBase::PACKET_DESTINATION = objects::NO_OBJECT;
|
||||||
|
|
||||||
CommandingServiceBase::defaultPacketSource = objects::NO_OBJECT;
|
CommandingServiceBase::defaultPacketSource = objects::NO_OBJECT;
|
||||||
CommandingServiceBase::defaultPacketDestination = objects::NO_OBJECT;
|
CommandingServiceBase::defaultPacketDestination = objects::NO_OBJECT;
|
||||||
|
|
||||||
VerificationReporter::messageReceiver = objects::PUS_SERVICE_1_VERIFICATION;
|
|
||||||
|
|
||||||
DeviceHandlerBase::powerSwitcherId = objects::NO_OBJECT;
|
DeviceHandlerBase::powerSwitcherId = objects::NO_OBJECT;
|
||||||
DeviceHandlerBase::rawDataReceiverId = objects::PUS_SERVICE_2_DEVICE_ACCESS;
|
DeviceHandlerBase::rawDataReceiverId = objects::PUS_SERVICE_2_DEVICE_ACCESS;
|
||||||
|
|
||||||
DeviceHandlerFailureIsolation::powerConfirmationId = objects::NO_OBJECT;
|
DeviceHandlerFailureIsolation::powerConfirmationId = objects::NO_OBJECT;
|
||||||
|
|
||||||
TmPacketBase::timeStamperId = objects::NO_OBJECT;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -11,15 +11,15 @@ ReturnValue_t pst::pollingSequenceInitDefault(
|
|||||||
|
|
||||||
/* Add polling sequence table here */
|
/* Add polling sequence table here */
|
||||||
|
|
||||||
if (thisSequence->checkSequence() == HasReturnvaluesIF::RETURN_OK) {
|
if (thisSequence->checkSequence() == returnvalue::OK) {
|
||||||
return HasReturnvaluesIF::RETURN_OK;
|
return returnvalue::OK;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
#if FSFW_CPP_OSTREAM_ENABLED == 1
|
#if FSFW_CPP_OSTREAM_ENABLED == 1
|
||||||
sif::error << "pst::pollingSequenceInitDefault: Sequence invalid!"
|
sif::error << "pst::pollingSequenceInitDefault: Sequence invalid!"
|
||||||
<< std::endl;
|
<< std::endl;
|
||||||
#endif
|
#endif
|
||||||
return HasReturnvaluesIF::RETURN_FAILED;
|
return returnvalue::FAILED;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
#ifndef POLLINGSEQUENCEFACTORY_H_
|
#ifndef POLLINGSEQUENCEFACTORY_H_
|
||||||
#define POLLINGSEQUENCEFACTORY_H_
|
#define POLLINGSEQUENCEFACTORY_H_
|
||||||
|
|
||||||
#include <fsfw/returnvalues/HasReturnvaluesIF.h>
|
#include <fsfw/returnvalues/returnvalue.h>
|
||||||
|
|
||||||
class FixedTimeslotTaskIF;
|
class FixedTimeslotTaskIF;
|
||||||
|
|
||||||
|
@ -1,8 +0,0 @@
|
|||||||
#!/bin/bash
|
|
||||||
if [[ ! -f README.md ]]; then
|
|
||||||
cd ..
|
|
||||||
fi
|
|
||||||
|
|
||||||
find ./src -iname *.h -o -iname *.cpp -o -iname *.c | xargs clang-format --style=file -i
|
|
||||||
find ./hal -iname *.h -o -iname *.cpp -o -iname *.c | xargs clang-format --style=file -i
|
|
||||||
find ./tests -iname *.h -o -iname *.cpp -o -iname *.c | xargs clang-format --style=file -i
|
|
30
scripts/auto-formatter.sh
Executable file
30
scripts/auto-formatter.sh
Executable file
@ -0,0 +1,30 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
if [[ ! -f README.md ]]; then
|
||||||
|
cd ..
|
||||||
|
fi
|
||||||
|
|
||||||
|
folder_list=(
|
||||||
|
"./src"
|
||||||
|
"./unittests"
|
||||||
|
)
|
||||||
|
|
||||||
|
cmake_fmt="cmake-format"
|
||||||
|
file_selectors="-iname CMakeLists.txt"
|
||||||
|
if command -v ${cmake_fmt} &> /dev/null; then
|
||||||
|
${cmake_fmt} -i CMakeLists.txt
|
||||||
|
find ./src ${file_selectors} | xargs ${cmake_fmt} -i
|
||||||
|
find ./unittests ${file_selectors} | xargs ${cmake_fmt} -i
|
||||||
|
else
|
||||||
|
echo "No ${cmake_fmt} tool found, not formatting CMake files"
|
||||||
|
fi
|
||||||
|
|
||||||
|
cpp_format="clang-format"
|
||||||
|
file_selectors="-iname *.h -o -iname *.cpp -o -iname *.c -o -iname *.tpp"
|
||||||
|
if command -v ${cpp_format} &> /dev/null; then
|
||||||
|
for dir in ${folder_list[@]}; do
|
||||||
|
echo "Auto-formatting ${dir} recursively"
|
||||||
|
find ${dir} ${file_selectors} | xargs clang-format --style=file -i
|
||||||
|
done
|
||||||
|
else
|
||||||
|
echo "No ${cpp_format} tool found, not formatting C++/C files"
|
||||||
|
fi
|
110
scripts/check_release.py
Executable file
110
scripts/check_release.py
Executable 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()
|
@ -13,7 +13,7 @@ from shutil import which
|
|||||||
from typing import List
|
from typing import List
|
||||||
|
|
||||||
|
|
||||||
UNITTEST_FOLDER_NAME = "build-tests"
|
UNITTEST_FOLDER_NAME = "cmake-build-tests"
|
||||||
DOCS_FOLDER_NAME = "build-docs"
|
DOCS_FOLDER_NAME = "build-docs"
|
||||||
|
|
||||||
|
|
||||||
@ -48,6 +48,20 @@ def main():
|
|||||||
action="store_true",
|
action="store_true",
|
||||||
help="Run valgrind on generated test binary",
|
help="Run valgrind on generated test binary",
|
||||||
)
|
)
|
||||||
|
parser.add_argument(
|
||||||
|
"-g",
|
||||||
|
"--generators",
|
||||||
|
default="Ninja",
|
||||||
|
action="store",
|
||||||
|
help="CMake generators",
|
||||||
|
)
|
||||||
|
parser.add_argument(
|
||||||
|
"-w",
|
||||||
|
"--windows",
|
||||||
|
default=False,
|
||||||
|
action="store_true",
|
||||||
|
help="Run on windows",
|
||||||
|
)
|
||||||
|
|
||||||
args = parser.parse_args()
|
args = parser.parse_args()
|
||||||
if args.all:
|
if args.all:
|
||||||
@ -115,14 +129,14 @@ def handle_tests_type(args, build_dir_list: list):
|
|||||||
if args.create:
|
if args.create:
|
||||||
if os.path.exists(UNITTEST_FOLDER_NAME):
|
if os.path.exists(UNITTEST_FOLDER_NAME):
|
||||||
shutil.rmtree(UNITTEST_FOLDER_NAME)
|
shutil.rmtree(UNITTEST_FOLDER_NAME)
|
||||||
create_tests_build_cfg()
|
create_tests_build_cfg(args)
|
||||||
build_directory = UNITTEST_FOLDER_NAME
|
build_directory = UNITTEST_FOLDER_NAME
|
||||||
elif len(build_dir_list) == 0:
|
elif len(build_dir_list) == 0:
|
||||||
print(
|
print(
|
||||||
"No valid CMake tests build directory found. "
|
"No valid CMake tests build directory found. "
|
||||||
"Trying to set up test build system"
|
"Trying to set up test build system"
|
||||||
)
|
)
|
||||||
create_tests_build_cfg()
|
create_tests_build_cfg(args)
|
||||||
build_directory = UNITTEST_FOLDER_NAME
|
build_directory = UNITTEST_FOLDER_NAME
|
||||||
elif len(build_dir_list) == 1:
|
elif len(build_dir_list) == 1:
|
||||||
build_directory = build_dir_list[0]
|
build_directory = build_dir_list[0]
|
||||||
@ -147,10 +161,23 @@ def handle_tests_type(args, build_dir_list: list):
|
|||||||
os.chdir("..")
|
os.chdir("..")
|
||||||
|
|
||||||
|
|
||||||
def create_tests_build_cfg():
|
def create_tests_build_cfg(args):
|
||||||
os.mkdir(UNITTEST_FOLDER_NAME)
|
os.mkdir(UNITTEST_FOLDER_NAME)
|
||||||
os.chdir(UNITTEST_FOLDER_NAME)
|
os.chdir(UNITTEST_FOLDER_NAME)
|
||||||
cmd_runner("cmake -DFSFW_OSAL=host -DFSFW_BUILD_UNITTESTS=ON ..")
|
if args.windows:
|
||||||
|
cmake_cmd = (
|
||||||
|
'cmake -G "'
|
||||||
|
+ args.generators
|
||||||
|
+ '" -DFSFW_OSAL=host -DFSFW_BUILD_TESTS=ON \
|
||||||
|
-DGCOVR_PATH="py -m gcovr" ..'
|
||||||
|
)
|
||||||
|
else:
|
||||||
|
cmake_cmd = (
|
||||||
|
'cmake -G "'
|
||||||
|
+ args.generators
|
||||||
|
+ '" -DFSFW_OSAL=host -DFSFW_BUILD_TESTS=ON ..'
|
||||||
|
)
|
||||||
|
cmd_runner(cmake_cmd)
|
||||||
os.chdir("..")
|
os.chdir("..")
|
||||||
|
|
||||||
|
|
||||||
@ -180,7 +207,7 @@ def check_for_cmake_build_dir(build_dir_list: list) -> list:
|
|||||||
def perform_lcov_operation(directory: str, chdir: bool):
|
def perform_lcov_operation(directory: str, chdir: bool):
|
||||||
if chdir:
|
if chdir:
|
||||||
os.chdir(directory)
|
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]):
|
def determine_build_dir(build_dir_list: List[str]):
|
||||||
|
@ -1,9 +1,11 @@
|
|||||||
target_include_directories(${LIB_FSFW_NAME} PRIVATE
|
target_include_directories(${LIB_FSFW_NAME} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR})
|
||||||
${CMAKE_CURRENT_SOURCE_DIR}
|
|
||||||
)
|
|
||||||
|
|
||||||
target_include_directories(${LIB_FSFW_NAME} INTERFACE
|
target_include_directories(${LIB_FSFW_NAME}
|
||||||
${CMAKE_CURRENT_SOURCE_DIR}
|
INTERFACE ${CMAKE_CURRENT_SOURCE_DIR})
|
||||||
)
|
|
||||||
|
|
||||||
add_subdirectory(fsfw)
|
add_subdirectory(fsfw)
|
||||||
|
if(FSFW_ADD_HAL)
|
||||||
|
add_subdirectory(fsfw_hal)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
add_subdirectory(fsfw_tests)
|
||||||
|
@ -1,6 +1,4 @@
|
|||||||
target_sources(${LIB_FSFW_NAME} PRIVATE
|
target_sources(${LIB_FSFW_NAME} PRIVATE version.cpp)
|
||||||
version.cpp
|
|
||||||
)
|
|
||||||
|
|
||||||
# Core
|
# Core
|
||||||
|
|
||||||
@ -33,26 +31,28 @@ add_subdirectory(thermal)
|
|||||||
add_subdirectory(timemanager)
|
add_subdirectory(timemanager)
|
||||||
add_subdirectory(tmtcpacket)
|
add_subdirectory(tmtcpacket)
|
||||||
add_subdirectory(tmtcservices)
|
add_subdirectory(tmtcservices)
|
||||||
|
add_subdirectory(filesystem)
|
||||||
|
add_subdirectory(util)
|
||||||
|
|
||||||
# Optional
|
# Optional
|
||||||
|
|
||||||
if(FSFW_ADD_MONITORING)
|
if(FSFW_ADD_MONITORING)
|
||||||
add_subdirectory(monitoring)
|
add_subdirectory(monitoring)
|
||||||
endif()
|
endif()
|
||||||
if(FSFW_ADD_PUS)
|
if(FSFW_ADD_PUS)
|
||||||
add_subdirectory(pus)
|
add_subdirectory(pus)
|
||||||
endif()
|
endif()
|
||||||
if(FSFW_ADD_TMSTORAGE)
|
if(FSFW_ADD_TMSTORAGE)
|
||||||
add_subdirectory(tmstorage)
|
add_subdirectory(tmstorage)
|
||||||
endif()
|
endif()
|
||||||
if(FSFW_ADD_COORDINATES)
|
if(FSFW_ADD_COORDINATES)
|
||||||
add_subdirectory(coordinates)
|
add_subdirectory(coordinates)
|
||||||
endif()
|
endif()
|
||||||
if(FSFW_ADD_RMAP)
|
if(FSFW_ADD_RMAP)
|
||||||
add_subdirectory(rmap)
|
add_subdirectory(rmap)
|
||||||
endif()
|
endif()
|
||||||
if(FSFW_ADD_DATALINKLAYER)
|
if(FSFW_ADD_DATALINKLAYER)
|
||||||
add_subdirectory(datalinklayer)
|
add_subdirectory(datalinklayer)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
# OSAL
|
# OSAL
|
||||||
|
@ -6,6 +6,6 @@ static constexpr int FSFW_VERSION_MAJOR = @FSFW_VERSION@;
|
|||||||
static constexpr int FSFW_VERSION_MINOR = @FSFW_SUBVERSION@;
|
static constexpr int FSFW_VERSION_MINOR = @FSFW_SUBVERSION@;
|
||||||
static constexpr int FSFW_VERSION_REVISION = @FSFW_REVISION@;
|
static constexpr int FSFW_VERSION_REVISION = @FSFW_REVISION@;
|
||||||
// Also contains CST (Commits since tag) information
|
// Also contains CST (Commits since tag) information
|
||||||
static const char FSFW_VERSION_CST_GIT_SHA1[] = "@FSFW_VERSION_CST_GIT_SHA1@";
|
static const char FSFW_VCS_INFO[] = "@FSFW_VCS_INFO@";
|
||||||
|
|
||||||
#endif /* FSFW_VERSION_H_ */
|
#endif /* FSFW_VERSION_H_ */
|
||||||
|
@ -6,13 +6,13 @@
|
|||||||
ActionHelper::ActionHelper(HasActionsIF* setOwner, MessageQueueIF* useThisQueue)
|
ActionHelper::ActionHelper(HasActionsIF* setOwner, MessageQueueIF* useThisQueue)
|
||||||
: owner(setOwner), queueToUse(useThisQueue) {}
|
: owner(setOwner), queueToUse(useThisQueue) {}
|
||||||
|
|
||||||
ActionHelper::~ActionHelper() {}
|
ActionHelper::~ActionHelper() = default;
|
||||||
|
|
||||||
ReturnValue_t ActionHelper::handleActionMessage(CommandMessage* command) {
|
ReturnValue_t ActionHelper::handleActionMessage(CommandMessage* command) {
|
||||||
if (command->getCommand() == ActionMessage::EXECUTE_ACTION) {
|
if (command->getCommand() == ActionMessage::EXECUTE_ACTION) {
|
||||||
ActionId_t currentAction = ActionMessage::getActionId(command);
|
ActionId_t currentAction = ActionMessage::getActionId(command);
|
||||||
prepareExecution(command->getSender(), currentAction, ActionMessage::getStoreId(command));
|
prepareExecution(command->getSender(), currentAction, ActionMessage::getStoreId(command));
|
||||||
return HasReturnvaluesIF::RETURN_OK;
|
return returnvalue::OK;
|
||||||
} else {
|
} else {
|
||||||
return CommandMessage::UNKNOWN_COMMAND;
|
return CommandMessage::UNKNOWN_COMMAND;
|
||||||
}
|
}
|
||||||
@ -21,7 +21,7 @@ ReturnValue_t ActionHelper::handleActionMessage(CommandMessage* command) {
|
|||||||
ReturnValue_t ActionHelper::initialize(MessageQueueIF* queueToUse_) {
|
ReturnValue_t ActionHelper::initialize(MessageQueueIF* queueToUse_) {
|
||||||
ipcStore = ObjectManager::instance()->get<StorageManagerIF>(objects::IPC_STORE);
|
ipcStore = ObjectManager::instance()->get<StorageManagerIF>(objects::IPC_STORE);
|
||||||
if (ipcStore == nullptr) {
|
if (ipcStore == nullptr) {
|
||||||
return HasReturnvaluesIF::RETURN_FAILED;
|
return returnvalue::FAILED;
|
||||||
}
|
}
|
||||||
if (queueToUse_ != nullptr) {
|
if (queueToUse_ != nullptr) {
|
||||||
setQueueToUse(queueToUse_);
|
setQueueToUse(queueToUse_);
|
||||||
@ -35,10 +35,10 @@ ReturnValue_t ActionHelper::initialize(MessageQueueIF* queueToUse_) {
|
|||||||
sif::printWarning("ActionHelper::initialize: No queue set\n");
|
sif::printWarning("ActionHelper::initialize: No queue set\n");
|
||||||
#endif
|
#endif
|
||||||
#endif /* FSFW_VERBOSE_LEVEL >= 1 */
|
#endif /* FSFW_VERBOSE_LEVEL >= 1 */
|
||||||
return HasReturnvaluesIF::RETURN_FAILED;
|
return returnvalue::FAILED;
|
||||||
}
|
}
|
||||||
|
|
||||||
return HasReturnvaluesIF::RETURN_OK;
|
return returnvalue::OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
void ActionHelper::step(uint8_t step, MessageQueueId_t reportTo, ActionId_t commandId,
|
void ActionHelper::step(uint8_t step, MessageQueueId_t reportTo, ActionId_t commandId,
|
||||||
@ -59,23 +59,30 @@ void ActionHelper::setQueueToUse(MessageQueueIF* queue) { queueToUse = queue; }
|
|||||||
|
|
||||||
void ActionHelper::prepareExecution(MessageQueueId_t commandedBy, ActionId_t actionId,
|
void ActionHelper::prepareExecution(MessageQueueId_t commandedBy, ActionId_t actionId,
|
||||||
store_address_t dataAddress) {
|
store_address_t dataAddress) {
|
||||||
const uint8_t* dataPtr = NULL;
|
bool hasAdditionalData = false;
|
||||||
|
const uint8_t* dataPtr = nullptr;
|
||||||
size_t size = 0;
|
size_t size = 0;
|
||||||
ReturnValue_t result = ipcStore->getData(dataAddress, &dataPtr, &size);
|
ReturnValue_t result;
|
||||||
if (result != HasReturnvaluesIF::RETURN_OK) {
|
if (dataAddress != store_address_t::invalid()) {
|
||||||
CommandMessage reply;
|
hasAdditionalData = true;
|
||||||
ActionMessage::setStepReply(&reply, actionId, 0, result);
|
ReturnValue_t result = ipcStore->getData(dataAddress, &dataPtr, &size);
|
||||||
queueToUse->sendMessage(commandedBy, &reply);
|
if (result != returnvalue::OK) {
|
||||||
return;
|
CommandMessage reply;
|
||||||
|
ActionMessage::setStepReply(&reply, actionId, 0, result);
|
||||||
|
queueToUse->sendMessage(commandedBy, &reply);
|
||||||
|
return;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
result = owner->executeAction(actionId, commandedBy, dataPtr, size);
|
result = owner->executeAction(actionId, commandedBy, dataPtr, size);
|
||||||
ipcStore->deleteData(dataAddress);
|
if (hasAdditionalData) {
|
||||||
|
ipcStore->deleteData(dataAddress);
|
||||||
|
}
|
||||||
if (result == HasActionsIF::EXECUTION_FINISHED) {
|
if (result == HasActionsIF::EXECUTION_FINISHED) {
|
||||||
CommandMessage reply;
|
CommandMessage reply;
|
||||||
ActionMessage::setCompletionReply(&reply, actionId, true, result);
|
ActionMessage::setCompletionReply(&reply, actionId, true, result);
|
||||||
queueToUse->sendMessage(commandedBy, &reply);
|
queueToUse->sendMessage(commandedBy, &reply);
|
||||||
}
|
}
|
||||||
if (result != HasReturnvaluesIF::RETURN_OK) {
|
if (result != returnvalue::OK) {
|
||||||
CommandMessage reply;
|
CommandMessage reply;
|
||||||
ActionMessage::setStepReply(&reply, actionId, 0, result);
|
ActionMessage::setStepReply(&reply, actionId, 0, result);
|
||||||
queueToUse->sendMessage(commandedBy, &reply);
|
queueToUse->sendMessage(commandedBy, &reply);
|
||||||
@ -91,11 +98,11 @@ ReturnValue_t ActionHelper::reportData(MessageQueueId_t reportTo, ActionId_t rep
|
|||||||
size_t maxSize = data->getSerializedSize();
|
size_t maxSize = data->getSerializedSize();
|
||||||
if (maxSize == 0) {
|
if (maxSize == 0) {
|
||||||
/* No error, there's simply nothing to report. */
|
/* No error, there's simply nothing to report. */
|
||||||
return HasReturnvaluesIF::RETURN_OK;
|
return returnvalue::OK;
|
||||||
}
|
}
|
||||||
size_t size = 0;
|
size_t size = 0;
|
||||||
ReturnValue_t result = ipcStore->getFreeElement(&storeAddress, maxSize, &dataPtr);
|
ReturnValue_t result = ipcStore->getFreeElement(&storeAddress, maxSize, &dataPtr);
|
||||||
if (result != HasReturnvaluesIF::RETURN_OK) {
|
if (result != returnvalue::OK) {
|
||||||
#if FSFW_CPP_OSTREAM_ENABLED == 1
|
#if FSFW_CPP_OSTREAM_ENABLED == 1
|
||||||
sif::warning << "ActionHelper::reportData: Getting free element from IPC store failed!"
|
sif::warning << "ActionHelper::reportData: Getting free element from IPC store failed!"
|
||||||
<< std::endl;
|
<< std::endl;
|
||||||
@ -107,7 +114,7 @@ ReturnValue_t ActionHelper::reportData(MessageQueueId_t reportTo, ActionId_t rep
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
result = data->serialize(&dataPtr, &size, maxSize, SerializeIF::Endianness::BIG);
|
result = data->serialize(&dataPtr, &size, maxSize, SerializeIF::Endianness::BIG);
|
||||||
if (result != HasReturnvaluesIF::RETURN_OK) {
|
if (result != returnvalue::OK) {
|
||||||
ipcStore->deleteData(storeAddress);
|
ipcStore->deleteData(storeAddress);
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
@ -124,7 +131,7 @@ ReturnValue_t ActionHelper::reportData(MessageQueueId_t reportTo, ActionId_t rep
|
|||||||
result = queueToUse->sendMessage(reportTo, &reply);
|
result = queueToUse->sendMessage(reportTo, &reply);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (result != HasReturnvaluesIF::RETURN_OK) {
|
if (result != returnvalue::OK) {
|
||||||
ipcStore->deleteData(storeAddress);
|
ipcStore->deleteData(storeAddress);
|
||||||
}
|
}
|
||||||
return result;
|
return result;
|
||||||
@ -137,7 +144,7 @@ ReturnValue_t ActionHelper::reportData(MessageQueueId_t reportTo, ActionId_t rep
|
|||||||
CommandMessage reply;
|
CommandMessage reply;
|
||||||
store_address_t storeAddress;
|
store_address_t storeAddress;
|
||||||
ReturnValue_t result = ipcStore->addData(&storeAddress, data, dataSize);
|
ReturnValue_t result = ipcStore->addData(&storeAddress, data, dataSize);
|
||||||
if (result != HasReturnvaluesIF::RETURN_OK) {
|
if (result != returnvalue::OK) {
|
||||||
#if FSFW_CPP_OSTREAM_ENABLED == 1
|
#if FSFW_CPP_OSTREAM_ENABLED == 1
|
||||||
sif::warning << "ActionHelper::reportData: Adding data to IPC store failed!" << std::endl;
|
sif::warning << "ActionHelper::reportData: Adding data to IPC store failed!" << std::endl;
|
||||||
#else
|
#else
|
||||||
@ -158,7 +165,7 @@ ReturnValue_t ActionHelper::reportData(MessageQueueId_t reportTo, ActionId_t rep
|
|||||||
result = queueToUse->sendMessage(reportTo, &reply);
|
result = queueToUse->sendMessage(reportTo, &reply);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (result != HasReturnvaluesIF::RETURN_OK) {
|
if (result != returnvalue::OK) {
|
||||||
ipcStore->deleteData(storeAddress);
|
ipcStore->deleteData(storeAddress);
|
||||||
}
|
}
|
||||||
return result;
|
return result;
|
||||||
|
@ -1,9 +1,9 @@
|
|||||||
#ifndef FSFW_ACTION_ACTIONHELPER_H_
|
#ifndef FSFW_ACTION_ACTIONHELPER_H_
|
||||||
#define FSFW_ACTION_ACTIONHELPER_H_
|
#define FSFW_ACTION_ACTIONHELPER_H_
|
||||||
|
|
||||||
#include "../ipc/MessageQueueIF.h"
|
|
||||||
#include "../serialize/SerializeIF.h"
|
|
||||||
#include "ActionMessage.h"
|
#include "ActionMessage.h"
|
||||||
|
#include "fsfw/ipc/MessageQueueIF.h"
|
||||||
|
#include "fsfw/serialize/SerializeIF.h"
|
||||||
/**
|
/**
|
||||||
* @brief Action Helper is a helper class which handles action messages
|
* @brief Action Helper is a helper class which handles action messages
|
||||||
*
|
*
|
||||||
@ -36,7 +36,7 @@ class ActionHelper {
|
|||||||
* send to the sender of the message automatically.
|
* send to the sender of the message automatically.
|
||||||
*
|
*
|
||||||
* @param command Pointer to a command message received by the owner
|
* @param command Pointer to a command message received by the owner
|
||||||
* @return HasReturnvaluesIF::RETURN_OK if the message is a action message,
|
* @return returnvalue::OK if the message is a action message,
|
||||||
* CommandMessage::UNKNOW_COMMAND if this message ID is unkown
|
* CommandMessage::UNKNOW_COMMAND if this message ID is unkown
|
||||||
*/
|
*/
|
||||||
ReturnValue_t handleActionMessage(CommandMessage* command);
|
ReturnValue_t handleActionMessage(CommandMessage* command);
|
||||||
@ -45,7 +45,7 @@ class ActionHelper {
|
|||||||
* helper function
|
* helper function
|
||||||
* @param queueToUse_ Pointer to the messageQueue to be used, optional
|
* @param queueToUse_ Pointer to the messageQueue to be used, optional
|
||||||
* if queue was set in constructor
|
* if queue was set in constructor
|
||||||
* @return Returns RETURN_OK if successful
|
* @return Returns returnvalue::OK if successful
|
||||||
*/
|
*/
|
||||||
ReturnValue_t initialize(MessageQueueIF* queueToUse_ = nullptr);
|
ReturnValue_t initialize(MessageQueueIF* queueToUse_ = nullptr);
|
||||||
/**
|
/**
|
||||||
@ -58,7 +58,7 @@ class ActionHelper {
|
|||||||
* @param result Result of the execution
|
* @param result Result of the execution
|
||||||
*/
|
*/
|
||||||
void step(uint8_t step, MessageQueueId_t reportTo, ActionId_t commandId,
|
void step(uint8_t step, MessageQueueId_t reportTo, ActionId_t commandId,
|
||||||
ReturnValue_t result = HasReturnvaluesIF::RETURN_OK);
|
ReturnValue_t result = returnvalue::OK);
|
||||||
/**
|
/**
|
||||||
* Function to be called by the owner to send a action completion message
|
* Function to be called by the owner to send a action completion message
|
||||||
* @param success Specify whether action was completed successfully or not.
|
* @param success Specify whether action was completed successfully or not.
|
||||||
@ -67,7 +67,7 @@ class ActionHelper {
|
|||||||
* @param result Result of the execution
|
* @param result Result of the execution
|
||||||
*/
|
*/
|
||||||
void finish(bool success, MessageQueueId_t reportTo, ActionId_t commandId,
|
void finish(bool success, MessageQueueId_t reportTo, ActionId_t commandId,
|
||||||
ReturnValue_t result = HasReturnvaluesIF::RETURN_OK);
|
ReturnValue_t result = returnvalue::OK);
|
||||||
/**
|
/**
|
||||||
* Function to be called by the owner if an action does report data.
|
* Function to be called by the owner if an action does report data.
|
||||||
* Takes a SerializeIF* pointer and serializes it into the IPC store.
|
* Takes a SerializeIF* pointer and serializes it into the IPC store.
|
||||||
@ -75,7 +75,7 @@ class ActionHelper {
|
|||||||
* message to
|
* message to
|
||||||
* @param replyId ID of the executed command
|
* @param replyId ID of the executed command
|
||||||
* @param data Pointer to the data
|
* @param data Pointer to the data
|
||||||
* @return Returns RETURN_OK if successful, otherwise failure code
|
* @return Returns returnvalue::OK if successful, otherwise failure code
|
||||||
*/
|
*/
|
||||||
ReturnValue_t reportData(MessageQueueId_t reportTo, ActionId_t replyId, SerializeIF* data,
|
ReturnValue_t reportData(MessageQueueId_t reportTo, ActionId_t replyId, SerializeIF* data,
|
||||||
bool hideSender = false);
|
bool hideSender = false);
|
||||||
@ -86,7 +86,7 @@ class ActionHelper {
|
|||||||
* message to
|
* message to
|
||||||
* @param replyId ID of the executed command
|
* @param replyId ID of the executed command
|
||||||
* @param data Pointer to the data
|
* @param data Pointer to the data
|
||||||
* @return Returns RETURN_OK if successful, otherwise failure code
|
* @return Returns returnvalue::OK if successful, otherwise failure code
|
||||||
*/
|
*/
|
||||||
ReturnValue_t reportData(MessageQueueId_t reportTo, ActionId_t replyId, const uint8_t* data,
|
ReturnValue_t reportData(MessageQueueId_t reportTo, ActionId_t replyId, const uint8_t* data,
|
||||||
size_t dataSize, bool hideSender = false);
|
size_t dataSize, bool hideSender = false);
|
||||||
|
@ -2,9 +2,9 @@
|
|||||||
#include "fsfw/objectmanager/ObjectManager.h"
|
#include "fsfw/objectmanager/ObjectManager.h"
|
||||||
#include "fsfw/storagemanager/StorageManagerIF.h"
|
#include "fsfw/storagemanager/StorageManagerIF.h"
|
||||||
|
|
||||||
ActionMessage::ActionMessage() {}
|
ActionMessage::ActionMessage() = default;
|
||||||
|
|
||||||
ActionMessage::~ActionMessage() {}
|
ActionMessage::~ActionMessage() = default;
|
||||||
|
|
||||||
void ActionMessage::setCommand(CommandMessage* message, ActionId_t fid,
|
void ActionMessage::setCommand(CommandMessage* message, ActionId_t fid,
|
||||||
store_address_t parameters) {
|
store_address_t parameters) {
|
||||||
@ -25,7 +25,7 @@ store_address_t ActionMessage::getStoreId(const CommandMessage* message) {
|
|||||||
|
|
||||||
void ActionMessage::setStepReply(CommandMessage* message, ActionId_t fid, uint8_t step,
|
void ActionMessage::setStepReply(CommandMessage* message, ActionId_t fid, uint8_t step,
|
||||||
ReturnValue_t result) {
|
ReturnValue_t result) {
|
||||||
if (result == HasReturnvaluesIF::RETURN_OK) {
|
if (result == returnvalue::OK) {
|
||||||
message->setCommand(STEP_SUCCESS);
|
message->setCommand(STEP_SUCCESS);
|
||||||
} else {
|
} else {
|
||||||
message->setCommand(STEP_FAILED);
|
message->setCommand(STEP_FAILED);
|
||||||
@ -64,9 +64,8 @@ void ActionMessage::clear(CommandMessage* message) {
|
|||||||
switch (message->getCommand()) {
|
switch (message->getCommand()) {
|
||||||
case EXECUTE_ACTION:
|
case EXECUTE_ACTION:
|
||||||
case DATA_REPLY: {
|
case DATA_REPLY: {
|
||||||
StorageManagerIF* ipcStore =
|
auto* ipcStore = ObjectManager::instance()->get<StorageManagerIF>(objects::IPC_STORE);
|
||||||
ObjectManager::instance()->get<StorageManagerIF>(objects::IPC_STORE);
|
if (ipcStore != nullptr) {
|
||||||
if (ipcStore != NULL) {
|
|
||||||
ipcStore->deleteData(getStoreId(message));
|
ipcStore->deleteData(getStoreId(message));
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
@ -33,12 +33,12 @@ class ActionMessage {
|
|||||||
static store_address_t getStoreId(const CommandMessage* message);
|
static store_address_t getStoreId(const CommandMessage* message);
|
||||||
|
|
||||||
static void setStepReply(CommandMessage* message, ActionId_t fid, uint8_t step,
|
static void setStepReply(CommandMessage* message, ActionId_t fid, uint8_t step,
|
||||||
ReturnValue_t result = HasReturnvaluesIF::RETURN_OK);
|
ReturnValue_t result = returnvalue::OK);
|
||||||
static uint8_t getStep(const CommandMessage* message);
|
static uint8_t getStep(const CommandMessage* message);
|
||||||
static ReturnValue_t getReturnCode(const CommandMessage* message);
|
static ReturnValue_t getReturnCode(const CommandMessage* message);
|
||||||
static void setDataReply(CommandMessage* message, ActionId_t actionId, store_address_t data);
|
static void setDataReply(CommandMessage* message, ActionId_t actionId, store_address_t data);
|
||||||
static void setCompletionReply(CommandMessage* message, ActionId_t fid, bool success,
|
static void setCompletionReply(CommandMessage* message, ActionId_t fid, bool success,
|
||||||
ReturnValue_t result = HasReturnvaluesIF::RETURN_OK);
|
ReturnValue_t result = returnvalue::OK);
|
||||||
|
|
||||||
static void clear(CommandMessage* message);
|
static void clear(CommandMessage* message);
|
||||||
};
|
};
|
||||||
|
@ -1,7 +1,3 @@
|
|||||||
target_sources(${LIB_FSFW_NAME}
|
target_sources(
|
||||||
PRIVATE
|
${LIB_FSFW_NAME} PRIVATE ActionHelper.cpp ActionMessage.cpp
|
||||||
ActionHelper.cpp
|
CommandActionHelper.cpp SimpleActionHelper.cpp)
|
||||||
ActionMessage.cpp
|
|
||||||
CommandActionHelper.cpp
|
|
||||||
SimpleActionHelper.cpp
|
|
||||||
)
|
|
||||||
|
@ -2,26 +2,26 @@
|
|||||||
#include "fsfw/objectmanager/ObjectManager.h"
|
#include "fsfw/objectmanager/ObjectManager.h"
|
||||||
|
|
||||||
CommandActionHelper::CommandActionHelper(CommandsActionsIF *setOwner)
|
CommandActionHelper::CommandActionHelper(CommandsActionsIF *setOwner)
|
||||||
: owner(setOwner), queueToUse(NULL), ipcStore(NULL), commandCount(0), lastTarget(0) {}
|
: owner(setOwner), queueToUse(nullptr), ipcStore(nullptr), commandCount(0), lastTarget(0) {}
|
||||||
|
|
||||||
CommandActionHelper::~CommandActionHelper() {}
|
CommandActionHelper::~CommandActionHelper() = default;
|
||||||
|
|
||||||
ReturnValue_t CommandActionHelper::commandAction(object_id_t commandTo, ActionId_t actionId,
|
ReturnValue_t CommandActionHelper::commandAction(object_id_t commandTo, ActionId_t actionId,
|
||||||
SerializeIF *data) {
|
SerializeIF *data) {
|
||||||
HasActionsIF *receiver = ObjectManager::instance()->get<HasActionsIF>(commandTo);
|
auto *receiver = ObjectManager::instance()->get<HasActionsIF>(commandTo);
|
||||||
if (receiver == NULL) {
|
if (receiver == nullptr) {
|
||||||
return CommandsActionsIF::OBJECT_HAS_NO_FUNCTIONS;
|
return CommandsActionsIF::OBJECT_HAS_NO_FUNCTIONS;
|
||||||
}
|
}
|
||||||
store_address_t storeId;
|
store_address_t storeId;
|
||||||
uint8_t *storePointer;
|
uint8_t *storePointer;
|
||||||
size_t maxSize = data->getSerializedSize();
|
size_t maxSize = data->getSerializedSize();
|
||||||
ReturnValue_t result = ipcStore->getFreeElement(&storeId, maxSize, &storePointer);
|
ReturnValue_t result = ipcStore->getFreeElement(&storeId, maxSize, &storePointer);
|
||||||
if (result != HasReturnvaluesIF::RETURN_OK) {
|
if (result != returnvalue::OK) {
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
size_t size = 0;
|
size_t size = 0;
|
||||||
result = data->serialize(&storePointer, &size, maxSize, SerializeIF::Endianness::BIG);
|
result = data->serialize(&storePointer, &size, maxSize, SerializeIF::Endianness::BIG);
|
||||||
if (result != HasReturnvaluesIF::RETURN_OK) {
|
if (result != returnvalue::OK) {
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
return sendCommand(receiver->getCommandQueue(), actionId, storeId);
|
return sendCommand(receiver->getCommandQueue(), actionId, storeId);
|
||||||
@ -29,16 +29,13 @@ ReturnValue_t CommandActionHelper::commandAction(object_id_t commandTo, ActionId
|
|||||||
|
|
||||||
ReturnValue_t CommandActionHelper::commandAction(object_id_t commandTo, ActionId_t actionId,
|
ReturnValue_t CommandActionHelper::commandAction(object_id_t commandTo, ActionId_t actionId,
|
||||||
const uint8_t *data, uint32_t size) {
|
const uint8_t *data, uint32_t size) {
|
||||||
// if (commandCount != 0) {
|
auto *receiver = ObjectManager::instance()->get<HasActionsIF>(commandTo);
|
||||||
// return CommandsFunctionsIF::ALREADY_COMMANDING;
|
if (receiver == nullptr) {
|
||||||
// }
|
|
||||||
HasActionsIF *receiver = ObjectManager::instance()->get<HasActionsIF>(commandTo);
|
|
||||||
if (receiver == NULL) {
|
|
||||||
return CommandsActionsIF::OBJECT_HAS_NO_FUNCTIONS;
|
return CommandsActionsIF::OBJECT_HAS_NO_FUNCTIONS;
|
||||||
}
|
}
|
||||||
store_address_t storeId;
|
store_address_t storeId;
|
||||||
ReturnValue_t result = ipcStore->addData(&storeId, data, size);
|
ReturnValue_t result = ipcStore->addData(&storeId, data, size);
|
||||||
if (result != HasReturnvaluesIF::RETURN_OK) {
|
if (result != returnvalue::OK) {
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
return sendCommand(receiver->getCommandQueue(), actionId, storeId);
|
return sendCommand(receiver->getCommandQueue(), actionId, storeId);
|
||||||
@ -49,7 +46,7 @@ ReturnValue_t CommandActionHelper::sendCommand(MessageQueueId_t queueId, ActionI
|
|||||||
CommandMessage command;
|
CommandMessage command;
|
||||||
ActionMessage::setCommand(&command, actionId, storeId);
|
ActionMessage::setCommand(&command, actionId, storeId);
|
||||||
ReturnValue_t result = queueToUse->sendMessage(queueId, &command);
|
ReturnValue_t result = queueToUse->sendMessage(queueId, &command);
|
||||||
if (result != HasReturnvaluesIF::RETURN_OK) {
|
if (result != returnvalue::OK) {
|
||||||
ipcStore->deleteData(storeId);
|
ipcStore->deleteData(storeId);
|
||||||
}
|
}
|
||||||
lastTarget = queueId;
|
lastTarget = queueId;
|
||||||
@ -59,55 +56,55 @@ ReturnValue_t CommandActionHelper::sendCommand(MessageQueueId_t queueId, ActionI
|
|||||||
|
|
||||||
ReturnValue_t CommandActionHelper::initialize() {
|
ReturnValue_t CommandActionHelper::initialize() {
|
||||||
ipcStore = ObjectManager::instance()->get<StorageManagerIF>(objects::IPC_STORE);
|
ipcStore = ObjectManager::instance()->get<StorageManagerIF>(objects::IPC_STORE);
|
||||||
if (ipcStore == NULL) {
|
if (ipcStore == nullptr) {
|
||||||
return HasReturnvaluesIF::RETURN_FAILED;
|
return returnvalue::FAILED;
|
||||||
}
|
}
|
||||||
|
|
||||||
queueToUse = owner->getCommandQueuePtr();
|
queueToUse = owner->getCommandQueuePtr();
|
||||||
if (queueToUse == NULL) {
|
if (queueToUse == nullptr) {
|
||||||
return HasReturnvaluesIF::RETURN_FAILED;
|
return returnvalue::FAILED;
|
||||||
}
|
}
|
||||||
return HasReturnvaluesIF::RETURN_OK;
|
return returnvalue::OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
ReturnValue_t CommandActionHelper::handleReply(CommandMessage *reply) {
|
ReturnValue_t CommandActionHelper::handleReply(CommandMessage *reply) {
|
||||||
if (reply->getSender() != lastTarget) {
|
if (reply->getSender() != lastTarget) {
|
||||||
return HasReturnvaluesIF::RETURN_FAILED;
|
return returnvalue::FAILED;
|
||||||
}
|
}
|
||||||
switch (reply->getCommand()) {
|
switch (reply->getCommand()) {
|
||||||
case ActionMessage::COMPLETION_SUCCESS:
|
case ActionMessage::COMPLETION_SUCCESS:
|
||||||
commandCount--;
|
commandCount--;
|
||||||
owner->completionSuccessfulReceived(ActionMessage::getActionId(reply));
|
owner->completionSuccessfulReceived(ActionMessage::getActionId(reply));
|
||||||
return HasReturnvaluesIF::RETURN_OK;
|
return returnvalue::OK;
|
||||||
case ActionMessage::COMPLETION_FAILED:
|
case ActionMessage::COMPLETION_FAILED:
|
||||||
commandCount--;
|
commandCount--;
|
||||||
owner->completionFailedReceived(ActionMessage::getActionId(reply),
|
owner->completionFailedReceived(ActionMessage::getActionId(reply),
|
||||||
ActionMessage::getReturnCode(reply));
|
ActionMessage::getReturnCode(reply));
|
||||||
return HasReturnvaluesIF::RETURN_OK;
|
return returnvalue::OK;
|
||||||
case ActionMessage::STEP_SUCCESS:
|
case ActionMessage::STEP_SUCCESS:
|
||||||
owner->stepSuccessfulReceived(ActionMessage::getActionId(reply),
|
owner->stepSuccessfulReceived(ActionMessage::getActionId(reply),
|
||||||
ActionMessage::getStep(reply));
|
ActionMessage::getStep(reply));
|
||||||
return HasReturnvaluesIF::RETURN_OK;
|
return returnvalue::OK;
|
||||||
case ActionMessage::STEP_FAILED:
|
case ActionMessage::STEP_FAILED:
|
||||||
commandCount--;
|
commandCount--;
|
||||||
owner->stepFailedReceived(ActionMessage::getActionId(reply), ActionMessage::getStep(reply),
|
owner->stepFailedReceived(ActionMessage::getActionId(reply), ActionMessage::getStep(reply),
|
||||||
ActionMessage::getReturnCode(reply));
|
ActionMessage::getReturnCode(reply));
|
||||||
return HasReturnvaluesIF::RETURN_OK;
|
return returnvalue::OK;
|
||||||
case ActionMessage::DATA_REPLY:
|
case ActionMessage::DATA_REPLY:
|
||||||
extractDataForOwner(ActionMessage::getActionId(reply), ActionMessage::getStoreId(reply));
|
extractDataForOwner(ActionMessage::getActionId(reply), ActionMessage::getStoreId(reply));
|
||||||
return HasReturnvaluesIF::RETURN_OK;
|
return returnvalue::OK;
|
||||||
default:
|
default:
|
||||||
return HasReturnvaluesIF::RETURN_FAILED;
|
return returnvalue::FAILED;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
uint8_t CommandActionHelper::getCommandCount() const { return commandCount; }
|
uint8_t CommandActionHelper::getCommandCount() const { return commandCount; }
|
||||||
|
|
||||||
void CommandActionHelper::extractDataForOwner(ActionId_t actionId, store_address_t storeId) {
|
void CommandActionHelper::extractDataForOwner(ActionId_t actionId, store_address_t storeId) {
|
||||||
const uint8_t *data = NULL;
|
const uint8_t *data = nullptr;
|
||||||
size_t size = 0;
|
size_t size = 0;
|
||||||
ReturnValue_t result = ipcStore->getData(storeId, &data, &size);
|
ReturnValue_t result = ipcStore->getData(storeId, &data, &size);
|
||||||
if (result != HasReturnvaluesIF::RETURN_OK) {
|
if (result != returnvalue::OK) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
owner->dataReceived(actionId, data, size);
|
owner->dataReceived(actionId, data, size);
|
||||||
|
@ -4,7 +4,7 @@
|
|||||||
#include "ActionMessage.h"
|
#include "ActionMessage.h"
|
||||||
#include "fsfw/ipc/MessageQueueIF.h"
|
#include "fsfw/ipc/MessageQueueIF.h"
|
||||||
#include "fsfw/objectmanager/ObjectManagerIF.h"
|
#include "fsfw/objectmanager/ObjectManagerIF.h"
|
||||||
#include "fsfw/returnvalues/HasReturnvaluesIF.h"
|
#include "fsfw/returnvalues/returnvalue.h"
|
||||||
#include "fsfw/serialize/SerializeIF.h"
|
#include "fsfw/serialize/SerializeIF.h"
|
||||||
#include "fsfw/storagemanager/StorageManagerIF.h"
|
#include "fsfw/storagemanager/StorageManagerIF.h"
|
||||||
|
|
||||||
@ -14,14 +14,14 @@ class CommandActionHelper {
|
|||||||
friend class CommandsActionsIF;
|
friend class CommandsActionsIF;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
CommandActionHelper(CommandsActionsIF* owner);
|
explicit CommandActionHelper(CommandsActionsIF* owner);
|
||||||
virtual ~CommandActionHelper();
|
virtual ~CommandActionHelper();
|
||||||
ReturnValue_t commandAction(object_id_t commandTo, ActionId_t actionId,
|
ReturnValue_t commandAction(object_id_t commandTo, ActionId_t actionId,
|
||||||
const uint8_t* data = nullptr, uint32_t size = 0);
|
const uint8_t* data = nullptr, uint32_t size = 0);
|
||||||
ReturnValue_t commandAction(object_id_t commandTo, ActionId_t actionId, SerializeIF* data);
|
ReturnValue_t commandAction(object_id_t commandTo, ActionId_t actionId, SerializeIF* data);
|
||||||
ReturnValue_t initialize();
|
ReturnValue_t initialize();
|
||||||
ReturnValue_t handleReply(CommandMessage* reply);
|
ReturnValue_t handleReply(CommandMessage* reply);
|
||||||
uint8_t getCommandCount() const;
|
[[nodiscard]] uint8_t getCommandCount() const;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
CommandsActionsIF* owner;
|
CommandsActionsIF* owner;
|
||||||
|
@ -1,9 +1,9 @@
|
|||||||
#ifndef FSFW_ACTION_COMMANDSACTIONSIF_H_
|
#ifndef FSFW_ACTION_COMMANDSACTIONSIF_H_
|
||||||
#define FSFW_ACTION_COMMANDSACTIONSIF_H_
|
#define FSFW_ACTION_COMMANDSACTIONSIF_H_
|
||||||
|
|
||||||
#include "../ipc/MessageQueueIF.h"
|
|
||||||
#include "../returnvalues/HasReturnvaluesIF.h"
|
|
||||||
#include "CommandActionHelper.h"
|
#include "CommandActionHelper.h"
|
||||||
|
#include "fsfw/ipc/MessageQueueIF.h"
|
||||||
|
#include "fsfw/returnvalues/returnvalue.h"
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Interface to separate commanding actions of other objects.
|
* Interface to separate commanding actions of other objects.
|
||||||
@ -21,7 +21,7 @@ class CommandsActionsIF {
|
|||||||
static const uint8_t INTERFACE_ID = CLASS_ID::COMMANDS_ACTIONS_IF;
|
static const uint8_t INTERFACE_ID = CLASS_ID::COMMANDS_ACTIONS_IF;
|
||||||
static const ReturnValue_t OBJECT_HAS_NO_FUNCTIONS = MAKE_RETURN_CODE(1);
|
static const ReturnValue_t OBJECT_HAS_NO_FUNCTIONS = MAKE_RETURN_CODE(1);
|
||||||
static const ReturnValue_t ALREADY_COMMANDING = MAKE_RETURN_CODE(2);
|
static const ReturnValue_t ALREADY_COMMANDING = MAKE_RETURN_CODE(2);
|
||||||
virtual ~CommandsActionsIF() {}
|
virtual ~CommandsActionsIF() = default;
|
||||||
virtual MessageQueueIF* getCommandQueuePtr() = 0;
|
virtual MessageQueueIF* getCommandQueuePtr() = 0;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
@ -1,11 +1,11 @@
|
|||||||
#ifndef FSFW_ACTION_HASACTIONSIF_H_
|
#ifndef FSFW_ACTION_HASACTIONSIF_H_
|
||||||
#define FSFW_ACTION_HASACTIONSIF_H_
|
#define FSFW_ACTION_HASACTIONSIF_H_
|
||||||
|
|
||||||
#include "../ipc/MessageQueueIF.h"
|
|
||||||
#include "../returnvalues/HasReturnvaluesIF.h"
|
|
||||||
#include "ActionHelper.h"
|
#include "ActionHelper.h"
|
||||||
#include "ActionMessage.h"
|
#include "ActionMessage.h"
|
||||||
#include "SimpleActionHelper.h"
|
#include "SimpleActionHelper.h"
|
||||||
|
#include "fsfw/ipc/MessageQueueIF.h"
|
||||||
|
#include "fsfw/returnvalues/returnvalue.h"
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief
|
* @brief
|
||||||
@ -40,12 +40,12 @@ class HasActionsIF {
|
|||||||
static const ReturnValue_t INVALID_PARAMETERS = MAKE_RETURN_CODE(2);
|
static const ReturnValue_t INVALID_PARAMETERS = MAKE_RETURN_CODE(2);
|
||||||
static const ReturnValue_t EXECUTION_FINISHED = MAKE_RETURN_CODE(3);
|
static const ReturnValue_t EXECUTION_FINISHED = MAKE_RETURN_CODE(3);
|
||||||
static const ReturnValue_t INVALID_ACTION_ID = MAKE_RETURN_CODE(4);
|
static const ReturnValue_t INVALID_ACTION_ID = MAKE_RETURN_CODE(4);
|
||||||
virtual ~HasActionsIF() {}
|
virtual ~HasActionsIF() = default;
|
||||||
/**
|
/**
|
||||||
* Function to get the MessageQueueId_t of the implementing object
|
* Function to get the MessageQueueId_t of the implementing object
|
||||||
* @return MessageQueueId_t of the object
|
* @return MessageQueueId_t of the object
|
||||||
*/
|
*/
|
||||||
virtual MessageQueueId_t getCommandQueue() const = 0;
|
[[nodiscard]] virtual MessageQueueId_t getCommandQueue() const = 0;
|
||||||
/**
|
/**
|
||||||
* Execute or initialize the execution of a certain function.
|
* Execute or initialize the execution of a certain function.
|
||||||
* The ActionHelpers will execute this function and behave differently
|
* The ActionHelpers will execute this function and behave differently
|
||||||
@ -53,7 +53,7 @@ class HasActionsIF {
|
|||||||
*
|
*
|
||||||
* @return
|
* @return
|
||||||
* -@c EXECUTION_FINISHED Finish reply will be generated
|
* -@c EXECUTION_FINISHED Finish reply will be generated
|
||||||
* -@c Not RETURN_OK Step failure reply will be generated
|
* -@c Not returnvalue::OK Step failure reply will be generated
|
||||||
*/
|
*/
|
||||||
virtual ReturnValue_t executeAction(ActionId_t actionId, MessageQueueId_t commandedBy,
|
virtual ReturnValue_t executeAction(ActionId_t actionId, MessageQueueId_t commandedBy,
|
||||||
const uint8_t* data, size_t size) = 0;
|
const uint8_t* data, size_t size) = 0;
|
||||||
|
@ -3,13 +3,13 @@
|
|||||||
SimpleActionHelper::SimpleActionHelper(HasActionsIF* setOwner, MessageQueueIF* useThisQueue)
|
SimpleActionHelper::SimpleActionHelper(HasActionsIF* setOwner, MessageQueueIF* useThisQueue)
|
||||||
: ActionHelper(setOwner, useThisQueue), isExecuting(false) {}
|
: ActionHelper(setOwner, useThisQueue), isExecuting(false) {}
|
||||||
|
|
||||||
SimpleActionHelper::~SimpleActionHelper() {}
|
SimpleActionHelper::~SimpleActionHelper() = default;
|
||||||
|
|
||||||
void SimpleActionHelper::step(ReturnValue_t result) {
|
void SimpleActionHelper::step(ReturnValue_t result) {
|
||||||
// STEP_OFFESET is subtracted to compensate for adding offset in base
|
// STEP_OFFESET is subtracted to compensate for adding offset in base
|
||||||
// method, which is not necessary here.
|
// method, which is not necessary here.
|
||||||
ActionHelper::step(stepCount - STEP_OFFSET, lastCommander, lastAction, result);
|
ActionHelper::step(stepCount - STEP_OFFSET, lastCommander, lastAction, result);
|
||||||
if (result != HasReturnvaluesIF::RETURN_OK) {
|
if (result != returnvalue::OK) {
|
||||||
resetHelper();
|
resetHelper();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -38,10 +38,10 @@ void SimpleActionHelper::prepareExecution(MessageQueueId_t commandedBy, ActionId
|
|||||||
ActionMessage::setStepReply(&reply, actionId, 0, HasActionsIF::IS_BUSY);
|
ActionMessage::setStepReply(&reply, actionId, 0, HasActionsIF::IS_BUSY);
|
||||||
queueToUse->sendMessage(commandedBy, &reply);
|
queueToUse->sendMessage(commandedBy, &reply);
|
||||||
}
|
}
|
||||||
const uint8_t* dataPtr = NULL;
|
const uint8_t* dataPtr = nullptr;
|
||||||
size_t size = 0;
|
size_t size = 0;
|
||||||
ReturnValue_t result = ipcStore->getData(dataAddress, &dataPtr, &size);
|
ReturnValue_t result = ipcStore->getData(dataAddress, &dataPtr, &size);
|
||||||
if (result != HasReturnvaluesIF::RETURN_OK) {
|
if (result != returnvalue::OK) {
|
||||||
ActionMessage::setStepReply(&reply, actionId, 0, result);
|
ActionMessage::setStepReply(&reply, actionId, 0, result);
|
||||||
queueToUse->sendMessage(commandedBy, &reply);
|
queueToUse->sendMessage(commandedBy, &reply);
|
||||||
return;
|
return;
|
||||||
@ -51,12 +51,12 @@ void SimpleActionHelper::prepareExecution(MessageQueueId_t commandedBy, ActionId
|
|||||||
result = owner->executeAction(actionId, commandedBy, dataPtr, size);
|
result = owner->executeAction(actionId, commandedBy, dataPtr, size);
|
||||||
ipcStore->deleteData(dataAddress);
|
ipcStore->deleteData(dataAddress);
|
||||||
switch (result) {
|
switch (result) {
|
||||||
case HasReturnvaluesIF::RETURN_OK:
|
case returnvalue::OK:
|
||||||
isExecuting = true;
|
isExecuting = true;
|
||||||
stepCount++;
|
stepCount++;
|
||||||
break;
|
break;
|
||||||
case HasActionsIF::EXECUTION_FINISHED:
|
case HasActionsIF::EXECUTION_FINISHED:
|
||||||
ActionMessage::setCompletionReply(&reply, actionId, true, HasReturnvaluesIF::RETURN_OK);
|
ActionMessage::setCompletionReply(&reply, actionId, true, returnvalue::OK);
|
||||||
queueToUse->sendMessage(commandedBy, &reply);
|
queueToUse->sendMessage(commandedBy, &reply);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
|
@ -11,15 +11,15 @@
|
|||||||
class SimpleActionHelper : public ActionHelper {
|
class SimpleActionHelper : public ActionHelper {
|
||||||
public:
|
public:
|
||||||
SimpleActionHelper(HasActionsIF* setOwner, MessageQueueIF* useThisQueue);
|
SimpleActionHelper(HasActionsIF* setOwner, MessageQueueIF* useThisQueue);
|
||||||
virtual ~SimpleActionHelper();
|
~SimpleActionHelper() override;
|
||||||
void step(ReturnValue_t result = HasReturnvaluesIF::RETURN_OK);
|
void step(ReturnValue_t result = returnvalue::OK);
|
||||||
void finish(ReturnValue_t result = HasReturnvaluesIF::RETURN_OK);
|
void finish(ReturnValue_t result = returnvalue::OK);
|
||||||
ReturnValue_t reportData(SerializeIF* data);
|
ReturnValue_t reportData(SerializeIF* data);
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
void prepareExecution(MessageQueueId_t commandedBy, ActionId_t actionId,
|
void prepareExecution(MessageQueueId_t commandedBy, ActionId_t actionId,
|
||||||
store_address_t dataAddress);
|
store_address_t dataAddress) override;
|
||||||
virtual void resetHelper();
|
void resetHelper() override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
bool isExecuting;
|
bool isExecuting;
|
||||||
@ -28,4 +28,4 @@ class SimpleActionHelper : public ActionHelper {
|
|||||||
uint8_t stepCount = 0;
|
uint8_t stepCount = 0;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif /* SIMPLEACTIONHELPER_H_ */
|
#endif /* FSFW_ACTION_SIMPLEACTIONHELPER_H_ */
|
||||||
|
12
src/fsfw/cfdp.h
Normal file
12
src/fsfw/cfdp.h
Normal 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
|
@ -1,59 +0,0 @@
|
|||||||
#include "fsfw/cfdp/CFDPHandler.h"
|
|
||||||
|
|
||||||
#include "fsfw/cfdp/CFDPMessage.h"
|
|
||||||
#include "fsfw/ipc/CommandMessage.h"
|
|
||||||
#include "fsfw/ipc/QueueFactory.h"
|
|
||||||
#include "fsfw/objectmanager/ObjectManager.h"
|
|
||||||
#include "fsfw/storagemanager/storeAddress.h"
|
|
||||||
#include "fsfw/tmtcservices/AcceptsTelemetryIF.h"
|
|
||||||
|
|
||||||
object_id_t CFDPHandler::packetSource = 0;
|
|
||||||
object_id_t CFDPHandler::packetDestination = 0;
|
|
||||||
|
|
||||||
CFDPHandler::CFDPHandler(object_id_t setObjectId, CFDPDistributor* dist)
|
|
||||||
: SystemObject(setObjectId) {
|
|
||||||
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() {}
|
|
||||||
|
|
||||||
ReturnValue_t CFDPHandler::initialize() {
|
|
||||||
ReturnValue_t result = SystemObject::initialize();
|
|
||||||
if (result != RETURN_OK) {
|
|
||||||
return result;
|
|
||||||
}
|
|
||||||
this->distributor->registerHandler(this);
|
|
||||||
return HasReturnvaluesIF::RETURN_OK;
|
|
||||||
}
|
|
||||||
|
|
||||||
ReturnValue_t CFDPHandler::handleRequest(store_address_t storeId) {
|
|
||||||
#if FSFW_VERBOSE_LEVEL >= 1
|
|
||||||
#if FSFW_CPP_OSTREAM_ENABLED == 1
|
|
||||||
sif::debug << "CFDPHandler::handleRequest" << std::endl;
|
|
||||||
#else
|
|
||||||
sif::printDebug("CFDPHandler::handleRequest\n");
|
|
||||||
#endif /* !FSFW_CPP_OSTREAM_ENABLED == 1 */
|
|
||||||
#endif
|
|
||||||
|
|
||||||
// TODO read out packet from store using storeId
|
|
||||||
|
|
||||||
return RETURN_OK;
|
|
||||||
}
|
|
||||||
|
|
||||||
ReturnValue_t CFDPHandler::performOperation(uint8_t opCode) {
|
|
||||||
ReturnValue_t status = RETURN_OK;
|
|
||||||
CommandMessage currentMessage;
|
|
||||||
for (status = this->requestQueue->receiveMessage(¤tMessage); status == RETURN_OK;
|
|
||||||
status = this->requestQueue->receiveMessage(¤tMessage)) {
|
|
||||||
store_address_t storeId = CFDPMessage::getStoreId(¤tMessage);
|
|
||||||
this->handleRequest(storeId);
|
|
||||||
}
|
|
||||||
return RETURN_OK;
|
|
||||||
}
|
|
||||||
|
|
||||||
uint16_t CFDPHandler::getIdentifier() { return 0; }
|
|
||||||
|
|
||||||
MessageQueueId_t CFDPHandler::getRequestQueue() { return this->requestQueue->getId(); }
|
|
@ -1,63 +0,0 @@
|
|||||||
#ifndef FSFW_CFDP_CFDPHANDLER_H_
|
|
||||||
#define FSFW_CFDP_CFDPHANDLER_H_
|
|
||||||
|
|
||||||
#include "fsfw/ipc/MessageQueueIF.h"
|
|
||||||
#include "fsfw/objectmanager/SystemObject.h"
|
|
||||||
#include "fsfw/returnvalues/HasReturnvaluesIF.h"
|
|
||||||
#include "fsfw/tasks/ExecutableObjectIF.h"
|
|
||||||
#include "fsfw/tcdistribution/CFDPDistributor.h"
|
|
||||||
#include "fsfw/tmtcservices/AcceptsTelecommandsIF.h"
|
|
||||||
|
|
||||||
namespace Factory {
|
|
||||||
void setStaticFrameworkObjectIds();
|
|
||||||
}
|
|
||||||
|
|
||||||
class CFDPHandler : public ExecutableObjectIF,
|
|
||||||
public AcceptsTelecommandsIF,
|
|
||||||
public SystemObject,
|
|
||||||
public HasReturnvaluesIF {
|
|
||||||
friend void(Factory::setStaticFrameworkObjectIds)();
|
|
||||||
|
|
||||||
public:
|
|
||||||
CFDPHandler(object_id_t setObjectId, CFDPDistributor* distributor);
|
|
||||||
/**
|
|
||||||
* The destructor is empty.
|
|
||||||
*/
|
|
||||||
virtual ~CFDPHandler();
|
|
||||||
|
|
||||||
virtual ReturnValue_t handleRequest(store_address_t storeId);
|
|
||||||
|
|
||||||
virtual ReturnValue_t initialize() override;
|
|
||||||
virtual uint16_t getIdentifier() override;
|
|
||||||
MessageQueueId_t getRequestQueue() override;
|
|
||||||
ReturnValue_t performOperation(uint8_t opCode) override;
|
|
||||||
|
|
||||||
protected:
|
|
||||||
/**
|
|
||||||
* This is a complete instance of the telecommand reception queue
|
|
||||||
* of the class. It is initialized on construction of the class.
|
|
||||||
*/
|
|
||||||
MessageQueueIF* requestQueue = nullptr;
|
|
||||||
|
|
||||||
CFDPDistributor* distributor = nullptr;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* The current CFDP packet to be processed.
|
|
||||||
* It is deleted after handleRequest was executed.
|
|
||||||
*/
|
|
||||||
CFDPPacketStored currentPacket;
|
|
||||||
|
|
||||||
static object_id_t packetSource;
|
|
||||||
|
|
||||||
static object_id_t packetDestination;
|
|
||||||
|
|
||||||
private:
|
|
||||||
/**
|
|
||||||
* This constant sets the maximum number of packets accepted per call.
|
|
||||||
* Remember that one packet must be completely handled in one
|
|
||||||
* #handleRequest call.
|
|
||||||
*/
|
|
||||||
static const uint8_t CFDP_HANDLER_MAX_RECEPTION = 100;
|
|
||||||
};
|
|
||||||
|
|
||||||
#endif /* FSFW_CFDP_CFDPHANDLER_H_ */
|
|
@ -1,17 +0,0 @@
|
|||||||
#include "CFDPMessage.h"
|
|
||||||
|
|
||||||
CFDPMessage::CFDPMessage() {}
|
|
||||||
|
|
||||||
CFDPMessage::~CFDPMessage() {}
|
|
||||||
|
|
||||||
void CFDPMessage::setCommand(CommandMessage *message, store_address_t cfdpPacket) {
|
|
||||||
message->setParameter(cfdpPacket.raw);
|
|
||||||
}
|
|
||||||
|
|
||||||
store_address_t CFDPMessage::getStoreId(const CommandMessage *message) {
|
|
||||||
store_address_t storeAddressCFDPPacket;
|
|
||||||
storeAddressCFDPPacket = message->getParameter();
|
|
||||||
return storeAddressCFDPPacket;
|
|
||||||
}
|
|
||||||
|
|
||||||
void CFDPMessage::clear(CommandMessage *message) {}
|
|
@ -1,7 +1,6 @@
|
|||||||
target_sources(${LIB_FSFW_NAME} PRIVATE
|
target_sources(${LIB_FSFW_NAME} PRIVATE CfdpMessage.cpp CfdpDistributor.cpp
|
||||||
CFDPHandler.cpp
|
VarLenFields.cpp helpers.cpp)
|
||||||
CFDPMessage.cpp
|
|
||||||
)
|
|
||||||
|
|
||||||
add_subdirectory(pdu)
|
add_subdirectory(pdu)
|
||||||
add_subdirectory(tlv)
|
add_subdirectory(tlv)
|
||||||
|
add_subdirectory(handler)
|
||||||
|
55
src/fsfw/cfdp/CfdpDistributor.cpp
Normal file
55
src/fsfw/cfdp/CfdpDistributor.cpp
Normal 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(); }
|
76
src/fsfw/cfdp/CfdpDistributor.h
Normal file
76
src/fsfw/cfdp/CfdpDistributor.h
Normal 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_ */
|
18
src/fsfw/cfdp/CfdpMessage.cpp
Normal file
18
src/fsfw/cfdp/CfdpMessage.cpp
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
#include "CfdpMessage.h"
|
||||||
|
|
||||||
|
CfdpMessage::CfdpMessage() = default;
|
||||||
|
|
||||||
|
CfdpMessage::~CfdpMessage() = default;
|
||||||
|
|
||||||
|
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) {
|
||||||
|
store_address_t storeId;
|
||||||
|
storeId = static_cast<store_address_t>(message->getParameter());
|
||||||
|
return storeId;
|
||||||
|
}
|
||||||
|
|
||||||
|
void CfdpMessage::clear(CommandMessage *message) {}
|
@ -5,15 +5,17 @@
|
|||||||
#include "fsfw/objectmanager/ObjectManagerIF.h"
|
#include "fsfw/objectmanager/ObjectManagerIF.h"
|
||||||
#include "fsfw/storagemanager/StorageManagerIF.h"
|
#include "fsfw/storagemanager/StorageManagerIF.h"
|
||||||
|
|
||||||
class CFDPMessage {
|
class CfdpMessage {
|
||||||
private:
|
private:
|
||||||
CFDPMessage();
|
CfdpMessage();
|
||||||
|
|
||||||
public:
|
public:
|
||||||
static const uint8_t MESSAGE_ID = messagetypes::CFDP;
|
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();
|
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);
|
static store_address_t getStoreId(const CommandMessage* message);
|
||||||
|
|
@ -1,16 +1,23 @@
|
|||||||
#ifndef FSFW_SRC_FSFW_CFDP_FILESIZE_H_
|
#ifndef FSFW_CFDP_FILESIZE_H_
|
||||||
#define FSFW_SRC_FSFW_CFDP_FILESIZE_H_
|
#define FSFW_CFDP_FILESIZE_H_
|
||||||
|
|
||||||
|
#include <optional>
|
||||||
|
|
||||||
#include "fsfw/serialize/SerializeAdapter.h"
|
#include "fsfw/serialize/SerializeAdapter.h"
|
||||||
#include "fsfw/serialize/SerializeIF.h"
|
#include "fsfw/serialize/SerializeIF.h"
|
||||||
|
|
||||||
namespace cfdp {
|
namespace cfdp {
|
||||||
|
|
||||||
struct FileSize : public SerializeIF {
|
/**
|
||||||
|
* Helper type for the CFDP File Size Sensitive (FSS) fields.
|
||||||
|
*/
|
||||||
|
struct Fss : public SerializeIF {
|
||||||
public:
|
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,
|
ReturnValue_t serialize(bool isLarge, uint8_t **buffer, size_t *size, size_t maxSize,
|
||||||
Endianness streamEndianness) {
|
Endianness streamEndianness) {
|
||||||
@ -27,7 +34,7 @@ struct FileSize : public SerializeIF {
|
|||||||
return SerializeAdapter::serialize(&fileSize, buffer, size, maxSize, streamEndianness);
|
return SerializeAdapter::serialize(&fileSize, buffer, size, maxSize, streamEndianness);
|
||||||
}
|
}
|
||||||
|
|
||||||
size_t getSerializedSize() const override {
|
[[nodiscard]] size_t getSerializedSize() const override {
|
||||||
if (largeFile) {
|
if (largeFile) {
|
||||||
return 8;
|
return 8;
|
||||||
} else {
|
} else {
|
||||||
@ -43,27 +50,29 @@ struct FileSize : public SerializeIF {
|
|||||||
uint32_t sizeTmp = 0;
|
uint32_t sizeTmp = 0;
|
||||||
ReturnValue_t result =
|
ReturnValue_t result =
|
||||||
SerializeAdapter::deSerialize(&sizeTmp, buffer, size, streamEndianness);
|
SerializeAdapter::deSerialize(&sizeTmp, buffer, size, streamEndianness);
|
||||||
if (result == HasReturnvaluesIF::RETURN_OK) {
|
if (result == returnvalue::OK) {
|
||||||
fileSize = sizeTmp;
|
fileSize = sizeTmp;
|
||||||
}
|
}
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
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) {
|
if (not largeFile and fileSize > UINT32_MAX) {
|
||||||
// TODO: emit warning here
|
// TODO: emit warning here
|
||||||
return HasReturnvaluesIF::RETURN_FAILED;
|
return returnvalue::FAILED;
|
||||||
}
|
}
|
||||||
this->fileSize = fileSize;
|
this->fileSize = fileSize_;
|
||||||
this->largeFile = largeFile;
|
return returnvalue::OK;
|
||||||
return HasReturnvaluesIF::RETURN_OK;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
bool isLargeFile() const { return largeFile; }
|
[[nodiscard]] bool isLargeFile() const { return largeFile; }
|
||||||
uint64_t getSize(bool *largeFile = nullptr) const {
|
uint64_t getSize(bool *largeFile_ = nullptr) const {
|
||||||
if (largeFile != nullptr) {
|
if (largeFile_ != nullptr) {
|
||||||
*largeFile = this->largeFile;
|
*largeFile_ = this->largeFile;
|
||||||
}
|
}
|
||||||
return fileSize;
|
return fileSize;
|
||||||
}
|
}
|
||||||
@ -75,4 +84,4 @@ struct FileSize : public SerializeIF {
|
|||||||
|
|
||||||
} // namespace cfdp
|
} // namespace cfdp
|
||||||
|
|
||||||
#endif /* FSFW_SRC_FSFW_CFDP_FILESIZE_H_ */
|
#endif /* FSFW_CFDP_FILESIZE_H_ */
|
@ -1,12 +1,11 @@
|
|||||||
#include "VarLenField.h"
|
#include "VarLenFields.h"
|
||||||
|
|
||||||
#include "fsfw/FSFW.h"
|
|
||||||
#include "fsfw/serialize/SerializeAdapter.h"
|
#include "fsfw/serialize/SerializeAdapter.h"
|
||||||
#include "fsfw/serviceinterface.h"
|
#include "fsfw/serviceinterface.h"
|
||||||
|
|
||||||
cfdp::VarLenField::VarLenField(cfdp::WidthInBytes width, size_t value) : VarLenField() {
|
cfdp::VarLenField::VarLenField(cfdp::WidthInBytes width, uint64_t value) : VarLenField() {
|
||||||
ReturnValue_t result = this->setValue(width, value);
|
ReturnValue_t result = this->setValueAndWidth(width, value);
|
||||||
if (result != HasReturnvaluesIF::RETURN_OK) {
|
if (result != returnvalue::OK) {
|
||||||
#if FSFW_DISABLE_PRINTOUT == 0
|
#if FSFW_DISABLE_PRINTOUT == 0
|
||||||
#if FSFW_CPP_OSTREAM_ENABLED == 1
|
#if FSFW_CPP_OSTREAM_ENABLED == 1
|
||||||
sif::warning << "cfdp::VarLenField: Setting value failed" << std::endl;
|
sif::warning << "cfdp::VarLenField: Setting value failed" << std::endl;
|
||||||
@ -21,38 +20,41 @@ cfdp::VarLenField::VarLenField() : width(cfdp::WidthInBytes::ONE_BYTE) { value.o
|
|||||||
|
|
||||||
cfdp::WidthInBytes cfdp::VarLenField::getWidth() const { return width; }
|
cfdp::WidthInBytes cfdp::VarLenField::getWidth() const { return width; }
|
||||||
|
|
||||||
ReturnValue_t cfdp::VarLenField::setValue(cfdp::WidthInBytes widthInBytes, size_t value) {
|
ReturnValue_t cfdp::VarLenField::setValueAndWidth(cfdp::WidthInBytes width_, uint64_t value_) {
|
||||||
switch (widthInBytes) {
|
switch (width_) {
|
||||||
case (cfdp::WidthInBytes::ONE_BYTE): {
|
case (cfdp::WidthInBytes::ONE_BYTE): {
|
||||||
if (value > UINT8_MAX) {
|
if (value_ > UINT8_MAX) {
|
||||||
return HasReturnvaluesIF::RETURN_FAILED;
|
return returnvalue::FAILED;
|
||||||
}
|
}
|
||||||
this->value.oneByte = value;
|
this->value.oneByte = value_;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case (cfdp::WidthInBytes::TWO_BYTES): {
|
case (cfdp::WidthInBytes::TWO_BYTES): {
|
||||||
if (value > UINT16_MAX) {
|
if (value_ > UINT16_MAX) {
|
||||||
return HasReturnvaluesIF::RETURN_FAILED;
|
return returnvalue::FAILED;
|
||||||
}
|
}
|
||||||
this->value.twoBytes = value;
|
this->value.twoBytes = value_;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case (cfdp::WidthInBytes::FOUR_BYTES): {
|
case (cfdp::WidthInBytes::FOUR_BYTES): {
|
||||||
if (value > UINT32_MAX) {
|
if (value_ > UINT32_MAX) {
|
||||||
return HasReturnvaluesIF::RETURN_FAILED;
|
return returnvalue::FAILED;
|
||||||
}
|
}
|
||||||
this->value.fourBytes = value;
|
this->value.fourBytes = value_;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
case (cfdp::WidthInBytes::EIGHT_BYTES): {
|
||||||
|
this->value.eightBytes = value_;
|
||||||
|
}
|
||||||
default: {
|
default: {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
this->width = widthInBytes;
|
this->width = width_;
|
||||||
return HasReturnvaluesIF::RETURN_OK;
|
return returnvalue::OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
size_t cfdp::VarLenField::getValue() const {
|
uint64_t cfdp::VarLenField::getValue() const {
|
||||||
switch (width) {
|
switch (width) {
|
||||||
case (cfdp::WidthInBytes::ONE_BYTE): {
|
case (cfdp::WidthInBytes::ONE_BYTE): {
|
||||||
return value.oneByte;
|
return value.oneByte;
|
||||||
@ -63,6 +65,9 @@ size_t cfdp::VarLenField::getValue() const {
|
|||||||
case (cfdp::WidthInBytes::FOUR_BYTES): {
|
case (cfdp::WidthInBytes::FOUR_BYTES): {
|
||||||
return value.fourBytes;
|
return value.fourBytes;
|
||||||
}
|
}
|
||||||
|
case (cfdp::WidthInBytes::EIGHT_BYTES): {
|
||||||
|
return value.eightBytes;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@ -77,7 +82,7 @@ ReturnValue_t cfdp::VarLenField::serialize(uint8_t **buffer, size_t *size, size_
|
|||||||
**buffer = value.oneByte;
|
**buffer = value.oneByte;
|
||||||
*size += 1;
|
*size += 1;
|
||||||
*buffer += 1;
|
*buffer += 1;
|
||||||
return HasReturnvaluesIF::RETURN_OK;
|
return returnvalue::OK;
|
||||||
}
|
}
|
||||||
case (cfdp::WidthInBytes::TWO_BYTES): {
|
case (cfdp::WidthInBytes::TWO_BYTES): {
|
||||||
return SerializeAdapter::serialize(&value.twoBytes, buffer, size, maxSize, streamEndianness);
|
return SerializeAdapter::serialize(&value.twoBytes, buffer, size, maxSize, streamEndianness);
|
||||||
@ -85,27 +90,36 @@ ReturnValue_t cfdp::VarLenField::serialize(uint8_t **buffer, size_t *size, size_
|
|||||||
case (cfdp::WidthInBytes::FOUR_BYTES): {
|
case (cfdp::WidthInBytes::FOUR_BYTES): {
|
||||||
return SerializeAdapter::serialize(&value.fourBytes, buffer, size, maxSize, streamEndianness);
|
return SerializeAdapter::serialize(&value.fourBytes, buffer, size, maxSize, streamEndianness);
|
||||||
}
|
}
|
||||||
|
case (cfdp::WidthInBytes::EIGHT_BYTES): {
|
||||||
|
return SerializeAdapter::serialize(&value.eightBytes, buffer, size, maxSize,
|
||||||
|
streamEndianness);
|
||||||
|
}
|
||||||
default: {
|
default: {
|
||||||
return HasReturnvaluesIF::RETURN_FAILED;
|
return returnvalue::FAILED;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
size_t cfdp::VarLenField::getSerializedSize() const { return width; }
|
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) {
|
size_t *size, Endianness streamEndianness) {
|
||||||
this->width = width;
|
this->width = width_;
|
||||||
return deSerialize(buffer, size, streamEndianness);
|
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,
|
ReturnValue_t cfdp::VarLenField::deSerialize(const uint8_t **buffer, size_t *size,
|
||||||
Endianness streamEndianness) {
|
Endianness streamEndianness) {
|
||||||
switch (width) {
|
switch (width) {
|
||||||
case (cfdp::WidthInBytes::ONE_BYTE): {
|
case (cfdp::WidthInBytes::ONE_BYTE): {
|
||||||
value.oneByte = **buffer;
|
value.oneByte = **buffer;
|
||||||
|
*buffer += 1;
|
||||||
*size += 1;
|
*size += 1;
|
||||||
return HasReturnvaluesIF::RETURN_OK;
|
return returnvalue::OK;
|
||||||
}
|
}
|
||||||
case (cfdp::WidthInBytes::TWO_BYTES): {
|
case (cfdp::WidthInBytes::TWO_BYTES): {
|
||||||
return SerializeAdapter::deSerialize(&value.twoBytes, buffer, size, streamEndianness);
|
return SerializeAdapter::deSerialize(&value.twoBytes, buffer, size, streamEndianness);
|
||||||
@ -113,8 +127,31 @@ ReturnValue_t cfdp::VarLenField::deSerialize(const uint8_t **buffer, size_t *siz
|
|||||||
case (cfdp::WidthInBytes::FOUR_BYTES): {
|
case (cfdp::WidthInBytes::FOUR_BYTES): {
|
||||||
return SerializeAdapter::deSerialize(&value.fourBytes, buffer, size, streamEndianness);
|
return SerializeAdapter::deSerialize(&value.fourBytes, buffer, size, streamEndianness);
|
||||||
}
|
}
|
||||||
|
case (cfdp::WidthInBytes::EIGHT_BYTES): {
|
||||||
|
return SerializeAdapter::deSerialize(&value.eightBytes, buffer, size, streamEndianness);
|
||||||
|
}
|
||||||
default: {
|
default: {
|
||||||
return HasReturnvaluesIF::RETURN_FAILED;
|
return returnvalue::FAILED;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool cfdp::VarLenField::operator<(const cfdp::VarLenField &other) const {
|
||||||
|
if (getWidth() < other.getWidth()) {
|
||||||
|
return true;
|
||||||
|
} else if (getWidth() == other.getWidth()) {
|
||||||
|
return getValue() < other.getValue();
|
||||||
|
} else {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
bool cfdp::VarLenField::operator==(const cfdp::VarLenField &other) const {
|
||||||
|
return getWidth() == other.getWidth() and getValue() == other.getValue();
|
||||||
|
}
|
||||||
|
|
||||||
|
bool cfdp::VarLenField::operator!=(const cfdp::VarLenField &other) const {
|
||||||
|
return not(*this == other);
|
||||||
|
}
|
||||||
|
|
||||||
|
void cfdp::VarLenField::setWidth(cfdp::WidthInBytes width_) { this->width = width_; }
|
135
src/fsfw/cfdp/VarLenFields.h
Normal file
135
src/fsfw/cfdp/VarLenFields.h
Normal 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_ */
|
@ -7,36 +7,37 @@
|
|||||||
#include <cstdint>
|
#include <cstdint>
|
||||||
|
|
||||||
#include "fsfw/returnvalues/FwClassIds.h"
|
#include "fsfw/returnvalues/FwClassIds.h"
|
||||||
#include "fsfw/returnvalues/HasReturnvaluesIF.h"
|
#include "fsfw/returnvalues/returnvalue.h"
|
||||||
|
|
||||||
namespace cfdp {
|
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 ReturnValue_t INVALID_TLV_TYPE =
|
static constexpr uint8_t CFDP_CLASS_ID = CLASS_ID::CFDP_BASE;
|
||||||
HasReturnvaluesIF::makeReturnCode(CFDP_CLASS_ID, 1);
|
|
||||||
static constexpr ReturnValue_t INVALID_DIRECTIVE_FIELDS =
|
static constexpr ReturnValue_t INVALID_TLV_TYPE = returnvalue::makeCode(CFDP_CLASS_ID, 1);
|
||||||
HasReturnvaluesIF::makeReturnCode(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 =
|
static constexpr ReturnValue_t INVALID_PDU_DATAFIELD_LEN = returnvalue::makeCode(CFDP_CLASS_ID, 3);
|
||||||
HasReturnvaluesIF::makeReturnCode(CFDP_CLASS_ID, 3);
|
|
||||||
static constexpr ReturnValue_t INVALID_ACK_DIRECTIVE_FIELDS =
|
static constexpr ReturnValue_t INVALID_ACK_DIRECTIVE_FIELDS =
|
||||||
HasReturnvaluesIF::makeReturnCode(CFDP_CLASS_ID, 4);
|
returnvalue::makeCode(CFDP_CLASS_ID, 4);
|
||||||
//! Can not parse options. This can also occur because there are options
|
//! Can not parse options. This can also occur because there are options
|
||||||
//! available but the user did not pass a valid options array
|
//! available but the user did not pass a valid options array
|
||||||
static constexpr ReturnValue_t METADATA_CANT_PARSE_OPTIONS =
|
static constexpr ReturnValue_t METADATA_CANT_PARSE_OPTIONS =
|
||||||
HasReturnvaluesIF::makeReturnCode(CFDP_CLASS_ID, 5);
|
returnvalue::makeCode(CFDP_CLASS_ID, 5);
|
||||||
static constexpr ReturnValue_t NAK_CANT_PARSE_OPTIONS =
|
static constexpr ReturnValue_t NAK_CANT_PARSE_OPTIONS = returnvalue::makeCode(CFDP_CLASS_ID, 6);
|
||||||
HasReturnvaluesIF::makeReturnCode(CFDP_CLASS_ID, 6);
|
|
||||||
static constexpr ReturnValue_t FINISHED_CANT_PARSE_FS_RESPONSES =
|
static constexpr ReturnValue_t FINISHED_CANT_PARSE_FS_RESPONSES =
|
||||||
HasReturnvaluesIF::makeReturnCode(CFDP_CLASS_ID, 6);
|
returnvalue::makeCode(CFDP_CLASS_ID, 7);
|
||||||
static constexpr ReturnValue_t FILESTORE_REQUIRES_SECOND_FILE =
|
static constexpr ReturnValue_t FILESTORE_REQUIRES_SECOND_FILE =
|
||||||
HasReturnvaluesIF::makeReturnCode(CFDP_CLASS_ID, 8);
|
returnvalue::makeCode(CFDP_CLASS_ID, 8);
|
||||||
//! Can not parse filestore response because user did not pass a valid instance
|
//! Can not parse filestore response because user did not pass a valid instance
|
||||||
//! or remaining size is invalid
|
//! or remaining size is invalid
|
||||||
static constexpr ReturnValue_t FILESTORE_RESPONSE_CANT_PARSE_FS_MESSAGE =
|
static constexpr ReturnValue_t FILESTORE_RESPONSE_CANT_PARSE_FS_MESSAGE =
|
||||||
HasReturnvaluesIF::makeReturnCode(CFDP_CLASS_ID, 9);
|
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
|
//! Checksum types according to the SANA Checksum Types registry
|
||||||
//! https://sanaregistry.org/r/checksum_identifiers/
|
//! https://sanaregistry.org/r/checksum_identifiers/
|
||||||
@ -49,17 +50,17 @@ enum ChecksumType {
|
|||||||
NULL_CHECKSUM = 15
|
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 {
|
enum SegmentationControl : bool {
|
||||||
NO_RECORD_BOUNDARIES_PRESERVATION = 0,
|
NO_RECORD_BOUNDARIES_PRESERVATION = false,
|
||||||
RECORD_BOUNDARIES_PRESERVATION = 1
|
RECORD_BOUNDARIES_PRESERVATION = true
|
||||||
};
|
};
|
||||||
|
|
||||||
enum WidthInBytes : uint8_t {
|
enum WidthInBytes : uint8_t {
|
||||||
@ -67,10 +68,12 @@ enum WidthInBytes : uint8_t {
|
|||||||
ONE_BYTE = 1,
|
ONE_BYTE = 1,
|
||||||
TWO_BYTES = 2,
|
TWO_BYTES = 2,
|
||||||
FOUR_BYTES = 4,
|
FOUR_BYTES = 4,
|
||||||
|
EIGHT_BYTES = 8
|
||||||
};
|
};
|
||||||
|
|
||||||
enum FileDirectives : uint8_t {
|
enum FileDirective : uint8_t {
|
||||||
INVALID_DIRECTIVE = 0x0f,
|
INVALID_DIRECTIVE = 0x0f,
|
||||||
|
// The _DIRECTIVE suffix is mandatory here because of some nameclash!
|
||||||
EOF_DIRECTIVE = 0x04,
|
EOF_DIRECTIVE = 0x04,
|
||||||
FINISH = 0x05,
|
FINISH = 0x05,
|
||||||
ACK = 0x06,
|
ACK = 0x06,
|
||||||
@ -97,6 +100,14 @@ enum ConditionCode : uint8_t {
|
|||||||
CANCEL_REQUEST_RECEIVED = 0b1111
|
CANCEL_REQUEST_RECEIVED = 0b1111
|
||||||
};
|
};
|
||||||
|
|
||||||
|
enum FaultHandlerCode {
|
||||||
|
RESERVED = 0b0000,
|
||||||
|
NOTICE_OF_CANCELLATION = 0b0001,
|
||||||
|
NOTICE_OF_SUSPENSION = 0b0010,
|
||||||
|
IGNORE_ERROR = 0b0011,
|
||||||
|
ABANDON_TRANSACTION = 0b0100
|
||||||
|
};
|
||||||
|
|
||||||
enum AckTransactionStatus {
|
enum AckTransactionStatus {
|
||||||
UNDEFINED = 0b00,
|
UNDEFINED = 0b00,
|
||||||
ACTIVE = 0b01,
|
ACTIVE = 0b01,
|
||||||
@ -104,18 +115,18 @@ enum AckTransactionStatus {
|
|||||||
UNRECOGNIZED = 0b11
|
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_DELIBERATELY = 0,
|
||||||
DISCARDED_FILESTORE_REJECTION = 1,
|
DISCARDED_FILESTORE_REJECTION = 1,
|
||||||
RETAINED_IN_FILESTORE = 2,
|
RETAINED_IN_FILESTORE = 2,
|
||||||
FILE_STATUS_UNREPORTED = 3
|
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_REQUEST = 0x00,
|
||||||
FILESTORE_RESPONSE = 0x01,
|
FILESTORE_RESPONSE = 0x01,
|
||||||
MSG_TO_USER = 0x02,
|
MSG_TO_USER = 0x02,
|
||||||
@ -132,6 +143,20 @@ enum RecordContinuationState {
|
|||||||
CONTAINS_START_AND_END = 0b11
|
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
|
} // namespace cfdp
|
||||||
|
|
||||||
#endif /* FSFW_SRC_FSFW_CFDP_PDU_DEFINITIONS_H_ */
|
#endif /* FSFW_SRC_FSFW_CFDP_PDU_DEFINITIONS_H_ */
|
||||||
|
4
src/fsfw/cfdp/handler/CMakeLists.txt
Normal file
4
src/fsfw/cfdp/handler/CMakeLists.txt
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
target_sources(
|
||||||
|
${LIB_FSFW_NAME}
|
||||||
|
PRIVATE SourceHandler.cpp DestHandler.cpp PutRequest.cpp
|
||||||
|
ReservedMessageParser.cpp FaultHandlerBase.cpp UserBase.cpp)
|
574
src/fsfw/cfdp/handler/DestHandler.cpp
Normal file
574
src/fsfw/cfdp/handler/DestHandler.cpp
Normal 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; }
|
177
src/fsfw/cfdp/handler/DestHandler.h
Normal file
177
src/fsfw/cfdp/handler/DestHandler.h
Normal 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
|
51
src/fsfw/cfdp/handler/FaultHandlerBase.cpp
Normal file
51
src/fsfw/cfdp/handler/FaultHandlerBase.cpp
Normal 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
|
77
src/fsfw/cfdp/handler/FaultHandlerBase.h
Normal file
77
src/fsfw/cfdp/handler/FaultHandlerBase.h
Normal 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
|
201
src/fsfw/cfdp/handler/PutRequest.cpp
Normal file
201
src/fsfw/cfdp/handler/PutRequest.cpp
Normal 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;
|
||||||
|
}
|
82
src/fsfw/cfdp/handler/PutRequest.h
Normal file
82
src/fsfw/cfdp/handler/PutRequest.h
Normal 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
|
35
src/fsfw/cfdp/handler/RemoteConfigTableIF.h
Normal file
35
src/fsfw/cfdp/handler/RemoteConfigTableIF.h
Normal 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
|
74
src/fsfw/cfdp/handler/ReservedMessageParser.cpp
Normal file
74
src/fsfw/cfdp/handler/ReservedMessageParser.cpp
Normal 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, ¤tPtr, deserSize)) {
|
||||||
|
if (messageType == static_cast<uint8_t>(ProxyOpMessageType::PUT_REQUEST)) {
|
||||||
|
EntityId entityIdLv;
|
||||||
|
result = entityIdLv.deSerializeFromLv(¤tPtr, &deserSize);
|
||||||
|
if (result != returnvalue::OK) {
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
putRequest.setDestId(entityIdLv);
|
||||||
|
result =
|
||||||
|
sourceFileName.deSerialize(¤tPtr, &deserSize, SerializeIF::Endianness::NETWORK);
|
||||||
|
if (result != OK) {
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
result =
|
||||||
|
destFileName.deSerialize(¤tPtr, &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;
|
||||||
|
}
|
27
src/fsfw/cfdp/handler/ReservedMessageParser.h
Normal file
27
src/fsfw/cfdp/handler/ReservedMessageParser.h
Normal 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
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user