1
0
mirror of https://codeberg.org/Freeyourgadget/Gadgetbridge synced 2024-11-04 09:17:29 +01:00

Amazfit Bip: request GPS fw version earlier

(to avoid recreation of DeviceAttributes because fw2 is sometimes available and sometimes not.)
This commit is contained in:
cpfeiffer 2017-09-04 23:19:53 +02:00
parent f6ce0c1a0e
commit 1ddea9268d
2 changed files with 6 additions and 1 deletions

View File

@ -1309,8 +1309,11 @@ public class MiBand2Support extends AbstractBTLEDeviceSupport {
public void phase2Initialize(TransactionBuilder builder) {
LOG.info("phase2Initialize...");
enableFurtherNotifications(builder, true);
requestBatteryInfo(builder);
}
public void phase3Initialize(TransactionBuilder builder) {
LOG.info("phase3Initialize...");
setDateDisplay(builder);
setTimeFormat(builder);
setWearLocation(builder);

View File

@ -117,7 +117,9 @@ public class InitOperation extends AbstractBTLEOperation<MiBand2Support> {
TransactionBuilder builder = createTransactionBuilder("Authenticated, now initialize phase 2");
builder.add(new SetDeviceStateAction(getDevice(), GBDevice.State.INITIALIZING, getContext()));
getSupport().requestDeviceInfo(builder);
getSupport().enableFurtherNotifications(builder, true);
getSupport().phase2Initialize(builder);
getSupport().phase3Initialize(builder);
getSupport().setInitialized(builder);
getSupport().performImmediately(builder);
} else {