]> granicus.if.org Git - esp-idf/commitdiff
component/bt:Finish all the separate code from BT & BLE
authorYulong <huangyulong@espressif.com>
Thu, 20 Apr 2017 11:18:05 +0000 (07:18 -0400)
committerYulong <huangyulong@espressif.com>
Thu, 20 Apr 2017 11:18:05 +0000 (07:18 -0400)
34 files changed:
components/bt/Kconfig
components/bt/bluedroid/api/esp_gatts_api.c
components/bt/bluedroid/bta/dm/bta_dm_act.c
components/bt/bluedroid/bta/gatt/bta_gatts_act.c
components/bt/bluedroid/bta/gatt/bta_gatts_api.c
components/bt/bluedroid/bta/gatt/bta_gatts_main.c
components/bt/bluedroid/bta/gatt/bta_gatts_utils.c
components/bt/bluedroid/bta/include/bta_gatt_api.h
components/bt/bluedroid/btc/core/btc_task.c
components/bt/bluedroid/btc/profile/esp/blufi/blufi_prf.c
components/bt/bluedroid/btc/profile/esp/blufi/blufi_protocol.c
components/bt/bluedroid/btc/profile/std/gatt/btc_gatts.c
components/bt/bluedroid/btif/bta_gatts_co.c
components/bt/bluedroid/device/include/interop.h
components/bt/bluedroid/device/interop.c
components/bt/bluedroid/hci/hci_hal_h4.c
components/bt/bluedroid/include/bt_target.h
components/bt/bluedroid/include/bt_trace.h
components/bt/bluedroid/stack/btm/btm_ble_gap.c
components/bt/bluedroid/stack/btu/btu_init.c
components/bt/bluedroid/stack/gap/gap_api.c
components/bt/bluedroid/stack/gap/gap_ble.c
components/bt/bluedroid/stack/gap/include/gap_int.h
components/bt/bluedroid/stack/gatt/gatt_api.c
components/bt/bluedroid/stack/gatt/gatt_attr.c
components/bt/bluedroid/stack/gatt/gatt_auth.c
components/bt/bluedroid/stack/gatt/gatt_cl.c
components/bt/bluedroid/stack/gatt/gatt_db.c
components/bt/bluedroid/stack/gatt/gatt_main.c
components/bt/bluedroid/stack/gatt/gatt_sr.c
components/bt/bluedroid/stack/gatt/gatt_utils.c
components/bt/bluedroid/stack/gatt/include/gatt_int.h
components/bt/bluedroid/stack/l2cap/l2c_link.c
components/bt/bluedroid/stack/l2cap/l2c_utils.c

index da1d98055d7c1fe1d40f8e11d1c0aa3f36d1b709..947142666fc8282d1eb7e2525bd75d7ea9ea6e53 100644 (file)
@@ -38,6 +38,34 @@ config BT_DRAM_RELEASE
         Enabling this option will release about 30K DRAM from Classic BT.
         The released DRAM will be used as system heap memory.
 
+config GATTS_ENABLE
+    bool "Set if enable the gatt server module(GATTS) in the stack or not"
+    depends on BLUEDROID_ENABLED
+    default y 
+    help
+        This option can be close when the app work only on gatt client mode
+
+config GATTC_ENABLE
+    bool "Set if enable the gatt server module(GATTC) in the stack or not"
+    depends on BLUEDROID_ENABLED
+    default y
+    help
+        This option can be close when the app work only on gatt server mode
+
+config SMP_ENABLE
+   bool "Set if enable the ble security module (SMP module) or not"
+   depends on BLUEDROID_ENABLED
+   default y
+   help
+       This option can be close when the app not used the ble security connect.
+
+config BT_ACL_CONNECTIONS
+    int "Set the max connection number for the bt/ble device can accept, up to 7."
+    depends on BLUEDROID_ENABLED
+    default 4
+    help 
+        This setting is used for the max connection link for the bt/ble device
+
 config BT_STACK_NO_LOG
     bool "Close the bluedroid bt stack log print"
     depends on BLUEDROID_ENABLED
index 318dd25bf27e3cd85963831181bdac944f15e2f9..47b8f947a7cd6c0b77d98513ec810c69080a3875 100644 (file)
@@ -19,7 +19,8 @@
 #include "btc_manage.h"
 #include "btc_gatts.h"
 #include "btc_gatt_util.h"
-
+#include "bt_target.h"
+#if (GATTS_INCLUDED == TRUE)
 #define COPY_TO_GATTS_ARGS(_gatt_args, _arg, _arg_type) memcpy(_gatt_args, _arg, sizeof(_arg_type))
 
 
@@ -399,3 +400,5 @@ esp_err_t esp_ble_gatts_close(esp_gatt_if_t gatts_if, uint16_t conn_id)
     return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_gatts_args_t), NULL)
             == BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL);
 }
+
+#endif  ///GATTS_INCLUDED
\ No newline at end of file
index f5fea540be1a52df371f0ba9ddcce8d1a0497748..9af44bfc0c81df5fb89139b28572841c962e1236 100644 (file)
@@ -81,7 +81,9 @@ static void bta_dm_search_timer_cback (TIMER_LIST_ENT *p_tle);
 static void bta_dm_disable_conn_down_timer_cback (TIMER_LIST_ENT *p_tle);
 static void bta_dm_rm_cback(tBTA_SYS_CONN_STATUS status, UINT8 id, UINT8 app_id, BD_ADDR peer_addr);
 static void bta_dm_adjust_roles(BOOLEAN delay_role_switch);
+#if (SDP_INCLUDED == TRUE || SMP_INCLUDED == TRUE)
 static char *bta_dm_get_remname(void);
+#endif  ///SDP_INCLUDED == TRUE || SMP_INCLUDED == TRUE
 static void bta_dm_bond_cancel_complete_cback(tBTM_STATUS result);
 
 static BOOLEAN bta_dm_read_remote_device_name (BD_ADDR bd_addr, tBT_TRANSPORT transport);
@@ -2473,7 +2475,7 @@ static void bta_dm_remname_cback (tBTM_REMOTE_DEV_NAME *p_remote_name)
 
     BTM_SecDeleteRmtNameNotifyCallback(&bta_dm_service_search_remname_cback);
 
-#if BLE_INCLUDED == TRUE
+#if BLE_INCLUDED == TRUE && GATTS_INCLUDED == TRUE
     if (bta_dm_search_cb.transport == BT_TRANSPORT_LE ) {
         GAP_BleReadPeerPrefConnParams (bta_dm_search_cb.peer_bdaddr);
     }
@@ -3492,6 +3494,7 @@ static void bta_dm_adjust_roles(BOOLEAN delay_role_switch)
 **
 ** Returns          char * - Pointer to the remote device name
 *******************************************************************************/
+#if (SDP_INCLUDED == TRUE || SMP_INCLUDED == TRUE)
 static char *bta_dm_get_remname(void)
 {
     char *p_name = (char *)bta_dm_search_cb.peer_name;
@@ -3505,6 +3508,7 @@ static char *bta_dm_get_remname(void)
 
     return p_name;
 }
+#endif  ///SDP_INCLUDED == TRUE || SMP_INCLUDED == TRUE
 
 /*******************************************************************************
 **
index 83d5e4d7d71fa64ddab8476fec905f918b64f793..6d75b864a0882ab664908220f1d3c404232d7404 100644 (file)
@@ -26,7 +26,7 @@
 
 #include "bt_target.h"
 
-#if defined(BTA_GATT_INCLUDED) && (BTA_GATT_INCLUDED == TRUE)
+#if defined(GATTS_INCLUDED) && (GATTS_INCLUDED == TRUE)
 
 #include "utl.h"
 #include "gki.h"
@@ -963,4 +963,4 @@ static void bta_gatts_cong_cback (UINT16 conn_id, BOOLEAN congested)
         }
     }
 }
-#endif /* BTA_GATT_INCLUDED */
+#endif /* GATTS_INCLUDED */
index 94f1d407e800c5fc56348c869d57a152296133f1..c56a9fa58ad28ec7d301ab5ed741c5178b96cc4f 100644 (file)
@@ -24,7 +24,7 @@
 
 #include "bt_target.h"
 
-#if defined(BTA_GATT_INCLUDED) && (BTA_GATT_INCLUDED == TRUE)
+#if defined(GATTS_INCLUDED) && (GATTS_INCLUDED == TRUE)
 
 #include <string.h>
 #include "gki.h"
index 4306709c8ca859505bb7213fd018d22becf461f0..1340b13995abc25344db5189cad09386b1d4281a 100644 (file)
@@ -24,7 +24,7 @@
 
 #include "bt_target.h"
 
-#if defined(BTA_GATT_INCLUDED) && (BTA_GATT_INCLUDED == TRUE)
+#if defined(GATTS_INCLUDED) && (GATTS_INCLUDED == TRUE)
 
 #include <string.h>
 
@@ -136,4 +136,4 @@ BOOLEAN bta_gatts_hdl_event(BT_HDR *p_msg)
     return (TRUE);
 }
 
-#endif /* BTA_GATT_INCLUDED */
+#endif /* GATTS_INCLUDED */
index b79bdd0bcbd9bc1949dd7a769ef8af740809df6a..1904d7498505440aece1aacca52f6bec7e26d493 100644 (file)
@@ -24,7 +24,7 @@
 
 #include "bt_target.h"
 
-#if defined(BTA_GATT_INCLUDED) && (BTA_GATT_INCLUDED == TRUE)
+#if defined(GATTS_INCLUDED) && (GATTS_INCLUDED == TRUE)
 
 #include <string.h>
 #include "utl.h"
@@ -222,4 +222,4 @@ BOOLEAN bta_gatts_uuid_compare(tBT_UUID tar, tBT_UUID src)
 
 
 
-#endif
+#endif  /* GATTS_INCLUDED */
\ No newline at end of file
index 40b661c2efbc9aad9e2b503e8c1864a6d3baf9f2..f4c0e06f0789dd0ad42b141c1bf257930a69dac8 100644 (file)
@@ -40,7 +40,7 @@
 
 
 #ifndef     BTA_GATT_DEBUG
-#define     BTA_GATT_DEBUG       TRUE
+#define     BTA_GATT_DEBUG       FALSE
 #endif
 
 /*****************************************************************************
index 98ff872728f2d0feb45872bd0c8a53d01485fcc3..40a08e44a145f3783820a0a02966b8296b53a322 100644 (file)
@@ -41,14 +41,18 @@ static xQueueHandle xBtcQueue = 0;
 static btc_func_t profile_tab[BTC_PID_NUM] = {
     [BTC_PID_MAIN_INIT] = {btc_main_call_handler,       NULL                    },
     [BTC_PID_DEV]       = {btc_dev_call_handler,        NULL                    },
+#if (GATTS_INCLUDED == TRUE)
     [BTC_PID_GATTS]     = {btc_gatts_call_handler,      btc_gatts_cb_handler    },
+#endif  ///GATTS_INCLUDED == TRUE
 #if (GATTC_INCLUDED == TRUE)
     [BTC_PID_GATTC]     = {btc_gattc_call_handler,      btc_gattc_cb_handler    },
 #endif  ///GATTC_INCLUDED == TRUE
     [BTC_PID_GAP_BLE]   = {btc_gap_ble_call_handler,    btc_gap_ble_cb_handler  },
     [BTC_PID_BLE_HID]   = {NULL, NULL},
     [BTC_PID_SPPLIKE]   = {NULL, NULL},
+#if (GATTS_INCLUDED == TRUE)
     [BTC_PID_BLUFI]     = {btc_blufi_call_handler,      btc_blufi_cb_handler    },
+#endif  ///GATTS_INCLUDED == TRUE
     [BTC_PID_DM_SEC]    = {NULL,                        btc_dm_sec_cb_handler   },
 #if CONFIG_CLASSIC_BT_ENABLED
     [BTC_PID_GAP_BT]    = {btc_gap_bt_call_handler,     NULL                    },
index 7379192577281497dcade0013bcdd6ff9b8fd5c2..cf6e233056949b504606c4db0ae6ff41f54893f4 100644 (file)
@@ -35,6 +35,8 @@
 
 #include "esp_blufi_api.h"
 
+#if (GATTS_INCLUDED == TRUE)
+
 #define BT_BD_ADDR_STR         "%02x:%02x:%02x:%02x:%02x:%02x"
 #define BT_BD_ADDR_HEX(addr)   addr[0], addr[1], addr[2], addr[3], addr[4], addr[5]
 
@@ -915,3 +917,5 @@ uint16_t btc_blufi_get_version(void)
 {
     return BTC_BLUFI_VERSION;
 }
+
+#endif ///GATTS_INCLUDED == TRUE
index d4d617f000057d055fe303c27ddd0b6cb11d322d..c66649bf09819bf49ae2c77c1b74a2b9bdc4e202 100644 (file)
@@ -35,6 +35,7 @@
 
 #include "esp_wifi.h"
 
+#if (GATTS_INCLUDED == TRUE)
 extern tBLUFI_ENV blufi_env;
 
 void btc_blufi_protocol_handler(uint8_t type, uint8_t *data, int len)
@@ -247,3 +248,5 @@ void btc_blufi_protocol_handler(uint8_t type, uint8_t *data, int len)
         break;
     }
 }
+
+#endif ///(GATTS_INCLUDED == TRUE)
index d2d658393308754b4e695a19d579b36c5f2d67a8..4dcf8b817990f87d194c3ae12e23dbe8f92114fd 100644 (file)
@@ -24,6 +24,8 @@
 #include "btc_main.h"
 #include "esp_gatts_api.h"
 
+#if (GATTS_INCLUDED == TRUE)
+
 #define A2C_GATTS_EVT(_bta_event) (_bta_event) //BTA TO BTC EVT
 #define C2A_GATTS_EVT(_btc_event) (_btc_event) //BTC TO BTA EVT
 
@@ -779,3 +781,5 @@ void btc_gatts_cb_handler(btc_msg_t *msg)
 
     btc_gatts_cb_param_copy_free(msg, p_data);
 }
+
+#endif  ///GATTS_INCLUDED
\ No newline at end of file
index d6f0ca7317127c388afed9fb10b309212c860207..77b6c35b155d758eda5471818615a4e772ca718d 100644 (file)
@@ -19,7 +19,7 @@
 #include "bta_api.h"
 
 #if( defined BLE_INCLUDED ) && (BLE_INCLUDED == TRUE)
-#if( defined BTA_GATT_INCLUDED ) && (BTA_GATT_INCLUDED == TRUE)
+#if( defined GATTS_INCLUDED ) && (GATTS_INCLUDED == TRUE)
 
 #include <stdlib.h>
 #include <string.h>
index 74394d95d4a73d653d2d851b0d8d0872a9bed703..a90c44ad29224d922766abe0c23e492463ae5769 100644 (file)
@@ -21,6 +21,7 @@
 
 #include <stdbool.h>
 #include "bt_defs.h"
+#include "bt_target.h"
 
 typedef enum {
     // Disable secure connections
index ffcbc0fe717ff8d1d8fbe6492035c387638e2238..18d2a84fb742122a31163ee939255f2ff15708e4 100644 (file)
@@ -26,6 +26,7 @@
 
 #define CASE_RETURN_STR(const) case const: return #const;
 
+#if (SMP_INCLUDED == TRUE)
 static const char *interop_feature_string(const interop_feature_t feature)
 {
     switch (feature) {
@@ -37,7 +38,6 @@ static const char *interop_feature_string(const interop_feature_t feature)
 }
 
 // Interface functions
-
 bool interop_match(const interop_feature_t feature, const bt_bdaddr_t *addr)
 {
     assert(addr);
@@ -56,3 +56,4 @@ bool interop_match(const interop_feature_t feature, const bt_bdaddr_t *addr)
 
     return false;
 }
+#endif  ///SMP_INCLUDED == TRUE
index f26365e3ac9846612547e064768e7b06b4ee28a8..021137511cb7750d1766542e662eaa98c5653b0c 100644 (file)
@@ -195,7 +195,7 @@ static void hci_hal_h4_hdl_rx_packet(BT_HDR *packet)
     packet->offset++;
     packet->len--;
     if (type == HCI_BLE_EVENT) {
-        uint8_t len;
+        uint8_t len = 0;
         STREAM_TO_UINT8(len, stream);
         LOG_ERROR("Workround stream corrupted during LE SCAN: pkt_len=%d ble_event_len=%d\n",
                   packet->len, len);
index b5dd88a987b60aa4171298fa23f504d877c0c652..7c3517bf1fcc4a22d20c4dcf4901675a12af542f 100644 (file)
 
 #endif /* #if CONFIG_CLASSIC_BT_ENABLED */
 
+#if (CONFIG_GATTS_ENABLE)
+#define GATTS_INCLUDED              TRUE
+#else
+#define GATTS_INCLUDED              FALSE
+#endif /* CONFIG_GATTS_ENABLE */
+
+#if (CONFIG_GATTC_ENABLE)
+#define GATTC_INCLUDED              TRUE
+#else
+#define GATTC_INCLUDED              FALSE
+#endif  /* CONFIG_GATTC_ENABLE */
+
+#if (CONFIG_SMP_ENABLE)
+#define SMP_INCLUDED              TRUE
+#define BLE_PRIVACY_SPT           TRUE
+#else
+#define SMP_INCLUDED              FALSE
+#define BLE_PRIVACY_SPT           FALSE
+#endif  /* CONFIG_GATTC_ENABLE */
+
+
 //------------------Added from bdroid_buildcfg.h---------------------
 #ifndef L2CAP_EXTFEA_SUPPORTED_MASK
 #define L2CAP_EXTFEA_SUPPORTED_MASK (L2CAP_EXTFEA_ENH_RETRANS | L2CAP_EXTFEA_STREAM_MODE | L2CAP_EXTFEA_NO_CRC | L2CAP_EXTFEA_FIXED_CHNLS)
 
 /* The size in bytes of the BTM inquiry database. 40 As Default */
 #ifndef BTM_INQ_DB_SIZE
-#define BTM_INQ_DB_SIZE             1//32
+#define BTM_INQ_DB_SIZE             5//32
 #endif
 
 /* The default scan mode */
 #if (CLASSIC_BT_INCLUDED == TRUE)
 #define L2CAP_NUM_FIXED_CHNLS               32
 #else
-#define L2CAP_NUM_FIXED_CHNLS               2   //There are just two fix channel in the BLE only mode(gatt,smp)
+#define L2CAP_NUM_FIXED_CHNLS               3   //There are just three fix channel in the BLE only mode(gatt,signal,smp)
 #endif  ///CLASSIC_BT_INCLUDED == TRUE
 #endif
 
index 6a1f848309f0e93707ba3fb8077325356282edd7..6324adf95fa5f7b022f804045ceb509c008b5478 100644 (file)
@@ -171,7 +171,7 @@ inline void trc_dump_buffer(const char *prefix, uint8_t *data, uint16_t len)
 
 /* Enables or disables all trace messages. */
 #ifndef BT_USE_TRACES
-#define BT_USE_TRACES       TRUE
+#define BT_USE_TRACES       FALSE
 #endif
 
 /******************************************************************************
@@ -194,11 +194,11 @@ inline void trc_dump_buffer(const char *prefix, uint8_t *data, uint16_t len)
 #endif
 
 #ifndef BTM_INITIAL_TRACE_LEVEL
-#define BTM_INITIAL_TRACE_LEVEL             BT_TRACE_LEVEL_DEBUG
+#define BTM_INITIAL_TRACE_LEVEL             BT_TRACE_LEVEL_WARNING
 #endif
 
 #ifndef L2CAP_INITIAL_TRACE_LEVEL
-#define L2CAP_INITIAL_TRACE_LEVEL           BT_TRACE_LEVEL_DEBUG
+#define L2CAP_INITIAL_TRACE_LEVEL           BT_TRACE_LEVEL_WARNING
 #endif
 
 #ifndef RFCOMM_INITIAL_TRACE_LEVEL
@@ -246,7 +246,7 @@ inline void trc_dump_buffer(const char *prefix, uint8_t *data, uint16_t len)
 #endif
 
 #ifndef APPL_INITIAL_TRACE_LEVEL
-#define APPL_INITIAL_TRACE_LEVEL            BT_TRACE_LEVEL_DEBUG
+#define APPL_INITIAL_TRACE_LEVEL            BT_TRACE_LEVEL_WARNING
 #endif
 
 #ifndef BT_TRACE_APPL
@@ -254,7 +254,7 @@ inline void trc_dump_buffer(const char *prefix, uint8_t *data, uint16_t len)
 #endif
 
 #ifndef GATT_INITIAL_TRACE_LEVEL
-#define GATT_INITIAL_TRACE_LEVEL             BT_TRACE_LEVEL_DEBUG
+#define GATT_INITIAL_TRACE_LEVEL             BT_TRACE_LEVEL_WARNING
 #endif
 
 #ifndef SMP_INITIAL_TRACE_LEVEL
index c2b356fc7ce40f26a119d0e38d011db2a9f17c26..49f491f06ca9e8eab7ed93231543bfdd9f322d6e 100644 (file)
@@ -2165,7 +2165,7 @@ tBTM_STATUS btm_ble_read_remote_name(BD_ADDR remote_bda, tBTM_INQ_INFO *p_cur, t
         return BTM_BUSY;
     }
 
-#if (defined(GAP_INCLUDED) && GAP_INCLUDED == TRUE)
+#if (defined(GAP_INCLUDED) && GAP_INCLUDED == TRUE && GATTS_INCLUDED == TRUE)
     if (!GAP_BleReadPeerDevName(remote_bda, btm_ble_read_remote_name_cmpl)) {
         return BTM_BUSY;
     }
@@ -2199,7 +2199,7 @@ BOOLEAN btm_ble_cancel_remote_name(BD_ADDR remote_bda)
     tBTM_INQUIRY_VAR_ST      *p_inq = &btm_cb.btm_inq_vars;
     BOOLEAN     status = TRUE;
 
-#if (defined(GAP_INCLUDED) && GAP_INCLUDED == TRUE)
+#if (defined(GAP_INCLUDED) && GAP_INCLUDED == TRUE && GATTS_INCLUDED == TRUE)
     status = GAP_BleCancelReadPeerDevName(remote_bda);
 #endif
 
index 2ed561bcf203b98b00a300d7f0e6362b335ffb4f..03a03f6e95c9646e664a1e187dfa5e0d7c8148ba 100644 (file)
@@ -133,7 +133,7 @@ void btu_free_core(void)
     l2c_free();
 
 #if BLE_INCLUDED == TRUE
-#if (defined(GATT_INCLUDED) && GATT_INCLUDED == true)
+#if (defined(GATTS_INCLUDED) && GATTS_INCLUDED == true)
     gatt_free();
 #endif
 #endif
index aff689c3406c6a45d44f8c578146030ad96ff166..32fa3b540760521344e77d8acb431f8c8034a145 100644 (file)
@@ -69,7 +69,7 @@ void GAP_Init(void)
     gap_conn_init();
 #endif
 
-#if BLE_INCLUDED == TRUE
+#if BLE_INCLUDED == TRUE && GATTS_INCLUDED == TRUE
     gap_attr_db_init();
 #endif
 }
index bf9ea08369f7e85ffd4ffd63e4fb6334f3379f73..b81bae4c49ba2775af86e6e1706c41c0571f8459 100644 (file)
@@ -17,7 +17,7 @@
  ******************************************************************************/
 #include "bt_target.h"
 
-#if (defined BLE_INCLUDED && BLE_INCLUDED == TRUE)
+#if (defined BLE_INCLUDED && BLE_INCLUDED == TRUE && GATTS_INCLUDED == TRUE)
 
 #include "bt_defs.h"
 #include <string.h>
@@ -513,11 +513,12 @@ BOOLEAN gap_ble_send_cl_read_request(tGAP_CLCB *p_clcb)
         param.service.s_handle       = 1;
         param.service.e_handle       = 0xFFFF;
         param.service.auth_req       = 0;
-
+#if (GATTC_INCLUDED == TRUE)
         if (GATTC_Read(p_clcb->conn_id, GATT_READ_BY_TYPE, &param) == GATT_SUCCESS) {
             p_clcb->cl_op_uuid = uuid;
             started = TRUE;
         }
+#endif  ///GATTC_INCLUDED == TRUE
     }
 
     return started;
@@ -784,7 +785,7 @@ BOOLEAN GAP_BleCancelReadPeerDevName (BD_ADDR peer_bda)
     return (TRUE);
 }
 
-#endif  /* BLE_INCLUDED */
+#endif  /* BLE_INCLUDED == TRUE && GATTS_INCLUDED == TRUE*/
 
 
 
index af7acf231a51182383893a1cbe4ddd6eb2da82f6..f05b0ce292a239e534103a005d3a3c75eb6150f0 100644 (file)
@@ -135,7 +135,7 @@ typedef struct {
 #endif
 
     /* LE GAP attribute database */
-#if BLE_INCLUDED == TRUE
+#if BLE_INCLUDED == TRUE && GATTS_INCLUDED == TRUE
     tGAP_ATTR               gatt_attr[GAP_MAX_CHAR_NUM];
     tGAP_CLCB               clcb[GAP_MAX_CL]; /* connection link*/
     tGATT_IF                gatt_if;
@@ -147,7 +147,7 @@ extern tGAP_CB  gap_cb;
 #if (GAP_CONN_INCLUDED == TRUE)
 extern void gap_conn_init(void);
 #endif
-#if (BLE_INCLUDED == TRUE)
+#if (BLE_INCLUDED == TRUE && GATTS_INCLUDED == TRUE)
 extern void gap_attr_db_init(void);
 #endif
 
index 5beffe8753fb9ac5d981024fabca9a8a726da0c5..ea39008cbb706bf0187d62879e7e0eed68f8f549 100644 (file)
@@ -65,6 +65,8 @@ UINT8 GATT_SetTraceLevel (UINT8 new_level)
     return (gatt_cb.trace_level);
 }
 
+
+#if (GATTS_INCLUDED == TRUE)
 /*****************************************************************************
 **
 **                  GATT SERVER API
@@ -440,7 +442,9 @@ tGATT_STATUS GATTS_StartService (tGATT_IF gatt_if, UINT16 service_handle,
     tGATT_SR_REG            *p_sreg;
     tGATT_HDL_LIST_ELEM      *p_list = NULL;
     UINT8                    i_sreg;
+#if (SDP_INCLUDED == TRUE)
     tBT_UUID                *p_uuid;
+#endif  ///SDP_INCLUDED == TRUE
     tGATT_REG              *p_reg = gatt_get_regcb(gatt_if);
 
     tGATTS_PENDING_NEW_SRV_START *p_buf;
@@ -479,8 +483,8 @@ tGATT_STATUS GATTS_StartService (tGATT_IF gatt_if, UINT16 service_handle,
     case GATT_TRANSPORT_BR_EDR:
     case GATT_TRANSPORT_LE_BR_EDR:
         if (p_sreg->type == GATT_UUID_PRI_SERVICE) {
-            p_uuid = gatts_get_service_uuid (p_sreg->p_db);
 #if (SDP_INCLUDED == TRUE)
+            p_uuid = gatts_get_service_uuid (p_sreg->p_db);
             p_sreg->sdp_handle = gatt_add_sdp_record(p_uuid, p_sreg->s_hdl, p_sreg->e_hdl);
 #endif  ///SDP_INCLUDED == TRUE
         }
@@ -761,7 +765,10 @@ tGATT_STATUS GATTS_GetAttributeValue(UINT16 attr_handle, UINT16 *length, UINT8 *
      status =  gatts_get_attribute_value(&p_decl->svc_db, attr_handle, length, value);
      return status;
 }
+#endif  ///GATTS_INCLUDED == TRUE
+
 
+#if (GATTC_INCLUDED == TRUE)
 /*******************************************************************************/
 /* GATT Profile Srvr Functions */
 /*******************************************************************************/
@@ -1115,6 +1122,7 @@ tGATT_STATUS GATTC_SendHandleValueConfirm (UINT16 conn_id, UINT16 handle)
     return ret;
 }
 
+#endif  ///GATTC_INCLUDED == TRUE
 
 /*******************************************************************************/
 /*                                                                             */
@@ -1218,10 +1226,12 @@ void GATT_Deregister (tGATT_IF gatt_if)
 {
     tGATT_REG       *p_reg = gatt_get_regcb(gatt_if);
     tGATT_TCB       *p_tcb;
-    tGATT_CLCB       *p_clcb;
-    UINT8           i, ii, j;
+    tGATT_CLCB      *p_clcb;
+    UINT8           i, j;
+#if (GATTS_INCLUDED == TRUE)
+    UINT8           ii;
     tGATT_SR_REG    *p_sreg;
-
+#endif  ///GATTS_INCLUDED == TRUE
     GATT_TRACE_API ("GATT_Deregister gatt_if=%d", gatt_if);
     /* Index 0 is GAP and is never deregistered */
     if ( (gatt_if == 0) || (p_reg == NULL) ) {
@@ -1233,16 +1243,15 @@ void GATT_Deregister (tGATT_IF gatt_if)
     /* todo an applcaiton can not be deregistered if its services is also used by other application
       deregisteration need to bed performed in an orderly fashion
       no check for now */
-
+#if (GATTS_INCLUDED == TRUE)
     for (ii = 0, p_sreg = gatt_cb.sr_reg; ii < GATT_MAX_SR_PROFILES; ii++, p_sreg++) {
         if (p_sreg->in_use && (p_sreg->gatt_if == gatt_if)) {
             GATTS_StopService(p_sreg->s_hdl);
         }
     }
-
     /* free all services db buffers if owned by this application */
     gatt_free_srvc_db_buffer_app_id(&p_reg->app_uuid128);
-
+#endif  ///GATTS_INCLUDED == TRUE
     /* When an application deregisters, check remove the link associated with the app */
 
     for (i = 0, p_tcb = gatt_cb.tcb; i < GATT_MAX_PHY_CHANNEL; i++, p_tcb++) {
index 421b17cab7696f4cd146f5fc08f1094f7cee3183..9d83bde333408d34ab3e60b460fa4a5d9dd5a276 100644 (file)
@@ -30,7 +30,7 @@
 #include "gatt_int.h"
 #include "sdpdefs.h"
 
-#if BLE_INCLUDED == TRUE
+#if (BLE_INCLUDED == TRUE && GATTS_INCLUDED == TRUE)
 
 #define GATTP_MAX_NUM_INC_SVR       0
 #define GATTP_MAX_CHAR_NUM          2
@@ -71,13 +71,14 @@ static tGATT_CBACK gatt_profile_cback = {
 ** Returns          Connection ID
 **
 *******************************************************************************/
+#if (GATTS_INCLUDED == TRUE)
 UINT16 gatt_profile_find_conn_id_by_bd_addr(BD_ADDR remote_bda)
 {
     UINT16 conn_id = GATT_INVALID_CONN_ID;
     GATT_GetConnIdIfConnected (gatt_cb.gatt_if, remote_bda, &conn_id, BT_TRANSPORT_LE);
     return conn_id;
 }
-
+#endif  ///GATTS_INCLUDED == TRUE
 /*******************************************************************************
 **
 ** Function         gatt_profile_find_clcb_by_conn_id
@@ -431,10 +432,12 @@ static void gatt_cl_start_config_ccc(tGATT_PROFILE_CLCB *p_clcb)
         srvc_disc_param.e_handle = 0xffff;
         srvc_disc_param.service.len = 2;
         srvc_disc_param.service.uu.uuid16 = UUID_SERVCLASS_GATT_SERVER;
+#if (GATTC_INCLUDED == TRUE)
         if (GATTC_Discover (p_clcb->conn_id, GATT_DISC_SRVC_BY_UUID, &srvc_disc_param) != GATT_SUCCESS) {
             GATT_TRACE_ERROR("%s() - ccc service error", __FUNCTION__);
             gatt_config_ccc_complete(p_clcb);
         }
+#endif  ///GATTC_INCLUDED == TRUE
         break;
 
     case GATT_SVC_CHANGED_CHARACTERISTIC: /* discover service change char */
@@ -442,29 +445,35 @@ static void gatt_cl_start_config_ccc(tGATT_PROFILE_CLCB *p_clcb)
         srvc_disc_param.e_handle = p_clcb->e_handle;
         srvc_disc_param.service.len = 2;
         srvc_disc_param.service.uu.uuid16 = GATT_UUID_GATT_SRV_CHGD;
+#if (GATTC_INCLUDED == TRUE)
         if (GATTC_Discover (p_clcb->conn_id, GATT_DISC_CHAR, &srvc_disc_param) != GATT_SUCCESS) {
             GATT_TRACE_ERROR("%s() - ccc char error", __FUNCTION__);
             gatt_config_ccc_complete(p_clcb);
         }
+#endif  ///GATTC_INCLUDED == TRUE
         break;
 
     case GATT_SVC_CHANGED_DESCRIPTOR: /* discover service change ccc */
         srvc_disc_param.s_handle = p_clcb->s_handle;
         srvc_disc_param.e_handle = p_clcb->e_handle;
+#if (GATTC_INCLUDED == TRUE)
         if (GATTC_Discover (p_clcb->conn_id, GATT_DISC_CHAR_DSCPT, &srvc_disc_param) != GATT_SUCCESS) {
             GATT_TRACE_ERROR("%s() - ccc char descriptor error", __FUNCTION__);
             gatt_config_ccc_complete(p_clcb);
         }
+#endif  ///GATTC_INCLUDED == TRUE
         break;
 
     case GATT_SVC_CHANGED_CONFIGURE_CCCD: /* write ccc */
         ccc_value.handle = p_clcb->s_handle;
         ccc_value.len = 2;
         ccc_value.value[0] = GATT_CLT_CONFIG_INDICATION;
+#if (GATTC_INCLUDED == TRUE)
         if (GATTC_Write (p_clcb->conn_id, GATT_WRITE, &ccc_value) != GATT_SUCCESS) {
             GATT_TRACE_ERROR("%s() - write ccc error", __FUNCTION__);
             gatt_config_ccc_complete(p_clcb);
         }
+#endif  ///GATTC_INCLUDED == TRUE
         break;
     }
 }
@@ -506,4 +515,4 @@ void GATT_ConfigServiceChangeCCC (BD_ADDR remote_bda, BOOLEAN enable, tBT_TRANSP
     gatt_cl_start_config_ccc(p_clcb);
 }
 
-#endif  /* BLE_INCLUDED */
+#endif  /* BLE_INCLUDED == TRUE && GATTS_INCLUDED == TRUE */
index 09f686bb952723e306ca1ba7ce86e4ff355a5215..69934dd8bd8fcd4f9e7acf6483ef632282c2833b 100644 (file)
@@ -72,7 +72,9 @@ static BOOLEAN gatt_sign_data (tGATT_CLCB *p_clcb)
                                  p_signature)) {
             p_attr->len += BTM_BLE_AUTH_SIGN_LEN;
             gatt_set_ch_state(p_clcb->p_tcb, GATT_CH_OPEN);
+#if (GATTC_INCLUDED == TRUE)
             gatt_act_write(p_clcb, GATT_SEC_SIGN_DATA);
+#endif  ///GATTC_INCLUDED == TRUE
         } else {
             gatt_end_operation(p_clcb, GATT_INTERNAL_ERROR, NULL);
         }
@@ -96,7 +98,9 @@ static BOOLEAN gatt_sign_data (tGATT_CLCB *p_clcb)
 void gatt_verify_signature(tGATT_TCB *p_tcb, BT_HDR *p_buf)
 {
     UINT16  cmd_len;
+#if (GATTS_INCLUDED == TRUE)
     UINT8   op_code;
+#endif  ///GATTS_INCLUDED == TRUE
     UINT8   *p, *p_orig = (UINT8 *)(p_buf + 1) + p_buf->offset;
     UINT32  counter;
 
@@ -110,8 +114,10 @@ void gatt_verify_signature(tGATT_TCB *p_tcb, BT_HDR *p_buf)
     STREAM_TO_UINT32(counter, p);
 
     if (BTM_BleVerifySignature(p_tcb->peer_bda, p_orig, cmd_len, counter, p)) {
+#if (GATTS_INCLUDED == TRUE)
         STREAM_TO_UINT8(op_code, p_orig);
         gatt_server_handle_client_req (p_tcb, op_code, (UINT16)(p_buf->len - 1), p_orig);
+#endif  ///GATTS_INCLUDED == TRUE
     } else {
         /* if this is a bad signature, assume from attacker, ignore it  */
         GATT_TRACE_ERROR("Signature Verification Failed, data ignored");
@@ -133,14 +139,15 @@ void gatt_sec_check_complete(BOOLEAN sec_check_ok, tGATT_CLCB   *p_clcb, UINT8 s
     if (p_clcb && p_clcb->p_tcb && GKI_queue_is_empty(&p_clcb->p_tcb->pending_enc_clcb)) {
         gatt_set_sec_act(p_clcb->p_tcb, GATT_SEC_NONE);
     }
-
+#if (GATTC_INCLUDED == TRUE)
     if (!sec_check_ok) {
         gatt_end_operation(p_clcb, GATT_AUTH_FAIL, NULL);
     } else if (p_clcb->operation == GATTC_OPTYPE_WRITE) {
         gatt_act_write(p_clcb, sec_act);
     } else if (p_clcb->operation == GATTC_OPTYPE_READ) {
         gatt_act_read(p_clcb, p_clcb->counter);
-    }
+    }\r
+#endif  ///GATTC_INCLUDED == TRUE
 }
 /*******************************************************************************
 **
index fab35d5f03bf1618a5a359b1985daf7bca62eb6d..753c44bbca99b31567f6b13c67a6e9a6d8c4c342 100644 (file)
@@ -24,7 +24,7 @@
 
 #include "bt_target.h"
 
-#if BLE_INCLUDED == TRUE
+#if BLE_INCLUDED == TRUE && GATTC_INCLUDED == TRUE
 
 #include <string.h>
 //#include "bt_utils.h"
@@ -1162,4 +1162,4 @@ void gatt_client_handle_server_rsp (tGATT_TCB *p_tcb, UINT8 op_code,
     return;
 }
 
-#endif  /* BLE_INCLUDED */
+#endif  /* BLE_INCLUDED == TRUE && GATTC_INCLUDED == TRUE */
index bb7c7ac9741488d96b906a00e985109d64ea942b..1379b43b72937ba9bb55f1855a74ef981462ba3d 100644 (file)
@@ -24,7 +24,7 @@
 
 #include "bt_target.h"
 
-#if BLE_INCLUDED == TRUE
+#if BLE_INCLUDED == TRUE && GATTS_INCLUDED == TRUE
 
 #include "bt_trace.h"
 //#include "bt_utils.h"
@@ -1465,4 +1465,4 @@ static BOOLEAN gatts_db_add_service_declaration(tGATT_SVC_DB *p_db, tBT_UUID *p_
     return rt;
 }
 
-#endif /* BLE_INCLUDED */
+#endif /* BLE_INCLUDED == TRUE && GATTS_INCLUDED == TRUE */
index 0a69ff12596fea4fb5e38124ebc8818591f620d4..14a963500aa7354c4962faea292844e9e2e134a9 100644 (file)
@@ -132,7 +132,9 @@ void gatt_init (void)
     gatt_cb.hdl_cfg.gatt_start_hdl = GATT_GATT_START_HANDLE;
     gatt_cb.hdl_cfg.gap_start_hdl  = GATT_GAP_START_HANDLE;
     gatt_cb.hdl_cfg.app_start_hdl  = GATT_APP_START_HANDLE;
+#if (GATTS_INCLUDED == TRUE)
     gatt_profile_db_init();
+#endif  ///GATTS_INCLUDED == TRUE
 
 }
 
@@ -146,6 +148,7 @@ void gatt_init (void)
 ** Returns          void
 **
 *******************************************************************************/
+#if (GATTS_INCLUDED == TRUE)
 void gatt_free(void)
 {
     int i;
@@ -154,6 +157,7 @@ void gatt_free(void)
         gatt_free_hdl_buffer(&gatt_cb.hdl_list[i]);
     }
 }
+#endif  ///GATTS_INCLUDED == TRUE
 
 /*******************************************************************************
 **
@@ -450,11 +454,12 @@ static void gatt_channel_congestion(tGATT_TCB *p_tcb, BOOLEAN congested)
     UINT8 i = 0;
     tGATT_REG *p_reg = NULL;
     UINT16 conn_id;
-
+#if (GATTC_INCLUDED == TRUE)
     /* if uncongested, check to see if there is any more pending data */
     if (p_tcb != NULL && congested == FALSE) {
         gatt_cl_send_next_cmd_inq(p_tcb);
     }
+#endif  ///GATTC_INCLUDED == TRUE
     /* notifying all applications for the connection up event */
     for (i = 0, p_reg = gatt_cb.cl_rcb ; i < GATT_MAX_APPS; i++, p_reg++) {
         if (p_reg->in_use) {
@@ -929,9 +934,13 @@ void gatt_data_process (tGATT_TCB *p_tcb, BT_HDR *p_buf)
             } else {
                 /* message from client */
                 if ((op_code % 2) == 0) {
+#if (GATTS_INCLUDED == TRUE)
                     gatt_server_handle_client_req (p_tcb, op_code, msg_len, p);
+#endif  ///GATTS_INCLUDED == TRUE
                 } else {
+#if (GATTC_INCLUDED == TRUE)
                     gatt_client_handle_server_rsp (p_tcb, op_code, msg_len, p);
+#endif  ///GATTC_INCLUDED == TRUE
                 }
             }
         } else {
@@ -981,6 +990,7 @@ void gatt_add_a_bonded_dev_for_srv_chg (BD_ADDR bda)
 *******************************************************************************/
 void gatt_send_srv_chg_ind (BD_ADDR peer_bda)
 {
+#if (GATTS_INCLUDED == TRUE)
     UINT8   handle_range[GATT_SIZE_OF_SRV_CHG_HNDL_RANGE];
     UINT8   *p = handle_range;
     UINT16  conn_id;
@@ -1001,6 +1011,7 @@ void gatt_send_srv_chg_ind (BD_ADDR peer_bda)
                              (peer_bda[4] << 8) + peer_bda[5] );
         }
     }
+#endif  ///GATTS_INCLUDED == TRUE
 }
 
 /*******************************************************************************
index 79d518398c0fe4fd01ce5c1efdfd0e2667cfd84d..a35c3717c6c18f485976a67c341a89294b91d2bd 100644 (file)
@@ -25,7 +25,7 @@
 #include "bt_target.h"
 //#include "bt_utils.h"
 
-#if BLE_INCLUDED == TRUE
+#if BLE_INCLUDED == TRUE && GATTS_INCLUDED == TRUE
 #include <string.h>
 #include "gatt_int.h"
 #include "l2c_api.h"
@@ -1491,6 +1491,7 @@ static void gatts_proc_srv_chg_ind_ack(tGATT_TCB *p_tcb )
 *******************************************************************************/
 static void gatts_chk_pending_ind(tGATT_TCB *p_tcb )
 {
+#if (GATTS_INCLUDED == TRUE)
     tGATT_VALUE *p_buf = (tGATT_VALUE *)GKI_getfirst(&p_tcb->pending_ind_q);
     GATT_TRACE_DEBUG("gatts_chk_pending_ind");
 
@@ -1501,6 +1502,7 @@ static void gatts_chk_pending_ind(tGATT_TCB *p_tcb )
                                      p_buf->value);
         GKI_freebuf(GKI_remove_from_queue (&p_tcb->pending_ind_q, p_buf));
     }
+#endif  ///GATTS_INCLUDED == TRUE
 }
 
 /*******************************************************************************
@@ -1645,4 +1647,4 @@ void gatt_server_handle_client_req (tGATT_TCB *p_tcb, UINT8 op_code,
     }
 }
 
-#endif /* BLE_INCLUDED */
+#endif /* BLE_INCLUDED == TRUE && GATTS_INCLUDED == TRUE */
index 776004c11af8240f62e9769fd9aa7cbae56ce22a..78b50789a8d960e02ee4f84ff9b18306227486f5 100644 (file)
@@ -297,6 +297,7 @@ tGATTS_SRV_CHG *gatt_add_srv_chg_clt(tGATTS_SRV_CHG *p_srv_chg)
 ** Returns    Pointer to the allocated buffer, NULL no buffer available
 **
 *******************************************************************************/
+#if (GATTS_INCLUDED == TRUE)
 tGATT_HDL_LIST_ELEM *gatt_alloc_hdl_buffer(void)
 {
     UINT8 i;
@@ -395,6 +396,8 @@ tGATT_HDL_LIST_ELEM *gatt_find_hdl_buffer_by_app_id (tBT_UUID *p_app_uuid128,
     }
     return NULL;
 }
+#endif  ///GATTS_INCLUDED == TRUE
+
 /*******************************************************************************
 **
 ** Function         gatt_free_attr_value_buffer
@@ -451,6 +454,7 @@ void gatt_free_hdl_buffer(tGATT_HDL_LIST_ELEM *p)
 ** Returns       None
 **
 *******************************************************************************/
+#if (GATTS_INCLUDED == TRUE)
 void gatt_free_srvc_db_buffer_app_id(tBT_UUID *p_app_id)
 {
     tGATT_HDL_LIST_ELEM *p_elem =  &gatt_cb.hdl_list[0];
@@ -501,7 +505,6 @@ BOOLEAN gatt_is_last_attribute(tGATT_SRV_LIST_INFO *p_list, tGATT_SRV_LIST_ELEM
     return is_last_attribute;
 
 }
-
 /*******************************************************************************
 **
 ** Function         gatt_update_last_pri_srv_info
@@ -545,6 +548,8 @@ void gatts_update_srv_list_elem(UINT8 i_sreg, UINT16 handle, BOOLEAN is_primary)
 
     return;
 }
+#endif  ///GATTS_INCLUDED == TRUE
+
 /*******************************************************************************
 **
 ** Function  gatt_add_a_srv_to_list
@@ -1234,7 +1239,9 @@ void gatt_rsp_timeout(TIMER_LIST_ENT *p_tle)
             GATT_TRACE_ERROR("gatt_rsp_timeout command queue out of sync, disconnect");
         } else {
             p_clcb->retry_count++;
+#if (GATTC_INCLUDED == TRUE)
             gatt_act_discovery(p_clcb);
+#endif  ///GATTC_INCLUDED == TRUE
             return;
         }
     }
@@ -1296,6 +1303,7 @@ UINT8 gatt_sr_find_i_rcb_by_handle(UINT16 handle)
 ** Returns          0 if not found. Otherwise index of th eservice.
 **
 *******************************************************************************/
+#if (GATTS_INCLUDED == TRUE)
 UINT8 gatt_sr_find_i_rcb_by_app_id(tBT_UUID *p_app_uuid128, tBT_UUID *p_svc_uuid, UINT16 svc_inst)
 {
     UINT8           i_rcb = 0;
@@ -1319,6 +1327,7 @@ UINT8 gatt_sr_find_i_rcb_by_app_id(tBT_UUID *p_app_uuid128, tBT_UUID *p_svc_uuid
     }
     return i_rcb;
 }
+#endif  ///GATTS_INCLUDED == TRUE
 /*******************************************************************************
 **
 ** Function         gatt_sr_find_i_rcb_by_handle
@@ -1431,11 +1440,11 @@ tGATT_STATUS gatt_send_error_rsp (tGATT_TCB *p_tcb, UINT8 err_code, UINT8 op_cod
     } else {
         status = GATT_INSUF_RESOURCE;
     }
-
+#if (GATTS_INCLUDED == TRUE)
     if (deq) {
         gatt_dequeue_sr_cmd(p_tcb);
     }
-
+#endif  ///GATTS_INCLUDED == TRUE
     return status;
 }
 
@@ -1716,6 +1725,7 @@ UINT8 gatt_num_clcb_by_bd_addr(BD_ADDR bda)
 *******************************************************************************/
 void gatt_sr_copy_prep_cnt_to_cback_cnt(tGATT_TCB *p_tcb )
 {
+#if (GATTS_INCLUDED == TRUE)
     UINT8 i;
 
     if (p_tcb) {
@@ -1725,7 +1735,7 @@ void gatt_sr_copy_prep_cnt_to_cback_cnt(tGATT_TCB *p_tcb )
             }
         }
     }
-
+#endif  ///GATTS_INCLUDED == TRUE
 }
 
 /*******************************************************************************
@@ -1740,6 +1750,7 @@ void gatt_sr_copy_prep_cnt_to_cback_cnt(tGATT_TCB *p_tcb )
 BOOLEAN gatt_sr_is_cback_cnt_zero(tGATT_TCB *p_tcb )
 {
     BOOLEAN status = TRUE;
+#if (GATTS_INCLUDED == TRUE)
     UINT8   i;
 
     if (p_tcb) {
@@ -1752,6 +1763,7 @@ BOOLEAN gatt_sr_is_cback_cnt_zero(tGATT_TCB *p_tcb )
     } else {
         status = FALSE;
     }
+#endif  ///GATTS_INCLUDED == TRUE
     return status;
 }
 
@@ -1794,6 +1806,7 @@ BOOLEAN gatt_sr_is_prep_cnt_zero(tGATT_TCB *p_tcb)
 *******************************************************************************/
 void gatt_sr_reset_cback_cnt(tGATT_TCB *p_tcb )
 {
+#if (GATTS_INCLUDED == TRUE)
     UINT8 i;
 
     if (p_tcb) {
@@ -1801,6 +1814,7 @@ void gatt_sr_reset_cback_cnt(tGATT_TCB *p_tcb )
             p_tcb->sr_cmd.cback_cnt[i] = 0;
         }
     }
+#endif  ///GATTS_INCLUDED == TRUE
 }
 
 /*******************************************************************************
@@ -1834,7 +1848,7 @@ void gatt_sr_reset_prep_cnt(tGATT_TCB *p_tcb )
 *******************************************************************************/
 void gatt_sr_update_cback_cnt(tGATT_TCB *p_tcb, tGATT_IF gatt_if, BOOLEAN is_inc, BOOLEAN is_reset_first)
 {
-
+#if (GATTS_INCLUDED == TRUE)
     UINT8 idx = ((UINT8) gatt_if) - 1 ;
 
     if (p_tcb) {
@@ -1849,6 +1863,7 @@ void gatt_sr_update_cback_cnt(tGATT_TCB *p_tcb, tGATT_IF gatt_if, BOOLEAN is_inc
             }
         }
     }
+#endif  ///GATTS_INCLUDED == TRUE
 }
 
 
index 6412aed6a37c81e87b06788b0217518c55c7f7ce..b538ed8b5c49696900cc101a1a9b70ac7408d0f2 100644 (file)
@@ -385,7 +385,9 @@ typedef struct {
 
     /* server needs */
     /* server response data */
+#if (GATTS_INCLUDED == TRUE)
     tGATT_SR_CMD    sr_cmd;
+#endif  ///GATTS_INCLUDED == TRUE
     UINT16          indicate_handle;
     BUFFER_Q        pending_ind_q;
 
@@ -502,11 +504,12 @@ typedef struct {
     UINT16              next_handle;    /* next available handle */
     tGATT_SVC_CHG       gattp_attr;     /* GATT profile attribute service change */
     tGATT_IF            gatt_if;
+#if (GATTS_INCLUDED == TRUE)    
     tGATT_HDL_LIST_INFO hdl_list_info;
     tGATT_HDL_LIST_ELEM hdl_list[GATT_MAX_SR_PROFILES];
     tGATT_SRV_LIST_INFO srv_list_info;
     tGATT_SRV_LIST_ELEM srv_list[GATT_MAX_SR_PROFILES];
-
+#endif  ///GATTS_INCLUDED == TRUE
     BUFFER_Q            srv_chg_clt_q;   /* service change clients queue */
     BUFFER_Q            pending_new_srv_start_q; /* pending new service start queue */
     tGATT_REG           cl_rcb[GATT_MAX_APPS];
@@ -521,8 +524,9 @@ typedef struct {
     UINT8               err_status;
     UINT16              handle;
 #endif
-
+#if (GATTS_INCLUDED == TRUE)
     tGATT_PROFILE_CLCB  profile_clcb[GATT_MAX_APPS];
+#endif  ///GATTS_INCLUDED == TRUE
     UINT16              handle_of_h_r;          /* Handle of the handles reused characteristic value */
 
     tGATT_APPL_INFO       cb_info;
index c22650d761bbd4f3898dbae20aea00c165a6ffa7..8fd29844fd1a68ea1ee572fec22278aabb4de317 100644 (file)
@@ -1041,7 +1041,7 @@ void l2c_link_check_send_pkts (tL2C_LCB *p_lcb, tL2C_CCB *p_ccb, BT_HDR *p_buf)
 {
     int         xx;
     BOOLEAN     single_write = FALSE;
-    L2CAP_TRACE_ERROR("%s",__func__);
+    L2CAP_TRACE_DEBUG("%s",__func__);
     /* Save the channel ID for faster counting */
     if (p_buf) {
         if (p_ccb != NULL) {
index bf35e8b264dd9deb10c9120ccac0b6d495f5e0c4..46123af177298aef5a66e15c27b59161fb720d10 100644 (file)
@@ -2530,7 +2530,6 @@ BOOLEAN l2cu_initialize_fixed_ccb (tL2C_LCB *p_lcb, UINT16 fixed_cid, tL2CAP_FCR
 {
 #if (L2CAP_NUM_FIXED_CHNLS > 0)
     tL2C_CCB    *p_ccb;
-    L2CAP_TRACE_ERROR("%s,fixed_cid=%d,p_lcb->p_fixed_ccbs[fixed_cid - L2CAP_FIRST_FIXED_CHNL] = %p",__func__,fixed_cid,p_lcb->p_fixed_ccbs[fixed_cid - L2CAP_FIRST_FIXED_CHNL]);
     /* If we already have a CCB, then simply return */
     if (p_lcb->p_fixed_ccbs[fixed_cid - L2CAP_FIRST_FIXED_CHNL] != NULL) {
         return (TRUE);
@@ -2918,7 +2917,7 @@ tL2C_CCB *l2cu_find_ccb_by_cid (tL2C_LCB *p_lcb, UINT16 local_cid)
     return (p_ccb);
 }
 
-#if (L2CAP_ROUND_ROBIN_CHANNEL_SERVICE == TRUE)
+#if (L2CAP_ROUND_ROBIN_CHANNEL_SERVICE == TRUE && CLASSIC_BT_INCLUDED == TRUE)
 
 /******************************************************************************
 **