Commit Graph

5442 Commits

Author SHA1 Message Date
Zhou Xiao
8d3d04c60a change(ble): [AUTO_MR] Update lib_esp32h2 to a6519790
(cherry picked from commit 8a744e8e93)

Co-authored-by: Zhou Xiao <zhouxiao@espressif.com>
2026-07-01 10:35:28 +08:00
Wang Meng Yang
1ce3dfb50c Merge branch 'bugfix/ai_review_btu_common_v5.4' into 'release/v5.4'
fix: Fix the critical issues of btu and bt_common from AI review report (v5.4)

See merge request espressif/esp-idf!50124
2026-06-30 19:24:27 +08:00
Wang Meng Yang
d3d0963239 Merge branch 'bugfix/ai_review_a2dp_v5.4' into 'release/v5.4'
fix(bt): Fix the critical issues related to A2DP from AI review report (v5.4)

See merge request espressif/esp-idf!50130
2026-06-30 19:23:54 +08:00
Island
416cd10dd5 Merge branch 'bugfix/fix_bluedroid_static_random_conn_rpa_v5.4' into 'release/v5.4'
fix(ble/bluedroid): skip identity conversion for static random direct connect (5.4)

See merge request espressif/esp-idf!50083
2026-06-30 10:24:53 +08:00
Island
6d69f146be Merge branch 'bugfix/fix_bluedroid_rpa_whitelist_conn_v5.4' into 'release/v5.4'
Fix connection failure when using RPA with whitelist filtering(ESP32) (5.4)

See merge request espressif/esp-idf!50089
2026-06-30 10:23:14 +08:00
yangfeng
f164a75569 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
- Remove invalid free of inline Cover Art image_descriptor
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:06:38 +08:00
yangfeng
3437c34c17 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:19 +08:00
Rahul Tank
5770e5bb97 Merge branch 'bugfix/fix_gatt_crash_v5.4' into 'release/v5.4'
fix(nimble): Add npl locks to avoid race condition (v5.4)

See merge request espressif/esp-idf!50068
2026-06-29 10:23:00 +05:30
zhanghaipeng
fac1e10fb8 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:43:14 +08:00
Jin Cheng
e2ddb61266 fix(bt/controller): fixed several BR/EDR controller bugs found by WVT regression tests on ESP32 2026-06-29 10:43:10 +08:00
Zhi Wei Jian
1b340fe82b 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 20:37:44 +08:00
Zhi Wei Jian
aed8603a42 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 20:37:44 +08:00
Zhi Wei Jian
661e297e87 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 20:37:44 +08:00
Zhi Wei Jian
c72a639097 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 20:37:44 +08:00
Zhi Wei Jian
4812d74f48 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 20:37:44 +08:00
Zhi Wei Jian
5cff20ac8f 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 20:37:44 +08:00
Zhang Hai Peng
ae071465e5 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:48 +08:00
Zhang Hai Peng
6d33df6d6b 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:27 +08:00
Zhang Hai Peng
d70c7c117b 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:09 +08:00
Zhang Hai Peng
af18806c6a 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:52 +08:00
Zhang Hai Peng
e3adb11acf 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:31 +08:00
Zhang Hai Peng
4e8432580a 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:43 +08:00
Zhang Hai Peng
989a673a6f 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:25 +08:00
Zhang Hai Peng
91db334490 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:07 +08:00
Zhang Hai Peng
ff8df1d5df 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:16:06 +08:00
Zhang Hai Peng
3017a78c1a 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:16:06 +08:00
Zhang Hai Peng
865a25c05a 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:47 +08:00
Zhang Hai Peng
debbf336f4 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:28 +08:00
Sumeet Singh
384ebee8d9 fix(nimble): Add npl locks to avoid race condition (v5.4) 2026-06-26 12:26:50 +05:30
Jiang Jiang Jian
2a082e4815 Merge branch 'bugfix/ai_review_hfp_v5.4' into 'release/v5.4'
fix(bt): Fix the critical issues related to HFP from AI review report (v5.4)

See merge request espressif/esp-idf!50009
2026-06-26 14:08:19 +08:00
Jiang Jiang Jian
b9ce92430f Merge branch 'bugfix/ai_review_avrcp_v5.4' into 'release/v5.4'
fix(bt): Fix the critical and high issues related to AVRCP from AI review report (v5.4)

See merge request espressif/esp-idf!50022
2026-06-26 14:07:59 +08:00
Island
72dfea0762 Merge branch 'fix/reduce_acl_event_gaps_v5.4' into 'release/v5.4'
feat(ble): updated libble to 71d180a4 for esp32h4 and esp32s31 (5.4)

See merge request espressif/esp-idf!49590
2026-06-26 10:47:14 +08:00
yangfeng
2184fae05b fix(bt): Fix the high issues related to AVRCP from AI review report
- SDP/registration: handle SDP record creation and discovery failures safely
- AVRC stack: fix packet checks, fragment leaks, response build, and compile guards
- BTC AVRCP: fix return codes, connection state, metadata parsing, and memory leaks
- AVCTP: fix event passing, L2CAP conflicts, TX queue leaks, and disconnect handling
- Example: remove TG RN capability setup before initialization
2026-06-25 14:58:17 +08:00
yangfeng
6c34f8140d fix(bt): Fix the critical issues related to AVRCP from AI review report
- recalculate len_left per attribute in avrc_bld_app_setting_text_rsp
- abort fragmented message reassembly when reassembly buffer alloc fails
2026-06-25 14:52:36 +08:00
yangfeng
8f4c343386 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:25:13 +08:00
Guo Zifan
a25fac6c71 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:26 +08:00
Island
9b35fc0e81 Merge branch 'change/ble_update_lib_20260612_v5.4' into 'release/v5.4'
change(ble): [AUTO_MR] 20260612 - Update ESP BLE Controller Lib (5.4)

See merge request espressif/esp-idf!49608
2026-06-24 10:45:17 +08:00
Island
e8270cddc6 Merge branch 'fix/ble_mesh_bug_report_v2_v5.4' into 'release/v5.4'
fix(ble_mesh): Miscellaneous bugfixes according to our internal bug report (v2)

See merge request espressif/esp-idf!49318
2026-06-22 22:29:32 +08:00
Rahul Tank
0a4dbf5d72 Merge branch 'feat/throughput_l2cap_coc_v5.4' into 'release/v5.4'
Added l2cap_coc example for throughput (v5.4)

See merge request espressif/esp-idf!49741
2026-06-22 19:40:58 +05:30
Astha Verma
94863a7628 fix(nimble): Added l2cap_coc throughput examples 2026-06-22 11:41:14 +05:30
xiongweichao
bc3456c66b 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-22 11:13:42 +08:00
Island
aa222369e7 Merge branch 'feat/ble-smp-multi-adv-static-random-address_v5.4' into 'release/v5.4'
feat(ble/bluedroid): Add BLE SMP support for multi-ADV with static random addresses (5.4)

See merge request espressif/esp-idf!49787
2026-06-22 10:35:26 +08:00
Zhang Hai Peng
68e37183f1 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:49 +08:00
Rahul Tank
3637cfd331 fix(nimble): Gaurd ble_hs_log_mbuf/flat_buf against non-DEBUG log level 2026-06-16 16:29:09 +05:30
Island
e155d443ad Merge branch 'fix/gattc-multi-app-notif-warning_v5.4' into 'release/v5.4'
fix(bt): Suppress gattc drop-notif warning for unregistered gatt_if (5.4)

See merge request espressif/esp-idf!49515
2026-06-15 15:08:20 +08:00
Wang Meng Yang
c4f758d14d Merge branch 'bugfix/bbp_isses_v5.4' into 'release/v5.4'
Bugfix/bbp isses v5.4

See merge request espressif/esp-idf!49626
2026-06-15 12:57:48 +08:00
Island
2b89a2ec22 Merge branch 'bugfix/fix_bluedroid_ai_review_bugs_20260427_v5.4' into 'release/v5.4'
Bugfix/fix bluedroid ai review bugs 20260427 (5.4)

See merge request espressif/esp-idf!49539
2026-06-15 11:04:00 +08:00
Jin Cheng
852a3545d1 fix(bt/bluedroid): added buffer length check for OBEX APIs 2026-06-12 18:44:19 +08:00
Jin Cheng
cc3478275e fix(bt/bluedroid): added buffer length check for HID Device data indication 2026-06-12 18:40:06 +08:00
Jin Cheng
e7d62574f3 fix(bt/bluedroid): added validation for all SMP BR opcode lengths in smp_br_data_received 2026-06-12 18:40:06 +08:00