Merge upstream/dev into observer-firmware-dev

This commit is contained in:
Adam Gessaman committed 2026-08-28 19:45:59 -07:00
commit 99a7e99a2e
73 files changed
+2024 -369

No files matched your search

+32
View File
@@ -0,0 +1,32 @@
#include "helpers/CommonRadioPrefs.h"
#include <stdio.h>
#include <stdlib.h>
// Native serializer tests instantiate NodePrefs, but the full radio CLI source
// depends on target hardware. These two methods are the only out-of-line vtable
// entries the host-side NodePrefs tests require.
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());
return true;
}
if (strcmp(key, "fem_txgain") == 0) {
snprintf(value, max_len, "%d", (uint32_t)getFEMTxGain());
return true;
}
return false;
}
bool CommonRadioPrefs::setByKey(const char* key, const char* value) {
if (strcmp(key, "fem_rxgain") == 0) {
setFEMRxGain(atoi(value));
markDirty();
return true;
}
if (strcmp(key, "fem_txgain") == 0) {
setFEMTxGain(atoi(value));
markDirty();
return true;
}
return false;
}