-
-
Notifications
You must be signed in to change notification settings - Fork 79
Closed
Description
Error message on readCharacteristic call after changing targetSdkVersion from "30" to "31".
BluetoothService: Read error: [BluetoothError]:error_function_call, readCharacteristic, [B@260bdf5, {"peripheralUUID":"XX:B4:6A:C9:75:AB","serviceUUID":"fe78","characteristicUUID":"73fdxxx-626c-4f9b-a52e-b1d226efcf8d"}
In Android there are two readCharacteristic() function callback. See the attached image and android documentation
So, if we patch onCharacteristicRead call from 3 arguments to 4 arguments (byte: any) the plugin works fine with sdkVersion check
onCharacteristicRead(gatt: android.bluetooth.BluetoothGatt, characteristic: android.bluetooth.BluetoothGattCharacteristic, byte: any, status: number) {
this.subDelegates.forEach((d) => {
if (d.onCharacteristicRead) {
if (sdkVersion < 33) {
d.onCharacteristicRead(gatt, characteristic, value);
} else {
d.onCharacteristicRead(gatt, characteristic, status);
}
});
}Metadata
Metadata
Assignees
Labels
No labels
