SpriteOvO / AirPodsDesktop

☄️ AirPods desktop user experience enhancement program, for Windows and Linux (WIP)
GNU General Public License v3.0
1.49k stars 87 forks source link

[Feature Request] Does it support multiple devices? #44

Closed ChinaGuCheng closed 1 year ago

ChinaGuCheng commented 2 years ago

How do multiple devices differentiate, the code seems to use the first received broadcast

ChinaGuCheng commented 2 years ago

I read the code and it seems that the bound device and the broadcasted device are not related

SpriteOvO commented 2 years ago

How do multiple devices differentiate, the code seems to use the first received broadcast

There is currently no way to support multiple devices working at the same time for the following reasons:

  1. We have no way to track AirPods reliably for Apple's privacy reasons (MAC addresses are Random Non-resolvable).
  2. There seems to be no way to determine that received BLE advertisements are broadcast from which device.

I read the code and it seems that the bound device and the broadcasted device are not related

You are right, see the second reason above. winrt does not provide such APIs.

The solution now is that we start processing the received BLE advertisements when the bound device is enabled and we ignore all BLE advertisements when the bound device is disabled. And then we track changes in battery and RSSI values to determine if it is likely to be the user's device and not someone else's device around (code). This solution is not absolutely reliable, but it works in most cases.