feat(bt/bluedroid): Support ble bluedroid host power control feature
This commit is contained in:
@@ -1539,3 +1539,127 @@ void btm_ble_periodic_adv_sync_trans_recv_evt(tBTM_BLE_PERIOD_ADV_SYNC_TRANS_REC
|
||||
BTM_ExtBleCallbackTrigger(BTM_BLE_GAP_PERIODIC_ADV_SYNC_TRANS_RECV_EVT, &cb_params);
|
||||
}
|
||||
#endif // #if (BLE_FEAT_PERIODIC_ADV_SYNC_TRANSFER == TRUE)
|
||||
|
||||
#if (BLE_FEAT_POWER_CONTROL_EN == TRUE)
|
||||
void BTM_BleEnhReadTransPowerLevel(uint16_t conn_handle, uint8_t phy)
|
||||
{
|
||||
btsnd_hcic_ble_enh_read_trans_power_level(conn_handle, phy);
|
||||
}
|
||||
|
||||
void BTM_BleReadRemoteTransPwrLevel(uint16_t conn_handle, uint8_t phy)
|
||||
{
|
||||
btsnd_hcic_ble_read_remote_trans_power_level(conn_handle, phy);
|
||||
}
|
||||
|
||||
void BTM_BleSetPathLossRptParams(uint16_t conn_handle, uint8_t high_threshold, uint8_t high_hysteresis,
|
||||
uint8_t low_threshold, uint8_t low_hysteresis, uint16_t min_time_spent)
|
||||
{
|
||||
tBTM_STATUS status = BTM_SUCCESS;
|
||||
tHCI_STATUS err = HCI_SUCCESS;
|
||||
tBTM_BLE_5_GAP_CB_PARAMS cb_params = {0};
|
||||
|
||||
if ((err = btsnd_hcic_ble_set_path_loss_rpt_params(conn_handle, high_threshold, high_hysteresis, low_threshold, low_hysteresis, min_time_spent)) != HCI_SUCCESS) {
|
||||
BTM_TRACE_ERROR("%s cmd err=0x%x", __func__, err);
|
||||
status = BTM_HCI_ERROR | err;
|
||||
}
|
||||
|
||||
cb_params.path_loss_rpting_params.status = status;
|
||||
cb_params.path_loss_rpting_params.conn_handle = conn_handle;
|
||||
|
||||
BTM_ExtBleCallbackTrigger(BTM_BLE_GAP_SET_PATH_LOSS_REPORTING_PARAMS_EVT, &cb_params);
|
||||
}
|
||||
|
||||
void BTM_BleSetPathLossRptEnable(uint16_t conn_handle, uint8_t enable)
|
||||
{
|
||||
tBTM_STATUS status = BTM_SUCCESS;
|
||||
tHCI_STATUS err = HCI_SUCCESS;
|
||||
tBTM_BLE_5_GAP_CB_PARAMS cb_params = {0};
|
||||
|
||||
if ((err = btsnd_hcic_ble_set_path_loss_rpt_enable(conn_handle, enable)) != HCI_SUCCESS) {
|
||||
BTM_TRACE_ERROR("%s cmd err=0x%x", __func__, err);
|
||||
status = BTM_HCI_ERROR | err;
|
||||
}
|
||||
|
||||
cb_params.path_loss_rpting_enable.status = status;
|
||||
cb_params.path_loss_rpting_enable.conn_handle = conn_handle;
|
||||
|
||||
BTM_ExtBleCallbackTrigger(BTM_BLE_GAP_SET_PATH_LOSS_REPORTING_ENABLE_EVT, &cb_params);
|
||||
}
|
||||
|
||||
void BTM_BleSetTransPwrRptEnable(uint16_t conn_handle, uint8_t local_enable, uint8_t remote_enable)
|
||||
{
|
||||
tBTM_STATUS status = BTM_SUCCESS;
|
||||
tHCI_STATUS err = HCI_SUCCESS;
|
||||
tBTM_BLE_5_GAP_CB_PARAMS cb_params = {0};
|
||||
|
||||
if ((err = btsnd_hcic_ble_set_trans_pwr_rpt_enable(conn_handle, local_enable, remote_enable)) != HCI_SUCCESS) {
|
||||
BTM_TRACE_ERROR("%s cmd err=0x%x", __func__, err);
|
||||
status = BTM_HCI_ERROR | err;
|
||||
}
|
||||
|
||||
cb_params.trans_pwr_rpting_enable.status = status;
|
||||
cb_params.trans_pwr_rpting_enable.conn_handle = conn_handle;
|
||||
|
||||
BTM_ExtBleCallbackTrigger(BTM_BLE_GAP_SET_TRANS_POWER_REPORTING_ENABLE_EVT, &cb_params);
|
||||
}
|
||||
|
||||
void btm_enh_read_trans_pwr_level_cmpl_evt(uint8_t *p)
|
||||
{
|
||||
uint8_t hci_status;
|
||||
tBTM_BLE_5_GAP_CB_PARAMS cb_params = {0};
|
||||
|
||||
STREAM_TO_UINT8(hci_status, p);
|
||||
STREAM_TO_UINT16(cb_params.enh_trans_pwr_level_cmpl.conn_handle, p);
|
||||
STREAM_TO_UINT8(cb_params.enh_trans_pwr_level_cmpl.phy, p);
|
||||
STREAM_TO_UINT8(cb_params.enh_trans_pwr_level_cmpl.cur_tx_pwr_level, p);
|
||||
STREAM_TO_UINT8(cb_params.enh_trans_pwr_level_cmpl.max_tx_pwr_level, p);
|
||||
|
||||
if(hci_status != HCI_SUCCESS) {
|
||||
hci_status = BTM_HCI_ERROR | hci_status;
|
||||
BTM_TRACE_ERROR("%s error status %d", __func__, hci_status);
|
||||
}
|
||||
cb_params.enh_trans_pwr_level_cmpl.status = hci_status;
|
||||
|
||||
BTM_ExtBleCallbackTrigger(BTM_BLE_GAP_ENH_READ_TRANS_POWER_LEVEL_EVT, &cb_params);
|
||||
}
|
||||
|
||||
void btm_read_remote_trans_pwr_level_cmpl(UINT8 status)
|
||||
{
|
||||
tBTM_BLE_5_GAP_CB_PARAMS cb_params = {0};
|
||||
|
||||
if (status != HCI_SUCCESS) {
|
||||
status = (status | BTM_HCI_ERROR);
|
||||
}
|
||||
|
||||
cb_params.remote_pwr_level_cmpl.status = status;
|
||||
|
||||
BTM_ExtBleCallbackTrigger(BTM_BLE_GAP_READ_REMOTE_TRANS_POWER_LEVEL_EVT, &cb_params);
|
||||
}
|
||||
|
||||
void btm_ble_path_loss_threshold_evt(tBTM_BLE_PATH_LOSS_THRESHOLD_EVT *params)
|
||||
{
|
||||
if (!params) {
|
||||
BTM_TRACE_ERROR("%s, Invalid params.", __func__);
|
||||
return;
|
||||
}
|
||||
|
||||
// If the user has register the callback function, should callback it to the application.
|
||||
BTM_ExtBleCallbackTrigger(BTM_BLE_GAP_PATH_LOSS_THRESHOLD_EVT, (tBTM_BLE_5_GAP_CB_PARAMS *)params);
|
||||
}
|
||||
|
||||
void btm_ble_transmit_power_report_evt(tBTM_BLE_TRANS_POWER_REPORT_EVT *params)
|
||||
{
|
||||
if (!params) {
|
||||
BTM_TRACE_ERROR("%s, Invalid params.", __func__);
|
||||
return;
|
||||
}
|
||||
|
||||
if (params->status != HCI_SUCCESS) {
|
||||
params->status = (params->status | BTM_HCI_ERROR);
|
||||
}
|
||||
|
||||
// If the user has register the callback function, should callback it to the application.
|
||||
BTM_ExtBleCallbackTrigger(BTM_BLE_GAP_TRANMIT_POWER_REPORTING_EVT, (tBTM_BLE_5_GAP_CB_PARAMS *)params);
|
||||
}
|
||||
|
||||
#endif // #if (BLE_FEAT_POWER_CONTROL_EN == TRUE)
|
||||
|
||||
@@ -598,6 +598,12 @@ void btm_ble_connless_iq_report_evt(tBTM_BLE_CTE_CONNLESS_IQ_REPORT_EVT *params)
|
||||
void btm_ble_conn_iq_report_evt(tBTM_BLE_CTE_CONN_IQ_REPORT_EVT *params);
|
||||
void btm_ble_cte_req_failed_evt(tBTM_BLE_CTE_REQ_FAILED_EVT *params);
|
||||
#endif // #if (BLE_FEAT_CTE_EN == TRUE)
|
||||
|
||||
#if (BLE_FEAT_POWER_CONTROL_EN == TRUE)
|
||||
void btm_ble_path_loss_threshold_evt(tBTM_BLE_PATH_LOSS_THRESHOLD_EVT *params);
|
||||
void btm_ble_transmit_power_report_evt(tBTM_BLE_TRANS_POWER_REPORT_EVT *params);
|
||||
#endif // #if (BLE_FEAT_POWER_CONTROL_EN == TRUE)
|
||||
|
||||
/*
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
||||
@@ -1121,6 +1121,11 @@ void btm_read_phy_callback(uint8_t hci_status, uint16_t conn_handle, uint8_t tx_
|
||||
void btm_ble_periodic_adv_sync_trans_complete(UINT16 op_code, UINT8 hci_status, UINT16 conn_handle);
|
||||
#endif
|
||||
void btm_ble_big_sync_terminate_complete(UINT8 hci_status, UINT8 big_handle);
|
||||
|
||||
#if (BLE_FEAT_POWER_CONTROL_EN == TRUE)
|
||||
void btm_enh_read_trans_pwr_level_cmpl_evt(uint8_t *p);
|
||||
void btm_read_remote_trans_pwr_level_cmpl(UINT8 status);
|
||||
#endif // #if (BLE_FEAT_POWER_CONTROL_EN == TRUE)
|
||||
/* Internal functions provided by btm_sco.c
|
||||
********************************************
|
||||
*/
|
||||
|
||||
@@ -219,6 +219,11 @@ static void btu_ble_cte_req_failed_evt(UINT8 *p);
|
||||
#endif // #if (BLE_FEAT_CTE_CONNECTION_EN == TRUE)
|
||||
#endif // #if (BLE_FEAT_CTE_EN == TRUE)
|
||||
|
||||
#if (BLE_FEAT_POWER_CONTROL_EN == TRUE)
|
||||
static void btu_ble_path_loss_threshold_evt(UINT8 *p);
|
||||
static void btu_ble_transmit_power_report_evt(UINT8 *p);
|
||||
#endif // #if (BLE_FEAT_POWER_CONTROL_EN == TRUE)
|
||||
|
||||
#if (BLE_42_ADV_EN == TRUE)
|
||||
extern osi_sem_t adv_enable_sem;
|
||||
extern osi_sem_t adv_data_sem;
|
||||
@@ -564,6 +569,14 @@ void btu_hcif_process_event (UNUSED_ATTR UINT8 controller_id, BT_HDR *p_msg)
|
||||
#endif // #if (BLE_FEAT_CTE_CONNECTION_EN == TRUE)
|
||||
|
||||
#endif // #if (BLE_FEAT_CTE_EN == TRUE)
|
||||
#if (BLE_FEAT_POWER_CONTROL_EN == TRUE)
|
||||
case HCI_BLE_PATH_LOSS_THRESHOLD_EVT:
|
||||
btu_ble_path_loss_threshold_evt(p);
|
||||
break;
|
||||
case HCI_BLE_TRANS_POWER_REPORTING_EVT:
|
||||
btu_ble_transmit_power_report_evt(p);
|
||||
break;
|
||||
#endif // #if (BLE_FEAT_POWER_CONTROL_EN == TRUE)
|
||||
}
|
||||
break;
|
||||
#endif /* BLE_INCLUDED */
|
||||
@@ -1358,6 +1371,13 @@ static void btu_hcif_hdl_command_complete (UINT16 opcode, UINT8 *p, UINT16 evt_l
|
||||
btm_ble_cte_read_ant_infor_complete(p);
|
||||
break;
|
||||
#endif // #if (BLE_FEAT_CTE_EN == TRUE)
|
||||
|
||||
#if (BLE_FEAT_POWER_CONTROL_EN == TRUE)
|
||||
case HCI_BLE_ENH_READ_TRANS_POWER_LEVEL:
|
||||
btm_enh_read_trans_pwr_level_cmpl_evt(p);
|
||||
break;
|
||||
#endif //#if (BLE_FEAT_POWER_CONTROL_EN == TRUE)
|
||||
|
||||
#endif /* (BLE_INCLUDED == TRUE) */
|
||||
|
||||
default: {
|
||||
@@ -1555,6 +1575,11 @@ static void btu_hcif_hdl_command_status (UINT16 opcode, UINT8 status, UINT8 *p_c
|
||||
break;
|
||||
#endif // #if (BLE_FEAT_ISO_CIG_PERIPHERAL_EN == TRUE)
|
||||
#endif // #if (BLE_FEAT_ISO_EN == TRUE)
|
||||
#if (BLE_FEAT_POWER_CONTROL_EN == TRUE)
|
||||
case HCI_BLE_READ_REMOTE_TRANS_POWER_LEVEL:
|
||||
btm_read_remote_trans_pwr_level_cmpl(status);
|
||||
break;
|
||||
#endif // #if (BLE_FEAT_POWER_CONTROL_EN == TRUE)
|
||||
default:
|
||||
/* If command failed to start, we may need to tell BTM */
|
||||
if (status != HCI_SUCCESS) {
|
||||
@@ -2985,6 +3010,42 @@ static void btu_ble_cte_req_failed_evt(UINT8 *p)
|
||||
|
||||
#endif // #if (BLE_FEAT_CTE_EN == TRUE)
|
||||
|
||||
#if (BLE_FEAT_POWER_CONTROL_EN == TRUE)
|
||||
static void btu_ble_path_loss_threshold_evt(UINT8 *p)
|
||||
{
|
||||
tBTM_BLE_PATH_LOSS_THRESHOLD_EVT path_loss_thres_evt = {0};
|
||||
if (!p) {
|
||||
HCI_TRACE_ERROR("%s, Invalid params.", __func__);
|
||||
return;
|
||||
}
|
||||
|
||||
STREAM_TO_UINT16(path_loss_thres_evt.conn_handle, p);
|
||||
STREAM_TO_UINT8(path_loss_thres_evt.cur_path_loss, p);
|
||||
STREAM_TO_UINT8(path_loss_thres_evt.zone_entered, p);
|
||||
|
||||
btm_ble_path_loss_threshold_evt(&path_loss_thres_evt);
|
||||
}
|
||||
|
||||
static void btu_ble_transmit_power_report_evt(UINT8 *p)
|
||||
{
|
||||
tBTM_BLE_TRANS_POWER_REPORT_EVT trans_pwr_report_evt = {0};
|
||||
if (!p) {
|
||||
HCI_TRACE_ERROR("%s, Invalid params.", __func__);
|
||||
return;
|
||||
}
|
||||
|
||||
STREAM_TO_UINT8(trans_pwr_report_evt.status, p);
|
||||
STREAM_TO_UINT16(trans_pwr_report_evt.conn_handle, p);
|
||||
STREAM_TO_UINT8(trans_pwr_report_evt.reason, p);
|
||||
STREAM_TO_UINT8(trans_pwr_report_evt.phy, p);
|
||||
STREAM_TO_UINT8(trans_pwr_report_evt.tx_power_level, p);
|
||||
STREAM_TO_UINT8(trans_pwr_report_evt.tx_power_level_flag, p);
|
||||
STREAM_TO_UINT8(trans_pwr_report_evt.delta, p);
|
||||
|
||||
btm_ble_transmit_power_report_evt(&trans_pwr_report_evt);
|
||||
}
|
||||
#endif // #if (BLE_FEAT_POWER_CONTROL_EN == TRUE)
|
||||
|
||||
/**********************************************
|
||||
** End of BLE Events Handler
|
||||
***********************************************/
|
||||
|
||||
@@ -2641,3 +2641,112 @@ UINT8 btsnd_hcic_ble_read_antenna_info(void)
|
||||
return btu_hcif_send_cmd_sync(LOCAL_BR_EDR_CONTROLLER_ID, p);
|
||||
}
|
||||
#endif // #if (BLE_FEAT_CTE_EN == TRUE)
|
||||
|
||||
#if (BLE_FEAT_POWER_CONTROL_EN == TRUE)
|
||||
UINT8 btsnd_hcic_ble_enh_read_trans_power_level(uint16_t conn_handle, uint8_t phy)
|
||||
{
|
||||
BT_HDR *p;
|
||||
UINT8 *pp;
|
||||
|
||||
HCI_TRACE_DEBUG("hci enh read trans power level, conn_handle %d phy %d", conn_handle, phy);
|
||||
|
||||
HCIC_BLE_CMD_CREATED(p, pp, HCIC_PARAM_SIZE_ENH_READ_TRANS_PWR_LEVEL);
|
||||
|
||||
pp = (UINT8 *)(p + 1);
|
||||
|
||||
UINT16_TO_STREAM(pp, HCI_BLE_ENH_READ_TRANS_POWER_LEVEL);
|
||||
UINT8_TO_STREAM(pp, HCIC_PARAM_SIZE_ENH_READ_TRANS_PWR_LEVEL);
|
||||
|
||||
UINT16_TO_STREAM(pp, conn_handle);
|
||||
UINT8_TO_STREAM(pp, phy);
|
||||
|
||||
return btu_hcif_send_cmd_sync(LOCAL_BR_EDR_CONTROLLER_ID, p);
|
||||
}
|
||||
|
||||
UINT8 btsnd_hcic_ble_read_remote_trans_power_level(uint16_t conn_handle, uint8_t phy)
|
||||
{
|
||||
BT_HDR *p;
|
||||
UINT8 *pp;
|
||||
|
||||
HCI_TRACE_DEBUG("hci read remote trans power level, conn_handle %d phy %d", conn_handle, phy);
|
||||
HCIC_BLE_CMD_CREATED(p, pp, HCIC_PARAM_SIZE_READ_REMOTE_TRANS_PWR_LEVEL);
|
||||
|
||||
pp = (UINT8 *)(p + 1);
|
||||
|
||||
UINT16_TO_STREAM(pp, HCI_BLE_READ_REMOTE_TRANS_POWER_LEVEL);
|
||||
UINT8_TO_STREAM(pp, HCIC_PARAM_SIZE_READ_REMOTE_TRANS_PWR_LEVEL);
|
||||
|
||||
UINT16_TO_STREAM(pp, conn_handle);
|
||||
UINT8_TO_STREAM(pp, phy);
|
||||
|
||||
btu_hcif_send_cmd(LOCAL_BR_EDR_CONTROLLER_ID, p);
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
UINT8 btsnd_hcic_ble_set_path_loss_rpt_params(uint16_t conn_handle, uint8_t high_threshold, uint8_t high_hysteresis,
|
||||
uint8_t low_threshold, uint8_t low_hysteresis, uint16_t min_time_spent)
|
||||
{
|
||||
BT_HDR *p;
|
||||
UINT8 *pp;
|
||||
|
||||
HCI_TRACE_DEBUG("hci set path loss rpt params, conn_handle %d high_threshold %d high_hysteresis %d low_threshold %d low_hysteresis %d min_time_spent %d",
|
||||
conn_handle, high_threshold, high_hysteresis, low_threshold,
|
||||
low_hysteresis, min_time_spent);
|
||||
|
||||
HCIC_BLE_CMD_CREATED(p, pp, HCIC_PARAM_SIZE_SET_PATH_LOSS_REPORTING_PARAMS);
|
||||
|
||||
pp = (UINT8 *)(p + 1);
|
||||
|
||||
UINT16_TO_STREAM(pp, HCI_BLE_SET_PATH_LOSS_REPORTING_PARAMS);
|
||||
UINT8_TO_STREAM(pp, HCIC_PARAM_SIZE_SET_PATH_LOSS_REPORTING_PARAMS);
|
||||
|
||||
UINT16_TO_STREAM(pp, conn_handle);
|
||||
UINT8_TO_STREAM(pp, high_threshold);
|
||||
UINT8_TO_STREAM(pp, high_hysteresis);
|
||||
UINT8_TO_STREAM(pp, low_threshold);
|
||||
UINT8_TO_STREAM(pp, low_hysteresis);
|
||||
UINT16_TO_STREAM(pp, min_time_spent);
|
||||
|
||||
return btu_hcif_send_cmd_sync(LOCAL_BR_EDR_CONTROLLER_ID, p);
|
||||
}
|
||||
|
||||
UINT8 btsnd_hcic_ble_set_path_loss_rpt_enable(uint16_t conn_handle, uint8_t enable)
|
||||
{
|
||||
BT_HDR *p;
|
||||
UINT8 *pp;
|
||||
|
||||
HCI_TRACE_DEBUG("hci set path loss rpt en, conn_handle %d enable %d", conn_handle, enable);
|
||||
HCIC_BLE_CMD_CREATED(p, pp, HCIC_PARAM_SIZE_SET_PATH_LOSS_REPORTING_ENABLE);
|
||||
|
||||
pp = (UINT8 *)(p + 1);
|
||||
|
||||
UINT16_TO_STREAM(pp, HCI_BLE_SET_PATH_LOSS_REPORTING_ENABLE);
|
||||
UINT8_TO_STREAM(pp, HCIC_PARAM_SIZE_SET_PATH_LOSS_REPORTING_ENABLE);
|
||||
|
||||
UINT16_TO_STREAM(pp, conn_handle);
|
||||
UINT8_TO_STREAM(pp, enable);
|
||||
|
||||
return btu_hcif_send_cmd_sync(LOCAL_BR_EDR_CONTROLLER_ID, p);
|
||||
}
|
||||
|
||||
UINT8 btsnd_hcic_ble_set_trans_pwr_rpt_enable(uint16_t conn_handle, uint8_t local_enable, uint8_t remote_enable)
|
||||
{
|
||||
BT_HDR *p;
|
||||
UINT8 *pp;
|
||||
|
||||
HCI_TRACE_DEBUG("hci set trans power rpt en, conn_handle %d local_enable %d remote_enable %d", conn_handle, local_enable, remote_enable);
|
||||
HCIC_BLE_CMD_CREATED(p, pp, HCIC_PARAM_SIZE_SET_TRANS_PWR_REPORTING_ENABLE);
|
||||
|
||||
pp = (UINT8 *)(p + 1);
|
||||
|
||||
UINT16_TO_STREAM(pp, HCI_BLE_SET_TRANS_POWER_REPORTING_ENABLE);
|
||||
UINT8_TO_STREAM(pp, HCIC_PARAM_SIZE_SET_TRANS_PWR_REPORTING_ENABLE);
|
||||
|
||||
UINT16_TO_STREAM(pp, conn_handle);
|
||||
UINT8_TO_STREAM(pp, local_enable);
|
||||
UINT8_TO_STREAM(pp, remote_enable);
|
||||
|
||||
return btu_hcif_send_cmd_sync(LOCAL_BR_EDR_CONTROLLER_ID, p);
|
||||
}
|
||||
#endif // #if (BLE_FEAT_POWER_CONTROL_EN == TRUE)
|
||||
|
||||
@@ -1072,6 +1072,15 @@ typedef void (tBTM_SET_VENDOR_EVT_MASK_CBACK) (tBTM_STATUS status);
|
||||
#define BTM_BLE_GAP_PERIODIC_ADV_SYNC_TRANS_RECV_EVT 39
|
||||
#endif // #if (BLE_FEAT_PERIODIC_ADV_SYNC_TRANSFER == TRUE)
|
||||
#define BTM_BLE_GAP_SET_PRIVACY_MODE_COMPLETE_EVT 40
|
||||
#if (BLE_FEAT_POWER_CONTROL_EN == TRUE)
|
||||
#define BTM_BLE_GAP_ENH_READ_TRANS_POWER_LEVEL_EVT 41
|
||||
#define BTM_BLE_GAP_READ_REMOTE_TRANS_POWER_LEVEL_EVT 42
|
||||
#define BTM_BLE_GAP_SET_PATH_LOSS_REPORTING_PARAMS_EVT 43
|
||||
#define BTM_BLE_GAP_SET_PATH_LOSS_REPORTING_ENABLE_EVT 44
|
||||
#define BTM_BLE_GAP_SET_TRANS_POWER_REPORTING_ENABLE_EVT 45
|
||||
#define BTM_BLE_GAP_PATH_LOSS_THRESHOLD_EVT 46
|
||||
#define BTM_BLE_GAP_TRANMIT_POWER_REPORTING_EVT 47
|
||||
#endif // #if (BLE_FEAT_POWER_CONTROL_EN == TRUE)
|
||||
#define BTM_BLE_5_GAP_UNKNOWN_EVT 50
|
||||
typedef UINT8 tBTM_BLE_5_GAP_EVENT;
|
||||
|
||||
@@ -1379,6 +1388,52 @@ typedef struct {
|
||||
} tBTM_BLE_PERIOD_ADV_SYNC_TRANS_RECV;
|
||||
#endif //#if (BLE_FEAT_PERIODIC_ADV_SYNC_TRANSFER == TRUE)
|
||||
|
||||
#if (BLE_FEAT_POWER_CONTROL_EN == TRUE)
|
||||
typedef struct {
|
||||
UINT8 status;
|
||||
UINT16 conn_handle;
|
||||
UINT8 phy;
|
||||
INT8 cur_tx_pwr_level;
|
||||
INT8 max_tx_pwr_level;
|
||||
} __attribute__((packed)) tBTM_BLE_ENH_TRANS_PWR_LEVEL_CMPL;
|
||||
|
||||
typedef struct {
|
||||
UINT8 status;
|
||||
} __attribute__((packed)) tBTM_BLE_REMOTE_TRANS_PWR_LEVEL_CMPL;
|
||||
|
||||
typedef struct {
|
||||
UINT8 status;
|
||||
UINT16 conn_handle;
|
||||
} __attribute__((packed)) tBTM_BLE_SET_PATH_LOSS_RPTING_PARAMS;
|
||||
|
||||
typedef struct {
|
||||
UINT8 status;
|
||||
UINT16 conn_handle;
|
||||
} __attribute__((packed)) tBTM_BLE_SET_PATH_LOSS_RPTING_ENABLE;
|
||||
|
||||
typedef struct {
|
||||
UINT8 status;
|
||||
UINT16 conn_handle;
|
||||
} __attribute__((packed)) tBTM_BLE_SET_TRANS_POWER_RPTING_ENABLE;
|
||||
|
||||
typedef struct {
|
||||
UINT16 conn_handle;
|
||||
UINT8 cur_path_loss;
|
||||
UINT8 zone_entered;
|
||||
} __attribute__((packed)) tBTM_BLE_PATH_LOSS_THRESHOLD_EVT;
|
||||
|
||||
typedef struct {
|
||||
UINT8 status;
|
||||
UINT16 conn_handle;
|
||||
UINT8 reason;
|
||||
UINT8 phy;
|
||||
INT8 tx_power_level;
|
||||
UINT8 tx_power_level_flag;
|
||||
INT8 delta;
|
||||
} __attribute__((packed)) tBTM_BLE_TRANS_POWER_REPORT_EVT;
|
||||
|
||||
#endif // #if (BLE_FEAT_POWER_CONTROL_EN == TRUE)
|
||||
|
||||
#if (BLE_FEAT_ISO_EN == TRUE)
|
||||
#if (BLE_FEAT_ISO_BIG_BROCASTER_EN == TRUE)
|
||||
typedef struct {
|
||||
@@ -1733,6 +1788,15 @@ typedef union {
|
||||
tBTM_BLE_SET_PERIOD_ADV_SYNC_TRANS_PARAMS_CMPL set_past_params;
|
||||
tBTM_BLE_PERIOD_ADV_SYNC_TRANS_RECV past_recv;
|
||||
#endif //#if (BLE_FEAT_PERIODIC_ADV_SYNC_TRANSFER == TRUE)
|
||||
#if (BLE_FEAT_POWER_CONTROL_EN == TRUE)
|
||||
tBTM_BLE_ENH_TRANS_PWR_LEVEL_CMPL enh_trans_pwr_level_cmpl;
|
||||
tBTM_BLE_REMOTE_TRANS_PWR_LEVEL_CMPL remote_pwr_level_cmpl;
|
||||
tBTM_BLE_SET_PATH_LOSS_RPTING_PARAMS path_loss_rpting_params;
|
||||
tBTM_BLE_SET_PATH_LOSS_RPTING_ENABLE path_loss_rpting_enable;
|
||||
tBTM_BLE_SET_TRANS_POWER_RPTING_ENABLE trans_pwr_rpting_enable;
|
||||
tBTM_BLE_PATH_LOSS_THRESHOLD_EVT path_loss_thres_evt;
|
||||
tBTM_BLE_TRANS_POWER_REPORT_EVT trans_pwr_report_evt;
|
||||
#endif // #if (BLE_FEAT_POWER_CONTROL_EN == TRUE)
|
||||
} tBTM_BLE_5_GAP_CB_PARAMS;
|
||||
|
||||
typedef struct {
|
||||
@@ -3256,4 +3320,14 @@ tBTM_STATUS BTM_BleCteSetConnectionRspEnable(uint16_t conn_handle, uint8_t enabl
|
||||
tBTM_STATUS BTM_BleCteReadAntInfor(void);
|
||||
|
||||
#endif // #if (BLE_FEAT_CTE_EN == TRUE)
|
||||
|
||||
#if (BLE_FEAT_POWER_CONTROL_EN == TRUE)
|
||||
void BTM_BleEnhReadTransPowerLevel(uint16_t conn_handle, uint8_t phy);
|
||||
void BTM_BleReadRemoteTransPwrLevel(uint16_t conn_handle, uint8_t phy);
|
||||
void BTM_BleSetPathLossRptParams(uint16_t conn_handle, uint8_t high_threshold, uint8_t high_hysteresis,
|
||||
uint8_t low_threshold, uint8_t low_hysteresis, uint16_t min_time_spent);
|
||||
void BTM_BleSetPathLossRptEnable(uint16_t conn_handle, uint8_t enable);
|
||||
void BTM_BleSetTransPwrRptEnable(uint16_t conn_handle, uint8_t local_enable, uint8_t remote_enable);
|
||||
#endif // #if (BLE_FEAT_POWER_CONTROL_EN == TRUE)
|
||||
|
||||
#endif
|
||||
|
||||
@@ -429,6 +429,15 @@
|
||||
#define HCI_BLE_ISO_SET_HOST_FEATURE (0x0074 | HCI_GRP_BLE_CMDS)
|
||||
#define HCI_BLE_ISO_READ_ISO_LINK_QUALITY (0x0075 | HCI_GRP_BLE_CMDS)
|
||||
#define HCI_BLE_ISO_SET_HOST_FEATURE_V2 (0x0097 | HCI_GRP_BLE_CMDS)
|
||||
|
||||
#if (BLE_FEAT_POWER_CONTROL_EN == TRUE)
|
||||
#define HCI_BLE_ENH_READ_TRANS_POWER_LEVEL (0x0076 | HCI_GRP_BLE_CMDS)
|
||||
#define HCI_BLE_READ_REMOTE_TRANS_POWER_LEVEL (0x0077 | HCI_GRP_BLE_CMDS)
|
||||
#define HCI_BLE_SET_PATH_LOSS_REPORTING_PARAMS (0x0078 | HCI_GRP_BLE_CMDS)
|
||||
#define HCI_BLE_SET_PATH_LOSS_REPORTING_ENABLE (0x0079 | HCI_GRP_BLE_CMDS)
|
||||
#define HCI_BLE_SET_TRANS_POWER_REPORTING_ENABLE (0x007A | HCI_GRP_BLE_CMDS)
|
||||
#endif // #if (BLE_FEAT_POWER_CONTROL_EN == TRUE)
|
||||
|
||||
// Vendor OGF define
|
||||
#define HCI_VENDOR_OGF 0x3F
|
||||
|
||||
@@ -881,6 +890,11 @@
|
||||
#define HCI_BLE_CIS_ESTABLISHED_V2_EVT 0x2A
|
||||
#endif // #if (BLE_FEAT_ISO_EN == TRUE)
|
||||
|
||||
#if (BLE_FEAT_POWER_CONTROL_EN == TRUE)
|
||||
#define HCI_BLE_PATH_LOSS_THRESHOLD_EVT 0x20
|
||||
#define HCI_BLE_TRANS_POWER_REPORTING_EVT 0x21
|
||||
#endif // #if (BLE_FEAT_POWER_CONTROL_EN == TRUE)
|
||||
|
||||
/* Definitions for LE Channel Map */
|
||||
#define HCI_BLE_CHNL_MAP_SIZE 5
|
||||
|
||||
|
||||
@@ -1215,4 +1215,19 @@ UINT8 btsnd_hcic_ble_conn_cte_rsp_enable(uint16_t conn_hdl, uint8_t enable);
|
||||
#endif // #if (BLE_FEAT_CTE_CONNECTION_EN == TRUE)
|
||||
UINT8 btsnd_hcic_ble_read_antenna_info(void);
|
||||
#endif // #if (BLE_FEAT_CTE_EN == TRUE)
|
||||
|
||||
#if (BLE_FEAT_POWER_CONTROL_EN == TRUE)
|
||||
#define HCIC_PARAM_SIZE_ENH_READ_TRANS_PWR_LEVEL 3
|
||||
#define HCIC_PARAM_SIZE_READ_REMOTE_TRANS_PWR_LEVEL 3
|
||||
#define HCIC_PARAM_SIZE_SET_PATH_LOSS_REPORTING_PARAMS 8
|
||||
#define HCIC_PARAM_SIZE_SET_PATH_LOSS_REPORTING_ENABLE 3
|
||||
#define HCIC_PARAM_SIZE_SET_TRANS_PWR_REPORTING_ENABLE 4
|
||||
|
||||
UINT8 btsnd_hcic_ble_enh_read_trans_power_level(uint16_t conn_handle, uint8_t phy);
|
||||
UINT8 btsnd_hcic_ble_read_remote_trans_power_level(uint16_t conn_handle, uint8_t phy);
|
||||
UINT8 btsnd_hcic_ble_set_path_loss_rpt_params(uint16_t conn_handle, uint8_t high_threshold, uint8_t high_hysteresis,
|
||||
uint8_t low_threshold, uint8_t low_hysteresis, uint16_t min_time_spent);
|
||||
UINT8 btsnd_hcic_ble_set_path_loss_rpt_enable(uint16_t conn_handle, uint8_t enable);
|
||||
UINT8 btsnd_hcic_ble_set_trans_pwr_rpt_enable(uint16_t conn_handle, uint8_t local_enable, uint8_t remote_enable);
|
||||
#endif // #if (BLE_FEAT_POWER_CONTROL_EN == TRUE)
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user