From ae0aa6df63e540940f6cc9eaee5aafc96d2b1b93 Mon Sep 17 00:00:00 2001 From: Andreas Shimokawa Date: Sun, 2 Nov 2025 07:38:45 +0100 Subject: [PATCH] Pebble 2 Duo: react to MTU changes though the official BLE way --- .../service/devices/pebble/ble/PebbleGATTClient.java | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/service/devices/pebble/ble/PebbleGATTClient.java b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/service/devices/pebble/ble/PebbleGATTClient.java index 30217aaf27..7316b2d618 100644 --- a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/service/devices/pebble/ble/PebbleGATTClient.java +++ b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/service/devices/pebble/ble/PebbleGATTClient.java @@ -222,6 +222,14 @@ class PebbleGATTClient extends BluetoothGattCallback { } } + @Override + public void onMtuChanged(BluetoothGatt gatt, int mtu, int status) { + if (status == BluetoothGatt.GATT_SUCCESS) { + LOG.info("MTU changed to {}", mtu); + mPebbleLESupport.setMTU(mtu); + } + } + private void connectToPebble(BluetoothDevice btDevice) { if (removeBond) { BondingUtil.Unpair(GBApplication.getContext(), btDevice.getAddress());