NordicSemiconductor / Android-BLE-Library

A library that makes working with Bluetooth LE on Android a pleasure. Seriously.
BSD 3-Clause "New" or "Revised" License
2.03k stars 417 forks source link

after bonding, then call writeCharacteristic, it fail #479

Closed eaglewangy closed 1 year ago

eaglewangy commented 1 year ago

After bonding, the variable operationInProgress in file BleManagerHandler.java remains true. So calling api writeCharacteristic will fail. It need to reset this variable after bonding.

CLAassistant commented 1 year ago

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.


Ying Wang seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account.
You have signed the CLA already but the status is still pending? Let us recheck it.

philips77 commented 1 year ago

What phone and OS version are you getting this issue?

philips77 commented 1 year ago

Does your device bond after connection or as a result of Insufficient Auth error on GATT operation (read / write)?

eaglewangy commented 1 year ago

What phone and OS version are you getting this issue?

We tested on Galaxy S9(SM-G9600/DS), XiaoMi Mi11 Ultra. It should be a general issue

eaglewangy commented 1 year ago

Does your device bond after connection or as a result of Insufficient Auth error on GATT operation (read / write)?

It bonded successfully. No error reported

philips77 commented 1 year ago

Does your device bond after connection or as a result of Insufficient Auth error on GATT operation (read / write)?

It bonded successfully. No error reported

I was asking when during the connection do you bond to the device. Is the bonding requested from the device side just after connection, or when the central tries to access an attribute, or by a request from the phone?

eaglewangy commented 1 year ago

Does your device bond after connection or as a result of Insufficient Auth error on GATT operation (read / write)?

It bonded successfully. No error reported

I was asking when during the connection do you bond to the device. Is the bonding requested from the device side just after connection, or when the central tries to access an attribute, or by a request from the phone?

The process is:

  1. connect to a bluetooth device.
  2. call writeCharacteristic to send some data.
  3. call ensureBond
  4. call writeCharacteristic, then failed. cause the operationInProgress is true
philips77 commented 1 year ago

Thanks, that should be enough for me to replicate.

eaglewangy commented 1 year ago

Thanks, that should be enough for me to replicate.

Hi Philips, Any progress?

philips77 commented 1 year ago

No, sorry, I still didn't have time to look into it. I hope your fix works for you for now.

eaglewangy commented 1 year ago

No, sorry, I still didn't have time to look into it. I hope your fix works for you for now.

It works for me now. But I want to use the official release including this fix. Is there an ETA

eaglewangy commented 1 year ago

Contributor

No, sorry, I still didn't have time to look into it. I hope your fix works for you for now.

@philips77 Have any progress?

philips77 commented 1 year ago

I still haven't had time to work on this library, sorry.