Gatt Write not permitted Exception
Hi Team, I'm facing a crash during write operation to a characteristics. I'm able to write and read other characteristics but not to one of characteristics among them. Could you please to handle the crash ?. Thanks.
Here's the crash log. com.juul.kable.GattStatusException: OnCharacteristicWrite(characteristic= "CHARACTERISTICS_UUID", status=GATT_WRITE_NOT_PERMITTED(3)) at com.juul.kable.AndroidPeripheral.write(Peripheral.kt:673) at com.juul.kable.AndroidPeripheral$write$1.invokeSuspend(Unknown Source:15) at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33) at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:106) at kotlinx.coroutines.scheduling.CoroutineScheduler.runSafely(CoroutineScheduler.kt:570) at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.executeTask(CoroutineScheduler.kt:749) at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.runWorker(CoroutineScheduler.kt:677) at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run(CoroutineScheduler.kt:664)
Could you please to handle the crash ?
The throwing of the exception is intentional, as a way to propagate that the request was unable to be fulfilled. If you need to handle it, then you should catch GattStatusException (and optionally inform the user of the failure).
Or, is there an alternate behavior that you'd expect Kable to provide in the situation that insufficient permissions are available to perform an operation?