mirror of
https://github.com/espressif/esp-idf.git
synced 2026-04-27 19:13:21 +00:00
fix(ble/bluedroid): Delete BLE_HOST_CONN_SCAN_PARAM_EN
(cherry picked from commit b175f3cc97)
Co-authored-by: zhiweijian <zhiweijian@espressif.com>
This commit is contained in:
@@ -5300,23 +5300,6 @@ void bta_dm_ble_set_scan_fil_params(tBTA_DM_MSG *p_data)
|
||||
}
|
||||
#endif // #if (BLE_42_SCAN_EN == TRUE)
|
||||
|
||||
#if (BLE_HOST_CONN_SCAN_PARAM_EN == TRUE)
|
||||
/*******************************************************************************
|
||||
**
|
||||
** Function bta_dm_ble_set_conn_scan_params
|
||||
**
|
||||
** Description This function set the preferred connection scan parameters.
|
||||
**
|
||||
** Parameters:
|
||||
**
|
||||
*******************************************************************************/
|
||||
void bta_dm_ble_set_conn_scan_params (tBTA_DM_MSG *p_data)
|
||||
{
|
||||
BTM_BleSetConnScanParams(p_data->ble_set_conn_scan_params.scan_int,
|
||||
p_data->ble_set_conn_scan_params.scan_window);
|
||||
}
|
||||
#endif // #if (BLE_HOST_CONN_SCAN_PARAM_EN == TRUE)
|
||||
|
||||
/*******************************************************************************
|
||||
**
|
||||
** Function bta_dm_ble_update_conn_params
|
||||
|
||||
@@ -1456,33 +1456,6 @@ void BTA_DmSetBlePrefConnParams(BD_ADDR bd_addr,
|
||||
#endif
|
||||
}
|
||||
|
||||
#if (BLE_HOST_CONN_SCAN_PARAM_EN == TRUE)
|
||||
/*******************************************************************************
|
||||
**
|
||||
** Function BTA_DmSetBleConnScanParams
|
||||
**
|
||||
** Description This function is called to set scan parameters used in
|
||||
** BLE connection request
|
||||
**
|
||||
** Parameters: scan_interval - scan interval
|
||||
** scan_window - scan window
|
||||
**
|
||||
** Returns void
|
||||
**
|
||||
*******************************************************************************/
|
||||
void BTA_DmSetBleConnScanParams(UINT32 scan_interval, UINT32 scan_window)
|
||||
{
|
||||
tBTA_DM_API_BLE_SCAN_PARAMS *p_msg;
|
||||
if ((p_msg = (tBTA_DM_API_BLE_SCAN_PARAMS *)osi_malloc(sizeof(tBTA_DM_API_BLE_SCAN_PARAMS))) != NULL) {
|
||||
memset(p_msg, 0, sizeof(tBTA_DM_API_BLE_SCAN_PARAMS));
|
||||
p_msg->hdr.event = BTA_DM_API_BLE_CONN_SCAN_PARAM_EVT;
|
||||
p_msg->scan_int = scan_interval;
|
||||
p_msg->scan_window = scan_window;
|
||||
bta_sys_sendmsg(p_msg);
|
||||
}
|
||||
}
|
||||
#endif // #if (BLE_HOST_CONN_SCAN_PARAM_EN == TRUE)
|
||||
|
||||
#if (BLE_HOST_BLE_SCAN_PARAM_UNUSED == TRUE)
|
||||
/*******************************************************************************
|
||||
**
|
||||
|
||||
@@ -142,9 +142,6 @@ const tBTA_DM_ACTION bta_dm_action[BTA_DM_MAX_EVT] = {
|
||||
#endif ///SMP_INCLUDED == TRUE
|
||||
bta_dm_ble_set_bg_conn_type,
|
||||
bta_dm_ble_set_conn_params, /* BTA_DM_API_BLE_CONN_PARAM_EVT */
|
||||
#if (BLE_HOST_CONN_SCAN_PARAM_EN == TRUE)
|
||||
bta_dm_ble_set_conn_scan_params, /* BTA_DM_API_BLE_CONN_SCAN_PARAM_EVT */
|
||||
#endif // #if (BLE_HOST_CONN_SCAN_PARAM_EN == TRUE)
|
||||
#if (BLE_HOST_BLE_SCAN_PARAM_UNUSED == TRUE)
|
||||
bta_dm_ble_set_scan_params, /* BTA_DM_API_BLE_SCAN_PARAM_EVT */
|
||||
#endif // #if (BLE_HOST_BLE_SCAN_PARAM_UNUSED == TRUE)
|
||||
|
||||
@@ -128,9 +128,6 @@ enum {
|
||||
#endif ///SMP_INCLUDED == TRUE
|
||||
BTA_DM_API_BLE_SET_BG_CONN_TYPE,
|
||||
BTA_DM_API_BLE_CONN_PARAM_EVT,
|
||||
#if (BLE_HOST_CONN_SCAN_PARAM_EN == TRUE)
|
||||
BTA_DM_API_BLE_CONN_SCAN_PARAM_EVT,
|
||||
#endif // #if (BLE_HOST_CONN_SCAN_PARAM_EN == TRUE)
|
||||
#if (BLE_HOST_BLE_SCAN_PARAM_UNUSED == TRUE)
|
||||
BTA_DM_API_BLE_SCAN_PARAM_EVT,
|
||||
#endif // #if (BLE_HOST_BLE_SCAN_PARAM_UNUSED == TRUE)
|
||||
@@ -871,15 +868,6 @@ typedef struct {
|
||||
tBLE_SCAN_PARAM_SETUP_CBACK scan_param_setup_cback;
|
||||
} tBTA_DM_API_BLE_SCAN_FILTER_PARAMS;
|
||||
|
||||
#if (BLE_HOST_CONN_SCAN_PARAM_EN == TRUE)
|
||||
/* set scan parameter for BLE connections */
|
||||
typedef struct {
|
||||
BT_HDR hdr;
|
||||
UINT16 scan_int;
|
||||
UINT16 scan_window;
|
||||
} tBTA_DM_API_BLE_CONN_SCAN_PARAMS;
|
||||
#endif // #if (BLE_HOST_CONN_SCAN_PARAM_EN == TRUE)
|
||||
|
||||
/* Data type for start/stop observe */
|
||||
typedef struct {
|
||||
BT_HDR hdr;
|
||||
@@ -1822,9 +1810,6 @@ typedef union {
|
||||
tBTA_DM_API_BLE_SEC_GRANT ble_sec_grant;
|
||||
tBTA_DM_API_BLE_SET_BG_CONN_TYPE ble_set_bd_conn_type;
|
||||
tBTA_DM_API_BLE_CONN_PARAMS ble_set_conn_params;
|
||||
#if (BLE_HOST_CONN_SCAN_PARAM_EN == TRUE)
|
||||
tBTA_DM_API_BLE_CONN_SCAN_PARAMS ble_set_conn_scan_params;
|
||||
#endif // #if (BLE_HOST_CONN_SCAN_PARAM_EN == TRUE)
|
||||
#if (BLE_HOST_BLE_SCAN_PARAM_UNUSED == TRUE)
|
||||
tBTA_DM_API_BLE_SCAN_PARAMS ble_set_scan_params;
|
||||
#endif // #if (BLE_HOST_BLE_SCAN_PARAM_UNUSED == TRUE)
|
||||
@@ -2406,9 +2391,6 @@ extern void bta_dm_ble_set_bg_conn_type (tBTA_DM_MSG *p_data);
|
||||
extern void bta_dm_ble_set_conn_params (tBTA_DM_MSG *p_data);
|
||||
extern void bta_dm_ble_set_scan_params(tBTA_DM_MSG *p_data);
|
||||
extern void bta_dm_ble_set_scan_fil_params(tBTA_DM_MSG *p_data);
|
||||
#if (BLE_HOST_CONN_SCAN_PARAM_EN == TRUE)
|
||||
extern void bta_dm_ble_set_conn_scan_params (tBTA_DM_MSG *p_data);
|
||||
#endif // #if (BLE_HOST_CONN_SCAN_PARAM_EN == TRUE)
|
||||
#if ((defined BTA_GATT_INCLUDED) && (BTA_GATT_INCLUDED == TRUE) && SDP_INCLUDED == TRUE) && (GATTC_INCLUDED == TRUE)
|
||||
extern void bta_dm_close_gatt_conn(tBTA_DM_MSG *p_data);
|
||||
#endif /* ((defined BTA_GATT_INCLUDED) && (BTA_GATT_INCLUDED == TRUE) && SDP_INCLUDED == TRUE) && (GATTC_INCLUDED == TRUE) */
|
||||
|
||||
@@ -1659,10 +1659,6 @@
|
||||
#define BLE_HOST_BLE_SCAN_PARAM_UNUSED FALSE
|
||||
#endif
|
||||
|
||||
#ifndef BLE_HOST_CONN_SCAN_PARAM_EN
|
||||
#define BLE_HOST_CONN_SCAN_PARAM_EN FALSE
|
||||
#endif
|
||||
|
||||
#ifndef BLE_HOST_SETUP_STORAGE_EN
|
||||
#define BLE_HOST_SETUP_STORAGE_EN FALSE
|
||||
#endif
|
||||
|
||||
@@ -549,48 +549,6 @@ void BTM_BleSecureConnectionCreateOobData(void)
|
||||
#endif
|
||||
}
|
||||
|
||||
#if (BLE_HOST_CONN_SCAN_PARAM_EN == TRUE)
|
||||
/******************************************************************************
|
||||
**
|
||||
** Function BTM_BleSetConnScanParams
|
||||
**
|
||||
** Description Set scan parameter used in BLE connection request
|
||||
**
|
||||
** Parameters: scan_interval: scan interval
|
||||
** scan_window: scan window
|
||||
**
|
||||
** Returns void
|
||||
**
|
||||
*******************************************************************************/
|
||||
void BTM_BleSetConnScanParams (UINT32 scan_interval, UINT32 scan_window)
|
||||
{
|
||||
#if SMP_INCLUDED == TRUE
|
||||
tBTM_BLE_CB *p_ble_cb = &btm_cb.ble_ctr_cb;
|
||||
BOOLEAN new_param = FALSE;
|
||||
|
||||
if (BTM_BLE_ISVALID_PARAM(scan_interval, BTM_BLE_SCAN_INT_MIN, BTM_BLE_SCAN_INT_MAX) &&
|
||||
BTM_BLE_ISVALID_PARAM(scan_window, BTM_BLE_SCAN_WIN_MIN, BTM_BLE_SCAN_WIN_MAX)) {
|
||||
if (p_ble_cb->scan_int != scan_interval) {
|
||||
p_ble_cb->scan_int = scan_interval;
|
||||
new_param = TRUE;
|
||||
}
|
||||
|
||||
if (p_ble_cb->scan_win != scan_window) {
|
||||
p_ble_cb->scan_win = scan_window;
|
||||
new_param = TRUE;
|
||||
}
|
||||
#if (tGATT_BG_CONN_DEV == TRUE)
|
||||
if (new_param && p_ble_cb->conn_state == BLE_BG_CONN) {
|
||||
btm_ble_suspend_bg_conn();
|
||||
}
|
||||
#endif // #if (tGATT_BG_CONN_DEV == TRUE)
|
||||
} else {
|
||||
BTM_TRACE_ERROR("Illegal Connection Scan Parameters");
|
||||
}
|
||||
#endif
|
||||
}
|
||||
#endif // #if (BLE_HOST_CONN_SCAN_PARAM_EN == TRUE)
|
||||
|
||||
/********************************************************
|
||||
**
|
||||
** Function BTM_BleSetPrefConnParams
|
||||
|
||||
Reference in New Issue
Block a user