Skip to content

Commit

Permalink
Merge pull request #425 from NordicSemiconductor/api33
Browse files Browse the repository at this point in the history
Migration to API 33, part 2
  • Loading branch information
philips77 authored Sep 29, 2022
2 parents d8c480a + e607f22 commit f73171c
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions ble/src/main/java/no/nordicsemi/android/ble/BleManagerHandler.java
Original file line number Diff line number Diff line change
Expand Up @@ -2236,8 +2236,13 @@ public void onServiceChanged(@NonNull final BluetoothGatt gatt) {
public void onCharacteristicRead(final BluetoothGatt gatt,
final BluetoothGattCharacteristic characteristic,
final int status) {
final byte[] data = characteristic.getValue();
onCharacteristicRead(gatt, characteristic, characteristic.getValue(), status);
}

@Override
public void onCharacteristicRead(@NonNull final BluetoothGatt gatt,
@NonNull final BluetoothGattCharacteristic characteristic,
@NonNull byte[] data, int status) {
if (status == BluetoothGatt.GATT_SUCCESS) {
log(Log.INFO, () ->
"Read Response received from " + characteristic.getUuid() +
Expand Down Expand Up @@ -2461,11 +2466,18 @@ public void onDescriptorWrite(final BluetoothGatt gatt,
nextRequest(true);
}


@Override
public void onCharacteristicChanged(final BluetoothGatt gatt,
final BluetoothGattCharacteristic characteristic) {
final byte[] data = characteristic.getValue();
onCharacteristicChanged(gatt, characteristic, characteristic.getValue());
}

@Override
public void onCharacteristicChanged(
@NonNull final BluetoothGatt gatt,
@NonNull final BluetoothGattCharacteristic characteristic,
@NonNull final byte[] data) {
if (isServiceChangedCharacteristic(characteristic)) {
// Android S added onServiceChanged() callback, which should be called in this
// situation. Again, this has not been tested.
Expand Down

0 comments on commit f73171c

Please sign in to comment.