On Fri Feb 21 10:01:24 2025 +0000, Elizabeth Figura wrote:
As usual I'm trusting that the bluez/dbus logic makes sense, the other side of the glue seems broadly sensible. I guess the library doesn't actually provide us with any way to just query the total number of devices at any given time? It would avoid having to keep track of devices in the first place...
Thanks.
I guess the library doesn't actually provide us with any way to just query the total number of devices at any given time? It would avoid having to keep track of devices in the first place...
There is one to get all BlueZ objects, `GetManagedObjects`, it's how we build the list of initially known devices and local radios. However, we'll also need to create device PDOs under the `BTHENUM` enumerator minidriver for every remote device in the future (which requires using signals from DBus to track them), as the [BLE API](https://learn.microsoft.com/en-us/windows/win32/api/bluetoothleapis/) is implemented as IOCTLs to the device HANDLE (while the regular methods in bluetoothapis call the radio itself).
In such a case, using `GetManagedObjects` here can be potentially racy if a new device has been discovered, but BlueZ hasn't gotten around to emitting an `InterfacesAdded` signal for it yet, but `GetManagedObjects` does include it.