File tree Expand file tree Collapse file tree 3 files changed +8
-15
lines changed
Examples/BLEChat_Central_OSX/BLEChat_Central_OSX Expand file tree Collapse file tree 3 files changed +8
-15
lines changed Original file line number Diff line number Diff line change @@ -203,8 +203,6 @@ - (int) findBLEPeripherals:(int) timeout
203203
204204- (void )centralManager : (CBCentralManager *)central didDisconnectPeripheral : (CBPeripheral *)peripheral error : (NSError *)error ;
205205{
206- done = false ;
207-
208206 [[self delegate ] bleDidDisconnect ];
209207
210208 isConnected = false ;
@@ -458,11 +456,8 @@ - (void)centralManager:(CBCentralManager *)central didConnectPeripheral:(CBPerip
458456
459457 self.activePeripheral = peripheral;
460458 [self .activePeripheral discoverServices: nil ];
461- [self getAllServicesFromPeripheral: peripheral];
462459}
463460
464- static bool done = false ;
465-
466461- (void )peripheral : (CBPeripheral *)peripheral didDiscoverCharacteristicsForService : (CBService *)service error : (NSError *)error
467462{
468463 if (!error)
@@ -477,13 +472,9 @@ - (void)peripheral:(CBPeripheral *)peripheral didDiscoverCharacteristicsForServi
477472
478473 if ([service.UUID isEqual: s.UUID])
479474 {
480- if (!done)
481- {
482- [self enableReadNotification: activePeripheral];
483- [[self delegate ] bleDidConnect ];
484- isConnected = true ;
485- done = true ;
486- }
475+ [self enableReadNotification: activePeripheral];
476+ [[self delegate ] bleDidConnect ];
477+ isConnected = true ;
487478
488479 break ;
489480 }
Original file line number Diff line number Diff line change 11<?xml version =" 1.0" encoding =" UTF-8" standalone =" no" ?>
2- <document type =" com.apple.InterfaceBuilder3.Cocoa.XIB" version =" 3.0" toolsVersion =" 4514 " systemVersion =" 13C64" targetRuntime =" MacOSX.Cocoa" propertyAccessControl =" none" useAutolayout =" YES" >
2+ <document type =" com.apple.InterfaceBuilder3.Cocoa.XIB" version =" 3.0" toolsVersion =" 5056 " systemVersion =" 13C64" targetRuntime =" MacOSX.Cocoa" propertyAccessControl =" none" useAutolayout =" YES" >
33 <dependencies >
4- <plugIn identifier =" com.apple.InterfaceBuilder.CocoaPlugin" version =" 4514 " />
4+ <plugIn identifier =" com.apple.InterfaceBuilder.CocoaPlugin" version =" 5056 " />
55 </dependencies >
66 <objects >
77 <customObject id =" -2" userLabel =" File's Owner" customClass =" NSApplication" >
743743 </customObject >
744744 <customObject id =" 420" customClass =" NSFontManager" />
745745 </objects >
746- </document >
746+ </document >
Original file line number Diff line number Diff line change @@ -38,6 +38,8 @@ -(void) bleDidConnect
3838
3939 btnConnect.title = @" Disconnect" ;
4040 [indConnect stopAnimation: self ];
41+
42+ [ble readRSSI ];
4143}
4244
4345- (void )bleDidDisconnect
You can’t perform that action at this time.
0 commit comments