Skip to content

Commit

Permalink
Minor fixes.
Browse files Browse the repository at this point in the history
  • Loading branch information
Cheong2K committed Apr 17, 2014
1 parent 50867bc commit 67ba6b9
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 15 deletions.
15 changes: 3 additions & 12 deletions Examples/BLEChat_Central_OSX/BLEChat_Central_OSX/BLE/BLE.m
Original file line number Diff line number Diff line change
Expand Up @@ -203,8 +203,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 @@ -458,11 +456,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 @@ -477,13 +472,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
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="4514" systemVersion="13C64" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES">
<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="5056" systemVersion="13C64" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES">
<dependencies>
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="4514"/>
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="5056"/>
</dependencies>
<objects>
<customObject id="-2" userLabel="File's Owner" customClass="NSApplication">
Expand Down Expand Up @@ -743,4 +743,4 @@
</customObject>
<customObject id="420" customClass="NSFontManager"/>
</objects>
</document>
</document>
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@ -(void) bleDidConnect

btnConnect.title = @"Disconnect";
[indConnect stopAnimation:self];

[ble readRSSI];
}

- (void)bleDidDisconnect
Expand Down

0 comments on commit 67ba6b9

Please sign in to comment.