From 4f045758a520b58612ba79d8aafb0786009ab6ca Mon Sep 17 00:00:00 2001 From: "Zenko B. Klapko Jr" Date: Wed, 4 Mar 2015 16:24:12 -0500 Subject: [PATCH 1/2] Removing deprecated field CBPeripheral UUID is deprecated (iOS 5 to iOS 7.1) without a long term replacement for >= iOS 8.x --- iPhone Apps/rfduino/RFduino.h | 1 - iPhone Apps/rfduino/RFduino.m | 1 - iPhone Apps/rfduino/RfduinoManager.m | 10 ---------- 3 files changed, 12 deletions(-) diff --git a/iPhone Apps/rfduino/RFduino.h b/iPhone Apps/rfduino/RFduino.h index 4d102c6..f19a9ee 100644 --- a/iPhone Apps/rfduino/RFduino.h +++ b/iPhone Apps/rfduino/RFduino.h @@ -55,7 +55,6 @@ extern NSString *customUUID; @property(strong, nonatomic) RFduinoManager *rfduinoManager; @property(strong, nonatomic) NSString *name; -@property(strong, nonatomic) NSString *UUID; @property(strong, nonatomic) NSData *advertisementData; @property(strong, nonatomic) NSNumber *advertisementRSSI; @property(assign, nonatomic) NSInteger advertisementPackets; diff --git a/iPhone Apps/rfduino/RFduino.m b/iPhone Apps/rfduino/RFduino.m index 789db01..ea0c8f3 100644 --- a/iPhone Apps/rfduino/RFduino.m +++ b/iPhone Apps/rfduino/RFduino.m @@ -90,7 +90,6 @@ @implementation RFduino @synthesize peripheral; @synthesize name; -@synthesize UUID; @synthesize advertisementData; @synthesize advertisementRSSI; @synthesize advertisementPackets; diff --git a/iPhone Apps/rfduino/RfduinoManager.m b/iPhone Apps/rfduino/RfduinoManager.m index dec6846..c2f9511 100644 --- a/iPhone Apps/rfduino/RfduinoManager.m +++ b/iPhone Apps/rfduino/RfduinoManager.m @@ -227,15 +227,6 @@ - (RFduino *)rfduinoForPeripheral:(CBPeripheral *)peripheral - (void)centralManager:(CBCentralManager *)central didDiscoverPeripheral:(CBPeripheral *)peripheral advertisementData:(NSDictionary *)advertisementData RSSI:(NSNumber *)RSSI { // NSLog(@"didDiscoverPeripheral"); - - NSString *uuid = NULL; - if (peripheral.UUID) { - // only returned if you have connected to the device before - uuid = (__bridge_transfer NSString *)CFUUIDCreateString(NULL, peripheral.UUID); - } else { - uuid = @""; - } - bool added = false; RFduino *rfduino = [self rfduinoForPeripheral:peripheral]; @@ -245,7 +236,6 @@ - (void)centralManager:(CBCentralManager *)central didDiscoverPeripheral:(CBPeri rfduino.rfduinoManager = self; rfduino.name = peripheral.name; - rfduino.UUID = uuid; rfduino.peripheral = peripheral; From 4ecaf84fc50c13029010cad71bab8d2d68b348af Mon Sep 17 00:00:00 2001 From: "Zenko B. Klapko Jr" Date: Wed, 4 Mar 2015 16:28:05 -0500 Subject: [PATCH 2/2] Fixing demo due to UUID deprecation by removing the field. --- iPhone Apps/rfduino/ScanViewController.m | 6 ------ 1 file changed, 6 deletions(-) diff --git a/iPhone Apps/rfduino/ScanViewController.m b/iPhone Apps/rfduino/ScanViewController.m index 44d9846..a7ca67a 100755 --- a/iPhone Apps/rfduino/ScanViewController.m +++ b/iPhone Apps/rfduino/ScanViewController.m @@ -132,9 +132,6 @@ - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(N if (rfduino.outOfRange) { start = [UIColor colorWithRed:160/255.0 green:160/255.0 blue:160/255.0 alpha:0.8]; stop = [UIColor colorWithRed:160/255.0 green:160/255.0 blue:160/255.0 alpha:0.2]; - } else if (! rfduino.UUID.length) { - start = [UIColor colorWithRed:224/255.0 green:242/255.0 blue:224/255.0 alpha: 1.0]; - stop = [UIColor colorWithRed:224/255.0 green:242/255.0 blue:224/255.0 alpha: 0.7]; } else { start = [UIColor colorWithRed:253/255.0 green:255/255.0 blue:255/255.0 alpha: 1.0]; stop = [UIColor colorWithRed:253/255.0 green:255/255.0 blue:255/255.0 alpha: 0.7]; @@ -147,8 +144,6 @@ - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(N NSString *text = [[NSString alloc] initWithFormat:@"%@", rfduino.name]; - NSString *uuid = rfduino.UUID; - int rssi = rfduino.advertisementRSSI.intValue; NSString *advertising = @""; @@ -162,7 +157,6 @@ - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(N [detail appendString:@" "]; [detail appendFormat:@"Packets: %d\n", rfduino.advertisementPackets]; [detail appendFormat:@"Advertising: %@\n", advertising]; - [detail appendFormat:@"%@", uuid]; cell.textLabel.text = text; cell.detailTextLabel.text = detail;