From 281a9c27618880c0db68d1663b4855316231fc6d Mon Sep 17 00:00:00 2001 From: Tian Hao Date: Thu, 1 Dec 2016 12:14:57 +0800 Subject: [PATCH] component/bt : fix a code bug --- components/bt/bluedroid/stack/btm/btm_ble_gap.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/components/bt/bluedroid/stack/btm/btm_ble_gap.c b/components/bt/bluedroid/stack/btm/btm_ble_gap.c index 906300a8a8..b7311dfd63 100644 --- a/components/bt/bluedroid/stack/btm/btm_ble_gap.c +++ b/components/bt/bluedroid/stack/btm/btm_ble_gap.c @@ -1353,11 +1353,10 @@ tBTM_STATUS BTM_BleWriteAdvData(tBTM_BLE_AD_MASK data_mask, tBTM_BLE_ADV_DATA *p BOOLEAN BTM_BleSetRandAddress(BD_ADDR rand_addr) { BOOLEAN set_flag = false; - UINT8 len = sizeof(rand_addr); - if (len != BD_ADDR_LEN) { - APPL_TRACE_ERROR("Invalid random adress"); - return false; - } + + if (rand_addr == NULL) + return set_flag; + //send the set random address to the controller set_flag = btsnd_hcic_ble_set_random_addr(rand_addr); return set_flag;