挖掘低耗電藍芽的寶藏
Upcoming SlideShare
Loading in...5
×
 

挖掘低耗電藍芽的寶藏

on

  • 344 views

MOPCON 2013

MOPCON 2013

Statistics

Views

Total Views
344
Views on SlideShare
344
Embed Views
0

Actions

Likes
1
Downloads
10
Comments
0

0 Embeds 0

No embeds

Accessibility

Categories

Upload Details

Uploaded via as Adobe PDF

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment

挖掘低耗電藍芽的寶藏 挖掘低耗電藍芽的寶藏 Presentation Transcript

  • 挖掘低耗電藍芽的寶藏 ! 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 July 2010. View slide
  • •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 View slide
  • CR2032
  • 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
  • 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
  • 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
  • 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.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
  • 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 http://developer.bluetooth.org
  • 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
  • Services Services are collections of characteristics and relationships to other services that encapsulate the behavior of part of a device. http://developer.bluetooth.org
  • 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
  • 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
  • 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)centralManagerDidUpdateState:(CBCentralManager *)central { if (central.state == CBCentralManagerStatePoweredOn) { [central scanForPeripheralsWithServices:nil options:0]; } } Scan
  • - (void)centralManager:(CBCentralManager *)central didDiscoverPeripheral:(CBPeripheral *)peripheral advertisementData:(NSDictionary *)advertisementData RSSI: (NSNumber *)RSSI { [centralManager connectPeripheral:peripheral options:nil]; } Discover Peripheral
  • - (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
  • - (void)peripheral:(CBPeripheral *)peripheral didDiscoverServices:(NSError *)error { if (!error) { for (CBService *service in peripheral.services) { [peripheral discoverCharacteristics:nil forService:service]; } } } Discover Services
  • - (void)peripheral:(CBPeripheral *)peripheral didDiscoverCharacteristicsForService:(CBService *)service error: (NSError *)error { ! } Discover Characteristics
  • Peripheral Manager CBPeripheralManager *peripheralManager = [[CBPeripheralManager alloc] initWithDelegate:self queue:nil]; ! ! ! - (void)peripheralManagerDidUpdateState:(CBPeripheralManager *)peripheral { if (peripheral.state == CBPeripheralManagerStatePoweredOn) { [peripheralManager startAdvertising:dictionary]; } }
  • Data Transmission Read Write Notification
  • Data Transmission - (void)readValueForCharacteristic:(CBCharacteristic *)characteristic;
  • Data Transmission - (void)writeValue:(NSData *)data forCharacteristic: (CBCharacteristic *)characteristic type: (CBCharacteristicWriteType)type;
  • - (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;
  • 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/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
  • 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
  • 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
  • 謝謝