Advertised UUIDs are erased on subsequent calls to CentralDelegateManager scanner callback #329
Labels
Backend: Core Bluetooth
Issues and PRs relating to the Core Bluetooth backend
bug
Something isn't working
bluetoothctl -v
) in case of Linux: N/ADescription
When calling
BleakScanner.discover()
on macOS, devices which advertise service UUIDs are returned withdevice.metadata["uuids"]
empty. For each of these devices, multiple calls are made toCentralManagerDelegate.did_discover_peripheral()
. Each call to this function calls the following function,callback()
, defined insideBleakScannerCoreBluetooth.start()
:If
callback()
is called multiple times,self._identifiers[p.identifier()]
will only contain the advertising dataa
passed in on the final call.Proposed Solution
I was able to fix the issue for my use case by changing
callback()
to the following:This change merges the advertising data objects according to the method described in this stackoverflow post. However, I am not familiar enough with this library to know if this could cause other adverse effects. Please let me know if this solution makes sense, or how I should test it.
The text was updated successfully, but these errors were encountered: