1 / 74

BLE 101 – Bluetooth low energy

BLE 101 – Bluetooth low energy. Roger Garvert Field Application Engineer 2445 Flambeau Drive Naperville, IL  60564. Email: roger.garvert@csr.com Direct:   +1 630 355 0331 Cell:  +1 630 788 7553 Web: www.csr.com. Agenda. Bluetooth low energy defined Architectural Overview

Samuel
Télécharger la présentation

BLE 101 – Bluetooth low energy

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. BLE 101 – Bluetooth low energy

  2. Roger Garvert Field Application Engineer 2445 Flambeau Drive Naperville, IL  60564 Email: roger.garvert@csr.com Direct:  +1 630 355 0331 Cell:  +1 630 788 7553 Web: www.csr.com

  3. Agenda • Bluetooth low energy defined • Architectural Overview • Stack Architecture • Physical Layer • Link Layer • HCI Layer • L2CAP Layer • Attribute Protocol • Generic Attribute Profile • Generic Access Profile • Applications • Applications

  4. Agenda • Bluetooth low energy defined • Architectural Overview • Stack Architecture • Physical Layer • Link Layer • HCI Layer • L2CAP Layer • Attribute Protocol • Generic Attribute Profile • Generic Access Profile • Applications • Applications

  5. What is Bluetooth low energy? • Evolution of current Bluetooth standard • Open and license free standard • Easily integrated within existing Bluetooth technology • Focus on ultra-low power consumption • Ideal for devices with very low battery capacity • Faster connections • “I got it” • “I got it” “I want more” “Here it is”

  6. New Technology? • Yes • efficient discovery / connection procedures • very short packets • asymmetric design for peripherals • client server architecture • No • reuse existing BR radio architecture • reuse existing HCI logical and physical transports • reuse existing L2CAP packets

  7. Why Bluetooth low energy? • In the home • Remote control • Entertainment • Assisted living • Consumer medical & health • In the workplace • Factory automation • In the car • Sensors • Displays • On the go • Sports and fitness • Proximity

  8. Basic Concepts • Everything optimized for power consumption • Button Cell will be the main power supply for peripherals • < 15ma peak current • < 1µa average current

  9. Basic Concepts • Everything has STATE • devices expose their state • these are servers • Clients can use the state exposed on servers • read it – get current temperature • write it – increase set point temperature for room • Servers can tell clients when state updates • notify it – temperature up to set point Server Client

  10. Internet Basic Concepts • Client Server Architecture • proven architecture for web-infrastructure • Gateways allow interconnect of internet & low energy • weighing scales send reports to doctor • home security web site shows all windows closed • assisted living for your parents allows low cost monitoring • sports data immediately uploaded via cellular phone

  11. Agenda • Bluetooth low energy defined • Architectural Overview • Stack Architecture • Physical Layer • Link Layer • HCI Layer • L2CAP Layer • Attribute Protocol • Generic Attribute Profile • Generic Access Profile • Applications • Applications

  12. Operating States and Roles • Master/Slave only • No scatternet • No role switches

  13. Operation States and Roles • Bluetooth low energy devices may have more than one instance of the Link Layer state machine at any one time • However a Bluetooth low energy device cannot be master and slave at the same time * Only advertising packets that will not result in Link Layer entering a Slave Role

  14. Topology Example • Star topology • Master can have multiple link layer connections • Slave can have only one link layer connection Advertiser Slave Slave Master Scanner Advertisement Slave Advertiser Advertiser Slave

  15. Topology Example • Initiation of connection requests • Master can simultaneously be scanner and Master • Master can simultaneously be initiator and Master Advertiser Slave Slave Master Scanner Connection Request Slave Advertiser Advertiser Slave

  16. Topology Example • Master and Slave can both act as Advertiser • Only advertising events that will not result in connection as Slave are allowed Advertiser Slave Slave Master Scanner Connected Slave Advertiser Slave / Advertiser Slave

  17. Agenda • Bluetooth low energy defined • Architectural Overview • Stack Architecture • Physical Layer • Link Layer • HCI Layer • L2CAP Layer • Attribute Protocol • Generic Attribute Profile • Generic Access Profile • Applications • Applications

  18. Stack Architecture Apps Applications Host Generic Access Profile Generic Attribute Profile Attribute Protocol Security Manager Logical Link Control and Adaptation Protocol Host Controller Interface Controller Link Layer Direct Test Mode Physical Layer

  19. Physical Layer Apps Applications Host Generic Access Profile Generic Attribute Profile Attribute Protocol Security Manager Logical Link Control and Adaptation Protocol Host Controller Interface Controller Link Layer Direct Test Mode Physical Layer

  20. Spectrum Usage • The 2.4GHz ISM band is a free for all for anyone who wants to use it. • The 2.4GHz ISM Band is also used by: • Microwave Ovens • Digital Cordless Phones • 802.11b/g DirectRadio wavesVisibleX-rays Current100 kHz – 300 GHz light ExtremelyUltravioletGamma low frequencyFMradioradiationrays (ELF) 88-108 MHz Very low frequency Microwaves (VLF)300 MHz – 300 GHz medium wave radio 550-1600 kHz Infrared long wave radio radiation 150-350kHz Frequency in hertz (Hz) kHz MHz GHz 0 102 104 106 108 1010 1012 1014 1016 1018 1020 1022 Bluetooth

  21. Bluetooth low energy Frequency Plan MHz 2402 2404 2406 2408 2410 2412 2414 2416 2418 2420 2422 2424 2426 2428 2430 2432 2434 2436 2438 2440 2442 2444 2446 2448 2450 2452 2454 2456 2458 2460 2462 2464 2466 2468 2470 2472 2474 2476 2478 2480 Advertising 37 38 39 Data 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 WiFi 1 1 1 1 1 1 1 1 1 6 6 6 6 6 6 6 6 6 11 11 11 11 11 11 11 11 11 Lower guard band of 2MHz, upper guard band of 3.5MHz

  22. Transmitter and Receiver Characteristics • Transmit output power • -20dBm to +10dBM • No concept of Class 1 / 2 / 3 • Receive sensitivity • -70dBm (-90dBm is expected performance) • Modulation Index • 0.5 (compared to 0.25 for Bluetooth BR/EDR) • Easier to distinguish “1” from “0” • Frequency hopping not required by regulatory agencies • No frequency hopping in advertising/scanning • Frequency hopping only in connections

  23. Frequency Hopping Spread Spectrum - FHSS • Bluetooth low energy splits the spectrum up into 37 1MHz wide channels data channels • FHSS occurs while in a connection • The frequency hops follow a hop-length that is pseudo-random per connection • Communicated in the “Connection Request” • Provides instant adaptive frequency hopping capability • Can be updated using a channel update message Guard Band Guard Band Frequency, GHz 2.4000 2.4020 2.4800 2.4835

  24. Link Layer Apps Applications Host Generic Access Profile Generic Attribute Profile Attribute Protocol Security Manager Logical Link Control and Adaptation Protocol Host Controller Interface Controller Link Layer Direct Test Mode Physical Layer

  25. Device Filtering • Devices maintain a “white list” • Storage of device addresses for device filtering • Filter policy can be set to: • Advertiser • Process scan/connection requests from devices in white list • Process all scan/connection requests (default advertiser filter policy) • Process connection requests from all devices but only scan requests in white list • Process scan requests from all devices but only connection requests in white list • Scanner • Process advertising packets from devices in white list • Process all advertising packets (default scanner filter policy) • Initiator • Process connectable advertising events from devices in white list • Process connectable events only from single device specified by host

  26. One Packet Format • Used for Advertising and Data Channel Packets • Preamble (0x55, 0xAA) • Frequency synchronization, symbol timing estimation, AGC training • Access Address • Advertising packets – always 0x8e89bed6 • Data packets – different for each link layer connection • Packet Data Unit • Defined based upon packet types Not Whitened Whitened Protected by CRC

  27. Advertising Advertiser Scanner Event started ADV_IND (data) Adv_Idx= 37 Found device (data) ~0.5ms ADV_IND (data) Adv_Idx=38 ~0.5ms ADV_IND (data) Adv_Idx= 39 Advertising Event Response packet to advertising event Event closed SCAN_REQ CONNECT_REQ ADV_IND Yes Yes ADV_DIRECT_IND No Yes * ADV_NONCONN_IND No No ADV_DISCOVER_IND Yes No * If initiator address matches

  28. Active Scanning Advertiser Scanner Event started ADV_IND (data) Adv_Idx= 37 T_IFS 150µs SCAN_REQ Adv_Idx=37 <1.5ms SCAN_RSP (data) Adv_Idx=37 Advertising Event Response packet to advertising event ADV_IND (data) Adv_Idx=38 SCAN_REQ CONNECT_REQ ~0.5ms ADV_IND Yes Yes ADV_DIRECT_IND No Yes * ADV_IND (data) Adv_Idx= 39 ADV_NONCONN_IND No No Event closed ADV_DISCOVER_IND Yes No * If initiator address matches

  29. Connection • CONNECT_REQ includes the following data: • Transmit window size • Transmit window offset • Connection interval • Slave latency • Connection Timeout • Hop sequence • Channel Map • CRC initialization value Advertiser Scanner Event started ADV_IND (data) Adv_Idx= 37 T_IFS 150µs CONNECT_REQ Adv_Idx=37 Event closed Advertising Event Response packet to advertising event SCAN_REQ CONNECT_REQ ADV_IND Yes Yes ADV_DIRECT_IND No Yes * ADV_NONCONN_IND No No ADV_DISCOVER_IND Yes No

  30. Connection Advertiser Scanner Advertising Event started ADV_IND (data) Adv_Idx= 37 CONNECT_REQ Adv_Idx=37 Advertising Event closed Master Slave 1.25ms < t < WindowOffset+WindowSize Connection Event started LL Data/Control packet Channel fn T_IFS 150µs LL Data/Control packet Channel fn Connection Event closed connInterval Connection Event started LL Data/Control packet Channel fn+1 T_IFS 150µs LL Data/Control packet Channel fn+1 Connection Event closed

  31. Acknowledgement and Flow Control • Acknowledgements embedded in header of every Data channel PDU • Single bit Sequence Number (SN) • Single bit Next Expected Sequence Number (NESN) • Packet is retransmitted until the NESN is different from the SN value in the sent packet • Enables lazy acknowledgement for significant power savings Slave Master Data (SN=0, NESN=0) Data (SN=0, NESN=1) Data (SN=1, NESN=1) Data (SN=1, NESN=0) Data (SN=0, NESN=1) Data (SN=1, NESN=0)

  32. Air Interface Packets – Advertising Packets • Preamble– frequency synchronization and AGC training (10101010) • Access Address– 0x8e89bedd6 • CRC – computed over PDU • TxAdd, RxAdd– PDU type-specific information Length (6 bits) RFU (2 bits) Type (4 bits) RFU (2 bits) TxAdd (1 bit) RxAdd (1 bit) Header (16 bits) Payload (per Length field in header) Preamble (1 octet) Access Address (4 octets) CRC (3 octets) PDU

  33. Air Interface Packets – Initiating PDUs AA (4 octets) CRCInit (3 octets) WinSize (1 octets) WinOffset (2 octets) Interval (2 octets) Latency (2 octets) Timeout (2 octets) ChM (5 octets) Hop (5 bits) SCA (3 bits) • InitA –initiator’s public/random address based on TxAdd • AdvA –advertiser’s public/random address based on RxAdd • AA – contains Link Layer’s connection address • CRCInit –initialization value for CRC calculation • WinSize – defines timing window for first data packet • WinOffset – offset of transmit window start • Interval – time between connection events • Latency – # times slave can ignore connection events • Timeout – max time between two correctly received packets before link is considered lost • ChM – Channel Map • Hop – Random number seeding hop sequence • SCA – Sleep Clock Accuracy range AdvA (6 octets) InitA (6 octets) LLData (22 octets) Header (16 bits) Payload (per Length field in header) Preamble (1 octet) Access Address (4 octets) CRC (3 octets) PDU

  34. Air Interface Packets – LL Data Channel • Preamble – frequency synchronization and AGC training (01010101) or (10101010) • Synchronization word – 32 bit link layer connection access address • CRC – computed over PDU • MIC – Message Integrity Code, for use with encrypted links LLID (2 bits) NESN (2 bits) SN (1 bit) MD (1 bit) RFU (3 bits) Length (5 bits) RFU (3 bits) Header (2 octets) Payload (0-27 octets) MIC (4 octets) Preamble (1 octet) Synchronization word (4 octets) PDU CRC (3 octets)

  35. Air Interface Packets – LL Control Packets CtrType (1 octet) CtrData LLID 1 1 NESN (2 bits) SN (1 bit) MD (1 bit) RFU (3 bits) Length (5 bits) RFU (3 bits) Header (2 octets) Payload (0-27 octets) MIC (4 octets) Preamble (1 octet) Synchronization word (4 octets) PDU CRC (3 octets)

  36. Packet Timings • Peer device transmits 150 μs after last packet • Minimum size packet = 80 μs (Preamble + Access Address + Header + CRC) • Maximum size packet = 328 μs (Preamble + Access Address + Header + Payload + MIC + CRC) Tx Rx Tx Rx Tx Rx Tx Rx Tx

  37. Maximum Data Rate • Asymmetric Tx/Rx Packet Sequence 328 + 150 + 80 + 150 = 708 μs Transmitting 27 octets of application data ~305 kbps Tx Rx Tx Rx Tx Rx Tx Rx Tx

  38. Device Setup Reset HCI Commands and Events Generic Events Command Complete Command Status Hardware Error Device Discovery LE Advertising Report LE Set Scan Enable LE Set Scan Parameters Host Flow Control Host Buffer Size Set Event Mask Set Controller To Host Flow Control Host Number of Completed Packets Data Buffer Overflow LE Add Device to White List LE Clear White List LE Read White List Size LE Remove Device from White List LE Set Event Mask Connection Setup Disconnect Command Disconnection Complete LE Connection Complete LE Create Connection Cancel LE Create Connection Controller Flow Control Read Buffer Size Number of Completed Packets LE Read Buffer Size Controller Information Read Local Version Information Read Local Supported Commands Read Local Supported Features Read BDADDR LE Read Local Supported Features LE Read Supported States Link Information Read Transmit Power Level Read RSSI LE Read Advertising Channel TX Power LE Read Channel Map Remote Information Read Remote Version Information Read Remote Version Information Complete LE Read Remote Used Features LE Read Remote Used Features Complete Controller Configuration LE Set Advertise Enable LE Set Advertising Data LE Set Advertising Parameters LE Set Random Address LE Set Scan Response Data LE Set Random Address Connection State LE Connection Update LE Connection Update Complete Authentication and Encryption Encryption Change Encryption Key Refresh Complete LE Encrypt LE Long Term Key Requested LE Long Term Key Requested Reply LE Long Term Key Requested Negative Reply LE Rand LE Start Encryption Physical Links LE Set Host Channel Classification Test LE Receiver Test LE Transmitter Test LE Test End Black – existing commands Black italicized – existing events Red – new commands Red italicized – new events

  39. Logical Link Control and Adaptation Protocol Apps Applications Host Generic Access Profile Generic Attribute Profile Attribute Protocol Security Manager Logical Link Control and Adaptation Protocol Host Controller Interface Controller Link Layer Direct Test Mode Physical Layer

  40. Attribute Protocol Apps Applications Host Generic Access Profile Generic Attribute Profile Attribute Protocol Security Manager Logical Link Control and Adaptation Protocol Host Controller Interface Controller Link Layer Direct Test Mode Physical Layer

  41. Attribute Protocol (ATT) • Client Server Architecture • servers have data • clients request data to/from servers • Servers expose data using Attributes Client Server Requests Data Data Responses Data

  42. The Attributes of Attributes • Attributes have values • Array of up to 512 octets, fixed or variable length • Attributes have handles • Used to address an individual attribute by a client • Attributes have a type • <<UUID>>, determines what the value means • Defined by GAP, GATT, “Characteristic Specifications” • Attributes have permissions • Read, Write • May require authentication or authorization to read or write

  43. Protocol Methods • Client can only send one request at a time – request completes after response received • Server can send only one indication at a time – indication completes after confirmation • Commands and Notifications can be sent at any time

  44. Attribute Commands

  45. Generic Attribute Profile Apps Applications Host Generic Access Profile Generic Attribute Profile Attribute Protocol Security Manager Logical Link Control and Adaptation Protocol Host Controller Interface Controller Link Layer Direct Test Mode Physical Layer

  46. Defines framework for using Generic Attribute Protocol Configurations and Roles Client Initiates commands and requests toward server Receives responses, indications, and notifications from server Server Accepts commands and requests from client Sends responses, indications, and notifications to client Generic Attribute Profile (GATT) Generic Access Profile Generic Attribute Profile Example Application Request Response Server Client

  47. Client Server Architecture • Same client server architecture as Attribute Protocol • except that data is encapsulated in “Services” • data is exposed in “Characteristic” Client Server Service Requests Service Char. Char. Responses Service Char.

  48. GATT Definitions • Service – set of related characteristics and how these are used • Primary Services – exposes primary usable functionality of device • Can be included by another service • Secondary Services – intended to be referenced by primary services • Characteristics – related attributes that describe state of device • Features available (readable, indicatable, etc.) • Handle • Representation (units, exponent, data type) – i.e. data dictionary

  49. GATT uses Attribute Protocol • Attribute Protocol defines a server with a set of attributes • addressable with a handle • typed using a UUID • Includes data in an attribute value • Includes permissions implementation specific 2 octets 2 or 16 octets variable length (0 to 512 octets) Attribute Handle Attribute Type Attribute Value Attribute Permissions

  50. GATT Attribute Grouping

More Related