btleplug icon indicating copy to clipboard operation
btleplug copied to clipboard

start_scan when scanning is already in progress

Open hansmbakker opened this issue 3 years ago • 1 comments

If for some reason Adapter.start_scan() is called multiple times (e.g. because of running an app multiple time before the first scan is stopped) then I get an error on Linux: DbusError(D-Bus error: Operation already in progress (org.bluez.Error.InProgress))

I believe there is currently no way to do this safe. The Adapter.session property is private and I'm not sure if that would give a way to check whether a scan is in progress.

Platform: linux Btleplug version: 0.9.2

hansmbakker avatar Mar 06 '22 20:03 hansmbakker

What I did to hotfix this bug in my program is to call Adapter.stop_scan() before any adapter.start_scan()

Link to the code

Yohannfra avatar Oct 29 '22 22:10 Yohannfra