From a20fffcc2c12bccb268fd8eac4fdcdb729ff7473 Mon Sep 17 00:00:00 2001 From: Kevin Hester Date: Fri, 8 Jan 2021 15:19:39 +0800 Subject: [PATCH] don't send BLE commands to meshservice while updating --- app/src/main/java/com/geeksville/mesh/service/MeshService.kt | 4 ++++ 1 file changed, 4 insertions(+) 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) }