mirror of
https://github.com/espressif/esp-idf.git
synced 2026-04-27 19:13:21 +00:00
fix(ble/bluedroid): Delete BLE_HOST_ENABLE_TEST_MODE_EN
(cherry picked from commit f08ff1448b)
Co-authored-by: zhiweijian <zhiweijian@espressif.com>
This commit is contained in:
@@ -4659,40 +4659,6 @@ void bta_dm_eir_update_uuid(tBT_UUID uuid, BOOLEAN adding)
|
||||
}
|
||||
#endif
|
||||
|
||||
#if (BLE_HOST_ENABLE_TEST_MODE_EN == TRUE)
|
||||
/*******************************************************************************
|
||||
**
|
||||
** Function bta_dm_enable_test_mode
|
||||
**
|
||||
** Description enable test mode
|
||||
**
|
||||
**
|
||||
** Returns void
|
||||
**
|
||||
*******************************************************************************/
|
||||
void bta_dm_enable_test_mode(tBTA_DM_MSG *p_data)
|
||||
{
|
||||
UNUSED(p_data);
|
||||
BTM_EnableTestMode();
|
||||
}
|
||||
|
||||
/*******************************************************************************
|
||||
**
|
||||
** Function bta_dm_disable_test_mode
|
||||
**
|
||||
** Description disable test mode
|
||||
**
|
||||
**
|
||||
** Returns void
|
||||
**
|
||||
*******************************************************************************/
|
||||
void bta_dm_disable_test_mode(tBTA_DM_MSG *p_data)
|
||||
{
|
||||
UNUSED(p_data);
|
||||
BTM_DeviceReset(NULL);
|
||||
}
|
||||
#endif // #if (BLE_HOST_ENABLE_TEST_MODE_EN == TRUE)
|
||||
|
||||
#if (BLE_HOST_EXECUTE_CBACK_EN == TRUE)
|
||||
/*******************************************************************************
|
||||
**
|
||||
|
||||
@@ -110,53 +110,6 @@ tBTA_STATUS BTA_DisableBluetooth(void)
|
||||
|
||||
return BTA_SUCCESS;
|
||||
}
|
||||
#if (BLE_HOST_ENABLE_TEST_MODE_EN == TRUE)
|
||||
/*******************************************************************************
|
||||
**
|
||||
** Function BTA_EnableTestMode
|
||||
**
|
||||
** Description Enables bluetooth device under test mode
|
||||
**
|
||||
**
|
||||
** Returns tBTA_STATUS
|
||||
**
|
||||
*******************************************************************************/
|
||||
tBTA_STATUS BTA_EnableTestMode(void)
|
||||
{
|
||||
BT_HDR *p_msg;
|
||||
|
||||
APPL_TRACE_API("BTA_EnableTestMode");
|
||||
|
||||
if ((p_msg = (BT_HDR *) osi_malloc(sizeof(BT_HDR))) != NULL) {
|
||||
p_msg->event = BTA_DM_API_ENABLE_TEST_MODE_EVT;
|
||||
bta_sys_sendmsg(p_msg);
|
||||
return BTA_SUCCESS;
|
||||
}
|
||||
return BTA_FAILURE;
|
||||
}
|
||||
|
||||
/*******************************************************************************
|
||||
**
|
||||
** Function BTA_DisableTestMode
|
||||
**
|
||||
** Description Disable bluetooth device under test mode
|
||||
**
|
||||
**
|
||||
** Returns None
|
||||
**
|
||||
*******************************************************************************/
|
||||
void BTA_DisableTestMode(void)
|
||||
{
|
||||
BT_HDR *p_msg;
|
||||
|
||||
APPL_TRACE_API("BTA_DisableTestMode");
|
||||
|
||||
if ((p_msg = (BT_HDR *) osi_malloc(sizeof(BT_HDR))) != NULL) {
|
||||
p_msg->event = BTA_DM_API_DISABLE_TEST_MODE_EVT;
|
||||
bta_sys_sendmsg(p_msg);
|
||||
}
|
||||
}
|
||||
#endif // #if (BLE_HOST_ENABLE_TEST_MODE_EN == TRUE)
|
||||
|
||||
/*******************************************************************************
|
||||
**
|
||||
|
||||
@@ -183,10 +183,6 @@ const tBTA_DM_ACTION bta_dm_action[BTA_DM_MAX_EVT] = {
|
||||
#endif // #if (BLE_HOST_SETUP_STORAGE_EN == TRUE)
|
||||
bta_dm_ble_disconnect, /* BTA_DM_API_BLE_DISCONNECT_EVT */
|
||||
#endif
|
||||
#if (BLE_HOST_ENABLE_TEST_MODE_EN == TRUE)
|
||||
bta_dm_enable_test_mode, /* BTA_DM_API_ENABLE_TEST_MODE_EVT */
|
||||
bta_dm_disable_test_mode, /* BTA_DM_API_DISABLE_TEST_MODE_EVT */
|
||||
#endif // #if (BLE_HOST_ENABLE_TEST_MODE_EN == TRUE)
|
||||
#if (BLE_HOST_EXECUTE_CBACK_EN == TRUE)
|
||||
bta_dm_execute_callback, /* BTA_DM_API_EXECUTE_CBACK_EVT */
|
||||
#endif // #if (BLE_HOST_EXECUTE_CBACK_EN == TRUE)
|
||||
|
||||
@@ -169,10 +169,6 @@ enum {
|
||||
BTA_DM_API_BLE_DISCONNECT_EVT,
|
||||
|
||||
#endif
|
||||
#if (BLE_HOST_ENABLE_TEST_MODE_EN == TRUE)
|
||||
BTA_DM_API_ENABLE_TEST_MODE_EVT,
|
||||
BTA_DM_API_DISABLE_TEST_MODE_EVT,
|
||||
#endif // #if (BLE_HOST_ENABLE_TEST_MODE_EN == TRUE)
|
||||
#if (BLE_HOST_EXECUTE_CBACK_EN == TRUE)
|
||||
BTA_DM_API_EXECUTE_CBACK_EVT,
|
||||
#endif // #if (BLE_HOST_EXECUTE_CBACK_EN == TRUE)
|
||||
|
||||
@@ -1618,10 +1618,6 @@
|
||||
#define BLE_INCLUDED FALSE
|
||||
#endif
|
||||
|
||||
#ifndef BLE_HOST_ENABLE_TEST_MODE_EN
|
||||
#define BLE_HOST_ENABLE_TEST_MODE_EN FALSE
|
||||
#endif
|
||||
|
||||
#ifndef BLE_HOST_EXECUTE_CBACK_EN
|
||||
#define BLE_HOST_EXECUTE_CBACK_EN FALSE
|
||||
#endif
|
||||
|
||||
@@ -1095,65 +1095,6 @@ tBTM_STATUS BTM_WriteVoiceSettings(UINT16 settings)
|
||||
return (BTM_NO_RESOURCES);
|
||||
}
|
||||
|
||||
#if (BLE_HOST_ENABLE_TEST_MODE_EN == TRUE)
|
||||
/*******************************************************************************
|
||||
**
|
||||
** Function BTM_EnableTestMode
|
||||
**
|
||||
** Description Send HCI the enable device under test command.
|
||||
**
|
||||
** Note: Controller can only be taken out of this mode by
|
||||
** resetting the controller.
|
||||
**
|
||||
** Returns
|
||||
** BTM_SUCCESS Command sent.
|
||||
** BTM_NO_RESOURCES If out of resources to send the command.
|
||||
**
|
||||
**
|
||||
*******************************************************************************/
|
||||
tBTM_STATUS BTM_EnableTestMode(void)
|
||||
{
|
||||
UINT8 cond;
|
||||
|
||||
BTM_TRACE_EVENT ("BTM: BTM_EnableTestMode");
|
||||
|
||||
/* set auto accept connection as this is needed during test mode */
|
||||
/* Allocate a buffer to hold HCI command */
|
||||
cond = HCI_DO_AUTO_ACCEPT_CONNECT;
|
||||
if (!btsnd_hcic_set_event_filter(HCI_FILTER_CONNECTION_SETUP,
|
||||
HCI_FILTER_COND_NEW_DEVICE,
|
||||
&cond, sizeof(cond))) {
|
||||
return (BTM_NO_RESOURCES);
|
||||
}
|
||||
|
||||
/* put device to connectable mode */
|
||||
if (BTM_SetConnectability(BTM_CONNECTABLE, BTM_DEFAULT_CONN_WINDOW,
|
||||
BTM_DEFAULT_CONN_INTERVAL) != BTM_SUCCESS) {
|
||||
return BTM_NO_RESOURCES;
|
||||
}
|
||||
|
||||
/* put device to discoverable mode */
|
||||
if (BTM_SetDiscoverability(BTM_GENERAL_DISCOVERABLE, BTM_DEFAULT_DISC_WINDOW,
|
||||
BTM_DEFAULT_DISC_INTERVAL) != BTM_SUCCESS) {
|
||||
return BTM_NO_RESOURCES;
|
||||
}
|
||||
|
||||
/* mask off all of event from controller */
|
||||
hci_layer_get_interface()->transmit_command(
|
||||
hci_packet_factory_get_interface()->make_set_event_mask((const bt_event_mask_t *)("\x00\x00\x00\x00\x00\x00\x00\x00")),
|
||||
NULL,
|
||||
NULL,
|
||||
NULL);
|
||||
|
||||
/* Send the HCI command */
|
||||
if (btsnd_hcic_enable_test_mode ()) {
|
||||
return (BTM_SUCCESS);
|
||||
} else {
|
||||
return (BTM_NO_RESOURCES);
|
||||
}
|
||||
}
|
||||
#endif // #if (BLE_HOST_ENABLE_TEST_MODE_EN == TRUE)
|
||||
|
||||
#if (CLASSIC_BT_INCLUDED == TRUE)
|
||||
/*******************************************************************************
|
||||
**
|
||||
|
||||
Reference in New Issue
Block a user