printout, doc, bugfixes..

This commit is contained in:
2021-01-31 17:40:20 +01:00
parent 503de9ba89
commit f067695353
4 changed files with 74 additions and 13 deletions

View File

@ -8,14 +8,23 @@
#include <cstddef>
/**
* @brief
* @brief This wrapper encapsulates the access to parameters provided by HasParametersIF.
* @details
* This wrapper is used by the ParameterHelper to interface with the on-board parameters
* exposed by the software via the HasParametersIF. A handle of this wrapper is passed
* to the user which then can be used to set or dump the parameters.
*
* The wrapper provides a set of setter functions. The user should call those setter functions,
* supplying an address to the local parameters. The user can also deserialize or
* serialize the parameter data. Please note that this will also serialize and deserialize
* the parameter information field (4 bytes) containing the ECSS PTC, PFC and rows and columns
* number.
*/
class ParameterWrapper: public SerializeIF {
friend class DataPoolParameterWrapper;
public:
static const uint8_t INTERFACE_ID = CLASS_ID::PARAMETER_WRAPPER;
static const ReturnValue_t UNKNOW_DATATYPE = MAKE_RETURN_CODE(0x01);
static const ReturnValue_t UNKNOWN_DATATYPE = MAKE_RETURN_CODE(0x01);
static const ReturnValue_t DATATYPE_MISSMATCH = MAKE_RETURN_CODE(0x02);
static const ReturnValue_t READONLY = MAKE_RETURN_CODE(0x03);
static const ReturnValue_t TOO_BIG = MAKE_RETURN_CODE(0x04);
@ -26,8 +35,7 @@ public:
ParameterWrapper();
ParameterWrapper(Type type, uint8_t rows, uint8_t columns, void *data);
ParameterWrapper(Type type, uint8_t rows, uint8_t columns,
const void *data);
ParameterWrapper(Type type, uint8_t rows, uint8_t columns, const void *data);
virtual ~ParameterWrapper();
virtual ReturnValue_t serialize(uint8_t** buffer, size_t* size,
@ -77,11 +85,23 @@ public:
this->pointsToStream = false;
}
/**
* Setter function for scalar non-const entries
* @tparam T
* @param member
*/
template<typename T>
void set(T& member) {
this->set(&member, 1, 1);
}
/**
* Setter function for scalar const entries.
* TODO: This is confusing, it should not be called set. Maybe we should call all functions
* assign instead?
* @tparam T
* @param readonlyMember
*/
template<typename T>
void set(const T& readonlyMember) {
this->set(&readonlyMember, 1, 1);
@ -89,12 +109,16 @@ public:
template<typename T>
void setVector(T& member) {
this->set(member, sizeof(member)/sizeof(member[0]), 1);
/* For a vector entry, the number of rows will be one
(left to right, top to bottom indexing) */
this->set(member, 1, sizeof(member) / sizeof(member[0]));
}
template<typename T>
void setVector(const T& member) {
this->set(member, 1, sizeof(member)/sizeof(member[0]));
/* For a vector entry, the number of rows will be one
(left to right, top to bottom indexing) */
this->set(member, 1, sizeof(member) / sizeof(member[0]));
}
template<typename T>
void setMatrix(T& member) {