diff --git a/components/bt/host/bluedroid/common/include/common/bt_target.h b/components/bt/host/bluedroid/common/include/common/bt_target.h index 0da2d011d86..6090cefdf6d 100644 --- a/components/bt/host/bluedroid/common/include/common/bt_target.h +++ b/components/bt/host/bluedroid/common/include/common/bt_target.h @@ -1015,6 +1015,19 @@ #define BLE_MAX_L2CAP_CLIENTS 15 #endif +/* Support status of L2CAP connection-oriented dynamic channels over LE transport with dynamic CID */ +#ifndef BLE_L2CAP_COC_INCLUDED +#define BLE_L2CAP_COC_INCLUDED FALSE // LE COC not use by default +#endif + +/* Support status of L2CAP connection-oriented dynamic channels over LE or BR/EDR transport with dynamic CID */ +#ifndef L2CAP_COC_INCLUDED +#if (CLASSIC_BT_INCLUDED == TRUE || BLE_L2CAP_COC_INCLUDED == TRUE) +#define L2CAP_COC_INCLUDED TRUE +#else +#define L2CAP_COC_INCLUDED FALSE +#endif +#endif /* The maximum number of simultaneous links that L2CAP can support. Up to 7*/ #ifndef MAX_ACL_CONNECTIONS diff --git a/components/bt/host/bluedroid/stack/include/stack/l2c_api.h b/components/bt/host/bluedroid/stack/include/stack/l2c_api.h index 76ec2b11c38..807b523445e 100644 --- a/components/bt/host/bluedroid/stack/include/stack/l2c_api.h +++ b/components/bt/host/bluedroid/stack/include/stack/l2c_api.h @@ -501,6 +501,7 @@ extern BOOLEAN L2CA_DisconnectReq (UINT16 cid); extern BOOLEAN L2CA_DisconnectRsp (UINT16 cid); #endif ///CLASSIC_BT_INCLUDED == TRUE +#if (BLE_L2CAP_COC_INCLUDED == TRUE) /******************************************************************************* ** ** Function L2CA_RegisterLECoc @@ -568,6 +569,8 @@ extern BOOLEAN L2CA_ConnectLECocRsp (BD_ADDR p_bd_addr, UINT8 id, UINT16 lcid, U *******************************************************************************/ extern BOOLEAN L2CA_GetPeerLECocConfig (UINT16 lcid, tL2CAP_LE_CFG_INFO* peer_cfg); +#endif // (BLE_L2CAP_COC_INCLUDED == TRUE) + /******************************************************************************* ** ** Function L2CA_DataWrite diff --git a/components/bt/host/bluedroid/stack/l2cap/include/l2c_int.h b/components/bt/host/bluedroid/stack/l2cap/include/l2c_int.h index 49014e582a6..045fb10daa7 100644 --- a/components/bt/host/bluedroid/stack/l2cap/include/l2c_int.h +++ b/components/bt/host/bluedroid/stack/l2cap/include/l2c_int.h @@ -694,11 +694,12 @@ extern void l2cu_release_rcb (tL2C_RCB *p_rcb); extern tL2C_RCB *l2cu_allocate_ble_rcb (UINT16 psm); extern tL2C_RCB *l2cu_find_ble_rcb_by_psm (UINT16 psm); - +#if (L2CAP_COC_INCLUDED == TRUE) extern UINT8 l2cu_process_peer_cfg_req (tL2C_CCB *p_ccb, tL2CAP_CFG_INFO *p_cfg); extern void l2cu_process_peer_cfg_rsp (tL2C_CCB *p_ccb, tL2CAP_CFG_INFO *p_cfg); extern void l2cu_process_our_cfg_req (tL2C_CCB *p_ccb, tL2CAP_CFG_INFO *p_cfg); extern void l2cu_process_our_cfg_rsp (tL2C_CCB *p_ccb, tL2CAP_CFG_INFO *p_cfg); +#endif // (L2CAP_COC_INCLUDED == TRUE) extern void l2cu_device_reset (void); extern tL2C_LCB *l2cu_find_lcb_by_state (tL2C_LINK_STATE state); @@ -751,11 +752,11 @@ extern void l2cu_set_info_rsp_mask (UINT32 mask); /* Functions provided by l2c_csm.c ************************************ */ +#if (L2CAP_COC_INCLUDED == TRUE) extern void l2c_csm_execute (tL2C_CCB *p_ccb, UINT16 event, void *p_data); - +#endif extern void l2c_enqueue_peer_data (tL2C_CCB *p_ccb, BT_HDR *p_buf); - /* Functions provided by l2c_fcr.c ************************************ */ diff --git a/components/bt/host/bluedroid/stack/l2cap/l2c_api.c b/components/bt/host/bluedroid/stack/l2cap/l2c_api.c index 2db8fd539da..52d8b45fda0 100644 --- a/components/bt/host/bluedroid/stack/l2cap/l2c_api.c +++ b/components/bt/host/bluedroid/stack/l2cap/l2c_api.c @@ -1297,7 +1297,7 @@ UINT8 L2CA_GetChnlFcrMode (UINT16 lcid) #endif ///CLASSIC_BT_INCLUDED == TRUE -#if (BLE_INCLUDED == TRUE) +#if (BLE_L2CAP_COC_INCLUDED == TRUE) /******************************************************************************* ** ** Function L2CA_RegisterLECoc @@ -1608,7 +1608,7 @@ BOOLEAN L2CA_GetPeerLECocConfig (UINT16 lcid, tL2CAP_LE_CFG_INFO* peer_cfg) return TRUE; } -#endif ///BLE_INCLUDED == TRUE +#endif // (BLE_L2CAP_COC_INCLUDED == TRUE) #if (L2CAP_NUM_FIXED_CHNLS > 0) /******************************************************************************* diff --git a/components/bt/host/bluedroid/stack/l2cap/l2c_csm.c b/components/bt/host/bluedroid/stack/l2cap/l2c_csm.c index de26388334e..9abe72e2853 100644 --- a/components/bt/host/bluedroid/stack/l2cap/l2c_csm.c +++ b/components/bt/host/bluedroid/stack/l2cap/l2c_csm.c @@ -36,7 +36,7 @@ #include "stack/hcimsgs.h" #include "osi/allocator.h" -#if (CLASSIC_BT_INCLUDED == TRUE) +#if (L2CAP_COC_INCLUDED == TRUE) /********************************************************************************/ /* L O C A L F U N C T I O N P R O T O T Y P E S */ /********************************************************************************/ @@ -1117,7 +1117,7 @@ static void l2c_csm_w4_l2ca_disconnect_rsp (tL2C_CCB *p_ccb, UINT16 event, void break; } } -#endif ///CLASSIC_BT_INCLUDED == TRUE +#endif /// (L2CAP_COC_INCLUDED == TRUE) #if (BT_TRACE_VERBOSE == TRUE) /******************************************************************************* diff --git a/components/bt/host/bluedroid/stack/l2cap/l2c_fcr.c b/components/bt/host/bluedroid/stack/l2cap/l2c_fcr.c index aafb4b380d8..1da2459d6e6 100644 --- a/components/bt/host/bluedroid/stack/l2cap/l2c_fcr.c +++ b/components/bt/host/bluedroid/stack/l2cap/l2c_fcr.c @@ -37,7 +37,7 @@ #include "stack/btu.h" #include "osi/allocator.h" -#if (CLASSIC_BT_INCLUDED == TRUE) +#if (L2CAP_COC_INCLUDED == TRUE) /* Flag passed to retransmit_i_frames() when all packets should be retransmitted */ #define L2C_FCR_RETX_ALL_PKTS 0xFF @@ -2226,4 +2226,4 @@ static void l2c_fcr_collect_ack_delay (tL2C_CCB *p_ccb, UINT8 num_bufs_acked) } } #endif -#endif ///CLASSIC_BT_INCLUDED == TRUE +#endif /// (L2CAP_COC_INCLUDED == TRUE) diff --git a/components/bt/host/bluedroid/stack/l2cap/l2c_utils.c b/components/bt/host/bluedroid/stack/l2cap/l2c_utils.c index 35815fd1e3c..0904ab86209 100644 --- a/components/bt/host/bluedroid/stack/l2cap/l2c_utils.c +++ b/components/bt/host/bluedroid/stack/l2cap/l2c_utils.c @@ -1927,7 +1927,7 @@ tL2C_RCB *l2cu_find_ble_rcb_by_psm (UINT16 psm) } #endif ///BLE_INCLUDED == TRUE - +#if (L2CAP_COC_INCLUDED == TRUE) /******************************************************************************* ** ** Function l2cu_process_peer_cfg_req @@ -2189,7 +2189,6 @@ void l2cu_process_our_cfg_req (tL2C_CCB *p_ccb, tL2CAP_CFG_INFO *p_cfg) ** Returns void ** *******************************************************************************/ -#if (CLASSIC_BT_INCLUDED == TRUE) void l2cu_process_our_cfg_rsp (tL2C_CCB *p_ccb, tL2CAP_CFG_INFO *p_cfg) { /* If peer wants QoS, we are allowed to change the values in a positive response */ @@ -2201,7 +2200,7 @@ void l2cu_process_our_cfg_rsp (tL2C_CCB *p_ccb, tL2CAP_CFG_INFO *p_cfg) l2c_fcr_adj_our_rsp_options (p_ccb, p_cfg); } -#endif ///CLASSIC_BT_INCLUDED == TRUE +#endif // (L2CAP_COC_INCLUDED == TRUE) /*******************************************************************************