Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions src/ble/index.android.ts
Original file line number Diff line number Diff line change
Expand Up @@ -767,12 +767,17 @@ function initBluetoothGattCallback() {
* Callback reporting the result of a characteristic read operation.
* @param gatt [android.bluetooth.BluetoothGatt] - GATT client invoked readCharacteristic(BluetoothGattCharacteristic)
* @param characteristic - Characteristic that was read from the associated remote device.
* @params value - byte: the value of the characteristic This value cannot be null. This will "status" in Android API level < 33.
* @param status [number] - GATT_SUCCESS if the read operation was completed successfully.
*/
onCharacteristicRead(gatt: android.bluetooth.BluetoothGatt, characteristic: android.bluetooth.BluetoothGattCharacteristic, status: number) {
onCharacteristicRead(gatt: android.bluetooth.BluetoothGatt, characteristic: android.bluetooth.BluetoothGattCharacteristic, value : any, status: number) {
this.subDelegates.forEach((d) => {
if (d.onCharacteristicRead) {
d.onCharacteristicRead(gatt, characteristic, status);
if (sdkVersion < 33) {
d.onCharacteristicRead(gatt, characteristic, value);
} else {
d.onCharacteristicRead(gatt, characteristic, status);
}
}
});
}
Expand Down