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 a223e336d..12a8c7aab 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 @@ -640,7 +640,8 @@ static void btc_ble_set_rand_addr (BD_ADDR rand_addr) param.set_rand_addr_cmpl.status = ESP_BT_STATUS_SUCCESS; if (rand_addr != NULL) { - if(rand_addr[BD_ADDR_LEN - 1] & BT_STATIC_RAND_ADDR_MASK) { + if((rand_addr[BD_ADDR_LEN - 1] & BT_STATIC_RAND_ADDR_MASK) + == BT_STATIC_RAND_ADDR_MASK) { BTA_DmSetRandAddress(rand_addr); } else { param.set_rand_addr_cmpl.status = ESP_BT_STATUS_INVALID_STATIC_RAND_ADDR;