且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

电源循环蓝牙后重新连接时,应用程序不会发现服务

更新时间:2022-05-13 21:54:46

当你得到centralManager的回调时状态已更改为 CBCentralManagerStatePoweredOff ,您需要遍历所有外围设备并在其上调用 cancelConnection:。那你就好了。

When you get the callback that the centralManager state has changed to CBCentralManagerStatePoweredOff, you need to loop through all your peripherals and call cancelConnection: on them. Then you'll be good to go.

[_yourCentralManager cancelPeripheralConnection:yourPeripheral];