문제

Before upgrading to iOS6, it all worked fine, but now when I run

[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?

도움이 되었습니까?

해결책

I believe this is a feature (if you would like to call it that) of 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.

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

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top