Bluetooth Low Energy (BLE) connection process


The Bluetooth Low Energy (BLE) connection process is usually divided into three main stages: Advertising, Scanning, and Connection. Here is a brief description of these stages:

Broadcasting (Advertising):

The peripheral device (Peripheral) starts to broadcast advertising packets (Advertising Packet), which contain the device's identification, service information or other relevant data.

Advertising packets are sent periodically at a fixed advertising interval (Advertising Interval).

Peripheral devices can choose different broadcast modes, such as connectable (Connectable) mode or non-connectable (Non-connectable) mode, and determine whether to accept connection requests according to needs.

Scanning:

The central device (Central) starts scanning nearby BLE devices for devices of interest.

A scan consists of advertising packets received within a specific time window, which may contain a device's identity and other relevant data.

The central device can choose different scanning modes, such as active scanning (Active Scanning) or passive scanning (Passive Scanning).

Connection (Connection):

The central device selects a peripheral device to connect to and sends a connection request.

The peripheral device can accept or reject the connection after receiving the connection request.

If the connection request is accepted, the central device and the peripheral device establish a BLE connection and perform the necessary handshake process.

The handshake process includes negotiating connection parameters, such as connection interval, timeout value, data length, etc.

Once the connection is established, the central device and the peripheral device can perform bidirectional data transmission through the BLE channel, including reading and writing characteristic values (Characteristic).

After the connection is established, the BLE device can discover, read and write services and characteristic values through the GATT (Generic Attribute Profile) protocol. The BLE connection can also support Notification and Indication mechanisms, enabling a device to asynchronously send notifications of data updates to another device.

It should be noted that the specific steps and parameters in the BLE connection process can be configured and customized according to the role of the device (peripheral device or central device) and application requirements. In addition, the BLE connection process is also affected by the BLE protocol stack and device operating system, so there may be subtle differences in specific implementations.

0コメント

  • 1000 / 1000