Introduction to Bluetooth Low Energy (BLE) Technology

Slide Note
Embed
Share

Bluetooth Low Energy (BLE) is a wireless protocol that enables direct connections between devices such as phones and health trackers. It is a lightweight subset of classic Bluetooth, offering advantages like low power consumption and faster throughput. BLE devices typically have two roles: peripheral devices, which are small and low-power, and central devices, which have more processing power. The advertising process in BLE involves transmitting data payloads to establish connections and exchange information. The Generic Access Profile (GAP) controls the connection and advertising processes in BLE.


Uploaded on Oct 11, 2024 | 0 Views


Download Presentation

Please find below an Image/Link to download the presentation.

The content on the website is provided AS IS for your information and personal use only. It may not be sold, licensed, or shared on other websites without obtaining consent from the author. Download presentation by click this link. If you encounter any issues during the download, it is possible that the publisher has removed the file from their server.

E N D

Presentation Transcript


  1. Lecture 12: Bluetooth LE Lecture 12: Bluetooth LE Topics: BLE Basics, code example

  2. What is BLE? What is BLE? A wireless protocol for connecting two devices. Direct connection between two devices; e.g. phones and health trackers. A lightweight subset of classic Bluetooth. Introduced by Nokia; Became a part of the Bluetooth 4.0 core specification.

  3. BLE vs. Classic BT BLE vs. Classic BT Spec. BLE BT Classic Topology Star Scatternet Throughput 0.7 2.1 Mbps 0.3 Mbps Message 8 47 bytes 358 bytes Power < 15 mA < 30 mA Cost Low High Range 50 150 m < 30 m Latency 3 ms 100 ms

  4. Devices: Two Roles Devices: Two Roles Peripheral Device (Server) Small Low power Resource constrained Connects to a more powerful (central) device e.g., heart rate monitors, BLE proximity tags Central Device (Client) More processing power More memory e.g. Smartphone and tablets

  5. Advertising: Two Kinds of Payloads Advertising: Two Kinds of Payloads Advertising Data Payload (Mandatory) constantly transmitted out of the peripheral to let the central know its existence. Scan Response Payload (optional) only if a central device requests for this.

  6. Advertising Process Advertising Process A peripheral periodically transmits an advertising packet at a specific advertising interval. Longer interval longer battery life, less responsive. If a listening device (central) is interested in a scan response payload, it can request for it, and the peripheral will respond with additional data.

  7. Advertisement Advertisement- -based Communication based Communication Typically, peripherals would advertise, establish a connection, and start exchanging data. Using advertisement packets, peripherals can broadcast data to any central in its listening range.

  8. Generic Access Profile (GAP) Generic Access Profile (GAP) Controls connection and advertising processes. Makes a device visible to the world. Determines how two devices can/cannot interact. Defines the role of a device.

  9. Generic Attribute Profile ( Generic Attribute Profile (GATT) Defines how two BLE devices transfer data back and forth using concepts like Services and Characteristics. GATT works only after a dedicated connection between two devices has been established. Connections are exclusive, i.e. a peripheral can only connect to one central device. Communication is two-way. GATT)

  10. Connected Network Topology Connected Network Topology One central and many peripherals. For two peripherals to talk, all messages have to pass through a central.

  11. So, see the difference? So, see the difference? Advertisement-based vs. Connection-based: Connection-less Broadcast Communication Connection-oriented Two-way Communication

  12. GATT GATT (once they are connected) (once they are connected) GATT a client-server relationship. A peripheral is a GATT Server which holds service and characteristic definitions. A central is a GATT Client which sends requests to the server (peripheral).

  13. Again, see the difference? Again, see the difference? Advertisement-based vs. Connection-based: Connection-less, broadcast communication Connection-oriented, two-way communication

  14. GATT Transaction GATT Transaction All transactions are started by a GATT Client, which receives a response from the GATT Server. When establishing a connection, a peripheral suggests a connection interval. A central device tries to connect to the peripheral at every connection interval to check for new data. Connection-oriented, two-way communication

  15. GATT GATT Transaction Transaction Profiles, services, and characteristics: Profile: Predefined collection of Services, compiled by either Bluetooth SIG or a peripheral designer. Service: A collection of characteristics. Unique ID called UUID (16 bit 128 bit) Characteristic: Encapsulates a single data point. Can be used for sending data back to a peripheral as we can write into a characteristic.

  16. Programming BLE in Android Programming BLE in Android Scanning and Listing BLE Devices Class Useful Methods BluetoothManager getAdapter() BluetoothAdapter getBluetoothLeScanner() BluetoothLeScanner startScan() stopScan() ScanCallback onScanResult() BLUETOOTH and LOCATION permissions are required (manifest.xml) Red colored methods are async do not call more than one at the same time.

  17. Programming BLE in Android Programming BLE in Android Getting Connected and Listing Services: Class Useful Methods BluetoothDevice connectGatt() BluetoothGatt discoverServices() getServices() BluetoothGattServices getCharacteristics() BluetoothGattCharacteristics getDescriptors() BluetoothGattDescriptor BluetoothGattCallback onConnectionStateChange() onServicesDiscovered() Red colored methods are async do not call more than one at the same time.

  18. Programming BLE in Android Programming BLE in Android Reading Characteristics (i.e. data): Class Useful Methods BluetoothDevice BluetoothGatt setCharacteristicsNotification() writeDescriptor() BluetoothGattServices getValue() BluetoothGattCharacteristics BluetoothGattDescriptor setValue() BluetoothGattCallback onCharacteristicRead() onCharacteristicChanged() onDescriptorWrite() Red colored methods are async do not call more than one at the same time.

  19. References References https://en.wikipedia.org/wiki/Bluetooth_low_energy https://learn.adafruit.com/introduction-to-bluetooth-low-energy/introduction https://developer.android.com/guide/topics/connectivity/bluetooth-le.html http://www.rfwireless-world.com/Terminology/Bluetooth-vs-BLE.html https://www.link-labs.com/blog/bluetooth-vs-bluetooth-low-energy

Related


More Related Content