简体   繁体   中英

CoreBluetooth never calls didDiscoverServices on iPhone5S

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.

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM