From ae2c107ed10021a5b2a439dc02d3aef5006cf85c Mon Sep 17 00:00:00 2001 From: Andreas Shimokawa Date: Fri, 2 Dec 2016 08:50:02 +0100 Subject: [PATCH] Pebble 2/LE: only notify once when first PP packets are incoming --- .../service/devices/pebble/ble/PebbleGATTServer.java | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) 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;