Top Banner
38

從App developer角度來介紹BLE

Dec 04, 2014

Download

Technology

Sam Lee

在物聯網跟穿戴式裝置正夯的時代,身為App Developer不能不了解的BLE
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: 從App developer角度來介紹BLE
Page 2: 從App developer角度來介紹BLE
Page 3: 從App developer角度來介紹BLE

在穿戴式裝置與物聯網正夯的時代身為 App Developer 你不能不了解的 BLE

Sam Lee ([email protected])

Page 4: 從App developer角度來介紹BLE
Page 5: 從App developer角度來介紹BLE

l Internet

Page 6: 從App developer角度來介紹BLE

l BLE (Bluetooth Low Energy)

l Bluetooth Smartl Bluetooth 4.0 (June 2010)l Bluetooth 4.1 (Dec 2013)l 低成本 (?)l 範圍 : ~ 100ml 省電 : 鈕扣電池可以撐 1 年以上l 速度 : 理論上限 (1Mbit/s), App (270Kbit/s)

Page 7: 從App developer角度來介紹BLE

Overview

l Broadcast & connectionl Short packetsl Client/Server 架構l Everything has STATEl 非同步傳送資料

Page 8: 從App developer角度來介紹BLE

Device Classic Bluetooth BLE support

Pre-4.0 Bluetooth Yes No

4.x Single-Mode No Yes

4.x Dual-Mode Yes Yes

Page 9: 從App developer角度來介紹BLE

廣播

Page 10: 從App developer角度來介紹BLE

連線

Page 11: 從App developer角度來介紹BLE

如何省電

Page 12: 從App developer角度來介紹BLE
Page 13: 從App developer角度來介紹BLE

Protocol ??

Profile ??

l GATT Based Profiles

Page 14: 從App developer角度來介紹BLE

l 2.4G Hzl 40 channelsl 3 advertising channell Fixed rate: 1 Mbit/sl 高斯頻移鍵控 (GFSK)l Frequency Hopping (AFH)

Page 15: 從App developer角度來介紹BLE
Page 16: 從App developer角度來介紹BLE

l Bluetooth Device Addressl 48-bit (Public/Random)

l 4 rolesl Advertiser & Scannerl Master & Slave

l 1 format 2 types packetsl Advertising & Data

l Connection (7.5ms~4s)l 27bytes, but ~20 bytes

l Advertising (20ms ~ 10.24s) l 31 bytes data payloadl Active/Passive scanning

Page 17: 從App developer角度來介紹BLE

l 搭起友誼的橋樑

Page 18: 從App developer角度來介紹BLE

l 協定多工器l 封包重組與分配l Data payload: 23 bytesl Similar to TCP

Page 19: 從App developer角度來介紹BLE

l Initiator → Responderl Central → Peripheral (GAP)

l Security Proceduresl Pairingl Bondingl Encryption Re-establishment

l Pairing Algorithmsl Just Worksl Passkey Displayl Out Of Band

Page 20: 從App developer角度來介紹BLE

l Client->Serverl Request → Responsel Strict Sequencing

l Server Initiated l Indication/Confirmationl Notfiication

l Handle l Typel (UUID)

l Attribute Value l Permissions

l 2B 2/4/16B l 0~512B

Page 21: 從App developer角度來介紹BLE

l Control layerl Roles

l Broascaster & Observerl Central & Peripheral

l GAP Service(GATT)l Device namel Apprearancel PPCP

Page 22: 從App developer角度來介紹BLE

l Data Layerl Roles

l Client & Serverl BluetoothBaseUUID

l xxxxxxxx-0000-1000-8000-00805F9B34FB

l Shortened UUID(16 or 32 bit)

Page 23: 從App developer角度來介紹BLE
Page 24: 從App developer角度來介紹BLE
Page 25: 從App developer角度來介紹BLE

l First Releasel JellyBean MR 4.3 (API 18)

l Peripheral Model Android L (Coming Soon)

Page 26: 從App developer角度來介紹BLE

http://developer.android.com/guide/topics/connectivity/bluetooth-le.html

Page 27: 從App developer角度來介紹BLE

搭配 : TI SensorTag CC2541

l 兩顆按鈕l 陀螺儀l 加速計l 溫濕感測l 氣壓計l 磁力計l IR 溫度感測器

Page 28: 從App developer角度來介紹BLE

Coding Steps

1. Use BLE Permissions2. Setup BLE3. Scan LE device4. Connect to GATT Server5. Discovery Services6. Read Data

l Read Characteristic(Attrubutes)l Receiving notification

Page 29: 從App developer角度來介紹BLE

簡易型簡報器

Page 30: 從App developer角度來介紹BLE

實際的應用案例

Page 31: 從App developer角度來介紹BLE

http://shopping.pchome.com.tw/prod/CBAFJ0-A90051821

Page 32: 從App developer角度來介紹BLE

http://24h.pchome.com.tw/prod/DGBT4W-A80478018

Page 33: 從App developer角度來介紹BLE

Oral-B

Page 34: 從App developer角度來介紹BLE

August Smart Lock

http://www.august.com/

Page 35: 從App developer角度來介紹BLE

iBeacon

Page 36: 從App developer角度來介紹BLE

Zuli

https://www.kickstarter.com/projects/zuli/zuli-smartplugs

Page 37: 從App developer角度來介紹BLE

https://www.youtube.com/watch?v=g8h_i8qv1FY

Page 38: 從App developer角度來介紹BLE

Mimo Kimono

http://mimobaby.com/