From 1016ab1c2a2634d90bd542af8d75b8d8732fd755 Mon Sep 17 00:00:00 2001 From: Yulong Date: Sun, 23 Apr 2017 00:48:23 -0400 Subject: [PATCH] component/bt:separate the smp_br_connect_callback from the BLE only mode --- components/bt/bluedroid/bta/include/bta_gattc_int.h | 2 +- components/bt/bluedroid/include/bt_target.h | 7 ++++--- components/bt/bluedroid/stack/l2cap/l2c_utils.c | 2 +- components/bt/bluedroid/stack/smp/smp_l2c.c | 9 +++++++-- 4 files changed, 13 insertions(+), 7 deletions(-) diff --git a/components/bt/bluedroid/bta/include/bta_gattc_int.h b/components/bt/bluedroid/bta/include/bta_gattc_int.h index 9526860876..d04097b71e 100644 --- a/components/bt/bluedroid/bta/include/bta_gattc_int.h +++ b/components/bt/bluedroid/bta/include/bta_gattc_int.h @@ -320,7 +320,7 @@ typedef struct { } tBTA_GATTC_SERV; #ifndef BTA_GATTC_NOTIF_REG_MAX -#define BTA_GATTC_NOTIF_REG_MAX 15 +#define BTA_GATTC_NOTIF_REG_MAX 7//15 #endif typedef struct { diff --git a/components/bt/bluedroid/include/bt_target.h b/components/bt/bluedroid/include/bt_target.h index e1a898aabc..ce59d6c833 100644 --- a/components/bt/bluedroid/include/bt_target.h +++ b/components/bt/bluedroid/include/bt_target.h @@ -112,7 +112,8 @@ #endif /* CONFIG_GATTC_ENABLE */ #if (CONFIG_BT_ACL_CONNECTIONS) -#define MAX_ACL_CONNECTIONS CONFIG_BT_ACL_CONNECTIONS +#define MAX_ACL_CONNECTIONS CONFIG_BT_ACL_CONNECTIONS +#define GATT_MAX_PHY_CHANNEL CONFIG_BT_ACL_CONNECTIONS #endif /* CONFIG_BT_ACL_CONNECTIONS */ //------------------Added from bdroid_buildcfg.h--------------------- @@ -724,7 +725,7 @@ #if (CLASSIC_BT_INCLUDED == TRUE) #define MAX_L2CAP_CHANNELS 8 #else -#define MAX_L2CAP_CHANNELS 1 //Not support to create l2cap channels in the BLE only mode in this bluedroid version(6.0) +#define MAX_L2CAP_CHANNELS 2 //Not support to create l2cap channels in the BLE only mode in this bluedroid version(6.0) #endif ///CLASSIC_BT_INCLUDED == TRUE #endif @@ -983,7 +984,7 @@ #endif #ifndef GATT_MAX_PHY_CHANNEL -#define GATT_MAX_PHY_CHANNEL 1 +#define GATT_MAX_PHY_CHANNEL 7 #endif /* Used for conformance testing ONLY */ diff --git a/components/bt/bluedroid/stack/l2cap/l2c_utils.c b/components/bt/bluedroid/stack/l2cap/l2c_utils.c index 46123af177..2021f064c4 100644 --- a/components/bt/bluedroid/stack/l2cap/l2c_utils.c +++ b/components/bt/bluedroid/stack/l2cap/l2c_utils.c @@ -2654,7 +2654,7 @@ void l2cu_no_dynamic_ccbs (tL2C_LCB *p_lcb) *******************************************************************************/ void l2cu_process_fixed_chnl_resp (tL2C_LCB *p_lcb) { - L2CAP_TRACE_ERROR("%s",__func__); + L2CAP_TRACE_DEBUG("%s",__func__); #if (BLE_INCLUDED == TRUE) if (p_lcb->transport == BT_TRANSPORT_BR_EDR) { /* ignore all not assigned BR/EDR channels */ diff --git a/components/bt/bluedroid/stack/smp/smp_l2c.c b/components/bt/bluedroid/stack/smp/smp_l2c.c index de0c1d0f0e..007c9ccb7b 100644 --- a/components/bt/bluedroid/stack/smp/smp_l2c.c +++ b/components/bt/bluedroid/stack/smp/smp_l2c.c @@ -38,10 +38,11 @@ static void smp_tx_complete_callback(UINT16 cid, UINT16 num_pkt); static void smp_connect_callback(UINT16 channel, BD_ADDR bd_addr, BOOLEAN connected, UINT16 reason, tBT_TRANSPORT transport); static void smp_data_received(UINT16 channel, BD_ADDR bd_addr, BT_HDR *p_buf); - +#if (CLASSIC_BT_INCLUDED == TRUE) static void smp_br_connect_callback(UINT16 channel, BD_ADDR bd_addr, BOOLEAN connected, UINT16 reason, tBT_TRANSPORT transport); static void smp_br_data_received(UINT16 channel, BD_ADDR bd_addr, BT_HDR *p_buf); +#endif ///CLASSIC_BT_INCLUDED == TRUE /******************************************************************************* ** @@ -70,11 +71,12 @@ void smp_l2cap_if_init (void) fixed_reg.default_idle_tout = 60; /* set 60 seconds timeout, 0xffff default idle timeout */ L2CA_RegisterFixedChannel (L2CAP_SMP_CID, &fixed_reg); - +#if (CLASSIC_BT_INCLUDED == TRUE) fixed_reg.pL2CA_FixedConn_Cb = smp_br_connect_callback; fixed_reg.pL2CA_FixedData_Cb = smp_br_data_received; L2CA_RegisterFixedChannel (L2CAP_SMP_BR_CID, &fixed_reg); +#endif ///CLASSIC_BT_INCLUDED == TRUE } /******************************************************************************* @@ -227,6 +229,7 @@ static void smp_tx_complete_callback (UINT16 cid, UINT16 num_pkt) ** connected (conn = TRUE)/disconnected (conn = FALSE). ** *******************************************************************************/ +#if (CLASSIC_BT_INCLUDED == TRUE) static void smp_br_connect_callback(UINT16 channel, BD_ADDR bd_addr, BOOLEAN connected, UINT16 reason, tBT_TRANSPORT transport) { @@ -319,4 +322,6 @@ static void smp_br_data_received(UINT16 channel, BD_ADDR bd_addr, BT_HDR *p_buf) GKI_freebuf (p_buf); } +#endif /* CLASSIC_BT_INCLUDED == TRUE */ + #endif /* SMP_INCLUDED == TRUE */ -- 2.40.0