mirror of
https://github.com/MarekZegare4/MeshCore-Solo.git
synced 2026-11-02 19:02:00 +00:00
Merge pull request #3442 from liamcottle/feature/companion-cli-commands
added reboot, shutdown and poweroff to companion cli commands
This commit is contained in:
@@ -2146,6 +2146,16 @@ bool MyMesh::handleCommand(const char* command, uint32_t sender_timestamp, char*
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (strcmp(command, "reboot") == 0) {
|
||||||
|
board.reboot(); // doesn't return
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (strcmp(command, "poweroff") == 0 || strcmp(command, "shutdown") == 0) {
|
||||||
|
board.powerOff(); // doesn't return
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
if (memcmp(command, "set name ", 9) == 0) {
|
if (memcmp(command, "set name ", 9) == 0) {
|
||||||
if (AdvertDataParser::isValidName(&command[9])) {
|
if (AdvertDataParser::isValidName(&command[9])) {
|
||||||
StrHelper::strncpy(_prefs.node_name, &command[9], sizeof(_prefs.node_name));
|
StrHelper::strncpy(_prefs.node_name, &command[9], sizeof(_prefs.node_name));
|
||||||
|
|||||||
Reference in New Issue
Block a user