don't send BLE commands to meshservice while updating

This commit is contained in:
Kevin Hester
2021-01-08 15:19:39 +08:00
parent 7ff7686ccb
commit a20fffcc2c

View File

@@ -60,6 +60,7 @@ class MeshService : Service(), Logging {
class IdNotFoundException(id: String) : Exception("ID not found $id")
class NodeNumNotFoundException(id: Int) : Exception("NodeNum not found $id")
class IsUpdatingException() : Exception("Operation prohibited during firmware update")
/**
* Talk to our running service and try to set a new device address. And then immediately
@@ -228,6 +229,9 @@ class MeshService : Service(), Logging {
private fun sendToRadio(p: ToRadio.Builder) {
val b = p.build().toByteArray()
if(SoftwareUpdateService.isUpdating)
throw IsUpdatingException()
connectedRadio.sendToRadio(b)
}