This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

pc_ble_driver_py multiple dongles

Does the python driver support multiple dongles? I have a situation where I want to scan with one dongle and connect to devices with a second dongle. However, the collector object that is just for connecting is receiving advertising scan timeout events from the scanning object. How can this happen unless the BLEDriver or BLEAdapter classes are acting like singletons?

EDIT 1: I am overriding the on_gap_evt_timeout method in my collector, which is a subclass of BLEDriverObserver and BLEAdapterObserver as well as threading.Thread.

In the collector that is only for connecting (no scanning) I still occasionally get BLEGapTimeoutSrc.scan events. Any idea how this could happen?

EDIT 2: I am running instances of my collectors in different threads. Looking at the ble_driver.py I see module variables being used which tells me that it might not be thread safe. Is this module thread safe?

Related