Add configurable Companion Bluetooth addresses

This commit is contained in:
mikecarper committed 2026-09-07 18:29:00 -07:00
1 parent b25005f52f
commit 4b400ea56b
26 files changed
+2723 -1966

No files matched your search

+10 -6
View File
@@ -18,7 +18,7 @@
// separately, see wcIsAdminPasswordKey below.
static const char* const WC_ALLOWED_SET_KEYS[] = {
// NodePrefs (radio / node)
"name", "bluetooth.name", "lat", "lon", "radio", "tx", "af", "rxdelay", "txdelay",
"name", "bluetooth.name", "bluetooth.mac", "lat", "lon", "radio", "tx", "af", "rxdelay", "txdelay",
"cad", "radio.rxgain", "radio.fem.rxgain", "radio.rxps", "powersaving",
"repeat",
"advert.interval", "flood.advert.interval",
@@ -57,14 +57,18 @@ static inline bool wcIsAllowedSetKey(const char* key) {
return false;
}
// Changing the primary ESP-NOW channel cannot be applied live: every peer and
// any infrastructure-WiFi association must stay on the boot channel until the
// node restarts. The server enforces this even when a crafted client omits the
// browser's reboot flag.
static inline bool wcSetKeyRequiresReboot(const char* key) {
static inline bool wcIsEspNowChannelKey(const char* key) {
return key != NULL && strcmp(key, "espnow.channel") == 0;
}
// These settings cannot be applied to a running transport. The server enforces
// a reboot even when a crafted client omits the browser's reboot flag.
static inline bool wcSetKeyRequiresReboot(const char* key) {
return key != NULL
&& (wcIsEspNowChannelKey(key)
|| strcmp(key, "bluetooth.mac") == 0);
}
// The admin password maps to the top-level `password` command, not a setter, so
// it is classified apart from the `set` allowlist. It is the only key that gets
// this treatment, which is what keeps the allowlist the sole route to `set` and