•what’s new in core bluetooth - development videos - … id software version serial number...
TRANSCRIPT
![Page 1: •What’s New in Core Bluetooth - Development Videos - … ID Software Version Serial Number CBService CBCharacteristic CBCharacteristic CBCharacteristic Service Discovery Speed](https://reader034.vdocument.in/reader034/viewer/2022050719/5ac249b17f8b9a213f8e2175/html5/thumbnails/1.jpg)
#WWDC17
© 2017 Apple Inc. All rights reserved. Redistribution or public display not permitted without written permission from Apple.
Craig Dooley, Bluetooth Engineer Duy Phan, Bluetooth Engineer
•What’s New in Core Bluetooth • Session 712
System Frameworks
![Page 2: •What’s New in Core Bluetooth - Development Videos - … ID Software Version Serial Number CBService CBCharacteristic CBCharacteristic CBCharacteristic Service Discovery Speed](https://reader034.vdocument.in/reader034/viewer/2022050719/5ac249b17f8b9a213f8e2175/html5/thumbnails/2.jpg)
•Introduction •Enhanced reliability •Platform support •L2CAP channels •Best practices •Getting the most out of Core Bluetooth
![Page 3: •What’s New in Core Bluetooth - Development Videos - … ID Software Version Serial Number CBService CBCharacteristic CBCharacteristic CBCharacteristic Service Discovery Speed](https://reader034.vdocument.in/reader034/viewer/2022050719/5ac249b17f8b9a213f8e2175/html5/thumbnails/3.jpg)
•Introduction
![Page 4: •What’s New in Core Bluetooth - Development Videos - … ID Software Version Serial Number CBService CBCharacteristic CBCharacteristic CBCharacteristic Service Discovery Speed](https://reader034.vdocument.in/reader034/viewer/2022050719/5ac249b17f8b9a213f8e2175/html5/thumbnails/4.jpg)
![Page 5: •What’s New in Core Bluetooth - Development Videos - … ID Software Version Serial Number CBService CBCharacteristic CBCharacteristic CBCharacteristic Service Discovery Speed](https://reader034.vdocument.in/reader034/viewer/2022050719/5ac249b17f8b9a213f8e2175/html5/thumbnails/5.jpg)
![Page 6: •What’s New in Core Bluetooth - Development Videos - … ID Software Version Serial Number CBService CBCharacteristic CBCharacteristic CBCharacteristic Service Discovery Speed](https://reader034.vdocument.in/reader034/viewer/2022050719/5ac249b17f8b9a213f8e2175/html5/thumbnails/6.jpg)
![Page 7: •What’s New in Core Bluetooth - Development Videos - … ID Software Version Serial Number CBService CBCharacteristic CBCharacteristic CBCharacteristic Service Discovery Speed](https://reader034.vdocument.in/reader034/viewer/2022050719/5ac249b17f8b9a213f8e2175/html5/thumbnails/7.jpg)
![Page 8: •What’s New in Core Bluetooth - Development Videos - … ID Software Version Serial Number CBService CBCharacteristic CBCharacteristic CBCharacteristic Service Discovery Speed](https://reader034.vdocument.in/reader034/viewer/2022050719/5ac249b17f8b9a213f8e2175/html5/thumbnails/8.jpg)
![Page 9: •What’s New in Core Bluetooth - Development Videos - … ID Software Version Serial Number CBService CBCharacteristic CBCharacteristic CBCharacteristic Service Discovery Speed](https://reader034.vdocument.in/reader034/viewer/2022050719/5ac249b17f8b9a213f8e2175/html5/thumbnails/9.jpg)
![Page 10: •What’s New in Core Bluetooth - Development Videos - … ID Software Version Serial Number CBService CBCharacteristic CBCharacteristic CBCharacteristic Service Discovery Speed](https://reader034.vdocument.in/reader034/viewer/2022050719/5ac249b17f8b9a213f8e2175/html5/thumbnails/10.jpg)
Thank you!
![Page 11: •What’s New in Core Bluetooth - Development Videos - … ID Software Version Serial Number CBService CBCharacteristic CBCharacteristic CBCharacteristic Service Discovery Speed](https://reader034.vdocument.in/reader034/viewer/2022050719/5ac249b17f8b9a213f8e2175/html5/thumbnails/11.jpg)
Built-in Profiles
Apple Notification Center Service
Apple Media Service
MIDI over Bluetooth Low Energy
iBeacon
Current Time Service
HID Over GATT
![Page 12: •What’s New in Core Bluetooth - Development Videos - … ID Software Version Serial Number CBService CBCharacteristic CBCharacteristic CBCharacteristic Service Discovery Speed](https://reader034.vdocument.in/reader034/viewer/2022050719/5ac249b17f8b9a213f8e2175/html5/thumbnails/12.jpg)
Centrals and Peripherals
![Page 13: •What’s New in Core Bluetooth - Development Videos - … ID Software Version Serial Number CBService CBCharacteristic CBCharacteristic CBCharacteristic Service Discovery Speed](https://reader034.vdocument.in/reader034/viewer/2022050719/5ac249b17f8b9a213f8e2175/html5/thumbnails/13.jpg)
Centrals and Peripherals
![Page 14: •What’s New in Core Bluetooth - Development Videos - … ID Software Version Serial Number CBService CBCharacteristic CBCharacteristic CBCharacteristic Service Discovery Speed](https://reader034.vdocument.in/reader034/viewer/2022050719/5ac249b17f8b9a213f8e2175/html5/thumbnails/14.jpg)
Centrals and Peripherals
![Page 15: •What’s New in Core Bluetooth - Development Videos - … ID Software Version Serial Number CBService CBCharacteristic CBCharacteristic CBCharacteristic Service Discovery Speed](https://reader034.vdocument.in/reader034/viewer/2022050719/5ac249b17f8b9a213f8e2175/html5/thumbnails/15.jpg)
Centrals and Peripherals
![Page 16: •What’s New in Core Bluetooth - Development Videos - … ID Software Version Serial Number CBService CBCharacteristic CBCharacteristic CBCharacteristic Service Discovery Speed](https://reader034.vdocument.in/reader034/viewer/2022050719/5ac249b17f8b9a213f8e2175/html5/thumbnails/16.jpg)
GATT Database
CBService
CBCharacteristic
CBCharacteristic
CBCharacteristic
CBService
CBCharacteristic
CBCharacteristic
CBCharacteristic
![Page 17: •What’s New in Core Bluetooth - Development Videos - … ID Software Version Serial Number CBService CBCharacteristic CBCharacteristic CBCharacteristic Service Discovery Speed](https://reader034.vdocument.in/reader034/viewer/2022050719/5ac249b17f8b9a213f8e2175/html5/thumbnails/17.jpg)
GATT Database
CBService
CBCharacteristic
CBCharacteristic
CBCharacteristic
CBService
CBCharacteristic
CBCharacteristic
CBCharacteristic
![Page 18: •What’s New in Core Bluetooth - Development Videos - … ID Software Version Serial Number CBService CBCharacteristic CBCharacteristic CBCharacteristic Service Discovery Speed](https://reader034.vdocument.in/reader034/viewer/2022050719/5ac249b17f8b9a213f8e2175/html5/thumbnails/18.jpg)
GATT Database
CBService
CBCharacteristic
CBCharacteristic
CBCharacteristic
CBService
CBCharacteristic
CBCharacteristic
CBCharacteristic
![Page 19: •What’s New in Core Bluetooth - Development Videos - … ID Software Version Serial Number CBService CBCharacteristic CBCharacteristic CBCharacteristic Service Discovery Speed](https://reader034.vdocument.in/reader034/viewer/2022050719/5ac249b17f8b9a213f8e2175/html5/thumbnails/19.jpg)
Reading Characteristics as a Central
Services can be read from a connected Central • Retrieve by identifier • Retrieve connected devices
open class CBCentralManager : CBManager { open func retrievePeripherals(withIdentifiers identifiers: [UUID]) -> [CBPeripheral] open func retrieveConnectedPeripherals(withServices serviceUUIDs: [CBUUID]) -> [CBPeripheral] }
![Page 20: •What’s New in Core Bluetooth - Development Videos - … ID Software Version Serial Number CBService CBCharacteristic CBCharacteristic CBCharacteristic Service Discovery Speed](https://reader034.vdocument.in/reader034/viewer/2022050719/5ac249b17f8b9a213f8e2175/html5/thumbnails/20.jpg)
•Enhanced Reliability
![Page 21: •What’s New in Core Bluetooth - Development Videos - … ID Software Version Serial Number CBService CBCharacteristic CBCharacteristic CBCharacteristic Service Discovery Speed](https://reader034.vdocument.in/reader034/viewer/2022050719/5ac249b17f8b9a213f8e2175/html5/thumbnails/21.jpg)
Summary
![Page 22: •What’s New in Core Bluetooth - Development Videos - … ID Software Version Serial Number CBService CBCharacteristic CBCharacteristic CBCharacteristic Service Discovery Speed](https://reader034.vdocument.in/reader034/viewer/2022050719/5ac249b17f8b9a213f8e2175/html5/thumbnails/22.jpg)
iOS Apps can continue using Core Bluetooth in the background
Backgrounded Apps
![Page 23: •What’s New in Core Bluetooth - Development Videos - … ID Software Version Serial Number CBService CBCharacteristic CBCharacteristic CBCharacteristic Service Discovery Speed](https://reader034.vdocument.in/reader034/viewer/2022050719/5ac249b17f8b9a213f8e2175/html5/thumbnails/23.jpg)
iOS Apps can continue using Core Bluetooth in the background
Backgrounded Apps
![Page 24: •What’s New in Core Bluetooth - Development Videos - … ID Software Version Serial Number CBService CBCharacteristic CBCharacteristic CBCharacteristic Service Discovery Speed](https://reader034.vdocument.in/reader034/viewer/2022050719/5ac249b17f8b9a213f8e2175/html5/thumbnails/24.jpg)
Central operations can continue when your app is not running • Scan for new devices with services • Connect to an already known device
CBCentralManager restoration
![Page 25: •What’s New in Core Bluetooth - Development Videos - … ID Software Version Serial Number CBService CBCharacteristic CBCharacteristic CBCharacteristic Service Discovery Speed](https://reader034.vdocument.in/reader034/viewer/2022050719/5ac249b17f8b9a213f8e2175/html5/thumbnails/25.jpg)
public let CBCentralManagerOptionRestoreIdentifierKey: String
/* * @seealso CBCentralManagerRestoredStatePeripheralsKey; * @seealso CBCentralManagerRestoredStateScanServicesKey; * @seealso CBCentralManagerRestoredStateScanOptionsKey; * */optional public func centralManager(_ central: CBCentralManager, willRestoreState dict: [String: Any])
![Page 26: •What’s New in Core Bluetooth - Development Videos - … ID Software Version Serial Number CBService CBCharacteristic CBCharacteristic CBCharacteristic Service Discovery Speed](https://reader034.vdocument.in/reader034/viewer/2022050719/5ac249b17f8b9a213f8e2175/html5/thumbnails/26.jpg)
Peripheral operations can continue when your app is not running • Publish local services • Advertise service UUID
CBPeripheralManager Restoration
![Page 27: •What’s New in Core Bluetooth - Development Videos - … ID Software Version Serial Number CBService CBCharacteristic CBCharacteristic CBCharacteristic Service Discovery Speed](https://reader034.vdocument.in/reader034/viewer/2022050719/5ac249b17f8b9a213f8e2175/html5/thumbnails/27.jpg)
public let CBPeripheralManagerOptionRestoreIdentifierKey: String
/* * @seealso CBPeripheralManagerRestoredStateServicesKey; * @seealso CBPeripheralManagerRestoredStateAdvertisementDataKey; * */optional public func peripheralManager(_ peripheral: CBPeripheralManager, willRestoreState dict: [String: Any])
![Page 28: •What’s New in Core Bluetooth - Development Videos - … ID Software Version Serial Number CBService CBCharacteristic CBCharacteristic CBCharacteristic Service Discovery Speed](https://reader034.vdocument.in/reader034/viewer/2022050719/5ac249b17f8b9a213f8e2175/html5/thumbnails/28.jpg)
State Preservation and RestorationNEW
![Page 29: •What’s New in Core Bluetooth - Development Videos - … ID Software Version Serial Number CBService CBCharacteristic CBCharacteristic CBCharacteristic Service Discovery Speed](https://reader034.vdocument.in/reader034/viewer/2022050719/5ac249b17f8b9a213f8e2175/html5/thumbnails/29.jpg)
State Preservation and Restoration
Works across device reboot or Bluetooth system events
NEW
![Page 30: •What’s New in Core Bluetooth - Development Videos - … ID Software Version Serial Number CBService CBCharacteristic CBCharacteristic CBCharacteristic Service Discovery Speed](https://reader034.vdocument.in/reader034/viewer/2022050719/5ac249b17f8b9a213f8e2175/html5/thumbnails/30.jpg)
State Preservation and Restoration
Works across device reboot or Bluetooth system events• Try to ask for as few system resources as possible
NEW
![Page 31: •What’s New in Core Bluetooth - Development Videos - … ID Software Version Serial Number CBService CBCharacteristic CBCharacteristic CBCharacteristic Service Discovery Speed](https://reader034.vdocument.in/reader034/viewer/2022050719/5ac249b17f8b9a213f8e2175/html5/thumbnails/31.jpg)
State Preservation and Restoration
Works across device reboot or Bluetooth system events• Try to ask for as few system resources as possible• Background activities will be stopped if
NEW
![Page 32: •What’s New in Core Bluetooth - Development Videos - … ID Software Version Serial Number CBService CBCharacteristic CBCharacteristic CBCharacteristic Service Discovery Speed](https://reader034.vdocument.in/reader034/viewer/2022050719/5ac249b17f8b9a213f8e2175/html5/thumbnails/32.jpg)
State Preservation and Restoration
Works across device reboot or Bluetooth system events• Try to ask for as few system resources as possible• Background activities will be stopped if
- User force quits the app
NEW
![Page 33: •What’s New in Core Bluetooth - Development Videos - … ID Software Version Serial Number CBService CBCharacteristic CBCharacteristic CBCharacteristic Service Discovery Speed](https://reader034.vdocument.in/reader034/viewer/2022050719/5ac249b17f8b9a213f8e2175/html5/thumbnails/33.jpg)
State Preservation and Restoration
Works across device reboot or Bluetooth system events• Try to ask for as few system resources as possible• Background activities will be stopped if
- User force quits the app - User disables Bluetooth
NEW
![Page 34: •What’s New in Core Bluetooth - Development Videos - … ID Software Version Serial Number CBService CBCharacteristic CBCharacteristic CBCharacteristic Service Discovery Speed](https://reader034.vdocument.in/reader034/viewer/2022050719/5ac249b17f8b9a213f8e2175/html5/thumbnails/34.jpg)
Write Without Response would be dropped due to memory pressure
New property will tell your app if more data can be sent
Write Without Response
open class CBPeripheral: CBPeer { open var canSendWriteWithoutResponse: Bool { get } }
public protocol CBPeripheralDelegate: NSObjectProtocol { optional public func peripheralIsReady(toSendWriteWithoutResponse peripheral: CBPeripheral) }
NEW
![Page 35: •What’s New in Core Bluetooth - Development Videos - … ID Software Version Serial Number CBService CBCharacteristic CBCharacteristic CBCharacteristic Service Discovery Speed](https://reader034.vdocument.in/reader034/viewer/2022050719/5ac249b17f8b9a213f8e2175/html5/thumbnails/35.jpg)
•Platform Support
![Page 36: •What’s New in Core Bluetooth - Development Videos - … ID Software Version Serial Number CBService CBCharacteristic CBCharacteristic CBCharacteristic Service Discovery Speed](https://reader034.vdocument.in/reader034/viewer/2022050719/5ac249b17f8b9a213f8e2175/html5/thumbnails/36.jpg)
macOS 10.7 iOS 5
![Page 37: •What’s New in Core Bluetooth - Development Videos - … ID Software Version Serial Number CBService CBCharacteristic CBCharacteristic CBCharacteristic Service Discovery Speed](https://reader034.vdocument.in/reader034/viewer/2022050719/5ac249b17f8b9a213f8e2175/html5/thumbnails/37.jpg)
macOS 10.7 iOS 5 tvOS 9
![Page 38: •What’s New in Core Bluetooth - Development Videos - … ID Software Version Serial Number CBService CBCharacteristic CBCharacteristic CBCharacteristic Service Discovery Speed](https://reader034.vdocument.in/reader034/viewer/2022050719/5ac249b17f8b9a213f8e2175/html5/thumbnails/38.jpg)
macOS 10.7 iOS 5 tvOS 9 watchOS 4
![Page 39: •What’s New in Core Bluetooth - Development Videos - … ID Software Version Serial Number CBService CBCharacteristic CBCharacteristic CBCharacteristic Service Discovery Speed](https://reader034.vdocument.in/reader034/viewer/2022050719/5ac249b17f8b9a213f8e2175/html5/thumbnails/39.jpg)
iOS + macOS
![Page 40: •What’s New in Core Bluetooth - Development Videos - … ID Software Version Serial Number CBService CBCharacteristic CBCharacteristic CBCharacteristic Service Discovery Speed](https://reader034.vdocument.in/reader034/viewer/2022050719/5ac249b17f8b9a213f8e2175/html5/thumbnails/40.jpg)
iOS + macOS
Foreground and background apps
![Page 41: •What’s New in Core Bluetooth - Development Videos - … ID Software Version Serial Number CBService CBCharacteristic CBCharacteristic CBCharacteristic Service Discovery Speed](https://reader034.vdocument.in/reader034/viewer/2022050719/5ac249b17f8b9a213f8e2175/html5/thumbnails/41.jpg)
iOS + macOS
Foreground and background apps
Central and Peripheral
![Page 42: •What’s New in Core Bluetooth - Development Videos - … ID Software Version Serial Number CBService CBCharacteristic CBCharacteristic CBCharacteristic Service Discovery Speed](https://reader034.vdocument.in/reader034/viewer/2022050719/5ac249b17f8b9a213f8e2175/html5/thumbnails/42.jpg)
iOS + macOS
Foreground and background apps
Central and Peripheral
15 ms minimum connection interval
![Page 43: •What’s New in Core Bluetooth - Development Videos - … ID Software Version Serial Number CBService CBCharacteristic CBCharacteristic CBCharacteristic Service Discovery Speed](https://reader034.vdocument.in/reader034/viewer/2022050719/5ac249b17f8b9a213f8e2175/html5/thumbnails/43.jpg)
iOS + macOS
Foreground and background apps
Central and Peripheral
15 ms minimum connection interval
State Preservation and Restoration on iOS
![Page 44: •What’s New in Core Bluetooth - Development Videos - … ID Software Version Serial Number CBService CBCharacteristic CBCharacteristic CBCharacteristic Service Discovery Speed](https://reader034.vdocument.in/reader034/viewer/2022050719/5ac249b17f8b9a213f8e2175/html5/thumbnails/44.jpg)
tvOS
![Page 45: •What’s New in Core Bluetooth - Development Videos - … ID Software Version Serial Number CBService CBCharacteristic CBCharacteristic CBCharacteristic Service Discovery Speed](https://reader034.vdocument.in/reader034/viewer/2022050719/5ac249b17f8b9a213f8e2175/html5/thumbnails/45.jpg)
tvOS
Foreground app only
![Page 46: •What’s New in Core Bluetooth - Development Videos - … ID Software Version Serial Number CBService CBCharacteristic CBCharacteristic CBCharacteristic Service Discovery Speed](https://reader034.vdocument.in/reader034/viewer/2022050719/5ac249b17f8b9a213f8e2175/html5/thumbnails/46.jpg)
tvOS
Foreground app only
Central role only
![Page 47: •What’s New in Core Bluetooth - Development Videos - … ID Software Version Serial Number CBService CBCharacteristic CBCharacteristic CBCharacteristic Service Discovery Speed](https://reader034.vdocument.in/reader034/viewer/2022050719/5ac249b17f8b9a213f8e2175/html5/thumbnails/47.jpg)
tvOS
Foreground app only
Central role only
Limited to 2 simultaneous connections
![Page 48: •What’s New in Core Bluetooth - Development Videos - … ID Software Version Serial Number CBService CBCharacteristic CBCharacteristic CBCharacteristic Service Discovery Speed](https://reader034.vdocument.in/reader034/viewer/2022050719/5ac249b17f8b9a213f8e2175/html5/thumbnails/48.jpg)
tvOS
Foreground app only
Central role only
Limited to 2 simultaneous connections
30 ms minimum connection interval
![Page 49: •What’s New in Core Bluetooth - Development Videos - … ID Software Version Serial Number CBService CBCharacteristic CBCharacteristic CBCharacteristic Service Discovery Speed](https://reader034.vdocument.in/reader034/viewer/2022050719/5ac249b17f8b9a213f8e2175/html5/thumbnails/49.jpg)
tvOS
Foreground app only
Central role only
Limited to 2 simultaneous connections
30 ms minimum connection interval
Peripherals disconnected when app ismoved to the background
![Page 50: •What’s New in Core Bluetooth - Development Videos - … ID Software Version Serial Number CBService CBCharacteristic CBCharacteristic CBCharacteristic Service Discovery Speed](https://reader034.vdocument.in/reader034/viewer/2022050719/5ac249b17f8b9a213f8e2175/html5/thumbnails/50.jpg)
watchOSNEW
![Page 51: •What’s New in Core Bluetooth - Development Videos - … ID Software Version Serial Number CBService CBCharacteristic CBCharacteristic CBCharacteristic Service Discovery Speed](https://reader034.vdocument.in/reader034/viewer/2022050719/5ac249b17f8b9a213f8e2175/html5/thumbnails/51.jpg)
watchOS
Access dictated by system runtime policies
NEW
![Page 52: •What’s New in Core Bluetooth - Development Videos - … ID Software Version Serial Number CBService CBCharacteristic CBCharacteristic CBCharacteristic Service Discovery Speed](https://reader034.vdocument.in/reader034/viewer/2022050719/5ac249b17f8b9a213f8e2175/html5/thumbnails/52.jpg)
watchOS
Access dictated by system runtime policies
Central role only
NEW
![Page 53: •What’s New in Core Bluetooth - Development Videos - … ID Software Version Serial Number CBService CBCharacteristic CBCharacteristic CBCharacteristic Service Discovery Speed](https://reader034.vdocument.in/reader034/viewer/2022050719/5ac249b17f8b9a213f8e2175/html5/thumbnails/53.jpg)
watchOS
Access dictated by system runtime policies
Central role only
Limited to 2 simultaneous connections
NEW
![Page 54: •What’s New in Core Bluetooth - Development Videos - … ID Software Version Serial Number CBService CBCharacteristic CBCharacteristic CBCharacteristic Service Discovery Speed](https://reader034.vdocument.in/reader034/viewer/2022050719/5ac249b17f8b9a213f8e2175/html5/thumbnails/54.jpg)
watchOS
Access dictated by system runtime policies
Central role only
Limited to 2 simultaneous connections
30 ms minimum connection interval
NEW
![Page 55: •What’s New in Core Bluetooth - Development Videos - … ID Software Version Serial Number CBService CBCharacteristic CBCharacteristic CBCharacteristic Service Discovery Speed](https://reader034.vdocument.in/reader034/viewer/2022050719/5ac249b17f8b9a213f8e2175/html5/thumbnails/55.jpg)
watchOS
Access dictated by system runtime policies
Central role only
Limited to 2 simultaneous connections
30 ms minimum connection interval
Peripherals disconnected when app is suspended
NEW
![Page 56: •What’s New in Core Bluetooth - Development Videos - … ID Software Version Serial Number CBService CBCharacteristic CBCharacteristic CBCharacteristic Service Discovery Speed](https://reader034.vdocument.in/reader034/viewer/2022050719/5ac249b17f8b9a213f8e2175/html5/thumbnails/56.jpg)
watchOS
Access dictated by system runtime policies
Central role only
Limited to 2 simultaneous connections
30 ms minimum connection interval
Peripherals disconnected when app is suspended
Supported on Apple Watch Series 2
NEW
![Page 57: •What’s New in Core Bluetooth - Development Videos - … ID Software Version Serial Number CBService CBCharacteristic CBCharacteristic CBCharacteristic Service Discovery Speed](https://reader034.vdocument.in/reader034/viewer/2022050719/5ac249b17f8b9a213f8e2175/html5/thumbnails/57.jpg)
•L2CAP Channels
NEW
![Page 58: •What’s New in Core Bluetooth - Development Videos - … ID Software Version Serial Number CBService CBCharacteristic CBCharacteristic CBCharacteristic Service Discovery Speed](https://reader034.vdocument.in/reader034/viewer/2022050719/5ac249b17f8b9a213f8e2175/html5/thumbnails/58.jpg)
L2CAP Connection Oriented Channels
Bluetooth SIG Protocol underlying all communication
Logical Link Control and Adaptation Protocol
Stream between two devices
Introduced for LE in Bluetooth Core Spec 4.1
![Page 59: •What’s New in Core Bluetooth - Development Videos - … ID Software Version Serial Number CBService CBCharacteristic CBCharacteristic CBCharacteristic Service Discovery Speed](https://reader034.vdocument.in/reader034/viewer/2022050719/5ac249b17f8b9a213f8e2175/html5/thumbnails/59.jpg)
L2CAP Channels
CBCentralManager
CBService
CBCharacteristic
CBCharacteristic
CBCharacteristic
![Page 60: •What’s New in Core Bluetooth - Development Videos - … ID Software Version Serial Number CBService CBCharacteristic CBCharacteristic CBCharacteristic Service Discovery Speed](https://reader034.vdocument.in/reader034/viewer/2022050719/5ac249b17f8b9a213f8e2175/html5/thumbnails/60.jpg)
L2CAP Channels
CBCentralManager
CBService
CBCharacteristic
CBCharacteristic
CBCharacteristic
CBL2CAPChannel CBL2CAPChannel
![Page 61: •What’s New in Core Bluetooth - Development Videos - … ID Software Version Serial Number CBService CBCharacteristic CBCharacteristic CBCharacteristic Service Discovery Speed](https://reader034.vdocument.in/reader034/viewer/2022050719/5ac249b17f8b9a213f8e2175/html5/thumbnails/61.jpg)
Open an L2CAP Channel on an existing CBPeripheral connection
Central Side L2CAP
open class CBPeripheral: CBPeer { open func openL2CAPChannel(_ PSM: CBL2CAPPSM) }
public protocol CBPeripheralDelegate: NSObjectProtocol { optional public func peripheral(_ peripheral: CBPeripheral,
didOpen channel: CBL2CAPChannel?, error: Error?) }
![Page 62: •What’s New in Core Bluetooth - Development Videos - … ID Software Version Serial Number CBService CBCharacteristic CBCharacteristic CBCharacteristic Service Discovery Speed](https://reader034.vdocument.in/reader034/viewer/2022050719/5ac249b17f8b9a213f8e2175/html5/thumbnails/62.jpg)
SIG Specified PSM for standardized profiles
Locally assigned PSM for dynamic services
PSM
/*! * @const CBUUIDL2CAppSMCharacteristicString * @discussion The PSM (a little endian uint16_t) of an L2CAP Channel associated with the GATT service * containing this characteristic. Servers can publish this characteristic with the UUID * ABDD3056-28FA-441D-A470-55A75A52553A */public let CBUUIDL2CAppSMCharacteristicString: String
![Page 63: •What’s New in Core Bluetooth - Development Videos - … ID Software Version Serial Number CBService CBCharacteristic CBCharacteristic CBCharacteristic Service Discovery Speed](https://reader034.vdocument.in/reader034/viewer/2022050719/5ac249b17f8b9a213f8e2175/html5/thumbnails/63.jpg)
Listen for incoming L2CAP Channels
Peripheral Side L2CAP
open class CBPeripheralManager : CBManager { open func publishL2CAPChannel(withEncryption encryptionRequired: Bool) open func unpublishL2CAPChannel(_ PSM: CBL2CAPPSM) }
public protocol CBPeripheralManagerDelegate : NSObjectProtocol { optional public func peripheralManager(_ peripheral: CBPeripheralManager, didPublishL2CAPChannel PSM: CBL2CAPPSM, error: Error?) }
![Page 64: •What’s New in Core Bluetooth - Development Videos - … ID Software Version Serial Number CBService CBCharacteristic CBCharacteristic CBCharacteristic Service Discovery Speed](https://reader034.vdocument.in/reader034/viewer/2022050719/5ac249b17f8b9a213f8e2175/html5/thumbnails/64.jpg)
Opening an L2CAP Channel
CBCentralManager
MyService
MyData
![Page 65: •What’s New in Core Bluetooth - Development Videos - … ID Software Version Serial Number CBService CBCharacteristic CBCharacteristic CBCharacteristic Service Discovery Speed](https://reader034.vdocument.in/reader034/viewer/2022050719/5ac249b17f8b9a213f8e2175/html5/thumbnails/65.jpg)
Opening an L2CAP Channel
CBCentralManager
MyService
MyData
peripheral.publishL2CAPChannel(withEncryption: true)
![Page 66: •What’s New in Core Bluetooth - Development Videos - … ID Software Version Serial Number CBService CBCharacteristic CBCharacteristic CBCharacteristic Service Discovery Speed](https://reader034.vdocument.in/reader034/viewer/2022050719/5ac249b17f8b9a213f8e2175/html5/thumbnails/66.jpg)
Opening an L2CAP Channel
CBCentralManager
MyService
MyData
optional public func peripheralManager(_ peripheral: CBPeripheralManager, didPublishL2CAPChannel PSM: CBL2CAPPSM, error: Error?)
![Page 67: •What’s New in Core Bluetooth - Development Videos - … ID Software Version Serial Number CBService CBCharacteristic CBCharacteristic CBCharacteristic Service Discovery Speed](https://reader034.vdocument.in/reader034/viewer/2022050719/5ac249b17f8b9a213f8e2175/html5/thumbnails/67.jpg)
Opening an L2CAP Channel
CBCentralManager
MyService
L2CAP PSM
MyData
optional public func peripheralManager(_ peripheral: CBPeripheralManager, didPublishL2CAPChannel PSM: CBL2CAPPSM, error: Error?)
L2CAP PSM
![Page 68: •What’s New in Core Bluetooth - Development Videos - … ID Software Version Serial Number CBService CBCharacteristic CBCharacteristic CBCharacteristic Service Discovery Speed](https://reader034.vdocument.in/reader034/viewer/2022050719/5ac249b17f8b9a213f8e2175/html5/thumbnails/68.jpg)
Opening an L2CAP Channel
CBCentralManager
MyService
L2CAP PSM
MyData
![Page 69: •What’s New in Core Bluetooth - Development Videos - … ID Software Version Serial Number CBService CBCharacteristic CBCharacteristic CBCharacteristic Service Discovery Speed](https://reader034.vdocument.in/reader034/viewer/2022050719/5ac249b17f8b9a213f8e2175/html5/thumbnails/69.jpg)
Opening an L2CAP Channel
CBCentralManager
MyService
L2CAP PSM
MyData
![Page 70: •What’s New in Core Bluetooth - Development Videos - … ID Software Version Serial Number CBService CBCharacteristic CBCharacteristic CBCharacteristic Service Discovery Speed](https://reader034.vdocument.in/reader034/viewer/2022050719/5ac249b17f8b9a213f8e2175/html5/thumbnails/70.jpg)
Opening an L2CAP Channel
CBCentralManager
MyService
L2CAP PSM
MyData
peripheral.openL2CAPChannel(PSM)
![Page 71: •What’s New in Core Bluetooth - Development Videos - … ID Software Version Serial Number CBService CBCharacteristic CBCharacteristic CBCharacteristic Service Discovery Speed](https://reader034.vdocument.in/reader034/viewer/2022050719/5ac249b17f8b9a213f8e2175/html5/thumbnails/71.jpg)
Opening an L2CAP Channel
CBCentralManager
MyService
L2CAP PSM
MyData
CBL2CAPChannel CBL2CAPChannel
optional public func peripheralManager(_ peripheral: CBPeripheralManager, didOpen channel: CBL2CAPChannel?, error: Error?)
![Page 72: •What’s New in Core Bluetooth - Development Videos - … ID Software Version Serial Number CBService CBCharacteristic CBCharacteristic CBCharacteristic Service Discovery Speed](https://reader034.vdocument.in/reader034/viewer/2022050719/5ac249b17f8b9a213f8e2175/html5/thumbnails/72.jpg)
@available(macOS 10.13, iOS 11.0, *) open class CBL2CAPChannel: NSObject {
open var peer: CBPeer! { get }
open var inputStream: InputStream! { get }
open var outputStream: OutputStream! { get }
open var psm: CBL2CAPPSM { get }
}
![Page 73: •What’s New in Core Bluetooth - Development Videos - … ID Software Version Serial Number CBService CBCharacteristic CBCharacteristic CBCharacteristic Service Discovery Speed](https://reader034.vdocument.in/reader034/viewer/2022050719/5ac249b17f8b9a213f8e2175/html5/thumbnails/73.jpg)
Stream events are delivered through NSStream
Stream Events
public protocol StreamDelegate: NSObjectProtocol { optional public func stream(_ aStream: Stream, handle eventCode: Stream.Event) }
public struct Stream.Event: OptionSet { public static var openCompleted: Stream.Event { get } public static var hasBytesAvailable: Stream.Event { get } public static var hasSpaceAvailable: Stream.Event { get } public static var errorOccurred: Stream.Event { get } public static var endEncountered: Stream.Event { get } }
![Page 74: •What’s New in Core Bluetooth - Development Videos - … ID Software Version Serial Number CBService CBCharacteristic CBCharacteristic CBCharacteristic Service Discovery Speed](https://reader034.vdocument.in/reader034/viewer/2022050719/5ac249b17f8b9a213f8e2175/html5/thumbnails/74.jpg)
Closing Channels
Channels may be closed due to • Link loss • Central close • Peripheral unpublished • Peripheral object is released
![Page 75: •What’s New in Core Bluetooth - Development Videos - … ID Software Version Serial Number CBService CBCharacteristic CBCharacteristic CBCharacteristic Service Discovery Speed](https://reader034.vdocument.in/reader034/viewer/2022050719/5ac249b17f8b9a213f8e2175/html5/thumbnails/75.jpg)
When Should L2CAP Be Used?
Use GATT where it makes sense
Lowest overhead
Best performance
Best for large data transfers
Great for stream protocols
![Page 76: •What’s New in Core Bluetooth - Development Videos - … ID Software Version Serial Number CBService CBCharacteristic CBCharacteristic CBCharacteristic Service Discovery Speed](https://reader034.vdocument.in/reader034/viewer/2022050719/5ac249b17f8b9a213f8e2175/html5/thumbnails/76.jpg)
•Best Practices
![Page 77: •What’s New in Core Bluetooth - Development Videos - … ID Software Version Serial Number CBService CBCharacteristic CBCharacteristic CBCharacteristic Service Discovery Speed](https://reader034.vdocument.in/reader034/viewer/2022050719/5ac249b17f8b9a213f8e2175/html5/thumbnails/77.jpg)
Follow the Bluetooth AccessoryDesign Guidelines for Apple Products
![Page 78: •What’s New in Core Bluetooth - Development Videos - … ID Software Version Serial Number CBService CBCharacteristic CBCharacteristic CBCharacteristic Service Discovery Speed](https://reader034.vdocument.in/reader034/viewer/2022050719/5ac249b17f8b9a213f8e2175/html5/thumbnails/78.jpg)
Use Existing Profiles and Services
![Page 79: •What’s New in Core Bluetooth - Development Videos - … ID Software Version Serial Number CBService CBCharacteristic CBCharacteristic CBCharacteristic Service Discovery Speed](https://reader034.vdocument.in/reader034/viewer/2022050719/5ac249b17f8b9a213f8e2175/html5/thumbnails/79.jpg)
Why does it take so long to connect?
![Page 80: •What’s New in Core Bluetooth - Development Videos - … ID Software Version Serial Number CBService CBCharacteristic CBCharacteristic CBCharacteristic Service Discovery Speed](https://reader034.vdocument.in/reader034/viewer/2022050719/5ac249b17f8b9a213f8e2175/html5/thumbnails/80.jpg)
Time to Discover
Peripheral
Central
Advertisement
Advertising
Scanning
![Page 81: •What’s New in Core Bluetooth - Development Videos - … ID Software Version Serial Number CBService CBCharacteristic CBCharacteristic CBCharacteristic Service Discovery Speed](https://reader034.vdocument.in/reader034/viewer/2022050719/5ac249b17f8b9a213f8e2175/html5/thumbnails/81.jpg)
Time to Discover
Peripheral
Central
Advertisement Advertisement Advertisement Advertisement
Advertising
Scanning
ScanScan
![Page 82: •What’s New in Core Bluetooth - Development Videos - … ID Software Version Serial Number CBService CBCharacteristic CBCharacteristic CBCharacteristic Service Discovery Speed](https://reader034.vdocument.in/reader034/viewer/2022050719/5ac249b17f8b9a213f8e2175/html5/thumbnails/82.jpg)
Connection Speed
Use the shortest advertising interval possible
Optimize for when users are trying to use your accessory
See the Bluetooth Accessory Design Guidelines for power-efficient advertising intervals
![Page 83: •What’s New in Core Bluetooth - Development Videos - … ID Software Version Serial Number CBService CBCharacteristic CBCharacteristic CBCharacteristic Service Discovery Speed](https://reader034.vdocument.in/reader034/viewer/2022050719/5ac249b17f8b9a213f8e2175/html5/thumbnails/83.jpg)
No need to scan for a peripheral for reconnect
Retrieve the peripheral and directly connect
Reconnecting devices
let identifier = UUID()
let peripherals = central.retrievePeripherals(withIdentifiers: [ identifier ])
central.connect(peripherals[0])
![Page 84: •What’s New in Core Bluetooth - Development Videos - … ID Software Version Serial Number CBService CBCharacteristic CBCharacteristic CBCharacteristic Service Discovery Speed](https://reader034.vdocument.in/reader034/viewer/2022050719/5ac249b17f8b9a213f8e2175/html5/thumbnails/84.jpg)
Service Discovery Speed
Battery (16 bit)
Battery Level
MyService (128 bit)
MoreData
OtherData
MyData
Device Information (16 bit)
PnP ID
Software Version
Serial Number
CBService
CBCharacteristic
CBCharacteristic
CBCharacteristic
![Page 85: •What’s New in Core Bluetooth - Development Videos - … ID Software Version Serial Number CBService CBCharacteristic CBCharacteristic CBCharacteristic Service Discovery Speed](https://reader034.vdocument.in/reader034/viewer/2022050719/5ac249b17f8b9a213f8e2175/html5/thumbnails/85.jpg)
Service Discovery Speed
Use as few services/characteristics as possible
Battery (16 bit)
Battery Level
MyService (128 bit)
MoreData
OtherData
MyData
Device Information (16 bit)
PnP ID
Software Version
Serial Number
CBService
CBCharacteristic
CBCharacteristic
CBCharacteristic
![Page 86: •What’s New in Core Bluetooth - Development Videos - … ID Software Version Serial Number CBService CBCharacteristic CBCharacteristic CBCharacteristic Service Discovery Speed](https://reader034.vdocument.in/reader034/viewer/2022050719/5ac249b17f8b9a213f8e2175/html5/thumbnails/86.jpg)
Service Discovery Speed
Use as few services/characteristics as possible
Battery (16 bit)
Battery Level
MyService (128 bit)
MoreData
OtherData
MyData
Device Information (16 bit)
PnP ID
Software Version
Serial Number
![Page 87: •What’s New in Core Bluetooth - Development Videos - … ID Software Version Serial Number CBService CBCharacteristic CBCharacteristic CBCharacteristic Service Discovery Speed](https://reader034.vdocument.in/reader034/viewer/2022050719/5ac249b17f8b9a213f8e2175/html5/thumbnails/87.jpg)
Service Discovery Speed
Use as few services/characteristics as possible
Group services by UUID size
Battery (16 bit)
Battery Level
MyService (128 bit)
MoreData
OtherData
MyData
Device Information (16 bit)
PnP ID
Software Version
Serial Number
![Page 88: •What’s New in Core Bluetooth - Development Videos - … ID Software Version Serial Number CBService CBCharacteristic CBCharacteristic CBCharacteristic Service Discovery Speed](https://reader034.vdocument.in/reader034/viewer/2022050719/5ac249b17f8b9a213f8e2175/html5/thumbnails/88.jpg)
Service Discovery Speed
Use as few services/characteristics as possible
Group services by UUID size
Support GATT Caching
Battery (16 bit)
Battery Level
MyService (128 bit)
MoreData
OtherData
MyData
Device Information (16 bit)
PnP ID
Software Version
Serial Number
![Page 89: •What’s New in Core Bluetooth - Development Videos - … ID Software Version Serial Number CBService CBCharacteristic CBCharacteristic CBCharacteristic Service Discovery Speed](https://reader034.vdocument.in/reader034/viewer/2022050719/5ac249b17f8b9a213f8e2175/html5/thumbnails/89.jpg)
Service Discovery Speed
Use as few services/characteristics as possible
Group services by UUID size
Support GATT Caching
Use “Service Changed”
Battery (16 bit)
Battery Level
MyService (128 bit)
MoreData
OtherData
MyData
Device Information (16 bit)
PnP ID
Software Version
Serial Number
![Page 90: •What’s New in Core Bluetooth - Development Videos - … ID Software Version Serial Number CBService CBCharacteristic CBCharacteristic CBCharacteristic Service Discovery Speed](https://reader034.vdocument.in/reader034/viewer/2022050719/5ac249b17f8b9a213f8e2175/html5/thumbnails/90.jpg)
New Accessory Recommendations
Use the newest chipset / Bluetooth standard available
4.2 and 5.0 are backward compatible
Follow these best practices
![Page 91: •What’s New in Core Bluetooth - Development Videos - … ID Software Version Serial Number CBService CBCharacteristic CBCharacteristic CBCharacteristic Service Discovery Speed](https://reader034.vdocument.in/reader034/viewer/2022050719/5ac249b17f8b9a213f8e2175/html5/thumbnails/91.jpg)
Duy Phan, Bluetooth Engineer
•Getting the Most out of Core Bluetooth
![Page 92: •What’s New in Core Bluetooth - Development Videos - … ID Software Version Serial Number CBService CBCharacteristic CBCharacteristic CBCharacteristic Service Discovery Speed](https://reader034.vdocument.in/reader034/viewer/2022050719/5ac249b17f8b9a213f8e2175/html5/thumbnails/92.jpg)
1MB = 3,240 seconds 2.5 kbps
![Page 93: •What’s New in Core Bluetooth - Development Videos - … ID Software Version Serial Number CBService CBCharacteristic CBCharacteristic CBCharacteristic Service Discovery Speed](https://reader034.vdocument.in/reader034/viewer/2022050719/5ac249b17f8b9a213f8e2175/html5/thumbnails/93.jpg)
Protocol Overhead
Controller
L2CAP
ATT
Application
GATT
Controller
L2CAP
ATT
Application
GATT
L2CAP 4 Bytes
Attribute Data20 Bytes
ATT 3 Bytes
Packet
![Page 94: •What’s New in Core Bluetooth - Development Videos - … ID Software Version Serial Number CBService CBCharacteristic CBCharacteristic CBCharacteristic Service Discovery Speed](https://reader034.vdocument.in/reader034/viewer/2022050719/5ac249b17f8b9a213f8e2175/html5/thumbnails/94.jpg)
Protocol Overhead
Controller
L2CAP
ATT
Application
GATT
Controller
L2CAP
ATT
Application
GATT
L2CAP 4 Bytes
Attribute Data20 Bytes
ATT 3 Bytes
Packet
![Page 95: •What’s New in Core Bluetooth - Development Videos - … ID Software Version Serial Number CBService CBCharacteristic CBCharacteristic CBCharacteristic Service Discovery Speed](https://reader034.vdocument.in/reader034/viewer/2022050719/5ac249b17f8b9a213f8e2175/html5/thumbnails/95.jpg)
Write With Response
Peripheral
Central
Inte
rval
Inte
rval
Inte
rval
![Page 96: •What’s New in Core Bluetooth - Development Videos - … ID Software Version Serial Number CBService CBCharacteristic CBCharacteristic CBCharacteristic Service Discovery Speed](https://reader034.vdocument.in/reader034/viewer/2022050719/5ac249b17f8b9a213f8e2175/html5/thumbnails/96.jpg)
Write With Response
Peripheral
Central
Write
Response
Inte
rval
Inte
rval
Inte
rval
![Page 97: •What’s New in Core Bluetooth - Development Videos - … ID Software Version Serial Number CBService CBCharacteristic CBCharacteristic CBCharacteristic Service Discovery Speed](https://reader034.vdocument.in/reader034/viewer/2022050719/5ac249b17f8b9a213f8e2175/html5/thumbnails/97.jpg)
Write With Response
Peripheral
Central
Inte
rval
Inte
rval
Inte
rval
![Page 98: •What’s New in Core Bluetooth - Development Videos - … ID Software Version Serial Number CBService CBCharacteristic CBCharacteristic CBCharacteristic Service Discovery Speed](https://reader034.vdocument.in/reader034/viewer/2022050719/5ac249b17f8b9a213f8e2175/html5/thumbnails/98.jpg)
Write Without Response
Reliable with Core Bluetooth flow control
Use all available connection events to transmit
Takes advantage of larger Connection Event Length
![Page 99: •What’s New in Core Bluetooth - Development Videos - … ID Software Version Serial Number CBService CBCharacteristic CBCharacteristic CBCharacteristic Service Discovery Speed](https://reader034.vdocument.in/reader034/viewer/2022050719/5ac249b17f8b9a213f8e2175/html5/thumbnails/99.jpg)
Write Without ResponseIn
terv
al
Inte
rval
Inte
rval
![Page 100: •What’s New in Core Bluetooth - Development Videos - … ID Software Version Serial Number CBService CBCharacteristic CBCharacteristic CBCharacteristic Service Discovery Speed](https://reader034.vdocument.in/reader034/viewer/2022050719/5ac249b17f8b9a213f8e2175/html5/thumbnails/100.jpg)
Write Without Response
Default MTU
37kbps
Inte
rval
Inte
rval
Inte
rval
![Page 101: •What’s New in Core Bluetooth - Development Videos - … ID Software Version Serial Number CBService CBCharacteristic CBCharacteristic CBCharacteristic Service Discovery Speed](https://reader034.vdocument.in/reader034/viewer/2022050719/5ac249b17f8b9a213f8e2175/html5/thumbnails/101.jpg)
Write Without Response
Default MTU
37kbps
Inte
rval
Inte
rval
Inte
rval
![Page 102: •What’s New in Core Bluetooth - Development Videos - … ID Software Version Serial Number CBService CBCharacteristic CBCharacteristic CBCharacteristic Service Discovery Speed](https://reader034.vdocument.in/reader034/viewer/2022050719/5ac249b17f8b9a213f8e2175/html5/thumbnails/102.jpg)
Write Without Response
Default MTU
Larger MTU
37kbps
Inte
rval
Inte
rval
Inte
rval
48kbps
![Page 103: •What’s New in Core Bluetooth - Development Videos - … ID Software Version Serial Number CBService CBCharacteristic CBCharacteristic CBCharacteristic Service Discovery Speed](https://reader034.vdocument.in/reader034/viewer/2022050719/5ac249b17f8b9a213f8e2175/html5/thumbnails/103.jpg)
Apple devices determine the optimal MTU
Accessories should support a large MTU
Use large attributes aligned to MTU
Fitting your data
open class CBPeripheral: CBPeer { open func maximumWriteValueLength(for type: CBCharacteristicWriteType) -> Int }
open class CBCentral: CBPeer { open var maximumUpdateValueLength: Int { get } }
![Page 104: •What’s New in Core Bluetooth - Development Videos - … ID Software Version Serial Number CBService CBCharacteristic CBCharacteristic CBCharacteristic Service Discovery Speed](https://reader034.vdocument.in/reader034/viewer/2022050719/5ac249b17f8b9a213f8e2175/html5/thumbnails/104.jpg)
Write Without Response
Default MTU
Larger MTU
Inte
rval
Inte
rval
Inte
rval
37kbps
48kbps
![Page 105: •What’s New in Core Bluetooth - Development Videos - … ID Software Version Serial Number CBService CBCharacteristic CBCharacteristic CBCharacteristic Service Discovery Speed](https://reader034.vdocument.in/reader034/viewer/2022050719/5ac249b17f8b9a213f8e2175/html5/thumbnails/105.jpg)
Write Without Response
EDL
Default MTU
Larger MTU
Inte
rval
Inte
rval
Inte
rval
37kbps
48kbps
![Page 106: •What’s New in Core Bluetooth - Development Videos - … ID Software Version Serial Number CBService CBCharacteristic CBCharacteristic CBCharacteristic Service Discovery Speed](https://reader034.vdocument.in/reader034/viewer/2022050719/5ac249b17f8b9a213f8e2175/html5/thumbnails/106.jpg)
Write Without Response
EDL
Default MTU
Larger MTU
10x 10x 10x
Inte
rval
Inte
rval
Inte
rval
37kbps
48kbps
135kbps
![Page 107: •What’s New in Core Bluetooth - Development Videos - … ID Software Version Serial Number CBService CBCharacteristic CBCharacteristic CBCharacteristic Service Discovery Speed](https://reader034.vdocument.in/reader034/viewer/2022050719/5ac249b17f8b9a213f8e2175/html5/thumbnails/107.jpg)
Extended Data Length
New Feature in Bluetooth 4.2
Much larger packets (251 vs 27 bytes)
Transparent to the application
4x throughput with the same radio time
Available on iPhone 7 and Apple Watch Series 2
![Page 108: •What’s New in Core Bluetooth - Development Videos - … ID Software Version Serial Number CBService CBCharacteristic CBCharacteristic CBCharacteristic Service Discovery Speed](https://reader034.vdocument.in/reader034/viewer/2022050719/5ac249b17f8b9a213f8e2175/html5/thumbnails/108.jpg)
L2CAP Connection Oriented Channels
ATT
Application
GATT
Controller
L2CAP
Controller
L2CAP
ATT
Application
GATT
L2CAP 4 Bytes
Attribute Data247 Bytes
Packet
![Page 109: •What’s New in Core Bluetooth - Development Videos - … ID Software Version Serial Number CBService CBCharacteristic CBCharacteristic CBCharacteristic Service Discovery Speed](https://reader034.vdocument.in/reader034/viewer/2022050719/5ac249b17f8b9a213f8e2175/html5/thumbnails/109.jpg)
L2CAP Connection Oriented Channels
Application
Controller
L2CAP
Controller
L2CAP
Application
L2CAP 4 Bytes
Attribute Data247 Bytes
Packet
197 kbps
![Page 110: •What’s New in Core Bluetooth - Development Videos - … ID Software Version Serial Number CBService CBCharacteristic CBCharacteristic CBCharacteristic Service Discovery Speed](https://reader034.vdocument.in/reader034/viewer/2022050719/5ac249b17f8b9a213f8e2175/html5/thumbnails/110.jpg)
Faster Connection Interval
L2CAP + EDL
Inte
rval
Inte
rval
Inte
rval
![Page 111: •What’s New in Core Bluetooth - Development Videos - … ID Software Version Serial Number CBService CBCharacteristic CBCharacteristic CBCharacteristic Service Discovery Speed](https://reader034.vdocument.in/reader034/viewer/2022050719/5ac249b17f8b9a213f8e2175/html5/thumbnails/111.jpg)
Faster Connection Interval
L2CAP + EDL
Inte
rval
Inte
rval
Inte
rval
394 kbps
Inte
rval
Inte
rval
![Page 112: •What’s New in Core Bluetooth - Development Videos - … ID Software Version Serial Number CBService CBCharacteristic CBCharacteristic CBCharacteristic Service Discovery Speed](https://reader034.vdocument.in/reader034/viewer/2022050719/5ac249b17f8b9a213f8e2175/html5/thumbnails/112.jpg)
Throughput (kbps)
Write With Response
Write Without Response
Packed CE Length
Larger MTU
EDL
L2CAP + EDL
L2CAP + EDL + 15ms Int
0 40 80 120 160 200 240 280 320 360 400
![Page 113: •What’s New in Core Bluetooth - Development Videos - … ID Software Version Serial Number CBService CBCharacteristic CBCharacteristic CBCharacteristic Service Discovery Speed](https://reader034.vdocument.in/reader034/viewer/2022050719/5ac249b17f8b9a213f8e2175/html5/thumbnails/113.jpg)
Throughput (kbps)
Write With Response
Write Without Response
Packed CE Length
Larger MTU
EDL
L2CAP + EDL
L2CAP + EDL + 15ms Int
0 40 80 120 160 200 240 280 320 360 400
2.5
![Page 114: •What’s New in Core Bluetooth - Development Videos - … ID Software Version Serial Number CBService CBCharacteristic CBCharacteristic CBCharacteristic Service Discovery Speed](https://reader034.vdocument.in/reader034/viewer/2022050719/5ac249b17f8b9a213f8e2175/html5/thumbnails/114.jpg)
Throughput (kbps)
Write With Response
Write Without Response
Packed CE Length
Larger MTU
EDL
L2CAP + EDL
L2CAP + EDL + 15ms Int
0 40 80 120 160 200 240 280 320 360 400
2.5
5.2
![Page 115: •What’s New in Core Bluetooth - Development Videos - … ID Software Version Serial Number CBService CBCharacteristic CBCharacteristic CBCharacteristic Service Discovery Speed](https://reader034.vdocument.in/reader034/viewer/2022050719/5ac249b17f8b9a213f8e2175/html5/thumbnails/115.jpg)
Throughput (kbps)
Write With Response
Write Without Response
Packed CE Length
Larger MTU
EDL
L2CAP + EDL
L2CAP + EDL + 15ms Int
0 40 80 120 160 200 240 280 320 360 400
2.5
5.2
37
![Page 116: •What’s New in Core Bluetooth - Development Videos - … ID Software Version Serial Number CBService CBCharacteristic CBCharacteristic CBCharacteristic Service Discovery Speed](https://reader034.vdocument.in/reader034/viewer/2022050719/5ac249b17f8b9a213f8e2175/html5/thumbnails/116.jpg)
Throughput (kbps)
Write With Response
Write Without Response
Packed CE Length
Larger MTU
EDL
L2CAP + EDL
L2CAP + EDL + 15ms Int
0 40 80 120 160 200 240 280 320 360 400
2.5
5.2
37
48
![Page 117: •What’s New in Core Bluetooth - Development Videos - … ID Software Version Serial Number CBService CBCharacteristic CBCharacteristic CBCharacteristic Service Discovery Speed](https://reader034.vdocument.in/reader034/viewer/2022050719/5ac249b17f8b9a213f8e2175/html5/thumbnails/117.jpg)
Throughput (kbps)
Write With Response
Write Without Response
Packed CE Length
Larger MTU
EDL
L2CAP + EDL
L2CAP + EDL + 15ms Int
0 40 80 120 160 200 240 280 320 360 400
2.5
5.2
37
48
135
![Page 118: •What’s New in Core Bluetooth - Development Videos - … ID Software Version Serial Number CBService CBCharacteristic CBCharacteristic CBCharacteristic Service Discovery Speed](https://reader034.vdocument.in/reader034/viewer/2022050719/5ac249b17f8b9a213f8e2175/html5/thumbnails/118.jpg)
Throughput (kbps)
Write With Response
Write Without Response
Packed CE Length
Larger MTU
EDL
L2CAP + EDL
L2CAP + EDL + 15ms Int
0 40 80 120 160 200 240 280 320 360 400
2.5
5.2
37
48
135
197
![Page 119: •What’s New in Core Bluetooth - Development Videos - … ID Software Version Serial Number CBService CBCharacteristic CBCharacteristic CBCharacteristic Service Discovery Speed](https://reader034.vdocument.in/reader034/viewer/2022050719/5ac249b17f8b9a213f8e2175/html5/thumbnails/119.jpg)
Throughput (kbps)
Write With Response
Write Without Response
Packed CE Length
Larger MTU
EDL
L2CAP + EDL
L2CAP + EDL + 15ms Int
0 40 80 120 160 200 240 280 320 360 400
2.5
5.2
37
48
135
197
394
![Page 120: •What’s New in Core Bluetooth - Development Videos - … ID Software Version Serial Number CBService CBCharacteristic CBCharacteristic CBCharacteristic Service Discovery Speed](https://reader034.vdocument.in/reader034/viewer/2022050719/5ac249b17f8b9a213f8e2175/html5/thumbnails/120.jpg)
Summary
Request a shorter Connection Interval
Take advantage of GATT optimizations
Use L2CAP Channel for large transfers and stream protocols
Update your hardware (4.2 EDL, 5.0) for best performance and battery life
![Page 121: •What’s New in Core Bluetooth - Development Videos - … ID Software Version Serial Number CBService CBCharacteristic CBCharacteristic CBCharacteristic Service Discovery Speed](https://reader034.vdocument.in/reader034/viewer/2022050719/5ac249b17f8b9a213f8e2175/html5/thumbnails/121.jpg)
Craig Dooley, Bluetooth Engineer
•Wrap Up
![Page 122: •What’s New in Core Bluetooth - Development Videos - … ID Software Version Serial Number CBService CBCharacteristic CBCharacteristic CBCharacteristic Service Discovery Speed](https://reader034.vdocument.in/reader034/viewer/2022050719/5ac249b17f8b9a213f8e2175/html5/thumbnails/122.jpg)
Key Takeaways
Check out State Restoration
Expand your app to tvOS and watchOS
Use L2CAP for stream protocols or large data transfers
Use the newest Bluetooth chipset available
Follow the Bluetooth Accessory Design Guidelines
![Page 123: •What’s New in Core Bluetooth - Development Videos - … ID Software Version Serial Number CBService CBCharacteristic CBCharacteristic CBCharacteristic Service Discovery Speed](https://reader034.vdocument.in/reader034/viewer/2022050719/5ac249b17f8b9a213f8e2175/html5/thumbnails/123.jpg)
More Informationhttps://developer.apple.com/wwdc17/712
![Page 124: •What’s New in Core Bluetooth - Development Videos - … ID Software Version Serial Number CBService CBCharacteristic CBCharacteristic CBCharacteristic Service Discovery Speed](https://reader034.vdocument.in/reader034/viewer/2022050719/5ac249b17f8b9a213f8e2175/html5/thumbnails/124.jpg)
Related Sessions
Core Bluetooth 101 WWDC 2012
Core Bluetooth WWDC 2013
![Page 125: •What’s New in Core Bluetooth - Development Videos - … ID Software Version Serial Number CBService CBCharacteristic CBCharacteristic CBCharacteristic Service Discovery Speed](https://reader034.vdocument.in/reader034/viewer/2022050719/5ac249b17f8b9a213f8e2175/html5/thumbnails/125.jpg)
Labs
Bluetooth Lab Technology Lab J Thur 12:00PM–2:00PM
Bluetooth Lab Technology Lab J Fri 12:00PM–2:00PM
![Page 126: •What’s New in Core Bluetooth - Development Videos - … ID Software Version Serial Number CBService CBCharacteristic CBCharacteristic CBCharacteristic Service Discovery Speed](https://reader034.vdocument.in/reader034/viewer/2022050719/5ac249b17f8b9a213f8e2175/html5/thumbnails/126.jpg)