Component/bt: fix set scan params and start scan action
This commit is contained in:
@@ -2209,6 +2209,47 @@ extern void BTA_DmBleObserve(BOOLEAN start, UINT32 duration,
|
||||
}
|
||||
}
|
||||
|
||||
/*******************************************************************************
|
||||
**
|
||||
** Function BTA_DmBleScan
|
||||
**
|
||||
** Description This procedure keep the device listening for advertising
|
||||
** events from a broadcast device.
|
||||
**
|
||||
** Parameters start: start or stop scan.
|
||||
**
|
||||
** Returns void
|
||||
|
||||
**
|
||||
** Returns void.
|
||||
**
|
||||
*******************************************************************************/
|
||||
extern void BTA_DmBleScan(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_SCAN *p_msg;
|
||||
|
||||
APPL_TRACE_API("BTA_DmBleScan:start = %d ", start);
|
||||
|
||||
if ((p_msg = (tBTA_DM_API_BLE_SCAN *) osi_malloc(sizeof(tBTA_DM_API_BLE_SCAN))) != NULL) {
|
||||
memset(p_msg, 0, sizeof(tBTA_DM_API_BLE_SCAN));
|
||||
|
||||
p_msg->hdr.event = BTA_DM_API_BLE_SCAN_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);
|
||||
}
|
||||
}
|
||||
|
||||
/*******************************************************************************
|
||||
**
|
||||
** Function BTA_DmBleStopAdvertising
|
||||
|
||||
Reference in New Issue
Block a user