mirror of
https://github.com/MarekZegare4/MeshCore-Solo.git
synced 2026-11-02 10:51:57 +00:00
* new DynamicConfigSerializer
* board/variant KeyValueStore now can write to 'custom' object in Json prefs
This commit is contained in:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user