Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Watch your Bluetooth!

Watch your Bluetooth!

Swift Poznań #1 - 27.06.2017

This talk is definitely not about hacking Bluetooth. Core Bluetooth has arrived to Apple Watch. Just watch what your Watch ⌚️ can do!

Maciej Piotrowski

June 27, 2017
Tweet

More Decks by Maciej Piotrowski

Other Decks in Technology

Transcript

  1. Bluetooth Low Energy (BLE) 4 low energy consumption 4 client

    - server architecture 4 services and characteristics
  2. Bird Service 4 CBService - Bird 4 CBCharacteristic - name

    4 CBCharacteristic - color 4 CBCharacteristic - alpha
  3. Bird Service 4 CBService - Bird 4 UTF-8 String 4

    hex as UTF-8 String 4 Int as UTF-8 String
  4. Storing UUIDs enum BirdBluetoothService { static let uuid: CBUUID =

    CBUUID(string: "B7AC06DC-09FF-40ED-B03A-55D09B08EB4A") static let color: CBUUID = CBUUID(string: "B7AC06DC-09FF-40ED-B03A-55D09B080001") static let name: CBUUID = CBUUID(string: "B7AC06DC-09FF-40ED-B03A-55D09B080002") static let alpha: CBUUID = CBUUID(string: "B7AC06DC-09FF-40ED-B03A-55D09B080003") static let characteristics: [CBUUID] = [ color, name, alpha ] }
  5. Bird Peripheral 4 advertise Bird Service 4 respond to READ

    requests 4 NOTIFY subscribers about char. updates
  6. Bird Central 4 scan for Bird Service 4 discover characteristics

    4 read values 4 subscribe for notifications
  7. WWDC 2017 4 watchOS 4 + CoreBluetooth = ❤ 4

    L2CAP channel - fast data Tx 4 enhanced reliability 4 state preservation & restoration on reboot
  8. Links 4 Watch your Bluetooth - demo source code on

    Github 4 Core Bluetooth - documentation changes 4 WWDC 2017 - 712 - What's New in Core Bluetooth 4 WWDC 2017 - 205 - What's New in watchOS 4 WWDC 2017 - 408 - What’s New in Playgrounds 4 Apple - Bluetooth for Developers 4 swifting.io - #Core Bluetooth 4 Bluetooth - official website