Admin message shutdown feature (#1124)

* Shutdown via proto admin message
This commit is contained in:
Ben Meadors
2022-01-21 15:03:26 -06:00
committed by GitHub
parent 7723b30951
commit b6706c7ac1
3 changed files with 34 additions and 2 deletions

View File

@@ -104,6 +104,12 @@ bool AdminPlugin::handleReceivedProtobuf(const MeshPacket &mp, AdminMessage *r)
rebootAtMsec = (s < 0) ? 0 : (millis() + s * 1000);
break;
}
case AdminMessage_shutdown_seconds_tag: {
int32_t s = r->shutdown_seconds;
DEBUG_MSG("Shutdown in %d seconds\n", s);
shutdownAtMsec = (s < 0) ? 0 : (millis() + s * 1000);
break;
}
#ifdef PORTDUINO
case AdminMessage_exit_simulator_tag: