Commit Graph
581 Commits
Author SHA1 Message Date
Liu Linyan 00a60eb202 feat(ble_mesh): Enable IV Index recovery by default
(cherry picked from commit 8e59eb4850)

Co-authored-by: Liu Linyan <liulinyan@espressif.com>
2026-08-31 11:43:45 +08:00
Jiang Jiang Jian b979cf26d0 Merge branch 'fix/ble_mesh_added_gatt_err_rsp_v6.1' into 'release/v6.1'
fix(ble_mesh): align GATTS read/write response handling with ATT (6.1)

See merge request espressif/esp-idf!51464
2026-08-31 11:29:21 +08:00
Luo Xu 6332384065 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:53 +08:00
luoxu 0bff830e79 feat(ble_mesh): update lib to 79e3fee04e 2026-07-28 11:48:33 +08:00
Luo Xu dbe3c9d442 feat(ble_mesh): supported get lib version
(cherry picked from commit 56f78da32c)

Co-authored-by: luoxu <luoxu@espressif.com>
2026-07-27 10:03:21 +08:00
Jiang Jiang Jian 0196213a13 Merge branch 'fix/ble_mesh_fixed_issues_v6.1' into 'release/v6.1'
Resolve reported BLE mesh stack issues (6.1)

See merge request espressif/esp-idf!50408
2026-07-16 11:27:36 +08:00
Luo Xu d75f7448e5 fix(ble_mesh): re-check scan dev-found cb before scan-rsp invocation
(cherry picked from commit 9a3a767824)

Co-authored-by: luoxu <luoxu@espressif.com>
2026-07-06 17:44:42 +08:00
Luo Xu 1b68511f89 fix(ble_mesh): comment out logs containing sensitive keys
(cherry picked from commit 781d6b2314)

Co-authored-by: luoxu <luoxu@espressif.com>
2026-07-06 17:44:41 +08:00
Luo Xu 0e4e6ba61f fix(ble_mesh): validate PB-ADV start segment length
(cherry picked from commit 912ec8dc62)

Co-authored-by: luoxu <luoxu@espressif.com>
2026-07-06 17:44:40 +08:00
Luo Xu 8d998f7fc1 fix(ble_mesh): Reset reassembly buffer at start of each transaction
The reassembly buffer must be reset to its origin at the beginning of every
transaction. prov_msg_recv() pulls the PDU type byte (advancing buf->data by
one) and nothing restores it between transactions. Without this reset,
buf->data drifts forward by one byte per received PDU, causing the segment-0
memcpy to write past the end of the statically allocated rx buffer
(PROV_RX_BUF_SIZE), and the XACT_SEG_DATA() offsets used for continuation
segments to be skewed by the accumulated drift.


(cherry picked from commit 2c4acaa2aa)

Co-authored-by: luoxu <luoxu@espressif.com>
2026-07-06 17:44:39 +08:00
Luo Xu c92fb5c2cb fix(ble_mesh): fix DFD client message parsing and encoding bugs
Fix multiple wire-format and robustness issues in the DFD client
(dfd_cli.c):

- handle_capabilities: read oob_retrieval_supported as u8 instead of
  le32. The server encodes a single byte; le32 over-consumed 3 bytes
  of the URL scheme list and could over-read the buffer.
- handle_upload_status: extract upload_progress from bits 0-6 (& 0x7F)
  and upload_type from bit 7 (>> 7), matching the server encoding
  (progress | BIT(7)). The previous >>1 / &0x01 returned wrong values,
  mis-classified in-band vs OOB, and falsely rejected valid OOB
  messages with high progress.
- handle_dfd_status: correct the transfer-mode byte layout to
  trans_mode bits 0-1, update_policy bit 2, RFU bits 3-7 (previously
  read bits 6-7 / 5), and fix the RFU mask to 0xF8. Now matches the
  struct bitfield definition and the DFD server.
- handle_dfd_status: report status+phase and return early when
  buf->len == 0 (IDLE phase) instead of pulling 10 absent bytes.
- bt_mesh_dfd_cli_distribution_start: encode trans_mode/update_policy
  into bits 0-2 so the server decodes them correctly.
- handle_receiver_list: validate buf->len >= entries_cnt * 5 before
  the loop, and handle entries_cnt == 0 without relying on calloc(0).
- handle_receiver_status: pass the status value (not the whole union)
  to the %d log format, fixing undefined behavior.
- dfd_client_recv_status: drop the dead BLE_MESH_DFD_OP_CAPABILITIES_GET
  case (a client-send opcode) from the receive switch.
- bt_mesh_dfd_cli_receivers_add: widen msg_length to uint32_t to avoid
  uint16_t overflow that bypassed the PDU size guard; add a NULL check
  for the receivers array.
- bt_mesh_dfd_cli_distribution_upload_oob_start: return -EINVAL
  instead of -1 for consistency with the rest of the file.


(cherry picked from commit 43137475e1)

Co-authored-by: luoxu <luoxu@espressif.com>
2026-07-06 17:44:38 +08:00
Luo Xu a475b0144e fix(ble_mesh): added max dfd srv count limit
(cherry picked from commit 781218cb62)

Co-authored-by: luoxu <luoxu@espressif.com>
2026-07-06 17:44:37 +08:00
Luo Xu d5555a086c fix(ble_mesh): reject invalid chunk size
(cherry picked from commit 35cd10fbdf)

Co-authored-by: luoxu <luoxu@espressif.com>
2026-07-06 17:44:37 +08:00
Luo Xu 5a57501543 fix(ble_mesh): fixed invalid disconnect handler wrote
(cherry picked from commit 52cfff707f)

Co-authored-by: luoxu <luoxu@espressif.com>
2026-07-06 17:44:36 +08:00
Luo Xu 3821e89347 fix(ble_mesh): fixed BLE-Mesh NimBLE extended-adv reassembly buffer overflow on COMPLETE fragment
(cherry picked from commit 1b22467f63)

Co-authored-by: luoxu <luoxu@espressif.com>
2026-07-06 17:44:34 +08:00
Luo Xu be19bf858d fix(ble_mesh): fixed BLE-Mesh GATTS read-callback error
(cherry picked from commit 00adfb3cbc)

Co-authored-by: luoxu <luoxu@espressif.com>
2026-07-06 17:44:34 +08:00
luoxu 942d513c27 fix(ble_mesh): Disable warning logging when advertising packets are discarded 2026-06-30 16:59:58 +08:00
Jiang Jiang Jian 85081d2414 Merge branch 'bugfix/fix_bluedroid_ai_review_bugs_20260427_v6.1' into 'release/v6.1'
Bugfix/fix bluedroid ai review bugs 20260427 (6.1)

See merge request espressif/esp-idf!49542
2026-06-14 11:04:54 +08:00
Zhi Wei Jian 5b8171d0d1 fix(bt): fix BTC task and BLE mesh bluedroid adapter
(cherry picked from commit 678fb93245)

Co-authored-by: zhiweijian <zhiweijian@espressif.com>
2026-06-12 17:17:37 +08:00
luoxu ceaa55822a fix(ble_mesh): Miscellaneous bugfixes according to our internal bug report (v2) 2026-06-05 11:59:35 +08:00
luoxu 313832de54 feat(ble_mesh): use SOC_ESP_NIMBLE_CONTROLLER instead of IDF_TARGET enumeration in Kconfig 2026-04-29 14:58:03 +08:00
luoxu 104e5c3d51 feat(ble_mesh): supported esp32s31 for ble mesh lib 2026-04-29 14:58:03 +08:00
luoxu f98082d596 feat(ble_mesh): supported esp32h4 for esp ble mesh lib 2026-04-29 14:58:03 +08:00
ShenWeilong 21e83d7eaf change(bt): Separated bt/CMakeLists to nimble/bluedroid/mesh/audio CMakeLists 2026-04-24 15:16:39 +08:00
luoxu 1f4c6ee31b fix(ble_mesh): fix Friend queue losing segmented messages for LPN 2026-04-23 16:06:01 +08:00
luoxu 17868a5f5c fix(ble/bluedroid): Change BLE mesh adapter to use BTA APIs 2026-03-19 20:59:28 +08:00
Island 596827eafd Merge branch 'feat/use_common_config_to_sel_crypt_lib' into 'master'
Feat/use common config to sel crypt lib

See merge request espressif/esp-idf!45556
2026-03-09 14:16:31 +08:00
Linyan Liu 9863c009d9 fix(ble_mesh): Revert some change updated in the commit 0e0fab2ea7 2026-02-27 15:58:07 +08:00
luoxu f084edd4d4 fix(ble_mesh): fixed configuration of core nums 2026-02-27 15:58:00 +08:00
luoxu 2af193dac4 fix(ble_mesh):fixed nimble connection failed 2026-02-09 18:00:03 +08:00
luoxu 4e006884f8 remove(ble_mesh): deprecate the tinycrypt library within the Bluetooth Mesh component 2026-02-04 00:07:33 +08:00
ShenWeilong aa40fdcc64 change(bt): use BT_SMP_CRYPTO_STACK_MBEDTLS to select bt cryption lib 2026-02-04 00:07:33 +08:00
Liu Linyan 0e0fab2ea7 fix(ble_mesh): Miscellaneous bugfixes according to our internal bug report 2026-02-03 10:59:04 +08:00
luoxu 7c4b104f61 feat(ble_mesh): update log compression for ble mesh lib 2026-01-12 14:51:26 +08:00
luoxu bc2d56b72a feat(ble_mesh): ignored the previous server status to avoid drop target by mistake 2026-01-07 20:17:42 +08:00
luoxu e039b33bb1 feat(ble_mesh): refuse to suspend dfu client when the last chunk sent 2026-01-07 20:17:42 +08:00
luoxu 8c8b43f564 fix(ble_mesh): added internal buffer to store dfu targets
The protocol may still receive DFU-related packets from the
network (such as forwarded or retransmitted ones) after DFU ends,
while the user might release the targets immediately after DFU completion.
However, since the list head is not empty, the protocol could access
already-freed memory when iterating through the targets.
2026-01-07 20:17:42 +08:00
luoxu f959884b2f fix(ble_mesh): fix blob transfer failure handling and chunk processing
- Fix DFU server transfer error state ordering to ensure proper callback delivery
- Add validation to discard chunks when blob server is not in busy state
- Prevent chunk processing when server is not in active transfer state
2026-01-07 20:17:42 +08:00
luoxu 3a8851422f fix(ble_mesh): ensure blob client/server work correctly with varying chunk sizes 2026-01-07 20:17:42 +08:00
luoxu c3faf5559a fix(ble_mesh): Miscellaneous fixes for blob 2026-01-07 20:17:42 +08:00
luoxu 90146a4513 feat(ble_mesh): update lib commit to d48251ab82 2026-01-06 14:45:17 +08:00
luoxu 866a07e954 feat(ble_mesh): fixed issues where the incorrect node oob private setting 2026-01-06 14:45:17 +08:00
luoxu 951856eb5c feat(ble_mesh): supported using little endian crypto components 2026-01-06 14:45:17 +08:00
luoxu 07834d2f74 feat(ble_mesh): unified ble mesh crypto 2026-01-06 14:45:17 +08:00
Ashish Sharma f22006e2f0 feat: migrates bt/ble to PSA APIs 2025-12-30 09:31:49 +05:30
luoxu a232b7c7af feat(ble_mesh): adapt blob cli&srv to long packet 2025-12-29 15:26:01 +08:00
luoxu b9d834edc7 fix(ble_mesh): eliminate deprecated warning for mbt 2025-12-26 16:09:29 +08:00
Island 34fcf5aa35 Merge branch 'fix/ble_mesh_proxy_cli_coexists_with_adv' into 'master'
fix(ble_mesh): Fix start callback timing when GATT and ADV bearers coexist

Closes BLERP-2463 and BLERP-2464

See merge request espressif/esp-idf!44331
2025-12-19 14:39:24 +08:00
luoxu 1c4f6045cf feat(ble_mesh): fix issues with advtypes 2025-12-18 16:42:56 +08:00
luoxu b63a0c2b78 feat(ble_mesh): update ble mesh multi connections config 2025-12-18 16:42:56 +08:00