diff --git a/Examples/SimpleControls_OSX/SimpleControls/BLE/BLE.m b/Examples/SimpleControls_OSX/SimpleControls/BLE/BLE.m index bcd892f..351ec04 100644 --- a/Examples/SimpleControls_OSX/SimpleControls/BLE/BLE.m +++ b/Examples/SimpleControls_OSX/SimpleControls/BLE/BLE.m @@ -201,8 +201,6 @@ - (int) findBLEPeripherals:(int) timeout - (void)centralManager:(CBCentralManager *)central didDisconnectPeripheral:(CBPeripheral *)peripheral error:(NSError *)error; { - done = false; - [[self delegate] bleDidDisconnect]; isConnected = false; @@ -456,11 +454,8 @@ - (void)centralManager:(CBCentralManager *)central didConnectPeripheral:(CBPerip self.activePeripheral = peripheral; [self.activePeripheral discoverServices:nil]; - [self getAllServicesFromPeripheral:peripheral]; } -static bool done = false; - - (void)peripheral:(CBPeripheral *)peripheral didDiscoverCharacteristicsForService:(CBService *)service error:(NSError *)error { if (!error) @@ -475,13 +470,9 @@ - (void)peripheral:(CBPeripheral *)peripheral didDiscoverCharacteristicsForServi if ([service.UUID isEqual:s.UUID]) { - if (!done) - { - [self enableReadNotification:activePeripheral]; - [[self delegate] bleDidConnect]; - isConnected = true; - done = true; - } + [self enableReadNotification:activePeripheral]; + [[self delegate] bleDidConnect]; + isConnected = true; break; }