* new DynamicConfigSerializer

* board/variant KeyValueStore now can write to 'custom' object in Json prefs
This commit is contained in:
Scott Powell committed 2026-08-24 17:12:56 +10:00
1 parent b5b20a7738
commit 5a7bc507d1
11 files changed
+139 -20

No files matched your search

+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) {