Compare commits

..

827 Commits

Author SHA1 Message Date
64b6edab6f Update 'README.md' 2020-12-01 13:32:50 +01:00
3bd144e6f4 Merge pull request 'Added the new logos, colors are WIP at the moment' (#270) from gaisser/fsfw:gaisser_logo into master
Reviewed-on: fsfw/fsfw#270
2020-12-01 13:32:13 +01:00
4764f6ba54 Merge branch 'master' into gaisser_logo 2020-12-01 13:31:48 +01:00
a2c28198ed Merge branch 'development' into master 2020-12-01 13:20:33 +01:00
4241c00448 Added the new logos, colors are WIP at the moment 2020-11-30 18:30:58 +01:00
4406c6eb86 Merge pull request 'meier/gaisser_readme_update' (#267) from gaisser/fsfw:meier/gaisser_readme_update into master
Reviewed-on: fsfw/fsfw#267
2020-11-30 16:28:09 +01:00
ce629dfd83 Merge branch 'master' into meier/gaisser_readme_update 2020-11-30 16:27:53 +01:00
293d34147e Merge pull request 'Readme Update' (#260) from gaisser/fsfw:gaisser_readme_update into master
Reviewed-on: fsfw/fsfw#260
2020-11-30 16:27:24 +01:00
9bfba41875 Merge pull request 'Update devel' (#264) from master into development
Reviewed-on: fsfw/fsfw#264
2020-11-30 12:27:10 +01:00
5a20ec583b Merge branch 'master' into gaisser_readme_update 2020-11-27 20:21:23 +01:00
d3a7f86ea2 Merge pull request 'Fixes for RTEMS #173' (#262) from gaisser_rtems_fixes into master
Reviewed-on: fsfw/fsfw#262
2020-11-27 20:21:08 +01:00
227ec25e89 some minor corrections in readme 2020-11-27 11:44:11 +01:00
6489246c4b Updated include guards 2020-11-17 19:35:37 +01:00
273ddf9061 Rtems compiles again fixes #176 2020-11-17 19:25:57 +01:00
5b5f2f3e1d Added hardware recommendations 2020-11-17 09:42:38 +01:00
51443d7a68 Version number 2020-11-13 15:09:00 +01:00
8aef4b9b99 Updated formatting 2020-11-13 14:36:32 +01:00
752601e85f WIP readme 2020-11-13 14:31:30 +01:00
0075ae53b3 Merge pull request 'meier/udp_bridge_embedded_linux' (#259) from eive/fsfw:meier/udp_bridge_embedded_linux into master
Reviewed-on: fsfw/fsfw#259
2020-11-10 15:10:47 +01:00
520409822e now all debug output removed 2020-11-10 15:06:51 +01:00
030f1beb93 Merge branch 'master' into meier/udp_bridge_embedded_linux 2020-11-10 14:53:15 +01:00
2a4b4f2114 Merge pull request 'config folder renamed and improved' (#255) from KSat/fsfw:mueller/fsfwconfig-better into master
Reviewed-on: fsfw/fsfw#255
2020-11-10 14:46:55 +01:00
bb7709fea1 Merge branch 'master' into mueller/fsfwconfig-better 2020-11-10 14:46:04 +01:00
bc58213482 Merge pull request 'Action folder: some minor form stuff' (#256) from KSat/fsfw:mueller/action-yet-another-update into master
Reviewed-on: fsfw/fsfw#256
2020-11-10 14:45:55 +01:00
136f04a5c6 trnaslation files removed 2020-11-09 21:23:51 +01:00
37fc22a117 config folder renamed and improved 2020-11-09 21:21:56 +01:00
bc81b5893c removed debug output 2020-11-09 17:34:53 +01:00
3eefcd3a2d fsfw.mk adjusted to upstream master 2020-11-07 20:45:00 +01:00
210d2de11e fetched fsfw.mk from upstream master 2020-11-07 20:40:01 +01:00
83568e11d1 removed unwanted changes 2020-11-07 20:37:48 +01:00
113397c6c6 udp bridge for embedded linux 2020-11-07 20:30:42 +01:00
3cd0f8f5f0 Merge remote-tracking branch 'upstream/development' into development 2020-11-02 17:29:26 +01:00
edecb7882b Merge branch 'eive/include-fsfw' into development 2020-11-02 17:21:43 +01:00
cc51d9ace9 small fix so that it compiles 2020-11-02 17:21:25 +01:00
3067259a9b include added 2020-11-02 17:19:24 +01:00
7d83767c2b include added 2020-11-02 16:45:19 +01:00
59c200254d Merge branch 'master' into development 2020-11-02 16:03:10 +01:00
2f993cf39a some minor form stuff 2020-11-02 15:51:52 +01:00
6bedc9b805 Merge pull request 'added new windows udp bridge' (#188) from KSat/fsfw:mueller/feature/windowsUdpBridge into master
Reviewed-on: fsfw/fsfw#188
2020-11-02 15:29:08 +01:00
652dc00cc9 Merge branch 'master' into mueller/feature/windowsUdpBridge 2020-11-02 15:28:07 +01:00
719aab2a26 Merge pull request 'health update' (#246) from KSat/fsfw:mueller/health-convergence into master
Reviewed-on: fsfw/fsfw#246
2020-11-02 15:26:51 +01:00
470196a044 Merge branch 'master' into mueller/health-convergence 2020-11-02 15:22:58 +01:00
9c9facf4a1 Merge pull request 'host osal fixes' (#247) from eive/fsfw:development into master
Reviewed-on: fsfw/fsfw#247
2020-11-02 15:22:37 +01:00
cf46aebf32 Merge branch 'master' into development 2020-11-02 15:16:10 +01:00
449a08c92c Merge pull request 'testcfg fix' (#248) from fsfwtest/testcfg-fix into master
Reviewed-on: fsfw/fsfw#248
2020-11-02 15:15:59 +01:00
a7e06c11fd Merge branch 'master' into fsfwtest/testcfg-fix 2020-11-02 15:12:44 +01:00
0c15a90399 Merge pull request 'Default Configuration' (#243) from KSat/fsfw:mueller/defaultcfg into master
Reviewed-on: fsfw/fsfw#243
2020-11-02 15:09:55 +01:00
bcbc61ccba Merge branch 'master' into fsfwtest/testcfg-fix 2020-11-02 15:06:10 +01:00
9221d0ca7c Merge branch 'master' into development 2020-11-02 15:04:25 +01:00
a7bc69b0ac health table update 2020-11-02 15:00:01 +01:00
77fd2cb871 mission timestmap size is uint8 now 2020-11-02 14:53:44 +01:00
093d3562b6 Merge branch 'master' into mueller/health-convergence 2020-11-02 14:53:20 +01:00
2761ee8109 Merge branch 'master' into mueller/defaultcfg 2020-11-02 14:48:23 +01:00
52d3dbfd20 Merge pull request 'HasReturnvaluesIF small improvements' (#245) from KSat/fsfw:mueller/returnvalue-convergence into master
Reviewed-on: fsfw/fsfw#245
2020-11-02 14:48:10 +01:00
963c333365 cast added 2020-11-02 14:45:10 +01:00
b441f5242f Merge remote-tracking branch 'upstream/master' into development 2020-11-02 14:23:51 +01:00
508f31a359 adaptions so it compiles 2020-11-02 14:19:56 +01:00
5d0f96c3a1 reamde update 2020-10-30 14:42:42 +01:00
82a2f3ec61 testcfg fix 2020-10-30 14:21:31 +01:00
a5cf510ae9 host osal fixes 2020-10-30 13:31:07 +01:00
a0d4c77d94 Merge remote-tracking branch 'upstream/master' into mueller/returnvalue-convergence 2020-10-30 11:06:09 +01:00
0b855c5b55 Merge branch 'master' into mueller/defaultcfg 2020-10-29 20:09:31 +01:00
38830dfc17 Merge branch 'master' into mueller/health-convergence 2020-10-29 20:06:03 +01:00
11a351a202 Merge pull request 'Unittest integrated in FSFW now' (#242) from KSat/fsfw:mueller/unittest-integration-from-master into master
Reviewed-on: fsfw/fsfw#242
2020-10-29 20:05:30 +01:00
51c5b05f03 Merge branch 'master' into mueller/unittest-integration-from-master 2020-10-29 19:59:23 +01:00
de5e62a9c8 Merge pull request 'Action folder: minor form improvements, include guards' (#235) from KSat/fsfw:mueller/action-update into master
Reviewed-on: fsfw/fsfw#235
2020-10-29 19:59:05 +01:00
3098f34eb0 health update 2020-10-29 17:52:28 +01:00
e35aebcd0a HasREturnvalue update 2020-10-29 17:45:06 +01:00
af4c6f1d45 config mk update 2020-10-29 17:33:40 +01:00
9b5e940965 config make fix 2020-10-29 17:32:07 +01:00
f5b0589f79 event manager update 2020-10-29 17:28:33 +01:00
567cbd39ef include fixes 2020-10-29 17:22:41 +01:00
78896323b6 fsfw config update 2020-10-29 17:09:43 +01:00
ba036805de Merge branch 'master' into mueller/action-update 2020-10-29 16:49:07 +01:00
9af5855ece event stuff added 2020-10-29 15:23:14 +01:00
64c341b5f6 now really five 2020-10-29 15:17:33 +01:00
27e0b9cf38 default FIFO depth is 5 now 2020-10-29 15:17:13 +01:00
4dd79b3495 not static anymore 2020-10-29 15:16:16 +01:00
64ec4835f3 Merge branch 'master' into mueller/defaultcfg 2020-10-29 15:15:52 +01:00
4229e256d1 include guard fix 2020-10-29 13:55:49 +01:00
352296d200 action helper update 2020-10-29 13:52:52 +01:00
4557a2eb36 better comments 2020-10-29 13:34:53 +01:00
edb2d3848d some improverments for simple helper 2020-10-29 13:27:41 +01:00
096643971b Merge pull request 'TMTC Packet Base improvements' (#80) from KSat/fsfw:mueller_tcPacketBase into master
Reviewed-on: fsfw/fsfw#80
2020-10-29 13:17:35 +01:00
56da648026 config folder update 2020-10-29 13:16:14 +01:00
38135a3d53 reamde update 2020-10-29 13:13:48 +01:00
3c1415a4bd todos removed2 2020-10-29 13:08:09 +01:00
08496c378e Merge branch 'mueller/action-update' of https://egit.irs.uni-stuttgart.de/KSat/fsfw into mueller/action-update 2020-10-29 13:07:17 +01:00
af18f6c94c todos removed 2020-10-29 13:07:08 +01:00
5a8431e82b Merge branch 'master' into mueller/action-update 2020-10-29 13:04:48 +01:00
97f6dace26 some fixes for master 2020-10-29 12:42:29 +01:00
c8fd698b3a some changes 2020-10-29 12:23:27 +01:00
50151310dc Merge branch 'master' into mueller/unittest-integration-from-master 2020-10-29 12:20:38 +01:00
53e98df37d tm packet stored 2020-10-28 19:44:37 +01:00
cb71a18277 ack fields improved 2020-10-28 19:21:33 +01:00
546db47db4 more refactoring 2020-10-28 02:20:12 +01:00
ce322ed121 Merge remote-tracking branch 'upstream/master' into mueller_tcPacketBase 2020-10-27 23:31:23 +01:00
744d3a2346 Merge branch 'master' into mueller/defaultcfg 2020-10-27 15:18:53 +01:00
c89a24a248 Merge pull request 'Fixes #161' (#244) from gaisser/fsfw:gaisser_fix_dhb_stream_reset into master
Reviewed-on: fsfw/fsfw#244
2020-10-27 15:17:18 +01:00
6651622a16 Merge branch 'master' into gaisser_fix_dhb_stream_reset 2020-10-27 15:16:58 +01:00
410094ed28 Fixes #161 2020-10-27 15:16:14 +01:00
8b21324815 Merge branch 'master' into mueller/action-update 2020-10-27 14:30:12 +01:00
f40b432e43 Merge pull request 'added FIFO to SharedRingBuffer' (#208) from KSat/fsfw:mueller/sharedRingBufferFIFO into master
Reviewed-on: fsfw/fsfw#208
2020-10-27 14:29:48 +01:00
67dd153511 Merge branch 'master' into mueller/sharedRingBufferFIFO 2020-10-27 13:36:59 +01:00
342a70d109 Merge branch 'master' into mueller_tcPacketBase 2020-10-27 12:24:12 +01:00
6cce062d62 some more fixes 2020-10-20 17:52:43 +02:00
29a796ebdb include names fixed 2020-10-20 17:51:13 +02:00
ede00dfdcc double files removed, versioning files renamed 2020-10-20 17:50:10 +02:00
e4d323683d readme fix 2020-10-20 17:47:52 +02:00
4d4300cee6 Merge branch 'mueller/defaultcfg' of https://egit.irs.uni-stuttgart.de/KSat/fsfw into mueller/defaultcfg 2020-10-20 17:44:35 +02:00
1940a2acf0 some fixes 2020-10-20 17:44:27 +02:00
279682351a Merge branch 'master' into mueller/defaultcfg 2020-10-20 17:41:33 +02:00
247c9f2947 added readme 2020-10-20 17:39:11 +02:00
482b77ff05 added defaultcfg config folder 2020-10-20 17:38:41 +02:00
72b9adb684 Merge branch 'master' into mueller/unittest-integration-from-master 2020-10-20 17:15:30 +02:00
865ea3386c unittest now contained directly 2020-10-20 17:11:23 +02:00
c677358343 include adaption 2020-10-20 17:06:09 +02:00
7821cc2870 submodule added 2020-10-20 16:52:34 +02:00
756df4f37f Merge branch 'master' into mueller/action-update 2020-10-20 16:04:29 +02:00
0b1b9c11eb Merge pull request 'TC Distribution convergence' (#229) from KSat/fsfw:mueller/tcDistribution into master
Reviewed-on: fsfw/fsfw#229
2020-10-20 15:11:27 +02:00
ddacc66b1f Merge branch 'mueller/tcDistribution' of https://egit.irs.uni-stuttgart.de/KSat/fsfw into mueller/tcDistribution 2020-10-20 15:04:45 +02:00
fa67f82462 structure improved 2020-10-20 15:04:28 +02:00
407df913d3 Merge branch 'master' into mueller/tcDistribution 2020-10-20 14:56:53 +02:00
b29376bd71 Merge branch 'master' into mueller/feature/windowsUdpBridge 2020-10-20 14:55:04 +02:00
3580ec0e09 Merge pull request 'MQM IF used by FreeRTOS' (#212) from KSat/fsfw:mueller/MQMQ_IF_UpdateFreeRTOS into master
Reviewed-on: fsfw/fsfw#212
2020-10-20 14:52:58 +02:00
12369d8d4b Merge remote-tracking branch 'upstream/master' into mueller/MQMQ_IF_UpdateFreeRTOS 2020-10-20 14:51:38 +02:00
6b2df54204 Merge pull request 'Message QueueMessage IF used in Linux' (#207) from KSat/fsfw:mueller/MQM_IF_UpdateLinux into master
Reviewed-on: fsfw/fsfw#207
2020-10-20 14:50:47 +02:00
8cea7b05db include improvement 2020-10-20 14:42:58 +02:00
17548605ec Merge branch 'master' into mueller/MQMQ_IF_UpdateFreeRTOS 2020-10-20 14:37:22 +02:00
829be0f082 doc correction, action helper new helper function 2020-10-12 16:58:04 +02:00
17ea3127a7 minor form improvements, include guards 2020-10-10 17:04:43 +02:00
ea8ef8b874 important bugfix 2020-10-03 14:19:42 +02:00
54af54927b Merge branch 'master' into mueller/tcDistribution 2020-10-01 19:05:09 +02:00
9bf0026b8a Merge branch 'master' into mueller/MQM_IF_UpdateLinux 2020-10-01 19:04:53 +02:00
335e146735 Merge pull request 'Made tpp file less cluttered and added inline qualifier' (#234) from gaisser/fsfw:master into master
Reviewed-on: fsfw/fsfw#234
2020-10-01 17:45:11 +02:00
6776ca86eb Made tpp file less cluttered and added inline qualifier 2020-10-01 17:44:23 +02:00
f172c07876 Merge pull request 'Fixed issue with tpp File' (#233) from gaisser/fsfw:gaisser_fix_multimap3 into master
Reviewed-on: fsfw/fsfw#233
2020-10-01 17:37:52 +02:00
0a9a8cf867 Merge branch 'master' into gaisser_fix_multimap3 2020-10-01 17:37:34 +02:00
f1bc9972f3 Fixed bugs 2020-10-01 17:36:46 +02:00
7c7b3de14f Merge pull request 'Fixes and comments in FixedOrderedMultimap' (#231) from gaisser/fsfw:gaisser_fix_multimap2 into master
Reviewed-on: fsfw/fsfw#231
2020-10-01 17:32:44 +02:00
587f87d270 Feedback from Robin 2020-10-01 17:27:24 +02:00
cd2cb410e4 Merge branch 'master' of https://egit.irs.uni-stuttgart.de/fsfw/fsfw.git
into gaisser_fix_multimap2

Conflicts:
	container/FixedOrderedMultimap.h
2020-10-01 14:59:26 +02:00
b292c5c927 Merge pull request 'FixedOrderedMultimap Implementation moved to TPP file' (#232) from KSat/fsfw:mueller/FixedOrdMultimapTpp into master
Reviewed-on: fsfw/fsfw#232
2020-10-01 14:02:41 +02:00
4f91db2ff8 Merge branch 'master' into mueller/FixedOrdMultimapTpp 2020-10-01 13:59:42 +02:00
c86d654fdf tpp file added 2020-10-01 13:58:20 +02:00
1f3a10b375 Fixes and comments in FixedOrderedMultimap 2020-10-01 13:30:28 +02:00
b8261854cb Merge branch 'master' into mueller/tcDistribution 2020-10-01 13:25:16 +02:00
89c4370d91 tc distribution improvements 2020-10-01 13:23:06 +02:00
565859a6f4 Merge branch 'master' into mueller/feature/windowsUdpBridge 2020-10-01 12:35:57 +02:00
1f994d9933 Merge pull request 'ArrayList and FixedMap improvements' (#218) from KSat/fsfw:mueller/ArrayList into master
Reviewed-on: fsfw/fsfw#218
2020-10-01 12:31:24 +02:00
5342dc4bc8 Merge branch 'master' into mueller/MQMQ_IF_UpdateFreeRTOS 2020-10-01 11:46:55 +02:00
a5a850eb41 Merge branch 'master' into mueller/MQM_IF_UpdateLinux 2020-10-01 11:45:44 +02:00
c77bded505 Merge remote-tracking branch 'upstream/master' into mueller/MQMQ_IF_UpdateFreeRTOS 2020-10-01 11:15:42 +02:00
acc03d3e8b Merge branch 'master' into mueller/ArrayList 2020-10-01 11:11:02 +02:00
d647c63da3 Merge pull request 'Added a compile time check in FixedArrayList and fixed copying' (#222) from gaisser/fsfw:gaisser_fixedArrayList_assert into master
Reviewed-on: fsfw/fsfw#222
2020-10-01 11:10:53 +02:00
ea13008aa2 Merge branch 'master' into gaisser_fixedArrayList_assert 2020-10-01 11:08:10 +02:00
7c3f99ed2d Revert "DH IF and DH message form improved"
This reverts commit adf528fce9.
2020-10-01 11:06:46 +02:00
2344efb3ac Merge remote-tracking branch 'upstream/master' 2020-10-01 11:06:21 +02:00
236a833d0b Merge pull request 'Added null pointer checks for FIFO Base' (#224) from gaisser/fsfw:gaisser_fifobase_nullptr_check into master
Reviewed-on: fsfw/fsfw#224
2020-10-01 11:04:55 +02:00
6c4ec713f3 Merge branch 'master' into gaisser_fifobase_nullptr_check 2020-10-01 11:04:22 +02:00
b2a7859549 Merge pull request 'Added Documentation to PlacementFactory' (#223) from gaisser/fsfw:gaisser_documentation_placementFactory into master
Reviewed-on: fsfw/fsfw#223
2020-10-01 11:04:08 +02:00
8178be9dc5 Merge branch 'master' into gaisser_documentation_placementFactory 2020-10-01 11:02:46 +02:00
adf528fce9 DH IF and DH message form improved 2020-10-01 11:01:52 +02:00
6efdf170f4 Merge pull request 'Removed old test files' (#226) from gaisser/fsfw:master into master
Reviewed-on: fsfw/fsfw#226
2020-09-30 20:26:08 +02:00
a14558ef1f Removed old test files 2020-09-30 20:25:02 +02:00
77a9a190aa Merge branch 'master' into mueller/ArrayList 2020-09-30 19:09:24 +02:00
a0098e8b17 non member comp operator for iterators 2020-09-30 18:57:30 +02:00
fcabf93af3 Added a few comments 2020-09-30 16:27:18 +02:00
ab9858b0c7 Added comments 2020-09-30 16:15:48 +02:00
823bae1a2a Added null pointer checks for FIFO Base 2020-09-30 16:06:17 +02:00
2f61bd0a0f A few typos and more docu 2020-09-30 14:38:46 +02:00
aeeef53508 Added Documentation to placement factory 2020-09-30 14:34:02 +02:00
8d8e918aeb Fixed copying of FixedArrayList 2020-09-30 13:05:55 +02:00
ecc4bdf11a Added a compile time check for MAX_SIZE
Compiler may warn if MAX_SIZE value overflows by itself but this checks
gives a more verbose warning
2020-09-30 12:50:52 +02:00
5340b9c58e Merge pull request 'Typo in FixedOrderedMultimap' (#220) from gaisser/fsfw:gaisser_another_small_fix into master
Reviewed-on: fsfw/fsfw#220
2020-09-30 10:58:26 +02:00
659671e1df Merge branch 'master' into gaisser_another_small_fix 2020-09-30 10:57:50 +02:00
5fc583117d Typo in FixedOrderedMultimap 2020-09-30 10:55:34 +02:00
86a1ae4a8a Merge remote-tracking branch 'upstream/master' into mueller/MQM_IF_UpdateLinux 2020-09-29 18:05:36 +02:00
195bf6b89f Merge remote-tracking branch 'upstream/master' into mueller/MQM_IF_UpdateLinux 2020-09-29 18:05:10 +02:00
f5ded3fa4b Merge branch 'master' into mueller/ArrayList 2020-09-29 18:03:44 +02:00
e104cd18e6 Merge pull request 'Hotfix Linux include' (#219) from mueller/hotfix-linuxinclude into master
Reviewed-on: fsfw/fsfw#219
2020-09-29 17:57:58 +02:00
71f2f34aab Merge remote-tracking branch 'upstream/master' into mueller/hotfix-linuxinclude 2020-09-29 17:57:20 +02:00
6c0bb23ed6 non member bool operator 2020-09-29 17:51:16 +02:00
303fcec9f6 Added a missing include 2020-09-29 17:49:04 +02:00
f73f798a4d lines removed 2020-09-29 17:28:37 +02:00
4fce0377a9 missing include for linux 2020-09-29 17:28:02 +02:00
4eef7bfc01 changes taken over 2020-09-29 16:12:43 +02:00
17d5de15c9 slight changes ,size t replacement 2020-09-29 16:10:35 +02:00
cdadf48f38 Merge pull request 'Returns failed now in Service 200 when mode answer is negative' (#217) from gaisser/fsfw:gaisser_service200_returns into master
Reviewed-on: fsfw/fsfw#217
2020-09-29 16:02:02 +02:00
896302c506 Merge branch 'master' into gaisser_service200_returns 2020-09-29 15:43:18 +02:00
1bdccedabe Fixes #86 2020-09-29 15:39:24 +02:00
db5890c15a Merge branch 'mueller/feature/windowsUdpBridge' of https://egit.irs.uni-stuttgart.de/KSat/fsfw into mueller/feature/windowsUdpBridge 2020-09-29 15:37:06 +02:00
72f924813d .mk fix 2020-09-29 15:36:54 +02:00
dffda771ac Merge branch 'master' into mueller/feature/windowsUdpBridge 2020-09-29 15:35:44 +02:00
06f5b816e4 Merge branch 'master' into mueller/MQMQ_IF_UpdateFreeRTOS 2020-09-29 15:29:01 +02:00
3d830a9e20 Merge branch 'master' into mueller/MQM_IF_UpdateLinux 2020-09-29 15:28:37 +02:00
13b30f8de6 Merge pull request 'Removed comments and added include in tmtcservices/PusVerificationReporter' (#216) from gaisser/fsfw:gaisser_removed_unused into master
Reviewed-on: fsfw/fsfw#216
2020-09-29 15:28:16 +02:00
e71020d631 Removed comments and added include 2020-09-29 15:24:29 +02:00
046eec6c18 Merge branch 'mueller/MQM_IF_UpdateLinux' into mueller/MQMQ_IF_UpdateFreeRTOS 2020-09-29 15:24:12 +02:00
47c21cfc6c include fix 2020-09-29 15:22:38 +02:00
00f89bb193 Merge branch 'mueller/MQM_IF_UpdateLinux' of https://egit.irs.uni-stuttgart.de/KSat/fsfw into mueller/MQM_IF_UpdateLinux 2020-09-29 15:21:42 +02:00
6879045ef3 include fix 2020-09-29 15:21:33 +02:00
c9005783b2 Merge branch 'master' into mueller/MQM_IF_UpdateLinux 2020-09-29 15:20:48 +02:00
4010d8d960 Merge remote-tracking branch 'upstream/master' into mueller/MQM_IF_UpdateLinux 2020-09-29 15:20:32 +02:00
a3235ced17 Merge pull request 'include added' (#215) from KSat/fsfw:mueller/VerifHotfix into master
Reviewed-on: fsfw/fsfw#215
2020-09-29 15:18:02 +02:00
d3ce6d147e Merge branch 'master' into mueller/VerifHotfix 2020-09-29 15:13:43 +02:00
ce983953ff Merge pull request 'Modes and Memory convergence' (#214) from KSat/fsfw:mueller/modes-memory into master
Reviewed-on: fsfw/fsfw#214
2020-09-29 15:13:34 +02:00
a71528551a include added 2020-09-29 15:10:08 +02:00
6a5268f5b0 typo fix 2020-09-29 15:05:18 +02:00
392d0299a9 Merge remote-tracking branch 'upstream/master' into mueller/modes-memory 2020-09-29 15:04:42 +02:00
8ade9e33c1 Merge branch 'master' into mueller/feature/windowsUdpBridge 2020-09-29 15:00:07 +02:00
37c605c4fb Merge pull request 'Fixes #194 Small Map Issues' (#209) from gaisser/fsfw:gaisser_small_map_issues into master
Reviewed-on: fsfw/fsfw#209
2020-09-29 14:59:55 +02:00
ea29b272bf Merge branch 'master' into mueller/feature/windowsUdpBridge 2020-09-29 14:59:50 +02:00
e55f8f583d Merge branch 'master' into gaisser_small_map_issues 2020-09-29 14:58:35 +02:00
d6e82f64e7 Merge branch 'master' into mueller_tcPacketBase 2020-09-29 14:58:19 +02:00
a700f6a96d Merge pull request 'New StoreAccessors and separation of implementation for storagemanager classes' (#92) from KSat/fsfw:mueller_StoreAccessor into master
Reviewed-on: fsfw/fsfw#92
2020-09-29 14:57:06 +02:00
6c86cf88f3 Merge branch 'master' into mueller_StoreAccessor 2020-09-29 14:56:20 +02:00
352ce13fb3 removed line break 2020-09-29 14:55:17 +02:00
1ed1b7ea06 include guard fix 2020-09-29 14:51:08 +02:00
a58e47623f update 2020-09-29 14:50:16 +02:00
622c7a5a0d debug output removed 2020-09-29 14:45:23 +02:00
bed4e7affa nullptr replacement 2020-09-29 14:43:23 +02:00
1ff85c88b2 store accessor small changes 2020-09-29 14:42:48 +02:00
cef84b13d9 renormalization 2020-09-29 14:35:05 +02:00
6f965c74ac Merge remote-tracking branch 'upstream/master' into mueller_StoreAccessor 2020-09-29 14:34:49 +02:00
b2677ae040 Merge branch 'master' into mueller_tcPacketBase 2020-09-29 14:34:16 +02:00
dae79f30d7 Merge pull request 'timeslot update' (#179) from KSat/fsfw:mueller/FixedTimeslotUpdate into master
Reviewed-on: fsfw/fsfw#179
2020-09-29 14:30:59 +02:00
c01d904552 Merge branch 'mueller/FixedTimeslotUpdate' of https://egit.irs.uni-stuttgart.de/KSat/fsfw into mueller/FixedTimeslotUpdate 2020-09-29 14:30:05 +02:00
7dbb73b7d8 removed dbeug printout 2020-09-29 14:29:57 +02:00
9f7dad31eb Merge branch 'master' into mueller/FixedTimeslotUpdate 2020-09-29 14:21:02 +02:00
21cbb19410 Merge pull request 'ipc update' (#176) from KSat/fsfw:mueller/ipc-updates into master
Reviewed-on: fsfw/fsfw#176
2020-09-29 14:20:18 +02:00
170217e2e8 Merge branch 'master' into mueller/ipc-updates 2020-09-29 14:15:13 +02:00
bf5e7241b6 Merge branch 'master' into mueller/MQM_IF_UpdateLinux 2020-09-29 14:14:56 +02:00
291a62eeb9 Merge branch 'master' into gaisser_small_map_issues 2020-09-29 14:14:48 +02:00
945f49bbe9 Merge pull request 'Object Id and Verif Reporter Improvements' (#213) from KSat/fsfw:mueller/objectIdImprovement into master
User have to change instantiation to the objectId of the new PUS Services

Reviewed-on: fsfw/fsfw#213
2020-09-29 14:14:27 +02:00
183b6a4193 small bugfix 2020-09-29 13:34:27 +02:00
75bdf96799 Merge branch 'master' into mueller/MQM_IF_UpdateLinux 2020-09-27 19:22:07 +02:00
6d2266f7d0 equalization complete 2020-09-26 14:58:53 +02:00
9d4c2b90f3 removed proxy/ not used&working? 2020-09-26 14:54:23 +02:00
7b57f372bf starting convergence 2020-09-26 14:51:00 +02:00
bf5688c8d8 last fixes 2020-09-26 14:36:56 +02:00
a0bc6b3c1f MQM IF update 2020-09-26 14:34:49 +02:00
eec022f801 Merge remote-tracking branch 'origin/mueller/ipc-updates' into mueller/MQMQ_IF_UpdateFreeRTOS 2020-09-26 14:33:35 +02:00
20279169ed Merge branch 'mueller/ipc-updates' into mueller/MQMQ_IF_UpdateFreeRTOS 2020-09-26 14:27:09 +02:00
2edc7fd096 Merge remote-tracking branch 'upstream/master' into mueller/MQMQ_IF_UpdateFreeRTOS 2020-09-26 14:25:50 +02:00
13b68f10a0 added usage of new interface 2020-09-26 14:24:09 +02:00
496251bd68 Merge branch 'master' into mueller/ipc-updates 2020-09-26 14:21:05 +02:00
22d9b77165 added documentation 2020-09-26 14:19:51 +02:00
40558835c7 Merge branch 'master' into mueller/FixedTimeslotUpdate 2020-09-26 14:14:50 +02:00
842c21684a Merge branch 'master' into gaisser_small_map_issues 2020-09-22 18:37:51 +02:00
d1fb512c1f Merge pull request 'Small fix with new pus services' (#210) from gaisser/fsfw:gaisser_small_fix_subsystem_id into master
Reviewed-on: fsfw/fsfw#210
2020-09-22 17:10:09 +02:00
59f72d1031 Small fix with new pus services 2020-09-22 16:59:13 +02:00
978d7514a4 added doc, changed type 2020-09-22 16:32:59 +02:00
2f73841580 include fix 2020-09-22 16:24:40 +02:00
74a4c98ca7 Small format stuff 2020-09-22 16:23:35 +02:00
0bc3807c18 added FIFO 2020-09-22 16:22:37 +02:00
d0f912f32b Merge branch 'master' into mueller/FixedTimeslotUpdate 2020-09-22 16:20:07 +02:00
b681a76f29 Merge branch 'master' into gaisser_small_map_issues 2020-09-22 16:18:55 +02:00
ed80768c66 Fixes #194 2020-09-22 16:13:45 +02:00
de840dcf8d last fixes for linux 2020-09-22 16:10:43 +02:00
e0d9a080c5 Merge remote-tracking branch 'upstream/master' into mueller/MQM_IF_UpdateLinux 2020-09-22 16:06:33 +02:00
59e4b95b62 Merge pull request 'srv17 id added, include fix for linux' (#206) from KSat/fsfw:mueller/include_fix_srv17_id into master
Reviewed-on: fsfw/fsfw#206
2020-09-22 16:03:23 +02:00
ab0f4d8c87 service 9 ID added 2020-09-22 16:01:34 +02:00
98333b92ef srv17 id added, include fix for linux 2020-09-22 15:57:26 +02:00
87fb17f39a IF replacements 2020-09-22 15:52:26 +02:00
8652f2f13f message queue IF update 2020-09-22 15:50:10 +02:00
cea748676e linux message queue update 2020-09-22 15:47:29 +02:00
74b9aef36b freeRTOS update 2020-09-22 15:33:28 +02:00
7dc3a7ecbd fix so it compiles 2020-09-22 15:31:15 +02:00
4248e4000c Merge branch 'mueller/ipc-updates' of https://egit.irs.uni-stuttgart.de/KSat/fsfw into mueller/ipc-updates 2020-09-22 15:29:38 +02:00
b2777faf66 queueue factory update 2020-09-22 15:29:28 +02:00
9faa8d3896 Merge branch 'master' into mueller/ipc-updates 2020-09-22 15:25:58 +02:00
8f2c8c838e Merge branch 'master' into mueller/FixedTimeslotUpdate 2020-09-22 15:24:07 +02:00
66383f78c6 Merge pull request 'renormalized files' (#201) from KSat/fsfw:mueller/file_renormalization into master
Reviewed-on: fsfw/fsfw#201
2020-09-22 15:22:34 +02:00
522433e1b5 Merge branch 'mueller/file_renormalization' of https://egit.irs.uni-stuttgart.de/KSat/fsfw into mueller/file_renormalization 2020-09-22 15:21:17 +02:00
156f44c268 Merge remote-tracking branch 'upstream/master' into mueller/file_renormalization 2020-09-22 15:21:12 +02:00
56c6f971e1 Merge branch 'master' into mueller/file_renormalization 2020-09-22 15:11:02 +02:00
33de6851eb Merge pull request 'SharedRingBuffer' (#167) from KSat/fsfw:mueller/sharedRingBufferPullRequest into master
Reviewed-on: fsfw/fsfw#167
2020-09-22 15:08:31 +02:00
f575c923d7 Merge branch 'master' into mueller/sharedRingBufferPullRequest 2020-09-22 15:08:06 +02:00
40d83fe603 Merge pull request 'SimpleRingBuffer Improvements' (#172) from KSat/fsfw:mueller/SimpleRingBufferUpdate2 into master
Reviewed-on: fsfw/fsfw#172
2020-09-22 15:07:34 +02:00
bb896faeb4 Merge branch 'master' into mueller/SimpleRingBufferUpdate2 2020-09-22 15:07:25 +02:00
3aa9ab2048 Merge branch 'master' into mueller/feature/windowsUdpBridge 2020-09-22 15:06:14 +02:00
580669d49d Merge pull request 'object manager convergence' (#202) from KSat/fsfw:mueller/objectManager-convergence into master
Reviewed-on: fsfw/fsfw#202
2020-09-22 15:03:56 +02:00
90b3ebd390 Merge branch 'master' into mueller/objectManager-convergence 2020-09-22 15:00:51 +02:00
1791b5af57 Merge pull request 'Default Time Stamper' (#199) from KSat/fsfw:mueller/feature/timeStamper into master
Reviewed-on: fsfw/fsfw#199
2020-09-22 15:00:32 +02:00
108f897102 Merge branch 'master' into mueller/feature/timeStamper 2020-09-22 14:57:56 +02:00
9aaa5721af Merge pull request 'PUS Service 9' (#198) from KSat/fsfw:mueller/pusSrv9 into master
Reviewed-on: fsfw/fsfw#198
2020-09-22 14:56:38 +02:00
ade9c32ff3 Merge branch 'master' into mueller/pusSrv9 2020-09-22 14:56:21 +02:00
da4f6cf447 Merge pull request 'Stopwatch-Update' (#200) from KSat/fsfw:mueller/Stopwatch-Update into master
Reviewed-on: fsfw/fsfw#200
2020-09-22 14:56:06 +02:00
4587fbb76d srv9 func removed 2020-09-22 14:52:24 +02:00
af53bf6643 Merge branch 'master' into mueller/Stopwatch-Update 2020-09-22 14:52:20 +02:00
d8c5c4d85d Merge branch 'master' into mueller/pusSrv9 2020-09-22 14:49:39 +02:00
17583f605d Merge pull request 'PUS Service 17' (#197) from KSat/fsfw:mueller/pusSrv17 into master
Reviewed-on: fsfw/fsfw#197
2020-09-22 14:49:30 +02:00
5e974877fe Merge branch 'master' into mueller/pusSrv17 2020-09-22 14:34:05 +02:00
447b69bf03 Merge branch 'master' into mueller/SimpleRingBufferUpdate2 2020-09-22 14:20:51 +02:00
37cf7566f9 Merge branch 'master' into mueller/sharedRingBufferPullRequest 2020-09-22 14:20:11 +02:00
0d8200e856 Merge pull request 'commanding service base hotfix' (#204) from KSat/fsfw:mueller/CSB-hotfix into master
Reviewed-on: fsfw/fsfw#204
2020-09-22 14:05:21 +02:00
7851a71a8e commanding service base hotfix 2020-09-22 14:00:18 +02:00
721793a058 added author tag back 2020-09-18 13:38:53 +02:00
8ea0a38658 shoulddo fix 2020-09-18 13:37:38 +02:00
6062192bf0 dded back retval expalanation 2020-09-18 13:37:06 +02:00
85f21b0516 object manager convergence 2020-09-18 13:32:53 +02:00
386f347574 renormalized files 2020-09-18 13:15:14 +02:00
56ff2aef26 include replacement 2020-09-18 13:03:48 +02:00
ad8c6f3528 commented out code added back 2020-09-18 12:58:38 +02:00
0f0ddfc375 stopwatch update 2020-09-18 12:27:40 +02:00
96f2b68a22 Merge remote-tracking branch 'upstream/master' into mueller/SimpleRingBufferUpdate2 2020-09-16 19:56:13 +02:00
53723b0795 include fix 2020-09-16 19:38:43 +02:00
b0a816490e fixed includes 2020-09-16 19:37:17 +02:00
963015513f added time stamper to framework 2020-09-16 19:36:15 +02:00
85d6e81881 added srv9 to class IDs 2020-09-16 19:17:00 +02:00
b31bee4fda added srv9 2020-09-16 19:11:50 +02:00
ae426c50ba space replaced by tab 2020-09-16 19:09:51 +02:00
a5c6be9dd9 added srv17 2020-09-16 19:05:25 +02:00
21346e40a5 some improvements 2020-09-15 16:58:38 +02:00
589b95d28b Merge branch 'master' into mueller/feature/windowsUdpBridge 2020-09-15 16:56:55 +02:00
d38e13f9d3 Merge branch 'master' into mueller/FixedTimeslotUpdate 2020-09-15 16:53:04 +02:00
3fcbb988ae new file for typedef to avoid circular include 2020-09-15 16:47:01 +02:00
e96ab12312 comment and calculation fix 2020-09-15 15:55:35 +02:00
f3d42de399 Merge branch 'master' into mueller/ipc-updates 2020-09-15 15:47:14 +02:00
db697f16de Merge branch 'master' into mueller_StoreAccessor 2020-09-15 15:46:11 +02:00
42bfedd36c Merge pull request 'health helper update' (#184) from KSat/fsfw:mueller/HealthHelperIdFix into master
Reviewed-on: fsfw/fsfw#184
2020-09-15 15:45:56 +02:00
9061d6d67e Merge branch 'master' into mueller/HealthHelperIdFix 2020-09-15 15:45:42 +02:00
c375e838b8 Merge pull request 'Some minor serialize file changes' (#185) from KSat/fsfw:mueller/serialize-convergence into master
Reviewed-on: fsfw/fsfw#185
2020-09-15 15:44:40 +02:00
d77d370c8a Merge branch 'master' into mueller/serialize-convergence 2020-09-15 15:42:12 +02:00
21094c4926 Merge pull request 'added host osal' (#165) from KSat/fsfw:mueller/hostosal into master
Reviewed-on: fsfw/fsfw#165
2020-09-15 15:33:51 +02:00
51cf13428b Merge branch 'mueller/hostosal' of https://egit.irs.uni-stuttgart.de/KSat/fsfw into mueller/hostosal 2020-09-15 15:28:37 +02:00
b4ca42f1fb ccsds time update 2020-09-15 15:28:05 +02:00
bff08a69fa Merge branch 'master' into mueller/hostosal 2020-09-15 15:08:58 +02:00
4f5b233505 Merge pull request 'init after task creation moved to task functionality' (#178) from KSat/fsfw:mueller/TaskUpdates into master
Reviewed-on: fsfw/fsfw#178
2020-09-15 15:08:18 +02:00
9334a705f8 Merge branch 'master' into mueller/TaskUpdates 2020-09-15 15:05:45 +02:00
2c6a239d5e Merge pull request 'added new periodic op divider' (#195) from KSat/fsfw:mueller/feature/periodicOpDivider into master
Reviewed-on: fsfw/fsfw#195
2020-09-15 15:04:30 +02:00
fbd75f947a Merge branch 'master' into mueller/feature/periodicOpDivider 2020-09-15 15:02:34 +02:00
4c17ef7be5 Merge pull request 'DLE encoder doc added' (#177) from KSat/fsfw:mueller/dledoc into master
Reviewed-on: fsfw/fsfw#177
2020-09-15 15:01:07 +02:00
4f48ed9756 added new periodic op divider 2020-09-10 19:53:52 +02:00
6362de5bc0 Merge branch 'master' into mueller/FixedTimeslotUpdate 2020-09-10 18:20:17 +02:00
d83573cefc additional IDs removed 2020-09-10 16:47:01 +02:00
8048195f63 Merge remote-tracking branch 'upstream/master' into mueller/dledoc 2020-09-10 16:46:31 +02:00
853bd75fec Merge branch 'mueller/HealthHelperIdFix' of https://egit.irs.uni-stuttgart.de/KSat/fsfw into mueller/HealthHelperIdFix 2020-09-10 16:42:25 +02:00
d807ea3afe using MessageQueueIF::NO_QUEUE now 2020-09-10 16:42:11 +02:00
036a022e66 Merge branch 'master' into mueller/HealthHelperIdFix 2020-09-10 16:40:20 +02:00
489d8f1903 Merge branch 'master' into mueller/serialize-convergence 2020-09-10 16:40:02 +02:00
be0cf56994 Merge branch 'master' into mueller/feature/windowsUdpBridge 2020-09-10 16:39:46 +02:00
bbd81c2d6a Merge pull request 'FixedMap Fixes #47 and #36' (#182) from gaisser/fsfw:gaisser_fixes_fixedMap into master
Reviewed-on: fsfw/fsfw#182

Performed CSB tests, everything working as before
2020-09-10 16:38:42 +02:00
e7444912d5 corrected include guard 2020-09-10 15:29:19 +02:00
b8d638cb69 Merge branch 'master' into gaisser_fixes_fixedMap 2020-09-10 15:27:15 +02:00
1635f16bc0 removed changes from datapool separation 2020-09-10 15:26:33 +02:00
c63baf70a1 Merge remote-tracking branch 'upstream/master' into mueller/feature/windowsUdpBridge 2020-09-10 15:26:13 +02:00
0da6456bad Merge remote-tracking branch 'upstream/master' into mueller/serialize-convergence 2020-09-10 15:23:22 +02:00
db2a31aef4 Merge pull request 'Implements #192' (#193) from gaisser/fsfw:gaisser_serialize_c11_update into master
Reviewed-on: fsfw/fsfw#193
2020-09-10 15:13:54 +02:00
de46cf5b08 Merge branch 'master' into gaisser_serialize_c11_update 2020-09-10 15:06:05 +02:00
a364f36f38 Merge pull request 'Fixes for #190 and #189' (#191) from gaisser/fsfw:gaisser_bugs_fixedMap_FIFO into master
Reviewed-on: fsfw/fsfw#191
2020-09-10 15:00:34 +02:00
2d76c744c5 Merge branch 'master' into mueller/HealthHelperIdFix 2020-09-08 14:34:33 +02:00
d1f8040599 Merge branch 'master' into mueller/ipc-updates 2020-09-08 14:33:50 +02:00
e24e080f31 Merge branch 'master' into mueller/sharedRingBufferPullRequest 2020-09-08 14:31:40 +02:00
dab10d761a Merge branch 'master' into mueller/serialize-convergence 2020-09-08 14:27:12 +02:00
976fd54f5e Merge branch 'master' into gaisser_fixes_fixedMap 2020-09-08 14:17:53 +02:00
d87cf0a612 Merge branch 'master' into gaisser_bugs_fixedMap_FIFO 2020-09-08 14:14:38 +02:00
b3af2b5fbc Merge branch 'master' into mueller/feature/windowsUdpBridge 2020-09-08 14:14:03 +02:00
fb36c55419 Merge pull request 'new tmtc unix udp bridge' (#141) from KSat/fsfw:mueller/feature/TmTcUnixBridge into master
Reviewed-on: fsfw/fsfw#141
2020-09-08 14:14:00 +02:00
5dd08877a5 Merge pull request 'tmtc bridge update, uses dynamic FIFO now' (#187) from KSat/fsfw:mueller/TmTcBridgeUpdate into master
Reviewed-on: fsfw/fsfw#187
2020-09-08 14:12:43 +02:00
0258ce62f0 Added documentation 2020-09-07 18:35:25 +02:00
b65789824c Removed old hacks and replaced by standard c++
Added overflow check in SerializeAdapter
2020-09-07 18:06:08 +02:00
278053a342 Another fix in DynamicFIFO 2020-09-07 15:49:28 +02:00
2a28114b49 Fixes for #190 and #189 2020-09-07 15:43:48 +02:00
67b11c0535 Merge branch 'master' into mueller/feature/TmTcUnixBridge 2020-09-06 15:51:34 +02:00
6c42189371 some minor improvements 2020-09-06 15:49:32 +02:00
2439ac455b tmtc bridge update, uses dynamic FIFO now 2020-09-06 15:48:30 +02:00
a9975f5aef added new windows udp bridge 2020-09-06 15:46:49 +02:00
ba01b4578c Merge branch 'master' into mueller/TaskUpdates 2020-09-06 15:41:40 +02:00
234fbcbf41 small bugfix in error checking 2020-09-06 09:34:06 +02:00
f7223abaa3 added define necessary for minGW 2020-09-05 21:20:10 +02:00
902cd4d210 host osal update 2020-09-05 21:19:53 +02:00
a1155686c5 updated host osal 2020-09-05 20:18:52 +02:00
c6dbce7446 Merge remote-tracking branch 'upstream/master' into mueller/hostosal 2020-09-05 20:18:18 +02:00
1a62158f33 took over serial array list adapter changes 2020-09-04 16:07:11 +02:00
328c1b7195 takne over serialize element changes 2020-09-04 16:03:36 +02:00
ed21ec6c78 changes taken over for serial linked list adapter 2020-09-04 16:00:45 +02:00
84308c74d9 taken over some changes 2020-09-04 15:56:08 +02:00
d4d96a128e adapted doc 2020-09-04 15:47:08 +02:00
e83de82481 gathering remaining differences.. 2020-09-04 15:40:42 +02:00
62eb327df6 health helper update 2020-09-04 15:19:33 +02:00
dbac6e139b shared ring buffer update 2020-09-04 15:11:53 +02:00
06400fa7bb share dring buffer update 2020-09-04 15:10:44 +02:00
3e67701933 taken over ring buffer base changes 2020-09-04 15:09:24 +02:00
e105be229a include guards fand include improvements 2020-09-04 15:06:48 +02:00
d885dddee8 renormalize files 2020-09-04 15:04:53 +02:00
a53b9dc3db renormalization 2020-09-04 14:59:59 +02:00
a6b2b4dd93 renormalization 2020-09-04 14:58:36 +02:00
a3b80288e1 Merge remote-tracking branch 'upstream/master' into mueller/dledoc 2020-09-04 14:54:49 +02:00
91d5277a94 added new returnvalues 2020-09-04 14:54:08 +02:00
975fb9832b added interface ID 2020-09-04 14:52:17 +02:00
4bdac1e017 changed from mueller/master taken over 2020-09-04 14:49:59 +02:00
381914886d initAfterTaskCreation added for linux 2020-09-04 14:43:53 +02:00
0eb4c3817e added initialize after taks creation for linux 2020-09-04 14:31:39 +02:00
4d7d48e8ca added a generic way to add a custom check 2020-09-04 14:24:34 +02:00
b8754fbc16 made fixed sequence slot doc generic 2020-09-04 14:11:59 +02:00
92c7369276 include guard fix 2020-09-04 13:56:12 +02:00
04532b8f6b renormalizing pull request step2 2020-09-04 13:52:54 +02:00
5eaf6cfd1f renormalizing pull request step1 2020-09-04 13:52:02 +02:00
7ad5274803 Merge remote-tracking branch 'upstream/master' into mueller/FixedTimeslotUpdate 2020-09-04 13:51:09 +02:00
ab9f58438f Merge branch 'master' into mueller_tcPacketBase 2020-09-01 13:24:41 +02:00
4da21d2c38 Merge branch 'master' into mueller/ipc-updates 2020-09-01 13:12:39 +02:00
b3d08cd40b Merge pull request 'FIFO is StaticFIFO now, new FIFO using vector' (#127) from KSat/fsfw:mueller_FIFO_static_normal into master
Reviewed-on: fsfw/fsfw#127
2020-09-01 13:08:58 +02:00
d5accd16ba Merge branch 'mueller_FIFO_static_normal' of https://egit.irs.uni-stuttgart.de/KSat/fsfw into mueller_FIFO_static_normal 2020-09-01 12:58:38 +02:00
03b2ca679d include guard correction 2020-09-01 12:58:29 +02:00
75f6cacd10 Merge branch 'master' into mueller_FIFO_static_normal 2020-09-01 12:56:41 +02:00
b32ea6e316 Merge pull request 'RingBuffer, static CTOR' (#132) from KSat/fsfw:mueller_ringBufferStatic into master
Reviewed-on: fsfw/fsfw#132
2020-09-01 12:56:23 +02:00
5308cb6237 Merge branch 'master' into mueller_ringBufferStatic 2020-09-01 12:54:08 +02:00
4f3869de8d Merge branch 'mueller_FIFO_static_normal' of https://egit.irs.uni-stuttgart.de/KSat/fsfw into mueller_FIFO_static_normal 2020-09-01 12:54:02 +02:00
b522b3c29c fifo updates 2020-09-01 12:53:53 +02:00
02cfa8bcd5 Merge branch 'master' into mueller_FIFO_static_normal 2020-09-01 12:45:25 +02:00
96c421b72c Merge pull request 'parameter improvements' (#181) from KSat/fsfw:mueller/parameter-updates into master
Reviewed-on: fsfw/fsfw#181
2020-09-01 12:45:20 +02:00
f85e4eb22f Merge branch 'master' into mueller/parameter-updates 2020-09-01 12:44:14 +02:00
66bc60f176 Merge branch 'mueller/parameter-updates' of https://egit.irs.uni-stuttgart.de/KSat/fsfw into mueller/parameter-updates 2020-09-01 12:43:02 +02:00
695a4e7842 offset is size_t now 2020-09-01 12:42:52 +02:00
f068df9028 Merge pull request 'event manager improvements' (#180) from KSat/fsfw:mueller/eventmanager-improvements into master
Reviewed-on: fsfw/fsfw#180
2020-09-01 12:39:33 +02:00
636e5fb888 Merge branch 'master' into gaisser_fixes_fixedMap 2020-09-01 12:35:53 +02:00
77927363ce Merge branch 'master' into mueller/eventmanager-improvements 2020-09-01 12:29:16 +02:00
5d87650833 Merge branch 'master' into mueller/parameter-updates 2020-09-01 12:28:53 +02:00
e949637271 Merge branch 'master' into mueller_FIFO_static_normal 2020-09-01 12:24:41 +02:00
4a80872c3c Merge pull request 'DHB Update' (#144) from KSat/fsfw:mueller/feature/DHBupdate into master
Reviewed-on: fsfw/fsfw#144
2020-09-01 12:24:19 +02:00
a9e5b54238 Merge branch 'master' into mueller/feature/DHBupdate 2020-09-01 12:22:14 +02:00
e77c294360 Merge pull request 'fdir update' (#158) from KSat/fsfw:mueller/devices/FDIR into master
Reviewed-on: fsfw/fsfw#158
2020-09-01 12:21:48 +02:00
7059d5f158 Merge branch 'master' into mueller/devices/FDIR 2020-09-01 12:21:28 +02:00
b07b19327c renormalize CHB 2020-09-01 11:52:18 +02:00
4abdc436fb Revert "renormalize CHB"
This reverts commit a4d9c761a7.
2020-09-01 11:51:43 +02:00
d644a40e14 Merge branch 'mueller/feature/DHBupdate' of https://egit.irs.uni-stuttgart.de/KSat/fsfw into mueller/feature/DHBupdate 2020-09-01 11:49:53 +02:00
a4d9c761a7 renormalize CHB 2020-09-01 11:49:43 +02:00
cc5c944c84 Merge branch 'master' into gaisser_fixes_fixedMap 2020-09-01 11:41:03 +02:00
f645fe6607 Merge pull request 'Comments in serializeIF' (#174) from gaisser/fsfw:gaisser_comments_serialize into master
Reviewed-on: fsfw/fsfw#174
2020-09-01 11:37:21 +02:00
c0ed474373 Update 'serialize/SerializeIF.h' 2020-09-01 11:34:28 +02:00
f12c56c75f Merge branch 'master' into mueller/feature/DHBupdate 2020-09-01 11:20:21 +02:00
7a5c70e753 typo fixes 2020-08-28 18:46:47 +02:00
478b88d7a2 Merge branch 'master' into gaisser_comments_serialize 2020-08-28 18:15:41 +02:00
b54d63edcb event manager improvements 2020-08-28 18:10:02 +02:00
aec557a8c0 updated unix udp bridge 2020-08-28 17:14:20 +02:00
6c0defed5e Merge remote-tracking branch 'upstream/master' into mueller/feature/TmTcUnixBridge 2020-08-28 17:08:54 +02:00
3ec7162832 Merge branch 'master' into mueller_FIFO_static_normal 2020-08-28 17:08:06 +02:00
b4978e7df3 Merge pull request 'Fixed a shadowing issue with moving a declaration to inner scope' (#163) from gaisser/fsfw:gaisser_small_bugfix_subsystem into master
Reviewed-on: fsfw/fsfw#163
2020-08-28 17:01:16 +02:00
543e2f7d5d Merge remote-tracking branch 'upstream/master' into mueller/SimpleRingBufferUpdate2 2020-08-28 13:31:23 +02:00
053f75968b Merge remote-tracking branch 'upstream/master' into mueller/SimpleRingBufferUpdate2 2020-08-28 13:30:44 +02:00
b87a8ba086 Merge remote-tracking branch 'upstream/master' into mueller/sharedRingBufferPullRequest 2020-08-28 13:28:13 +02:00
2362b1d165 Merge branch 'master' into gaisser_small_bugfix_subsystem 2020-08-28 13:25:34 +02:00
ce4d010b5c Merge pull request 'Semaphore Initialization - Linux and FreeRTOS' (#89) from KSat/fsfw:mueller_binSemaphoreInit into master
Reviewed-on: fsfw/fsfw#89
2020-08-28 13:25:05 +02:00
eb503ae030 include guard fix 2020-08-27 20:19:27 +02:00
795b1e5245 Merge remote-tracking branch 'upstream/master' into mueller_FIFO_static_normal 2020-08-27 20:18:06 +02:00
54112acf62 chb update 2020-08-27 20:11:36 +02:00
c4c607776c important fix, 0 init removed 2020-08-27 20:07:03 +02:00
8f2d5a5528 DH fdir improvements 2020-08-27 19:58:35 +02:00
2a74c8d150 Merge remote-tracking branch 'upstream/master' into mueller/devices/FDIR 2020-08-27 19:55:22 +02:00
dfe3658a85 removed hk stuff 2020-08-27 19:52:25 +02:00
386b153ede Merge remote-tracking branch 'upstream/master' into mueller/feature/DHBupdate 2020-08-27 19:50:02 +02:00
df4fb17a45 Merge remote-tracking branch 'upstream/master' into mueller/feature/TmTcUnixBridge 2020-08-27 17:31:16 +02:00
0fedad6da0 semaphore factory update 2020-08-27 17:14:49 +02:00
3be253efd6 include fix 2020-08-27 17:07:42 +02:00
73db79a3fe updated linux implementation 2020-08-27 17:06:10 +02:00
7723ee13b3 Merge remote-tracking branch 'upstream/master' into mueller_binSemaphoreInit 2020-08-27 16:28:50 +02:00
073f168b95 task management function taken over from master 2020-08-27 16:27:54 +02:00
aacda3afc2 interface adapted 2020-08-27 16:26:00 +02:00
64022212f9 removed is empty flag 2020-08-27 16:20:32 +02:00
4530b19548 header update 2020-08-27 16:13:36 +02:00
89d3fe5095 integrated change manually 2020-08-27 16:11:40 +02:00
66cf2d3559 timeslot update for FreeRTOS 2020-08-27 16:05:31 +02:00
02be87aa03 init after task creation moved to task functionality 2020-08-27 15:57:47 +02:00
76f145ddcf Update 'globalfunctions/DleEncoder.cpp'
Just a missing char
2020-08-26 19:59:58 +02:00
281f13e27b Update 'globalfunctions/DleEncoder.h'
Corrected some spelling mistakes
2020-08-26 19:58:18 +02:00
df850116ff dle encoder doc added 2020-08-26 17:43:47 +02:00
a8f2cf910b taken over dle encoder from upstream master 2020-08-26 17:43:20 +02:00
2748a8b93b added doc to dle encoder 2020-08-26 17:42:13 +02:00
561becf6aa Merge remote-tracking branch 'upstream/master' into mueller/hostosal 2020-08-25 18:31:17 +02:00
f13e7b4255 include replacements 2020-08-25 18:30:11 +02:00
3f9d9b8770 ipc update 2020-08-25 18:24:46 +02:00
9465c8f2b2 Merge pull request 'include fix FreeRTOS' (#175) from KSat/fsfw:mueller/hotfix/MutexFreeRTOS into master 2020-08-25 18:16:50 +02:00
d9ee6d0d90 include fix 2020-08-25 18:15:02 +02:00
1ae79ab99d Improvements of comments 2020-08-25 15:06:53 +02:00
6903a761ff Some corrections 2020-08-25 14:23:59 +02:00
af52d1ffda Added some documentation in SerializeIF 2020-08-25 14:14:58 +02:00
7571bc3728 Merge pull request 'renamed MESSAGE_TYPE to messagetypes' (#110) from KSat/fsfw:mueller_MessageNamespaceRenamed into master 2020-08-25 14:08:32 +02:00
9fbf0d1d94 Merge remote-tracking branch 'upstream/master' into mueller_MessageNamespaceRenamed 2020-08-25 14:02:48 +02:00
3001911d69 taken over interface changes 2020-08-25 14:00:27 +02:00
9a06cb846c Merge remote-tracking branch 'upstream/master' into mueller_StoreAccessor 2020-08-25 13:58:58 +02:00
e0a2d09716 Merge pull request 'getter/setter functions for serial buffer adapter' (#170) from KSat/fsfw:mueller/SerialBufferAdapter into master 2020-08-25 13:51:30 +02:00
9c29253337 removed forward decl 2020-08-25 13:42:36 +02:00
de98dd0871 optimization 2020-08-25 13:37:42 +02:00
fb0a3d22db linker forward decl added 2020-08-25 13:34:52 +02:00
ba4eac65cc count t replacements 2020-08-25 13:33:31 +02:00
7d2c48fb33 serializhe improved 2020-08-25 13:32:17 +02:00
c8595c3442 deSerialize fixed/improved 2020-08-25 13:29:36 +02:00
857d61ea13 member pointer now checked 2020-08-25 13:16:17 +02:00
825bf62d79 fixed deSerialize 2020-08-25 13:14:13 +02:00
9245b14569 Merge pull request 'FreeRTOS Stack Size Correction' (#156) from KSat/fsfw:mueller/FreeRTOSstackSizeCorrection into master 2020-08-25 13:00:38 +02:00
6ebe523e50 Merge remote-tracking branch 'upstream/master' into mueller/FreeRTOSstackSizeCorrection 2020-08-25 12:51:57 +02:00
f863849a75 Merge remote-tracking branch 'upstream/master' into mueller_tcPacketBase 2020-08-25 12:45:42 +02:00
b5d6d5a178 Merge pull request 'freeRTOS task management init' (#157) from KSat/fsfw:mueller/FreeRTOS/TaskManagement into master 2020-08-25 12:42:42 +02:00
c0332a80a7 task management update 2020-08-25 12:40:06 +02:00
043710ee56 Merge remote-tracking branch 'upstream/master' into mueller/FreeRTOS/TaskManagement 2020-08-25 12:38:23 +02:00
fddf31121d Merge pull request 'setTaskIF in periodic task' (#154) from KSat/fsfw:mueller/Linux-SetTaskIF-Fix into master 2020-08-25 12:29:02 +02:00
7e0cf49723 author tag 2020-08-25 12:24:37 +02:00
d0419467a7 include guard fix 2020-08-25 12:23:46 +02:00
1235e38556 rtems adaption 2020-08-25 12:20:56 +02:00
8c150fd40d Merge remote-tracking branch 'upstream/master' into mueller/Linux-SetTaskIF-Fix 2020-08-25 12:19:52 +02:00
a1d1d42e88 Merge pull request 'singly linked list improvements' (#108) from KSat/fsfw:mueller_SinglyLinkedListImprovements into master 2020-08-25 12:18:23 +02:00
a414be23bf Merge pull request 'renamed framework.mk to fsfw.mk' (#169) from KSat/fsfw:mueller/submakefile-renamed into master 2020-08-25 12:16:48 +02:00
02de6c41ec Merge pull request 'Mutex improvements' (#90) from KSat/fsfw:mueller_MutexImprovements into master 2020-08-25 12:13:30 +02:00
74dea921e0 made fixes 2020-08-25 12:10:28 +02:00
ab4c65c87a added header file changes 2020-08-25 12:08:12 +02:00
49a36d6fdc removed definitions 2020-08-25 12:06:39 +02:00
a4626aeac0 made rtems adaption 2020-08-25 12:04:59 +02:00
84d99a6f04 added brackets for boolean expressions 2020-08-24 14:56:50 +02:00
b7612bee37 getFreeELement function added 2020-08-24 14:55:32 +02:00
5210bce64d Merge remote-tracking branch 'upstream/master' into mueller_ringBufferStatic 2020-08-24 14:51:13 +02:00
26b63d63b9 small fix 2020-08-24 14:47:53 +02:00
1b4c4de3fa getter/setter functions for serial buffer adapter 2020-08-24 14:38:59 +02:00
1b8f134029 Merge remote-tracking branch 'upstream/master' into mueller_MutexImprovements 2020-08-19 17:30:08 +02:00
5b4e49e966 Merge remote-tracking branch 'upstream/master' into mueller/devices/FDIR 2020-08-19 17:26:50 +02:00
180d997b03 Merge remote-tracking branch 'upstream/master' into mueller/Linux-SetTaskIF-Fix 2020-08-19 17:25:01 +02:00
a2c8b3f75b Merge remote-tracking branch 'upstream/master' into mueller/FreeRTOSstackSizeCorrection 2020-08-19 17:20:44 +02:00
31f398cec9 small fix 2020-08-19 13:16:08 +02:00
e59022dd43 old .mk file removed 2020-08-19 13:15:14 +02:00
c63665c257 renamed framework.mk to fsfw.mk 2020-08-19 13:13:57 +02:00
49d4b6ebc7 Merge pull request 'All includes are relative now #147' (#164) from gaisser/fsfw:gaisser_relative_paths into master 2020-08-18 12:07:40 +02:00
549ad97bd3 shared ring buffer pull request 2020-08-18 11:25:57 +02:00
111f9dce7d added host osal 2020-08-16 23:06:32 +02:00
9e0a905096 Two paths gone wrong 2020-08-13 20:58:49 +02:00
d5dedce294 Relative Paths 2020-08-13 20:53:35 +02:00
287a83c54c Another shadowing error 2020-08-13 19:11:23 +02:00
3d89bc83e5 Another shadowing, altough again no problem 2020-08-13 18:08:17 +02:00
4a2ef6d97f Fixed a shadowing issue of with moving to inner scope 2020-08-13 17:58:42 +02:00
b484e4d5ad Removed unused function 2020-08-13 10:27:16 +02:00
7dbab61ab7 Merge remote-tracking branch 'origin/master' into gaisser_fixes_fixedMap 2020-08-12 10:10:39 +02:00
e535bc1427 Merge pull request 'PUS: PUS Services' (#139) from KSat/fsfw:mueller_PusServices into master 2020-08-12 10:07:36 +02:00
18105e2d16 Merge pull request 'CSB improvements' (#143) from KSat/fsfw:mueller/feature/CSBupdate into master 2020-08-12 10:05:43 +02:00
ebc11bd777 Merge pull request 'Corrected warning in framework mk to fit name of setting' (#160) from gaisser_framework_mk_small_change into master 2020-08-11 17:21:06 +02:00
3d4daa51d5 Corrected warning to fit name of setting 2020-08-11 17:17:50 +02:00
e963aca02a Fixed an issue with memmove in FixedOrderedMultimap 2020-08-11 17:02:19 +02:00
8c722feafb Fixes #47 and #36 2020-08-11 16:21:59 +02:00
6b4fa0cc04 fdir update 2020-08-08 13:28:59 +02:00
e61fdd0d5e freeRTOS task management init 2020-08-08 13:15:41 +02:00
944226c2ed periodic task if fix 2020-08-08 12:47:14 +02:00
a0f41d3238 stack size is bytes now 2020-08-08 12:46:06 +02:00
20f7217501 Merge remote-tracking branch 'upstream/master' into mueller_MutexImprovements 2020-08-07 22:32:19 +02:00
11e23420f2 Merge remote-tracking branch 'upstream/master' into mueller/Linux-SetTaskIF-Fix 2020-08-07 22:31:11 +02:00
3905b72b08 Merge pull request 'linux hotfix' (#155) from KSat/fsfw:mueller/LinuxHotfix into master 2020-08-07 22:29:29 +02:00
90a3e2b8c5 linux hotfix 2020-08-07 22:26:01 +02:00
54825dca6b periodic posix task hotfix 2020-08-07 22:19:13 +02:00
caeb2f9dd6 mutex api changes 2020-08-07 22:16:10 +02:00
7b3fddfd42 implemented mutex if changes 2020-08-07 22:10:58 +02:00
9d90348175 Merge remote-tracking branch 'upstream/master' into mueller_MutexImprovements 2020-08-07 22:07:37 +02:00
9102eec4ab interface change for freeRTOS 2020-08-04 15:20:43 +02:00
c42b5283af periodic task IF: setting task if boolean removed 2020-08-04 15:19:31 +02:00
ea9288d848 updated subsystem ID range 2020-08-04 15:17:40 +02:00
78442a8b92 Amending PR #145, forgot some documentation 2020-08-04 12:25:29 +02:00
03539a6991 Merge pull request 'HasActionsIF + CommandMessage Typo' (#145) from KSat/fsfw:mueller/feature/HasActionsIF into master 2020-08-04 12:18:29 +02:00
6ac36cec15 removed other include in framework.mk 2020-08-02 15:56:38 +02:00
d58fc5c6f7 removed includes in framework.mk 2020-08-02 15:55:56 +02:00
be6060ec94 Merge remote-tracking branch 'upstream/master' into mueller_PusServices 2020-08-02 15:55:22 +02:00
f36da8a79c Merge remote-tracking branch 'upstream/master' into mueller/feature/DHBupdate 2020-08-02 15:49:11 +02:00
2e08037e75 revertiing pool changes 2020-08-02 15:48:09 +02:00
a0ff1e0019 reverted datapool changes 2020-08-02 15:46:25 +02:00
d8bf1931cc doc correction 2020-08-01 16:55:20 +02:00
2198406714 csb update 2020-08-01 16:53:17 +02:00
4213e2e081 Merge remote-tracking branch 'upstram/master' into mueller/feature/CSBupdate 2020-08-01 16:46:27 +02:00
e188e65897 Merge pull request 'important bugfix' (#152) from KSat/fsfw:hotfix/PeriodicTaskOverflowChecking into master 2020-07-30 11:22:47 +02:00
652c60c362 important bugfix
I checked all 5 cases for overflows when checking
for missed deadlines (there is current time, timeToWake
and lastWakeTime, with various combinations of overflows)

This should be the correct implementation now
2020-07-29 20:02:04 +02:00
0449c63225 bugfixes 2020-07-28 13:13:40 +02:00
c16675f69a Merge pull request 'SerialArrayListAdapter' (#151) from KSat/fsfw:bugfix/SerialArrayListAdapter into master 2020-07-28 13:08:10 +02:00
35fe41361b Merge remote-tracking branch 'upstream/master' into mueller_FIFO_static_normal 2020-07-28 13:08:04 +02:00
802004107b Merge remote-tracking branch 'upstream/master' into mueller_FIFO_static_normal 2020-07-28 13:07:35 +02:00
4bffcf17fb some formatting stuff 2020-07-28 13:04:58 +02:00
036a887ea3 bugfix 2020-07-28 13:02:43 +02:00
a87a8f527f Merge pull request 'ServiceInterfaceBuffer Bugfix #149' (#150) from gaisser_fix_service_interface_149 into master 2020-07-28 12:51:28 +02:00
b74fbbddb9 Merge pull request 'FreeRTOS PeriodicTask improvement' (#116) from KSat/fsfw:mueller_PeriodicTaskImprovements into master 2020-07-28 12:45:27 +02:00
88cec7ddb1 Merge pull request 'framework submakefile improvements' (#114) from KSat/fsfw:mueller_Framework_mk_OS_FSFW into master 2020-07-28 12:37:28 +02:00
0defc6a7d8 removed folders 2020-07-28 12:36:22 +02:00
a9c8bea857 Merge remote-tracking branch 'upstream/master' into mueller_binSemaphoreInit 2020-07-28 12:26:56 +02:00
5df88eb73b singlyl inked list bugfix 2020-07-28 12:20:23 +02:00
32f22dd974 Merge pull request 'CommandingServiceBase improvements' (#105) from KSat/fsfw:mueller_CSB_improvements into master 2020-07-28 12:12:07 +02:00
40d0568062 Merge pull request 'PusServiceBase enhancements' (#103) from KSat/fsfw:mueller_PSB_improvement into master 2020-07-28 12:10:18 +02:00
86c48cb7d8 Merge pull request 'Newlib nano CCSDS define' (#49) from KSat/fsfw:mueller_CCSDSTime_Bugfix_Atmel into master
Does not hurt anyone.
2020-07-28 12:00:10 +02:00
136a68000b Merge remote-tracking branch 'upstream/master' into mueller_CSB_improvements 2020-07-25 11:00:27 +02:00
06e7f286d6 added explicit brackets 2020-07-25 10:55:28 +02:00
be9d0a61f4 Fixes #149 2020-07-21 15:15:53 +02:00
e1c17409d9 Merge pull request 'service interface stream enhancements' (#93) from KSat/fsfw:mueller_ServiceStreamEnhancement into master 2020-07-21 12:18:20 +02:00
dc4db6e031 Fixed spelling mistake in HealthHelper 2020-07-16 13:32:08 +02:00
6b03a1c03d commented out some more components 2020-07-16 13:00:22 +02:00
c9bc022941 commented out all new hk manager components 2020-07-16 12:57:29 +02:00
36f7cf2caf updated DHB changes 2020-07-16 12:54:30 +02:00
307c954007 fixed CommandMessageTypo
and integrated HasActionsIF interface changes
2020-07-16 12:49:53 +02:00
646e86ea85 dhb update init 2020-07-16 11:56:48 +02:00
aca0c94c51 CSB new update init 2020-07-16 11:47:11 +02:00
7a4a2f986a Merge pull request 'new intialize after task creation function' (#137) from KSat/fsfw:mueller_ExecutableObjectIF_newInit into master 2020-07-14 11:59:14 +02:00
52f56ca798 Merge pull request 'tmtc bridge improvements' (#136) from KSat/fsfw:mueller_TmTcBridgeImprovements into master 2020-07-14 11:58:38 +02:00
639e61cebf Merge pull request 'FixedTimeslotTask FreeRTOS improvements' (#117) from KSat/fsfw:mueller_FixedTimeslotTaskImprovements into master 2020-07-14 11:45:41 +02:00
8f2a7b9e68 Merge pull request 'hybrid iterator fix and improvement' (#109) from KSat/fsfw:mueller_HybridIterator into master 2020-07-14 11:40:48 +02:00
ced61da357 Merge pull request 'Fixed spelling mistake in HealthHelper' (#121) from gaisser_fix_spelling_mistake_health into master 2020-07-14 11:24:14 +02:00
a0834204da Merge remote-tracking branch 'upstream/master' into mueller_MutexImprovements 2020-07-13 22:18:08 +02:00
ef2a44c683 added back inttypes.h for cleaner code 2020-07-13 22:15:38 +02:00
9f12f232bc Merge branch 'mueller_CCSDSTime_Bugfix_Atmel' of https://egit.irs.uni-stuttgart.de/KSat/fsfw into mueller_CCSDSTime_Bugfix_Atmel 2020-07-13 22:07:27 +02:00
ae486f5330 Merge remote-tracking branch 'upstream/master' into mueller_CCSDSTime_Bugfix_Atmel 2020-07-13 22:02:17 +02:00
538962d0c2 Merge remote-tracking branch 'upstream/master' into mueller_SinglyLinkedListImprovements 2020-07-13 19:54:57 +02:00
d7e157d908 switch setLast and setEnd 2020-07-13 19:53:44 +02:00
14f86422e3 additional size_t replacement 2020-07-13 19:47:31 +02:00
d34ee48126 Merge remote-tracking branch 'upstream/master' into mueller_CSB_improvements 2020-07-13 19:39:36 +02:00
3a2dc5eeb6 new tmtc unix udp bridge 2020-07-13 13:33:12 +02:00
170a2c58f0 Merge pull request 'size_t replacement' (#140) from KSat/fsfw:mueller/hotfix/HealthTableIF into master 2020-07-13 11:52:06 +02:00
72c9ef1089 size_t replacement 2020-07-13 02:12:11 +02:00
85d24b9dfe removed file header comment 2020-07-10 14:31:58 +02:00
97b01f837c srv8 improvements 2020-07-10 14:29:17 +02:00
6b2b788308 added new pus services 2020-07-10 14:16:55 +02:00
5fb5cea949 Merge pull request 'Update SerializeAdapter' (#122) from mohr_serialize into master 2020-07-10 12:21:14 +02:00
26b5ef6dac Merge branch 'master' into mohr_serialize 2020-07-10 12:19:51 +02:00
d1e922eecf new intiialize after task creation function 2020-07-09 20:08:40 +02:00
83484237ae default argument for getter function 2020-07-09 19:53:17 +02:00
1025a3cecc Merge remote-tracking branch 'upstream/master' into mueller_CSB_improvements 2020-07-09 19:49:47 +02:00
90e299977b minor formatting improvements 2020-07-09 19:41:16 +02:00
133ed9586b tmtc bridge improvements 2020-07-09 19:31:28 +02:00
65d71b1c65 added new ctor, non-allocating 2020-07-07 18:11:36 +02:00
d795892d57 csb fifo tweak 2020-07-07 17:54:09 +02:00
5f76b03f3a fifo tweaks 2020-07-07 17:44:15 +02:00
e9166ec4c7 Merge remote-tracking branch 'upstream/master' into mueller_FIFO_static_normal 2020-07-07 17:43:03 +02:00
9f4f8d945c Merge pull request 'hotfix: arrayprinter was renamed' (#131) from KSat/fsfw:mueller_hotfix_arrayprinter into master 2020-07-07 13:27:11 +02:00
986bb154be hotfix: arrayprinter was renamed 2020-07-07 13:24:04 +02:00
ce5a241f4f Merge pull request 'new initializer list ctor' (#72) from KSat/fsfw:mueller_initializer_list into master 2020-07-07 12:10:53 +02:00
56c8f4877d Merge pull request 'mueller_TmTcBridge_cherryPicked' (#40) from KSat/fsfw:mueller_TmTcBridge_cherryPicked into master 2020-07-07 12:06:47 +02:00
6f40a8c622 Merge pull request 'mueller_stopwatch' (#30) from KSat/fsfw:mueller_stopwatch into master 2020-07-07 12:05:04 +02:00
2fccc4fef7 getter function for capacity 2020-07-06 23:08:31 +02:00
8f6c3b50af namespace fix 2020-07-06 13:40:13 +02:00
b699c8b2b3 put FIFO in namespace, fixed doc 2020-07-06 13:38:11 +02:00
991385de65 added missing include, CSB uses static fifo now 2020-07-06 13:29:56 +02:00
ec212d9fcf new fifo init 2020-07-06 13:26:58 +02:00
856f1efd6b Merge remote-tracking branch 'upstram/master' into mueller_PeriodicTaskImprovements 2020-07-06 12:40:27 +02:00
6a0a2675b1 typedef instead of auto used now 2020-07-06 12:36:01 +02:00
05393b900b Merge remote-tracking branch 'upstram/master' into mueller_FixedTimeslotTaskImprovements 2020-07-06 12:27:12 +02:00
f654c4b33e Merge remote-tracking branch 'upstram/master' into mueller_tcPacketBase 2020-07-06 12:22:22 +02:00
c3172d7308 Merge remote-tracking branch 'upstream/master' into mueller_TmTcBridge_cherryPicked 2020-07-03 16:33:17 +02:00
6e79972086 size_t for DataPoolAdmin 2020-07-03 15:50:29 +02:00
45430e8586 Reworked PoolRawAccess to use EndianConverter instead of converting by itself 2020-07-03 15:47:05 +02:00
89accf8940 Documented EndianConverter and changed length to size_t 2020-07-03 15:46:00 +02:00
06b481b02f Corrected filename of EndianConverter.h 2020-07-03 12:44:08 +02:00
8c68895c06 Merge remote-tracking branch 'origin/master' into mohr_serialize 2020-07-03 11:59:15 +02:00
3cd946fef8 Merge pull request 'DeviceHandlerBase: All Refactoring' (#44) from KSat/fsfw:mueller_DeviceHandlerBase_AllRefactoring into master 2020-07-03 11:48:55 +02:00
d311c49998 setTaskIF implemented 2020-06-29 16:57:00 +02:00
5400e38126 slight change 2020-06-29 16:53:32 +02:00
bfd49caab4 fixed include guard comment 2020-06-26 12:52:03 +02:00
053b472157 Fixed spelling mistake in HealthHelper 2020-06-25 18:09:32 +02:00
d1b9ab5126 added basic insertion operations 2020-06-25 17:17:24 +02:00
1ed5da3a12 getter function bugfix 2020-06-24 16:26:44 +02:00
ce3e4a1176 added getter for reject reply 2020-06-24 16:24:16 +02:00
fc0d42e3e0 error output for CSB init failure 2020-06-24 16:07:02 +02:00
644896245f better returnvalues for CSB init 2020-06-24 16:03:54 +02:00
8a56964dab doc fix, various improvements 2020-06-24 16:01:17 +02:00
19cbac923f typo fix 2020-06-24 12:06:08 +02:00
f826ada774 some more little changes for single linked list 2020-06-24 11:40:21 +02:00
a682ca97d2 Merge remote-tracking branch 'upstream/master' into mueller_SinglyLinkedListImprovements 2020-06-24 11:36:45 +02:00
a5a53e7f9b include guard updated 2020-06-24 11:36:10 +02:00
f6d2549534 requested changed implemented 2020-06-24 11:35:07 +02:00
e10cf44c8d Merge remote-tracking branch 'upstream/master' into mueller_HybridIterator 2020-06-24 11:33:31 +02:00
b4bc05fb12 Merge remote-tracking branch 'upstream/master' into mueller_FixedTimeslotTaskImprovements 2020-06-24 11:31:35 +02:00
93d57c0784 Merge remote-tracking branch 'upstream/master' into mueller_PeriodicTaskImprovements 2020-06-24 11:31:21 +02:00
a589be7c74 took over imrpvements 2020-06-23 11:06:54 +02:00
4c59b043e1 const store accessor in separate file now 2020-06-23 10:57:14 +02:00
c8b92a8828 Merge remote-tracking branch 'upstream/master' into mueller_StoreAccessor 2020-06-23 10:50:47 +02:00
e935b8bd04 some minor improvements 2020-06-23 10:45:47 +02:00
d51b3b68e4 Merge remote-tracking branch 'upstream/master' into mueller_TmTcBridge_cherryPicked 2020-06-23 10:37:10 +02:00
4507bdfb69 added setting task IF 2020-06-23 01:14:28 +02:00
1cc50639c7 improvements integrated 2020-06-22 23:49:31 +02:00
0c9c9c581b minor formatting 2020-06-22 23:31:27 +02:00
bf63ba15fe finished overflow checking (hopefully) 2020-06-22 23:30:17 +02:00
3c7ac60dbe added overflow checking 2020-06-22 20:39:36 +02:00
2cada2df4a some fixes and improvements 2020-06-22 20:21:11 +02:00
ffe2a7bffe fix for fixed timeslot task improvement 2020-06-22 19:00:02 +02:00
56aaa29985 added deadline missed check 2020-06-19 14:47:01 +02:00
31e5577763 added deadline missed check 2020-06-19 14:45:29 +02:00
d8e9e34ad9 framework submakefile improvements 2020-06-19 14:36:49 +02:00
cda3130b34 periodic reply map param is bool now 2020-06-19 01:05:51 +02:00
b412ef587a Merge remote-tracking branch 'upstream/master' into mueller_DeviceHandlerBase_AllRefactoring 2020-06-19 00:45:02 +02:00
952fc7303a renamed MESSAGE_TYPE to messagetypes 2020-06-17 21:15:19 +02:00
0c45522540 hybrid iterator fix and improvement 2020-06-17 20:57:35 +02:00
eb4880f603 singly linked list improvements 2020-06-17 20:53:10 +02:00
72f3b16c24 split up huge member function for readability 2020-06-10 22:53:24 +02:00
534fddd2c6 added back comment removed for unknown reasons 2020-06-10 22:19:08 +02:00
482aedfaf2 cleaned up includes, improved doc 2020-06-10 22:13:49 +02:00
5dc2133c3a CSB improvements 2020-06-10 21:41:48 +02:00
39d5fe34bb better include guard, doc form improvement 2020-06-10 21:36:21 +02:00
372493828d Merge remote-tracking branch 'upstream/master' into mueller_PSB_improvement 2020-06-10 21:24:55 +02:00
ed7b4e2a3a PSB improvements 2020-06-10 20:49:30 +02:00
860cdba94d subservicve passed to handleRequest() 2020-06-10 20:28:44 +02:00
86a6b2fee0 Merge remote-tracking branch 'upstream/master' into mueller_binSemaphoreInit 2020-06-10 16:48:14 +02:00
887f8331a2 Merge remote-tracking branch 'upstream/master' into mueller_TmTcBridge_cherryPicked 2020-06-10 16:44:11 +02:00
dc43222db8 Merge remote-tracking branch 'upstream/master' into mueller_stopwatch 2020-06-10 16:43:05 +02:00
dd8543fedd Merge remote-tracking branch 'upstream/master' into mueller_ServiceStreamEnhancement 2020-06-10 16:40:48 +02:00
b5567e8aae rtems mutex update 2020-06-09 13:26:27 +02:00
20abb810f2 i hope this is correct 2020-06-08 14:11:38 +02:00
ad37848039 Merge remote-tracking branch 'upstream/master' into mueller_MutexImprovements 2020-06-08 14:06:59 +02:00
9c766c123d device command iter was uninitialized 2020-06-06 20:56:09 +02:00
03e9362825 mutex helper special output for timeout fail 2020-06-05 20:42:39 +02:00
cef5fda379 refactored initializer list 2020-06-05 13:43:06 +02:00
38b0792cdc Merge remote-tracking branch 'upstream/master' into mueller_initializer_list 2020-06-05 12:31:49 +02:00
fbf804cdca linux changes for mutex 2020-06-04 20:25:15 +02:00
9bcc4c0e3c Merge remote-tracking branch 'upstream/master' into mueller_MutexImprovements 2020-06-04 20:21:52 +02:00
869700e6f5 added mutex IF timeout name 2020-06-04 20:20:38 +02:00
56340bb8b6 free rtos mutex improvements 2020-06-04 20:12:37 +02:00
639b517eda removed unnecessary change 2020-06-04 19:57:25 +02:00
7014833c1c improvements and fixes 2020-06-04 19:50:56 +02:00
3a573c1b4c no run-time dyn memory allocation now 2020-06-04 19:37:33 +02:00
c0808e71d9 no dyn memory allocation, print seems to work 2020-06-04 19:07:04 +02:00
d466921aa0 some more experiments 2020-06-04 17:58:22 +02:00
1cb241ca0c zero padded not using dyn mem alloc now 2020-06-04 17:30:09 +02:00
a6a3180196 removed conflict markers 2020-06-04 15:03:29 +02:00
3d175f603c removed conflict markers 2020-06-04 15:02:14 +02:00
1d99a99bbd I now remember why I included object manager IF changes 2020-06-04 15:00:05 +02:00
8e3f99a350 removed object manager changes for now 2020-06-04 14:59:14 +02:00
11c64a91a3 Merge remote-tracking branch 'upstream/master' into mueller_ServiceStreamEnhancement 2020-06-04 14:52:40 +02:00
e20244b0ce Merge remote-tracking branch 'upstream/master' into mueller_StoreAccessor 2020-06-04 14:35:55 +02:00
966c9c3993 buffer changes 2020-06-04 14:22:04 +02:00
f8fb370ae7 preamble changes started 2020-06-04 14:08:26 +02:00
764608005b buf renamed to streambuf 2020-06-04 13:26:35 +02:00
ef13249405 typedef renamed 2020-06-04 13:01:59 +02:00
9361568b45 clarifying commnet 2020-06-03 23:28:31 +02:00
7259a13569 more improvements:
1. New optional flag to redirect print to stderr. THis can be useful on
host environemtns (e.g linux)
2. non-buffered mode if this flag is true: the preamble msut be printed
manually
2. Getter function for preamble for that case.
3. printChar function: specify whether to print to stderr or stdout
2020-06-03 23:14:17 +02:00
d4f69633f0 renamed timeout values 2020-06-02 22:36:42 +02:00
e5cea3ead0 service interface stream enhancements 2020-05-29 20:31:08 +02:00
70454b4640 Merge remote-tracking branch 'upstram/master' into mueller_stopwatch 2020-05-29 17:55:52 +02:00
a9a23d7623 include improvements 2020-05-29 17:51:15 +02:00
c5bb18a788 include improvements, nullptr used 2020-05-29 17:49:39 +02:00
f15424be4f implemented missing static function 2020-05-29 17:47:55 +02:00
0be418a553 clock.h form improvements 2020-05-29 17:45:08 +02:00
1cf5991101 getClock_timval used now 2020-05-29 17:43:06 +02:00
43a7274129 Merge branch 'mueller_localPoolNeat' into mueller_StoreAccessor 2020-05-29 17:11:10 +02:00
f871f75e1c added back default value for pool manager.h 2020-05-29 17:10:57 +02:00
023af149df Merge branch 'mueller_localPoolNeat' into mueller_StoreAccessor 2020-05-29 17:07:48 +02:00
a3f379e149 and another little include guard fix 2020-05-29 16:50:37 +02:00
acf037614f added another author tag 2020-05-29 16:48:53 +02:00
ab17e28405 include protection output fix 2020-05-29 16:45:52 +02:00
a993223f6e added include protection 2020-05-29 16:44:31 +02:00
d83181cb0f added author tag 2020-05-29 16:41:23 +02:00
8af5a32f1d new store accessor classes
implementation of local pool and pool manager extracted into
tpp file.

store_address_t definition extracted in separate file to avoid circular
includes by using forward declarations
2020-05-29 16:37:46 +02:00
896e7f15dc addd new timeout value 2020-05-29 14:16:44 +02:00
2eba865564 some minor form corrections 2020-05-29 14:03:39 +02:00
8f563b7b21 added retvals for mutex 2020-05-29 14:02:14 +02:00
73183b39ef added new casts
otherwise i cant compile with new freertos version
2020-05-29 13:37:13 +02:00
6c9f157d2c added fw class ids 2020-05-29 13:34:17 +02:00
b4c6a04d4a added linux implementations 2020-05-29 13:33:44 +02:00
adb80a68fc addd freertos semaphore factory 2020-05-29 13:32:38 +02:00
f829d063ce added task management functions
required for freeRTOS
2020-05-29 13:31:55 +02:00
d909fcb6a1 added semaphore implementations 2020-05-29 13:31:19 +02:00
f388bd374c added new factory and interface 2020-05-29 13:29:29 +02:00
ca74e0c0f2 removed comments 2020-05-26 16:07:32 +02:00
9951b59627 DHB retval fixes 2020-05-25 23:45:32 +02:00
dd5b301980 improved returnvalues 2020-05-25 23:38:11 +02:00
5de68fcc6e some returnvalue comments 2020-05-25 23:36:47 +02:00
112779d91f cleaned up returnvlaues 2020-05-25 23:31:13 +02:00
98449ddc7f comment removed 2020-05-25 23:17:15 +02:00
19b4332801 some little tweaks 2020-05-25 23:16:46 +02:00
35b9346c2b include improvements for clock, sif fixes 2020-05-25 15:25:17 +02:00
4f278b610d Merge remote-tracking branch 'upstram/master' into mueller_stopwatch 2020-05-25 15:08:47 +02:00
7eb250a90a include testing 2020-05-25 15:06:54 +02:00
ca10020f19 added getter function for tc packet stored 2020-05-19 20:29:37 +02:00
331b36fe18 fixed setAppData function 2020-05-19 19:05:17 +02:00
730c715120 doc improved 2020-05-19 19:01:25 +02:00
7bc29fc2d5 souce data setter function 2020-05-19 19:00:33 +02:00
483a47d353 some renamings 2020-05-19 18:56:23 +02:00
7bc7e06277 added reordering of ctor arguments 2020-05-18 16:41:37 +02:00
df7be467eb nullptr replacements 2020-05-17 17:54:21 +02:00
0bf8e97830 better error output for invalid passed cookie 2020-05-17 17:49:32 +02:00
80c6eff8a6 added error output for passed nullptr cookie 2020-05-17 17:46:27 +02:00
deb8ce3744 merged upstream master 2020-05-17 15:53:29 +02:00
e8a1912fda Merge remote-tracking branch 'upstram/master' into mueller_DeviceHandlerBase_AllRefactoring 2020-05-17 15:50:40 +02:00
f4ad38f07f replyMap insertion improvements 2020-05-17 15:47:17 +02:00
7ceb6f3c96 override for executeAction() 2020-05-17 15:43:45 +02:00
fb0834ffe1 added cookie caching and deletion 2020-05-17 15:28:00 +02:00
b8e7b12a63 commented whole SWITCH IO BOARD block 2020-05-17 13:10:09 +02:00
4819bad402 addtional comment 2020-05-15 20:01:11 +02:00
1c967d4739 app data size uint16_t 2020-05-15 19:56:21 +02:00
eb5832180b size_t uint16_t corrections 2020-05-15 19:51:39 +02:00
1fb87db82e bugfix and additional functions 2020-05-15 19:44:14 +02:00
a159e60a90 removed bool specialization 2020-05-11 16:53:16 +02:00
fadebe2eb4 new initializer list ctor 2020-05-08 14:38:10 +02:00
614deea323 last size_t replacements 2020-05-07 23:38:28 +02:00
33eae034c7 replace device comIF uint32_t with size_t 2020-05-07 23:14:29 +02:00
25ff8784cf corrected documentation 2020-05-07 20:00:42 +02:00
1181ebcbda Merge remote-tracking branch 'upstream/master' into mueller_stopwatch 2020-05-07 19:57:31 +02:00
684dd67f63 seconds_t double now 2020-05-05 19:14:51 +02:00
6be607e422 FIFO protected 2020-05-04 17:33:56 +02:00
07247dbf40 added virtual keyword for init and performOp() 2020-04-23 11:50:13 +02:00
cf3190a904 Actually, not that horrible, thanks to sed 2020-04-21 22:28:43 +02:00
2093329481 working on updating SerializeIF, to quote Basti: This is going to be horrible 2020-04-21 21:34:03 +02:00
c30cae3431 added back NoC99 io section 2020-04-21 16:32:39 +02:00
ea904642d1 CCSDS time possible bugfix for sscanf() 2020-04-21 16:16:02 +02:00
b78b3ac68a added performOperationHook() 2020-04-19 22:17:14 +02:00
225e1b98a0 some bugfixes in cpp file to enable compilation 2020-04-19 22:10:02 +02:00
3bd83c00f5 freeRTOS with included with extern"C" 2020-04-19 21:52:13 +02:00
fd100cb994 header function order change
fillCOmmandANdREplyMAp is now closer to its helper functions
2020-04-19 16:10:44 +02:00
f4c925e671 Merge branch 'mueller_DeviceHandlerBase_API_change_CookieIF' into mueller_DeviceHandlerBase_AllRefactoring 2020-04-19 15:57:39 +02:00
7f08bb3506 removed ioboardAddress, max reply Len 2020-04-19 15:54:28 +02:00
36dbf6e1ce Merge branch 'mueller_DeviceHandlerBase_ctor_reduction' into mueller_DeviceHandlerBase_AllRefactoring 2020-04-19 15:51:58 +02:00
1820ad14b7 API change introduced, using new device comIF
also changed child handler base.
2020-04-19 15:48:17 +02:00
c8983650f7 Merge branch 'mueller_DeviceHandlerBase_Changes' into mueller_newDeviceCommunicationIF 2020-04-19 15:36:42 +02:00
bb650ac784 Merge remote-tracking branch 'origin/mueller_CookieToCookieIF' into mueller_newDeviceCommunicationIF 2020-04-19 15:30:14 +02:00
ff47fa191a Communication interface rework
As discussed, open/reOpen not used anymore, replaced by
initializeInterface call.
Using CookieIF.
2020-04-19 15:25:17 +02:00
520ed881bb wrong function call fixed 2020-04-19 15:16:44 +02:00
ce554c615c reduced massive ctor size
this was done by moving zero or nullptr initialization
into the header file
2020-04-19 15:15:33 +02:00
eacedf7ed6 DHB: replyLen in replyMap now
both maps are closer together now as well
2020-04-19 15:01:27 +02:00
74b8c3eef4 new returnvalue DeviceComIF
explicitely setting receivedDataLen to 0 in readReceivedMessage() does
not trigger error anymore
2020-04-19 14:52:27 +02:00
62644bdfc9 DeviceHandlerIF fixed some indentation error
still some unclarities about returnvalues
so I added a comment on what the returnvalues
in DHB and DH interface mean
2020-04-19 14:45:28 +02:00
1ec1d057b8 renamed rmap to com (more generic) 2020-04-19 14:08:20 +02:00
7126c19ee0 Restructured header file
Abstract functions are closer to the top
because they must be implemented and documentation
should be near the top.
Important virtual functions moved up too.
Additional documentation added and existing adapted
to 80 column width.
I tried to reduce the number of included files and sorted them a bit
2020-04-19 14:03:47 +02:00
574d6051ba new returnvalue for scanForReply
to ignore full packet
DeviceCommunicationIF sendMessage function takes const data pointer now
2020-04-19 13:41:43 +02:00
0c0c8ec448 device handler base indentation 2020-04-19 13:29:50 +02:00
eb9f43d202 Merge remote-tracking branch 'upstream/master' into mueller_DeviceHandlerBase_Changes 2020-04-19 13:27:20 +02:00
0cb2abfe7e old cookie added again
will be replaced in separate branch/pull request
2020-04-19 13:26:40 +02:00
abe7239018 reset, splitting up merge request 2020-04-19 13:24:10 +02:00
a1f36e6ae5 added std:: before uint32_t typedef 2020-04-18 15:05:51 +02:00
db34c45b67 removed self-inclusion 2020-04-18 14:16:46 +02:00
9c958c06fe Changed Cookie to CookieIF 2020-04-18 14:10:38 +02:00
81ab5a6914 As discussed, renamed Cookie to CookieIF.
Also added documentation on the purpose of this class
2020-04-18 14:03:37 +02:00
2b740a3c0f bugfix 2020-04-09 18:02:42 +02:00
ee23a7c0b5 fix 2020-04-06 14:02:33 +02:00
511c0db8c7 Cookie -> CookieIF, DHB changes
According to changes agreed on 01.04.2020,
slight refactoring of DHB:
requestLen is set to 0 if no respective reply is enabled
2020-04-01 12:43:53 +02:00
ac4275ef05 some minor changes 2020-03-27 14:44:54 +01:00
bfb0234d41 more refactoring 2020-03-24 15:59:08 +01:00
ea41514553 new cookie.cpp + cookieIF.h 2020-03-23 19:17:53 +01:00
59812199fd new cookieIF 2020-03-23 19:16:01 +01:00
029b2133e6 new adaptions for cookie + comIF changes
hook for performOp() added
2020-03-23 18:03:00 +01:00
e03aff3731 Device Handler Base Proposals
1. Interface functions moved closer to top (and functions which should
be implemented)
2. ioBoardAddress renamed to logicalAddress. getter FUnction added.
3. debug interface for easier debugging of device handlers
4. new documentation
5. new return value for scanForReply to ignore full packet
2020-02-03 22:34:15 +01:00
368ef242ff CCSDSTime bugfix for atmel
Possible good for other cases too?
2020-01-18 18:49:55 +01:00
600 changed files with 16195 additions and 13434 deletions

0
.gitmodules vendored Normal file
View File

12
FSFWVersion.h Normal file
View File

@ -0,0 +1,12 @@
#ifndef FSFW_DEFAULTCFG_VERSION_H_
#define FSFW_DEFAULTCFG_VERSION_H_
const char* const FSFW_VERSION_NAME = "ASTP";
#define FSFW_VERSION 0
#define FSFW_SUBVERSION 0
#define FSFW_REVISION 1
#endif /* FSFW_DEFAULTCFG_VERSION_H_ */

2
NOTICE
View File

@ -4,6 +4,8 @@ The initial version of the Flight Software Framework was developed during
the Flying Laptop Project by the Universität Stuttgart in coorporation
with Airbus Defence and Space GmbH.
The supreme FSFW Logo was designed by Markus Koller and Luise Trilsbach.
Copyrights in the Flight Software Framework are retained by their contributors.
No copyright assignment is required to contribute to the Flight Software Framework.

159
README.md Normal file
View File

@ -0,0 +1,159 @@
![FSFW Logo](logo/FSFW_Logo_V3_bw.png)
# Flight Software Framework (FSFW)
The Flight Software Framework is a C++ Object Oriented Framework for unmanned,
automated systems like Satellites.
The initial version of the Flight Software Framework was developed during
the Flying Laptop Project by the University of Stuttgart in cooperation
with Airbus Defence and Space GmbH.
## Intended Use
The framework is designed for systems, which communicate with external devices, perform control loops, receive telecommands and send telemetry, and need to maintain a high level of availability.
Therefore, a mode and health system provides control over the states of the software and the controlled devices.
In addition, a simple mechanism of event based fault detection, isolation and recovery is implemented as well.
The recommended hardware is a microprocessor with more than 2 MB of RAM and 1 MB of non-volatile Memory.
For reference, current Applications use a Cobham Gaisler UT699 (LEON3FT), a ISISPACE IOBC or a Zynq-7020 SoC.
## 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.
Exceptions are not allowed.
### Failure Handling
Functions should return a defined ReturnValue_t to signal to the caller that something is 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.
### OSAL
The FSFW provides operation system abstraction layers for Linux, FreeRTOS and RTEMS. A independent OSAL called "host" is currently not finished. This aims to be running on windows as well.
The OSAL provides periodic tasks, message queues, clocks and Semaphores as well as Mutexes.
### Core Components
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):
* 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.
``` c++
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 must be configured by setting this 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;
}
```
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
### 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/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 over Message through Queues.
Those queues are created by calling the singleton QueueFactory::instance()->create().
### 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.
#### 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 must be created.
An example can be found in the timemanager folder, this uses CCSDSTime::CDS_short.
#### DeviceHandling
DeviceHandlers are a core 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 DH can be tested on different hardware.
The DH has mechanisms to monitor the communication with the physical device which allow for FDIR reaction.
A standard FDIR component for the DH will be created automatically but can be overwritten by the user.
#### Modes, 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.
## Example config
A example config can be found in defaultcfg/fsfwconfig.
## Unit Tests
Unit Tests are provided in the unittest folder. Those use the catch2 framework but do not include catch2 itself.
See README.md in the unittest Folder.

View File

@ -1,9 +1,12 @@
#include <framework/action/ActionHelper.h>
#include <framework/action/HasActionsIF.h>
#include <framework/objectmanager/ObjectManagerIF.h>
#include "ActionHelper.h"
#include "HasActionsIF.h"
ActionHelper::ActionHelper(HasActionsIF* setOwner, MessageQueueIF* useThisQueue) :
owner(setOwner), queueToUse(useThisQueue), ipcStore(nullptr) {
#include "../ipc/MessageQueueSenderIF.h"
#include "../objectmanager/ObjectManagerIF.h"
ActionHelper::ActionHelper(HasActionsIF* setOwner,
MessageQueueIF* useThisQueue) :
owner(setOwner), queueToUse(useThisQueue) {
}
ActionHelper::~ActionHelper() {
@ -32,13 +35,15 @@ ReturnValue_t ActionHelper::initialize(MessageQueueIF* queueToUse_) {
return HasReturnvaluesIF::RETURN_OK;
}
void ActionHelper::step(uint8_t step, MessageQueueId_t reportTo, ActionId_t commandId, ReturnValue_t result) {
void ActionHelper::step(uint8_t step, MessageQueueId_t reportTo,
ActionId_t commandId, ReturnValue_t result) {
CommandMessage reply;
ActionMessage::setStepReply(&reply, commandId, step + STEP_OFFSET, result);
queueToUse->sendMessage(reportTo, &reply);
}
void ActionHelper::finish(MessageQueueId_t reportTo, ActionId_t commandId, ReturnValue_t result) {
void ActionHelper::finish(MessageQueueId_t reportTo, ActionId_t commandId,
ReturnValue_t result) {
CommandMessage reply;
ActionMessage::setCompletionReply(&reply, commandId, result);
queueToUse->sendMessage(reportTo, &reply);
@ -48,8 +53,8 @@ void ActionHelper::setQueueToUse(MessageQueueIF* queue) {
queueToUse = queue;
}
void ActionHelper::prepareExecution(MessageQueueId_t commandedBy, ActionId_t actionId,
store_address_t dataAddress) {
void ActionHelper::prepareExecution(MessageQueueId_t commandedBy,
ActionId_t actionId, store_address_t dataAddress) {
const uint8_t* dataPtr = NULL;
size_t size = 0;
ReturnValue_t result = ipcStore->getData(dataAddress, &dataPtr, &size);
@ -61,6 +66,11 @@ void ActionHelper::prepareExecution(MessageQueueId_t commandedBy, ActionId_t act
}
result = owner->executeAction(actionId, commandedBy, dataPtr, size);
ipcStore->deleteData(dataAddress);
if(result == HasActionsIF::EXECUTION_FINISHED) {
CommandMessage reply;
ActionMessage::setCompletionReply(&reply, actionId, result);
queueToUse->sendMessage(commandedBy, &reply);
}
if (result != HasReturnvaluesIF::RETURN_OK) {
CommandMessage reply;
ActionMessage::setStepReply(&reply, actionId, 0, result);
@ -85,22 +95,28 @@ ReturnValue_t ActionHelper::reportData(MessageQueueId_t reportTo,
if (result != HasReturnvaluesIF::RETURN_OK) {
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) {
ipcStore->deleteData(storeAddress);
return result;
}
//We don't need to report the objectId, as we receive REQUESTED data before the completion success message.
//True aperiodic replies need to be reported with another dedicated message.
// We don't need to report the objectId, as we receive REQUESTED data
// before the completion success message.
// True aperiodic replies need to be reported with
// another dedicated message.
ActionMessage::setDataReply(&reply, replyId, storeAddress);
//TODO Service Implementation sucks at the moment
if (hideSender){
// If the sender needs to be hidden, for example to handle packet
// as unrequested reply, this will be done here.
if (hideSender) {
result = MessageQueueSenderIF::sendMessage(reportTo, &reply);
} else {
}
else {
result = queueToUse->sendMessage(reportTo, &reply);
}
if ( result != HasReturnvaluesIF::RETURN_OK){
if (result != HasReturnvaluesIF::RETURN_OK){
ipcStore->deleteData(storeAddress);
}
return result;
@ -108,3 +124,39 @@ ReturnValue_t ActionHelper::reportData(MessageQueueId_t reportTo,
void ActionHelper::resetHelper() {
}
ReturnValue_t ActionHelper::reportData(MessageQueueId_t reportTo,
ActionId_t replyId, const uint8_t *data, size_t dataSize,
bool hideSender) {
CommandMessage reply;
store_address_t storeAddress;
ReturnValue_t result = ipcStore->addData(&storeAddress, data, dataSize);
if (result != HasReturnvaluesIF::RETURN_OK) {
return result;
}
if (result != HasReturnvaluesIF::RETURN_OK) {
ipcStore->deleteData(storeAddress);
return result;
}
// We don't need to report the objectId, as we receive REQUESTED data
// before the completion success message.
// True aperiodic replies need to be reported with
// another dedicated message.
ActionMessage::setDataReply(&reply, replyId, storeAddress);
// If the sender needs to be hidden, for example to handle packet
// as unrequested reply, this will be done here.
if (hideSender) {
result = MessageQueueSenderIF::sendMessage(reportTo, &reply);
}
else {
result = queueToUse->sendMessage(reportTo, &reply);
}
if (result != HasReturnvaluesIF::RETURN_OK){
ipcStore->deleteData(storeAddress);
}
return result;
}

View File

@ -1,15 +1,18 @@
#ifndef ACTIONHELPER_H_
#define ACTIONHELPER_H_
#ifndef FSFW_ACTION_ACTIONHELPER_H_
#define FSFW_ACTION_ACTIONHELPER_H_
#include <framework/action/ActionMessage.h>
#include <framework/serialize/SerializeIF.h>
#include <framework/ipc/MessageQueueIF.h>
#include "ActionMessage.h"
#include "../serialize/SerializeIF.h"
#include "../ipc/MessageQueueIF.h"
/**
* \brief Action Helper is a helper class which handles action messages
* @brief Action Helper is a helper class which handles action messages
*
* Components which use the HasActionIF this helper can be used to handle the action messages.
* It does handle step messages as well as other answers to action calls. It uses the executeAction function
* of its owner as callback. The call of the initialize function is mandatory and it needs a valid messageQueueIF pointer!
* Components which use the HasActionIF this helper can be used to handle
* the action messages.
* It does handle step messages as well as other answers to action calls.
* It uses the executeAction function of its owner as callback.
* The call of the initialize function is mandatory and needs a
* valid MessageQueueIF pointer!
*/
class HasActionsIF;
@ -18,7 +21,8 @@ public:
/**
* Constructor of the action helper
* @param setOwner Pointer to the owner of the interface
* @param useThisQueue messageQueue to be used, can be set during initialize function as well.
* @param useThisQueue messageQueue to be used, can be set during
* initialize function as well.
*/
ActionHelper(HasActionsIF* setOwner, MessageQueueIF* useThisQueue);
@ -26,28 +30,36 @@ public:
/**
* Function to be called from the owner with a new command message
*
* If the message is a valid action message the helper will use the executeAction function from HasActionsIF.
* If the message is invalid or the callback fails a message reply will be send to the sender of the message automatically.
* If the message is a valid action message the helper will use the
* executeAction function from HasActionsIF.
* If the message is invalid or the callback fails a message reply will be
* send to the sender of the message automatically.
*
* @param command Pointer to a command message received by the owner
* @return HasReturnvaluesIF::RETURN_OK if the message is a action message, CommandMessage::UNKNOW_COMMAND if this message ID is unkown
* @return HasReturnvaluesIF::RETURN_OK if the message is a action message,
* CommandMessage::UNKNOW_COMMAND if this message ID is unkown
*/
ReturnValue_t handleActionMessage(CommandMessage* command);
/**
* Helper initialize function. Must be called before use of any other helper function
* @param queueToUse_ Pointer to the messageQueue to be used
* Helper initialize function. Must be called before use of any other
* helper function
* @param queueToUse_ Pointer to the messageQueue to be used, optional
* if queue was set in constructor
* @return Returns RETURN_OK if successful
*/
ReturnValue_t initialize(MessageQueueIF* queueToUse_ = nullptr);
/**
* Function to be called from the owner to send a step message. Success or failure will be determined by the result value.
* Function to be called from the owner to send a step message.
* Success or failure will be determined by the result value.
*
* @param step Number of steps already done
* @param reportTo The messageQueueId to report the step message to
* @param commandId ID of the executed command
* @param result Result of the execution
*/
void step(uint8_t step, MessageQueueId_t reportTo, ActionId_t commandId, ReturnValue_t result = HasReturnvaluesIF::RETURN_OK);
void step(uint8_t step, MessageQueueId_t reportTo,
ActionId_t commandId,
ReturnValue_t result = HasReturnvaluesIF::RETURN_OK);
/**
* Function to be called by the owner to send a action completion message
*
@ -55,39 +67,59 @@ public:
* @param commandId ID of the executed command
* @param result Result of the execution
*/
void finish(MessageQueueId_t reportTo, ActionId_t commandId, ReturnValue_t result = HasReturnvaluesIF::RETURN_OK);
void finish(MessageQueueId_t reportTo, ActionId_t commandId,
ReturnValue_t result = HasReturnvaluesIF::RETURN_OK);
/**
* Function to be called by the owner if an action does report data
*
* @param reportTo MessageQueueId_t to report the action completion message to
* Function to be called by the owner if an action does report data.
* Takes a SerializeIF* pointer and serializes it into the IPC store.
* @param reportTo MessageQueueId_t to report the action completion
* message to
* @param replyId ID of the executed command
* @param data Pointer to the data
* @return Returns RETURN_OK if successful, otherwise failure code
*/
ReturnValue_t reportData(MessageQueueId_t reportTo, ActionId_t replyId, SerializeIF* data, bool hideSender = false);
ReturnValue_t reportData(MessageQueueId_t reportTo, ActionId_t replyId,
SerializeIF* data, bool hideSender = false);
/**
* Function to be called by the owner if an action does report data.
* Takes the raw data and writes it into the IPC store.
* @param reportTo MessageQueueId_t to report the action completion
* message to
* @param replyId ID of the executed command
* @param data Pointer to the data
* @return Returns RETURN_OK if successful, otherwise failure code
*/
ReturnValue_t reportData(MessageQueueId_t reportTo, ActionId_t replyId,
const uint8_t* data, size_t dataSize, bool hideSender = false);
/**
* Function to setup the MessageQueueIF* of the helper. Can be used to set the messageQueueIF* if
* message queue is unavailable at construction and initialize but must be setup before first call of other functions.
* Function to setup the MessageQueueIF* of the helper. Can be used to
* set the MessageQueueIF* if message queue is unavailable at construction
* and initialize but must be setup before first call of other functions.
* @param queue Queue to be used by the helper
*/
void setQueueToUse(MessageQueueIF *queue);
protected:
static const uint8_t STEP_OFFSET = 1;//!< Increase of value of this per step
//!< Increase of value of this per step
static const uint8_t STEP_OFFSET = 1;
HasActionsIF* owner;//!< Pointer to the owner
MessageQueueIF* queueToUse;//!< Queue to be used as response sender, has to be set with
StorageManagerIF* ipcStore;//!< Pointer to an IPC Store, initialized during construction or initialize(MessageQueueIF* queueToUse_) or with setQueueToUse(MessageQueueIF *queue)
//! Queue to be used as response sender, has to be set in ctor or with
//! setQueueToUse
MessageQueueIF* queueToUse;
//! Pointer to an IPC Store, initialized during construction or
StorageManagerIF* ipcStore = nullptr;
/**
*Internal function called by handleActionMessage(CommandMessage* command)
*
* Internal function called by handleActionMessage
* @param commandedBy MessageQueueID of Commander
* @param actionId ID of action to be done
* @param dataAddress Address of additional data in IPC Store
*/
virtual void prepareExecution(MessageQueueId_t commandedBy, ActionId_t actionId, store_address_t dataAddress);
virtual void prepareExecution(MessageQueueId_t commandedBy,
ActionId_t actionId, store_address_t dataAddress);
/**
*
* @brief Default implementation is empty.
*/
virtual void resetHelper();
};
#endif /* ACTIONHELPER_H_ */
#endif /* FSFW_ACTION_ACTIONHELPER_H_ */

View File

@ -1,6 +1,6 @@
#include <framework/action/ActionMessage.h>
#include <framework/objectmanager/ObjectManagerIF.h>
#include <framework/storagemanager/StorageManagerIF.h>
#include "ActionMessage.h"
#include "../objectmanager/ObjectManagerIF.h"
#include "../storagemanager/StorageManagerIF.h"
ActionMessage::ActionMessage() {
}

View File

@ -1,9 +1,9 @@
#ifndef ACTIONMESSAGE_H_
#define ACTIONMESSAGE_H_
#ifndef FSFW_ACTION_ACTIONMESSAGE_H_
#define FSFW_ACTION_ACTIONMESSAGE_H_
#include <framework/ipc/CommandMessage.h>
#include <framework/objectmanager/ObjectManagerIF.h>
#include <framework/storagemanager/StorageManagerIF.h>
#include "../ipc/CommandMessage.h"
#include "../objectmanager/ObjectManagerIF.h"
#include "../storagemanager/StorageManagerIF.h"
typedef uint32_t ActionId_t;
class ActionMessage {
@ -18,15 +18,19 @@ public:
static const Command_t COMPLETION_SUCCESS = MAKE_COMMAND_ID(5);
static const Command_t COMPLETION_FAILED = MAKE_COMMAND_ID(6);
virtual ~ActionMessage();
static void setCommand(CommandMessage* message, ActionId_t fid, store_address_t parameters);
static void setCommand(CommandMessage* message, ActionId_t fid,
store_address_t parameters);
static ActionId_t getActionId(const CommandMessage* message );
static store_address_t getStoreId(const CommandMessage* message );
static void setStepReply(CommandMessage* message, ActionId_t fid, uint8_t step, ReturnValue_t result = HasReturnvaluesIF::RETURN_OK);
static void setStepReply(CommandMessage* message, ActionId_t fid,
uint8_t step, ReturnValue_t result = HasReturnvaluesIF::RETURN_OK);
static uint8_t getStep(const CommandMessage* message );
static ReturnValue_t getReturnCode(const CommandMessage* message );
static void setDataReply(CommandMessage* message, ActionId_t actionId, store_address_t data);
static void setCompletionReply(CommandMessage* message, ActionId_t fid, ReturnValue_t result = HasReturnvaluesIF::RETURN_OK);
static void setDataReply(CommandMessage* message, ActionId_t actionId,
store_address_t data);
static void setCompletionReply(CommandMessage* message, ActionId_t fid,
ReturnValue_t result = HasReturnvaluesIF::RETURN_OK);
static void clear(CommandMessage* message);
};
#endif /* ACTIONMESSAGE_H_ */
#endif /* FSFW_ACTION_ACTIONMESSAGE_H_ */

View File

@ -1,8 +1,8 @@
#include <framework/action/ActionMessage.h>
#include <framework/action/CommandActionHelper.h>
#include <framework/action/CommandsActionsIF.h>
#include <framework/action/HasActionsIF.h>
#include <framework/objectmanager/ObjectManagerIF.h>
#include "ActionMessage.h"
#include "CommandActionHelper.h"
#include "CommandsActionsIF.h"
#include "HasActionsIF.h"
#include "../objectmanager/ObjectManagerIF.h"
CommandActionHelper::CommandActionHelper(CommandsActionsIF *setOwner) :
owner(setOwner), queueToUse(NULL), ipcStore(

View File

@ -1,12 +1,12 @@
#ifndef COMMANDACTIONHELPER_H_
#define COMMANDACTIONHELPER_H_
#include <framework/action/ActionMessage.h>
#include <framework/objectmanager/ObjectManagerIF.h>
#include <framework/returnvalues/HasReturnvaluesIF.h>
#include <framework/serialize/SerializeIF.h>
#include <framework/storagemanager/StorageManagerIF.h>
#include <framework/ipc/MessageQueueIF.h>
#include "ActionMessage.h"
#include "../objectmanager/ObjectManagerIF.h"
#include "../returnvalues/HasReturnvaluesIF.h"
#include "../serialize/SerializeIF.h"
#include "../storagemanager/StorageManagerIF.h"
#include "../ipc/MessageQueueIF.h"
class CommandsActionsIF;

View File

@ -1,9 +1,9 @@
#ifndef COMMANDSACTIONSIF_H_
#define COMMANDSACTIONSIF_H_
#ifndef FSFW_ACTION_COMMANDSACTIONSIF_H_
#define FSFW_ACTION_COMMANDSACTIONSIF_H_
#include <framework/action/CommandActionHelper.h>
#include <framework/returnvalues/HasReturnvaluesIF.h>
#include <framework/ipc/MessageQueueIF.h>
#include "CommandActionHelper.h"
#include "../returnvalues/HasReturnvaluesIF.h"
#include "../ipc/MessageQueueIF.h"
/**
* Interface to separate commanding actions of other objects.
@ -24,11 +24,14 @@ public:
virtual MessageQueueIF* getCommandQueuePtr() = 0;
protected:
virtual void stepSuccessfulReceived(ActionId_t actionId, uint8_t step) = 0;
virtual void stepFailedReceived(ActionId_t actionId, uint8_t step, ReturnValue_t returnCode) = 0;
virtual void dataReceived(ActionId_t actionId, const uint8_t* data, uint32_t size) = 0;
virtual void stepFailedReceived(ActionId_t actionId, uint8_t step,
ReturnValue_t returnCode) = 0;
virtual void dataReceived(ActionId_t actionId, const uint8_t* data,
uint32_t size) = 0;
virtual void completionSuccessfulReceived(ActionId_t actionId) = 0;
virtual void completionFailedReceived(ActionId_t actionId, ReturnValue_t returnCode) = 0;
virtual void completionFailedReceived(ActionId_t actionId,
ReturnValue_t returnCode) = 0;
};
#endif /* COMMANDSACTIONSIF_H_ */
#endif /* FSFW_ACTION_COMMANDSACTIONSIF_H_ */

View File

@ -1,11 +1,12 @@
#ifndef FRAMEWORK_ACTION_HASACTIONSIF_H_
#define FRAMEWORK_ACTION_HASACTIONSIF_H_
#ifndef FSFW_ACTION_HASACTIONSIF_H_
#define FSFW_ACTION_HASACTIONSIF_H_
#include "ActionHelper.h"
#include "ActionMessage.h"
#include "SimpleActionHelper.h"
#include "../returnvalues/HasReturnvaluesIF.h"
#include "../ipc/MessageQueueIF.h"
#include <framework/action/ActionHelper.h>
#include <framework/action/ActionMessage.h>
#include <framework/action/SimpleActionHelper.h>
#include <framework/returnvalues/HasReturnvaluesIF.h>
#include <framework/ipc/MessageQueueIF.h>
/**
* @brief
* Interface for component which uses actions
@ -47,14 +48,16 @@ public:
virtual MessageQueueId_t getCommandQueue() const = 0;
/**
* Execute or initialize the execution of a certain function.
* Returning #EXECUTION_FINISHED or a failure code, nothing else needs to
* be done. When needing more steps, return RETURN_OK and issue steps and
* completion manually.
* One "step failed" or completion report must be issued!
* The ActionHelpers will execute this function and behave differently
* depending on the returnvalue.
*
* @return
* -@c EXECUTION_FINISHED Finish reply will be generated
* -@c Not RETURN_OK Step failure reply will be generated
*/
virtual ReturnValue_t executeAction(ActionId_t actionId,
MessageQueueId_t commandedBy, const uint8_t* data, size_t size) = 0;
};
#endif /* FRAMEWORK_ACTION_HASACTIONSIF_H_ */
#endif /* FSFW_ACTION_HASACTIONSIF_H_ */

View File

@ -1,16 +1,17 @@
#include <framework/action/HasActionsIF.h>
#include <framework/action/SimpleActionHelper.h>
#include "HasActionsIF.h"
#include "SimpleActionHelper.h"
SimpleActionHelper::SimpleActionHelper(HasActionsIF* setOwner,
MessageQueueIF* useThisQueue) :
ActionHelper(setOwner, useThisQueue), isExecuting(false), lastCommander(
0), lastAction(0), stepCount(0) {
ActionHelper(setOwner, useThisQueue), isExecuting(false) {
}
SimpleActionHelper::~SimpleActionHelper() {
}
void SimpleActionHelper::step(ReturnValue_t result) {
//STEP_OFFESET is subtracted to compensate for adding offset in base method, which is not necessary here.
// STEP_OFFESET is subtracted to compensate for adding offset in base
// method, which is not necessary here.
ActionHelper::step(stepCount - STEP_OFFSET, lastCommander, lastAction,
result);
if (result != HasReturnvaluesIF::RETURN_OK) {

View File

@ -1,8 +1,13 @@
#ifndef SIMPLEACTIONHELPER_H_
#define SIMPLEACTIONHELPER_H_
#ifndef FSFW_ACTION_SIMPLEACTIONHELPER_H_
#define FSFW_ACTION_SIMPLEACTIONHELPER_H_
#include <framework/action/ActionHelper.h>
#include "ActionHelper.h"
/**
* @brief This is an action helper which is only able to service one action
* at a time but remembers last commander and last action which
* simplifies usage
*/
class SimpleActionHelper: public ActionHelper {
public:
SimpleActionHelper(HasActionsIF* setOwner, MessageQueueIF* useThisQueue);
@ -12,13 +17,14 @@ public:
ReturnValue_t reportData(SerializeIF* data);
protected:
void prepareExecution(MessageQueueId_t commandedBy, ActionId_t actionId, store_address_t dataAddress);
virtual void resetHelper();
void prepareExecution(MessageQueueId_t commandedBy, ActionId_t actionId,
store_address_t dataAddress);
virtual void resetHelper();
private:
bool isExecuting;
MessageQueueId_t lastCommander;
ActionId_t lastAction;
uint8_t stepCount;
MessageQueueId_t lastCommander = MessageQueueIF::NO_QUEUE;
ActionId_t lastAction = 0;
uint8_t stepCount = 0;
};
#endif /* SIMPLEACTIONHELPER_H_ */

View File

@ -1,9 +1,9 @@
#ifndef FRAMEWORK_CONTAINER_ARRAYLIST_H_
#define FRAMEWORK_CONTAINER_ARRAYLIST_H_
#ifndef FSFW_CONTAINER_ARRAYLIST_H_
#define FSFW_CONTAINER_ARRAYLIST_H_
#include <framework/returnvalues/HasReturnvaluesIF.h>
#include <framework/serialize/SerializeAdapter.h>
#include <framework/serialize/SerializeIF.h>
#include "../returnvalues/HasReturnvaluesIF.h"
#include "../serialize/SerializeAdapter.h"
#include "../serialize/SerializeIF.h"
/**
* @brief A List that stores its values in an array.
@ -20,11 +20,35 @@ public:
static const uint8_t INTERFACE_ID = CLASS_ID::ARRAY_LIST;
static const ReturnValue_t FULL = MAKE_RETURN_CODE(0x01);
/**
* Copying is forbiden by declaring copy ctor and copy assignment deleted
* It is too ambigous in this case.
* (Allocate a new backend? Use the same? What to do in an modifying call?)
*/
/**
* This is the allocating constructor.
* It allocates an array of the specified size.
* @param maxSize
*/
ArrayList(count_t maxSize) :
size(0), maxSize_(maxSize), allocated(true) {
entries = new T[maxSize];
}
/**
* This is the non-allocating constructor
*
* It expects a pointer to an array of a certain size and initializes
* itself to it.
*
* @param storage the array to use as backend
* @param maxSize size of storage
* @param size size of data already present in storage
*/
ArrayList(T *storage, count_t maxSize, count_t size = 0) :
size(size), entries(storage), maxSize_(maxSize), allocated(false) {
}
/**
* Copying is forbiden by declaring copy ctor and copy assignment deleted
* It is too ambigous in this case.
* (Allocate a new backend? Use the same? What to do in an modifying call?)
*/
ArrayList(const ArrayList& other) = delete;
const ArrayList& operator=(const ArrayList& other) = delete;
@ -33,30 +57,6 @@ public:
*/
count_t size;
/**
* This is the allocating constructor;
*
* It allocates an array of the specified size.
*
* @param maxSize
*/
ArrayList(count_t maxSize) :
size(0), maxSize_(maxSize), allocated(true) {
entries = new T[maxSize];
}
/**
* This is the non-allocating constructor
*
* It expects a pointer to an array of a certain size and initializes itself to it.
*
* @param storage the array to use as backend
* @param maxSize size of storage
* @param size size of data already present in storage
*/
ArrayList(T *storage, count_t maxSize, count_t size = 0) :
size(size), entries(storage), maxSize_(maxSize), allocated(false) {
}
/**
* Destructor, if the allocating constructor was used, it deletes the array.
@ -67,77 +67,81 @@ public:
}
}
/**
* An Iterator to go trough an ArrayList
*
* It stores a pointer to an element and increments the
* pointer when incremented itself.
*/
class Iterator {
public:
/**
* Empty ctor, points to NULL
*/
Iterator(): value(0) {}
/**
* An Iterator to go trough an ArrayList
*
* It stores a pointer to an element and increments the
* pointer when incremented itself.
*/
class Iterator {
public:
/**
* Empty ctor, points to NULL
*/
Iterator(): value(0) {}
/**
* Initializes the Iterator to point to an element
*
* @param initialize
*/
Iterator(T *initialize) {
value = initialize;
}
/**
* Initializes the Iterator to point to an element
*
* @param initialize
*/
Iterator(T *initialize) {
value = initialize;
}
/**
* The current element the iterator points to
*/
T *value;
/**
* The current element the iterator points to
*/
T *value;
Iterator& operator++() {
value++;
return *this;
}
Iterator& operator++() {
value++;
return *this;
}
Iterator operator++(int) {
Iterator tmp(*this);
operator++();
return tmp;
}
Iterator operator++(int) {
Iterator tmp(*this);
operator++();
return tmp;
}
Iterator& operator--() {
value--;
return *this;
}
Iterator& operator--() {
value--;
return *this;
}
Iterator operator--(int) {
Iterator tmp(*this);
operator--();
return tmp;
}
Iterator operator--(int) {
Iterator tmp(*this);
operator--();
return tmp;
}
T operator*() {
return *value;
}
T& operator*() {
return *value;
}
T *operator->() {
return value;
}
const T& operator*() const {
return *value;
}
const T *operator->() const{
return value;
}
T *operator->() {
return value;
}
//SHOULDDO this should be implemented as non-member
bool operator==(const typename ArrayList<T, count_t>::Iterator& other) const{
return (value == other.value);
}
const T *operator->() const {
return value;
}
};
//SHOULDDO this should be implemented as non-member
bool operator!=(const typename ArrayList<T, count_t>::Iterator& other) const {
return !(*this == other);
}
};
friend bool operator==(const ArrayList::Iterator& lhs,
const ArrayList::Iterator& rhs) {
return (lhs.value == rhs.value);
}
friend bool operator!=(const ArrayList::Iterator& lhs,
const ArrayList::Iterator& rhs) {
return not (lhs.value == rhs.value);
}
/**
* Iterator pointing to the first stored elmement
@ -192,7 +196,7 @@ public:
*
* @return maximum number of elements
*/
uint32_t maxSize() const {
size_t maxSize() const {
return this->maxSize_;
}
@ -236,7 +240,7 @@ protected:
/**
* remembering the maximum size
*/
uint32_t maxSize_;
size_t maxSize_;
/**
* true if the array was allocated and needs to be deleted in the destructor.
@ -244,4 +248,6 @@ protected:
bool allocated;
};
#endif /* ARRAYLIST_H_ */
#endif /* FSFW_CONTAINER_ARRAYLIST_H_ */

View File

@ -1,7 +1,7 @@
#ifndef FRAMEWORK_CONTAINER_DYNAMICFIFO_H_
#define FRAMEWORK_CONTAINER_DYNAMICFIFO_H_
#ifndef FSFW_CONTAINER_DYNAMICFIFO_H_
#define FSFW_CONTAINER_DYNAMICFIFO_H_
#include <framework/container/FIFOBase.h>
#include "FIFOBase.h"
#include <vector>
/**
@ -22,21 +22,34 @@ public:
// trying to pass the pointer of the uninitialized vector
// to the FIFOBase constructor directly lead to a super evil bug.
// So we do it like this now.
this->setData(fifoVector.data());
this->setContainer(fifoVector.data());
};
/**
* @brief Custom copy constructor which prevents setting the
* underlying pointer wrong.
* underlying pointer wrong. This function allocates memory!
* @details This is a very heavy operation so try to avoid this!
*
*/
DynamicFIFO(const DynamicFIFO& other): FIFOBase<T>(other),
fifoVector(other.maxCapacity) {
this->setData(fifoVector.data());
this->fifoVector = other.fifoVector;
this->setContainer(fifoVector.data());
}
/**
* @brief Custom assignment operator
* @details This is a very heavy operation so try to avoid this!
* @param other DyamicFIFO to copy from
*/
DynamicFIFO& operator=(const DynamicFIFO& other){
FIFOBase<T>::operator=(other);
this->fifoVector = other.fifoVector;
this->setContainer(fifoVector.data());
return *this;
}
private:
std::vector<T> fifoVector;
};
#endif /* FRAMEWORK_CONTAINER_DYNAMICFIFO_H_ */
#endif /* FSFW_CONTAINER_DYNAMICFIFO_H_ */

View File

@ -1,8 +1,7 @@
#ifndef FRAMEWORK_CONTAINER_FIFO_H_
#define FRAMEWORK_CONTAINER_FIFO_H_
#ifndef FSFW_CONTAINER_FIFO_H_
#define FSFW_CONTAINER_FIFO_H_
#include <framework/returnvalues/HasReturnvaluesIF.h>
#include <framework/container/FIFOBase.h>
#include "FIFOBase.h"
#include <array>
/**
@ -17,18 +16,32 @@
template<typename T, size_t capacity>
class FIFO: public FIFOBase<T> {
public:
FIFO(): FIFOBase<T>(fifoArray.data(), capacity) {};
FIFO(): FIFOBase<T>(nullptr, capacity) {
this->setContainer(fifoArray.data());
};
/**
* @brief Custom copy constructor to set pointer correctly.
* @param other
*/
FIFO(const FIFO& other): FIFOBase<T>(other) {
this->setData(fifoArray.data());
this->fifoArray = other.fifoArray;
this->setContainer(fifoArray.data());
}
/**
* @brief Custom assignment operator
* @param other
*/
FIFO& operator=(const FIFO& other){
FIFOBase<T>::operator=(other);
this->fifoArray = other.fifoArray;
this->setContainer(fifoArray.data());
return *this;
}
private:
std::array<T, capacity> fifoArray;
};
#endif /* FRAMEWORK_CONTAINERS_STATICFIFO_H_ */
#endif /* FSFW_CONTAINER_FIFO_H_ */

View File

@ -1,7 +1,7 @@
#ifndef FRAMEWORK_CONTAINER_FIFOBASE_H_
#define FRAMEWORK_CONTAINER_FIFOBASE_H_
#ifndef FSFW_CONTAINER_FIFOBASE_H_
#define FSFW_CONTAINER_FIFOBASE_H_
#include <framework/returnvalues/HasReturnvaluesIF.h>
#include "../returnvalues/HasReturnvaluesIF.h"
#include <cstddef>
#include <cstring>
@ -19,36 +19,50 @@ public:
/**
* Insert value into FIFO
* @param value
* @return
* @return RETURN_OK on success, FULL if full
*/
ReturnValue_t insert(T value);
/**
* Retrieve item from FIFO. This removes the item from the FIFO.
* @param value
* @return
* @param value Must point to a valid T
* @return RETURN_OK on success, EMPTY if empty and FAILED if nullptr check failed
*/
ReturnValue_t retrieve(T *value);
/**
* Retrieve item from FIFO without removing it from FIFO.
* @param value
* @return
* @param value Must point to a valid T
* @return RETURN_OK on success, EMPTY if empty and FAILED if nullptr check failed
*/
ReturnValue_t peek(T * value);
/**
* Remove item from FIFO.
* @return
* @return RETURN_OK on success, EMPTY if empty
*/
ReturnValue_t pop();
/***
* Check if FIFO is empty
* @return True if empty, False if not
*/
bool empty();
/***
* Check if FIFO is Full
* @return True if full, False if not
*/
bool full();
/***
* Current used size (elements) used
* @return size_t in elements
*/
size_t size();
/***
* Get maximal capacity of fifo
* @return size_t with max capacity of this fifo
*/
size_t getMaxCapacity() const;
protected:
void setData(T* data);
void setContainer(T* data);
size_t maxCapacity = 0;
T* values;
@ -60,6 +74,6 @@ protected:
size_t next(size_t current);
};
#include <framework/container/FIFOBase.tpp>
#include "FIFOBase.tpp"
#endif /* FRAMEWORK_CONTAINER_FIFOBASE_H_ */
#endif /* FSFW_CONTAINER_FIFOBASE_H_ */

View File

@ -1,7 +1,7 @@
#ifndef FRAMEWORK_CONTAINER_FIFOBASE_TPP_
#define FRAMEWORK_CONTAINER_FIFOBASE_TPP_
#ifndef FSFW_CONTAINER_FIFOBASE_TPP_
#define FSFW_CONTAINER_FIFOBASE_TPP_
#ifndef FRAMEWORK_CONTAINER_FIFOBASE_H_
#ifndef FSFW_CONTAINER_FIFOBASE_H_
#error Include FIFOBase.h before FIFOBase.tpp!
#endif
@ -26,6 +26,9 @@ inline ReturnValue_t FIFOBase<T>::retrieve(T* value) {
if (empty()) {
return EMPTY;
} else {
if (value == nullptr){
return HasReturnvaluesIF::RETURN_FAILED;
}
*value = values[readIndex];
readIndex = next(readIndex);
--currentSize;
@ -38,6 +41,9 @@ inline ReturnValue_t FIFOBase<T>::peek(T* value) {
if(empty()) {
return EMPTY;
} else {
if (value == nullptr){
return HasReturnvaluesIF::RETURN_FAILED;
}
*value = values[readIndex];
return HasReturnvaluesIF::RETURN_OK;
}
@ -80,7 +86,7 @@ inline size_t FIFOBase<T>::getMaxCapacity() const {
template<typename T>
inline void FIFOBase<T>::setData(T *data) {
inline void FIFOBase<T>::setContainer(T *data) {
this->values = data;
}

View File

@ -1,51 +1,32 @@
#ifndef FIXEDARRAYLIST_H_
#define FIXEDARRAYLIST_H_
#include <framework/container/ArrayList.h>
#include "ArrayList.h"
#include <cmath>
/**
* @brief Array List with a fixed maximum size
* @ingroup container
* \ingroup container
*/
template<typename T, uint32_t MAX_SIZE, typename count_t = uint8_t>
template<typename T, size_t MAX_SIZE, typename count_t = uint8_t>
class FixedArrayList: public ArrayList<T, count_t> {
static_assert(MAX_SIZE <= (pow(2,sizeof(count_t)*8)-1), "count_t is not large enough to hold MAX_SIZE");
private:
T data[MAX_SIZE];
public:
/**
* (Robin) Maybe we should also implement move assignment and move ctor.
* Or at least delete them.
*/
FixedArrayList() :
ArrayList<T, count_t>(data, MAX_SIZE) {
}
// (Robin): We could create a constructor to initialize the fixed array list
// with data and the known size field
// so it can be used for serialization too (with SerialFixedArrrayListAdapter)
// is this feasible?
/**
* Initialize a fixed array list with data and number of data fields.
* Endianness of entries can be swapped optionally.
* @param data_
* @param count
* @param swapArrayListEndianess
*/
FixedArrayList(T * data_, count_t count):
ArrayList<T, count_t>(data, MAX_SIZE) {
memcpy(this->data, data_, count * sizeof(T));
this->size = count;
}
FixedArrayList(const FixedArrayList& other) :
ArrayList<T, count_t>(data, MAX_SIZE) {
memcpy(this->data, other.data, sizeof(this->data));
this->entries = data;
this->size = other.size;
}
FixedArrayList& operator=(FixedArrayList other) {
memcpy(this->data, other.data, sizeof(this->data));
this->entries = data;
this->size = other.size;
return *this;
}

View File

@ -1,19 +1,27 @@
#ifndef FIXEDMAP_H_
#define FIXEDMAP_H_
#ifndef FSFW_CONTAINER_FIXEDMAP_H_
#define FSFW_CONTAINER_FIXEDMAP_H_
#include <framework/container/ArrayList.h>
#include <framework/returnvalues/HasReturnvaluesIF.h>
#include "ArrayList.h"
#include "../returnvalues/HasReturnvaluesIF.h"
#include <utility>
#include <type_traits>
/**
* @brief Map implementation for maps with a pre-defined size.
* @details Can be initialized with desired maximum size.
* Iterator is used to access <key,value> pair and
* iterate through map entries. Complexity O(n).
* @brief Map implementation for maps with a pre-defined size.
* @details
* Can be initialized with desired maximum size.
* Iterator is used to access <key,value> pair and iterate through map entries.
* Complexity O(n).
* @warning Iterators return a non-const key_t in the pair.
* @warning A User is not allowed to change the key, otherwise the map is corrupted.
* @ingroup container
*/
template<typename key_t, typename T>
class FixedMap: public SerializeIF {
static_assert (std::is_trivially_copyable<T>::value or
std::is_base_of<SerializeIF, T>::value,
"Types used in FixedMap must either be trivial copy-able or a "
"derived class from SerializeIF to be serialize-able");
public:
static const uint8_t INTERFACE_ID = CLASS_ID::FIXED_MAP;
static const ReturnValue_t KEY_ALREADY_EXISTS = MAKE_RETURN_CODE(0x01);
@ -51,28 +59,17 @@ public:
Iterator(std::pair<key_t, T> *pair) :
ArrayList<std::pair<key_t, T>, uint32_t>::Iterator(pair) {
}
T operator*() {
return ArrayList<std::pair<key_t, T>, uint32_t>::Iterator::value->second;
}
// -> operator overloaded, can be used to access value
T *operator->() {
return &ArrayList<std::pair<key_t, T>, uint32_t>::Iterator::value->second;
}
// Can be used to access the key of the iterator
key_t first() {
return ArrayList<std::pair<key_t, T>, uint32_t>::Iterator::value->first;
}
// Alternative to access value, similar to std::map implementation
T second() {
return ArrayList<std::pair<key_t, T>, uint32_t>::Iterator::value->second;
}
};
friend bool operator==(const typename FixedMap::Iterator& lhs,
const typename FixedMap::Iterator& rhs) {
return (lhs.value == rhs.value);
}
friend bool operator!=(const typename FixedMap::Iterator& lhs,
const typename FixedMap::Iterator& rhs) {
return not (lhs.value == rhs.value);
}
Iterator begin() const {
return Iterator(&theMap[0]);
@ -86,16 +83,16 @@ public:
return _size;
}
ReturnValue_t insert(key_t key, T value, Iterator *storedValue = NULL) {
ReturnValue_t insert(key_t key, T value, Iterator *storedValue = nullptr) {
if (exists(key) == HasReturnvaluesIF::RETURN_OK) {
return FixedMap::KEY_ALREADY_EXISTS;
return KEY_ALREADY_EXISTS;
}
if (_size == theMap.maxSize()) {
return FixedMap::MAP_FULL;
return MAP_FULL;
}
theMap[_size].first = key;
theMap[_size].second = value;
if (storedValue != NULL) {
if (storedValue != nullptr) {
*storedValue = Iterator(&theMap[_size]);
}
++_size;
@ -156,6 +153,24 @@ public:
return HasReturnvaluesIF::RETURN_OK;
}
bool empty() {
if(_size == 0) {
return true;
}
else {
return false;
}
}
bool full() {
if(_size >= theMap.maxSize()) {
return true;
}
else {
return false;
}
}
void clear() {
_size = 0;
}
@ -164,16 +179,6 @@ public:
return theMap.maxSize();
}
bool full() {
if(_size == theMap.maxSize()) {
return true;
}
else {
return false;
}
}
virtual ReturnValue_t serialize(uint8_t** buffer, size_t* size,
size_t maxSize, Endianness streamEndianness) const {
ReturnValue_t result = SerializeAdapter::serialize(&this->_size,
@ -222,4 +227,4 @@ public:
};
#endif /* FIXEDMAP_H_ */
#endif /* FSFW_CONTAINER_FIXEDMAP_H_ */

View File

@ -1,181 +1,206 @@
#ifndef FRAMEWORK_CONTAINER_FIXEDORDEREDMULTIMAP_H_
#define FRAMEWORK_CONTAINER_FIXEDORDEREDMULTIMAP_H_
#ifndef FSFW_CONTAINER_FIXEDORDEREDMULTIMAP_H_
#define FSFW_CONTAINER_FIXEDORDEREDMULTIMAP_H_
#include <framework/container/ArrayList.h>
#include "ArrayList.h"
#include <cstring>
#include <set>
/**
* @brief An associative container which allows multiple entries of the same key.
* @details
* Same keys are ordered by KEY_COMPARE function which is std::less<key_t> > by default.
*
* It uses the ArrayList, so technically this is not a real map, it is an array of pairs
* of type key_t, T. It is ordered by key_t as FixedMap but allows same keys. Thus it has a linear
* complexity O(n). As long as the number of entries remains low, this
* should not be an issue.
* The number of insertion and deletion operation should be minimized
* as those incur extensive memory move operations (the underlying container
* is not node based).
*
* Its of fixed size so no allocations are performed after the construction.
*
* The maximum size is given as first parameter of the constructor.
*
* It provides an iterator to do list iterations.
*
* The type T must have a copy constructor if it is not trivial copy-able.
*
* @warning Iterators return a non-const key_t in the pair.
* @warning A User is not allowed to change the key, otherwise the map is corrupted.
*
* \ingroup container
*/
template<typename key_t, typename T, typename KEY_COMPARE = std::less<key_t>>
class FixedOrderedMultimap {
public:
static const uint8_t INTERFACE_ID = CLASS_ID::FIXED_MULTIMAP;
static const ReturnValue_t KEY_ALREADY_EXISTS = MAKE_RETURN_CODE(0x01);
static const ReturnValue_t MAP_FULL = MAKE_RETURN_CODE(0x02);
static const ReturnValue_t KEY_DOES_NOT_EXIST = MAKE_RETURN_CODE(0x03);
static const ReturnValue_t MAP_FULL = MAKE_RETURN_CODE(0x01);
static const ReturnValue_t KEY_DOES_NOT_EXIST = MAKE_RETURN_CODE(0x02);
private:
typedef KEY_COMPARE compare;
compare myComp;
ArrayList<std::pair<key_t, T>, uint32_t> theMap;
uint32_t _size;
/***
* Constructor which needs a size_t for the maximum allowed size
*
* Can not be resized during runtime
*
* Allocates memory at construction
* @param maxSize size_t of Maximum allowed size
*/
FixedOrderedMultimap(size_t maxSize):theMap(maxSize), _size(0){
}
uint32_t findFirstIndex(key_t key, uint32_t startAt = 0) const {
if (startAt >= _size) {
return startAt + 1;
}
uint32_t i = startAt;
for (i = startAt; i < _size; ++i) {
if (theMap[i].first == key) {
return i;
}
}
return i;
}
uint32_t findNicePlace(key_t key) const {
uint32_t i = 0;
for (i = 0; i < _size; ++i) {
if (myComp(key, theMap[i].first)) {
return i;
}
}
return i;
}
void removeFromPosition(uint32_t position) {
if (_size <= position) {
return;
}
memmove(&theMap[position], &theMap[position + 1],
(_size - position - 1) * sizeof(std::pair<key_t,T>));
--_size;
}
public:
FixedOrderedMultimap(uint32_t maxSize) :
theMap(maxSize), _size(0) {
}
/***
* Virtual destructor frees Memory by deleting its member
*/
virtual ~FixedOrderedMultimap() {
}
class Iterator: public ArrayList<std::pair<key_t, T>, uint32_t>::Iterator {
/***
* Special iterator for FixedOrderedMultimap
*/
class Iterator: public ArrayList<std::pair<key_t, T>, size_t>::Iterator {
public:
Iterator() :
ArrayList<std::pair<key_t, T>, uint32_t>::Iterator() {
ArrayList<std::pair<key_t, T>, size_t>::Iterator() {
}
Iterator(std::pair<key_t, T> *pair) :
ArrayList<std::pair<key_t, T>, uint32_t>::Iterator(pair) {
ArrayList<std::pair<key_t, T>, size_t>::Iterator(pair) {
}
T operator*() {
return ArrayList<std::pair<key_t, T>, uint32_t>::Iterator::value->second;
}
T *operator->() {
return &ArrayList<std::pair<key_t, T>, uint32_t>::Iterator::value->second;
}
};
/***
* Returns an iterator pointing to the first element
* @return Iterator pointing to first element
*/
Iterator begin() const {
return Iterator(&theMap[0]);
}
/**
* Returns an iterator pointing to one element past the end
* @return Iterator pointing to one element past the end
*/
Iterator end() const {
return Iterator(&theMap[_size]);
}
uint32_t size() const {
/***
* Returns the current size of the map (not maximum size!)
* @return Current size
*/
size_t size() const{
return _size;
}
ReturnValue_t insert(key_t key, T value, Iterator *storedValue = NULL) {
if (_size == theMap.maxSize()) {
return MAP_FULL;
}
uint32_t position = findNicePlace(key);
memmove(&theMap[position + 1], &theMap[position],
(_size - position) * sizeof(std::pair<key_t,T>));
theMap[position].first = key;
theMap[position].second = value;
++_size;
if (storedValue != NULL) {
*storedValue = Iterator(&theMap[position]);
}
return HasReturnvaluesIF::RETURN_OK;
/**
* Clears the map, does not deallocate any memory
*/
void clear(){
_size = 0;
}
ReturnValue_t insert(std::pair<key_t, T> pair) {
return insert(pair.fist, pair.second);
/**
* Returns the maximum size of the map
* @return Maximum size of the map
*/
size_t maxSize() const{
return theMap.maxSize();
}
ReturnValue_t exists(key_t key) const {
ReturnValue_t result = KEY_DOES_NOT_EXIST;
if (findFirstIndex(key) < _size) {
result = HasReturnvaluesIF::RETURN_OK;
}
return result;
}
/***
* Used to insert a key and value separately.
*
* @param[in] key Key of the new element
* @param[in] value Value of the new element
* @param[in/out] (optional) storedValue On success this points to the new value, otherwise a nullptr
* @return RETURN_OK if insert was successful, MAP_FULL if no space is available
*/
ReturnValue_t insert(key_t key, T value, Iterator *storedValue = nullptr);
ReturnValue_t erase(Iterator *iter) {
uint32_t i;
if ((i = findFirstIndex((*iter).value->first)) >= _size) {
return KEY_DOES_NOT_EXIST;
}
removeFromPosition(i);
if (*iter != begin()) {
(*iter)--;
} else {
*iter = begin();
}
return HasReturnvaluesIF::RETURN_OK;
}
/***
* Used to insert new pair instead of single values
*
* @param pair Pair to be inserted
* @return RETURN_OK if insert was successful, MAP_FULL if no space is available
*/
ReturnValue_t insert(std::pair<key_t, T> pair);
ReturnValue_t erase(key_t key) {
uint32_t i;
if ((i = findFirstIndex(key)) >= _size) {
return KEY_DOES_NOT_EXIST;
}
do {
removeFromPosition(i);
i = findFirstIndex(key, i);
} while (i < _size);
return HasReturnvaluesIF::RETURN_OK;
}
/***
* Can be used to check if a certain key is in the map
* @param key Key to be checked
* @return RETURN_OK if the key exists KEY_DOES_NOT_EXIST otherwise
*/
ReturnValue_t exists(key_t key) const;
//This is potentially unsafe
// T *findValue(key_t key) const {
// return &theMap[findFirstIndex(key)].second;
// }
/***
* Used to delete the element in the iterator
*
* The iterator will point to the element before or begin(),
* but never to one element in front of the map.
*
* @warning The iterator needs to be valid and dereferenceable
* @param[in/out] iter Pointer to iterator to the element that needs to be ereased
* @return RETURN_OK if erased, KEY_DOES_NOT_EXIST if the there is no element like this
*/
ReturnValue_t erase(Iterator *iter);
/***
* Used to erase by key
* @param key Key to be erased
* @return RETURN_OK if erased, KEY_DOES_NOT_EXIST if the there is no element like this
*/
ReturnValue_t erase(key_t key);
Iterator find(key_t key) const {
/***
* Find returns the first appearance of the key
*
* If the key does not exist, it points to end()
*
* @param key Key to search for
* @return Iterator pointing to the first entry of key
*/
Iterator find(key_t key) const{
ReturnValue_t result = exists(key);
if (result != HasReturnvaluesIF::RETURN_OK) {
return end();
}
return Iterator(&theMap[findFirstIndex(key)]);
};
/***
* Finds first entry of the given key and returns a
* pointer to the value
*
* @param key Key to search for
* @param value Found value
* @return RETURN_OK if it points to the value,
* KEY_DOES_NOT_EXIST if the key is not in the map
*/
ReturnValue_t find(key_t key, T **value) const;
friend bool operator==(const typename FixedOrderedMultimap::Iterator& lhs,
const typename FixedOrderedMultimap::Iterator& rhs) {
return (lhs.value == rhs.value);
}
ReturnValue_t find(key_t key, T **value) const {
ReturnValue_t result = exists(key);
if (result != HasReturnvaluesIF::RETURN_OK) {
return result;
}
*value = &theMap[findFirstIndex(key)].second;
return HasReturnvaluesIF::RETURN_OK;
friend bool operator!=(const typename FixedOrderedMultimap::Iterator& lhs,
const typename FixedOrderedMultimap::Iterator& rhs) {
return not (lhs.value == rhs.value);
}
void clear() {
_size = 0;
}
private:
typedef KEY_COMPARE compare;
compare myComp;
ArrayList<std::pair<key_t, T>, size_t> theMap;
size_t _size;
uint32_t maxSize() const {
return theMap.maxSize();
}
size_t findFirstIndex(key_t key, size_t startAt = 0) const;
size_t findNicePlace(key_t key) const;
void removeFromPosition(size_t position);
};
#endif /* FRAMEWORK_CONTAINER_FIXEDORDEREDMULTIMAP_H_ */
#include "FixedOrderedMultimap.tpp"
#endif /* FSFW_CONTAINER_FIXEDORDEREDMULTIMAP_H_ */

View File

@ -0,0 +1,109 @@
#ifndef FRAMEWORK_CONTAINER_FIXEDORDEREDMULTIMAP_TPP_
#define FRAMEWORK_CONTAINER_FIXEDORDEREDMULTIMAP_TPP_
template<typename key_t, typename T, typename KEY_COMPARE>
inline ReturnValue_t FixedOrderedMultimap<key_t, T, KEY_COMPARE>::insert(key_t key, T value, Iterator *storedValue) {
if (_size == theMap.maxSize()) {
return MAP_FULL;
}
size_t position = findNicePlace(key);
memmove(static_cast<void*>(&theMap[position + 1]),static_cast<void*>(&theMap[position]),
(_size - position) * sizeof(std::pair<key_t,T>));
theMap[position].first = key;
theMap[position].second = value;
++_size;
if (storedValue != nullptr) {
*storedValue = Iterator(&theMap[position]);
}
return HasReturnvaluesIF::RETURN_OK;
}
template<typename key_t, typename T, typename KEY_COMPARE>
inline ReturnValue_t FixedOrderedMultimap<key_t, T, KEY_COMPARE>::insert(std::pair<key_t, T> pair) {
return insert(pair.first, pair.second);
}
template<typename key_t, typename T, typename KEY_COMPARE>
inline ReturnValue_t FixedOrderedMultimap<key_t, T, KEY_COMPARE>::exists(key_t key) const {
ReturnValue_t result = KEY_DOES_NOT_EXIST;
if (findFirstIndex(key) < _size) {
result = HasReturnvaluesIF::RETURN_OK;
}
return result;
}
template<typename key_t, typename T, typename KEY_COMPARE>
inline ReturnValue_t FixedOrderedMultimap<key_t, T, KEY_COMPARE>::erase(Iterator *iter) {
size_t i;
if ((i = findFirstIndex((*iter).value->first)) >= _size) {
return KEY_DOES_NOT_EXIST;
}
removeFromPosition(i);
if (*iter != begin()) {
(*iter)--;
} else {
*iter = begin();
}
return HasReturnvaluesIF::RETURN_OK;
}
template<typename key_t, typename T, typename KEY_COMPARE>
inline ReturnValue_t FixedOrderedMultimap<key_t, T, KEY_COMPARE>::erase(key_t key) {
size_t i;
if ((i = findFirstIndex(key)) >= _size) {
return KEY_DOES_NOT_EXIST;
}
do {
removeFromPosition(i);
i = findFirstIndex(key, i);
} while (i < _size);
return HasReturnvaluesIF::RETURN_OK;
}
template<typename key_t, typename T, typename KEY_COMPARE>
inline ReturnValue_t FixedOrderedMultimap<key_t, T, KEY_COMPARE>::find(key_t key, T **value) const {
ReturnValue_t result = exists(key);
if (result != HasReturnvaluesIF::RETURN_OK) {
return result;
}
*value = &theMap[findFirstIndex(key)].second;
return HasReturnvaluesIF::RETURN_OK;
}
template<typename key_t, typename T, typename KEY_COMPARE>
inline size_t FixedOrderedMultimap<key_t, T, KEY_COMPARE>::findFirstIndex(key_t key, size_t startAt) const {
if (startAt >= _size) {
return startAt + 1;
}
size_t i = startAt;
for (i = startAt; i < _size; ++i) {
if (theMap[i].first == key) {
return i;
}
}
return i;
}
template<typename key_t, typename T, typename KEY_COMPARE>
inline size_t FixedOrderedMultimap<key_t, T, KEY_COMPARE>::findNicePlace(key_t key) const {
size_t i = 0;
for (i = 0; i < _size; ++i) {
if (myComp(key, theMap[i].first)) {
return i;
}
}
return i;
}
template<typename key_t, typename T, typename KEY_COMPARE>
inline void FixedOrderedMultimap<key_t, T, KEY_COMPARE>::removeFromPosition(size_t position) {
if (_size <= position) {
return;
}
memmove(static_cast<void*>(&theMap[position]), static_cast<void*>(&theMap[position + 1]),
(_size - position - 1) * sizeof(std::pair<key_t,T>));
--_size;
}
#endif /* FRAMEWORK_CONTAINER_FIXEDORDEREDMULTIMAP_TPP_ */

View File

@ -1,8 +1,8 @@
#ifndef FRAMEWORK_CONTAINER_HYBRIDITERATOR_H_
#define FRAMEWORK_CONTAINER_HYBRIDITERATOR_H_
#include <framework/container/ArrayList.h>
#include <framework/container/SinglyLinkedList.h>
#include "ArrayList.h"
#include "SinglyLinkedList.h"
template<typename T, typename count_t = uint8_t>
class HybridIterator: public LinkedElement<T>::Iterator,

View File

@ -1,34 +1,27 @@
#ifndef FRAMEWORK_CONTAINER_INDEXEDRINGMEMORY_H_
#define FRAMEWORK_CONTAINER_INDEXEDRINGMEMORY_H_
#include <framework/container/ArrayList.h>
#include <framework/globalfunctions/CRC.h>
#include <framework/serviceinterface/ServiceInterfaceStream.h>
#include <framework/returnvalues/HasReturnvaluesIF.h>
#include <framework/serialize/SerialArrayListAdapter.h>
#include "ArrayList.h"
#include "../globalfunctions/CRC.h"
#include "../serviceinterface/ServiceInterfaceStream.h"
#include "../returnvalues/HasReturnvaluesIF.h"
#include "../serialize/SerialArrayListAdapter.h"
#include <cmath>
/**
* Index is the Type used for the list of indices.
*
* @tparam T Type which destribes the index. Needs to be a child of SerializeIF
* to be able to make it persistent
*/
template<typename T>
class Index: public SerializeIF{
/**
*
* Index is the Type used for the list of indices. The template parameter is the type which describes the index, it needs to be a child of SerializeIF to be able to make it persistent
*/
static_assert(std::is_base_of<SerializeIF,T>::value,
"Wrong Type for Index, Type must implement SerializeIF");
static_assert(std::is_base_of<SerializeIF,T>::value,"Wrong Type for Index, Type must implement SerializeIF");
public:
Index():blockStartAddress(0),size(0),storedPackets(0){}
Index(uint32_t startAddress):blockStartAddress(startAddress),
size(0),storedPackets(0) {
Index(uint32_t startAddress):blockStartAddress(startAddress),size(0),storedPackets(0){
}
void setBlockStartAddress(uint32_t newAddress) {
void setBlockStartAddress(uint32_t newAddress){
this->blockStartAddress = newAddress;
}
@ -40,7 +33,7 @@ public:
return &indexType;
}
T* modifyIndexType() {
T* modifyIndexType(){
return &indexType;
}
/**
@ -135,35 +128,26 @@ private:
};
/**
* @brief Indexed Ring Memory Array is a class for a ring memory with indices.
* @details
* It assumes that the newest data comes in last
* It uses the currentWriteBlock as pointer to the current writing position
* The currentReadBlock must be set manually
* @tparam T
*/
template<typename T>
class IndexedRingMemoryArray: public SerializeIF, public ArrayList<Index<T>, uint32_t>{
/**
*
* Indexed Ring Memory Array is a class for a ring memory with indices. It assumes that the newest data comes in last
* It uses the currentWriteBlock as pointer to the current writing position
* The currentReadBlock must be set manually
*/
public:
IndexedRingMemoryArray(uint32_t startAddress, uint32_t size, uint32_t bytesPerBlock,
SerializeIF* additionalInfo, bool overwriteOld):
ArrayList<Index<T>,uint32_t>(NULL,(uint32_t)10,(uint32_t)0),totalSize(size),
indexAddress(startAddress),currentReadSize(0),currentReadBlockSizeCached(0),
lastBlockToReadSize(0), additionalInfo(additionalInfo),overwriteOld(overwriteOld)
{
IndexedRingMemoryArray(uint32_t startAddress, uint32_t size, uint32_t bytesPerBlock, SerializeIF* additionalInfo,
bool overwriteOld) :ArrayList<Index<T>,uint32_t>(NULL,(uint32_t)10,(uint32_t)0),totalSize(size),indexAddress(startAddress),currentReadSize(0),currentReadBlockSizeCached(0),lastBlockToReadSize(0), additionalInfo(additionalInfo),overwriteOld(overwriteOld){
//Calculate the maximum number of indices needed for this blocksize
uint32_t maxNrOfIndices = floor(static_cast<double>(size)/static_cast<double>(bytesPerBlock));
//Calculate the Size needeed for the index itself
size_t serializedSize = 0;
if(additionalInfo!=NULL) {
uint32_t serializedSize = 0;
if(additionalInfo!=NULL){
serializedSize += additionalInfo->getSerializedSize();
}
//Size of current iterator type
Index<T> tempIndex;
serializedSize += tempIndex.getSerializedSize();
@ -178,7 +162,6 @@ public:
error << "IndexedRingMemory: Store is too small for index" << std::endl;
}
uint32_t useableSize = totalSize - serializedSize;
//Update the totalSize for calculations
totalSize = useableSize;
@ -195,10 +178,12 @@ public:
this->allocated = true;
//Check trueNumberOfBlocks
if(trueNumberOfBlocks<1) {
if(trueNumberOfBlocks<1){
error << "IndexedRingMemory: Invalid Number of Blocks: " << trueNumberOfBlocks;
}
//Fill address into index
uint32_t address = trueStartAddress;
for (typename IndexedRingMemoryArray<T>::Iterator it = this->begin();it!=this->end();++it) {
@ -208,6 +193,7 @@ public:
address += bytesPerBlock;
}
//Initialize iterators
currentWriteBlock = this->begin();
currentReadBlock = this->begin();
@ -246,10 +232,10 @@ public:
(*typeResetFnc)(it->modifyIndexType());
}
/**
/*
* Reading
* @param it
*/
void setCurrentReadBlock(typename IndexedRingMemoryArray<T>::Iterator it){
currentReadBlock = it;
currentReadBlockSizeCached = it->getSize();
@ -262,7 +248,6 @@ public:
lastBlockToRead = currentWriteBlock;
lastBlockToReadSize = currentWriteBlock->getSize();
}
/**
* Sets the last block to read to this iterator.
* Can be used to dump until block x
@ -307,39 +292,33 @@ public:
uint32_t getCurrentReadAddress() const {
return getAddressOfCurrentReadBlock() + currentReadSize;
}
/**
* Adds readSize to the current size and checks if the read has no more data
* left and advances the read block.
* Adds readSize to the current size and checks if the read has no more data left and advances the read block
* @param readSize The size that was read
* @return Returns true if the read can go on
*/
bool addReadSize(uint32_t readSize) {
if(currentReadBlock == lastBlockToRead) {
if(currentReadBlock == lastBlockToRead){
//The current read block is the last to read
if((currentReadSize+readSize)<lastBlockToReadSize) {
if((currentReadSize+readSize)<lastBlockToReadSize){
//the block has more data -> return true
currentReadSize += readSize;
return true;
}
else {
}else{
//Reached end of read -> return false
currentReadSize = lastBlockToReadSize;
return false;
}
}
else {
}else{
//We are not in the last Block
if((currentReadSize + readSize)<currentReadBlockSizeCached) {
if((currentReadSize + readSize)<currentReadBlockSizeCached){
//The current Block has more data
currentReadSize += readSize;
return true;
}
// TODO: Maybe some logic blocks should be extracted
else {
}else{
//The current block is written completely
readNext();
if(currentReadBlockSizeCached==0) {
if(currentReadBlockSizeCached==0){
//Next block is empty
typename IndexedRingMemoryArray<T>::Iterator it(currentReadBlock);
//Search if any block between this and the last block is not empty
@ -442,13 +421,13 @@ public:
T* modifyCurrentWriteBlockIndexType(){
return currentWriteBlock->modifyIndexType();
}
void updatePreviousWriteSize(uint32_t size, uint32_t storedPackets){
typename IndexedRingMemoryArray<T>::Iterator it = getPreviousBlock(currentWriteBlock);
it->addSize(size);
it->addStoredPackets(storedPackets);
}
/**
* Checks if the block has enough space for sizeToWrite
* @param sizeToWrite The data to be written in the Block
@ -457,10 +436,7 @@ public:
bool hasCurrentWriteBlockEnoughSpace(uint32_t sizeToWrite){
typename IndexedRingMemoryArray<T>::Iterator next = getNextWrite();
uint32_t addressOfNextBlock = next->getBlockStartAddress();
uint32_t availableSize =
( ( addressOfNextBlock + totalSize ) -
(getAddressOfCurrentWriteBlock() + getSizeOfCurrentWriteBlock()))
% totalSize;
uint32_t availableSize = ((addressOfNextBlock+totalSize) - (getAddressOfCurrentWriteBlock()+getSizeOfCurrentWriteBlock()))%totalSize;
return (sizeToWrite < availableSize);
}
@ -550,7 +526,7 @@ public:
*/
size_t getSerializedSize() const {
size_t size = 0;
uint32_t size = 0;
if(additionalInfo!=NULL){
size += additionalInfo->getSerializedSize();
}
@ -718,4 +694,7 @@ private:
};
#endif /* FRAMEWORK_CONTAINER_INDEXEDRINGMEMORY_H_ */

View File

@ -1,50 +0,0 @@
#ifndef ISDERIVEDFROM_H_
#define ISDERIVEDFROM_H_
/**
* These template type checks are based on SFINAE
* (https://en.cppreference.com/w/cpp/language/sfinae)
*
* @tparam D Derived Type
* @tparam B Base Type
*/
template<typename D, typename B>
class IsDerivedFrom {
class No {
};
class Yes {
No no[3];
};
// This will be chosen if B is the base type
static Yes Test(B*); // declared, but not defined
// This will be chosen for anything else
static No Test(... ); // declared, but not defined
public:
enum {
Is = sizeof(Test(static_cast<D*>(0))) == sizeof(Yes)
};
};
template<typename, typename>
struct is_same {
static bool const value = false;
};
template<typename A>
struct is_same<A, A> {
static bool const value = true;
};
template<bool C, typename T = void>
struct enable_if {
typedef T type;
};
template<typename T>
struct enable_if<false, T> { };
#endif /* ISDERIVEDFROM_H_ */

View File

@ -1,28 +1,64 @@
#ifndef FRAMEWORK_CONTAINER_PLACEMENTFACTORY_H_
#define FRAMEWORK_CONTAINER_PLACEMENTFACTORY_H_
#include <framework/storagemanager/StorageManagerIF.h>
#include "../storagemanager/StorageManagerIF.h"
#include <utility>
/**
* The Placement Factory is used to create objects at runtime in a specific pool.
* In general, this should be avoided and it should only be used if you know what you are doing.
* You are not allowed to use this container with a type that allocates memory internally like ArrayList.
*
* Also, you have to check the returned pointer in generate against nullptr!
*
* A backend of Type StorageManagerIF must be given as a place to store the new objects.
* Therefore ThreadSafety is only provided by your StorageManager Implementation.
*
* Objects must be destroyed by the user with "destroy"! Otherwise the pool will not be cleared.
*
* The concept is based on the placement new operator.
*
* @warning Do not use with any Type that allocates memory internally!
* @ingroup container
*/
class PlacementFactory {
public:
PlacementFactory(StorageManagerIF* backend) :
dataBackend(backend) {
}
/***
* Generates an object of type T in the backend storage.
*
* @warning Do not use with any Type that allocates memory internally!
*
* @tparam T Type of Object
* @param args Constructor Arguments to be passed
* @return A pointer to the new object or a nullptr in case of failure
*/
template<typename T, typename ... Args>
T* generate(Args&&... args) {
store_address_t tempId;
uint8_t* pData = NULL;
uint8_t* pData = nullptr;
ReturnValue_t result = dataBackend->getFreeElement(&tempId, sizeof(T),
&pData);
if (result != HasReturnvaluesIF::RETURN_OK) {
return NULL;
return nullptr;
}
T* temp = new (pData) T(std::forward<Args>(args)...);
return temp;
}
/***
* Function to destroy the object allocated with generate and free space in backend.
* This must be called by the user.
*
* @param thisElement Element to be destroyed
* @return RETURN_OK if the element was destroyed, different errors on failure
*/
template<typename T>
ReturnValue_t destroy(T* thisElement) {
if (thisElement == nullptr){
return HasReturnvaluesIF::RETURN_FAILED;
}
//Need to call destructor first, in case something was allocated by the object (shouldn't do that, however).
thisElement->~T();
uint8_t* pointer = (uint8_t*) (thisElement);

View File

@ -1,7 +1,7 @@
#ifndef FRAMEWORK_CONTAINER_RINGBUFFERBASE_H_
#define FRAMEWORK_CONTAINER_RINGBUFFERBASE_H_
#ifndef FSFW_CONTAINER_RINGBUFFERBASE_H_
#define FSFW_CONTAINER_RINGBUFFERBASE_H_
#include <framework/returnvalues/HasReturnvaluesIF.h>
#include "../returnvalues/HasReturnvaluesIF.h"
#include <cstddef>
template<uint8_t N_READ_PTRS = 1>
@ -21,10 +21,10 @@ public:
return (availableWriteSpace(n) == 0);
}
bool isEmpty(uint8_t n = 0) {
return (availableReadData(n) == 0);
return (getAvailableReadData(n) == 0);
}
size_t availableReadData(uint8_t n = 0) const {
size_t getAvailableReadData(uint8_t n = 0) const {
return ((write + size) - read[n]) % size;
}
size_t availableWriteSpace(uint8_t n = 0) const {
@ -36,7 +36,7 @@ public:
return overwriteOld;
}
size_t maxSize() const {
size_t getMaxSize() const {
return size - 1;
}
@ -65,6 +65,7 @@ protected:
size_t read[N_READ_PTRS];
const size_t size;
const bool overwriteOld;
void incrementWrite(uint32_t amount) {
write = ((write + amount - start) % size) + start;
}
@ -73,7 +74,7 @@ protected:
}
ReturnValue_t readData(uint32_t amount, uint8_t n = 0) {
if (availableReadData(n) >= amount) {
if (getAvailableReadData(n) >= amount) {
incrementRead(amount, n);
return HasReturnvaluesIF::RETURN_OK;
} else {
@ -90,7 +91,6 @@ protected:
}
}
size_t getRead(uint8_t n = 0) const {
return read[n];
}
@ -110,4 +110,4 @@ protected:
}
};
#endif /* FRAMEWORK_CONTAINER_RINGBUFFERBASE_H_ */
#endif /* FSFW_CONTAINER_RINGBUFFERBASE_H_ */

View File

@ -1,79 +0,0 @@
#include <iostream>
#include "SimpleRingBuffer.h"
int main() {
using namespace std;
SimpleRingBuffer buffer(64, false);
uint8_t data[8] = {'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h'};
ReturnValue_t result = buffer.writeData(data, 8);
if (result != HasReturnvaluesIF::RETURN_OK) {
cout << "writeData failed." << endl;
}
result = buffer.writeData(data, 8);
if (result != HasReturnvaluesIF::RETURN_OK) {
cout << "writeData failed." << endl;
}
uint8_t buffer2[47] = {0};
for (uint8_t count = 0; count<sizeof(buffer2); count++) {
buffer2[count] = count;
}
result = buffer.writeData(buffer2, sizeof(buffer2));
if (result != HasReturnvaluesIF::RETURN_OK) {
cout << "writeData failed." << endl;
}
result = buffer.writeData(buffer2, sizeof(buffer2));
if (result != HasReturnvaluesIF::RETURN_OK) {
cout << "writeData failed." << endl;
}
uint8_t readBuffer[64] = {0};
uint32_t writtenData = 0;
result = buffer.readData(readBuffer, 12, true, &writtenData);
if (result != HasReturnvaluesIF::RETURN_OK) {
cout << "readData failed." << endl;
} else {
cout << "Read data: " << writtenData << endl;
for (uint32_t count = 0; count < writtenData; count++) {
cout << hex << (uint16_t)readBuffer[count] << " ";
}
cout << dec << endl;
}
result = buffer.readData(readBuffer, 60, true, &writtenData);
if (result != HasReturnvaluesIF::RETURN_OK) {
cout << "readData failed." << endl;
} else {
cout << "Read data: " << writtenData << endl;
for (uint32_t count = 0; count < writtenData; count++) {
cout << hex << (uint16_t)readBuffer[count] << " ";
}
cout << dec << endl;
}
result = buffer.writeData(data, sizeof(data));
if (result != HasReturnvaluesIF::RETURN_OK) {
cout << "writeData failed." << endl;
}
result = buffer.readData(readBuffer, 60, true, &writtenData);
if (result != HasReturnvaluesIF::RETURN_OK) {
cout << "readData failed." << endl;
} else {
cout << "Read data: " << writtenData << endl;
for (uint32_t count = 0; count < writtenData; count++) {
cout << hex << (uint16_t)readBuffer[count] << " ";
}
cout << dec << endl;
}
result = buffer.writeData(readBuffer, sizeof(readBuffer));
if (result != HasReturnvaluesIF::RETURN_OK) {
cout << "writeData failed." << endl;
}
result = buffer.writeData(readBuffer, sizeof(readBuffer)-1);
if (result != HasReturnvaluesIF::RETURN_OK) {
cout << "writeData failed." << endl;
} else {
cout << "write done." << endl;
}
}

View File

@ -1,59 +1,55 @@
#include <framework/container/SharedRingBuffer.h>
#include <framework/ipc/MutexFactory.h>
#include <framework/ipc/MutexHelper.h>
#include "SharedRingBuffer.h"
#include "../ipc/MutexFactory.h"
#include "../ipc/MutexHelper.h"
SharedRingBuffer::SharedRingBuffer(object_id_t objectId, const size_t size,
bool overwriteOld, size_t maxExcessBytes, dur_millis_t mutexTimeout):
bool overwriteOld, size_t maxExcessBytes):
SystemObject(objectId), SimpleRingBuffer(size, overwriteOld,
maxExcessBytes), mutexTimeout(mutexTimeout) {
maxExcessBytes) {
mutex = MutexFactory::instance()->createMutex();
}
SharedRingBuffer::SharedRingBuffer(object_id_t objectId, uint8_t *buffer,
const size_t size, bool overwriteOld, size_t maxExcessBytes,
dur_millis_t mutexTimeout):
const size_t size, bool overwriteOld, size_t maxExcessBytes):
SystemObject(objectId), SimpleRingBuffer(buffer, size, overwriteOld,
maxExcessBytes), mutexTimeout(mutexTimeout) {
maxExcessBytes) {
mutex = MutexFactory::instance()->createMutex();
}
ReturnValue_t SharedRingBuffer::getFreeElementProtected(uint8_t** writePtr,
size_t amount) {
MutexHelper(mutex, mutexTimeout);
return SimpleRingBuffer::getFreeElement(writePtr,amount);
void SharedRingBuffer::setToUseReceiveSizeFIFO(size_t fifoDepth) {
this->fifoDepth = fifoDepth;
}
ReturnValue_t SharedRingBuffer::writeDataProtected(const uint8_t *data,
size_t amount) {
MutexHelper(mutex, mutexTimeout);
return SimpleRingBuffer::writeData(data,amount);
ReturnValue_t SharedRingBuffer::lockRingBufferMutex(
MutexIF::TimeoutType timeoutType, dur_millis_t timeout) {
return mutex->lockMutex(timeoutType, timeout);
}
ReturnValue_t SharedRingBuffer::readDataProtected(uint8_t *data, size_t amount,
bool incrementReadPtr, bool readRemaining,
size_t *trueAmount) {
MutexHelper(mutex, mutexTimeout);
return SimpleRingBuffer::readData(data,amount, incrementReadPtr,
readRemaining, trueAmount);
ReturnValue_t SharedRingBuffer::unlockRingBufferMutex() {
return mutex->unlockMutex();
}
ReturnValue_t SharedRingBuffer::deleteDataProtected(size_t amount,
bool deleteRemaining, size_t *trueAmount) {
MutexHelper(mutex, mutexTimeout);
return SimpleRingBuffer::deleteData(amount, deleteRemaining, trueAmount);
MutexIF* SharedRingBuffer::getMutexHandle() const {
return mutex;
}
size_t SharedRingBuffer::getExcessBytes() const {
MutexHelper(mutex, mutexTimeout);
return SimpleRingBuffer::getExcessBytes();
ReturnValue_t SharedRingBuffer::initialize() {
if(fifoDepth > 0) {
receiveSizesFIFO = new DynamicFIFO<size_t>(fifoDepth);
}
return SystemObject::initialize();
}
void SharedRingBuffer::moveExcessBytesToStart() {
MutexHelper(mutex, mutexTimeout);
return SimpleRingBuffer::moveExcessBytesToStart();
}
size_t SharedRingBuffer::getAvailableReadDataProtected(uint8_t n) const {
MutexHelper(mutex, mutexTimeout);
return ((write + size) - read[n]) % size;
DynamicFIFO<size_t>* SharedRingBuffer::getReceiveSizesFIFO() {
if(receiveSizesFIFO == nullptr) {
// Configuration error.
sif::warning << "SharedRingBuffer::getReceiveSizesFIFO: Ring buffer"
<< " was not configured to have sizes FIFO, returning nullptr!"
<< std::endl;
}
return receiveSizesFIFO;
}

View File

@ -1,11 +1,19 @@
#ifndef FRAMEWORK_CONTAINER_SHAREDRINGBUFFER_H_
#define FRAMEWORK_CONTAINER_SHAREDRINGBUFFER_H_
#ifndef FSFW_CONTAINER_SHAREDRINGBUFFER_H_
#define FSFW_CONTAINER_SHAREDRINGBUFFER_H_
#include <framework/container/SimpleRingBuffer.h>
#include <framework/ipc/MutexIF.h>
#include <framework/objectmanager/SystemObject.h>
#include <framework/timemanager/Clock.h>
#include "SimpleRingBuffer.h"
#include "DynamicFIFO.h"
#include "../ipc/MutexIF.h"
#include "../objectmanager/SystemObject.h"
#include "../timemanager/Clock.h"
/**
* @brief Ring buffer which can be shared among multiple objects
* @details
* This class offers a mutex to perform thread-safe operation on the ring
* buffer. It is still up to the developer to actually perform the lock
* and unlock operations.
*/
class SharedRingBuffer: public SystemObject,
public SimpleRingBuffer {
public:
@ -17,8 +25,17 @@ public:
* will be overwritten.
*/
SharedRingBuffer(object_id_t objectId, const size_t size,
bool overwriteOld, size_t maxExcessBytes,
dur_millis_t mutexTimeout = 10);
bool overwriteOld, size_t maxExcessBytes);
/**
* @brief This function can be used to add an optional FIFO to the class
* @details
* This FIFO will be allocated in the initialize function (and will
* have a fixed maximum size after that). It can be used to store
* values like packet sizes, for example for a shared ring buffer
* used by producer/consumer tasks.
*/
void setToUseReceiveSizeFIFO(size_t fifoDepth);
/**
* This constructor takes an external buffer with the specified size.
@ -29,40 +46,47 @@ public:
* will be overwritten.
*/
SharedRingBuffer(object_id_t objectId, uint8_t* buffer, const size_t size,
bool overwriteOld, size_t maxExcessBytes,
dur_millis_t mutexTimeout = 10);
bool overwriteOld, size_t maxExcessBytes);
void setMutexTimeout(dur_millis_t newTimeout);
virtual size_t getExcessBytes() const override;
/**
* Helper functions which moves any excess bytes to the start
* of the ring buffer.
* Unless a read-only constant value is read, all operations on the
* shared ring buffer should be protected by calling this function.
* @param timeoutType
* @param timeout
* @return
*/
virtual void moveExcessBytesToStart() override;
virtual ReturnValue_t lockRingBufferMutex(MutexIF::TimeoutType timeoutType,
dur_millis_t timeout);
/**
* Any locked mutex also has to be unlocked, otherwise, access to the
* shared ring buffer will be blocked.
* @return
*/
virtual ReturnValue_t unlockRingBufferMutex();
/** Performs mutex protected SimpleRingBuffer::getFreeElement call */
ReturnValue_t getFreeElementProtected(uint8_t** writePtr, size_t amount);
/**
* The mutex handle can be accessed directly, for example to perform
* the lock with the #MutexHelper for a RAII compliant lock operation.
* @return
*/
MutexIF* getMutexHandle() const;
/** Performs mutex protected SimpleRingBuffer::writeData call */
ReturnValue_t writeDataProtected(const uint8_t* data, size_t amount);
ReturnValue_t initialize() override;
/** Performs mutex protected SimpleRingBuffer::readData call */
ReturnValue_t readDataProtected(uint8_t *data, size_t amount,
bool incrementReadPtr = false,
bool readRemaining = false, size_t *trueAmount = nullptr);
/** Performs mutex protected SimpleRingBuffer::deleteData call */
ReturnValue_t deleteDataProtected(size_t amount,
bool deleteRemaining = false, size_t* trueAmount = nullptr);
size_t getAvailableReadDataProtected (uint8_t n = 0) const;
/**
* If the shared ring buffer was configured to have a sizes FIFO, a handle
* to that FIFO can be retrieved with this function.
* Do not forget to protect access with a lock if required!
* @return
*/
DynamicFIFO<size_t>* getReceiveSizesFIFO();
private:
dur_millis_t mutexTimeout;
MutexIF* mutex = nullptr;
size_t fifoDepth = 0;
DynamicFIFO<size_t>* receiveSizesFIFO = nullptr;
};
#endif /* FRAMEWORK_CONTAINER_SHAREDRINGBUFFER_H_ */
#endif /* FSFW_CONTAINER_SHAREDRINGBUFFER_H_ */

View File

@ -1,4 +1,4 @@
#include <framework/container/SimpleRingBuffer.h>
#include "SimpleRingBuffer.h"
#include <cstring>
SimpleRingBuffer::SimpleRingBuffer(const size_t size, bool overwriteOld,
@ -25,12 +25,10 @@ SimpleRingBuffer::SimpleRingBuffer(uint8_t *buffer, const size_t size,
}
}
SimpleRingBuffer::~SimpleRingBuffer() {
delete[] buffer;
}
ReturnValue_t SimpleRingBuffer::getFreeElement(uint8_t **writePointer,
size_t amount) {
if (availableWriteSpace() >= amount or overwriteOld) {
@ -42,7 +40,6 @@ ReturnValue_t SimpleRingBuffer::getFreeElement(uint8_t **writePointer,
excessBytes = amount - amountTillWrap;
}
*writePointer = &buffer[write];
incrementWrite(amount);
return HasReturnvaluesIF::RETURN_OK;
}
else {
@ -50,6 +47,14 @@ ReturnValue_t SimpleRingBuffer::getFreeElement(uint8_t **writePointer,
}
}
void SimpleRingBuffer::confirmBytesWritten(size_t amount) {
if(getExcessBytes() > 0) {
moveExcessBytesToStart();
}
incrementWrite(amount);
}
ReturnValue_t SimpleRingBuffer::writeData(const uint8_t* data,
size_t amount) {
if (availableWriteSpace() >= amount or overwriteOld) {
@ -71,7 +76,7 @@ ReturnValue_t SimpleRingBuffer::writeData(const uint8_t* data,
ReturnValue_t SimpleRingBuffer::readData(uint8_t* data, size_t amount,
bool incrementReadPtr, bool readRemaining, size_t* trueAmount) {
size_t availableData = availableReadData(READ_PTR);
size_t availableData = getAvailableReadData(READ_PTR);
size_t amountTillWrap = readTillWrap(READ_PTR);
if (availableData < amount) {
if (readRemaining) {
@ -110,7 +115,7 @@ void SimpleRingBuffer::moveExcessBytesToStart() {
ReturnValue_t SimpleRingBuffer::deleteData(size_t amount,
bool deleteRemaining, size_t* trueAmount) {
size_t availableData = availableReadData(READ_PTR);
size_t availableData = getAvailableReadData(READ_PTR);
if (availableData < amount) {
if (deleteRemaining) {
amount = availableData;
@ -124,4 +129,3 @@ ReturnValue_t SimpleRingBuffer::deleteData(size_t amount,
incrementRead(amount, READ_PTR);
return HasReturnvaluesIF::RETURN_OK;
}

View File

@ -1,7 +1,7 @@
#ifndef FRAMEWORK_CONTAINER_SIMPLERINGBUFFER_H_
#define FRAMEWORK_CONTAINER_SIMPLERINGBUFFER_H_
#ifndef FSFW_CONTAINER_SIMPLERINGBUFFER_H_
#define FSFW_CONTAINER_SIMPLERINGBUFFER_H_
#include <framework/container/RingBufferBase.h>
#include "RingBufferBase.h"
#include <cstddef>
/**
@ -56,7 +56,8 @@ public:
/**
* Returns a pointer to a free element. If the remaining buffer is
* not large enough, the data will be written past the actual size
* and the amount of excess bytes will be cached.
* and the amount of excess bytes will be cached. This function
* does not increment the write pointer!
* @param writePointer Pointer to a pointer which can be used to write
* contiguous blocks into the ring buffer
* @param amount
@ -64,6 +65,14 @@ public:
*/
ReturnValue_t getFreeElement(uint8_t** writePointer, size_t amount);
/**
* This increments the write pointer and also copies the excess bytes
* to the beginning. It should be called if the write operation
* conducted after calling getFreeElement() was performed.
* @return
*/
void confirmBytesWritten(size_t amount);
virtual size_t getExcessBytes() const;
/**
* Helper functions which moves any excess bytes to the start
@ -108,6 +117,7 @@ public:
*/
ReturnValue_t deleteData(size_t amount, bool deleteRemaining = false,
size_t* trueAmount = nullptr);
private:
static const uint8_t READ_PTR = 0;
uint8_t* buffer = nullptr;
@ -115,5 +125,5 @@ private:
size_t excessBytes = 0;
};
#endif /* FRAMEWORK_CONTAINER_SIMPLERINGBUFFER_H_ */
#endif /* FSFW_CONTAINER_SIMPLERINGBUFFER_H_ */

View File

@ -100,7 +100,7 @@ public:
*/
ElementIterator back() const {
LinkedElement<T> *element = start;
while (element != nullptr) {
while (element->getNext() != nullptr) {
element = element->getNext();
}
return ElementIterator::Iterator(element);

View File

@ -4,9 +4,11 @@
/**
* @defgroup container Container
*
* General Purpose Containers to store various elements.
* As opposed to the STL library implementation, these implementations
* don't allocate memory dynamically.
* General Purpose Container to store various elements.
*
* Also contains Adapter classes to print elements to a
* bytestream and to read them from a bytestream, as well
* as an Adapter to swap the endianness.
*/

View File

@ -1,365 +0,0 @@
#include "FixedArrayList.h"
#include "SinglyLinkedList.h"
#include "HybridIterator.h"
#include "FixedMap.h"
#include <stdio.h>
/*
class Packet: public SinglyLinkedList {
public:
SinglyLinkedList::Element<uint32_t> element1;
SinglyLinkedList::Element<uint32_t> element2;
Packet() {
this->start = &element1;
element1.next = &element2;
}
};
class Packet2: public SinglyLinkedList {
public:
SinglyLinkedList::Element<uint32_t> element1;
SinglyLinkedList::Element<FixedArrayList<FixedArrayList<uint8_t, 5>, 2>> element2;
SinglyLinkedList::Element<uint32_t> element3;
Packet2() {
this->start = &element1;
element1.next = &element2;
element2.next = &element3;
}
};
class Packet3: public SinglyLinkedList {
public:
SinglyLinkedList::TypedElement<uint32_t> element1;
SinglyLinkedList::TypedElement<uint32_t> element2;
Packet3() {
this->start = &element1;
element1.next = &element2;
}
};
void arrayList() {
puts("** Array List **");
FixedArrayList<uint32_t, 10, uint32_t> list;
FixedArrayList<uint32_t, 10, uint32_t> list2;
list.size = 2;
list[0] = 0xcafecafe;
list[1] = 0x12345678;
uint8_t buffer[100];
uint8_t *pointer = buffer;
uint32_t size = 0;
uint32_t maxSize = 100;
uint32_t i;
int32_t size2;
printf("printsize: %i\n", list.getPrintSize());
list.print(&pointer, &size, 100, true);
printf("buffer(%i):", size);
for (i = 0; i < size; ++i) {
printf("%02x", buffer[i]);
}
printf("\n");
pointer = buffer;
size2 = size;
printf("list2 read: %x\n", list2.read(&pointer, &size2, true));
printf("list2(%i):", list2.size);
for (ArrayList<uint32_t, uint32_t>::Iterator iter = list2.begin();
iter != list2.end(); iter++) {
printf("0x%04x ", *iter);
}
printf("\n");
HybridIterator<uint32_t, uint32_t> hiter(list.begin(),list.end());
printf("hybrid1: 0x%04x\n", *(hiter++));
printf("hybrid2: 0x%04x\n", *hiter);
}
void allocatingList() {
puts("** Allocating List **");
ArrayList<uint8_t> myList(3), myList2(2);
myList[0] = 0xab;
myList[1] = 0xcd;
myList.size = 2;
uint8_t buffer[100];
uint8_t *pointer = buffer;
uint32_t size = 0;
uint32_t maxSize = 100;
uint32_t i;
int32_t size2;
myList.print(&pointer, &size, 100, true);
pointer = buffer;
size2 = size;
printf("Read %x\n", myList2.read(&pointer, &size2, true));
printf("%x,%x\n", myList2[0], myList2[1]);
}
void linkedList() {
puts("** Linked List **");
uint8_t buffer[100];
uint8_t *pointer = buffer;
uint32_t size = 0;
uint32_t maxSize = 100;
uint32_t i;
int32_t size2;
Packet myPacket;
myPacket.element1.entry = 0x12345678;
myPacket.element2.entry = 0x9abcdef0;
pointer = buffer;
size = 0;
ReturnValue_t result = myPacket.print(&pointer, &size, 100, true);
printf("result %02x\n", result);
printf("printsize: %i\n", myPacket.getPrintSize());
printf("buffer(%i):", size);
for (i = 0; i < size; ++i) {
printf("%02x", buffer[i]);
}
printf("\n");
Packet3 myPacket3;
myPacket3.element1.entry = 0x12345678;
myPacket3.element2.entry = 0xabcdeff;
SinglyLinkedList::TypedIterator<uint32_t> titer(&myPacket3.element1);
printf("0x%04x\n", *titer);
HybridIterator<uint32_t, uint32_t> hiter(&myPacket3.element1);
printf("hybrid1: 0x%04x\n", *hiter);
hiter++;
printf("hybrid2: 0x%04x\n", *hiter);
}
void complex() {
puts("** complex **");
uint8_t buffer[100];
uint8_t *pointer = buffer;
uint32_t size = 0;
uint32_t maxSize = 100;
uint32_t i;
int32_t size2 = size;
Packet myPacket2;
size2 = size;
pointer = buffer;
myPacket2.read(&pointer, &size2, true);
printf("packet: 0x%04x, 0x%04x\n", myPacket2.element1.entry,
myPacket2.element2.entry);
buffer[0] = 0x12;
buffer[1] = 0x34;
buffer[2] = 0x56;
buffer[3] = 0x78;
buffer[4] = 0x2;
buffer[5] = 0x3;
buffer[6] = 0xab;
buffer[7] = 0xcd;
buffer[8] = 0xef;
buffer[9] = 0x2;
buffer[10] = 0x11;
buffer[11] = 0x22;
buffer[12] = 0xca;
buffer[13] = 0xfe;
buffer[14] = 0x5a;
buffer[15] = 0xfe;
pointer = buffer;
size2 = 23;
Packet2 p2;
ReturnValue_t result = p2.read(&pointer, &size2, true);
printf("result is %02x\n", result);
printf("%04x; %i: %i: %x %x %x; %i: %x %x;; %04x\n", p2.element1.entry,
p2.element2.entry.size, p2.element2.entry[0].size,
p2.element2.entry[0][0], p2.element2.entry[0][1],
p2.element2.entry[0][2], p2.element2.entry[1].size,
p2.element2.entry[1][0], p2.element2.entry[1][1],
p2.element3.entry);
}
*/
struct Test {
uint32_t a;
uint32_t b;
};
template<typename key_t, typename T>
void printMap(FixedMap<key_t, T> *map) {
typename FixedMap<key_t, T>::Iterator iter;
printf("Map (%i): ", map->getSize());
for (iter = map->begin(); iter != map->end(); ++iter) {
printf("%x:%08x,%08x ", iter.value->first, (*iter).a, (*iter).b);
}
printf("\n");
}
template<typename T>
void map() {
puts("** Map **");
typename FixedMap<T, Test>::Iterator iter;
ReturnValue_t result;
FixedMap<T, Test> myMap(5);
printMap<T, Test>(&myMap);
Test a;
a.a = 0x01234567;
a.b = 0xabcdef89;
myMap.insert(1, a);
printMap<T, Test>(&myMap);
a.a = 0;
myMap.insert(2, a);
printMap<T, Test>(&myMap);
printf("2 exists: %x\n", myMap.exists(0x02));
printf("ff exists: %x\n", myMap.exists(0xff));
a.a = 1;
printf("insert 0x2: %x\n", myMap.insert(2, a));
result = myMap.insert(0xff, a);
a.a = 0x44;
result = myMap.insert(0xab, a);
result = myMap.insert(0xa, a);
printMap<T, Test>(&myMap);
printf("insert 0x5: %x\n", myMap.insert(5, a));
printf("erase 0xfe: %x\n", myMap.erase(0xfe));
printf("erase 0x2: %x\n", myMap.erase(0x2));
printMap<T, Test>(&myMap);
printf("erase 0xab: %x\n", myMap.erase(0xab));
printMap<T, Test>(&myMap);
printf("insert 0x5: %x\n", myMap.insert(5, a));
printMap<T, Test>(&myMap);
iter = myMap.begin();
++iter;
++iter;
++iter;
printf("iter: %i: %x,%x\n",iter.value->first, iter->a, iter->b);
myMap.erase(&iter);
printf("iter: %i: %x,%x\n",iter.value->first, iter->a, iter->b);
printMap<T, Test>(&myMap);
}
/*
void mapPrint() {
puts("** Map Print **");
FixedMap<uint16_t, Packet2> myMap(5);
Packet2 myPacket;
myPacket.element1.entry = 0x12345678;
myPacket.element2.entry[0][0] = 0xab;
myPacket.element2.entry[0][1] = 0xcd;
myPacket.element2.entry[0].size = 2;
myPacket.element2.entry.size = 1;
myPacket.element3.entry = 0xabcdef90;
myMap.insert(0x1234, myPacket);
uint8_t buffer[100];
uint32_t size = 0, i;
uint8_t *pointer = buffer;
printf("printsize: %i\n", myMap.getPrintSize());
SerializeAdapter<FixedMap<uint16_t, Packet2>>::print(&myMap, &pointer,
&size, 100, false);
printf("buffer(%i):", size);
for (i = 0; i < size; ++i) {
printf("%02x", buffer[i]);
}
printf("\n");
int32_t size2 = size;
pointer = buffer;
FixedMap<uint16_t, Packet2> myMap2(5);
ReturnValue_t result = SerializeAdapter<FixedMap<uint16_t, Packet2>>::read(
&myMap2, &pointer, &size2, false);
Packet2 *myPacket2 = myMap2.find(0x1234);
printf("Map (%i): Packet2: %x, Array (%i): Array (%i): %x, %x; %x\n",
myMap2.getSize(), myPacket2->element1.entry,
myPacket2->element2.entry.size, myPacket2->element2.entry[0].size,
myPacket2->element2.entry[0][0], myPacket2->element2.entry[0][1],
myPacket2->element3.entry);
}
void empty() {
puts("** Empty **");
ArrayList<uint32_t> list(0);
printf("%p %p\n", list.front(), list.back());
}
*/
int main(void) {
// arrayList();
// linkedList();
// allocatingList();
// complex();
map<uint32_t>();
//
// mapPrint();
// empty();
return 0;
}

File diff suppressed because it is too large Load Diff

View File

@ -1,117 +1,117 @@
#ifndef _sgp4unit_
#define _sgp4unit_
/* ----------------------------------------------------------------
*
* sgp4unit.h
*
* this file contains the sgp4 procedures for analytical propagation
* of a satellite. the code was originally released in the 1980 and 1986
* spacetrack papers. a detailed discussion of the theory and history
* may be found in the 2006 aiaa paper by vallado, crawford, hujsak,
* and kelso.
*
* companion code for
* fundamentals of astrodynamics and applications
* 2007
* by david vallado
*
* (w) 719-573-2600, email dvallado@agi.com
*
* current :
* 20 apr 07 david vallado
* misc fixes for constants
* changes :
* 11 aug 06 david vallado
* chg lyddane choice back to strn3, constants, misc doc
* 15 dec 05 david vallado
* misc fixes
* 26 jul 05 david vallado
* fixes for paper
* note that each fix is preceded by a
* comment with "sgp4fix" and an explanation of
* what was changed
* 10 aug 04 david vallado
* 2nd printing baseline working
* 14 may 01 david vallado
* 2nd edition baseline
* 80 norad
* original baseline
* ---------------------------------------------------------------- */
#include <math.h>
#include <stdio.h>
// -------------------------- structure declarations ----------------------------
typedef enum
{
wgs72old,
wgs72,
wgs84
} gravconsttype;
typedef struct elsetrec
{
long int satnum;
int epochyr, epochtynumrev;
int error;
char init, method;
/* Near Earth */
int isimp;
double aycof , con41 , cc1 , cc4 , cc5 , d2 , d3 , d4 ,
delmo , eta , argpdot, omgcof , sinmao , t , t2cof, t3cof ,
t4cof , t5cof , x1mth2 , x7thm1 , mdot , nodedot, xlcof , xmcof ,
nodecf;
/* Deep Space */
int irez;
double d2201 , d2211 , d3210 , d3222 , d4410 , d4422 , d5220 , d5232 ,
d5421 , d5433 , dedt , del1 , del2 , del3 , didt , dmdt ,
dnodt , domdt , e3 , ee2 , peo , pgho , pho , pinco ,
plo , se2 , se3 , sgh2 , sgh3 , sgh4 , sh2 , sh3 ,
si2 , si3 , sl2 , sl3 , sl4 , gsto , xfact , xgh2 ,
xgh3 , xgh4 , xh2 , xh3 , xi2 , xi3 , xl2 , xl3 ,
xl4 , xlamo , zmol , zmos , atime , xli , xni;
double a , altp , alta , epochdays, jdsatepoch , nddot , ndot ,
bstar , rcse , inclo , nodeo , ecco , argpo , mo ,
no;
} elsetrec;
// --------------------------- function declarations ----------------------------
int sgp4init
(
gravconsttype whichconst, const int satn, const double epoch,
const double xbstar, const double xecco, const double xargpo,
const double xinclo, const double xmo, const double xno,
const double xnodeo,
elsetrec& satrec
);
int sgp4
(
gravconsttype whichconst,
elsetrec& satrec, double tsince,
double r[], double v[]
);
double gstime
(
double
);
void getgravconst
(
gravconsttype,
double&,
double&,
double&,
double&,
double&,
double&,
double&,
double&
);
#endif
#ifndef _sgp4unit_
#define _sgp4unit_
/* ----------------------------------------------------------------
*
* sgp4unit.h
*
* this file contains the sgp4 procedures for analytical propagation
* of a satellite. the code was originally released in the 1980 and 1986
* spacetrack papers. a detailed discussion of the theory and history
* may be found in the 2006 aiaa paper by vallado, crawford, hujsak,
* and kelso.
*
* companion code for
* fundamentals of astrodynamics and applications
* 2007
* by david vallado
*
* (w) 719-573-2600, email dvallado@agi.com
*
* current :
* 20 apr 07 david vallado
* misc fixes for constants
* changes :
* 11 aug 06 david vallado
* chg lyddane choice back to strn3, constants, misc doc
* 15 dec 05 david vallado
* misc fixes
* 26 jul 05 david vallado
* fixes for paper
* note that each fix is preceded by a
* comment with "sgp4fix" and an explanation of
* what was changed
* 10 aug 04 david vallado
* 2nd printing baseline working
* 14 may 01 david vallado
* 2nd edition baseline
* 80 norad
* original baseline
* ---------------------------------------------------------------- */
#include <math.h>
#include <stdio.h>
// -------------------------- structure declarations ----------------------------
typedef enum
{
wgs72old,
wgs72,
wgs84
} gravconsttype;
typedef struct elsetrec
{
long int satnum;
int epochyr, epochtynumrev;
int error;
char init, method;
/* Near Earth */
int isimp;
double aycof , con41 , cc1 , cc4 , cc5 , d2 , d3 , d4 ,
delmo , eta , argpdot, omgcof , sinmao , t , t2cof, t3cof ,
t4cof , t5cof , x1mth2 , x7thm1 , mdot , nodedot, xlcof , xmcof ,
nodecf;
/* Deep Space */
int irez;
double d2201 , d2211 , d3210 , d3222 , d4410 , d4422 , d5220 , d5232 ,
d5421 , d5433 , dedt , del1 , del2 , del3 , didt , dmdt ,
dnodt , domdt , e3 , ee2 , peo , pgho , pho , pinco ,
plo , se2 , se3 , sgh2 , sgh3 , sgh4 , sh2 , sh3 ,
si2 , si3 , sl2 , sl3 , sl4 , gsto , xfact , xgh2 ,
xgh3 , xgh4 , xh2 , xh3 , xi2 , xi3 , xl2 , xl3 ,
xl4 , xlamo , zmol , zmos , atime , xli , xni;
double a , altp , alta , epochdays, jdsatepoch , nddot , ndot ,
bstar , rcse , inclo , nodeo , ecco , argpo , mo ,
no;
} elsetrec;
// --------------------------- function declarations ----------------------------
int sgp4init
(
gravconsttype whichconst, const int satn, const double epoch,
const double xbstar, const double xecco, const double xargpo,
const double xinclo, const double xmo, const double xno,
const double xnodeo,
elsetrec& satrec
);
int sgp4
(
gravconsttype whichconst,
elsetrec& satrec, double tsince,
double r[], double v[]
);
double gstime
(
double
);
void getgravconst
(
gravconsttype,
double&,
double&,
double&,
double&,
double&,
double&,
double&,
double&
);
#endif

View File

@ -1,8 +1,8 @@
#include <framework/subsystem/SubsystemBase.h>
#include <framework/controller/ControllerBase.h>
#include <framework/subsystem/SubsystemBase.h>
#include <framework/ipc/QueueFactory.h>
#include <framework/action/HasActionsIF.h>
#include "../subsystem/SubsystemBase.h"
#include "ControllerBase.h"
#include "../subsystem/SubsystemBase.h"
#include "../ipc/QueueFactory.h"
#include "../action/HasActionsIF.h"
ControllerBase::ControllerBase(uint32_t setObjectId, uint32_t parentId,
size_t commandQueueDepth) :
@ -56,26 +56,26 @@ MessageQueueId_t ControllerBase::getCommandQueue() const {
}
void ControllerBase::handleQueue() {
CommandMessage command;
CommandMessage message;
ReturnValue_t result;
for (result = commandQueue->receiveMessage(&command); result == RETURN_OK;
result = commandQueue->receiveMessage(&command)) {
for (result = commandQueue->receiveMessage(&message); result == RETURN_OK;
result = commandQueue->receiveMessage(&message)) {
result = modeHelper.handleModeCommand(&command);
result = modeHelper.handleModeCommand(&message);
if (result == RETURN_OK) {
continue;
}
result = healthHelper.handleHealthCommand(&command);
result = healthHelper.handleHealthCommand(&message);
if (result == RETURN_OK) {
continue;
}
result = handleCommandMessage(&command);
result = handleCommandMessage(&message);
if (result == RETURN_OK) {
continue;
}
command.setToUnknownCommand();
commandQueue->reply(&command);
message.setToUnknownCommand();
commandQueue->reply(&message);
}
}

View File

@ -1,13 +1,13 @@
#ifndef CONTROLLERBASE_H_
#define CONTROLLERBASE_H_
#include <framework/health/HasHealthIF.h>
#include <framework/health/HealthHelper.h>
#include <framework/modes/HasModesIF.h>
#include <framework/modes/ModeHelper.h>
#include <framework/objectmanager/SystemObject.h>
#include <framework/tasks/ExecutableObjectIF.h>
#include <framework/datapool/HkSwitchHelper.h>
#include "../health/HasHealthIF.h"
#include "../health/HealthHelper.h"
#include "../modes/HasModesIF.h"
#include "../modes/ModeHelper.h"
#include "../objectmanager/SystemObject.h"
#include "../tasks/ExecutableObjectIF.h"
#include "../datapool/HkSwitchHelper.h"
class ControllerBase: public HasModesIF,

View File

@ -1,7 +1,7 @@
#include <framework/coordinates/CoordinateTransformations.h>
#include <framework/globalfunctions/constants.h>
#include <framework/globalfunctions/math/MatrixOperations.h>
#include <framework/globalfunctions/math/VectorOperations.h>
#include "CoordinateTransformations.h"
#include "../globalfunctions/constants.h"
#include "../globalfunctions/math/MatrixOperations.h"
#include "../globalfunctions/math/VectorOperations.h"
#include <stddef.h>
#include <cmath>

View File

@ -1,7 +1,7 @@
#ifndef COORDINATETRANSFORMATIONS_H_
#define COORDINATETRANSFORMATIONS_H_
#include <framework/timemanager/Clock.h>
#include "../timemanager/Clock.h"
#include <cstring>
class CoordinateTransformations {

View File

@ -2,10 +2,10 @@
#define FRAMEWORK_COORDINATES_JGM3MODEL_H_
#include <stdint.h>
#include <framework/coordinates/CoordinateTransformations.h>
#include <framework/globalfunctions/math/VectorOperations.h>
#include <framework/globalfunctions/timevalOperations.h>
#include <framework/globalfunctions/constants.h>
#include "CoordinateTransformations.h"
#include "../globalfunctions/math/VectorOperations.h"
#include "../globalfunctions/timevalOperations.h"
#include "../globalfunctions/constants.h"
#include <memory.h>

View File

@ -1,9 +1,9 @@
#include <framework/coordinates/CoordinateTransformations.h>
#include <framework/coordinates/Sgp4Propagator.h>
#include <framework/globalfunctions/constants.h>
#include <framework/globalfunctions/math/MatrixOperations.h>
#include <framework/globalfunctions/math/VectorOperations.h>
#include <framework/globalfunctions/timevalOperations.h>
#include "CoordinateTransformations.h"
#include "Sgp4Propagator.h"
#include "../globalfunctions/constants.h"
#include "../globalfunctions/math/MatrixOperations.h"
#include "../globalfunctions/math/VectorOperations.h"
#include "../globalfunctions/timevalOperations.h"
#include <cstring>
Sgp4Propagator::Sgp4Propagator() :
initialized(false), epoch({0, 0}), whichconst(wgs84) {

View File

@ -3,7 +3,7 @@
#include <sys/time.h>
#include "../contrib/sgp4/sgp4unit.h"
#include <framework/returnvalues/HasReturnvaluesIF.h>
#include "../returnvalues/HasReturnvaluesIF.h"
class Sgp4Propagator {
public:

View File

@ -8,7 +8,7 @@
#ifndef BCFRAME_H_
#define BCFRAME_H_
#include <framework/datalinklayer/CCSDSReturnValuesIF.h>
#include "CCSDSReturnValuesIF.h"
/**
* Small helper class to identify a BcFrame.

View File

@ -8,7 +8,7 @@
#ifndef CCSDSRETURNVALUESIF_H_
#define CCSDSRETURNVALUESIF_H_
#include <framework/returnvalues/HasReturnvaluesIF.h>
#include "../returnvalues/HasReturnvaluesIF.h"
/**
* This is a helper class to collect special return values that come up during CCSDS Handling.
* @ingroup ccsds_handling

View File

@ -7,8 +7,8 @@
#include <framework/datalinklayer/Clcw.h>
#include <framework/serviceinterface/ServiceInterfaceStream.h>
#include "Clcw.h"
#include "../serviceinterface/ServiceInterfaceStream.h"
Clcw::Clcw() {
content.raw = 0;

View File

@ -8,7 +8,7 @@
#ifndef CLCW_H_
#define CLCW_H_
#include <framework/datalinklayer/ClcwIF.h>
#include "ClcwIF.h"
/**
* Small helper method to handle the Clcw values.
* It has a content struct that manages the register and can be set externally.

View File

@ -1,6 +1,6 @@
#include <framework/datalinklayer/DataLinkLayer.h>
#include <framework/globalfunctions/CRC.h>
#include <framework/serviceinterface/ServiceInterfaceStream.h>
#include "DataLinkLayer.h"
#include "../globalfunctions/CRC.h"
#include "../serviceinterface/ServiceInterfaceStream.h"
DataLinkLayer::DataLinkLayer(uint8_t* set_frame_buffer, ClcwIF* setClcw,
uint8_t set_start_sequence_length, uint16_t set_scid) :

View File

@ -1,11 +1,11 @@
#ifndef DATALINKLAYER_H_
#define DATALINKLAYER_H_
#include <framework/datalinklayer/CCSDSReturnValuesIF.h>
#include <framework/datalinklayer/ClcwIF.h>
#include <framework/datalinklayer/TcTransferFrame.h>
#include <framework/datalinklayer/VirtualChannelReceptionIF.h>
#include <framework/events/Event.h>
#include "CCSDSReturnValuesIF.h"
#include "ClcwIF.h"
#include "TcTransferFrame.h"
#include "VirtualChannelReceptionIF.h"
#include "../events/Event.h"
#include <map>

View File

@ -8,7 +8,7 @@
#ifndef FARM1STATEIF_H_
#define FARM1STATEIF_H_
#include <framework/datalinklayer/CCSDSReturnValuesIF.h>
#include "CCSDSReturnValuesIF.h"
class VirtualChannelReception;
class TcTransferFrame;
class ClcwIF;

View File

@ -7,10 +7,10 @@
#include <framework/datalinklayer/ClcwIF.h>
#include <framework/datalinklayer/Farm1StateLockout.h>
#include <framework/datalinklayer/TcTransferFrame.h>
#include <framework/datalinklayer/VirtualChannelReception.h>
#include "ClcwIF.h"
#include "Farm1StateLockout.h"
#include "TcTransferFrame.h"
#include "VirtualChannelReception.h"
Farm1StateLockout::Farm1StateLockout(VirtualChannelReception* setMyVC) : myVC(setMyVC) {
}

View File

@ -8,7 +8,7 @@
#ifndef FARM1STATELOCKOUT_H_
#define FARM1STATELOCKOUT_H_
#include <framework/datalinklayer/Farm1StateIF.h>
#include "Farm1StateIF.h"
/**
* This class represents the FARM-1 "Lockout" State.

View File

@ -8,10 +8,10 @@
#include <framework/datalinklayer/ClcwIF.h>
#include <framework/datalinklayer/Farm1StateOpen.h>
#include <framework/datalinklayer/TcTransferFrame.h>
#include <framework/datalinklayer/VirtualChannelReception.h>
#include "ClcwIF.h"
#include "Farm1StateOpen.h"
#include "TcTransferFrame.h"
#include "VirtualChannelReception.h"
Farm1StateOpen::Farm1StateOpen(VirtualChannelReception* setMyVC) : myVC(setMyVC) {
}

View File

@ -8,7 +8,7 @@
#ifndef FARM1STATEOPEN_H_
#define FARM1STATEOPEN_H_
#include <framework/datalinklayer/Farm1StateIF.h>
#include "Farm1StateIF.h"
/**
* This class represents the FARM-1 "Open" State.

View File

@ -6,10 +6,10 @@
*/
#include <framework/datalinklayer/ClcwIF.h>
#include <framework/datalinklayer/Farm1StateWait.h>
#include <framework/datalinklayer/TcTransferFrame.h>
#include <framework/datalinklayer/VirtualChannelReception.h>
#include "ClcwIF.h"
#include "Farm1StateWait.h"
#include "TcTransferFrame.h"
#include "VirtualChannelReception.h"
Farm1StateWait::Farm1StateWait(VirtualChannelReception* setMyVC) : myVC(setMyVC) {
}

View File

@ -8,7 +8,7 @@
#ifndef FARM1STATEWAIT_H_
#define FARM1STATEWAIT_H_
#include <framework/datalinklayer/Farm1StateIF.h>
#include "Farm1StateIF.h"
/**
* This class represents the FARM-1 "Wait" State.

View File

@ -5,20 +5,20 @@
* @author baetz
*/
#include <framework/datalinklayer/MapPacketExtraction.h>
#include <framework/ipc/QueueFactory.h>
#include <framework/serviceinterface/ServiceInterfaceStream.h>
#include <framework/storagemanager/StorageManagerIF.h>
#include <framework/tmtcpacket/SpacePacketBase.h>
#include <framework/tmtcservices/AcceptsTelecommandsIF.h>
#include <framework/tmtcservices/TmTcMessage.h>
#include "MapPacketExtraction.h"
#include "../ipc/QueueFactory.h"
#include "../serviceinterface/ServiceInterfaceStream.h"
#include "../storagemanager/StorageManagerIF.h"
#include "../tmtcpacket/SpacePacketBase.h"
#include "../tmtcservices/AcceptsTelecommandsIF.h"
#include "../tmtcservices/TmTcMessage.h"
#include <string.h>
MapPacketExtraction::MapPacketExtraction(uint8_t setMapId,
object_id_t setPacketDestination) :
lastSegmentationFlag(NO_SEGMENTATION), mapId(setMapId), packetLength(0),
bufferPosition(packetBuffer), packetDestination(setPacketDestination),
packetStore(nullptr), tcQueueId(MessageQueueMessageIF::NO_QUEUE) {
lastSegmentationFlag(NO_SEGMENTATION), mapId(setMapId), packetLength(0), bufferPosition(
packetBuffer), packetDestination(setPacketDestination), packetStore(
NULL), tcQueueId(MessageQueueIF::NO_QUEUE) {
memset(packetBuffer, 0, sizeof(packetBuffer));
}

View File

@ -8,10 +8,10 @@
#ifndef MAPPACKETEXTRACTION_H_
#define MAPPACKETEXTRACTION_H_
#include <framework/datalinklayer/MapPacketExtractionIF.h>
#include <framework/objectmanager/ObjectManagerIF.h>
#include <framework/returnvalues/HasReturnvaluesIF.h>
#include <framework/ipc/MessageQueueSenderIF.h>
#include "MapPacketExtractionIF.h"
#include "../objectmanager/ObjectManagerIF.h"
#include "../returnvalues/HasReturnvaluesIF.h"
#include "../ipc/MessageQueueSenderIF.h"
class StorageManagerIF;

View File

@ -8,8 +8,8 @@
#ifndef MAPPACKETEXTRACTIONIF_H_
#define MAPPACKETEXTRACTIONIF_H_
#include <framework/datalinklayer/CCSDSReturnValuesIF.h>
#include <framework/datalinklayer/TcTransferFrame.h>
#include "CCSDSReturnValuesIF.h"
#include "TcTransferFrame.h"
/**
* This is the interface for MAP Packet Extraction classes.

View File

@ -7,8 +7,8 @@
#include <framework/datalinklayer/TcTransferFrame.h>
#include <framework/serviceinterface/ServiceInterfaceStream.h>
#include "TcTransferFrame.h"
#include "../serviceinterface/ServiceInterfaceStream.h"
TcTransferFrame::TcTransferFrame() {
frame = NULL;

View File

@ -5,9 +5,9 @@
* @author baetz
*/
#include <framework/datalinklayer/TcTransferFrameLocal.h>
#include <framework/globalfunctions/CRC.h>
#include <framework/serviceinterface/ServiceInterfaceStream.h>
#include "TcTransferFrameLocal.h"
#include "../globalfunctions/CRC.h"
#include "../serviceinterface/ServiceInterfaceStream.h"
#include <string.h>
TcTransferFrameLocal::TcTransferFrameLocal(bool bypass, bool controlCommand, uint16_t scid,

View File

@ -8,7 +8,7 @@
#ifndef TCTRANSFERFRAMELOCAL_H_
#define TCTRANSFERFRAMELOCAL_H_
#include <framework/datalinklayer/TcTransferFrame.h>
#include "TcTransferFrame.h"
/**
* This is a helper class to locally create TC Transfer Frames.

View File

@ -5,9 +5,9 @@
* @author baetz
*/
#include <framework/datalinklayer/BCFrame.h>
#include <framework/datalinklayer/VirtualChannelReception.h>
#include <framework/serviceinterface/ServiceInterfaceStream.h>
#include "BCFrame.h"
#include "VirtualChannelReception.h"
#include "../serviceinterface/ServiceInterfaceStream.h"
VirtualChannelReception::VirtualChannelReception(uint8_t setChannelId,
uint8_t setSlidingWindowWidth) :

View File

@ -8,14 +8,14 @@
#ifndef VIRTUALCHANNELRECEPTION_H_
#define VIRTUALCHANNELRECEPTION_H_
#include <framework/datalinklayer/CCSDSReturnValuesIF.h>
#include <framework/datalinklayer/Clcw.h>
#include <framework/datalinklayer/Farm1StateIF.h>
#include <framework/datalinklayer/Farm1StateLockout.h>
#include <framework/datalinklayer/Farm1StateOpen.h>
#include <framework/datalinklayer/Farm1StateWait.h>
#include <framework/datalinklayer/MapPacketExtractionIF.h>
#include <framework/datalinklayer/VirtualChannelReceptionIF.h>
#include "CCSDSReturnValuesIF.h"
#include "Clcw.h"
#include "Farm1StateIF.h"
#include "Farm1StateLockout.h"
#include "Farm1StateOpen.h"
#include "Farm1StateWait.h"
#include "MapPacketExtractionIF.h"
#include "VirtualChannelReceptionIF.h"
#include <map>
/**
* Implementation of a TC Virtual Channel.

View File

@ -8,9 +8,9 @@
#ifndef VIRTUALCHANNELRECEPTIONIF_H_
#define VIRTUALCHANNELRECEPTIONIF_H_
#include <framework/datalinklayer/ClcwIF.h>
#include <framework/datalinklayer/TcTransferFrame.h>
#include <framework/returnvalues/HasReturnvaluesIF.h>
#include "ClcwIF.h"
#include "TcTransferFrame.h"
#include "../returnvalues/HasReturnvaluesIF.h"
/**
* This is the interface for Virtual Channel reception classes.

View File

@ -1,4 +1,4 @@
#include <framework/datapool/ControllerSet.h>
#include "ControllerSet.h"
ControllerSet::ControllerSet() {

View File

@ -1,9 +1,9 @@
#ifndef CONTROLLERSET_H_
#define CONTROLLERSET_H_
#include <framework/datapoolglob/GlobalDataSet.h>
#include "DataSet.h"
class ControllerSet :public GlobDataSet {
class ControllerSet :public DataSet {
public:
ControllerSet();
virtual ~ControllerSet();

131
datapool/DataPool.cpp Normal file
View File

@ -0,0 +1,131 @@
#include "DataPool.h"
#include "../serviceinterface/ServiceInterfaceStream.h"
#include "../ipc/MutexFactory.h"
DataPool::DataPool( void ( *initFunction )( std::map<uint32_t, PoolEntryIF*>* pool_map ) ) {
mutex = MutexFactory::instance()->createMutex();
if (initFunction != NULL ) {
initFunction( &this->data_pool );
}
}
DataPool::~DataPool() {
MutexFactory::instance()->deleteMutex(mutex);
for ( std::map<uint32_t, PoolEntryIF*>::iterator it = this->data_pool.begin(); it != this->data_pool.end(); ++it ) {
delete it->second;
}
}
//The function checks PID, type and array length before returning a copy of the PoolEntry. In failure case, it returns a temp-Entry with size 0 and NULL-ptr.
template <typename T> PoolEntry<T>* DataPool::getData( uint32_t data_pool_id, uint8_t sizeOrPosition ) {
std::map<uint32_t, PoolEntryIF*>::iterator it = this->data_pool.find( data_pool_id );
if ( it != this->data_pool.end() ) {
PoolEntry<T>* entry = dynamic_cast< PoolEntry<T>* >( it->second );
if (entry != NULL ) {
if ( sizeOrPosition <= entry->length ) {
return entry;
}
}
}
return NULL;
}
PoolEntryIF* DataPool::getRawData( uint32_t data_pool_id ) {
std::map<uint32_t, PoolEntryIF*>::iterator it = this->data_pool.find( data_pool_id );
if ( it != this->data_pool.end() ) {
return it->second;
} else {
return NULL;
}
}
//uint8_t DataPool::getRawData( uint32_t data_pool_id, uint8_t* address, uint16_t* size, uint32_t maxSize ) {
// std::map<uint32_t, PoolEntryIF*>::iterator it = this->data_pool.find( data_pool_id );
// if ( it != this->data_pool.end() ) {
// if ( it->second->getByteSize() <= maxSize ) {
// *size = it->second->getByteSize();
// memcpy( address, it->second->getRawData(), *size );
// return DP_SUCCESSFUL;
// }
// }
// *size = 0;
// return DP_FAILURE;
//}
ReturnValue_t DataPool::freeDataPoolLock() {
ReturnValue_t status = mutex->unlockMutex();
if ( status != RETURN_OK ) {
sif::error << "DataPool::DataPool: unlock of mutex failed with error code: " << status << std::endl;
}
return status;
}
ReturnValue_t DataPool::lockDataPool() {
ReturnValue_t status = mutex->lockMutex(MutexIF::BLOCKING);
if ( status != RETURN_OK ) {
sif::error << "DataPool::DataPool: lock of mutex failed with error code: " << status << std::endl;
}
return status;
}
void DataPool::print() {
sif::debug << "DataPool contains: " << std::endl;
std::map<uint32_t, PoolEntryIF*>::iterator dataPoolIt;
dataPoolIt = this->data_pool.begin();
while( dataPoolIt != this->data_pool.end() ) {
sif::debug << std::hex << dataPoolIt->first << std::dec << " |";
dataPoolIt->second->print();
dataPoolIt++;
}
}
template PoolEntry<uint8_t>* DataPool::getData<uint8_t>( uint32_t data_pool_id, uint8_t size );
template PoolEntry<uint16_t>* DataPool::getData<uint16_t>( uint32_t data_pool_id, uint8_t size );
template PoolEntry<uint32_t>* DataPool::getData<uint32_t>( uint32_t data_pool_id, uint8_t size );
template PoolEntry<uint64_t>* DataPool::getData<uint64_t>(uint32_t data_pool_id,
uint8_t size);
template PoolEntry<int8_t>* DataPool::getData<int8_t>( uint32_t data_pool_id, uint8_t size );
template PoolEntry<int16_t>* DataPool::getData<int16_t>( uint32_t data_pool_id, uint8_t size );
template PoolEntry<int32_t>* DataPool::getData<int32_t>( uint32_t data_pool_id, uint8_t size );
template PoolEntry<float>* DataPool::getData<float>( uint32_t data_pool_id, uint8_t size );
template PoolEntry<double>* DataPool::getData<double>(uint32_t data_pool_id,
uint8_t size);
uint32_t DataPool::PIDToDataPoolId(uint32_t parameter_id) {
return (parameter_id >> 8) & 0x00FFFFFF;
}
uint8_t DataPool::PIDToArrayIndex(uint32_t parameter_id) {
return (parameter_id & 0x000000FF);
}
uint32_t DataPool::poolIdAndPositionToPid(uint32_t poolId, uint8_t index) {
return (poolId << 8) + index;
}
//SHOULDDO: Do we need a mutex lock here... I don't think so, as we only check static const values of elements in a list that do not change.
//there is no guarantee in the standard, but it seems to me that the implementation is safe -UM
ReturnValue_t DataPool::getType(uint32_t parameter_id, Type* type) {
std::map<uint32_t, PoolEntryIF*>::iterator it = this->data_pool.find( PIDToDataPoolId(parameter_id));
if ( it != this->data_pool.end() ) {
*type = it->second->getType();
return RETURN_OK;
} else {
*type = Type::UNKNOWN_TYPE;
return RETURN_FAILED;
}
}
bool DataPool::exists(uint32_t parameterId) {
uint32_t poolId = PIDToDataPoolId(parameterId);
uint32_t index = PIDToArrayIndex(parameterId);
std::map<uint32_t, PoolEntryIF*>::iterator it = this->data_pool.find( poolId );
if (it != data_pool.end()) {
if (it->second->getSize() >= index) {
return true;
}
}
return false;
}

135
datapool/DataPool.h Normal file
View File

@ -0,0 +1,135 @@
/**
* \file DataPool.h
*
* \date 10/17/2012
* \author Bastian Baetz
*
* \brief This file contains the definition of the DataPool class and (temporarily)
* the "extern" definition of the global dataPool instance.
*/
#ifndef DATAPOOL_H_
#define DATAPOOL_H_
#include "PoolEntry.h"
#include "../globalfunctions/Type.h"
#include "../ipc/MutexIF.h"
#include <map>
/**
* \defgroup data_pool Data Pool
* This is the group, where all classes associated with Data Pool Handling belong to.
* This includes classes to access Data Pool variables.
*/
#define DP_SUCCESSFUL 0
#define DP_FAILURE 1
/**
* \brief This class represents the OBSW global data-pool.
*
* \details All variables are registered and space is allocated in an initialization
* function, which is passed do the constructor.
* Space for the variables is allocated on the heap (with a new call).
* The data is found by a data pool id, which uniquely represents a variable.
* Data pool variables should be used with a blackboard logic in mind,
* which means read data is valid (if flagged so), but not necessarily up-to-date.
* Variables are either single values or arrays.
* \ingroup data_pool
*/
class DataPool : public HasReturnvaluesIF {
private:
/**
* \brief This is the actual data pool itself.
* \details It is represented by a map
* with the data pool id as index and a pointer to a single PoolEntry as value.
*/
std::map<uint32_t, PoolEntryIF*> data_pool;
public:
/**
* \brief The mutex is created in the constructor and makes access mutual exclusive.
* \details Locking and unlocking the pool is only done by the DataSet class.
*/
MutexIF* mutex;
/**
* \brief In the classes constructor, the passed initialization function is called.
* \details To enable filling the pool,
* a pointer to the map is passed, allowing direct access to the pool's content.
* On runtime, adding or removing variables is forbidden.
*/
DataPool( void ( *initFunction )( std::map<uint32_t, PoolEntryIF*>* pool_map ) );
/**
* \brief The destructor iterates through the data_pool map and calls all Entries destructors to clean up the heap.
*/
~DataPool();
/**
* \brief This is the default call to access the pool.
* \details A pointer to the PoolEntry object is returned.
* The call checks data pool id, type and array size. Returns NULL in case of failure.
* \param data_pool_id The data pool id to search.
* \param sizeOrPosition The array size (not byte size!) of the pool entry, or the position the user wants to read.
* If smaller than the entry size, everything's ok.
*/
template <typename T> PoolEntry<T>* getData( uint32_t data_pool_id, uint8_t sizeOrPosition );
/**
* \brief An alternative call to get a data pool entry in case the type is not implicitly known
* (i.e. in Housekeeping Telemetry).
* \details It returns a basic interface and does NOT perform
* a size check. The caller has to assure he does not copy too much data.
* Returns NULL in case the entry is not found.
* \param data_pool_id The data pool id to search.
*/
PoolEntryIF* getRawData( uint32_t data_pool_id );
/**
* \brief This is a small helper function to facilitate locking the global data pool.
* \details It fetches the pool's mutex id and tries to acquire the mutex.
*/
ReturnValue_t lockDataPool();
/**
* \brief This is a small helper function to facilitate unlocking the global data pool.
* \details It fetches the pool's mutex id and tries to free the mutex.
*/
ReturnValue_t freeDataPoolLock();
/**
* \brief The print call is a simple debug method.
* \details It prints the current content of the data pool.
* It iterates through the data_pool map and calls each entry's print() method.
*/
void print();
/**
* Extracts the data pool id from a SCOS 2000 PID.
* @param parameter_id The passed Parameter ID.
* @return The data pool id as used within the OBSW.
*/
static uint32_t PIDToDataPoolId( uint32_t parameter_id );
/**
* Extracts an array index out of a SCOS 2000 PID.
* @param parameter_id The passed Parameter ID.
* @return The index of the corresponding data pool entry.
*/
static uint8_t PIDToArrayIndex( uint32_t parameter_id );
/**
* Retransforms a data pool id and an array index to a SCOS 2000 PID.
*/
static uint32_t poolIdAndPositionToPid( uint32_t poolId, uint8_t index );
/**
* Method to return the type of a pool variable.
* @param parameter_id A parameterID (not pool id) of a DP member.
* @param type Returns the type or TYPE::UNKNOWN_TYPE
* @return RETURN_OK if parameter exists, RETURN_FAILED else.
*/
ReturnValue_t getType( uint32_t parameter_id, Type* type );
/**
* Method to check if a PID exists.
* Does not lock, as there's no possibility to alter the list that is checked during run-time.
* @param parameterId The PID (not pool id!) of a parameter.
* @return true if exists, false else.
*/
bool exists(uint32_t parameterId);
};
//We assume someone globally instantiates a DataPool.
extern DataPool dataPool;
#endif /* DATAPOOL_H_ */

View File

@ -1,10 +1,10 @@
#include <framework/datapoolglob/DataPoolAdmin.h>
#include <framework/datapoolglob/GlobalDataSet.h>
#include <framework/datapoolglob/GlobalDataPool.h>
#include <framework/datapoolglob/PoolRawAccess.h>
#include <framework/ipc/CommandMessage.h>
#include <framework/ipc/QueueFactory.h>
#include <framework/parameters/ParameterMessage.h>
#include "DataPool.h"
#include "DataPoolAdmin.h"
#include "DataSet.h"
#include "PoolRawAccess.h"
#include "../ipc/CommandMessage.h"
#include "../ipc/QueueFactory.h"
#include "../parameters/ParameterMessage.h"
DataPoolAdmin::DataPoolAdmin(object_id_t objectId) :
SystemObject(objectId), storage(NULL), commandQueue(NULL), memoryHelper(
@ -40,9 +40,9 @@ ReturnValue_t DataPoolAdmin::executeAction(ActionId_t actionId,
uint8_t valid = data[4];
uint32_t poolId = glob::dataPool.PIDToDataPoolId(address);
uint32_t poolId = ::dataPool.PIDToDataPoolId(address);
GlobDataSet mySet;
DataSet mySet;
PoolRawAccess variable(poolId, 0, &mySet, PoolVariableIF::VAR_READ_WRITE);
ReturnValue_t status = mySet.read();
if (status != RETURN_OK) {
@ -92,9 +92,9 @@ void DataPoolAdmin::handleCommand() {
ReturnValue_t DataPoolAdmin::handleMemoryLoad(uint32_t address,
const uint8_t* data, size_t size, uint8_t** dataPointer) {
uint32_t poolId = glob::dataPool.PIDToDataPoolId(address);
uint8_t arrayIndex = glob::dataPool.PIDToArrayIndex(address);
GlobDataSet testSet;
uint32_t poolId = ::dataPool.PIDToDataPoolId(address);
uint8_t arrayIndex = ::dataPool.PIDToArrayIndex(address);
DataSet testSet;
PoolRawAccess varToGetSize(poolId, arrayIndex, &testSet,
PoolVariableIF::VAR_READ);
ReturnValue_t status = testSet.read();
@ -113,7 +113,7 @@ ReturnValue_t DataPoolAdmin::handleMemoryLoad(uint32_t address,
const uint8_t* readPosition = data;
for (; size > 0; size -= typeSize) {
GlobDataSet rawSet;
DataSet rawSet;
PoolRawAccess variable(poolId, arrayIndex, &rawSet,
PoolVariableIF::VAR_READ_WRITE);
status = rawSet.read();
@ -131,9 +131,9 @@ ReturnValue_t DataPoolAdmin::handleMemoryLoad(uint32_t address,
ReturnValue_t DataPoolAdmin::handleMemoryDump(uint32_t address, size_t size,
uint8_t** dataPointer, uint8_t* copyHere) {
uint32_t poolId = glob::dataPool.PIDToDataPoolId(address);
uint8_t arrayIndex = glob::dataPool.PIDToArrayIndex(address);
GlobDataSet testSet;
uint32_t poolId = ::dataPool.PIDToDataPoolId(address);
uint8_t arrayIndex = ::dataPool.PIDToArrayIndex(address);
DataSet testSet;
PoolRawAccess varToGetSize(poolId, arrayIndex, &testSet,
PoolVariableIF::VAR_READ);
ReturnValue_t status = testSet.read();
@ -146,7 +146,7 @@ ReturnValue_t DataPoolAdmin::handleMemoryDump(uint32_t address, size_t size,
}
uint8_t* ptrToCopy = copyHere;
for (; size > 0; size -= typeSize) {
GlobDataSet rawSet;
DataSet rawSet;
PoolRawAccess variable(poolId, arrayIndex, &rawSet,
PoolVariableIF::VAR_READ);
status = rawSet.read();

View File

@ -1,16 +1,15 @@
#ifndef DATAPOOLADMIN_H_
#define DATAPOOLADMIN_H_
#include <framework/objectmanager/SystemObject.h>
#include <framework/returnvalues/HasReturnvaluesIF.h>
#include <framework/tasks/ExecutableObjectIF.h>
#include <framework/action/HasActionsIF.h>
#include <framework/ipc/MessageQueueIF.h>
#include <framework/parameters/ReceivesParameterMessagesIF.h>
#include <framework/memory/MemoryHelper.h>
#include <framework/action/SimpleActionHelper.h>
#include <framework/datapoolglob/DataPoolParameterWrapper.h>
#include "../memory/MemoryHelper.h"
#include "../action/HasActionsIF.h"
#include "../action/SimpleActionHelper.h"
#include "../objectmanager/SystemObject.h"
#include "../returnvalues/HasReturnvaluesIF.h"
#include "../tasks/ExecutableObjectIF.h"
#include "../parameters/ReceivesParameterMessagesIF.h"
#include "DataPoolParameterWrapper.h"
#include "../ipc/MessageQueueIF.h"
class DataPoolAdmin: public HasActionsIF,
public ExecutableObjectIF,

View File

@ -1,8 +1,10 @@
#include <framework/datapoolglob/GlobalDataSet.h>
#include <framework/datapoolglob/DataPoolParameterWrapper.h>
#include <framework/datapoolglob/PoolRawAccess.h>
#include <framework/parameters/HasParametersIF.h>
#include "DataPoolParameterWrapper.h"
//for returncodes
#include "../parameters/HasParametersIF.h"
#include "DataSet.h"
#include "PoolRawAccess.h"
DataPoolParameterWrapper::DataPoolParameterWrapper() :
type(Type::UNKNOWN_TYPE), rows(0), columns(0), poolId(
@ -18,7 +20,7 @@ ReturnValue_t DataPoolParameterWrapper::set(uint8_t domainId,
uint16_t parameterId) {
poolId = (domainId << 16) + parameterId;
GlobDataSet mySet;
DataSet mySet;
PoolRawAccess raw(poolId, 0, &mySet, PoolVariableIF::VAR_READ);
ReturnValue_t status = mySet.read();
if (status != HasReturnvaluesIF::RETURN_OK) {
@ -55,7 +57,7 @@ ReturnValue_t DataPoolParameterWrapper::serialize(uint8_t** buffer,
}
for (uint8_t index = 0; index < rows; index++){
GlobDataSet mySet;
DataSet mySet;
PoolRawAccess raw(poolId, index, &mySet,PoolVariableIF::VAR_READ);
mySet.read();
result = raw.serialize(buffer,size,maxSize,streamEndianness);
@ -92,7 +94,7 @@ ReturnValue_t DataPoolParameterWrapper::deSerializeData(uint8_t startingRow,
for (uint8_t fromRow = 0; fromRow < fromRows; fromRow++) {
GlobDataSet mySet;
DataSet mySet;
PoolRawAccess raw(poolId, startingRow + fromRow, &mySet,
PoolVariableIF::VAR_READ_WRITE);
mySet.read();

View File

@ -1,8 +1,8 @@
#ifndef DATAPOOLPARAMETERWRAPPER_H_
#define DATAPOOLPARAMETERWRAPPER_H_
#include <framework/globalfunctions/Type.h>
#include <framework/parameters/ParameterWrapper.h>
#include "../globalfunctions/Type.h"
#include "../parameters/ParameterWrapper.h"
class DataPoolParameterWrapper: public SerializeIF {
public:

150
datapool/DataSet.cpp Normal file
View File

@ -0,0 +1,150 @@
#include "DataSet.h"
#include "../serviceinterface/ServiceInterfaceStream.h"
DataSet::DataSet() :
fill_count(0), state(DATA_SET_UNINITIALISED) {
for (unsigned count = 0; count < DATA_SET_MAX_SIZE; count++) {
registeredVariables[count] = NULL;
}
}
DataSet::~DataSet() {
//Don't do anything with your variables, they are dead already! (Destructor is already called)
}
ReturnValue_t DataSet::read() {
ReturnValue_t result = RETURN_OK;
if (state == DATA_SET_UNINITIALISED) {
lockDataPool();
for (uint16_t count = 0; count < fill_count; count++) {
if (registeredVariables[count]->getReadWriteMode()
!= PoolVariableIF::VAR_WRITE
&& registeredVariables[count]->getDataPoolId()
!= PoolVariableIF::NO_PARAMETER) {
ReturnValue_t status = registeredVariables[count]->read();
if (status != RETURN_OK) {
result = INVALID_PARAMETER_DEFINITION;
break;
}
}
}
state = DATA_SET_WAS_READ;
freeDataPoolLock();
} else {
sif::error << "DataSet::read(): Call made in wrong position." << std::endl;
result = SET_WAS_ALREADY_READ;
}
return result;
}
ReturnValue_t DataSet::commit(uint8_t valid) {
setValid(valid);
return commit();
}
ReturnValue_t DataSet::commit() {
if (state == DATA_SET_WAS_READ) {
lockDataPool();
for (uint16_t count = 0; count < fill_count; count++) {
if (registeredVariables[count]->getReadWriteMode()
!= PoolVariableIF::VAR_READ
&& registeredVariables[count]->getDataPoolId()
!= PoolVariableIF::NO_PARAMETER) {
registeredVariables[count]->commit();
}
}
state = DATA_SET_UNINITIALISED;
freeDataPoolLock();
return RETURN_OK;
} else {
ReturnValue_t result = RETURN_OK;
lockDataPool();
for (uint16_t count = 0; count < fill_count; count++) {
if (registeredVariables[count]->getReadWriteMode()
== PoolVariableIF::VAR_WRITE
&& registeredVariables[count]->getDataPoolId()
!= PoolVariableIF::NO_PARAMETER) {
registeredVariables[count]->commit();
} else if (registeredVariables[count]->getDataPoolId()
!= PoolVariableIF::NO_PARAMETER) {
if (result != COMMITING_WITHOUT_READING) {
sif::error <<
"DataSet::commit(): commit-without-read "
"call made with non write-only variable." << std::endl;
result = COMMITING_WITHOUT_READING;
}
}
}
state = DATA_SET_UNINITIALISED;
freeDataPoolLock();
return result;
}
}
void DataSet::registerVariable(PoolVariableIF* variable) {
if (state == DATA_SET_UNINITIALISED) {
if (variable != NULL) {
if (fill_count < DATA_SET_MAX_SIZE) {
registeredVariables[fill_count] = variable;
fill_count++;
return;
}
}
}
sif::error
<< "DataSet::registerVariable: failed. Either NULL, or set is full, or call made in wrong position."
<< std::endl;
return;
}
uint8_t DataSet::freeDataPoolLock() {
return ::dataPool.freeDataPoolLock();
}
uint8_t DataSet::lockDataPool() {
return ::dataPool.lockDataPool();
}
ReturnValue_t DataSet::serialize(uint8_t** buffer, size_t* size,
size_t maxSize, Endianness streamEndianness) const {
ReturnValue_t result = RETURN_FAILED;
for (uint16_t count = 0; count < fill_count; count++) {
result = registeredVariables[count]->serialize(buffer, size, maxSize,
streamEndianness);
if (result != RETURN_OK) {
return result;
}
}
return result;
}
size_t DataSet::getSerializedSize() const {
size_t size = 0;
for (uint16_t count = 0; count < fill_count; count++) {
size += registeredVariables[count]->getSerializedSize();
}
return size;
}
void DataSet::setValid(uint8_t valid) {
for (uint16_t count = 0; count < fill_count; count++) {
if (registeredVariables[count]->getReadWriteMode()
!= PoolVariableIF::VAR_READ) {
registeredVariables[count]->setValid(valid);
}
}
}
ReturnValue_t DataSet::deSerialize(const uint8_t** buffer, size_t* size,
Endianness streamEndianness) {
ReturnValue_t result = RETURN_FAILED;
for (uint16_t count = 0; count < fill_count; count++) {
result = registeredVariables[count]->deSerialize(buffer, size,
streamEndianness);
if (result != RETURN_OK) {
return result;
}
}
return result;
}

159
datapool/DataSet.h Normal file
View File

@ -0,0 +1,159 @@
/*
* \file DataSet.h
*
* \brief This file contains the DataSet class and a small structure called DataSetContent.
*
* \date 10/17/2012
*
* \author Bastian Baetz
*
*/
#ifndef DATASET_H_
#define DATASET_H_
#include "DataPool.h"
#include "DataSetIF.h"
#include "PoolRawAccess.h"
#include "PoolVariable.h"
#include "PoolVarList.h"
#include "PoolVector.h"
#include "../serialize/SerializeAdapter.h"
/**
* \brief The DataSet class manages a set of locally checked out variables.
*
* \details This class manages a list, where a set of local variables (or pool variables) are
* registered. They are checked-out (i.e. their values are looked up and copied)
* with the read call. After the user finishes working with the pool variables,
* he can write back all variable values to the pool with the commit call.
* The data set manages locking and freeing the data pool, to ensure that all values
* are read and written back at once.
* An internal state manages usage of this class. Variables may only be registered before
* the read call is made, and the commit call only after the read call.
* If pool variables are writable and not committed until destruction of the set, the
* DataSet class automatically sets the valid flag in the data pool to invalid (without)
* changing the variable's value.
*
* \ingroup data_pool
*/
class DataSet: public DataSetIF, public HasReturnvaluesIF, public SerializeIF {
private:
//SHOULDDO we could use a linked list of datapool variables
static const uint8_t DATA_SET_MAX_SIZE = 63; //!< This definition sets the maximum number of variables to register in one DataSet.
/**
* \brief This array represents all pool variables registered in this set.
* \details It has a maximum size of DATA_SET_MAX_SIZE.
*/
PoolVariableIF* registeredVariables[DATA_SET_MAX_SIZE];
/**
* \brief The fill_count attribute ensures that the variables register in the correct array
* position and that the maximum number of variables is not exceeded.
*/
uint16_t fill_count;
/**
* States of the seet.
*/
enum States {
DATA_SET_UNINITIALISED, //!< DATA_SET_UNINITIALISED
DATA_SET_WAS_READ //!< DATA_SET_WAS_READ
};
/**
* \brief state manages the internal state of the data set, which is important e.g. for the
* behavior on destruction.
*/
States state;
/**
* \brief This is a small helper function to facilitate locking the global data pool.
* \details It makes use of the lockDataPool method offered by the DataPool class.
*/
uint8_t lockDataPool();
/**
* \brief This is a small helper function to facilitate unlocking the global data pool.
* \details It makes use of the freeDataPoolLock method offered by the DataPool class.
*/
uint8_t freeDataPoolLock();
public:
static const uint8_t INTERFACE_ID = CLASS_ID::DATA_SET_CLASS;
static const ReturnValue_t INVALID_PARAMETER_DEFINITION =
MAKE_RETURN_CODE( 0x01 );
static const ReturnValue_t SET_WAS_ALREADY_READ = MAKE_RETURN_CODE( 0x02 );
static const ReturnValue_t COMMITING_WITHOUT_READING =
MAKE_RETURN_CODE(0x03);
/**
* \brief The constructor simply sets the fill_count to zero and sets the state to "uninitialized".
*/
DataSet();
/**
* \brief The destructor automatically manages writing the valid information of variables.
* \details In case the data set was read out, but not committed (indicated by state),
* the destructor parses all variables that are still registered to the set.
* For each, the valid flag in the data pool is set to "invalid".
*/
~DataSet();
/**
* \brief The read call initializes reading out all registered variables.
* \details It iterates through the list of registered variables and calls all read()
* functions of the registered pool variables (which read out their values from the
* data pool) which are not write-only. In case of an error (e.g. a wrong data type,
* or an invalid data pool id), the operation is aborted and
* \c INVALID_PARAMETER_DEFINITION returned.
* The data pool is locked during the whole read operation and freed afterwards.
* The state changes to "was written" after this operation.
* \return - \c RETURN_OK if all variables were read successfully.
* - \c INVALID_PARAMETER_DEFINITION if PID, size or type of the
* requested variable is invalid.
* - \c SET_WAS_ALREADY_READ if read() is called twice without calling
* commit() in between
*/
ReturnValue_t read();
/**
* \brief The commit call initializes writing back the registered variables.
* \details It iterates through the list of registered variables and calls
* the commit() method of the remaining registered variables (which write back
* their values to the pool).
* The data pool is locked during the whole commit operation and freed afterwards.
* The state changes to "was committed" after this operation.
* If the set does contain at least one variable which is not write-only commit()
* can only be called after read(). If the set only contains variables which are
* write only, commit() can be called without a preceding read() call.
* \return - \c RETURN_OK if all variables were read successfully.
* - \c COMMITING_WITHOUT_READING if set was not read yet and contains non write-only
* variables
*/
ReturnValue_t commit(void);
/**
* Variant of method above which sets validity of all elements of the set.
* @param valid Validity information from PoolVariableIF.
* \return - \c RETURN_OK if all variables were read successfully.
* - \c COMMITING_WITHOUT_READING if set was not read yet and contains non write-only
* variables
*/
ReturnValue_t commit(uint8_t valid);
/**
* \brief This operation is used to register the local variables in the set.
* \details It copies all required information to the currently
* free space in the registeredVariables list.
*/
void registerVariable(PoolVariableIF* variable);
/**
* Set the valid information of all variables contained in the set which are not readonly
*
* @param valid Validity information from PoolVariableIF.
*/
void setValid(uint8_t valid);
ReturnValue_t serialize(uint8_t** buffer, size_t* size,
size_t maxSize, Endianness streamEndianness) const override;
size_t getSerializedSize() const override;
ReturnValue_t deSerialize(const uint8_t** buffer, size_t* size,
Endianness streamEndianness) override;
};
#endif /* DATASET_H_ */

View File

@ -1,168 +0,0 @@
#include <framework/datapool/DataSetBase.h>
#include <framework/serviceinterface/ServiceInterfaceStream.h>
DataSetBase::DataSetBase(PoolVariableIF** registeredVariablesArray,
const size_t maxFillCount):
registeredVariables(registeredVariablesArray),
maxFillCount(maxFillCount) {
for (uint8_t count = 0; count < maxFillCount; count++) {
registeredVariables[count] = nullptr;
}
}
DataSetBase::~DataSetBase() {}
ReturnValue_t DataSetBase::registerVariable(
PoolVariableIF *variable) {
if (state != States::DATA_SET_UNINITIALISED) {
sif::error << "DataSet::registerVariable: "
"Call made in wrong position." << std::endl;
return DataSetIF::DATA_SET_UNINITIALISED;
}
if (variable == nullptr) {
sif::error << "DataSet::registerVariable: "
"Pool variable is nullptr." << std::endl;
return DataSetIF::POOL_VAR_NULL;
}
if (fillCount >= maxFillCount) {
sif::error << "DataSet::registerVariable: "
"DataSet is full." << std::endl;
return DataSetIF::DATA_SET_FULL;
}
registeredVariables[fillCount] = variable;
fillCount++;
return HasReturnvaluesIF::RETURN_OK;
}
ReturnValue_t DataSetBase::read(uint32_t lockTimeout) {
ReturnValue_t result = HasReturnvaluesIF::RETURN_OK;
if (state == States::DATA_SET_UNINITIALISED) {
lockDataPool(lockTimeout);
for (uint16_t count = 0; count < fillCount; count++) {
result = readVariable(count);
if(result != RETURN_OK) {
break;
}
}
state = States::DATA_SET_WAS_READ;
unlockDataPool();
}
else {
sif::error << "DataSet::read(): "
"Call made in wrong position. Don't forget to commit"
" member datasets!" << std::endl;
result = SET_WAS_ALREADY_READ;
}
return result;
}
uint16_t DataSetBase::getFillCount() const {
return fillCount;
}
ReturnValue_t DataSetBase::readVariable(uint16_t count) {
ReturnValue_t result = HasReturnvaluesIF::RETURN_OK;
// These checks are often performed by the respective
// variable implementation too, but I guess a double check does not hurt.
if (registeredVariables[count]->getReadWriteMode() !=
PoolVariableIF::VAR_WRITE and
registeredVariables[count]->getDataPoolId()
!= PoolVariableIF::NO_PARAMETER)
{
result = registeredVariables[count]->readWithoutLock();
if(result != HasReturnvaluesIF::RETURN_OK) {
result = INVALID_PARAMETER_DEFINITION;
}
}
return result;
}
ReturnValue_t DataSetBase::commit(uint32_t lockTimeout) {
if (state == States::DATA_SET_WAS_READ) {
handleAlreadyReadDatasetCommit(lockTimeout);
return HasReturnvaluesIF::RETURN_OK;
}
else {
return handleUnreadDatasetCommit(lockTimeout);
}
}
void DataSetBase::handleAlreadyReadDatasetCommit(uint32_t lockTimeout) {
lockDataPool(lockTimeout);
for (uint16_t count = 0; count < fillCount; count++) {
if (registeredVariables[count]->getReadWriteMode()
!= PoolVariableIF::VAR_READ
&& registeredVariables[count]->getDataPoolId()
!= PoolVariableIF::NO_PARAMETER) {
registeredVariables[count]->commitWithoutLock();
}
}
state = States::DATA_SET_UNINITIALISED;
unlockDataPool();
}
ReturnValue_t DataSetBase::handleUnreadDatasetCommit(uint32_t lockTimeout) {
ReturnValue_t result = HasReturnvaluesIF::RETURN_OK;
lockDataPool(lockTimeout);
for (uint16_t count = 0; count < fillCount; count++) {
if (registeredVariables[count]->getReadWriteMode()
== PoolVariableIF::VAR_WRITE
&& registeredVariables[count]->getDataPoolId()
!= PoolVariableIF::NO_PARAMETER) {
registeredVariables[count]->commitWithoutLock();
} else if (registeredVariables[count]->getDataPoolId()
!= PoolVariableIF::NO_PARAMETER) {
if (result != COMMITING_WITHOUT_READING) {
sif::error << "DataSet::commit(): commit-without-read call made "
"with non write-only variable." << std::endl;
result = COMMITING_WITHOUT_READING;
}
}
}
state = States::DATA_SET_UNINITIALISED;
unlockDataPool();
return result;
}
ReturnValue_t DataSetBase::lockDataPool(uint32_t timeoutMs) {
return HasReturnvaluesIF::RETURN_OK;
}
ReturnValue_t DataSetBase::unlockDataPool() {
return HasReturnvaluesIF::RETURN_OK;
}
ReturnValue_t DataSetBase::serialize(uint8_t** buffer, size_t* size,
const size_t maxSize, SerializeIF::Endianness streamEndianness) const {
ReturnValue_t result = HasReturnvaluesIF::RETURN_FAILED;
for (uint16_t count = 0; count < fillCount; count++) {
result = registeredVariables[count]->serialize(buffer, size, maxSize,
streamEndianness);
if (result != HasReturnvaluesIF::RETURN_OK) {
return result;
}
}
return result;
}
ReturnValue_t DataSetBase::deSerialize(const uint8_t** buffer, size_t* size,
SerializeIF::Endianness streamEndianness) {
ReturnValue_t result = HasReturnvaluesIF::RETURN_FAILED;
for (uint16_t count = 0; count < fillCount; count++) {
result = registeredVariables[count]->deSerialize(buffer, size,
streamEndianness);
if (result != HasReturnvaluesIF::RETURN_OK) {
return result;
}
}
return result;
}
size_t DataSetBase::getSerializedSize() const {
uint32_t size = 0;
for (uint16_t count = 0; count < fillCount; count++) {
size += registeredVariables[count]->getSerializedSize();
}
return size;
}

View File

@ -1,149 +0,0 @@
#ifndef FRAMEWORK_DATAPOOL_DATASETBASE_H_
#define FRAMEWORK_DATAPOOL_DATASETBASE_H_
#include <framework/datapool/DataSetIF.h>
#include <framework/datapool/PoolVariableIF.h>
#include <framework/ipc/MutexIF.h>
/**
* @brief The DataSetBase class manages a set of locally checked out variables.
* @details
* This class manages a list, where a set of local variables (or pool variables)
* are registered. They are checked-out (i.e. their values are looked
* up and copied) with the read call. After the user finishes working with the
* pool variables, he can write back all variable values to the pool with
* the commit call. The data set manages locking and freeing the data pool,
* to ensure that all values are read and written back at once.
*
* An internal state manages usage of this class. Variables may only be
* registered before the read call is made, and the commit call only
* after the read call.
*
* If pool variables are writable and not committed until destruction
* of the set, the DataSet class automatically sets the valid flag in the
* data pool to invalid (without) changing the variable's value.
*
* The base class lockDataPool und unlockDataPool implementation are empty
* and should be implemented to protect the underlying pool type.
* @author Bastian Baetz
* @ingroup data_pool
*/
class DataSetBase: public DataSetIF,
public SerializeIF,
public HasReturnvaluesIF {
public:
/**
* @brief Creates an empty dataset. Use registerVariable or
* supply a pointer to this dataset to PoolVariable
* initializations to register pool variables.
*/
DataSetBase(PoolVariableIF** registeredVariablesArray,
const size_t maxFillCount);
virtual~ DataSetBase();
/**
* @brief The read call initializes reading out all registered variables.
* @details
* It iterates through the list of registered variables and calls all read()
* functions of the registered pool variables (which read out their values
* from the data pool) which are not write-only.
* In case of an error (e.g. a wrong data type, or an invalid data pool id),
* the operation is aborted and @c INVALID_PARAMETER_DEFINITION returned.
*
* The data pool is locked during the whole read operation and
* freed afterwards.The state changes to "was written" after this operation.
* @return
* - @c RETURN_OK if all variables were read successfully.
* - @c INVALID_PARAMETER_DEFINITION if PID, size or type of the
* requested variable is invalid.
* - @c SET_WAS_ALREADY_READ if read() is called twice without calling
* commit() in between
*/
virtual ReturnValue_t read(uint32_t lockTimeout =
MutexIF::BLOCKING) override;
/**
* @brief The commit call initializes writing back the registered variables.
* @details
* It iterates through the list of registered variables and calls the
* commit() method of the remaining registered variables (which write back
* their values to the pool).
*
* The data pool is locked during the whole commit operation and
* freed afterwards. The state changes to "was committed" after this operation.
*
* If the set does contain at least one variable which is not write-only
* commit() can only be called after read(). If the set only contains
* variables which are write only, commit() can be called without a
* preceding read() call.
* @return - @c RETURN_OK if all variables were read successfully.
* - @c COMMITING_WITHOUT_READING if set was not read yet and
* contains non write-only variables
*/
virtual ReturnValue_t commit(uint32_t lockTimeout =
MutexIF::BLOCKING) override;
/**
* Register the passed pool variable instance into the data set.
* @param variable
* @return
*/
virtual ReturnValue_t registerVariable( PoolVariableIF* variable) override;
/**
* Provides the means to lock the underlying data structure to ensure
* thread-safety. Default implementation is empty
* @return Always returns -@c RETURN_OK
*/
virtual ReturnValue_t lockDataPool(uint32_t timeoutMs =
MutexIF::BLOCKING) override;
/**
* Provides the means to unlock the underlying data structure to ensure
* thread-safety. Default implementation is empty
* @return Always returns -@c RETURN_OK
*/
virtual ReturnValue_t unlockDataPool() override;
virtual uint16_t getFillCount() const;
/* SerializeIF implementations */
virtual ReturnValue_t serialize(uint8_t** buffer, size_t* size,
const size_t maxSize,
SerializeIF::Endianness streamEndianness) const override;
virtual size_t getSerializedSize() const override;
virtual ReturnValue_t deSerialize(const uint8_t** buffer, size_t* size,
SerializeIF::Endianness streamEndianness) override;
protected:
/**
* @brief The fill_count attribute ensures that the variables
* register in the correct array position and that the maximum
* number of variables is not exceeded.
*/
uint16_t fillCount = 0;
/**
* States of the seet.
*/
enum class States {
DATA_SET_UNINITIALISED, //!< DATA_SET_UNINITIALISED
DATA_SET_WAS_READ //!< DATA_SET_WAS_READ
};
/**
* @brief state manages the internal state of the data set,
* which is important e.g. for the behavior on destruction.
*/
States state = States::DATA_SET_UNINITIALISED;
/**
* @brief This array represents all pool variables registered in this set.
* Child classes can use a static or dynamic container to create
* an array of registered variables and assign the first entry here.
*/
PoolVariableIF** registeredVariables = nullptr;
const size_t maxFillCount = 0;
private:
ReturnValue_t readVariable(uint16_t count);
void handleAlreadyReadDatasetCommit(uint32_t lockTimeout);
ReturnValue_t handleUnreadDatasetCommit(uint32_t lockTimeout);
};
#endif /* FRAMEWORK_DATAPOOL_DATASETBASE_H_ */

View File

@ -1,62 +1,39 @@
/**
* \file DataSetIF.h
*
* \brief This file contains the small interface to access the DataSet class.
*
* \date 10/23/2012
*
* \author Bastian Baetz
*
*/
#ifndef DATASETIF_H_
#define DATASETIF_H_
#include <framework/returnvalues/HasReturnvaluesIF.h>
#include <framework/timemanager/Clock.h>
class PoolVariableIF;
/**
* @brief This class defines a small interface to register on a DataSet.
* \brief This class defines a small interface to register on a DataSet.
*
* @details
* Currently, the only purpose of this interface is to provide a
* method for locally checked-out variables to register on a data set.
* Still, it may become useful for other purposes as well.
* @author Bastian Baetz
* @ingroup data_pool
* \details Currently, the only purpose of this interface is to provide a method for locally
* checked-out variables to register on a data set. Still, it may become useful for
* other purposes as well.
*
* \ingroup data_pool
*/
class DataSetIF {
public:
static constexpr uint8_t INTERFACE_ID = CLASS_ID::DATA_SET_CLASS;
static constexpr ReturnValue_t INVALID_PARAMETER_DEFINITION =
MAKE_RETURN_CODE( 0x01 );
static constexpr ReturnValue_t SET_WAS_ALREADY_READ = MAKE_RETURN_CODE( 0x02 );
static constexpr ReturnValue_t COMMITING_WITHOUT_READING =
MAKE_RETURN_CODE(0x03);
static constexpr ReturnValue_t DATA_SET_UNINITIALISED = MAKE_RETURN_CODE( 0x04 );
static constexpr ReturnValue_t DATA_SET_FULL = MAKE_RETURN_CODE( 0x05 );
static constexpr ReturnValue_t POOL_VAR_NULL = MAKE_RETURN_CODE( 0x06 );
/**
* @brief This is an empty virtual destructor,
* as it is proposed for C++ interfaces.
* \brief This is an empty virtual destructor, as it is proposed for C++ interfaces.
*/
virtual ~DataSetIF() {}
virtual ReturnValue_t read(uint32_t lockTimeout) = 0;
virtual ReturnValue_t commit(uint32_t lockTimeout) = 0;
/**
* @brief This operation provides a method to register local data pool
* variables to register in a data set by passing itself
* to this DataSet operation.
* \brief This operation provides a method to register local data pool variables
* to register in a data set by passing itself to this DataSet operation.
*/
virtual ReturnValue_t registerVariable(PoolVariableIF* variable) = 0;
virtual uint16_t getFillCount() const = 0;
private:
/**
* @brief Most underlying data structures will have a pool like structure
* and will require a lock and unlock mechanism to ensure
* thread-safety
* @return Lock operation result
*/
virtual ReturnValue_t lockDataPool(uint32_t timeoutMs) = 0;
/**
* @brief Unlock call corresponding to the lock call.
* @return Unlock operation result
*/
virtual ReturnValue_t unlockDataPool() = 0;
virtual void registerVariable( PoolVariableIF* variable ) = 0;
};
#endif /* DATASETIF_H_ */

View File

@ -1,5 +1,6 @@
#include <framework/datapool/HkSwitchHelper.h>
#include <framework/ipc/QueueFactory.h>
#include "HkSwitchHelper.h"
//#include <mission/tmtcservices/HKService_03.h>
#include "../ipc/QueueFactory.h"
HkSwitchHelper::HkSwitchHelper(EventReportingProxyIF* eventProxy) :
commandActionHelper(this), eventProxy(eventProxy) {
@ -21,14 +22,14 @@ ReturnValue_t HkSwitchHelper::initialize() {
}
ReturnValue_t HkSwitchHelper::performOperation(uint8_t operationCode) {
CommandMessage command;
while (actionQueue->receiveMessage(&command) == HasReturnvaluesIF::RETURN_OK) {
ReturnValue_t result = commandActionHelper.handleReply(&command);
CommandMessage message;
while (actionQueue->receiveMessage(&message) == HasReturnvaluesIF::RETURN_OK) {
ReturnValue_t result = commandActionHelper.handleReply(&message);
if (result == HasReturnvaluesIF::RETURN_OK) {
continue;
}
command.setToUnknownCommand();
actionQueue->reply(&command);
message.setToUnknownCommand();
actionQueue->reply(&message);
}
return HasReturnvaluesIF::RETURN_OK;

View File

@ -1,9 +1,9 @@
#ifndef FRAMEWORK_DATAPOOL_HKSWITCHHELPER_H_
#define FRAMEWORK_DATAPOOL_HKSWITCHHELPER_H_
#include <framework/tasks/ExecutableObjectIF.h>
#include <framework/action/CommandsActionsIF.h>
#include <framework/events/EventReportingProxyIF.h>
#include "../tasks/ExecutableObjectIF.h"
#include "../action/CommandsActionsIF.h"
#include "../events/EventReportingProxyIF.h"
//TODO this class violations separation between mission and framework
//but it is only a transitional solution until the Datapool is

View File

@ -1,11 +1,11 @@
#ifndef PIDREADER_H_
#define PIDREADER_H_
#include <framework/datapool/DataSetIF.h>
#include <framework/datapoolglob/GlobalDataPool.h>
#include <framework/datapool/PoolEntry.h>
#include <framework/datapool/PoolVariableIF.h>
#include <framework/serialize/SerializeAdapter.h>
#include <framework/serviceinterface/ServiceInterfaceStream.h>
#include "DataPool.h"
#include "DataSetIF.h"
#include "PoolEntry.h"
#include "PoolVariableIF.h"
#include "../serialize/SerializeAdapter.h"
#include "../serviceinterface/ServiceInterfaceStream.h"
template<typename U, uint8_t n_var> class PIDReaderList;
@ -15,10 +15,10 @@ class PIDReader: public PoolVariableIF {
protected:
uint32_t parameterId;
uint8_t valid;
ReturnValue_t readWithoutLock() {
uint8_t arrayIndex = GlobalDataPool::PIDToArrayIndex(parameterId);
PoolEntry<T> *read_out = glob::dataPool.getData<T>(
GlobalDataPool::PIDToDataPoolId(parameterId), arrayIndex);
ReturnValue_t read() {
uint8_t arrayIndex = DataPool::PIDToArrayIndex(parameterId);
PoolEntry<T> *read_out = ::dataPool.getData<T>(
DataPool::PIDToDataPoolId(parameterId), arrayIndex);
if (read_out != NULL) {
valid = read_out->valid;
value = read_out->address[arrayIndex];
@ -36,13 +36,9 @@ protected:
* Reason is the possibility to access a single DP vector element, but if we commit,
* we set validity of the whole vector.
*/
ReturnValue_t commit(uint32_t lockTimeout) override {
ReturnValue_t commit() {
return HasReturnvaluesIF::RETURN_FAILED;
}
ReturnValue_t commitWithoutLock() override {
return HasReturnvaluesIF::RETURN_FAILED;
}
/**
* Empty ctor for List initialization
*/
@ -76,19 +72,6 @@ public:
}
}
ReturnValue_t read(uint32_t lockTimeout) override {
ReturnValue_t result = glob::dataPool.lockDataPool();
if(result != HasReturnvaluesIF::RETURN_OK) {
return result;
}
result = readWithoutLock();
ReturnValue_t unlockResult = glob::dataPool.unlockDataPool();
if(unlockResult != HasReturnvaluesIF::RETURN_OK) {
sif::error << "PIDReader::read: Could not unlock data pool!"
<< std::endl;
}
return result;
}
/**
* Copy ctor to copy classes containing Pool Variables.
*/
@ -106,7 +89,7 @@ public:
* \brief This operation returns the data pool id of the variable.
*/
uint32_t getDataPoolId() const {
return GlobalDataPool::PIDToDataPoolId(parameterId);
return DataPool::PIDToDataPoolId(parameterId);
}
uint32_t getParameterId() const {
return parameterId;
@ -131,7 +114,7 @@ public:
return valid;
}
void setValid(bool valid) {
void setValid(uint8_t valid) {
this->valid = valid;
}

View File

@ -1,8 +1,8 @@
#ifndef FRAMEWORK_DATAPOOLGLOB_PIDREADERLIST_H_
#define FRAMEWORK_DATAPOOLGLOB_PIDREADERLIST_H_
#ifndef FRAMEWORK_DATAPOOL_PIDREADERLIST_H_
#define FRAMEWORK_DATAPOOL_PIDREADERLIST_H_
#include <framework/datapool/PoolVariableIF.h>
#include <framework/datapoolglob/PIDReader.h>
#include "PIDReader.h"
#include "PoolVariableIF.h"
template <class T, uint8_t n_var>
class PIDReaderList {
private:
@ -24,4 +24,4 @@ public:
#endif /* FRAMEWORK_DATAPOOLGLOB_PIDREADERLIST_H_ */
#endif /* FRAMEWORK_DATAPOOL_PIDREADERLIST_H_ */

View File

@ -1,6 +1,6 @@
#include <framework/datapool/PoolEntry.h>
#include <framework/serviceinterface/ServiceInterfaceStream.h>
#include <framework/globalfunctions/arrayprinter.h>
#include "PoolEntry.h"
#include "../serviceinterface/ServiceInterfaceStream.h"
#include "../globalfunctions/arrayprinter.h"
#include <cstring>
template <typename T>

View File

@ -1,7 +1,7 @@
#ifndef FRAMEWORK_DATAPOOL_POOLENTRY_H_
#define FRAMEWORK_DATAPOOL_POOLENTRY_H_
#include <framework/datapool/PoolEntryIF.h>
#include "PoolEntryIF.h"
#include <initializer_list>
#include <type_traits>

View File

@ -1,7 +1,7 @@
#ifndef FRAMEWORK_DATAPOOL_POOLENTRYIF_H_
#define FRAMEWORK_DATAPOOL_POOLENTRYIF_H_
#include <framework/globalfunctions/Type.h>
#include "../globalfunctions/Type.h"
#include <cstdint>
/**

187
datapool/PoolRawAccess.cpp Normal file
View File

@ -0,0 +1,187 @@
#include "DataPool.h"
#include "PoolEntryIF.h"
#include "PoolRawAccess.h"
#include "../serviceinterface/ServiceInterfaceStream.h"
#include "../serialize/EndianConverter.h"
#include <cstring>
PoolRawAccess::PoolRawAccess(uint32_t set_id, uint8_t setArrayEntry,
DataSetIF *data_set, ReadWriteMode_t setReadWriteMode) :
dataPoolId(set_id), arrayEntry(setArrayEntry), valid(false), type(
Type::UNKNOWN_TYPE), typeSize(0), arraySize(0), sizeTillEnd(0), readWriteMode(
setReadWriteMode) {
memset(value, 0, sizeof(value));
if (data_set != NULL) {
data_set->registerVariable(this);
}
}
PoolRawAccess::~PoolRawAccess() {
}
ReturnValue_t PoolRawAccess::read() {
PoolEntryIF *read_out = ::dataPool.getRawData(dataPoolId);
if (read_out != NULL) {
valid = read_out->getValid();
if (read_out->getSize() > arrayEntry) {
arraySize = read_out->getSize();
typeSize = read_out->getByteSize() / read_out->getSize();
type = read_out->getType();
if (typeSize <= sizeof(value)) {
uint16_t arrayPosition = arrayEntry * typeSize;
sizeTillEnd = read_out->getByteSize() - arrayPosition;
uint8_t *ptr =
&((uint8_t*) read_out->getRawData())[arrayPosition];
memcpy(value, ptr, typeSize);
return HasReturnvaluesIF::RETURN_OK;
} else {
//Error value type too large.
}
} else {
//Error index requested too large
}
} else {
//Error entry does not exist.
}
sif::error << "PoolRawAccess: read of DP Variable 0x" << std::hex
<< dataPoolId << std::dec << " failed." << std::endl;
valid = INVALID;
typeSize = 0;
sizeTillEnd = 0;
memset(value, 0, sizeof(value));
return HasReturnvaluesIF::RETURN_FAILED;
}
ReturnValue_t PoolRawAccess::commit() {
PoolEntryIF *write_back = ::dataPool.getRawData(dataPoolId);
if ((write_back != NULL) && (readWriteMode != VAR_READ)) {
write_back->setValid(valid);
uint8_t array_position = arrayEntry * typeSize;
uint8_t *ptr = &((uint8_t*) write_back->getRawData())[array_position];
memcpy(ptr, value, typeSize);
return HasReturnvaluesIF::RETURN_OK;
} else {
return HasReturnvaluesIF::RETURN_FAILED;
}
}
uint8_t* PoolRawAccess::getEntry() {
return value;
}
ReturnValue_t PoolRawAccess::getEntryEndianSafe(uint8_t *buffer,
size_t *writtenBytes, size_t maxSize) {
uint8_t *data_ptr = getEntry();
// debug << "PoolRawAccess::getEntry: Array position: " << index * size_of_type << " Size of T: " << (int)size_of_type << " ByteSize: " << byte_size << " Position: " << *size << std::endl;
if (typeSize == 0) {
return DATA_POOL_ACCESS_FAILED;
}
if (typeSize > maxSize) {
return INCORRECT_SIZE;
}
EndianConverter::convertBigEndian(buffer, data_ptr, typeSize);
*writtenBytes = typeSize;
return HasReturnvaluesIF::RETURN_OK;
}
Type PoolRawAccess::getType() {
return type;
}
size_t PoolRawAccess::getSizeOfType() {
return typeSize;
}
size_t PoolRawAccess::getArraySize() {
return arraySize;
}
uint32_t PoolRawAccess::getDataPoolId() const {
return dataPoolId;
}
PoolVariableIF::ReadWriteMode_t PoolRawAccess::getReadWriteMode() const {
return readWriteMode;
}
ReturnValue_t PoolRawAccess::setEntryFromBigEndian(const uint8_t *buffer,
size_t setSize) {
if (typeSize == setSize) {
EndianConverter::convertBigEndian(value, buffer, typeSize);
return HasReturnvaluesIF::RETURN_OK;
} else {
sif::error
<< "PoolRawAccess::setEntryFromBigEndian: Illegal sizes: Internal"
<< (uint32_t) typeSize << ", Requested: " << setSize
<< std::endl;
return INCORRECT_SIZE;
}
}
bool PoolRawAccess::isValid() const {
if (valid != INVALID)
return true;
else
return false;
}
void PoolRawAccess::setValid(uint8_t valid) {
this->valid = valid;
}
size_t PoolRawAccess::getSizeTillEnd() const {
return sizeTillEnd;
}
ReturnValue_t PoolRawAccess::serialize(uint8_t **buffer, size_t *size,
size_t maxSize, Endianness streamEndianness) const {
if (typeSize + *size <= maxSize) {
switch (streamEndianness) {
case (Endianness::BIG):
EndianConverter::convertBigEndian(*buffer, value, typeSize);
break;
case (Endianness::LITTLE):
EndianConverter::convertLittleEndian(*buffer, value, typeSize);
break;
default:
case (Endianness::MACHINE):
memcpy(*buffer, value, typeSize);
break;
}
*size += typeSize;
(*buffer) += typeSize;
return HasReturnvaluesIF::RETURN_OK;
} else {
return SerializeIF::BUFFER_TOO_SHORT;
}
}
size_t PoolRawAccess::getSerializedSize() const {
return typeSize;
}
ReturnValue_t PoolRawAccess::deSerialize(const uint8_t **buffer, size_t *size,
Endianness streamEndianness) {
if (*size >= typeSize) {
switch (streamEndianness) {
case (Endianness::BIG):
EndianConverter::convertBigEndian(value, *buffer, typeSize);
break;
case (Endianness::LITTLE):
EndianConverter::convertLittleEndian(value, *buffer, typeSize);
break;
default:
case (Endianness::MACHINE):
memcpy(value, *buffer, typeSize);
break;
}
*size -= typeSize;
*buffer += typeSize;
return HasReturnvaluesIF::RETURN_OK;
} else {
return SerializeIF::STREAM_TOO_SHORT;
}
}

152
datapool/PoolRawAccess.h Normal file
View File

@ -0,0 +1,152 @@
#ifndef POOLRAWACCESS_H_
#define POOLRAWACCESS_H_
#include "DataSetIF.h"
#include "PoolVariableIF.h"
/**
* This class allows accessing Data Pool variables as raw bytes.
* This is necessary to have an access method for HK data, as the PID's alone do not
* provide a type information.
* \ingroup data_pool
*/
class PoolRawAccess: public PoolVariableIF {
private:
/**
* \brief To access the correct data pool entry on read and commit calls, the data pool id
* is stored.
*/
uint32_t dataPoolId;
/**
* \brief The array entry that is fetched from the data pool.
*/
uint8_t arrayEntry;
/**
* \brief The valid information as it was stored in the data pool is copied to this attribute.
*/
uint8_t valid;
/**
* \brief This value contains the type of the data pool entry.
*/
Type type;
/**
* \brief This value contains the size of the data pool entry in bytes.
*/
size_t typeSize;
/**
* The size of the DP array (single values return 1)
*/
size_t arraySize;
/**
* The size (in bytes) from the selected entry till the end of this DataPool variable.
*/
size_t sizeTillEnd;
/**
* \brief The information whether the class is read-write or read-only is stored here.
*/
ReadWriteMode_t readWriteMode;
static const uint8_t RAW_MAX_SIZE = sizeof(double);
protected:
/**
* \brief This is a call to read the value from the global data pool.
* \details When executed, this operation tries to fetch the pool entry with matching
* data pool id from the global data pool and copies the value and the valid
* information to its local attributes. In case of a failure (wrong type or
* pool id not found), the variable is set to zero and invalid.
* The operation does NOT provide any mutual exclusive protection by itself.
*/
ReturnValue_t read();
/**
* \brief The commit call writes back the variable's value to the data pool.
* \details It checks type and size, as well as if the variable is writable. If so,
* the value is copied and the valid flag is automatically set to "valid".
* The operation does NOT provide any mutual exclusive protection by itself.
*
*/
ReturnValue_t commit();
public:
static const uint8_t INTERFACE_ID = CLASS_ID::POOL_RAW_ACCESS_CLASS;
static const ReturnValue_t INCORRECT_SIZE = MAKE_RETURN_CODE(0x01);
static const ReturnValue_t DATA_POOL_ACCESS_FAILED = MAKE_RETURN_CODE(0x02);
uint8_t value[RAW_MAX_SIZE];
PoolRawAccess(uint32_t data_pool_id, uint8_t arrayEntry,
DataSetIF *data_set, ReadWriteMode_t setReadWriteMode =
PoolVariableIF::VAR_READ);
/**
* \brief The classes destructor is empty. If commit() was not called, the local value is
* discarded and not written back to the data pool.
*/
~PoolRawAccess();
/**
* \brief This operation returns a pointer to the entry fetched.
* \details This means, it does not return a pointer to byte "index", but to the start byte of
* array entry "index". Example: If the original data pool array consists of an double
* array of size four, getEntry(1) returns &(this->value[8]).
*/
uint8_t* getEntry();
/**
* \brief This operation returns the fetched entry from the data pool and
* flips the bytes, if necessary.
* \details It makes use of the getEntry call of this function, but additionally flips the
* bytes to big endian, which is the default for external communication (as House-
* keeping telemetry). To achieve this, the data is copied directly to the passed
* buffer, if it fits in the given maxSize.
* \param buffer A pointer to a buffer to write to
* \param writtenBytes The number of bytes written is returned with this value.
* \param maxSize The maximum size that the function may write to buffer.
* \return - \c RETURN_OK if entry could be acquired
* - \c RETURN_FAILED else.
*/
ReturnValue_t getEntryEndianSafe(uint8_t *buffer, size_t *size,
size_t maxSize);
/**
* With this method, the content can be set from a big endian buffer safely.
* @param buffer Pointer to the data to set
* @param size Size of the data to write. Must fit this->size.
* @return - \c RETURN_OK on success
* - \c RETURN_FAILED on failure
*/
ReturnValue_t setEntryFromBigEndian(const uint8_t *buffer,
size_t setSize);
/**
* \brief This operation returns the type of the entry currently stored.
*/
Type getType();
/**
* \brief This operation returns the size of the entry currently stored.
*/
size_t getSizeOfType();
/**
*
* @return the size of the datapool array
*/
size_t getArraySize();
/**
* \brief This operation returns the data pool id of the variable.
*/
uint32_t getDataPoolId() const;
/**
* This method returns if the variable is read-write or read-only.
*/
ReadWriteMode_t getReadWriteMode() const;
/**
* \brief With this call, the valid information of the variable is returned.
*/
bool isValid() const;
void setValid(uint8_t valid);
/**
* Getter for the remaining size.
*/
size_t getSizeTillEnd() const;
ReturnValue_t serialize(uint8_t **buffer, size_t *size, size_t maxSize,
Endianness streamEndianness) const override;
size_t getSerializedSize() const override;
ReturnValue_t deSerialize(const uint8_t **buffer, size_t *size,
Endianness streamEndianness) override;
};
#endif /* POOLRAWACCESS_H_ */

View File

@ -1,188 +0,0 @@
/**
* @file PoolRawAccessHelper.cpp
*
* @date 22.12.2019
* @author R. Mueller
*/
#include <framework/datapool/PoolRawAccessHelper.h>
#include <framework/datapoolglob/GlobalDataSet.h>
#include <framework/serialize/SerializeAdapter.h>
#include <framework/serviceinterface/ServiceInterfaceStream.h>
#include <cmath>
#include <cstring>
PoolRawAccessHelper::PoolRawAccessHelper(uint32_t * poolIdBuffer_,
uint8_t numberOfParameters_):
poolIdBuffer(reinterpret_cast<uint8_t * >(poolIdBuffer_)),
numberOfParameters(numberOfParameters_), validBufferIndex(0),
validBufferIndexBit(1) {
}
PoolRawAccessHelper::~PoolRawAccessHelper() {
}
ReturnValue_t PoolRawAccessHelper::serialize(uint8_t **buffer, size_t *size,
const size_t max_size, SerializeIF::Endianness streamEndianness) {
SerializationArgs serializationArgs = {buffer, size, max_size,
streamEndianness};
ReturnValue_t result = RETURN_OK;
size_t remainingParametersSize = numberOfParameters * 4;
for(uint8_t count=0; count < numberOfParameters; count++) {
result = serializeCurrentPoolEntryIntoBuffer(serializationArgs,
&remainingParametersSize, false);
if(result != RETURN_OK) {
return result;
}
}
if(remainingParametersSize != 0) {
sif::debug << "PoolRawAccessHelper: "
"Remaining parameters size not 0 !" << std::endl;
result = RETURN_FAILED;
}
return result;
}
ReturnValue_t PoolRawAccessHelper::serializeWithValidityMask(uint8_t ** buffer,
size_t * size, const size_t max_size,
SerializeIF::Endianness streamEndianness) {
ReturnValue_t result = RETURN_OK;
SerializationArgs argStruct = {buffer, size, max_size, streamEndianness};
size_t remainingParametersSize = numberOfParameters * 4;
uint8_t validityMaskSize = ceil((float)numberOfParameters/8.0);
uint8_t validityMask[validityMaskSize];
memset(validityMask,0, validityMaskSize);
for(uint8_t count = 0; count < numberOfParameters; count++) {
result = serializeCurrentPoolEntryIntoBuffer(argStruct,
&remainingParametersSize,true,validityMask);
if (result != RETURN_OK) {
return result;
}
}
if(remainingParametersSize != 0) {
sif::debug << "PoolRawAccessHelper: Remaining "
"parameters size not 0 !" << std::endl;
result = RETURN_FAILED;
}
memcpy(*argStruct.buffer, validityMask, validityMaskSize);
*size += validityMaskSize;
validBufferIndex = 1;
validBufferIndexBit = 0;
return result;
}
ReturnValue_t PoolRawAccessHelper::serializeCurrentPoolEntryIntoBuffer(
SerializationArgs argStruct, size_t * remainingParameters,
bool withValidMask, uint8_t * validityMask) {
uint32_t currentPoolId;
// Deserialize current pool ID from pool ID buffer
ReturnValue_t result = SerializeAdapter::deSerialize(&currentPoolId,
&poolIdBuffer,remainingParameters, SerializeIF::Endianness::MACHINE);
if(result != RETURN_OK) {
sif::debug << std::hex << "PoolRawAccessHelper: Error deSeralizing "
"pool IDs" << std::dec << std::endl;
return result;
}
result = handlePoolEntrySerialization(currentPoolId, argStruct,
withValidMask, validityMask);
return result;
}
ReturnValue_t PoolRawAccessHelper::handlePoolEntrySerialization(
uint32_t currentPoolId,SerializationArgs argStruct, bool withValidMask,
uint8_t * validityMask) {
ReturnValue_t result = RETURN_FAILED;
uint8_t arrayPosition = 0;
uint8_t counter = 0;
bool poolEntrySerialized = false;
//debug << "Pool Raw Access Helper: Handling Pool ID: "
// << std::hex << currentPoolId << std::endl;
while(not poolEntrySerialized) {
if(counter > GlobDataSet::DATA_SET_MAX_SIZE) {
sif::error << "PoolRawAccessHelper: Config error, "
"max. number of possible data set variables exceeded"
<< std::endl;
return result;
}
counter ++;
GlobDataSet currentDataSet;
//debug << "Current array position: " << (int)arrayPosition << std::endl;
PoolRawAccess currentPoolRawAccess(currentPoolId, arrayPosition,
&currentDataSet, PoolVariableIF::VAR_READ);
result = currentDataSet.read();
if (result != RETURN_OK) {
sif::debug << std::hex << "PoolRawAccessHelper: Error reading raw "
"dataset with returncode 0x" << result << std::dec << std::endl;
return result;
}
result = checkRemainingSize(&currentPoolRawAccess, &poolEntrySerialized,
&arrayPosition);
if(result != RETURN_OK) {
sif::error << "Pool Raw Access Helper: Configuration Error at pool ID "
<< std::hex << currentPoolId
<< ". Size till end smaller than 0" << std::dec << std::endl;
return result;
}
// set valid mask bit if necessary
if(withValidMask) {
if(currentPoolRawAccess.isValid()) {
handleMaskModification(validityMask);
}
validBufferIndexBit ++;
}
result = currentDataSet.serialize(argStruct.buffer, argStruct.size,
argStruct.max_size, argStruct.streamEndianness);
if (result != RETURN_OK) {
sif::debug << "Pool Raw Access Helper: Error serializing pool data with "
"ID 0x" << std::hex << currentPoolId << " into send buffer "
"with return code " << result << std::dec << std::endl;
return result;
}
}
return result;
}
ReturnValue_t PoolRawAccessHelper::checkRemainingSize(PoolRawAccess*
currentPoolRawAccess, bool * isSerialized, uint8_t * arrayPosition) {
int8_t remainingSize = currentPoolRawAccess->getSizeTillEnd() -
currentPoolRawAccess->getSizeOfType();
if(remainingSize == 0) {
*isSerialized = true;
}
else if(remainingSize > 0) {
*arrayPosition += 1;
}
else {
return RETURN_FAILED;
}
return RETURN_OK;
}
void PoolRawAccessHelper::handleMaskModification(uint8_t * validityMask) {
validityMask[validBufferIndex] =
bitSetter(validityMask[validBufferIndex], validBufferIndexBit, true);
if(validBufferIndexBit == 8) {
validBufferIndex ++;
validBufferIndexBit = 1;
}
}
uint8_t PoolRawAccessHelper::bitSetter(uint8_t byte, uint8_t position,
bool value) {
if(position < 1 or position > 8) {
sif::debug << "Pool Raw Access: Bit setting invalid position" << std::endl;
return byte;
}
uint8_t shiftNumber = position + (6 - 2 * (position - 1));
byte |= 1UL << shiftNumber;
return byte;
}

View File

@ -1,111 +0,0 @@
/**
* @file PoolRawAccessHelper.h
*
* @date 22.12.2019
*/
#ifndef FRAMEWORK_DATAPOOL_POOLRAWACCESSHELPER_H_
#define FRAMEWORK_DATAPOOL_POOLRAWACCESSHELPER_H_
#include <framework/returnvalues/HasReturnvaluesIF.h>
#include <framework/datapoolglob/GlobalDataSet.h>
#include <framework/datapoolglob/PoolRawAccess.h>
/**
* @brief This helper function simplifies accessing data pool entries
* via PoolRawAccess
* @details Can be used for a Housekeeping Service
* like ECSS PUS Service 3 if the type of the datapool entries is unknown.
* The provided dataset can be serialized into a provided buffer automatically by
* providing a buffer of pool IDs
* @ingroup data_pool
*/
class PoolRawAccessHelper: public HasReturnvaluesIF {
public:
/**
* Call this constructor if a dataset needs to be serialized via
* Pool Raw Access
* @param dataSet_ This dataset will be used to perform thread-safe reading
* @param poolIdBuffer_ A buffer of uint32_t pool IDs
* @param numberOfParameters_ The number of parameters / pool IDs
*/
PoolRawAccessHelper(uint32_t * poolIdBuffer_, uint8_t numberOfParameters_);
virtual ~PoolRawAccessHelper();
/**
* Serialize the datapool entries derived from the pool ID buffer
* directly into a provided buffer
* @param [out] buffer
* @param [out] size Size of the serialized buffer
* @param max_size
* @param bigEndian
* @return @c RETURN_OK On success
* @c RETURN_FAILED on failure
*/
ReturnValue_t serialize(uint8_t ** buffer, size_t * size,
const size_t max_size, SerializeIF::Endianness streamEndianness);
/**
* Serializes data pool entries into provided buffer with the validity mask buffer
* at the end of the buffer. Every bit of the validity mask denotes
* the validity of a corresponding data pool entry from left to right.
* @param [out] buffer
* @param [out] size Size of the serialized buffer plus size
* of the validity mask
* @return @c RETURN_OK On success
* @c RETURN_FAILED on failure
*/
ReturnValue_t serializeWithValidityMask(uint8_t ** buffer, size_t * size,
const size_t max_size, SerializeIF::Endianness streamEndianness);
private:
// DataSet * dataSet;
const uint8_t * poolIdBuffer;
uint8_t numberOfParameters;
uint8_t validBufferIndex;
uint8_t validBufferIndexBit;
struct SerializationArgs {
uint8_t ** buffer;
size_t * size;
const size_t max_size;
SerializeIF::Endianness streamEndianness;
};
/**
* Helper function to serialize single pool entries
* @param pPoolIdBuffer
* @param buffer
* @param remainingParameters
* @param hkDataSize
* @param max_size
* @param bigEndian
* @param withValidMask Can be set optionally to set a
* provided validity mask
* @param validityMask Can be supplied and will be set if
* @c withValidMask is set to true
* @return
*/
ReturnValue_t serializeCurrentPoolEntryIntoBuffer(
SerializationArgs argStruct, size_t * remainingParameters,
bool withValidMask = false, uint8_t * validityMask = nullptr);
ReturnValue_t handlePoolEntrySerialization(uint32_t currentPoolId,
SerializationArgs argStruct, bool withValidMask = false,
uint8_t * validityMask = nullptr);
ReturnValue_t checkRemainingSize(PoolRawAccess * currentPoolRawAccess,
bool * isSerialized, uint8_t * arrayPosition);
void handleMaskModification(uint8_t * validityMask);
/**
* Sets specific bit of a byte
* @param byte
* @param position Position of byte to set from 1 to 8
* @param value Binary value to set
* @return
*/
uint8_t bitSetter(uint8_t byte, uint8_t position, bool value);
};
#endif /* FRAMEWORK_DATAPOOL_POOLRAWACCESSHELPER_H_ */

View File

@ -1,12 +1,12 @@
#ifndef POOLVARLIST_H_
#define POOLVARLIST_H_
#include <framework/datapool/PoolVariableIF.h>
#include <framework/datapoolglob/GlobalPoolVariable.h>
#include "PoolVariable.h"
#include "PoolVariableIF.h"
template <class T, uint8_t n_var>
class PoolVarList {
private:
GlobPoolVar<T> variables[n_var];
PoolVariable<T> variables[n_var];
public:
PoolVarList( const uint32_t set_id[n_var], DataSetIF* dataSet, PoolVariableIF::ReadWriteMode_t setReadWriteMode ) {
//I really should have a look at the new init list c++ syntax.
@ -20,7 +20,7 @@ public:
}
}
GlobPoolVar<T> &operator [](int i) { return variables[i]; }
PoolVariable<T> &operator [](int i) { return variables[i]; }
};

295
datapool/PoolVariable.h Normal file
View File

@ -0,0 +1,295 @@
/*
* \file PoolVariable.h
*
* \brief This file contains the PoolVariable class, which locally represents a non-array data pool variable.
*
* \date 10/17/2012
*
* \author Bastian Baetz
*/
#ifndef POOLVARIABLE_H_
#define POOLVARIABLE_H_
#include "DataSetIF.h"
#include "PoolEntry.h"
#include "PoolVariableIF.h"
#include "../serialize/SerializeAdapter.h"
#include "../serviceinterface/ServiceInterfaceStream.h"
template<typename T, uint8_t n_var> class PoolVarList;
/**
* \brief This is the access class for non-array data pool entries.
*
* \details To ensure safe usage of the data pool, operation is not done directly on the data pool
* entries, but on local copies. This class provides simple type-safe access to single
* data pool entries (i.e. entries with length = 1).
* The class can be instantiated as read-write and read only.
* It provides a commit-and-roll-back semantic, which means that the variable's value in
* the data pool is not changed until the commit call is executed.
* \tparam T The template parameter sets the type of the variable. Currently, all plain data types
* are supported, but in principle any type is possible.
* \ingroup data_pool
*/
template<typename T>
class PoolVariable: public PoolVariableIF {
template<typename U, uint8_t n_var> friend class PoolVarList;
protected:
/**
* \brief To access the correct data pool entry on read and commit calls, the data pool id
* is stored.
*/
uint32_t dataPoolId;
/**
* \brief The valid information as it was stored in the data pool is copied to this attribute.
*/
uint8_t valid;
/**
* \brief The information whether the class is read-write or read-only is stored here.
*/
ReadWriteMode_t readWriteMode;
/**
* \brief This is a call to read the value from the global data pool.
* \details When executed, this operation tries to fetch the pool entry with matching
* data pool id from the global data pool and copies the value and the valid
* information to its local attributes. In case of a failure (wrong type or
* pool id not found), the variable is set to zero and invalid.
* The operation does NOT provide any mutual exclusive protection by itself.
*/
ReturnValue_t read() {
PoolEntry<T> *read_out = ::dataPool.getData < T > (dataPoolId, 1);
if (read_out != NULL) {
valid = read_out->valid;
value = *(read_out->address);
return HasReturnvaluesIF::RETURN_OK;
} else {
value = 0;
valid = false;
sif::error << "PoolVariable: read of DP Variable 0x" << std::hex
<< dataPoolId << std::dec << " failed." << std::endl;
return HasReturnvaluesIF::RETURN_FAILED;
}
}
/**
* \brief The commit call writes back the variable's value to the data pool.
* \details It checks type and size, as well as if the variable is writable. If so,
* the value is copied and the valid flag is automatically set to "valid".
* The operation does NOT provide any mutual exclusive protection by itself.
*
*/
ReturnValue_t commit() {
PoolEntry<T> *write_back = ::dataPool.getData < T > (dataPoolId, 1);
if ((write_back != NULL) && (readWriteMode != VAR_READ)) {
write_back->valid = valid;
*(write_back->address) = value;
return HasReturnvaluesIF::RETURN_OK;
} else {
return HasReturnvaluesIF::RETURN_FAILED;
}
}
/**
* Empty ctor for List initialization
*/
PoolVariable() :
dataPoolId(PoolVariableIF::NO_PARAMETER), valid(
PoolVariableIF::INVALID), readWriteMode(VAR_READ), value(0) {
}
public:
/**
* \brief This is the local copy of the data pool entry.
* \details The user can work on this attribute
* just like he would on a simple local variable.
*/
T value;
/**
* \brief In the constructor, the variable can register itself in a DataSet (if not NULL is
* passed).
* \details It DOES NOT fetch the current value from the data pool, but sets the value
* attribute to default (0). The value is fetched within the read() operation.
* \param set_id This is the id in the global data pool this instance of the access class
* corresponds to.
* \param dataSet The data set in which the variable shall register itself. If NULL,
* the variable is not registered.
* \param setWritable If this flag is set to true, changes in the value attribute can be
* written back to the data pool, otherwise not.
*/
PoolVariable(uint32_t set_id, DataSetIF *dataSet,
ReadWriteMode_t setReadWriteMode) :
dataPoolId(set_id), valid(PoolVariableIF::INVALID), readWriteMode(
setReadWriteMode), value(0) {
if (dataSet != NULL) {
dataSet->registerVariable(this);
}
}
/**
* Copy ctor to copy classes containing Pool Variables.
*/
PoolVariable(const PoolVariable &rhs) :
dataPoolId(rhs.dataPoolId), valid(rhs.valid), readWriteMode(
rhs.readWriteMode), value(rhs.value) {
}
/**
* \brief The classes destructor is empty.
* \details If commit() was not called, the local value is
* discarded and not written back to the data pool.
*/
~PoolVariable() {
}
/**
* \brief This operation returns the data pool id of the variable.
*/
uint32_t getDataPoolId() const {
return dataPoolId;
}
/**
* This operation sets the data pool id of the variable.
* The method is necessary to set id's of data pool member variables with bad initialization.
*/
void setDataPoolId(uint32_t poolId) {
dataPoolId = poolId;
}
/**
* This method returns if the variable is write-only, read-write or read-only.
*/
ReadWriteMode_t getReadWriteMode() const {
return readWriteMode;
}
/**
* \brief With this call, the valid information of the variable is returned.
*/
bool isValid() const {
if (valid)
return true;
else
return false;
}
uint8_t getValid() {
return valid;
}
void setValid(uint8_t valid) {
this->valid = valid;
}
operator T() {
return value;
}
operator T() const {
return value;
}
PoolVariable<T>& operator=(T newValue) {
value = newValue;
return *this;
}
PoolVariable<T>& operator=(PoolVariable<T> newPoolVariable) {
value = newPoolVariable.value;
return *this;
}
virtual ReturnValue_t serialize(uint8_t **buffer, size_t *size,
size_t maxSize, Endianness streamEndianness) const override {
return SerializeAdapter::serialize<T>(&value, buffer, size, maxSize,
streamEndianness);
}
virtual size_t getSerializedSize() const override {
return SerializeAdapter::getSerializedSize(&value);
}
virtual ReturnValue_t deSerialize(const uint8_t **buffer, size_t *size,
Endianness streamEndianness) override {
return SerializeAdapter::deSerialize(&value, buffer, size, streamEndianness);
}
};
typedef PoolVariable<uint8_t> db_uint8_t;
typedef PoolVariable<uint16_t> db_uint16_t;
typedef PoolVariable<uint32_t> db_uint32_t;
typedef PoolVariable<int8_t> db_int8_t;
typedef PoolVariable<int16_t> db_int16_t;
typedef PoolVariable<int32_t> db_int32_t;
typedef PoolVariable<uint8_t> db_bool_t;
typedef PoolVariable<float> db_float_t;
typedef PoolVariable<double> db_double_t;
//Alternative (but I thing this is not as useful: code duplication, differences too small):
//template <typename T>
//class PoolReader : public PoolVariableIF {
//private:
// uint32_t parameter_id;
// uint8_t valid;
//public:
// T value;
// PoolReader( uint32_t set_id, DataSetIF* set ) : parameter_id(set_id), valid(false), value(0) {
// set->registerVariable( this );
// }
//
// ~PoolReader() {};
//
// uint8_t commit() {
// return HasReturnvaluesIF::RETURN_OK;
// }
//
// uint8_t read() {
// PoolEntry<T>* read_out = ::dataPool.getData<T>( parameter_id, 1 );
// if ( read_out != NULL ) {
// valid = read_out->valid;
// value = *(read_out->address);
// return HasReturnvaluesIF::RETURN_OK;
// } else {
// value = 0;
// valid = false;
// return CHECKOUT_FAILED;
// }
// }
// uint32_t getParameterId() { return parameter_id; }
// bool isWritable() { return false; };
// bool isValid() { if (valid) return true; else return false; }
//};
//
//template <typename T>
//class PoolWriter : public PoolVariableIF {
//private:
// uint32_t parameter_id;
//public:
// T value;
// PoolWriter( uint32_t set_id, DataSetIF* set ) : parameter_id(set_id), value(0) {
// set->registerVariable( this );
// }
//
// ~PoolWriter() {};
//
// uint8_t commit() {
// PoolEntry<T>* write_back = ::dataPool.getData<T>( parameter_id, 1 );
// if ( write_back != NULL ) {
// write_back->valid = true;
// *(write_back->address) = value;
// return HasReturnvaluesIF::RETURN_OK;
// } else {
// return CHECKOUT_FAILED;
// }
// }
// uint8_t read() {
// PoolEntry<T>* read_out = ::dataPool.getData<T>( parameter_id, 1 );
// if ( read_out != NULL ) {
// value = *(read_out->address);
// return HasReturnvaluesIF::RETURN_OK;
// } else {
// value = 0;
// return CHECKOUT_FAILED;
// }
// }
// uint32_t getParameterId() { return parameter_id; }
// bool isWritable() { return true; };
// bool isValid() { return false; }
//};
#endif /* POOLVARIABLE_H_ */

View File

@ -1,99 +1,71 @@
#ifndef FRAMEWORK_DATAPOOL_POOLVARIABLEIF_H_
#define FRAMEWORK_DATAPOOL_POOLVARIABLEIF_H_
/*
* \file PoolVariableIF.h
*
* \brief This file contains the interface definition for pool variables.
*
* \date 10/17/2012
*
* \author Bastian Baetz
*/
#include <framework/returnvalues/HasReturnvaluesIF.h>
#include <framework/serialize/SerializeIF.h>
#ifndef POOLVARIABLEIF_H_
#define POOLVARIABLEIF_H_
#include "../returnvalues/HasReturnvaluesIF.h"
#include "../serialize/SerializeIF.h"
/**
* @brief This interface is used to control data pool
* variable representations.
* @details
* To securely handle data pool variables, all pool entries are locally
* managed by data pool variable access classes, which are called pool
* variables. To ensure a common state of a set of variables needed in a
* function, these local pool variables again are managed by other classes,
* like the DataSet classes. This interface provides unified access to
* local pool variables for such manager classes.
* @author Bastian Baetz
* @ingroup data_pool
* \brief This interface is used to control local data pool variable representations.
*
* \details To securely handle data pool variables, all pool entries are locally managed by
* data pool variable access classes, which are called pool variables. To ensure a
* common state of a set of variables needed in a function, these local pool variables
* again are managed by other classes, e.g. the DataSet. This interface provides unified
* access to local pool variables for such manager classes.
* \ingroup data_pool
*/
class PoolVariableIF : public SerializeIF {
friend class DataSetBase;
friend class GlobDataSet;
friend class LocalDataSet;
friend class DataSet;
protected:
/**
* \brief The commit call shall write back a newly calculated local value to the data pool.
*/
virtual ReturnValue_t commit() = 0;
/**
* \brief The read call shall read the value of this parameter from the data pool and store
* the content locally.
*/
virtual ReturnValue_t read() = 0;
public:
static constexpr uint8_t INTERFACE_ID = CLASS_ID::POOL_VARIABLE_IF;
static constexpr ReturnValue_t INVALID_READ_WRITE_MODE = MAKE_RETURN_CODE(0xA0);
static constexpr bool VALID = 1;
static constexpr bool INVALID = 0;
static constexpr uint32_t NO_PARAMETER = 0xffffffff;
static const uint8_t VALID = 1;
static const uint8_t INVALID = 0;
static const uint32_t NO_PARAMETER = 0;
enum ReadWriteMode_t {
VAR_READ, VAR_WRITE, VAR_READ_WRITE
};
/**
* @brief This is an empty virtual destructor,
* as it is proposed for C++ interfaces.
* \brief This is an empty virtual destructor, as it is proposed for C++ interfaces.
*/
virtual ~PoolVariableIF() {}
virtual ~PoolVariableIF() {
}
/**
* @brief This method returns if the variable is write-only,
* read-write or read-only.
* \brief This method returns if the variable is write-only, read-write or read-only.
*/
virtual ReadWriteMode_t getReadWriteMode() const = 0;
/**
* @brief This operation shall return the data pool id of the variable.
* \brief This operation shall return the data pool id of the variable.
*/
virtual uint32_t getDataPoolId() const = 0;
/**
* @brief With this call, the valid information of the
* variable is returned.
* \brief With this call, the valid information of the variable is returned.
*/
virtual bool isValid() const = 0;
/**
* @brief With this call, the valid information of the variable is set.
* \brief With this call, the valid information of the variable is set.
*/
virtual void setValid(bool validity) = 0;
virtual void setValid(uint8_t validity) = 0;
/**
* @brief The commit call shall write back a newly calculated local
* value to the data pool.
* @details
* It is assumed that these calls are implemented in a thread-safe manner!
*/
virtual ReturnValue_t commit(uint32_t lockTimeout) = 0;
/**
* @brief The read call shall read the value of this parameter from
* the data pool and store the content locally.
* @details
* It is assumbed that these calls are implemented in a thread-safe manner!
*/
virtual ReturnValue_t read(uint32_t lockTimeout) = 0;
protected:
/**
* @brief Same as commit with the difference that comitting will be
* performed without a lock
* @return
* This can be used if the lock protection is handled externally
* to avoid the overhead of locking and unlocking consecutively.
* Declared protected to avoid free public usage.
*/
virtual ReturnValue_t readWithoutLock() = 0;
/**
* @brief Same as commit with the difference that comitting will be
* performed without a lock
* @return
* This can be used if the lock protection is handled externally
* to avoid the overhead of locking and unlocking consecutively.
* Declared protected to avoid free public usage.
*/
virtual ReturnValue_t commitWithoutLock() = 0;
};
using pool_rwm_t = PoolVariableIF::ReadWriteMode_t;
#endif /* POOLVARIABLEIF_H_ */

233
datapool/PoolVector.h Normal file
View File

@ -0,0 +1,233 @@
/*
* \file PoolVector.h
*
* \brief This file contains the PoolVector class, the header only class to handle data pool vectors.
*
* \date 10/23/2012
*
* \author Bastian Baetz
*/
#ifndef POOLVECTOR_H_
#define POOLVECTOR_H_
#include "DataSetIF.h"
#include "PoolEntry.h"
#include "PoolVariableIF.h"
#include "../serialize/SerializeAdapter.h"
#include "../serviceinterface/ServiceInterfaceStream.h"
/**
* \brief This is the access class for array-type data pool entries.
*
* \details To ensure safe usage of the data pool, operation is not done directly on the data pool
* entries, but on local copies. This class provides simple type- and length-safe access
* to vector-style data pool entries (i.e. entries with length > 1).
* The class can be instantiated as read-write and read only.
* It provides a commit-and-roll-back semantic, which means that no array entry in
* the data pool is changed until the commit call is executed.
* There are two template parameters:
* \tparam T This template parameter specifies the data type of an array entry. Currently, all
* plain data types are supported, but in principle any type is possible.
* \tparam vector_size This template parameter specifies the vector size of this entry.
* Using a template parameter for this is not perfect, but avoids dynamic memory allocation.
* \ingroup data_pool
*/
template<typename T, uint16_t vector_size>
class PoolVector: public PoolVariableIF {
private:
/**
* \brief To access the correct data pool entry on read and commit calls, the data pool id
* is stored.
*/
uint32_t dataPoolId;
/**
* \brief The valid information as it was stored in the data pool is copied to this attribute.
*/
uint8_t valid;
/**
* \brief The information whether the class is read-write or read-only is stored here.
*/
ReadWriteMode_t readWriteMode;
protected:
/**
* \brief This is a call to read the array's values from the global data pool.
* \details When executed, this operation tries to fetch the pool entry with matching
* data pool id from the global data pool and copies all array values and the valid
* information to its local attributes. In case of a failure (wrong type, size or
* pool id not found), the variable is set to zero and invalid.
* The operation does NOT provide any mutual exclusive protection by itself.
*/
ReturnValue_t read() {
PoolEntry<T>* read_out = ::dataPool.getData<T>(this->dataPoolId,
vector_size);
if (read_out != NULL) {
this->valid = read_out->valid;
memcpy(this->value, read_out->address, read_out->getByteSize());
return HasReturnvaluesIF::RETURN_OK;
} else {
memset(this->value, 0, vector_size * sizeof(T));
sif::error << "PoolVector: read of DP Variable 0x" << std::hex
<< dataPoolId << std::dec << " failed." << std::endl;
this->valid = INVALID;
return HasReturnvaluesIF::RETURN_FAILED;
}
}
/**
* \brief The commit call copies the array values back to the data pool.
* \details It checks type and size, as well as if the variable is writable. If so,
* the value is copied and the valid flag is automatically set to "valid".
* The operation does NOT provide any mutual exclusive protection by itself.
*
*/
ReturnValue_t commit() {
PoolEntry<T>* write_back = ::dataPool.getData<T>(this->dataPoolId,
vector_size);
if ((write_back != NULL) && (this->readWriteMode != VAR_READ)) {
write_back->valid = valid;
memcpy(write_back->address, this->value, write_back->getByteSize());
return HasReturnvaluesIF::RETURN_OK;
} else {
return HasReturnvaluesIF::RETURN_FAILED;
}
}
public:
/**
* \brief This is the local copy of the data pool entry.
* \detials The user can work on this attribute
* just like he would on a local array of this type.
*/
T value[vector_size];
/**
* \brief In the constructor, the variable can register itself in a DataSet (if not NULL is
* passed).
* \details It DOES NOT fetch the current value from the data pool, but sets the value
* attribute to default (0). The value is fetched within the read() operation.
* \param set_id This is the id in the global data pool this instance of the access class
* corresponds to.
* \param dataSet The data set in which the variable shall register itself. If NULL,
* the variable is not registered.
* \param setWritable If this flag is set to true, changes in the value attribute can be
* written back to the data pool, otherwise not.
*/
PoolVector(uint32_t set_id, DataSetIF* set,
ReadWriteMode_t setReadWriteMode) :
dataPoolId(set_id), valid(false), readWriteMode(setReadWriteMode) {
memset(this->value, 0, vector_size * sizeof(T));
if (set != NULL) {
set->registerVariable(this);
}
}
/**
* Copy ctor to copy classes containing Pool Variables.
*/
// PoolVector(const PoolVector& rhs) {
// PoolVector<T, vector_size> temp(rhs.dataPoolId, rhs.)
// memcpy(value, rhs.value, sizeof(T)*vector_size);
// }
/**
* \brief The classes destructor is empty.
* \details If commit() was not called, the local value is
* discarded and not written back to the data pool.
*/
~PoolVector() {
}
;
/**
* \brief The operation returns the number of array entries in this variable.
*/
uint8_t getSize() {
return vector_size;
}
/**
* \brief This operation returns the data pool id of the variable.
*/
uint32_t getDataPoolId() const {
return dataPoolId;
}
/**
* This operation sets the data pool id of the variable.
* The method is necessary to set id's of data pool member variables with bad initialization.
*/
void setDataPoolId(uint32_t poolId) {
dataPoolId = poolId;
}
/**
* This method returns if the variable is write-only, read-write or read-only.
*/
ReadWriteMode_t getReadWriteMode() const {
return readWriteMode;
}
;
/**
* \brief With this call, the valid information of the variable is returned.
*/
bool isValid() const {
if (valid != INVALID)
return true;
else
return false;
}
void setValid(uint8_t valid) {
this->valid = valid;
}
uint8_t getValid() {
return valid;
}
T &operator [](int i) {
return value[i];
}
const T &operator [](int i) const {
return value[i];
}
PoolVector<T, vector_size> &operator=(
PoolVector<T, vector_size> newPoolVector) {
for (uint16_t i = 0; i < vector_size; i++) {
this->value[i] = newPoolVector.value[i];
}
return *this;
}
virtual ReturnValue_t serialize(uint8_t** buffer, size_t* size,
size_t maxSize, Endianness streamEndianness) const {
uint16_t i;
ReturnValue_t result;
for (i = 0; i < vector_size; i++) {
result = SerializeAdapter::serialize(&(value[i]), buffer, size,
maxSize, streamEndianness);
if (result != HasReturnvaluesIF::RETURN_OK) {
return result;
}
}
return result;
}
virtual size_t getSerializedSize() const {
return vector_size * SerializeAdapter::getSerializedSize(value);
}
virtual ReturnValue_t deSerialize(const uint8_t** buffer, size_t* size,
Endianness streamEndianness) {
uint16_t i;
ReturnValue_t result;
for (i = 0; i < vector_size; i++) {
result = SerializeAdapter::deSerialize(&(value[i]), buffer, size,
streamEndianness);
if (result != HasReturnvaluesIF::RETURN_OK) {
return result;
}
}
return result;
}
};
#endif /* POOLVECTOR_H_ */

View File

@ -1,132 +0,0 @@
#include <framework/datapoolglob/GlobalDataPool.h>
#include <framework/serviceinterface/ServiceInterfaceStream.h>
#include <framework/ipc/MutexFactory.h>
GlobalDataPool::GlobalDataPool(
void(*initFunction)(GlobPoolMap* pool_map)) {
mutex = MutexFactory::instance()->createMutex();
if (initFunction != NULL ) {
initFunction( &this->globDataPool );
}
}
GlobalDataPool::~GlobalDataPool() {
MutexFactory::instance()->deleteMutex(mutex);
for(GlobPoolMapIter it = this->globDataPool.begin();
it != this->globDataPool.end(); ++it )
{
delete it->second;
}
}
// The function checks PID, type and array length before returning a copy of
// the PoolEntry. In failure case, it returns a temp-Entry with size 0 and NULL-ptr.
template <typename T> PoolEntry<T>* GlobalDataPool::getData( uint32_t data_pool_id,
uint8_t sizeOrPosition ) {
GlobPoolMapIter it = this->globDataPool.find( data_pool_id );
if ( it != this->globDataPool.end() ) {
PoolEntry<T>* entry = dynamic_cast< PoolEntry<T>* >( it->second );
if (entry != nullptr ) {
if ( sizeOrPosition <= entry->length ) {
return entry;
}
}
}
return nullptr;
}
PoolEntryIF* GlobalDataPool::getRawData( uint32_t data_pool_id ) {
GlobPoolMapIter it = this->globDataPool.find( data_pool_id );
if ( it != this->globDataPool.end() ) {
return it->second;
} else {
return nullptr;
}
}
ReturnValue_t GlobalDataPool::unlockDataPool() {
ReturnValue_t status = mutex->unlockMutex();
if(status != RETURN_OK) {
sif::error << "DataPool::DataPool: unlock of mutex failed with"
" error code: " << status << std::endl;
}
return status;
}
ReturnValue_t GlobalDataPool::lockDataPool(uint32_t timeoutMs) {
ReturnValue_t status = mutex->lockMutex(timeoutMs);
if(status != RETURN_OK) {
sif::error << "DataPool::DataPool: lock of mutex failed "
"with error code: " << status << std::endl;
}
return status;
}
void GlobalDataPool::print() {
sif::debug << "DataPool contains: " << std::endl;
std::map<uint32_t, PoolEntryIF*>::iterator dataPoolIt;
dataPoolIt = this->globDataPool.begin();
while( dataPoolIt != this->globDataPool.end() ) {
sif::debug << std::hex << dataPoolIt->first << std::dec << " |";
dataPoolIt->second->print();
dataPoolIt++;
}
}
uint32_t GlobalDataPool::PIDToDataPoolId(uint32_t parameter_id) {
return (parameter_id >> 8) & 0x00FFFFFF;
}
uint8_t GlobalDataPool::PIDToArrayIndex(uint32_t parameter_id) {
return (parameter_id & 0x000000FF);
}
uint32_t GlobalDataPool::poolIdAndPositionToPid(uint32_t poolId, uint8_t index) {
return (poolId << 8) + index;
}
//SHOULDDO: Do we need a mutex lock here... I don't think so,
//as we only check static const values of elements in a list that do not change.
//there is no guarantee in the standard, but it seems to me that the implementation is safe -UM
ReturnValue_t GlobalDataPool::getType(uint32_t parameter_id, Type* type) {
GlobPoolMapIter it = this->globDataPool.find( PIDToDataPoolId(parameter_id));
if ( it != this->globDataPool.end() ) {
*type = it->second->getType();
return RETURN_OK;
} else {
*type = Type::UNKNOWN_TYPE;
return RETURN_FAILED;
}
}
bool GlobalDataPool::exists(uint32_t parameterId) {
uint32_t poolId = PIDToDataPoolId(parameterId);
uint32_t index = PIDToArrayIndex(parameterId);
GlobPoolMapIter it = this->globDataPool.find( poolId );
if (it != globDataPool.end()) {
if (it->second->getSize() >= index) {
return true;
}
}
return false;
}
template PoolEntry<uint8_t>* GlobalDataPool::getData<uint8_t>(
uint32_t data_pool_id, uint8_t size );
template PoolEntry<uint16_t>* GlobalDataPool::getData<uint16_t>(
uint32_t data_pool_id, uint8_t size );
template PoolEntry<uint32_t>* GlobalDataPool::getData<uint32_t>(
uint32_t data_pool_id, uint8_t size );
template PoolEntry<uint64_t>* GlobalDataPool::getData<uint64_t>(
uint32_t data_pool_id, uint8_t size);
template PoolEntry<int8_t>* GlobalDataPool::getData<int8_t>(
uint32_t data_pool_id, uint8_t size );
template PoolEntry<int16_t>* GlobalDataPool::getData<int16_t>(
uint32_t data_pool_id, uint8_t size );
template PoolEntry<int32_t>* GlobalDataPool::getData<int32_t>(
uint32_t data_pool_id, uint8_t size );
template PoolEntry<float>* GlobalDataPool::getData<float>(
uint32_t data_pool_id, uint8_t size );
template PoolEntry<double>* GlobalDataPool::getData<double>(
uint32_t data_pool_id, uint8_t size);

View File

@ -1,149 +0,0 @@
#ifndef GLOBALDATAPOOL_H_
#define GLOBALDATAPOOL_H_
#include <framework/datapool/PoolEntry.h>
#include <framework/globalfunctions/Type.h>
#include <framework/ipc/MutexIF.h>
#include <map>
/**
* @defgroup data_pool Global data pool
* This is the group, where all classes associated with global
* data pool handling belong to.
* This includes classes to access Data Pool variables.
*/
/**
* Typedefs for the global pool representations
*/
using GlobPoolMap = std::map<uint32_t, PoolEntryIF*>;
using GlobPoolMapIter = GlobPoolMap::iterator;
/**
* @brief This class represents the OBSW global data-pool.
*
* @details
* All variables are registered and space is allocated in an initialization
* function, which is passed do the constructor. Space for the variables is
* allocated on the heap (with a new call).
*
* The data is found by a data pool id, which uniquely represents a variable.
* Data pool variables should be used with a blackboard logic in mind,
* which means read data is valid (if flagged so),
* but not necessarily up-to-date.
*
* Variables are either single values or arrays.
* @author Bastian Baetz
* @ingroup data_pool
*/
class GlobalDataPool : public HasReturnvaluesIF {
private:
/**
* @brief This is the actual data pool itself.
* @details It is represented by a map with the data pool id as index
* and a pointer to a single PoolEntry as value.
*/
GlobPoolMap globDataPool;
/**
* @brief The mutex is created in the constructor and makes
* access mutual exclusive.
* @details Locking and unlocking the pool is only done by the DataSet class.
*/
MutexIF* mutex;
public:
/**
* @brief In the classes constructor,
* the passed initialization function is called.
* @details
* To enable filling the pool, a pointer to the map is passed,
* allowing direct access to the pool's content.
* On runtime, adding or removing variables is forbidden.
*/
GlobalDataPool( void ( *initFunction )( GlobPoolMap* pool_map ) );
/**
* @brief The destructor iterates through the data_pool map and
* calls all entries destructors to clean up the heap.
*/
~GlobalDataPool();
/**
* @brief This is the default call to access the pool.
* @details
* A pointer to the PoolEntry object is returned.
* The call checks data pool id, type and array size.
* Returns NULL in case of failure.
* @param data_pool_id The data pool id to search.
* @param sizeOrPosition The array size (not byte size!) of the pool entry,
* or the position the user wants to read.
* If smaller than the entry size, everything's ok.
*/
template <typename T> PoolEntry<T>* getData( uint32_t data_pool_id,
uint8_t sizeOrPosition );
/**
* @brief An alternative call to get a data pool entry in case the type is not implicitly known
* (i.e. in Housekeeping Telemetry).
* @details It returns a basic interface and does NOT perform
* a size check. The caller has to assure he does not copy too much data.
* Returns NULL in case the entry is not found.
* @param data_pool_id The data pool id to search.
*/
PoolEntryIF* getRawData( uint32_t data_pool_id );
/**
* @brief This is a small helper function to facilitate locking the global data pool.
* @details It fetches the pool's mutex id and tries to acquire the mutex.
*/
ReturnValue_t lockDataPool(uint32_t timeoutMs = MutexIF::BLOCKING);
/**
* @brief This is a small helper function to facilitate unlocking the global data pool.
* @details It fetches the pool's mutex id and tries to free the mutex.
*/
ReturnValue_t unlockDataPool();
/**
* @brief The print call is a simple debug method.
* @details It prints the current content of the data pool.
* It iterates through the data_pool map and calls each entry's print() method.
*/
void print();
/**
* Extracts the data pool id from a SCOS 2000 PID.
* @param parameter_id The passed Parameter ID.
* @return The data pool id as used within the OBSW.
*/
static uint32_t PIDToDataPoolId( uint32_t parameter_id );
/**
* Extracts an array index out of a SCOS 2000 PID.
* @param parameter_id The passed Parameter ID.
* @return The index of the corresponding data pool entry.
*/
static uint8_t PIDToArrayIndex( uint32_t parameter_id );
/**
* Retransforms a data pool id and an array index to a SCOS 2000 PID.
*/
static uint32_t poolIdAndPositionToPid( uint32_t poolId, uint8_t index );
/**
* Method to return the type of a pool variable.
* @param parameter_id A parameterID (not pool id) of a DP member.
* @param type Returns the type or TYPE::UNKNOWN_TYPE
* @return RETURN_OK if parameter exists, RETURN_FAILED else.
*/
ReturnValue_t getType( uint32_t parameter_id, Type* type );
/**
* Method to check if a PID exists. Does not lock, as there's no
* possibility to alter the list that is checked during run-time.
* @param parameterId The PID (not pool id!) of a parameter.
* @return true if exists, false else.
*/
bool exists(uint32_t parameterId);
};
//We assume someone globally instantiates a DataPool.
namespace glob {
extern GlobalDataPool dataPool;
}
#endif /* DATAPOOL_H_ */

View File

@ -1,44 +0,0 @@
#include <framework/datapoolglob/GlobalDataPool.h>
#include <framework/datapoolglob/GlobalDataSet.h>
#include <framework/serviceinterface/ServiceInterfaceStream.h>
GlobDataSet::GlobDataSet(): DataSetBase(
reinterpret_cast<PoolVariableIF**>(&registeredVariables),
DATA_SET_MAX_SIZE) {}
// Don't do anything with your variables, they are dead already!
// (Destructor is already called)
GlobDataSet::~GlobDataSet() {}
ReturnValue_t GlobDataSet::commit(bool valid, uint32_t lockTimeout) {
setEntriesValid(valid);
setSetValid(valid);
return commit(lockTimeout);
}
ReturnValue_t GlobDataSet::commit(uint32_t lockTimeout) {
return DataSetBase::commit(lockTimeout);
}
ReturnValue_t GlobDataSet::unlockDataPool() {
return glob::dataPool.unlockDataPool();
}
ReturnValue_t GlobDataSet::lockDataPool(uint32_t timeoutMs) {
return glob::dataPool.lockDataPool(timeoutMs);
}
void GlobDataSet::setEntriesValid(bool valid) {
for (uint16_t count = 0; count < fillCount; count++) {
if (registeredVariables[count]->getReadWriteMode()
!= PoolVariableIF::VAR_READ) {
registeredVariables[count]->setValid(valid);
}
}
}
void GlobDataSet::setSetValid(bool valid) {
this->valid = valid;
}

View File

@ -1,96 +0,0 @@
#ifndef FRAMEWORK_DATAPOOLGLOB_DATASET_H_
#define FRAMEWORK_DATAPOOLGLOB_DATASET_H_
#include <framework/datapool/DataSetBase.h>
/**
* @brief The DataSet class manages a set of locally checked out variables
* for the global data pool.
* @details
* This class uses the read-commit() semantic provided by the DataSetBase class.
* It extends the base class by using the global data pool,
* having a valid state and implementing lock und unlock calls for the global
* datapool.
*
* For more information on how this class works, see the DataSetBase
* documentation.
* @author Bastian Baetz
* @ingroup data_pool
*/
class GlobDataSet: public DataSetBase {
public:
/**
* @brief Creates an empty GlobDataSet. Use registerVariable or
* supply a pointer to this dataset to PoolVariable
* initializations to register pool variables.
*/
GlobDataSet();
/**
* @brief The destructor automatically manages writing the valid
* information of variables.
* @details
* In case the data set was read out, but not committed(indicated by state),
* the destructor parses all variables that are still registered to the set.
* For each, the valid flag in the data pool is set to "invalid".
*/
~GlobDataSet();
/**
* Variant of method above which sets validity of all elements of the set.
* @param valid Validity information from PoolVariableIF.
* @return - @c RETURN_OK if all variables were read successfully.
* - @c COMMITING_WITHOUT_READING if set was not read yet and
* contains non write-only variables
*/
ReturnValue_t commit(bool valid, uint32_t lockTimeout = MutexIF::BLOCKING);
ReturnValue_t commit(uint32_t lockTimeout = MutexIF::BLOCKING) override;
/**
* Set all entries
* @param valid
*/
void setSetValid(bool valid);
/**
* Set the valid information of all variables contained in the set which
* are not read-only
*
* @param valid Validity information from PoolVariableIF.
*/
void setEntriesValid(bool valid);
//!< This definition sets the maximum number of variables to
//! register in one DataSet.
static const uint8_t DATA_SET_MAX_SIZE = 63;
private:
/**
* If the valid state of a dataset is always relevant to the whole
* data set we can use this flag.
*/
bool valid = false;
/**
* @brief This is a small helper function to facilitate locking
* the global data pool.
* @details
* It makes use of the lockDataPool method offered by the DataPool class.
*/
ReturnValue_t lockDataPool(uint32_t timeoutMs) override;
/**
* @brief This is a small helper function to facilitate
* unlocking the global data pool
* @details
* It makes use of the freeDataPoolLock method offered by the DataPool class.
*/
ReturnValue_t unlockDataPool() override;
void handleAlreadyReadDatasetCommit();
ReturnValue_t handleUnreadDatasetCommit();
PoolVariableIF* registeredVariables[DATA_SET_MAX_SIZE];
};
#endif /* FRAMEWORK_DATAPOOLGLOB_DATASET_H_ */

View File

@ -1,213 +0,0 @@
#ifndef GLOBALPOOLVARIABLE_H_
#define GLOBALPOOLVARIABLE_H_
#include <framework/datapool/DataSetIF.h>
#include <framework/datapoolglob/GlobalDataPool.h>
#include <framework/datapool/PoolVariableIF.h>
#include <framework/datapool/PoolEntry.h>
#include <framework/serialize/SerializeAdapter.h>
#include <framework/serviceinterface/ServiceInterfaceStream.h>
template<typename T, uint8_t n_var> class PoolVarList;
/**
* @brief This is the access class for non-array data pool entries.
*
* @details
* To ensure safe usage of the data pool, operation is not done directly
* on the data pool entries, but on local copies. This class provides simple
* type-safe access to single data pool entries (i.e. entries with length = 1).
* The class can be instantiated as read-write and read only.
* It provides a commit-and-roll-back semantic, which means that the
* variable's value in the data pool is not changed until the
* commit call is executed.
* @tparam T The template parameter sets the type of the variable.
* Currently, all plain data types are supported, but in principle
* any type is possible.
* @ingroup data_pool
*/
template<typename T>
class GlobPoolVar: public PoolVariableIF {
template<typename U, uint8_t n_var> friend class PoolVarList;
static_assert(not std::is_same<T, bool>::value,
"Do not use boolean for the PoolEntry type, use uint8_t instead!"
"There is no boolean type in CCSDS.");
public:
/**
* @brief In the constructor, the variable can register itself in a
* DataSet (if nullptr is not passed).
* @details
* It DOES NOT fetch the current value from the data pool, but
* sets the value attribute to default (0).
* The value is fetched within the read() operation.
* @param set_id This is the id in the global data pool
* this instance of the access class corresponds to.
* @param dataSet The data set in which the variable shall register
* itself. If NULL, the variable is not registered.
* @param setWritable If this flag is set to true, changes in the value
* attribute can be written back to the data pool, otherwise not.
*/
GlobPoolVar(uint32_t set_id, DataSetIF* dataSet,
ReadWriteMode_t setReadWriteMode);
/**
* @brief This is the local copy of the data pool entry.
* @details The user can work on this attribute
* just like he would on a simple local variable.
*/
T value = 0;
/**
* @brief Copy ctor to copy classes containing Pool Variables.
* (Robin): This only copies member variables, which is done
* by the default copy ctor. maybe we can ommit this ctor?
*/
GlobPoolVar(const GlobPoolVar& rhs);
/**
* @brief The classes destructor is empty.
* @details If commit() was not called, the local value is
* discarded and not written back to the data pool.
*/
~GlobPoolVar() {}
/**
* @brief This is a call to read the value from the global data pool.
* @details
* When executed, this operation tries to fetch the pool entry with matching
* data pool id from the global data pool and copies the value and the valid
* information to its local attributes. In case of a failure (wrong type or
* pool id not found), the variable is set to zero and invalid.
* The read call is protected with a lock.
* It is recommended to use DataSets to read and commit multiple variables
* at once to avoid the overhead of unnecessary lock und unlock operations.
*/
ReturnValue_t read(uint32_t lockTimeout) override;
/**
* @brief The commit call writes back the variable's value to the data pool.
* @details
* It checks type and size, as well as if the variable is writable. If so,
* the value is copied and the valid flag is automatically set to "valid".
* The operation does NOT provide any mutual exclusive protection by itself.
* The commit call is protected with a lock.
* It is recommended to use DataSets to read and commit multiple variables
* at once to avoid the overhead of unnecessary lock und unlock operations.
*/
ReturnValue_t commit(uint32_t lockTimeout) override;
protected:
/**
* @brief Like #read, but without a lock protection of the global pool.
* @details
* The operation does NOT provide any mutual exclusive protection by itself.
* This can be used if the lock is handled externally to avoid the overhead
* of consecutive lock und unlock operations.
* Declared protected to discourage free public usage.
*/
ReturnValue_t readWithoutLock() override;
/**
* @brief Like #commit, but without a lock protection of the global pool.
* @details
* The operation does NOT provide any mutual exclusive protection by itself.
* This can be used if the lock is handled externally to avoid the overhead
* of consecutive lock und unlock operations.
* Declared protected to discourage free public usage.
*/
ReturnValue_t commitWithoutLock() override;
/**
* @brief To access the correct data pool entry on read and commit calls,
* the data pool is stored.
*/
uint32_t dataPoolId;
/**
* @brief The valid information as it was stored in the data pool is
* copied to this attribute.
*/
uint8_t valid;
/**
* @brief The information whether the class is read-write or read-only
* is stored here.
*/
pool_rwm_t readWriteMode;
/**
* Empty ctor for List initialization
*/
GlobPoolVar();
public:
/**
* \brief This operation returns the data pool id of the variable.
*/
uint32_t getDataPoolId() const override;
/**
* This method returns if the variable is write-only, read-write or read-only.
*/
ReadWriteMode_t getReadWriteMode() const override;
/**
* This operation sets the data pool id of the variable.
* The method is necessary to set id's of data pool member variables with bad initialization.
*/
void setDataPoolId(uint32_t poolId);
/**
* \brief With this call, the valid information of the variable is returned.
*/
bool isValid() const override;
uint8_t getValid();
void setValid(bool valid) override;
operator T() {
return value;
}
operator T() const {
return value;
}
GlobPoolVar<T> &operator=(T newValue) {
value = newValue;
return *this;
}
GlobPoolVar<T> &operator=(GlobPoolVar<T> newPoolVariable) {
value = newPoolVariable.value;
return *this;
}
virtual ReturnValue_t serialize(uint8_t** buffer, size_t* size,
const size_t max_size,
SerializeIF::Endianness streamEndianness) const override {
return SerializeAdapter::serialize(&value, buffer, size, max_size,
streamEndianness);
}
virtual size_t getSerializedSize() const {
return SerializeAdapter::getSerializedSize(&value);
}
virtual ReturnValue_t deSerialize(const uint8_t** buffer, size_t* size,
SerializeIF::Endianness streamEndianness) {
return SerializeAdapter::deSerialize(&value, buffer, size,
streamEndianness);
}
};
#include <framework/datapoolglob/GlobalPoolVariable.tpp>
typedef GlobPoolVar<uint8_t> gp_bool_t;
typedef GlobPoolVar<uint8_t> gp_uint8_t;
typedef GlobPoolVar<uint16_t> gp_uint16_t;
typedef GlobPoolVar<uint32_t> gp_uint32_t;
typedef GlobPoolVar<int8_t> gp_int8_t;
typedef GlobPoolVar<int16_t> gp_int16_t;
typedef GlobPoolVar<int32_t> gp_int32_t;
typedef GlobPoolVar<float> gp_float_t;
typedef GlobPoolVar<double> gp_double_t;
#endif /* POOLVARIABLE_H_ */

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