File tree 3 files changed +8
-15
lines changed
Examples/BLEChat_Central_OSX/BLEChat_Central_OSX
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
203
203
204
204
- (void )centralManager : (CBCentralManager *)central didDisconnectPeripheral : (CBPeripheral *)peripheral error : (NSError *)error ;
205
205
{
206
- done = false ;
207
-
208
206
[[self delegate ] bleDidDisconnect ];
209
207
210
208
isConnected = false ;
@@ -458,11 +456,8 @@ - (void)centralManager:(CBCentralManager *)central didConnectPeripheral:(CBPerip
458
456
459
457
self.activePeripheral = peripheral;
460
458
[self .activePeripheral discoverServices: nil ];
461
- [self getAllServicesFromPeripheral: peripheral];
462
459
}
463
460
464
- static bool done = false ;
465
-
466
461
- (void )peripheral : (CBPeripheral *)peripheral didDiscoverCharacteristicsForService : (CBService *)service error : (NSError *)error
467
462
{
468
463
if (!error)
@@ -477,13 +472,9 @@ - (void)peripheral:(CBPeripheral *)peripheral didDiscoverCharacteristicsForServi
477
472
478
473
if ([service.UUID isEqual: s.UUID])
479
474
{
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 ;
487
478
488
479
break ;
489
480
}
Original file line number Diff line number Diff line change 1
1
<?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" >
3
3
<dependencies >
4
- <plugIn identifier =" com.apple.InterfaceBuilder.CocoaPlugin" version =" 4514 " />
4
+ <plugIn identifier =" com.apple.InterfaceBuilder.CocoaPlugin" version =" 5056 " />
5
5
</dependencies >
6
6
<objects >
7
7
<customObject id =" -2" userLabel =" File's Owner" customClass =" NSApplication" >
743
743
</customObject >
744
744
<customObject id =" 420" customClass =" NSFontManager" />
745
745
</objects >
746
- </document >
746
+ </document >
Original file line number Diff line number Diff line change @@ -38,6 +38,8 @@ -(void) bleDidConnect
38
38
39
39
btnConnect.title = @" Disconnect" ;
40
40
[indConnect stopAnimation: self ];
41
+
42
+ [ble readRSSI ];
41
43
}
42
44
43
45
- (void )bleDidDisconnect
You can’t perform that action at this time.
0 commit comments