mirror of
https://github.com/espressif/esp-idf.git
synced 2025-11-20 17:29:45 +01:00
feat(bt/bluedroid): added a VSC to set minimal encryption key size
This commit is contained in:
@@ -860,6 +860,15 @@ typedef struct {
|
||||
UINT16 pkt_types;
|
||||
} tBTM_SET_ACL_PKT_TYPES_RESULTS;
|
||||
|
||||
#if (ENC_KEY_SIZE_CTRL_MODE != ENC_KEY_SIZE_CTRL_MODE_NONE)
|
||||
/* Structure returned with set minimal encryption key size event (in tBTM_CMPL_CB callback function)
|
||||
** in response to BTM_SetMinEncKeySize call.
|
||||
*/
|
||||
typedef struct {
|
||||
UINT8 hci_status;
|
||||
} tBTM_SET_MIN_ENC_KEY_SIZE_RESULTS;
|
||||
#endif
|
||||
|
||||
/* Structure returned with set BLE channels event (in tBTM_CMPL_CB callback function)
|
||||
** in response to BTM_BleSetChannels call.
|
||||
*/
|
||||
@@ -2305,6 +2314,22 @@ tBTM_STATUS BTM_ReadPageTimeout(tBTM_CMPL_CB *p_cb);
|
||||
//extern
|
||||
tBTM_STATUS BTM_SetAclPktTypes(BD_ADDR remote_bda, UINT16 pkt_types, tBTM_CMPL_CB *p_cb);
|
||||
|
||||
/*******************************************************************************
|
||||
**
|
||||
** Function BTM_SetMinEncKeySize
|
||||
**
|
||||
** Description Send HCI Set Minimum Encryption Key Size
|
||||
**
|
||||
** Returns
|
||||
** BTM_SUCCESS Command sent.
|
||||
** BTM_NO_RESOURCES If out of resources to send the command.
|
||||
**
|
||||
*******************************************************************************/
|
||||
//extern
|
||||
#if (ENC_KEY_SIZE_CTRL_MODE != ENC_KEY_SIZE_CTRL_MODE_NONE)
|
||||
tBTM_STATUS BTM_SetMinEncKeySize(UINT8 key_size, tBTM_CMPL_CB *p_cb);
|
||||
#endif
|
||||
|
||||
/*******************************************************************************
|
||||
**
|
||||
** Function BTM_WriteVoiceSettings
|
||||
|
||||
@@ -212,6 +212,7 @@
|
||||
#define HCI_WRITE_ERRONEOUS_DATA_RPT (0x005B | HCI_GRP_HOST_CONT_BASEBAND_CMDS)
|
||||
#define HCI_ENHANCED_FLUSH (0x005F | HCI_GRP_HOST_CONT_BASEBAND_CMDS)
|
||||
#define HCI_SEND_KEYPRESS_NOTIF (0x0060 | HCI_GRP_HOST_CONT_BASEBAND_CMDS)
|
||||
#define HCI_SET_MIN_ENC_KEY_SIZE (0x0084 | HCI_GRP_HOST_CONT_BASEBAND_CMDS)
|
||||
|
||||
|
||||
/* AMP HCI */
|
||||
@@ -424,8 +425,9 @@
|
||||
#define HCI_SUBCODE_BLE_MAX 0x7F
|
||||
|
||||
//ESP BT subcode define
|
||||
#define HCI_SUBCODE_BT_INIT 0x00
|
||||
#define HCI_SUBCODE_BT_MAX 0x7F
|
||||
#define HCI_SUBCODE_BT_INIT 0x00
|
||||
#define HCI_SUBCODE_BT_SET_MIN_ENC_KEY_SIZE 0x02
|
||||
#define HCI_SUBCODE_BT_MAX 0x7F
|
||||
|
||||
#define HCI_ESP_VENDOR_OPCODE_BUILD(ogf, group, subcode) ((ogf << 10) | (group <<7) | (subcode << 0))
|
||||
/*
|
||||
@@ -467,6 +469,7 @@
|
||||
/* BLE clear legacy advertising */
|
||||
#define HCI_VENDOR_BLE_CLEAR_ADV HCI_ESP_VENDOR_OPCODE_BUILD(HCI_VENDOR_OGF, HCI_ESP_GROUP_BLE, HCI_SUBCODE_BLE_CLEAR_ADV)
|
||||
//ESP BT HCI CMD
|
||||
#define HCI_VENDOR_BT_SET_MIN_ENC_KEY_SIZE HCI_ESP_VENDOR_OPCODE_BUILD(HCI_VENDOR_OGF, HCI_ESP_GROUP_BT, HCI_SUBCODE_BT_SET_MIN_ENC_KEY_SIZE)
|
||||
|
||||
/* subcode for multi adv feature */
|
||||
#define BTM_BLE_MULTI_ADV_SET_PARAM 0x01
|
||||
|
||||
@@ -583,6 +583,10 @@ BOOLEAN btsnd_hcic_set_afh_channels (AFH_CHANNELS channels);
|
||||
BOOLEAN btsnd_hcic_ble_set_channels (BLE_CHANNELS channels);
|
||||
#define HCIC_PARAM_SIZE_BLE_SET_CHANNELS 5
|
||||
|
||||
/* set minimum encryption key size */
|
||||
BOOLEAN btsnd_hcic_set_min_enc_key_size (UINT8 size);
|
||||
#define HCIC_PARAM_SIZE_SET_MIN_ENC_KEY_SIZE 1
|
||||
|
||||
BOOLEAN btsnd_hcic_write_pin_type(UINT8 type); /* Write PIN Type */
|
||||
BOOLEAN btsnd_hcic_write_auto_accept(UINT8 flag); /* Write Auto Accept */
|
||||
BOOLEAN btsnd_hcic_read_name (void); /* Read Local Name */
|
||||
|
||||
Reference in New Issue
Block a user