From c8112454c39a6d074279c3a91778349b7df25d26 Mon Sep 17 00:00:00 2001 From: lly Date: Wed, 24 Jun 2020 17:26:34 +0800 Subject: [PATCH] ble_mesh: stack: Fix compile error when only proxy enabled Also remove some redundant CONFIG_BLE_MESH_PROXY checks, because when the following options are satisfied, the CONFIG_BLE_MESH_PROXY option will be selected mandatorily. --- components/bt/esp_ble_mesh/mesh_core/main.c | 29 ++++++++++----------- 1 file changed, 14 insertions(+), 15 deletions(-) diff --git a/components/bt/esp_ble_mesh/mesh_core/main.c b/components/bt/esp_ble_mesh/mesh_core/main.c index 64710ddc15..978a0aa249 100644 --- a/components/bt/esp_ble_mesh/mesh_core/main.c +++ b/components/bt/esp_ble_mesh/mesh_core/main.c @@ -336,17 +336,16 @@ int bt_mesh_init(const struct bt_mesh_prov *prov, bt_mesh_gatt_init(); } - if (IS_ENABLED(CONFIG_BLE_MESH_PROXY)) { - if ((IS_ENABLED(CONFIG_BLE_MESH_NODE) && - IS_ENABLED(CONFIG_BLE_MESH_PB_GATT)) || - IS_ENABLED(CONFIG_BLE_MESH_GATT_PROXY_SERVER)) { - bt_mesh_proxy_init(); - } - if ((IS_ENABLED(CONFIG_BLE_MESH_PROVISIONER) && - IS_ENABLED(CONFIG_BLE_MESH_PB_GATT)) || - IS_ENABLED(CONFIG_BLE_MESH_GATT_PROXY_CLIENT)) { - bt_mesh_proxy_prov_client_init(); - } + if ((IS_ENABLED(CONFIG_BLE_MESH_NODE) && + IS_ENABLED(CONFIG_BLE_MESH_PB_GATT)) || + IS_ENABLED(CONFIG_BLE_MESH_GATT_PROXY_SERVER)) { + bt_mesh_proxy_init(); + } + + if ((IS_ENABLED(CONFIG_BLE_MESH_PROVISIONER) && + IS_ENABLED(CONFIG_BLE_MESH_PB_GATT)) || + IS_ENABLED(CONFIG_BLE_MESH_GATT_PROXY_CLIENT)) { + bt_mesh_proxy_prov_client_init(); } if (IS_ENABLED(CONFIG_BLE_MESH_PROV)) { @@ -444,10 +443,10 @@ int bt_mesh_deinit(struct bt_mesh_deinit_param *param) bt_mesh_beacon_deinit(); - if (IS_ENABLED(CONFIG_BLE_MESH_PROXY)) { - if (IS_ENABLED(CONFIG_BLE_MESH_NODE)) { - bt_mesh_proxy_deinit(); - } + if ((IS_ENABLED(CONFIG_BLE_MESH_NODE) && + IS_ENABLED(CONFIG_BLE_MESH_PB_GATT)) || + IS_ENABLED(CONFIG_BLE_MESH_GATT_PROXY_SERVER)) { + bt_mesh_proxy_deinit(); } if ((IS_ENABLED(CONFIG_BLE_MESH_PROVISIONER) &&