Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我的应用程序使用scanForPeripheralsWithServices:扫描BLE设备,参数指定servicesUUIDs数组,有时可以快速发现外围设备,但有时需要等待片刻。我的应用程序是会话后台。那么,我怎样才能尽快发现外围设备背景。
当应用程序在后台时,iOS 会不时启用蓝牙,但并不总是在监听。这是为了节省电池,因为 WiFi 和蓝牙共享同一天线,不能同时发送。如果您可以访问外围设备实现,为了使其尽快发现您的外围设备,请确保外围设备尽可能频繁地宣传自己。我相信 Apple 建议至少每 20 毫秒一次。