mirror of
https://github.com/espressif/esp-idf.git
synced 2026-06-04 20:26:38 +03:00
fix(ble/bluedroid): change bluedroid scan callback name
(cherry picked from commit b9440efbe9)
Co-authored-by: zhiweijian <zhiweijian@espressif.com>
This commit is contained in:
@@ -133,9 +133,9 @@ extern tBTA_DM_CONTRL_STATE bta_dm_pm_obtain_controller_state(void);
|
||||
static BOOLEAN bta_dm_remove_sec_dev_entry(BD_ADDR remote_bd_addr);
|
||||
#endif ///SMP_INCLUDED == TRUE
|
||||
#if (BLE_INCLUDED == TRUE)
|
||||
static void bta_dm_observe_results_cb(tBTM_INQ_RESULTS *p_inq, UINT8 *p_eir);
|
||||
static void bta_dm_observe_cmpl_cb(void *p_result);
|
||||
static void bta_dm_observe_discard_cb (uint32_t num_dis);
|
||||
static void bta_dm_scan_results_cb(tBTM_INQ_RESULTS *p_inq, UINT8 *p_eir);
|
||||
static void bta_dm_scan_cmpl_cb(void *p_result);
|
||||
static void bta_dm_scan_discard_cb (uint32_t num_dis);
|
||||
#endif ///BLE_INCLUDED == TRUE
|
||||
|
||||
#if (CLASSIC_BT_INCLUDED == TRUE)
|
||||
@@ -4657,9 +4657,10 @@ BOOLEAN bta_dm_check_if_only_hd_connected(BD_ADDR peer_addr)
|
||||
#endif /* BTA_HD_INCLUDED == TRUE */
|
||||
|
||||
#if (BLE_INCLUDED == TRUE)
|
||||
#if (BLE_42_SCAN_EN == TRUE)
|
||||
/*******************************************************************************
|
||||
**
|
||||
** Function bta_dm_observe_results_cb
|
||||
** Function bta_dm_scan_results_cb
|
||||
**
|
||||
** Description Callback for BLE Observe result
|
||||
**
|
||||
@@ -4667,7 +4668,7 @@ BOOLEAN bta_dm_check_if_only_hd_connected(BD_ADDR peer_addr)
|
||||
** Returns void
|
||||
**
|
||||
*******************************************************************************/
|
||||
static void bta_dm_observe_results_cb (tBTM_INQ_RESULTS *p_inq, UINT8 *p_eir)
|
||||
static void bta_dm_scan_results_cb (tBTM_INQ_RESULTS *p_inq, UINT8 *p_eir)
|
||||
{
|
||||
tBTA_DM_SEARCH result;
|
||||
tBTM_INQ_INFO *p_inq_info;
|
||||
@@ -4707,7 +4708,7 @@ static void bta_dm_observe_results_cb (tBTM_INQ_RESULTS *p_inq, UINT8 *p_eir)
|
||||
|
||||
/*******************************************************************************
|
||||
**
|
||||
** Function bta_dm_observe_cmpl_cb
|
||||
** Function bta_dm_scan_cmpl_cb
|
||||
**
|
||||
** Description Callback for BLE Observe complete
|
||||
**
|
||||
@@ -4715,11 +4716,11 @@ static void bta_dm_observe_results_cb (tBTM_INQ_RESULTS *p_inq, UINT8 *p_eir)
|
||||
** Returns void
|
||||
**
|
||||
*******************************************************************************/
|
||||
static void bta_dm_observe_cmpl_cb (void *p_result)
|
||||
static void bta_dm_scan_cmpl_cb (void *p_result)
|
||||
{
|
||||
tBTA_DM_SEARCH data;
|
||||
|
||||
APPL_TRACE_DEBUG("bta_dm_observe_cmpl_cb");
|
||||
APPL_TRACE_DEBUG("bta_dm_scan_cmpl_cb");
|
||||
|
||||
data.inq_cmpl.num_resps = ((tBTM_INQUIRY_CMPL *)p_result)->num_resp;
|
||||
if (bta_dm_search_cb.p_scan_cback) {
|
||||
@@ -4729,7 +4730,7 @@ static void bta_dm_observe_cmpl_cb (void *p_result)
|
||||
|
||||
/*******************************************************************************
|
||||
**
|
||||
** Function bta_dm_observe_discard_cb
|
||||
** Function bta_dm_scan_discard_cb
|
||||
**
|
||||
** Description Callback for BLE Observe lost
|
||||
**
|
||||
@@ -4737,17 +4738,18 @@ static void bta_dm_observe_cmpl_cb (void *p_result)
|
||||
** Returns void
|
||||
**
|
||||
*******************************************************************************/
|
||||
static void bta_dm_observe_discard_cb (uint32_t num_dis)
|
||||
static void bta_dm_scan_discard_cb (uint32_t num_dis)
|
||||
{
|
||||
tBTA_DM_SEARCH data;
|
||||
|
||||
APPL_TRACE_DEBUG("bta_dm_observe_discard_cb");
|
||||
APPL_TRACE_DEBUG("bta_dm_scan_discard_cb");
|
||||
|
||||
data.inq_dis.num_dis = num_dis;
|
||||
if (bta_dm_search_cb.p_scan_cback) {
|
||||
bta_dm_search_cb.p_scan_cback(BTA_DM_INQ_DISCARD_NUM_EVT, &data);
|
||||
}
|
||||
}
|
||||
#endif // (BLE_42_SCAN_EN == TRUE)
|
||||
|
||||
#if (SMP_INCLUDED == TRUE)
|
||||
/*******************************************************************************
|
||||
@@ -5228,7 +5230,7 @@ void bta_dm_ble_scan (tBTA_DM_MSG *p_data)
|
||||
bta_dm_search_cb.p_scan_cback = p_data->ble_scan.p_cback;
|
||||
|
||||
if ((status = BTM_BleScan(TRUE, p_data->ble_scan.duration,
|
||||
bta_dm_observe_results_cb, bta_dm_observe_cmpl_cb, bta_dm_observe_discard_cb)) != BTM_CMD_STARTED) {
|
||||
bta_dm_scan_results_cb, bta_dm_scan_cmpl_cb, bta_dm_scan_discard_cb)) != BTM_CMD_STARTED) {
|
||||
APPL_TRACE_WARNING(" %s start scan failed. status=0x%x\n", __FUNCTION__, status);
|
||||
}
|
||||
|
||||
@@ -5463,14 +5465,14 @@ void bta_dm_ble_set_data_length(tBTA_DM_MSG *p_data)
|
||||
#if (BLE_42_ADV_EN == TRUE)
|
||||
/*******************************************************************************
|
||||
**
|
||||
** Function bta_dm_ble_broadcast
|
||||
** Function bta_dm_ble_advstop
|
||||
**
|
||||
** Description Starts or stops LE broadcasts
|
||||
**
|
||||
** Parameters:
|
||||
**
|
||||
*******************************************************************************/
|
||||
void bta_dm_ble_broadcast (tBTA_DM_MSG *p_data)
|
||||
void bta_dm_ble_advstop (tBTA_DM_MSG *p_data)
|
||||
{
|
||||
tBTA_STATUS status = BTA_FAILURE;
|
||||
BOOLEAN start = p_data->ble_observe.start;
|
||||
|
||||
@@ -1590,25 +1590,25 @@ void BTA_DmUpdateDuplicateExceptionalList(UINT8 subcode, UINT32 type, BD_ADDR de
|
||||
#if (BLE_42_ADV_EN == TRUE)
|
||||
/*******************************************************************************
|
||||
**
|
||||
** Function BTA_DmBleBroadcast
|
||||
** Function BTA_DmBleAdvStop
|
||||
**
|
||||
** Description This function starts or stops LE broadcasting.
|
||||
**
|
||||
** Parameters start: start or stop broadcast.
|
||||
** Parameters start: always be false.
|
||||
**
|
||||
** Returns None
|
||||
**
|
||||
*******************************************************************************/
|
||||
extern void BTA_DmBleBroadcast (BOOLEAN start, tBTA_START_STOP_ADV_CMPL_CBACK *p_start_stop_adv_cb)
|
||||
extern void BTA_DmBleAdvStop (BOOLEAN start, tBTA_START_STOP_ADV_CMPL_CBACK *p_start_stop_adv_cb)
|
||||
{
|
||||
tBTA_DM_API_BLE_OBSERVE *p_msg;
|
||||
|
||||
APPL_TRACE_API("BTA_DmBleBroadcast: start = %d \n", start);
|
||||
APPL_TRACE_API("BTA_DmBleAdvStop: start = %d \n", 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_BROADCAST_EVT;
|
||||
p_msg->hdr.event = BTA_DM_API_BLE_ADVSTOP_EVT;
|
||||
p_msg->start = start;
|
||||
if (start == FALSE){
|
||||
p_msg->p_stop_adv_cback= p_start_stop_adv_cb;
|
||||
|
||||
@@ -159,7 +159,7 @@ const tBTA_DM_ACTION bta_dm_action[BTA_DM_MAX_EVT] = {
|
||||
/* New function to allow set raw scan
|
||||
response data to HCI */
|
||||
bta_dm_ble_set_scan_rsp_raw, /* BTA_DM_API_BLE_SET_SCAN_RSP_RAW_EVT */
|
||||
bta_dm_ble_broadcast, /* BTA_DM_API_BLE_BROADCAST_EVT */
|
||||
bta_dm_ble_advstop, /* BTA_DM_API_BLE_ADVSTOP_EVT */
|
||||
#endif // #if (BLE_42_ADV_EN == TRUE)
|
||||
bta_dm_ble_set_data_length, /* BTA_DM_API_SET_DATA_LENGTH_EVT */
|
||||
bta_dm_ble_disconnect, /* BTA_DM_API_BLE_DISCONNECT_EVT */
|
||||
|
||||
@@ -153,7 +153,7 @@ enum {
|
||||
BTA_DM_API_BLE_SET_SCAN_RSP_EVT,
|
||||
/* Add for set raw scan response data */
|
||||
BTA_DM_API_BLE_SET_SCAN_RSP_RAW_EVT,
|
||||
BTA_DM_API_BLE_BROADCAST_EVT,
|
||||
BTA_DM_API_BLE_ADVSTOP_EVT,
|
||||
#endif // #if (BLE_42_ADV_EN == TRUE)
|
||||
BTA_DM_API_SET_DATA_LENGTH_EVT,
|
||||
|
||||
@@ -2232,7 +2232,7 @@ extern void bta_dm_ble_set_adv_config (tBTA_DM_MSG *p_data);
|
||||
extern void bta_dm_ble_set_adv_config_raw (tBTA_DM_MSG *p_data);
|
||||
extern void bta_dm_ble_set_scan_rsp (tBTA_DM_MSG *p_data);
|
||||
extern void bta_dm_ble_set_scan_rsp_raw (tBTA_DM_MSG *p_data);
|
||||
extern void bta_dm_ble_broadcast (tBTA_DM_MSG *p_data);
|
||||
extern void bta_dm_ble_advstop (tBTA_DM_MSG *p_data);
|
||||
extern void bta_dm_ble_set_data_length(tBTA_DM_MSG *p_data);
|
||||
extern void bta_dm_ble_update_duplicate_exceptional_list(tBTA_DM_MSG *p_data);
|
||||
#if SMP_INCLUDED == TRUE
|
||||
|
||||
@@ -2889,7 +2889,7 @@ extern void BTA_DmUpdateDuplicateExceptionalList(UINT8 subcode, UINT32 type,
|
||||
|
||||
/*******************************************************************************
|
||||
**
|
||||
** Function BTA_DmBleBroadcast
|
||||
** Function BTA_DmBleAdvStop
|
||||
**
|
||||
** Description This function starts or stops LE broadcasting.
|
||||
**
|
||||
@@ -2899,7 +2899,7 @@ extern void BTA_DmUpdateDuplicateExceptionalList(UINT8 subcode, UINT32 type,
|
||||
** Returns None
|
||||
**
|
||||
*******************************************************************************/
|
||||
extern void BTA_DmBleBroadcast (BOOLEAN start, tBTA_START_STOP_ADV_CMPL_CBACK *p_start_stop_adv_cb);
|
||||
extern void BTA_DmBleAdvStop (BOOLEAN start, tBTA_START_STOP_ADV_CMPL_CBACK *p_start_stop_adv_cb);
|
||||
|
||||
/*******************************************************************************
|
||||
**
|
||||
|
||||
@@ -1801,7 +1801,7 @@ static void btc_ble_stop_advertising(tBTA_START_STOP_ADV_CMPL_CBACK *stop_adv_cb
|
||||
{
|
||||
bool stop_adv = false;
|
||||
|
||||
BTA_DmBleBroadcast(stop_adv, stop_adv_cb);
|
||||
BTA_DmBleAdvStop(stop_adv, stop_adv_cb);
|
||||
}
|
||||
#endif // #if (BLE_42_ADV_EN == TRUE)
|
||||
|
||||
|
||||
@@ -528,6 +528,8 @@ tBTM_STATUS BTM_BleBroadcast(BOOLEAN start, tBTM_START_STOP_ADV_CMPL_CBACK *p_s
|
||||
#endif
|
||||
|
||||
if (start) {
|
||||
// "start" should not be ture
|
||||
#if (0)
|
||||
/* update adv params */
|
||||
if (!btsnd_hcic_ble_write_adv_params ((UINT16)(p_cb->adv_interval_min ? p_cb->adv_interval_min :
|
||||
BTM_BLE_GAP_ADV_INT),
|
||||
@@ -547,6 +549,7 @@ tBTM_STATUS BTM_BleBroadcast(BOOLEAN start, tBTM_START_STOP_ADV_CMPL_CBACK *p_s
|
||||
}
|
||||
|
||||
status = btm_ble_start_adv ();
|
||||
#endif //
|
||||
} else {
|
||||
//save the stop adv callback to the BTM env.
|
||||
p_cb->p_stop_adv_cb = p_stop_adv_cback;
|
||||
|
||||
Reference in New Issue
Block a user