Open DayDayUpAllInOne opened 5 months ago
What version of Kable are you using?
What version of Kable are you using?
hi twyatt, the Kable version I use is 0.24.0, this problem occurs on iOS, Android is normal
I added the observationExceptionHandler method, and the program can receive the notification data from the Bluetooth device normally.
val peripheral = defaultScope.peripheral(it) {
onServicesDiscovered {
bleLogger.i("""BleClient/startScan/onServicesDiscovered:${it.peripheralName}""")
}
observationExceptionHandler { cause ->
// Log failure instead of propagating associated `observe` flow.
bleLogger.i("""BleClient/startScan/observationExceptionHandler:$cause""")
}
}
Log:
Runner[1678:356710] W/Kable/Delegate: 890FF1DD-33D3-AF4F-2CD8-7340E8C3B112 890FF1DD-33D3-AF4F-2CD8-7340E8C3B112 didUpdateNotificationStateForCharacteristic
service: 8C858000-0302-41C5-B46E-CF057C562025
characteristic: 8C858000-0302-4D46-BEC2-EE689169F628
error: Error Domain=CBATTErrorDomain Code=10 "The attribute could not be found." UserInfo={NSLocalizedDescription=The attribute could not be found.}
>>> info#ESIot/ble <<<BleClient/startScan/observationExceptionHandler:com.juul.kable.IOException: Error Domain=CBATTErrorDomain Code=10 "The attribute could not be found." UserInfo={NSLocalizedDescription=The attribute could not be found.}/1710152968286
Why does the program become normal after adding the observationExceptionHandler method?
When I use the code below,The kable library reports an error
error message:
How to solve this problem? Thanks!