Skip to content

Commit 9acfe2a

Browse files
1 parent a5b9c5b commit 9acfe2a

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

src/ble/index.android.ts

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -767,12 +767,17 @@ function initBluetoothGattCallback() {
767767
* Callback reporting the result of a characteristic read operation.
768768
* @param gatt [android.bluetooth.BluetoothGatt] - GATT client invoked readCharacteristic(BluetoothGattCharacteristic)
769769
* @param characteristic - Characteristic that was read from the associated remote device.
770+
* @params value - byte: the value of the characteristic This value cannot be null. This will "status" in Android API level < 33.
770771
* @param status [number] - GATT_SUCCESS if the read operation was completed successfully.
771772
*/
772-
onCharacteristicRead(gatt: android.bluetooth.BluetoothGatt, characteristic: android.bluetooth.BluetoothGattCharacteristic, status: number) {
773+
onCharacteristicRead(gatt: android.bluetooth.BluetoothGatt, characteristic: android.bluetooth.BluetoothGattCharacteristic, value : any, status: number) {
773774
this.subDelegates.forEach((d) => {
774775
if (d.onCharacteristicRead) {
775-
d.onCharacteristicRead(gatt, characteristic, status);
776+
if (sdkVersion < 33) {
777+
d.onCharacteristicRead(gatt, characteristic, value);
778+
} else {
779+
d.onCharacteristicRead(gatt, characteristic, status);
780+
}
776781
}
777782
});
778783
}

0 commit comments

Comments
 (0)