* refactor: CommonCLI, processing of optional command prefix moved to handleCommand() call sites

* Sensor, anon_req now just for admin login (guest password now unused)
* special CLI command, "setperm {pubkey-hex} {permissions-int16}" for admin(s) to manage user access (permissions 0 = remove)
This commit is contained in:
Scott Powell 2025-07-08 17:50:06 +10:00
parent ac834922de
commit 9cecbad2a7
6 changed files with 125 additions and 89 deletions

View file

@ -127,14 +127,6 @@ void CommonCLI::checkAdvertInterval() {
}
void CommonCLI::handleCommand(uint32_t sender_timestamp, const char* command, char* reply) {
while (*command == ' ') command++; // skip leading spaces
if (strlen(command) > 4 && command[2] == '|') { // optional prefix (for companion radio CLI)
memcpy(reply, command, 3); // reflect the prefix back
reply += 3;
command += 3;
}
if (memcmp(command, "reboot", 6) == 0) {
_board->reboot(); // doesn't return
} else if (memcmp(command, "advert", 6) == 0) {