From cb5c2968298b50b9d11ea030307025b79f8cb8d6 Mon Sep 17 00:00:00 2001 From: Yulong Date: Fri, 14 Apr 2017 02:45:07 -0400 Subject: [PATCH] component/bt:move the bugfix/ble_set_rand_addr_bug here for fix the conflict with the master --- components/bt/bluedroid/bta/dm/bta_dm_act.c | 5 ++++- components/bt/bluedroid/btc/profile/std/gap/btc_gap_ble.c | 7 +++++-- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/components/bt/bluedroid/bta/dm/bta_dm_act.c b/components/bt/bluedroid/bta/dm/bta_dm_act.c index 1a2b6259c0..939142cd1b 100644 --- a/components/bt/bluedroid/bta/dm/bta_dm_act.c +++ b/components/bt/bluedroid/bta/dm/bta_dm_act.c @@ -4472,12 +4472,15 @@ void bta_dm_ble_update_conn_params (tBTA_DM_MSG *p_data) *******************************************************************************/ void bta_dm_ble_set_rand_address(tBTA_DM_MSG *p_data) { + BOOLEAN set_flag = false; if (p_data->set_addr.addr_type != BLE_ADDR_RANDOM) { APPL_TRACE_ERROR("Invalid random adress type = %d\n", p_data->set_addr.addr_type); return; } //send the setting random address to BTM layer - BTM_BleSetRandAddress(p_data->set_addr.address); + if ((set_flag = BTM_BleSetRandAddress(p_data->set_addr.address) != TRUE)){ + APPL_TRACE_ERROR("%s,set random address fail."); + } } 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 1d78fe637c..f9ec31bba8 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 @@ -861,9 +861,12 @@ void btc_gap_ble_call_handler(btc_msg_t *msg) case BTC_GAP_BLE_ACT_SET_PKT_DATA_LEN: btc_ble_set_pkt_data_len(arg->set_pkt_data_len.remote_device, arg->set_pkt_data_len.tx_data_length); break; - case BTC_GAP_BLE_ACT_SET_RAND_ADDRESS: - btc_ble_set_rand_addr(arg->set_rand_addr.rand_addr); + case BTC_GAP_BLE_ACT_SET_RAND_ADDRESS: { + BD_ADDR bd_addr; + memcpy(bd_addr, arg->set_rand_addr.rand_addr, sizeof(BD_ADDR)); + btc_ble_set_rand_addr(bd_addr); break; + } case BTC_GAP_BLE_ACT_CONFIG_LOCAL_PRIVACY: btc_ble_config_local_privacy(arg->cfg_local_privacy.privacy_enable); break;