简体   繁体   English

iOS6不会断开Bluetooth Smart / LE外围设备的连接

[英]iOS6 does not disconnect Bluetooth Smart/LE Peripheral

Before upgrading to iOS6, it all worked fine, but now when I run 升级到iOS6之前,一切正常,但是现在我运行

[centralManager cancelPeripheralConnection:peripheral];

the callback gets triggered 回调被触发

-(void) centralManager:(CBCentralManager *)central didDisconnectPeripheral:(CBPeripheral     *)peripheral error:(NSError *)error{
NSLog(@"Disconnected");
NSLog(@"Error: %@", [error localizedDescription]);
}

and the console outputs 和控制台输出

Disconnected
Error: (null)

Still, the peripheral isn't disconnected until I either turn of bluetooth in settings or turn of the phone (I have a connected status on the peripheral). 尽管如此,直到我在设置中打开蓝牙或关闭手机(我的外围设备处于连接状态)之前,外设并没有断开连接。 Has anyone else discovered this iOS6 specific problem? 有没有其他人发现这个iOS6特定的问题?

I believe this is a feature (if you would like to call it that) of iOS6. 我相信这是iOS6的一项功能(如果您要称呼它的话)。

It's just a way of not disrupting other applications that might use the connection (or it might be in the middle of a pairing procedure). 这只是不破坏可能使用该连接的其他应用程序的一种方法(或者可能处于配对过程的中间)。 It may take up to 45 seconds before it is disconnected. 断开连接最多可能需要45秒钟。

If possible the best solution might be to trigger the disconnect from the peripheral, then the disconnect would happen straight away. 如果可能的话,最好的解决方案是触发与外围设备的断开连接,那么断开连接将立即发生。

http://lists.apple.com/archives/bluetooth-dev/2012/Sep/msg00090.html http://lists.apple.com/archives/bluetooth-dev/2012/Sep/msg00090.html

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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