* new DynamicConfigSerializer

* board/variant KeyValueStore now can write to 'custom' object in Json prefs
This commit is contained in:
Scott Powell
2026-08-24 17:12:56 +10:00
parent a1cf5bd806
commit 5a162ff4c6
11 changed files with 139 additions and 20 deletions
+13 -9
View File
@@ -3,25 +3,29 @@
#include "Utils.h"
#include "target.h"
void CommonRadioPrefs::getByKey(const char* key, char* value, size_t max_len) {
bool CommonRadioPrefs::getByKey(const char* key, char* value, size_t max_len) {
if (strcmp(key, "fem_rxgain") == 0) {
snprintf(value, max_len, "%d", (uint32_t)getFEMRxGain());
} else if (strcmp(key, "fem_txgain") == 0) {
snprintf(value, max_len, "%d", (uint32_t)getFEMTxGain());
} else {
MESH_DEBUG_PRINTLN("Error: getBykey() unknown key: %s", key);
return true;
}
if (strcmp(key, "fem_txgain") == 0) {
snprintf(value, max_len, "%d", (uint32_t)getFEMTxGain());
return true;
}
return false;
}
void CommonRadioPrefs::setByKey(const char* key, const char* value) {
bool CommonRadioPrefs::setByKey(const char* key, const char* value) {
if (strcmp(key, "fem_rxgain") == 0) {
setFEMRxGain(atoi(value));
markDirty();
} else if (strcmp(key, "fem_txgain") == 0) {
return true;
}
if (strcmp(key, "fem_txgain") == 0) {
setFEMTxGain(atoi(value));
markDirty();
} else {
MESH_DEBUG_PRINTLN("Error: setBykey() unknown key: %s", key);
return true;
}
return false;
}
bool CommonRadioPrefs::handleCommand(const char* command, uint32_t sender_timestamp, char* reply) {