Android-DFU-Library icon indicating copy to clipboard operation
Android-DFU-Library copied to clipboard

GATT INVALID HANDLE - We have trouble identifying the source of the problem

Open slobodanantonijevic opened this issue 4 years ago • 0 comments

Information This GitHub Issue page is for reporting issues or asking questions regarding the iOS DFU library. For general DFU questions, SDK questions, etc, please check our DevZone. Make sure you are using the latest version of the library: Download Also, before creating a new issue, make sure similar issue isn't already opened in open or closed issues.

DFU Bootloader version (please complete the following information):

  • SDK version: nRF SDK 15.0.0, Softdevice s132, Version 6.0.0
  • Bonding used: yes
  • Library version: 2.2.4

Device information (please complete the following information):

  • Device: Samsung Galaxy S20, Nokia 7.1, Nokia 7.2, Samsung Galaxy A40, Redmi Note 7 Pro, Redmi Note 9 Pro, Sony Xperia XZ2 Compact
  • OS: Android 10 & Android 11

Your question Now this problem only occurs during the BLE upgrade process, we're completely using nordic lib and have no custom hacketry involved. Also the problem does not occur constantly, only on some devices. Sometimes it only happens once or twice, sometimes it can be persistent for an entire day. Funny thing is at one point the process actually goes through successfully. The devices I've listed above are just the ones we've caught this on from our users by adding diagnostic mechanism to failure cases, we've failed to reproduce this error on same devices on our end. Nor does it happen for majority of the users using the same devices. Another thing we've noticed is that this occurs only after onDfuProcessStarting callback Best explanation I could find was the following

The GATT INVALID HANDLE error indicates that the phone is not doing a re-discovery of the attribute table upon entering DFU mode.

Now the explanation does match the fact that we're expecting a onDfuProcessStarted callback to trigger instead of the error. But we fail to understand if there's anything we can do on our end within the implementation on Android. Or if this is a failure caused by a mishandle on the connected device's side?

Logs We're doing a pretty basic operation here

        val dfuServiceInitiator = DfuServiceInitiator(deviceAddress)
                .setKeepBond(true)
                .setRestoreBond(true)
                .setPrepareDataObjectDelay(300L)
                .setNumberOfRetries(3)
                .setUnsafeExperimentalButtonlessServiceInSecureDfuEnabled(true)
                .setZip(R.raw.v55)

        if (deviceName != null) {
            dfuServiceInitiator.setDeviceName(deviceName)
        }

        dfuServiceInitiator.start(context.applicationContext, BleFirmwareUpgradeService::class.java)
        DfuServiceListenerHelper.registerProgressListener(
            context.applicationContext,
            this,
            deviceAddress
        )

Is there anything else that we could do in this case?

slobodanantonijevic avatar Mar 31 '21 11:03 slobodanantonijevic