From cecd8d1c6094bae3f25c74d0cef22f30445412c7 Mon Sep 17 00:00:00 2001 From: luoxu Date: Tue, 7 Jan 2025 16:40:45 +0800 Subject: [PATCH] fix(ble_mesh): fixed some issues with ble50 --- components/bt/esp_ble_mesh/common/include/mesh/queue.h | 2 +- components/bt/esp_ble_mesh/common/queue.c | 2 +- components/bt/esp_ble_mesh/core/ext_adv.c | 3 +++ components/bt/esp_ble_mesh/lib/ext.c | 2 ++ 4 files changed, 7 insertions(+), 2 deletions(-) diff --git a/components/bt/esp_ble_mesh/common/include/mesh/queue.h b/components/bt/esp_ble_mesh/common/include/mesh/queue.h index 8ec7a5c678..021c99ba67 100644 --- a/components/bt/esp_ble_mesh/common/include/mesh/queue.h +++ b/components/bt/esp_ble_mesh/common/include/mesh/queue.h @@ -23,7 +23,7 @@ typedef struct { #endif } bt_mesh_queue_t; -int bt_mesh_queue_init(bt_mesh_queue_t *queue, uint8_t queue_size, uint8_t item_size); +int bt_mesh_queue_init(bt_mesh_queue_t *queue, uint16_t queue_size, uint8_t item_size); int bt_mesh_queue_deinit(bt_mesh_queue_t *queue); #ifdef __cplusplus diff --git a/components/bt/esp_ble_mesh/common/queue.c b/components/bt/esp_ble_mesh/common/queue.c index 3f44843ca1..1fc3d66a61 100644 --- a/components/bt/esp_ble_mesh/common/queue.c +++ b/components/bt/esp_ble_mesh/common/queue.c @@ -7,7 +7,7 @@ #include "mesh/common.h" #include "mesh/queue.h" -int bt_mesh_queue_init(bt_mesh_queue_t *queue, uint8_t queue_size, uint8_t item_size) +int bt_mesh_queue_init(bt_mesh_queue_t *queue, uint16_t queue_size, uint8_t item_size) { __ASSERT(queue && queue_size && item_size, "Invalid queue init parameters"); diff --git a/components/bt/esp_ble_mesh/core/ext_adv.c b/components/bt/esp_ble_mesh/core/ext_adv.c index 3a2e4af2d0..fecfe30c3b 100644 --- a/components/bt/esp_ble_mesh/core/ext_adv.c +++ b/components/bt/esp_ble_mesh/core/ext_adv.c @@ -65,6 +65,9 @@ static inline int adv_send(struct bt_mesh_adv_inst *inst, uint16_t *adv_duration switch (BLE_MESH_ADV(buf)->type) { case BLE_MESH_ADV_PROV: case BLE_MESH_ADV_DATA: +#if CONFIG_BLE_MESH_FRIEND + case BLE_MESH_ADV_FRIEND: +#endif #if CONFIG_BLE_MESH_RELAY_ADV_BUF case BLE_MESH_ADV_RELAY_DATA: #endif diff --git a/components/bt/esp_ble_mesh/lib/ext.c b/components/bt/esp_ble_mesh/lib/ext.c index bac25f9820..5d0981ced3 100644 --- a/components/bt/esp_ble_mesh/lib/ext.c +++ b/components/bt/esp_ble_mesh/lib/ext.c @@ -3989,6 +3989,7 @@ void bt_mesh_ext_mbt_server_cb_evt_to_btc(uint8_t event, void *model, void *ctx) typedef struct { uint64_t config_ble_mesh_stack_trace_level : 3; + uint64_t config_ble_mesh_use_ble_50: 1; uint64_t config_ble_mesh_use_duplicate_scan : 1; uint64_t config_ble_mesh_pb_adv : 1; uint64_t config_ble_mesh_pb_gatt : 1; @@ -4154,6 +4155,7 @@ typedef struct { static const bt_mesh_ext_config_t bt_mesh_ext_cfg = { .config_ble_mesh_stack_trace_level = BLE_MESH_LOG_LEVEL, + .config_ble_mesh_use_ble_50 = IS_ENABLED(CONFIG_BLE_MESH_USE_BLE_50), .config_ble_mesh_use_duplicate_scan = IS_ENABLED(CONFIG_BLE_MESH_USE_DUPLICATE_SCAN), .config_ble_mesh_pb_adv = IS_ENABLED(CONFIG_BLE_MESH_PB_ADV), .config_ble_mesh_pb_gatt = IS_ENABLED(CONFIG_BLE_MESH_PB_GATT),