diff --git a/inc/ECSS_Definitions.hpp b/inc/ECSS_Definitions.hpp index 882052bc0e6c8f2639f4a090796f8af417b0e1fa..8c3df99f433f6b04feeb3b4d820912f570754dfc 100644 --- a/inc/ECSS_Definitions.hpp +++ b/inc/ECSS_Definitions.hpp @@ -146,11 +146,6 @@ */ #define ECSS_ST_20_MAX_PARAMETERS 5 -/** - * @brief (TEMPORARY) Length of the flags bitset for each \ref Parameter of ST[20] - */ -#define ECSS_ST_20_NUMBER_OF_FLAGS 3 - /** * @brief Maximum etl::string output length in bytes for each \ref Parameter of ST[20] */ diff --git a/inc/Services/Parameter.hpp b/inc/Services/Parameter.hpp index 83d37177febb743d0327d6d07bc500d2ef72b8e1..6505500bfeadf307e796f115ce97b8e7d6dff518 100644 --- a/inc/Services/Parameter.hpp +++ b/inc/Services/Parameter.hpp @@ -1,7 +1,6 @@ #ifndef ECSS_SERVICES_PARAMETER_HPP #define ECSS_SERVICES_PARAMETER_HPP -#include "etl/bitset.h" #include "etl/String.hpp" #include "ECSS_Definitions.hpp" @@ -17,10 +16,8 @@ * Useful type definitions * * @typedef ParamId: the unique ID of a parameter, used for searching - * @typedef Flags: container for the binary flags */ typedef uint16_t ParamId; -typedef etl::bitset<ECSS_ST_20_NUMBER_OF_FLAGS> Flags; /** * Parameter class - Breakdown of fields @@ -30,13 +27,6 @@ typedef etl::bitset<ECSS_ST_20_NUMBER_OF_FLAGS> Flags; * * @todo: Find a way to store arbitrary types in currentValue * - * Additional features (not included in standard): - * @private flags: Various binary flags (number and meaning TBD). - * @warning Current flag meanings (starting from LSB, big-endian): - * Index 0: update with priority - * Index 1: manual update available - * Index 2: automatic update available - * * * Methods: * @public Parameter(uint32_t initialValue = 0, UpdatePtr newPtr = nullptr): @@ -52,18 +42,14 @@ class ParameterBase { protected: uint8_t sizeInBytes; void* valuePtr; - Flags flags; public: - void setFlags(const char* flags); virtual String<ECSS_ST_20_MAX_STRING_LENGTH> getValueAsString() = 0; template <typename ValueType> void setCurrentValue(ValueType newVal) { // set the value only if the parameter can be updated manually - if (flags[1]) { - *reinterpret_cast<ValueType*>(valuePtr) = newVal; - } + *reinterpret_cast<ValueType*>(valuePtr) = newVal; } }; @@ -77,8 +63,6 @@ public: ptr = newPtr; sizeInBytes = sizeof(initialValue); valuePtr = static_cast<void*>(¤tValue); - // see Parameter.hpp for explanation on flags - // by default: no update priority, manual and automatic update available if (ptr != nullptr) { (*ptr)(¤tValue); // call the update function for the initial value diff --git a/inc/Services/ParameterService.hpp b/inc/Services/ParameterService.hpp index 1dd0b35681671735a442cd0537187971153fc479..e2f4be64e451503d23f7b6e98a642cfef6c7b749 100644 --- a/inc/Services/ParameterService.hpp +++ b/inc/Services/ParameterService.hpp @@ -41,9 +41,8 @@ public: * exists already. * @param id: the desired ID for this parameter * @param param: the parameter field to be included - * @param flags: the flags to be set for this field (see Parameter.hpp) */ - void addNewParameter(uint16_t id, ParameterBase* param, const char* flags = "110"); + void addNewParameter(uint16_t id, ParameterBase* param); /** * This function receives a TC[20, 1] packet and returns a TM[20, 2] packet diff --git a/src/Services/Parameter.cpp b/src/Services/Parameter.cpp index b1b57eba4be0d51792f021fd21ca7746821b4f7f..526f4d6e2d89c9d74c2c11477ef841bd65e25eae 100644 --- a/src/Services/Parameter.cpp +++ b/src/Services/Parameter.cpp @@ -1,5 +1 @@ #include "Services/Parameter.hpp" - -void ParameterBase::setFlags(const char* flags) { - this->flags = Flags(flags); -} diff --git a/src/Services/ParameterService.cpp b/src/Services/ParameterService.cpp index 5863540614cf9f6b81a3a8e995219e3cbefad8d6..a20b5b80f15dbc3fc0322d598a78aa688800c03d 100644 --- a/src/Services/ParameterService.cpp +++ b/src/Services/ParameterService.cpp @@ -10,13 +10,12 @@ ParameterService::ParameterService() { // addNewParameter(3, 14); } -void ParameterService::addNewParameter(uint16_t id, ParameterBase* param, const char* flags) { +void ParameterService::addNewParameter(uint16_t id, ParameterBase* param) { if (paramsList.full()) { ErrorHandler::reportInternalError(ErrorHandler::InternalErrorType::MapFull); } else { if (paramsList.find(id) == paramsList.end()) { - param->setFlags(flags); paramsList.insert(std::make_pair(id, param)); } else { diff --git a/test/Services/ParameterService.cpp b/test/Services/ParameterService.cpp index 56630a5a51952ff0b6a06a7a3f2245f5114c6358..16b3ae329e9426a84341c8549745ca64f2c199ae 100644 --- a/test/Services/ParameterService.cpp +++ b/test/Services/ParameterService.cpp @@ -158,7 +158,7 @@ TEST_CASE("Parameter Setting Subservice") { SECTION("Attempt to set parameter with no manual update availability") { Parameter<int> param1 = Parameter<int>(12); - pserv.addNewParameter(1, static_cast<ParameterBase*>(¶m1), "100"); + pserv.addNewParameter(1, static_cast<ParameterBase*>(¶m1)); Message setRequest = Message(20, 3, Message::TC, 1); setRequest.appendUint16(1);