Skip to content

Commit 1c86c44

Browse files
committed
Add PAIR and PAIRSTOP commands to CLI
1 parent 5ae280d commit 1c86c44

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

Firmware/RTK_Everywhere/menuCommands.ino

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -281,6 +281,22 @@ t_cliResult processCommand(char *cmdBuffer)
281281
commandSendExecuteOkResponse(tokens[0], tokens[1]);
282282
return (CLI_OK);
283283
}
284+
else if (strcmp(tokens[1], "PAIR") == 0)
285+
{
286+
commandSendExecuteOkResponse(tokens[0], tokens[1]);
287+
espnowRequestPair = true; // Start ESP-NOW pairing process
288+
// Force exit all config menus and/or command modes to allow OTA state machine to run
289+
btPrintEchoExit = true;
290+
return (CLI_EXIT); // Exit the CLI to allow OTA state machine to run
291+
}
292+
else if (strcmp(tokens[1], "PAIRSTOP") == 0)
293+
{
294+
commandSendExecuteOkResponse(tokens[0], tokens[1]);
295+
espnowRequestPair = false; // Stop ESP-NOW pairing process
296+
// Force exit all config menus and/or command modes to allow OTA state machine to run
297+
btPrintEchoExit = true;
298+
return (CLI_EXIT); // Exit the CLI to allow OTA state machine to run
299+
}
284300
else if (strcmp(tokens[1], "REBOOT") == 0)
285301
{
286302
commandSendExecuteOkResponse(tokens[0], tokens[1]);

0 commit comments

Comments
 (0)