feat(bt/bluedroid): optimize bluedroid menuconfig

This commit is contained in:
zhiweijian
2025-01-09 11:23:00 +08:00
parent 0959beef72
commit fb08e4eafe
34 changed files with 680 additions and 715 deletions
@@ -367,7 +367,6 @@ typedef UINT32 tBTM_BLE_AD_MASK;
#define BTM_BLE_AD_TYPE_MANU HCI_EIR_MANUFACTURER_SPECIFIC_TYPE /* 0xff */
typedef UINT8 tBTM_BLE_AD_TYPE;
#define BTM_BLE_LONG_ADV_MAX_LEN 249
/* Security settings used with L2CAP LE COC */
#define BTM_SEC_LE_LINK_ENCRYPTED 0x01
@@ -1013,6 +1012,7 @@ typedef void (tBTM_SET_CSA_SUPPORT_CMPL_CBACK) (tBTM_STATUS status);
#define BTM_BLE_5_GAP_READ_PHY_COMPLETE_EVT 1
#define BTM_BLE_5_GAP_SET_PREFERED_DEFAULT_PHY_COMPLETE_EVT 2
#define BTM_BLE_5_GAP_SET_PREFERED_PHY_COMPLETE_EVT 3
#if (BLE_50_EXTEND_ADV_EN == TRUE)
#define BTM_BLE_5_GAP_EXT_ADV_SET_RAND_ADDR_COMPLETE_EVT 4
#define BTM_BLE_5_GAP_EXT_ADV_SET_PARAMS_COMPLETE_EVT 5
#define BTM_BLE_5_GAP_EXT_ADV_DATA_SET_COMPLETE_EVT 6
@@ -1021,6 +1021,8 @@ typedef void (tBTM_SET_CSA_SUPPORT_CMPL_CBACK) (tBTM_STATUS status);
#define BTM_BLE_5_GAP_EXT_ADV_STOP_COMPLETE_EVT 9
#define BTM_BLE_5_GAP_EXT_ADV_SET_REMOVE_COMPLETE_EVT 10
#define BTM_BLE_5_GAP_EXT_ADV_SET_CLEAR_COMPLETE_EVT 11
#endif // #if (BLE_50_EXTEND_ADV_EN == TRUE)
#if (BLE_50_PERIODIC_ADV_EN == TRUE)
#define BTM_BLE_5_GAP_PERIODIC_ADV_SET_PARAMS_COMPLETE_EVT 12
#define BTM_BLE_5_GAP_PERIODIC_ADV_DATA_SET_COMPLETE_EVT 13
#define BTM_BLE_5_GAP_PERIODIC_ADV_START_COMPLETE_EVT 14
@@ -1031,19 +1033,28 @@ typedef void (tBTM_SET_CSA_SUPPORT_CMPL_CBACK) (tBTM_STATUS status);
#define BTM_BLE_5_GAP_PERIODIC_ADV_ADD_DEV_COMPLETE_EVT 19
#define BTM_BLE_5_GAP_PERIODIC_ADV_REMOVE_DEV_COMPLETE_EVT 20
#define BTM_BLE_5_GAP_PERIODIC_ADV_CLEAR_DEV_COMPLETE_EVT 21
#endif // #if (BLE_50_PERIODIC_ADV_EN == TRUE)
#if (BLE_50_EXTEND_SCAN_EN == TRUE)
#define BTM_BLE_5_GAP_SET_EXT_SCAN_PARAMS_COMPLETE_EVT 22
#define BTM_BLE_5_GAP_EXT_SCAN_START_COMPLETE_EVT 23
#define BTM_BLE_5_GAP_EXT_SCAN_STOP_COMPLETE_EVT 24
#endif // #if (BLE_50_EXTEND_SCAN_EN == TRUE)
#define BTM_BLE_5_GAP_PREFER_EXT_CONN_PARAMS_SET_COMPLETE_EVT 25
#define BTM_BLE_5_GAP_PHY_UPDATE_COMPLETE_EVT 26
#if (BLE_50_EXTEND_SCAN_EN == TRUE)
#define BTM_BLE_5_GAP_EXT_ADV_REPORT_EVT 27
#define BTM_BLE_5_GAP_SCAN_TIMEOUT_EVT 28
#endif // #if (BLE_50_EXTEND_SCAN_EN == TRUE)
#if (BLE_50_EXTEND_ADV_EN == TRUE)
#define BTM_BLE_5_GAP_ADV_TERMINATED_EVT 29
#define BTM_BLE_5_GAP_SCAN_REQ_RECEIVED_EVT 30
#endif // #if (BLE_50_EXTEND_ADV_EN == TRUE)
#define BTM_BLE_5_GAP_CHANNEL_SELETE_ALGORITHM_EVT 31
#if (BLE_50_EXTEND_SYNC_EN == TRUE)
#define BTM_BLE_5_GAP_PERIODIC_ADV_REPORT_EVT 32
#define BTM_BLE_5_GAP_PERIODIC_ADV_SYNC_LOST_EVT 33
#define BTM_BLE_5_GAP_PERIODIC_ADV_SYNC_ESTAB_EVT 34
#endif // #if (BLE_50_EXTEND_SYNC_EN == TRUE)
#if (BLE_FEAT_PERIODIC_ADV_SYNC_TRANSFER == TRUE)
#define BTM_BLE_GAP_PERIODIC_ADV_RECV_ENABLE_COMPLETE_EVT 35
#define BTM_BLE_GAP_PERIODIC_ADV_SYNC_TRANS_COMPLETE_EVT 36
@@ -1313,12 +1324,15 @@ typedef union {
tBTM_BLE_READ_PHY_CMPL read_phy;
tBTM_BLE_SET_PREF_DEF_PHY_CMPL set_perf_def_phy;
tBTM_BLE_SET_PERF_PHY_CMPL set_perf_phy;
#if (BLE_50_EXTEND_ADV_EN == TRUE)
tBTM_BLE_EXT_ADV_SET_RAND_ADDR_CMPL set_ext_rand_addr;
tBTM_BLE_EXT_ADV_SET_PARAMS_CMPL set_params;
tBTM_BLE_EXT_ADV_DATA_SET_CMPL adv_data_set;
tBTM_BLE_EXT_ADV_SCAN_RSP_DATA_SET_CMPL scan_rsp_data_set;
tBTM_BLE_EXT_ADV_START_CMPL adv_start;
tBTM_BLE_EXT_ADV_STOP_CMPL adv_stop;
#endif // #if (BLE_50_EXTEND_ADV_EN == TRUE)
#if (BLE_50_PERIODIC_ADV_EN == TRUE)
tBTM_BLE_PERIOD_ADV_SET_PARAMS_CMPL per_adv_set_params;
tBTM_BLE_PERIOD_ADV_DATA_SET_CMPL per_adv_data_set;
tBTM_BLE_PERIOD_ADV_START_CMPL per_adv_start;
@@ -1329,18 +1343,27 @@ typedef union {
tBTM_BLE_PERIOD_ADV_ADD_DEV_CMPL per_adv_add_dev;
tBTM_BLE_PERIOD_ADV_REMOVE_DEV_CMPL per_adv_remove_dev;
tBTM_BLE_PEROID_ADV_CLEAR_DEV_CMPL per_adv_clear_dev;
#endif // #if (BLE_50_PERIODIC_ADV_EN == TRUE)
#if (BLE_50_EXTEND_SCAN_EN == TRUE)
tBTM_BLE_SET_EXT_SCAN_PARAMS_CMPL ext_scan;
tBTM_BLE_EXT_SCAN_START_CMPL scan_start;
tBTM_BLE_EXT_SCAN_STOP_CMPL scan_stop;
#endif // #if (BLE_50_EXTEND_SCAN_EN == TRUE)
tBTM_BLE_PREF_EXT_CONN_SET_PARAMS_CMPL ext_conn_set_params;
tBTM_BLE_PHY_UPDATE_CMPL phy_update;
#if (BLE_50_EXTEND_SCAN_EN == TRUE)
tBTM_BLE_EXT_ADV_REPORT ext_adv_report;
#endif // #if (BLE_50_EXTEND_SCAN_EN == TRUE)
#if (BLE_50_EXTEND_ADV_EN == TRUE)
tBTM_BLE_ADV_TERMINAT adv_term;
tBTM_BLE_SCAN_REQ_RECEIVED scan_req;
#endif // #if (BLE_50_EXTEND_ADV_EN == TRUE)
tBTM_BLE_CHANNEL_SEL_ALG channel_sel;
#if (BLE_50_EXTEND_SYNC_EN == TRUE)
tBTM_PERIOD_ADV_REPORT period_adv_report;
tBTM_BLE_PERIOD_ADV_SYNC_LOST sync_lost;
tBTM_BLE_PERIOD_ADV_SYNC_ESTAB sync_estab;
#endif // #if (BLE_50_EXTEND_SYNC_EN == TRUE)
#if (BLE_FEAT_PERIODIC_ADV_SYNC_TRANSFER == TRUE)
tBTM_BLE_PERIOD_ADV_RECV_ENABLE_CMPL per_adv_recv_enable;
tBTM_BLE_PERIOD_ADV_SYNC_TRANS_CMPL per_adv_sync_trans;
@@ -1424,23 +1447,6 @@ BOOLEAN BTM_SecAddBleDevice (BD_ADDR bd_addr, BD_NAME bd_name,
BOOLEAN BTM_SecAddBleKey (BD_ADDR bd_addr, tBTM_LE_KEY_VALUE *p_le_key,
tBTM_LE_KEY_TYPE key_type);
/*******************************************************************************
**
** Function BTM_BleSetAdvParams
**
** Description This function is called to set advertising parameters.
**
** Parameters: None.
**
** Returns void
**
*******************************************************************************/
//extern
tBTM_STATUS BTM_BleSetAdvParams(UINT16 adv_int_min, UINT16 adv_int_max,
tBLE_BD_ADDR *p_dir_bda, tBTM_BLE_ADV_CHNL_MAP chnl_map);
/*******************************************************************************
**
** Function BTM_BleSetAdvParamsAll
@@ -1485,20 +1491,6 @@ tBTM_STATUS BTM_BleStartAdv(void);
tBTM_STATUS BTM_BleWriteAdvData(tBTM_BLE_AD_MASK data_mask,
tBTM_BLE_ADV_DATA *p_data);
/*******************************************************************************
**
** Function BTM_BleWriteLongAdvData
**
** Description This function is called to write long advertising data.
**
** Parameters: adv_data: long advertising data
** adv_data_len: the length of long advertising data
**
** Returns void
**
*******************************************************************************/
tBTM_STATUS BTM_BleWriteLongAdvData(uint8_t *adv_data, uint8_t adv_data_len);
/*******************************************************************************
**
** Function BTM_BleWriteAdvDataRaw
@@ -2789,12 +2781,13 @@ tBTM_STATUS BTM_BleSetExtendedScanParams(tBTM_BLE_EXT_SCAN_PARAMS *params);
tBTM_STATUS BTM_BleExtendedScan(BOOLEAN enable, UINT16 duration, UINT16 period);
void BTM_BleSetPreferExtenedConnParams(BD_ADDR bd_addr, tBTM_EXT_CONN_PARAMS *params);
#endif // #if (BLE_50_FEATURE_SUPPORT == TRUE)
#if (BLE_50_DTM_TEST_EN == TRUE)
void BTM_BleEnhancedReceiverTest(UINT8 rx_freq, UINT8 phy, UINT8 modulation_index, tBTM_CMPL_CB *p_cmd_cmpl_cback);
void BTM_BleEnhancedTransmitterTest(UINT8 tx_freq, UINT8 test_data_len, UINT8 packet_payload, UINT8 phy, tBTM_CMPL_CB *p_cmd_cmpl_cback);
#endif // #if (BLE_50_FEATURE_SUPPORT == TRUE)
#endif // #if (BLE_50_DTM_TEST_EN == TRUE)
#if (BLE_FEAT_PERIODIC_ADV_SYNC_TRANSFER == TRUE)
void BTM_BlePeriodicAdvRecvEnable(UINT16 sync_handle, UINT8 enable);
@@ -357,8 +357,12 @@
#define HCI_BLE_READ_PHY (0x0030 | HCI_GRP_BLE_CMDS)
#define HCI_BLE_SET_DEFAULT_PHY (0x0031 | HCI_GRP_BLE_CMDS)
#define HCI_BLE_SET_PHY (0x0032 | HCI_GRP_BLE_CMDS)
#endif
#if (BLE_50_DTM_TEST_EN == TRUE)
#define HCI_BLE_ENH_RX_TEST (0x0033 | HCI_GRP_BLE_CMDS)
#define HCI_BLE_ENH_TX_TEST (0x0034 | HCI_GRP_BLE_CMDS)
#endif // #if (BLE_50_DTM_TEST_EN == TRUE)
#if (BLE_50_FEATURE_SUPPORT == TRUE)
#define HCI_BLE_SET_ADV_RAND_ADDR (0x0035 | HCI_GRP_BLE_CMDS)
#define HCI_BLE_SET_EXT_ADV_PARAM (0x0036 | HCI_GRP_BLE_CMDS)
#define HCI_BLE_SET_EXT_ADV_DATA (0x0037 | HCI_GRP_BLE_CMDS)
@@ -461,8 +465,6 @@
#define HCI_BLE_ENERGY_INFO_OCF HCI_ESP_VENDOR_OPCODE_BUILD(HCI_VENDOR_OGF, HCI_ESP_GROUP_BLE, HCI_SUBCODE_BLE_ENERGY_INFO)
/* Extended BLE Scan parameters OCF */
#define HCI_BLE_EXTENDED_SCAN_PARAMS_OCF HCI_ESP_VENDOR_OPCODE_BUILD(HCI_VENDOR_OGF, HCI_ESP_GROUP_BLE, HCI_SUBCODE_BLE_EXTENDED_SCAN_PARAMS)
/* Long BLE Adv data OCF */
#define HCI_VENDOR_BLE_LONG_ADV_DATA HCI_ESP_VENDOR_OPCODE_BUILD(HCI_VENDOR_OGF, HCI_ESP_GROUP_BLE, HCI_SUBCODE_BLE_LONG_ADV)
/* BLE update duplicate scan exceptional list */
#define HCI_VENDOR_BLE_UPDATE_DUPLICATE_EXCEPTIONAL_LIST HCI_ESP_VENDOR_OPCODE_BUILD(HCI_VENDOR_OGF, HCI_ESP_GROUP_BLE, HCI_SUBCODE_BLE_DUPLICATE_EXCEPTIONAL_LIST)
#define HCI_VENDOR_BLE_SET_ADV_FLOW_CONTROL HCI_ESP_VENDOR_OPCODE_BUILD(HCI_VENDOR_OGF, HCI_ESP_GROUP_BLE, HCI_SUBCODE_BLE_SET_ADV_FLOW_CONTROL)
@@ -764,8 +764,12 @@ void btsnd_hcic_vendor_spec_cmd (BT_HDR *buffer, UINT16 opcode,
#define HCIC_PARAM_SIZE_BLE_READ_PHY 2
#define HCIC_PARAM_SIZE_BLE_SET_DEF_PHY 3
#define HCIC_PARAM_SIZE_BLE_SET_PHY 7
#endif
#if (BLE_50_DTM_TEST_EN == TRUE)
#define HCIC_PARAM_SIZE_ENH_RX_TEST 3
#define HCIC_PARAM_SIZE_ENH_TX_TEST 4
#endif // #if (BLE_50_DTM_TEST_EN == TRUE)
#if (BLE_50_FEATURE_SUPPORT == TRUE)
#define HCIC_PARAM_SIZE_EXT_RAND_ADDR 7
#define HCIC_PARAM_SIZE_EXT_ADV_SET_PARAMS 25
#define HCIC_PARAM_SIZE_EXT_ADV_WRITE_DATA 251
@@ -963,14 +967,17 @@ UINT8 btsnd_hcic_ble_set_prefered_default_phy(UINT8 all_phys,
BOOLEAN btsnd_hcic_ble_set_phy(UINT16 conn_handle,
UINT8 all_phys, UINT8 tx_phys,
UINT8 rx_phys, UINT16 phy_options);
#endif // #if (BLE_50_FEATURE_SUPPORT == TRUE)
#if (BLE_50_DTM_TEST_EN == TRUE)
UINT8 btsnd_hcic_ble_enhand_rx_test(UINT8 rx_channel, UINT8 phy,
UINT8 modulation_idx);
UINT8 btsnd_hcic_ble_enhand_tx_test(UINT8 tx_channel, UINT8 len,
UINT8 packect,
UINT8 phy);
#endif // #if (BLE_50_DTM_TEST_EN == TRUE)
#if (BLE_50_FEATURE_SUPPORT == TRUE)
UINT8 btsnd_hcic_ble_set_extend_rand_address(UINT8 adv_handle, BD_ADDR rand_addr);
UINT8 btsnd_hcic_ble_set_ext_adv_params(UINT8 adv_handle, UINT16 properties, UINT32 interval_min,