use ble.name
This commit is contained in:
1 parent
9e70d32f79
commit
de721bcb4b
2 files changed
+11
-12
No files matched your search
@@ -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 <name>`
|
||||
- `set ble_name_default`
|
||||
- `get ble.name`
|
||||
- `set ble.name <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 `<name>` is empty the BLE name will be reset to the aforementioned default. These commands require a reboot to take effect.
|
||||
|
||||
---
|
||||
|
||||
|
||||
@@ -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) {
|
||||
|
||||
Reference in new issue
Block a user