mirror of
https://github.com/espressif/esp-idf.git
synced 2026-04-27 19:13:21 +00:00
fix(ble/bluedroid): delete BLE_HOST_BLE_OBSERVE_EN
(cherry picked from commit 08f9511e25)
Co-authored-by: zhiweijian <zhiweijian@espressif.com>
This commit is contained in:
@@ -5391,48 +5391,6 @@ void bta_dm_ble_set_key_material (tBTA_DM_MSG *p_data)
|
||||
}
|
||||
#endif
|
||||
|
||||
#if (BLE_HOST_BLE_OBSERVE_EN == TRUE)
|
||||
/*******************************************************************************
|
||||
**
|
||||
** Function bta_dm_ble_observe
|
||||
**
|
||||
** Description This function set the preferred connection scan parameters.
|
||||
**
|
||||
** Parameters:
|
||||
**
|
||||
*******************************************************************************/
|
||||
void bta_dm_ble_observe (tBTA_DM_MSG *p_data)
|
||||
{
|
||||
tBTM_STATUS status;
|
||||
if (p_data->ble_observe.start) {
|
||||
/*Save the callback to be called when a scan results are available */
|
||||
bta_dm_search_cb.p_scan_cback = p_data->ble_observe.p_cback;
|
||||
|
||||
if ((status = BTM_BleObserve(TRUE, p_data->ble_observe.duration,
|
||||
bta_dm_observe_results_cb, bta_dm_observe_cmpl_cb)) != BTM_CMD_STARTED) {
|
||||
APPL_TRACE_WARNING(" %s start observe failed. status=0x%x\n", __FUNCTION__, status);
|
||||
}
|
||||
|
||||
if (p_data->ble_observe.p_start_scan_cback) {
|
||||
status = (status == BTM_CMD_STARTED ? BTA_SUCCESS : BTA_FAILURE);
|
||||
p_data->ble_observe.p_start_scan_cback(status);
|
||||
}
|
||||
} else {
|
||||
bta_dm_search_cb.p_scan_cback = NULL;
|
||||
status = BTM_BleObserve(FALSE, 0, NULL, NULL);
|
||||
|
||||
if (status != BTM_CMD_STARTED){
|
||||
APPL_TRACE_WARNING(" %s stop observe failed, status=0x%x\n", __FUNCTION__, status);
|
||||
}
|
||||
|
||||
if (p_data->ble_observe.p_stop_scan_cback) {
|
||||
status = (status == BTM_CMD_STARTED ? BTA_SUCCESS : BTA_FAILURE);
|
||||
p_data->ble_observe.p_stop_scan_cback(status);
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif // #if (BLE_HOST_BLE_OBSERVE_EN == TRUE)
|
||||
|
||||
/*******************************************************************************
|
||||
**
|
||||
** Function bta_dm_ble_scan
|
||||
|
||||
@@ -2550,48 +2550,6 @@ void BTA_DmCloseACL(BD_ADDR bd_addr, BOOLEAN remove_dev, tBTA_TRANSPORT transpor
|
||||
#endif // #if (BLE_HOST_REMOVE_AN_ACL_EN == TRUE)
|
||||
|
||||
#if BLE_INCLUDED == TRUE
|
||||
#if (BLE_HOST_BLE_OBSERVE_EN == TRUE)
|
||||
/*******************************************************************************
|
||||
**
|
||||
** Function BTA_DmBleObserve
|
||||
**
|
||||
** Description This procedure keep the device listening for advertising
|
||||
** events from a broadcast device.
|
||||
**
|
||||
** Parameters start: start or stop observe.
|
||||
**
|
||||
** Returns void
|
||||
|
||||
**
|
||||
** Returns void.
|
||||
**
|
||||
*******************************************************************************/
|
||||
extern void BTA_DmBleObserve(BOOLEAN start, UINT32 duration,
|
||||
tBTA_DM_SEARCH_CBACK *p_results_cb,
|
||||
tBTA_START_STOP_SCAN_CMPL_CBACK *p_start_stop_scan_cb)
|
||||
{
|
||||
tBTA_DM_API_BLE_OBSERVE *p_msg;
|
||||
|
||||
APPL_TRACE_API("BTA_DmBleObserve:start = %d ", start);
|
||||
|
||||
if ((p_msg = (tBTA_DM_API_BLE_OBSERVE *) osi_malloc(sizeof(tBTA_DM_API_BLE_OBSERVE))) != NULL) {
|
||||
memset(p_msg, 0, sizeof(tBTA_DM_API_BLE_OBSERVE));
|
||||
|
||||
p_msg->hdr.event = BTA_DM_API_BLE_OBSERVE_EVT;
|
||||
p_msg->start = start;
|
||||
p_msg->duration = duration;
|
||||
p_msg->p_cback = p_results_cb;
|
||||
if (start){
|
||||
p_msg->p_start_scan_cback = p_start_stop_scan_cb;
|
||||
}
|
||||
else {
|
||||
p_msg->p_stop_scan_cback = p_start_stop_scan_cb;
|
||||
}
|
||||
|
||||
bta_sys_sendmsg(p_msg);
|
||||
}
|
||||
}
|
||||
#endif // #if (BLE_HOST_BLE_OBSERVE_EN == TRUE)
|
||||
|
||||
#if (BLE_42_SCAN_EN == TRUE)
|
||||
/*******************************************************************************
|
||||
|
||||
@@ -145,9 +145,6 @@ const tBTA_DM_ACTION bta_dm_action[BTA_DM_MAX_EVT] = {
|
||||
#if (BLE_42_SCAN_EN == TRUE)
|
||||
bta_dm_ble_set_scan_fil_params, /* BTA_DM_API_BLE_SCAN_FIL_PARAM_EVT */
|
||||
#endif // #if (BLE_42_SCAN_EN == TRUE)
|
||||
#if (BLE_HOST_BLE_OBSERVE_EN == TRUE)
|
||||
bta_dm_ble_observe, /* BTA_DM_API_BLE_OBSERVE_EVT */
|
||||
#endif // #if (BLE_HOST_BLE_OBSERVE_EN == TRUE)
|
||||
#if (BLE_42_SCAN_EN == TRUE)
|
||||
bta_dm_ble_scan, /* BTA_DM_API_BLE_SCAN_EVT */
|
||||
#endif // #if (BLE_42_SCAN_EN == TRUE)
|
||||
|
||||
@@ -133,9 +133,6 @@ enum {
|
||||
#if (BLE_42_SCAN_EN == TRUE)
|
||||
BTA_DM_API_BLE_SCAN_FIL_PARAM_EVT,
|
||||
#endif // #if (BLE_42_SCAN_EN == TRUE)
|
||||
#if (BLE_HOST_BLE_OBSERVE_EN == TRUE)
|
||||
BTA_DM_API_BLE_OBSERVE_EVT,
|
||||
#endif // #if (BLE_HOST_BLE_OBSERVE_EN == TRUE)
|
||||
#if (BLE_42_SCAN_EN == TRUE)
|
||||
BTA_DM_API_BLE_SCAN_EVT,
|
||||
#endif // #if (BLE_42_SCAN_EN == TRUE)
|
||||
|
||||
@@ -1647,10 +1647,6 @@
|
||||
#define BLE_HOST_READ_TX_POWER_EN FALSE
|
||||
#endif
|
||||
|
||||
#ifndef BLE_HOST_BLE_OBSERVE_EN
|
||||
#define BLE_HOST_BLE_OBSERVE_EN FALSE
|
||||
#endif
|
||||
|
||||
#ifndef BLE_HOST_SETUP_STORAGE_EN
|
||||
#define BLE_HOST_SETUP_STORAGE_EN FALSE
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user