diff --git a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/service/devices/miband/MiBandSupport.java b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/service/devices/miband/MiBandSupport.java index b789938a..81f44548 100644 --- a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/service/devices/miband/MiBandSupport.java +++ b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/service/devices/miband/MiBandSupport.java @@ -98,6 +98,7 @@ public class MiBandSupport extends AbstractBTLEDeviceSupport { builder.add(new SetDeviceStateAction(getDevice(), State.INITIALIZING, getContext())); enableNotifications(builder, true) .setLowLatency(builder) + .readDate(builder) // without reading the data, we get sporadic connection problems, especially directly after turning on BT .pair(builder) .requestDeviceInfo(builder) .sendUserInfo(builder) @@ -112,6 +113,11 @@ public class MiBandSupport extends AbstractBTLEDeviceSupport { return builder; } + private MiBandSupport readDate(TransactionBuilder builder) { + builder.read(getCharacteristic(MiBandService.UUID_CHARACTERISTIC_DATE_TIME)); + return this; + } + public MiBandSupport setLowLatency(TransactionBuilder builder) { builder.write(getCharacteristic(MiBandService.UUID_CHARACTERISTIC_LE_PARAMS), getLowLatency()); return this;