Merge branch 'bugfix/btdm_security_section_remove_bug' into 'master'

component/bt: Change the remove section error &&  SMP_INCLUDE marco

See merge request !1133
This commit is contained in:
Jiang Jiang Jian 2017-08-22 14:13:29 +08:00
commit 9f24f06a65
4 changed files with 12 additions and 8 deletions

View file

@ -57,8 +57,10 @@ static void btc_init_bluetooth(void)
osi_alarm_init(); osi_alarm_init();
bte_main_boot_entry(btc_init_callback); bte_main_boot_entry(btc_init_callback);
btc_config_init(); btc_config_init();
#if (SMP_INCLUDED)
//load the ble local key whitch has been store in the flash //load the ble local key whitch has been store in the flash
btc_dm_load_ble_local_keys(); btc_dm_load_ble_local_keys();
#endif /* #if (SMP_INCLUDED) */
} }

View file

@ -29,10 +29,6 @@
static tBTA_BLE_ADV_DATA gl_bta_adv_data; static tBTA_BLE_ADV_DATA gl_bta_adv_data;
static tBTA_BLE_ADV_DATA gl_bta_scan_rsp_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) 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); 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) static void btc_ble_remove_bond_device(esp_bt_status_t status)
{ {
int ret; int ret;
@ -846,6 +843,8 @@ static void btc_ble_get_bond_device_list(void)
// release the buffer after used. // release the buffer after used.
GKI_freebuf((void *)bond_dev); 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) 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); 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) { switch (msg->act) {
case ESP_GAP_BLE_GET_BOND_DEV_COMPLETE_EVT: { 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__); LOG_DEBUG("%s \n", __func__);
switch (msg->act) { 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__); LOG_DEBUG("%s", __func__);
switch (msg->act) { switch (msg->act) {

View file

@ -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_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_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__ */ #endif /* __BTC_GAP_BLE_H__ */

View file

@ -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); LOG_DEBUG("entry->key = %s, entry->value = %s", entry->key, entry->value);
if (!strcmp(entry->key, key) && !strcmp(entry->value, key_value)) { if (!strcmp(entry->key, key) && !strcmp(entry->value, key_value)) {
LOG_DEBUG("%s, the irk aready in the flash.", __func__); LOG_DEBUG("%s, the irk aready in the flash.", __func__);
section_free((void *)section);
return true; return true;
} }
} }