Commit Graph
2035 Commits
Author SHA1 Message Date
Island 518eabeb7d Merge branch 'bugfix/fix_bluedroid_static_random_conn_rpa_v6.0' into 'release/v6.0'
fix(ble/bluedroid): skip identity conversion for static random direct connect (6.0)

See merge request espressif/esp-idf!50085
2026-06-30 10:24:28 +08:00
Rahul Tank cd0ad239a6 Merge branch 'bugfix/nimble_issues_02062026_v6.0' into 'release/v6.0'
fix(nimble):  Fix few nimble issues 02062026 (v6.0)

See merge request espressif/esp-idf!49153
2026-06-29 21:52:48 +05:30
Zhang Hai Peng af02bd9018 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-29 19:04:29 +08:00
Zhang Hai Peng add48e6f2c 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-29 19:04:29 +08:00
Zhang Hai Peng b13f63fd7f 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-29 19:04:29 +08:00
Zhang Hai Peng 0217c922fe 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-29 19:04:29 +08:00
Zhang Hai Peng a8ee33b38f 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-29 19:04:29 +08:00
Zhang Hai Peng 005e8029a9 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-29 19:04:29 +08:00
Zhang Hai Peng ad3a325cc9 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-29 19:04:29 +08:00
Zhang Hai Peng 50b98393c6 fix(ble/bluedroid): Fixed potential double Execute Write Response
(cherry picked from commit 0a93ccd3b3)

Co-authored-by: zhanghaipeng <zhanghaipeng@espressif.com>
2026-06-29 19:04:29 +08:00
Zhang Hai Peng be3b2cf56b 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-29 19:04:29 +08:00
Zhang Hai Peng 78f1bd2ccf 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-29 19:04:29 +08:00
Zhang Hai Peng 702972227d 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-29 19:04:29 +08:00
Zhang Hai Peng 3a0344e321 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-29 19:04:29 +08:00
Sumeet Singh 5dfb38a6d3 fix(nimble): Add npl locks to avoid race condition (v6.0) 2026-06-29 15:45:00 +05:30
Astha Verma b0f278ec19 fix(nimble): Added l2cap_coc throughput examples 2026-06-29 15:41:54 +05:30
Rahul Tank 13ce6692eb fix(nimble): Gaurd ble_hs_log_mbuf/flat_buf against non-DEBUG log level 2026-06-29 15:38:45 +05:30
Island 0ced163703 Merge branch 'feat/add_ble_core_6x_feature_for_bluedroid_v6.0' into 'release/v6.0'
Feat/add ble core 6x feature for bluedroid (6.0)

See merge request espressif/esp-idf!50053
2026-06-29 17:59:32 +08:00
Sumeet Singh dbe2e860da fix(nimble): Change remaining vars from Static to Dynamic (v6.0) 2026-06-29 15:25:37 +05:30
Rahul Tank f783d3a7eb fix(nimble): Deinit NimBLE stop event in host task 2026-06-29 15:25:37 +05:30
Rahul Tank 609ad13324 fix(nimble): Fix for clang compilation issues 2026-06-29 15:25:37 +05:30
Rahul Tank b633c5e2a5 fix(nimble): Add support for shorter connection intervals 2026-06-29 15:25:37 +05:30
Rahul Tank b2ab997d3f fix(nimble): Fix compilation issues in Gatt SPS service 2026-06-29 15:25:37 +05:30
Rahul Tank 3b270b8c67 fix(nimble): Remove extra/unwanted prints 2026-06-29 15:25:36 +05:30
Mayank Tyagi 562a32ba46 fix(nimble): Avoid deadlock caused by local writes taking s_hidd_mutex 2026-06-29 15:25:36 +05:30
Mayank Tyagi 842941b488 fix(nimble): Forward HID report/control/protocol writes as HIDD events 2026-06-29 15:25:36 +05:30
Mayank Tyagi 0a90976237 feat(nimble): ADD BLE HCI logging support for ESP Insights 2026-06-29 15:25:36 +05:30
Jiang Jiang Jian f02fad8ce1 Merge branch 'bugfix/ai_review_avrcp_v6.0' into 'release/v6.0'
fix(bt): Fix the critical and high issues related to AVRCP from AI review report (v6.0)

See merge request espressif/esp-idf!50020
2026-06-29 15:43:53 +08:00
Jiang Jiang Jian 965ebfce03 Merge branch 'bugfix/ai_review_hfp_v6.0' into 'release/v6.0'
fix(bt): Fix the critical issues related to HFP from AI review report (v6.0)

See merge request espressif/esp-idf!50007
2026-06-29 15:43:38 +08:00
Jiang Jiang Jian 777411abb9 Merge branch 'feat/ble-smp-multi-adv-static-random-address_v6.0' into 'release/v6.0'
feat(ble/bluedroid): Add BLE SMP support for multi-ADV with static random addresses (6.0)

See merge request espressif/esp-idf!49789
2026-06-29 15:41:49 +08:00
Jiang Jiang Jian 76c727dfdf Merge branch 'bugfix/ag_unknown_codec_vv6.0' into 'release/v6.0'
fix(bt): skip unknown codecs when parsing AT+BAC(v6.0)

See merge request espressif/esp-idf!49840
2026-06-29 15:41:42 +08:00
Jiang Jiang Jian 97ccc904c5 Merge branch 'bugfix/bbp_isses_v6.0' into 'release/v6.0'
Bugfix/bbp isses v6.0

See merge request espressif/esp-idf!49624
2026-06-29 15:40:16 +08:00
Jiang Jiang Jian c1aeac2888 Merge branch 'bugfix/fix_bluedroid_ai_review_bugs_20260427_v6.0' into 'release/v6.0'
Bugfix/fix bluedroid ai review bugs 20260427 (6.0)

See merge request espressif/esp-idf!49541
2026-06-29 15:39:47 +08:00
Jiang Jiang Jian 870760093f Merge branch 'bugfix/acl_conn_state_error_v6.0' into 'release/v6.0'
fix: Fix missing handling for HCI_ERR_CONNECTION_EXISTS (v6.0)

See merge request espressif/esp-idf!49313
2026-06-29 15:37:20 +08:00
Island 608c9495a4 Merge branch 'bugfix/fix_ble_reg_notify_no_fail_v6.0' into 'release/v6.0'
validate handle in esp_ble_gattc_register_for_notify (6.0)

See merge request espressif/esp-idf!48546
2026-06-29 14:39:34 +08:00
Island 760495e0b2 Merge branch 'fix/ble_funcs_reset_default_enabled_v6.0' into 'release/v6.0'
fix(bt): Add default BLE controller funcs reset enable (6.0)

See merge request espressif/esp-idf!49138
2026-06-29 14:39:15 +08:00
Zhi Wei Jian 4536a24c4c 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:31 +08:00
Zhi Wei Jian 9fb8579038 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:31 +08:00
Zhi Wei JianandCursor ae3f98e78d 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:30 +08:00
Zhi Wei Jian 78257b3e96 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:29 +08:00
Zhi Wei JianandCursor e23d745b76 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:29 +08:00
Zhi Wei Jian 0ad5f22cfa 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:28 +08:00
yangfeng e27d9efe13 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:48:50 +08:00
yangfeng 021caefcd5 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:47:38 +08:00
yangfeng a3f1ba390e 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 12:08:06 +08:00
xiongweichao 9b619e2617 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:03 +08:00
Zhang Hai Peng 9bf18ab861 fix(bt): Suppress gattc drop-notif warning for unregistered gatt_if
GATT stack broadcasts notifications to every client app, so unregistered
gatt_if instances were flooding logs even when another app had registered
the handle. Only warn when no client app registered for the handle.


(cherry picked from commit c18c8dc5e7)

Co-authored-by: zhanghaipeng <zhanghaipeng@espressif.com>
2026-06-22 00:24:14 +08:00
Zhang Hai Peng 6e6394de74 fix(bt/bluedroid): validate handle in esp_ble_gattc_register_for_notify
(cherry picked from commit aa29772cbe1ec0fb1c5c6629dc5bf333a0194198)

Co-authored-by: zhanghaipeng <zhanghaipeng@espressif.com>
2026-06-22 00:24:14 +08:00
Zhang Hai Peng 4e0cdf45ec 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:53 +08:00
Jin Cheng 2ac34db41c fix(bt/bluedroid): added buffer length check for OBEX APIs 2026-06-12 18:32:39 +08:00