From c3e702da058f395182187b586663093066aacbfa Mon Sep 17 00:00:00 2001 From: lly Date: Sun, 28 Jun 2020 15:56:34 +0800 Subject: [PATCH] ble_mesh: stack: Remove some not used variables & functions --- .../bt/esp_ble_mesh/mesh_core/cfg_cli.c | 20 +---------- .../bt/esp_ble_mesh/mesh_core/health_cli.c | 35 ------------------- .../esp_ble_mesh/mesh_core/include/cfg_cli.h | 3 -- .../mesh_core/include/health_cli.h | 5 --- 4 files changed, 1 insertion(+), 62 deletions(-) diff --git a/components/bt/esp_ble_mesh/mesh_core/cfg_cli.c b/components/bt/esp_ble_mesh/mesh_core/cfg_cli.c index 4e0c9f1dc..cd4bdde6a 100644 --- a/components/bt/esp_ble_mesh/mesh_core/cfg_cli.c +++ b/components/bt/esp_ble_mesh/mesh_core/cfg_cli.c @@ -20,10 +20,6 @@ #include "mesh_common.h" #include "cfg_cli.h" -s32_t config_msg_timeout; - -static bt_mesh_config_client_t *cli; - static const bt_mesh_client_op_pair_t cfg_op_pair[] = { { OP_BEACON_GET, OP_BEACON_STATUS }, { OP_BEACON_SET, OP_BEACON_STATUS }, @@ -1383,16 +1379,6 @@ int bt_mesh_cfg_net_transmit_set(bt_mesh_client_common_param_t *param, u8_t tran return send_msg_with_u8(param, OP_NET_TRANSMIT_SET, transmit); } -s32_t bt_mesh_cfg_cli_timeout_get(void) -{ - return config_msg_timeout; -} - -void bt_mesh_cfg_cli_timeout_set(s32_t timeout) -{ - config_msg_timeout = timeout; -} - int bt_mesh_cfg_cli_init(struct bt_mesh_model *model, bool primary) { config_internal_data_t *internal = NULL; @@ -1433,8 +1419,6 @@ int bt_mesh_cfg_cli_init(struct bt_mesh_model *model, bool primary) bt_mesh_client_clear_list(client->internal_data); } - cli = client; - /* Configuration Model security is device-key based */ model->keys[0] = BLE_MESH_KEY_DEV; @@ -1469,11 +1453,9 @@ int bt_mesh_cfg_cli_deinit(struct bt_mesh_model *model, bool primary) /* Free the allocated internal data */ bt_mesh_free(client->internal_data); - cli->internal_data = NULL; + client->internal_data = NULL; } - client = NULL; - bt_mesh_cfg_client_mutex_free(); return 0; diff --git a/components/bt/esp_ble_mesh/mesh_core/health_cli.c b/components/bt/esp_ble_mesh/mesh_core/health_cli.c index acf56eef2..1c8475154 100644 --- a/components/bt/esp_ble_mesh/mesh_core/health_cli.c +++ b/components/bt/esp_ble_mesh/mesh_core/health_cli.c @@ -18,10 +18,6 @@ #include "mesh_common.h" #include "health_cli.h" -s32_t health_msg_timeout; - -static bt_mesh_health_client_t *health_cli; - static const bt_mesh_client_op_pair_t health_op_pair[] = { { OP_HEALTH_FAULT_GET, OP_HEALTH_FAULT_STATUS }, { OP_HEALTH_FAULT_CLEAR, OP_HEALTH_FAULT_STATUS }, @@ -350,28 +346,6 @@ int bt_mesh_health_fault_get(bt_mesh_client_common_param_t *param, u16_t cid) return err; } -s32_t bt_mesh_health_cli_timeout_get(void) -{ - return health_msg_timeout; -} - -void bt_mesh_health_cli_timeout_set(s32_t timeout) -{ - health_msg_timeout = timeout; -} - -int bt_mesh_health_cli_set(struct bt_mesh_model *model) -{ - if (!model || !model->user_data) { - BT_ERR("No Health Client context for given model"); - return -EINVAL; - } - - health_cli = model->user_data; - - return 0; -} - int bt_mesh_health_cli_init(struct bt_mesh_model *model, bool primary) { health_internal_data_t *internal = NULL; @@ -409,11 +383,6 @@ int bt_mesh_health_cli_init(struct bt_mesh_model *model, bool primary) bt_mesh_health_client_mutex_new(); - /* Set the default health client pointer */ - if (!health_cli) { - health_cli = client; - } - return 0; } @@ -443,9 +412,5 @@ int bt_mesh_health_cli_deinit(struct bt_mesh_model *model, bool primary) bt_mesh_health_client_mutex_free(); - if (health_cli) { - health_cli = NULL; - } - return 0; } diff --git a/components/bt/esp_ble_mesh/mesh_core/include/cfg_cli.h b/components/bt/esp_ble_mesh/mesh_core/include/cfg_cli.h index c33a7d977..e04b7b3ad 100644 --- a/components/bt/esp_ble_mesh/mesh_core/include/cfg_cli.h +++ b/components/bt/esp_ble_mesh/mesh_core/include/cfg_cli.h @@ -135,9 +135,6 @@ int bt_mesh_cfg_hb_pub_get(bt_mesh_client_common_param_t *param); int bt_mesh_cfg_node_reset(bt_mesh_client_common_param_t *param); -s32_t bt_mesh_cfg_cli_timeout_get(void); -void bt_mesh_cfg_cli_timeout_set(s32_t timeout); - /* Configuration Client Status Message Context */ struct bt_mesh_cfg_comp_data_status { diff --git a/components/bt/esp_ble_mesh/mesh_core/include/health_cli.h b/components/bt/esp_ble_mesh/mesh_core/include/health_cli.h index 8d38cf3d3..6bb7a4285 100644 --- a/components/bt/esp_ble_mesh/mesh_core/include/health_cli.h +++ b/components/bt/esp_ble_mesh/mesh_core/include/health_cli.h @@ -34,8 +34,6 @@ extern const struct bt_mesh_model_op bt_mesh_health_cli_op[]; BLE_MESH_MODEL(BLE_MESH_MODEL_ID_HEALTH_CLI, \ bt_mesh_health_cli_op, NULL, cli_data) -int bt_mesh_health_cli_set(struct bt_mesh_model *model); - int bt_mesh_health_fault_get(bt_mesh_client_common_param_t *param, u16_t cid); int bt_mesh_health_fault_clear(bt_mesh_client_common_param_t *param, @@ -54,9 +52,6 @@ int bt_mesh_health_attention_get(bt_mesh_client_common_param_t *param); int bt_mesh_health_attention_set(bt_mesh_client_common_param_t *param, u8_t attention, bool need_ack); -s32_t bt_mesh_health_cli_timeout_get(void); -void bt_mesh_health_cli_timeout_set(s32_t timeout); - /* Health Client Status Message Context */ struct bt_mesh_health_current_status {