mirror of
https://github.com/espressif/esp-idf.git
synced 2025-07-29 18:27:20 +02:00
feat(bt/bluedroid): Added report for the type of link key in ESP_BT_GAP_AUTH_CMPL_EVT
This commit is contained in:
@ -226,6 +226,16 @@ typedef enum {
|
||||
ESP_BT_GAP_DISCOVERY_STARTED, /*!< Device discovery started */
|
||||
} esp_bt_gap_discovery_state_t;
|
||||
|
||||
/// Type of link key
|
||||
#define ESP_BT_LINK_KEY_COMB (0x00) /*!< Combination Key */
|
||||
#define ESP_BT_LINK_KEY_DBG_COMB (0x03) /*!< Debug Combination Key */
|
||||
#define ESP_BT_LINK_KEY_UNAUTHED_COMB_P192 (0x04) /*!< Unauthenticated Combination Key generated from P-192 */
|
||||
#define ESP_BT_LINK_KEY_AUTHED_COMB_P192 (0x05) /*!< Authenticated Combination Key generated from P-192 */
|
||||
#define ESP_BT_LINK_KEY_CHG_COMB (0x06) /*!< Changed Combination Key */
|
||||
#define ESP_BT_LINK_KEY_UNAUTHED_COMB_P256 (0x07) /*!< Unauthenticated Combination Key generated from P-256 */
|
||||
#define ESP_BT_LINK_KEY_AUTHED_COMB_P256 (0x08) /*!< Authenticated Combination Key generated from P-256 */
|
||||
typedef uint8_t esp_bt_link_key_type_t;
|
||||
|
||||
/// BT GAP callback events
|
||||
typedef enum {
|
||||
ESP_BT_GAP_DISC_RES_EVT = 0, /*!< Device discovery result event */
|
||||
@ -331,6 +341,7 @@ typedef union {
|
||||
struct auth_cmpl_param {
|
||||
esp_bd_addr_t bda; /*!< remote bluetooth device address*/
|
||||
esp_bt_status_t stat; /*!< authentication complete status */
|
||||
esp_bt_link_key_type_t lk_type; /*!< type of link key generated */
|
||||
uint8_t device_name[ESP_BT_GAP_MAX_BDNAME_LEN + 1]; /*!< device name */
|
||||
} auth_cmpl; /*!< authentication complete parameter struct */
|
||||
|
||||
|
@ -413,6 +413,7 @@ static void btc_dm_auth_cmpl_evt (tBTA_DM_AUTH_CMPL *p_auth_cmpl)
|
||||
msg->pid = BTC_PID_GAP_BT;
|
||||
msg->act = BTC_GAP_BT_AUTH_CMPL_EVT;
|
||||
param.auth_cmpl.stat = status;
|
||||
param.auth_cmpl.lk_type = p_auth_cmpl->key_type;
|
||||
memcpy(param.auth_cmpl.bda, p_auth_cmpl->bd_addr, ESP_BD_ADDR_LEN);
|
||||
memcpy(param.auth_cmpl.device_name, p_auth_cmpl->bd_name, ESP_BT_GAP_MAX_BDNAME_LEN + 1);
|
||||
memcpy(msg->arg, ¶m, sizeof(esp_bt_gap_cb_param_t));
|
||||
|
@ -59,6 +59,7 @@ static void bt_app_gap_cb(esp_bt_gap_cb_event_t event, esp_bt_gap_cb_param_t *pa
|
||||
} else {
|
||||
ESP_LOGE(BT_AV_TAG, "authentication failed, status: %d", param->auth_cmpl.stat);
|
||||
}
|
||||
ESP_LOGI(BT_AV_TAG, "link key type of current link is: %d", param->auth_cmpl.lk_type);
|
||||
break;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user