Bluetooth Overview

BT Basic Architecture

The Bluetooth system is divided into three parts: BT Host, HCI (Host Controller Interface), and BT Controller:

Module

Description

BT Host

Application

Contains Bluetooth APIs and the applications built upon them, including Peripheral, Central, Scatternet, Mesh, A2DP, LE Audio, and others

Framework

Includes the following libs:

  • LE audio lib: \component\bluetooth\rtk_stack\platform\amebaxxx\lib\(km4\kr4\ca32)\leaudio.a

  • BLE mgr lib: \component\bluetooth\rtk_stack\platform\amebaxxx\lib\(km4\kr4\ca32)\ble_mgr.a

  • BT mgr lib: \component\bluetooth\rtk_stack\platform\amebaxxx\lib\(km4\kr4\ca32)\bt_mgr.a

  • system lib: \component\bluetooth\rtk_stack\platform\amebaxxx\lib\(km4\kr4\ca32)\sysm.a

The purpose of every lib:

  • LE audio lib & BLE mgr lib: implement BAP CAP and BLE profile required by LE audio

  • BT mgr lib: implements BR/EDR profile

  • system lib: provides various system-related functionalities

Host stack

lib path: \component\bluetooth\rtk_stack\platform\amebaxxx\lib\(km4\kr4\ca32)\(ble_only\dual_mode)\btgap.a

Implements the functions of the upper layers of the Bluetooth protocol stack, including GAP, GATT, L2CAP, ATT, SMP, and others

HCI

The only communication interface between the Controller and the Host, and all data interactions between them are carried out through this interface

BT Controller

lib path: \component\bluetooth\driver\platform\amebaxxx\hci\bt_normal_patch.c

Provided as a binary array, and implements the functions of the lower layers of the Bluetooth protocol stack, including the Link Layer, PHY, and others

The architecture of Bluetooth is illustrated below:

../../_images/bt_architecture.svg

BT Feature Supported

Item Feature Supported
Physical BR/EDR /
BLE
BLE 4.0 Advertiser
Scanner
Initiator
Master
Slave
Link Layer Encryption
BLE Max. Link (Theoretical value) 8 Master + 3 Slave
BLE 4.1 Low Duty Cycle Directed Advertising
MWS Coexistence /
LE Ping
LE Link Layer Topology
LE Scatternet
BLE 4.2 LE Data Length Extension
LE Secure Connection
Link Layer Privacy
Link Layer Extended Scanner Filter Policies
BLE 5.0 LE 2Mbps PHY
LE Long Range
LE Advertising Extensions
LE Channel Selection Algorithm #2
High Duty Cycle Non-Connectable Advertising
LE Periodic Advertising /

BT Feature Configuration

Function

Configuration file

Configuration parameter

Link Layer Privacy

Taking Peripheral as an example:

\component\bluetooth\example\ble_peripheral\peripheral.c

Set privacy_enable to true

LE Advertising Extensions

\component\bluetooth\api\include\bt_api_config.h

Set RTK_BLE_5_0_AE_ADV_SUPPORT and RTK_BLE_5_0_AE_SCAN_SUPPORT to 1

LE Periodic Advertising

\component\bluetooth\api\include\bt_api_config.h

Set the corresponding SoC’s RTK_BLE_5_0_AE_ADV_SUPPORT, RTK_BLE_5_0_AE_SCAN_SUPPORT, RTK_BLE_5_0_PA_ADV_SUPPORT and RTK_BLE_5_0_PA_SYNC_SUPPORT to 1

Periodic Advertising Sync Transfer (PAST)

\component\bluetooth\api\include\bt_api_config.h

Set the corresponding SoC’s RTK_BLE_5_0_AE_ADV_SUPPORT, RTK_BLE_5_0_AE_SCAN_SUPPORT, RTK_BLE_5_0_PA_ADV_SUPPORT, RTK_BLE_5_0_PA_SYNC_SUPPORT,

RTK_BLE_5_1_PAST_SENDER_SUPPORT and RTK_BLE_5_1_PAST_RECIPIENT_SUPPORT to 1

SMP OOB

\component\bluetooth\api\include\bt_api_config.h

Enabled by default, set RTK_BLE_SMP_OOB_SUPPORT to 0 to disable it

LE Data Length Extension

\component\bluetooth\api\include\bt_api_config.h

Enabled by default, set RTK_BLE_4_2_DATA_LEN_EXT_SUPPORT to 0 to disable it

SET PHYS

\component\bluetooth\api\include\bt_api_config.h

Enabled by default, set RTK_BLE_5_0_SET_PHYS_SUPPORT to 0 to disable it

LE Power Control

\component\bluetooth\api\include\bt_api_config.h

Set RTK_BLE_5_2_POWER_CONTROL_SUPPORT to 1

EATT

\component\bluetooth\api\include\bt_api_config.h

Set RTK_BT_5_2_EATT_SUPPORT to 1