Lines Matching refs:ble
21 * This file contains functions for BLE device control utilities, and LE
126 p_dev_rec->ble.ble_addr_type = addr_type;
134 p_info->results.ble_addr_type = p_dev_rec->ble.ble_addr_type ;
371 *p_addr_type = p_dev_rec->ble.ble_addr_type;
466 ** Description Set scan parameter used in BLE connection request
618 p_dev_rec->ble.ble_addr_type = p_inq_info->results.ble_addr_type;
621 *p_addr_type = p_dev_rec->ble.ble_addr_type;
798 p_dev_rec->ble.keys.local_counter++;
800 p_dev_rec->ble.keys.counter++;
803 p_dev_rec->ble.keys.local_counter,
804 p_dev_rec->ble.keys.counter);
812 ** Description This function is to get the BLE key type that has been exchanged
826 *p_key_types = p_dev_rec->ble.key_type;
854 if (p_dev_rec && p_dev_rec->ble.keys.div)
857 *p_div = p_dev_rec->ble.keys.div;
868 ** an BLE key. SMP is internal, whereas all the keys shall
870 ** when application passes ble key stored in NVRAM to the btm_sec.
896 memcpy(p_rec->ble.keys.ltk, p_keys->penc_key.ltk, BT_OCTET16_LEN);
897 memcpy(p_rec->ble.keys.rand, p_keys->penc_key.rand, BT_OCTET8_LEN);
898 p_rec->ble.keys.sec_level = p_keys->penc_key.sec_level;
899 p_rec->ble.keys.ediv = p_keys->penc_key.ediv;
900 p_rec->ble.keys.key_size = p_keys->penc_key.key_size;
901 p_rec->ble.key_type |= BTM_LE_KEY_PENC;
908 p_rec->ble.key_type,
910 p_rec->ble.keys.sec_level);
916 ble.keys.irk[i] = p_keys->pid_key.irk[i];
919 //memcpy( p_rec->ble.keys.irk, p_keys->pid_key, BT_OCTET16_LEN); todo will crash the system
920 memcpy(p_rec->ble.static_addr, p_keys->pid_key.static_addr, BD_ADDR_LEN);
921 p_rec->ble.static_addr_type = p_keys->pid_key.addr_type;
922 p_rec->ble.key_type |= BTM_LE_KEY_PID;
923 BTM_TRACE_DEBUG("BTM_LE_KEY_PID key_type=0x%x save peer IRK", p_rec->ble.key_type);
927 memcpy(p_rec->ble.keys.csrk, p_keys->pcsrk_key.csrk, BT_OCTET16_LEN);
928 p_rec->ble.keys.srk_sec_level = p_keys->pcsrk_key.sec_level;
929 p_rec->ble.keys.counter = p_keys->pcsrk_key.counter;
930 p_rec->ble.key_type |= BTM_LE_KEY_PCSRK;
938 p_rec->ble.key_type,
940 p_rec->ble.keys.srk_sec_level,
941 p_rec->ble.keys.counter );
945 p_rec->ble.keys.div = p_keys->lenc_key.div; /* update DIV */
946 p_rec->ble.keys.sec_level = p_keys->lenc_key.sec_level;
947 p_rec->ble.keys.key_size = p_keys->lenc_key.key_size;
948 p_rec->ble.key_type |= BTM_LE_KEY_LENC;
951 p_rec->ble.key_type,
952 p_rec->ble.keys.div,
953 p_rec->ble.keys.key_size,
954 p_rec->ble.keys.sec_level );
958 p_rec->ble.keys.div = p_keys->lcsrk_key.div; /* update DIV */
959 p_rec->ble.keys.local_csrk_sec_level = p_keys->lcsrk_key.sec_level;
960 p_rec->ble.keys.local_counter = p_keys->lcsrk_key.counter;
961 p_rec->ble.key_type |= BTM_LE_KEY_LCSRK;
963 p_rec->ble.key_type,
964 p_rec->ble.keys.div,
965 p_rec->ble.keys.local_csrk_sec_level,
966 p_rec->ble.keys.local_counter );
974 BTM_TRACE_DEBUG ("BLE key type 0x%02x updated for BDA: %08x%04x (btm_sec_save_le_key)", key_type,
978 /* Notify the application that one of the BLE keys has been updated
989 BTM_TRACE_WARNING ("BLE key type 0x%02x called for Unknown BDA or type: %08x%04x !! (btm_sec_save_le_key)", key_type,
1045 ** Description Check BLE link security level match.
1091 if (p_dev_rec->ble.key_type & BTM_LE_KEY_PENC)
1092 cur_sec_level = p_dev_rec->ble.keys.sec_level;
1266 else if (p_rec->ble.key_type & BTM_LE_KEY_PENC)
1268 if (btsnd_hcic_ble_start_enc(p_rec->ble_hci_handle, p_rec->ble.keys.rand,
1269 p_rec->ble.keys.ediv, p_rec->ble.keys.ltk))
1314 p_dev_rec->enc_key_size = p_dev_rec->ble.keys.key_size;
1366 p_dev_rec->ble.keys.div == div )
1408 p_cb->key_size = p_rec->ble.keys.key_size;
1410 BTM_TRACE_ERROR("key size = %d", p_rec->ble.keys.key_size);
1536 match_rec->ble.active_addr_type = BTM_BLE_ADDR_RRA;
1537 memcpy(match_rec->ble.cur_rand_addr, bda, BD_ADDR_LEN);
1606 p_dev_rec->ble.ble_addr_type = addr_type;
1614 p_dev_rec->ble.active_addr_type = BTM_BLE_ADDR_PSEUDO;
1616 if (p_dev_rec->ble.ble_addr_type == BLE_ADDR_RANDOM && !addr_matched)
1617 memcpy(p_dev_rec->ble.cur_rand_addr, bda, BD_ADDR_LEN);
1886 UINT32_TO_STREAM(pp, p_rec->ble.keys.local_counter);
1889 UINT32_TO_STREAM(pp, p_rec->ble.keys.local_counter);
1918 UINT32_TO_STREAM(p_mac, p_rec->ble.keys.local_counter);
1921 UINT32_TO_STREAM(p_mac, p_rec->ble.keys.local_counter);
1974 if (p_rec == NULL || (p_rec && !(p_rec->ble.key_type & BTM_LE_KEY_PCSRK)))
1978 else if (counter < p_rec->ble.keys.counter)
1988 BTM_TRACE_DEBUG ("BTM_BleVerifySignature rcv_cnt=%d >= expected_cnt=%d", counter, p_rec->ble.keys.counter);
1990 if (AES_CMAC(p_rec->ble.keys.csrk, p_orig, len, BTM_CMAC_TLEN_SIZE, p_mac))
2153 BTM_TRACE_DEBUG("BLE DHK generated.");
2205 BTM_TRACE_DEBUG("BLE IR generated.");