From de721bcb4b3ae041097807a30a2341c1ba8cdbd3 Mon Sep 17 00:00:00 2001 From: Eve <139727413+netrunnereve@users.noreply.github.com> Date: Fri, 13 Nov 2026 20:35:32 -0500 Subject: [PATCH] use ble.name --- docs/companion_cli.md | 7 +++---- examples/companion_radio/MyMesh.cpp | 16 ++++++++-------- 2 files changed, 11 insertions(+), 12 deletions(-) diff --git a/docs/companion_cli.md b/docs/companion_cli.md index 4887d997..d861b81e 100644 --- a/docs/companion_cli.md +++ b/docs/companion_cli.md @@ -415,14 +415,13 @@ Radio parameters are common to all roles and handled by `CommonRadioPrefs`. #### Change BLE name **Usage:** -- `get ble_name` -- `set ble_name ` -- `set ble_name_default` +- `get ble.name` +- `set ble.name ` **Parameters:** - `name`: New BLE name -**Note:** By default the node name will be used as the BLE name. These commands require a reboot to take effect. +**Note:** By default the node name will be used as the BLE name. If `` is empty the BLE name will be reset to the aforementioned default. These commands require a reboot to take effect. --- diff --git a/examples/companion_radio/MyMesh.cpp b/examples/companion_radio/MyMesh.cpp index d1ba6e13..91a9c8ab 100644 --- a/examples/companion_radio/MyMesh.cpp +++ b/examples/companion_radio/MyMesh.cpp @@ -2154,7 +2154,13 @@ bool MyMesh::handleCommand(const char* command, uint32_t sender_timestamp, char* sprintf(reply, "> pin is now %06d", _prefs.ble_pin); return true; } - if (memcmp(command, "set ble_name ", 13) == 0) { + if (strcmp(command, "set ble.name") == 0) { + _prefs.ble_name[0] = 0; + savePrefs(); + sprintf(reply, "> BLE name reset to %s (reboot to apply)", _prefs.node_name); + return true; + } + if (memcmp(command, "set ble.name ", 13) == 0) { if (AdvertDataParser::isValidName(&command[13])) { StrHelper::strncpy(_prefs.ble_name, &command[13], sizeof(_prefs.ble_name)); savePrefs(); @@ -2164,16 +2170,10 @@ bool MyMesh::handleCommand(const char* command, uint32_t sender_timestamp, char* } return true; } - if (strcmp(command, "get ble_name") == 0) { + if (strcmp(command, "get ble.name") == 0) { sprintf(reply, "> %s", _prefs.ble_name[0] ? _prefs.ble_name : _prefs.node_name); return true; } - if (strcmp(command, "set ble_name_default") == 0) { - _prefs.ble_name[0] = 0; - savePrefs(); - sprintf(reply, "> BLE name reset to %s (reboot to apply)", _prefs.node_name); - return true; - } #ifdef ENABLE_WIFI_INTERFACE if (memcmp(command, "set wifi.ssid ", 14) == 0) {