mirror of
https://github.com/espressif/esp-idf.git
synced 2026-04-27 19:13:21 +00:00
fix(ble/bluedroid): delete BLE_HOST_ENERGY_INFO_EN
This commit is contained in:
@@ -6345,56 +6345,6 @@ void bta_ble_scan_setup_cb(tBTM_BLE_BATCH_SCAN_EVT evt, tBTM_BLE_REF_VALUE ref_v
|
||||
}
|
||||
}
|
||||
|
||||
#if (BLE_HOST_ENERGY_INFO_EN == TRUE)
|
||||
/*******************************************************************************
|
||||
**
|
||||
** Function bta_ble_enable_scan_cmpl
|
||||
**
|
||||
** Description ADV payload filtering enable / disable complete callback
|
||||
**
|
||||
**
|
||||
** Returns None
|
||||
**
|
||||
*******************************************************************************/
|
||||
static void bta_ble_energy_info_cmpl(tBTM_BLE_TX_TIME_MS tx_time,
|
||||
tBTM_BLE_RX_TIME_MS rx_time,
|
||||
tBTM_BLE_IDLE_TIME_MS idle_time,
|
||||
tBTM_BLE_ENERGY_USED energy_used,
|
||||
tBTM_STATUS status)
|
||||
{
|
||||
tBTA_STATUS st = (status == BTM_SUCCESS) ? BTA_SUCCESS : BTA_FAILURE;
|
||||
tBTA_DM_CONTRL_STATE ctrl_state = 0;
|
||||
#if ((defined BTA_GATT_INCLUDED) && (BTA_GATT_INCLUDED == TRUE) && SDP_INCLUDED == TRUE)
|
||||
if (BTA_SUCCESS == st) {
|
||||
ctrl_state = bta_dm_pm_obtain_controller_state();
|
||||
}
|
||||
#endif
|
||||
if (bta_dm_cb.p_energy_info_cback) {
|
||||
bta_dm_cb.p_energy_info_cback(tx_time, rx_time, idle_time, energy_used, ctrl_state, st);
|
||||
}
|
||||
}
|
||||
|
||||
/*******************************************************************************
|
||||
**
|
||||
** Function bta_dm_ble_get_energy_info
|
||||
**
|
||||
** Description This function obtains the energy info
|
||||
**
|
||||
** Parameters:
|
||||
**
|
||||
*******************************************************************************/
|
||||
void bta_dm_ble_get_energy_info(tBTA_DM_MSG *p_data)
|
||||
{
|
||||
tBTM_STATUS btm_status = 0;
|
||||
|
||||
bta_dm_cb.p_energy_info_cback = p_data->ble_energy_info.p_energy_info_cback;
|
||||
btm_status = BTM_BleGetEnergyInfo(bta_ble_energy_info_cmpl);
|
||||
if (BTM_CMD_STARTED != btm_status) {
|
||||
bta_ble_energy_info_cmpl(0, 0, 0, 0, btm_status);
|
||||
}
|
||||
}
|
||||
#endif // #if (BLE_HOST_ENERGY_INFO_EN == TRUE)
|
||||
|
||||
#if ((defined BTA_GATT_INCLUDED) && (BTA_GATT_INCLUDED == TRUE) && SDP_INCLUDED == TRUE)
|
||||
#ifndef BTA_DM_GATT_CLOSE_DELAY_TOUT
|
||||
#define BTA_DM_GATT_CLOSE_DELAY_TOUT 1000
|
||||
|
||||
@@ -2078,34 +2078,6 @@ void BTA_DmBleSetKeyMaterial(const uint8_t *session_key, const uint8_t *iv)
|
||||
}
|
||||
#endif
|
||||
|
||||
#if (BLE_HOST_ENERGY_INFO_EN == TRUE)
|
||||
/*******************************************************************************
|
||||
**
|
||||
** Function BTA_DmBleGetEnergyInfo
|
||||
**
|
||||
** Description This function is called to obtain the energy info
|
||||
**
|
||||
** Parameters p_cmpl_cback - Command complete callback
|
||||
**
|
||||
** Returns void
|
||||
**
|
||||
*******************************************************************************/
|
||||
void BTA_DmBleGetEnergyInfo(tBTA_BLE_ENERGY_INFO_CBACK *p_cmpl_cback)
|
||||
{
|
||||
tBTA_DM_API_ENERGY_INFO *p_msg;
|
||||
APPL_TRACE_API ("BTA_DmBleGetEnergyInfo");
|
||||
|
||||
UINT16 len = sizeof(tBTA_DM_API_ENERGY_INFO) + sizeof(tBLE_BD_ADDR);
|
||||
|
||||
if ((p_msg = (tBTA_DM_API_ENERGY_INFO *) osi_malloc(len)) != NULL) {
|
||||
memset (p_msg, 0, len);
|
||||
p_msg->hdr.event = BTA_DM_API_BLE_ENERGY_INFO_EVT;
|
||||
p_msg->p_energy_info_cback = p_cmpl_cback;
|
||||
bta_sys_sendmsg(p_msg);
|
||||
}
|
||||
}
|
||||
#endif // #if (BLE_HOST_ENERGY_INFO_EN == TRUE)
|
||||
|
||||
/*******************************************************************************
|
||||
**
|
||||
** Function BTA_DmBleUpdateConnectionParams
|
||||
|
||||
@@ -181,10 +181,6 @@ const tBTA_DM_ACTION bta_dm_action[BTA_DM_MAX_EVT] = {
|
||||
#if (BLE_HOST_SETUP_STORAGE_EN == TRUE)
|
||||
bta_dm_ble_setup_storage, /* BTA_DM_API_BLE_SETUP_STORAGE_EVT */
|
||||
#endif // #if (BLE_HOST_SETUP_STORAGE_EN == TRUE)
|
||||
|
||||
#if (BLE_HOST_ENERGY_INFO_EN == TRUE)
|
||||
bta_dm_ble_get_energy_info, /* BTA_DM_API_BLE_ENERGY_INFO_EVT */
|
||||
#endif // #if (BLE_HOST_ENERGY_INFO_EN == TRUE)
|
||||
bta_dm_ble_disconnect, /* BTA_DM_API_BLE_DISCONNECT_EVT */
|
||||
#endif
|
||||
#if (BLE_HOST_ENABLE_TEST_MODE_EN == TRUE)
|
||||
|
||||
@@ -166,9 +166,6 @@ enum {
|
||||
BTA_DM_API_BLE_SETUP_STORAGE_EVT,
|
||||
#endif // #if (BLE_HOST_SETUP_STORAGE_EN == TRUE)
|
||||
|
||||
#if (BLE_HOST_ENERGY_INFO_EN == TRUE)
|
||||
BTA_DM_API_BLE_ENERGY_INFO_EVT,
|
||||
#endif // #if (BLE_HOST_ENERGY_INFO_EN == TRUE)
|
||||
BTA_DM_API_BLE_DISCONNECT_EVT,
|
||||
|
||||
#endif
|
||||
@@ -957,13 +954,6 @@ typedef struct {
|
||||
} tBTA_DM_API_SET_STORAGE_CONFIG;
|
||||
#endif // #if (BLE_HOST_SETUP_STORAGE_EN == TRUE)
|
||||
|
||||
#if (BLE_HOST_ENERGY_INFO_EN == TRUE)
|
||||
typedef struct {
|
||||
BT_HDR hdr;
|
||||
tBTA_BLE_ENERGY_INFO_CBACK *p_energy_info_cback;
|
||||
} tBTA_DM_API_ENERGY_INFO;
|
||||
#endif // #if (BLE_HOST_ENERGY_INFO_EN == TRUE)
|
||||
|
||||
typedef struct {
|
||||
BT_HDR hdr;
|
||||
BD_ADDR remote_bda;
|
||||
@@ -1786,10 +1776,6 @@ typedef union {
|
||||
#if (BLE_HOST_SETUP_STORAGE_EN == TRUE)
|
||||
tBTA_DM_API_SET_STORAGE_CONFIG ble_set_storage;
|
||||
#endif // #if (BLE_HOST_SETUP_STORAGE_EN == TRUE)
|
||||
|
||||
#if (BLE_HOST_ENERGY_INFO_EN == TRUE)
|
||||
tBTA_DM_API_ENERGY_INFO ble_energy_info;
|
||||
#endif // #if (BLE_HOST_ENERGY_INFO_EN == TRUE)
|
||||
tBTA_DM_API_BLE_DISCONNECT ble_disconnect;
|
||||
tBTA_DM_API_UPDATE_DUPLICATE_EXCEPTIONAL_LIST ble_duplicate_exceptional_list;
|
||||
#if (BLE_50_FEATURE_SUPPORT == TRUE)
|
||||
@@ -2036,9 +2022,6 @@ typedef struct {
|
||||
tBTA_DM_SEC_CBACK *p_sec_cback;
|
||||
#if ((defined BLE_INCLUDED) && (BLE_INCLUDED == TRUE))
|
||||
tBTA_BLE_SCAN_SETUP_CBACK *p_setup_cback;
|
||||
#if (BLE_HOST_ENERGY_INFO_EN == TRUE)
|
||||
tBTA_BLE_ENERGY_INFO_CBACK *p_energy_info_cback;
|
||||
#endif // #if (BLE_HOST_ENERGY_INFO_EN == TRUE)
|
||||
#endif
|
||||
UINT16 state;
|
||||
BOOLEAN disabling;
|
||||
@@ -2397,11 +2380,6 @@ extern void bta_dm_ble_enable_batch_scan(tBTA_DM_MSG *p_data);
|
||||
extern void bta_dm_ble_disable_batch_scan(tBTA_DM_MSG *p_data);
|
||||
extern void bta_dm_ble_read_scan_reports(tBTA_DM_MSG *p_data);
|
||||
|
||||
|
||||
#if (BLE_HOST_ENERGY_INFO_EN == TRUE)
|
||||
extern void bta_dm_ble_get_energy_info(tBTA_DM_MSG *p_data);
|
||||
#endif // #if (BLE_HOST_ENERGY_INFO_EN == TRUE)
|
||||
|
||||
#endif
|
||||
extern void bta_dm_set_encryption(tBTA_DM_MSG *p_data);
|
||||
extern void bta_dm_confirm(tBTA_DM_MSG *p_data);
|
||||
|
||||
@@ -1205,16 +1205,6 @@ typedef void (tBTA_DM_ENCRYPT_CBACK) (BD_ADDR bd_addr, tBTA_TRANSPORT transport,
|
||||
#define BTA_DM_BLE_SEC_MITM BTM_BLE_SEC_ENCRYPT_MITM
|
||||
typedef tBTM_BLE_SEC_ACT tBTA_DM_BLE_SEC_ACT;
|
||||
|
||||
typedef tBTM_BLE_TX_TIME_MS tBTA_DM_BLE_TX_TIME_MS;
|
||||
typedef tBTM_BLE_RX_TIME_MS tBTA_DM_BLE_RX_TIME_MS;
|
||||
typedef tBTM_BLE_IDLE_TIME_MS tBTA_DM_BLE_IDLE_TIME_MS;
|
||||
typedef tBTM_BLE_ENERGY_USED tBTA_DM_BLE_ENERGY_USED;
|
||||
|
||||
#define BTA_DM_CONTRL_UNKNOWN 0 /* Unknown state */
|
||||
#define BTA_DM_CONTRL_ACTIVE 1 /* ACL link on, SCO link ongoing, sniff mode */
|
||||
#define BTA_DM_CONTRL_SCAN 2 /* Scan state - paging/inquiry/trying to connect*/
|
||||
#define BTA_DM_CONTRL_IDLE 3 /* Idle state - page scan, LE advt, inquiry scan */
|
||||
|
||||
typedef UINT8 tBTA_DM_CONTRL_STATE;
|
||||
|
||||
typedef UINT8 tBTA_DM_BLE_ADV_STATE;
|
||||
@@ -1238,15 +1228,6 @@ typedef void (tBTA_START_STOP_ADV_CMPL_CBACK) (tBTA_STATUS status);
|
||||
|
||||
typedef void (tBTA_CLEAR_ADV_CMPL_CBACK) (tBTA_STATUS status);
|
||||
|
||||
#if (BLE_HOST_ENERGY_INFO_EN == TRUE)
|
||||
typedef void (tBTA_BLE_ENERGY_INFO_CBACK)(tBTA_DM_BLE_TX_TIME_MS tx_time,
|
||||
tBTA_DM_BLE_RX_TIME_MS rx_time,
|
||||
tBTA_DM_BLE_IDLE_TIME_MS idle_time,
|
||||
tBTA_DM_BLE_ENERGY_USED energy_used,
|
||||
tBTA_DM_CONTRL_STATE ctrl_state,
|
||||
tBTA_STATUS status);
|
||||
#endif // #if (BLE_HOST_ENERGY_INFO_EN == TRUE)
|
||||
|
||||
#else
|
||||
typedef UINT8 tBTA_DM_BLE_SEC_ACT;
|
||||
#endif
|
||||
@@ -3128,21 +3109,6 @@ extern void BTA_DmBleReadScanReports(tBTA_BLE_BATCH_SCAN_MODE scan_type,
|
||||
*******************************************************************************/
|
||||
extern void BTA_DmBleDisableBatchScan(tBTA_DM_BLE_REF_VALUE ref_value);
|
||||
|
||||
#if (BLE_HOST_ENERGY_INFO_EN == TRUE)
|
||||
/*******************************************************************************
|
||||
**
|
||||
** Function BTA_DmBleGetEnergyInfo
|
||||
**
|
||||
** Description This function is called to obtain the energy info
|
||||
**
|
||||
** Parameters p_cmpl_cback - Command complete callback
|
||||
**
|
||||
** Returns void
|
||||
**
|
||||
*******************************************************************************/
|
||||
extern void BTA_DmBleGetEnergyInfo(tBTA_BLE_ENERGY_INFO_CBACK *p_cmpl_cback);
|
||||
#endif // #if (BLE_HOST_ENERGY_INFO_EN == TRUE)
|
||||
|
||||
/*******************************************************************************
|
||||
**
|
||||
** Function BTA_BrcmInit
|
||||
|
||||
@@ -1618,11 +1618,6 @@
|
||||
#define BLE_INCLUDED FALSE
|
||||
#endif
|
||||
|
||||
#ifndef BLE_HOST_ENERGY_INFO_EN
|
||||
#define BLE_HOST_ENERGY_INFO_EN FALSE
|
||||
#endif
|
||||
|
||||
|
||||
#ifndef BLE_HOST_ENABLE_TEST_MODE_EN
|
||||
#define BLE_HOST_ENABLE_TEST_MODE_EN FALSE
|
||||
#endif
|
||||
|
||||
@@ -20,91 +20,5 @@
|
||||
#include "common/bt_target.h"
|
||||
|
||||
#if (BLE_INCLUDED == TRUE)
|
||||
#if (BLE_HOST_ENERGY_INFO_EN == TRUE)
|
||||
#include "stack/bt_types.h"
|
||||
#include "stack/hcimsgs.h"
|
||||
#include "stack/btu.h"
|
||||
#include "btm_int.h"
|
||||
//#include "bt_utils.h"
|
||||
#include "stack/hcidefs.h"
|
||||
#include "stack/btm_ble_api.h"
|
||||
|
||||
tBTM_BLE_ENERGY_INFO_CB ble_energy_info_cb;
|
||||
|
||||
/*******************************************************************************
|
||||
**
|
||||
** Function btm_ble_cont_energy_cmpl_cback
|
||||
**
|
||||
** Description Controller VSC complete callback
|
||||
**
|
||||
** Parameters
|
||||
**
|
||||
** Returns void
|
||||
**
|
||||
*******************************************************************************/
|
||||
void btm_ble_cont_energy_cmpl_cback (tBTM_VSC_CMPL *p_params)
|
||||
{
|
||||
UINT8 *p = p_params->p_param_buf;
|
||||
UINT16 len = p_params->param_len;
|
||||
UINT8 status = 0;
|
||||
UINT32 total_tx_time = 0, total_rx_time = 0, total_idle_time = 0, total_energy_used = 0;
|
||||
|
||||
if (len < 17) {
|
||||
BTM_TRACE_ERROR("wrong length for btm_ble_cont_energy_cmpl_cback");
|
||||
return;
|
||||
}
|
||||
|
||||
STREAM_TO_UINT8(status, p);
|
||||
STREAM_TO_UINT32(total_tx_time, p);
|
||||
STREAM_TO_UINT32(total_rx_time, p);
|
||||
STREAM_TO_UINT32(total_idle_time, p);
|
||||
STREAM_TO_UINT32(total_energy_used, p);
|
||||
|
||||
BTM_TRACE_DEBUG("energy_info status=%d,tx_t=%u, rx_t=%u, ener_used=%u, idle_t=%u",
|
||||
status, total_tx_time, total_rx_time, total_energy_used, total_idle_time);
|
||||
|
||||
if (NULL != ble_energy_info_cb.p_ener_cback) {
|
||||
ble_energy_info_cb.p_ener_cback(total_tx_time, total_rx_time, total_idle_time,
|
||||
total_energy_used, status);
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
/*******************************************************************************
|
||||
**
|
||||
** Function BTM_BleGetEnergyInfo
|
||||
**
|
||||
** Description This function obtains the energy info
|
||||
**
|
||||
** Parameters p_ener_cback - Callback pointer
|
||||
**
|
||||
** Returns status
|
||||
**
|
||||
*******************************************************************************/
|
||||
tBTM_STATUS BTM_BleGetEnergyInfo(tBTM_BLE_ENERGY_INFO_CBACK *p_ener_cback)
|
||||
{
|
||||
tBTM_STATUS status = BTM_ILLEGAL_VALUE;
|
||||
tBTM_BLE_VSC_CB cmn_ble_vsc_cb;
|
||||
|
||||
BTM_BleGetVendorCapabilities(&cmn_ble_vsc_cb);
|
||||
|
||||
BTM_TRACE_EVENT("BTM_BleGetEnergyInfo\n");
|
||||
|
||||
if (0 == cmn_ble_vsc_cb.energy_support) {
|
||||
BTM_TRACE_ERROR("Controller does not support get energy info\n");
|
||||
return BTM_ERR_PROCESSING;
|
||||
}
|
||||
|
||||
ble_energy_info_cb.p_ener_cback = p_ener_cback;
|
||||
if ((status = BTM_VendorSpecificCommand (HCI_BLE_ENERGY_INFO_OCF, 0, NULL,
|
||||
btm_ble_cont_energy_cmpl_cback)) != BTM_CMD_STARTED) {
|
||||
BTM_TRACE_ERROR("BTM_BleGetEnergyInfo status: %d", status);
|
||||
return BTM_ILLEGAL_VALUE;
|
||||
}
|
||||
|
||||
return status;
|
||||
}
|
||||
#endif // #if (BLE_HOST_ENERGY_INFO_EN == TRUE)
|
||||
|
||||
#endif
|
||||
|
||||
@@ -924,19 +924,6 @@ typedef UINT8 tBTM_BLE_CONN_TYPE;
|
||||
|
||||
typedef UINT8 tBTM_BLE_BATCH_SCAN_EVT;
|
||||
|
||||
typedef UINT32 tBTM_BLE_TX_TIME_MS;
|
||||
typedef UINT32 tBTM_BLE_RX_TIME_MS;
|
||||
typedef UINT32 tBTM_BLE_IDLE_TIME_MS;
|
||||
typedef UINT32 tBTM_BLE_ENERGY_USED;
|
||||
|
||||
typedef void (tBTM_BLE_ENERGY_INFO_CBACK)(tBTM_BLE_TX_TIME_MS tx_time, tBTM_BLE_RX_TIME_MS rx_time,
|
||||
tBTM_BLE_IDLE_TIME_MS idle_time,
|
||||
tBTM_BLE_ENERGY_USED energy_used,
|
||||
tBTM_STATUS status);
|
||||
|
||||
typedef struct {
|
||||
tBTM_BLE_ENERGY_INFO_CBACK *p_ener_cback;
|
||||
} tBTM_BLE_ENERGY_INFO_CB;
|
||||
|
||||
typedef BOOLEAN (tBTM_BLE_SEL_CBACK)(BD_ADDR random_bda, UINT8 *p_remote_name);
|
||||
|
||||
@@ -3105,20 +3092,6 @@ tBTM_STATUS BTM_BleEnableDisableFilterFeature(UINT8 enable,
|
||||
tBTM_BLE_PF_STATUS_CBACK *p_stat_cback,
|
||||
tBTM_BLE_REF_VALUE ref_value);
|
||||
|
||||
/*******************************************************************************
|
||||
**
|
||||
** Function BTM_BleGetEnergyInfo
|
||||
**
|
||||
** Description This function obtains the energy info
|
||||
**
|
||||
** Parameters p_ener_cback - Callback pointer
|
||||
**
|
||||
** Returns status
|
||||
**
|
||||
*******************************************************************************/
|
||||
//extern
|
||||
tBTM_STATUS BTM_BleGetEnergyInfo(tBTM_BLE_ENERGY_INFO_CBACK *p_ener_cback);
|
||||
|
||||
/*******************************************************************************
|
||||
**
|
||||
** Function BTM_SetBleDataLength
|
||||
|
||||
@@ -491,7 +491,7 @@
|
||||
#define HCI_SUBCODE_BLE_BATCH_SCAN 0x02
|
||||
#define HCI_SUBCODE_BLE_ADV_FILTER 0x03
|
||||
#define HCI_SUBCODE_BLE_TRACK_ADV 0x04
|
||||
#define HCI_SUBCODE_BLE_ENERGY_INFO 0x05
|
||||
|
||||
#define HCI_SUBCODE_BLE_EXTENDED_SCAN_PARAMS 0x06
|
||||
#define HCI_SUBCODE_BLE_LONG_ADV 0x07
|
||||
#define HCI_SUBCODE_BLE_DUPLICATE_EXCEPTIONAL_LIST 0x08
|
||||
@@ -542,8 +542,6 @@
|
||||
#define HCI_BLE_ADV_FILTER_OCF HCI_ESP_VENDOR_OPCODE_BUILD(HCI_VENDOR_OGF, HCI_ESP_GROUP_BLE, HCI_SUBCODE_BLE_ADV_FILTER)
|
||||
/* Tracking OCF */
|
||||
#define HCI_BLE_TRACK_ADV_OCF HCI_ESP_VENDOR_OPCODE_BUILD(HCI_VENDOR_OGF, HCI_ESP_GROUP_BLE, HCI_SUBCODE_BLE_TRACK_ADV)
|
||||
/* Energy info OCF */
|
||||
#define HCI_BLE_ENERGY_INFO_OCF HCI_ESP_VENDOR_OPCODE_BUILD(HCI_VENDOR_OGF, HCI_ESP_GROUP_BLE, HCI_SUBCODE_BLE_ENERGY_INFO)
|
||||
/* Extended BLE Scan parameters OCF */
|
||||
#define HCI_BLE_EXTENDED_SCAN_PARAMS_OCF HCI_ESP_VENDOR_OPCODE_BUILD(HCI_VENDOR_OGF, HCI_ESP_GROUP_BLE, HCI_SUBCODE_BLE_EXTENDED_SCAN_PARAMS)
|
||||
/* BLE update duplicate scan exceptional list */
|
||||
|
||||
Reference in New Issue
Block a user