mirror of
https://codeberg.org/Freeyourgadget/Gadgetbridge.git
synced 2026-07-31 07:44:24 +02:00
Partially revert "huami+pebble: replace deprecated writeCharacteristic and writeDescriptor"
The reverted change sent the updated descriptor value to the watch, breaking the connection. It is unclear why the descriptor is set to an unknown value and never sent to the watch, but this restores the previous working behavior.
This commit is contained in:
+4
-1
@@ -252,7 +252,10 @@ class PebbleGATTClient extends BluetoothGattCallback {
|
||||
LOG.info("setting MTU");
|
||||
BluetoothGattCharacteristic characteristic = gatt.getService(SERVICE_UUID).getCharacteristic(MTU_CHARACTERISTIC);
|
||||
BluetoothGattDescriptor descriptor = characteristic.getDescriptor(CHARACTERISTIC_CONFIGURATION_DESCRIPTOR);
|
||||
NotifyAction.writeDescriptor(gatt, descriptor, new byte[]{0x0b, 0x01}); // unknown
|
||||
descriptor.setValue(new byte[]{0x0b, 0x01}); // unknown
|
||||
// descriptor is not wrote back to the device, but the characteristic is.
|
||||
// Reason is unclear but writing back the descriptor instead of the characteristic breaks the connection.
|
||||
WriteAction.writeCharacteristic(gatt,characteristic, characteristic.getValue());
|
||||
}
|
||||
|
||||
private void subscribeToPPoGATT(BluetoothGatt gatt) {
|
||||
|
||||
Reference in New Issue
Block a user