mirror of
https://github.com/espressif/esp-idf.git
synced 2025-08-14 22:16:46 +00:00
component/bt: add clear rand address API
This commit is contained in:
@@ -590,8 +590,16 @@ static BT_HDR *smp_build_id_addr_cmd(UINT8 cmd_code, tSMP_CB *p_cb)
|
||||
p = (UINT8 *)(p_buf + 1) + L2CAP_MIN_OFFSET;
|
||||
|
||||
UINT8_TO_STREAM (p, SMP_OPCODE_ID_ADDR);
|
||||
UINT8_TO_STREAM (p, 0);
|
||||
BDADDR_TO_STREAM (p, controller_get_interface()->get_address()->address);
|
||||
/* Identity Address Information is used in the Transport Specific Key Distribution phase to distribute
|
||||
its public device address or static random address. if slave using static random address is encrypted,
|
||||
it should distribute its static random address */
|
||||
if(btm_cb.ble_ctr_cb.addr_mgnt_cb.own_addr_type == BLE_ADDR_RANDOM && memcmp(btm_cb.ble_ctr_cb.addr_mgnt_cb.static_rand_addr, btm_cb.ble_ctr_cb.addr_mgnt_cb.private_addr,6) == 0) {
|
||||
UINT8_TO_STREAM (p, 0x01);
|
||||
BDADDR_TO_STREAM (p, btm_cb.ble_ctr_cb.addr_mgnt_cb.static_rand_addr);
|
||||
} else {
|
||||
UINT8_TO_STREAM (p, 0);
|
||||
BDADDR_TO_STREAM (p, controller_get_interface()->get_address()->address);
|
||||
}
|
||||
|
||||
p_buf->offset = L2CAP_MIN_OFFSET;
|
||||
p_buf->len = SMP_ID_ADDR_SIZE;
|
||||
|
Reference in New Issue
Block a user