Skip to content

Commit

Permalink
Merge branch 'feat/add_ble_hci' into 'master'
Browse files Browse the repository at this point in the history
feat(ble): support ble hci components

See merge request ae_group/esp-iot-solution!1036
  • Loading branch information
loop233 committed Jul 9, 2024
2 parents 593e59b + 0bca683 commit 81c784a
Show file tree
Hide file tree
Showing 24 changed files with 1,516 additions and 3 deletions.
11 changes: 11 additions & 0 deletions .gitlab/ci/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -783,6 +783,17 @@ build_example_utilities_xz_decompress_file:
variables:
EXAMPLE_DIR: examples/utilities/xz_decompress_file


build_components_bluetooth_ble_hci_test_apps:
extends:
- .build_examples_template
- .rules:build:components_bluetooth_ble_hci_test_apps
parallel:
matrix:
- IMAGE: espressif/idf:release-v5.2
variables:
EXAMPLE_DIR: components/bluetooth/ble_hci/test_apps

build_components_button_test_apps:
extends:
- .build_examples_template
Expand Down
16 changes: 16 additions & 0 deletions .gitlab/ci/rules.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,10 @@
- "components/bluetooth/ble_services/**/*"
- "components/tools/cmake_utilities/package_manager.cmake"

.patterns-components_bluetooth_ble_hci: &patterns-components_bluetooth_ble_hci
- "components/bluetooth/ble_hci/**/*"
- "components/tools/cmake_utilities/package_manager.cmake"

.patterns-components_bootloader_support_plus: &patterns-components_bootloader_support_plus
- "components/bootloader_support_plus/**/*"
- "components/utilities/xz/**/*"
Expand Down Expand Up @@ -293,6 +297,7 @@
- "components/audio/dac_audio/include/dac_audio.h"
- "components/audio/pwm_audio/include/pwm_audio.h"
- "components/bluetooth/ble_conn_mgr/include/esp_ble_conn_mgr.h"
- "components/bluetooth/ble_hci/include/ble_hci.h"
- "components/bus/include/spi_bus.h"
- "components/button/include/iot_button.h"
- "components/display/screen/interface_driver/scr_interface_driver.h"
Expand Down Expand Up @@ -1364,6 +1369,17 @@
- <<: *if-dev-push
changes: *patterns-components_audio_pwm_audio

.rules:build:components_bluetooth_ble_hci_test_apps:
rules:
- <<: *if-protected
- <<: *if-label-build
- <<: *if-label-target_test
- <<: *if-trigger-job
- <<: *if-dev-push
changes: *patterns-build_system
- <<: *if-dev-push
changes: *patterns-components_bluetooth_ble_hci

.rules:build:component_bus_test:
rules:
- <<: *if-protected
Expand Down
4 changes: 4 additions & 0 deletions components/.build-rules.yml
Original file line number Diff line number Diff line change
Expand Up @@ -141,3 +141,7 @@ components/usb/usb_device_uac/test_apps:
components/sensors/power_monitor/ina236/test_apps:
enable:
- if: INCLUDE_DEFAULT == 1

components/bluetooth/ble_hci/test_apps:
enable:
- if: IDF_TARGET in ["esp32","esp32c3","esp32s3"]
7 changes: 7 additions & 0 deletions components/bluetooth/ble_hci/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# ChangeLog

## v1.0.0 - 2024-5-30

First release version.

- Support ble hci
5 changes: 5 additions & 0 deletions components/bluetooth/ble_hci/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
idf_component_register(SRCS "bt_hci_common.c" "ble_hci.c"
INCLUDE_DIRS "include"
PRIV_INCLUDE_DIRS "priv_include"
REQUIRES bt
)
28 changes: 28 additions & 0 deletions components/bluetooth/ble_hci/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# BLE HCI Component
[中文版](./README_CN.md)

[![Component Registry](https://components.espressif.com/components/espressif/ble_hci/badge.svg)](https://components.espressif.com/components/espressif/ble_hci)

- [User Guide](https://docs.espressif.com/projects/esp-iot-solution/en/latest/bluetooth/ble_hci.html)

The ``ble_hci`` is used to operate the BLE Controller directly through the VHCI interface to realize broadcasting, scanning and other functions.

Compared to initiating broadcasts and scans through the Nimble or Bluedroid stacks, using this component has the following advantages:
- Smaller memory footprint
- Smaller firmware size
- Faster initialization process

## List of supported commands

- Send broadcast packets
- Scan broadcast packets
- Add/Remove whitelist
- Set local address

## Adding the component to your project

To add the `ble_hci` to your project's dependencies, please use the command `idf.py add-dependency`. During the `CMake` step, the component will be downloaded automatically.

```
idf.py add-dependency "espressif/ble_hci=*"
```
17 changes: 17 additions & 0 deletions components/bluetooth/ble_hci/README_CN.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# BLE HCI 组件

[![Component Registry](https://components.espressif.com/components/espressif/ble_hci/badge.svg)](https://components.espressif.com/components/espressif/ble_hci)

- [User Guide](https://docs.espressif.com/projects/esp-iot-solution/zh_CN/latest/bluetooth/ble_hci.html)

BLE HCI 组件用于通过 VHCI 接口直接操作 BLE Controller 实现广播,扫描等功能。
相比于通过 Nimble 或 Bluedroid 协议栈发起广播和扫描,使用该组件有如下优点:
- 更少的内存占用
- 更小的固件尺寸
- 更快的初始化流程

## 支持指令列表
- 发送广播包
- 扫描广播包
- 白名单
- 设置本地地址
Loading

0 comments on commit 81c784a

Please sign in to comment.