diff --git a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/service/devices/pebble/ble/PebbleGATTServer.java b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/service/devices/pebble/ble/PebbleGATTServer.java index c818a956..384c656a 100644 --- a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/service/devices/pebble/ble/PebbleGATTServer.java +++ b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/service/devices/pebble/ble/PebbleGATTServer.java @@ -103,9 +103,11 @@ class PebbleGATTServer extends BluetoothGattServerCallback { LOG.warn("unexpected write request"); return; } - mPebbleLESupport.mIsConnected = true; - synchronized (mPebbleLESupport) { - mPebbleLESupport.notify(); + if (!mPebbleLESupport.mIsConnected) { + mPebbleLESupport.mIsConnected = true; + synchronized (mPebbleLESupport) { + mPebbleLESupport.notify(); + } } LOG.info("write request: offset = " + offset + " value = " + GB.hexdump(value, 0, -1)); int header = value[0] & 0xff;