mirror of
https://github.com/espressif/esp-idf.git
synced 2026-10-02 03:00:34 +03:00
feat(ble/bluedroid): Support bluedroid encrypted advertising data
This commit is contained in:
@@ -2948,6 +2948,22 @@ BOOLEAN BTM_BleConfigPrivacy(BOOLEAN enable, tBTM_SET_LOCAL_PRIVACY_CBACK *set_l
|
||||
*******************************************************************************/
|
||||
void BTM_BleConfigLocalIcon(uint16_t icon);
|
||||
|
||||
#if (BT_GATTS_KEY_MATERIAL_CHAR == TRUE)
|
||||
/*******************************************************************************
|
||||
**
|
||||
** Function BTM_BleSetKeyMaterial
|
||||
**
|
||||
** Description Set the Encrypted Data Key Material in GAP service
|
||||
**
|
||||
** Parameters session_key: 16-byte session key
|
||||
** iv: 8-byte initialization vector
|
||||
**
|
||||
** Returns void
|
||||
**
|
||||
*******************************************************************************/
|
||||
void BTM_BleSetKeyMaterial(const uint8_t *session_key, const uint8_t *iv);
|
||||
#endif
|
||||
|
||||
/*******************************************************************************
|
||||
**
|
||||
** Function BTM_BleConfigConnParams
|
||||
|
||||
@@ -113,6 +113,17 @@ typedef struct {
|
||||
UINT16 sp_tout;
|
||||
} tGAP_BLE_PREF_PARAM;
|
||||
|
||||
#if (BT_GATTS_KEY_MATERIAL_CHAR == TRUE)
|
||||
#define GAP_KEY_MATERIAL_SESSION_KEY_SIZE 16 /* 128-bit session key */
|
||||
#define GAP_KEY_MATERIAL_IV_SIZE 8 /* 64-bit IV */
|
||||
#define GAP_KEY_MATERIAL_SIZE (GAP_KEY_MATERIAL_SESSION_KEY_SIZE + GAP_KEY_MATERIAL_IV_SIZE)
|
||||
|
||||
typedef struct {
|
||||
UINT8 session_key[GAP_KEY_MATERIAL_SESSION_KEY_SIZE];
|
||||
UINT8 iv[GAP_KEY_MATERIAL_IV_SIZE];
|
||||
} tGAP_BLE_KEY_MATERIAL;
|
||||
#endif // (BT_GATTS_KEY_MATERIAL_CHAR == TRUE)
|
||||
|
||||
typedef union {
|
||||
tGAP_BLE_PREF_PARAM conn_param;
|
||||
BD_ADDR reconn_bda;
|
||||
@@ -122,6 +133,9 @@ typedef union {
|
||||
#if (BT_GATTS_SECURITY_LEVELS_CHAR == TRUE)
|
||||
UINT16 security_level;
|
||||
#endif // (BT_GATTS_SECURITY_LEVELS_CHAR == TRUE)
|
||||
#if (BT_GATTS_KEY_MATERIAL_CHAR == TRUE)
|
||||
tGAP_BLE_KEY_MATERIAL key_material;
|
||||
#endif // (BT_GATTS_KEY_MATERIAL_CHAR == TRUE)
|
||||
|
||||
} tGAP_BLE_ATTR_VALUE;
|
||||
|
||||
|
||||
@@ -53,6 +53,7 @@
|
||||
#define GATT_UUID_GAP_CENTRAL_ADDR_RESOL 0x2AA6
|
||||
|
||||
#define GATT_UUID_GAP_GATT_SECURITY_LEVELS 0x2BF5
|
||||
#define GATT_UUID_GAP_KEY_MATERIAL 0x2B88 /* Encrypted Data Key Material */
|
||||
|
||||
/* Attribute Profile Attribute UUID */
|
||||
#define GATT_UUID_GATT_SRV_CHGD 0x2A05
|
||||
|
||||
Reference in New Issue
Block a user