mirror of
https://github.com/meshtastic/Meshtastic-Android.git
synced 2026-04-20 22:23:37 +00:00
Fix back to back writes to not overwrite BLE characterstic. Fixes
the "sending while device was asleep bug"
This commit is contained in:
parent
7ee4aff64c
commit
f9c1ac8cd2
3 changed files with 60 additions and 22 deletions
|
|
@ -217,9 +217,8 @@ class BluetoothInterface(val service: RadioInterfaceService, val address: String
|
|||
// Note: we generate a new characteristic each time, because we are about to
|
||||
// change the data and we want the data stored in the closure
|
||||
val toRadio = getCharacteristic(uuid)
|
||||
toRadio.value = a
|
||||
|
||||
s.asyncWriteCharacteristic(toRadio) { r ->
|
||||
s.asyncWriteCharacteristic(toRadio, a) { r ->
|
||||
try {
|
||||
r.getOrThrow()
|
||||
debug("write of ${a.size} bytes completed")
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue