Compare commits
380 Commits
meier/upst
...
mohr/dhb2n
Author | SHA1 | Date | |
---|---|---|---|
f805667779 | |||
bddc7a7ca6 | |||
11a22577be | |||
94f1f1f908 | |||
955579c856 | |||
c6585c8645 | |||
d8a4675842 | |||
1164c21ddd | |||
77b1a85b47 | |||
f3e9277e59 | |||
d592f1ecbc | |||
6ec18171a8 | |||
518dcdef4b | |||
d9730032fd | |||
b3ac72b7db | |||
cd0cb43412 | |||
32c12b3dbf | |||
3e9acf476e | |||
99101ce2bf | |||
6b991045f7 | |||
337cb0d6c9 | |||
c283e0c988 | |||
448d20f3bd | |||
2316728d74 | |||
6f562e5f3e | |||
176f243194 | |||
d964fa2107 | |||
7b5ae6a445 | |||
8e362a000c | |||
7877776e24 | |||
3de0ae5a48 | |||
95ac53c417 | |||
62f638a3d2 | |||
bd64591f30 | |||
e6a877f048 | |||
ea8c557ee8 | |||
0bdd780f82 | |||
9ec397c8b7 | |||
c54d9d7ba6 | |||
30c03c110c | |||
69f1be263a | |||
c7b5309dcb | |||
775d5632de | |||
4f3361eb2b | |||
9e6c1d60e5 | |||
12d0c23c13 | |||
5c3bb13834 | |||
292fe3e5e4 | |||
33530f2819 | |||
c0000a8635 | |||
5488ee715f | |||
0fea22d031 | |||
3b8ca09299 | |||
9a2146fa2d | |||
558550ecb9 | |||
72172a972b | |||
b4b11ebd3b | |||
bcbbc9763a | |||
0042372cb6 | |||
8dea13742f | |||
0f027d29d2 | |||
131e3ff1e3 | |||
423a9540ed | |||
ce7146e468 | |||
a681a4a797 | |||
83b7b8707c | |||
4002b74ea2 | |||
1a833e2d45 | |||
8df6d934d7 | |||
5363868120 | |||
8501477a78 | |||
6eea711d9f | |||
9a181aa6a8 | |||
655c944c0e | |||
2e310fca8d | |||
37390dfc74 | |||
1efc0d2855 | |||
237e29cc59 | |||
0849c8a08d | |||
9d626e0a5d | |||
0ce568ad26 | |||
6970068d56 | |||
af282c7d3e | |||
21a9d89fb3 | |||
3257935150 | |||
f34cf9095d | |||
24ecf125a3 | |||
6451a16888 | |||
fa5605c959 | |||
8e835be55f | |||
9bd600c488 | |||
9c7248e78e | |||
ecf51b2913 | |||
8bbde05413 | |||
d79b5348d8 | |||
92e3ab04f3 | |||
003a6d00fa | |||
9ee1896553 | |||
a5b5523111 | |||
62cd39e573 | |||
278ed36db8 | |||
aed30d54ef | |||
1126db2c8a | |||
a64a04d7fe | |||
80467bf097 | |||
6a6aa7fdd6 | |||
7e379d2159 | |||
6ae709acc3 | |||
d52f335455 | |||
04b619a15c | |||
282704e0fd | |||
07ef9a0ec3 | |||
80464f2a81 | |||
16688316a8 | |||
3583e30ee6 | |||
1e395dc402 | |||
f5421e9abd | |||
4c3f9feb93 | |||
b7ed8ff390 | |||
75dc7a405d | |||
b7a1f79d5b | |||
f0b7a103d4 | |||
ee93f4a4ca | |||
d64ad71529 | |||
26bc80964e | |||
eb03bf52a6 | |||
80355910ee | |||
04800df31e | |||
1e85cdadfd | |||
ebc02673dd | |||
9202c6c17f | |||
5f8c549993 | |||
04bff7a522 | |||
5c20cc804e | |||
eb8e236cd4 | |||
7dec45ccf2 | |||
2b01e86f9c | |||
60fd3d43c0 | |||
67980cb592 | |||
3010f2f925 | |||
01651f0521 | |||
c7f300671f | |||
7d3223d766 | |||
7ae82a5cb4 | |||
28ecd0e5c6 | |||
7345c18b04 | |||
158007fa7f | |||
ab719a3e59 | |||
64a7fde301 | |||
9131ca688b | |||
8e6cee7761 | |||
c756297e5c | |||
0f27c7e7e7 | |||
20d42add03 | |||
a9277622ce | |||
aea9db75cb | |||
9fedd03ed8 | |||
10fc4dd89d | |||
0cc8af5eb0 | |||
92d65aa3a5 | |||
342a56410c | |||
2cab73d972 | |||
cb23911ccd | |||
b499dedd76 | |||
1bb487373d | |||
3bffb4f968 | |||
6bcb208968 | |||
6c2b5ab39e | |||
a7039bad41 | |||
6605ffb6b1 | |||
e2e0190cae | |||
fd278e410b | |||
ff4cbea571 | |||
a46d8c34d9 | |||
ba5c6410d6 | |||
10f34e5a48 | |||
dab1b1d067 | |||
8c8d1cfa84 | |||
2a4ab0af7b | |||
7c59df3f1c | |||
ff6de8e378 | |||
239d053562 | |||
875174c4ad | |||
8fd8a37f59 | |||
217276d50c | |||
d2ac3603a5 | |||
f63f3fa564 | |||
fc34d56239 | |||
1037102349 | |||
221361eb9c | |||
7f9269b387 | |||
4224c3d009 | |||
62fe75ee40 | |||
9e064fe800 | |||
d7ec04bf4b | |||
adcc375f25 | |||
94a718ff19 | |||
4a10f76784 | |||
57ce5d1f34 | |||
90963b3940 | |||
71ed95b09a | |||
7ac4f1c64d | |||
9d64b96e9a | |||
5de2c6af66 | |||
ca2efb6021 | |||
3b000d924a | |||
deeeef553b | |||
0e7ec79af9 | |||
d3cabd8984 | |||
8efe85cb15 | |||
b28c26b288 | |||
8b4253bc46 | |||
9796abfc7d | |||
e6957de166 | |||
cc56b00df3 | |||
43048c852a | |||
19817bd3a5 | |||
1db04cf20c | |||
52ee50ba8c | |||
96f092ef75 | |||
4a4d23573d | |||
47e148af8f | |||
c9bec03f00 | |||
6c5c59cad8 | |||
03e12a2388 | |||
da106fd96f | |||
fc3412fa35 | |||
8f6f0e1d45 | |||
1b5fa2a8fa | |||
cb118176a0 | |||
30ba9ab916 | |||
fb4ba487b5 | |||
72bc5d4d60 | |||
5355e63711 | |||
b11cdf6184 | |||
dc31358d52 | |||
b485afea57 | |||
5bb7023ff3 | |||
85dbef20b0 | |||
93acac02f5 | |||
7e8afcc12f | |||
f03b7cd660 | |||
d641d63531 | |||
4e571e5082 | |||
356d778743 | |||
0a38d2e22d | |||
234ccdf764 | |||
f591b9793c | |||
c5ad9b5fa9 | |||
083d08ae2a | |||
740644f2c8 | |||
059fb10558 | |||
86692e202d | |||
064b195c75 | |||
18ee2ab903 | |||
9eb652e585 | |||
e7d9979078 | |||
681738dcc6 | |||
152c01b2ec | |||
8bf0fb9885 | |||
1954ce0ea4 | |||
d98b79cf5e | |||
f14c812aff | |||
146a0e3828 | |||
75c824ec80 | |||
332e9dbfd5 | |||
f1c37203a4 | |||
500a5602bd | |||
4ed028000d | |||
88ebb67c8d | |||
b827bd8370 | |||
bdf71d4e66 | |||
e48b6f1432 | |||
747243684d | |||
db33f9cc7e | |||
c12669fe50 | |||
6d00fc65c0 | |||
7d87274844 | |||
c83f75c515 | |||
586993c081 | |||
a88f767cca | |||
935e135f1c | |||
6d0fa36f8a | |||
8f07133e2c | |||
f11433e50f | |||
5fd5d488ff | |||
edc5a314b8 | |||
f80be9e9fa | |||
f3af88ae40 | |||
380f1d0206 | |||
54fc35eae7 | |||
05d4162f5b | |||
e030878023 | |||
9ee6da47e9 | |||
1a7d7b172b | |||
36e3956efb | |||
180210dc38 | |||
ca1e921b94 | |||
2a34c831b1 | |||
e2ad37e3e6 | |||
973d4ee8a5 | |||
899d021e00 | |||
4989bd0f02 | |||
832367fb30 | |||
63ee88af17 | |||
4921527022 | |||
f0c8fd2688 | |||
c96e304b68 | |||
d474c4a7ee | |||
3708df2423 | |||
f629d60aaf | |||
b809f90e72 | |||
f2bf4b463e | |||
b66fd63cb4 | |||
fd55de9e95 | |||
8e05fc0417 | |||
55a238d553 | |||
9ccd9fd775 | |||
ddad97033d | |||
99aaf7068d | |||
c9d37e8d62 | |||
42a1d6cccd | |||
133894f4ba | |||
cb05329dd9 | |||
b350018cad | |||
2dfbce6174 | |||
cecaec6007 | |||
f28b9ea61b | |||
9275ccb79b | |||
67776241de | |||
bfee4fd90a | |||
0dfaba81f9 | |||
affde6bad5 | |||
0981ee6f7e | |||
61bc867bed | |||
5af3138e81 | |||
08e0b0f1a0 | |||
23f264096c | |||
e5ee96259d | |||
9bbe1dc716 | |||
d8b6cb39ac | |||
be35bd53a6 | |||
9860061fc6 | |||
d80941514f | |||
6c636661b6 | |||
5fffbd4a90 | |||
95b476d4bd | |||
3d2af203f2 | |||
74794bb71b | |||
ddf38b65c3 | |||
490a80e49f | |||
6f751c2cf9 | |||
e4d7182d93 | |||
8b6dd3f868 | |||
f6ede7cd3e | |||
4da18172b3 | |||
7e2fdc06cd | |||
3c72a42ce1 | |||
0c5f623780 | |||
d7a2eada94 | |||
546e173cef | |||
0a7f2c6646 | |||
2ebefdffae | |||
45792e86b9 | |||
d871f55a89 | |||
ff40a71582 | |||
e1604b292c | |||
d3e7037759 | |||
755dcf66a3 | |||
b7ffd2653b | |||
7a5ce57bbc | |||
b7a316008a | |||
f598f7030f | |||
70f575396d | |||
ad57e6713e | |||
23f8e5cb41 | |||
879223f38f | |||
8a44c498c5 | |||
a891769a02 | |||
df97c582d7 |
59
CHANGELOG.md
59
CHANGELOG.md
@ -8,7 +8,61 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
|
|||||||
|
|
||||||
# [unreleased]
|
# [unreleased]
|
||||||
|
|
||||||
# [v5.0.0]
|
# [v6.0.0]
|
||||||
|
|
||||||
|
## Fixes
|
||||||
|
|
||||||
|
- I2C Bugfixes: Do not keep iterator as member and fix some incorrect handling with the iterator.
|
||||||
|
Also properly reset the reply size for successfull transfers and erroneous transfers.
|
||||||
|
PR: https://egit.irs.uni-stuttgart.de/fsfw/fsfw/pulls/700
|
||||||
|
- Bugfix for Serial Buffer Stream: Setting `doActive` to false now
|
||||||
|
actually fully disables printing.
|
||||||
|
PR: https://egit.irs.uni-stuttgart.de/fsfw/fsfw/pulls/680
|
||||||
|
- `TcpTmTcServer.cpp`: The server was actually not able to handle
|
||||||
|
CCSDS packets which were clumped together. This has been fixed now.
|
||||||
|
PR: https://egit.irs.uni-stuttgart.de/fsfw/fsfw/pulls/673
|
||||||
|
|
||||||
|
## Added
|
||||||
|
|
||||||
|
- Add new `UnsignedByteField` class
|
||||||
|
PR: https://egit.irs.uni-stuttgart.de/fsfw/fsfw/pulls/660
|
||||||
|
|
||||||
|
## Changes
|
||||||
|
|
||||||
|
- Remove default secondary header argument for
|
||||||
|
`uint16_t getTcSpacePacketIdFromApid(uint16_t apid, bool secondaryHeaderFlag)` and
|
||||||
|
`uint16_t getTmSpacePacketIdFromApid(uint16_t apid, bool secondaryHeaderFlag)`
|
||||||
|
PR: https://egit.irs.uni-stuttgart.de/fsfw/fsfw/pulls/689
|
||||||
|
- Removed `HasReturnvaluesIF` class in favor of `returnvalue` namespace with `OK` and `FAILED`
|
||||||
|
constants.
|
||||||
|
PR: https://egit.irs.uni-stuttgart.de/fsfw/fsfw/pulls/659
|
||||||
|
- Overhaul of the TMTC stack, including various changes and improvements
|
||||||
|
for other modules
|
||||||
|
PR: https://egit.irs.uni-stuttgart.de/fsfw/fsfw/pulls/655
|
||||||
|
which also includes a migration guide
|
||||||
|
- Bump Catch2 dependency to regular version `v3.1.0`
|
||||||
|
PR: https://egit.irs.uni-stuttgart.de/fsfw/fsfw/pulls/678
|
||||||
|
- `SerialBufferAdapter`: Rename `setBuffer` to `setConstBuffer` and update
|
||||||
|
API to expect `const uint8_t*` accordingly.
|
||||||
|
PR: https://egit.irs.uni-stuttgart.de/fsfw/fsfw/pulls/677
|
||||||
|
- Remove the following user includes from `fsfw/events/Event.h` and
|
||||||
|
`fsfw/returnvalues/returnvalue.h`:
|
||||||
|
- `#include "events/subsystemIdRanges.h"`
|
||||||
|
- `#include "returnvalues/classIds.h"`
|
||||||
|
The user has to include those themselves now
|
||||||
|
PR: https://egit.irs.uni-stuttgart.de/fsfw/fsfw/pulls/675
|
||||||
|
- `DeviceHandlerBase`: Set command sender before calling `buildCommandFromCommand`.
|
||||||
|
This allows finishing action commands immediately inside the function.
|
||||||
|
PR: https://egit.irs.uni-stuttgart.de/fsfw/fsfw/pulls/672
|
||||||
|
- `DeviceHandlerBase`: New signature of `handleDeviceTm` which expects
|
||||||
|
a `const SerializeIF&` and additional helper variant which expects `const uint8_t*`
|
||||||
|
PR: https://egit.irs.uni-stuttgart.de/fsfw/fsfw/pulls/671
|
||||||
|
- Improvements for `AcceptsTelemetryIF` and `AcceptsTelecommandsIF`:
|
||||||
|
- Make functions `const` where it makes sense
|
||||||
|
- Add `const char* getName const` abstract function
|
||||||
|
PR: https://egit.irs.uni-stuttgart.de/fsfw/fsfw/pulls/684
|
||||||
|
|
||||||
|
# [v5.0.0] 25.07.2022
|
||||||
|
|
||||||
## Changes
|
## Changes
|
||||||
|
|
||||||
@ -23,6 +77,9 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
|
|||||||
PR: https://egit.irs.uni-stuttgart.de/fsfw/fsfw/pulls/572
|
PR: https://egit.irs.uni-stuttgart.de/fsfw/fsfw/pulls/572
|
||||||
- HAL Devicehandlers: Periodic printout is run-time configurable now
|
- HAL Devicehandlers: Periodic printout is run-time configurable now
|
||||||
- `oneShotAction` flag in the `TestTask` class is not static anymore
|
- `oneShotAction` flag in the `TestTask` class is not static anymore
|
||||||
|
- `SimpleRingBuffer::writeData` now checks if the amount is larger than the total size of the
|
||||||
|
Buffer and rejects such writeData calls with `returnvalue::FAILED`
|
||||||
|
PR: https://egit.irs.uni-stuttgart.de/fsfw/fsfw/pulls/586
|
||||||
- Major update for version handling, using `git describe` to fetch version information with git.
|
- Major update for version handling, using `git describe` to fetch version information with git.
|
||||||
PR: https://egit.irs.uni-stuttgart.de/fsfw/fsfw/pulls/601
|
PR: https://egit.irs.uni-stuttgart.de/fsfw/fsfw/pulls/601
|
||||||
- Add helper functions provided by [`cmake-modules`](https://github.com/bilke/cmake-modules)
|
- Add helper functions provided by [`cmake-modules`](https://github.com/bilke/cmake-modules)
|
||||||
|
@ -13,7 +13,7 @@ list(APPEND CMAKE_MODULE_PATH
|
|||||||
# Version file handling #
|
# Version file handling #
|
||||||
# ##############################################################################
|
# ##############################################################################
|
||||||
|
|
||||||
set(FSFW_VERSION_IF_GIT_FAILS 4)
|
set(FSFW_VERSION_IF_GIT_FAILS 5)
|
||||||
set(FSFW_SUBVERSION_IF_GIT_FAILS 0)
|
set(FSFW_SUBVERSION_IF_GIT_FAILS 0)
|
||||||
set(FSFW_REVISION_IF_GIT_FAILS 0)
|
set(FSFW_REVISION_IF_GIT_FAILS 0)
|
||||||
|
|
||||||
@ -80,7 +80,7 @@ set(FSFW_CATCH2_LIB_MAJOR_VERSION
|
|||||||
3
|
3
|
||||||
CACHE STRING "Catch2 library major version requirement")
|
CACHE STRING "Catch2 library major version requirement")
|
||||||
set(FSFW_CATCH2_LIB_VERSION
|
set(FSFW_CATCH2_LIB_VERSION
|
||||||
v${FSFW_CATCH2_LIB_MAJOR_VERSION}.0.0-preview5
|
v${FSFW_CATCH2_LIB_MAJOR_VERSION}.1.0
|
||||||
CACHE STRING "Catch2 library exact version requirement")
|
CACHE STRING "Catch2 library exact version requirement")
|
||||||
|
|
||||||
# Keep this off by default for now. See PR:
|
# Keep this off by default for now. See PR:
|
||||||
@ -104,8 +104,8 @@ if(FSFW_GENERATE_SECTIONS)
|
|||||||
option(FSFW_REMOVE_UNUSED_CODE "Remove unused code" ON)
|
option(FSFW_REMOVE_UNUSED_CODE "Remove unused code" ON)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
option(FSFW_BUILD_TESTS
|
option(FSFW_BUILD_TESTS "Build unittest binary in addition to static library"
|
||||||
"Build unittest binary in addition to static library" OFF)
|
OFF)
|
||||||
option(FSFW_CICD_BUILD "Build for CI/CD. This can disable problematic test" OFF)
|
option(FSFW_CICD_BUILD "Build for CI/CD. This can disable problematic test" OFF)
|
||||||
option(FSFW_BUILD_DOCS "Build documentation with Sphinx and Doxygen" OFF)
|
option(FSFW_BUILD_DOCS "Build documentation with Sphinx and Doxygen" OFF)
|
||||||
if(FSFW_BUILD_TESTS)
|
if(FSFW_BUILD_TESTS)
|
||||||
@ -118,6 +118,12 @@ option(FSFW_ADD_INTERNAL_TESTS "Add internal unit tests" ON)
|
|||||||
option(FSFW_ADD_UNITTESTS "Add regular unittests. Requires Catch2" OFF)
|
option(FSFW_ADD_UNITTESTS "Add regular unittests. Requires Catch2" OFF)
|
||||||
option(FSFW_ADD_HAL "Add Hardware Abstraction Layer" ON)
|
option(FSFW_ADD_HAL "Add Hardware Abstraction Layer" ON)
|
||||||
|
|
||||||
|
if(UNIX)
|
||||||
|
option(FSFW_HAL_LINUX_ADD_PERIPHERAL_DRIVERS "Add Linux peripheral drivers"
|
||||||
|
OFF)
|
||||||
|
option(FSFW_HAL_LINUX_ADD_LIBGPIOD "Attempt to add Linux GPIOD drivers" OFF)
|
||||||
|
endif()
|
||||||
|
|
||||||
# Optional sources
|
# Optional sources
|
||||||
option(FSFW_ADD_PUS "Compile with PUS sources" ON)
|
option(FSFW_ADD_PUS "Compile with PUS sources" ON)
|
||||||
option(FSFW_ADD_MONITORING "Compile with monitoring components" ON)
|
option(FSFW_ADD_MONITORING "Compile with monitoring components" ON)
|
||||||
@ -183,7 +189,10 @@ if(FSFW_BUILD_TESTS)
|
|||||||
endif()
|
endif()
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
message(STATUS "${MSG_PREFIX} Finding and/or providing ETL library")
|
message(
|
||||||
|
STATUS
|
||||||
|
"${MSG_PREFIX} Finding and/or providing etl library with version ${FSFW_ETL_LIB_MAJOR_VERSION}"
|
||||||
|
)
|
||||||
|
|
||||||
# Check whether the user has already installed ETL first
|
# Check whether the user has already installed ETL first
|
||||||
find_package(${FSFW_ETL_LIB_NAME} ${FSFW_ETL_LIB_MAJOR_VERSION} QUIET)
|
find_package(${FSFW_ETL_LIB_NAME} ${FSFW_ETL_LIB_MAJOR_VERSION} QUIET)
|
||||||
@ -191,7 +200,7 @@ find_package(${FSFW_ETL_LIB_NAME} ${FSFW_ETL_LIB_MAJOR_VERSION} QUIET)
|
|||||||
if(NOT ${FSFW_ETL_LIB_NAME}_FOUND)
|
if(NOT ${FSFW_ETL_LIB_NAME}_FOUND)
|
||||||
message(
|
message(
|
||||||
STATUS
|
STATUS
|
||||||
"No ETL installation was found with find_package. Installing and providing "
|
"${MSG_PREFIX} No ETL installation was found with find_package. Installing and providing "
|
||||||
"etl with FindPackage")
|
"etl with FindPackage")
|
||||||
include(FetchContent)
|
include(FetchContent)
|
||||||
|
|
||||||
@ -317,7 +326,8 @@ if(FSFW_BUILD_TESTS)
|
|||||||
"/usr/local/include/*"
|
"/usr/local/include/*"
|
||||||
"*/fsfw_tests/*"
|
"*/fsfw_tests/*"
|
||||||
"*/catch2-src/*"
|
"*/catch2-src/*"
|
||||||
"*/fsfw_hal/*")
|
"*/fsfw_hal/*"
|
||||||
|
"unittests/*")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
target_link_options(${FSFW_TEST_TGT} PRIVATE -fprofile-arcs
|
target_link_options(${FSFW_TEST_TGT} PRIVATE -fprofile-arcs
|
||||||
@ -335,8 +345,15 @@ if(FSFW_BUILD_TESTS)
|
|||||||
DEPENDENCIES ${FSFW_TEST_TGT})
|
DEPENDENCIES ${FSFW_TEST_TGT})
|
||||||
else()
|
else()
|
||||||
setup_target_for_coverage_lcov(
|
setup_target_for_coverage_lcov(
|
||||||
NAME ${FSFW_TEST_TGT}_coverage EXECUTABLE ${FSFW_TEST_TGT}
|
NAME
|
||||||
DEPENDENCIES ${FSFW_TEST_TGT})
|
${FSFW_TEST_TGT}_coverage
|
||||||
|
EXECUTABLE
|
||||||
|
${FSFW_TEST_TGT}
|
||||||
|
DEPENDENCIES
|
||||||
|
${FSFW_TEST_TGT}
|
||||||
|
GENHTML_ARGS
|
||||||
|
--html-epilog
|
||||||
|
${CMAKE_SOURCE_DIR}/unittests/lcov_epilog.html)
|
||||||
endif()
|
endif()
|
||||||
endif()
|
endif()
|
||||||
endif()
|
endif()
|
||||||
@ -351,7 +368,8 @@ if(NOT FSFW_CONFIG_PATH)
|
|||||||
if(NOT FSFW_BUILD_DOCS)
|
if(NOT FSFW_BUILD_DOCS)
|
||||||
message(
|
message(
|
||||||
WARNING
|
WARNING
|
||||||
"${MSG_PREFIX} Flight Software Framework configuration path not set")
|
"${MSG_PREFIX} Flight Software Framework configuration path FSFW_CONFIG_PATH not set"
|
||||||
|
)
|
||||||
message(
|
message(
|
||||||
WARNING
|
WARNING
|
||||||
"${MSG_PREFIX} Setting default configuration from ${DEF_CONF_PATH} ..")
|
"${MSG_PREFIX} Setting default configuration from ${DEF_CONF_PATH} ..")
|
||||||
|
@ -132,7 +132,7 @@ You can use the following commands inside the `fsfw` folder to set up the build
|
|||||||
|
|
||||||
```sh
|
```sh
|
||||||
mkdir build-tests && cd build-tests
|
mkdir build-tests && cd build-tests
|
||||||
cmake -DFSFW_BUILD_UNITTESTS=ON -DFSFW_OSAL=host -DCMAKE_BUILD_TYPE=Debug ..
|
cmake -DFSFW_BUILD_TESTS=ON -DFSFW_OSAL=host -DCMAKE_BUILD_TYPE=Debug ..
|
||||||
```
|
```
|
||||||
|
|
||||||
You can also use `-DFSFW_OSAL=linux` on Linux systems.
|
You can also use `-DFSFW_OSAL=linux` on Linux systems.
|
||||||
@ -175,7 +175,7 @@ cmake -DFSFW_BUILD_DOCS=ON -DFSFW_OSAL=host ..
|
|||||||
Then you can generate the documentation using
|
Then you can generate the documentation using
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
cmake --build . -j
|
cmake --build . -- Sphinx -j
|
||||||
```
|
```
|
||||||
|
|
||||||
You can find the generated documentation inside the `docs/sphinx` folder inside the build
|
You can find the generated documentation inside the `docs/sphinx` folder inside the build
|
||||||
|
@ -5,16 +5,25 @@ RUN apt-get --yes upgrade
|
|||||||
|
|
||||||
#tzdata is a dependency, won't install otherwise
|
#tzdata is a dependency, won't install otherwise
|
||||||
ARG DEBIAN_FRONTEND=noninteractive
|
ARG DEBIAN_FRONTEND=noninteractive
|
||||||
RUN apt-get --yes install gcc g++ cmake make lcov git valgrind nano iputils-ping
|
RUN apt-get --yes install gcc g++ cmake make lcov git valgrind nano iputils-ping python3 pip doxygen graphviz rsync
|
||||||
|
|
||||||
|
RUN python3 -m pip install sphinx breathe
|
||||||
|
|
||||||
RUN git clone https://github.com/catchorg/Catch2.git && \
|
RUN git clone https://github.com/catchorg/Catch2.git && \
|
||||||
cd Catch2 && \
|
cd Catch2 && \
|
||||||
git checkout v3.0.0-preview5 && \
|
git checkout v3.1.0 && \
|
||||||
cmake -Bbuild -H. -DBUILD_TESTING=OFF && \
|
cmake -Bbuild -H. -DBUILD_TESTING=OFF && \
|
||||||
cmake --build build/ --target install
|
cmake --build build/ --target install
|
||||||
|
|
||||||
RUN git clone https://github.com/ETLCPP/etl.git && \
|
RUN git clone https://github.com/ETLCPP/etl.git && \
|
||||||
cd etl && \
|
cd etl && \
|
||||||
git checkout 20.28.0 && \
|
git checkout 20.28.0 && \
|
||||||
cmake -B build . && \
|
cmake -B build . && \
|
||||||
cmake --install build/
|
cmake --install build/
|
||||||
|
|
||||||
|
#ssh needs a valid user to work
|
||||||
|
RUN adduser --uid 114 jenkins
|
||||||
|
|
||||||
|
#add documentation server to known hosts
|
||||||
|
RUN echo "|1|/LzCV4BuTmTb2wKnD146l9fTKgQ=|NJJtVjvWbtRt8OYqFgcYRnMQyVw= ecdsa-sha2-nistp256 AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBNL8ssTonYtgiR/6RRlSIK9WU1ywOcJmxFTLcEblAwH7oifZzmYq3XRfwXrgfMpylEfMFYfCU8JRqtmi19xc21A=" >> /etc/ssh/ssh_known_hosts
|
||||||
|
RUN echo "|1|CcBvBc3EG03G+XM5rqRHs6gK/Gg=|oGeJQ+1I8NGI2THIkJsW92DpTzs= ecdsa-sha2-nistp256 AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBNL8ssTonYtgiR/6RRlSIK9WU1ywOcJmxFTLcEblAwH7oifZzmYq3XRfwXrgfMpylEfMFYfCU8JRqtmi19xc21A=" >> /etc/ssh/ssh_known_hosts
|
46
automation/Jenkinsfile
vendored
46
automation/Jenkinsfile
vendored
@ -1,9 +1,13 @@
|
|||||||
pipeline {
|
pipeline {
|
||||||
environment {
|
environment {
|
||||||
BUILDDIR = 'build-tests'
|
BUILDDIR = 'cmake-build-tests'
|
||||||
|
DOCDDIR = 'cmake-build-documentation'
|
||||||
}
|
}
|
||||||
agent {
|
agent {
|
||||||
docker { image 'fsfw-ci:d3'}
|
docker {
|
||||||
|
image 'fsfw-ci:d6'
|
||||||
|
args '--network host'
|
||||||
|
}
|
||||||
}
|
}
|
||||||
stages {
|
stages {
|
||||||
stage('Clean') {
|
stage('Clean') {
|
||||||
@ -39,5 +43,43 @@ pipeline {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
stage('Documentation') {
|
||||||
|
when {
|
||||||
|
branch 'development'
|
||||||
|
}
|
||||||
|
steps {
|
||||||
|
dir(DOCDDIR) {
|
||||||
|
sh 'cmake -DFSFW_BUILD_DOCS=ON -DFSFW_OSAL=host ..'
|
||||||
|
sh 'make Sphinx'
|
||||||
|
sshagent(credentials: ['documentation-buildfix']) {
|
||||||
|
sh 'rsync -r --delete docs/sphinx/* buildfix@documentation.irs.uni-stuttgart.de:/fsfw/development'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
dir(BUILDDIR) {
|
||||||
|
sshagent(credentials: ['documentation-buildfix']) {
|
||||||
|
sh 'rsync -r --delete fsfw-tests_coverage/* buildfix@documentation.irs.uni-stuttgart.de:/fsfw/coverage/development'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
stage('Master Documentation') {
|
||||||
|
when {
|
||||||
|
branch 'master'
|
||||||
|
}
|
||||||
|
steps {
|
||||||
|
dir(DOCDDIR) {
|
||||||
|
sh 'cmake -DFSFW_BUILD_DOCS=ON -DFSFW_OSAL=host ..'
|
||||||
|
sh 'make Sphinx'
|
||||||
|
sshagent(credentials: ['documentation-buildfix']) {
|
||||||
|
sh 'rsync -r --delete docs/sphinx/* buildfix@documentation.irs.uni-stuttgart.de:/fsfw/master'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
dir(BUILDDIR) {
|
||||||
|
sshagent(credentials: ['documentation-buildfix']) {
|
||||||
|
sh 'rsync -r --delete fsfw-tests_coverage/* buildfix@documentation.irs.uni-stuttgart.de:/fsfw/coverage/master'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,40 +0,0 @@
|
|||||||
Configuring the FSFW
|
|
||||||
======
|
|
||||||
|
|
||||||
The FSFW can be configured via the `fsfwconfig` folder. A template folder has
|
|
||||||
been provided to have a starting point for this. The folder should be added
|
|
||||||
to the include path. The primary configuration file is the `FSFWConfig.h` folder. Some
|
|
||||||
of the available options will be explained in more detail here.
|
|
||||||
|
|
||||||
# Auto-Translation of Events
|
|
||||||
|
|
||||||
The FSFW allows the automatic translation of events, which allows developers to track triggered
|
|
||||||
events directly via console output. Using this feature requires:
|
|
||||||
|
|
||||||
1. `FSFW_OBJ_EVENT_TRANSLATION` set to 1 in the configuration file.
|
|
||||||
2. Special auto-generated translation files which translate event IDs and object IDs into
|
|
||||||
human readable strings. These files can be generated using the
|
|
||||||
[modgen Python scripts](https://git.ksat-stuttgart.de/source/modgen.git).
|
|
||||||
3. The generated translation files for the object IDs should be named `translatesObjects.cpp`
|
|
||||||
and `translateObjects.h` and should be copied to the `fsfwconfig/objects` folder
|
|
||||||
4. The generated translation files for the event IDs should be named `translateEvents.cpp` and
|
|
||||||
`translateEvents.h` and should be copied to the `fsfwconfig/events` folder
|
|
||||||
|
|
||||||
An example implementations of these translation file generators can be found as part
|
|
||||||
of the [SOURCE project here](https://git.ksat-stuttgart.de/source/sourceobsw/-/tree/development/generators)
|
|
||||||
or the [FSFW example](https://egit.irs.uni-stuttgart.de/fsfw/fsfw_example_public/src/branch/master/generators)
|
|
||||||
|
|
||||||
## Configuring the Event Manager
|
|
||||||
|
|
||||||
The number of allowed subscriptions can be modified with the following
|
|
||||||
parameters:
|
|
||||||
|
|
||||||
``` c++
|
|
||||||
namespace fsfwconfig {
|
|
||||||
//! Configure the allocated pool sizes for the event manager.
|
|
||||||
static constexpr size_t FSFW_EVENTMGMR_MATCHTREE_NODES = 240;
|
|
||||||
static constexpr size_t FSFW_EVENTMGMT_EVENTIDMATCHERS = 120;
|
|
||||||
static constexpr size_t FSFW_EVENTMGMR_RANGEMATCHERS = 120;
|
|
||||||
}
|
|
||||||
```
|
|
||||||
|
|
@ -1 +0,0 @@
|
|||||||
## Controllers
|
|
@ -1,55 +0,0 @@
|
|||||||
## FSFW Core Modules
|
|
||||||
|
|
||||||
These core modules provide the most important functionalities of the
|
|
||||||
Flight Software Framework
|
|
||||||
|
|
||||||
### Clock
|
|
||||||
|
|
||||||
* This is a class of static functions that can be used at anytime
|
|
||||||
* Leap Seconds must be set if any time conversions from UTC to other times is used
|
|
||||||
|
|
||||||
### ObjectManager
|
|
||||||
|
|
||||||
* Must be created during program startup
|
|
||||||
* The component which handles all references. All SystemObjects register at this component.
|
|
||||||
* Any SystemObject needs to have a unique ObjectId. Those can be managed like objects::framework_objects.
|
|
||||||
* A reference to an object can be get by calling the following function. T must be the specific Interface you want to call.
|
|
||||||
A nullptr check of the returning Pointer must be done. This function is based on Run-time type information.
|
|
||||||
|
|
||||||
```cpp
|
|
||||||
template <typename T> T* ObjectManagerIF::get( object_id_t id )
|
|
||||||
```
|
|
||||||
* A typical way to create all objects on startup is a handing a static produce function to the
|
|
||||||
ObjectManager on creation. By calling objectManager->initialize() the produce function will be
|
|
||||||
called and all SystemObjects will be initialized afterwards.
|
|
||||||
|
|
||||||
### Event Manager
|
|
||||||
|
|
||||||
* Component which allows routing of events
|
|
||||||
* Other objects can subscribe to specific events, ranges of events or all events of an object.
|
|
||||||
* Subscriptions can be done during runtime but should be done during initialization
|
|
||||||
* Amounts of allowed subscriptions can be configured in `FSFWConfig.h`
|
|
||||||
|
|
||||||
### Health Table
|
|
||||||
|
|
||||||
* A component which holds every health state
|
|
||||||
* Provides a thread safe way to access all health states without the need of message exchanges
|
|
||||||
|
|
||||||
### Stores
|
|
||||||
|
|
||||||
* The message based communication can only exchange a few bytes of information inside the message
|
|
||||||
itself. Therefore, additional information can be exchanged with Stores. With this, only the
|
|
||||||
store address must be exchanged in the message.
|
|
||||||
* Internally, the FSFW uses an IPC Store to exchange data between processes. For incoming TCs a TC
|
|
||||||
Store is used. For outgoing TM a TM store is used.
|
|
||||||
* All of them should use the Thread Safe Class storagemanager/PoolManager
|
|
||||||
|
|
||||||
### Tasks
|
|
||||||
|
|
||||||
There are two different types of tasks:
|
|
||||||
* The PeriodicTask just executes objects that are of type ExecutableObjectIF in the order of the
|
|
||||||
insertion to the Tasks.
|
|
||||||
* FixedTimeslotTask executes a list of calls in the order of the given list. This is intended for
|
|
||||||
DeviceHandlers, where polling should be in a defined order. An example can be found in
|
|
||||||
`defaultcfg/fsfwconfig/pollingSequence` folder
|
|
||||||
|
|
@ -1 +0,0 @@
|
|||||||
## Device Handlers
|
|
@ -1,135 +0,0 @@
|
|||||||
High-level overview
|
|
||||||
======
|
|
||||||
|
|
||||||
# Structure
|
|
||||||
|
|
||||||
The general structure is driven by the usage of interfaces provided by objects.
|
|
||||||
The FSFW uses C++11 as baseline. The intention behind this is that this C++ Standard should be
|
|
||||||
widely available, even with older compilers.
|
|
||||||
The FSFW uses dynamic allocation during the initialization but provides static containers during runtime.
|
|
||||||
This simplifies the instantiation of objects and allows the usage of some standard containers.
|
|
||||||
Dynamic Allocation after initialization is discouraged and different solutions are provided in the
|
|
||||||
FSFW to achieve that. The fsfw uses run-time type information but exceptions are not allowed.
|
|
||||||
|
|
||||||
# Failure Handling
|
|
||||||
|
|
||||||
Functions should return a defined `ReturnValue_t` to signal to the caller that something has
|
|
||||||
gone wrong. Returnvalues must be unique. For this the function `HasReturnvaluesIF::makeReturnCode`
|
|
||||||
or the macro `MAKE_RETURN` can be used. The `CLASS_ID` is a unique id for that type of object.
|
|
||||||
See `returnvalues/FwClassIds` folder. The user can add custom `CLASS_ID`s via the
|
|
||||||
`fsfwconfig` folder.
|
|
||||||
|
|
||||||
# OSAL
|
|
||||||
|
|
||||||
The FSFW provides operation system abstraction layers for Linux, FreeRTOS and RTEMS.
|
|
||||||
The OSAL provides periodic tasks, message queues, clocks and semaphores as well as mutexes.
|
|
||||||
The [OSAL README](doc/README-osal.md#top) provides more detailed information on provided components
|
|
||||||
and how to use them.
|
|
||||||
|
|
||||||
# Core Components
|
|
||||||
|
|
||||||
The FSFW has following core components. More detailed informations can be found in the
|
|
||||||
[core component section](doc/README-core.md#top):
|
|
||||||
|
|
||||||
1. Tasks: Abstraction for different (periodic) task types like periodic tasks or tasks
|
|
||||||
with fixed timeslots
|
|
||||||
2. ObjectManager: This module stores all `SystemObjects` by mapping a provided unique object ID
|
|
||||||
to the object handles.
|
|
||||||
3. Static Stores: Different stores are provided to store data of variable size (like telecommands
|
|
||||||
or small telemetry) in a pool structure without using dynamic memory allocation.
|
|
||||||
These pools are allocated up front.
|
|
||||||
3. Clock: This module provided common time related functions
|
|
||||||
4. EventManager: This module allows routing of events generated by `SystemObjects`
|
|
||||||
5. HealthTable: A component which stores the health states of objects
|
|
||||||
|
|
||||||
# Static IDs in the framework
|
|
||||||
|
|
||||||
Some parts of the framework use a static routing address for communication.
|
|
||||||
An example setup of ids can be found in the example config in `defaultcft/fsfwconfig/objects`
|
|
||||||
inside the function `Factory::setStaticFrameworkObjectIds()`.
|
|
||||||
|
|
||||||
# Events
|
|
||||||
|
|
||||||
Events are tied to objects. EventIds can be generated by calling the Macro MAKE_EVENT.
|
|
||||||
This works analog to the returnvalues. Every object that needs own EventIds has to get a
|
|
||||||
unique SUBSYSTEM_ID. Every SystemObject can call triggerEvent from the parent class.
|
|
||||||
Therefore, event messages contain the specific EventId and the objectId of the object that
|
|
||||||
has triggered.
|
|
||||||
|
|
||||||
# Internal Communication
|
|
||||||
|
|
||||||
Components communicate mostly via Messages through Queues.
|
|
||||||
Those queues are created by calling the singleton `QueueFactory::instance()->create()` which
|
|
||||||
will create `MessageQueue` instances for the used OSAL.
|
|
||||||
|
|
||||||
# External Communication
|
|
||||||
|
|
||||||
The external communication with the mission control system is mostly up to the user implementation.
|
|
||||||
The FSFW provides PUS Services which can be used to but don't need to be used.
|
|
||||||
The services can be seen as a conversion from a TC to a message based communication and back.
|
|
||||||
|
|
||||||
## TMTC Communication
|
|
||||||
|
|
||||||
The FSFW provides some components to facilitate TMTC handling via the PUS commands.
|
|
||||||
For example, a UDP or TCP PUS server socket can be opened on a specific port using the
|
|
||||||
files located in `osal/common`. The FSFW example uses this functionality to allow sending telecommands
|
|
||||||
and receiving telemetry using the [TMTC commander application](https://github.com/spacefisch/tmtccmd).
|
|
||||||
Simple commands like the PUS Service 17 ping service can be tested by simply running the
|
|
||||||
`tmtc_client_cli.py` or `tmtc_client_gui.py` utility in
|
|
||||||
the [example tmtc folder](https://egit.irs.uni-stuttgart.de/fsfw/fsfw_example_public/src/branch/master/tmtc)
|
|
||||||
while the `fsfw_example` application is running.
|
|
||||||
|
|
||||||
More generally, any class responsible for handling incoming telecommands and sending telemetry
|
|
||||||
can implement the generic `TmTcBridge` class located in `tmtcservices`. Many applications
|
|
||||||
also use a dedicated polling task for reading telecommands which passes telecommands
|
|
||||||
to the `TmTcBridge` implementation.
|
|
||||||
|
|
||||||
## CCSDS Frames, CCSDS Space Packets and PUS
|
|
||||||
|
|
||||||
If the communication is based on CCSDS Frames and Space Packets, several classes can be used to
|
|
||||||
distributed the packets to the corresponding services. Those can be found in `tcdistribution`.
|
|
||||||
If Space Packets are used, a timestamper has to be provided by the user.
|
|
||||||
An example can be found in the `timemanager` folder, which uses `CCSDSTime::CDS_short`.
|
|
||||||
|
|
||||||
# Device Handlers
|
|
||||||
|
|
||||||
DeviceHandlers are another important component of the FSFW.
|
|
||||||
The idea is, to have a software counterpart of every physical device to provide a simple mode,
|
|
||||||
health and commanding interface. By separating the underlying Communication Interface with
|
|
||||||
`DeviceCommunicationIF`, a device handler (DH) can be tested on different hardware.
|
|
||||||
The DH has mechanisms to monitor the communication with the physical device which allow
|
|
||||||
for FDIR reaction. Device Handlers can be created by implementing `DeviceHandlerBase`.
|
|
||||||
A standard FDIR component for the DH will be created automatically but can
|
|
||||||
be overwritten by the user. More information on DeviceHandlers can be found in the
|
|
||||||
related [documentation section](doc/README-devicehandlers.md#top).
|
|
||||||
|
|
||||||
# Modes and Health
|
|
||||||
|
|
||||||
The two interfaces `HasModesIF` and `HasHealthIF` provide access for commanding and monitoring
|
|
||||||
of components. On-board Mode Management is implement in hierarchy system.
|
|
||||||
DeviceHandlers and Controllers are the lowest part of the hierarchy.
|
|
||||||
The next layer are Assemblies. Those assemblies act as a component which handle
|
|
||||||
redundancies of handlers. Assemblies share a common core with the next level which
|
|
||||||
are the Subsystems.
|
|
||||||
|
|
||||||
Those Assemblies are intended to act as auto-generated components from a database which describes
|
|
||||||
the subsystem modes. The definitions contain transition and target tables which contain the DH,
|
|
||||||
Assembly and Controller Modes to be commanded.
|
|
||||||
Transition tables contain as many steps as needed to reach the mode from any other mode, e.g. a
|
|
||||||
switch into any higher AOCS mode might first turn on the sensors, than the actuators and the
|
|
||||||
controller as last component.
|
|
||||||
The target table is used to describe the state that is checked continuously by the subsystem.
|
|
||||||
All of this allows System Modes to be generated as Subsystem object as well from the same database.
|
|
||||||
This System contains list of subsystem modes in the transition and target tables.
|
|
||||||
Therefore, it allows a modular system to create system modes and easy commanding of those, because
|
|
||||||
only the highest components must be commanded.
|
|
||||||
|
|
||||||
The health state represents if the component is able to perform its tasks.
|
|
||||||
This can be used to signal the system to avoid using this component instead of a redundant one.
|
|
||||||
The on-board FDIR uses the health state for isolation and recovery.
|
|
||||||
|
|
||||||
# Unit Tests
|
|
||||||
|
|
||||||
Unit Tests are provided in the unittest folder. Those use the catch2 framework but do not include
|
|
||||||
catch2 itself. More information on how to run these tests can be found in the separate
|
|
||||||
[`fsfw_tests` reposoitory](https://egit.irs.uni-stuttgart.de/fsfw/fsfw_tests)
|
|
@ -1,174 +0,0 @@
|
|||||||
## Local Data Pools Developer Information
|
|
||||||
|
|
||||||
The following text is targeted towards mission software developers which would like
|
|
||||||
to use the local data pools provided by the FSFW to store data like sensor values so they can be
|
|
||||||
used by other software objects like controllers as well. If a custom class should have a local
|
|
||||||
pool which can be used by other software objects as well, following steps have to be performed:
|
|
||||||
|
|
||||||
1. Create a `LocalDataPoolManager` member object in the custom class
|
|
||||||
2. Implement the `HasLocalDataPoolIF` with specifies the interface between the local pool manager
|
|
||||||
and the class owning the local pool.
|
|
||||||
|
|
||||||
The local data pool manager is also able to process housekeeping service requests in form
|
|
||||||
of messages, generate periodic housekeeping packet, generate notification and snapshots of changed
|
|
||||||
variables and datasets and process notifications and snapshots coming from other objects.
|
|
||||||
The two former tasks are related to the external interface using telemetry and telecommands (TMTC)
|
|
||||||
while the later two are related to data consumers like controllers only acting on data change
|
|
||||||
detected by the data creator instead of checking the data manually each cycle. Two important
|
|
||||||
framework classes `DeviceHandlerBase` and `ExtendedControllerBase` already perform the two steps
|
|
||||||
shown above so the steps required are altered slightly.
|
|
||||||
|
|
||||||
### Storing and Accessing pool data
|
|
||||||
|
|
||||||
The pool manager is responsible for thread-safe access of the pool data, but the actual
|
|
||||||
access to the pool data from the point of view of a mission software developer happens via proxy
|
|
||||||
classes like pool variable classes. These classes store a copy
|
|
||||||
of the pool variable with the matching datatype and copy the actual data from the local pool
|
|
||||||
on a `read` call. Changed variables can then be written to the local pool with a `commit` call.
|
|
||||||
The `read` and `commit` calls are thread-safe and can be called concurrently from data creators
|
|
||||||
and data consumers. Generally, a user will create a dataset class which in turn groups all
|
|
||||||
cohesive pool variables. These sets simply iterator over the list of variables and call the
|
|
||||||
`read` and `commit` functions of each variable. The following diagram shows the
|
|
||||||
high-level architecture of the local data pools.
|
|
||||||
|
|
||||||
.. image:: ../misc/logo/FSFW_Logo_V3_bw.png
|
|
||||||
:alt: FSFW Logo
|
|
||||||
|
|
||||||
|
|
||||||
An example is shown for using the local data pools with a Gyroscope.
|
|
||||||
For example, the following code shows an implementation to access data from a Gyroscope taken
|
|
||||||
from the SOURCE CubeSat project:
|
|
||||||
|
|
||||||
```cpp
|
|
||||||
class GyroPrimaryDataset: public StaticLocalDataSet<3 * sizeof(float)> {
|
|
||||||
public:
|
|
||||||
/**
|
|
||||||
* Constructor for data users
|
|
||||||
* @param gyroId
|
|
||||||
*/
|
|
||||||
GyroPrimaryDataset(object_id_t gyroId):
|
|
||||||
StaticLocalDataSet(sid_t(gyroId, gyrodefs::GYRO_DATA_SET_ID)) {
|
|
||||||
setAllVariablesReadOnly();
|
|
||||||
}
|
|
||||||
|
|
||||||
lp_var_t<float> angVelocityX = lp_var_t<float>(sid.objectId,
|
|
||||||
gyrodefs::ANGULAR_VELOCITY_X, this);
|
|
||||||
lp_var_t<float> angVelocityY = lp_var_t<float>(sid.objectId,
|
|
||||||
gyrodefs::ANGULAR_VELOCITY_Y, this);
|
|
||||||
lp_var_t<float> angVelocityZ = lp_var_t<float>(sid.objectId,
|
|
||||||
gyrodefs::ANGULAR_VELOCITY_Z, this);
|
|
||||||
private:
|
|
||||||
|
|
||||||
friend class GyroHandler;
|
|
||||||
/**
|
|
||||||
* Constructor for data creator
|
|
||||||
* @param hkOwner
|
|
||||||
*/
|
|
||||||
GyroPrimaryDataset(HasLocalDataPoolIF* hkOwner):
|
|
||||||
StaticLocalDataSet(hkOwner, gyrodefs::GYRO_DATA_SET_ID) {}
|
|
||||||
};
|
|
||||||
```
|
|
||||||
|
|
||||||
There is a public constructor for users which sets all variables to read-only and there is a
|
|
||||||
constructor for the GyroHandler data creator by marking it private and declaring the `GyroHandler`
|
|
||||||
as a friend class. Both the atittude controller and the `GyroHandler` can now
|
|
||||||
use the same class definition to access the pool variables with `read` and `commit` semantics
|
|
||||||
in a thread-safe way. Generally, each class requiring access will have the set class as a member
|
|
||||||
class. The data creator will also be generally a `DeviceHandlerBase` subclass and some additional
|
|
||||||
steps are necessary to expose the set for housekeeping purposes.
|
|
||||||
|
|
||||||
### Using the local data pools in a `DeviceHandlerBase` subclass
|
|
||||||
|
|
||||||
It is very common to store data generated by devices like a sensor into a pool which can
|
|
||||||
then be used by other objects. Therefore, the `DeviceHandlerBase` already has a
|
|
||||||
local pool. Using the aforementioned example, our `GyroHandler` will now have the set class
|
|
||||||
as a member:
|
|
||||||
|
|
||||||
```cpp
|
|
||||||
class GyroHandler: ... {
|
|
||||||
|
|
||||||
public:
|
|
||||||
...
|
|
||||||
private:
|
|
||||||
...
|
|
||||||
GyroPrimaryDataset gyroData;
|
|
||||||
...
|
|
||||||
};
|
|
||||||
```
|
|
||||||
|
|
||||||
The constructor used for the creators expects the owner class as a parameter, so we initialize
|
|
||||||
the object in the `GyroHandler` constructor like this:
|
|
||||||
|
|
||||||
```cpp
|
|
||||||
GyroHandler::GyroHandler(object_id_t objectId, object_id_t comIF,
|
|
||||||
CookieIF *comCookie, uint8_t switchId):
|
|
||||||
DeviceHandlerBase(objectId, comIF, comCookie), switchId(switchId),
|
|
||||||
gyroData(this) {}
|
|
||||||
```
|
|
||||||
|
|
||||||
We need to assign the set to a reply ID used in the `DeviceHandlerBase`.
|
|
||||||
The combination of the `GyroHandler` object ID and the reply ID will be the 64-bit structure ID
|
|
||||||
`sid_t` and is used to globally identify the set, for example when requesting housekeeping data or
|
|
||||||
generating update messages. We need to assign our custom set class in some way so that the local
|
|
||||||
pool manager can access the custom data sets as well.
|
|
||||||
By default, the `getDataSetHandle` will take care of this tasks. The default implementation for a
|
|
||||||
`DeviceHandlerBase` subclass will use the internal command map to retrieve
|
|
||||||
a handle to a dataset from a given reply ID. Therefore,
|
|
||||||
we assign the set in the `fillCommandAndReplyMap` function:
|
|
||||||
|
|
||||||
```cpp
|
|
||||||
void GyroHandler::fillCommandAndReplyMap() {
|
|
||||||
...
|
|
||||||
this->insertInCommandAndReplyMap(gyrodefs::GYRO_DATA, 3, &gyroData);
|
|
||||||
...
|
|
||||||
}
|
|
||||||
```
|
|
||||||
|
|
||||||
Now, we need to create the actual pool entries as well, using the `initializeLocalDataPool`
|
|
||||||
function. Here, we also immediately subscribe for periodic housekeeping packets
|
|
||||||
with an interval of 4 seconds. They are still disabled in this example and can be enabled
|
|
||||||
with a housekeeping service command.
|
|
||||||
|
|
||||||
```cpp
|
|
||||||
ReturnValue_t GyroHandler::initializeLocalDataPool(localpool::DataPool &localDataPoolMap,
|
|
||||||
LocalDataPoolManager &poolManager) {
|
|
||||||
localDataPoolMap.emplace(gyrodefs::ANGULAR_VELOCITY_X,
|
|
||||||
new PoolEntry<float>({0.0}));
|
|
||||||
localDataPoolMap.emplace(gyrodefs::ANGULAR_VELOCITY_Y,
|
|
||||||
new PoolEntry<float>({0.0}));
|
|
||||||
localDataPoolMap.emplace(gyrodefs::ANGULAR_VELOCITY_Z,
|
|
||||||
new PoolEntry<float>({0.0}));
|
|
||||||
localDataPoolMap.emplace(gyrodefs::GENERAL_CONFIG_REG42,
|
|
||||||
new PoolEntry<uint8_t>({0}));
|
|
||||||
localDataPoolMap.emplace(gyrodefs::RANGE_CONFIG_REG43,
|
|
||||||
new PoolEntry<uint8_t>({0}));
|
|
||||||
|
|
||||||
poolManager.subscribeForPeriodicPacket(gyroData.getSid(), false, 4.0, false);
|
|
||||||
return HasReturnvaluesIF::RETURN_OK;
|
|
||||||
}
|
|
||||||
```
|
|
||||||
|
|
||||||
Now, if we receive some sensor data and converted them into the right format,
|
|
||||||
we can write it into the pool like this, using a guard class to ensure the set is commited back
|
|
||||||
in any case:
|
|
||||||
|
|
||||||
```cpp
|
|
||||||
PoolReadGuard readHelper(&gyroData);
|
|
||||||
if(readHelper.getReadResult() == HasReturnvaluesIF::RETURN_OK) {
|
|
||||||
if(not gyroData.isValid()) {
|
|
||||||
gyroData.setValidity(true, true);
|
|
||||||
}
|
|
||||||
|
|
||||||
gyroData.angVelocityX = angularVelocityX;
|
|
||||||
gyroData.angVelocityY = angularVelocityY;
|
|
||||||
gyroData.angVelocityZ = angularVelocityZ;
|
|
||||||
}
|
|
||||||
```
|
|
||||||
|
|
||||||
The guard class will commit the changed data on destruction automatically.
|
|
||||||
|
|
||||||
### Using the local data pools in a `ExtendedControllerBase` subclass
|
|
||||||
|
|
||||||
Coming soon
|
|
||||||
|
|
||||||
|
|
@ -1,32 +0,0 @@
|
|||||||
# Operating System Abstraction Layer (OSAL)
|
|
||||||
|
|
||||||
Some specific information on the provided OSALs are provided.
|
|
||||||
|
|
||||||
## Linux OSAL
|
|
||||||
|
|
||||||
This OSAL can be used to compile for Linux host systems like Ubuntu 20.04 or for
|
|
||||||
embedded Linux targets like the Raspberry Pi. This OSAL generally requires threading support
|
|
||||||
and real-time functionalities. For most UNIX systems, this is done by adding `-lrt` and `-lpthread` to the linked libraries in the compilation process. The CMake build support provided will do this automatically for the `fsfw` target. It should be noted that most UNIX systems need to be configured specifically to allow the real-time functionalities required by the FSFW.
|
|
||||||
|
|
||||||
More information on how to set up a Linux system accordingly can be found in the
|
|
||||||
[Linux README of the FSFW example application](https://egit.irs.uni-stuttgart.de/fsfw/fsfw_example/src/branch/master/doc/README-linux.md#top)
|
|
||||||
|
|
||||||
## Hosted OSAL
|
|
||||||
|
|
||||||
This is the newest OSAL. Support for Semaphores has not been implemented yet and will propably be implemented as soon as C++20 with Semaphore support has matured. This OSAL can be used to run the FSFW on any host system, but currently has only been tested on Windows 10 and Ubuntu 20.04. Unlike the other OSALs, it uses dynamic memory allocation (e.g. for the message queue implementation). Cross-platform serial port (USB) support might be added soon.
|
|
||||||
|
|
||||||
## FreeRTOS OSAL
|
|
||||||
|
|
||||||
FreeRTOS is not included and the developer needs to take care of compiling the FreeRTOS sources and adding the `FreeRTOSConfig.h` file location to the include path. This OSAL has only been tested extensively with the pre-emptive scheduler configuration so far but it should in principle also be possible to use a cooperative scheduler. It is recommended to use the `heap_4` allocation scheme. When using newlib (nano), it is also recommended to add `#define configUSE_NEWLIB_REENTRANT` to the FreeRTOS configuration file to ensure thread-safety.
|
|
||||||
|
|
||||||
When using this OSAL, developers also need to provide an implementation for the `vRequestContextSwitchFromISR` function. This has been done because the call to request a context switch from an ISR is generally located in the `portmacro.h` header and is different depending on the target architecture or device.
|
|
||||||
|
|
||||||
## RTEMS OSAL
|
|
||||||
|
|
||||||
The RTEMS OSAL was the first implemented OSAL which is also used on the active satellite Flying Laptop.
|
|
||||||
|
|
||||||
## TCP/IP socket abstraction
|
|
||||||
|
|
||||||
The Linux and Host OSAL provide abstraction layers for the socket API. Currently, only UDP sockets have been imlemented. This is very useful to test TMTC handling either on the host computer directly (targeting localhost with a TMTC application) or on embedded Linux devices, sending TMTC packets via Ethernet.
|
|
||||||
|
|
||||||
|
|
@ -1 +0,0 @@
|
|||||||
## PUS Services
|
|
@ -3,7 +3,7 @@
|
|||||||
Returnvalue API
|
Returnvalue API
|
||||||
==================
|
==================
|
||||||
|
|
||||||
.. doxygenfile:: HasReturnvaluesIF.h
|
.. doxygenfile:: returnvalue.h
|
||||||
|
|
||||||
.. _fwclassids:
|
.. _fwclassids:
|
||||||
|
|
||||||
|
@ -50,6 +50,11 @@ exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store']
|
|||||||
#
|
#
|
||||||
html_theme = 'alabaster'
|
html_theme = 'alabaster'
|
||||||
|
|
||||||
|
html_theme_options = {
|
||||||
|
"extra_nav_links": {"Impressum" : "https://www.uni-stuttgart.de/impressum", "Datenschutz": "https://info.irs.uni-stuttgart.de/datenschutz/datenschutzWebmit.html"}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
# Add any paths that contain custom static files (such as style sheets) here,
|
# Add any paths that contain custom static files (such as style sheets) here,
|
||||||
# relative to this directory. They are copied after the builtin static files,
|
# relative to this directory. They are copied after the builtin static files,
|
||||||
# so a file named "default.css" will overwrite the builtin "default.css".
|
# so a file named "default.css" will overwrite the builtin "default.css".
|
||||||
|
@ -75,11 +75,11 @@ and the respective source file with sensible default return values:
|
|||||||
void TestDeviceHandler::doShutDown() {}
|
void TestDeviceHandler::doShutDown() {}
|
||||||
|
|
||||||
ReturnValue_t TestDeviceHandler::buildNormalDeviceCommand(DeviceCommandId_t* id) {
|
ReturnValue_t TestDeviceHandler::buildNormalDeviceCommand(DeviceCommandId_t* id) {
|
||||||
return HasReturnvaluesIF::RETURN_OK;
|
return returnvalue::OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
ReturnValue_t TestDeviceHandler::buildTransitionDeviceCommand(DeviceCommandId_t* id) {
|
ReturnValue_t TestDeviceHandler::buildTransitionDeviceCommand(DeviceCommandId_t* id) {
|
||||||
return HasReturnvaluesIF::RETURN_OK;
|
return returnvalue::OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
void TestDeviceHandler::fillCommandAndReplyMap() {}
|
void TestDeviceHandler::fillCommandAndReplyMap() {}
|
||||||
@ -87,17 +87,17 @@ and the respective source file with sensible default return values:
|
|||||||
ReturnValue_t TestDeviceHandler::buildCommandFromCommand(DeviceCommandId_t deviceCommand,
|
ReturnValue_t TestDeviceHandler::buildCommandFromCommand(DeviceCommandId_t deviceCommand,
|
||||||
const uint8_t* commandData,
|
const uint8_t* commandData,
|
||||||
size_t commandDataLen) {
|
size_t commandDataLen) {
|
||||||
return HasReturnvaluesIF::RETURN_OK;
|
return returnvalue::OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
ReturnValue_t TestDeviceHandler::scanForReply(const uint8_t* start, size_t remainingSize,
|
ReturnValue_t TestDeviceHandler::scanForReply(const uint8_t* start, size_t remainingSize,
|
||||||
DeviceCommandId_t* foundId, size_t* foundLen) {
|
DeviceCommandId_t* foundId, size_t* foundLen) {
|
||||||
return HasReturnvaluesIF::RETURN_OK;
|
return returnvalue::OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
ReturnValue_t TestDeviceHandler::interpretDeviceReply(DeviceCommandId_t id,
|
ReturnValue_t TestDeviceHandler::interpretDeviceReply(DeviceCommandId_t id,
|
||||||
const uint8_t* packet) {
|
const uint8_t* packet) {
|
||||||
return HasReturnvaluesIF::RETURN_OK;
|
return returnvalue::OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
uint32_t TestDeviceHandler::getTransitionDelayMs(Mode_t modeFrom, Mode_t modeTo) {
|
uint32_t TestDeviceHandler::getTransitionDelayMs(Mode_t modeFrom, Mode_t modeTo) {
|
||||||
@ -106,5 +106,5 @@ and the respective source file with sensible default return values:
|
|||||||
|
|
||||||
ReturnValue_t TestDeviceHandler::initializeLocalDataPool(localpool::DataPool& localDataPoolMap,
|
ReturnValue_t TestDeviceHandler::initializeLocalDataPool(localpool::DataPool& localDataPoolMap,
|
||||||
LocalDataPoolManager& poolManager) {
|
LocalDataPoolManager& poolManager) {
|
||||||
return HasReturnvaluesIF::RETURN_OK;
|
return returnvalue::OK;
|
||||||
}
|
}
|
||||||
|
@ -106,7 +106,7 @@ You can use the following commands inside the ``fsfw`` folder to set up the buil
|
|||||||
.. code-block:: console
|
.. code-block:: console
|
||||||
|
|
||||||
mkdir build-tests && cd build-tests
|
mkdir build-tests && cd build-tests
|
||||||
cmake -DFSFW_BUILD_UNITTESTS=ON -DFSFW_OSAL=host ..
|
cmake -DFSFW_BUILD_TESTS=ON -DFSFW_OSAL=host ..
|
||||||
|
|
||||||
|
|
||||||
You can also use ``-DFSFW_OSAL=linux`` on Linux systems.
|
You can also use ``-DFSFW_OSAL=linux`` on Linux systems.
|
||||||
|
@ -6,19 +6,20 @@ High-level overview
|
|||||||
Structure
|
Structure
|
||||||
----------
|
----------
|
||||||
|
|
||||||
The general structure is driven by the usage of interfaces provided by objects.
|
The general structure is driven by the usage of interfaces provided by objects.
|
||||||
The FSFW uses C++11 as baseline. The intention behind this is that this C++ Standard should be
|
The FSFW uses C++17 as baseline. Most modern compilers like GCC should have support for this
|
||||||
widely available, even with older compilers.
|
standard, even for micocontrollers.
|
||||||
The FSFW uses dynamic allocation during the initialization but provides static containers during runtime.
|
|
||||||
This simplifies the instantiation of objects and allows the usage of some standard containers.
|
The FSFW might use dynamic allocation during program initialization but not during runtime.
|
||||||
Dynamic Allocation after initialization is discouraged and different solutions are provided in the
|
It offers pool objects, static containers and it also exposes the
|
||||||
FSFW to achieve that. The fsfw uses run-time type information but exceptions are not allowed.
|
`Embedded Template Library <https://www.etlcpp.com/>`_ to allow writing code which does not perform
|
||||||
|
allocation during runtime. The fsfw uses run-time type information but will not throw exceptions.
|
||||||
|
|
||||||
Failure Handling
|
Failure Handling
|
||||||
-----------------
|
-----------------
|
||||||
|
|
||||||
Functions should return a defined :cpp:type:`ReturnValue_t` to signal to the caller that something has
|
Functions should return a defined :cpp:type:`ReturnValue_t` to signal to the caller that something has
|
||||||
gone wrong. Returnvalues must be unique. For this the function :cpp:func:`HasReturnvaluesIF::makeReturnCode`
|
gone wrong. Returnvalues must be unique. For this the function :cpp:func:`returnvalue::makeCode`
|
||||||
or the :ref:`macro MAKE_RETURN_CODE <retvalapi>` can be used. The ``CLASS_ID`` is a unique ID for that type of object.
|
or the :ref:`macro MAKE_RETURN_CODE <retvalapi>` can be used. The ``CLASS_ID`` is a unique ID for that type of object.
|
||||||
See the :ref:`FSFW Class IDs file <fwclassids>`. The user can add custom ``CLASS_ID``\s via the
|
See the :ref:`FSFW Class IDs file <fwclassids>`. The user can add custom ``CLASS_ID``\s via the
|
||||||
``fsfwconfig`` folder.
|
``fsfwconfig`` folder.
|
||||||
|
@ -150,7 +150,7 @@ with a housekeeping service command.
|
|||||||
new PoolEntry<uint8_t>({0}));
|
new PoolEntry<uint8_t>({0}));
|
||||||
|
|
||||||
poolManager.subscribeForPeriodicPacket(gyroData.getSid(), false, 4.0, false);
|
poolManager.subscribeForPeriodicPacket(gyroData.getSid(), false, 4.0, false);
|
||||||
return HasReturnvaluesIF::RETURN_OK;
|
return returnvalue::OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
Now, if we receive some sensor data and converted them into the right format,
|
Now, if we receive some sensor data and converted them into the right format,
|
||||||
@ -160,7 +160,7 @@ in any case:
|
|||||||
.. code-block:: cpp
|
.. code-block:: cpp
|
||||||
|
|
||||||
PoolReadGuard readHelper(&gyroData);
|
PoolReadGuard readHelper(&gyroData);
|
||||||
if(readHelper.getReadResult() == HasReturnvaluesIF::RETURN_OK) {
|
if(readHelper.getReadResult() == returnvalue::OK) {
|
||||||
if(not gyroData.isValid()) {
|
if(not gyroData.isValid()) {
|
||||||
gyroData.setValidity(true, true);
|
gyroData.setValidity(true, true);
|
||||||
}
|
}
|
||||||
|
@ -4,6 +4,10 @@
|
|||||||
#include <cstddef>
|
#include <cstddef>
|
||||||
#include <cstdint>
|
#include <cstdint>
|
||||||
|
|
||||||
|
// It is assumed the user has a subsystem and class ID list in some user header files.
|
||||||
|
// #include "events/subsystemIdRanges.h"
|
||||||
|
// #include "returnvalues/classIds.h"
|
||||||
|
|
||||||
//! Used to determine whether C++ ostreams are used which can increase
|
//! Used to determine whether C++ ostreams are used which can increase
|
||||||
//! the binary size significantly. If this is disabled,
|
//! the binary size significantly. If this is disabled,
|
||||||
//! the C stdio functions can be used alternatively
|
//! the C stdio functions can be used alternatively
|
||||||
|
@ -4,7 +4,6 @@
|
|||||||
#include <fsfw/devicehandlers/DeviceHandlerBase.h>
|
#include <fsfw/devicehandlers/DeviceHandlerBase.h>
|
||||||
#include <fsfw/events/EventManager.h>
|
#include <fsfw/events/EventManager.h>
|
||||||
#include <fsfw/health/HealthTable.h>
|
#include <fsfw/health/HealthTable.h>
|
||||||
#include <fsfw/tmtcpacket/pus/tm/TmPacketStored.h>
|
|
||||||
#include <fsfw/tmtcservices/CommandingServiceBase.h>
|
#include <fsfw/tmtcservices/CommandingServiceBase.h>
|
||||||
#include <fsfw/tmtcservices/PusServiceBase.h>
|
#include <fsfw/tmtcservices/PusServiceBase.h>
|
||||||
#include <fsfw/internalerror/InternalErrorReporter.h>
|
#include <fsfw/internalerror/InternalErrorReporter.h>
|
||||||
@ -35,19 +34,15 @@ void Factory::produceFsfwObjects(void) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void Factory::setStaticFrameworkObjectIds() {
|
void Factory::setStaticFrameworkObjectIds() {
|
||||||
PusServiceBase::packetSource = objects::NO_OBJECT;
|
PusServiceBase::PUS_DISTRIBUTOR = objects::NO_OBJECT;
|
||||||
PusServiceBase::packetDestination = objects::NO_OBJECT;
|
PusServiceBase::PACKET_DESTINATION = objects::NO_OBJECT;
|
||||||
|
|
||||||
CommandingServiceBase::defaultPacketSource = objects::NO_OBJECT;
|
CommandingServiceBase::defaultPacketSource = objects::NO_OBJECT;
|
||||||
CommandingServiceBase::defaultPacketDestination = objects::NO_OBJECT;
|
CommandingServiceBase::defaultPacketDestination = objects::NO_OBJECT;
|
||||||
|
|
||||||
VerificationReporter::messageReceiver = objects::PUS_SERVICE_1_VERIFICATION;
|
|
||||||
|
|
||||||
DeviceHandlerBase::powerSwitcherId = objects::NO_OBJECT;
|
DeviceHandlerBase::powerSwitcherId = objects::NO_OBJECT;
|
||||||
DeviceHandlerBase::rawDataReceiverId = objects::PUS_SERVICE_2_DEVICE_ACCESS;
|
DeviceHandlerBase::rawDataReceiverId = objects::PUS_SERVICE_2_DEVICE_ACCESS;
|
||||||
|
|
||||||
DeviceHandlerFailureIsolation::powerConfirmationId = objects::NO_OBJECT;
|
DeviceHandlerFailureIsolation::powerConfirmationId = objects::NO_OBJECT;
|
||||||
|
|
||||||
TmPacketBase::timeStamperId = objects::NO_OBJECT;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -11,15 +11,15 @@ ReturnValue_t pst::pollingSequenceInitDefault(
|
|||||||
|
|
||||||
/* Add polling sequence table here */
|
/* Add polling sequence table here */
|
||||||
|
|
||||||
if (thisSequence->checkSequence() == HasReturnvaluesIF::RETURN_OK) {
|
if (thisSequence->checkSequence() == returnvalue::OK) {
|
||||||
return HasReturnvaluesIF::RETURN_OK;
|
return returnvalue::OK;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
#if FSFW_CPP_OSTREAM_ENABLED == 1
|
#if FSFW_CPP_OSTREAM_ENABLED == 1
|
||||||
sif::error << "pst::pollingSequenceInitDefault: Sequence invalid!"
|
sif::error << "pst::pollingSequenceInitDefault: Sequence invalid!"
|
||||||
<< std::endl;
|
<< std::endl;
|
||||||
#endif
|
#endif
|
||||||
return HasReturnvaluesIF::RETURN_FAILED;
|
return returnvalue::FAILED;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
#ifndef POLLINGSEQUENCEFACTORY_H_
|
#ifndef POLLINGSEQUENCEFACTORY_H_
|
||||||
#define POLLINGSEQUENCEFACTORY_H_
|
#define POLLINGSEQUENCEFACTORY_H_
|
||||||
|
|
||||||
#include <fsfw/returnvalues/HasReturnvaluesIF.h>
|
#include <fsfw/returnvalues/returnvalue.h>
|
||||||
|
|
||||||
class FixedTimeslotTaskIF;
|
class FixedTimeslotTaskIF;
|
||||||
|
|
||||||
|
@ -3,6 +3,11 @@ if [[ ! -f README.md ]]; then
|
|||||||
cd ..
|
cd ..
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
folder_list=(
|
||||||
|
"./src"
|
||||||
|
"./unittests"
|
||||||
|
)
|
||||||
|
|
||||||
cmake_fmt="cmake-format"
|
cmake_fmt="cmake-format"
|
||||||
file_selectors="-iname CMakeLists.txt"
|
file_selectors="-iname CMakeLists.txt"
|
||||||
if command -v ${cmake_fmt} &> /dev/null; then
|
if command -v ${cmake_fmt} &> /dev/null; then
|
||||||
@ -15,9 +20,10 @@ fi
|
|||||||
cpp_format="clang-format"
|
cpp_format="clang-format"
|
||||||
file_selectors="-iname *.h -o -iname *.cpp -o -iname *.c -o -iname *.tpp"
|
file_selectors="-iname *.h -o -iname *.cpp -o -iname *.c -o -iname *.tpp"
|
||||||
if command -v ${cpp_format} &> /dev/null; then
|
if command -v ${cpp_format} &> /dev/null; then
|
||||||
find ./src ${file_selectors} | xargs ${cpp_format} --style=file -i
|
for dir in ${folder_list[@]}; do
|
||||||
find ./hal ${file_selectors} | xargs ${cpp_format} --style=file -i
|
echo "Auto-formatting ${dir} recursively"
|
||||||
find ./tests ${file_selectors} | xargs ${cpp_format} --style=file -i
|
find ${dir} ${file_selectors} | xargs clang-format --style=file -i
|
||||||
|
done
|
||||||
else
|
else
|
||||||
echo "No ${cpp_format} tool found, not formatting C++/C files"
|
echo "No ${cpp_format} tool found, not formatting C++/C files"
|
||||||
fi
|
fi
|
||||||
|
@ -13,7 +13,7 @@ from shutil import which
|
|||||||
from typing import List
|
from typing import List
|
||||||
|
|
||||||
|
|
||||||
UNITTEST_FOLDER_NAME = "build-tests"
|
UNITTEST_FOLDER_NAME = "cmake-build-tests"
|
||||||
DOCS_FOLDER_NAME = "build-docs"
|
DOCS_FOLDER_NAME = "build-docs"
|
||||||
|
|
||||||
|
|
||||||
@ -199,7 +199,7 @@ def check_for_cmake_build_dir(build_dir_list: list) -> list:
|
|||||||
def perform_lcov_operation(directory: str, chdir: bool):
|
def perform_lcov_operation(directory: str, chdir: bool):
|
||||||
if chdir:
|
if chdir:
|
||||||
os.chdir(directory)
|
os.chdir(directory)
|
||||||
cmd_runner("cmake --build . -- fsfw-tests_coverage -j")
|
cmd_runner("cmake --build . -j -- fsfw-tests_coverage")
|
||||||
|
|
||||||
|
|
||||||
def determine_build_dir(build_dir_list: List[str]):
|
def determine_build_dir(build_dir_list: List[str]):
|
||||||
|
@ -12,7 +12,7 @@ ReturnValue_t ActionHelper::handleActionMessage(CommandMessage* command) {
|
|||||||
if (command->getCommand() == ActionMessage::EXECUTE_ACTION) {
|
if (command->getCommand() == ActionMessage::EXECUTE_ACTION) {
|
||||||
ActionId_t currentAction = ActionMessage::getActionId(command);
|
ActionId_t currentAction = ActionMessage::getActionId(command);
|
||||||
prepareExecution(command->getSender(), currentAction, ActionMessage::getStoreId(command));
|
prepareExecution(command->getSender(), currentAction, ActionMessage::getStoreId(command));
|
||||||
return HasReturnvaluesIF::RETURN_OK;
|
return returnvalue::OK;
|
||||||
} else {
|
} else {
|
||||||
return CommandMessage::UNKNOWN_COMMAND;
|
return CommandMessage::UNKNOWN_COMMAND;
|
||||||
}
|
}
|
||||||
@ -21,7 +21,7 @@ ReturnValue_t ActionHelper::handleActionMessage(CommandMessage* command) {
|
|||||||
ReturnValue_t ActionHelper::initialize(MessageQueueIF* queueToUse_) {
|
ReturnValue_t ActionHelper::initialize(MessageQueueIF* queueToUse_) {
|
||||||
ipcStore = ObjectManager::instance()->get<StorageManagerIF>(objects::IPC_STORE);
|
ipcStore = ObjectManager::instance()->get<StorageManagerIF>(objects::IPC_STORE);
|
||||||
if (ipcStore == nullptr) {
|
if (ipcStore == nullptr) {
|
||||||
return HasReturnvaluesIF::RETURN_FAILED;
|
return returnvalue::FAILED;
|
||||||
}
|
}
|
||||||
if (queueToUse_ != nullptr) {
|
if (queueToUse_ != nullptr) {
|
||||||
setQueueToUse(queueToUse_);
|
setQueueToUse(queueToUse_);
|
||||||
@ -35,10 +35,10 @@ ReturnValue_t ActionHelper::initialize(MessageQueueIF* queueToUse_) {
|
|||||||
sif::printWarning("ActionHelper::initialize: No queue set\n");
|
sif::printWarning("ActionHelper::initialize: No queue set\n");
|
||||||
#endif
|
#endif
|
||||||
#endif /* FSFW_VERBOSE_LEVEL >= 1 */
|
#endif /* FSFW_VERBOSE_LEVEL >= 1 */
|
||||||
return HasReturnvaluesIF::RETURN_FAILED;
|
return returnvalue::FAILED;
|
||||||
}
|
}
|
||||||
|
|
||||||
return HasReturnvaluesIF::RETURN_OK;
|
return returnvalue::OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
void ActionHelper::step(uint8_t step, MessageQueueId_t reportTo, ActionId_t commandId,
|
void ActionHelper::step(uint8_t step, MessageQueueId_t reportTo, ActionId_t commandId,
|
||||||
@ -62,7 +62,7 @@ void ActionHelper::prepareExecution(MessageQueueId_t commandedBy, ActionId_t act
|
|||||||
const uint8_t* dataPtr = nullptr;
|
const uint8_t* dataPtr = nullptr;
|
||||||
size_t size = 0;
|
size_t size = 0;
|
||||||
ReturnValue_t result = ipcStore->getData(dataAddress, &dataPtr, &size);
|
ReturnValue_t result = ipcStore->getData(dataAddress, &dataPtr, &size);
|
||||||
if (result != HasReturnvaluesIF::RETURN_OK) {
|
if (result != returnvalue::OK) {
|
||||||
CommandMessage reply;
|
CommandMessage reply;
|
||||||
ActionMessage::setStepReply(&reply, actionId, 0, result);
|
ActionMessage::setStepReply(&reply, actionId, 0, result);
|
||||||
queueToUse->sendMessage(commandedBy, &reply);
|
queueToUse->sendMessage(commandedBy, &reply);
|
||||||
@ -75,7 +75,7 @@ void ActionHelper::prepareExecution(MessageQueueId_t commandedBy, ActionId_t act
|
|||||||
ActionMessage::setCompletionReply(&reply, actionId, true, result);
|
ActionMessage::setCompletionReply(&reply, actionId, true, result);
|
||||||
queueToUse->sendMessage(commandedBy, &reply);
|
queueToUse->sendMessage(commandedBy, &reply);
|
||||||
}
|
}
|
||||||
if (result != HasReturnvaluesIF::RETURN_OK) {
|
if (result != returnvalue::OK) {
|
||||||
CommandMessage reply;
|
CommandMessage reply;
|
||||||
ActionMessage::setStepReply(&reply, actionId, 0, result);
|
ActionMessage::setStepReply(&reply, actionId, 0, result);
|
||||||
queueToUse->sendMessage(commandedBy, &reply);
|
queueToUse->sendMessage(commandedBy, &reply);
|
||||||
@ -91,11 +91,11 @@ ReturnValue_t ActionHelper::reportData(MessageQueueId_t reportTo, ActionId_t rep
|
|||||||
size_t maxSize = data->getSerializedSize();
|
size_t maxSize = data->getSerializedSize();
|
||||||
if (maxSize == 0) {
|
if (maxSize == 0) {
|
||||||
/* No error, there's simply nothing to report. */
|
/* No error, there's simply nothing to report. */
|
||||||
return HasReturnvaluesIF::RETURN_OK;
|
return returnvalue::OK;
|
||||||
}
|
}
|
||||||
size_t size = 0;
|
size_t size = 0;
|
||||||
ReturnValue_t result = ipcStore->getFreeElement(&storeAddress, maxSize, &dataPtr);
|
ReturnValue_t result = ipcStore->getFreeElement(&storeAddress, maxSize, &dataPtr);
|
||||||
if (result != HasReturnvaluesIF::RETURN_OK) {
|
if (result != returnvalue::OK) {
|
||||||
#if FSFW_CPP_OSTREAM_ENABLED == 1
|
#if FSFW_CPP_OSTREAM_ENABLED == 1
|
||||||
sif::warning << "ActionHelper::reportData: Getting free element from IPC store failed!"
|
sif::warning << "ActionHelper::reportData: Getting free element from IPC store failed!"
|
||||||
<< std::endl;
|
<< std::endl;
|
||||||
@ -107,7 +107,7 @@ ReturnValue_t ActionHelper::reportData(MessageQueueId_t reportTo, ActionId_t rep
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
result = data->serialize(&dataPtr, &size, maxSize, SerializeIF::Endianness::BIG);
|
result = data->serialize(&dataPtr, &size, maxSize, SerializeIF::Endianness::BIG);
|
||||||
if (result != HasReturnvaluesIF::RETURN_OK) {
|
if (result != returnvalue::OK) {
|
||||||
ipcStore->deleteData(storeAddress);
|
ipcStore->deleteData(storeAddress);
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
@ -124,7 +124,7 @@ ReturnValue_t ActionHelper::reportData(MessageQueueId_t reportTo, ActionId_t rep
|
|||||||
result = queueToUse->sendMessage(reportTo, &reply);
|
result = queueToUse->sendMessage(reportTo, &reply);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (result != HasReturnvaluesIF::RETURN_OK) {
|
if (result != returnvalue::OK) {
|
||||||
ipcStore->deleteData(storeAddress);
|
ipcStore->deleteData(storeAddress);
|
||||||
}
|
}
|
||||||
return result;
|
return result;
|
||||||
@ -137,7 +137,7 @@ ReturnValue_t ActionHelper::reportData(MessageQueueId_t reportTo, ActionId_t rep
|
|||||||
CommandMessage reply;
|
CommandMessage reply;
|
||||||
store_address_t storeAddress;
|
store_address_t storeAddress;
|
||||||
ReturnValue_t result = ipcStore->addData(&storeAddress, data, dataSize);
|
ReturnValue_t result = ipcStore->addData(&storeAddress, data, dataSize);
|
||||||
if (result != HasReturnvaluesIF::RETURN_OK) {
|
if (result != returnvalue::OK) {
|
||||||
#if FSFW_CPP_OSTREAM_ENABLED == 1
|
#if FSFW_CPP_OSTREAM_ENABLED == 1
|
||||||
sif::warning << "ActionHelper::reportData: Adding data to IPC store failed!" << std::endl;
|
sif::warning << "ActionHelper::reportData: Adding data to IPC store failed!" << std::endl;
|
||||||
#else
|
#else
|
||||||
@ -158,7 +158,7 @@ ReturnValue_t ActionHelper::reportData(MessageQueueId_t reportTo, ActionId_t rep
|
|||||||
result = queueToUse->sendMessage(reportTo, &reply);
|
result = queueToUse->sendMessage(reportTo, &reply);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (result != HasReturnvaluesIF::RETURN_OK) {
|
if (result != returnvalue::OK) {
|
||||||
ipcStore->deleteData(storeAddress);
|
ipcStore->deleteData(storeAddress);
|
||||||
}
|
}
|
||||||
return result;
|
return result;
|
||||||
|
@ -36,7 +36,7 @@ class ActionHelper {
|
|||||||
* send to the sender of the message automatically.
|
* send to the sender of the message automatically.
|
||||||
*
|
*
|
||||||
* @param command Pointer to a command message received by the owner
|
* @param command Pointer to a command message received by the owner
|
||||||
* @return HasReturnvaluesIF::RETURN_OK if the message is a action message,
|
* @return returnvalue::OK if the message is a action message,
|
||||||
* CommandMessage::UNKNOW_COMMAND if this message ID is unkown
|
* CommandMessage::UNKNOW_COMMAND if this message ID is unkown
|
||||||
*/
|
*/
|
||||||
ReturnValue_t handleActionMessage(CommandMessage* command);
|
ReturnValue_t handleActionMessage(CommandMessage* command);
|
||||||
@ -45,7 +45,7 @@ class ActionHelper {
|
|||||||
* helper function
|
* helper function
|
||||||
* @param queueToUse_ Pointer to the messageQueue to be used, optional
|
* @param queueToUse_ Pointer to the messageQueue to be used, optional
|
||||||
* if queue was set in constructor
|
* if queue was set in constructor
|
||||||
* @return Returns RETURN_OK if successful
|
* @return Returns returnvalue::OK if successful
|
||||||
*/
|
*/
|
||||||
ReturnValue_t initialize(MessageQueueIF* queueToUse_ = nullptr);
|
ReturnValue_t initialize(MessageQueueIF* queueToUse_ = nullptr);
|
||||||
/**
|
/**
|
||||||
@ -58,7 +58,7 @@ class ActionHelper {
|
|||||||
* @param result Result of the execution
|
* @param result Result of the execution
|
||||||
*/
|
*/
|
||||||
void step(uint8_t step, MessageQueueId_t reportTo, ActionId_t commandId,
|
void step(uint8_t step, MessageQueueId_t reportTo, ActionId_t commandId,
|
||||||
ReturnValue_t result = HasReturnvaluesIF::RETURN_OK);
|
ReturnValue_t result = returnvalue::OK);
|
||||||
/**
|
/**
|
||||||
* Function to be called by the owner to send a action completion message
|
* Function to be called by the owner to send a action completion message
|
||||||
* @param success Specify whether action was completed successfully or not.
|
* @param success Specify whether action was completed successfully or not.
|
||||||
@ -67,7 +67,7 @@ class ActionHelper {
|
|||||||
* @param result Result of the execution
|
* @param result Result of the execution
|
||||||
*/
|
*/
|
||||||
void finish(bool success, MessageQueueId_t reportTo, ActionId_t commandId,
|
void finish(bool success, MessageQueueId_t reportTo, ActionId_t commandId,
|
||||||
ReturnValue_t result = HasReturnvaluesIF::RETURN_OK);
|
ReturnValue_t result = returnvalue::OK);
|
||||||
/**
|
/**
|
||||||
* Function to be called by the owner if an action does report data.
|
* Function to be called by the owner if an action does report data.
|
||||||
* Takes a SerializeIF* pointer and serializes it into the IPC store.
|
* Takes a SerializeIF* pointer and serializes it into the IPC store.
|
||||||
@ -75,7 +75,7 @@ class ActionHelper {
|
|||||||
* message to
|
* message to
|
||||||
* @param replyId ID of the executed command
|
* @param replyId ID of the executed command
|
||||||
* @param data Pointer to the data
|
* @param data Pointer to the data
|
||||||
* @return Returns RETURN_OK if successful, otherwise failure code
|
* @return Returns returnvalue::OK if successful, otherwise failure code
|
||||||
*/
|
*/
|
||||||
ReturnValue_t reportData(MessageQueueId_t reportTo, ActionId_t replyId, SerializeIF* data,
|
ReturnValue_t reportData(MessageQueueId_t reportTo, ActionId_t replyId, SerializeIF* data,
|
||||||
bool hideSender = false);
|
bool hideSender = false);
|
||||||
@ -86,7 +86,7 @@ class ActionHelper {
|
|||||||
* message to
|
* message to
|
||||||
* @param replyId ID of the executed command
|
* @param replyId ID of the executed command
|
||||||
* @param data Pointer to the data
|
* @param data Pointer to the data
|
||||||
* @return Returns RETURN_OK if successful, otherwise failure code
|
* @return Returns returnvalue::OK if successful, otherwise failure code
|
||||||
*/
|
*/
|
||||||
ReturnValue_t reportData(MessageQueueId_t reportTo, ActionId_t replyId, const uint8_t* data,
|
ReturnValue_t reportData(MessageQueueId_t reportTo, ActionId_t replyId, const uint8_t* data,
|
||||||
size_t dataSize, bool hideSender = false);
|
size_t dataSize, bool hideSender = false);
|
||||||
|
@ -25,7 +25,7 @@ store_address_t ActionMessage::getStoreId(const CommandMessage* message) {
|
|||||||
|
|
||||||
void ActionMessage::setStepReply(CommandMessage* message, ActionId_t fid, uint8_t step,
|
void ActionMessage::setStepReply(CommandMessage* message, ActionId_t fid, uint8_t step,
|
||||||
ReturnValue_t result) {
|
ReturnValue_t result) {
|
||||||
if (result == HasReturnvaluesIF::RETURN_OK) {
|
if (result == returnvalue::OK) {
|
||||||
message->setCommand(STEP_SUCCESS);
|
message->setCommand(STEP_SUCCESS);
|
||||||
} else {
|
} else {
|
||||||
message->setCommand(STEP_FAILED);
|
message->setCommand(STEP_FAILED);
|
||||||
|
@ -33,12 +33,12 @@ class ActionMessage {
|
|||||||
static store_address_t getStoreId(const CommandMessage* message);
|
static store_address_t getStoreId(const CommandMessage* message);
|
||||||
|
|
||||||
static void setStepReply(CommandMessage* message, ActionId_t fid, uint8_t step,
|
static void setStepReply(CommandMessage* message, ActionId_t fid, uint8_t step,
|
||||||
ReturnValue_t result = HasReturnvaluesIF::RETURN_OK);
|
ReturnValue_t result = returnvalue::OK);
|
||||||
static uint8_t getStep(const CommandMessage* message);
|
static uint8_t getStep(const CommandMessage* message);
|
||||||
static ReturnValue_t getReturnCode(const CommandMessage* message);
|
static ReturnValue_t getReturnCode(const CommandMessage* message);
|
||||||
static void setDataReply(CommandMessage* message, ActionId_t actionId, store_address_t data);
|
static void setDataReply(CommandMessage* message, ActionId_t actionId, store_address_t data);
|
||||||
static void setCompletionReply(CommandMessage* message, ActionId_t fid, bool success,
|
static void setCompletionReply(CommandMessage* message, ActionId_t fid, bool success,
|
||||||
ReturnValue_t result = HasReturnvaluesIF::RETURN_OK);
|
ReturnValue_t result = returnvalue::OK);
|
||||||
|
|
||||||
static void clear(CommandMessage* message);
|
static void clear(CommandMessage* message);
|
||||||
};
|
};
|
||||||
|
@ -16,12 +16,12 @@ ReturnValue_t CommandActionHelper::commandAction(object_id_t commandTo, ActionId
|
|||||||
uint8_t *storePointer;
|
uint8_t *storePointer;
|
||||||
size_t maxSize = data->getSerializedSize();
|
size_t maxSize = data->getSerializedSize();
|
||||||
ReturnValue_t result = ipcStore->getFreeElement(&storeId, maxSize, &storePointer);
|
ReturnValue_t result = ipcStore->getFreeElement(&storeId, maxSize, &storePointer);
|
||||||
if (result != HasReturnvaluesIF::RETURN_OK) {
|
if (result != returnvalue::OK) {
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
size_t size = 0;
|
size_t size = 0;
|
||||||
result = data->serialize(&storePointer, &size, maxSize, SerializeIF::Endianness::BIG);
|
result = data->serialize(&storePointer, &size, maxSize, SerializeIF::Endianness::BIG);
|
||||||
if (result != HasReturnvaluesIF::RETURN_OK) {
|
if (result != returnvalue::OK) {
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
return sendCommand(receiver->getCommandQueue(), actionId, storeId);
|
return sendCommand(receiver->getCommandQueue(), actionId, storeId);
|
||||||
@ -35,7 +35,7 @@ ReturnValue_t CommandActionHelper::commandAction(object_id_t commandTo, ActionId
|
|||||||
}
|
}
|
||||||
store_address_t storeId;
|
store_address_t storeId;
|
||||||
ReturnValue_t result = ipcStore->addData(&storeId, data, size);
|
ReturnValue_t result = ipcStore->addData(&storeId, data, size);
|
||||||
if (result != HasReturnvaluesIF::RETURN_OK) {
|
if (result != returnvalue::OK) {
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
return sendCommand(receiver->getCommandQueue(), actionId, storeId);
|
return sendCommand(receiver->getCommandQueue(), actionId, storeId);
|
||||||
@ -46,7 +46,7 @@ ReturnValue_t CommandActionHelper::sendCommand(MessageQueueId_t queueId, ActionI
|
|||||||
CommandMessage command;
|
CommandMessage command;
|
||||||
ActionMessage::setCommand(&command, actionId, storeId);
|
ActionMessage::setCommand(&command, actionId, storeId);
|
||||||
ReturnValue_t result = queueToUse->sendMessage(queueId, &command);
|
ReturnValue_t result = queueToUse->sendMessage(queueId, &command);
|
||||||
if (result != HasReturnvaluesIF::RETURN_OK) {
|
if (result != returnvalue::OK) {
|
||||||
ipcStore->deleteData(storeId);
|
ipcStore->deleteData(storeId);
|
||||||
}
|
}
|
||||||
lastTarget = queueId;
|
lastTarget = queueId;
|
||||||
@ -57,44 +57,44 @@ ReturnValue_t CommandActionHelper::sendCommand(MessageQueueId_t queueId, ActionI
|
|||||||
ReturnValue_t CommandActionHelper::initialize() {
|
ReturnValue_t CommandActionHelper::initialize() {
|
||||||
ipcStore = ObjectManager::instance()->get<StorageManagerIF>(objects::IPC_STORE);
|
ipcStore = ObjectManager::instance()->get<StorageManagerIF>(objects::IPC_STORE);
|
||||||
if (ipcStore == nullptr) {
|
if (ipcStore == nullptr) {
|
||||||
return HasReturnvaluesIF::RETURN_FAILED;
|
return returnvalue::FAILED;
|
||||||
}
|
}
|
||||||
|
|
||||||
queueToUse = owner->getCommandQueuePtr();
|
queueToUse = owner->getCommandQueuePtr();
|
||||||
if (queueToUse == nullptr) {
|
if (queueToUse == nullptr) {
|
||||||
return HasReturnvaluesIF::RETURN_FAILED;
|
return returnvalue::FAILED;
|
||||||
}
|
}
|
||||||
return HasReturnvaluesIF::RETURN_OK;
|
return returnvalue::OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
ReturnValue_t CommandActionHelper::handleReply(CommandMessage *reply) {
|
ReturnValue_t CommandActionHelper::handleReply(CommandMessage *reply) {
|
||||||
if (reply->getSender() != lastTarget) {
|
if (reply->getSender() != lastTarget) {
|
||||||
return HasReturnvaluesIF::RETURN_FAILED;
|
return returnvalue::FAILED;
|
||||||
}
|
}
|
||||||
switch (reply->getCommand()) {
|
switch (reply->getCommand()) {
|
||||||
case ActionMessage::COMPLETION_SUCCESS:
|
case ActionMessage::COMPLETION_SUCCESS:
|
||||||
commandCount--;
|
commandCount--;
|
||||||
owner->completionSuccessfulReceived(ActionMessage::getActionId(reply));
|
owner->completionSuccessfulReceived(ActionMessage::getActionId(reply));
|
||||||
return HasReturnvaluesIF::RETURN_OK;
|
return returnvalue::OK;
|
||||||
case ActionMessage::COMPLETION_FAILED:
|
case ActionMessage::COMPLETION_FAILED:
|
||||||
commandCount--;
|
commandCount--;
|
||||||
owner->completionFailedReceived(ActionMessage::getActionId(reply),
|
owner->completionFailedReceived(ActionMessage::getActionId(reply),
|
||||||
ActionMessage::getReturnCode(reply));
|
ActionMessage::getReturnCode(reply));
|
||||||
return HasReturnvaluesIF::RETURN_OK;
|
return returnvalue::OK;
|
||||||
case ActionMessage::STEP_SUCCESS:
|
case ActionMessage::STEP_SUCCESS:
|
||||||
owner->stepSuccessfulReceived(ActionMessage::getActionId(reply),
|
owner->stepSuccessfulReceived(ActionMessage::getActionId(reply),
|
||||||
ActionMessage::getStep(reply));
|
ActionMessage::getStep(reply));
|
||||||
return HasReturnvaluesIF::RETURN_OK;
|
return returnvalue::OK;
|
||||||
case ActionMessage::STEP_FAILED:
|
case ActionMessage::STEP_FAILED:
|
||||||
commandCount--;
|
commandCount--;
|
||||||
owner->stepFailedReceived(ActionMessage::getActionId(reply), ActionMessage::getStep(reply),
|
owner->stepFailedReceived(ActionMessage::getActionId(reply), ActionMessage::getStep(reply),
|
||||||
ActionMessage::getReturnCode(reply));
|
ActionMessage::getReturnCode(reply));
|
||||||
return HasReturnvaluesIF::RETURN_OK;
|
return returnvalue::OK;
|
||||||
case ActionMessage::DATA_REPLY:
|
case ActionMessage::DATA_REPLY:
|
||||||
extractDataForOwner(ActionMessage::getActionId(reply), ActionMessage::getStoreId(reply));
|
extractDataForOwner(ActionMessage::getActionId(reply), ActionMessage::getStoreId(reply));
|
||||||
return HasReturnvaluesIF::RETURN_OK;
|
return returnvalue::OK;
|
||||||
default:
|
default:
|
||||||
return HasReturnvaluesIF::RETURN_FAILED;
|
return returnvalue::FAILED;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -104,7 +104,7 @@ void CommandActionHelper::extractDataForOwner(ActionId_t actionId, store_address
|
|||||||
const uint8_t *data = nullptr;
|
const uint8_t *data = nullptr;
|
||||||
size_t size = 0;
|
size_t size = 0;
|
||||||
ReturnValue_t result = ipcStore->getData(storeId, &data, &size);
|
ReturnValue_t result = ipcStore->getData(storeId, &data, &size);
|
||||||
if (result != HasReturnvaluesIF::RETURN_OK) {
|
if (result != returnvalue::OK) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
owner->dataReceived(actionId, data, size);
|
owner->dataReceived(actionId, data, size);
|
||||||
|
@ -4,7 +4,7 @@
|
|||||||
#include "ActionMessage.h"
|
#include "ActionMessage.h"
|
||||||
#include "fsfw/ipc/MessageQueueIF.h"
|
#include "fsfw/ipc/MessageQueueIF.h"
|
||||||
#include "fsfw/objectmanager/ObjectManagerIF.h"
|
#include "fsfw/objectmanager/ObjectManagerIF.h"
|
||||||
#include "fsfw/returnvalues/HasReturnvaluesIF.h"
|
#include "fsfw/returnvalues/returnvalue.h"
|
||||||
#include "fsfw/serialize/SerializeIF.h"
|
#include "fsfw/serialize/SerializeIF.h"
|
||||||
#include "fsfw/storagemanager/StorageManagerIF.h"
|
#include "fsfw/storagemanager/StorageManagerIF.h"
|
||||||
|
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
|
|
||||||
#include "CommandActionHelper.h"
|
#include "CommandActionHelper.h"
|
||||||
#include "fsfw/ipc/MessageQueueIF.h"
|
#include "fsfw/ipc/MessageQueueIF.h"
|
||||||
#include "fsfw/returnvalues/HasReturnvaluesIF.h"
|
#include "fsfw/returnvalues/returnvalue.h"
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Interface to separate commanding actions of other objects.
|
* Interface to separate commanding actions of other objects.
|
||||||
|
@ -5,7 +5,7 @@
|
|||||||
#include "ActionMessage.h"
|
#include "ActionMessage.h"
|
||||||
#include "SimpleActionHelper.h"
|
#include "SimpleActionHelper.h"
|
||||||
#include "fsfw/ipc/MessageQueueIF.h"
|
#include "fsfw/ipc/MessageQueueIF.h"
|
||||||
#include "fsfw/returnvalues/HasReturnvaluesIF.h"
|
#include "fsfw/returnvalues/returnvalue.h"
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief
|
* @brief
|
||||||
@ -53,7 +53,7 @@ class HasActionsIF {
|
|||||||
*
|
*
|
||||||
* @return
|
* @return
|
||||||
* -@c EXECUTION_FINISHED Finish reply will be generated
|
* -@c EXECUTION_FINISHED Finish reply will be generated
|
||||||
* -@c Not RETURN_OK Step failure reply will be generated
|
* -@c Not returnvalue::OK Step failure reply will be generated
|
||||||
*/
|
*/
|
||||||
virtual ReturnValue_t executeAction(ActionId_t actionId, MessageQueueId_t commandedBy,
|
virtual ReturnValue_t executeAction(ActionId_t actionId, MessageQueueId_t commandedBy,
|
||||||
const uint8_t* data, size_t size) = 0;
|
const uint8_t* data, size_t size) = 0;
|
||||||
|
@ -9,7 +9,7 @@ void SimpleActionHelper::step(ReturnValue_t result) {
|
|||||||
// STEP_OFFESET is subtracted to compensate for adding offset in base
|
// STEP_OFFESET is subtracted to compensate for adding offset in base
|
||||||
// method, which is not necessary here.
|
// method, which is not necessary here.
|
||||||
ActionHelper::step(stepCount - STEP_OFFSET, lastCommander, lastAction, result);
|
ActionHelper::step(stepCount - STEP_OFFSET, lastCommander, lastAction, result);
|
||||||
if (result != HasReturnvaluesIF::RETURN_OK) {
|
if (result != returnvalue::OK) {
|
||||||
resetHelper();
|
resetHelper();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -41,7 +41,7 @@ void SimpleActionHelper::prepareExecution(MessageQueueId_t commandedBy, ActionId
|
|||||||
const uint8_t* dataPtr = nullptr;
|
const uint8_t* dataPtr = nullptr;
|
||||||
size_t size = 0;
|
size_t size = 0;
|
||||||
ReturnValue_t result = ipcStore->getData(dataAddress, &dataPtr, &size);
|
ReturnValue_t result = ipcStore->getData(dataAddress, &dataPtr, &size);
|
||||||
if (result != HasReturnvaluesIF::RETURN_OK) {
|
if (result != returnvalue::OK) {
|
||||||
ActionMessage::setStepReply(&reply, actionId, 0, result);
|
ActionMessage::setStepReply(&reply, actionId, 0, result);
|
||||||
queueToUse->sendMessage(commandedBy, &reply);
|
queueToUse->sendMessage(commandedBy, &reply);
|
||||||
return;
|
return;
|
||||||
@ -51,12 +51,12 @@ void SimpleActionHelper::prepareExecution(MessageQueueId_t commandedBy, ActionId
|
|||||||
result = owner->executeAction(actionId, commandedBy, dataPtr, size);
|
result = owner->executeAction(actionId, commandedBy, dataPtr, size);
|
||||||
ipcStore->deleteData(dataAddress);
|
ipcStore->deleteData(dataAddress);
|
||||||
switch (result) {
|
switch (result) {
|
||||||
case HasReturnvaluesIF::RETURN_OK:
|
case returnvalue::OK:
|
||||||
isExecuting = true;
|
isExecuting = true;
|
||||||
stepCount++;
|
stepCount++;
|
||||||
break;
|
break;
|
||||||
case HasActionsIF::EXECUTION_FINISHED:
|
case HasActionsIF::EXECUTION_FINISHED:
|
||||||
ActionMessage::setCompletionReply(&reply, actionId, true, HasReturnvaluesIF::RETURN_OK);
|
ActionMessage::setCompletionReply(&reply, actionId, true, returnvalue::OK);
|
||||||
queueToUse->sendMessage(commandedBy, &reply);
|
queueToUse->sendMessage(commandedBy, &reply);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
|
@ -12,8 +12,8 @@ class SimpleActionHelper : public ActionHelper {
|
|||||||
public:
|
public:
|
||||||
SimpleActionHelper(HasActionsIF* setOwner, MessageQueueIF* useThisQueue);
|
SimpleActionHelper(HasActionsIF* setOwner, MessageQueueIF* useThisQueue);
|
||||||
~SimpleActionHelper() override;
|
~SimpleActionHelper() override;
|
||||||
void step(ReturnValue_t result = HasReturnvaluesIF::RETURN_OK);
|
void step(ReturnValue_t result = returnvalue::OK);
|
||||||
void finish(ReturnValue_t result = HasReturnvaluesIF::RETURN_OK);
|
void finish(ReturnValue_t result = returnvalue::OK);
|
||||||
ReturnValue_t reportData(SerializeIF* data);
|
ReturnValue_t reportData(SerializeIF* data);
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
@ -1,17 +0,0 @@
|
|||||||
#include "CFDPMessage.h"
|
|
||||||
|
|
||||||
CFDPMessage::CFDPMessage() {}
|
|
||||||
|
|
||||||
CFDPMessage::~CFDPMessage() {}
|
|
||||||
|
|
||||||
void CFDPMessage::setCommand(CommandMessage *message, store_address_t cfdpPacket) {
|
|
||||||
message->setParameter(cfdpPacket.raw);
|
|
||||||
}
|
|
||||||
|
|
||||||
store_address_t CFDPMessage::getStoreId(const CommandMessage *message) {
|
|
||||||
store_address_t storeAddressCFDPPacket;
|
|
||||||
storeAddressCFDPPacket = message->getParameter();
|
|
||||||
return storeAddressCFDPPacket;
|
|
||||||
}
|
|
||||||
|
|
||||||
void CFDPMessage::clear(CommandMessage *message) {}
|
|
@ -1,4 +1,4 @@
|
|||||||
target_sources(${LIB_FSFW_NAME} PRIVATE CFDPHandler.cpp CFDPMessage.cpp)
|
target_sources(${LIB_FSFW_NAME} PRIVATE CfdpHandler.cpp CfdpMessage.cpp)
|
||||||
|
|
||||||
add_subdirectory(pdu)
|
add_subdirectory(pdu)
|
||||||
add_subdirectory(tlv)
|
add_subdirectory(tlv)
|
||||||
|
@ -1,33 +1,32 @@
|
|||||||
#include "fsfw/cfdp/CFDPHandler.h"
|
#include "fsfw/cfdp/CfdpHandler.h"
|
||||||
|
|
||||||
#include "fsfw/cfdp/CFDPMessage.h"
|
#include "fsfw/cfdp/CfdpMessage.h"
|
||||||
#include "fsfw/ipc/CommandMessage.h"
|
#include "fsfw/ipc/CommandMessage.h"
|
||||||
#include "fsfw/ipc/QueueFactory.h"
|
#include "fsfw/ipc/QueueFactory.h"
|
||||||
#include "fsfw/objectmanager/ObjectManager.h"
|
|
||||||
#include "fsfw/storagemanager/storeAddress.h"
|
#include "fsfw/storagemanager/storeAddress.h"
|
||||||
#include "fsfw/tmtcservices/AcceptsTelemetryIF.h"
|
#include "fsfw/tmtcservices/AcceptsTelemetryIF.h"
|
||||||
|
|
||||||
object_id_t CFDPHandler::packetSource = 0;
|
object_id_t CfdpHandler::packetSource = 0;
|
||||||
object_id_t CFDPHandler::packetDestination = 0;
|
object_id_t CfdpHandler::packetDestination = 0;
|
||||||
|
|
||||||
CFDPHandler::CFDPHandler(object_id_t setObjectId, CFDPDistributor* dist)
|
CfdpHandler::CfdpHandler(object_id_t setObjectId, CFDPDistributor* dist)
|
||||||
: SystemObject(setObjectId) {
|
: SystemObject(setObjectId) {
|
||||||
requestQueue = QueueFactory::instance()->createMessageQueue(CFDP_HANDLER_MAX_RECEPTION);
|
requestQueue = QueueFactory::instance()->createMessageQueue(CFDP_HANDLER_MAX_RECEPTION);
|
||||||
distributor = dist;
|
distributor = dist;
|
||||||
}
|
}
|
||||||
|
|
||||||
CFDPHandler::~CFDPHandler() {}
|
CfdpHandler::~CfdpHandler() = default;
|
||||||
|
|
||||||
ReturnValue_t CFDPHandler::initialize() {
|
ReturnValue_t CfdpHandler::initialize() {
|
||||||
ReturnValue_t result = SystemObject::initialize();
|
ReturnValue_t result = SystemObject::initialize();
|
||||||
if (result != RETURN_OK) {
|
if (result != returnvalue::OK) {
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
this->distributor->registerHandler(this);
|
this->distributor->registerHandler(this);
|
||||||
return HasReturnvaluesIF::RETURN_OK;
|
return returnvalue::OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
ReturnValue_t CFDPHandler::handleRequest(store_address_t storeId) {
|
ReturnValue_t CfdpHandler::handleRequest(store_address_t storeId) {
|
||||||
#if FSFW_VERBOSE_LEVEL >= 1
|
#if FSFW_VERBOSE_LEVEL >= 1
|
||||||
#if FSFW_CPP_OSTREAM_ENABLED == 1
|
#if FSFW_CPP_OSTREAM_ENABLED == 1
|
||||||
sif::debug << "CFDPHandler::handleRequest" << std::endl;
|
sif::debug << "CFDPHandler::handleRequest" << std::endl;
|
||||||
@ -38,20 +37,20 @@ ReturnValue_t CFDPHandler::handleRequest(store_address_t storeId) {
|
|||||||
|
|
||||||
// TODO read out packet from store using storeId
|
// TODO read out packet from store using storeId
|
||||||
|
|
||||||
return RETURN_OK;
|
return returnvalue::OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
ReturnValue_t CFDPHandler::performOperation(uint8_t opCode) {
|
ReturnValue_t CfdpHandler::performOperation(uint8_t opCode) {
|
||||||
ReturnValue_t status = RETURN_OK;
|
ReturnValue_t status = returnvalue::OK;
|
||||||
CommandMessage currentMessage;
|
CommandMessage currentMessage;
|
||||||
for (status = this->requestQueue->receiveMessage(¤tMessage); status == RETURN_OK;
|
for (status = this->requestQueue->receiveMessage(¤tMessage); status == returnvalue::OK;
|
||||||
status = this->requestQueue->receiveMessage(¤tMessage)) {
|
status = this->requestQueue->receiveMessage(¤tMessage)) {
|
||||||
store_address_t storeId = CFDPMessage::getStoreId(¤tMessage);
|
store_address_t storeId = CfdpMessage::getStoreId(¤tMessage);
|
||||||
this->handleRequest(storeId);
|
this->handleRequest(storeId);
|
||||||
}
|
}
|
||||||
return RETURN_OK;
|
return returnvalue::OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
uint16_t CFDPHandler::getIdentifier() { return 0; }
|
uint32_t CfdpHandler::getIdentifier() const { return 0; }
|
||||||
|
|
||||||
MessageQueueId_t CFDPHandler::getRequestQueue() { return this->requestQueue->getId(); }
|
MessageQueueId_t CfdpHandler::getRequestQueue() const { return this->requestQueue->getId(); }
|
@ -3,7 +3,7 @@
|
|||||||
|
|
||||||
#include "fsfw/ipc/MessageQueueIF.h"
|
#include "fsfw/ipc/MessageQueueIF.h"
|
||||||
#include "fsfw/objectmanager/SystemObject.h"
|
#include "fsfw/objectmanager/SystemObject.h"
|
||||||
#include "fsfw/returnvalues/HasReturnvaluesIF.h"
|
#include "fsfw/returnvalues/returnvalue.h"
|
||||||
#include "fsfw/tasks/ExecutableObjectIF.h"
|
#include "fsfw/tasks/ExecutableObjectIF.h"
|
||||||
#include "fsfw/tcdistribution/CFDPDistributor.h"
|
#include "fsfw/tcdistribution/CFDPDistributor.h"
|
||||||
#include "fsfw/tmtcservices/AcceptsTelecommandsIF.h"
|
#include "fsfw/tmtcservices/AcceptsTelecommandsIF.h"
|
||||||
@ -12,24 +12,21 @@ namespace Factory {
|
|||||||
void setStaticFrameworkObjectIds();
|
void setStaticFrameworkObjectIds();
|
||||||
}
|
}
|
||||||
|
|
||||||
class CFDPHandler : public ExecutableObjectIF,
|
class CfdpHandler : public ExecutableObjectIF, public AcceptsTelecommandsIF, public SystemObject {
|
||||||
public AcceptsTelecommandsIF,
|
|
||||||
public SystemObject,
|
|
||||||
public HasReturnvaluesIF {
|
|
||||||
friend void(Factory::setStaticFrameworkObjectIds)();
|
friend void(Factory::setStaticFrameworkObjectIds)();
|
||||||
|
|
||||||
public:
|
public:
|
||||||
CFDPHandler(object_id_t setObjectId, CFDPDistributor* distributor);
|
CfdpHandler(object_id_t setObjectId, CFDPDistributor* distributor);
|
||||||
/**
|
/**
|
||||||
* The destructor is empty.
|
* The destructor is empty.
|
||||||
*/
|
*/
|
||||||
virtual ~CFDPHandler();
|
virtual ~CfdpHandler();
|
||||||
|
|
||||||
virtual ReturnValue_t handleRequest(store_address_t storeId);
|
virtual ReturnValue_t handleRequest(store_address_t storeId);
|
||||||
|
|
||||||
virtual ReturnValue_t initialize() override;
|
virtual ReturnValue_t initialize() override;
|
||||||
virtual uint16_t getIdentifier() override;
|
uint32_t getIdentifier() const override;
|
||||||
MessageQueueId_t getRequestQueue() override;
|
MessageQueueId_t getRequestQueue() const override;
|
||||||
ReturnValue_t performOperation(uint8_t opCode) override;
|
ReturnValue_t performOperation(uint8_t opCode) override;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
@ -45,7 +42,7 @@ class CFDPHandler : public ExecutableObjectIF,
|
|||||||
* The current CFDP packet to be processed.
|
* The current CFDP packet to be processed.
|
||||||
* It is deleted after handleRequest was executed.
|
* It is deleted after handleRequest was executed.
|
||||||
*/
|
*/
|
||||||
CFDPPacketStored currentPacket;
|
CfdpPacketStored currentPacket;
|
||||||
|
|
||||||
static object_id_t packetSource;
|
static object_id_t packetSource;
|
||||||
|
|
17
src/fsfw/cfdp/CfdpMessage.cpp
Normal file
17
src/fsfw/cfdp/CfdpMessage.cpp
Normal file
@ -0,0 +1,17 @@
|
|||||||
|
#include "CfdpMessage.h"
|
||||||
|
|
||||||
|
CfdpMessage::CfdpMessage() = default;
|
||||||
|
|
||||||
|
CfdpMessage::~CfdpMessage() = default;
|
||||||
|
|
||||||
|
void CfdpMessage::setCommand(CommandMessage *message, store_address_t cfdpPacket) {
|
||||||
|
message->setParameter(cfdpPacket.raw);
|
||||||
|
}
|
||||||
|
|
||||||
|
store_address_t CfdpMessage::getStoreId(const CommandMessage *message) {
|
||||||
|
store_address_t storeId;
|
||||||
|
storeId = static_cast<store_address_t>(message->getParameter());
|
||||||
|
return storeId;
|
||||||
|
}
|
||||||
|
|
||||||
|
void CfdpMessage::clear(CommandMessage *message) {}
|
@ -5,14 +5,14 @@
|
|||||||
#include "fsfw/objectmanager/ObjectManagerIF.h"
|
#include "fsfw/objectmanager/ObjectManagerIF.h"
|
||||||
#include "fsfw/storagemanager/StorageManagerIF.h"
|
#include "fsfw/storagemanager/StorageManagerIF.h"
|
||||||
|
|
||||||
class CFDPMessage {
|
class CfdpMessage {
|
||||||
private:
|
private:
|
||||||
CFDPMessage();
|
CfdpMessage();
|
||||||
|
|
||||||
public:
|
public:
|
||||||
static const uint8_t MESSAGE_ID = messagetypes::CFDP;
|
static const uint8_t MESSAGE_ID = messagetypes::CFDP;
|
||||||
|
|
||||||
virtual ~CFDPMessage();
|
virtual ~CfdpMessage();
|
||||||
static void setCommand(CommandMessage* message, store_address_t cfdpPacket);
|
static void setCommand(CommandMessage* message, store_address_t cfdpPacket);
|
||||||
|
|
||||||
static store_address_t getStoreId(const CommandMessage* message);
|
static store_address_t getStoreId(const CommandMessage* message);
|
@ -43,7 +43,7 @@ struct FileSize : public SerializeIF {
|
|||||||
uint32_t sizeTmp = 0;
|
uint32_t sizeTmp = 0;
|
||||||
ReturnValue_t result =
|
ReturnValue_t result =
|
||||||
SerializeAdapter::deSerialize(&sizeTmp, buffer, size, streamEndianness);
|
SerializeAdapter::deSerialize(&sizeTmp, buffer, size, streamEndianness);
|
||||||
if (result == HasReturnvaluesIF::RETURN_OK) {
|
if (result == returnvalue::OK) {
|
||||||
fileSize = sizeTmp;
|
fileSize = sizeTmp;
|
||||||
}
|
}
|
||||||
return result;
|
return result;
|
||||||
@ -53,11 +53,11 @@ struct FileSize : public SerializeIF {
|
|||||||
ReturnValue_t setFileSize(uint64_t fileSize, bool largeFile) {
|
ReturnValue_t setFileSize(uint64_t fileSize, bool largeFile) {
|
||||||
if (not largeFile and fileSize > UINT32_MAX) {
|
if (not largeFile and fileSize > UINT32_MAX) {
|
||||||
// TODO: emit warning here
|
// TODO: emit warning here
|
||||||
return HasReturnvaluesIF::RETURN_FAILED;
|
return returnvalue::FAILED;
|
||||||
}
|
}
|
||||||
this->fileSize = fileSize;
|
this->fileSize = fileSize;
|
||||||
this->largeFile = largeFile;
|
this->largeFile = largeFile;
|
||||||
return HasReturnvaluesIF::RETURN_OK;
|
return returnvalue::OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool isLargeFile() const { return largeFile; }
|
bool isLargeFile() const { return largeFile; }
|
||||||
|
@ -7,7 +7,7 @@
|
|||||||
#include <cstdint>
|
#include <cstdint>
|
||||||
|
|
||||||
#include "fsfw/returnvalues/FwClassIds.h"
|
#include "fsfw/returnvalues/FwClassIds.h"
|
||||||
#include "fsfw/returnvalues/HasReturnvaluesIF.h"
|
#include "fsfw/returnvalues/returnvalue.h"
|
||||||
|
|
||||||
namespace cfdp {
|
namespace cfdp {
|
||||||
|
|
||||||
@ -15,28 +15,24 @@ static constexpr uint8_t VERSION_BITS = 0b00100000;
|
|||||||
|
|
||||||
static constexpr uint8_t CFDP_CLASS_ID = CLASS_ID::CFDP;
|
static constexpr uint8_t CFDP_CLASS_ID = CLASS_ID::CFDP;
|
||||||
|
|
||||||
static constexpr ReturnValue_t INVALID_TLV_TYPE =
|
static constexpr ReturnValue_t INVALID_TLV_TYPE = returnvalue::makeCode(CFDP_CLASS_ID, 1);
|
||||||
HasReturnvaluesIF::makeReturnCode(CFDP_CLASS_ID, 1);
|
static constexpr ReturnValue_t INVALID_DIRECTIVE_FIELDS = returnvalue::makeCode(CFDP_CLASS_ID, 2);
|
||||||
static constexpr ReturnValue_t INVALID_DIRECTIVE_FIELDS =
|
static constexpr ReturnValue_t INVALID_PDU_DATAFIELD_LEN = returnvalue::makeCode(CFDP_CLASS_ID, 3);
|
||||||
HasReturnvaluesIF::makeReturnCode(CFDP_CLASS_ID, 2);
|
|
||||||
static constexpr ReturnValue_t INVALID_PDU_DATAFIELD_LEN =
|
|
||||||
HasReturnvaluesIF::makeReturnCode(CFDP_CLASS_ID, 3);
|
|
||||||
static constexpr ReturnValue_t INVALID_ACK_DIRECTIVE_FIELDS =
|
static constexpr ReturnValue_t INVALID_ACK_DIRECTIVE_FIELDS =
|
||||||
HasReturnvaluesIF::makeReturnCode(CFDP_CLASS_ID, 4);
|
returnvalue::makeCode(CFDP_CLASS_ID, 4);
|
||||||
//! Can not parse options. This can also occur because there are options
|
//! Can not parse options. This can also occur because there are options
|
||||||
//! available but the user did not pass a valid options array
|
//! available but the user did not pass a valid options array
|
||||||
static constexpr ReturnValue_t METADATA_CANT_PARSE_OPTIONS =
|
static constexpr ReturnValue_t METADATA_CANT_PARSE_OPTIONS =
|
||||||
HasReturnvaluesIF::makeReturnCode(CFDP_CLASS_ID, 5);
|
returnvalue::makeCode(CFDP_CLASS_ID, 5);
|
||||||
static constexpr ReturnValue_t NAK_CANT_PARSE_OPTIONS =
|
static constexpr ReturnValue_t NAK_CANT_PARSE_OPTIONS = returnvalue::makeCode(CFDP_CLASS_ID, 6);
|
||||||
HasReturnvaluesIF::makeReturnCode(CFDP_CLASS_ID, 6);
|
|
||||||
static constexpr ReturnValue_t FINISHED_CANT_PARSE_FS_RESPONSES =
|
static constexpr ReturnValue_t FINISHED_CANT_PARSE_FS_RESPONSES =
|
||||||
HasReturnvaluesIF::makeReturnCode(CFDP_CLASS_ID, 6);
|
returnvalue::makeCode(CFDP_CLASS_ID, 6);
|
||||||
static constexpr ReturnValue_t FILESTORE_REQUIRES_SECOND_FILE =
|
static constexpr ReturnValue_t FILESTORE_REQUIRES_SECOND_FILE =
|
||||||
HasReturnvaluesIF::makeReturnCode(CFDP_CLASS_ID, 8);
|
returnvalue::makeCode(CFDP_CLASS_ID, 8);
|
||||||
//! Can not parse filestore response because user did not pass a valid instance
|
//! Can not parse filestore response because user did not pass a valid instance
|
||||||
//! or remaining size is invalid
|
//! or remaining size is invalid
|
||||||
static constexpr ReturnValue_t FILESTORE_RESPONSE_CANT_PARSE_FS_MESSAGE =
|
static constexpr ReturnValue_t FILESTORE_RESPONSE_CANT_PARSE_FS_MESSAGE =
|
||||||
HasReturnvaluesIF::makeReturnCode(CFDP_CLASS_ID, 9);
|
returnvalue::makeCode(CFDP_CLASS_ID, 9);
|
||||||
|
|
||||||
//! Checksum types according to the SANA Checksum Types registry
|
//! Checksum types according to the SANA Checksum Types registry
|
||||||
//! https://sanaregistry.org/r/checksum_identifiers/
|
//! https://sanaregistry.org/r/checksum_identifiers/
|
||||||
|
@ -5,7 +5,7 @@ AckPduDeserializer::AckPduDeserializer(const uint8_t* pduBuf, size_t maxSize, Ac
|
|||||||
|
|
||||||
ReturnValue_t AckPduDeserializer::parseData() {
|
ReturnValue_t AckPduDeserializer::parseData() {
|
||||||
ReturnValue_t result = FileDirectiveDeserializer::parseData();
|
ReturnValue_t result = FileDirectiveDeserializer::parseData();
|
||||||
if (result != HasReturnvaluesIF::RETURN_OK) {
|
if (result != returnvalue::OK) {
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
size_t currentIdx = FileDirectiveDeserializer::getHeaderSize();
|
size_t currentIdx = FileDirectiveDeserializer::getHeaderSize();
|
||||||
@ -15,7 +15,7 @@ ReturnValue_t AckPduDeserializer::parseData() {
|
|||||||
if (not checkAndSetCodes(rawPtr[currentIdx], rawPtr[currentIdx + 1])) {
|
if (not checkAndSetCodes(rawPtr[currentIdx], rawPtr[currentIdx + 1])) {
|
||||||
return cfdp::INVALID_ACK_DIRECTIVE_FIELDS;
|
return cfdp::INVALID_ACK_DIRECTIVE_FIELDS;
|
||||||
}
|
}
|
||||||
return HasReturnvaluesIF::RETURN_OK;
|
return returnvalue::OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool AckPduDeserializer::checkAndSetCodes(uint8_t firstByte, uint8_t secondByte) {
|
bool AckPduDeserializer::checkAndSetCodes(uint8_t firstByte, uint8_t secondByte) {
|
||||||
|
@ -11,7 +11,7 @@ ReturnValue_t AckPduSerializer::serialize(uint8_t **buffer, size_t *size, size_t
|
|||||||
Endianness streamEndianness) const {
|
Endianness streamEndianness) const {
|
||||||
ReturnValue_t result =
|
ReturnValue_t result =
|
||||||
FileDirectiveSerializer::serialize(buffer, size, maxSize, streamEndianness);
|
FileDirectiveSerializer::serialize(buffer, size, maxSize, streamEndianness);
|
||||||
if (result != HasReturnvaluesIF::RETURN_OK) {
|
if (result != returnvalue::OK) {
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
cfdp::FileDirectives ackedDirective = ackInfo.getAckedDirective();
|
cfdp::FileDirectives ackedDirective = ackInfo.getAckedDirective();
|
||||||
@ -21,7 +21,7 @@ ReturnValue_t AckPduSerializer::serialize(uint8_t **buffer, size_t *size, size_t
|
|||||||
if (ackedDirective != cfdp::FileDirectives::FINISH and
|
if (ackedDirective != cfdp::FileDirectives::FINISH and
|
||||||
ackedDirective != cfdp::FileDirectives::EOF_DIRECTIVE) {
|
ackedDirective != cfdp::FileDirectives::EOF_DIRECTIVE) {
|
||||||
// TODO: better returncode
|
// TODO: better returncode
|
||||||
return HasReturnvaluesIF::RETURN_FAILED;
|
return returnvalue::FAILED;
|
||||||
}
|
}
|
||||||
if (*size + 2 > maxSize) {
|
if (*size + 2 > maxSize) {
|
||||||
return SerializeIF::BUFFER_TOO_SHORT;
|
return SerializeIF::BUFFER_TOO_SHORT;
|
||||||
@ -32,5 +32,5 @@ ReturnValue_t AckPduSerializer::serialize(uint8_t **buffer, size_t *size, size_t
|
|||||||
**buffer = ackedConditionCode << 4 | transactionStatus;
|
**buffer = ackedConditionCode << 4 | transactionStatus;
|
||||||
*buffer += 1;
|
*buffer += 1;
|
||||||
*size += 1;
|
*size += 1;
|
||||||
return HasReturnvaluesIF::RETURN_OK;
|
return returnvalue::OK;
|
||||||
}
|
}
|
||||||
|
@ -8,7 +8,7 @@ EofPduDeserializer::EofPduDeserializer(const uint8_t* pduBuf, size_t maxSize, Eo
|
|||||||
|
|
||||||
ReturnValue_t EofPduDeserializer::parseData() {
|
ReturnValue_t EofPduDeserializer::parseData() {
|
||||||
ReturnValue_t result = FileDirectiveDeserializer::parseData();
|
ReturnValue_t result = FileDirectiveDeserializer::parseData();
|
||||||
if (result != HasReturnvaluesIF::RETURN_OK) {
|
if (result != returnvalue::OK) {
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -31,7 +31,7 @@ ReturnValue_t EofPduDeserializer::parseData() {
|
|||||||
uint32_t checksum = 0;
|
uint32_t checksum = 0;
|
||||||
auto endianness = getEndianness();
|
auto endianness = getEndianness();
|
||||||
result = SerializeAdapter::deSerialize(&checksum, &bufPtr, &deserLen, endianness);
|
result = SerializeAdapter::deSerialize(&checksum, &bufPtr, &deserLen, endianness);
|
||||||
if (result != HasReturnvaluesIF::RETURN_OK) {
|
if (result != returnvalue::OK) {
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
info.setChecksum(checksum);
|
info.setChecksum(checksum);
|
||||||
@ -44,7 +44,7 @@ ReturnValue_t EofPduDeserializer::parseData() {
|
|||||||
result = SerializeAdapter::deSerialize(&fileSizeValue, &bufPtr, &deserLen, endianness);
|
result = SerializeAdapter::deSerialize(&fileSizeValue, &bufPtr, &deserLen, endianness);
|
||||||
info.setFileSize(fileSizeValue, false);
|
info.setFileSize(fileSizeValue, false);
|
||||||
}
|
}
|
||||||
if (result != HasReturnvaluesIF::RETURN_OK) {
|
if (result != returnvalue::OK) {
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
if (info.getConditionCode() != cfdp::ConditionCode::NO_ERROR) {
|
if (info.getConditionCode() != cfdp::ConditionCode::NO_ERROR) {
|
||||||
@ -61,7 +61,7 @@ ReturnValue_t EofPduDeserializer::parseData() {
|
|||||||
" given TLV pointer invalid");
|
" given TLV pointer invalid");
|
||||||
#endif
|
#endif
|
||||||
#endif /* FSFW_VERBOSE_LEVEL >= 1 */
|
#endif /* FSFW_VERBOSE_LEVEL >= 1 */
|
||||||
return HasReturnvaluesIF::RETURN_FAILED;
|
return returnvalue::FAILED;
|
||||||
}
|
}
|
||||||
result = tlvPtr->deSerialize(&bufPtr, &deserLen, endianness);
|
result = tlvPtr->deSerialize(&bufPtr, &deserLen, endianness);
|
||||||
}
|
}
|
||||||
|
@ -16,7 +16,7 @@ ReturnValue_t EofPduSerializer::serialize(uint8_t **buffer, size_t *size, size_t
|
|||||||
Endianness streamEndianness) const {
|
Endianness streamEndianness) const {
|
||||||
ReturnValue_t result =
|
ReturnValue_t result =
|
||||||
FileDirectiveSerializer::serialize(buffer, size, maxSize, streamEndianness);
|
FileDirectiveSerializer::serialize(buffer, size, maxSize, streamEndianness);
|
||||||
if (result != HasReturnvaluesIF::RETURN_OK) {
|
if (result != returnvalue::OK) {
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
if (*size + 1 > maxSize) {
|
if (*size + 1 > maxSize) {
|
||||||
@ -27,7 +27,7 @@ ReturnValue_t EofPduSerializer::serialize(uint8_t **buffer, size_t *size, size_t
|
|||||||
*size += 1;
|
*size += 1;
|
||||||
uint32_t checksum = info.getChecksum();
|
uint32_t checksum = info.getChecksum();
|
||||||
result = SerializeAdapter::serialize(&checksum, buffer, size, maxSize, streamEndianness);
|
result = SerializeAdapter::serialize(&checksum, buffer, size, maxSize, streamEndianness);
|
||||||
if (result != HasReturnvaluesIF::RETURN_OK) {
|
if (result != returnvalue::OK) {
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
if (info.getFileSize().isLargeFile()) {
|
if (info.getFileSize().isLargeFile()) {
|
||||||
|
@ -6,7 +6,7 @@ FileDataDeserializer::FileDataDeserializer(const uint8_t* pduBuf, size_t maxSize
|
|||||||
|
|
||||||
ReturnValue_t FileDataDeserializer::parseData() {
|
ReturnValue_t FileDataDeserializer::parseData() {
|
||||||
ReturnValue_t result = HeaderDeserializer::parseData();
|
ReturnValue_t result = HeaderDeserializer::parseData();
|
||||||
if (result != HasReturnvaluesIF::RETURN_OK) {
|
if (result != returnvalue::OK) {
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
size_t currentIdx = HeaderDeserializer::getHeaderSize();
|
size_t currentIdx = HeaderDeserializer::getHeaderSize();
|
||||||
@ -32,13 +32,13 @@ ReturnValue_t FileDataDeserializer::parseData() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
result = info.getOffset().deSerialize(&buf, &remSize, this->getEndianness());
|
result = info.getOffset().deSerialize(&buf, &remSize, this->getEndianness());
|
||||||
if (result != HasReturnvaluesIF::RETURN_OK) {
|
if (result != returnvalue::OK) {
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
if (remSize > 0) {
|
if (remSize > 0) {
|
||||||
info.setFileData(buf, remSize);
|
info.setFileData(buf, remSize);
|
||||||
}
|
}
|
||||||
return HasReturnvaluesIF::RETURN_OK;
|
return returnvalue::OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
SerializeIF::Endianness FileDataDeserializer::getEndianness() const { return endianness; }
|
SerializeIF::Endianness FileDataDeserializer::getEndianness() const { return endianness; }
|
||||||
|
@ -50,11 +50,11 @@ ReturnValue_t FileDataInfo::addSegmentMetadataInfo(cfdp::RecordContinuationState
|
|||||||
this->segmentMetadataFlag = cfdp::SegmentMetadataFlag::PRESENT;
|
this->segmentMetadataFlag = cfdp::SegmentMetadataFlag::PRESENT;
|
||||||
this->recContState = recContState;
|
this->recContState = recContState;
|
||||||
if (segmentMetadataLen > 63) {
|
if (segmentMetadataLen > 63) {
|
||||||
return HasReturnvaluesIF::RETURN_FAILED;
|
return returnvalue::FAILED;
|
||||||
}
|
}
|
||||||
this->segmentMetadata = segmentMetadata;
|
this->segmentMetadata = segmentMetadata;
|
||||||
this->segmentMetadataLen = segmentMetadataLen;
|
this->segmentMetadataLen = segmentMetadataLen;
|
||||||
return HasReturnvaluesIF::RETURN_OK;
|
return returnvalue::OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
const uint8_t *FileDataInfo::getFileData(size_t *fileSize) const {
|
const uint8_t *FileDataInfo::getFileData(size_t *fileSize) const {
|
||||||
|
@ -17,7 +17,7 @@ void FileDataSerializer::update() {
|
|||||||
ReturnValue_t FileDataSerializer::serialize(uint8_t** buffer, size_t* size, size_t maxSize,
|
ReturnValue_t FileDataSerializer::serialize(uint8_t** buffer, size_t* size, size_t maxSize,
|
||||||
Endianness streamEndianness) const {
|
Endianness streamEndianness) const {
|
||||||
ReturnValue_t result = HeaderSerializer::serialize(buffer, size, maxSize, streamEndianness);
|
ReturnValue_t result = HeaderSerializer::serialize(buffer, size, maxSize, streamEndianness);
|
||||||
if (result != HasReturnvaluesIF::RETURN_OK) {
|
if (result != returnvalue::OK) {
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
if (*size + this->getSerializedSize() > maxSize) {
|
if (*size + this->getSerializedSize() > maxSize) {
|
||||||
@ -36,7 +36,7 @@ ReturnValue_t FileDataSerializer::serialize(uint8_t** buffer, size_t* size, size
|
|||||||
}
|
}
|
||||||
cfdp::FileSize& offset = info.getOffset();
|
cfdp::FileSize& offset = info.getOffset();
|
||||||
result = offset.serialize(this->getLargeFileFlag(), buffer, size, maxSize, streamEndianness);
|
result = offset.serialize(this->getLargeFileFlag(), buffer, size, maxSize, streamEndianness);
|
||||||
if (result != HasReturnvaluesIF::RETURN_OK) {
|
if (result != returnvalue::OK) {
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
size_t fileSize = 0;
|
size_t fileSize = 0;
|
||||||
@ -47,7 +47,7 @@ ReturnValue_t FileDataSerializer::serialize(uint8_t** buffer, size_t* size, size
|
|||||||
std::memcpy(*buffer, readOnlyPtr, fileSize);
|
std::memcpy(*buffer, readOnlyPtr, fileSize);
|
||||||
*buffer += fileSize;
|
*buffer += fileSize;
|
||||||
*size += fileSize;
|
*size += fileSize;
|
||||||
return HasReturnvaluesIF::RETURN_OK;
|
return returnvalue::OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
size_t FileDataSerializer::getSerializedSize() const {
|
size_t FileDataSerializer::getSerializedSize() const {
|
||||||
|
@ -7,7 +7,7 @@ cfdp::FileDirectives FileDirectiveDeserializer::getFileDirective() const { retur
|
|||||||
|
|
||||||
ReturnValue_t FileDirectiveDeserializer::parseData() {
|
ReturnValue_t FileDirectiveDeserializer::parseData() {
|
||||||
ReturnValue_t result = HeaderDeserializer::parseData();
|
ReturnValue_t result = HeaderDeserializer::parseData();
|
||||||
if (result != HasReturnvaluesIF::RETURN_OK) {
|
if (result != returnvalue::OK) {
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
if (this->getPduDataFieldLen() < 1) {
|
if (this->getPduDataFieldLen() < 1) {
|
||||||
@ -21,7 +21,7 @@ ReturnValue_t FileDirectiveDeserializer::parseData() {
|
|||||||
return cfdp::INVALID_DIRECTIVE_FIELDS;
|
return cfdp::INVALID_DIRECTIVE_FIELDS;
|
||||||
}
|
}
|
||||||
setFileDirective(static_cast<cfdp::FileDirectives>(rawPtr[currentIdx]));
|
setFileDirective(static_cast<cfdp::FileDirectives>(rawPtr[currentIdx]));
|
||||||
return HasReturnvaluesIF::RETURN_OK;
|
return returnvalue::OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
size_t FileDirectiveDeserializer::getHeaderSize() const {
|
size_t FileDirectiveDeserializer::getHeaderSize() const {
|
||||||
|
@ -13,13 +13,13 @@ size_t FileDirectiveSerializer::getSerializedSize() const {
|
|||||||
ReturnValue_t FileDirectiveSerializer::serialize(uint8_t **buffer, size_t *size, size_t maxSize,
|
ReturnValue_t FileDirectiveSerializer::serialize(uint8_t **buffer, size_t *size, size_t maxSize,
|
||||||
Endianness streamEndianness) const {
|
Endianness streamEndianness) const {
|
||||||
if (buffer == nullptr or size == nullptr) {
|
if (buffer == nullptr or size == nullptr) {
|
||||||
return HasReturnvaluesIF::RETURN_FAILED;
|
return returnvalue::FAILED;
|
||||||
}
|
}
|
||||||
if (FileDirectiveSerializer::getWholePduSize() > maxSize) {
|
if (FileDirectiveSerializer::getWholePduSize() > maxSize) {
|
||||||
return BUFFER_TOO_SHORT;
|
return BUFFER_TOO_SHORT;
|
||||||
}
|
}
|
||||||
ReturnValue_t result = HeaderSerializer::serialize(buffer, size, maxSize, streamEndianness);
|
ReturnValue_t result = HeaderSerializer::serialize(buffer, size, maxSize, streamEndianness);
|
||||||
if (result != HasReturnvaluesIF::RETURN_OK) {
|
if (result != returnvalue::OK) {
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -29,7 +29,7 @@ ReturnValue_t FileDirectiveSerializer::serialize(uint8_t **buffer, size_t *size,
|
|||||||
**buffer = directiveCode;
|
**buffer = directiveCode;
|
||||||
*buffer += 1;
|
*buffer += 1;
|
||||||
*size += 1;
|
*size += 1;
|
||||||
return HasReturnvaluesIF::RETURN_OK;
|
return returnvalue::OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
void FileDirectiveSerializer::setDirectiveDataFieldLen(size_t len) {
|
void FileDirectiveSerializer::setDirectiveDataFieldLen(size_t len) {
|
||||||
|
@ -46,14 +46,14 @@ ReturnValue_t FinishedInfo::setFilestoreResponsesArray(FilestoreResponseTlv** fs
|
|||||||
if (maxFsResponsesLen != nullptr) {
|
if (maxFsResponsesLen != nullptr) {
|
||||||
this->fsResponsesMaxLen = *maxFsResponsesLen;
|
this->fsResponsesMaxLen = *maxFsResponsesLen;
|
||||||
}
|
}
|
||||||
return HasReturnvaluesIF::RETURN_OK;
|
return returnvalue::OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
ReturnValue_t FinishedInfo::getFilestoreResonses(FilestoreResponseTlv*** fsResponses,
|
ReturnValue_t FinishedInfo::getFilestoreResonses(FilestoreResponseTlv*** fsResponses,
|
||||||
size_t* fsResponsesLen,
|
size_t* fsResponsesLen,
|
||||||
size_t* fsResponsesMaxLen) {
|
size_t* fsResponsesMaxLen) {
|
||||||
if (fsResponses == nullptr) {
|
if (fsResponses == nullptr) {
|
||||||
return HasReturnvaluesIF::RETURN_FAILED;
|
return returnvalue::FAILED;
|
||||||
}
|
}
|
||||||
*fsResponses = this->fsResponses;
|
*fsResponses = this->fsResponses;
|
||||||
if (fsResponsesLen != nullptr) {
|
if (fsResponsesLen != nullptr) {
|
||||||
@ -62,7 +62,7 @@ ReturnValue_t FinishedInfo::getFilestoreResonses(FilestoreResponseTlv*** fsRespo
|
|||||||
if (fsResponsesMaxLen != nullptr) {
|
if (fsResponsesMaxLen != nullptr) {
|
||||||
*fsResponsesMaxLen = this->fsResponsesMaxLen;
|
*fsResponsesMaxLen = this->fsResponsesMaxLen;
|
||||||
}
|
}
|
||||||
return HasReturnvaluesIF::RETURN_OK;
|
return returnvalue::OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
void FinishedInfo::setFaultLocation(EntityIdTlv* faultLocation) {
|
void FinishedInfo::setFaultLocation(EntityIdTlv* faultLocation) {
|
||||||
@ -71,10 +71,10 @@ void FinishedInfo::setFaultLocation(EntityIdTlv* faultLocation) {
|
|||||||
|
|
||||||
ReturnValue_t FinishedInfo::getFaultLocation(EntityIdTlv** faultLocation) {
|
ReturnValue_t FinishedInfo::getFaultLocation(EntityIdTlv** faultLocation) {
|
||||||
if (this->faultLocation == nullptr) {
|
if (this->faultLocation == nullptr) {
|
||||||
return HasReturnvaluesIF::RETURN_FAILED;
|
return returnvalue::FAILED;
|
||||||
}
|
}
|
||||||
*faultLocation = this->faultLocation;
|
*faultLocation = this->faultLocation;
|
||||||
return HasReturnvaluesIF::RETURN_OK;
|
return returnvalue::OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
cfdp::ConditionCode FinishedInfo::getConditionCode() const { return conditionCode; }
|
cfdp::ConditionCode FinishedInfo::getConditionCode() const { return conditionCode; }
|
||||||
|
@ -6,7 +6,7 @@ FinishPduDeserializer::FinishPduDeserializer(const uint8_t* pduBuf, size_t maxSi
|
|||||||
|
|
||||||
ReturnValue_t FinishPduDeserializer::parseData() {
|
ReturnValue_t FinishPduDeserializer::parseData() {
|
||||||
ReturnValue_t result = FileDirectiveDeserializer::parseData();
|
ReturnValue_t result = FileDirectiveDeserializer::parseData();
|
||||||
if (result != HasReturnvaluesIF::RETURN_OK) {
|
if (result != returnvalue::OK) {
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
size_t currentIdx = FileDirectiveDeserializer::getHeaderSize();
|
size_t currentIdx = FileDirectiveDeserializer::getHeaderSize();
|
||||||
@ -33,7 +33,7 @@ FinishedInfo& FinishPduDeserializer::getInfo() { return finishedInfo; }
|
|||||||
|
|
||||||
ReturnValue_t FinishPduDeserializer::parseTlvs(size_t remLen, size_t currentIdx, const uint8_t* buf,
|
ReturnValue_t FinishPduDeserializer::parseTlvs(size_t remLen, size_t currentIdx, const uint8_t* buf,
|
||||||
cfdp::ConditionCode conditionCode) {
|
cfdp::ConditionCode conditionCode) {
|
||||||
ReturnValue_t result = HasReturnvaluesIF::RETURN_OK;
|
ReturnValue_t result = returnvalue::OK;
|
||||||
size_t fsResponsesIdx = 0;
|
size_t fsResponsesIdx = 0;
|
||||||
auto endianness = getEndianness();
|
auto endianness = getEndianness();
|
||||||
FilestoreResponseTlv** fsResponseArray = nullptr;
|
FilestoreResponseTlv** fsResponseArray = nullptr;
|
||||||
@ -60,7 +60,7 @@ ReturnValue_t FinishPduDeserializer::parseTlvs(size_t remLen, size_t currentIdx,
|
|||||||
return cfdp::FINISHED_CANT_PARSE_FS_RESPONSES;
|
return cfdp::FINISHED_CANT_PARSE_FS_RESPONSES;
|
||||||
}
|
}
|
||||||
result = fsResponseArray[fsResponsesIdx]->deSerialize(&buf, &remLen, endianness);
|
result = fsResponseArray[fsResponsesIdx]->deSerialize(&buf, &remLen, endianness);
|
||||||
if (result != HasReturnvaluesIF::RETURN_OK) {
|
if (result != returnvalue::OK) {
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
fsResponsesIdx += 1;
|
fsResponsesIdx += 1;
|
||||||
@ -72,11 +72,11 @@ ReturnValue_t FinishPduDeserializer::parseTlvs(size_t remLen, size_t currentIdx,
|
|||||||
return cfdp::INVALID_TLV_TYPE;
|
return cfdp::INVALID_TLV_TYPE;
|
||||||
}
|
}
|
||||||
result = finishedInfo.getFaultLocation(&faultLocation);
|
result = finishedInfo.getFaultLocation(&faultLocation);
|
||||||
if (result != HasReturnvaluesIF::RETURN_OK) {
|
if (result != returnvalue::OK) {
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
result = faultLocation->deSerialize(&buf, &remLen, endianness);
|
result = faultLocation->deSerialize(&buf, &remLen, endianness);
|
||||||
if (result != HasReturnvaluesIF::RETURN_OK) {
|
if (result != returnvalue::OK) {
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
@ -17,7 +17,7 @@ ReturnValue_t FinishPduSerializer::serialize(uint8_t **buffer, size_t *size, siz
|
|||||||
Endianness streamEndianness) const {
|
Endianness streamEndianness) const {
|
||||||
ReturnValue_t result =
|
ReturnValue_t result =
|
||||||
FileDirectiveSerializer::serialize(buffer, size, maxSize, streamEndianness);
|
FileDirectiveSerializer::serialize(buffer, size, maxSize, streamEndianness);
|
||||||
if (result != HasReturnvaluesIF::RETURN_OK) {
|
if (result != returnvalue::OK) {
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
if (*size + 1 >= maxSize) {
|
if (*size + 1 >= maxSize) {
|
||||||
@ -34,13 +34,13 @@ ReturnValue_t FinishPduSerializer::serialize(uint8_t **buffer, size_t *size, siz
|
|||||||
finishInfo.getFilestoreResonses(&fsResponsesArray, &fsResponsesArrayLen, nullptr);
|
finishInfo.getFilestoreResonses(&fsResponsesArray, &fsResponsesArrayLen, nullptr);
|
||||||
for (size_t idx = 0; idx < fsResponsesArrayLen; idx++) {
|
for (size_t idx = 0; idx < fsResponsesArrayLen; idx++) {
|
||||||
result = fsResponsesArray[idx]->serialize(buffer, size, maxSize, streamEndianness);
|
result = fsResponsesArray[idx]->serialize(buffer, size, maxSize, streamEndianness);
|
||||||
if (result != HasReturnvaluesIF::RETURN_OK) {
|
if (result != returnvalue::OK) {
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
EntityIdTlv *entityId = nullptr;
|
EntityIdTlv *entityId = nullptr;
|
||||||
if (finishInfo.getFaultLocation(&entityId) == HasReturnvaluesIF::RETURN_OK) {
|
if (finishInfo.getFaultLocation(&entityId) == returnvalue::OK) {
|
||||||
result = entityId->serialize(buffer, size, maxSize, streamEndianness);
|
result = entityId->serialize(buffer, size, maxSize, streamEndianness);
|
||||||
}
|
}
|
||||||
return result;
|
return result;
|
||||||
|
@ -18,7 +18,7 @@ ReturnValue_t HeaderDeserializer::setData(uint8_t *dataPtr, size_t maxSize, void
|
|||||||
if (dataPtr == nullptr) {
|
if (dataPtr == nullptr) {
|
||||||
// Allowed for now
|
// Allowed for now
|
||||||
this->fixedHeader = nullptr;
|
this->fixedHeader = nullptr;
|
||||||
return HasReturnvaluesIF::RETURN_OK;
|
return returnvalue::OK;
|
||||||
}
|
}
|
||||||
this->fixedHeader = reinterpret_cast<PduHeaderFixedStruct *>(const_cast<uint8_t *>(dataPtr));
|
this->fixedHeader = reinterpret_cast<PduHeaderFixedStruct *>(const_cast<uint8_t *>(dataPtr));
|
||||||
sourceIdRaw = static_cast<uint8_t *>(&fixedHeader->variableFieldsStart);
|
sourceIdRaw = static_cast<uint8_t *>(&fixedHeader->variableFieldsStart);
|
||||||
@ -27,7 +27,7 @@ ReturnValue_t HeaderDeserializer::setData(uint8_t *dataPtr, size_t maxSize, void
|
|||||||
seqNumRaw = static_cast<uint8_t *>(sourceIdRaw) + static_cast<uint8_t>(widthEntityIds);
|
seqNumRaw = static_cast<uint8_t *>(sourceIdRaw) + static_cast<uint8_t>(widthEntityIds);
|
||||||
destIdRaw = static_cast<uint8_t *>(seqNumRaw) + static_cast<uint8_t>(widthSeqNum);
|
destIdRaw = static_cast<uint8_t *>(seqNumRaw) + static_cast<uint8_t>(widthSeqNum);
|
||||||
this->maxSize = maxSize;
|
this->maxSize = maxSize;
|
||||||
return HasReturnvaluesIF::RETURN_OK;
|
return returnvalue::OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
size_t HeaderDeserializer::getHeaderSize() const {
|
size_t HeaderDeserializer::getHeaderSize() const {
|
||||||
|
@ -36,8 +36,8 @@ class HeaderDeserializer : public RedirectableDataPointerIF, public PduHeaderIF
|
|||||||
/**
|
/**
|
||||||
* This needs to be called before accessing the PDU fields to avoid segmentation faults.
|
* This needs to be called before accessing the PDU fields to avoid segmentation faults.
|
||||||
* @return
|
* @return
|
||||||
* - RETURN_OK on parse success
|
* - returnvalue::OK on parse success
|
||||||
* - RETURN_FAILED Invalid raw data
|
* - returnvalue::FAILED Invalid raw data
|
||||||
* - SerializeIF::BUFFER_TOO_SHORT if buffer is shorter than expected
|
* - SerializeIF::BUFFER_TOO_SHORT if buffer is shorter than expected
|
||||||
*/
|
*/
|
||||||
virtual ReturnValue_t parseData();
|
virtual ReturnValue_t parseData();
|
||||||
@ -61,7 +61,7 @@ class HeaderDeserializer : public RedirectableDataPointerIF, public PduHeaderIF
|
|||||||
void getDestId(cfdp::EntityId& destId) const override;
|
void getDestId(cfdp::EntityId& destId) const override;
|
||||||
void getTransactionSeqNum(cfdp::TransactionSeqNum& seqNum) const override;
|
void getTransactionSeqNum(cfdp::TransactionSeqNum& seqNum) const override;
|
||||||
|
|
||||||
ReturnValue_t deserResult = HasReturnvaluesIF::RETURN_OK;
|
ReturnValue_t deserResult = returnvalue::OK;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Can also be used to reset the pointer to a nullptr, but the getter functions will not
|
* Can also be used to reset the pointer to a nullptr, but the getter functions will not
|
||||||
|
@ -15,7 +15,7 @@ HeaderSerializer::HeaderSerializer(PduConfig &pduConf, cfdp::PduType pduType,
|
|||||||
ReturnValue_t HeaderSerializer::serialize(uint8_t **buffer, size_t *size, size_t maxSize,
|
ReturnValue_t HeaderSerializer::serialize(uint8_t **buffer, size_t *size, size_t maxSize,
|
||||||
Endianness streamEndianness) const {
|
Endianness streamEndianness) const {
|
||||||
if (buffer == nullptr or size == nullptr) {
|
if (buffer == nullptr or size == nullptr) {
|
||||||
return HasReturnvaluesIF::RETURN_FAILED;
|
return returnvalue::FAILED;
|
||||||
}
|
}
|
||||||
if (maxSize < this->getSerializedSize()) {
|
if (maxSize < this->getSerializedSize()) {
|
||||||
return BUFFER_TOO_SHORT;
|
return BUFFER_TOO_SHORT;
|
||||||
@ -32,19 +32,19 @@ ReturnValue_t HeaderSerializer::serialize(uint8_t **buffer, size_t *size, size_t
|
|||||||
*buffer += 1;
|
*buffer += 1;
|
||||||
*size += 4;
|
*size += 4;
|
||||||
ReturnValue_t result = pduConf.sourceId.serialize(buffer, size, maxSize, streamEndianness);
|
ReturnValue_t result = pduConf.sourceId.serialize(buffer, size, maxSize, streamEndianness);
|
||||||
if (result != HasReturnvaluesIF::RETURN_OK) {
|
if (result != returnvalue::OK) {
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
result = pduConf.seqNum.serialize(buffer, size, maxSize, streamEndianness);
|
result = pduConf.seqNum.serialize(buffer, size, maxSize, streamEndianness);
|
||||||
if (result != HasReturnvaluesIF::RETURN_OK) {
|
if (result != returnvalue::OK) {
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
result = pduConf.destId.serialize(buffer, size, maxSize, streamEndianness);
|
result = pduConf.destId.serialize(buffer, size, maxSize, streamEndianness);
|
||||||
if (result != HasReturnvaluesIF::RETURN_OK) {
|
if (result != returnvalue::OK) {
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
return HasReturnvaluesIF::RETURN_OK;
|
return returnvalue::OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
size_t HeaderSerializer::getSerializedSize() const {
|
size_t HeaderSerializer::getSerializedSize() const {
|
||||||
@ -55,7 +55,7 @@ size_t HeaderSerializer::getSerializedSize() const {
|
|||||||
ReturnValue_t HeaderSerializer::deSerialize(const uint8_t **buffer, size_t *size,
|
ReturnValue_t HeaderSerializer::deSerialize(const uint8_t **buffer, size_t *size,
|
||||||
Endianness streamEndianness) {
|
Endianness streamEndianness) {
|
||||||
// We could implement this, but I prefer dedicated classes
|
// We could implement this, but I prefer dedicated classes
|
||||||
return HasReturnvaluesIF::RETURN_FAILED;
|
return returnvalue::FAILED;
|
||||||
}
|
}
|
||||||
|
|
||||||
size_t HeaderSerializer::getWholePduSize() const {
|
size_t HeaderSerializer::getWholePduSize() const {
|
||||||
|
@ -6,7 +6,7 @@ KeepAlivePduDeserializer::KeepAlivePduDeserializer(const uint8_t* pduBuf, size_t
|
|||||||
|
|
||||||
ReturnValue_t KeepAlivePduDeserializer::parseData() {
|
ReturnValue_t KeepAlivePduDeserializer::parseData() {
|
||||||
ReturnValue_t result = FileDirectiveDeserializer::parseData();
|
ReturnValue_t result = FileDirectiveDeserializer::parseData();
|
||||||
if (result != HasReturnvaluesIF::RETURN_OK) {
|
if (result != returnvalue::OK) {
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
size_t currentIdx = FileDirectiveDeserializer::getHeaderSize();
|
size_t currentIdx = FileDirectiveDeserializer::getHeaderSize();
|
||||||
|
@ -19,7 +19,7 @@ ReturnValue_t KeepAlivePduSerializer::serialize(uint8_t **buffer, size_t *size,
|
|||||||
Endianness streamEndianness) const {
|
Endianness streamEndianness) const {
|
||||||
ReturnValue_t result =
|
ReturnValue_t result =
|
||||||
FileDirectiveSerializer::serialize(buffer, size, maxSize, streamEndianness);
|
FileDirectiveSerializer::serialize(buffer, size, maxSize, streamEndianness);
|
||||||
if (result != HasReturnvaluesIF::RETURN_OK) {
|
if (result != returnvalue::OK) {
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
return progress.serialize(this->getLargeFileFlag(), buffer, size, maxSize, streamEndianness);
|
return progress.serialize(this->getLargeFileFlag(), buffer, size, maxSize, streamEndianness);
|
||||||
|
@ -39,7 +39,7 @@ cfdp::FileSize& MetadataInfo::getFileSize() { return fileSize; }
|
|||||||
ReturnValue_t MetadataInfo::getOptions(cfdp::Tlv*** optionsArray, size_t* optionsLen,
|
ReturnValue_t MetadataInfo::getOptions(cfdp::Tlv*** optionsArray, size_t* optionsLen,
|
||||||
size_t* maxOptsLen) {
|
size_t* maxOptsLen) {
|
||||||
if (optionsArray == nullptr or this->optionsArray == nullptr) {
|
if (optionsArray == nullptr or this->optionsArray == nullptr) {
|
||||||
return HasReturnvaluesIF::RETURN_FAILED;
|
return returnvalue::FAILED;
|
||||||
}
|
}
|
||||||
*optionsArray = this->optionsArray;
|
*optionsArray = this->optionsArray;
|
||||||
if (optionsLen != nullptr) {
|
if (optionsLen != nullptr) {
|
||||||
@ -48,7 +48,7 @@ ReturnValue_t MetadataInfo::getOptions(cfdp::Tlv*** optionsArray, size_t* option
|
|||||||
if (maxOptsLen != nullptr) {
|
if (maxOptsLen != nullptr) {
|
||||||
*maxOptsLen = this->maxOptionsLen;
|
*maxOptsLen = this->maxOptionsLen;
|
||||||
}
|
}
|
||||||
return HasReturnvaluesIF::RETURN_OK;
|
return returnvalue::OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool MetadataInfo::hasOptions() const {
|
bool MetadataInfo::hasOptions() const {
|
||||||
|
@ -6,7 +6,7 @@ MetadataPduDeserializer::MetadataPduDeserializer(const uint8_t* pduBuf, size_t m
|
|||||||
|
|
||||||
ReturnValue_t MetadataPduDeserializer::parseData() {
|
ReturnValue_t MetadataPduDeserializer::parseData() {
|
||||||
ReturnValue_t result = FileDirectiveDeserializer::parseData();
|
ReturnValue_t result = FileDirectiveDeserializer::parseData();
|
||||||
if (result != HasReturnvaluesIF::RETURN_OK) {
|
if (result != returnvalue::OK) {
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
size_t currentIdx = FileDirectiveDeserializer::getHeaderSize();
|
size_t currentIdx = FileDirectiveDeserializer::getHeaderSize();
|
||||||
@ -21,15 +21,15 @@ ReturnValue_t MetadataPduDeserializer::parseData() {
|
|||||||
buf += 1;
|
buf += 1;
|
||||||
auto endianness = getEndianness();
|
auto endianness = getEndianness();
|
||||||
result = info.getFileSize().deSerialize(&buf, &remSize, endianness);
|
result = info.getFileSize().deSerialize(&buf, &remSize, endianness);
|
||||||
if (result != HasReturnvaluesIF::RETURN_OK) {
|
if (result != returnvalue::OK) {
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
result = info.getSourceFileName().deSerialize(&buf, &remSize, endianness);
|
result = info.getSourceFileName().deSerialize(&buf, &remSize, endianness);
|
||||||
if (result != HasReturnvaluesIF::RETURN_OK) {
|
if (result != returnvalue::OK) {
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
result = info.getDestFileName().deSerialize(&buf, &remSize, endianness);
|
result = info.getDestFileName().deSerialize(&buf, &remSize, endianness);
|
||||||
if (result != HasReturnvaluesIF::RETURN_OK) {
|
if (result != returnvalue::OK) {
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -47,7 +47,7 @@ ReturnValue_t MetadataPduDeserializer::parseData() {
|
|||||||
return cfdp::METADATA_CANT_PARSE_OPTIONS;
|
return cfdp::METADATA_CANT_PARSE_OPTIONS;
|
||||||
}
|
}
|
||||||
result = optionsArray[optsIdx]->deSerialize(&buf, &remSize, endianness);
|
result = optionsArray[optsIdx]->deSerialize(&buf, &remSize, endianness);
|
||||||
if (result != HasReturnvaluesIF::RETURN_OK) {
|
if (result != returnvalue::OK) {
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
optsIdx++;
|
optsIdx++;
|
||||||
|
@ -17,7 +17,7 @@ ReturnValue_t MetadataPduSerializer::serialize(uint8_t **buffer, size_t *size, s
|
|||||||
Endianness streamEndianness) const {
|
Endianness streamEndianness) const {
|
||||||
ReturnValue_t result =
|
ReturnValue_t result =
|
||||||
FileDirectiveSerializer::serialize(buffer, size, maxSize, streamEndianness);
|
FileDirectiveSerializer::serialize(buffer, size, maxSize, streamEndianness);
|
||||||
if (result != HasReturnvaluesIF::RETURN_OK) {
|
if (result != returnvalue::OK) {
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
if (*size + 1 >= maxSize) {
|
if (*size + 1 >= maxSize) {
|
||||||
@ -27,15 +27,15 @@ ReturnValue_t MetadataPduSerializer::serialize(uint8_t **buffer, size_t *size, s
|
|||||||
*buffer += 1;
|
*buffer += 1;
|
||||||
*size += 1;
|
*size += 1;
|
||||||
result = info.getFileSize().serialize(buffer, size, maxSize, streamEndianness);
|
result = info.getFileSize().serialize(buffer, size, maxSize, streamEndianness);
|
||||||
if (result != HasReturnvaluesIF::RETURN_OK) {
|
if (result != returnvalue::OK) {
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
result = info.getSourceFileName().serialize(buffer, size, maxSize, streamEndianness);
|
result = info.getSourceFileName().serialize(buffer, size, maxSize, streamEndianness);
|
||||||
if (result != HasReturnvaluesIF::RETURN_OK) {
|
if (result != returnvalue::OK) {
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
result = info.getDestFileName().serialize(buffer, size, maxSize, streamEndianness);
|
result = info.getDestFileName().serialize(buffer, size, maxSize, streamEndianness);
|
||||||
if (result != HasReturnvaluesIF::RETURN_OK) {
|
if (result != returnvalue::OK) {
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -45,7 +45,7 @@ ReturnValue_t MetadataPduSerializer::serialize(uint8_t **buffer, size_t *size, s
|
|||||||
info.getOptions(&optsArray, &optsLen, nullptr);
|
info.getOptions(&optsArray, &optsLen, nullptr);
|
||||||
for (size_t idx = 0; idx < optsLen; idx++) {
|
for (size_t idx = 0; idx < optsLen; idx++) {
|
||||||
result = optsArray[idx]->serialize(buffer, size, maxSize, streamEndianness);
|
result = optsArray[idx]->serialize(buffer, size, maxSize, streamEndianness);
|
||||||
if (result != HasReturnvaluesIF::RETURN_OK) {
|
if (result != returnvalue::OK) {
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -5,7 +5,7 @@ NakPduDeserializer::NakPduDeserializer(const uint8_t* pduBuf, size_t maxSize, Na
|
|||||||
|
|
||||||
ReturnValue_t NakPduDeserializer::parseData() {
|
ReturnValue_t NakPduDeserializer::parseData() {
|
||||||
ReturnValue_t result = FileDirectiveDeserializer::parseData();
|
ReturnValue_t result = FileDirectiveDeserializer::parseData();
|
||||||
if (result != HasReturnvaluesIF::RETURN_OK) {
|
if (result != returnvalue::OK) {
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
size_t currentIdx = FileDirectiveDeserializer::getHeaderSize();
|
size_t currentIdx = FileDirectiveDeserializer::getHeaderSize();
|
||||||
@ -16,11 +16,11 @@ ReturnValue_t NakPduDeserializer::parseData() {
|
|||||||
}
|
}
|
||||||
result =
|
result =
|
||||||
nakInfo.getStartOfScope().deSerialize(&buffer, &remSize, SerializeIF::Endianness::NETWORK);
|
nakInfo.getStartOfScope().deSerialize(&buffer, &remSize, SerializeIF::Endianness::NETWORK);
|
||||||
if (result != HasReturnvaluesIF::RETURN_OK) {
|
if (result != returnvalue::OK) {
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
result = nakInfo.getEndOfScope().deSerialize(&buffer, &remSize, SerializeIF::Endianness::NETWORK);
|
result = nakInfo.getEndOfScope().deSerialize(&buffer, &remSize, SerializeIF::Endianness::NETWORK);
|
||||||
if (result != HasReturnvaluesIF::RETURN_OK) {
|
if (result != returnvalue::OK) {
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
nakInfo.setSegmentRequestLen(0);
|
nakInfo.setSegmentRequestLen(0);
|
||||||
@ -39,12 +39,12 @@ ReturnValue_t NakPduDeserializer::parseData() {
|
|||||||
}
|
}
|
||||||
result =
|
result =
|
||||||
segReqs[idx].first.deSerialize(&buffer, &remSize, SerializeIF::Endianness::NETWORK);
|
segReqs[idx].first.deSerialize(&buffer, &remSize, SerializeIF::Endianness::NETWORK);
|
||||||
if (result != HasReturnvaluesIF::RETURN_OK) {
|
if (result != returnvalue::OK) {
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
result =
|
result =
|
||||||
segReqs[idx].second.deSerialize(&buffer, &remSize, SerializeIF::Endianness::NETWORK);
|
segReqs[idx].second.deSerialize(&buffer, &remSize, SerializeIF::Endianness::NETWORK);
|
||||||
if (result != HasReturnvaluesIF::RETURN_OK) {
|
if (result != returnvalue::OK) {
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
idx++;
|
idx++;
|
||||||
|
@ -17,15 +17,15 @@ ReturnValue_t NakPduSerializer::serialize(uint8_t **buffer, size_t *size, size_t
|
|||||||
Endianness streamEndianness) const {
|
Endianness streamEndianness) const {
|
||||||
ReturnValue_t result =
|
ReturnValue_t result =
|
||||||
FileDirectiveSerializer::serialize(buffer, size, maxSize, streamEndianness);
|
FileDirectiveSerializer::serialize(buffer, size, maxSize, streamEndianness);
|
||||||
if (result != HasReturnvaluesIF::RETURN_OK) {
|
if (result != returnvalue::OK) {
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
result = nakInfo.getStartOfScope().serialize(buffer, size, maxSize, streamEndianness);
|
result = nakInfo.getStartOfScope().serialize(buffer, size, maxSize, streamEndianness);
|
||||||
if (result != HasReturnvaluesIF::RETURN_OK) {
|
if (result != returnvalue::OK) {
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
result = nakInfo.getEndOfScope().serialize(buffer, size, maxSize, streamEndianness);
|
result = nakInfo.getEndOfScope().serialize(buffer, size, maxSize, streamEndianness);
|
||||||
if (result != HasReturnvaluesIF::RETURN_OK) {
|
if (result != returnvalue::OK) {
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
if (nakInfo.hasSegmentRequests()) {
|
if (nakInfo.hasSegmentRequests()) {
|
||||||
@ -34,11 +34,11 @@ ReturnValue_t NakPduSerializer::serialize(uint8_t **buffer, size_t *size, size_t
|
|||||||
nakInfo.getSegmentRequests(&segmentRequests, &segmentRequestLen, nullptr);
|
nakInfo.getSegmentRequests(&segmentRequests, &segmentRequestLen, nullptr);
|
||||||
for (size_t idx = 0; idx < segmentRequestLen; idx++) {
|
for (size_t idx = 0; idx < segmentRequestLen; idx++) {
|
||||||
result = segmentRequests[idx].first.serialize(buffer, size, maxSize, streamEndianness);
|
result = segmentRequests[idx].first.serialize(buffer, size, maxSize, streamEndianness);
|
||||||
if (result != HasReturnvaluesIF::RETURN_OK) {
|
if (result != returnvalue::OK) {
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
result = segmentRequests[idx].second.serialize(buffer, size, maxSize, streamEndianness);
|
result = segmentRequests[idx].second.serialize(buffer, size, maxSize, streamEndianness);
|
||||||
if (result != HasReturnvaluesIF::RETURN_OK) {
|
if (result != returnvalue::OK) {
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -9,7 +9,7 @@ cfdp::PromptResponseRequired PromptPduDeserializer::getPromptResponseRequired()
|
|||||||
|
|
||||||
ReturnValue_t PromptPduDeserializer::parseData() {
|
ReturnValue_t PromptPduDeserializer::parseData() {
|
||||||
ReturnValue_t result = FileDirectiveDeserializer::parseData();
|
ReturnValue_t result = FileDirectiveDeserializer::parseData();
|
||||||
if (result != HasReturnvaluesIF::RETURN_OK) {
|
if (result != returnvalue::OK) {
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
size_t currentIdx = FileDirectiveDeserializer::getHeaderSize();
|
size_t currentIdx = FileDirectiveDeserializer::getHeaderSize();
|
||||||
@ -17,5 +17,5 @@ ReturnValue_t PromptPduDeserializer::parseData() {
|
|||||||
return SerializeIF::STREAM_TOO_SHORT;
|
return SerializeIF::STREAM_TOO_SHORT;
|
||||||
}
|
}
|
||||||
responseRequired = static_cast<cfdp::PromptResponseRequired>((rawPtr[currentIdx] >> 7) & 0x01);
|
responseRequired = static_cast<cfdp::PromptResponseRequired>((rawPtr[currentIdx] >> 7) & 0x01);
|
||||||
return HasReturnvaluesIF::RETURN_OK;
|
return returnvalue::OK;
|
||||||
}
|
}
|
||||||
|
@ -13,7 +13,7 @@ ReturnValue_t PromptPduSerializer::serialize(uint8_t **buffer, size_t *size, siz
|
|||||||
Endianness streamEndianness) const {
|
Endianness streamEndianness) const {
|
||||||
ReturnValue_t result =
|
ReturnValue_t result =
|
||||||
FileDirectiveSerializer::serialize(buffer, size, maxSize, streamEndianness);
|
FileDirectiveSerializer::serialize(buffer, size, maxSize, streamEndianness);
|
||||||
if (result != HasReturnvaluesIF::RETURN_OK) {
|
if (result != returnvalue::OK) {
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
if (*size + 1 > maxSize) {
|
if (*size + 1 > maxSize) {
|
||||||
|
@ -6,7 +6,7 @@
|
|||||||
|
|
||||||
cfdp::VarLenField::VarLenField(cfdp::WidthInBytes width, size_t value) : VarLenField() {
|
cfdp::VarLenField::VarLenField(cfdp::WidthInBytes width, size_t value) : VarLenField() {
|
||||||
ReturnValue_t result = this->setValue(width, value);
|
ReturnValue_t result = this->setValue(width, value);
|
||||||
if (result != HasReturnvaluesIF::RETURN_OK) {
|
if (result != returnvalue::OK) {
|
||||||
#if FSFW_DISABLE_PRINTOUT == 0
|
#if FSFW_DISABLE_PRINTOUT == 0
|
||||||
#if FSFW_CPP_OSTREAM_ENABLED == 1
|
#if FSFW_CPP_OSTREAM_ENABLED == 1
|
||||||
sif::warning << "cfdp::VarLenField: Setting value failed" << std::endl;
|
sif::warning << "cfdp::VarLenField: Setting value failed" << std::endl;
|
||||||
@ -25,21 +25,21 @@ ReturnValue_t cfdp::VarLenField::setValue(cfdp::WidthInBytes widthInBytes, size_
|
|||||||
switch (widthInBytes) {
|
switch (widthInBytes) {
|
||||||
case (cfdp::WidthInBytes::ONE_BYTE): {
|
case (cfdp::WidthInBytes::ONE_BYTE): {
|
||||||
if (value > UINT8_MAX) {
|
if (value > UINT8_MAX) {
|
||||||
return HasReturnvaluesIF::RETURN_FAILED;
|
return returnvalue::FAILED;
|
||||||
}
|
}
|
||||||
this->value.oneByte = value;
|
this->value.oneByte = value;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case (cfdp::WidthInBytes::TWO_BYTES): {
|
case (cfdp::WidthInBytes::TWO_BYTES): {
|
||||||
if (value > UINT16_MAX) {
|
if (value > UINT16_MAX) {
|
||||||
return HasReturnvaluesIF::RETURN_FAILED;
|
return returnvalue::FAILED;
|
||||||
}
|
}
|
||||||
this->value.twoBytes = value;
|
this->value.twoBytes = value;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case (cfdp::WidthInBytes::FOUR_BYTES): {
|
case (cfdp::WidthInBytes::FOUR_BYTES): {
|
||||||
if (value > UINT32_MAX) {
|
if (value > UINT32_MAX) {
|
||||||
return HasReturnvaluesIF::RETURN_FAILED;
|
return returnvalue::FAILED;
|
||||||
}
|
}
|
||||||
this->value.fourBytes = value;
|
this->value.fourBytes = value;
|
||||||
break;
|
break;
|
||||||
@ -49,7 +49,7 @@ ReturnValue_t cfdp::VarLenField::setValue(cfdp::WidthInBytes widthInBytes, size_
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
this->width = widthInBytes;
|
this->width = widthInBytes;
|
||||||
return HasReturnvaluesIF::RETURN_OK;
|
return returnvalue::OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
size_t cfdp::VarLenField::getValue() const {
|
size_t cfdp::VarLenField::getValue() const {
|
||||||
@ -77,7 +77,7 @@ ReturnValue_t cfdp::VarLenField::serialize(uint8_t **buffer, size_t *size, size_
|
|||||||
**buffer = value.oneByte;
|
**buffer = value.oneByte;
|
||||||
*size += 1;
|
*size += 1;
|
||||||
*buffer += 1;
|
*buffer += 1;
|
||||||
return HasReturnvaluesIF::RETURN_OK;
|
return returnvalue::OK;
|
||||||
}
|
}
|
||||||
case (cfdp::WidthInBytes::TWO_BYTES): {
|
case (cfdp::WidthInBytes::TWO_BYTES): {
|
||||||
return SerializeAdapter::serialize(&value.twoBytes, buffer, size, maxSize, streamEndianness);
|
return SerializeAdapter::serialize(&value.twoBytes, buffer, size, maxSize, streamEndianness);
|
||||||
@ -86,7 +86,7 @@ ReturnValue_t cfdp::VarLenField::serialize(uint8_t **buffer, size_t *size, size_
|
|||||||
return SerializeAdapter::serialize(&value.fourBytes, buffer, size, maxSize, streamEndianness);
|
return SerializeAdapter::serialize(&value.fourBytes, buffer, size, maxSize, streamEndianness);
|
||||||
}
|
}
|
||||||
default: {
|
default: {
|
||||||
return HasReturnvaluesIF::RETURN_FAILED;
|
return returnvalue::FAILED;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -105,7 +105,7 @@ ReturnValue_t cfdp::VarLenField::deSerialize(const uint8_t **buffer, size_t *siz
|
|||||||
case (cfdp::WidthInBytes::ONE_BYTE): {
|
case (cfdp::WidthInBytes::ONE_BYTE): {
|
||||||
value.oneByte = **buffer;
|
value.oneByte = **buffer;
|
||||||
*size += 1;
|
*size += 1;
|
||||||
return HasReturnvaluesIF::RETURN_OK;
|
return returnvalue::OK;
|
||||||
}
|
}
|
||||||
case (cfdp::WidthInBytes::TWO_BYTES): {
|
case (cfdp::WidthInBytes::TWO_BYTES): {
|
||||||
return SerializeAdapter::deSerialize(&value.twoBytes, buffer, size, streamEndianness);
|
return SerializeAdapter::deSerialize(&value.twoBytes, buffer, size, streamEndianness);
|
||||||
@ -114,7 +114,7 @@ ReturnValue_t cfdp::VarLenField::deSerialize(const uint8_t **buffer, size_t *siz
|
|||||||
return SerializeAdapter::deSerialize(&value.fourBytes, buffer, size, streamEndianness);
|
return SerializeAdapter::deSerialize(&value.fourBytes, buffer, size, streamEndianness);
|
||||||
}
|
}
|
||||||
default: {
|
default: {
|
||||||
return HasReturnvaluesIF::RETURN_FAILED;
|
return returnvalue::FAILED;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -22,7 +22,7 @@ ReturnValue_t FaultHandlerOverrideTlv::serialize(uint8_t **buffer, size_t *size,
|
|||||||
**buffer = this->conditionCode << 4 | this->handlerCode;
|
**buffer = this->conditionCode << 4 | this->handlerCode;
|
||||||
*buffer += 1;
|
*buffer += 1;
|
||||||
*size += 1;
|
*size += 1;
|
||||||
return HasReturnvaluesIF::RETURN_OK;
|
return returnvalue::OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
size_t FaultHandlerOverrideTlv::getSerializedSize() const { return getLengthField() + 2; }
|
size_t FaultHandlerOverrideTlv::getSerializedSize() const { return getLengthField() + 2; }
|
||||||
@ -40,7 +40,7 @@ ReturnValue_t FaultHandlerOverrideTlv::deSerialize(const uint8_t **buffer, size_
|
|||||||
*size -= 1;
|
*size -= 1;
|
||||||
size_t detectedSize = **buffer;
|
size_t detectedSize = **buffer;
|
||||||
if (detectedSize != getLengthField()) {
|
if (detectedSize != getLengthField()) {
|
||||||
return HasReturnvaluesIF::RETURN_FAILED;
|
return returnvalue::FAILED;
|
||||||
}
|
}
|
||||||
*buffer += 1;
|
*buffer += 1;
|
||||||
*size += 1;
|
*size += 1;
|
||||||
@ -48,7 +48,7 @@ ReturnValue_t FaultHandlerOverrideTlv::deSerialize(const uint8_t **buffer, size_
|
|||||||
this->handlerCode = static_cast<cfdp::FaultHandlerCode>(**buffer & 0x0f);
|
this->handlerCode = static_cast<cfdp::FaultHandlerCode>(**buffer & 0x0f);
|
||||||
*buffer += 1;
|
*buffer += 1;
|
||||||
*size += 1;
|
*size += 1;
|
||||||
return HasReturnvaluesIF::RETURN_OK;
|
return returnvalue::OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
cfdp::TlvTypes FaultHandlerOverrideTlv::getType() const { return cfdp::TlvTypes::FAULT_HANDLER; }
|
cfdp::TlvTypes FaultHandlerOverrideTlv::getType() const { return cfdp::TlvTypes::FAULT_HANDLER; }
|
||||||
|
@ -16,11 +16,11 @@ void FilestoreRequestTlv::setSecondFileName(cfdp::Lv *secondFileName) {
|
|||||||
ReturnValue_t FilestoreRequestTlv::serialize(uint8_t **buffer, size_t *size, size_t maxSize,
|
ReturnValue_t FilestoreRequestTlv::serialize(uint8_t **buffer, size_t *size, size_t maxSize,
|
||||||
Endianness streamEndianness) const {
|
Endianness streamEndianness) const {
|
||||||
ReturnValue_t result = commonSerialize(buffer, size, maxSize, streamEndianness);
|
ReturnValue_t result = commonSerialize(buffer, size, maxSize, streamEndianness);
|
||||||
if (result != HasReturnvaluesIF::RETURN_OK) {
|
if (result != returnvalue::OK) {
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
result = firstFileName.serialize(buffer, size, maxSize, streamEndianness);
|
result = firstFileName.serialize(buffer, size, maxSize, streamEndianness);
|
||||||
if (result != HasReturnvaluesIF::RETURN_OK) {
|
if (result != returnvalue::OK) {
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
if (requiresSecondFileName()) {
|
if (requiresSecondFileName()) {
|
||||||
@ -30,13 +30,13 @@ ReturnValue_t FilestoreRequestTlv::serialize(uint8_t **buffer, size_t *size, siz
|
|||||||
}
|
}
|
||||||
secondFileName->serialize(buffer, size, maxSize, streamEndianness);
|
secondFileName->serialize(buffer, size, maxSize, streamEndianness);
|
||||||
}
|
}
|
||||||
return HasReturnvaluesIF::RETURN_OK;
|
return returnvalue::OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
ReturnValue_t FilestoreRequestTlv::deSerialize(const uint8_t **buffer, size_t *size,
|
ReturnValue_t FilestoreRequestTlv::deSerialize(const uint8_t **buffer, size_t *size,
|
||||||
Endianness streamEndianness) {
|
Endianness streamEndianness) {
|
||||||
ReturnValue_t result = commonDeserialize(buffer, size, streamEndianness);
|
ReturnValue_t result = commonDeserialize(buffer, size, streamEndianness);
|
||||||
if (result != HasReturnvaluesIF::RETURN_OK) {
|
if (result != returnvalue::OK) {
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
return deSerializeFromValue(buffer, size, streamEndianness);
|
return deSerializeFromValue(buffer, size, streamEndianness);
|
||||||
@ -63,13 +63,13 @@ ReturnValue_t FilestoreRequestTlv::deSerializeFromValue(const uint8_t **buffer,
|
|||||||
*buffer += 1;
|
*buffer += 1;
|
||||||
*size -= 1;
|
*size -= 1;
|
||||||
ReturnValue_t result = firstFileName.deSerialize(buffer, size, streamEndianness);
|
ReturnValue_t result = firstFileName.deSerialize(buffer, size, streamEndianness);
|
||||||
if (result != HasReturnvaluesIF::RETURN_OK) {
|
if (result != returnvalue::OK) {
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
if (requiresSecondFileName()) {
|
if (requiresSecondFileName()) {
|
||||||
if (secondFileName == nullptr) {
|
if (secondFileName == nullptr) {
|
||||||
secondFileNameMissing();
|
secondFileNameMissing();
|
||||||
return HasReturnvaluesIF::RETURN_FAILED;
|
return returnvalue::FAILED;
|
||||||
}
|
}
|
||||||
result = secondFileName->deSerialize(buffer, size, streamEndianness);
|
result = secondFileName->deSerialize(buffer, size, streamEndianness);
|
||||||
}
|
}
|
||||||
|
@ -32,11 +32,11 @@ ReturnValue_t FilestoreResponseTlv::serialize(uint8_t **buffer, size_t *size, si
|
|||||||
Endianness streamEndianness) const {
|
Endianness streamEndianness) const {
|
||||||
ReturnValue_t result =
|
ReturnValue_t result =
|
||||||
commonSerialize(buffer, size, maxSize, streamEndianness, true, this->statusCode);
|
commonSerialize(buffer, size, maxSize, streamEndianness, true, this->statusCode);
|
||||||
if (result != HasReturnvaluesIF::RETURN_OK) {
|
if (result != returnvalue::OK) {
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
result = firstFileName.serialize(buffer, size, maxSize, streamEndianness);
|
result = firstFileName.serialize(buffer, size, maxSize, streamEndianness);
|
||||||
if (result != HasReturnvaluesIF::RETURN_OK) {
|
if (result != returnvalue::OK) {
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
if (requiresSecondFileName()) {
|
if (requiresSecondFileName()) {
|
||||||
@ -61,7 +61,7 @@ ReturnValue_t FilestoreResponseTlv::serialize(uint8_t **buffer, size_t *size, si
|
|||||||
ReturnValue_t FilestoreResponseTlv::deSerialize(const uint8_t **buffer, size_t *size,
|
ReturnValue_t FilestoreResponseTlv::deSerialize(const uint8_t **buffer, size_t *size,
|
||||||
Endianness streamEndianness) {
|
Endianness streamEndianness) {
|
||||||
ReturnValue_t result = commonDeserialize(buffer, size, streamEndianness);
|
ReturnValue_t result = commonDeserialize(buffer, size, streamEndianness);
|
||||||
if (result != HasReturnvaluesIF::RETURN_OK) {
|
if (result != returnvalue::OK) {
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
return deSerializeFromValue(buffer, size, streamEndianness);
|
return deSerializeFromValue(buffer, size, streamEndianness);
|
||||||
@ -75,7 +75,7 @@ ReturnValue_t FilestoreResponseTlv::deSerializeFromValue(const uint8_t **buffer,
|
|||||||
*buffer += 1;
|
*buffer += 1;
|
||||||
*size -= 1;
|
*size -= 1;
|
||||||
ReturnValue_t result = firstFileName.deSerialize(buffer, size, streamEndianness);
|
ReturnValue_t result = firstFileName.deSerialize(buffer, size, streamEndianness);
|
||||||
if (result != HasReturnvaluesIF::RETURN_OK) {
|
if (result != returnvalue::OK) {
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
if (requiresSecondFileName()) {
|
if (requiresSecondFileName()) {
|
||||||
@ -83,7 +83,7 @@ ReturnValue_t FilestoreResponseTlv::deSerializeFromValue(const uint8_t **buffer,
|
|||||||
return cfdp::FILESTORE_REQUIRES_SECOND_FILE;
|
return cfdp::FILESTORE_REQUIRES_SECOND_FILE;
|
||||||
}
|
}
|
||||||
result = secondFileName->deSerialize(buffer, size, streamEndianness);
|
result = secondFileName->deSerialize(buffer, size, streamEndianness);
|
||||||
if (result != HasReturnvaluesIF::RETURN_OK) {
|
if (result != returnvalue::OK) {
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -98,7 +98,7 @@ ReturnValue_t FilestoreResponseTlv::deSerializeFromValue(const uint8_t **buffer,
|
|||||||
*size -= 1;
|
*size -= 1;
|
||||||
*buffer += 1;
|
*buffer += 1;
|
||||||
// Ignore empty filestore message
|
// Ignore empty filestore message
|
||||||
return HasReturnvaluesIF::RETURN_OK;
|
return returnvalue::OK;
|
||||||
}
|
}
|
||||||
return filestoreMsg->deSerialize(buffer, size, streamEndianness);
|
return filestoreMsg->deSerialize(buffer, size, streamEndianness);
|
||||||
}
|
}
|
||||||
|
@ -73,7 +73,7 @@ class FilestoreTlvBase : public TlvIF {
|
|||||||
Endianness streamEndianness, bool isResponse = false,
|
Endianness streamEndianness, bool isResponse = false,
|
||||||
uint8_t responseStatusCode = 0) const {
|
uint8_t responseStatusCode = 0) const {
|
||||||
if (buffer == nullptr or size == nullptr) {
|
if (buffer == nullptr or size == nullptr) {
|
||||||
return HasReturnvaluesIF::RETURN_FAILED;
|
return returnvalue::FAILED;
|
||||||
}
|
}
|
||||||
if (maxSize < 3) {
|
if (maxSize < 3) {
|
||||||
return SerializeIF::BUFFER_TOO_SHORT;
|
return SerializeIF::BUFFER_TOO_SHORT;
|
||||||
@ -90,13 +90,13 @@ class FilestoreTlvBase : public TlvIF {
|
|||||||
}
|
}
|
||||||
*buffer += 1;
|
*buffer += 1;
|
||||||
*size += 1;
|
*size += 1;
|
||||||
return HasReturnvaluesIF::RETURN_OK;
|
return returnvalue::OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
ReturnValue_t commonDeserialize(const uint8_t** buffer, size_t* size,
|
ReturnValue_t commonDeserialize(const uint8_t** buffer, size_t* size,
|
||||||
SerializeIF::Endianness streamEndianness) {
|
SerializeIF::Endianness streamEndianness) {
|
||||||
if (buffer == nullptr or size == nullptr) {
|
if (buffer == nullptr or size == nullptr) {
|
||||||
return HasReturnvaluesIF::RETURN_FAILED;
|
return returnvalue::FAILED;
|
||||||
}
|
}
|
||||||
if (*size < 3) {
|
if (*size < 3) {
|
||||||
return SerializeIF::STREAM_TOO_SHORT;
|
return SerializeIF::STREAM_TOO_SHORT;
|
||||||
@ -114,7 +114,7 @@ class FilestoreTlvBase : public TlvIF {
|
|||||||
if (remainingLength == 0) {
|
if (remainingLength == 0) {
|
||||||
return SerializeIF::STREAM_TOO_SHORT;
|
return SerializeIF::STREAM_TOO_SHORT;
|
||||||
}
|
}
|
||||||
return HasReturnvaluesIF::RETURN_OK;
|
return returnvalue::OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool requiresSecondFileName() const {
|
bool requiresSecondFileName() const {
|
||||||
@ -152,7 +152,7 @@ class FilestoreTlvBase : public TlvIF {
|
|||||||
size_t serSize = 0;
|
size_t serSize = 0;
|
||||||
uint8_t* valueStart = buffer + 2;
|
uint8_t* valueStart = buffer + 2;
|
||||||
ReturnValue_t result = this->serialize(&buffer, &serSize, maxSize, streamEndianness);
|
ReturnValue_t result = this->serialize(&buffer, &serSize, maxSize, streamEndianness);
|
||||||
if (result != HasReturnvaluesIF::RETURN_OK) {
|
if (result != returnvalue::OK) {
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
tlv.setValue(valueStart, serSize - 2);
|
tlv.setValue(valueStart, serSize - 2);
|
||||||
|
@ -21,7 +21,7 @@ cfdp::Lv& cfdp::Lv::operator=(const Lv& other) {
|
|||||||
if (value == nullptr or otherSize == 0) {
|
if (value == nullptr or otherSize == 0) {
|
||||||
this->zeroLen = true;
|
this->zeroLen = true;
|
||||||
}
|
}
|
||||||
this->value.setBuffer(value, otherSize);
|
this->value.setConstBuffer(value, otherSize);
|
||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -31,13 +31,13 @@ ReturnValue_t cfdp::Lv::serialize(uint8_t** buffer, size_t* size, size_t maxSize
|
|||||||
return BUFFER_TOO_SHORT;
|
return BUFFER_TOO_SHORT;
|
||||||
}
|
}
|
||||||
if (buffer == nullptr or size == nullptr) {
|
if (buffer == nullptr or size == nullptr) {
|
||||||
return HasReturnvaluesIF::RETURN_FAILED;
|
return returnvalue::FAILED;
|
||||||
}
|
}
|
||||||
if (zeroLen) {
|
if (zeroLen) {
|
||||||
**buffer = 0;
|
**buffer = 0;
|
||||||
*size += 1;
|
*size += 1;
|
||||||
*buffer += 1;
|
*buffer += 1;
|
||||||
return HasReturnvaluesIF::RETURN_OK;
|
return returnvalue::OK;
|
||||||
}
|
}
|
||||||
return value.serialize(buffer, size, maxSize, streamEndianness);
|
return value.serialize(buffer, size, maxSize, streamEndianness);
|
||||||
}
|
}
|
||||||
@ -54,7 +54,7 @@ size_t cfdp::Lv::getSerializedSize() const {
|
|||||||
ReturnValue_t cfdp::Lv::deSerialize(const uint8_t** buffer, size_t* size,
|
ReturnValue_t cfdp::Lv::deSerialize(const uint8_t** buffer, size_t* size,
|
||||||
Endianness streamEndianness) {
|
Endianness streamEndianness) {
|
||||||
if (buffer == nullptr or size == nullptr) {
|
if (buffer == nullptr or size == nullptr) {
|
||||||
return HasReturnvaluesIF::RETURN_FAILED;
|
return returnvalue::FAILED;
|
||||||
}
|
}
|
||||||
if (*size < 1) {
|
if (*size < 1) {
|
||||||
return SerializeIF::STREAM_TOO_SHORT;
|
return SerializeIF::STREAM_TOO_SHORT;
|
||||||
@ -64,16 +64,16 @@ ReturnValue_t cfdp::Lv::deSerialize(const uint8_t** buffer, size_t* size,
|
|||||||
zeroLen = true;
|
zeroLen = true;
|
||||||
*buffer += 1;
|
*buffer += 1;
|
||||||
*size -= 1;
|
*size -= 1;
|
||||||
return HasReturnvaluesIF::RETURN_OK;
|
return returnvalue::OK;
|
||||||
} else if (*size < lengthField + 1) {
|
} else if (*size < lengthField + 1) {
|
||||||
return SerializeIF::STREAM_TOO_SHORT;
|
return SerializeIF::STREAM_TOO_SHORT;
|
||||||
}
|
}
|
||||||
zeroLen = false;
|
zeroLen = false;
|
||||||
// Zero-copy implementation
|
// Zero-copy implementation
|
||||||
value.setBuffer(const_cast<uint8_t*>(*buffer + 1), lengthField);
|
value.setConstBuffer(*buffer + 1, lengthField);
|
||||||
*buffer += 1 + lengthField;
|
*buffer += 1 + lengthField;
|
||||||
*size -= 1 + lengthField;
|
*size -= 1 + lengthField;
|
||||||
return HasReturnvaluesIF::RETURN_OK;
|
return returnvalue::OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
const uint8_t* cfdp::Lv::getValue(size_t* size) const {
|
const uint8_t* cfdp::Lv::getValue(size_t* size) const {
|
||||||
|
@ -12,7 +12,7 @@ cfdp::Tlv::Tlv() : value(static_cast<uint8_t *>(nullptr), 0, true) {}
|
|||||||
ReturnValue_t cfdp::Tlv::serialize(uint8_t **buffer, size_t *size, size_t maxSize,
|
ReturnValue_t cfdp::Tlv::serialize(uint8_t **buffer, size_t *size, size_t maxSize,
|
||||||
Endianness streamEndianness) const {
|
Endianness streamEndianness) const {
|
||||||
if (buffer == nullptr or size == nullptr) {
|
if (buffer == nullptr or size == nullptr) {
|
||||||
return HasReturnvaluesIF::RETURN_FAILED;
|
return returnvalue::FAILED;
|
||||||
}
|
}
|
||||||
if (*size + 2 > maxSize) {
|
if (*size + 2 > maxSize) {
|
||||||
return BUFFER_TOO_SHORT;
|
return BUFFER_TOO_SHORT;
|
||||||
@ -28,10 +28,10 @@ ReturnValue_t cfdp::Tlv::serialize(uint8_t **buffer, size_t *size, size_t maxSiz
|
|||||||
**buffer = 0;
|
**buffer = 0;
|
||||||
*size += 1;
|
*size += 1;
|
||||||
*buffer += 1;
|
*buffer += 1;
|
||||||
return HasReturnvaluesIF::RETURN_OK;
|
return returnvalue::OK;
|
||||||
}
|
}
|
||||||
if (value.getConstBuffer() == nullptr) {
|
if (value.getConstBuffer() == nullptr) {
|
||||||
return HasReturnvaluesIF::RETURN_FAILED;
|
return returnvalue::FAILED;
|
||||||
}
|
}
|
||||||
return value.serialize(buffer, size, maxSize, streamEndianness);
|
return value.serialize(buffer, size, maxSize, streamEndianness);
|
||||||
}
|
}
|
||||||
@ -48,7 +48,7 @@ size_t cfdp::Tlv::getSerializedSize() const {
|
|||||||
ReturnValue_t cfdp::Tlv::deSerialize(const uint8_t **buffer, size_t *size,
|
ReturnValue_t cfdp::Tlv::deSerialize(const uint8_t **buffer, size_t *size,
|
||||||
Endianness streamEndianness) {
|
Endianness streamEndianness) {
|
||||||
if (buffer == nullptr or size == nullptr) {
|
if (buffer == nullptr or size == nullptr) {
|
||||||
return HasReturnvaluesIF::RETURN_FAILED;
|
return returnvalue::FAILED;
|
||||||
}
|
}
|
||||||
if (*size < 2) {
|
if (*size < 2) {
|
||||||
return STREAM_TOO_SHORT;
|
return STREAM_TOO_SHORT;
|
||||||
@ -68,17 +68,17 @@ ReturnValue_t cfdp::Tlv::deSerialize(const uint8_t **buffer, size_t *size,
|
|||||||
zeroLen = true;
|
zeroLen = true;
|
||||||
*buffer += 1;
|
*buffer += 1;
|
||||||
*size -= 1;
|
*size -= 1;
|
||||||
return HasReturnvaluesIF::RETURN_OK;
|
return returnvalue::OK;
|
||||||
}
|
}
|
||||||
if (lengthField + 1 > *size) {
|
if (lengthField + 1 > *size) {
|
||||||
return SerializeIF::STREAM_TOO_SHORT;
|
return SerializeIF::STREAM_TOO_SHORT;
|
||||||
}
|
}
|
||||||
zeroLen = false;
|
zeroLen = false;
|
||||||
// Zero-copy implementation
|
// Zero-copy implementation
|
||||||
value.setBuffer(const_cast<uint8_t *>(*buffer + 1), lengthField);
|
value.setConstBuffer(*buffer + 1, lengthField);
|
||||||
*buffer += 1 + lengthField;
|
*buffer += 1 + lengthField;
|
||||||
*size -= 1 + lengthField;
|
*size -= 1 + lengthField;
|
||||||
return HasReturnvaluesIF::RETURN_OK;
|
return returnvalue::OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
const uint8_t *cfdp::Tlv::getValue() const { return value.getConstBuffer(); }
|
const uint8_t *cfdp::Tlv::getValue() const { return value.getConstBuffer(); }
|
||||||
@ -96,7 +96,7 @@ void cfdp::Tlv::setValue(uint8_t *value, size_t len) {
|
|||||||
if (len > 0) {
|
if (len > 0) {
|
||||||
zeroLen = false;
|
zeroLen = false;
|
||||||
}
|
}
|
||||||
this->value.setBuffer(value, len);
|
this->value.setConstBuffer(value, len);
|
||||||
}
|
}
|
||||||
|
|
||||||
uint8_t cfdp::Tlv::getLengthField() const { return this->value.getSerializedSize() - 1; }
|
uint8_t cfdp::Tlv::getLengthField() const { return this->value.getSerializedSize() - 1; }
|
||||||
|
@ -23,7 +23,7 @@ class Tlv : public TlvIF {
|
|||||||
* @param maxSize
|
* @param maxSize
|
||||||
* @param streamEndianness
|
* @param streamEndianness
|
||||||
* @return
|
* @return
|
||||||
* - RETURN_OK on success
|
* - returnvalue::OK on success
|
||||||
* - INVALID_TLV_TYPE
|
* - INVALID_TLV_TYPE
|
||||||
* - SerializeIF returncode on wrong serialization parameters
|
* - SerializeIF returncode on wrong serialization parameters
|
||||||
*/
|
*/
|
||||||
@ -37,7 +37,7 @@ class Tlv : public TlvIF {
|
|||||||
* @param buffer Raw buffer including the size field
|
* @param buffer Raw buffer including the size field
|
||||||
* @param size
|
* @param size
|
||||||
* @param streamEndianness
|
* @param streamEndianness
|
||||||
* - RETURN_OK on success
|
* - returnvalue::OK on success
|
||||||
* - INVALID_TLV_TYPE
|
* - INVALID_TLV_TYPE
|
||||||
* - SerializeIF returncode on wrong deserialization parameters
|
* - SerializeIF returncode on wrong deserialization parameters
|
||||||
*/
|
*/
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
#ifndef FSFW_CONTAINER_ARRAYLIST_H_
|
#ifndef FSFW_CONTAINER_ARRAYLIST_H_
|
||||||
#define FSFW_CONTAINER_ARRAYLIST_H_
|
#define FSFW_CONTAINER_ARRAYLIST_H_
|
||||||
|
|
||||||
#include "../returnvalues/HasReturnvaluesIF.h"
|
#include "../returnvalues/returnvalue.h"
|
||||||
#include "../serialize/SerializeAdapter.h"
|
#include "../serialize/SerializeAdapter.h"
|
||||||
#include "../serialize/SerializeIF.h"
|
#include "../serialize/SerializeIF.h"
|
||||||
|
|
||||||
@ -183,7 +183,7 @@ class ArrayList {
|
|||||||
* @param entry
|
* @param entry
|
||||||
* @return
|
* @return
|
||||||
* -@c FULL if the List is full
|
* -@c FULL if the List is full
|
||||||
* -@c RETURN_OK else
|
* -@c returnvalue::OK else
|
||||||
*/
|
*/
|
||||||
ReturnValue_t insert(T entry) {
|
ReturnValue_t insert(T entry) {
|
||||||
if (size >= maxSize_) {
|
if (size >= maxSize_) {
|
||||||
@ -191,7 +191,7 @@ class ArrayList {
|
|||||||
}
|
}
|
||||||
entries[size] = entry;
|
entries[size] = entry;
|
||||||
++size;
|
++size;
|
||||||
return HasReturnvaluesIF::RETURN_OK;
|
return returnvalue::OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -4,7 +4,7 @@
|
|||||||
#include <cstddef>
|
#include <cstddef>
|
||||||
#include <cstring>
|
#include <cstring>
|
||||||
|
|
||||||
#include "../returnvalues/HasReturnvaluesIF.h"
|
#include "../returnvalues/returnvalue.h"
|
||||||
|
|
||||||
template <typename T>
|
template <typename T>
|
||||||
class FIFOBase {
|
class FIFOBase {
|
||||||
@ -20,24 +20,24 @@ class FIFOBase {
|
|||||||
/**
|
/**
|
||||||
* Insert value into FIFO
|
* Insert value into FIFO
|
||||||
* @param value
|
* @param value
|
||||||
* @return RETURN_OK on success, FULL if full
|
* @return returnvalue::OK on success, FULL if full
|
||||||
*/
|
*/
|
||||||
ReturnValue_t insert(T value);
|
ReturnValue_t insert(T value);
|
||||||
/**
|
/**
|
||||||
* Retrieve item from FIFO. This removes the item from the FIFO.
|
* Retrieve item from FIFO. This removes the item from the FIFO.
|
||||||
* @param value Must point to a valid T
|
* @param value Must point to a valid T
|
||||||
* @return RETURN_OK on success, EMPTY if empty and FAILED if nullptr check failed
|
* @return returnvalue::OK on success, EMPTY if empty and FAILED if nullptr check failed
|
||||||
*/
|
*/
|
||||||
ReturnValue_t retrieve(T* value);
|
ReturnValue_t retrieve(T* value);
|
||||||
/**
|
/**
|
||||||
* Retrieve item from FIFO without removing it from FIFO.
|
* Retrieve item from FIFO without removing it from FIFO.
|
||||||
* @param value Must point to a valid T
|
* @param value Must point to a valid T
|
||||||
* @return RETURN_OK on success, EMPTY if empty and FAILED if nullptr check failed
|
* @return returnvalue::OK on success, EMPTY if empty and FAILED if nullptr check failed
|
||||||
*/
|
*/
|
||||||
ReturnValue_t peek(T* value);
|
ReturnValue_t peek(T* value);
|
||||||
/**
|
/**
|
||||||
* Remove item from FIFO.
|
* Remove item from FIFO.
|
||||||
* @return RETURN_OK on success, EMPTY if empty
|
* @return returnvalue::OK on success, EMPTY if empty
|
||||||
*/
|
*/
|
||||||
ReturnValue_t pop();
|
ReturnValue_t pop();
|
||||||
|
|
||||||
|
@ -17,7 +17,7 @@ inline ReturnValue_t FIFOBase<T>::insert(T value) {
|
|||||||
values[writeIndex] = value;
|
values[writeIndex] = value;
|
||||||
writeIndex = next(writeIndex);
|
writeIndex = next(writeIndex);
|
||||||
++currentSize;
|
++currentSize;
|
||||||
return HasReturnvaluesIF::RETURN_OK;
|
return returnvalue::OK;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -27,12 +27,12 @@ inline ReturnValue_t FIFOBase<T>::retrieve(T* value) {
|
|||||||
return EMPTY;
|
return EMPTY;
|
||||||
} else {
|
} else {
|
||||||
if (value == nullptr) {
|
if (value == nullptr) {
|
||||||
return HasReturnvaluesIF::RETURN_FAILED;
|
return returnvalue::FAILED;
|
||||||
}
|
}
|
||||||
*value = values[readIndex];
|
*value = values[readIndex];
|
||||||
readIndex = next(readIndex);
|
readIndex = next(readIndex);
|
||||||
--currentSize;
|
--currentSize;
|
||||||
return HasReturnvaluesIF::RETURN_OK;
|
return returnvalue::OK;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -42,10 +42,10 @@ inline ReturnValue_t FIFOBase<T>::peek(T* value) {
|
|||||||
return EMPTY;
|
return EMPTY;
|
||||||
} else {
|
} else {
|
||||||
if (value == nullptr) {
|
if (value == nullptr) {
|
||||||
return HasReturnvaluesIF::RETURN_FAILED;
|
return returnvalue::FAILED;
|
||||||
}
|
}
|
||||||
*value = values[readIndex];
|
*value = values[readIndex];
|
||||||
return HasReturnvaluesIF::RETURN_OK;
|
return returnvalue::OK;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -4,7 +4,7 @@
|
|||||||
#include <type_traits>
|
#include <type_traits>
|
||||||
#include <utility>
|
#include <utility>
|
||||||
|
|
||||||
#include "../returnvalues/HasReturnvaluesIF.h"
|
#include "../returnvalues/returnvalue.h"
|
||||||
#include "ArrayList.h"
|
#include "ArrayList.h"
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -75,7 +75,7 @@ class FixedMap : public SerializeIF {
|
|||||||
uint32_t size() const { return _size; }
|
uint32_t size() const { return _size; }
|
||||||
|
|
||||||
ReturnValue_t insert(key_t key, T value, Iterator* storedValue = nullptr) {
|
ReturnValue_t insert(key_t key, T value, Iterator* storedValue = nullptr) {
|
||||||
if (exists(key) == HasReturnvaluesIF::RETURN_OK) {
|
if (exists(key) == returnvalue::OK) {
|
||||||
return KEY_ALREADY_EXISTS;
|
return KEY_ALREADY_EXISTS;
|
||||||
}
|
}
|
||||||
if (_size == theMap.maxSize()) {
|
if (_size == theMap.maxSize()) {
|
||||||
@ -87,7 +87,7 @@ class FixedMap : public SerializeIF {
|
|||||||
*storedValue = Iterator(&theMap[_size]);
|
*storedValue = Iterator(&theMap[_size]);
|
||||||
}
|
}
|
||||||
++_size;
|
++_size;
|
||||||
return HasReturnvaluesIF::RETURN_OK;
|
return returnvalue::OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
ReturnValue_t insert(std::pair<key_t, T> pair) { return insert(pair.first, pair.second); }
|
ReturnValue_t insert(std::pair<key_t, T> pair) { return insert(pair.first, pair.second); }
|
||||||
@ -95,7 +95,7 @@ class FixedMap : public SerializeIF {
|
|||||||
ReturnValue_t exists(key_t key) const {
|
ReturnValue_t exists(key_t key) const {
|
||||||
ReturnValue_t result = KEY_DOES_NOT_EXIST;
|
ReturnValue_t result = KEY_DOES_NOT_EXIST;
|
||||||
if (findIndex(key) < _size) {
|
if (findIndex(key) < _size) {
|
||||||
result = HasReturnvaluesIF::RETURN_OK;
|
result = returnvalue::OK;
|
||||||
}
|
}
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
@ -108,7 +108,7 @@ class FixedMap : public SerializeIF {
|
|||||||
theMap[i] = theMap[_size - 1];
|
theMap[i] = theMap[_size - 1];
|
||||||
--_size;
|
--_size;
|
||||||
--((*iter).value);
|
--((*iter).value);
|
||||||
return HasReturnvaluesIF::RETURN_OK;
|
return returnvalue::OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
ReturnValue_t erase(key_t key) {
|
ReturnValue_t erase(key_t key) {
|
||||||
@ -118,14 +118,14 @@ class FixedMap : public SerializeIF {
|
|||||||
}
|
}
|
||||||
theMap[i] = theMap[_size - 1];
|
theMap[i] = theMap[_size - 1];
|
||||||
--_size;
|
--_size;
|
||||||
return HasReturnvaluesIF::RETURN_OK;
|
return returnvalue::OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
T* findValue(key_t key) const { return &theMap[findIndex(key)].second; }
|
T* findValue(key_t key) const { return &theMap[findIndex(key)].second; }
|
||||||
|
|
||||||
Iterator find(key_t key) const {
|
Iterator find(key_t key) const {
|
||||||
ReturnValue_t result = exists(key);
|
ReturnValue_t result = exists(key);
|
||||||
if (result != HasReturnvaluesIF::RETURN_OK) {
|
if (result != returnvalue::OK) {
|
||||||
return end();
|
return end();
|
||||||
}
|
}
|
||||||
return Iterator(&theMap[findIndex(key)]);
|
return Iterator(&theMap[findIndex(key)]);
|
||||||
@ -133,11 +133,11 @@ class FixedMap : public SerializeIF {
|
|||||||
|
|
||||||
ReturnValue_t find(key_t key, T** value) const {
|
ReturnValue_t find(key_t key, T** value) const {
|
||||||
ReturnValue_t result = exists(key);
|
ReturnValue_t result = exists(key);
|
||||||
if (result != HasReturnvaluesIF::RETURN_OK) {
|
if (result != returnvalue::OK) {
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
*value = &theMap[findIndex(key)].second;
|
*value = &theMap[findIndex(key)].second;
|
||||||
return HasReturnvaluesIF::RETURN_OK;
|
return returnvalue::OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool empty() {
|
bool empty() {
|
||||||
@ -165,7 +165,7 @@ class FixedMap : public SerializeIF {
|
|||||||
ReturnValue_t result =
|
ReturnValue_t result =
|
||||||
SerializeAdapter::serialize(&this->_size, buffer, size, maxSize, streamEndianness);
|
SerializeAdapter::serialize(&this->_size, buffer, size, maxSize, streamEndianness);
|
||||||
uint32_t i = 0;
|
uint32_t i = 0;
|
||||||
while ((result == HasReturnvaluesIF::RETURN_OK) && (i < this->_size)) {
|
while ((result == returnvalue::OK) && (i < this->_size)) {
|
||||||
result =
|
result =
|
||||||
SerializeAdapter::serialize(&theMap[i].first, buffer, size, maxSize, streamEndianness);
|
SerializeAdapter::serialize(&theMap[i].first, buffer, size, maxSize, streamEndianness);
|
||||||
result =
|
result =
|
||||||
@ -195,7 +195,7 @@ class FixedMap : public SerializeIF {
|
|||||||
return SerializeIF::TOO_MANY_ELEMENTS;
|
return SerializeIF::TOO_MANY_ELEMENTS;
|
||||||
}
|
}
|
||||||
uint32_t i = 0;
|
uint32_t i = 0;
|
||||||
while ((result == HasReturnvaluesIF::RETURN_OK) && (i < this->_size)) {
|
while ((result == returnvalue::OK) && (i < this->_size)) {
|
||||||
result = SerializeAdapter::deSerialize(&theMap[i].first, buffer, size, streamEndianness);
|
result = SerializeAdapter::deSerialize(&theMap[i].first, buffer, size, streamEndianness);
|
||||||
result = SerializeAdapter::deSerialize(&theMap[i].second, buffer, size, streamEndianness);
|
result = SerializeAdapter::deSerialize(&theMap[i].second, buffer, size, streamEndianness);
|
||||||
++i;
|
++i;
|
||||||
|
@ -100,7 +100,7 @@ class FixedOrderedMultimap {
|
|||||||
* @param[in] value Value 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
|
* @param[in/out] (optional) storedValue On success this points to the new value, otherwise a
|
||||||
* nullptr
|
* nullptr
|
||||||
* @return RETURN_OK if insert was successful, MAP_FULL if no space is available
|
* @return returnvalue::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 insert(key_t key, T value, Iterator* storedValue = nullptr);
|
||||||
|
|
||||||
@ -108,14 +108,14 @@ class FixedOrderedMultimap {
|
|||||||
* Used to insert new pair instead of single values
|
* Used to insert new pair instead of single values
|
||||||
*
|
*
|
||||||
* @param pair Pair to be inserted
|
* @param pair Pair to be inserted
|
||||||
* @return RETURN_OK if insert was successful, MAP_FULL if no space is available
|
* @return returnvalue::OK if insert was successful, MAP_FULL if no space is available
|
||||||
*/
|
*/
|
||||||
ReturnValue_t insert(std::pair<key_t, T> pair);
|
ReturnValue_t insert(std::pair<key_t, T> pair);
|
||||||
|
|
||||||
/***
|
/***
|
||||||
* Can be used to check if a certain key is in the map
|
* Can be used to check if a certain key is in the map
|
||||||
* @param key Key to be checked
|
* @param key Key to be checked
|
||||||
* @return RETURN_OK if the key exists KEY_DOES_NOT_EXIST otherwise
|
* @return returnvalue::OK if the key exists KEY_DOES_NOT_EXIST otherwise
|
||||||
*/
|
*/
|
||||||
ReturnValue_t exists(key_t key) const;
|
ReturnValue_t exists(key_t key) const;
|
||||||
|
|
||||||
@ -127,14 +127,14 @@ class FixedOrderedMultimap {
|
|||||||
*
|
*
|
||||||
* @warning The iterator needs to be valid and dereferenceable
|
* @warning The iterator needs to be valid and dereferenceable
|
||||||
* @param[in/out] iter Pointer to iterator to the element that needs to be ereased
|
* @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
|
* @return returnvalue::OK if erased, KEY_DOES_NOT_EXIST if the there is no element like this
|
||||||
*/
|
*/
|
||||||
ReturnValue_t erase(Iterator* iter);
|
ReturnValue_t erase(Iterator* iter);
|
||||||
|
|
||||||
/***
|
/***
|
||||||
* Used to erase by key
|
* Used to erase by key
|
||||||
* @param key Key to be erased
|
* @param key Key to be erased
|
||||||
* @return RETURN_OK if erased, KEY_DOES_NOT_EXIST if the there is no element like this
|
* @return returnvalue::OK if erased, KEY_DOES_NOT_EXIST if the there is no element like this
|
||||||
*/
|
*/
|
||||||
ReturnValue_t erase(key_t key);
|
ReturnValue_t erase(key_t key);
|
||||||
|
|
||||||
@ -148,7 +148,7 @@ class FixedOrderedMultimap {
|
|||||||
*/
|
*/
|
||||||
Iterator find(key_t key) const {
|
Iterator find(key_t key) const {
|
||||||
ReturnValue_t result = exists(key);
|
ReturnValue_t result = exists(key);
|
||||||
if (result != HasReturnvaluesIF::RETURN_OK) {
|
if (result != returnvalue::OK) {
|
||||||
return end();
|
return end();
|
||||||
}
|
}
|
||||||
return Iterator(&theMap[findFirstIndex(key)]);
|
return Iterator(&theMap[findFirstIndex(key)]);
|
||||||
@ -160,7 +160,7 @@ class FixedOrderedMultimap {
|
|||||||
*
|
*
|
||||||
* @param key Key to search for
|
* @param key Key to search for
|
||||||
* @param value Found value
|
* @param value Found value
|
||||||
* @return RETURN_OK if it points to the value,
|
* @return returnvalue::OK if it points to the value,
|
||||||
* KEY_DOES_NOT_EXIST if the key is not in the map
|
* KEY_DOES_NOT_EXIST if the key is not in the map
|
||||||
*/
|
*/
|
||||||
ReturnValue_t find(key_t key, T** value) const;
|
ReturnValue_t find(key_t key, T** value) const;
|
||||||
|
@ -16,7 +16,7 @@ inline ReturnValue_t FixedOrderedMultimap<key_t, T, KEY_COMPARE>::insert(key_t k
|
|||||||
if (storedValue != nullptr) {
|
if (storedValue != nullptr) {
|
||||||
*storedValue = Iterator(&theMap[position]);
|
*storedValue = Iterator(&theMap[position]);
|
||||||
}
|
}
|
||||||
return HasReturnvaluesIF::RETURN_OK;
|
return returnvalue::OK;
|
||||||
}
|
}
|
||||||
template <typename key_t, typename T, typename KEY_COMPARE>
|
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) {
|
inline ReturnValue_t FixedOrderedMultimap<key_t, T, KEY_COMPARE>::insert(std::pair<key_t, T> pair) {
|
||||||
@ -27,7 +27,7 @@ template <typename key_t, typename T, typename KEY_COMPARE>
|
|||||||
inline ReturnValue_t FixedOrderedMultimap<key_t, T, KEY_COMPARE>::exists(key_t key) const {
|
inline ReturnValue_t FixedOrderedMultimap<key_t, T, KEY_COMPARE>::exists(key_t key) const {
|
||||||
ReturnValue_t result = KEY_DOES_NOT_EXIST;
|
ReturnValue_t result = KEY_DOES_NOT_EXIST;
|
||||||
if (findFirstIndex(key) < _size) {
|
if (findFirstIndex(key) < _size) {
|
||||||
result = HasReturnvaluesIF::RETURN_OK;
|
result = returnvalue::OK;
|
||||||
}
|
}
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
@ -44,7 +44,7 @@ inline ReturnValue_t FixedOrderedMultimap<key_t, T, KEY_COMPARE>::erase(Iterator
|
|||||||
} else {
|
} else {
|
||||||
*iter = begin();
|
*iter = begin();
|
||||||
}
|
}
|
||||||
return HasReturnvaluesIF::RETURN_OK;
|
return returnvalue::OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
template <typename key_t, typename T, typename KEY_COMPARE>
|
template <typename key_t, typename T, typename KEY_COMPARE>
|
||||||
@ -57,17 +57,17 @@ inline ReturnValue_t FixedOrderedMultimap<key_t, T, KEY_COMPARE>::erase(key_t ke
|
|||||||
removeFromPosition(i);
|
removeFromPosition(i);
|
||||||
i = findFirstIndex(key, i);
|
i = findFirstIndex(key, i);
|
||||||
} while (i < _size);
|
} while (i < _size);
|
||||||
return HasReturnvaluesIF::RETURN_OK;
|
return returnvalue::OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
template <typename key_t, typename T, typename KEY_COMPARE>
|
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 {
|
inline ReturnValue_t FixedOrderedMultimap<key_t, T, KEY_COMPARE>::find(key_t key, T **value) const {
|
||||||
ReturnValue_t result = exists(key);
|
ReturnValue_t result = exists(key);
|
||||||
if (result != HasReturnvaluesIF::RETURN_OK) {
|
if (result != returnvalue::OK) {
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
*value = &theMap[findFirstIndex(key)].second;
|
*value = &theMap[findFirstIndex(key)].second;
|
||||||
return HasReturnvaluesIF::RETURN_OK;
|
return returnvalue::OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
template <typename key_t, typename T, typename KEY_COMPARE>
|
template <typename key_t, typename T, typename KEY_COMPARE>
|
||||||
|
@ -4,7 +4,7 @@
|
|||||||
#include <cmath>
|
#include <cmath>
|
||||||
|
|
||||||
#include "../globalfunctions/CRC.h"
|
#include "../globalfunctions/CRC.h"
|
||||||
#include "../returnvalues/HasReturnvaluesIF.h"
|
#include "../returnvalues/returnvalue.h"
|
||||||
#include "../serialize/SerialArrayListAdapter.h"
|
#include "../serialize/SerialArrayListAdapter.h"
|
||||||
#include "../serviceinterface/ServiceInterfaceStream.h"
|
#include "../serviceinterface/ServiceInterfaceStream.h"
|
||||||
#include "ArrayList.h"
|
#include "ArrayList.h"
|
||||||
@ -52,15 +52,15 @@ class Index : public SerializeIF {
|
|||||||
Endianness streamEndianness) const {
|
Endianness streamEndianness) const {
|
||||||
ReturnValue_t result =
|
ReturnValue_t result =
|
||||||
SerializeAdapter::serialize(&blockStartAddress, buffer, size, maxSize, streamEndianness);
|
SerializeAdapter::serialize(&blockStartAddress, buffer, size, maxSize, streamEndianness);
|
||||||
if (result != HasReturnvaluesIF::RETURN_OK) {
|
if (result != returnvalue::OK) {
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
result = indexType.serialize(buffer, size, maxSize, streamEndianness);
|
result = indexType.serialize(buffer, size, maxSize, streamEndianness);
|
||||||
if (result != HasReturnvaluesIF::RETURN_OK) {
|
if (result != returnvalue::OK) {
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
result = SerializeAdapter::serialize(&this->size, buffer, size, maxSize, streamEndianness);
|
result = SerializeAdapter::serialize(&this->size, buffer, size, maxSize, streamEndianness);
|
||||||
if (result != HasReturnvaluesIF::RETURN_OK) {
|
if (result != returnvalue::OK) {
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
result =
|
result =
|
||||||
@ -71,19 +71,19 @@ class Index : public SerializeIF {
|
|||||||
ReturnValue_t deSerialize(const uint8_t** buffer, size_t* size, Endianness streamEndianness) {
|
ReturnValue_t deSerialize(const uint8_t** buffer, size_t* size, Endianness streamEndianness) {
|
||||||
ReturnValue_t result =
|
ReturnValue_t result =
|
||||||
SerializeAdapter::deSerialize(&blockStartAddress, buffer, size, streamEndianness);
|
SerializeAdapter::deSerialize(&blockStartAddress, buffer, size, streamEndianness);
|
||||||
if (result != HasReturnvaluesIF::RETURN_OK) {
|
if (result != returnvalue::OK) {
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
result = indexType.deSerialize(buffer, size, streamEndianness);
|
result = indexType.deSerialize(buffer, size, streamEndianness);
|
||||||
if (result != HasReturnvaluesIF::RETURN_OK) {
|
if (result != returnvalue::OK) {
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
result = SerializeAdapter::deSerialize(&this->size, buffer, size, streamEndianness);
|
result = SerializeAdapter::deSerialize(&this->size, buffer, size, streamEndianness);
|
||||||
if (result != HasReturnvaluesIF::RETURN_OK) {
|
if (result != returnvalue::OK) {
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
result = SerializeAdapter::deSerialize(&this->storedPackets, buffer, size, streamEndianness);
|
result = SerializeAdapter::deSerialize(&this->storedPackets, buffer, size, streamEndianness);
|
||||||
if (result != HasReturnvaluesIF::RETURN_OK) {
|
if (result != returnvalue::OK) {
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
return result;
|
return result;
|
||||||
@ -449,13 +449,13 @@ class IndexedRingMemoryArray : public SerializeIF, public ArrayList<Index<T>, ui
|
|||||||
// Check Next Block
|
// Check Next Block
|
||||||
if (!isNextBlockWritable()) {
|
if (!isNextBlockWritable()) {
|
||||||
// The Index is full and does not overwrite old
|
// The Index is full and does not overwrite old
|
||||||
return HasReturnvaluesIF::RETURN_FAILED;
|
return returnvalue::FAILED;
|
||||||
}
|
}
|
||||||
// Next block can be written, update Metadata
|
// Next block can be written, update Metadata
|
||||||
currentWriteBlock = getNextWrite();
|
currentWriteBlock = getNextWrite();
|
||||||
currentWriteBlock->setSize(0);
|
currentWriteBlock->setSize(0);
|
||||||
currentWriteBlock->setStoredPackets(0);
|
currentWriteBlock->setStoredPackets(0);
|
||||||
return HasReturnvaluesIF::RETURN_OK;
|
return returnvalue::OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -475,21 +475,21 @@ class IndexedRingMemoryArray : public SerializeIF, public ArrayList<Index<T>, ui
|
|||||||
additionalInfo->serialize(buffer, size, maxSize, streamEndianness);
|
additionalInfo->serialize(buffer, size, maxSize, streamEndianness);
|
||||||
}
|
}
|
||||||
ReturnValue_t result = currentWriteBlock->serialize(buffer, size, maxSize, streamEndianness);
|
ReturnValue_t result = currentWriteBlock->serialize(buffer, size, maxSize, streamEndianness);
|
||||||
if (result != HasReturnvaluesIF::RETURN_OK) {
|
if (result != returnvalue::OK) {
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
result = SerializeAdapter::serialize(&this->size, buffer, size, maxSize, streamEndianness);
|
result = SerializeAdapter::serialize(&this->size, buffer, size, maxSize, streamEndianness);
|
||||||
if (result != HasReturnvaluesIF::RETURN_OK) {
|
if (result != returnvalue::OK) {
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
uint32_t i = 0;
|
uint32_t i = 0;
|
||||||
while ((result == HasReturnvaluesIF::RETURN_OK) && (i < this->size)) {
|
while ((result == returnvalue::OK) && (i < this->size)) {
|
||||||
result =
|
result =
|
||||||
SerializeAdapter::serialize(&this->entries[i], buffer, size, maxSize, streamEndianness);
|
SerializeAdapter::serialize(&this->entries[i], buffer, size, maxSize, streamEndianness);
|
||||||
++i;
|
++i;
|
||||||
}
|
}
|
||||||
if (result != HasReturnvaluesIF::RETURN_OK) {
|
if (result != returnvalue::OK) {
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
uint16_t crc = Calculate_CRC(crcBuffer, (*size - oldSize));
|
uint16_t crc = Calculate_CRC(crcBuffer, (*size - oldSize));
|
||||||
@ -523,44 +523,44 @@ class IndexedRingMemoryArray : public SerializeIF, public ArrayList<Index<T>, ui
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
ReturnValue_t deSerialize(const uint8_t** buffer, size_t* size, Endianness streamEndianness) {
|
ReturnValue_t deSerialize(const uint8_t** buffer, size_t* size, Endianness streamEndianness) {
|
||||||
ReturnValue_t result = HasReturnvaluesIF::RETURN_OK;
|
ReturnValue_t result = returnvalue::OK;
|
||||||
if (additionalInfo != NULL) {
|
if (additionalInfo != NULL) {
|
||||||
result = additionalInfo->deSerialize(buffer, size, streamEndianness);
|
result = additionalInfo->deSerialize(buffer, size, streamEndianness);
|
||||||
}
|
}
|
||||||
if (result != HasReturnvaluesIF::RETURN_OK) {
|
if (result != returnvalue::OK) {
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
Index<T> tempIndex;
|
Index<T> tempIndex;
|
||||||
result = tempIndex.deSerialize(buffer, size, streamEndianness);
|
result = tempIndex.deSerialize(buffer, size, streamEndianness);
|
||||||
if (result != HasReturnvaluesIF::RETURN_OK) {
|
if (result != returnvalue::OK) {
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
uint32_t tempSize = 0;
|
uint32_t tempSize = 0;
|
||||||
result = SerializeAdapter::deSerialize(&tempSize, buffer, size, streamEndianness);
|
result = SerializeAdapter::deSerialize(&tempSize, buffer, size, streamEndianness);
|
||||||
if (result != HasReturnvaluesIF::RETURN_OK) {
|
if (result != returnvalue::OK) {
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
if (this->size != tempSize) {
|
if (this->size != tempSize) {
|
||||||
return HasReturnvaluesIF::RETURN_FAILED;
|
return returnvalue::FAILED;
|
||||||
}
|
}
|
||||||
uint32_t i = 0;
|
uint32_t i = 0;
|
||||||
while ((result == HasReturnvaluesIF::RETURN_OK) && (i < this->size)) {
|
while ((result == returnvalue::OK) && (i < this->size)) {
|
||||||
result = SerializeAdapter::deSerialize(&this->entries[i], buffer, size, streamEndianness);
|
result = SerializeAdapter::deSerialize(&this->entries[i], buffer, size, streamEndianness);
|
||||||
++i;
|
++i;
|
||||||
}
|
}
|
||||||
if (result != HasReturnvaluesIF::RETURN_OK) {
|
if (result != returnvalue::OK) {
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
typename IndexedRingMemoryArray<T>::Iterator cmp(&tempIndex);
|
typename IndexedRingMemoryArray<T>::Iterator cmp(&tempIndex);
|
||||||
for (typename IndexedRingMemoryArray<T>::Iterator it = this->begin(); it != this->end(); ++it) {
|
for (typename IndexedRingMemoryArray<T>::Iterator it = this->begin(); it != this->end(); ++it) {
|
||||||
if (*(cmp.value) == *(it.value)) {
|
if (*(cmp.value) == *(it.value)) {
|
||||||
currentWriteBlock = it;
|
currentWriteBlock = it;
|
||||||
return HasReturnvaluesIF::RETURN_OK;
|
return returnvalue::OK;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// Reached if current write block iterator is not found
|
// Reached if current write block iterator is not found
|
||||||
return HasReturnvaluesIF::RETURN_FAILED;
|
return returnvalue::FAILED;
|
||||||
}
|
}
|
||||||
|
|
||||||
uint32_t getIndexAddress() const { return indexAddress; }
|
uint32_t getIndexAddress() const { return indexAddress; }
|
||||||
|
@ -40,7 +40,7 @@ class PlacementFactory {
|
|||||||
store_address_t tempId;
|
store_address_t tempId;
|
||||||
uint8_t* pData = nullptr;
|
uint8_t* pData = nullptr;
|
||||||
ReturnValue_t result = dataBackend->getFreeElement(&tempId, sizeof(T), &pData);
|
ReturnValue_t result = dataBackend->getFreeElement(&tempId, sizeof(T), &pData);
|
||||||
if (result != HasReturnvaluesIF::RETURN_OK) {
|
if (result != returnvalue::OK) {
|
||||||
return nullptr;
|
return nullptr;
|
||||||
}
|
}
|
||||||
T* temp = new (pData) T(std::forward<Args>(args)...);
|
T* temp = new (pData) T(std::forward<Args>(args)...);
|
||||||
@ -51,12 +51,12 @@ class PlacementFactory {
|
|||||||
* This must be called by the user.
|
* This must be called by the user.
|
||||||
*
|
*
|
||||||
* @param thisElement Element to be destroyed
|
* @param thisElement Element to be destroyed
|
||||||
* @return RETURN_OK if the element was destroyed, different errors on failure
|
* @return returnvalue::OK if the element was destroyed, different errors on failure
|
||||||
*/
|
*/
|
||||||
template <typename T>
|
template <typename T>
|
||||||
ReturnValue_t destroy(T* thisElement) {
|
ReturnValue_t destroy(T* thisElement) {
|
||||||
if (thisElement == nullptr) {
|
if (thisElement == nullptr) {
|
||||||
return HasReturnvaluesIF::RETURN_FAILED;
|
return returnvalue::FAILED;
|
||||||
}
|
}
|
||||||
// Need to call destructor first, in case something was allocated by the object (shouldn't do
|
// Need to call destructor first, in case something was allocated by the object (shouldn't do
|
||||||
// that, however).
|
// that, however).
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
|
|
||||||
#include <cstddef>
|
#include <cstddef>
|
||||||
|
|
||||||
#include "../returnvalues/HasReturnvaluesIF.h"
|
#include "../returnvalues/returnvalue.h"
|
||||||
|
|
||||||
template <uint8_t N_READ_PTRS = 1>
|
template <uint8_t N_READ_PTRS = 1>
|
||||||
class RingBufferBase {
|
class RingBufferBase {
|
||||||
@ -58,18 +58,18 @@ class RingBufferBase {
|
|||||||
ReturnValue_t readData(uint32_t amount, uint8_t n = 0) {
|
ReturnValue_t readData(uint32_t amount, uint8_t n = 0) {
|
||||||
if (getAvailableReadData(n) >= amount) {
|
if (getAvailableReadData(n) >= amount) {
|
||||||
incrementRead(amount, n);
|
incrementRead(amount, n);
|
||||||
return HasReturnvaluesIF::RETURN_OK;
|
return returnvalue::OK;
|
||||||
} else {
|
} else {
|
||||||
return HasReturnvaluesIF::RETURN_FAILED;
|
return returnvalue::FAILED;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
ReturnValue_t writeData(uint32_t amount) {
|
ReturnValue_t writeData(uint32_t amount) {
|
||||||
if (availableWriteSpace() >= amount or overwriteOld) {
|
if (availableWriteSpace() >= amount or overwriteOld) {
|
||||||
incrementWrite(amount);
|
incrementWrite(amount);
|
||||||
return HasReturnvaluesIF::RETURN_OK;
|
return returnvalue::OK;
|
||||||
} else {
|
} else {
|
||||||
return HasReturnvaluesIF::RETURN_FAILED;
|
return returnvalue::FAILED;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2,6 +2,9 @@
|
|||||||
|
|
||||||
#include <cstring>
|
#include <cstring>
|
||||||
|
|
||||||
|
#include "fsfw/FSFW.h"
|
||||||
|
#include "fsfw/serviceinterface.h"
|
||||||
|
|
||||||
SimpleRingBuffer::SimpleRingBuffer(const size_t size, bool overwriteOld, size_t maxExcessBytes)
|
SimpleRingBuffer::SimpleRingBuffer(const size_t size, bool overwriteOld, size_t maxExcessBytes)
|
||||||
: RingBufferBase<>(0, size, overwriteOld), maxExcessBytes(maxExcessBytes) {
|
: RingBufferBase<>(0, size, overwriteOld), maxExcessBytes(maxExcessBytes) {
|
||||||
if (maxExcessBytes > size) {
|
if (maxExcessBytes > size) {
|
||||||
@ -29,14 +32,14 @@ ReturnValue_t SimpleRingBuffer::getFreeElement(uint8_t** writePointer, size_t am
|
|||||||
size_t amountTillWrap = writeTillWrap();
|
size_t amountTillWrap = writeTillWrap();
|
||||||
if (amountTillWrap < amount) {
|
if (amountTillWrap < amount) {
|
||||||
if ((amount - amountTillWrap + excessBytes) > maxExcessBytes) {
|
if ((amount - amountTillWrap + excessBytes) > maxExcessBytes) {
|
||||||
return HasReturnvaluesIF::RETURN_FAILED;
|
return returnvalue::FAILED;
|
||||||
}
|
}
|
||||||
excessBytes = amount - amountTillWrap;
|
excessBytes = amount - amountTillWrap;
|
||||||
}
|
}
|
||||||
*writePointer = &buffer[write];
|
*writePointer = &buffer[write];
|
||||||
return HasReturnvaluesIF::RETURN_OK;
|
return returnvalue::OK;
|
||||||
} else {
|
} else {
|
||||||
return HasReturnvaluesIF::RETURN_FAILED;
|
return returnvalue::FAILED;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -48,6 +51,19 @@ void SimpleRingBuffer::confirmBytesWritten(size_t amount) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
ReturnValue_t SimpleRingBuffer::writeData(const uint8_t* data, size_t amount) {
|
ReturnValue_t SimpleRingBuffer::writeData(const uint8_t* data, size_t amount) {
|
||||||
|
if (data == nullptr) {
|
||||||
|
return returnvalue::FAILED;
|
||||||
|
}
|
||||||
|
if (amount > getMaxSize()) {
|
||||||
|
#if FSFW_VERBOSE_LEVEL >= 1
|
||||||
|
#if FSFW_CPP_OSTREAM_ENABLED == 1
|
||||||
|
sif::error << "SimpleRingBuffer::writeData: Amount of data too large" << std::endl;
|
||||||
|
#else
|
||||||
|
sif::printError("SimpleRingBuffer::writeData: Amount of data too large\n");
|
||||||
|
#endif
|
||||||
|
#endif
|
||||||
|
return returnvalue::FAILED;
|
||||||
|
}
|
||||||
if (availableWriteSpace() >= amount or overwriteOld) {
|
if (availableWriteSpace() >= amount or overwriteOld) {
|
||||||
size_t amountTillWrap = writeTillWrap();
|
size_t amountTillWrap = writeTillWrap();
|
||||||
if (amountTillWrap >= amount) {
|
if (amountTillWrap >= amount) {
|
||||||
@ -58,9 +74,9 @@ ReturnValue_t SimpleRingBuffer::writeData(const uint8_t* data, size_t amount) {
|
|||||||
memcpy(buffer, data + amountTillWrap, amount - amountTillWrap);
|
memcpy(buffer, data + amountTillWrap, amount - amountTillWrap);
|
||||||
}
|
}
|
||||||
incrementWrite(amount);
|
incrementWrite(amount);
|
||||||
return HasReturnvaluesIF::RETURN_OK;
|
return returnvalue::OK;
|
||||||
} else {
|
} else {
|
||||||
return HasReturnvaluesIF::RETURN_FAILED;
|
return returnvalue::FAILED;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -73,7 +89,7 @@ ReturnValue_t SimpleRingBuffer::readData(uint8_t* data, size_t amount, bool incr
|
|||||||
// more data available than amount specified.
|
// more data available than amount specified.
|
||||||
amount = availableData;
|
amount = availableData;
|
||||||
} else {
|
} else {
|
||||||
return HasReturnvaluesIF::RETURN_FAILED;
|
return returnvalue::FAILED;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (trueAmount != nullptr) {
|
if (trueAmount != nullptr) {
|
||||||
@ -89,7 +105,7 @@ ReturnValue_t SimpleRingBuffer::readData(uint8_t* data, size_t amount, bool incr
|
|||||||
if (incrementReadPtr) {
|
if (incrementReadPtr) {
|
||||||
deleteData(amount, readRemaining);
|
deleteData(amount, readRemaining);
|
||||||
}
|
}
|
||||||
return HasReturnvaluesIF::RETURN_OK;
|
return returnvalue::OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
size_t SimpleRingBuffer::getExcessBytes() const { return excessBytes; }
|
size_t SimpleRingBuffer::getExcessBytes() const { return excessBytes; }
|
||||||
@ -108,12 +124,12 @@ ReturnValue_t SimpleRingBuffer::deleteData(size_t amount, bool deleteRemaining,
|
|||||||
if (deleteRemaining) {
|
if (deleteRemaining) {
|
||||||
amount = availableData;
|
amount = availableData;
|
||||||
} else {
|
} else {
|
||||||
return HasReturnvaluesIF::RETURN_FAILED;
|
return returnvalue::FAILED;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (trueAmount != nullptr) {
|
if (trueAmount != nullptr) {
|
||||||
*trueAmount = amount;
|
*trueAmount = amount;
|
||||||
}
|
}
|
||||||
incrementRead(amount, READ_PTR);
|
incrementRead(amount, READ_PTR);
|
||||||
return HasReturnvaluesIF::RETURN_OK;
|
return returnvalue::OK;
|
||||||
}
|
}
|
||||||
|
@ -47,8 +47,8 @@ class SimpleRingBuffer : public RingBufferBase<> {
|
|||||||
* Write to circular buffer and increment write pointer by amount.
|
* Write to circular buffer and increment write pointer by amount.
|
||||||
* @param data
|
* @param data
|
||||||
* @param amount
|
* @param amount
|
||||||
* @return -@c RETURN_OK if write operation was successful
|
* @return -@c returnvalue::OK if write operation was successful
|
||||||
* -@c RETURN_FAILED if
|
* -@c returnvalue::FAILED if
|
||||||
*/
|
*/
|
||||||
ReturnValue_t writeData(const uint8_t* data, size_t amount);
|
ReturnValue_t writeData(const uint8_t* data, size_t amount);
|
||||||
|
|
||||||
@ -95,8 +95,8 @@ class SimpleRingBuffer : public RingBufferBase<> {
|
|||||||
* If readRemaining was set to true, the true amount read will be assigned
|
* If readRemaining was set to true, the true amount read will be assigned
|
||||||
* to the passed value.
|
* to the passed value.
|
||||||
* @return
|
* @return
|
||||||
* - @c RETURN_OK if data was read successfully
|
* - @c returnvalue::OK if data was read successfully
|
||||||
* - @c RETURN_FAILED if not enough data was available and readRemaining
|
* - @c returnvalue::FAILED if not enough data was available and readRemaining
|
||||||
* was set to false.
|
* was set to false.
|
||||||
*/
|
*/
|
||||||
ReturnValue_t readData(uint8_t* data, size_t amount, bool incrementReadPtr = false,
|
ReturnValue_t readData(uint8_t* data, size_t amount, bool incrementReadPtr = false,
|
||||||
|
@ -20,7 +20,7 @@ ControllerBase::~ControllerBase() { QueueFactory::instance()->deleteMessageQueue
|
|||||||
|
|
||||||
ReturnValue_t ControllerBase::initialize() {
|
ReturnValue_t ControllerBase::initialize() {
|
||||||
ReturnValue_t result = SystemObject::initialize();
|
ReturnValue_t result = SystemObject::initialize();
|
||||||
if (result != RETURN_OK) {
|
if (result != returnvalue::OK) {
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -28,7 +28,7 @@ ReturnValue_t ControllerBase::initialize() {
|
|||||||
if (parentId != objects::NO_OBJECT) {
|
if (parentId != objects::NO_OBJECT) {
|
||||||
auto* parent = ObjectManager::instance()->get<SubsystemBase>(parentId);
|
auto* parent = ObjectManager::instance()->get<SubsystemBase>(parentId);
|
||||||
if (parent == nullptr) {
|
if (parent == nullptr) {
|
||||||
return RETURN_FAILED;
|
return returnvalue::FAILED;
|
||||||
}
|
}
|
||||||
parentQueue = parent->getCommandQueue();
|
parentQueue = parent->getCommandQueue();
|
||||||
|
|
||||||
@ -36,16 +36,16 @@ ReturnValue_t ControllerBase::initialize() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
result = healthHelper.initialize(parentQueue);
|
result = healthHelper.initialize(parentQueue);
|
||||||
if (result != RETURN_OK) {
|
if (result != returnvalue::OK) {
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
result = modeHelper.initialize(parentQueue);
|
result = modeHelper.initialize(parentQueue);
|
||||||
if (result != RETURN_OK) {
|
if (result != returnvalue::OK) {
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
return RETURN_OK;
|
return returnvalue::OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
MessageQueueId_t ControllerBase::getCommandQueue() const { return commandQueue->getId(); }
|
MessageQueueId_t ControllerBase::getCommandQueue() const { return commandQueue->getId(); }
|
||||||
@ -53,19 +53,19 @@ MessageQueueId_t ControllerBase::getCommandQueue() const { return commandQueue->
|
|||||||
void ControllerBase::handleQueue() {
|
void ControllerBase::handleQueue() {
|
||||||
CommandMessage command;
|
CommandMessage command;
|
||||||
ReturnValue_t result;
|
ReturnValue_t result;
|
||||||
for (result = commandQueue->receiveMessage(&command); result == RETURN_OK;
|
for (result = commandQueue->receiveMessage(&command); result == returnvalue::OK;
|
||||||
result = commandQueue->receiveMessage(&command)) {
|
result = commandQueue->receiveMessage(&command)) {
|
||||||
result = modeHelper.handleModeCommand(&command);
|
result = modeHelper.handleModeCommand(&command);
|
||||||
if (result == RETURN_OK) {
|
if (result == returnvalue::OK) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
result = healthHelper.handleHealthCommand(&command);
|
result = healthHelper.handleHealthCommand(&command);
|
||||||
if (result == RETURN_OK) {
|
if (result == returnvalue::OK) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
result = handleCommandMessage(&command);
|
result = handleCommandMessage(&command);
|
||||||
if (result == RETURN_OK) {
|
if (result == returnvalue::OK) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
command.setToUnknownCommand();
|
command.setToUnknownCommand();
|
||||||
@ -96,7 +96,7 @@ void ControllerBase::announceMode(bool recursive) { triggerEvent(MODE_INFO, mode
|
|||||||
ReturnValue_t ControllerBase::performOperation(uint8_t opCode) {
|
ReturnValue_t ControllerBase::performOperation(uint8_t opCode) {
|
||||||
handleQueue();
|
handleQueue();
|
||||||
performControlOperation();
|
performControlOperation();
|
||||||
return RETURN_OK;
|
return returnvalue::OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
void ControllerBase::modeChanged(Mode_t mode_, Submode_t submode_) {}
|
void ControllerBase::modeChanged(Mode_t mode_, Submode_t submode_) {}
|
||||||
@ -106,7 +106,7 @@ ReturnValue_t ControllerBase::setHealth(HealthState health) {
|
|||||||
case HEALTHY:
|
case HEALTHY:
|
||||||
case EXTERNAL_CONTROL:
|
case EXTERNAL_CONTROL:
|
||||||
healthHelper.setHealth(health);
|
healthHelper.setHealth(health);
|
||||||
return RETURN_OK;
|
return returnvalue::OK;
|
||||||
default:
|
default:
|
||||||
return INVALID_HEALTH_STATE;
|
return INVALID_HEALTH_STATE;
|
||||||
}
|
}
|
||||||
@ -117,4 +117,4 @@ void ControllerBase::setTaskIF(PeriodicTaskIF* task_) { executingTask = task_; }
|
|||||||
|
|
||||||
void ControllerBase::changeHK(Mode_t mode_, Submode_t submode_, bool enable) {}
|
void ControllerBase::changeHK(Mode_t mode_, Submode_t submode_, bool enable) {}
|
||||||
|
|
||||||
ReturnValue_t ControllerBase::initializeAfterTaskCreation() { return HasReturnvaluesIF::RETURN_OK; }
|
ReturnValue_t ControllerBase::initializeAfterTaskCreation() { return returnvalue::OK; }
|
||||||
|
@ -18,8 +18,7 @@
|
|||||||
class ControllerBase : public HasModesIF,
|
class ControllerBase : public HasModesIF,
|
||||||
public HasHealthIF,
|
public HasHealthIF,
|
||||||
public ExecutableObjectIF,
|
public ExecutableObjectIF,
|
||||||
public SystemObject,
|
public SystemObject {
|
||||||
public HasReturnvaluesIF {
|
|
||||||
public:
|
public:
|
||||||
static const Mode_t MODE_NORMAL = 2;
|
static const Mode_t MODE_NORMAL = 2;
|
||||||
|
|
||||||
|
@ -12,7 +12,7 @@ ReturnValue_t ExtendedControllerBase::executeAction(ActionId_t actionId,
|
|||||||
MessageQueueId_t commandedBy,
|
MessageQueueId_t commandedBy,
|
||||||
const uint8_t *data, size_t size) {
|
const uint8_t *data, size_t size) {
|
||||||
/* Needs to be overriden and implemented by child class. */
|
/* Needs to be overriden and implemented by child class. */
|
||||||
return HasReturnvaluesIF::RETURN_OK;
|
return returnvalue::OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
object_id_t ExtendedControllerBase::getObjectId() const { return SystemObject::getObjectId(); }
|
object_id_t ExtendedControllerBase::getObjectId() const { return SystemObject::getObjectId(); }
|
||||||
@ -23,7 +23,7 @@ uint32_t ExtendedControllerBase::getPeriodicOperationFrequency() const {
|
|||||||
|
|
||||||
ReturnValue_t ExtendedControllerBase::handleCommandMessage(CommandMessage *message) {
|
ReturnValue_t ExtendedControllerBase::handleCommandMessage(CommandMessage *message) {
|
||||||
ReturnValue_t result = actionHelper.handleActionMessage(message);
|
ReturnValue_t result = actionHelper.handleActionMessage(message);
|
||||||
if (result == HasReturnvaluesIF::RETURN_OK) {
|
if (result == returnvalue::OK) {
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
return poolManager.handleHousekeepingMessage(message);
|
return poolManager.handleHousekeepingMessage(message);
|
||||||
@ -32,30 +32,30 @@ ReturnValue_t ExtendedControllerBase::handleCommandMessage(CommandMessage *messa
|
|||||||
void ExtendedControllerBase::handleQueue() {
|
void ExtendedControllerBase::handleQueue() {
|
||||||
CommandMessage command;
|
CommandMessage command;
|
||||||
ReturnValue_t result;
|
ReturnValue_t result;
|
||||||
for (result = commandQueue->receiveMessage(&command); result == RETURN_OK;
|
for (result = commandQueue->receiveMessage(&command); result == returnvalue::OK;
|
||||||
result = commandQueue->receiveMessage(&command)) {
|
result = commandQueue->receiveMessage(&command)) {
|
||||||
result = actionHelper.handleActionMessage(&command);
|
result = actionHelper.handleActionMessage(&command);
|
||||||
if (result == RETURN_OK) {
|
if (result == returnvalue::OK) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
result = modeHelper.handleModeCommand(&command);
|
result = modeHelper.handleModeCommand(&command);
|
||||||
if (result == RETURN_OK) {
|
if (result == returnvalue::OK) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
result = healthHelper.handleHealthCommand(&command);
|
result = healthHelper.handleHealthCommand(&command);
|
||||||
if (result == RETURN_OK) {
|
if (result == returnvalue::OK) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
result = poolManager.handleHousekeepingMessage(&command);
|
result = poolManager.handleHousekeepingMessage(&command);
|
||||||
if (result == RETURN_OK) {
|
if (result == returnvalue::OK) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
result = handleCommandMessage(&command);
|
result = handleCommandMessage(&command);
|
||||||
if (result == RETURN_OK) {
|
if (result == returnvalue::OK) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
command.setToUnknownCommand();
|
command.setToUnknownCommand();
|
||||||
@ -65,11 +65,11 @@ void ExtendedControllerBase::handleQueue() {
|
|||||||
|
|
||||||
ReturnValue_t ExtendedControllerBase::initialize() {
|
ReturnValue_t ExtendedControllerBase::initialize() {
|
||||||
ReturnValue_t result = ControllerBase::initialize();
|
ReturnValue_t result = ControllerBase::initialize();
|
||||||
if (result != HasReturnvaluesIF::RETURN_OK) {
|
if (result != returnvalue::OK) {
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
result = actionHelper.initialize(commandQueue);
|
result = actionHelper.initialize(commandQueue);
|
||||||
if (result != HasReturnvaluesIF::RETURN_OK) {
|
if (result != returnvalue::OK) {
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -86,7 +86,7 @@ ReturnValue_t ExtendedControllerBase::performOperation(uint8_t opCode) {
|
|||||||
/* We do this after performing control operation because variables will be set changed
|
/* We do this after performing control operation because variables will be set changed
|
||||||
in this function. */
|
in this function. */
|
||||||
poolManager.performHkOperation();
|
poolManager.performHkOperation();
|
||||||
return RETURN_OK;
|
return returnvalue::OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
MessageQueueId_t ExtendedControllerBase::getCommandQueue() const { return commandQueue->getId(); }
|
MessageQueueId_t ExtendedControllerBase::getCommandQueue() const { return commandQueue->getId(); }
|
||||||
|
@ -152,7 +152,7 @@ ReturnValue_t Sgp4Propagator::initialize(const uint8_t* line1, const uint8_t* li
|
|||||||
return MAKE_RETURN_CODE(result);
|
return MAKE_RETURN_CODE(result);
|
||||||
} else {
|
} else {
|
||||||
initialized = true;
|
initialized = true;
|
||||||
return HasReturnvaluesIF::RETURN_OK;
|
return returnvalue::OK;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -195,6 +195,6 @@ ReturnValue_t Sgp4Propagator::propagate(double* position, double* velocity, time
|
|||||||
if (result != 0) {
|
if (result != 0) {
|
||||||
return MAKE_RETURN_CODE(result || 0xB0);
|
return MAKE_RETURN_CODE(result || 0xB0);
|
||||||
} else {
|
} else {
|
||||||
return HasReturnvaluesIF::RETURN_OK;
|
return returnvalue::OK;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -7,7 +7,7 @@
|
|||||||
#ifndef PLATFORM_WIN
|
#ifndef PLATFORM_WIN
|
||||||
#include <sys/time.h>
|
#include <sys/time.h>
|
||||||
#endif
|
#endif
|
||||||
#include "fsfw/returnvalues/HasReturnvaluesIF.h"
|
#include "fsfw/returnvalues/returnvalue.h"
|
||||||
#include "fsfw_contrib/sgp4/sgp4unit.h"
|
#include "fsfw_contrib/sgp4/sgp4unit.h"
|
||||||
|
|
||||||
class Sgp4Propagator {
|
class Sgp4Propagator {
|
||||||
|
@ -9,12 +9,12 @@
|
|||||||
#define CCSDSRETURNVALUESIF_H_
|
#define CCSDSRETURNVALUESIF_H_
|
||||||
|
|
||||||
#include "dllConf.h"
|
#include "dllConf.h"
|
||||||
#include "fsfw/returnvalues/HasReturnvaluesIF.h"
|
#include "fsfw/returnvalues/returnvalue.h"
|
||||||
/**
|
/**
|
||||||
* This is a helper class to collect special return values that come up during CCSDS Handling.
|
* This is a helper class to collect special return values that come up during CCSDS Handling.
|
||||||
* @ingroup ccsds_handling
|
* @ingroup ccsds_handling
|
||||||
*/
|
*/
|
||||||
class CCSDSReturnValuesIF : public HasReturnvaluesIF {
|
class CCSDSReturnValuesIF {
|
||||||
public:
|
public:
|
||||||
static const uint8_t INTERFACE_ID = CLASS_ID::CCSDS_HANDLER_IF; //!< Basic ID of the interface.
|
static const uint8_t INTERFACE_ID = CLASS_ID::CCSDS_HANDLER_IF; //!< Basic ID of the interface.
|
||||||
|
|
||||||
|
@ -28,7 +28,7 @@ ReturnValue_t DataLinkLayer::frameDelimitingAndFillRemoval() {
|
|||||||
TcTransferFrame frame_candidate(frameBuffer);
|
TcTransferFrame frame_candidate(frameBuffer);
|
||||||
this->currentFrame = frame_candidate; // should work with shallow copy.
|
this->currentFrame = frame_candidate; // should work with shallow copy.
|
||||||
|
|
||||||
return RETURN_OK;
|
return returnvalue::OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
ReturnValue_t DataLinkLayer::frameValidationCheck() {
|
ReturnValue_t DataLinkLayer::frameValidationCheck() {
|
||||||
@ -59,14 +59,14 @@ ReturnValue_t DataLinkLayer::frameValidationCheck() {
|
|||||||
if (USE_CRC) {
|
if (USE_CRC) {
|
||||||
return this->frameCheckCRC();
|
return this->frameCheckCRC();
|
||||||
}
|
}
|
||||||
return RETURN_OK;
|
return returnvalue::OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
ReturnValue_t DataLinkLayer::frameCheckCRC() {
|
ReturnValue_t DataLinkLayer::frameCheckCRC() {
|
||||||
uint16_t checkValue =
|
uint16_t checkValue =
|
||||||
CRC::crc16ccitt(this->currentFrame.getFullFrame(), this->currentFrame.getFullSize());
|
CRC::crc16ccitt(this->currentFrame.getFullFrame(), this->currentFrame.getFullSize());
|
||||||
if (checkValue == 0) {
|
if (checkValue == 0) {
|
||||||
return RETURN_OK;
|
return returnvalue::OK;
|
||||||
} else {
|
} else {
|
||||||
return CRC_FAILED;
|
return CRC_FAILED;
|
||||||
}
|
}
|
||||||
@ -74,7 +74,7 @@ ReturnValue_t DataLinkLayer::frameCheckCRC() {
|
|||||||
|
|
||||||
ReturnValue_t DataLinkLayer::allFramesReception() {
|
ReturnValue_t DataLinkLayer::allFramesReception() {
|
||||||
ReturnValue_t status = this->frameDelimitingAndFillRemoval();
|
ReturnValue_t status = this->frameDelimitingAndFillRemoval();
|
||||||
if (status != RETURN_OK) {
|
if (status != returnvalue::OK) {
|
||||||
return status;
|
return status;
|
||||||
}
|
}
|
||||||
return this->frameValidationCheck();
|
return this->frameValidationCheck();
|
||||||
@ -90,7 +90,7 @@ ReturnValue_t DataLinkLayer::virtualChannelDemultiplexing() {
|
|||||||
virtualChannelIterator iter = virtualChannels.find(vcId);
|
virtualChannelIterator iter = virtualChannels.find(vcId);
|
||||||
if (iter == virtualChannels.end()) {
|
if (iter == virtualChannels.end()) {
|
||||||
// Do not report because passive board will get this error all the time.
|
// Do not report because passive board will get this error all the time.
|
||||||
return RETURN_OK;
|
return returnvalue::OK;
|
||||||
} else {
|
} else {
|
||||||
return (iter->second)->frameAcceptanceAndReportingMechanism(¤tFrame, clcw);
|
return (iter->second)->frameAcceptanceAndReportingMechanism(¤tFrame, clcw);
|
||||||
}
|
}
|
||||||
@ -99,7 +99,7 @@ ReturnValue_t DataLinkLayer::virtualChannelDemultiplexing() {
|
|||||||
ReturnValue_t DataLinkLayer::processFrame(uint16_t length) {
|
ReturnValue_t DataLinkLayer::processFrame(uint16_t length) {
|
||||||
receivedDataLength = length;
|
receivedDataLength = length;
|
||||||
ReturnValue_t status = allFramesReception();
|
ReturnValue_t status = allFramesReception();
|
||||||
if (status != RETURN_OK) {
|
if (status != returnvalue::OK) {
|
||||||
#if FSFW_CPP_OSTREAM_ENABLED == 1
|
#if FSFW_CPP_OSTREAM_ENABLED == 1
|
||||||
sif::error << "DataLinkLayer::processFrame: frame reception failed. "
|
sif::error << "DataLinkLayer::processFrame: frame reception failed. "
|
||||||
"Error code: "
|
"Error code: "
|
||||||
@ -117,14 +117,14 @@ ReturnValue_t DataLinkLayer::addVirtualChannel(uint8_t virtualChannelId,
|
|||||||
std::pair<virtualChannelIterator, bool> returnValue = virtualChannels.insert(
|
std::pair<virtualChannelIterator, bool> returnValue = virtualChannels.insert(
|
||||||
std::pair<uint8_t, VirtualChannelReceptionIF*>(virtualChannelId, object));
|
std::pair<uint8_t, VirtualChannelReceptionIF*>(virtualChannelId, object));
|
||||||
if (returnValue.second == true) {
|
if (returnValue.second == true) {
|
||||||
return RETURN_OK;
|
return returnvalue::OK;
|
||||||
} else {
|
} else {
|
||||||
return RETURN_FAILED;
|
return returnvalue::FAILED;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
ReturnValue_t DataLinkLayer::initialize() {
|
ReturnValue_t DataLinkLayer::initialize() {
|
||||||
ReturnValue_t returnValue = RETURN_FAILED;
|
ReturnValue_t returnValue = returnvalue::FAILED;
|
||||||
// Set Virtual Channel ID to first virtual channel instance in this DataLinkLayer instance to
|
// Set Virtual Channel ID to first virtual channel instance in this DataLinkLayer instance to
|
||||||
// avoid faulty information (e.g. 0) in the VCID.
|
// avoid faulty information (e.g. 0) in the VCID.
|
||||||
if (virtualChannels.begin() != virtualChannels.end()) {
|
if (virtualChannels.begin() != virtualChannels.end()) {
|
||||||
@ -133,13 +133,13 @@ ReturnValue_t DataLinkLayer::initialize() {
|
|||||||
#if FSFW_CPP_OSTREAM_ENABLED == 1
|
#if FSFW_CPP_OSTREAM_ENABLED == 1
|
||||||
sif::error << "DataLinkLayer::initialize: No VC assigned to this DLL instance! " << std::endl;
|
sif::error << "DataLinkLayer::initialize: No VC assigned to this DLL instance! " << std::endl;
|
||||||
#endif
|
#endif
|
||||||
return RETURN_FAILED;
|
return returnvalue::FAILED;
|
||||||
}
|
}
|
||||||
|
|
||||||
for (virtualChannelIterator iterator = virtualChannels.begin(); iterator != virtualChannels.end();
|
for (virtualChannelIterator iterator = virtualChannels.begin(); iterator != virtualChannels.end();
|
||||||
iterator++) {
|
iterator++) {
|
||||||
returnValue = iterator->second->initialize();
|
returnValue = iterator->second->initialize();
|
||||||
if (returnValue != RETURN_OK) break;
|
if (returnValue != returnvalue::OK) break;
|
||||||
}
|
}
|
||||||
return returnValue;
|
return returnValue;
|
||||||
}
|
}
|
||||||
|
@ -51,7 +51,7 @@ class DataLinkLayer : public CCSDSReturnValuesIF {
|
|||||||
* This method tries to process a frame that is placed in #frameBuffer.
|
* This method tries to process a frame that is placed in #frameBuffer.
|
||||||
* The procedures described in the Standard are performed.
|
* The procedures described in the Standard are performed.
|
||||||
* @param length Length of the incoming frame candidate.
|
* @param length Length of the incoming frame candidate.
|
||||||
* @return @c RETURN_OK on successful handling, otherwise the return codes of the higher
|
* @return @c returnvalue::OK on successful handling, otherwise the return codes of the higher
|
||||||
* methods.
|
* methods.
|
||||||
*/
|
*/
|
||||||
ReturnValue_t processFrame(uint16_t length);
|
ReturnValue_t processFrame(uint16_t length);
|
||||||
@ -61,12 +61,12 @@ class DataLinkLayer : public CCSDSReturnValuesIF {
|
|||||||
* handle Frames directed to this VC.
|
* handle Frames directed to this VC.
|
||||||
* @param virtualChannelId Id of the VC. Shall be smaller than 64.
|
* @param virtualChannelId Id of the VC. Shall be smaller than 64.
|
||||||
* @param object Reference to the object that handles the Frame.
|
* @param object Reference to the object that handles the Frame.
|
||||||
* @return @c RETURN_OK on success, @c RETURN_FAILED otherwise.
|
* @return @c returnvalue::OK on success, @c returnvalue::FAILED otherwise.
|
||||||
*/
|
*/
|
||||||
ReturnValue_t addVirtualChannel(uint8_t virtualChannelId, VirtualChannelReceptionIF* object);
|
ReturnValue_t addVirtualChannel(uint8_t virtualChannelId, VirtualChannelReceptionIF* object);
|
||||||
/**
|
/**
|
||||||
* The initialization method calls the @c initialize routine of all virtual channels.
|
* The initialization method calls the @c initialize routine of all virtual channels.
|
||||||
* @return The return code of the first failed VC initialization or @c RETURN_OK.
|
* @return The return code of the first failed VC initialization or @c returnvalue::OK.
|
||||||
*/
|
*/
|
||||||
ReturnValue_t initialize();
|
ReturnValue_t initialize();
|
||||||
|
|
||||||
@ -91,19 +91,19 @@ class DataLinkLayer : public CCSDSReturnValuesIF {
|
|||||||
virtualChannels; //!< Map of all virtual channels assigned.
|
virtualChannels; //!< Map of all virtual channels assigned.
|
||||||
/**
|
/**
|
||||||
* Method that performs all possible frame validity checks (as specified).
|
* Method that performs all possible frame validity checks (as specified).
|
||||||
* @return Various error codes or @c RETURN_OK on success.
|
* @return Various error codes or @c returnvalue::OK on success.
|
||||||
*/
|
*/
|
||||||
ReturnValue_t frameValidationCheck();
|
ReturnValue_t frameValidationCheck();
|
||||||
/**
|
/**
|
||||||
* First method to call.
|
* First method to call.
|
||||||
* Removes start sequence bytes and checks if the complete frame was received.
|
* Removes start sequence bytes and checks if the complete frame was received.
|
||||||
* SHOULDDO: Maybe handling the start sequence must be done more variable.
|
* SHOULDDO: Maybe handling the start sequence must be done more variable.
|
||||||
* @return @c RETURN_OK or @c TOO_SHORT.
|
* @return @c returnvalue::OK or @c TOO_SHORT.
|
||||||
*/
|
*/
|
||||||
ReturnValue_t frameDelimitingAndFillRemoval();
|
ReturnValue_t frameDelimitingAndFillRemoval();
|
||||||
/**
|
/**
|
||||||
* Small helper method to check the CRC of the Frame.
|
* Small helper method to check the CRC of the Frame.
|
||||||
* @return @c RETURN_OK or @c CRC_FAILED.
|
* @return @c returnvalue::OK or @c CRC_FAILED.
|
||||||
*/
|
*/
|
||||||
ReturnValue_t frameCheckCRC();
|
ReturnValue_t frameCheckCRC();
|
||||||
/**
|
/**
|
||||||
|
@ -11,7 +11,7 @@ ReturnValue_t Farm1StateOpen::handleADFrame(TcTransferFrame* frame, ClcwIF* clcw
|
|||||||
if (diff == 0) {
|
if (diff == 0) {
|
||||||
myVC->vR++;
|
myVC->vR++;
|
||||||
clcw->setRetransmitFlag(false);
|
clcw->setRetransmitFlag(false);
|
||||||
return RETURN_OK;
|
return returnvalue::OK;
|
||||||
} else if (diff < myVC->positiveWindow && diff > 0) {
|
} else if (diff < myVC->positiveWindow && diff > 0) {
|
||||||
clcw->setRetransmitFlag(true);
|
clcw->setRetransmitFlag(true);
|
||||||
return NS_POSITIVE_W;
|
return NS_POSITIVE_W;
|
||||||
|
@ -37,8 +37,8 @@ class Farm1StateOpen : public Farm1StateIF {
|
|||||||
* change to Farm1StateLockout.
|
* change to Farm1StateLockout.
|
||||||
* @param frame The frame to handle.
|
* @param frame The frame to handle.
|
||||||
* @param clcw Any changes to the CLCW shall be done with the help of this interface.
|
* @param clcw Any changes to the CLCW shall be done with the help of this interface.
|
||||||
* @return If the Sequence Number is ok, it returns #RETURN_OK. Otherwise either #NS_POSITIVE_W,
|
* @return If the Sequence Number is ok, it returns returnvalue::OK. Otherwise either
|
||||||
* #NS_NEGATIVE_W or NS_LOCKOUT is returned.
|
* #NS_POSITIVE_W, #NS_NEGATIVE_W or NS_LOCKOUT is returned.
|
||||||
*/
|
*/
|
||||||
ReturnValue_t handleADFrame(TcTransferFrame* frame, ClcwIF* clcw);
|
ReturnValue_t handleADFrame(TcTransferFrame* frame, ClcwIF* clcw);
|
||||||
/**
|
/**
|
||||||
|
@ -6,7 +6,7 @@
|
|||||||
#include "fsfw/objectmanager/ObjectManager.h"
|
#include "fsfw/objectmanager/ObjectManager.h"
|
||||||
#include "fsfw/serviceinterface/ServiceInterface.h"
|
#include "fsfw/serviceinterface/ServiceInterface.h"
|
||||||
#include "fsfw/storagemanager/StorageManagerIF.h"
|
#include "fsfw/storagemanager/StorageManagerIF.h"
|
||||||
#include "fsfw/tmtcpacket/SpacePacketBase.h"
|
#include "fsfw/tmtcpacket/ccsds/SpacePacketReader.h"
|
||||||
#include "fsfw/tmtcservices/AcceptsTelecommandsIF.h"
|
#include "fsfw/tmtcservices/AcceptsTelecommandsIF.h"
|
||||||
#include "fsfw/tmtcservices/TmTcMessage.h"
|
#include "fsfw/tmtcservices/TmTcMessage.h"
|
||||||
|
|
||||||
@ -31,7 +31,7 @@ ReturnValue_t MapPacketExtraction::extractPackets(TcTransferFrame* frame) {
|
|||||||
if (packetLength <= MAX_PACKET_SIZE) {
|
if (packetLength <= MAX_PACKET_SIZE) {
|
||||||
memcpy(packetBuffer, frame->getDataField(), packetLength);
|
memcpy(packetBuffer, frame->getDataField(), packetLength);
|
||||||
bufferPosition = &packetBuffer[packetLength];
|
bufferPosition = &packetBuffer[packetLength];
|
||||||
status = RETURN_OK;
|
status = returnvalue::OK;
|
||||||
} else {
|
} else {
|
||||||
#if FSFW_CPP_OSTREAM_ENABLED == 1
|
#if FSFW_CPP_OSTREAM_ENABLED == 1
|
||||||
sif::error << "MapPacketExtraction::extractPackets. Packet too large! Size: "
|
sif::error << "MapPacketExtraction::extractPackets. Packet too large! Size: "
|
||||||
@ -52,7 +52,7 @@ ReturnValue_t MapPacketExtraction::extractPackets(TcTransferFrame* frame) {
|
|||||||
status = sendCompletePacket(packetBuffer, packetLength);
|
status = sendCompletePacket(packetBuffer, packetLength);
|
||||||
clearBuffers();
|
clearBuffers();
|
||||||
}
|
}
|
||||||
status = RETURN_OK;
|
status = returnvalue::OK;
|
||||||
} else {
|
} else {
|
||||||
#if FSFW_CPP_OSTREAM_ENABLED == 1
|
#if FSFW_CPP_OSTREAM_ENABLED == 1
|
||||||
sif::error << "MapPacketExtraction::extractPackets. Packet too large! Size: "
|
sif::error << "MapPacketExtraction::extractPackets. Packet too large! Size: "
|
||||||
@ -95,7 +95,7 @@ ReturnValue_t MapPacketExtraction::unpackBlockingPackets(TcTransferFrame* frame)
|
|||||||
status = sendCompletePacket(packet.getWholeData(), packet.getFullSize());
|
status = sendCompletePacket(packet.getWholeData(), packet.getFullSize());
|
||||||
totalLength -= packet.getFullSize();
|
totalLength -= packet.getFullSize();
|
||||||
position += packet.getFullSize();
|
position += packet.getFullSize();
|
||||||
status = RETURN_OK;
|
status = returnvalue::OK;
|
||||||
} else {
|
} else {
|
||||||
status = DATA_CORRUPTED;
|
status = DATA_CORRUPTED;
|
||||||
totalLength = 0;
|
totalLength = 0;
|
||||||
@ -110,7 +110,7 @@ ReturnValue_t MapPacketExtraction::unpackBlockingPackets(TcTransferFrame* frame)
|
|||||||
ReturnValue_t MapPacketExtraction::sendCompletePacket(uint8_t* data, uint32_t size) {
|
ReturnValue_t MapPacketExtraction::sendCompletePacket(uint8_t* data, uint32_t size) {
|
||||||
store_address_t store_id;
|
store_address_t store_id;
|
||||||
ReturnValue_t status = this->packetStore->addData(&store_id, data, size);
|
ReturnValue_t status = this->packetStore->addData(&store_id, data, size);
|
||||||
if (status == RETURN_OK) {
|
if (status == returnvalue::OK) {
|
||||||
TmTcMessage message(store_id);
|
TmTcMessage message(store_id);
|
||||||
status = MessageQueueSenderIF::sendMessage(tcQueueId, &message);
|
status = MessageQueueSenderIF::sendMessage(tcQueueId, &message);
|
||||||
}
|
}
|
||||||
@ -130,9 +130,9 @@ ReturnValue_t MapPacketExtraction::initialize() {
|
|||||||
ObjectManager::instance()->get<AcceptsTelecommandsIF>(packetDestination);
|
ObjectManager::instance()->get<AcceptsTelecommandsIF>(packetDestination);
|
||||||
if ((packetStore != NULL) && (distributor != NULL)) {
|
if ((packetStore != NULL) && (distributor != NULL)) {
|
||||||
tcQueueId = distributor->getRequestQueue();
|
tcQueueId = distributor->getRequestQueue();
|
||||||
return RETURN_OK;
|
return returnvalue::OK;
|
||||||
} else {
|
} else {
|
||||||
return RETURN_FAILED;
|
return returnvalue::FAILED;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -5,7 +5,7 @@
|
|||||||
#include "dllConf.h"
|
#include "dllConf.h"
|
||||||
#include "fsfw/ipc/MessageQueueSenderIF.h"
|
#include "fsfw/ipc/MessageQueueSenderIF.h"
|
||||||
#include "fsfw/objectmanager/ObjectManagerIF.h"
|
#include "fsfw/objectmanager/ObjectManagerIF.h"
|
||||||
#include "fsfw/returnvalues/HasReturnvaluesIF.h"
|
#include "fsfw/returnvalues/returnvalue.h"
|
||||||
|
|
||||||
class StorageManagerIF;
|
class StorageManagerIF;
|
||||||
|
|
||||||
@ -36,7 +36,7 @@ class MapPacketExtraction : public MapPacketExtractionIF {
|
|||||||
* Method that is called if the segmentation flag is @c NO_SEGMENTATION.
|
* Method that is called if the segmentation flag is @c NO_SEGMENTATION.
|
||||||
* The method extracts one or more packets within the frame and forwards them to the OBSW.
|
* The method extracts one or more packets within the frame and forwards them to the OBSW.
|
||||||
* @param frame The TC Transfer Frame to work on.
|
* @param frame The TC Transfer Frame to work on.
|
||||||
* @return @c RETURN_OK if all Packets were extracted. If something is entirely wrong,
|
* @return @c returnvalue::OK if all Packets were extracted. If something is entirely wrong,
|
||||||
* @c DATA_CORRUPTED is returned, if some bytes are left over @c RESIDUAL_DATA.
|
* @c DATA_CORRUPTED is returned, if some bytes are left over @c RESIDUAL_DATA.
|
||||||
*/
|
*/
|
||||||
ReturnValue_t unpackBlockingPackets(TcTransferFrame* frame);
|
ReturnValue_t unpackBlockingPackets(TcTransferFrame* frame);
|
||||||
@ -63,7 +63,7 @@ class MapPacketExtraction : public MapPacketExtractionIF {
|
|||||||
ReturnValue_t extractPackets(TcTransferFrame* frame);
|
ReturnValue_t extractPackets(TcTransferFrame* frame);
|
||||||
/**
|
/**
|
||||||
* The #packetStore and the default destination of #tcQueue are initialized here.
|
* The #packetStore and the default destination of #tcQueue are initialized here.
|
||||||
* @return @c RETURN_OK on success, @c RETURN_FAILED otherwise.
|
* @return @c returnvalue::OK on success, @c returnvalue::FAILED otherwise.
|
||||||
*/
|
*/
|
||||||
ReturnValue_t initialize();
|
ReturnValue_t initialize();
|
||||||
/**
|
/**
|
||||||
|
@ -57,18 +57,18 @@ ReturnValue_t VirtualChannelReception::doFARM(TcTransferFrame* frame, ClcwIF* cl
|
|||||||
|
|
||||||
ReturnValue_t VirtualChannelReception::frameAcceptanceAndReportingMechanism(TcTransferFrame* frame,
|
ReturnValue_t VirtualChannelReception::frameAcceptanceAndReportingMechanism(TcTransferFrame* frame,
|
||||||
ClcwIF* clcw) {
|
ClcwIF* clcw) {
|
||||||
ReturnValue_t result = RETURN_OK;
|
ReturnValue_t result = returnvalue::OK;
|
||||||
result = doFARM(frame, &internalClcw);
|
result = doFARM(frame, &internalClcw);
|
||||||
internalClcw.setReceiverFrameSequenceNumber(vR);
|
internalClcw.setReceiverFrameSequenceNumber(vR);
|
||||||
internalClcw.setFarmBCount(farmBCounter);
|
internalClcw.setFarmBCount(farmBCounter);
|
||||||
clcw->setWhole(internalClcw.getAsWhole());
|
clcw->setWhole(internalClcw.getAsWhole());
|
||||||
switch (result) {
|
switch (result) {
|
||||||
case RETURN_OK:
|
case returnvalue::OK:
|
||||||
return mapDemultiplexing(frame);
|
return mapDemultiplexing(frame);
|
||||||
case BC_IS_SET_VR_COMMAND:
|
case BC_IS_SET_VR_COMMAND:
|
||||||
case BC_IS_UNLOCK_COMMAND:
|
case BC_IS_UNLOCK_COMMAND:
|
||||||
// Need to catch these codes to avoid error reporting later.
|
// Need to catch these codes to avoid error reporting later.
|
||||||
return RETURN_OK;
|
return returnvalue::OK;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@ -79,15 +79,15 @@ ReturnValue_t VirtualChannelReception::addMapChannel(uint8_t mapId, MapPacketExt
|
|||||||
std::pair<mapChannelIterator, bool> returnValue =
|
std::pair<mapChannelIterator, bool> returnValue =
|
||||||
mapChannels.insert(std::pair<uint8_t, MapPacketExtractionIF*>(mapId, object));
|
mapChannels.insert(std::pair<uint8_t, MapPacketExtractionIF*>(mapId, object));
|
||||||
if (returnValue.second == true) {
|
if (returnValue.second == true) {
|
||||||
return RETURN_OK;
|
return returnvalue::OK;
|
||||||
} else {
|
} else {
|
||||||
return RETURN_FAILED;
|
return returnvalue::FAILED;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
ReturnValue_t VirtualChannelReception::handleBDFrame(TcTransferFrame* frame, ClcwIF* clcw) {
|
ReturnValue_t VirtualChannelReception::handleBDFrame(TcTransferFrame* frame, ClcwIF* clcw) {
|
||||||
farmBCounter++;
|
farmBCounter++;
|
||||||
return RETURN_OK;
|
return returnvalue::OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
ReturnValue_t VirtualChannelReception::handleBCFrame(TcTransferFrame* frame, ClcwIF* clcw) {
|
ReturnValue_t VirtualChannelReception::handleBCFrame(TcTransferFrame* frame, ClcwIF* clcw) {
|
||||||
@ -107,18 +107,18 @@ ReturnValue_t VirtualChannelReception::handleBCFrame(TcTransferFrame* frame, Clc
|
|||||||
uint8_t VirtualChannelReception::getChannelId() const { return channelId; }
|
uint8_t VirtualChannelReception::getChannelId() const { return channelId; }
|
||||||
|
|
||||||
ReturnValue_t VirtualChannelReception::initialize() {
|
ReturnValue_t VirtualChannelReception::initialize() {
|
||||||
ReturnValue_t returnValue = RETURN_FAILED;
|
ReturnValue_t returnValue = returnvalue::FAILED;
|
||||||
if ((slidingWindowWidth > 254) || (slidingWindowWidth % 2 != 0)) {
|
if ((slidingWindowWidth > 254) || (slidingWindowWidth % 2 != 0)) {
|
||||||
#if FSFW_CPP_OSTREAM_ENABLED == 1
|
#if FSFW_CPP_OSTREAM_ENABLED == 1
|
||||||
sif::error << "VirtualChannelReception::initialize: Illegal sliding window width: "
|
sif::error << "VirtualChannelReception::initialize: Illegal sliding window width: "
|
||||||
<< (int)slidingWindowWidth << std::endl;
|
<< (int)slidingWindowWidth << std::endl;
|
||||||
#endif
|
#endif
|
||||||
return RETURN_FAILED;
|
return returnvalue::FAILED;
|
||||||
}
|
}
|
||||||
for (mapChannelIterator iterator = mapChannels.begin(); iterator != mapChannels.end();
|
for (mapChannelIterator iterator = mapChannels.begin(); iterator != mapChannels.end();
|
||||||
iterator++) {
|
iterator++) {
|
||||||
returnValue = iterator->second->initialize();
|
returnValue = iterator->second->initialize();
|
||||||
if (returnValue != RETURN_OK) break;
|
if (returnValue != returnvalue::OK) break;
|
||||||
}
|
}
|
||||||
return returnValue;
|
return returnValue;
|
||||||
}
|
}
|
||||||
|
@ -77,7 +77,7 @@ class VirtualChannelReception : public VirtualChannelReceptionIF, public CCSDSRe
|
|||||||
* required.
|
* required.
|
||||||
* @param frame The Tc Transfer Frame to handle.
|
* @param frame The Tc Transfer Frame to handle.
|
||||||
* @param clcw Any changes on the CLCW shall be done with this method.
|
* @param clcw Any changes on the CLCW shall be done with this method.
|
||||||
* @return Always returns @c RETURN_OK.
|
* @return Always returns @c returnvalue::OK.
|
||||||
*/
|
*/
|
||||||
ReturnValue_t handleBDFrame(TcTransferFrame* frame, ClcwIF* clcw);
|
ReturnValue_t handleBDFrame(TcTransferFrame* frame, ClcwIF* clcw);
|
||||||
/**
|
/**
|
||||||
@ -102,13 +102,14 @@ class VirtualChannelReception : public VirtualChannelReceptionIF, public CCSDSRe
|
|||||||
* Helper method to simplify adding a mapChannel during construction.
|
* Helper method to simplify adding a mapChannel during construction.
|
||||||
* @param mapId The mapId of the object to add.
|
* @param mapId The mapId of the object to add.
|
||||||
* @param object Pointer to the MapPacketExtraction object itself.
|
* @param object Pointer to the MapPacketExtraction object itself.
|
||||||
* @return @c RETURN_OK if the channel was successfully inserted, @c RETURN_FAILED otherwise.
|
* @return @c returnvalue::OK if the channel was successfully inserted, @c returnvalue::FAILED
|
||||||
|
* otherwise.
|
||||||
*/
|
*/
|
||||||
ReturnValue_t addMapChannel(uint8_t mapId, MapPacketExtractionIF* object);
|
ReturnValue_t addMapChannel(uint8_t mapId, MapPacketExtractionIF* object);
|
||||||
/**
|
/**
|
||||||
* The initialization routine checks the set #slidingWindowWidth and initializes all MAP
|
* The initialization routine checks the set #slidingWindowWidth and initializes all MAP
|
||||||
* channels.
|
* channels.
|
||||||
* @return @c RETURN_OK on successful initialization, @c RETURN_FAILED otherwise.
|
* @return @c returnvalue::OK on successful initialization, @c returnvalue::FAILED otherwise.
|
||||||
*/
|
*/
|
||||||
ReturnValue_t initialize();
|
ReturnValue_t initialize();
|
||||||
/**
|
/**
|
||||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user