BLE Connection Establishment Explained
Advertisement
This page describes the BLE (Bluetooth Low Energy) Connection Establishment Procedure. The messages exchanged between a BLE master (i.e., initiator) and slave (i.e., advertiser) to establish a BLE connection are also described.
Introduction
Bluetooth Low Energy (BLE) is a wireless PAN (personal area network) technology designed, developed, and maintained by the Bluetooth SIG (Special Interest Group). Bluetooth is widely used in various applications across industries, including healthcare, security, fitness, and entertainment. Examples of BLE devices include proximity sensors, fitness trackers, and heart rate monitors. It’s also used in mobile phones, laptops, and tablets for data exchange.
The Link Layer of the BLE protocol stack is responsible for advertising, scanning, and creating/maintaining connections. The roles of BLE devices change in peer-to-peer (i.e., Unicast) or broadcast modes.
The common roles are as follows:
- Advertiser/Scanner (Initiator)
- Slave/Master
- Broadcaster/Observer
Figure 1: BLE Link Layer States
The figure above depicts BLE device states. The device will be in any one of these states: Standby, Advertising, Scanning, Initiating, Connection, and Synchronization. The BLE connection process depends on the role of the BLE devices.
Figure: BLE Connection Establishment Procedure
Let’s understand the BLE connection establishment procedure, focusing on the BLE peer-to-peer or unicast connection process.
Discovery Phase
Initially, a discovery process takes place. As a result, devices become aware of each other’s presence. After this, the BLE connection process starts.
Connecting Phase
The scanner then selects a preferred advertiser based on advertising data, which includes the device name, service UUID, RSSI, etc. The device is now called the “Initiator,” which responds to the advertising packet with a “CONNECT_REQ” packet.
- This “CONNECT_REQ” packet, as defined in v4.2, carries parameters useful for the connection, including the frequency hopping sequence, connection interval, slave latency, supervision timeout, etc. The connection interval refers to the time between two consecutive events. Once the CONNECT_REQ packet is transmitted by the initiator or received by the advertiser, the BLE devices are said to be connected.
- (As defined in V5.1), the CONNECT_IND and the AUX_CONNECT_REQ PDUs are sent by the Link Layer in the Initiating state and received by the Link Layer in the Advertising state. The AUX_CONNECT_RSP PDU is sent by the Link Layer in the Advertising state and received by the Link Layer in the Initiating state.
Connected Phase
Once a connection is established between the “master” and “slave,” they can start exchanging data using data packets at regular intervals known as “connection events.” The timing of connection events is determined by two parameters: the connection interval (i.e., “connInterval”) and slave latency (i.e., “connSlaveLatency”).
References
- BLUETOOTH CORE SPECIFICATION Version 4.2/5.1
- Previous versions of Bluetooth 5.0 or Bluetooth Low Energy (BLE)