Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
slobodanantonijevic opened this issue Mar 31, 2021 · 0 comments
Labels

Comments

@slobodanantonijevic
Copy link

slobodanantonijevic commented Mar 31, 2021

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant