mirror of
https://codeberg.org/Freeyourgadget/Gadgetbridge
synced 2024-12-24 17:45:50 +01:00
Fixed connection issues by reading the date from the band #249
This commit is contained in:
parent
e5b0afb916
commit
89eddb13b0
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user