Add a timeout of 1 second before rebooting after firmware update.

This commit is contained in:
Daniele Gobbetti 2015-07-31 11:28:03 +02:00
parent 0a6dc8f7a0
commit fbbc2afda4
1 changed files with 1 additions and 0 deletions

View File

@ -946,6 +946,7 @@ public class MiBandSupport extends AbstractBTLEDeviceSupport {
LOG.info("Firmware update progress:" + firmwareProgress + " total len:" + len + " progress:" + (firmwareProgress / len)); LOG.info("Firmware update progress:" + firmwareProgress + " total len:" + len + " progress:" + (firmwareProgress / len));
if (firmwareProgress >= len) { if (firmwareProgress >= len) {
builder.write(getCharacteristic(MiBandService.UUID_CHARACTERISTIC_CONTROL_POINT), new byte[]{MiBandService.COMMAND_SYNC}); builder.write(getCharacteristic(MiBandService.UUID_CHARACTERISTIC_CONTROL_POINT), new byte[]{MiBandService.COMMAND_SYNC});
builder.wait(1000);
builder.add(new SetProgressAction("Firmware installation complete", false, 100, getContext())); builder.add(new SetProgressAction("Firmware installation complete", false, 100, getContext()));
} else { } else {
GB.updateInstallNotification("Firmware write failed", false, 0, getContext()); GB.updateInstallNotification("Firmware write failed", false, 0, getContext());