labapart / gattlib

Library to access GATT information from BLE (Bluetooth Low Energy) devices
http://labapart.com/
436 stars 157 forks source link

Scanning fails once notifications are started and then stop #200

Open MogheesBinZahid opened 3 years ago

MogheesBinZahid commented 3 years ago

Background:

We are using Raspberry Pi 3B+. We want to run scanning in one thread to detect present devices and want to run notification in another thread to read response from devices.

Problem:

We are running scan in main thread and notification in separate thread. We are running notification using default context. Scanning is running properly until notification is started and stopped. The problem I think is that the default context is not closing properly when we stop notification. After notification is run once we start receiving following error message when scan is run again


Failed to start discovery: GDBus.Error:org.bluez.Error.InProgress: Operation already in progress 6, ERROR: Failed to scan.

Code Snippet:

image