diff --git a/app/src/main/java/com/geeksville/mesh/service/MeshService.kt b/app/src/main/java/com/geeksville/mesh/service/MeshService.kt index 72e6ef6f1..d8ef31baf 100644 --- a/app/src/main/java/com/geeksville/mesh/service/MeshService.kt +++ b/app/src/main/java/com/geeksville/mesh/service/MeshService.kt @@ -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) }