mirror of
https://github.com/meshcore-dev/MeshCore.git
synced 2026-04-20 22:13:47 +00:00
* various changes for CLI support via companion radio
This commit is contained in:
parent
189ed79d46
commit
1209d54d2e
6 changed files with 79 additions and 11 deletions
|
|
@ -469,7 +469,7 @@ protected:
|
|||
timestamp++;
|
||||
}
|
||||
memcpy(temp, ×tamp, 4); // mostly an extra blob to help make packet_hash unique
|
||||
temp[4] = (TXT_TYPE_PLAIN << 2); // TODO: change this to TXT_TYPE_CLI_DATA soon
|
||||
temp[4] = (TXT_TYPE_CLI_DATA << 2); // NOTE: legacy was: TXT_TYPE_PLAIN
|
||||
|
||||
// calc expected ACK reply
|
||||
//mesh::Utils::sha256((uint8_t *)&expected_ack_crc, 4, temp, 5 + text_len, self_id.pub_key, PUB_KEY_SIZE);
|
||||
|
|
@ -581,9 +581,15 @@ public:
|
|||
}
|
||||
}
|
||||
|
||||
void handleCommand(uint32_t sender_timestamp, const char* command, char reply[]) {
|
||||
void 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) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue