Core Bluetooth - Apple Inc. · 2016. 7. 10. · Evolution of Core Bluetooth Core Bluetooth in iOS 7...
Transcript of Core Bluetooth - Apple Inc. · 2016. 7. 10. · Evolution of Core Bluetooth Core Bluetooth in iOS 7...
![Page 1: Core Bluetooth - Apple Inc. · 2016. 7. 10. · Evolution of Core Bluetooth Core Bluetooth in iOS 7 Code Demo Tips and Best Practices. BLE State of the Union Evolution of Core Bluetooth](https://reader031.fdocuments.net/reader031/viewer/2022013018/5fd74962042a917b5c0990d9/html5/thumbnails/1.jpg)
These are confidential sessions—please refrain from streaming, blogging, or taking pictures
Session 703
Core Bluetooth
Jason ConnCode Monkey & Radio Sponge
Brian TuckerBluetooth SIG Grand Wizard
Renaud LienhartKeeper of the Code & General Curmudgeon
![Page 2: Core Bluetooth - Apple Inc. · 2016. 7. 10. · Evolution of Core Bluetooth Core Bluetooth in iOS 7 Code Demo Tips and Best Practices. BLE State of the Union Evolution of Core Bluetooth](https://reader031.fdocuments.net/reader031/viewer/2022013018/5fd74962042a917b5c0990d9/html5/thumbnails/2.jpg)
BLE State of the Union
Evolution of Core Bluetooth
Core Bluetooth in iOS 7
Code Demo
Tips and Best Practices
![Page 3: Core Bluetooth - Apple Inc. · 2016. 7. 10. · Evolution of Core Bluetooth Core Bluetooth in iOS 7 Code Demo Tips and Best Practices. BLE State of the Union Evolution of Core Bluetooth](https://reader031.fdocuments.net/reader031/viewer/2022013018/5fd74962042a917b5c0990d9/html5/thumbnails/3.jpg)
BLE State of the Union
Evolution of Core Bluetooth
Core Bluetooth in iOS 7
Code Demo
Tips and Best Practices
![Page 4: Core Bluetooth - Apple Inc. · 2016. 7. 10. · Evolution of Core Bluetooth Core Bluetooth in iOS 7 Code Demo Tips and Best Practices. BLE State of the Union Evolution of Core Bluetooth](https://reader031.fdocuments.net/reader031/viewer/2022013018/5fd74962042a917b5c0990d9/html5/thumbnails/4.jpg)
BLE State of the Union
Evolution of Core Bluetooth
Core Bluetooth in iOS 7
Code Demo
Tips and Best Practices
![Page 5: Core Bluetooth - Apple Inc. · 2016. 7. 10. · Evolution of Core Bluetooth Core Bluetooth in iOS 7 Code Demo Tips and Best Practices. BLE State of the Union Evolution of Core Bluetooth](https://reader031.fdocuments.net/reader031/viewer/2022013018/5fd74962042a917b5c0990d9/html5/thumbnails/5.jpg)
BLE State of the Union
Evolution of Core Bluetooth
Core Bluetooth in iOS 7
Code Demo
Tips and Best Practices
![Page 6: Core Bluetooth - Apple Inc. · 2016. 7. 10. · Evolution of Core Bluetooth Core Bluetooth in iOS 7 Code Demo Tips and Best Practices. BLE State of the Union Evolution of Core Bluetooth](https://reader031.fdocuments.net/reader031/viewer/2022013018/5fd74962042a917b5c0990d9/html5/thumbnails/6.jpg)
BLE State of the Union
Evolution of Core Bluetooth
Core Bluetooth in iOS 7
Code Demo
Tips and Best Practices
![Page 7: Core Bluetooth - Apple Inc. · 2016. 7. 10. · Evolution of Core Bluetooth Core Bluetooth in iOS 7 Code Demo Tips and Best Practices. BLE State of the Union Evolution of Core Bluetooth](https://reader031.fdocuments.net/reader031/viewer/2022013018/5fd74962042a917b5c0990d9/html5/thumbnails/7.jpg)
BLE State of the Union
Evolution of Core Bluetooth
Core Bluetooth in iOS 7
Code Demo
Tips and Best Practices
![Page 8: Core Bluetooth - Apple Inc. · 2016. 7. 10. · Evolution of Core Bluetooth Core Bluetooth in iOS 7 Code Demo Tips and Best Practices. BLE State of the Union Evolution of Core Bluetooth](https://reader031.fdocuments.net/reader031/viewer/2022013018/5fd74962042a917b5c0990d9/html5/thumbnails/8.jpg)
BLE: State of the Union
Brian TuckerBluetooth SIG Grand Wizard
![Page 9: Core Bluetooth - Apple Inc. · 2016. 7. 10. · Evolution of Core Bluetooth Core Bluetooth in iOS 7 Code Demo Tips and Best Practices. BLE State of the Union Evolution of Core Bluetooth](https://reader031.fdocuments.net/reader031/viewer/2022013018/5fd74962042a917b5c0990d9/html5/thumbnails/9.jpg)
![Page 10: Core Bluetooth - Apple Inc. · 2016. 7. 10. · Evolution of Core Bluetooth Core Bluetooth in iOS 7 Code Demo Tips and Best Practices. BLE State of the Union Evolution of Core Bluetooth](https://reader031.fdocuments.net/reader031/viewer/2022013018/5fd74962042a917b5c0990d9/html5/thumbnails/10.jpg)
Source ABI Research 2013
Projected BLE Accessories Shipped1 Billion+
![Page 11: Core Bluetooth - Apple Inc. · 2016. 7. 10. · Evolution of Core Bluetooth Core Bluetooth in iOS 7 Code Demo Tips and Best Practices. BLE State of the Union Evolution of Core Bluetooth](https://reader031.fdocuments.net/reader031/viewer/2022013018/5fd74962042a917b5c0990d9/html5/thumbnails/11.jpg)
Projected BLE Accessories Shipped
0
750
1,500
2,250
3,000
2012 2013 2014 2015 2016 2017 2018
Source ABI Research 2013
1,009,000,000 Devices
![Page 12: Core Bluetooth - Apple Inc. · 2016. 7. 10. · Evolution of Core Bluetooth Core Bluetooth in iOS 7 Code Demo Tips and Best Practices. BLE State of the Union Evolution of Core Bluetooth](https://reader031.fdocuments.net/reader031/viewer/2022013018/5fd74962042a917b5c0990d9/html5/thumbnails/12.jpg)
Proximity
Security
Automation
Health Care Sports/Fitness
Entertainment Toys
Pay Systems Time Services
![Page 13: Core Bluetooth - Apple Inc. · 2016. 7. 10. · Evolution of Core Bluetooth Core Bluetooth in iOS 7 Code Demo Tips and Best Practices. BLE State of the Union Evolution of Core Bluetooth](https://reader031.fdocuments.net/reader031/viewer/2022013018/5fd74962042a917b5c0990d9/html5/thumbnails/13.jpg)
Evolution of Core Bluetooth
Renaud LienhartKeeper of the Code & General Curmudgeon
![Page 14: Core Bluetooth - Apple Inc. · 2016. 7. 10. · Evolution of Core Bluetooth Core Bluetooth in iOS 7 Code Demo Tips and Best Practices. BLE State of the Union Evolution of Core Bluetooth](https://reader031.fdocuments.net/reader031/viewer/2022013018/5fd74962042a917b5c0990d9/html5/thumbnails/14.jpg)
Observer, Central, Client
• CBCentralManager■ Discover peripherals■ Connect
• CBPeripheral■ Access remote services
iOS 5
![Page 15: Core Bluetooth - Apple Inc. · 2016. 7. 10. · Evolution of Core Bluetooth Core Bluetooth in iOS 7 Code Demo Tips and Best Practices. BLE State of the Union Evolution of Core Bluetooth](https://reader031.fdocuments.net/reader031/viewer/2022013018/5fd74962042a917b5c0990d9/html5/thumbnails/15.jpg)
Broadcaster, Peripheral, ServeriOS 6
• CBPeripheralManager■ Host services■ Advertise information■ Field CBCentral requests
• Peripheral database caching
![Page 16: Core Bluetooth - Apple Inc. · 2016. 7. 10. · Evolution of Core Bluetooth Core Bluetooth in iOS 7 Code Demo Tips and Best Practices. BLE State of the Union Evolution of Core Bluetooth](https://reader031.fdocuments.net/reader031/viewer/2022013018/5fd74962042a917b5c0990d9/html5/thumbnails/16.jpg)
LE, EvolvedCore Bluetooth in iOS 7.0
![Page 17: Core Bluetooth - Apple Inc. · 2016. 7. 10. · Evolution of Core Bluetooth Core Bluetooth in iOS 7 Code Demo Tips and Best Practices. BLE State of the Union Evolution of Core Bluetooth](https://reader031.fdocuments.net/reader031/viewer/2022013018/5fd74962042a917b5c0990d9/html5/thumbnails/17.jpg)
Ch-ch-ch-changes
• Simpler device management• Smarter peripherals• Performance improvements•Application persistence• Built-in services
What’s New
![Page 18: Core Bluetooth - Apple Inc. · 2016. 7. 10. · Evolution of Core Bluetooth Core Bluetooth in iOS 7 Code Demo Tips and Best Practices. BLE State of the Union Evolution of Core Bluetooth](https://reader031.fdocuments.net/reader031/viewer/2022013018/5fd74962042a917b5c0990d9/html5/thumbnails/18.jpg)
![Page 19: Core Bluetooth - Apple Inc. · 2016. 7. 10. · Evolution of Core Bluetooth Core Bluetooth in iOS 7 Code Demo Tips and Best Practices. BLE State of the Union Evolution of Core Bluetooth](https://reader031.fdocuments.net/reader031/viewer/2022013018/5fd74962042a917b5c0990d9/html5/thumbnails/19.jpg)
![Page 20: Core Bluetooth - Apple Inc. · 2016. 7. 10. · Evolution of Core Bluetooth Core Bluetooth in iOS 7 Code Demo Tips and Best Practices. BLE State of the Union Evolution of Core Bluetooth](https://reader031.fdocuments.net/reader031/viewer/2022013018/5fd74962042a917b5c0990d9/html5/thumbnails/20.jpg)
That is the questionTo Simulate, or Not to Simulate
• Emerging market • Limited hardware available
■ No iOS devices
•Development difficult
![Page 21: Core Bluetooth - Apple Inc. · 2016. 7. 10. · Evolution of Core Bluetooth Core Bluetooth in iOS 7 Code Demo Tips and Best Practices. BLE State of the Union Evolution of Core Bluetooth](https://reader031.fdocuments.net/reader031/viewer/2022013018/5fd74962042a917b5c0990d9/html5/thumbnails/21.jpg)
That is the questionTo Simulate, or Not to Simulate
• Exploding market•Many LE-compatible devices
■ All iOS hardware■ Macbook, Mac mini
• Third-party development kits
![Page 22: Core Bluetooth - Apple Inc. · 2016. 7. 10. · Evolution of Core Bluetooth Core Bluetooth in iOS 7 Code Demo Tips and Best Practices. BLE State of the Union Evolution of Core Bluetooth](https://reader031.fdocuments.net/reader031/viewer/2022013018/5fd74962042a917b5c0990d9/html5/thumbnails/22.jpg)
That is the questionTo Simulate, or Not to Simulate
• Exploding market•Many LE-compatible devices
■ All iOS hardware■ Macbook, Mac mini
• Third-party development kits
![Page 23: Core Bluetooth - Apple Inc. · 2016. 7. 10. · Evolution of Core Bluetooth Core Bluetooth in iOS 7 Code Demo Tips and Best Practices. BLE State of the Union Evolution of Core Bluetooth](https://reader031.fdocuments.net/reader031/viewer/2022013018/5fd74962042a917b5c0990d9/html5/thumbnails/23.jpg)
That is the questionTo Simulate, or Not to Simulate
• Exploding market•Many LE-compatible devices
■ All iOS hardware■ Most Mac hardware
• Third-party development kits
![Page 24: Core Bluetooth - Apple Inc. · 2016. 7. 10. · Evolution of Core Bluetooth Core Bluetooth in iOS 7 Code Demo Tips and Best Practices. BLE State of the Union Evolution of Core Bluetooth](https://reader031.fdocuments.net/reader031/viewer/2022013018/5fd74962042a917b5c0990d9/html5/thumbnails/24.jpg)
Handling centrals and peripheralsSimpler Device Management
![Page 25: Core Bluetooth - Apple Inc. · 2016. 7. 10. · Evolution of Core Bluetooth Core Bluetooth in iOS 7 Code Demo Tips and Best Practices. BLE State of the Union Evolution of Core Bluetooth](https://reader031.fdocuments.net/reader031/viewer/2022013018/5fd74962042a917b5c0990d9/html5/thumbnails/25.jpg)
• Bye, bye CoreFoundation
Handling centrals and peripheralsSimpler Device Management
@property(readonly, nonatomic) CFUUIDRef *UUID;
![Page 26: Core Bluetooth - Apple Inc. · 2016. 7. 10. · Evolution of Core Bluetooth Core Bluetooth in iOS 7 Code Demo Tips and Best Practices. BLE State of the Union Evolution of Core Bluetooth](https://reader031.fdocuments.net/reader031/viewer/2022013018/5fd74962042a917b5c0990d9/html5/thumbnails/26.jpg)
• Bye, bye CoreFoundation
Handling centrals and peripheralsSimpler Device Management
@property(readonly, nonatomic) CFUUIDRef *UUID;
@property(readonly, nonatomic) NSUUID *identifier;
![Page 27: Core Bluetooth - Apple Inc. · 2016. 7. 10. · Evolution of Core Bluetooth Core Bluetooth in iOS 7 Code Demo Tips and Best Practices. BLE State of the Union Evolution of Core Bluetooth](https://reader031.fdocuments.net/reader031/viewer/2022013018/5fd74962042a917b5c0990d9/html5/thumbnails/27.jpg)
• Bye, bye CoreFoundation
Handling centrals and peripheralsSimpler Device Management
@property(readonly, nonatomic) CFUUIDRef *UUID;
@property(readonly, nonatomic) NSUUID *identifier;
• Identifiers created at discovery
![Page 28: Core Bluetooth - Apple Inc. · 2016. 7. 10. · Evolution of Core Bluetooth Core Bluetooth in iOS 7 Code Demo Tips and Best Practices. BLE State of the Union Evolution of Core Bluetooth](https://reader031.fdocuments.net/reader031/viewer/2022013018/5fd74962042a917b5c0990d9/html5/thumbnails/28.jpg)
Retrieving peripherals, todaySimpler Device Management
CBCentralManager <CBCentralManagerDelegate>
![Page 29: Core Bluetooth - Apple Inc. · 2016. 7. 10. · Evolution of Core Bluetooth Core Bluetooth in iOS 7 Code Demo Tips and Best Practices. BLE State of the Union Evolution of Core Bluetooth](https://reader031.fdocuments.net/reader031/viewer/2022013018/5fd74962042a917b5c0990d9/html5/thumbnails/29.jpg)
Retrieving peripherals, todaySimpler Device Management
CBCentralManager <CBCentralManagerDelegate>
![Page 30: Core Bluetooth - Apple Inc. · 2016. 7. 10. · Evolution of Core Bluetooth Core Bluetooth in iOS 7 Code Demo Tips and Best Practices. BLE State of the Union Evolution of Core Bluetooth](https://reader031.fdocuments.net/reader031/viewer/2022013018/5fd74962042a917b5c0990d9/html5/thumbnails/30.jpg)
Retrieving peripherals, todaySimpler Device Management
retrievePeripherals:
CBCentralManager <CBCentralManagerDelegate>
![Page 31: Core Bluetooth - Apple Inc. · 2016. 7. 10. · Evolution of Core Bluetooth Core Bluetooth in iOS 7 Code Demo Tips and Best Practices. BLE State of the Union Evolution of Core Bluetooth](https://reader031.fdocuments.net/reader031/viewer/2022013018/5fd74962042a917b5c0990d9/html5/thumbnails/31.jpg)
Retrieving peripherals, todaySimpler Device Management
didRetrievePeripherals:
retrievePeripherals:
CBCentralManager <CBCentralManagerDelegate>
![Page 32: Core Bluetooth - Apple Inc. · 2016. 7. 10. · Evolution of Core Bluetooth Core Bluetooth in iOS 7 Code Demo Tips and Best Practices. BLE State of the Union Evolution of Core Bluetooth](https://reader031.fdocuments.net/reader031/viewer/2022013018/5fd74962042a917b5c0990d9/html5/thumbnails/32.jpg)
Retrieving peripherals, todaySimpler Device Management
didRetrievePeripherals:
retrievePeripherals:
CBCentralManager <CBCentralManagerDelegate>
retrieveConnectedPeripherals
![Page 33: Core Bluetooth - Apple Inc. · 2016. 7. 10. · Evolution of Core Bluetooth Core Bluetooth in iOS 7 Code Demo Tips and Best Practices. BLE State of the Union Evolution of Core Bluetooth](https://reader031.fdocuments.net/reader031/viewer/2022013018/5fd74962042a917b5c0990d9/html5/thumbnails/33.jpg)
Retrieving peripherals, todaySimpler Device Management
didRetrievePeripherals:
retrievePeripherals:
CBCentralManager <CBCentralManagerDelegate>
retrieveConnectedPeripherals
didRetrieveConnectedPeripherals:
![Page 34: Core Bluetooth - Apple Inc. · 2016. 7. 10. · Evolution of Core Bluetooth Core Bluetooth in iOS 7 Code Demo Tips and Best Practices. BLE State of the Union Evolution of Core Bluetooth](https://reader031.fdocuments.net/reader031/viewer/2022013018/5fd74962042a917b5c0990d9/html5/thumbnails/34.jpg)
Retrieving peripheralsSimpler Device Management
CBCentralManager <CBCentralManagerDelegate>
![Page 35: Core Bluetooth - Apple Inc. · 2016. 7. 10. · Evolution of Core Bluetooth Core Bluetooth in iOS 7 Code Demo Tips and Best Practices. BLE State of the Union Evolution of Core Bluetooth](https://reader031.fdocuments.net/reader031/viewer/2022013018/5fd74962042a917b5c0990d9/html5/thumbnails/35.jpg)
Retrieving peripheralsSimpler Device Management
CBCentralManager <CBCentralManagerDelegate>
![Page 36: Core Bluetooth - Apple Inc. · 2016. 7. 10. · Evolution of Core Bluetooth Core Bluetooth in iOS 7 Code Demo Tips and Best Practices. BLE State of the Union Evolution of Core Bluetooth](https://reader031.fdocuments.net/reader031/viewer/2022013018/5fd74962042a917b5c0990d9/html5/thumbnails/36.jpg)
Retrieving peripheralsSimpler Device Management
retrievePeripheralsWithIdentifiers:
CBCentralManager <CBCentralManagerDelegate>
![Page 37: Core Bluetooth - Apple Inc. · 2016. 7. 10. · Evolution of Core Bluetooth Core Bluetooth in iOS 7 Code Demo Tips and Best Practices. BLE State of the Union Evolution of Core Bluetooth](https://reader031.fdocuments.net/reader031/viewer/2022013018/5fd74962042a917b5c0990d9/html5/thumbnails/37.jpg)
Retrieving peripheralsSimpler Device Management
retrievePeripheralsWithIdentifiers:
CBCentralManager <CBCentralManagerDelegate>
didRetrievePeripherals:
![Page 38: Core Bluetooth - Apple Inc. · 2016. 7. 10. · Evolution of Core Bluetooth Core Bluetooth in iOS 7 Code Demo Tips and Best Practices. BLE State of the Union Evolution of Core Bluetooth](https://reader031.fdocuments.net/reader031/viewer/2022013018/5fd74962042a917b5c0990d9/html5/thumbnails/38.jpg)
Retrieving peripheralsSimpler Device Management
CBCentralManager
retrievePeripheralsWithIdentifiers:
<CBCentralManagerDelegate>
, the iOS 7 way
![Page 39: Core Bluetooth - Apple Inc. · 2016. 7. 10. · Evolution of Core Bluetooth Core Bluetooth in iOS 7 Code Demo Tips and Best Practices. BLE State of the Union Evolution of Core Bluetooth](https://reader031.fdocuments.net/reader031/viewer/2022013018/5fd74962042a917b5c0990d9/html5/thumbnails/39.jpg)
Retrieving peripheralsSimpler Device Management
CBCentralManager
retrievePeripheralsWithIdentifiers:
retrieveConnectedPeripheralsWithServices:
<CBCentralManagerDelegate>
, the iOS 7 way
![Page 40: Core Bluetooth - Apple Inc. · 2016. 7. 10. · Evolution of Core Bluetooth Core Bluetooth in iOS 7 Code Demo Tips and Best Practices. BLE State of the Union Evolution of Core Bluetooth](https://reader031.fdocuments.net/reader031/viewer/2022013018/5fd74962042a917b5c0990d9/html5/thumbnails/40.jpg)
Retrieving peripheralsSimpler Device Management
CBCentralManager
retrievePeripheralsWithIdentifiers:
retrieveConnectedPeripheralsWithServices:
connectPeripheral:options:
<CBCentralManagerDelegate>
, the iOS 7 way
![Page 41: Core Bluetooth - Apple Inc. · 2016. 7. 10. · Evolution of Core Bluetooth Core Bluetooth in iOS 7 Code Demo Tips and Best Practices. BLE State of the Union Evolution of Core Bluetooth](https://reader031.fdocuments.net/reader031/viewer/2022013018/5fd74962042a917b5c0990d9/html5/thumbnails/41.jpg)
Smarter Peripherals
![Page 42: Core Bluetooth - Apple Inc. · 2016. 7. 10. · Evolution of Core Bluetooth Core Bluetooth in iOS 7 Code Demo Tips and Best Practices. BLE State of the Union Evolution of Core Bluetooth](https://reader031.fdocuments.net/reader031/viewer/2022013018/5fd74962042a917b5c0990d9/html5/thumbnails/42.jpg)
Smarter Peripherals
•More connection-aware@property(readonly) BOOL isConnected;
typedef NS_ENUM(NSInteger, CBPeripheralState) { CBPeripheralStateDisconnected = 0, CBPeripheralStateConnecting, CBPeripheralStateConnected };
@property(readonly) CBPeripheralState state;
![Page 43: Core Bluetooth - Apple Inc. · 2016. 7. 10. · Evolution of Core Bluetooth Core Bluetooth in iOS 7 Code Demo Tips and Best Practices. BLE State of the Union Evolution of Core Bluetooth](https://reader031.fdocuments.net/reader031/viewer/2022013018/5fd74962042a917b5c0990d9/html5/thumbnails/43.jpg)
Smarter Peripherals
•More connection-aware@property(readonly) BOOL isConnected;
typedef NS_ENUM(NSInteger, CBPeripheralState) { CBPeripheralStateDisconnected = 0, CBPeripheralStateConnecting, CBPeripheralStateConnected };
@property(readonly) CBPeripheralState state;
![Page 44: Core Bluetooth - Apple Inc. · 2016. 7. 10. · Evolution of Core Bluetooth Core Bluetooth in iOS 7 Code Demo Tips and Best Practices. BLE State of the Union Evolution of Core Bluetooth](https://reader031.fdocuments.net/reader031/viewer/2022013018/5fd74962042a917b5c0990d9/html5/thumbnails/44.jpg)
Smarter Peripherals
![Page 45: Core Bluetooth - Apple Inc. · 2016. 7. 10. · Evolution of Core Bluetooth Core Bluetooth in iOS 7 Code Demo Tips and Best Practices. BLE State of the Union Evolution of Core Bluetooth](https://reader031.fdocuments.net/reader031/viewer/2022013018/5fd74962042a917b5c0990d9/html5/thumbnails/45.jpg)
Smarter Peripherals
• Better service invalidation
![Page 46: Core Bluetooth - Apple Inc. · 2016. 7. 10. · Evolution of Core Bluetooth Core Bluetooth in iOS 7 Code Demo Tips and Best Practices. BLE State of the Union Evolution of Core Bluetooth](https://reader031.fdocuments.net/reader031/viewer/2022013018/5fd74962042a917b5c0990d9/html5/thumbnails/46.jpg)
Smarter Peripherals
• Better service invalidation(void)peripheralDidInvalidateServices:(CBPeripheral *)
![Page 47: Core Bluetooth - Apple Inc. · 2016. 7. 10. · Evolution of Core Bluetooth Core Bluetooth in iOS 7 Code Demo Tips and Best Practices. BLE State of the Union Evolution of Core Bluetooth](https://reader031.fdocuments.net/reader031/viewer/2022013018/5fd74962042a917b5c0990d9/html5/thumbnails/47.jpg)
Smarter Peripherals
• Better service invalidation(void)peripheralDidInvalidateServices:(CBPeripheral *)
(void)peripheral:(CBPeripheral *)didModifyServices:(NSArray *)
![Page 48: Core Bluetooth - Apple Inc. · 2016. 7. 10. · Evolution of Core Bluetooth Core Bluetooth in iOS 7 Code Demo Tips and Best Practices. BLE State of the Union Evolution of Core Bluetooth](https://reader031.fdocuments.net/reader031/viewer/2022013018/5fd74962042a917b5c0990d9/html5/thumbnails/48.jpg)
LE, EvolvedCore Bluetooth in iOS 7.0
Jason ConnCode Monkey & Radio Sponge
![Page 49: Core Bluetooth - Apple Inc. · 2016. 7. 10. · Evolution of Core Bluetooth Core Bluetooth in iOS 7 Code Demo Tips and Best Practices. BLE State of the Union Evolution of Core Bluetooth](https://reader031.fdocuments.net/reader031/viewer/2022013018/5fd74962042a917b5c0990d9/html5/thumbnails/49.jpg)
Performance Improvements
ServiceHeart Rate Monitor
CharacteristicHeart Rate Measurement
![Page 50: Core Bluetooth - Apple Inc. · 2016. 7. 10. · Evolution of Core Bluetooth Core Bluetooth in iOS 7 Code Demo Tips and Best Practices. BLE State of the Union Evolution of Core Bluetooth](https://reader031.fdocuments.net/reader031/viewer/2022013018/5fd74962042a917b5c0990d9/html5/thumbnails/50.jpg)
Database caching, todayPerformance Improvements
ServiceHeart Rate Monitor
CharacteristicHeart Rate Measurement
ServiceHeart Rate Monitor
CharacteristicHeart Rate Measurement
Characteristic Value190
DescriptorClient Configuration
![Page 51: Core Bluetooth - Apple Inc. · 2016. 7. 10. · Evolution of Core Bluetooth Core Bluetooth in iOS 7 Code Demo Tips and Best Practices. BLE State of the Union Evolution of Core Bluetooth](https://reader031.fdocuments.net/reader031/viewer/2022013018/5fd74962042a917b5c0990d9/html5/thumbnails/51.jpg)
Database caching, todayPerformance Improvements
• Introduced in iOS 6 ServiceHeart Rate Monitor
CharacteristicHeart Rate Measurement
ServiceHeart Rate Monitor
CharacteristicHeart Rate Measurement
Characteristic Value190
DescriptorClient Configuration
![Page 52: Core Bluetooth - Apple Inc. · 2016. 7. 10. · Evolution of Core Bluetooth Core Bluetooth in iOS 7 Code Demo Tips and Best Practices. BLE State of the Union Evolution of Core Bluetooth](https://reader031.fdocuments.net/reader031/viewer/2022013018/5fd74962042a917b5c0990d9/html5/thumbnails/52.jpg)
Database caching, todayPerformance Improvements
• Introduced in iOS 6• Increases speed and battery life
ServiceHeart Rate Monitor
CharacteristicHeart Rate Measurement
ServiceHeart Rate Monitor
CharacteristicHeart Rate Measurement
Characteristic Value190
DescriptorClient Configuration
![Page 53: Core Bluetooth - Apple Inc. · 2016. 7. 10. · Evolution of Core Bluetooth Core Bluetooth in iOS 7 Code Demo Tips and Best Practices. BLE State of the Union Evolution of Core Bluetooth](https://reader031.fdocuments.net/reader031/viewer/2022013018/5fd74962042a917b5c0990d9/html5/thumbnails/53.jpg)
Database caching, todayPerformance Improvements
• Introduced in iOS 6• Increases speed and battery life• Cache services and characteristics
ServiceHeart Rate Monitor
CharacteristicHeart Rate Measurement
ServiceHeart Rate Monitor
CharacteristicHeart Rate Measurement
Characteristic Value190
DescriptorClient Configuration
![Page 54: Core Bluetooth - Apple Inc. · 2016. 7. 10. · Evolution of Core Bluetooth Core Bluetooth in iOS 7 Code Demo Tips and Best Practices. BLE State of the Union Evolution of Core Bluetooth](https://reader031.fdocuments.net/reader031/viewer/2022013018/5fd74962042a917b5c0990d9/html5/thumbnails/54.jpg)
Database caching, in iOS 7Performance Improvements
ServiceHeart Rate Monitor
CharacteristicHeart Rate Measurement
DescriptorClient Configuration
DescriptorClient Configuration
Characteristic Value190
Characteristic Value190
Characteristic Value73
Characteristic Value190
![Page 55: Core Bluetooth - Apple Inc. · 2016. 7. 10. · Evolution of Core Bluetooth Core Bluetooth in iOS 7 Code Demo Tips and Best Practices. BLE State of the Union Evolution of Core Bluetooth](https://reader031.fdocuments.net/reader031/viewer/2022013018/5fd74962042a917b5c0990d9/html5/thumbnails/55.jpg)
• Cache characteristic descriptors
Database caching, in iOS 7Performance Improvements
ServiceHeart Rate Monitor
CharacteristicHeart Rate Measurement
DescriptorClient Configuration
DescriptorClient Configuration
Characteristic Value190
Characteristic Value190
Characteristic Value73
Characteristic Value190
![Page 56: Core Bluetooth - Apple Inc. · 2016. 7. 10. · Evolution of Core Bluetooth Core Bluetooth in iOS 7 Code Demo Tips and Best Practices. BLE State of the Union Evolution of Core Bluetooth](https://reader031.fdocuments.net/reader031/viewer/2022013018/5fd74962042a917b5c0990d9/html5/thumbnails/56.jpg)
• Cache characteristic descriptors• Caching for characteristic values?
Database caching, in iOS 7Performance Improvements
ServiceHeart Rate Monitor
CharacteristicHeart Rate Measurement
DescriptorClient Configuration
DescriptorClient Configuration
Characteristic Value190
Characteristic Value190
Characteristic Value73
Characteristic Value190
![Page 57: Core Bluetooth - Apple Inc. · 2016. 7. 10. · Evolution of Core Bluetooth Core Bluetooth in iOS 7 Code Demo Tips and Best Practices. BLE State of the Union Evolution of Core Bluetooth](https://reader031.fdocuments.net/reader031/viewer/2022013018/5fd74962042a917b5c0990d9/html5/thumbnails/57.jpg)
• Cache characteristic descriptors• Caching for characteristic values?
Database caching, in iOS 7Performance Improvements
ServiceHeart Rate Monitor
CharacteristicHeart Rate Measurement
DescriptorClient Configuration
DescriptorClient Configuration
Characteristic Value190
Characteristic Value190
Characteristic Value73
Characteristic Value190
![Page 58: Core Bluetooth - Apple Inc. · 2016. 7. 10. · Evolution of Core Bluetooth Core Bluetooth in iOS 7 Code Demo Tips and Best Practices. BLE State of the Union Evolution of Core Bluetooth](https://reader031.fdocuments.net/reader031/viewer/2022013018/5fd74962042a917b5c0990d9/html5/thumbnails/58.jpg)
• Cache characteristic descriptors• Caching for characteristic values?
■ Provide last-known characteristic values and descriptor values
Database caching, in iOS 7Performance Improvements
ServiceHeart Rate Monitor
CharacteristicHeart Rate Measurement
DescriptorClient Configuration
DescriptorClient Configuration
Characteristic Value190
Characteristic Value190
Characteristic Value73
Characteristic Value190
Characteristic Value73
![Page 59: Core Bluetooth - Apple Inc. · 2016. 7. 10. · Evolution of Core Bluetooth Core Bluetooth in iOS 7 Code Demo Tips and Best Practices. BLE State of the Union Evolution of Core Bluetooth](https://reader031.fdocuments.net/reader031/viewer/2022013018/5fd74962042a917b5c0990d9/html5/thumbnails/59.jpg)
• Cache characteristic descriptors• Caching for characteristic values?
■ Provide last-known characteristic values and descriptor values
• Free!
Database caching, in iOS 7Performance Improvements
ServiceHeart Rate Monitor
CharacteristicHeart Rate Measurement
DescriptorClient Configuration
DescriptorClient Configuration
Characteristic Value190
Characteristic Value190
Characteristic Value73
Characteristic Value190
Characteristic Value73
![Page 60: Core Bluetooth - Apple Inc. · 2016. 7. 10. · Evolution of Core Bluetooth Core Bluetooth in iOS 7 Code Demo Tips and Best Practices. BLE State of the Union Evolution of Core Bluetooth](https://reader031.fdocuments.net/reader031/viewer/2022013018/5fd74962042a917b5c0990d9/html5/thumbnails/60.jpg)
Performance Improvements
![Page 61: Core Bluetooth - Apple Inc. · 2016. 7. 10. · Evolution of Core Bluetooth Core Bluetooth in iOS 7 Code Demo Tips and Best Practices. BLE State of the Union Evolution of Core Bluetooth](https://reader031.fdocuments.net/reader031/viewer/2022013018/5fd74962042a917b5c0990d9/html5/thumbnails/61.jpg)
Sending dataPerformance Improvements
![Page 62: Core Bluetooth - Apple Inc. · 2016. 7. 10. · Evolution of Core Bluetooth Core Bluetooth in iOS 7 Code Demo Tips and Best Practices. BLE State of the Union Evolution of Core Bluetooth](https://reader031.fdocuments.net/reader031/viewer/2022013018/5fd74962042a917b5c0990d9/html5/thumbnails/62.jpg)
115 BPM
Sending dataPerformance Improvements
![Page 63: Core Bluetooth - Apple Inc. · 2016. 7. 10. · Evolution of Core Bluetooth Core Bluetooth in iOS 7 Code Demo Tips and Best Practices. BLE State of the Union Evolution of Core Bluetooth](https://reader031.fdocuments.net/reader031/viewer/2022013018/5fd74962042a917b5c0990d9/html5/thumbnails/63.jpg)
115 BPM
Sending dataPerformance Improvements
![Page 64: Core Bluetooth - Apple Inc. · 2016. 7. 10. · Evolution of Core Bluetooth Core Bluetooth in iOS 7 Code Demo Tips and Best Practices. BLE State of the Union Evolution of Core Bluetooth](https://reader031.fdocuments.net/reader031/viewer/2022013018/5fd74962042a917b5c0990d9/html5/thumbnails/64.jpg)
115 BPM
Sending dataPerformance Improvements
![Page 65: Core Bluetooth - Apple Inc. · 2016. 7. 10. · Evolution of Core Bluetooth Core Bluetooth in iOS 7 Code Demo Tips and Best Practices. BLE State of the Union Evolution of Core Bluetooth](https://reader031.fdocuments.net/reader031/viewer/2022013018/5fd74962042a917b5c0990d9/html5/thumbnails/65.jpg)
115 BPM
Sending dataPerformance Improvements
![Page 66: Core Bluetooth - Apple Inc. · 2016. 7. 10. · Evolution of Core Bluetooth Core Bluetooth in iOS 7 Code Demo Tips and Best Practices. BLE State of the Union Evolution of Core Bluetooth](https://reader031.fdocuments.net/reader031/viewer/2022013018/5fd74962042a917b5c0990d9/html5/thumbnails/66.jpg)
115 BPM
Sending dataPerformance Improvements
Mon Tues Weds Thurs
58
70
43
55
96
53
26
17
Mon Tues Weds Thurs
50%
28%
14%9%
![Page 67: Core Bluetooth - Apple Inc. · 2016. 7. 10. · Evolution of Core Bluetooth Core Bluetooth in iOS 7 Code Demo Tips and Best Practices. BLE State of the Union Evolution of Core Bluetooth](https://reader031.fdocuments.net/reader031/viewer/2022013018/5fd74962042a917b5c0990d9/html5/thumbnails/67.jpg)
115 BPM
Sending dataPerformance Improvements
Mon Tues Weds Thurs
58
70
43
55
96
53
26
17
Mon Tues Weds Thurs
50%
28%
14%9%
![Page 68: Core Bluetooth - Apple Inc. · 2016. 7. 10. · Evolution of Core Bluetooth Core Bluetooth in iOS 7 Code Demo Tips and Best Practices. BLE State of the Union Evolution of Core Bluetooth](https://reader031.fdocuments.net/reader031/viewer/2022013018/5fd74962042a917b5c0990d9/html5/thumbnails/68.jpg)
![Page 69: Core Bluetooth - Apple Inc. · 2016. 7. 10. · Evolution of Core Bluetooth Core Bluetooth in iOS 7 Code Demo Tips and Best Practices. BLE State of the Union Evolution of Core Bluetooth](https://reader031.fdocuments.net/reader031/viewer/2022013018/5fd74962042a917b5c0990d9/html5/thumbnails/69.jpg)
Sending dataPerformance Improvements
![Page 70: Core Bluetooth - Apple Inc. · 2016. 7. 10. · Evolution of Core Bluetooth Core Bluetooth in iOS 7 Code Demo Tips and Best Practices. BLE State of the Union Evolution of Core Bluetooth](https://reader031.fdocuments.net/reader031/viewer/2022013018/5fd74962042a917b5c0990d9/html5/thumbnails/70.jpg)
Sending dataPerformance Improvements
• Support MTU exchange request
![Page 71: Core Bluetooth - Apple Inc. · 2016. 7. 10. · Evolution of Core Bluetooth Core Bluetooth in iOS 7 Code Demo Tips and Best Practices. BLE State of the Union Evolution of Core Bluetooth](https://reader031.fdocuments.net/reader031/viewer/2022013018/5fd74962042a917b5c0990d9/html5/thumbnails/71.jpg)
Sending dataPerformance Improvements
• Support MTU exchange request•Maximum amount of data per PDU
![Page 72: Core Bluetooth - Apple Inc. · 2016. 7. 10. · Evolution of Core Bluetooth Core Bluetooth in iOS 7 Code Demo Tips and Best Practices. BLE State of the Union Evolution of Core Bluetooth](https://reader031.fdocuments.net/reader031/viewer/2022013018/5fd74962042a917b5c0990d9/html5/thumbnails/72.jpg)
Sending dataPerformance Improvements
• Support MTU exchange request•Maximum amount of data per PDU• Send more data at a time
![Page 73: Core Bluetooth - Apple Inc. · 2016. 7. 10. · Evolution of Core Bluetooth Core Bluetooth in iOS 7 Code Demo Tips and Best Practices. BLE State of the Union Evolution of Core Bluetooth](https://reader031.fdocuments.net/reader031/viewer/2022013018/5fd74962042a917b5c0990d9/html5/thumbnails/73.jpg)
Sending dataPerformance Improvements
![Page 74: Core Bluetooth - Apple Inc. · 2016. 7. 10. · Evolution of Core Bluetooth Core Bluetooth in iOS 7 Code Demo Tips and Best Practices. BLE State of the Union Evolution of Core Bluetooth](https://reader031.fdocuments.net/reader031/viewer/2022013018/5fd74962042a917b5c0990d9/html5/thumbnails/74.jpg)
Sending data
Default MTU23 bytes
Performance Improvements
![Page 75: Core Bluetooth - Apple Inc. · 2016. 7. 10. · Evolution of Core Bluetooth Core Bluetooth in iOS 7 Code Demo Tips and Best Practices. BLE State of the Union Evolution of Core Bluetooth](https://reader031.fdocuments.net/reader031/viewer/2022013018/5fd74962042a917b5c0990d9/html5/thumbnails/75.jpg)
Sending data
Default MTU23 bytes
Performance Improvements
![Page 76: Core Bluetooth - Apple Inc. · 2016. 7. 10. · Evolution of Core Bluetooth Core Bluetooth in iOS 7 Code Demo Tips and Best Practices. BLE State of the Union Evolution of Core Bluetooth](https://reader031.fdocuments.net/reader031/viewer/2022013018/5fd74962042a917b5c0990d9/html5/thumbnails/76.jpg)
Sending data
Default MTU23 bytes
Increased MTU??? bytes
Performance Improvements
![Page 77: Core Bluetooth - Apple Inc. · 2016. 7. 10. · Evolution of Core Bluetooth Core Bluetooth in iOS 7 Code Demo Tips and Best Practices. BLE State of the Union Evolution of Core Bluetooth](https://reader031.fdocuments.net/reader031/viewer/2022013018/5fd74962042a917b5c0990d9/html5/thumbnails/77.jpg)
Sending data
Default MTU23 bytes
Increased MTU??? bytes
Performance Improvements
![Page 78: Core Bluetooth - Apple Inc. · 2016. 7. 10. · Evolution of Core Bluetooth Core Bluetooth in iOS 7 Code Demo Tips and Best Practices. BLE State of the Union Evolution of Core Bluetooth](https://reader031.fdocuments.net/reader031/viewer/2022013018/5fd74962042a917b5c0990d9/html5/thumbnails/78.jpg)
Sending dataPerformance Improvements
![Page 79: Core Bluetooth - Apple Inc. · 2016. 7. 10. · Evolution of Core Bluetooth Core Bluetooth in iOS 7 Code Demo Tips and Best Practices. BLE State of the Union Evolution of Core Bluetooth](https://reader031.fdocuments.net/reader031/viewer/2022013018/5fd74962042a917b5c0990d9/html5/thumbnails/79.jpg)
Sending dataPerformance Improvements
•When central, ask for larger MTU
![Page 80: Core Bluetooth - Apple Inc. · 2016. 7. 10. · Evolution of Core Bluetooth Core Bluetooth in iOS 7 Code Demo Tips and Best Practices. BLE State of the Union Evolution of Core Bluetooth](https://reader031.fdocuments.net/reader031/viewer/2022013018/5fd74962042a917b5c0990d9/html5/thumbnails/80.jpg)
Sending dataPerformance Improvements
•When central, ask for larger MTU•Up to 20% increase in throughput
![Page 81: Core Bluetooth - Apple Inc. · 2016. 7. 10. · Evolution of Core Bluetooth Core Bluetooth in iOS 7 Code Demo Tips and Best Practices. BLE State of the Union Evolution of Core Bluetooth](https://reader031.fdocuments.net/reader031/viewer/2022013018/5fd74962042a917b5c0990d9/html5/thumbnails/81.jpg)
Sending dataPerformance Improvements
•When central, ask for larger MTU•Up to 20% increase in throughput• Free!
![Page 82: Core Bluetooth - Apple Inc. · 2016. 7. 10. · Evolution of Core Bluetooth Core Bluetooth in iOS 7 Code Demo Tips and Best Practices. BLE State of the Union Evolution of Core Bluetooth](https://reader031.fdocuments.net/reader031/viewer/2022013018/5fd74962042a917b5c0990d9/html5/thumbnails/82.jpg)
Performing long-term actionsPerformance Improvements
![Page 83: Core Bluetooth - Apple Inc. · 2016. 7. 10. · Evolution of Core Bluetooth Core Bluetooth in iOS 7 Code Demo Tips and Best Practices. BLE State of the Union Evolution of Core Bluetooth](https://reader031.fdocuments.net/reader031/viewer/2022013018/5fd74962042a917b5c0990d9/html5/thumbnails/83.jpg)
Performing long-term actionsPerformance Improvements
![Page 84: Core Bluetooth - Apple Inc. · 2016. 7. 10. · Evolution of Core Bluetooth Core Bluetooth in iOS 7 Code Demo Tips and Best Practices. BLE State of the Union Evolution of Core Bluetooth](https://reader031.fdocuments.net/reader031/viewer/2022013018/5fd74962042a917b5c0990d9/html5/thumbnails/84.jpg)
Living in a multitasking worldPerforming Long-Term Actions
![Page 85: Core Bluetooth - Apple Inc. · 2016. 7. 10. · Evolution of Core Bluetooth Core Bluetooth in iOS 7 Code Demo Tips and Best Practices. BLE State of the Union Evolution of Core Bluetooth](https://reader031.fdocuments.net/reader031/viewer/2022013018/5fd74962042a917b5c0990d9/html5/thumbnails/85.jpg)
Living in a multitasking worldPerforming Long-Term Actions
• Backgrounding modes
![Page 86: Core Bluetooth - Apple Inc. · 2016. 7. 10. · Evolution of Core Bluetooth Core Bluetooth in iOS 7 Code Demo Tips and Best Practices. BLE State of the Union Evolution of Core Bluetooth](https://reader031.fdocuments.net/reader031/viewer/2022013018/5fd74962042a917b5c0990d9/html5/thumbnails/86.jpg)
Living in a multitasking worldPerforming Long-Term Actions
• Backgrounding modes■ App communicates using CoreBluetooth
![Page 87: Core Bluetooth - Apple Inc. · 2016. 7. 10. · Evolution of Core Bluetooth Core Bluetooth in iOS 7 Code Demo Tips and Best Practices. BLE State of the Union Evolution of Core Bluetooth](https://reader031.fdocuments.net/reader031/viewer/2022013018/5fd74962042a917b5c0990d9/html5/thumbnails/87.jpg)
Living in a multitasking worldPerforming Long-Term Actions
• Backgrounding modes■ App communicates using CoreBluetooth■ App shares data using CoreBluetooth
![Page 88: Core Bluetooth - Apple Inc. · 2016. 7. 10. · Evolution of Core Bluetooth Core Bluetooth in iOS 7 Code Demo Tips and Best Practices. BLE State of the Union Evolution of Core Bluetooth](https://reader031.fdocuments.net/reader031/viewer/2022013018/5fd74962042a917b5c0990d9/html5/thumbnails/88.jpg)
Living in a multitasking worldPerforming Long-Term Actions
• Backgrounding modes■ App communicates using CoreBluetooth■ App shares data using CoreBluetooth
• Background applications can be terminated by system
![Page 89: Core Bluetooth - Apple Inc. · 2016. 7. 10. · Evolution of Core Bluetooth Core Bluetooth in iOS 7 Code Demo Tips and Best Practices. BLE State of the Union Evolution of Core Bluetooth](https://reader031.fdocuments.net/reader031/viewer/2022013018/5fd74962042a917b5c0990d9/html5/thumbnails/89.jpg)
Living in a multitasking worldPerforming Long-Term Actions
• Backgrounding modes■ App communicates using CoreBluetooth■ App shares data using CoreBluetooth
• Background applications can be terminated by system• Some use-cases take hours
![Page 90: Core Bluetooth - Apple Inc. · 2016. 7. 10. · Evolution of Core Bluetooth Core Bluetooth in iOS 7 Code Demo Tips and Best Practices. BLE State of the Union Evolution of Core Bluetooth](https://reader031.fdocuments.net/reader031/viewer/2022013018/5fd74962042a917b5c0990d9/html5/thumbnails/90.jpg)
![Page 91: Core Bluetooth - Apple Inc. · 2016. 7. 10. · Evolution of Core Bluetooth Core Bluetooth in iOS 7 Code Demo Tips and Best Practices. BLE State of the Union Evolution of Core Bluetooth](https://reader031.fdocuments.net/reader031/viewer/2022013018/5fd74962042a917b5c0990d9/html5/thumbnails/91.jpg)
![Page 92: Core Bluetooth - Apple Inc. · 2016. 7. 10. · Evolution of Core Bluetooth Core Bluetooth in iOS 7 Code Demo Tips and Best Practices. BLE State of the Union Evolution of Core Bluetooth](https://reader031.fdocuments.net/reader031/viewer/2022013018/5fd74962042a917b5c0990d9/html5/thumbnails/92.jpg)
![Page 93: Core Bluetooth - Apple Inc. · 2016. 7. 10. · Evolution of Core Bluetooth Core Bluetooth in iOS 7 Code Demo Tips and Best Practices. BLE State of the Union Evolution of Core Bluetooth](https://reader031.fdocuments.net/reader031/viewer/2022013018/5fd74962042a917b5c0990d9/html5/thumbnails/93.jpg)
![Page 94: Core Bluetooth - Apple Inc. · 2016. 7. 10. · Evolution of Core Bluetooth Core Bluetooth in iOS 7 Code Demo Tips and Best Practices. BLE State of the Union Evolution of Core Bluetooth](https://reader031.fdocuments.net/reader031/viewer/2022013018/5fd74962042a917b5c0990d9/html5/thumbnails/94.jpg)
![Page 95: Core Bluetooth - Apple Inc. · 2016. 7. 10. · Evolution of Core Bluetooth Core Bluetooth in iOS 7 Code Demo Tips and Best Practices. BLE State of the Union Evolution of Core Bluetooth](https://reader031.fdocuments.net/reader031/viewer/2022013018/5fd74962042a917b5c0990d9/html5/thumbnails/95.jpg)
Our solutionPerforming Long-term Actions
![Page 96: Core Bluetooth - Apple Inc. · 2016. 7. 10. · Evolution of Core Bluetooth Core Bluetooth in iOS 7 Code Demo Tips and Best Practices. BLE State of the Union Evolution of Core Bluetooth](https://reader031.fdocuments.net/reader031/viewer/2022013018/5fd74962042a917b5c0990d9/html5/thumbnails/96.jpg)
Our solutionPerforming Long-term Actions
• System watches application state
![Page 97: Core Bluetooth - Apple Inc. · 2016. 7. 10. · Evolution of Core Bluetooth Core Bluetooth in iOS 7 Code Demo Tips and Best Practices. BLE State of the Union Evolution of Core Bluetooth](https://reader031.fdocuments.net/reader031/viewer/2022013018/5fd74962042a917b5c0990d9/html5/thumbnails/97.jpg)
Our solutionPerforming Long-term Actions
• System watches application state•When application is terminated…
![Page 98: Core Bluetooth - Apple Inc. · 2016. 7. 10. · Evolution of Core Bluetooth Core Bluetooth in iOS 7 Code Demo Tips and Best Practices. BLE State of the Union Evolution of Core Bluetooth](https://reader031.fdocuments.net/reader031/viewer/2022013018/5fd74962042a917b5c0990d9/html5/thumbnails/98.jpg)
Our solutionPerforming Long-term Actions
• System watches application state•When application is terminated…
■ If cause is memory pressure
![Page 99: Core Bluetooth - Apple Inc. · 2016. 7. 10. · Evolution of Core Bluetooth Core Bluetooth in iOS 7 Code Demo Tips and Best Practices. BLE State of the Union Evolution of Core Bluetooth](https://reader031.fdocuments.net/reader031/viewer/2022013018/5fd74962042a917b5c0990d9/html5/thumbnails/99.jpg)
Our solutionPerforming Long-term Actions
• System watches application state•When application is terminated…
■ If cause is memory pressure■ If application is performing long-term action(s)
![Page 100: Core Bluetooth - Apple Inc. · 2016. 7. 10. · Evolution of Core Bluetooth Core Bluetooth in iOS 7 Code Demo Tips and Best Practices. BLE State of the Union Evolution of Core Bluetooth](https://reader031.fdocuments.net/reader031/viewer/2022013018/5fd74962042a917b5c0990d9/html5/thumbnails/100.jpg)
Our solutionPerforming Long-term Actions
• System watches application state•When application is terminated…
■ If cause is memory pressure■ If application is performing long-term action(s)
• System acts as application proxy
![Page 101: Core Bluetooth - Apple Inc. · 2016. 7. 10. · Evolution of Core Bluetooth Core Bluetooth in iOS 7 Code Demo Tips and Best Practices. BLE State of the Union Evolution of Core Bluetooth](https://reader031.fdocuments.net/reader031/viewer/2022013018/5fd74962042a917b5c0990d9/html5/thumbnails/101.jpg)
Our solutionPerforming Long-term Actions
• System watches application state•When application is terminated…
■ If cause is memory pressure■ If application is performing long-term action(s)
• System acts as application proxy•When needed, application is re-launched
![Page 102: Core Bluetooth - Apple Inc. · 2016. 7. 10. · Evolution of Core Bluetooth Core Bluetooth in iOS 7 Code Demo Tips and Best Practices. BLE State of the Union Evolution of Core Bluetooth](https://reader031.fdocuments.net/reader031/viewer/2022013018/5fd74962042a917b5c0990d9/html5/thumbnails/102.jpg)
State Preservation and Restoration
![Page 103: Core Bluetooth - Apple Inc. · 2016. 7. 10. · Evolution of Core Bluetooth Core Bluetooth in iOS 7 Code Demo Tips and Best Practices. BLE State of the Union Evolution of Core Bluetooth](https://reader031.fdocuments.net/reader031/viewer/2022013018/5fd74962042a917b5c0990d9/html5/thumbnails/103.jpg)
State Preservation and Restoration
•Opt-in
![Page 104: Core Bluetooth - Apple Inc. · 2016. 7. 10. · Evolution of Core Bluetooth Core Bluetooth in iOS 7 Code Demo Tips and Best Practices. BLE State of the Union Evolution of Core Bluetooth](https://reader031.fdocuments.net/reader031/viewer/2022013018/5fd74962042a917b5c0990d9/html5/thumbnails/104.jpg)
State Preservation and Restoration
•Opt-in• Supported by CBCentralManager and CBPeripheralManager
![Page 105: Core Bluetooth - Apple Inc. · 2016. 7. 10. · Evolution of Core Bluetooth Core Bluetooth in iOS 7 Code Demo Tips and Best Practices. BLE State of the Union Evolution of Core Bluetooth](https://reader031.fdocuments.net/reader031/viewer/2022013018/5fd74962042a917b5c0990d9/html5/thumbnails/105.jpg)
State Preservation and Restoration
•Opt-in• Supported by CBCentralManager and CBPeripheralManager•Minimal implementation
■ Provide unique “identifier” for manager■ Implement new delegate method
![Page 106: Core Bluetooth - Apple Inc. · 2016. 7. 10. · Evolution of Core Bluetooth Core Bluetooth in iOS 7 Code Demo Tips and Best Practices. BLE State of the Union Evolution of Core Bluetooth](https://reader031.fdocuments.net/reader031/viewer/2022013018/5fd74962042a917b5c0990d9/html5/thumbnails/106.jpg)
A picture is worth a thousand wordsState Preservation and Restoration
![Page 107: Core Bluetooth - Apple Inc. · 2016. 7. 10. · Evolution of Core Bluetooth Core Bluetooth in iOS 7 Code Demo Tips and Best Practices. BLE State of the Union Evolution of Core Bluetooth](https://reader031.fdocuments.net/reader031/viewer/2022013018/5fd74962042a917b5c0990d9/html5/thumbnails/107.jpg)
A picture is worth a thousand wordsState Preservation and Restoration
• Snapshot taken before termination
![Page 108: Core Bluetooth - Apple Inc. · 2016. 7. 10. · Evolution of Core Bluetooth Core Bluetooth in iOS 7 Code Demo Tips and Best Practices. BLE State of the Union Evolution of Core Bluetooth](https://reader031.fdocuments.net/reader031/viewer/2022013018/5fd74962042a917b5c0990d9/html5/thumbnails/108.jpg)
A picture is worth a thousand wordsState Preservation and Restoration
• Snapshot taken before termination• CBCentralManager
![Page 109: Core Bluetooth - Apple Inc. · 2016. 7. 10. · Evolution of Core Bluetooth Core Bluetooth in iOS 7 Code Demo Tips and Best Practices. BLE State of the Union Evolution of Core Bluetooth](https://reader031.fdocuments.net/reader031/viewer/2022013018/5fd74962042a917b5c0990d9/html5/thumbnails/109.jpg)
A picture is worth a thousand wordsState Preservation and Restoration
• Snapshot taken before termination• CBCentralManager
■ Scanning state
![Page 110: Core Bluetooth - Apple Inc. · 2016. 7. 10. · Evolution of Core Bluetooth Core Bluetooth in iOS 7 Code Demo Tips and Best Practices. BLE State of the Union Evolution of Core Bluetooth](https://reader031.fdocuments.net/reader031/viewer/2022013018/5fd74962042a917b5c0990d9/html5/thumbnails/110.jpg)
A picture is worth a thousand wordsState Preservation and Restoration
• Snapshot taken before termination• CBCentralManager
■ Scanning state■ Pending/active connections
![Page 111: Core Bluetooth - Apple Inc. · 2016. 7. 10. · Evolution of Core Bluetooth Core Bluetooth in iOS 7 Code Demo Tips and Best Practices. BLE State of the Union Evolution of Core Bluetooth](https://reader031.fdocuments.net/reader031/viewer/2022013018/5fd74962042a917b5c0990d9/html5/thumbnails/111.jpg)
A picture is worth a thousand wordsState Preservation and Restoration
• Snapshot taken before termination• CBCentralManager
■ Scanning state■ Pending/active connections■ Peripheral subscriptions
![Page 112: Core Bluetooth - Apple Inc. · 2016. 7. 10. · Evolution of Core Bluetooth Core Bluetooth in iOS 7 Code Demo Tips and Best Practices. BLE State of the Union Evolution of Core Bluetooth](https://reader031.fdocuments.net/reader031/viewer/2022013018/5fd74962042a917b5c0990d9/html5/thumbnails/112.jpg)
A picture is worth a thousand wordsState Preservation and Restoration
• Snapshot taken before termination• CBCentralManager
■ Scanning state■ Pending/active connections■ Peripheral subscriptions
• CBPeripheralManager
![Page 113: Core Bluetooth - Apple Inc. · 2016. 7. 10. · Evolution of Core Bluetooth Core Bluetooth in iOS 7 Code Demo Tips and Best Practices. BLE State of the Union Evolution of Core Bluetooth](https://reader031.fdocuments.net/reader031/viewer/2022013018/5fd74962042a917b5c0990d9/html5/thumbnails/113.jpg)
A picture is worth a thousand wordsState Preservation and Restoration
• Snapshot taken before termination• CBCentralManager
■ Scanning state■ Pending/active connections■ Peripheral subscriptions
• CBPeripheralManager■Advertising state
![Page 114: Core Bluetooth - Apple Inc. · 2016. 7. 10. · Evolution of Core Bluetooth Core Bluetooth in iOS 7 Code Demo Tips and Best Practices. BLE State of the Union Evolution of Core Bluetooth](https://reader031.fdocuments.net/reader031/viewer/2022013018/5fd74962042a917b5c0990d9/html5/thumbnails/114.jpg)
A picture is worth a thousand wordsState Preservation and Restoration
• Snapshot taken before termination• CBCentralManager
■ Scanning state■ Pending/active connections■ Peripheral subscriptions
• CBPeripheralManager■Advertising state■ Published services
![Page 115: Core Bluetooth - Apple Inc. · 2016. 7. 10. · Evolution of Core Bluetooth Core Bluetooth in iOS 7 Code Demo Tips and Best Practices. BLE State of the Union Evolution of Core Bluetooth](https://reader031.fdocuments.net/reader031/viewer/2022013018/5fd74962042a917b5c0990d9/html5/thumbnails/115.jpg)
A picture is worth a thousand wordsState Preservation and Restoration
• Snapshot taken before termination• CBCentralManager
■ Scanning state■ Pending/active connections■ Peripheral subscriptions
• CBPeripheralManager■Advertising state■ Published services■Central subscriptions
![Page 116: Core Bluetooth - Apple Inc. · 2016. 7. 10. · Evolution of Core Bluetooth Core Bluetooth in iOS 7 Code Demo Tips and Best Practices. BLE State of the Union Evolution of Core Bluetooth](https://reader031.fdocuments.net/reader031/viewer/2022013018/5fd74962042a917b5c0990d9/html5/thumbnails/116.jpg)
Back from the deadState Preservation and Restoration
![Page 117: Core Bluetooth - Apple Inc. · 2016. 7. 10. · Evolution of Core Bluetooth Core Bluetooth in iOS 7 Code Demo Tips and Best Practices. BLE State of the Union Evolution of Core Bluetooth](https://reader031.fdocuments.net/reader031/viewer/2022013018/5fd74962042a917b5c0990d9/html5/thumbnails/117.jpg)
Back from the deadState Preservation and Restoration
![Page 118: Core Bluetooth - Apple Inc. · 2016. 7. 10. · Evolution of Core Bluetooth Core Bluetooth in iOS 7 Code Demo Tips and Best Practices. BLE State of the Union Evolution of Core Bluetooth](https://reader031.fdocuments.net/reader031/viewer/2022013018/5fd74962042a917b5c0990d9/html5/thumbnails/118.jpg)
Back from the deadState Preservation and Restoration
• Events that system can’t handle trigger application re-launch
![Page 119: Core Bluetooth - Apple Inc. · 2016. 7. 10. · Evolution of Core Bluetooth Core Bluetooth in iOS 7 Code Demo Tips and Best Practices. BLE State of the Union Evolution of Core Bluetooth](https://reader031.fdocuments.net/reader031/viewer/2022013018/5fd74962042a917b5c0990d9/html5/thumbnails/119.jpg)
Back from the deadState Preservation and Restoration
• Events that system can’t handle trigger application re-launch■ Peripheral connects, central subscribes, notification received, etc.
![Page 120: Core Bluetooth - Apple Inc. · 2016. 7. 10. · Evolution of Core Bluetooth Core Bluetooth in iOS 7 Code Demo Tips and Best Practices. BLE State of the Union Evolution of Core Bluetooth](https://reader031.fdocuments.net/reader031/viewer/2022013018/5fd74962042a917b5c0990d9/html5/thumbnails/120.jpg)
Back from the deadState Preservation and Restoration
• Events that system can’t handle trigger application re-launch■ Peripheral connects, central subscribes, notification received, etc.
•Application re-launched into background, running
![Page 121: Core Bluetooth - Apple Inc. · 2016. 7. 10. · Evolution of Core Bluetooth Core Bluetooth in iOS 7 Code Demo Tips and Best Practices. BLE State of the Union Evolution of Core Bluetooth](https://reader031.fdocuments.net/reader031/viewer/2022013018/5fd74962042a917b5c0990d9/html5/thumbnails/121.jpg)
Back from the deadState Preservation and Restoration
• Events that system can’t handle trigger application re-launch■ Peripheral connects, central subscribes, notification received, etc.
•Application re-launched into background, running■ Re-instantiates appropriate manager object(s)
![Page 122: Core Bluetooth - Apple Inc. · 2016. 7. 10. · Evolution of Core Bluetooth Core Bluetooth in iOS 7 Code Demo Tips and Best Practices. BLE State of the Union Evolution of Core Bluetooth](https://reader031.fdocuments.net/reader031/viewer/2022013018/5fd74962042a917b5c0990d9/html5/thumbnails/122.jpg)
Back from the deadState Preservation and Restoration
• Events that system can’t handle trigger application re-launch■ Peripheral connects, central subscribes, notification received, etc.
•Application re-launched into background, running■ Re-instantiates appropriate manager object(s)■ Delegate callback provides all preserved state
![Page 123: Core Bluetooth - Apple Inc. · 2016. 7. 10. · Evolution of Core Bluetooth Core Bluetooth in iOS 7 Code Demo Tips and Best Practices. BLE State of the Union Evolution of Core Bluetooth](https://reader031.fdocuments.net/reader031/viewer/2022013018/5fd74962042a917b5c0990d9/html5/thumbnails/123.jpg)
Back from the deadState Preservation and Restoration
• Events that system can’t handle trigger application re-launch■ Peripheral connects, central subscribes, notification received, etc.
•Application re-launched into background, running■ Re-instantiates appropriate manager object(s)■ Delegate callback provides all preserved state■ Power on event
![Page 124: Core Bluetooth - Apple Inc. · 2016. 7. 10. · Evolution of Core Bluetooth Core Bluetooth in iOS 7 Code Demo Tips and Best Practices. BLE State of the Union Evolution of Core Bluetooth](https://reader031.fdocuments.net/reader031/viewer/2022013018/5fd74962042a917b5c0990d9/html5/thumbnails/124.jpg)
Back from the deadState Preservation and Restoration
• Events that system can’t handle trigger application re-launch■ Peripheral connects, central subscribes, notification received, etc.
•Application re-launched into background, running■ Re-instantiates appropriate manager object(s)■ Delegate callback provides all preserved state■ Power on event■ Delegate callback for triggering event
![Page 125: Core Bluetooth - Apple Inc. · 2016. 7. 10. · Evolution of Core Bluetooth Core Bluetooth in iOS 7 Code Demo Tips and Best Practices. BLE State of the Union Evolution of Core Bluetooth](https://reader031.fdocuments.net/reader031/viewer/2022013018/5fd74962042a917b5c0990d9/html5/thumbnails/125.jpg)
DemoAdding State Preservation and Restoration Support
Jason ConnCode Monkey & Radio Sponge
![Page 126: Core Bluetooth - Apple Inc. · 2016. 7. 10. · Evolution of Core Bluetooth Core Bluetooth in iOS 7 Code Demo Tips and Best Practices. BLE State of the Union Evolution of Core Bluetooth](https://reader031.fdocuments.net/reader031/viewer/2022013018/5fd74962042a917b5c0990d9/html5/thumbnails/126.jpg)
Bluetooth Low Energy graduatesBuilt-in Services
Renaud LienhartKeeper of the Code & General Curmudgeon
![Page 127: Core Bluetooth - Apple Inc. · 2016. 7. 10. · Evolution of Core Bluetooth Core Bluetooth in iOS 7 Code Demo Tips and Best Practices. BLE State of the Union Evolution of Core Bluetooth](https://reader031.fdocuments.net/reader031/viewer/2022013018/5fd74962042a917b5c0990d9/html5/thumbnails/127.jpg)
GATT ClientBuilt-in Services
![Page 128: Core Bluetooth - Apple Inc. · 2016. 7. 10. · Evolution of Core Bluetooth Core Bluetooth in iOS 7 Code Demo Tips and Best Practices. BLE State of the Union Evolution of Core Bluetooth](https://reader031.fdocuments.net/reader031/viewer/2022013018/5fd74962042a917b5c0990d9/html5/thumbnails/128.jpg)
GATT ClientBuilt-in Services
•HID Over GATT Profile ■ HID, Battery, Device Information services
![Page 129: Core Bluetooth - Apple Inc. · 2016. 7. 10. · Evolution of Core Bluetooth Core Bluetooth in iOS 7 Code Demo Tips and Best Practices. BLE State of the Union Evolution of Core Bluetooth](https://reader031.fdocuments.net/reader031/viewer/2022013018/5fd74962042a917b5c0990d9/html5/thumbnails/129.jpg)
GATT ClientBuilt-in Services
•HID Over GATT Profile ■ HID, Battery, Device Information services
•Works just like Bluetooth Classic■ Managed from Bluetooth Settings■ iOS automatically reconnects paired peripherals
![Page 130: Core Bluetooth - Apple Inc. · 2016. 7. 10. · Evolution of Core Bluetooth Core Bluetooth in iOS 7 Code Demo Tips and Best Practices. BLE State of the Union Evolution of Core Bluetooth](https://reader031.fdocuments.net/reader031/viewer/2022013018/5fd74962042a917b5c0990d9/html5/thumbnails/130.jpg)
GATT ServerBuilt-in Services
![Page 131: Core Bluetooth - Apple Inc. · 2016. 7. 10. · Evolution of Core Bluetooth Core Bluetooth in iOS 7 Code Demo Tips and Best Practices. BLE State of the Union Evolution of Core Bluetooth](https://reader031.fdocuments.net/reader031/viewer/2022013018/5fd74962042a917b5c0990d9/html5/thumbnails/131.jpg)
GATT ServerBuilt-in Services
• Battery Service
![Page 132: Core Bluetooth - Apple Inc. · 2016. 7. 10. · Evolution of Core Bluetooth Core Bluetooth in iOS 7 Code Demo Tips and Best Practices. BLE State of the Union Evolution of Core Bluetooth](https://reader031.fdocuments.net/reader031/viewer/2022013018/5fd74962042a917b5c0990d9/html5/thumbnails/132.jpg)
GATT ServerBuilt-in Services
• Battery Service• Current Time Service
■ Accurate time and date■ Time zone information
![Page 133: Core Bluetooth - Apple Inc. · 2016. 7. 10. · Evolution of Core Bluetooth Core Bluetooth in iOS 7 Code Demo Tips and Best Practices. BLE State of the Union Evolution of Core Bluetooth](https://reader031.fdocuments.net/reader031/viewer/2022013018/5fd74962042a917b5c0990d9/html5/thumbnails/133.jpg)
GATT ServerBuilt-in Services
• Battery Service• Current Time Service
■ Accurate time and date■ Time zone information
•One more thing…
![Page 134: Core Bluetooth - Apple Inc. · 2016. 7. 10. · Evolution of Core Bluetooth Core Bluetooth in iOS 7 Code Demo Tips and Best Practices. BLE State of the Union Evolution of Core Bluetooth](https://reader031.fdocuments.net/reader031/viewer/2022013018/5fd74962042a917b5c0990d9/html5/thumbnails/134.jpg)
Notifications—the problemsBuilt-in Services
![Page 135: Core Bluetooth - Apple Inc. · 2016. 7. 10. · Evolution of Core Bluetooth Core Bluetooth in iOS 7 Code Demo Tips and Best Practices. BLE State of the Union Evolution of Core Bluetooth](https://reader031.fdocuments.net/reader031/viewer/2022013018/5fd74962042a917b5c0990d9/html5/thumbnails/135.jpg)
Notifications—the problemsBuilt-in Services
•Message Access Profile (MAP)
![Page 136: Core Bluetooth - Apple Inc. · 2016. 7. 10. · Evolution of Core Bluetooth Core Bluetooth in iOS 7 Code Demo Tips and Best Practices. BLE State of the Union Evolution of Core Bluetooth](https://reader031.fdocuments.net/reader031/viewer/2022013018/5fd74962042a917b5c0990d9/html5/thumbnails/136.jpg)
Notifications—the problemsBuilt-in Services
•Message Access Profile (MAP)■ Developed for an automotive usage
![Page 137: Core Bluetooth - Apple Inc. · 2016. 7. 10. · Evolution of Core Bluetooth Core Bluetooth in iOS 7 Code Demo Tips and Best Practices. BLE State of the Union Evolution of Core Bluetooth](https://reader031.fdocuments.net/reader031/viewer/2022013018/5fd74962042a917b5c0990d9/html5/thumbnails/137.jpg)
Notifications—the problemsBuilt-in Services
•Message Access Profile (MAP)■ Developed for an automotive usage■ Very constrained: SMS, MMS, Email
![Page 138: Core Bluetooth - Apple Inc. · 2016. 7. 10. · Evolution of Core Bluetooth Core Bluetooth in iOS 7 Code Demo Tips and Best Practices. BLE State of the Union Evolution of Core Bluetooth](https://reader031.fdocuments.net/reader031/viewer/2022013018/5fd74962042a917b5c0990d9/html5/thumbnails/138.jpg)
Notifications—the problemsBuilt-in Services
•Message Access Profile (MAP)■ Developed for an automotive usage■ Very constrained: SMS, MMS, Email
•Alert Notification Service
![Page 139: Core Bluetooth - Apple Inc. · 2016. 7. 10. · Evolution of Core Bluetooth Core Bluetooth in iOS 7 Code Demo Tips and Best Practices. BLE State of the Union Evolution of Core Bluetooth](https://reader031.fdocuments.net/reader031/viewer/2022013018/5fd74962042a917b5c0990d9/html5/thumbnails/139.jpg)
Notifications—the problemsBuilt-in Services
•Message Access Profile (MAP)■ Developed for an automotive usage■ Very constrained: SMS, MMS, Email
•Alert Notification Service■ Very limited
![Page 140: Core Bluetooth - Apple Inc. · 2016. 7. 10. · Evolution of Core Bluetooth Core Bluetooth in iOS 7 Code Demo Tips and Best Practices. BLE State of the Union Evolution of Core Bluetooth](https://reader031.fdocuments.net/reader031/viewer/2022013018/5fd74962042a917b5c0990d9/html5/thumbnails/140.jpg)
Notifications—the problemsBuilt-in Services
•Message Access Profile (MAP)■ Developed for an automotive usage■ Very constrained: SMS, MMS, Email
•Alert Notification Service■ Very limited
• Custom app tailored to a specific accessory
![Page 141: Core Bluetooth - Apple Inc. · 2016. 7. 10. · Evolution of Core Bluetooth Core Bluetooth in iOS 7 Code Demo Tips and Best Practices. BLE State of the Union Evolution of Core Bluetooth](https://reader031.fdocuments.net/reader031/viewer/2022013018/5fd74962042a917b5c0990d9/html5/thumbnails/141.jpg)
Notifications—the problemsBuilt-in Services
•Message Access Profile (MAP)■ Developed for an automotive usage■ Very constrained: SMS, MMS, Email
•Alert Notification Service■ Very limited
• Custom app tailored to a specific accessory■ Heavyweight
![Page 142: Core Bluetooth - Apple Inc. · 2016. 7. 10. · Evolution of Core Bluetooth Core Bluetooth in iOS 7 Code Demo Tips and Best Practices. BLE State of the Union Evolution of Core Bluetooth](https://reader031.fdocuments.net/reader031/viewer/2022013018/5fd74962042a917b5c0990d9/html5/thumbnails/142.jpg)
Notifications—the problemsBuilt-in Services
•Message Access Profile (MAP)■ Developed for an automotive usage■ Very constrained: SMS, MMS, Email
•Alert Notification Service■ Very limited
• Custom app tailored to a specific accessory■ Heavyweight■ Data limited to what the sandbox allows
![Page 143: Core Bluetooth - Apple Inc. · 2016. 7. 10. · Evolution of Core Bluetooth Core Bluetooth in iOS 7 Code Demo Tips and Best Practices. BLE State of the Union Evolution of Core Bluetooth](https://reader031.fdocuments.net/reader031/viewer/2022013018/5fd74962042a917b5c0990d9/html5/thumbnails/143.jpg)
Notifications—our solutionBuilt-in Services
![Page 144: Core Bluetooth - Apple Inc. · 2016. 7. 10. · Evolution of Core Bluetooth Core Bluetooth in iOS 7 Code Demo Tips and Best Practices. BLE State of the Union Evolution of Core Bluetooth](https://reader031.fdocuments.net/reader031/viewer/2022013018/5fd74962042a917b5c0990d9/html5/thumbnails/144.jpg)
Notifications—our solutionBuilt-in Services
•Apple Notification Center Service
![Page 145: Core Bluetooth - Apple Inc. · 2016. 7. 10. · Evolution of Core Bluetooth Core Bluetooth in iOS 7 Code Demo Tips and Best Practices. BLE State of the Union Evolution of Core Bluetooth](https://reader031.fdocuments.net/reader031/viewer/2022013018/5fd74962042a917b5c0990d9/html5/thumbnails/145.jpg)
Notifications—our solutionBuilt-in Services
•Apple Notification Center Service■ Apple-specific
![Page 146: Core Bluetooth - Apple Inc. · 2016. 7. 10. · Evolution of Core Bluetooth Core Bluetooth in iOS 7 Code Demo Tips and Best Practices. BLE State of the Union Evolution of Core Bluetooth](https://reader031.fdocuments.net/reader031/viewer/2022013018/5fd74962042a917b5c0990d9/html5/thumbnails/146.jpg)
Notifications—our solutionBuilt-in Services
•Apple Notification Center Service■ Apple-specific■ Notification about any events on your phone
![Page 147: Core Bluetooth - Apple Inc. · 2016. 7. 10. · Evolution of Core Bluetooth Core Bluetooth in iOS 7 Code Demo Tips and Best Practices. BLE State of the Union Evolution of Core Bluetooth](https://reader031.fdocuments.net/reader031/viewer/2022013018/5fd74962042a917b5c0990d9/html5/thumbnails/147.jpg)
Notifications—our solutionBuilt-in Services
•Apple Notification Center Service■ Apple-specific■ Notification about any events on your phone
■ Incoming and Missed calls, Voicemails
![Page 148: Core Bluetooth - Apple Inc. · 2016. 7. 10. · Evolution of Core Bluetooth Core Bluetooth in iOS 7 Code Demo Tips and Best Practices. BLE State of the Union Evolution of Core Bluetooth](https://reader031.fdocuments.net/reader031/viewer/2022013018/5fd74962042a917b5c0990d9/html5/thumbnails/148.jpg)
Notifications—our solutionBuilt-in Services
•Apple Notification Center Service■ Apple-specific■ Notification about any events on your phone
■ Incoming and Missed calls, Voicemails■ Instant messages, Emails
![Page 149: Core Bluetooth - Apple Inc. · 2016. 7. 10. · Evolution of Core Bluetooth Core Bluetooth in iOS 7 Code Demo Tips and Best Practices. BLE State of the Union Evolution of Core Bluetooth](https://reader031.fdocuments.net/reader031/viewer/2022013018/5fd74962042a917b5c0990d9/html5/thumbnails/149.jpg)
Notifications—our solutionBuilt-in Services
•Apple Notification Center Service■ Apple-specific■ Notification about any events on your phone
■ Incoming and Missed calls, Voicemails■ Instant messages, Emails■ Calendar alerts
![Page 150: Core Bluetooth - Apple Inc. · 2016. 7. 10. · Evolution of Core Bluetooth Core Bluetooth in iOS 7 Code Demo Tips and Best Practices. BLE State of the Union Evolution of Core Bluetooth](https://reader031.fdocuments.net/reader031/viewer/2022013018/5fd74962042a917b5c0990d9/html5/thumbnails/150.jpg)
Notifications—our solutionBuilt-in Services
•Apple Notification Center Service■ Apple-specific■ Notification about any events on your phone
■ Incoming and Missed calls, Voicemails■ Instant messages, Emails■ Calendar alerts■ App notifications
![Page 151: Core Bluetooth - Apple Inc. · 2016. 7. 10. · Evolution of Core Bluetooth Core Bluetooth in iOS 7 Code Demo Tips and Best Practices. BLE State of the Union Evolution of Core Bluetooth](https://reader031.fdocuments.net/reader031/viewer/2022013018/5fd74962042a917b5c0990d9/html5/thumbnails/151.jpg)
Notifications—our solutionBuilt-in Services
•Apple Notification Center Service■ Apple-specific■ Notification about any events on your phone
■ Incoming and Missed calls, Voicemails■ Instant messages, Emails■ Calendar alerts■ App notifications
■ System automatically reconnects
![Page 152: Core Bluetooth - Apple Inc. · 2016. 7. 10. · Evolution of Core Bluetooth Core Bluetooth in iOS 7 Code Demo Tips and Best Practices. BLE State of the Union Evolution of Core Bluetooth](https://reader031.fdocuments.net/reader031/viewer/2022013018/5fd74962042a917b5c0990d9/html5/thumbnails/152.jpg)
Notifications—our solutionBuilt-in Services
•Apple Notification Center Service■ Apple-specific■ Notification about any events on your phone
■ Incoming and Missed calls, Voicemails■ Instant messages, Emails■ Calendar alerts■ App notifications
■ System automatically reconnects ■ Detailed specification posted on the developer portal soon
![Page 153: Core Bluetooth - Apple Inc. · 2016. 7. 10. · Evolution of Core Bluetooth Core Bluetooth in iOS 7 Code Demo Tips and Best Practices. BLE State of the Union Evolution of Core Bluetooth](https://reader031.fdocuments.net/reader031/viewer/2022013018/5fd74962042a917b5c0990d9/html5/thumbnails/153.jpg)
Apple Notification Center ServiceBuilt-in Services
![Page 154: Core Bluetooth - Apple Inc. · 2016. 7. 10. · Evolution of Core Bluetooth Core Bluetooth in iOS 7 Code Demo Tips and Best Practices. BLE State of the Union Evolution of Core Bluetooth](https://reader031.fdocuments.net/reader031/viewer/2022013018/5fd74962042a917b5c0990d9/html5/thumbnails/154.jpg)
New iMessage
![Page 155: Core Bluetooth - Apple Inc. · 2016. 7. 10. · Evolution of Core Bluetooth Core Bluetooth in iOS 7 Code Demo Tips and Best Practices. BLE State of the Union Evolution of Core Bluetooth](https://reader031.fdocuments.net/reader031/viewer/2022013018/5fd74962042a917b5c0990d9/html5/thumbnails/155.jpg)
New iMessageNew Social Notification, UID=1
![Page 156: Core Bluetooth - Apple Inc. · 2016. 7. 10. · Evolution of Core Bluetooth Core Bluetooth in iOS 7 Code Demo Tips and Best Practices. BLE State of the Union Evolution of Core Bluetooth](https://reader031.fdocuments.net/reader031/viewer/2022013018/5fd74962042a917b5c0990d9/html5/thumbnails/156.jpg)
New iMessageNew Social Notification, UID=1
GetAttributes(UID=1,Title,Msg)
![Page 157: Core Bluetooth - Apple Inc. · 2016. 7. 10. · Evolution of Core Bluetooth Core Bluetooth in iOS 7 Code Demo Tips and Best Practices. BLE State of the Union Evolution of Core Bluetooth](https://reader031.fdocuments.net/reader031/viewer/2022013018/5fd74962042a917b5c0990d9/html5/thumbnails/157.jpg)
New iMessageNew Social Notification, UID=1
GetAttributes(UID=1,Title,Msg)
Title=”Jason”,Msg=”Beers?”
![Page 158: Core Bluetooth - Apple Inc. · 2016. 7. 10. · Evolution of Core Bluetooth Core Bluetooth in iOS 7 Code Demo Tips and Best Practices. BLE State of the Union Evolution of Core Bluetooth](https://reader031.fdocuments.net/reader031/viewer/2022013018/5fd74962042a917b5c0990d9/html5/thumbnails/158.jpg)
New iMessageNew Social Notification, UID=1
GetAttributes(UID=1,Title,Msg)
Title=”Jason”,Msg=”Beers?”
Alert User
![Page 159: Core Bluetooth - Apple Inc. · 2016. 7. 10. · Evolution of Core Bluetooth Core Bluetooth in iOS 7 Code Demo Tips and Best Practices. BLE State of the Union Evolution of Core Bluetooth](https://reader031.fdocuments.net/reader031/viewer/2022013018/5fd74962042a917b5c0990d9/html5/thumbnails/159.jpg)
New iMessageNew Social Notification, UID=1
GetAttributes(UID=1,Title,Msg)
Title=”Jason”,Msg=”Beers?”
iMessage Read
Alert User
![Page 160: Core Bluetooth - Apple Inc. · 2016. 7. 10. · Evolution of Core Bluetooth Core Bluetooth in iOS 7 Code Demo Tips and Best Practices. BLE State of the Union Evolution of Core Bluetooth](https://reader031.fdocuments.net/reader031/viewer/2022013018/5fd74962042a917b5c0990d9/html5/thumbnails/160.jpg)
New iMessageNew Social Notification, UID=1
GetAttributes(UID=1,Title,Msg)
Title=”Jason”,Msg=”Beers?”
iMessage Read Notification Removed, UID=1
Alert User
![Page 161: Core Bluetooth - Apple Inc. · 2016. 7. 10. · Evolution of Core Bluetooth Core Bluetooth in iOS 7 Code Demo Tips and Best Practices. BLE State of the Union Evolution of Core Bluetooth](https://reader031.fdocuments.net/reader031/viewer/2022013018/5fd74962042a917b5c0990d9/html5/thumbnails/161.jpg)
New iMessageNew Social Notification, UID=1
GetAttributes(UID=1,Title,Msg)
Title=”Jason”,Msg=”Beers?”
iMessage Read Notification Removed, UID=1
Alert User
Dismiss Alert
![Page 162: Core Bluetooth - Apple Inc. · 2016. 7. 10. · Evolution of Core Bluetooth Core Bluetooth in iOS 7 Code Demo Tips and Best Practices. BLE State of the Union Evolution of Core Bluetooth](https://reader031.fdocuments.net/reader031/viewer/2022013018/5fd74962042a917b5c0990d9/html5/thumbnails/162.jpg)
Tips and Best Practices
![Page 163: Core Bluetooth - Apple Inc. · 2016. 7. 10. · Evolution of Core Bluetooth Core Bluetooth in iOS 7 Code Demo Tips and Best Practices. BLE State of the Union Evolution of Core Bluetooth](https://reader031.fdocuments.net/reader031/viewer/2022013018/5fd74962042a917b5c0990d9/html5/thumbnails/163.jpg)
Tips and Best Practices
• Core Bluetooth needs to know if you intend to use CBPeripherals—keep a reference to them
![Page 164: Core Bluetooth - Apple Inc. · 2016. 7. 10. · Evolution of Core Bluetooth Core Bluetooth in iOS 7 Code Demo Tips and Best Practices. BLE State of the Union Evolution of Core Bluetooth](https://reader031.fdocuments.net/reader031/viewer/2022013018/5fd74962042a917b5c0990d9/html5/thumbnails/164.jpg)
Tips and Best Practices
• Core Bluetooth needs to know if you intend to use CBPeripherals—keep a reference to them• Scanning and connection requests do not time out
![Page 165: Core Bluetooth - Apple Inc. · 2016. 7. 10. · Evolution of Core Bluetooth Core Bluetooth in iOS 7 Code Demo Tips and Best Practices. BLE State of the Union Evolution of Core Bluetooth](https://reader031.fdocuments.net/reader031/viewer/2022013018/5fd74962042a917b5c0990d9/html5/thumbnails/165.jpg)
Tips and Best Practices
• Core Bluetooth needs to know if you intend to use CBPeripherals—keep a reference to them• Scanning and connection requests do not time out• CBPeripheral and CBCentral conform to NSCopying and can be used as dictionary keys
![Page 166: Core Bluetooth - Apple Inc. · 2016. 7. 10. · Evolution of Core Bluetooth Core Bluetooth in iOS 7 Code Demo Tips and Best Practices. BLE State of the Union Evolution of Core Bluetooth](https://reader031.fdocuments.net/reader031/viewer/2022013018/5fd74962042a917b5c0990d9/html5/thumbnails/166.jpg)
Tips and Best Practices
• Core Bluetooth needs to know if you intend to use CBPeripherals—keep a reference to them• Scanning and connection requests do not time out• CBPeripheral and CBCentral conform to NSCopying and can be used as dictionary keys•Do not touch Client Configuration Characteristic Descriptors directly
![Page 167: Core Bluetooth - Apple Inc. · 2016. 7. 10. · Evolution of Core Bluetooth Core Bluetooth in iOS 7 Code Demo Tips and Best Practices. BLE State of the Union Evolution of Core Bluetooth](https://reader031.fdocuments.net/reader031/viewer/2022013018/5fd74962042a917b5c0990d9/html5/thumbnails/167.jpg)
Tips and Best Practices
• Core Bluetooth needs to know if you intend to use CBPeripherals—keep a reference to them• Scanning and connection requests do not time out• CBPeripheral and CBCentral conform to NSCopying and can be used as dictionary keys•Do not touch Client Configuration Characteristic Descriptors directly•Do not game the background mechanisms
![Page 168: Core Bluetooth - Apple Inc. · 2016. 7. 10. · Evolution of Core Bluetooth Core Bluetooth in iOS 7 Code Demo Tips and Best Practices. BLE State of the Union Evolution of Core Bluetooth](https://reader031.fdocuments.net/reader031/viewer/2022013018/5fd74962042a917b5c0990d9/html5/thumbnails/168.jpg)
Bluetooth best practices
http://developer.apple.com/hardwaredrivers/BluetoothDesignGuidelines.pdf
Apple Guidelines
![Page 169: Core Bluetooth - Apple Inc. · 2016. 7. 10. · Evolution of Core Bluetooth Core Bluetooth in iOS 7 Code Demo Tips and Best Practices. BLE State of the Union Evolution of Core Bluetooth](https://reader031.fdocuments.net/reader031/viewer/2022013018/5fd74962042a917b5c0990d9/html5/thumbnails/169.jpg)
Core Bluetooth Programming Guide
Finally!
Apple Guidelines
![Page 170: Core Bluetooth - Apple Inc. · 2016. 7. 10. · Evolution of Core Bluetooth Core Bluetooth in iOS 7 Code Demo Tips and Best Practices. BLE State of the Union Evolution of Core Bluetooth](https://reader031.fdocuments.net/reader031/viewer/2022013018/5fd74962042a917b5c0990d9/html5/thumbnails/170.jpg)
Craig KeithleyMFi & I/O Technology [email protected]
Stephen ChickiPhone [email protected]
Developer ProgramsMFi Programhttp://developer.apple.com/mfi/
More Information
![Page 171: Core Bluetooth - Apple Inc. · 2016. 7. 10. · Evolution of Core Bluetooth Core Bluetooth in iOS 7 Code Demo Tips and Best Practices. BLE State of the Union Evolution of Core Bluetooth](https://reader031.fdocuments.net/reader031/viewer/2022013018/5fd74962042a917b5c0990d9/html5/thumbnails/171.jpg)
Bluetooth Accessory Design Guidelineshttp://developer.apple.com/hardwaredrivers/BluetoothDesignGuidelines.pdf
Reporting Bugshttp://bugreport.apple.com
Apple Developer Forumshttps://devforums.apple.com/community/ios/core/cbthttps://devforums.apple.com/community/mac/coreos/cbt
Bluetooth Developer Sitehttp://developer.bluetooth.org
More Information
![Page 172: Core Bluetooth - Apple Inc. · 2016. 7. 10. · Evolution of Core Bluetooth Core Bluetooth in iOS 7 Code Demo Tips and Best Practices. BLE State of the Union Evolution of Core Bluetooth](https://reader031.fdocuments.net/reader031/viewer/2022013018/5fd74962042a917b5c0990d9/html5/thumbnails/172.jpg)
What’s New in Core Location PresidioThursday 11:30AM
Related Sessions
Designing Accessories for iOS and OS X Nob HillTuesday 10:15AM
![Page 173: Core Bluetooth - Apple Inc. · 2016. 7. 10. · Evolution of Core Bluetooth Core Bluetooth in iOS 7 Code Demo Tips and Best Practices. BLE State of the Union Evolution of Core Bluetooth](https://reader031.fdocuments.net/reader031/viewer/2022013018/5fd74962042a917b5c0990d9/html5/thumbnails/173.jpg)
Labs
iOS and OS X Accessories Lab Core OS Lab BThursday 9:00AM
iOS and OS X Accessories Lab Core OS Lab ATuesday 11:30AM
![Page 174: Core Bluetooth - Apple Inc. · 2016. 7. 10. · Evolution of Core Bluetooth Core Bluetooth in iOS 7 Code Demo Tips and Best Practices. BLE State of the Union Evolution of Core Bluetooth](https://reader031.fdocuments.net/reader031/viewer/2022013018/5fd74962042a917b5c0990d9/html5/thumbnails/174.jpg)
ProximitySecurityAutomationHealth CareSports/FitnessEntertainmentToysPay Systems
![Page 175: Core Bluetooth - Apple Inc. · 2016. 7. 10. · Evolution of Core Bluetooth Core Bluetooth in iOS 7 Code Demo Tips and Best Practices. BLE State of the Union Evolution of Core Bluetooth](https://reader031.fdocuments.net/reader031/viewer/2022013018/5fd74962042a917b5c0990d9/html5/thumbnails/175.jpg)
Proximity
Security
Automation
Health Care Sports/Fitness
Entertainment
Toys
Pay Systems
![Page 176: Core Bluetooth - Apple Inc. · 2016. 7. 10. · Evolution of Core Bluetooth Core Bluetooth in iOS 7 Code Demo Tips and Best Practices. BLE State of the Union Evolution of Core Bluetooth](https://reader031.fdocuments.net/reader031/viewer/2022013018/5fd74962042a917b5c0990d9/html5/thumbnails/176.jpg)
Proximity
Security
Automation
Health Care Sports/Fitness
Entertainment
Toys
Pay Systems
Connect the World
![Page 177: Core Bluetooth - Apple Inc. · 2016. 7. 10. · Evolution of Core Bluetooth Core Bluetooth in iOS 7 Code Demo Tips and Best Practices. BLE State of the Union Evolution of Core Bluetooth](https://reader031.fdocuments.net/reader031/viewer/2022013018/5fd74962042a917b5c0990d9/html5/thumbnails/177.jpg)