From 5d7d1a180a1e31caa6e5464625900e66ceebd999 Mon Sep 17 00:00:00 2001 From: Luo Xu Date: Wed, 4 Dec 2024 16:23:41 +0800 Subject: [PATCH] fix(ble_mesh): Miscellaneous update (cherry picked from commit 589ebfc1d6189464fd5dfa8045fd4e3d88deec53) Co-authored-by: luoxu --- components/bt/esp_ble_mesh/core/beacon.c | 4 ++++ components/bt/esp_ble_mesh/core/cfg_srv.c | 7 +++++-- components/bt/esp_ble_mesh/core/prov_common.c | 2 +- 3 files changed, 10 insertions(+), 3 deletions(-) diff --git a/components/bt/esp_ble_mesh/core/beacon.c b/components/bt/esp_ble_mesh/core/beacon.c index 45e4a2d1a9..97ec6ebd82 100644 --- a/components/bt/esp_ble_mesh/core/beacon.c +++ b/components/bt/esp_ble_mesh/core/beacon.c @@ -35,7 +35,11 @@ #define UNPROV_BEACON_INTERVAL K_SECONDS(5) #endif +#if CONFIG_BLE_MESH_BQB_TEST +#define SECURE_BEACON_INTERVAL K_SECONDS(3) +#else #define SECURE_BEACON_INTERVAL K_SECONDS(10) +#endif /* 3 transmissions, 20ms interval */ #define UNPROV_XMIT BLE_MESH_TRANSMIT(2, 20) diff --git a/components/bt/esp_ble_mesh/core/cfg_srv.c b/components/bt/esp_ble_mesh/core/cfg_srv.c index a8fe1af424..fe605939a5 100644 --- a/components/bt/esp_ble_mesh/core/cfg_srv.c +++ b/components/bt/esp_ble_mesh/core/cfg_srv.c @@ -1287,7 +1287,7 @@ static struct label *va_find(const uint8_t *label_uuid, return match; } -static uint8_t va_add(uint8_t *label_uuid, uint16_t *addr) +uint8_t va_add(uint8_t *label_uuid, uint16_t *addr) { struct label *update = NULL, *free_slot = NULL; @@ -1295,6 +1295,9 @@ static uint8_t va_add(uint8_t *label_uuid, uint16_t *addr) if (update) { update->ref++; va_store(update); + if (addr) { + *addr = update->addr; + } return STATUS_SUCCESS; } @@ -1314,7 +1317,7 @@ static uint8_t va_add(uint8_t *label_uuid, uint16_t *addr) return STATUS_SUCCESS; } -static uint8_t va_del(uint8_t *label_uuid, uint16_t *addr) +uint8_t va_del(uint8_t *label_uuid, uint16_t *addr) { struct label *update = NULL; diff --git a/components/bt/esp_ble_mesh/core/prov_common.c b/components/bt/esp_ble_mesh/core/prov_common.c index bc75b447d2..a19aeb060b 100644 --- a/components/bt/esp_ble_mesh/core/prov_common.c +++ b/components/bt/esp_ble_mesh/core/prov_common.c @@ -143,7 +143,7 @@ bool bt_mesh_prov_pdu_check(uint8_t type, uint16_t length, uint8_t *reason) static uint8_t bt_mesh_prov_buf_type_get(struct net_buf_simple *buf) { - return buf->data[PROV_BUF_HEADROOM]; + return buf->__buf[PROV_BUF_HEADROOM]; } uint8_t node_next_xact_id(struct bt_mesh_prov_link *link)