fpga download image command
Some checks failed
EIVE/eive-obsw/pipeline/pr-develop There was a failure building this commit

This commit is contained in:
Jakob Meier
2021-12-29 20:33:20 +01:00
parent 8d160572c7
commit e26ffb6afd
11 changed files with 1031 additions and 86 deletions

View File

@ -7,7 +7,7 @@
#include <string>
#include <filesystem>
class NVMParameterBase {
class NVMParameterBase : public HasReturnvaluesIF {
public:
virtual~ NVMParameterBase() {}
@ -34,12 +34,18 @@ public:
ReturnValue_t setValue(std::string key, T value);
template<typename T>
T getValue(std::string key) const;
ReturnValue_t getValue(std::string key, T* value) const;
void printKeys() const;
void print() const;
private:
static const uint8_t INTERFACE_ID = CLASS_ID::NVM_PARAM_BASE;
//! [EXPORT] : [COMMENT] Specified key does not exist in json file
static const ReturnValue_t KEY_NOT_EXISTS = MAKE_RETURN_CODE(0xA0);
nlohmann::json json;
std::vector<std::string> keys;
std::string fullName;
@ -62,8 +68,12 @@ inline ReturnValue_t NVMParameterBase::setValue(std::string key, T value) {
}
template<typename T>
inline T NVMParameterBase::getValue(std::string key) const {
return json[key];
inline ReturnValue_t NVMParameterBase::getValue(std::string key, T* value) const {
if (!json.contains(key)) {
return KEY_NOT_EXISTS;
}
*value = json[key];
return RETURN_OK;
}
#endif /* BSP_Q7S_CORE_NVMPARAMS_NVMPARAMIF_H_ */