mirror of
https://github.com/meshtastic/Meshtastic-Android.git
synced 2026-04-20 22:23:37 +00:00
don't send BLE commands to meshservice while updating
This commit is contained in:
parent
7ff7686ccb
commit
a20fffcc2c
1 changed files with 4 additions and 0 deletions
|
|
@ -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)
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue