挖掘低耗電藍芽的寶藏
!
Evan Wu
Evan Wu
Cocoa Heads Kaohsiung 共同發起⼈人
Code for Kaohsiung 共同發起⼈人
Code Monkey @Mobilogics
Bluetooth 4.0 Low Energy
The Bluetooth SIG announced the formal
adoption of Bluetooth Core Specification
Version 4.0 in Ju...
•Ultra-low peak, average and idle mode
power consumption
•Ability to run for years on standard,
coin-cell batteries
•Low c...
CR2032
Frequency Bands and Channel
Arrangement
The Bluetooth system operates in the 2.4 GHz ISM
band. This frequency band is 2400...
Range
Class 3 radios - have a range of up to 1 meter or 3
feet
Class 2 radios - most commonly found in mobile
devices - ha...
Transmitter Characteristics
Power Class
Maximum
Output Power
(Pmax)
Nominal Output
Power
Minimum
Output Power
Power Contro...
Classic Bluetooth
Automation
SecuritySports/FitnessHealth Care
Entertainment Toys
Pay System Time Services Proximity
WWDC 2012 Session 703
Platforms for Bluetooth Smart devices
Company Description
Bluegiga Offers single mode development kits & more. Bluegiga.co...
connectBlue Bluetooth Serial Port Module OBS421
TICC2541 SensorTag Development Kit
Nordic nRF8001 Development Kit
Does the iOS simulator
support Bluetooth Low
Energy?
Technical Note TN2295
How about OS X?
http://www.apple.com.tw
Role of Bluetooth 4.0
Client Server
Wants Data Has Data
Central Peripheral
Master Slave
Profiles
Profiles are high level definitions that define how
services can be used to enable an application or
use case
htt...
Profiles
Alert Notification HID OVER GATT
Blood Pressure Location and Navigation
Cycling Power Phone Alert Status
Cycling S...
Services
Services are collections of characteristics and
relationships to other services that encapsulate the
behavior of ...
Services
Alert Notification Service	

0x1811
Battery Service	

0x180f
Blood Pressure	

0x1810
Current Time Service	

0x1805...
Characteristics
Alert Category ID Alert Category ID Bit Mask Alert Level
Alert Notification Control Point Alert Status Appe...
Profile, Services and Characteristics
Profile
WWDC 2012 Session 703
SDK and Framework
Android:
samsung_ble_sdk_200.jar
!
iOS:
CoreBluetooth.framework
Central Manager
Scan
Discover Peripheral
Connect / Disconnect
Discover Services
Discover Characteristics
CBCentralManager *centralManager = [[CBCentralManager alloc]
initWithDelegate:self queue:nil];
!
!
!
!
- (void)centralMana...
- (void)centralManager:(CBCentralManager *)central
didDiscoverPeripheral:(CBPeripheral *)peripheral
advertisementData:(NSD...
- (void)centralManager:(CBCentralManager *)central
didConnectPeripheral:(CBPeripheral *)peripheral
{
[peripheral setDelega...
- (void)peripheral:(CBPeripheral *)peripheral
didDiscoverServices:(NSError *)error
{
if (!error) {
for (CBService *service...
- (void)peripheral:(CBPeripheral *)peripheral
didDiscoverCharacteristicsForService:(CBService *)service error:
(NSError *)...
Peripheral Manager
CBPeripheralManager *peripheralManager = [[CBPeripheralManager
alloc] initWithDelegate:self queue:nil];...
Data Transmission
Read
Write
Notification
Data Transmission
- (void)readValueForCharacteristic:(CBCharacteristic
*)characteristic;
Data Transmission
- (void)writeValue:(NSData *)data forCharacteristic:
(CBCharacteristic *)characteristic type:
(CBCharact...
- (void)setNotifyValue:(BOOL)enabled forCharacteristic:
(CBCharacteristic *)characteristic;
Data Transmission
- (void)peri...
Need a Help with Tool?
GreatBLE
DEMO
AScan
Central
Peripheral
AScaniPDT5iPad
Central
Peripheral
AScaniPDT5
Central
Peripheral
iPad
Product Idea?
!
Where is the Treasure?
More Information
Bluetooth Accessory Design Guidelines for Apple Products
https://developer.apple.com/hardwaredrivers/Blue...
More Information
BlackBerry 10 Bluetooth LE resource index
http://supportforums.blackberry.com/t5/Native-Development-Knowl...
More Information
github.com/Mobilogics
Code for Kaohsiung facebook
http://www.facebook.com/groups/codeforkaohsiung/
Cocoah...
謝謝
挖掘低耗電藍芽的寶藏
挖掘低耗電藍芽的寶藏
挖掘低耗電藍芽的寶藏
挖掘低耗電藍芽的寶藏
挖掘低耗電藍芽的寶藏
挖掘低耗電藍芽的寶藏
挖掘低耗電藍芽的寶藏
挖掘低耗電藍芽的寶藏
挖掘低耗電藍芽的寶藏
Upcoming SlideShare
Loading in …5
×

挖掘低耗電藍芽的寶藏

722 views

Published on

MOPCON 2013

Published in: Technology, Business
0 Comments
2 Likes
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total views
722
On SlideShare
0
From Embeds
0
Number of Embeds
4
Actions
Shares
0
Downloads
15
Comments
0
Likes
2
Embeds 0
No embeds

No notes for slide

挖掘低耗電藍芽的寶藏

  1. 1. 挖掘低耗電藍芽的寶藏 ! Evan Wu
  2. 2. Evan Wu Cocoa Heads Kaohsiung 共同發起⼈人 Code for Kaohsiung 共同發起⼈人 Code Monkey @Mobilogics
  3. 3. Bluetooth 4.0 Low Energy The Bluetooth SIG announced the formal adoption of Bluetooth Core Specification Version 4.0 in July 2010.
  4. 4. •Ultra-low peak, average and idle mode power consumption •Ability to run for years on standard, coin-cell batteries •Low cost •Multi-vendor interoperability •Single Mode & Dual Mode http://developer.bluetooth.org
  5. 5. CR2032
  6. 6. Frequency Bands and Channel Arrangement The Bluetooth system operates in the 2.4 GHz ISM band. This frequency band is 2400 - 2483.5 MHz ! The 79 RF channels are ordered from channel number 0-78 and are spaced 1 MHz beginning at 2402 GHz http://developer.bluetooth.org
  7. 7. Range Class 3 radios - have a range of up to 1 meter or 3 feet Class 2 radios - most commonly found in mobile devices - have a range of 10 meters or 33 feet Class 1 radios - used primarily in industrial use case - have a range of 100 meters or 300 feet http://developer.bluetooth.org
  8. 8. Transmitter Characteristics Power Class Maximum Output Power (Pmax) Nominal Output Power Minimum Output Power Power Control 1 100 mW(20 dBm) N/A 1mW(0 dBm) Pmin<+4 dBm to Pmax Optional: Pmin** to Pmax 2 2.5mW(4 dBm) 1mW(0 dBm) 0.25mW(-6 dBm) Optional: Pmin to Pmax 3 1mW(0 dBm) N/A N/A Optional: Pmin2 to Pmax http://developer.bluetooth.org
  9. 9. Classic Bluetooth
  10. 10. Automation SecuritySports/FitnessHealth Care Entertainment Toys Pay System Time Services Proximity WWDC 2012 Session 703
  11. 11. Platforms for Bluetooth Smart devices Company Description Bluegiga Offers single mode development kits & more. Bluegiga.com Broadcom Offers application development kit. Broadcom.com Cambridge Silicon Radio Offers hosts, controllers, profile solutions & more. CSR.com connectBlue Offers single mode platform for Bluetooth Smart devices & more. connectBlue.com ISSC Technologies Corp. Offers platforms for Bluetooth Smart device development. issc-tech.com Laird Technologies Offers single mode BLE module featuring smartBASIC. lairdtech.com Nordic Semiconductor Offers single mode development kits & more. NordicSemi.com Stollmann Offers single mode platform independent profile solutions. Stollmann.com TI Offers single mode development kits & more. TI.com http://developer.bluetooth.org
  12. 12. connectBlue Bluetooth Serial Port Module OBS421 TICC2541 SensorTag Development Kit Nordic nRF8001 Development Kit
  13. 13. Does the iOS simulator support Bluetooth Low Energy? Technical Note TN2295
  14. 14. How about OS X?
  15. 15. http://www.apple.com.tw
  16. 16. Role of Bluetooth 4.0 Client Server Wants Data Has Data Central Peripheral Master Slave
  17. 17. Profiles Profiles are high level definitions that define how services can be used to enable an application or use case http://developer.bluetooth.org
  18. 18. Profiles Alert Notification HID OVER GATT Blood Pressure Location and Navigation Cycling Power Phone Alert Status Cycling Speed and Cadence Proximity Find Me Running Speed and Cadence Glucose Scan Parameters Health Thermometer Time Heart Rate
  19. 19. Services Services are collections of characteristics and relationships to other services that encapsulate the behavior of part of a device. http://developer.bluetooth.org
  20. 20. Services Alert Notification Service 0x1811 Battery Service 0x180f Blood Pressure 0x1810 Current Time Service 0x1805 Cycling Power 0x1818 Cycling Speed and Cadence Device Information Generic Access Generic Attribute Glucose Health Thermometer Heart Rate Human Interface Device Immediate Alert Link Loss Location and Navigation Next DST Change Service Phone Alert Status Service Reference Time Update Service Running Speed and Cadence Scan Parameters Tx Power
  21. 21. Characteristics Alert Category ID Alert Category ID Bit Mask Alert Level Alert Notification Control Point Alert Status Appearance Battery Level Blood Pressure Feature Blood Pressure Measurement Body Sensor Location Boot Keyboard Input Report Boot Keyboard Output Report CSC Feature CSC Measurement Current Time Cycling Power Control Point Cycling Power Feature Cycling Power Measurement Cycling PowerVector Data Time Day Date Time Day of Week Device Name DST Offset Exact Time 256 Firmware Revision String Clucose Feature Glucose Measurement Glucose Measurement Context Hardware Revision String Heart Rate Control Point Heart Rate Measurement HID Control Point HID Information IEEE 11073-20601 Regulatory Certification Data List Intermediate Cuff Pressure Intermediate Temperature LN Control Point LN Feature Local Time Information Local Time Information Location and Speed Manufacturer name String Measurement Interval Model Number String Navigation New Alert Peripheral Preferred Connection Parameters Peripheral Privacy Flag PnP ID Position Quality Protocol Mode Reconnection Address Record Access Control Point Reference Time Information Report Report Map Ringer Control Point Ringer Setting RSC Feature RSC Measurement SC Control Point Scan Interval Window Scan Refresh Sensor Location Serial Number String Supported New Alert Category Supported Unread Alert Category System ID Temperature Measurement Temperature Type Time Accuracy Time Source Time Update Control Point Time Update State Time with DST Time Zone Tx Power Level
  22. 22. Profile, Services and Characteristics Profile WWDC 2012 Session 703
  23. 23. SDK and Framework Android: samsung_ble_sdk_200.jar ! iOS: CoreBluetooth.framework
  24. 24. Central Manager Scan Discover Peripheral Connect / Disconnect Discover Services Discover Characteristics
  25. 25. CBCentralManager *centralManager = [[CBCentralManager alloc] initWithDelegate:self queue:nil]; ! ! ! ! - (void)centralManagerDidUpdateState:(CBCentralManager *)central { if (central.state == CBCentralManagerStatePoweredOn) { [central scanForPeripheralsWithServices:nil options:0]; } } Scan
  26. 26. - (void)centralManager:(CBCentralManager *)central didDiscoverPeripheral:(CBPeripheral *)peripheral advertisementData:(NSDictionary *)advertisementData RSSI: (NSNumber *)RSSI { [centralManager connectPeripheral:peripheral options:nil]; } Discover Peripheral
  27. 27. - (void)centralManager:(CBCentralManager *)central didConnectPeripheral:(CBPeripheral *)peripheral { [peripheral setDelegate:self]; [peripheral discoverServices:nil]; } ! ! - (void)centralManager:(CBCentralManager *)central didDisconnectPeripheral:(CBPeripheral *)peripheral error: (NSError *)error { NSLog(@"didDisconnectPeripheral = %@", [peripheral.identifier UUIDString]); } Connected / Disconnected
  28. 28. - (void)peripheral:(CBPeripheral *)peripheral didDiscoverServices:(NSError *)error { if (!error) { for (CBService *service in peripheral.services) { [peripheral discoverCharacteristics:nil forService:service]; } } } Discover Services
  29. 29. - (void)peripheral:(CBPeripheral *)peripheral didDiscoverCharacteristicsForService:(CBService *)service error: (NSError *)error { ! } Discover Characteristics
  30. 30. Peripheral Manager CBPeripheralManager *peripheralManager = [[CBPeripheralManager alloc] initWithDelegate:self queue:nil]; ! ! ! - (void)peripheralManagerDidUpdateState:(CBPeripheralManager *)peripheral { if (peripheral.state == CBPeripheralManagerStatePoweredOn) { [peripheralManager startAdvertising:dictionary]; } }
  31. 31. Data Transmission Read Write Notification
  32. 32. Data Transmission - (void)readValueForCharacteristic:(CBCharacteristic *)characteristic;
  33. 33. Data Transmission - (void)writeValue:(NSData *)data forCharacteristic: (CBCharacteristic *)characteristic type: (CBCharacteristicWriteType)type;
  34. 34. - (void)setNotifyValue:(BOOL)enabled forCharacteristic: (CBCharacteristic *)characteristic; Data Transmission - (void)peripheral:(CBPeripheral *)peripheral didUpdateValueForCharacteristic:(CBCharacteristic *)characteristic error:(NSError *)error; - (BOOL)updateValue:(NSData *)value forCharacteristic: (CBMutableCharacteristic *)characteristic onSubscribedCentrals: (NSArray *)centrals;
  35. 35. Need a Help with Tool? GreatBLE
  36. 36. DEMO
  37. 37. AScan Central Peripheral
  38. 38. AScaniPDT5iPad Central Peripheral
  39. 39. AScaniPDT5 Central Peripheral iPad
  40. 40. Product Idea? ! Where is the Treasure?
  41. 41. More Information Bluetooth Accessory Design Guidelines for Apple Products https://developer.apple.com/hardwaredrivers/BluetoothDesignGuidelines.pdf Bluetooth SIG, Inc. http://www.bluetooth.org Bluetooth Developer Portal https://developer.bluetooth.org/Pages/default.aspx WWDC 2012 Session 703 WWDC 2012 Session 705 WWDC 2013 Session 703
  42. 42. More Information BlackBerry 10 Bluetooth LE resource index http://supportforums.blackberry.com/t5/Native-Development-Knowledge/BlackBerry-10-Bluetooth-LE-resource- index/ta-p/2326147 Samsung BLE SDK http://developer.samsung.com/ble
  43. 43. More Information github.com/Mobilogics Code for Kaohsiung facebook http://www.facebook.com/groups/codeforkaohsiung/ Cocoaheads Kaohsiung facebook http://www.facebook.com/groups/cocoaheads.kaohsiung/ evan3rd@gmail.com
  44. 44. 謝謝

×