简体   繁体   中英

BLE not a valid peripheral

Sometimes in random moments (usually after background disconnect) I have a strange bug with connection

WARNING: <CBPeripheral: 0x1c4109ea0, identifier = 6040FFF8-6E53-4776-ABF7-9632093B2DB5, name = XXXXXXXX, state = connecting> is not a valid peripheral

I checked connection status on BLE device and app was connected but didn't subscribe for notifications. On app, state was connecting. The only way to reconnect properly after this bug is to close and open app again. What can I do to prevent this situation?

Please make sure, if you are connecting any BLE device multiple times, then before connecting device again it should be disconnected. As From your scenario, it seems that you are connecting a BLE device again n again without disconnecting it.

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