Allow the pi to be shutdown from the app via bluetooth.

This commit is contained in:
MarkBryanMilligan
2021-03-06 20:20:55 -06:00
parent a43222049d
commit 2a5674b736
3 changed files with 11 additions and 2 deletions

View File

@@ -154,6 +154,14 @@ public class MonitorApp {
LOG.error("Exception occurred while trying to reboot", _e);
}
break;
case Shutdown:
LOG.info("Shutting down Pi...");
try {
Runtime.getRuntime().exec(new String[]{"shutdown","now"});
} catch (IOException _e) {
LOG.error("Exception occurred while trying to shutdown", _e);
}
break;
}
}
});