1
0
mirror of https://codeberg.org/Freeyourgadget/Gadgetbridge synced 2024-11-25 11:26:47 +01:00

Amazfit Bip, do not set menu items during initializaton

(This could prevent menus from vanishing when updating to FW 0.1.0.51)
This commit is contained in:
Andreas Shimokawa 2018-01-20 01:34:40 +01:00
parent 06d6aeacb9
commit 76cf667202
2 changed files with 17 additions and 1 deletions

View File

@ -53,6 +53,8 @@ import nodomain.freeyourgadget.gadgetbridge.service.devices.miband2.MiBand2Suppo
import nodomain.freeyourgadget.gadgetbridge.util.StringUtils; import nodomain.freeyourgadget.gadgetbridge.util.StringUtils;
import nodomain.freeyourgadget.gadgetbridge.util.Version; import nodomain.freeyourgadget.gadgetbridge.util.Version;
import static nodomain.freeyourgadget.gadgetbridge.devices.miband.MiBand2Service.ENDPOINT_DISPLAY_ITEMS;
public class AmazfitBipSupport extends MiBand2Support { public class AmazfitBipSupport extends MiBand2Support {
private static final Logger LOG = LoggerFactory.getLogger(AmazfitBipSupport.class); private static final Logger LOG = LoggerFactory.getLogger(AmazfitBipSupport.class);
@ -122,6 +124,19 @@ public class AmazfitBipSupport extends MiBand2Support {
// ignore // ignore
} }
@Override
protected AmazfitBipSupport setDisplayItems(TransactionBuilder builder) {
/*
LOG.info("Enabling all display items");
// This will brick the watch, don't enable it!
byte[] data = new byte[]{ENDPOINT_DISPLAY_ITEMS, (byte) 0xff, 0x01, 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08};
builder.write(getCharacteristic(MiBand2Service.UUID_CHARACTERISTIC_3_CONFIGURATION), data);
*/
return this;
}
@Override @Override
public void onSendWeather(WeatherSpec weatherSpec) { public void onSendWeather(WeatherSpec weatherSpec) {
if (gbDevice.getFirmwareVersion() == null) { if (gbDevice.getFirmwareVersion() == null) {
@ -320,6 +335,7 @@ public class AmazfitBipSupport extends MiBand2Support {
return this; return this;
} }
@Override @Override
public void phase2Initialize(TransactionBuilder builder) { public void phase2Initialize(TransactionBuilder builder) {
super.phase2Initialize(builder); super.phase2Initialize(builder);

View File

@ -1428,7 +1428,7 @@ public class MiBand2Support extends AbstractBTLEDeviceSupport {
return this; return this;
} }
private MiBand2Support setDisplayItems(TransactionBuilder builder) { protected MiBand2Support setDisplayItems(TransactionBuilder builder) {
Set<String> pages = HuamiCoordinator.getDisplayItems(); Set<String> pages = HuamiCoordinator.getDisplayItems();
LOG.info("Setting display items to " + (pages == null ? "none" : pages)); LOG.info("Setting display items to " + (pages == null ? "none" : pages));