From fc359e4491daefb24039c4ac4724a088bbcc7b08 Mon Sep 17 00:00:00 2001 From: Yulong Date: Tue, 10 Oct 2017 04:19:11 -0400 Subject: [PATCH] component/bt: Change the _btc_storage_remove_ble_bonding_keys function ret default vaule from 1 to 0. --- components/bt/bluedroid/btc/core/btc_ble_storage.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/components/bt/bluedroid/btc/core/btc_ble_storage.c b/components/bt/bluedroid/btc/core/btc_ble_storage.c index 538e978359..3e7238cc4e 100644 --- a/components/bt/bluedroid/btc/core/btc_ble_storage.c +++ b/components/bt/bluedroid/btc/core/btc_ble_storage.c @@ -184,29 +184,29 @@ bt_status_t btc_storage_get_ble_bonding_key(bt_bdaddr_t *remote_bd_addr, *******************************************************************************/ static bt_status_t _btc_storage_remove_ble_bonding_keys(bt_bdaddr_t *remote_bd_addr) { - int ret = 1; + int ret = 0; bdstr_t bdstr; bdaddr_to_string(remote_bd_addr, bdstr, sizeof(bdstr)); BTIF_TRACE_DEBUG(" %s in bd addr:%s",__FUNCTION__, bdstr); if (btc_config_exist(bdstr, BTC_BLE_STORAGE_ADDR_TYPE_STR)) { - ret &= btc_config_remove(bdstr, BTC_BLE_STORAGE_ADDR_TYPE_STR); + ret |= btc_config_remove(bdstr, BTC_BLE_STORAGE_ADDR_TYPE_STR); } if (btc_config_exist(bdstr, BTC_BLE_STORAGE_LE_KEY_PENC_STR)) { - ret &= btc_config_remove(bdstr, BTC_BLE_STORAGE_LE_KEY_PENC_STR); + ret |= btc_config_remove(bdstr, BTC_BLE_STORAGE_LE_KEY_PENC_STR); } if (btc_config_exist(bdstr, BTC_BLE_STORAGE_LE_KEY_PID_STR)) { - ret &= btc_config_remove(bdstr, BTC_BLE_STORAGE_LE_KEY_PID_STR); + ret |= btc_config_remove(bdstr, BTC_BLE_STORAGE_LE_KEY_PID_STR); } if (btc_config_exist(bdstr, BTC_BLE_STORAGE_LE_KEY_PCSRK_STR)) { - ret &= btc_config_remove(bdstr, BTC_BLE_STORAGE_LE_KEY_PCSRK_STR); + ret |= btc_config_remove(bdstr, BTC_BLE_STORAGE_LE_KEY_PCSRK_STR); } if (btc_config_exist(bdstr, BTC_BLE_STORAGE_LE_KEY_LENC_STR)) { - ret &= btc_config_remove(bdstr, BTC_BLE_STORAGE_LE_KEY_LENC_STR); + ret |= btc_config_remove(bdstr, BTC_BLE_STORAGE_LE_KEY_LENC_STR); } if (btc_config_exist(bdstr, BTC_BLE_STORAGE_LE_KEY_LCSRK_STR)) { - ret &= btc_config_remove(bdstr, BTC_BLE_STORAGE_LE_KEY_LCSRK_STR); + ret |= btc_config_remove(bdstr, BTC_BLE_STORAGE_LE_KEY_LCSRK_STR); } //here don't remove section, because config_save will check it _btc_storage_save();