CoreBluetooth never calls didDiscoverServices on iPhone5S

孤街浪徒 提交于 2019-12-10 15:15:08

问题


Most of the time, the app we are coding works quite well with our BLE peripheral. Often for iPhone 5S users the device gets in a funk and whenever we scan for services, the didDiscoverServices: delegate method is never called. Rebooting the device or deleting all settings (General -> Reset -> Reset all settings) fixes the problem temporarily.

Once the device exhibits this problem, even other apps (eg. LightBlue) are affected; no peripherals are able to discover services until a reboot.

For context, our BLE peripheral does not currently support pairing.

What is causing this problem? Are there any ways to avoid causing the instability? Once it happens, is there a way that the app can recover from it automatically?

Some issues with similar symptoms: App doesn't Discover Services When Reconnecting and Not Scanning for Services in iPad Air

Update: Just FYI, I'm still working on this problem, but something we did caused it to happen way less (therefore it's not really a priority ATM). I don't know what caused the added stability yet.


回答1:


It's probably an iOS bug

1) Enable bluetooth logging on your device https://developer.apple.com/bug-reporting/ios/bluetooth/

2) Use a packet sniffer to observe the connection between iOS and BLE peripheral



来源:https://stackoverflow.com/questions/23435809/corebluetooth-never-calls-diddiscoverservices-on-iphone5s

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!