Transcript
Page 1: Bluetooth Low Energy Unveiled

Bluetooth Low EnergyUncovered

Gabe Gindele@barbazoo

Friday, October 18, 13

Page 2: Bluetooth Low Energy Unveiled

Tech Overview

• “A Better Bluetooth” - Power and Cost

• 4.0 - Single and Dual Mode

• 3 Advertising, 37 Data Channels

• Advertiser vs. Scanner

• Master vs. Slave

Friday, October 18, 13

Page 3: Bluetooth Low Energy Unveiled

Classic vs. Low Energy

• 100mW vs. 10mW power

• Connection Oriented vs. Connectionless

• Streaming Data vs. Small Data Bursts

• HCI API stays intact

Friday, October 18, 13

Page 4: Bluetooth Low Energy Unveiled

Tech Overview Cont.

Total Transaction Time: 3msFriday, October 18, 13

Page 5: Bluetooth Low Energy Unveiled

Apple and Bluetooth LE

• First to Introduce

• iPhone 4S, MBA, Mac Mini since 2011

• WWDC 2012 Sessions

• All Products Today - Apple TV

• Classic remains under MFA

• Opens new era of Sensors and IOT

Friday, October 18, 13

Page 6: Bluetooth Low Energy Unveiled

Devices Today

• Fitbit Flex

• Heart Rate monitors

• SmartWatches

• Proximity

• iBeacons

• Sensors

Friday, October 18, 13

Page 7: Bluetooth Low Energy Unveiled

GATT

• Service

• Characteristic

• Value

• Descriptors

• Notifications

• APIs are Asynchronous

Friday, October 18, 13

Page 8: Bluetooth Low Energy Unveiled

iOS: Discovery

central  =  [[CBCentralManagernager  alloc]  

initWithDelegate:self  queue:nil];

[central  scanForPeripheralsWithServices:nil  options:nil];

-­‐  (void)centralManager:(CBCentralManager  *)central

    didDiscoverPeripheral:(CBPeripheral  *)peripheral

  advertisementData:(NSDictionary  *)advertisementData

  RSSI:(NSNumber  *)RSSI  {}

[myCentralManager  stopScan];

Friday, October 18, 13

Page 9: Bluetooth Low Energy Unveiled

iOS: Connection

[myCentralManager  connectPeripheral:peripheral  options:nil];

-­‐  (void)centralManager:(CBCentralManager  *)central  didConnectPeripheral:(CBPeripheral  *)peripheral  {}

peripheral.delegate  =  self;

[peripheral  discoverServices:nil];[peripheral  discoverCharacteristics:nil    forService:...];

[peripheral  readValueForCharacteristic:...];[peripheral  setNotifyValue:YES  forCharacteristic:...;[peripheral  writeValue:...  type:CBCharacteristicWriteWithResponse]

Friday, October 18, 13

Page 10: Bluetooth Low Energy Unveiled

Android: BluetoothGatt

• Since 4.3 - API 18 - Most of new devices

• A new profile

• GATT Server is missing

Friday, October 18, 13

Page 11: Bluetooth Low Energy Unveiled

Android: Discovery

mBluetoothAdapter.startLeScan(mLeScanCallback);  

public  void  onLeScan(final  BluetoothDevice  device,  int  rssi,  byte[]  scanRecord)  {};

mBluetoothAdapter.stopLeScan(mLeScanCallback);

Friday, October 18, 13

Page 12: Bluetooth Low Energy Unveiled

Android: Connection

BluetoothGatt  mBtGatt  =  device.connectGatt(...  callback);

BluetoothGattCallback  callback  =  new  BluetoothGattCallback()  {

public  void  onConnectionStateChange(...)  {}public  void  onServicesDiscovered(...)  {}public  void  onCharacteristicRead(...)  {}public  void  onCharacteristicChanged(...)  {}

};

mBtGatt.setCharacteristicNotification(characteristic,  enabled);

onCharacteristicChanged(BluetoothGatt  gatt,    BluetoothGattCharacteristic)  {}

Friday, October 18, 13

Page 13: Bluetooth Low Energy Unveiled

iBeacon

• Best Kept Secret of iOS7

• Micro Locations Made Simple

• API extends CoreLocation - CLBeacon

• Broadcast only - UUID, Major, Minor

• Geofence, Passbook

Friday, October 18, 13

Page 14: Bluetooth Low Energy Unveiled

Development Tools

• TI CC2541 Sensor Tag

• BlueGiga BGScript and API

• Nordic nRF51922 with Cortex M0

• RadiusNetworks Android iBeacons SDK

Friday, October 18, 13

Page 15: Bluetooth Low Energy Unveiled

Questions?

Friday, October 18, 13


Recommended