mirror of
https://github.com/espressif/esp-idf.git
synced 2026-10-03 03:31:41 +03:00
fix(bt/bluedroid): update the COD before enabling inquiry scan
This commit is contained in:
@@ -240,13 +240,6 @@ tBTM_STATUS BTM_SetDiscoverability (UINT16 inq_mode, UINT16 window, UINT16 inter
|
|||||||
scan_mode |= HCI_PAGE_SCAN_ENABLED;
|
scan_mode |= HCI_PAGE_SCAN_ENABLED;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (btsnd_hcic_write_scan_enable (scan_mode)) {
|
|
||||||
btm_cb.btm_inq_vars.discoverable_mode &= (~BTM_DISCOVERABLE_MASK);
|
|
||||||
btm_cb.btm_inq_vars.discoverable_mode |= inq_mode;
|
|
||||||
} else {
|
|
||||||
return (BTM_NO_RESOURCES);
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Change the service class bit if mode has changed */
|
/* Change the service class bit if mode has changed */
|
||||||
p_cod = BTM_ReadDeviceClass();
|
p_cod = BTM_ReadDeviceClass();
|
||||||
BTM_COD_SERVICE_CLASS(service_class, p_cod);
|
BTM_COD_SERVICE_CLASS(service_class, p_cod);
|
||||||
@@ -266,6 +259,13 @@ tBTM_STATUS BTM_SetDiscoverability (UINT16 inq_mode, UINT16 window, UINT16 inter
|
|||||||
(void) BTM_SetDeviceClass (cod);
|
(void) BTM_SetDeviceClass (cod);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (btsnd_hcic_write_scan_enable (scan_mode)) {
|
||||||
|
btm_cb.btm_inq_vars.discoverable_mode &= (~BTM_DISCOVERABLE_MASK);
|
||||||
|
btm_cb.btm_inq_vars.discoverable_mode |= inq_mode;
|
||||||
|
} else {
|
||||||
|
return (BTM_NO_RESOURCES);
|
||||||
|
}
|
||||||
|
|
||||||
return (BTM_SUCCESS);
|
return (BTM_SUCCESS);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user