CoreBluetooth advertising detection time

前端 未结 2 798
佛祖请我去吃肉
佛祖请我去吃肉 2021-02-03 14:22

This issue has been discussed back in October here. This is a new question as CoreBluetooth is fairly new and some changes might have occurred since then.

I have a BLE d

2条回答
  •  被撕碎了的回忆
    2021-02-03 14:56

    Though this is an old thread, I see the same problem in macOS High Sierra 10.13.3 on my MacBook Pro (15-inch, 2017). The problem varies by peripheral device where "Apple TV" tends to always show up quickly, perhaps because it has a short advertising time. Some peripherals take a long time to show up or do not seem to show up at all. Also, if advertising is too slow, then connecting also can be slow since connection occurs by first finding an advertisement and responding to it at a very short fixed time afterwards (the peripheral is listening during that time).

    I found a workaround for this problem which is to turn off BOTH Wi-Fi and Handoff. One turns off Handoff by going into Apple - System Preferences - General and unchecking "Allow Handoff between this Mac and your iCloud devices". Not only does this make scans show up advertising packets more quickly and connections be faster, it also shows a higher (less negative) RSSI representing a stronger signal strength being received.

    Note that the problem does not show up in iOS, possibly due to better BT and Wi-Fi co-existence support and between Handoff (Airdrop) and regular BLE usage. The issue appears to only be one of the proportion of BLE listening time during scan and connect. Once a connection is established, there does not appear to be as much interference. In part, this is due to the fact that after one connects there are automatic low-level BLE retries and frequency hopping between connection intervals. During scanning and establishing a connection (both of which rely on seeing advertising packets) one should be sequentially monitoring the 3 BLE advertising channels but macOS behaves as if it is not doing that. Technically, the advertising channels do not overlap with the Wi-Fi channels (see http://www.argenox.com/a-ble-advertising-primer/).

提交回复
热议问题