Skip to content

Commit

Permalink
Minor fixes to OSX SimpleControls.
Browse files Browse the repository at this point in the history
  • Loading branch information
Cheong2K committed Apr 23, 2014
1 parent 67ba6b9 commit 50a1508
Showing 1 changed file with 3 additions and 12 deletions.
15 changes: 3 additions & 12 deletions Examples/SimpleControls_OSX/SimpleControls/BLE/BLE.m
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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)
Expand All @@ -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;
}
Expand Down

0 comments on commit 50a1508

Please sign in to comment.