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 c6c245b4..b762f87f 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 @@ -57,12 +57,7 @@ class PebbleGATTServer extends BluetoothGattServerCallback { LOG.info("send data to pebble " + GB.hexdump(data, 0, -1)); writeCharacteristics.setValue(data.clone()); - mBluetoothGattServer.notifyCharacteristicChanged(mBtDevice, writeCharacteristics, false); - try { - Thread.sleep(100); // FIXME: bad bad, I mean BAAAD - } catch (InterruptedException ignore) { - } } synchronized private void sendAckToPebble(int serial) { diff --git a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/service/devices/pebble/ble/PebbleLESupport.java b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/service/devices/pebble/ble/PebbleLESupport.java index 449b76d9..2346dab3 100644 --- a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/service/devices/pebble/ble/PebbleLESupport.java +++ b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/service/devices/pebble/ble/PebbleLESupport.java @@ -126,6 +126,11 @@ public class PebbleLESupport { payloadToSend -= chunkSize; } + try { + Thread.sleep(500); // FIXME ugly wait 0.5s after each pebble package send to the pebble (we do not wait for the GATT chunks) + } catch (InterruptedException ignore) { + } + } catch (IOException e) { LOG.warn("IO exception"); mQuit = true;