From 08740df98867cac0af5e00a7ea3eef8f7f1bbe34 Mon Sep 17 00:00:00 2001 From: zhiweijian Date: Tue, 18 Nov 2025 20:59:33 +0800 Subject: [PATCH] fix(ble/bluedroid): Delete BLE_HOST_SETUP_STORAGE_EN --- .../bt/host/bluedroid/bta/dm/bta_dm_act.c | 73 ------------------- .../bt/host/bluedroid/bta/dm/bta_dm_api.c | 42 ----------- .../bt/host/bluedroid/bta/dm/bta_dm_main.c | 3 - .../bluedroid/bta/dm/include/bta_dm_int.h | 25 ------- .../host/bluedroid/bta/include/bta/bta_api.h | 62 ---------------- .../common/include/common/bt_target.h | 4 - .../stack/include/stack/btm_ble_api.h | 14 ---- 7 files changed, 223 deletions(-) diff --git a/components/bt/host/bluedroid/bta/dm/bta_dm_act.c b/components/bt/host/bluedroid/bta/dm/bta_dm_act.c index c0e75d95c1..4fd35c54df 100644 --- a/components/bt/host/bluedroid/bta/dm/bta_dm_act.c +++ b/components/bt/host/bluedroid/bta/dm/bta_dm_act.c @@ -6125,79 +6125,6 @@ void bta_dm_api_cs_procedure_enable(tBTA_DM_MSG *p_data) } #endif // (BT_BLE_FEAT_CHANNEL_SOUNDING == TRUE) -#if (BLE_HOST_SETUP_STORAGE_EN == TRUE) -/******************************************************************************* -** -** Function bta_dm_ble_setup_storage -** -** Description This function configures up the storage parameters for ADV batch scanning -** -** Parameters: -** -*******************************************************************************/ -void bta_dm_ble_setup_storage (tBTA_DM_MSG *p_data) -{ - tBTM_STATUS btm_status = 0; - tBTM_BLE_VSC_CB cmn_ble_vsc_cb; - - BTM_BleGetVendorCapabilities(&cmn_ble_vsc_cb); - - if (0 != cmn_ble_vsc_cb.tot_scan_results_strg) { - btm_status = BTM_BleSetStorageConfig(p_data->ble_set_storage.batch_scan_full_max, - p_data->ble_set_storage.batch_scan_trunc_max, - p_data->ble_set_storage.batch_scan_notify_threshold, - p_data->ble_set_storage.p_setup_cback, - p_data->ble_set_storage.p_thres_cback, - p_data->ble_set_storage.p_read_rep_cback, - p_data->ble_set_storage.ref_value); - } - - if (BTM_CMD_STARTED != btm_status) { - bta_ble_scan_setup_cb(BTM_BLE_BATCH_SCAN_CFG_STRG_EVT, p_data->ble_set_storage.ref_value, - btm_status); - } -} -#endif // #if (BLE_HOST_SETUP_STORAGE_EN == TRUE) - -/******************************************************************************* -** -** Function bta_ble_scan_setup_cb -** -** Description Handle the setup callback from BTM layer and forward it to app layer -** -** Parameters: -** -*******************************************************************************/ -void bta_ble_scan_setup_cb(tBTM_BLE_BATCH_SCAN_EVT evt, tBTM_BLE_REF_VALUE ref_value, - tBTM_STATUS status) -{ - tBTA_BLE_BATCH_SCAN_EVT bta_evt = 0; - - APPL_TRACE_DEBUG("bta_ble_scan_setup_cb : evt: %d, ref_value: %d, status:%d", evt, - ref_value, status); - - switch (evt) { - case BTM_BLE_BATCH_SCAN_ENABLE_EVT: - bta_evt = BTA_BLE_BATCH_SCAN_ENB_EVT; - break; - case BTM_BLE_BATCH_SCAN_CFG_STRG_EVT: - bta_evt = BTA_BLE_BATCH_SCAN_CFG_STRG_EVT; - break; - case BTM_BLE_BATCH_SCAN_DISABLE_EVT: - bta_evt = BTA_BLE_BATCH_SCAN_DIS_EVT; - break; - case BTM_BLE_BATCH_SCAN_PARAM_EVT: - bta_evt = BTA_BLE_BATCH_SCAN_PARAM_EVT; - break; - default: - break; - } - - if (NULL != bta_dm_cb.p_setup_cback) { - bta_dm_cb.p_setup_cback(bta_evt, ref_value, status); - } -} - #if ((defined BTA_GATT_INCLUDED) && (BTA_GATT_INCLUDED == TRUE) && SDP_INCLUDED == TRUE) #ifndef BTA_DM_GATT_CLOSE_DELAY_TOUT #define BTA_DM_GATT_CLOSE_DELAY_TOUT 1000 diff --git a/components/bt/host/bluedroid/bta/dm/bta_dm_api.c b/components/bt/host/bluedroid/bta/dm/bta_dm_api.c index 850155de4a..ffd2872f85 100644 --- a/components/bt/host/bluedroid/bta/dm/bta_dm_api.c +++ b/components/bt/host/bluedroid/bta/dm/bta_dm_api.c @@ -1605,48 +1605,6 @@ void BTA_DmUpdateDuplicateExceptionalList(UINT8 subcode, UINT32 type, BD_ADDR de bta_sys_sendmsg(p_msg); } } -#if (BLE_HOST_SETUP_STORAGE_EN == TRUE) -/******************************************************************************* -** -** Function BTA_DmBleSetStorageParams -** -** Description This function is called to override the BTA scan response. -** -** Parameters batch_scan_full_max -Max storage space (in %) allocated to full scanning -** batch_scan_trunc_max -Max storage space (in %) allocated to truncated scanning -** batch_scan_notify_threshold -Setup notification level based on total space -** p_setup_cback - Setup callback pointer -** p_thres_cback - Threshold callback pointer -** p_rep_cback - Reports callback pointer -** ref_value - Ref value -** -** Returns None -** -*******************************************************************************/ -extern void BTA_DmBleSetStorageParams(UINT8 batch_scan_full_max, - UINT8 batch_scan_trunc_max, - UINT8 batch_scan_notify_threshold, - tBTA_BLE_SCAN_SETUP_CBACK *p_setup_cback, - tBTA_BLE_SCAN_THRESHOLD_CBACK *p_thres_cback, - tBTA_BLE_SCAN_REP_CBACK *p_rep_cback, - tBTA_DM_BLE_REF_VALUE ref_value) -{ - tBTA_DM_API_SET_STORAGE_CONFIG *p_msg; - bta_dm_cb.p_setup_cback = p_setup_cback; - if ((p_msg = (tBTA_DM_API_SET_STORAGE_CONFIG *) - osi_malloc(sizeof(tBTA_DM_API_SET_STORAGE_CONFIG))) != NULL) { - p_msg->hdr.event = BTA_DM_API_BLE_SETUP_STORAGE_EVT; - p_msg->p_setup_cback = bta_ble_scan_setup_cb; - p_msg->p_thres_cback = p_thres_cback; - p_msg->p_read_rep_cback = p_rep_cback; - p_msg->ref_value = ref_value; - p_msg->batch_scan_full_max = batch_scan_full_max; - p_msg->batch_scan_trunc_max = batch_scan_trunc_max; - p_msg->batch_scan_notify_threshold = batch_scan_notify_threshold; - bta_sys_sendmsg(p_msg); - } -} -#endif // #if (BLE_HOST_SETUP_STORAGE_EN == TRUE) #endif diff --git a/components/bt/host/bluedroid/bta/dm/bta_dm_main.c b/components/bt/host/bluedroid/bta/dm/bta_dm_main.c index 6a2f9eabc6..377a2ac949 100644 --- a/components/bt/host/bluedroid/bta/dm/bta_dm_main.c +++ b/components/bt/host/bluedroid/bta/dm/bta_dm_main.c @@ -175,9 +175,6 @@ const tBTA_DM_ACTION bta_dm_action[BTA_DM_MAX_EVT] = { bta_dm_ble_broadcast, /* BTA_DM_API_BLE_BROADCAST_EVT */ #endif // #if (BLE_42_ADV_EN == TRUE) bta_dm_ble_set_data_length, /* BTA_DM_API_SET_DATA_LENGTH_EVT */ -#if (BLE_HOST_SETUP_STORAGE_EN == TRUE) - bta_dm_ble_setup_storage, /* BTA_DM_API_BLE_SETUP_STORAGE_EVT */ -#endif // #if (BLE_HOST_SETUP_STORAGE_EN == TRUE) bta_dm_ble_disconnect, /* BTA_DM_API_BLE_DISCONNECT_EVT */ #endif bta_dm_remove_device, /* BTA_DM_API_REMOVE_DEVICE_EVT */ diff --git a/components/bt/host/bluedroid/bta/dm/include/bta_dm_int.h b/components/bt/host/bluedroid/bta/dm/include/bta_dm_int.h index 18607a16be..a0c1fce523 100644 --- a/components/bt/host/bluedroid/bta/dm/include/bta_dm_int.h +++ b/components/bt/host/bluedroid/bta/dm/include/bta_dm_int.h @@ -159,9 +159,6 @@ enum { BTA_DM_API_BLE_BROADCAST_EVT, #endif // #if (BLE_42_ADV_EN == TRUE) BTA_DM_API_SET_DATA_LENGTH_EVT, -#if (BLE_HOST_SETUP_STORAGE_EN == TRUE) - BTA_DM_API_BLE_SETUP_STORAGE_EVT, -#endif // #if (BLE_HOST_SETUP_STORAGE_EN == TRUE) BTA_DM_API_BLE_DISCONNECT_EVT, @@ -909,19 +906,6 @@ typedef struct { tBTA_SET_ADV_DATA_CMPL_CBACK *p_adv_data_cback; } tBTA_DM_API_SET_ADV_CONFIG_RAW; -#if (BLE_HOST_SETUP_STORAGE_EN == TRUE) -typedef struct { - BT_HDR hdr; - UINT8 batch_scan_full_max; - UINT8 batch_scan_trunc_max; - UINT8 batch_scan_notify_threshold; - tBTA_BLE_SCAN_SETUP_CBACK *p_setup_cback; - tBTA_BLE_SCAN_THRESHOLD_CBACK *p_thres_cback; - tBTA_BLE_SCAN_REP_CBACK *p_read_rep_cback; - tBTA_DM_BLE_REF_VALUE ref_value; -} tBTA_DM_API_SET_STORAGE_CONFIG; -#endif // #if (BLE_HOST_SETUP_STORAGE_EN == TRUE) - typedef struct { BT_HDR hdr; BD_ADDR remote_bda; @@ -1715,9 +1699,6 @@ typedef union { tBTA_DM_APT_CLEAR_ADDR clear_addr; tBTA_DM_API_SET_RPA_TIMEOUT set_rpa_timeout; tBTA_DM_API_ADD_DEV_TO_RESOLVING_LIST add_dev_to_resolving_list; -#if (BLE_HOST_SETUP_STORAGE_EN == TRUE) - tBTA_DM_API_SET_STORAGE_CONFIG ble_set_storage; -#endif // #if (BLE_HOST_SETUP_STORAGE_EN == TRUE) tBTA_DM_API_BLE_DISCONNECT ble_disconnect; tBTA_DM_API_UPDATE_DUPLICATE_EXCEPTIONAL_LIST ble_duplicate_exceptional_list; #if (BLE_50_FEATURE_SUPPORT == TRUE) @@ -1955,9 +1936,6 @@ typedef struct { BOOLEAN is_bta_dm_active; tBTA_DM_ACTIVE_LINK device_list; tBTA_DM_SEC_CBACK *p_sec_cback; -#if ((defined BLE_INCLUDED) && (BLE_INCLUDED == TRUE)) - tBTA_BLE_SCAN_SETUP_CBACK *p_setup_cback; -#endif UINT16 state; BOOLEAN disabling; TIMER_LIST_ENT disable_timer; @@ -2308,9 +2286,6 @@ extern void bta_dm_ble_gap_set_ext_scan_params(tBTA_DM_MSG *p_data); extern void bta_dm_ble_gap_ext_scan(tBTA_DM_MSG *p_data); extern void bta_dm_ble_gap_set_prefer_ext_conn_params(tBTA_DM_MSG *p_data); #endif // #if (BLE_50_FEATURE_SUPPORT == TRUE) -#if (BLE_HOST_SETUP_STORAGE_EN == TRUE) -extern void bta_dm_ble_setup_storage(tBTA_DM_MSG *p_data); -#endif // #if (BLE_HOST_SETUP_STORAGE_EN == TRUE) extern void bta_dm_ble_enable_batch_scan(tBTA_DM_MSG *p_data); extern void bta_dm_ble_disable_batch_scan(tBTA_DM_MSG *p_data); extern void bta_dm_ble_read_scan_reports(tBTA_DM_MSG *p_data); diff --git a/components/bt/host/bluedroid/bta/include/bta/bta_api.h b/components/bt/host/bluedroid/bta/include/bta/bta_api.h index 3f8c0524e4..1945148848 100644 --- a/components/bt/host/bluedroid/bta/include/bta/bta_api.h +++ b/components/bt/host/bluedroid/bta/include/bta/bta_api.h @@ -530,16 +530,6 @@ enum { }; typedef UINT8 tBTA_BLE_ADV_CHANGE_REASON; -enum { - BTA_BLE_BATCH_SCAN_ENB_EVT = 1, - BTA_BLE_BATCH_SCAN_CFG_STRG_EVT = 2, - BTA_BLE_BATCH_SCAN_DATA_EVT = 3, - BTA_BLE_BATCH_SCAN_THRES_EVT = 4, - BTA_BLE_BATCH_SCAN_PARAM_EVT = 5, - BTA_BLE_BATCH_SCAN_DIS_EVT = 6 -}; -typedef tBTM_BLE_BATCH_SCAN_EVT tBTA_BLE_BATCH_SCAN_EVT; - // #endif /* BLE customer specific feature function type definitions */ @@ -1218,10 +1208,6 @@ typedef void (tBTA_BLE_SCAN_REP_CBACK) (tBTA_DM_BLE_REF_VALUE ref_value, UINT8 r UINT8 num_records, UINT16 data_len, UINT8 *p_rep_data, tBTA_STATUS status); -typedef void (tBTA_BLE_SCAN_SETUP_CBACK) (tBTA_BLE_BATCH_SCAN_EVT evt, - tBTA_DM_BLE_REF_VALUE ref_value, - tBTA_STATUS status); - typedef void (tBTA_START_STOP_SCAN_CMPL_CBACK) (tBTA_STATUS status); typedef void (tBTA_START_STOP_ADV_CMPL_CBACK) (tBTA_STATUS status); @@ -3033,54 +3019,6 @@ void BTA_DmBleGapCsSetProcPatams(tBTA_DM_CS_SET_PROC_PARAMS *set_proc_params); void BTA_DmBleGapCsProcEnable(uint16_t conn_handle, uint8_t config_id, uint8_t enable); #endif // (BT_BLE_FEAT_CHANNEL_SOUNDING == TRUE) -/******************************************************************************* -** -** Function BTA_DmBleSetStorageParams -** -** Description This function is called to set the storage parameters -** -** Parameters batch_scan_full_max -Max storage space (in %) allocated to full scanning -** batch_scan_trunc_max -Max storage space (in %) allocated to truncated scanning -** batch_scan_notify_threshold - Setup notification level based on total space -** consumed by both pools. Setting it to 0 will disable threshold notification -** p_setup_cback - Setup callback -** p_thres_cback - Threshold callback -** p_rep_cback - Reports callback -** ref_value - Reference value -** -** Returns None -** -*******************************************************************************/ -extern void BTA_DmBleSetStorageParams(UINT8 batch_scan_full_max, - UINT8 batch_scan_trunc_max, - UINT8 batch_scan_notify_threshold, - tBTA_BLE_SCAN_SETUP_CBACK *p_setup_cback, - tBTA_BLE_SCAN_THRESHOLD_CBACK *p_thres_cback, - tBTA_BLE_SCAN_REP_CBACK *p_rep_cback, - tBTA_DM_BLE_REF_VALUE ref_value); - -/******************************************************************************* -** -** Function BTA_DmBleEnableBatchScan -** -** Description This function is called to enable the batch scan -** -** Parameters scan_mode -Batch scan mode -** scan_interval - Scan interval -** scan_window - Scan window -** discard_rule -Discard rules -** addr_type - Address type -** ref_value - Reference value -** -** Returns None -** -*******************************************************************************/ -extern void BTA_DmBleEnableBatchScan(tBTA_BLE_BATCH_SCAN_MODE scan_mode, - UINT32 scan_interval, UINT32 scan_window, - tBTA_BLE_DISCARD_RULE discard_rule, - tBLE_ADDR_TYPE addr_type, - tBTA_DM_BLE_REF_VALUE ref_value); - /******************************************************************************* ** ** Function BTA_DmBleReadScanReports diff --git a/components/bt/host/bluedroid/common/include/common/bt_target.h b/components/bt/host/bluedroid/common/include/common/bt_target.h index 733799a1da..96e914d2b5 100644 --- a/components/bt/host/bluedroid/common/include/common/bt_target.h +++ b/components/bt/host/bluedroid/common/include/common/bt_target.h @@ -1618,10 +1618,6 @@ #define BLE_INCLUDED FALSE #endif -#ifndef BLE_HOST_SETUP_STORAGE_EN -#define BLE_HOST_SETUP_STORAGE_EN FALSE -#endif - #ifndef BLE_HOST_BG_CONNECT_EN #define BLE_HOST_BG_CONNECT_EN FALSE #endif diff --git a/components/bt/host/bluedroid/stack/include/stack/btm_ble_api.h b/components/bt/host/bluedroid/stack/include/stack/btm_ble_api.h index cda8df761c..f6902af8d8 100644 --- a/components/bt/host/bluedroid/stack/include/stack/btm_ble_api.h +++ b/components/bt/host/bluedroid/stack/include/stack/btm_ble_api.h @@ -913,18 +913,6 @@ typedef UINT8 tBTM_BLE_CONN_TYPE; #define ADV_INFO_PRESENT 0x00 #define NO_ADV_INFO_PRESENT 0x01 -#define BTM_BLE_MULTI_ADV_INVALID 0 - -#define BTM_BLE_BATCH_SCAN_ENABLE_EVT 1 -#define BTM_BLE_BATCH_SCAN_CFG_STRG_EVT 2 -#define BTM_BLE_BATCH_SCAN_READ_REPTS_EVT 3 -#define BTM_BLE_BATCH_SCAN_THR_EVT 4 -#define BTM_BLE_BATCH_SCAN_PARAM_EVT 5 -#define BTM_BLE_BATCH_SCAN_DISABLE_EVT 6 - -typedef UINT8 tBTM_BLE_BATCH_SCAN_EVT; - - typedef BOOLEAN (tBTM_BLE_SEL_CBACK)(BD_ADDR random_bda, UINT8 *p_remote_name); /* callback function for SMP signing algorithm, signed data in little endian order with tlen bits long */ @@ -936,8 +924,6 @@ typedef void (tBTM_BLE_RANDOM_SET_CBACK) (BD_ADDR random_bda); typedef void (tBTM_BLE_SCAN_REQ_CBACK)(BD_ADDR remote_bda, tBLE_ADDR_TYPE addr_type, UINT8 adv_evt); typedef void (*tBLE_SCAN_PARAM_SETUP_CBACK)(tGATT_IF client_if, tBTM_STATUS status); -tBTM_BLE_SCAN_SETUP_CBACK bta_ble_scan_setup_cb; - typedef void (tBTM_START_ADV_CMPL_CBACK) (UINT8 status); typedef void (tBTM_START_STOP_ADV_CMPL_CBACK) (UINT8 status);