Commit Graph

5829 Commits

Author SHA1 Message Date
ShenWeilong
ef702ca257 feat(ble): Updated libble to 6bbfb64 on ESP32-S31 and ESP32-H4 2026-07-01 21:06:50 +08:00
Jiang Jiang Jian
f71890ccec Merge branch 'bugfix/ai_review_btu_common_v6.1' into 'release/v6.1'
fix: Fix the critical issues of btu and bt_common from AI review report (v6.1)

See merge request espressif/esp-idf!50121
2026-06-30 17:37:34 +08:00
Jiang Jiang Jian
24d35f4c04 Merge branch 'bugfix/ai_review_a2dp_v6.1' into 'release/v6.1'
fix(bt): Fix the critical issues related to A2DP from AI review report (v6.1)

See merge request espressif/esp-idf!50127
2026-06-30 14:24:19 +08:00
Jiang Jiang Jian
8264c9589c Merge branch 'bugfix/fix_bluedroid_rpa_whitelist_conn_v6.1' into 'release/v6.1'
Fix connection failure when using RPA with whitelist filtering(ESP32) (6.1)

See merge request espressif/esp-idf!50092
2026-06-30 14:23:29 +08:00
Jiang Jiang Jian
b0cd9819ee Merge branch 'bugfix/fix_bluedroid_static_random_conn_rpa_v6.1' into 'release/v6.1'
fix(ble/bluedroid): skip identity conversion for static random direct connect (6.1)

See merge request espressif/esp-idf!50086
2026-06-30 14:23:18 +08:00
Jiang Jiang Jian
6e1ac00adb Merge branch 'feat/add_ble_core_6x_feature_for_bluedroid_v6.1' into 'release/v6.1'
Feat/add ble core 6x feature for bluedroid (6.1)

See merge request espressif/esp-idf!50054
2026-06-30 14:21:41 +08:00
Jiang Jiang Jian
7219860f52 Merge branch 'bugfix/ai_review_avrcp_v6.1' into 'release/v6.1'
fix(bt): Fix the critical and high issues related to AVRCP from AI review report (v6.1)

See merge request espressif/esp-idf!50019
2026-06-30 14:20:16 +08:00
Jiang Jiang Jian
e2a7c8b36c Merge branch 'bugfix/ai_review_hfp_v6.1' into 'release/v6.1'
fix(bt): Fix the critical issues related to HFP from AI review report (v6.1)

See merge request espressif/esp-idf!50006
2026-06-30 14:19:53 +08:00
Jiang Jiang Jian
74402d2c43 Merge branch 'feat/spi_log_qa_frame_check_v6.1' into 'release/v6.1'
feat(ble_log): add FINAL_STAT session-end frame and flush hook before controller restart (6.1)

See merge request espressif/esp-idf!49959
2026-06-30 14:18:54 +08:00
Jiang Jiang Jian
6d69cde133 Merge branch 'bugfix/ag_unknown_codec_v6.1' into 'release/v6.1'
fix(bt): skip unknown codecs when parsing AT+BAC(v6.1)

See merge request espressif/esp-idf!49839
2026-06-30 14:16:32 +08:00
Jiang Jiang Jian
9d36edbe30 Merge branch 'feat/ble-smp-multi-adv-static-random-address_v6.1' into 'release/v6.1'
feat(ble/bluedroid): Add BLE SMP support for multi-ADV with static random addresses (6.1)

See merge request espressif/esp-idf!49790
2026-06-30 14:15:32 +08:00
Jiang Jiang Jian
03f0364c0c Merge branch 'idf/ble_audio_mcc_fixes_v6.1' into 'release/v6.1'
fix(ble_audio): Fix mcc read may enter BUSY state while multiple notifications are received (v6.1)

See merge request espressif/esp-idf!49776
2026-06-30 14:15:10 +08:00
Jiang Jiang Jian
f1a8184bfa Merge branch 'bugfix/bbp_isses_v6.1' into 'release/v6.1'
Bugfix/bbp isses v6.1

See merge request espressif/esp-idf!49623
2026-06-30 14:11:03 +08:00
Jiang Jiang Jian
2841ad761e Merge branch 'fix/add_remaining_vars_to_heap_v6.1' into 'release/v6.1'
fix(nimble): Change remaining vars from Static to Dynamic (v6.1)

See merge request espressif/esp-idf!49279
2026-06-30 14:02:41 +08:00
yangfeng
9517a7b93b 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
- Reject source audio send when A2DP is deiniting
- Add shutdown state check in btc_a2dp_sink_shutdown
- Guard A2DP source timer against freed dynamic local param
2026-06-29 14:57:22 +08:00
yangfeng
57f28af482 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:45:46 +08:00
zhanghaipeng
c69d150565 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:38:51 +08:00
Jin Cheng
e44fcbd35f fix(bt/controller): fixed several BR/EDR controller bugs found by WVT regression tests on ESP32 2026-06-29 10:38:34 +08:00
Zhang Hai Peng
59a740ca12 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:54 +08:00
Zhang Hai Peng
e9fce74445 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:34 +08:00
Zhang Hai Peng
7b2b31bb0d 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:16 +08:00
Zhang Hai Peng
54e7b74cc1 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:59 +08:00
Zhang Hai Peng
f00c216ce2 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:38 +08:00
Zhang Hai Peng
4bf3d52183 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:49 +08:00
Zhang Hai Peng
fab51c7925 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:32 +08:00
Zhang Hai Peng
50c719356c 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:14 +08:00
Zhang Hai Peng
95c5099ed9 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:14 +08:00
Zhang Hai Peng
feb1da9239 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:13 +08:00
Zhang Hai Peng
003a4007e5 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:54 +08:00
Zhang Hai Peng
2f8c3b6c1a 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:35 +08:00
Zhi Wei Jian
85d364da14 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:36 +08:00
Zhi Wei Jian
9a6f769a45 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:35 +08:00
Zhi Wei Jian
ecc48e1450 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:35 +08:00
Zhi Wei Jian
8a8727cfba 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:34 +08:00
Zhi Wei Jian
fcba9face2 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:34 +08:00
Zhi Wei Jian
92328f276e 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:33 +08:00
yangfeng
ce898faf35 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:42:06 +08:00
yangfeng
37b55f4ca5 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:42:06 +08:00
yangfeng
6c3b30a9d9 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
- Return bt_status_t from btc_hf_ag_audio_data_send to avoid silent buffer leak on SLC failure
- 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:
- Check osi_calloc result before use when reassembling split mSBC frames
- 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 11:58:38 +08:00
Guo Zifan
2ee0c43f25 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:33 +08:00
xiongweichao
24c1362022 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:23:02 +00:00
Jiang Jiang Jian
c039510b18 Merge branch 'change/ble_update_lib_20260612_v6.1' into 'release/v6.1'
change(ble): [AUTO_MR] 20260612 - Update ESP BLE Controller Lib (6.1)

See merge request espressif/esp-idf!49611
2026-06-23 14:46:22 +08:00
Zhang Hai Peng
7b924ab605 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:55 +08:00
Liu Linyan
759c564b73 fix(ble_audio): Fix mcc read may enter BUSY state while multiple notifications are received 2026-06-17 19:22:48 +08:00
Jin Cheng
3be52f9d46 fix(bt/bluedroid): added buffer length check for OBEX APIs 2026-06-17 07:23:59 +08:00
Jin Cheng
10eb7df430 fix(bt/bluedroid): added buffer length check for HID Device data indication 2026-06-17 07:23:59 +08:00
Jin Cheng
ad84fe5f87 fix(bt/bluedroid): added validation for all SMP BR opcode lengths in smp_br_data_received 2026-06-17 07:23:59 +08:00
Jin Cheng
964dec2081 fix(bt/bluedroid): fixed CTKD link key authentication downgrade in SC-Only mode 2026-06-17 07:23:59 +08:00
Jin Cheng
ed980ec113 fix(bt/bluedroid): added buffer length check for HID host data indication 2026-06-17 07:23:59 +08:00
Jin Cheng
14c99559b4 fix(bt/bluedroid): added buffer length check for L2CAP related functions 2026-06-17 07:23:59 +08:00