mirror of
https://github.com/meshcore-dev/MeshCore.git
synced 2026-04-20 22:13:47 +00:00
added new CommonCLI get commands: get role and get public.key
This commit is contained in:
parent
0d5c17f7ed
commit
b77701ced0
4 changed files with 16 additions and 3 deletions
|
|
@ -198,6 +198,12 @@ void CommonCLI::handleCommand(uint32_t sender_timestamp, const char* command, ch
|
|||
sprintf(reply, "> %d", (uint32_t) _prefs->tx_power_dbm);
|
||||
} else if (memcmp(config, "freq", 4) == 0) {
|
||||
sprintf(reply, "> %s", StrHelper::ftoa(_prefs->freq));
|
||||
} else if (memcmp(config, "public.key", 10) == 0) {
|
||||
char pub_key_hex[PUB_KEY_SIZE * 2 + 1];
|
||||
mesh::Utils::toHex(pub_key_hex, _mesh->self_id.pub_key, PUB_KEY_SIZE);
|
||||
sprintf(reply, "> %s", pub_key_hex);
|
||||
} else if (memcmp(config, "role", 4) == 0) {
|
||||
sprintf(reply, "> %s", _callbacks->getRole());
|
||||
} else {
|
||||
sprintf(reply, "??: %s", config);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue