Merge branch 'feat/support_pan_bnep' into 'master'

feat(bt/bluedroid): support Classic Bluetooth PAN profile

See merge request espressif/esp-idf!50641
This commit is contained in:
Wang Meng Yang
2026-08-18 17:38:59 +08:00
66 changed files with 12863 additions and 8 deletions

View File

@@ -96,6 +96,7 @@ CLASSIC_BT_DOCS = [
'api-reference/bluetooth/esp_hf_client.rst',
'api-reference/bluetooth/esp_hf_ag.rst',
'api-reference/bluetooth/esp_spp.rst',
'api-reference/bluetooth/esp_pan.rst',
'api-reference/bluetooth/esp_gap_bt.rst',
'migration-guides/release-5.x/5.0/bluetooth-classic.rst',
'migration-guides/release-5.x/5.2/bluetooth-classic.rst',

View File

@@ -99,6 +99,7 @@ INPUT = \
$(PROJECT_PATH)/components/bt/host/bluedroid/api/include/api/esp_hidd_api.h \
$(PROJECT_PATH)/components/bt/host/bluedroid/api/include/api/esp_hidh_api.h \
$(PROJECT_PATH)/components/bt/host/bluedroid/api/include/api/esp_l2cap_bt_api.h \
$(PROJECT_PATH)/components/bt/host/bluedroid/api/include/api/esp_pan_api.h \
$(PROJECT_PATH)/components/bt/host/bluedroid/api/include/api/esp_sdp_api.h \
$(PROJECT_PATH)/components/bt/host/bluedroid/api/include/api/esp_spp_api.h \
$(PROJECT_PATH)/components/bt/host/nimble/esp-hci/include/esp_nimble_hci.h \

View File

@@ -13,6 +13,7 @@ The Bluetooth Classic API provides the following main features:
- Media playback control (**AVRCP**)
- Hands-free calling support (**HFP**)
- Input device connectivity (**HID** host and device roles)
- Personal Area Networking (**PAN**)
----
@@ -59,6 +60,10 @@ The Bluetooth Classic API in ESP-IDF is organized into the following parts:
- :doc:`Bluetooth HID Device <esp_hidd>`: Implements peripheral roles such as keyboard, mouse, or game controller
- :doc:`Bluetooth HID Host <esp_hidh>`: Implements the host role for connecting to remote HID devices
**Personal Area Networking (PAN)**
- :doc:`Bluetooth PAN <esp_pan>`: BNEP-based networking with PANU, NAP, and GN roles
Each part typically includes an **Overview**, **Application Examples**, and **API Reference**, covering purpose, main functionality, sample usage, and detailed API documentation.
@@ -77,3 +82,4 @@ Each part typically includes an **Overview**, **Application Examples**, and **AP
Bluetooth HFP AG <esp_hf_ag>
Bluetooth HID Device <esp_hidd>
Bluetooth HID Host <esp_hidh>
Bluetooth PAN <esp_pan>

View File

@@ -0,0 +1,23 @@
Bluetooth® PAN API
==================
:link_to_translation:`zh_CN:[中文]`
Overview
--------
PAN (Personal Area Networking) enables IP networking over Classic Bluetooth using BNEP (Bluetooth Network Encapsulation Protocol). Devices can act as a PAN User (PANU), Group Network (GN) hub, or Network Access Point (NAP) so peers can exchange Ethernet frames and obtain network access.
Application Examples
--------------------
- :example:`bluetooth/bluedroid/classic_bt/bt_pan_nap` demonstrates how to use the PAN Network Access Point (NAP) role so that PANU peers can reach the Internet through the ESP device's Wi-Fi STA uplink.
- :example:`bluetooth/bluedroid/classic_bt/bt_pan_panu` demonstrates how to use the PAN User (PANU) role to connect to a NAP (for example ``bt_pan_nap`` or a phone with Bluetooth tethering) and verify IP connectivity.
- :example:`bluetooth/bluedroid/classic_bt/bt_pan_gn` demonstrates how to use the PAN Group Network (GN) role as a hub that bridges multiple PANU clients so they can communicate on the same subnet.
API Reference
-------------
.. include-build-file:: inc/esp_pan_api.inc

View File

@@ -13,6 +13,7 @@
- 媒体播放控制 (**AVRCP**)
- 免提通话支持 (**HFP**)
- 输入设备连接 **HID** 主机和外设角色)
- 个人区域网络 (**PAN**)
----
@@ -59,6 +60,10 @@
- :doc:`Bluetooth HID Device <esp_hidd>`:实现外设角色,如键盘、鼠标或游戏手柄
- :doc:`Bluetooth HID Host <esp_hidh>`:实现主机角色,用于连接远程 HID 外设
**个人区域网络 (PAN)**
- :doc:`Bluetooth PAN <esp_pan>`:基于 BNEP 的组网,支持 PANU、NAP 和 GN 角色
每个部分通常包含 **概述****应用示例****API 参考**,涵盖用途、主要功能、示例用法及详细 API 文档。
@@ -77,3 +82,4 @@
Bluetooth HFP AG <esp_hf_ag>
Bluetooth HID Device <esp_hidd>
Bluetooth HID Host <esp_hidh>
Bluetooth PAN <esp_pan>

View File

@@ -0,0 +1,23 @@
蓝牙\ :sup:`®` PAN API
======================
:link_to_translation:`en:[English]`
概述
----
PANPersonal Area Networking个人区域网络通过 BNEPBluetooth Network Encapsulation Protocol蓝牙网络封装协议在经典蓝牙上实现 IP 组网。设备可作为 PAN 用户PANU、组网中心GN或网络接入点NAP使对端设备能够交换以太网帧并获得网络访问。
应用示例
--------
- :example:`bluetooth/bluedroid/classic_bt/bt_pan_nap` 演示如何使用 PAN 网络接入点NAP角色使 PANU 对端可通过 ESP 设备的 Wi-Fi STA 上行链路访问互联网。
- :example:`bluetooth/bluedroid/classic_bt/bt_pan_panu` 演示如何使用 PAN 用户PANU角色连接 NAP例如 ``bt_pan_nap`` 或开启蓝牙网络共享的手机),并验证 IP 连通性。
- :example:`bluetooth/bluedroid/classic_bt/bt_pan_gn` 演示如何使用 PAN 组网GN角色作为中枢桥接多个 PANU 客户端,使其能在同一子网内通信。
API 参考
--------
.. include-build-file:: inc/esp_pan_api.inc