Commit Graph
5169 Commits
Author SHA1 Message Date
Wang Meng Yang a5bea83f88 Merge branch 'bugfix/ai_review_a2dp_v5.2' into 'release/v5.2'
fix(bt): Fix the critical issues related to A2DP from AI review report (v5.2)

See merge request espressif/esp-idf!50132
2026-06-30 19:22:24 +08:00
Jiang Jiang Jian 2a981289a8 Merge branch 'bugfix/ai_review_btu_common_v5.2' into 'release/v5.2'
fix: Fix the critical issues of btu and bt_common from AI review report (v5.2)

See merge request espressif/esp-idf!50126
2026-06-30 12:27:24 +08:00
Island f0f8e1cf0a Merge branch 'bugfix/fix_bluedroid_static_random_conn_rpa_v5.2' into 'release/v5.2'
fix(ble/bluedroid): skip identity conversion for static random direct connect (5.2)

See merge request espressif/esp-idf!50081
2026-06-30 10:24:40 +08:00
Island be6f6afa4f Merge branch 'bugfix/fix_bluedroid_rpa_whitelist_conn_v5.2' into 'release/v5.2'
Fix connection failure when using RPA with whitelist filtering(ESP32) (5.2)

See merge request espressif/esp-idf!50087
2026-06-30 10:24:03 +08:00
Island e8f973bbfa Merge branch 'bugfix/always_init_dft_queue_in_nimble_host_v5.2' into 'release/v5.2'
fix(nimble): always init the default os queue for all of controllers (5.2)

See merge request espressif/esp-idf!48069
2026-06-29 17:58:58 +08:00
yangfeng fc2b420742 fix(bt): Fix the critical issues related to A2DP from AI review report
AVDT:
- Roll back CCB allocation when cmd/rsp queue creation fails
- Free media packet on invalid handle in AVDT_WriteReqOpt
- Zero-init timeout failure message before GETCAP callback
- Initialize lcid_tbl to 0xFF to avoid mapping to tc_tbl[0]
BTA/AVRCP:
- Use size_t for AVRC message copy buffer allocation
- Allocate before register in BTA_AvEnable
- Guard BTA_AvRegister callback when enable never completed
A2DP BTC/API:
- Default g_a2dp_on_deinit to true before profile init
- Add shutdown state check in btc_a2dp_sink_shutdown
- Guard A2DP source timer against freed dynamic local param
2026-06-29 15:17:40 +08:00
yangfeng 6e48173373 fix: Fix the critical issues of btu and bt_common from AI review report
- advance connect queue on synchronous connect_cb failure
- lock bta_alarm_hash_map in all BTA timer APIs
- free controller params after stack disable; cleanup on init fail
- handle BTE_InitStack failure and signal init future
- validate HCI remote name event length before parse
- drop stale L2CAP quick-timer alarm events
2026-06-29 14:49:41 +08:00
zhanghaipeng f6e1787e6a fix(bt): update ESP32 libbtdm_app.a to 4a0f94d5
- Fix connection failure when using RPA with whitelist filtering
- Fix disconnect with reason 0x08 during full scan
- Fix peer RPA resolution failure when advertising with a local identity address
2026-06-29 10:44:42 +08:00
Jin Cheng 3e1f6dea3c fix(bt/controller): fixed several BR/EDR controller bugs found by WVT regression tests on ESP32 2026-06-29 10:44:38 +08:00
Island 52d2ddcbd9 Merge branch 'feat/add_ble_core_6x_feature_for_bluedroid_v5.2' into 'release/v5.2'
Feat/add ble core 6x feature for bluedroid (5.2)

See merge request espressif/esp-idf!50049
2026-06-29 10:31:43 +08:00
Zhang Hai Peng 7be8f34b15 fix(ble/bluedroid): preserve HCI status on BLE 4.2 GAP failures
Return BTM_HCI_ERROR | hci_status from legacy BLE 4.2 GAP HCI command
paths instead of mapping failures to BTM_ILLEGAL_VALUE or
BTM_NO_RESOURCES. Add btm_ble_status_from_hci() helper and propagate
real status through scan start/stop completion callbacks.


(cherry picked from commit 47dd785a18)

Co-authored-by: zhanghaipeng <zhanghaipeng@espressif.com>
2026-06-26 20:24:43 +08:00
Zhang Hai Peng 43820cfb3a feat(ble/bluedroid): Optimize Bluedroid memory usage
- Delete unused device records (~356B each)


(cherry picked from commit 7d1c0e9a32)

Co-authored-by: zhanghaipeng <zhanghaipeng@espressif.com>
2026-06-26 20:24:21 +08:00
Zhang Hai Peng e78123abd6 fix(ble/bluedroid): cap Read By Type response length at ATT maximum
Read By Type Response Length is one octet (max 255). When MTU was
large enough to return a long characteristic value in one pair, the
server wrote (UINT8)(value_len + 2) and overflowed (e.g. 513 -> 1),
so the client rejected the PDU as GATT_INVALID_PDU (0x04).

Cap server value to 253 bytes per pair, clamp the length byte, and
continue long reads via Read Blob when the capped size is returned.


(cherry picked from commit 97905afccc)

Co-authored-by: zhanghaipeng <zhanghaipeng@espressif.com>
2026-06-26 20:24:05 +08:00
Zhang Hai Peng 38ae6a02f6 fix(ble/bluedroid): Fixed potential double Execute Write Response
(cherry picked from commit 0a93ccd3b3)

Co-authored-by: zhanghaipeng <zhanghaipeng@espressif.com>
2026-06-26 20:23:48 +08:00
Zhang Hai Peng 368c4e3535 fix(ble/bluedroid): preserve ATT error on prepare write completion
Skip prepare-write echo validation when the GATT stack reports a
non-success status. ATT Error Response carries no prepare-write echo
body (rsp_len=0), so the check incorrectly overwrote errors such as
GATT_INSUF_AUTHENTICATION (0x05) with GATT_INVALID_PDU (0x04).


(cherry picked from commit d5b9350d0f)

Co-authored-by: zhanghaipeng <zhanghaipeng@espressif.com>
2026-06-26 20:23:26 +08:00
Zhang Hai Peng 880d05ccfc fix(ble/bluedroid): unblock sync HCI cmd on Command Status error
Release the BLE sync semaphore and record HCI status when a
synchronous command is rejected via Command Status, since no
Command Complete event follows.


(cherry picked from commit 29ae92f4ef)

Co-authored-by: zhanghaipeng <zhanghaipeng@espressif.com>
2026-06-26 20:16:38 +08:00
Zhang Hai Peng 7a5d027ae1 fix(ble/bluedroid): set REQ_WAITING before GATTC service-change rediscovery
When service change cancels in-progress discovery, bta_gattc_disc_cmpl()
re-triggers discovery without marking auto_update as REQ_WAITING. If a
client command is queued in p_q_cmd, bta_gattc_start_discover() refuses
to restart and the command is never dispatched.


(cherry picked from commit 13926bb9bc)

Co-authored-by: zhanghaipeng <zhanghaipeng@espressif.com>
2026-06-26 20:16:20 +08:00
Zhang Hai Peng c214524419 fix(ble/bluedroid): report conn param update failure for unknown BD_ADDR
Route unknown BD_ADDR and other immediate failures through the existing
need_cb path so ESP_GAP_BLE_UPDATE_CONN_PARAMS_EVT is always delivered.


(cherry picked from commit f9eaeb5e84)

Co-authored-by: zhanghaipeng <zhanghaipeng@espressif.com>
2026-06-26 20:16:00 +08:00
Zhang Hai Peng 3f6fcd1e7a fix(ble/bluedroid): add context to GATTC reg-notify cache warning
Include client_if, handle, bd_addr, and server cache state in the
warning logged when notification registration skips handle validation.


(cherry picked from commit 1085a32be8)

Co-authored-by: zhanghaipeng <zhanghaipeng@espressif.com>
2026-06-26 20:15:59 +08:00
Zhang Hai Peng 81b8b92d20 fix(ble/bluedroid): return ESP_ERR_INVALID_ARG for invalid conn params
Return ESP_ERR_INVALID_ARG instead of ESP_FAIL when connection
parameter validation fails


(cherry picked from commit 6c53838e66)

Co-authored-by: zhanghaipeng <zhanghaipeng@espressif.com>
2026-06-26 20:15:58 +08:00
Zhang Hai Peng 7f3237091d fix(ble/bluedroid): reject adv data on legacy directed ext adv
(cherry picked from commit c339cec380)

Co-authored-by: zhanghaipeng <zhanghaipeng@espressif.com>
2026-06-26 20:15:42 +08:00
Zhang Hai Peng de86e2f994 fix(ble/bluedroid): skip identity conversion for static random direct connect
Do not rewrite static or non-resolvable random peer addresses to
identity type 0x03 when CONFIG_BT_BLE_RPA_SUPPORTED is enabled.


(cherry picked from commit 2ef10ef488)

Co-authored-by: zhanghaipeng <zhanghaipeng@espressif.com>
2026-06-26 20:15:23 +08:00
Jiang Jiang Jian e29f982062 Merge branch 'bugfix/ai_review_hfp_v5.2' into 'release/v5.2'
fix(bt): Fix the critical issues related to HFP from AI review report (v5.2)

See merge request espressif/esp-idf!50011
2026-06-26 14:05:35 +08:00
Island 97e4a56c24 Merge branch 'fix/reduce_acl_event_gaps_v5.2' into 'release/v5.2'
feat(ble): updated libble to 71d180a4 for esp32h4 and esp32s31 (5.2)

See merge request espressif/esp-idf!49588
2026-06-26 10:47:09 +08:00
ShenWeilong 586d5df8bd fix(ble): always init the default os queue for all of controllers 2026-06-26 10:37:18 +08:00
Zhi Wei Jian de98b13bbe feat(ble/bluedroid): add CS Security Requirements host support (Core 6.3)
(cherry picked from commit 919622c01c)

Co-authored-by: zhiweijian <zhiweijian@espressif.com>
2026-06-26 09:08:12 +08:00
Zhi Wei Jian 1d72f538b3 feat(ble/bluedroid): add LE UTP host support (Core 6.2)
(cherry picked from commit 3844e24207)

Co-authored-by: zhiweijian <zhiweijian@espressif.com>
2026-06-26 09:08:11 +08:00
Zhi Wei JianandCursor 8c40d4c674 feat(ble/bluedroid): add Shorter Connection Intervals host support (Core 6.2)
Co-authored-by: Cursor <cursoragent@cursor.com>


(cherry picked from commit 2a8a96d650)

Co-authored-by: zhiweijian <zhiweijian@espressif.com>
2026-06-26 09:08:10 +08:00
Zhi Wei Jian 9e84500383 feat(ble/bluedroid): add LL Extended Feature Set host support (Core 6.0)
(cherry picked from commit d568f2f151)

Co-authored-by: zhiweijian <zhiweijian@espressif.com>
2026-06-26 09:08:10 +08:00
Zhi Wei JianandCursor 99b4919243 feat(ble/bluedroid): add Frame Space Update host support (Core 6.0)
Co-authored-by: Cursor <cursoragent@cursor.com>


(cherry picked from commit 5372ce03a3)

Co-authored-by: zhiweijian <zhiweijian@espressif.com>
2026-06-26 09:08:09 +08:00
Zhi Wei Jian 46d84e0d43 feat(ble/bluedroid): add DBAF host support (Core 6.0)
(cherry picked from commit e20d3f0197)

Co-authored-by: zhiweijian <zhiweijian@espressif.com>
2026-06-26 09:08:08 +08:00
yangfeng b14b748d07 fix(bt): Fix the critical issues related to HFP from AI review report
HFP AG:
- Fix mSBC EV3 second-packet payload length calculation to prevent OOB read and infinite loop
- Add init/deinit guards in HF AG helper functions to avoid NULL deref
- Break SCO CI data loop when SCO is not open to prevent CPU starvation
- Guard BTM_FreeSCN(0) and reset SCN after free in bta_ag_del_records
- Use OI_UINT32 for mSBC decode frame length to avoid stack corruption
- Bound AT Dial command string copy to BTA_AG_AT_MAX_LEN
HFP Client:
- Use OI_UINT32 for mSBC decode frame length to avoid stack corruption
- Free SDP db, collision/AT timers and queued AT cmds before scb reset on disable
- Fix mSBC EV3 second-packet payload length calculation (same as AG)
- Reject pcm_resample input smaller than overlap window (96 bytes) on filtered path
- Break SCO CI data loop when SCO is not open to prevent CPU starvation
- Guard BTM_FreeSCN(0) and reset SCN after free in bta_hf_client_del_record
2026-06-25 14:30:24 +08:00
Jiang Jiang Jian 0468e5fe76 Merge branch 'bugfix/ag_unknown_codec_vv5.2' into 'release/v5.2'
fix(bt): skip unknown codecs when parsing AT+BAC(v5.2)

See merge request espressif/esp-idf!49838
2026-06-24 20:23:53 +08:00
Guo Zifan c18f7607f9 feat(ble_log): Add frame check support for restart flow
(cherry picked from commit a81322a2ce)

Co-authored-by: guozifan <guozifan@espressif.com>
2026-06-24 11:25:22 +08:00
Zhou Xiao 7bd84966e3 change(ble): [AUTO_MR] Update lib_esp32c2 to 750d4902
(cherry picked from commit 897f3b2af1)

Co-authored-by: Zhou Xiao <zhouxiao@espressif.com>
2026-06-23 15:27:16 +08:00
xiongweichao 46ca4c24f5 fix(bt): skip unknown codecs when parsing AT+BAC
Peers may report custom or non-standard codec UUIDs in AT+BAC alongside
CVSD/mSBC. Returning BTA_AG_CODEC_NONE on the first unknown entry
discarded already-parsed standard codecs. Log unknown UUIDs and continue
parsing so negotiated capabilities still reflect supported codecs.
2026-06-23 07:24:30 +00:00
Island b376d3c11d Merge branch 'fix/ble_mesh_bug_report_v2_v5.2' into 'release/v5.2'
fix(ble_mesh): Miscellaneous bugfixes according to our internal bug report (v2)

See merge request espressif/esp-idf!49320
2026-06-22 22:29:40 +08:00
Rahul Tank d5848c3a43 Merge branch 'feat/throughput_l2cap_coc_v5.2' into 'release/v5.2'
Added l2cap_coc example for throughput (v5.2)

See merge request espressif/esp-idf!49743
2026-06-22 19:47:01 +05:30
Astha Verma e08b2eefa6 fix(nimble): Added l2cap_coc throughput examples 2026-06-22 11:49:55 +05:30
Island 75a5c91e7a Merge branch 'feat/ble-smp-multi-adv-static-random-address_v5.2' into 'release/v5.2'
feat(ble/bluedroid): Add BLE SMP support for multi-ADV with static random addresses (5.2)

See merge request espressif/esp-idf!49785
2026-06-22 10:35:20 +08:00
Zhang Hai Peng b35182d6f2 feat(ble/bluedroid): Add BLE SMP support for multi-ADV with static random addresses
(cherry picked from commit 7986e2faa8)

Co-authored-by: zhanghaipeng <zhanghaipeng@espressif.com>
2026-06-18 10:24:45 +08:00
Rahul Tank d045ed9bb4 fix(nimble): Gaurd ble_hs_log_mbuf/flat_buf against non-DEBUG log level 2026-06-16 16:36:52 +05:30
Wang Meng Yang 8f58679ce4 Merge branch 'bugfix/bbp_isses_v5.2' into 'release/v5.2'
Bugfix/bbp isses v5.2

See merge request espressif/esp-idf!49628
2026-06-15 20:38:45 +08:00
Island 2ec1d4883d Merge branch 'fix/gattc-multi-app-notif-warning_v5.2' into 'release/v5.2'
fix(bt): Suppress gattc drop-notif warning for unregistered gatt_if (5.2)

See merge request espressif/esp-idf!49513
2026-06-15 15:08:08 +08:00
Island a3684e583c Merge branch 'bugfix/fix_bluedroid_ai_review_bugs_20260427_v5.2' into 'release/v5.2'
Bugfix/fix bluedroid ai review bugs 20260427 (5.2)

See merge request espressif/esp-idf!49537
2026-06-15 11:04:08 +08:00
Jin Cheng de369a5cfc fix(bt/bluedroid): added buffer length check for HID Device data indication 2026-06-12 18:47:38 +08:00
Jin Cheng f2b3536279 fix(bt/bluedroid): added validation for all SMP BR opcode lengths in smp_br_data_received 2026-06-12 18:47:38 +08:00
Jin Cheng 929c3e42ec fix(bt/bluedroid): fixed CTKD link key authentication downgrade in SC-Only mode 2026-06-12 18:47:38 +08:00
Jin Cheng a4e6fa2f42 fix(bt/bluedroid): added buffer length check for HID host data indication 2026-06-12 18:47:38 +08:00
Jin Cheng c2610255a5 fix(bt/bluedroid): added buffer length check for L2CAP related functions 2026-06-12 18:47:38 +08:00