Created
July 27, 2018 08:36
-
-
Save SunXiaoShan/252d3f013b83d00beb44e3ba4e12166d to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| - (void)centralManager:(CBCentralManager *)central | |
| didConnectPeripheral:(CBPeripheral *)peripheral { | |
| [self.centralManager stopScan]; | |
| peripheral.delegate = self; | |
| [peripheral discoverServices:@[[CBUUID UUIDWithString:kServiceUUID]]]; | |
| } | |
| - (void)centralManager:(CBCentralManager *)central | |
| didFailToConnectPeripheral:(CBPeripheral *)peripheral | |
| error:(NSError *)error { | |
| [self cleanup:peripheral]; | |
| } | |
| - (void)cleanup:(CBPeripheral *)cbPeripheral { | |
| [self.centralManager cancelPeripheralConnection:cbPeripheral]; | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment