mirror of
https://github.com/espressif/esp-idf.git
synced 2026-10-02 03:00:34 +03:00
fix(ble/bluedroid): Fixed bt buuld error
fix(ble/bluedroid): disable power management if bt is disabled
(cherry picked from commit 6f27074c1e)
Co-authored-by: zhiweijian <zhiweijian@espressif.com>
This commit is contained in:
@@ -75,7 +75,9 @@ void btm_acl_init (void)
|
||||
btm_cb.p_bl_changed_cb = NULL;
|
||||
#endif
|
||||
btm_cb.p_acl_db_list = list_new(osi_free_func);
|
||||
#if (CLASSIC_BT_INCLUDED == TRUE)
|
||||
btm_cb.p_pm_mode_db_list = list_new(osi_free_func);
|
||||
#endif// #if (CLASSIC_BT_INCLUDED == TRUE)
|
||||
|
||||
/* Initialize nonzero defaults */
|
||||
btm_cb.btm_def_link_super_tout = HCI_DEFAULT_INACT_TOUT;
|
||||
@@ -296,12 +298,14 @@ void btm_acl_created (BD_ADDR bda, DEV_CLASS dc, UINT8 bdn[BTM_MAX_REM_BD_NAME_L
|
||||
#endif
|
||||
#if (CLASSIC_BT_INCLUDED == TRUE)
|
||||
p->switch_role_state = BTM_ACL_SWKEY_STATE_IDLE;
|
||||
#endif // (CLASSIC_BT_INCLUDED == TRUE)
|
||||
|
||||
|
||||
p->p_pm_mode_db = btm_pm_sm_alloc();
|
||||
|
||||
#if BTM_PM_DEBUG == TRUE
|
||||
BTM_TRACE_DEBUG( "btm_pm_sm_alloc handle:%d st:%d", hci_handle, p->p_pm_mode_db->state);
|
||||
#endif // BTM_PM_DEBUG
|
||||
#endif // (CLASSIC_BT_INCLUDED == TRUE)
|
||||
|
||||
#if (CLASSIC_BT_INCLUDED == TRUE)
|
||||
btm_sec_update_legacy_auth_state(p, BTM_ACL_LEGACY_AUTH_NONE);
|
||||
@@ -491,8 +495,9 @@ void btm_acl_removed (BD_ADDR bda, tBT_TRANSPORT transport)
|
||||
|
||||
}
|
||||
#endif
|
||||
|
||||
#if (CLASSIC_BT_INCLUDED == TRUE)
|
||||
list_remove(btm_cb.p_pm_mode_db_list, p->p_pm_mode_db);
|
||||
#endif // #if (CLASSIC_BT_INCLUDED == TRUE)
|
||||
/* Clear the ACL connection data */
|
||||
memset(p, 0, sizeof(tACL_CONN));
|
||||
if (list_remove(btm_cb.p_acl_db_list, p)) {
|
||||
@@ -2233,6 +2238,7 @@ void BTM_BleGetPeriodicAdvListSize(uint8_t *size)
|
||||
|
||||
#endif ///BLE_INCLUDED == TRUE
|
||||
|
||||
#if BLE_INCLUDED == TRUE
|
||||
/*******************************************************************************
|
||||
**
|
||||
** Function btm_read_channel_map_complete
|
||||
@@ -2287,7 +2293,7 @@ void btm_read_channel_map_complete(UINT8 *p)
|
||||
(*p_cb)(&results);
|
||||
}
|
||||
}
|
||||
|
||||
#endif // #if BLE_INCLUDED == TRUE
|
||||
|
||||
/*******************************************************************************
|
||||
**
|
||||
@@ -2702,7 +2708,9 @@ void btm_acl_chk_peer_pkt_type_support (tACL_CONN *p, UINT16 *p_pkt_type)
|
||||
void btm_acl_free(void)
|
||||
{
|
||||
list_free(btm_cb.p_acl_db_list);
|
||||
#if (CLASSIC_BT_INCLUDED == TRUE)
|
||||
list_free(btm_cb.p_pm_mode_db_list);
|
||||
#endif // #if (CLASSIC_BT_INCLUDED == TRUE)
|
||||
}
|
||||
|
||||
/*******************************************************************************
|
||||
|
||||
@@ -139,7 +139,7 @@ void btm_update_scanner_filter_policy(tBTM_BLE_SFP scan_policy)
|
||||
p_inq->sfp = scan_policy;
|
||||
p_inq->scan_type = p_inq->scan_type == BTM_BLE_SCAN_MODE_NONE ? BTM_BLE_SCAN_MODE_ACTI : p_inq->scan_type;
|
||||
|
||||
|
||||
|
||||
btsnd_hcic_ble_set_scan_params(p_inq->scan_type, (UINT16)scan_interval,
|
||||
(UINT16)scan_window,
|
||||
btm_cb.ble_ctr_cb.addr_mgnt_cb.own_addr_type,
|
||||
|
||||
@@ -495,7 +495,7 @@ tBTM_STATUS BTM_BleBroadcast(BOOLEAN start, tBTM_START_STOP_ADV_CMPL_CBACK *p_s
|
||||
#endif
|
||||
|
||||
if (start) {
|
||||
// "start" should not be ture
|
||||
// "start" should not be true
|
||||
#if (0)
|
||||
/* update adv params */
|
||||
if (!btsnd_hcic_ble_write_adv_params ((UINT16)(p_cb->adv_interval_min ? p_cb->adv_interval_min :
|
||||
@@ -902,6 +902,7 @@ void BTM_BleConfigConnParams(uint16_t int_min, uint16_t int_max, uint16_t latenc
|
||||
}
|
||||
|
||||
#if BLE_PRIVACY_SPT == TRUE
|
||||
#if (BLE_42_SCAN_EN == TRUE)
|
||||
/*******************************************************************************
|
||||
**
|
||||
** Function btm_ble_resolve_random_addr_on_adv
|
||||
@@ -942,6 +943,7 @@ static void btm_ble_resolve_random_addr_on_adv(void *p_rec, void *p)
|
||||
|
||||
return;
|
||||
}
|
||||
#endif // #if (BLE_42_SCAN_EN == TRUE)
|
||||
#endif
|
||||
|
||||
/*******************************************************************************
|
||||
@@ -1301,10 +1303,10 @@ tBTM_STATUS BTM_BleSetScanFilterParams(tGATT_IF client_if, UINT32 scan_interval,
|
||||
if (BTM_BleUpdateOwnType(&addr_type_own, NULL) != 0) {
|
||||
return BTM_ILLEGAL_VALUE;
|
||||
}
|
||||
|
||||
|
||||
max_scan_interval = BTM_BLE_SCAN_INT_MAX;
|
||||
max_scan_window = BTM_BLE_SCAN_WIN_MAX;
|
||||
|
||||
|
||||
|
||||
osi_mutex_lock(&scan_param_lock, OSI_MUTEX_MAX_TIMEOUT);
|
||||
|
||||
|
||||
@@ -183,8 +183,9 @@ static void reset_complete(void)
|
||||
#endif // #if (GATT_BG_CONN_DEV == TRUE)
|
||||
|
||||
#endif
|
||||
|
||||
#if (CLASSIC_BT_INCLUDED == TRUE)
|
||||
btm_pm_reset();
|
||||
#endif // #if (CLASSIC_BT_INCLUDED == TRUE)
|
||||
|
||||
l2c_link_processs_num_bufs(controller->get_acl_buffer_count_classic());
|
||||
#if BTM_SCO_HCI_INCLUDED == TRUE
|
||||
|
||||
@@ -2183,6 +2183,8 @@ void btm_inq_rmt_name_failed (void)
|
||||
btm_sec_rmt_name_request_complete (NULL, NULL, HCI_ERR_UNSPECIFIED);
|
||||
#endif ///SMP_INCLUDED == TRUE
|
||||
}
|
||||
|
||||
#if (CLASSIC_BT_INCLUDED == TRUE)
|
||||
/*******************************************************************************
|
||||
**
|
||||
** Function btm_read_linq_tx_power_complete
|
||||
@@ -2218,6 +2220,7 @@ void btm_read_linq_tx_power_complete(UINT8 *p)
|
||||
}
|
||||
|
||||
}
|
||||
#endif // #if (CLASSIC_BT_INCLUDED == TRUE)
|
||||
/*******************************************************************************
|
||||
**
|
||||
** Function BTM_WriteEIR
|
||||
|
||||
@@ -45,6 +45,8 @@
|
||||
//#include "bt_utils.h"
|
||||
//#include "osi/include/log.h"
|
||||
#include "osi/allocator.h"
|
||||
|
||||
#if (CLASSIC_BT_INCLUDED == TRUE)
|
||||
/*****************************************************************************/
|
||||
/* to handle different modes */
|
||||
/*****************************************************************************/
|
||||
@@ -968,3 +970,5 @@ static const char *mode_to_string(tBTM_PM_MODE mode)
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif // #if (CLASSIC_BT_INCLUDED == TRUE)
|
||||
|
||||
@@ -211,7 +211,7 @@ static BOOLEAN btm_serv_trusted(tBTM_SEC_DEV_REC *p_dev_rec, tBTM_SEC_SERV_REC *
|
||||
}
|
||||
return (FALSE);
|
||||
}
|
||||
#endif ///SMP_INCLUDED == TRUE
|
||||
|
||||
/*******************************************************************************
|
||||
**
|
||||
** Function BTM_SecRegister
|
||||
@@ -274,6 +274,7 @@ BOOLEAN BTM_SecRegisterLinkKeyNotificationCallback (tBTM_LINK_KEY_CALLBACK *p_ca
|
||||
btm_cb.api.p_link_key_callback = p_callback;
|
||||
return TRUE;
|
||||
}
|
||||
#endif ///SMP_INCLUDED == TRUE
|
||||
|
||||
/*******************************************************************************
|
||||
**
|
||||
@@ -410,6 +411,7 @@ void BTM_SetPinType (UINT8 pin_type, PIN_CODE pin_code, UINT8 pin_code_len)
|
||||
}
|
||||
#endif ///CLASSIC_BT_INCLUDED == TRUE
|
||||
|
||||
#if (CLASSIC_BT_INCLUDED == TRUE)
|
||||
/*******************************************************************************
|
||||
**
|
||||
** Function BTM_SetPairableMode
|
||||
@@ -455,6 +457,8 @@ void BTM_SetSecureConnectionsOnly (BOOLEAN secure_connections_only_mode)
|
||||
btm_cb.devcb.secure_connections_only = secure_connections_only_mode;
|
||||
btm_cb.security_mode = BTM_SEC_MODE_SC;
|
||||
}
|
||||
#endif // #if (CLASSIC_BT_INCLUDED == TRUE)
|
||||
|
||||
#define BTM_NO_AVAIL_SEC_SERVICES ((UINT16) 0xffff)
|
||||
|
||||
/*******************************************************************************
|
||||
@@ -2779,10 +2783,12 @@ void btm_create_conn_cancel_complete (UINT8 *p, UINT16 evt_len)
|
||||
case HCI_ERR_CONNECTION_EXISTS:
|
||||
case HCI_ERR_NO_CONNECTION:
|
||||
default:
|
||||
#if (SMP_INCLUDED == TRUE)
|
||||
/* Notify application of the error */
|
||||
if (btm_cb.api.p_bond_cancel_cmpl_callback) {
|
||||
btm_cb.api.p_bond_cancel_cmpl_callback(BTM_ERR_PROCESSING);
|
||||
}
|
||||
#endif // #if (SMP_INCLUDED == TRUE)
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -4549,10 +4555,11 @@ void btm_sec_connected (UINT8 *bda, UINT16 handle, UINT8 status, UINT8 enc_mode)
|
||||
/* commands events and data at the same time. */
|
||||
/* Set the packet types to the default allowed by the device */
|
||||
btm_set_packet_types (p_acl_cb, btm_cb.btm_acl_pkt_types_supported);
|
||||
|
||||
#if (CLASSIC_BT_INCLUDED == TRUE)
|
||||
if (btm_cb.btm_def_link_policy) {
|
||||
BTM_SetLinkPolicy (p_acl_cb->remote_addr, &btm_cb.btm_def_link_policy);
|
||||
}
|
||||
#endif // #if (CLASSIC_BT_INCLUDED == TRUE)
|
||||
#endif
|
||||
}
|
||||
btm_acl_created (bda, p_dev_rec->dev_class, p_dev_rec->sec_bd_name, handle, HCI_ROLE_SLAVE, BT_TRANSPORT_BR_EDR);
|
||||
@@ -4639,10 +4646,10 @@ BOOLEAN btm_sec_disconnected (UINT16 handle, UINT8 reason)
|
||||
tBTM_SEC_CALLBACK *p_callback = NULL;
|
||||
tBT_TRANSPORT transport = BT_TRANSPORT_BR_EDR;
|
||||
|
||||
#if (CLASSIC_BT_INCLUDED == TRUE)
|
||||
/* If page was delayed for disc complete, can do it now */
|
||||
btm_cb.discing = FALSE;
|
||||
|
||||
#if (CLASSIC_BT_INCLUDED == TRUE)
|
||||
btm_acl_resubmit_page();
|
||||
#endif
|
||||
|
||||
|
||||
@@ -199,17 +199,20 @@ tBTM_CMPL_CB *p_rln_cmpl_cb; /* Callback function to be called when
|
||||
TIMER_LIST_ENT rssi_timer;
|
||||
tBTM_CMPL_CB *p_rssi_cmpl_cb; /* Callback function to be called when */
|
||||
/* read rssi function completes */
|
||||
|
||||
#if BLE_INCLUDED == TRUE
|
||||
tBTM_CMPL_CB *p_ble_ch_map_cmpl_cb; /* Callback function to be called when */
|
||||
#endif // #if BLE_INCLUDED == TRUE
|
||||
/* read channel map function completes */
|
||||
#if (CLASSIC_BT_INCLUDED == TRUE)
|
||||
TIMER_LIST_ENT lnk_quality_timer;
|
||||
tBTM_CMPL_CB *p_lnk_qual_cmpl_cb;/* Callback function to be called when */
|
||||
#endif // (CLASSIC_BT_INCLUDED == TRUE)
|
||||
|
||||
#if (CLASSIC_BT_INCLUDED == TRUE)
|
||||
/* read link quality function completes */
|
||||
TIMER_LIST_ENT txpwer_timer;
|
||||
tBTM_CMPL_CB *p_txpwer_cmpl_cb; /* Callback function to be called when */
|
||||
#endif // #if (CLASSIC_BT_INCLUDED == TRUE)
|
||||
|
||||
/* read inq tx power function completes */
|
||||
#if (CLASSIC_BT_INCLUDED == TRUE)
|
||||
@@ -274,10 +277,11 @@ UINT32 test_local_sign_cntr;
|
||||
#endif
|
||||
|
||||
#endif /* BLE_INCLUDED */
|
||||
|
||||
tBTM_IO_CAP loc_io_caps; /* IO capability of the local device */
|
||||
#if (SMP_INCLUDED == TRUE)
|
||||
tBTM_AUTH_REQ loc_auth_req; /* the auth_req flag */
|
||||
BOOLEAN secure_connections_only; /* Rejects service level 0 connections if */
|
||||
#endif // #if (SMP_INCLUDED == TRUE)
|
||||
/* itself or peer device doesn't support */
|
||||
/* secure connections */
|
||||
} tBTM_DEVCB;
|
||||
@@ -880,11 +884,12 @@ typedef struct {
|
||||
/****************************************************
|
||||
** Power Management
|
||||
****************************************************/
|
||||
#if (CLASSIC_BT_INCLUDED == TRUE)
|
||||
list_t *p_pm_mode_db_list;
|
||||
tBTM_PM_RCB pm_reg_db[BTM_MAX_PM_RECORDS + 1]; /* per application/module */
|
||||
UINT16 pm_pend_link_hdl; /* the index of acl_db, which has a pending PM cmd */
|
||||
UINT8 pm_pend_id; /* the id pf the module, which has a pending PM cmd */
|
||||
|
||||
#endif // #if (CLASSIC_BT_INCLUDED == TRUE)
|
||||
/*****************************************************
|
||||
** Device control
|
||||
*****************************************************/
|
||||
@@ -924,7 +929,7 @@ typedef struct {
|
||||
#if BTM_SCO_INCLUDED == TRUE
|
||||
tSCO_CB sco_cb;
|
||||
#endif
|
||||
|
||||
#if (SMP_INCLUDED == TRUE)
|
||||
/*****************************************************
|
||||
** Security Management
|
||||
*****************************************************/
|
||||
@@ -933,18 +938,22 @@ typedef struct {
|
||||
#define BTM_SEC_MAX_RMT_NAME_CALLBACKS 2
|
||||
|
||||
tBTM_RMT_NAME_CALLBACK *p_rmt_name_callback[BTM_SEC_MAX_RMT_NAME_CALLBACKS];
|
||||
#endif // #if (SMP_INCLUDED == TRUE)
|
||||
#if (SMP_INCLUDED == TRUE)
|
||||
tBTM_SEC_DEV_REC *p_collided_dev_rec;
|
||||
#endif ///SMP_INCLUDED == TRUE
|
||||
UINT8 security_mode;
|
||||
UINT32 dev_rec_count; /* Counter used for device record timestamp */
|
||||
#if (SMP_INCLUDED == TRUE)
|
||||
TIMER_LIST_ENT sec_collision_tle;
|
||||
UINT32 collision_start_time;
|
||||
UINT32 max_collision_delay;
|
||||
UINT32 dev_rec_count; /* Counter used for device record timestamp */
|
||||
UINT8 security_mode;
|
||||
BOOLEAN pairing_disabled;
|
||||
BOOLEAN connect_only_paired;
|
||||
BOOLEAN security_mode_changed; /* mode changed during bonding */
|
||||
BOOLEAN sec_req_pending; /* TRUE if a request is pending */
|
||||
#endif // #if (SMP_INCLUDED == TRUE)
|
||||
|
||||
#if (CLASSIC_BT_INCLUDED == TRUE)
|
||||
BOOLEAN pin_type_changed; /* pin type changed during bonding */
|
||||
#endif ///CLASSIC_BT_INCLUDED == TRUE
|
||||
@@ -961,10 +970,12 @@ typedef struct {
|
||||
UINT8 disc_reason; /* for legacy devices */
|
||||
UINT16 disc_handle; /* for legacy devices */
|
||||
#endif ///CLASSIC_BT_INCLUDED == TRUE
|
||||
#if (SMP_INCLUDED == TRUE)
|
||||
tBTM_PAIRING_STATE pairing_state; /* The current pairing state */
|
||||
UINT8 pairing_flags; /* The current pairing flags */
|
||||
BD_ADDR pairing_bda; /* The device currently pairing */
|
||||
TIMER_LIST_ENT pairing_tle; /* Timer for pairing process */
|
||||
#endif // #if (SMP_INCLUDED == TRUE)
|
||||
|
||||
#endif ///SMP_INCLUDED == TRUE
|
||||
#if SMP_INCLUDED == TRUE || CLASSIC_BT_INCLUDED == TRUE
|
||||
|
||||
@@ -1226,7 +1226,9 @@ static void btu_hcif_hdl_command_complete (UINT16 opcode, UINT8 *p, UINT16 evt_l
|
||||
btm_read_rssi_complete (p, evt_len);
|
||||
break;
|
||||
case HCI_BLE_READ_CHNL_MAP:
|
||||
#if BLE_INCLUDED == TRUE
|
||||
btm_read_channel_map_complete (p);
|
||||
#endif // #if BLE_INCLUDED == TRUE
|
||||
break;
|
||||
case HCI_READ_TRANSMIT_POWER_LEVEL:
|
||||
break;
|
||||
|
||||
@@ -573,8 +573,8 @@ typedef struct {
|
||||
#endif // (GATTC_INCLUDED == TRUE)
|
||||
#if (GATTS_INCLUDED == TRUE)
|
||||
UINT8 srv_chg_mode; /* internal use: service change mode */
|
||||
#endif // (GATTS_INCLUDED == TRUE)
|
||||
tGATTS_RSP rsp; /* use to read internal service attribute */
|
||||
#endif // (GATTS_INCLUDED == TRUE)
|
||||
} tGATT_CB;
|
||||
|
||||
typedef struct{
|
||||
|
||||
@@ -488,7 +488,9 @@ typedef struct {
|
||||
|
||||
list_t *p_lcb_pool; /* Link Control Block pool */
|
||||
list_t *p_ccb_pool; /* Channel Control Block pool */
|
||||
#if (CLASSIC_BT_INCLUDED == TRUE)
|
||||
tL2C_RCB rcb_pool[MAX_L2CAP_CLIENTS]; /* Registration info pool */
|
||||
#endif // #if (CLASSIC_BT_INCLUDED == TRUE)
|
||||
|
||||
#if (CLASSIC_BT_INCLUDED == TRUE)
|
||||
UINT8 desire_role; /* desire to be master/slave when accepting a connection */
|
||||
@@ -500,8 +502,10 @@ typedef struct {
|
||||
list_t *rcv_pending_q; /* Recv pending queue */
|
||||
TIMER_LIST_ENT rcv_hold_tle; /* Timer list entry for rcv hold */
|
||||
|
||||
tL2C_LCB *p_cur_hcit_lcb; /* Current HCI Transport buffer */
|
||||
// tL2C_LCB *p_cur_hcit_lcb; /* Current HCI Transport buffer */
|
||||
#if (CLASSIC_BT_INCLUDED == TRUE)
|
||||
UINT16 num_links_active; /* Number of links active */
|
||||
#endif // #if (CLASSIC_BT_INCLUDED == TRUE)
|
||||
|
||||
#if (L2CAP_NON_FLUSHABLE_PB_INCLUDED == TRUE)
|
||||
UINT16 non_flushable_pbf; /* L2CAP_PKT_START_NON_FLUSHABLE if controller supports */
|
||||
@@ -530,13 +534,16 @@ typedef struct {
|
||||
tL2C_RCB ble_rcb_pool[BLE_MAX_L2CAP_CLIENTS]; /* Registration info pool */
|
||||
#endif
|
||||
|
||||
#if (CLASSIC_BT_INCLUDED == TRUE)
|
||||
tL2CA_ECHO_DATA_CB *p_echo_data_cb; /* Echo data callback */
|
||||
#endif // #if (CLASSIC_BT_INCLUDED == TRUE)
|
||||
|
||||
#if (defined(L2CAP_HIGH_PRI_CHAN_QUOTA_IS_CONFIGURABLE) && (L2CAP_HIGH_PRI_CHAN_QUOTA_IS_CONFIGURABLE == TRUE))
|
||||
UINT16 high_pri_min_xmit_quota; /* Minimum number of ACL credit for high priority link */
|
||||
#endif /* (L2CAP_HIGH_PRI_CHAN_QUOTA_IS_CONFIGURABLE == TRUE) */
|
||||
|
||||
#if (CLASSIC_BT_INCLUDED == TRUE)
|
||||
UINT16 dyn_psm;
|
||||
#endif // #if (CLASSIC_BT_INCLUDED == TRUE)
|
||||
} tL2C_CB;
|
||||
|
||||
|
||||
|
||||
@@ -1118,6 +1118,7 @@ void l2c_link_processs_ble_num_bufs (UINT16 num_lm_ble_bufs)
|
||||
l2cb.num_lm_ble_bufs = l2cb.controller_le_xmit_window = num_lm_ble_bufs;
|
||||
}
|
||||
|
||||
#if (BLE_INCLUDED == TRUE)
|
||||
/*******************************************************************************
|
||||
**
|
||||
** Function l2c_ble_link_adjust_allocation
|
||||
@@ -1237,6 +1238,7 @@ void l2c_ble_link_adjust_allocation (void)
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif // #if (BLE_INCLUDED == TRUE)
|
||||
|
||||
#if (defined BLE_LLT_INCLUDED) && (BLE_LLT_INCLUDED == TRUE)
|
||||
/*******************************************************************************
|
||||
|
||||
@@ -736,7 +736,7 @@ void l2c_info_timeout (tL2C_LCB *p_lcb)
|
||||
#endif ///CLASSIC_BT_INCLUDED == TRUE
|
||||
}
|
||||
}
|
||||
|
||||
#if (CLASSIC_BT_INCLUDED == TRUE)
|
||||
/*******************************************************************************
|
||||
**
|
||||
** Function l2c_link_adjust_allocation
|
||||
@@ -857,7 +857,7 @@ void l2c_link_adjust_allocation (void)
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
#endif // #if (CLASSIC_BT_INCLUDED == TRUE)
|
||||
/*******************************************************************************
|
||||
**
|
||||
** Function l2c_link_adjust_chnl_allocation
|
||||
@@ -1013,7 +1013,9 @@ void l2c_pin_code_request (BD_ADDR bd_addr)
|
||||
*******************************************************************************/
|
||||
BOOLEAN l2c_link_check_power_mode (tL2C_LCB *p_lcb)
|
||||
{
|
||||
#if (CLASSIC_BT_INCLUDED == TRUE)
|
||||
tBTM_PM_MODE mode;
|
||||
#endif // #if (CLASSIC_BT_INCLUDED == TRUE)
|
||||
tL2C_CCB *p_ccb;
|
||||
BOOLEAN need_to_active = FALSE;
|
||||
|
||||
@@ -1033,6 +1035,7 @@ BOOLEAN l2c_link_check_power_mode (tL2C_LCB *p_lcb)
|
||||
|
||||
/* if we have packets to send */
|
||||
if ( need_to_active ) {
|
||||
#if (CLASSIC_BT_INCLUDED == TRUE)
|
||||
/* check power mode */
|
||||
if (BTM_ReadPowerMode(p_lcb->remote_bd_addr, &mode) == BTM_SUCCESS) {
|
||||
if ( mode == BTM_PM_STS_PENDING ) {
|
||||
@@ -1041,6 +1044,7 @@ BOOLEAN l2c_link_check_power_mode (tL2C_LCB *p_lcb)
|
||||
return TRUE;
|
||||
}
|
||||
}
|
||||
#endif // #if (CLASSIC_BT_INCLUDED == TRUE)
|
||||
}
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
@@ -859,8 +859,10 @@ void l2c_init (void)
|
||||
l2c_cb_ptr = (tL2C_CB *)osi_malloc(sizeof(tL2C_CB));
|
||||
#endif /* #if L2C_DYNAMIC_MEMORY */
|
||||
memset (&l2cb, 0, sizeof (tL2C_CB));
|
||||
#if (CLASSIC_BT_INCLUDED == TRUE)
|
||||
/* the psm is increased by 2 before being used */
|
||||
l2cb.dyn_psm = 0xFFF;
|
||||
#endif // #if (CLASSIC_BT_INCLUDED == TRUE)
|
||||
|
||||
l2cb.p_ccb_pool = list_new(osi_free_func);
|
||||
if (l2cb.p_ccb_pool == NULL) {
|
||||
|
||||
@@ -113,8 +113,10 @@ tL2C_LCB *l2cu_allocate_lcb (BD_ADDR p_bd_addr, BOOLEAN is_bonding, tBT_TRANSPOR
|
||||
} else
|
||||
#endif
|
||||
{
|
||||
#if (CLASSIC_BT_INCLUDED == TRUE)
|
||||
l2cb.num_links_active++;
|
||||
l2c_link_adjust_allocation();
|
||||
#endif // #if (CLASSIC_BT_INCLUDED == TRUE)
|
||||
}
|
||||
p_lcb->link_xmit_data_q = list_new(NULL);
|
||||
return (p_lcb);
|
||||
@@ -261,11 +263,13 @@ void l2cu_release_lcb (tL2C_LCB *p_lcb)
|
||||
} else
|
||||
#endif
|
||||
{
|
||||
#if (CLASSIC_BT_INCLUDED == TRUE)
|
||||
if (l2cb.num_links_active >= 1) {
|
||||
l2cb.num_links_active--;
|
||||
}
|
||||
|
||||
l2c_link_adjust_allocation();
|
||||
#endif // #if (CLASSIC_BT_INCLUDED == TRUE)
|
||||
}
|
||||
|
||||
/* Check for ping outstanding */
|
||||
@@ -1799,6 +1803,7 @@ tL2C_CCB *l2cu_find_ccb_by_remote_cid (tL2C_LCB *p_lcb, UINT16 remote_cid)
|
||||
return (NULL);
|
||||
}
|
||||
|
||||
#if (CLASSIC_BT_INCLUDED == TRUE)
|
||||
/*******************************************************************************
|
||||
**
|
||||
** Function l2cu_allocate_rcb
|
||||
@@ -1828,6 +1833,7 @@ tL2C_RCB *l2cu_allocate_rcb (UINT16 psm)
|
||||
/* If here, no free RCB found */
|
||||
return (NULL);
|
||||
}
|
||||
#endif // #if (CLASSIC_BT_INCLUDED == TRUE)
|
||||
|
||||
#if (BLE_INCLUDED == TRUE)
|
||||
/*******************************************************************************
|
||||
@@ -1907,7 +1913,7 @@ void l2cu_disconnect_chnl (tL2C_CCB *p_ccb)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
#if (CLASSIC_BT_INCLUDED == TRUE)
|
||||
/*******************************************************************************
|
||||
**
|
||||
** Function l2cu_find_rcb_by_psm
|
||||
@@ -1932,6 +1938,7 @@ tL2C_RCB *l2cu_find_rcb_by_psm (UINT16 psm)
|
||||
/* If here, no match found */
|
||||
return (NULL);
|
||||
}
|
||||
#endif // #if (CLASSIC_BT_INCLUDED == TRUE)
|
||||
|
||||
#if (BLE_INCLUDED == TRUE)
|
||||
/*******************************************************************************
|
||||
|
||||
Reference in New Issue
Block a user