core bluetooth - mementionmemention.com/chcorebluetooth.pdf · core bluetooth cocoaheads sthlm 2014...
TRANSCRIPT
![Page 1: Core Bluetooth - Mementionmemention.com/CHCoreBluetooth.pdf · Core Bluetooth CocoaHeads Sthlm 2014 ... The Core Bluetooth framework provides the classes needed for your iOS and Mac](https://reader034.vdocument.in/reader034/viewer/2022052518/5f0537527e708231d411db31/html5/thumbnails/1.jpg)
Core BluetoothCocoaHeads Sthlm 2014
Edward Patel
teaser
![Page 2: Core Bluetooth - Mementionmemention.com/CHCoreBluetooth.pdf · Core Bluetooth CocoaHeads Sthlm 2014 ... The Core Bluetooth framework provides the classes needed for your iOS and Mac](https://reader034.vdocument.in/reader034/viewer/2022052518/5f0537527e708231d411db31/html5/thumbnails/2.jpg)
Me
• I work at
• Love programming
• Love gadgets
• Love programming gadgets
![Page 3: Core Bluetooth - Mementionmemention.com/CHCoreBluetooth.pdf · Core Bluetooth CocoaHeads Sthlm 2014 ... The Core Bluetooth framework provides the classes needed for your iOS and Mac](https://reader034.vdocument.in/reader034/viewer/2022052518/5f0537527e708231d411db31/html5/thumbnails/3.jpg)
Bluetooth Low Energy
![Page 4: Core Bluetooth - Mementionmemention.com/CHCoreBluetooth.pdf · Core Bluetooth CocoaHeads Sthlm 2014 ... The Core Bluetooth framework provides the classes needed for your iOS and Mac](https://reader034.vdocument.in/reader034/viewer/2022052518/5f0537527e708231d411db31/html5/thumbnails/4.jpg)
WWDC’13 Keynote• Anki DRIVE
![Page 5: Core Bluetooth - Mementionmemention.com/CHCoreBluetooth.pdf · Core Bluetooth CocoaHeads Sthlm 2014 ... The Core Bluetooth framework provides the classes needed for your iOS and Mac](https://reader034.vdocument.in/reader034/viewer/2022052518/5f0537527e708231d411db31/html5/thumbnails/5.jpg)
![Page 6: Core Bluetooth - Mementionmemention.com/CHCoreBluetooth.pdf · Core Bluetooth CocoaHeads Sthlm 2014 ... The Core Bluetooth framework provides the classes needed for your iOS and Mac](https://reader034.vdocument.in/reader034/viewer/2022052518/5f0537527e708231d411db31/html5/thumbnails/6.jpg)
Bluetooth Low Energy
• Invented by researchers at Nokia
• For small things
• Run a long time on a coin-cell battery
• Look for “Internet-of-Things”
![Page 7: Core Bluetooth - Mementionmemention.com/CHCoreBluetooth.pdf · Core Bluetooth CocoaHeads Sthlm 2014 ... The Core Bluetooth framework provides the classes needed for your iOS and Mac](https://reader034.vdocument.in/reader034/viewer/2022052518/5f0537527e708231d411db31/html5/thumbnails/7.jpg)
iOS
• Introduced in iOS 5
• Extended in iOS 6 (can become a “Peripheral”)
• Cleaning API in iOS 7 + better caching andhandling including backgrounding.
![Page 8: Core Bluetooth - Mementionmemention.com/CHCoreBluetooth.pdf · Core Bluetooth CocoaHeads Sthlm 2014 ... The Core Bluetooth framework provides the classes needed for your iOS and Mac](https://reader034.vdocument.in/reader034/viewer/2022052518/5f0537527e708231d411db31/html5/thumbnails/8.jpg)
Framework
Core Bluetooth Framework ReferenceThe Core Bluetooth framework provides the classes needed for your iOS and Mac apps to communicate with devices that are equipped with Bluetooth low energy wireless technology.
Protocol ReferencesCBCentralManagerDelegateCBPeripheralDelegateCBPeripheralManagerDelegate
Class ReferencesCBATTRequestCBCentralCBCentralManagerCBCharacteristicCBDescriptorCBMutableCharacteristicCBMutableDescriptorCBMutableServiceCBPeripheralCBPeripheralManagerCBServiceCBUUID
Other ReferencesCore Bluetooth Constants
![Page 9: Core Bluetooth - Mementionmemention.com/CHCoreBluetooth.pdf · Core Bluetooth CocoaHeads Sthlm 2014 ... The Core Bluetooth framework provides the classes needed for your iOS and Mac](https://reader034.vdocument.in/reader034/viewer/2022052518/5f0537527e708231d411db31/html5/thumbnails/9.jpg)
There are only two hard things in Computer Science:
cache invalidation naming things
off-by-one errors
![Page 10: Core Bluetooth - Mementionmemention.com/CHCoreBluetooth.pdf · Core Bluetooth CocoaHeads Sthlm 2014 ... The Core Bluetooth framework provides the classes needed for your iOS and Mac](https://reader034.vdocument.in/reader034/viewer/2022052518/5f0537527e708231d411db31/html5/thumbnails/10.jpg)
PeripheralCentral
has datawants data
(server)(client)
Naming things...
advertise
![Page 11: Core Bluetooth - Mementionmemention.com/CHCoreBluetooth.pdf · Core Bluetooth CocoaHeads Sthlm 2014 ... The Core Bluetooth framework provides the classes needed for your iOS and Mac](https://reader034.vdocument.in/reader034/viewer/2022052518/5f0537527e708231d411db31/html5/thumbnails/11.jpg)
Service
Characteristic
Characteristic
Service
Characteristic
Characteristic
Peripheral
![Page 12: Core Bluetooth - Mementionmemention.com/CHCoreBluetooth.pdf · Core Bluetooth CocoaHeads Sthlm 2014 ... The Core Bluetooth framework provides the classes needed for your iOS and Mac](https://reader034.vdocument.in/reader034/viewer/2022052518/5f0537527e708231d411db31/html5/thumbnails/12.jpg)
Characteristic
• Can be read, and writable
• Can be integers, strings etc
• Can be “Notifiable”
![Page 13: Core Bluetooth - Mementionmemention.com/CHCoreBluetooth.pdf · Core Bluetooth CocoaHeads Sthlm 2014 ... The Core Bluetooth framework provides the classes needed for your iOS and Mac](https://reader034.vdocument.in/reader034/viewer/2022052518/5f0537527e708231d411db31/html5/thumbnails/13.jpg)
GATT
• A kind of contract known in advance
• Defines a number of UUID’s for Services and Characteristics and value types.
• There are standardized ones,i.e Heart rate monitors
• You can define your own
Service
Characteristic
Characteristic
Service
Characteristic
Characteristic
Generic Attribute Profile
![Page 14: Core Bluetooth - Mementionmemention.com/CHCoreBluetooth.pdf · Core Bluetooth CocoaHeads Sthlm 2014 ... The Core Bluetooth framework provides the classes needed for your iOS and Mac](https://reader034.vdocument.in/reader034/viewer/2022052518/5f0537527e708231d411db31/html5/thumbnails/14.jpg)
https://developer.bluetooth.org/gatt/
Find the standardized?
![Page 15: Core Bluetooth - Mementionmemention.com/CHCoreBluetooth.pdf · Core Bluetooth CocoaHeads Sthlm 2014 ... The Core Bluetooth framework provides the classes needed for your iOS and Mac](https://reader034.vdocument.in/reader034/viewer/2022052518/5f0537527e708231d411db31/html5/thumbnails/15.jpg)
UUID’s
• Standardized by Bluetooth SIG are short, 16 bit
• Free are long, 128 bits
“0CDA25F083E54CBCB7C97FB2AC3DC476”
“180D”
Heart rate monitor service
Your own message service
![Page 16: Core Bluetooth - Mementionmemention.com/CHCoreBluetooth.pdf · Core Bluetooth CocoaHeads Sthlm 2014 ... The Core Bluetooth framework provides the classes needed for your iOS and Mac](https://reader034.vdocument.in/reader034/viewer/2022052518/5f0537527e708231d411db31/html5/thumbnails/16.jpg)
Discover Peripherals with Services
Connect to Peripheral
Discover Services for Peripheral
Discover Characteristics for Service
Workflow of a Central in iOS
Create a CBCentralManager
![Page 17: Core Bluetooth - Mementionmemention.com/CHCoreBluetooth.pdf · Core Bluetooth CocoaHeads Sthlm 2014 ... The Core Bluetooth framework provides the classes needed for your iOS and Mac](https://reader034.vdocument.in/reader034/viewer/2022052518/5f0537527e708231d411db31/html5/thumbnails/17.jpg)
Where to start?
• LightBlue - Bluetooth Low Energy
• TI BLE Multitool
Download some apps from App Store
Do it now!
![Page 18: Core Bluetooth - Mementionmemention.com/CHCoreBluetooth.pdf · Core Bluetooth CocoaHeads Sthlm 2014 ... The Core Bluetooth framework provides the classes needed for your iOS and Mac](https://reader034.vdocument.in/reader034/viewer/2022052518/5f0537527e708231d411db31/html5/thumbnails/18.jpg)
Get some hardware?
• SensorTag (6 sensors)
• Arduino Shields, i.e. Tinyduino or BLE Shield
• BLE Mini by RedBearLabs
• BLE-112 Evaluation board
• Gimbal iBeacon
• Or just use two iPhones
![Page 19: Core Bluetooth - Mementionmemention.com/CHCoreBluetooth.pdf · Core Bluetooth CocoaHeads Sthlm 2014 ... The Core Bluetooth framework provides the classes needed for your iOS and Mac](https://reader034.vdocument.in/reader034/viewer/2022052518/5f0537527e708231d411db31/html5/thumbnails/19.jpg)
Get some sample code?
• HiBeacons by Nick Toumpelis (a Spotifier)
• Temperature Sensor by Apple
• Also, checkout WWDC videos
![Page 20: Core Bluetooth - Mementionmemention.com/CHCoreBluetooth.pdf · Core Bluetooth CocoaHeads Sthlm 2014 ... The Core Bluetooth framework provides the classes needed for your iOS and Mac](https://reader034.vdocument.in/reader034/viewer/2022052518/5f0537527e708231d411db31/html5/thumbnails/20.jpg)
Thanks!