NordicSemiconductor / Android-DFU-Library

Device Firmware Update library and Android app
http://www.nordicsemi.com/dfu
BSD 3-Clause "New" or "Revised" License
753 stars 263 forks source link

DfuServiceInitiator requires a new method #444

Open xiaozhao1995 opened 1 month ago

xiaozhao1995 commented 1 month ago

Target

Library

Describe the feature

    /**
     * Sets the time required by the device to reboot. The library will wait for this time to disconnect
     * for the device to make sure device has received BLE_GATTC_EVT_HVX
     *
     * @param disconnectTime the disconnect time in milliseconds,default 0.
     * @return the builder
     */
    public DfuServiceInitiator setDisconnectTimeout(final long disconnectTime) {
        this.disconnectTime = disconnectTime;
        return this;
    }

We found that on some phones, such as Huawei mate30pro, Huawei pura70, if you call (ButtonlessDfuImpl#performDfu)disconnect immediately after receiving 0x200101, the device may not receive the _BLE_GATTC_EVTHVX event, resulting in an interrupt into boot.