gattlib icon indicating copy to clipboard operation
gattlib copied to clipboard

scan takes forever and no timeout

Open terrancewong opened this issue 1 year ago • 0 comments

  • gattlib version: Release 0.7.2
  • Debian testing (trixie)
  • bluez: 5.77-1
  • 8087:0032 Intel Corp. AX210 Bluetooth

examples/notification/notification sometimes scan discovers nothing, and never timeout, just stuck there. Ececuting examples/ble_scan/ble_scan or notification again and again occasionally triggers something, then notification can find my device.

#define BLE_SCAN_TIMEOUT 10
...
gattlib_adapter_scan_enable(adapter, ble_discovered_device, BLE_SCAN_TIMEOUT, addr);

command log

 % ./examples/notification/notification 5C:53:10:B7:D9:4B ffe4
[22797.607] Scanning...
^C  # waited for more than 1min
 % ./examples/notification/notification 5C:53:10:B7:D9:4B ffe4
[22883.581] Scanning...
^C # waited for more than 1min
 % ./examples/notification/notification 5C:53:10:B7:D9:4B ffe4
[22948.065] Scanning...
gattlib_notification: Found bluetooth device '5C:53:10:B7:D9:4B' with RSSI:-60
gattlib_notification: Wait for notification for 30 seconds...
[22968.614] Notification Handler: 00 97 7e 74 00 ab 0a 2b 15 2c 00 00 18 9c 39 
...
 % ./examples/notification/notification 5C:53:10:B7:D9:4B ffe4
[23060.784] Scanning...
# stuck again

terrancewong avatar Sep 30 '24 05:09 terrancewong