Iphone iOS6不会断开蓝牙智能/LE外围设备的连接
在升级到iOS6之前,一切都很好,但现在当我运行Iphone iOS6不会断开蓝牙智能/LE外围设备的连接,iphone,core-bluetooth,bluetooth-lowenergy,disconnect,Iphone,Core Bluetooth,Bluetooth Lowenergy,Disconnect,在升级到iOS6之前,一切都很好,但现在当我运行 [centralManager cancelPeripheralConnection:peripheral]; 回调被触发 -(void) centralManager:(CBCentralManager *)central didDisconnectPeripheral:(CBPeripheral *)peripheral error:(NSError *)error{ NSLog(@"Disconnected"); NSLog(@"
[centralManager cancelPeripheralConnection:peripheral];
回调被触发
-(void) centralManager:(CBCentralManager *)central didDisconnectPeripheral:(CBPeripheral *)peripheral error:(NSError *)error{
NSLog(@"Disconnected");
NSLog(@"Error: %@", [error localizedDescription]);
}
和控制台输出
Disconnected
Error: (null)
不过,直到我在设置中打开蓝牙或打开手机(我的外设处于已连接状态),外设才会断开连接。是否有其他人发现了此iOS6特定问题 我相信这是iOS6的一个特性(如果你愿意这样称呼的话)
这只是一种不中断可能使用连接的其他应用程序的方法(或者它可能在配对过程的中间)。断开连接可能需要45秒的时间
如果可能,最好的解决方案可能是触发与外围设备的断开连接,然后断开连接将立即发生听到这个消息很难过。我的外围设备是一架直升机,断开连接用于关闭发动机,所以可能我只需要在断开连接之前发送0-data。非常感谢。