BLE (Bluetooth Low Energy)
BLE (Bluetooth Low Energy) is a wireless communication protocol designed for short-range communication with low power consumption, making it ideal for IoT and connected devices.
BLE Communication Model
BLE operates in a client-server model. Devices can either be a ‘server’ that provides data (like a heart rate sensor) or a ‘client’ that uses this data (like a smartphone).
Advertisement and Connection
The primary way devices interact in BLE is through advertisements and connections.
Advertisements: Devices (servers) broadcast small packets of data called ‘advertisements’. These packets can be received by any device (clients) scanning for such information.
Advertisements are used for broadcasting data that doesn’t require a connection (like a temperature reading) or for indicating that a device is available for connection.
Connection Requests: If a client device finds an advertisement interesting (for example, it recognizes a specific sensor it needs data from), it can initiate a connection request. This request is a packet sent to the server, which includes details for establishing a connection like timing intervals and latency parameters.
Packet Transfer in BLE
Once connected, data is transferred in packets. A packet in BLE typically consists of the following:
Access Address: Identifies a BLE channel, ensuring devices communicate on the same channel.
PDU (Protocol Data Unit): Contains the actual data and control information. It has two parts:Header: Contains information like the type of message (whether it’s data or a control packet) and length of the payload.
Payload: The actual data being transmitted.
Example Scenario: Heart Rate Monitor Connecting to a Smartphone
Advertising: A heart rate monitor (server) broadcasts an advertisement packet. This packet includes the monitor’s unique identifier and may also include some initial data like the current heart rate.
Scanning and Connection Request: Your smartphone (client) is scanning for BLE devices. It picks up the advertisement from the heart rate monitor. The smartphone then sends a connection request packet to the monitor.
Connection Establishment: Upon accepting the connection, the heart rate monitor sends an acknowledgment. This establishes a two-way communication link. The devices agree on aspects like connection intervals (how often they will communicate) and latency.
Data Transfer: Once the connection is established, the heart rate monitor starts sending data packets with the heart rate information. Each packet contains the Access Address, a PDU with a header, and the heart rate data as the payload.
Maintaining Connection: The devices continue to communicate at agreed intervals.
Disconnection: When the smartphone no longer needs the heart rate data, it sends a disconnection request, terminating the established connection.
Disclaimer – This post has only been shared for an educational and knowledge-sharing purpose related to Technologies. Information was obtained from the source above source. All rights and credits are reserved for the respective owner(s).
Keep learning and keep growing
Credits: Mr. Aditya Thakekar’s Post