Permalink
Browse files

reenabled peer-to-peer

  • Loading branch information...
1 parent dcabedc commit 0be751b9bb0f6edba9c650058a34c6a9545955e6 @timburks committed Sep 9, 2012
Showing with 6 additions and 5 deletions.
  1. +6 −5 CBSample/SampleClient.m
View
11 CBSample/SampleClient.m
@@ -8,6 +8,8 @@
#import "SampleClient.h"
#import "Common.h"
+#define FLASH_TIME 0.5
+
@interface SampleClient () <CBCentralManagerDelegate, CBPeripheralDelegate>
@property (nonatomic, strong) CBCentralManager *manager;
@@ -352,7 +354,6 @@ - (void)peripheral:(CBPeripheral *)peripheral
return;
}
-#ifdef DONTDOTHIS
if([service.UUID isEqual:[CBUUID UUIDWithString:SAMPLE_SERVICE]]) {
for (CBCharacteristic *characteristic in service.characteristics) {
NSLog(@"discovered characteristic %@", characteristic.UUID);
@@ -382,7 +383,7 @@ - (void)peripheral:(CBPeripheral *)peripheral
}
}
}
-#endif
+
if([service.UUID isEqual:[CBUUID UUIDWithString:@"A696CB2B-F3A4-4240-B74D-C457C253857B"]]) {
for (CBCharacteristic *characteristic in service.characteristics) {
NSLog(@"discovered characteristic %@", characteristic.UUID);
@@ -400,7 +401,7 @@ - (void)peripheral:(CBPeripheral *)peripheral
forCharacteristic:self.LEDcharacteristic
type:CBCharacteristicWriteWithResponse];
- [self performSelector:@selector(disableLED:) withObject:nil afterDelay:0.00];
+ [self performSelector:@selector(disableLED:) withObject:nil afterDelay:FLASH_TIME];
}
}
}
@@ -417,7 +418,7 @@ - (void) disableLED:(id) sender {
[self.peripheral writeValue:data
forCharacteristic:self.LEDcharacteristic
type:CBCharacteristicWriteWithResponse];
- [self performSelector:@selector(enableLED:) withObject:nil afterDelay:0.00];
+ [self performSelector:@selector(enableLED:) withObject:nil afterDelay:FLASH_TIME];
}
- (void) enableLED:(id) sender {
@@ -427,7 +428,7 @@ - (void) enableLED:(id) sender {
[self.peripheral writeValue:data
forCharacteristic:self.LEDcharacteristic
type:CBCharacteristicWriteWithResponse];
- [self performSelector:@selector(disableLED:) withObject:nil afterDelay:0.00];
+ [self performSelector:@selector(disableLED:) withObject:nil afterDelay:FLASH_TIME];
}

0 comments on commit 0be751b

Please sign in to comment.