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

requestLEScan: Max gatt client reached: 32, no response from capacitor #655

Open
andrew-aladjev opened this issue May 20, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@andrew-aladjev
Copy link

andrew-aladjev commented May 20, 2024

Describe the bug
Gatt leaks in Android BLE. It is well know thing, but capacitor ble plugin didn't provide a way to handle this issue.

To Reproduce
Steps to reproduce the behavior:

  1. Try to use requestLEScan in android app.
  2. Destroy app process during scan (don't call stopLEScan).
  3. Repeat this thing 32 times.
Capacitor/Plugin: To native (Capacitor plugin): callbackId: 7257068, pluginId: BluetoothLe, methodName: addListener
Capacitor: callback: 7257068, pluginId: BluetoothLe, methodName: addListener, methodData: {"eventName":"onScanResult"}
Capacitor/Plugin: To native (Capacitor plugin): callbackId: 7257069, pluginId: BluetoothLe, methodName: requestLEScan
Capacitor: callback: 7257069, pluginId: BluetoothLe, methodName: requestLEScan, methodData: {"services":[],"allowDuplicates":true}
DeviceScanner: Start scanning.
BluetoothAdapter: isLeEnabled(): ON
bt_stack: [INFO:le_scanning_manager.cc(141)] RegisterScanner in shim layer
bluetooth: packages/modules/Bluetooth/system/gd/hci/le_scanning_manager.cc:597 register_scanner: Unable to register scanner, max client reached:32
BluetoothLeScanner: onScannerRegistered() - status=128 scannerId=0 mScannerId=0
Capacitor/Console: File: http://localhost/ - Line 232 - Msg: undefined

I wanted to handle this error and restart BLE, but capacitor is not capable to produce this error. I mean requestLEScan is not calling callbacks, is not throwing errors, it just hangs silently.

Expected behavior
requestLEScan throws some error.

Plugin version:

  • @capacitor-community/bluetooth-le: [3.1.4]

Smartphone (please complete the following information):

  • Device: Google Pixel 7a API 33
  • OS: Android 13
@andrew-aladjev andrew-aladjev added the bug Something isn't working label May 20, 2024
@andrew-aladjev
Copy link
Author

I have a good news: I can't reproduce this issue anymore in v6.0.0.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant