fix(ble/bluedroid): delete BLE_HOST_READ_SCAN_REPORTS_EN
(cherry picked from commit c3a185ae80fc71f9550c247df40421eb3ff18ae6) Co-authored-by: zhiweijian <zhiweijian@espressif.com>
This commit is contained in:
@@ -6475,35 +6475,6 @@ void bta_dm_ble_disable_batch_scan (tBTA_DM_MSG *p_data)
|
||||
}
|
||||
#endif // #if (BLE_HOST_BATCH_SCAN_EN == TRUE)
|
||||
|
||||
#if (BLE_HOST_READ_SCAN_REPORTS_EN == TRUE)
|
||||
/*******************************************************************************
|
||||
**
|
||||
** Function bta_dm_ble_read_scan_reports
|
||||
**
|
||||
** Description This function reads the batch scan reports
|
||||
**
|
||||
** Parameters:
|
||||
**
|
||||
*******************************************************************************/
|
||||
void bta_dm_ble_read_scan_reports(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_BleReadScanReports(p_data->ble_read_reports.scan_type,
|
||||
p_data->ble_read_reports.ref_value);
|
||||
}
|
||||
|
||||
if (BTM_CMD_STARTED != btm_status) {
|
||||
bta_ble_scan_setup_cb(BTM_BLE_BATCH_SCAN_READ_REPTS_EVT, p_data->ble_enable_scan.ref_value,
|
||||
btm_status);
|
||||
}
|
||||
}
|
||||
#endif // #if (BLE_HOST_READ_SCAN_REPORTS_EN == TRUE)
|
||||
|
||||
/*******************************************************************************
|
||||
**
|
||||
** Function bta_ble_scan_setup_cb
|
||||
|
||||
@@ -1856,34 +1856,6 @@ extern void BTA_DmBleDisableBatchScan(tBTA_DM_BLE_REF_VALUE ref_value)
|
||||
}
|
||||
#endif // #if (BLE_HOST_BATCH_SCAN_EN == TRUE)
|
||||
|
||||
#if (BLE_HOST_READ_SCAN_REPORTS_EN == TRUE)
|
||||
/*******************************************************************************
|
||||
**
|
||||
** Function BTA_DmBleReadScanReports
|
||||
**
|
||||
** Description This function is called to read scan reports
|
||||
**
|
||||
** Parameters scan_type -Batch scan mode
|
||||
** ref_value - Reference value
|
||||
**
|
||||
** Returns None
|
||||
**
|
||||
*******************************************************************************/
|
||||
extern void BTA_DmBleReadScanReports(tBTA_BLE_BATCH_SCAN_MODE scan_type,
|
||||
tBTA_DM_BLE_REF_VALUE ref_value)
|
||||
{
|
||||
tBTA_DM_API_READ_SCAN_REPORTS *p_msg;
|
||||
|
||||
if ((p_msg = (tBTA_DM_API_READ_SCAN_REPORTS *)
|
||||
osi_malloc(sizeof(tBTA_DM_API_READ_SCAN_REPORTS))) != NULL) {
|
||||
p_msg->hdr.event = BTA_DM_API_BLE_READ_SCAN_REPORTS_EVT;
|
||||
p_msg->scan_type = scan_type;
|
||||
p_msg->ref_value = ref_value;
|
||||
bta_sys_sendmsg(p_msg);
|
||||
}
|
||||
}
|
||||
#endif // #if (BLE_HOST_READ_SCAN_REPORTS_EN == TRUE)
|
||||
|
||||
#endif
|
||||
|
||||
/*******************************************************************************
|
||||
|
||||
@@ -202,9 +202,6 @@ const tBTA_DM_ACTION bta_dm_action[BTA_DM_MAX_EVT] = {
|
||||
bta_dm_ble_enable_batch_scan, /* BTA_DM_API_BLE_ENABLE_BATCH_SCAN_EVT */
|
||||
bta_dm_ble_disable_batch_scan, /* BTA_DM_API_BLE_DISABLE_BATCH_SCAN_EVT */
|
||||
#endif // #if (BLE_HOST_BATCH_SCAN_EN == TRUE)
|
||||
#if (BLE_HOST_READ_SCAN_REPORTS_EN == TRUE)
|
||||
bta_dm_ble_read_scan_reports, /* BTA_DM_API_BLE_READ_SCAN_REPORTS_EVT */
|
||||
#endif // #if (BLE_HOST_READ_SCAN_REPORTS_EN == TRUE)
|
||||
|
||||
#if (BLE_HOST_ENERGY_INFO_EN == TRUE)
|
||||
bta_dm_ble_get_energy_info, /* BTA_DM_API_BLE_ENERGY_INFO_EVT */
|
||||
|
||||
@@ -188,9 +188,6 @@ enum {
|
||||
BTA_DM_API_BLE_ENABLE_BATCH_SCAN_EVT,
|
||||
BTA_DM_API_BLE_DISABLE_BATCH_SCAN_EVT,
|
||||
#endif // #if (BLE_HOST_BATCH_SCAN_EN == TRUE)
|
||||
#if (BLE_HOST_READ_SCAN_REPORTS_EN == TRUE)
|
||||
BTA_DM_API_BLE_READ_SCAN_REPORTS_EVT,
|
||||
#endif // #if (BLE_HOST_READ_SCAN_REPORTS_EN == TRUE)
|
||||
|
||||
#if (BLE_HOST_ENERGY_INFO_EN == TRUE)
|
||||
BTA_DM_API_BLE_ENERGY_INFO_EVT,
|
||||
@@ -1009,15 +1006,6 @@ typedef struct {
|
||||
} tBTA_DM_API_DISABLE_SCAN;
|
||||
#endif // #if (BLE_HOST_BATCH_SCAN_EN == TRUE)
|
||||
|
||||
#if (BLE_HOST_READ_SCAN_REPORTS_EN == TRUE)
|
||||
typedef struct {
|
||||
BT_HDR hdr;
|
||||
tBTA_BLE_BATCH_SCAN_MODE scan_type;
|
||||
tBTA_DM_BLE_REF_VALUE ref_value;
|
||||
} tBTA_DM_API_READ_SCAN_REPORTS;
|
||||
#endif // #if (BLE_HOST_READ_SCAN_REPORTS_EN == TRUE)
|
||||
|
||||
|
||||
#if (BLE_HOST_ENERGY_INFO_EN == TRUE)
|
||||
typedef struct {
|
||||
BT_HDR hdr;
|
||||
@@ -1890,9 +1878,6 @@ typedef union {
|
||||
#if (BLE_HOST_BATCH_SCAN_EN == TRUE)
|
||||
tBTA_DM_API_ENABLE_SCAN ble_enable_scan;
|
||||
#endif // #if (BLE_HOST_BATCH_SCAN_EN == TRUE)
|
||||
#if (BLE_HOST_READ_SCAN_REPORTS_EN == TRUE)
|
||||
tBTA_DM_API_READ_SCAN_REPORTS ble_read_reports;
|
||||
#endif // #if (BLE_HOST_READ_SCAN_REPORTS_EN == TRUE)
|
||||
#if (BLE_HOST_BATCH_SCAN_EN == TRUE)
|
||||
tBTA_DM_API_DISABLE_SCAN ble_disable_scan;
|
||||
#endif // #if (BLE_HOST_BATCH_SCAN_EN == TRUE)
|
||||
|
||||
@@ -1661,10 +1661,6 @@
|
||||
#define BLE_HOST_SETUP_STORAGE_EN FALSE
|
||||
#endif
|
||||
|
||||
#ifndef BLE_HOST_READ_SCAN_REPORTS_EN
|
||||
#define BLE_HOST_READ_SCAN_REPORTS_EN FALSE
|
||||
#endif
|
||||
|
||||
#ifndef BLE_HOST_BATCH_SCAN_EN
|
||||
#define BLE_HOST_BATCH_SCAN_EN FALSE
|
||||
#endif
|
||||
|
||||
@@ -745,67 +745,6 @@ tBTM_STATUS BTM_BleDisableBatchScan(tBTM_BLE_REF_VALUE ref_value)
|
||||
return status;
|
||||
}
|
||||
|
||||
#if (BLE_HOST_READ_SCAN_REPORTS_EN == TRUE)
|
||||
/*******************************************************************************
|
||||
**
|
||||
** Function BTM_BleReadScanReports
|
||||
**
|
||||
** Description This function is called to start reading batch scan reports
|
||||
**
|
||||
** Parameters: scan_mode - Batch scan mode
|
||||
** ref_value - Reference value
|
||||
**
|
||||
** Returns tBTM_STATUS
|
||||
**
|
||||
*******************************************************************************/
|
||||
tBTM_STATUS BTM_BleReadScanReports(tBTM_BLE_BATCH_SCAN_MODE scan_mode,
|
||||
tBTM_BLE_REF_VALUE ref_value)
|
||||
{
|
||||
tBTM_STATUS status = BTM_NO_RESOURCES;
|
||||
tBTM_BLE_VSC_CB cmn_ble_vsc_cb;
|
||||
UINT8 read_scan_mode = 0;
|
||||
UINT8 *p_data = NULL, num_records = 0;
|
||||
UINT16 data_len = 0;
|
||||
|
||||
BTM_TRACE_EVENT (" BTM_BleReadScanReports; %d, %d", scan_mode, ref_value);
|
||||
|
||||
if (!controller_get_interface()->supports_ble()) {
|
||||
return BTM_ILLEGAL_VALUE;
|
||||
}
|
||||
|
||||
BTM_BleGetVendorCapabilities(&cmn_ble_vsc_cb);
|
||||
|
||||
if (0 == cmn_ble_vsc_cb.tot_scan_results_strg) {
|
||||
BTM_TRACE_ERROR("Controller does not support batch scan");
|
||||
return BTM_ERR_PROCESSING;
|
||||
}
|
||||
|
||||
/* Check if the requested scan mode has already been setup by the user */
|
||||
read_scan_mode = ble_batchscan_cb.scan_mode & BTM_BLE_BATCH_SCAN_MODE_ACTI;
|
||||
if (0 == read_scan_mode) {
|
||||
read_scan_mode = ble_batchscan_cb.scan_mode & BTM_BLE_BATCH_SCAN_MODE_PASS;
|
||||
}
|
||||
|
||||
/* Check only for modes, as scan reports can be called after disabling batch scan */
|
||||
if (read_scan_mode > 0 && (BTM_BLE_BATCH_SCAN_MODE_PASS == scan_mode ||
|
||||
BTM_BLE_BATCH_SCAN_MODE_ACTI == scan_mode)) {
|
||||
status = btm_ble_batchscan_enq_rep_q(scan_mode, ref_value);
|
||||
if (BTM_SUCCESS == status) {
|
||||
status = btm_ble_read_batchscan_reports(scan_mode, ref_value);
|
||||
if (BTM_CMD_STARTED != status) {
|
||||
btm_ble_batchscan_deq_rep_data(scan_mode, &ref_value,
|
||||
&num_records, &p_data, &data_len);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
BTM_TRACE_ERROR("Illegal read scan params: %d, %d, %d", read_scan_mode, scan_mode,
|
||||
ble_batchscan_cb.cur_state);
|
||||
return BTM_ILLEGAL_VALUE;
|
||||
}
|
||||
return status;
|
||||
}
|
||||
#endif // #if (BLE_HOST_READ_SCAN_REPORTS_EN == TRUE)
|
||||
|
||||
/*******************************************************************************
|
||||
**
|
||||
** Function btm_ble_batchscan_init
|
||||
|
||||
@@ -2313,25 +2313,6 @@ tBTM_STATUS BTM_BleEnableBatchScan(tBTM_BLE_BATCH_SCAN_MODE scan_mode,
|
||||
//extern
|
||||
tBTM_STATUS BTM_BleDisableBatchScan(tBTM_BLE_REF_VALUE ref_value);
|
||||
|
||||
#if (BLE_HOST_READ_SCAN_REPORTS_EN == TRUE)
|
||||
/*******************************************************************************
|
||||
**
|
||||
** Function BTM_BleReadScanReports
|
||||
**
|
||||
** Description This function is called to read batch scan reports
|
||||
**
|
||||
** Parameters tBLE_SCAN_MODE scan_mode - Scan mode report to be read out
|
||||
tBTM_BLE_SCAN_REP_CBACK* p_cback - Reports callback
|
||||
**
|
||||
** Returns tBTM_STATUS
|
||||
**
|
||||
*******************************************************************************/
|
||||
//extern
|
||||
tBTM_STATUS BTM_BleReadScanReports(tBLE_SCAN_MODE scan_mode,
|
||||
tBTM_BLE_REF_VALUE ref_value);
|
||||
#endif // #if (BLE_HOST_READ_SCAN_REPORTS_EN == TRUE)
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
**
|
||||
** Function BTM_BleWriteScanRsp
|
||||
|
||||
Reference in New Issue
Block a user