Commit Graph
5264 Commits
Author SHA1 Message Date
Luo Xu ea5e0f245d fix(ble_mesh): align GATTS read/write response handling with ATT
bt_mesh_bta_gatts_cb did not always answer ATT Read/Write Requests:
- READ: on a callback error it only logged a warning and sent nothing; a
  0-byte read (Read Blob at an offset equal to the value length) also sent
  nothing, although it is a successful empty read.
- WRITE: on a callback error it sent nothing, and a partial/zero write was
  treated as success.
- Both: when the handle was not found or the attribute had no read/write
  callback, the request was silently dropped.

An ATT Request must always be answered:

- READ: len >= 0 is success -> Read Response (a 0-byte read yields an empty
  value); len < 0 -> ATT Error Response carrying the callback's error code
  (-len, since BLE_MESH_GATT_ERR(x) == -x). The copy length is clamped to
  the source buffer size as a defensive bound. If the handle is unknown or
  the attribute has no read callback, respond with INVALID_HANDLE /
  READ_NOT_PERMITTED.
- WRITE: when need_rsp is set, always reply. len == write length -> Write
  Response; otherwise (negative ATT error, partial write, or 0) -> ATT
  Error Response (the negative code, or UNLIKELY for partial/0). If the
  handle is unknown or the attribute has no write callback, respond with
  INVALID_HANDLE / WRITE_NOT_PERMITTED. Write Without Response still sends
  no response.

A non-success status passed to BTA_GATTS_SendRsp is turned into an ATT
Error Response by the GATT layer (gatt_sr_process_app_rsp ->
gatt_send_error_rsp).


(cherry picked from commit ed1f4de3a3)

Co-authored-by: luoxu <luoxu@espressif.com>
2026-08-03 21:43:32 +08:00
Island 4a270847e9 Merge branch 'feat/update_mesh_lib_to_supported_get_lib_ver_v5.2' into 'release/v5.2'
Feat/update mesh lib to supported get lib ver (5.2)

See merge request espressif/esp-idf!51169
2026-08-03 11:30:56 +08:00
Rahul Tank 940c834103 Merge branch 'bugfix/fix_pawr_conn_event_v5.2' into 'release/v5.2'
fix(nimble):  Deliver PAwR peripheral CONNECT via sync callback (v5.2)

See merge request espressif/esp-idf!51257
2026-07-30 20:45:50 +05:30
Jin Cheng 18a99d2eb7 fix(bt/bluedroid): fixed incorrect eSCO packet type validation under secure connection mode in BlueDroid 2026-07-29 17:30:41 +08:00
hejiaxin 5434deb81d fix(bt): Fix some bug in stm_sco.c
- Memory safety
- State machine & logic integrity
- Resource leaks
- Edge cases check
2026-07-29 17:30:41 +08:00
Wang Meng Yang 1db291682a Merge branch 'bugfix/bredr_critical_bugs_v5.2' into 'release/v5.2'
fix(bt/bluedroid): fixed issues from AI review in GAP, SPP, HID, L2CAP and HCI (v5.2)

See merge request espressif/esp-idf!51082
2026-07-28 19:43:38 +08:00
Rahul Tank 5aa51e4b9c fix(nimble): Deliver PAwR peripheral CONNECT via sync callback 2026-07-28 12:59:42 +05:30
luoxu c9e5af2508 feat(ble_mesh): update lib to 79e3fee04e 2026-07-28 12:16:47 +08:00
Luo Xu 641ec20d67 feat(ble_mesh): supported get lib version
(cherry picked from commit 56f78da32c)

Co-authored-by: luoxu <luoxu@espressif.com>
2026-07-27 10:03:10 +08:00
Shreeyash Bhakare 609cb58a9b fix(nimble): Added security related fixes 2026-07-25 13:54:50 +05:30
Astha Verma 936d7c117c fix(nimble): Restore throughput after switching from LE Coded PHY 2026-07-24 18:13:33 +05:30
Rahul Tank 0ff25a3b51 Merge branch 'bugfix/red_rem_feat_evt_v5.2' into 'release/v5.2'
Handle Read Remote Supported Feature failure (v5.2)

See merge request espressif/esp-idf!50813
2026-07-24 14:34:33 +05:30
Island f36ae6c755 Merge branch 'fix/ble_hidd_remove_ccc_gating_v5.2' into 'release/v5.2'
fix(esp_hid/bluedroid): remove app-layer CCC gating in HID device (5.2)

See merge request espressif/esp-idf!51003
2026-07-23 19:26:23 +08:00
Wang Meng Yang 47e8e05222 Merge branch 'bugfix/low_spp_throughput_v5.2' into 'release/v5.2'
change(bt/bluedroid): increased port low watermark of RFCOMM (v5.2)

See merge request espressif/esp-idf!51088
2026-07-23 16:38:39 +08:00
Island 82389b3e96 Merge branch 'fix/ble_log_compression_safety_v5.2' into 'release/v5.2'
fix(ble_log): fix unaligned access and buffer safety in log compression (5.2)

See merge request espressif/esp-idf!47927
2026-07-23 14:25:24 +08:00
Jin Cheng 30bf70a980 change(bt/bluedroid): increased port low watermark of RFCOMM
When PORT_RX_BUF_LOW_WM is too low, RFCOMM replenishes credits only
after receiving a relatively large number of packets, which may cause
the peer to exhaust its credits and enter a stop-and-wait state.
Increase the low watermark to replenish credits more promptly and
reduce the likelihood of the peer stalling while waiting for additional
credits.
2026-07-23 08:12:10 +08:00
Jin Cheng 72edcd18ea fix(bt/bluedroid): fixed issues from AI review in GAP, SPP, HID, L2CAP and HCI 2026-07-23 07:56:42 +08:00
Wang Meng Yang efed7bd6af Merge branch 'bugfix/hid_host_oob_read_v5.2' into 'release/v5.2'
fix(bt/bluedroid): fixed possible 1-byte OOB read in bta_hh_ctrl_dat_act (v5.2)

See merge request espressif/esp-idf!50976
2026-07-22 17:58:45 +08:00
Astha Verma c481185c04 fix(nimble): Handle Read Remote Supported Features failure correctly 2026-07-22 12:27:45 +05:30
Wang Meng Yang 02004d3fe1 Merge branch 'bugfix/a2dp_sbc_v5.2' into 'release/v5.2'
fix(bt): Fix the pointer sbc_start_frame is not initialized (v5.2)

See merge request espressif/esp-idf!51021
2026-07-22 14:08:16 +08:00
Zhou Xiao cafcf83921 fix(bt): keep BLE log ISR state in internal RAM
(cherry picked from commit 2fa434eb50)

Co-authored-by: Zhou Xiao <zhouxiao@espressif.com>
2026-07-21 19:44:10 +08:00
yangfeng 895ca78695 fix(bt): Fix the pointer sbc_start_frame is not initialized
- Closes https://github.com/espressif/esp-idf/issues/18835
2026-07-21 16:10:40 +08:00
luoxu 984c9940d9 fix(bt): added err-check for cp_push funcs 2026-07-21 15:39:23 +08:00
luoxu bb0e8fb86b fix(ble_log): use typing.Optional/List for Python 3.9 compatibility 2026-07-21 15:03:15 +08:00
Luo Xu 975c30ad97 fix(ble_log): fix size_info nibble misalignment for last odd-count arg
(cherry picked from commit f5a927e055)

Co-authored-by: luoxu <luoxu@espressif.com>
2026-07-21 15:01:23 +08:00
luoxu fa0817fd45 fix(ble_log): fix unaligned access and buffer safety in log compression 2026-07-21 14:18:44 +08:00
Luo Xu bb75137ca2 test(ble): add comprehensive test suite for log compression
(cherry picked from commit 58121d2540)

Co-authored-by: luoxu <luoxu@espressif.com>
2026-07-21 14:18:44 +08:00
Luo Xu c8cd9f224c fix(ble): replace hardcoded tuple indices with FormatToken NamedTuple
(cherry picked from commit b7760a77e4)

Co-authored-by: luoxu <luoxu@espressif.com>
2026-07-21 14:18:44 +08:00
Island d467ddfc35 Merge branch 'fix/ble_mesh_disable_adv_pkt_discard_log_v5.2' into 'release/v5.2'
fix(ble_mesh): Disable warning logging when advertising packets are discarded (5.2)

See merge request espressif/esp-idf!50163
2026-07-21 11:35:45 +08:00
Island 6f18de959d Merge branch 'fix/ble-log-64-bit-io-setup-support_v5.2' into 'release/v5.2'
fix(ble_log): use BIT64 over BIT to support 64-bit IO setup (5.2)

See merge request espressif/esp-idf!50327
2026-07-21 11:22:26 +08:00
Zhang Hai Peng 75a7071292 fix(ble/bluedroid): track ext scan state for rand addr check
Update inq_var.state only after btsnd_hcic_ble_ext_scan_enable succeeds.
Clear BTM_BLE_SCANNING on explicit stop and controller scan timeout.


(cherry picked from commit 23519567e4)

Co-authored-by: zhanghaipeng <zhanghaipeng@espressif.com>
2026-07-21 10:53:21 +08:00
Zhang Hai Peng 77c6595e97 change(ble/bluedroid): disable host trace logs when BLE Log host is off
Default all Bluedroid layer trace levels to NONE when BLE async log
is enabled without BLE_LOG_HOST_LOG.


(cherry picked from commit 1f8f935e3f)

Co-authored-by: zhanghaipeng <zhanghaipeng@espressif.com>
2026-07-21 10:44:04 +08:00
Island 798ac66c91 Merge branch 'feat/ble_log_compression_module_cfg_update_v5.2' into 'release/v5.2'
Feat/ble log compression module cfg update (5.2)

See merge request espressif/esp-idf!49871
2026-07-20 21:37:59 +08:00
Jin Cheng 940a38a6d7 fix(bt/bluedroid): fixed possible 1-byte OOB read in bta_hh_ctrl_dat_act
Closes SEC-786
2026-07-20 16:42:59 +08:00
yangfeng d1ed5d3e84 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-07-20 09:56:54 +08:00
yangfeng 85a3cebb7a 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-07-20 09:48:39 +08:00
yangfeng 3568ec1c45 fix(bt/bluedroid): Fix unchecked p_ctrl_cback and p_msg_cback in AVRC
Closes SEC-1186
2026-07-19 12:43:59 +08:00
yangfeng b78a508f66 fix(bt/bluedroid): Fix missing NULL check on p_cfg in AVDT_ReconfigReq
Closes SEC-1187
2026-07-19 12:43:59 +08:00
Wang Meng Yang a2e4d90451 Merge branch 'bugfix/fix_bredr_inq_crash_v5.2' into 'release/v5.2'
fix(bt/bluedroid): fix crash during bredr inquiry when zero-addr device is found (v5.2)

See merge request espressif/esp-idf!50858
2026-07-19 10:06:57 +08:00
Rahul Tank c0c517ae4f Merge branch 'bugfix/add_dis_ieee_udi_to_config_v5.2' into 'release/v5.2'
fix(nimble): Add option to disable IEEE and UDI Characteristic in DIS (v5.2)

See merge request espressif/esp-idf!50764
2026-07-18 09:31:29 +05:30
Wang Meng Yang ecd2bf1002 Merge branch 'bugfix/smp_sec_flags_v5.2' into 'release/v5.2'
fix(bt/bluedroid): fixed several security issues from NVIDIA (v5.2)

See merge request espressif/esp-idf!50570
2026-07-17 20:02:52 +08:00
linruihao 76943b3b04 fix(bt/bluedroid): fix crash during bredr inquiry when zero-addr device is found 2026-07-17 10:39:42 +08:00
luoxu 81366e9e0a feat(ble): reorganize log compression Kconfig
Move log-compression Kconfig files to host/ and profile/mesh/ directories and update source paths.
2026-07-16 21:56:10 +08:00
luoxu 18dc3c9885 fix(ble_mesh): Disable warning logging when advertising packets are discarded 2026-07-16 16:20:16 +08:00
luoxu 9cc997e746 feat(ble): split log compression Kconfig into separate mesh and host files
# Conflicts:
#	components/bt/common/ble_log/extension/log_compression/Kconfig.in
2026-07-16 12:09:19 +08:00
Luo Xu 02e068020a fix(ble): fix Bluedroid log compression for newly added modules
(cherry picked from commit 8d4f1cb608)

Co-authored-by: luoxu <luoxu@espressif.com>
2026-07-16 12:09:19 +08:00
Island b89ea6a90a Merge branch 'change/ble_update_lib_20260610_v5.2' into 'release/v5.2'
change(ble): [AUTO_MR] 20260610 - Update ESP BLE Controller Lib (5.2)

See merge request espressif/esp-idf!50222
2026-07-15 20:45:12 +08:00
Zhou Xiao 15a4a59941 fix(ble_log): use BIT64 over BIT to support 64-bit IO setup
(cherry picked from commit a2876d304e)

Co-authored-by: Zhou Xiao <zhouxiao@espressif.com>
2026-07-15 17:19:59 +08:00
Island e864cf06a8 Merge branch 'bugfix/fix_bluedroid_read_multi_v5.2' into 'release/v5.2'
fix(ble/bluedroid): fix GATT Read Multiple response handling (5.2)

See merge request espressif/esp-idf!50705
2026-07-15 15:38:59 +08:00
Sumeet Singh 3301aac8e1 fix(nimble): Add option to disable IEEE and UDI Characteristic in DIS (v5.2) 2026-07-15 12:13:03 +05:30