From 71d35c77709f880071b3363b2e4c6d94dfea8c9f Mon Sep 17 00:00:00 2001 From: Yulong Date: Mon, 21 Aug 2017 23:28:45 -0400 Subject: [PATCH] component/bt: Change the remove section error. --- components/bt/bluedroid/btc/core/btc_main.c | 2 ++ .../bt/bluedroid/btc/profile/std/gap/btc_gap_ble.c | 13 ++++++------- .../bluedroid/btc/profile/std/include/btc_gap_ble.h | 4 ++++ components/bt/bluedroid/osi/config.c | 1 - 4 files changed, 12 insertions(+), 8 deletions(-) diff --git a/components/bt/bluedroid/btc/core/btc_main.c b/components/bt/bluedroid/btc/core/btc_main.c index d6c480109..87892b846 100644 --- a/components/bt/bluedroid/btc/core/btc_main.c +++ b/components/bt/bluedroid/btc/core/btc_main.c @@ -57,8 +57,10 @@ static void btc_init_bluetooth(void) osi_alarm_init(); bte_main_boot_entry(btc_init_callback); btc_config_init(); +#if (SMP_INCLUDED) //load the ble local key whitch has been store in the flash btc_dm_load_ble_local_keys(); +#endif /* #if (SMP_INCLUDED) */ } diff --git a/components/bt/bluedroid/btc/profile/std/gap/btc_gap_ble.c b/components/bt/bluedroid/btc/profile/std/gap/btc_gap_ble.c index 9fa28cc43..a9a667f4e 100644 --- a/components/bt/bluedroid/btc/profile/std/gap/btc_gap_ble.c +++ b/components/bt/bluedroid/btc/profile/std/gap/btc_gap_ble.c @@ -29,10 +29,6 @@ static tBTA_BLE_ADV_DATA gl_bta_adv_data; static tBTA_BLE_ADV_DATA gl_bta_scan_rsp_data; -static void btc_gap_ble_arg_deep_free(btc_msg_t *msg); -static void btc_gap_ble_cb_deep_free(btc_msg_t *msg); -static void btc_gap_ble_cb_deep_copy(btc_msg_t *msg, void *p_dest, void *p_src); - static inline void btc_gap_ble_cb_to_app(esp_gap_ble_cb_event_t event, esp_ble_gap_cb_param_t *param) { esp_gap_ble_cb_t btc_gap_ble_cb = (esp_gap_ble_cb_t)btc_profile_cb_get(BTC_PID_GAP_BLE); @@ -784,6 +780,7 @@ static void btc_ble_set_rand_addr (BD_ADDR rand_addr) } } +#if (SMP_INCLUDED) static void btc_ble_remove_bond_device(esp_bt_status_t status) { int ret; @@ -846,6 +843,8 @@ static void btc_ble_get_bond_device_list(void) // release the buffer after used. GKI_freebuf((void *)bond_dev); } +#endif /* #if (SMP_INCLUDED) */ + static void btc_ble_config_local_privacy(bool privacy_enable, tBTA_SET_LOCAL_PRIVACY_CBACK *set_local_privacy_cback) { BTA_DmBleConfigLocalPrivacy(privacy_enable, set_local_privacy_cback); @@ -939,7 +938,7 @@ void btc_gap_ble_arg_deep_copy(btc_msg_t *msg, void *p_dest, void *p_src) } } -static void btc_gap_ble_cb_deep_copy(btc_msg_t *msg, void *p_dest, void *p_src) +void btc_gap_ble_cb_deep_copy(btc_msg_t *msg, void *p_dest, void *p_src) { switch (msg->act) { case ESP_GAP_BLE_GET_BOND_DEV_COMPLETE_EVT: { @@ -963,7 +962,7 @@ static void btc_gap_ble_cb_deep_copy(btc_msg_t *msg, void *p_dest, void *p_src) } } -static void btc_gap_ble_arg_deep_free(btc_msg_t *msg) +void btc_gap_ble_arg_deep_free(btc_msg_t *msg) { LOG_DEBUG("%s \n", __func__); switch (msg->act) { @@ -1002,7 +1001,7 @@ static void btc_gap_ble_arg_deep_free(btc_msg_t *msg) } } -static void btc_gap_ble_cb_deep_free(btc_msg_t *msg) +void btc_gap_ble_cb_deep_free(btc_msg_t *msg) { LOG_DEBUG("%s", __func__); switch (msg->act) { diff --git a/components/bt/bluedroid/btc/profile/std/include/btc_gap_ble.h b/components/bt/bluedroid/btc/profile/std/include/btc_gap_ble.h index 948ec24f1..507089a26 100644 --- a/components/bt/bluedroid/btc/profile/std/include/btc_gap_ble.h +++ b/components/bt/bluedroid/btc/profile/std/include/btc_gap_ble.h @@ -133,5 +133,9 @@ void btc_gap_ble_call_handler(btc_msg_t *msg); void btc_gap_ble_cb_handler(btc_msg_t *msg); void btc_gap_ble_arg_deep_copy(btc_msg_t *msg, void *p_dest, void *p_src); +void btc_gap_ble_arg_deep_free(btc_msg_t *msg); +void btc_gap_ble_cb_deep_free(btc_msg_t *msg); +void btc_gap_ble_cb_deep_copy(btc_msg_t *msg, void *p_dest, void *p_src); + #endif /* __BTC_GAP_BLE_H__ */ diff --git a/components/bt/bluedroid/osi/config.c b/components/bt/bluedroid/osi/config.c index 99b30219e..590e0392b 100644 --- a/components/bt/bluedroid/osi/config.c +++ b/components/bt/bluedroid/osi/config.c @@ -144,7 +144,6 @@ bool config_has_key_in_section(config_t *config, char *key, char *key_value) LOG_DEBUG("entry->key = %s, entry->value = %s", entry->key, entry->value); if (!strcmp(entry->key, key) && !strcmp(entry->value, key_value)) { LOG_DEBUG("%s, the irk aready in the flash.", __func__); - section_free((void *)section); return true; } }