Skip to content

Commit

Permalink
Android: use ENABLE_NOTIFICATION_VALUE instead of ENABLE_INDICATION_V…
Browse files Browse the repository at this point in the history
…ALUE (#5784)

* Fix Issue#5593

* Fix Issue#5593

* Merge with master

* issue#5593 merge with master

* issue#5593 do not reformat code

* issue#5593 apply patch failure on second part

* Restyled by whitespace

Co-authored-by: Restyled.io <[email protected]>
  • Loading branch information
robertfarnum and restyled-commits authored Apr 7, 2021
1 parent 50152f9 commit bc3d6bf
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ public void onDescriptorWrite(
return;
}

if (desc.getValue() == BluetoothGattDescriptor.ENABLE_INDICATION_VALUE) {
if (desc.getValue() == BluetoothGattDescriptor.ENABLE_NOTIFICATION_VALUE) {
handleSubscribeComplete(
connId, svcIdBytes, charIdBytes, status == BluetoothGatt.GATT_SUCCESS);
} else if (desc.getValue() == BluetoothGattDescriptor.DISABLE_NOTIFICATION_VALUE) {
Expand Down Expand Up @@ -302,7 +302,7 @@ public static boolean onSubscribeCharacteristic(int connId, byte[] svcId, byte[]

BluetoothGattDescriptor descriptor =
subscribeChar.getDescriptor(UUID.fromString(CLIENT_CHARACTERISTIC_CONFIG));
descriptor.setValue(BluetoothGattDescriptor.ENABLE_INDICATION_VALUE);
descriptor.setValue(BluetoothGattDescriptor.ENABLE_NOTIFICATION_VALUE);
if (!bluetoothGatt.writeDescriptor(descriptor)) {
Log.e(TAG, "writeDescriptor failed");
return false;
Expand Down

0 comments on commit bc3d6bf

Please sign in to comment.