]> granicus.if.org Git - esp-idf/commitdiff
component/bt: Macor from `sdkconfig.h` is used only in `bt_user_config.h`
authorbaohongde <baohongde@espressif.com>
Mon, 17 Sep 2018 08:44:38 +0000 (16:44 +0800)
committerbaohongde <baohongde@espressif.com>
Thu, 20 Jun 2019 03:41:17 +0000 (11:41 +0800)
16 files changed:
components/bt/bluedroid/api/esp_bt_main.c
components/bt/bluedroid/btc/core/btc_task.c
components/bt/bluedroid/btc/include/btc/btc_task.h
components/bt/bluedroid/btc/profile/std/a2dp/btc_a2dp_sink.c
components/bt/bluedroid/btc/profile/std/a2dp/btc_a2dp_source.c
components/bt/bluedroid/btc/profile/std/hf_client/btc_hf_client.c
components/bt/bluedroid/common/include/common/bt_target.h
components/bt/bluedroid/common/include/common/bt_trace.h
components/bt/bluedroid/common/include/common/bt_user_config.h [new file with mode: 0644]
components/bt/bluedroid/hci/hci_hal_h4.c
components/bt/bluedroid/hci/hci_layer.c
components/bt/bluedroid/osi/allocator.c
components/bt/bluedroid/osi/include/osi/allocator.h
components/bt/bluedroid/stack/btm/btm_sec.c
components/bt/bluedroid/stack/btu/btu_init.c
components/bt/bluedroid/stack/include/stack/dyn_mem.h

index 1620ae9d80382e79d8878c173a620e6a6e2b12a4..0b1bcc6ab0145be6953b27309090bb7711e18519 100644 (file)
@@ -128,7 +128,7 @@ esp_err_t esp_bluedroid_init(void)
         return ESP_ERR_INVALID_STATE;
     }
 
-#ifdef CONFIG_BT_BLUEDROID_MEM_DEBUG
+#if HEAP_MEMORY_DEBUG
     osi_mem_dbg_init();
 #endif
 
index 2787bc205639749d77129c883148b8e5317612f7..8b787405bc10c88322f6e61867e907fddf198c16 100644 (file)
@@ -30,7 +30,7 @@
 #include "btc/btc_dm.h"
 #include "btc/btc_alarm.h"
 #include "bta/bta_gatt_api.h"
-#if CONFIG_BT_CLASSIC_ENABLED
+#if CLASSIC_BT_INCLUDED
 #include "btc/btc_profile_queue.h"
 #if (BTC_GAP_BT_INCLUDED == TRUE)
 #include "btc_gap_bt.h"
 #include "btc_av.h"
 #include "btc_avrc.h"
 #endif /* #if BTC_AV_INCLUDED */
-#if CONFIG_BT_SPP_ENABLED
+#if (BTC_SPP_INCLUDED == TRUE)
 #include "btc_spp.h"
-#endif /* #if CONFIG_BT_SPP_ENABLED */
+#endif /* #if (BTC_SPP_INCLUDED == TRUE) */
 #if BTC_HF_CLIENT_INCLUDED
 #include "btc_hf_client.h"
 #endif  /* #if BTC_HF_CLIENT_INCLUDED */
-#endif /* #if CONFIG_BT_CLASSIC_ENABLED */
+#endif /* #if CLASSIC_BT_INCLUDED */
 
 #define BTC_TASK_PINNED_TO_CORE         (TASK_PINNED_TO_CORE)
-#define BTC_TASK_STACK_SIZE             (CONFIG_BTC_TASK_STACK_SIZE + BT_TASK_EXTRA_STACK_SIZE)        //by menuconfig
+#define BTC_TASK_STACK_SIZE             (BT_BTC_TASK_STACK_SIZE + BT_TASK_EXTRA_STACK_SIZE)    //by menuconfig
 #define BTC_TASK_NAME                   "btcT"
-#define BTC_TASK_PRIO                   (configMAX_PRIORITIES - 6)
-#define BTC_TASK_QUEUE_LEN              60
+#define BTC_TASK_PRIO                   (BT_TASK_MAX_PRIORITIES - 6)
 
 static osi_thread_t *btc_thread;
 
@@ -75,7 +74,7 @@ static btc_func_t profile_tab[BTC_PID_NUM] = {
 #endif  ///GATTS_INCLUDED == TRUE
     [BTC_PID_DM_SEC]      = {NULL,                        btc_dm_sec_cb_handler   },
     [BTC_PID_ALARM]       = {btc_alarm_handler,           NULL                    },
-#if CONFIG_BT_CLASSIC_ENABLED
+#if CLASSIC_BT_INCLUDED
 #if (BTC_GAP_BT_INCLUDED == TRUE)
     [BTC_PID_GAP_BT]    = {btc_gap_bt_call_handler,     btc_gap_bt_cb_handler   },
 #endif /* (BTC_GAP_BT_INCLUDED == TRUE) */
@@ -85,13 +84,13 @@ static btc_func_t profile_tab[BTC_PID_NUM] = {
     [BTC_PID_AVRC_CT]     = {btc_avrc_ct_call_handler,    NULL                    },
     [BTC_PID_AVRC_TG]     = {btc_avrc_tg_call_handler,    NULL                    },
 #endif /* #if BTC_AV_INCLUDED */
-#if CONFIG_BT_SPP_ENABLED
+#if (BTC_SPP_INCLUDED == TRUE)
     [BTC_PID_SPP]         = {btc_spp_call_handler,        btc_spp_cb_handler      },
-#endif /* #if CONFIG_BT_SPP_ENABLED */
+#endif /* #if (BTC_SPP_INCLUDED == TRUE) */
 #if BTC_HF_CLIENT_INCLUDED
     [BTC_PID_HF_CLIENT]   = {btc_hf_client_call_handler,  btc_hf_client_cb_handler},
 #endif  /* #if BTC_HF_CLIENT_INCLUDED */
-#endif /* #if CONFIG_BT_CLASSIC_ENABLED */
+#endif /* #if CLASSIC_BT_INCLUDED */
 };
 
 /*****************************************************************************
@@ -122,7 +121,7 @@ static void btc_thread_handler(void *arg)
     osi_free(msg);
 }
 
-static bt_status_t btc_task_post(btc_msg_t *msg, osi_thread_blocking_t blocking) 
+static bt_status_t btc_task_post(btc_msg_t *msg, osi_thread_blocking_t blocking)
 {
     btc_msg_t *lmsg;
 
index 2ea76c1772a6f69d91af3abe5612b6595bb1959f..0ed02d911ac74bb217010eb8ee522802164ec18a 100644 (file)
@@ -53,17 +53,17 @@ typedef enum {
     BTC_PID_BLUFI,
     BTC_PID_DM_SEC,
     BTC_PID_ALARM,
-#if CONFIG_BT_CLASSIC_ENABLED
+#if (CLASSIC_BT_INCLUDED == TRUE)
     BTC_PID_GAP_BT,
     BTC_PID_PRF_QUE,
     BTC_PID_A2DP,
     BTC_PID_AVRC_CT,
     BTC_PID_AVRC_TG,
     BTC_PID_SPP,
-#if BTC_HF_CLIENT_INCLUDED
+#if (BTC_HF_CLIENT_INCLUDED == TRUE)
     BTC_PID_HF_CLIENT,
 #endif /* BTC_HF_CLIENT_INCLUDED */
-#endif  /* CONFIG_BT_CLASSIC_ENABLED */
+#endif  /* CLASSIC_BT_INCLUDED */
     BTC_PID_NUM,
 } btc_pid_t; //btc profile id
 
index c8e1ec9c901f5237667d722d3a87be615280665c..d25a1e5de5570cb45bfba01117a44c04252710dc 100644 (file)
@@ -47,9 +47,9 @@
 
 /* Macro */
 #define BTC_A2DP_SINK_TASK_PINNED_TO_CORE     (TASK_PINNED_TO_CORE)
-#define BTC_A2DP_SINK_TASK_STACK_SIZE         (CONFIG_A2DP_SINK_TASK_STACK_SIZE + BT_TASK_EXTRA_STACK_SIZE) // by menuconfig
+#define BTC_A2DP_SINK_TASK_STACK_SIZE         (A2DP_SINK_TASK_STACK_SIZE + BT_TASK_EXTRA_STACK_SIZE) // by menuconfig
 #define BTC_A2DP_SINK_TASK_NAME               "BtA2dSinkT"
-#define BTC_A2DP_SINK_TASK_PRIO               (configMAX_PRIORITIES - 3)
+#define BTC_A2DP_SINK_TASK_PRIO               (BT_TASK_MAX_PRIORITIES - 3)
 
 
 /*****************************************************************************
index 893ade6e0d7eb10f041885d55d0c545592d9f963..d6f12b69f113f0704b3917cb3186eb478b6823d9 100644 (file)
@@ -52,9 +52,9 @@
 
 /* Macro */
 #define BTC_A2DP_SOURCE_TASK_PINNED_TO_CORE   (TASK_PINNED_TO_CORE)
-#define BTC_A2DP_SOURCE_TASK_STACK_SIZE       (CONFIG_A2DP_SOURCE_TASK_STACK_SIZE + BT_TASK_EXTRA_STACK_SIZE) // by menuconfig
+#define BTC_A2DP_SOURCE_TASK_STACK_SIZE       (A2DP_SOURCE_TASK_STACK_SIZE + BT_TASK_EXTRA_STACK_SIZE) // by menuconfig
 #define BTC_A2DP_SOURCE_TASK_NAME             "BtA2dSourceT"
-#define BTC_A2DP_SOURCE_TASK_PRIO             (configMAX_PRIORITIES - 3)
+#define BTC_A2DP_SOURCE_TASK_PRIO             (BT_TASK_MAX_PRIORITIES - 3)
 
 
 /*****************************************************************************
index 3ae296cf0f0aeb2ad2452031d9a08bccefc64a45..d0cdbc5e6612711f62d9c306d9672e23efd380ad 100644 (file)
@@ -174,7 +174,7 @@ bt_status_t btc_hf_client_init(void)
 
     btc_hf_client_cb.initialized = true;
 
-#if CONFIG_BT_HFP_AUDIO_DATA_PATH_HCI
+#if BTM_SCO_HCI_INCLUDED
     data_path = ESP_SCO_DATA_PATH_HCI;
 #else
     data_path = ESP_SCO_DATA_PATH_PCM;
index 3e9dac61312b33bda9a60fdbb9d2f98407153c43..b781d435ac58c2edf72ef1896192ebb7d3a14c56 100644 (file)
 #include "bdroid_buildcfg.h"
 #endif
 
-#include "sdkconfig.h"
+#include "bt_user_config.h"
 #include "stack/bt_types.h"   /* This must be defined AFTER buildcfg.h */
 
 #include "stack/dyn_mem.h"    /* defines static and/or dynamic memory for components */
 
 
 /* OS Configuration from User config (eg: sdkconfig) */
-#if CONFIG_BLUEDROID_PINNED_TO_CORE
-#define TASK_PINNED_TO_CORE         (CONFIG_BLUEDROID_PINNED_TO_CORE < portNUM_PROCESSORS ? CONFIG_BLUEDROID_PINNED_TO_CORE : tskNO_AFFINITY)
-#else
-#define TASK_PINNED_TO_CORE         (0)
-#endif
+#define TASK_PINNED_TO_CORE         UC_TASK_PINNED_TO_CORE
+#define BT_TASK_MAX_PRIORITIES      configMAX_PRIORITIES
+#define BT_BTC_TASK_STACK_SIZE      UC_BTC_TASK_STACK_SIZE
+#define A2DP_SINK_TASK_STACK_SIZE   UC_A2DP_SINK_TASK_STACK_SIZE
+#define A2DP_SOURCE_TASK_STACK_SIZE UC_A2DP_SOURCE_TASK_STACK_SIZE
 
 /******************************************************************************
 **
 ** Classic BT features
 **
 ******************************************************************************/
-#if CONFIG_BT_CLASSIC_ENABLED
+#if (UC_BT_CLASSIC_ENABLED == TRUE)
 #define CLASSIC_BT_INCLUDED         TRUE
 #define BTC_SM_INCLUDED             TRUE
 #define BTC_PRF_QUEUE_INCLUDED      TRUE
@@ -61,7 +61,7 @@
 #define BTA_DM_PM_INCLUDED          TRUE
 #define SDP_INCLUDED                TRUE
 
-#if CONFIG_BT_A2DP_ENABLE
+#if (UC_BT_A2DP_ENABLED == TRUE)
 #define BTA_AR_INCLUDED             TRUE
 #define BTA_AV_INCLUDED             TRUE
 #define AVDT_INCLUDED               TRUE
 #define SBC_DEC_INCLUDED            TRUE
 #define BTC_AV_SRC_INCLUDED         TRUE
 #define SBC_ENC_INCLUDED            TRUE
-#endif /* CONFIG_BT_A2DP_ENABLE */
+#endif /* UC_BT_A2DP_ENABLED */
 
-#if CONFIG_BT_SPP_ENABLED
+#if (UC_BT_SPP_ENABLED == TRUE)
 #define RFCOMM_INCLUDED             TRUE
 #define BTA_JV_INCLUDED             TRUE
 #define BTC_SPP_INCLUDED            TRUE
-#endif /* CONFIG_BT_SPP_ENABLED */
+#endif /* UC_BT_SPP_ENABLED */
 
-#if CONFIG_BT_HFP_CLIENT_ENABLE
+#if (UC_BT_HFP_CLIENT_ENABLED == TRUE)
 #define BTC_HF_CLIENT_INCLUDED      TRUE
 #define BTA_HF_INCLUDED             TRUE
 #define PLC_INCLUDED                TRUE
 #ifndef BTM_MAX_SCO_LINKS
 #define BTM_MAX_SCO_LINKS           (1)
 #endif
+
 #ifndef SBC_DEC_INCLUDED
 #define SBC_DEC_INCLUDED            TRUE
 #endif
 #ifndef SBC_ENC_INCLUDED
 #define SBC_ENC_INCLUDED            TRUE
 #endif
-#endif  /* CONFIG_HFP_HF_ENABLE */
+#endif  /* UC_BT_HFP_CLIENT_ENABLED */
 
-#if CONFIG_BT_SSP_ENABLED
+#if UC_BT_SSP_ENABLED
 #define BT_SSP_INCLUDED             TRUE
-#endif /* CONFIG_BT_SSP_ENABLED */
+#endif /* UC_BT_SSP_ENABLED */
 
-#endif /* #if CONFIG_BT_CLASSIC_ENABLED */
+#endif /* UC_BT_CLASSIC_ENABLED */
 
 #ifndef CLASSIC_BT_INCLUDED
 #define CLASSIC_BT_INCLUDED         FALSE
 #endif /* CLASSIC_BT_INCLUDED */
 
-#ifndef CONFIG_BT_GATTC_CACHE_NVS_FLASH
-#define CONFIG_BT_GATTC_CACHE_NVS_FLASH         FALSE
-#endif /* CONFIG_BT_GATTC_CACHE_NVS_FLASH */
-
 /******************************************************************************
 **
 ** BLE features
 **
 ******************************************************************************/
-#if (CONFIG_BT_GATTS_ENABLE)
+#if (UC_BT_GATTS_ENABLE)
 #define GATTS_INCLUDED              TRUE
 #else
 #define GATTS_INCLUDED              FALSE
-#endif /* CONFIG_BT_GATTS_ENABLE */
+#endif /* UC_BT_GATTS_ENABLE */
 
-#if (CONFIG_BT_GATTC_ENABLE)
+#if (UC_BT_GATTC_ENABLE)
 #define GATTC_INCLUDED              TRUE
 #else
 #define GATTC_INCLUDED              FALSE
-#endif  /* CONFIG_BT_GATTC_ENABLE */
+#endif  /* UC_BT_GATTC_ENABLE */
 
-#if (CONFIG_BT_GATTC_ENABLE && CONFIG_BT_GATTC_CACHE_NVS_FLASH)
-#define GATTC_CACHE_NVS              TRUE
+#if (UC_BT_GATTC_ENABLE && UC_BT_GATTC_CACHE_NVS_FLASH_ENABLED)
+#define GATTC_CACHE_NVS             TRUE
 #else
-#define GATTC_CACHE_NVS              FALSE
-#endif  /* CONFIG_BT_GATTC_CACHE_NVS_FLASH */
+#define GATTC_CACHE_NVS             FALSE
+#endif  /* UC_BT_GATTC_ENABLE && UC_BT_GATTC_CACHE_NVS_FLASH_ENABLED */
 
-#if (CONFIG_BT_SMP_ENABLE)
-#define SMP_INCLUDED              TRUE
-#define BLE_PRIVACY_SPT           TRUE
+#if (UC_BT_SMP_ENABLE)
+#define SMP_INCLUDED                TRUE
+#define BLE_PRIVACY_SPT             TRUE
 #else
-#define SMP_INCLUDED              FALSE
-#define BLE_PRIVACY_SPT           FALSE
-#endif  /* CONFIG_BT_SMP_ENABLE */
+#define SMP_INCLUDED                FALSE
+#define BLE_PRIVACY_SPT             FALSE
+#endif  /* UC_BT_SMP_ENABLE */
 
-#ifdef CONFIG_BT_SMP_SLAVE_CON_PARAMS_UPD_ENABLE
-#if(CONFIG_BT_SMP_SLAVE_CON_PARAMS_UPD_ENABLE)
-#define SMP_SLAVE_CON_PARAMS_UPD_ENABLE  TRUE
-#else
-#define SMP_SLAVE_CON_PARAMS_UPD_ENABLE  FALSE
-#endif
+#if(UC_BT_SMP_SLAVE_CON_PARAMS_UPD_ENABLE)
+#define SMP_SLAVE_CON_PARAMS_UPD_ENABLE     TRUE
 #else
-#define SMP_SLAVE_CON_PARAMS_UPD_ENABLE  FALSE
-#endif
+#define SMP_SLAVE_CON_PARAMS_UPD_ENABLE     FALSE
+#endif /* UC_BT_SMP_SLAVE_CON_PARAMS_UPD_ENABLE */
 
-#ifndef CONFIG_BTDM_BLE_ADV_REPORT_FLOW_CTRL_SUPP
-#define BLE_ADV_REPORT_FLOW_CONTROL  FALSE
-#else
-#define BLE_ADV_REPORT_FLOW_CONTROL  CONFIG_BTDM_BLE_ADV_REPORT_FLOW_CTRL_SUPP
-#endif /* CONFIG_BTDM_BLE_ADV_REPORT_FLOW_CTRL_SUPP */
+#ifdef UC_BTDM_BLE_ADV_REPORT_FLOW_CTRL_SUPP
+#define BLE_ADV_REPORT_FLOW_CONTROL         UC_BTDM_BLE_ADV_REPORT_FLOW_CTRL_SUPP
+#endif /* UC_BTDM_BLE_ADV_REPORT_FLOW_CTRL_SUPP */
 
-#ifndef CONFIG_BTDM_BLE_ADV_REPORT_FLOW_CTRL_NUM
-#define BLE_ADV_REPORT_FLOW_CONTROL_NUM   100
-#else
-#define BLE_ADV_REPORT_FLOW_CONTROL_NUM     CONFIG_BTDM_BLE_ADV_REPORT_FLOW_CTRL_NUM
-#endif /* CONFIG_BTDM_BLE_ADV_REPORT_FLOW_CTRL_NUM */
+#ifdef UC_BTDM_BLE_ADV_REPORT_FLOW_CTRL_NUM
+#define BLE_ADV_REPORT_FLOW_CONTROL_NUM     UC_BTDM_BLE_ADV_REPORT_FLOW_CTRL_NUM
+#endif /* UC_BTDM_BLE_ADV_REPORT_FLOW_CTRL_NUM */
 
-#ifndef CONFIG_BTDM_BLE_ADV_REPORT_DISCARD_THRSHOLD
-#define BLE_ADV_REPORT_DISCARD_THRSHOLD  20
-#else
-#define BLE_ADV_REPORT_DISCARD_THRSHOLD  CONFIG_BTDM_BLE_ADV_REPORT_DISCARD_THRSHOLD
-#endif /* CONFIG_BTDM_BLE_ADV_REPORT_DISCARD_THRSHOLD */
+#ifdef UC_BTDM_BLE_ADV_REPORT_DISCARD_THRSHOLD
+#define BLE_ADV_REPORT_DISCARD_THRSHOLD     UC_BTDM_BLE_ADV_REPORT_DISCARD_THRSHOLD
+#endif /* UC_BTDM_BLE_ADV_REPORT_DISCARD_THRSHOLD */
 
-#if (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 */
+#ifdef UC_BT_ACL_CONNECTIONS
+#define MAX_ACL_CONNECTIONS         UC_BT_ACL_CONNECTIONS
+#define GATT_MAX_PHY_CHANNEL        UC_BT_ACL_CONNECTIONS
+#endif  /* UC_BT_ACL_CONNECTIONS */
 
-#if(CONFIG_BT_BLE_ESTAB_LINK_CONN_TOUT)
-#define BLE_ESTABLISH_LINK_CONNECTION_TIMEOUT CONFIG_BT_BLE_ESTAB_LINK_CONN_TOUT
-#else
-#define BLE_ESTABLISH_LINK_CONNECTION_TIMEOUT 30
+#ifdef UC_BT_BLE_ESTAB_LINK_CONN_TOUT
+#define BLE_ESTABLISH_LINK_CONNECTION_TIMEOUT UC_BT_BLE_ESTAB_LINK_CONN_TOUT
 #endif
 
 //------------------Added from bdroid_buildcfg.h---------------------
 #endif
 
 #ifndef BTA_AVRCP_FF_RW_SUPPORT
-#define BTA_AVRCP_FF_RW_SUPPORT FALSE//TRUE
+#define BTA_AVRCP_FF_RW_SUPPORT FALSE
 #endif
 
 #ifndef BTA_AG_SCO_PKT_TYPES
 #endif
 
 #ifndef BTA_AV_CO_CP_SCMS_T
-#define BTA_AV_CO_CP_SCMS_T  FALSE//FALSE
+#define BTA_AV_CO_CP_SCMS_T  FALSE
 #endif
 
 #ifndef QUEUE_CONGEST_SIZE
 #define  QUEUE_CONGEST_SIZE    40
 #endif
 
-#ifndef CONFIG_BT_BLE_HOST_QUEUE_CONG_CHECK
-#define SCAN_QUEUE_CONGEST_CHECK  FALSE
+#if UC_BT_BLE_HOST_QUEUE_CONGESTION_CHECK
+#define SCAN_QUEUE_CONGEST_CHECK  TRUE
 #else
-#define SCAN_QUEUE_CONGEST_CHECK  CONFIG_BT_BLE_HOST_QUEUE_CONG_CHECK
+#define SCAN_QUEUE_CONGEST_CHECK  FALSE
 #endif
 
-#ifndef CONFIG_BT_GATTS_SEND_SERVICE_CHANGE_MODE
-#define GATTS_SEND_SERVICE_CHANGE_MODE GATTS_SEND_SERVICE_CHANGE_AUTO
-#else
-#define GATTS_SEND_SERVICE_CHANGE_MODE CONFIG_BT_GATTS_SEND_SERVICE_CHANGE_MODE
+#ifdef UC_BT_GATTS_SEND_SERVICE_CHANGE_MODE
+#define GATTS_SEND_SERVICE_CHANGE_MODE UC_BT_GATTS_SEND_SERVICE_CHANGE_MODE
 #endif
 
-#ifndef CONFIG_BT_BLE_ACT_SCAN_REP_ADV_SCAN
-#define BTM_BLE_ACTIVE_SCAN_REPORT_ADV_SCAN_RSP_INDIVIDUALLY    FALSE
-#else
-#define BTM_BLE_ACTIVE_SCAN_REPORT_ADV_SCAN_RSP_INDIVIDUALLY    CONFIG_BT_BLE_ACT_SCAN_REP_ADV_SCAN
+#ifdef UC_BT_BLE_ACT_SCAN_REP_ADV_SCAN
+#define BTM_BLE_ACTIVE_SCAN_REPORT_ADV_SCAN_RSP_INDIVIDUALLY    UC_BT_BLE_ACT_SCAN_REP_ADV_SCAN
 #endif
 
 /* This feature is used to eanble interleaved scan*/
 #ifndef BTA_HOST_INTERLEAVE_SEARCH
-#define BTA_HOST_INTERLEAVE_SEARCH FALSE//FALSE
+#define BTA_HOST_INTERLEAVE_SEARCH FALSE
 #endif
 
 #ifndef BT_USE_TRACES
 #endif
 
 #ifndef BTIF_DM_OOB_TEST
-#define BTIF_DM_OOB_TEST  FALSE//TRUE
+#define BTIF_DM_OOB_TEST  FALSE
 #endif
 
 // How long to wait before activating sniff mode after entering the
 
 /* Includes SCO if TRUE */
 #ifndef BTM_SCO_HCI_INCLUDED
-#if CONFIG_BT_HFP_AUDIO_DATA_PATH_HCI
+#if UC_BT_HFP_AUDIO_DATA_PATH_HCI
 #define BTM_SCO_HCI_INCLUDED            TRUE       /* TRUE includes SCO over HCI code */
 #else
 #define BTM_SCO_HCI_INCLUDED            FALSE
-#endif /* CONFIG_BT_HFP_AUDIO_DATA_PATH_HCI */
+#endif /* UC_HFP_AUDIO_DATA_PATH_HCI */
 #endif
 
 /* Includes WBS if TRUE */
 #endif
 
 #ifndef ATT_DEBUG
-#define ATT_DEBUG           FALSE//TRUE
+#define ATT_DEBUG           FALSE
 #endif
 
 #ifndef BLE_PERIPHERAL_MODE_SUPPORT
@@ -1537,12 +1518,12 @@ Range: 2 octets
 ******************************************************************************/
 
 #ifndef BNEP_INCLUDED
-#define BNEP_INCLUDED               FALSE//TRUE
+#define BNEP_INCLUDED               FALSE
 #endif
 
 /* BNEP status API call is used mainly to get the L2CAP handle */
 #ifndef BNEP_SUPPORTS_STATUS_API
-#define BNEP_SUPPORTS_STATUS_API            FALSE//TRUE
+#define BNEP_SUPPORTS_STATUS_API            FALSE
 #endif
 
 /*
@@ -1550,7 +1531,7 @@ Range: 2 octets
 ** we will do an authentication check again on the new role
 */
 #ifndef BNEP_DO_AUTH_FOR_ROLE_SWITCH
-#define BNEP_DO_AUTH_FOR_ROLE_SWITCH        FALSE//TRUE
+#define BNEP_DO_AUTH_FOR_ROLE_SWITCH        FALSE
 #endif
 
 
@@ -1663,22 +1644,22 @@ Range: 2 octets
 
 /* This will enable the PANU role */
 #ifndef PAN_SUPPORTS_ROLE_PANU
-#define PAN_SUPPORTS_ROLE_PANU              FALSE//TRUE
+#define PAN_SUPPORTS_ROLE_PANU              FALSE
 #endif
 
 /* This will enable the GN role */
 #ifndef PAN_SUPPORTS_ROLE_GN
-#define PAN_SUPPORTS_ROLE_GN                FALSE//TRUE
+#define PAN_SUPPORTS_ROLE_GN                FALSE
 #endif
 
 /* This will enable the NAP role */
 #ifndef PAN_SUPPORTS_ROLE_NAP
-#define PAN_SUPPORTS_ROLE_NAP               FALSE//TRUE
+#define PAN_SUPPORTS_ROLE_NAP               FALSE
 #endif
 
 /* This is just for debugging purposes */
 #ifndef PAN_SUPPORTS_DEBUG_DUMP
-#define PAN_SUPPORTS_DEBUG_DUMP             FALSE//TRUE
+#define PAN_SUPPORTS_DEBUG_DUMP             FALSE
 #endif
 
 /* Maximum number of PAN connections allowed */
@@ -2000,7 +1981,7 @@ The maximum number of payload octets that the local device can receive in a sing
 ******************************************************************************/
 
 #ifndef HCILP_INCLUDED
-#define HCILP_INCLUDED                  FALSE//TRUE
+#define HCILP_INCLUDED                  FALSE
 #endif
 
 /******************************************************************************
@@ -2042,7 +2023,7 @@ The maximum number of payload octets that the local device can receive in a sing
 #endif
 
 #ifndef BTA_DM_AVOID_A2DP_ROLESWITCH_ON_INQUIRY
-#define BTA_DM_AVOID_A2DP_ROLESWITCH_ON_INQUIRY FALSE//TRUE
+#define BTA_DM_AVOID_A2DP_ROLESWITCH_ON_INQUIRY FALSE
 #endif
 
 /******************************************************************************
@@ -2053,7 +2034,25 @@ The maximum number of payload octets that the local device can receive in a sing
 
 /* Enable/disable BTSnoop memory logging */
 #ifndef BTSNOOP_MEM
-#define BTSNOOP_MEM FALSE//TRUE
+#define BTSNOOP_MEM FALSE
+#endif
+
+#if UC_BT_BLUEDROID_MEM_DEBUG
+#define HEAP_MEMORY_DEBUG   TRUE
+#else
+#define HEAP_MEMORY_DEBUG   FALSE
+#endif
+
+#if UC_HEAP_ALLOCATION_FROM_SPIRAM_FIRST
+#define HEAP_ALLOCATION_FROM_SPIRAM_FIRST TRUE
+#else
+#define HEAP_ALLOCATION_FROM_SPIRAM_FIRST FALSE
+#endif
+
+#if UC_BT_BLE_DYNAMIC_ENV_MEMORY
+#define BT_BLE_DYNAMIC_ENV_MEMORY   TRUE
+#else
+#define BT_BLE_DYNAMIC_ENV_MEMORY   FALSE
 #endif
 
 #include "common/bt_trace.h"
index a0dbf9bc729d108abb2f6e34ea85c10c6306369b..920cfa7134ad9451a07d28dde0cf17e90a32babd 100644 (file)
 #ifndef _BT_TRACE_H_
 #define _BT_TRACE_H_
 
-#include "sdkconfig.h"
-
 #include <assert.h>
 #include <stdio.h>
+#include "bt_user_config.h"
 #include "stack/bt_types.h"
 
 #ifndef LOG_LOCAL_LEVEL
 #ifndef BOOTLOADER_BUILD
-#define LOG_LOCAL_LEVEL  CONFIG_LOG_DEFAULT_LEVEL
+#define LOG_LOCAL_LEVEL  UC_LOG_DEFAULT_LEVEL
 #else
-#define LOG_LOCAL_LEVEL  CONFIG_BOOTLOADER_LOG_LEVEL
+#define LOG_LOCAL_LEVEL  UC_BOOTLOADER_LOG_LEVEL
 #endif
 #endif
 
@@ -217,135 +216,31 @@ inline void trc_dump_buffer(const char *prefix, uint8_t *data, uint16_t len)
 
 // btla-specific ++
 /* Core Stack default trace levels */
-#ifdef  CONFIG_BT_LOG_HCI_TRACE_LEVEL
-#define HCI_INITIAL_TRACE_LEVEL             CONFIG_BT_LOG_HCI_TRACE_LEVEL
-#else
-#define HCI_INITIAL_TRACE_LEVEL             BT_TRACE_LEVEL_WARNING
-#endif
-
-#ifdef  CONFIG_BT_LOG_BTM_TRACE_LEVEL
-#define BTM_INITIAL_TRACE_LEVEL             CONFIG_BT_LOG_BTM_TRACE_LEVEL
-#else
-#define BTM_INITIAL_TRACE_LEVEL             BT_TRACE_LEVEL_WARNING
-#endif
-
-#ifdef  CONFIG_BT_LOG_L2CAP_TRACE_LEVEL
-#define L2CAP_INITIAL_TRACE_LEVEL           CONFIG_BT_LOG_L2CAP_TRACE_LEVEL
-#else
-#define L2CAP_INITIAL_TRACE_LEVEL           BT_TRACE_LEVEL_WARNING
-#endif
-
-#ifdef  CONFIG_BT_LOG_RFCOMM_TRACE_LEVEL
-#define RFCOMM_INITIAL_TRACE_LEVEL          CONFIG_BT_LOG_RFCOMM_TRACE_LEVEL
-#else
-#define RFCOMM_INITIAL_TRACE_LEVEL          BT_TRACE_LEVEL_WARNING
-#endif
-
-#ifdef  CONFIG_SDP_INITIAL_TRACE_LEVEL
-#define SDP_INITIAL_TRACE_LEVEL             CONFIG_SDP_INITIAL_TRACE_LEVEL
-#else
-#define SDP_INITIAL_TRACE_LEVEL             BT_TRACE_LEVEL_WARNING
-#endif
-
-#ifdef  CONFIG_BT_LOG_GAP_TRACE_LEVEL
-#define GAP_INITIAL_TRACE_LEVEL             CONFIG_BT_LOG_GAP_TRACE_LEVEL
-#else
-#define GAP_INITIAL_TRACE_LEVEL             BT_TRACE_LEVEL_WARNING
-#endif
-
-#ifdef  CONFIG_BT_LOG_BNEP_TRACE_LEVEL
-#define BNEP_INITIAL_TRACE_LEVEL            CONFIG_BT_LOG_BNEP_TRACE_LEVEL
-#else
-#define BNEP_INITIAL_TRACE_LEVEL            BT_TRACE_LEVEL_WARNING
-#endif
-
-#ifdef  CONFIG_BT_LOG_PAN_TRACE_LEVEL
-#define PAN_INITIAL_TRACE_LEVEL             CONFIG_BT_LOG_PAN_TRACE_LEVEL
-#else
-#define PAN_INITIAL_TRACE_LEVEL             BT_TRACE_LEVEL_WARNING
-#endif
-
-#ifdef  CONFIG_BT_LOG_A2D_TRACE_LEVEL
-#define A2D_INITIAL_TRACE_LEVEL             CONFIG_BT_LOG_A2D_TRACE_LEVEL
-#else
-#define A2D_INITIAL_TRACE_LEVEL             BT_TRACE_LEVEL_WARNING
-#endif
-
-#ifdef  CONFIG_BT_LOG_AVDT_TRACE_LEVEL
-#define AVDT_INITIAL_TRACE_LEVEL            CONFIG_BT_LOG_AVDT_TRACE_LEVEL
-#else
-#define AVDT_INITIAL_TRACE_LEVEL            BT_TRACE_LEVEL_WARNING
-#endif
-
-#ifdef  CONFIG_BT_LOG_AVCT_TRACE_LEVEL
-#define AVCT_INITIAL_TRACE_LEVEL            CONFIG_BT_LOG_AVCT_TRACE_LEVEL
-#else
-#define AVCT_INITIAL_TRACE_LEVEL            BT_TRACE_LEVEL_WARNING
-#endif
-
-#ifdef  CONFIG_BT_LOG_AVRC_TRACE_LEVEL
-#define AVRC_INITIAL_TRACE_LEVEL            CONFIG_BT_LOG_AVRC_TRACE_LEVEL
-#else
-#define AVRC_INITIAL_TRACE_LEVEL            BT_TRACE_LEVEL_WARNING
-#endif
-
-#ifdef  CONFIG_BT_LOG_MCA_TRACE_LEVEL
-#define MCA_INITIAL_TRACE_LEVEL             CONFIG_BT_LOG_MCA_TRACE_LEVEL
-#else
-#define MCA_INITIAL_TRACE_LEVEL             BT_TRACE_LEVEL_WARNING
-#endif
-
-#ifdef  CONFIG_BT_LOG_HID_TRACE_LEVEL
-#define HID_INITIAL_TRACE_LEVEL             CONFIG_BT_LOG_HID_TRACE_LEVEL
-#else
-#define HID_INITIAL_TRACE_LEVEL             BT_TRACE_LEVEL_WARNING
-#endif
-
-#ifdef  CONFIG_BT_LOG_APPL_TRACE_LEVEL
-#define APPL_INITIAL_TRACE_LEVEL            CONFIG_BT_LOG_APPL_TRACE_LEVEL
-#else
-#define APPL_INITIAL_TRACE_LEVEL            BT_TRACE_LEVEL_WARNING
-#endif
-
-#ifdef  CONFIG_BT_LOG_GATT_TRACE_LEVEL
-#define GATT_INITIAL_TRACE_LEVEL            CONFIG_BT_LOG_GATT_TRACE_LEVEL
-#else
-#define GATT_INITIAL_TRACE_LEVEL            BT_TRACE_LEVEL_WARNING
-#endif
-
-#ifdef  CONFIG_BT_LOG_SMP_TRACE_LEVEL
-#define SMP_INITIAL_TRACE_LEVEL             CONFIG_BT_LOG_SMP_TRACE_LEVEL
-#else
-#define SMP_INITIAL_TRACE_LEVEL             BT_TRACE_LEVEL_WARNING
-#endif
-
-#ifdef  CONFIG_BT_LOG_BTIF_TRACE_LEVEL
-#define BTIF_INITIAL_TRACE_LEVEL            CONFIG_BT_LOG_BTIF_TRACE_LEVEL
-#else
-#define BTIF_INITIAL_TRACE_LEVEL            BT_TRACE_LEVEL_WARNING
-#endif
-
-#ifdef  CONFIG_BT_LOG_BTC_TRACE_LEVEL
-#define BTC_INITIAL_TRACE_LEVEL             CONFIG_BT_LOG_BTC_TRACE_LEVEL
-#else
-#define BTC_INITIAL_TRACE_LEVEL             BT_TRACE_LEVEL_WARNING
-#endif
-
-#ifdef  CONFIG_BT_LOG_OSI_TRACE_LEVEL
-#define OSI_INITIAL_TRACE_LEVEL            CONFIG_BT_LOG_OSI_TRACE_LEVEL
-#else
-#define OSI_INITIAL_TRACE_LEVEL            BT_TRACE_LEVEL_WARNING
-#endif
-
-#ifdef  CONFIG_BT_LOG_BLUFI_TRACE_LEVEL
-#define BLUFI_INITIAL_TRACE_LEVEL            CONFIG_BT_LOG_BLUFI_TRACE_LEVEL
-#else
-#define BLUFI_INITIAL_TRACE_LEVEL            BT_TRACE_LEVEL_WARNING
-#endif
+#define HCI_INITIAL_TRACE_LEVEL             UC_BT_LOG_HCI_TRACE_LEVEL
+#define BTM_INITIAL_TRACE_LEVEL             UC_BT_LOG_BTM_TRACE_LEVEL
+#define L2CAP_INITIAL_TRACE_LEVEL           UC_BT_LOG_L2CAP_TRACE_LEVEL
+#define RFCOMM_INITIAL_TRACE_LEVEL          UC_BT_LOG_RFCOMM_TRACE_LEVEL
+#define SDP_INITIAL_TRACE_LEVEL             UC_BT_LOG_SDP_TRACE_LEVEL
+#define GAP_INITIAL_TRACE_LEVEL             UC_BT_LOG_GAP_TRACE_LEVEL
+#define BNEP_INITIAL_TRACE_LEVEL            UC_BT_LOG_BNEP_TRACE_LEVEL
+#define PAN_INITIAL_TRACE_LEVEL             UC_BT_LOG_PAN_TRACE_LEVEL
+#define A2D_INITIAL_TRACE_LEVEL             UC_BT_LOG_A2D_TRACE_LEVEL
+#define AVDT_INITIAL_TRACE_LEVEL            UC_BT_LOG_AVDT_TRACE_LEVEL
+#define AVCT_INITIAL_TRACE_LEVEL            UC_BT_LOG_AVCT_TRACE_LEVEL
+#define AVRC_INITIAL_TRACE_LEVEL            UC_BT_LOG_AVRC_TRACE_LEVEL
+#define MCA_INITIAL_TRACE_LEVEL             UC_BT_LOG_MCA_TRACE_LEVEL
+#define HID_INITIAL_TRACE_LEVEL             UC_BT_LOG_HID_TRACE_LEVEL
+#define APPL_INITIAL_TRACE_LEVEL            UC_BT_LOG_APPL_TRACE_LEVEL
+#define GATT_INITIAL_TRACE_LEVEL            UC_BT_LOG_GATT_TRACE_LEVEL
+#define SMP_INITIAL_TRACE_LEVEL             UC_BT_LOG_SMP_TRACE_LEVEL
+#define BTIF_INITIAL_TRACE_LEVEL            UC_BT_LOG_BTIF_TRACE_LEVEL
+#define BTC_INITIAL_TRACE_LEVEL             UC_BT_LOG_BTC_TRACE_LEVEL
+#define OSI_INITIAL_TRACE_LEVEL             UC_BT_LOG_OSI_TRACE_LEVEL
+#define BLUFI_INITIAL_TRACE_LEVEL           UC_BT_LOG_BLUFI_TRACE_LEVEL
 
 // btla-specific --
 
-#if !CONFIG_BT_STACK_NO_LOG
+#if !UC_BT_STACK_NO_LOG
 #define LOG_ERROR(format, ... )             {if (LOG_LOCAL_LEVEL >= ESP_LOG_ERROR)    esp_log_write(ESP_LOG_ERROR,   "BT_LOG", LOG_FORMAT(E, format), esp_log_timestamp(), "BT_LOG", ##__VA_ARGS__); }
 #define LOG_WARN(format, ... )              {if (LOG_LOCAL_LEVEL >= ESP_LOG_WARN)     esp_log_write(ESP_LOG_WARN,    "BT_LOG", LOG_FORMAT(W, format), esp_log_timestamp(), "BT_LOG", ##__VA_ARGS__); }
 #define LOG_INFO(format, ... )              {if (LOG_LOCAL_LEVEL >= ESP_LOG_INFO)     esp_log_write(ESP_LOG_INFO,    "BT_LOG", LOG_FORMAT(I, format), esp_log_timestamp(), "BT_LOG", ##__VA_ARGS__); }
@@ -695,7 +590,7 @@ extern UINT8 btif_trace_level;
 #define BLUFI_TRACE_EVENT(fmt, args...)
 #define BLUFI_TRACE_DEBUG(fmt, args...)
 #define BLUFI_TRACE_VERBOSE(fmt, args...)
-#endif  ///CONFIG_BT_STACK_NO_LOG
+#endif  ///!UC_BT_STACK_NO_LOG
 
 
 /* Simplified Trace Helper Macro
diff --git a/components/bt/bluedroid/common/include/common/bt_user_config.h b/components/bt/bluedroid/common/include/common/bt_user_config.h
new file mode 100644 (file)
index 0000000..10568fb
--- /dev/null
@@ -0,0 +1,372 @@
+// Copyright 2015-2016 Espressif Systems (Shanghai) PTE LTD
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+
+//     http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+#ifndef __BT_USER_CONFIG_H__
+#define __BT_USER_CONFIG_H__
+
+
+
+
+/* All the configuration from SDK defined here */
+
+#include "sdkconfig.h"
+#include "esp_task.h"
+
+
+/**********************************************************
+ * Thread/Task reference
+ **********************************************************/
+#ifdef CONFIG_BLUEDROID_PINNED_TO_CORE
+#define UC_TASK_PINNED_TO_CORE              (CONFIG_BLUEDROID_PINNED_TO_CORE < portNUM_PROCESSORS ? CONFIG_BLUEDROID_PINNED_TO_CORE : tskNO_AFFINITY)
+#else
+#define UC_TASK_PINNED_TO_CORE              (0)
+#endif
+
+#ifdef CONFIG_BTC_TASK_STACK_SIZE
+#define UC_BTC_TASK_STACK_SIZE              CONFIG_BTC_TASK_STACK_SIZE
+#else
+#define UC_BTC_TASK_STACK_SIZE              3072
+#endif
+
+#ifdef CONFIG_A2DP_SINK_TASK_STACK_SIZE
+#define UC_A2DP_SINK_TASK_STACK_SIZE        CONFIG_A2DP_SINK_TASK_STACK_SIZE
+#else
+#define UC_A2DP_SINK_TASK_STACK_SIZE        2048
+#endif
+#ifdef CONFIG_A2DP_SOURCE_TASK_STACK_SIZE
+#define UC_A2DP_SOURCE_TASK_STACK_SIZE      CONFIG_A2DP_SOURCE_TASK_STACK_SIZE
+#else
+#define UC_A2DP_SOURCE_TASK_STACK_SIZE      2048
+#endif
+
+/**********************************************************
+ * Profile reference
+ **********************************************************/
+//Classic BT reference
+#ifdef CONFIG_BT_CLASSIC_ENABLED
+#define UC_BT_CLASSIC_ENABLED               CONFIG_BT_CLASSIC_ENABLED
+#else
+#define UC_BT_CLASSIC_ENABLED               FALSE
+#endif
+
+//A2DP
+#ifdef CONFIG_BT_A2DP_ENABLE
+#define UC_BT_A2DP_ENABLED                  CONFIG_BT_A2DP_ENABLE
+#else
+#define UC_BT_A2DP_ENABLED                  FALSE
+#endif
+
+//SPP
+#ifdef CONFIG_BT_SPP_ENABLED
+#define UC_BT_SPP_ENABLED                   CONFIG_BT_SPP_ENABLED
+#else
+#define UC_BT_SPP_ENABLED                   FALSE
+#endif
+
+//HFP
+#ifdef CONFIG_BT_HFP_CLIENT_ENABLE
+#define UC_BT_HFP_CLIENT_ENABLED            CONFIG_BT_HFP_CLIENT_ENABLE
+#else
+#define UC_BT_HFP_CLIENT_ENABLED            FALSE
+#endif
+
+//SSP
+#ifdef CONFIG_BT_SSP_ENABLED
+#define UC_BT_SSP_ENABLED                   CONFIG_BT_SSP_ENABLED
+#else
+#define UC_BT_SSP_ENABLED                   FALSE
+#endif
+
+//GATTS
+#ifdef CONFIG_BT_GATTS_ENABLE
+#define UC_BT_GATTS_ENABLED                 CONFIG_BT_GATTS_ENABLE
+#else
+#define UC_BT_GATTS_ENABLED                 FALSE
+#endif
+
+//GATTC
+#ifdef CONFIG_BT_GATTC_ENABLE
+#define UC_BT_GATTC_ENABLED                 CONFIG_BT_GATTC_ENABLE
+#else
+#define UC_BT_GATTC_ENABLED                 FALSE
+#endif
+
+//GATTC CACHE
+#ifdef CONFIG_BT_GATTC_CACHE_NVS_FLASH
+#define UC_BT_GATTC_CACHE_NVS_FLASH_ENABLED    CONFIG_BT_GATTC_CACHE_NVS_FLASH
+#else
+#define UC_BT_GATTC_CACHE_NVS_FLASH_ENABLED    FALSE
+#endif
+
+//SMP
+#ifdef CONFIG_BT_SMP_ENABLE
+#define UC_BT_SMP_ENABLED                      CONFIG_BT_SMP_ENABLE
+#else
+#define UC_BT_SMP_ENABLED                      FALSE
+#endif
+
+//SMP_SLAVE_CON_PARAMS_UPD_ENABLE
+#ifdef CONFIG_BT_SMP_SLAVE_CON_PARAMS_UPD_ENABLE
+#define UC_BT_SMP_SLAVE_CON_PARAMS_UPD_ENABLE  CONFIG_BT_SMP_SLAVE_CON_PARAMS_UPD_ENABLE
+#else
+#define UC_BT_SMP_SLAVE_CON_PARAMS_UPD_ENABLE  FALSE
+#endif
+
+//BTDM_BLE_ADV_REPORT_FLOW_CTRL_SUPP
+#ifdef CONFIG_BTDM_BLE_ADV_REPORT_FLOW_CTRL_SUPP
+#define UC_BTDM_BLE_ADV_REPORT_FLOW_CTRL_SUPP  CONFIG_BTDM_BLE_ADV_REPORT_FLOW_CTRL_SUPP
+#else
+#define UC_BTDM_BLE_ADV_REPORT_FLOW_CTRL_SUPP  FALSE
+#endif
+
+//SMP_SLAVE_CON_PARAMS_UPD_ENABLE
+#ifdef CONFIG_BTDM_BLE_ADV_REPORT_FLOW_CTRL_NUM
+#define UC_BTDM_BLE_ADV_REPORT_FLOW_CTRL_NUM   CONFIG_BTDM_BLE_ADV_REPORT_FLOW_CTRL_NUM
+#else
+#define UC_BTDM_BLE_ADV_REPORT_FLOW_CTRL_NUM   100
+#endif
+
+//BTDM_BLE_ADV_REPORT_FLOW_CTRL_SUPP
+#ifdef CONFIG_BTDM_BLE_ADV_REPORT_DISCARD_THRSHOLD
+#define UC_BTDM_BLE_ADV_REPORT_DISCARD_THRSHOLD     CONFIG_BTDM_BLE_ADV_REPORT_DISCARD_THRSHOLD
+#else
+#define UC_BTDM_BLE_ADV_REPORT_DISCARD_THRSHOLD     20
+#endif
+
+//BT ACL CONNECTIONS
+#ifdef CONFIG_BT_ACL_CONNECTIONS
+#define UC_BT_ACL_CONNECTIONS                   CONFIG_BT_ACL_CONNECTIONS
+#else
+#define UC_BT_ACL_CONNECTIONS                   5
+#endif
+
+//BT_BLE_ESTAB_LINK_CONN_TOUT
+#ifdef CONFIG_BT_BLE_ESTAB_LINK_CONN_TOUT
+#define UC_BT_BLE_ESTAB_LINK_CONN_TOUT          CONFIG_BT_BLE_ESTAB_LINK_CONN_TOUT
+#else
+#define UC_BT_BLE_ESTAB_LINK_CONN_TOUT          30
+#endif
+
+
+//HOST QUEUE CONGEST CHECK
+#ifdef CONFIG_BT_BLE_HOST_QUEUE_CONGESTION_CHECK
+#define UC_BT_BLE_HOST_QUEUE_CONGESTION_CHECK   CONFIG_BT_BLE_HOST_QUEUE_CONGESTION_CHECK
+#else
+#define UC_BT_BLE_HOST_QUEUE_CONGESTION_CHECK   FALSE
+#endif
+
+#ifdef CONFIG_BT_GATTS_SEND_SERVICE_CHANGE_MODE
+#define UC_BT_GATTS_SEND_SERVICE_CHANGE_MODE    CONFIG_BT_GATTS_SEND_SERVICE_CHANGE_MODE
+#else
+#define UC_BT_GATTS_SEND_SERVICE_CHANGE_MODE    0
+#endif
+
+#ifdef CONFIG_BT_BLE_ACT_SCAN_REP_ADV_SCAN
+#define UC_BT_BLE_ACT_SCAN_REP_ADV_SCAN         CONFIG_BT_BLE_ACT_SCAN_REP_ADV_SCAN
+#else
+#define UC_BT_BLE_ACT_SCAN_REP_ADV_SCAN         FALSE
+#endif
+
+//SCO VOICE OVER HCI
+#ifdef CONFIG_BT_HFP_AUDIO_DATA_PATH_HCI
+#define UC_BT_HFP_AUDIO_DATA_PATH_HCI           CONFIG_BT_HFP_AUDIO_DATA_PATH_HCI
+#else
+#define UC_BT_HFP_AUDIO_DATA_PATH_HCI           FALSE
+#endif
+
+
+/**********************************************************
+ * Memory reference
+ **********************************************************/
+//DYNAMIC ENV ALLOCATOR
+#ifdef CONFIG_BT_BLE_DYNAMIC_ENV_MEMORY
+#define UC_BT_BLE_DYNAMIC_ENV_MEMORY            CONFIG_BT_BLE_DYNAMIC_ENV_MEMORY
+#else
+#define UC_BT_BLE_DYNAMIC_ENV_MEMORY            FALSE
+#endif
+
+//MEMORY ALLOCATOR
+#ifdef CONFIG_BT_ALLOCATION_FROM_SPIRAM_FIRST
+#define UC_HEAP_ALLOCATION_FROM_SPIRAM_FIRST    CONFIG_BT_ALLOCATION_FROM_SPIRAM_FIRST
+#else
+#define UC_HEAP_ALLOCATION_FROM_SPIRAM_FIRST    FALSE
+#endif
+
+//MEMORY DEBUG
+#ifdef CONFIG_BT_BLUEDROID_MEM_DEBUG
+#define UC_BT_BLUEDROID_MEM_DEBUG               CONFIG_BT_BLUEDROID_MEM_DEBUG
+#else
+#define UC_BT_BLUEDROID_MEM_DEBUG               FALSE
+#endif
+
+
+/**********************************************************
+ * Trace reference
+ **********************************************************/
+#ifdef CONFIG_LOG_DEFAULT_LEVEL
+#define UC_LOG_DEFAULT_LEVEL                CONFIG_LOG_DEFAULT_LEVEL
+#else
+#define UC_LOG_DEFAULT_LEVEL                3
+#endif
+#ifdef CONFIG_BOOTLOADER_LOG_LEVEL
+#define UC_BOOTLOADER_LOG_LEVEL             CONFIG_BOOTLOADER_LOG_LEVEL
+#else
+#define UC_BOOTLOADER_LOG_LEVEL             3
+#endif
+
+#ifdef CONFIG_BT_STACK_NO_LOG
+#define UC_BT_STACK_NO_LOG                  CONFIG_BT_STACK_NO_LOG
+#else
+#define UC_BT_STACK_NO_LOG                  FALSE
+#endif
+
+#define UC_TRACE_LEVEL_NONE                 0          /* No trace messages to be generated    */
+#define UC_TRACE_LEVEL_ERROR                1          /* Error condition trace messages       */
+#define UC_TRACE_LEVEL_WARNING              2          /* Warning condition trace messages     */
+#define UC_TRACE_LEVEL_API                  3          /* API traces                           */
+#define UC_TRACE_LEVEL_EVENT                4          /* Debug messages for events            */
+#define UC_TRACE_LEVEL_DEBUG                5          /* Full debug messages                  */
+#define UC_TRACE_LEVEL_VERBOSE              6          /* Verbose debug messages               */
+
+#ifdef CONFIG_BT_LOG_HCI_TRACE_LEVEL
+#define UC_BT_LOG_HCI_TRACE_LEVEL           CONFIG_BT_LOG_HCI_TRACE_LEVEL
+#else
+#define UC_BT_LOG_HCI_TRACE_LEVEL           UC_TRACE_LEVEL_WARNING
+#endif
+
+#ifdef CONFIG_BT_LOG_BTM_TRACE_LEVEL
+#define UC_BT_LOG_BTM_TRACE_LEVEL           CONFIG_BT_LOG_BTM_TRACE_LEVEL
+#else
+#define UC_BT_LOG_BTM_TRACE_LEVEL           UC_TRACE_LEVEL_WARNING
+#endif
+
+#ifdef CONFIG_BT_LOG_L2CAP_TRACE_LEVEL
+#define UC_BT_LOG_L2CAP_TRACE_LEVEL         CONFIG_BT_LOG_L2CAP_TRACE_LEVEL
+#else
+#define UC_BT_LOG_L2CAP_TRACE_LEVEL         UC_TRACE_LEVEL_WARNING
+#endif
+
+#ifdef CONFIG_BT_LOG_RFCOMM_TRACE_LEVEL
+#define UC_BT_LOG_RFCOMM_TRACE_LEVEL        CONFIG_BT_LOG_RFCOMM_TRACE_LEVEL
+#else
+#define UC_BT_LOG_RFCOMM_TRACE_LEVEL        UC_TRACE_LEVEL_WARNING
+#endif
+
+#ifdef CONFIG_BT_LOG_SDP_TRACE_LEVEL
+#define UC_BT_LOG_SDP_TRACE_LEVEL           CONFIG_BT_LOG_SDP_TRACE_LEVEL
+#else
+#define UC_BT_LOG_SDP_TRACE_LEVEL           UC_TRACE_LEVEL_WARNING
+#endif
+
+#ifdef CONFIG_BT_LOG_GAP_TRACE_LEVEL
+#define UC_BT_LOG_GAP_TRACE_LEVEL           CONFIG_BT_LOG_GAP_TRACE_LEVEL
+#else
+#define UC_BT_LOG_GAP_TRACE_LEVEL           UC_TRACE_LEVEL_WARNING
+#endif
+
+#ifdef CONFIG_BT_LOG_BNEP_TRACE_LEVEL
+#define UC_BT_LOG_BNEP_TRACE_LEVEL          CONFIG_BT_LOG_BNEP_TRACE_LEVEL
+#else
+#define UC_BT_LOG_BNEP_TRACE_LEVEL          UC_TRACE_LEVEL_WARNING
+#endif
+
+#ifdef CONFIG_BT_LOG_PAN_TRACE_LEVEL
+#define UC_BT_LOG_PAN_TRACE_LEVEL           CONFIG_BT_LOG_PAN_TRACE_LEVEL
+#else
+#define UC_BT_LOG_PAN_TRACE_LEVEL           UC_TRACE_LEVEL_WARNING
+#endif
+
+#ifdef CONFIG_BT_LOG_A2D_TRACE_LEVEL
+#define UC_BT_LOG_A2D_TRACE_LEVEL           CONFIG_BT_LOG_A2D_TRACE_LEVEL
+#else
+#define UC_BT_LOG_A2D_TRACE_LEVEL           UC_TRACE_LEVEL_WARNING
+#endif
+
+#ifdef CONFIG_BT_LOG_AVDT_TRACE_LEVEL
+#define UC_BT_LOG_AVDT_TRACE_LEVEL          CONFIG_BT_LOG_AVDT_TRACE_LEVEL
+#else
+#define UC_BT_LOG_AVDT_TRACE_LEVEL          UC_TRACE_LEVEL_WARNING
+#endif
+
+#ifdef CONFIG_BT_LOG_AVCT_TRACE_LEVEL
+#define UC_BT_LOG_AVCT_TRACE_LEVEL          CONFIG_BT_LOG_AVCT_TRACE_LEVEL
+#else
+#define UC_BT_LOG_AVCT_TRACE_LEVEL          UC_TRACE_LEVEL_WARNING
+#endif
+
+#ifdef CONFIG_BT_LOG_AVRC_TRACE_LEVEL
+#define UC_BT_LOG_AVRC_TRACE_LEVEL          CONFIG_BT_LOG_AVRC_TRACE_LEVEL
+#else
+#define UC_BT_LOG_AVRC_TRACE_LEVEL          UC_TRACE_LEVEL_WARNING
+#endif
+
+#ifdef CONFIG_BT_LOG_MCA_TRACE_LEVEL
+#define UC_BT_LOG_MCA_TRACE_LEVEL           CONFIG_BT_LOG_MCA_TRACE_LEVEL
+#else
+#define UC_BT_LOG_MCA_TRACE_LEVEL           UC_TRACE_LEVEL_WARNING
+#endif
+
+#ifdef CONFIG_BT_LOG_HID_TRACE_LEVEL
+#define UC_BT_LOG_HID_TRACE_LEVEL           CONFIG_BT_LOG_HID_TRACE_LEVEL
+#else
+#define UC_BT_LOG_HID_TRACE_LEVEL           UC_TRACE_LEVEL_WARNING
+#endif
+
+#ifdef CONFIG_BT_LOG_APPL_TRACE_LEVEL
+#define UC_BT_LOG_APPL_TRACE_LEVEL          CONFIG_BT_LOG_APPL_TRACE_LEVEL
+#else
+#define UC_BT_LOG_APPL_TRACE_LEVEL          UC_TRACE_LEVEL_WARNING
+#endif
+
+#ifdef CONFIG_BT_LOG_GATT_TRACE_LEVEL
+#define UC_BT_LOG_GATT_TRACE_LEVEL          CONFIG_BT_LOG_GATT_TRACE_LEVEL
+#else
+#define UC_BT_LOG_GATT_TRACE_LEVEL          UC_TRACE_LEVEL_WARNING
+#endif
+
+#ifdef CONFIG_BT_LOG_SMP_TRACE_LEVEL
+#define UC_BT_LOG_SMP_TRACE_LEVEL           CONFIG_BT_LOG_SMP_TRACE_LEVEL
+#else
+#define UC_BT_LOG_SMP_TRACE_LEVEL           UC_TRACE_LEVEL_WARNING
+#endif
+
+#ifdef CONFIG_BT_LOG_BTIF_TRACE_LEVEL
+#define UC_BT_LOG_BTIF_TRACE_LEVEL          CONFIG_BT_LOG_BTIF_TRACE_LEVEL
+#else
+#define UC_BT_LOG_BTIF_TRACE_LEVEL          UC_TRACE_LEVEL_WARNING
+#endif
+
+#ifdef CONFIG_BT_LOG_BTC_TRACE_LEVEL
+#define UC_BT_LOG_BTC_TRACE_LEVEL           CONFIG_BT_LOG_BTC_TRACE_LEVEL
+#else
+#define UC_BT_LOG_BTC_TRACE_LEVEL           UC_TRACE_LEVEL_WARNING
+#endif
+
+#ifdef CONFIG_BT_LOG_OSI_TRACE_LEVEL
+#define UC_BT_LOG_OSI_TRACE_LEVEL           CONFIG_BT_LOG_OSI_TRACE_LEVEL
+#else
+#define UC_BT_LOG_OSI_TRACE_LEVEL           UC_TRACE_LEVEL_WARNING
+#endif
+
+#ifdef CONFIG_BT_LOG_BLUFI_TRACE_LEVEL
+#define UC_BT_LOG_BLUFI_TRACE_LEVEL         CONFIG_BT_LOG_BLUFI_TRACE_LEVEL
+#else
+#define UC_BT_LOG_BLUFI_TRACE_LEVEL         UC_TRACE_LEVEL_WARNING
+#endif
+
+
+#endif /* __BT_USER_CONFIG_H__ */
+
+
+
index 4189aa2fe55f86b416b6a3d99e107133c9dd0fec..b31deda79cf5f71c51836e8f8460849615e0230f 100644 (file)
@@ -29,9 +29,8 @@
 
 #define HCI_H4_TASK_PINNED_TO_CORE      (TASK_PINNED_TO_CORE)
 #define HCI_H4_TASK_STACK_SIZE          (2048 + BT_TASK_EXTRA_STACK_SIZE)
-#define HCI_H4_TASK_PRIO                (configMAX_PRIORITIES - 4)
+#define HCI_H4_TASK_PRIO                (BT_TASK_MAX_PRIORITIES - 4)
 #define HCI_H4_TASK_NAME                "hciH4T"
-#define HCI_H4_QUEUE_LEN                1
 
 
 #if (C2H_FLOW_CONTROL_INCLUDED == TRUE)
index 67ed0a2bcc063a20a1bfd71993db7fd491a5cf0b..00c6f19e7c1b9f0ec0874e9fbe3955f6e982cd72 100644 (file)
@@ -36,9 +36,8 @@
 
 #define HCI_HOST_TASK_PINNED_TO_CORE    (TASK_PINNED_TO_CORE)
 #define HCI_HOST_TASK_STACK_SIZE        (2048 + BT_TASK_EXTRA_STACK_SIZE)
-#define HCI_HOST_TASK_PRIO              (configMAX_PRIORITIES - 3)
+#define HCI_HOST_TASK_PRIO              (BT_TASK_MAX_PRIORITIES - 3)
 #define HCI_HOST_TASK_NAME              "hciHostT"
-#define HCI_HOST_QUEUE_LEN              40
 
 typedef struct {
     uint16_t opcode;
index 866ccc2e2643103c36501f3a3632d33a20633dda..de8c8da722bd05166c20d1ffca56fbafe8b8ab72 100644 (file)
@@ -24,7 +24,8 @@
 extern void *pvPortZalloc(size_t size);
 extern void vPortFree(void *pv);
 
-#ifdef CONFIG_BT_BLUEDROID_MEM_DEBUG
+
+#if HEAP_MEMORY_DEBUG
 
 #define OSI_MEM_DBG_INFO_MAX    1024*3
 typedef struct {
@@ -130,48 +131,48 @@ char *osi_strdup(const char *str)
 
 void *osi_malloc_func(size_t size)
 {
-#ifdef CONFIG_BT_BLUEDROID_MEM_DEBUG
+#if HEAP_MEMORY_DEBUG
     void *p;
-#if CONFIG_BT_ALLOCATION_FROM_SPIRAM_FIRST
+#if HEAP_ALLOCATION_FROM_SPIRAM_FIRST
     p = heap_caps_malloc_prefer(size, 2, MALLOC_CAP_DEFAULT|MALLOC_CAP_SPIRAM, MALLOC_CAP_DEFAULT|MALLOC_CAP_INTERNAL);
 #else
     p = malloc(size);
-#endif /* #if CONFIG_BT_ALLOCATION_FROM_SPIRAM_FIRST */
+#endif /* #if HEAP_ALLOCATION_FROM_SPIRAM_FIRST */
     osi_mem_dbg_record(p, size, __func__, __LINE__);
     return p;
 #else
-#if CONFIG_BT_ALLOCATION_FROM_SPIRAM_FIRST
+#if HEAP_ALLOCATION_FROM_SPIRAM_FIRST
     return heap_caps_malloc_prefer(size, 2, MALLOC_CAP_DEFAULT|MALLOC_CAP_SPIRAM, MALLOC_CAP_DEFAULT|MALLOC_CAP_INTERNAL);
 #else
     return malloc(size);
-#endif /* #if CONFIG_BT_ALLOCATION_FROM_SPIRAM_FIRST */
-#endif /* #ifdef CONFIG_BT_BLUEDROID_MEM_DEBUG */
+#endif /* #if HEAP_ALLOCATION_FROM_SPIRAM_FIRST */
+#endif /* #if HEAP_MEMORY_DEBUG */
 }
 
 void *osi_calloc_func(size_t size)
 {
-#ifdef CONFIG_BT_BLUEDROID_MEM_DEBUG
+#if HEAP_MEMORY_DEBUG
     void *p;
-#if CONFIG_BT_ALLOCATION_FROM_SPIRAM_FIRST
+#if HEAP_ALLOCATION_FROM_SPIRAM_FIRST
     p = heap_caps_calloc_prefer(1, size, 2, MALLOC_CAP_DEFAULT|MALLOC_CAP_SPIRAM, MALLOC_CAP_DEFAULT|MALLOC_CAP_INTERNAL);
 #else
     p = calloc(1, size);
-#endif /* #if CONFIG_BT_ALLOCATION_FROM_SPIRAM_FIRST */
+#endif /* #if HEAP_ALLOCATION_FROM_SPIRAM_FIRST */
     osi_mem_dbg_record(p, size, __func__, __LINE__);
     return p;
 #else
-#if CONFIG_BT_ALLOCATION_FROM_SPIRAM_FIRST
+#if HEAP_ALLOCATION_FROM_SPIRAM_FIRST
     return heap_caps_calloc_prefer(1, size, 2, MALLOC_CAP_DEFAULT|MALLOC_CAP_SPIRAM, MALLOC_CAP_DEFAULT|MALLOC_CAP_INTERNAL);
 #else
     return calloc(1, size);
-#endif /* #if CONFIG_BT_ALLOCATION_FROM_SPIRAM_FIRST */ 
-#endif /* #ifdef CONFIG_BT_BLUEDROID_MEM_DEBUG */
+#endif /* #if HEAP_ALLOCATION_FROM_SPIRAM_FIRST */
+#endif /* #if HEAP_MEMORY_DEBUG */
 }
 
 void osi_free_func(void *ptr)
 {
-#ifdef CONFIG_BT_BLUEDROID_MEM_DEBUG
-    osi_mem_dbg_clean(ptr, __func__, __LINE__); 
+#if HEAP_MEMORY_DEBUG
+    osi_mem_dbg_clean(ptr, __func__, __LINE__);
 #endif
     free(ptr);
 }
index 3be366e76ad25e1199e48674b2174a33bb4df486..f30987e058d982cfc5494e9b40c53b59d85749e3 100644 (file)
@@ -22,7 +22,6 @@
 #include <stddef.h>
 #include <stdlib.h>
 #include "esp_heap_caps.h"
-#include "sdkconfig.h"
 
 char *osi_strdup(const char *str);
 
@@ -30,14 +29,14 @@ void *osi_malloc_func(size_t size);
 void *osi_calloc_func(size_t size);
 void osi_free_func(void *ptr);
 
-#ifdef CONFIG_BT_BLUEDROID_MEM_DEBUG
+#if HEAP_MEMORY_DEBUG
 
 void osi_mem_dbg_init(void);
 void osi_mem_dbg_record(void *p, int size, const char *func, int line);
 void osi_mem_dbg_clean(void *p, const char *func, int line);
 void osi_mem_dbg_show(void);
 
-#if CONFIG_BT_ALLOCATION_FROM_SPIRAM_FIRST
+#if HEAP_ALLOCATION_FROM_SPIRAM_FIRST
 #define osi_malloc(size)                                \
 ({                                                      \
     void *p;                                            \
@@ -76,7 +75,7 @@ void osi_mem_dbg_show(void);
     (void *)p;                                          \
 })
 
-#endif /* #if CONFIG_BT_ALLOCATION_FROM_SPIRAM_FIRST */
+#endif /* #if HEAP_ALLOCATION_FROM_SPIRAM_FIRST */
 
 
 #if 0
@@ -84,11 +83,11 @@ void osi_mem_dbg_show(void);
 do {                                                    \
     void *p;                                            \
                                                         \
-#if CONFIG_BT_ALLOCATION_FROM_SPIRAM_FIRST              \
+#if HEAP_ALLOCATION_FROM_SPIRAM_FIRST              \
     p = heap_caps_malloc_prefer(size, 2, MALLOC_CAP_DEFAULT|MALLOC_CAP_SPIRAM, MALLOC_CAP_DEFAULT|MALLOC_CAP_INTERNAL); \
 #else                                                   \
     p = malloc((size));                                 \
-#endif /* #if CONFIG_BT_ALLOCATION_FROM_SPIRAM_FIRST */ \
+#endif /* #if HEAP_ALLOCATION_FROM_SPIRAM_FIRST */ \
     osi_mem_dbg_record(p, size, __func__, __LINE__);    \
     (void *)p;                                          \
 }while(0)
@@ -97,13 +96,13 @@ do {                                                    \
 do {                                                    \
     void *p;                                            \
                                                         \
-#if CONFIG_BT_ALLOCATION_FROM_SPIRAM_FIRST              \
+#if HEAP_ALLOCATION_FROM_SPIRAM_FIRST              \
         p = heap_caps_calloc_prefer(1, size, 2,         \
             MALLOC_CAP_DEFAULT|MALLOC_CAP_SPIRAM,       \
             MALLOC_CAP_DEFAULT|MALLOC_CAP_INTERNAL);    \
 #else                                                   \
     p = calloc(1, (size));                              \
-#endif /* #if CONFIG_BT_ALLOCATION_FROM_SPIRAM_FIRST */ \
+#endif /* #if HEAP_ALLOCATION_FROM_SPIRAM_FIRST */ \
     osi_mem_dbg_record(p, size, __func__, __LINE__);    \
     (void *)p;                                          \
 } while(0)
@@ -118,16 +117,16 @@ do {                                                    \
 
 #else
 
-#if CONFIG_BT_ALLOCATION_FROM_SPIRAM_FIRST
+#if HEAP_ALLOCATION_FROM_SPIRAM_FIRST
 #define osi_malloc(size)                  heap_caps_malloc_prefer(size, 2, MALLOC_CAP_DEFAULT|MALLOC_CAP_SPIRAM, MALLOC_CAP_DEFAULT|MALLOC_CAP_INTERNAL)
 #define osi_calloc(size)                  heap_caps_calloc_prefer(1, size, 2, MALLOC_CAP_DEFAULT|MALLOC_CAP_SPIRAM, MALLOC_CAP_DEFAULT|MALLOC_CAP_INTERNAL)
 #else
 #define osi_malloc(size)                  malloc((size))
 #define osi_calloc(size)                  calloc(1, (size))
-#endif /* #if CONFIG_BT_ALLOCATION_FROM_SPIRAM_FIRST */
+#endif /* #if HEAP_ALLOCATION_FROM_SPIRAM_FIRST */
 #define osi_free(p)                       free((p))
 
-#endif /* CONFIG_BT_BLUEDROID_MEM_DEBUG */
+#endif /* HEAP_MEMORY_DEBUG */
 
 #define FREE_AND_RESET(a)   \
 do {                        \
index 1ad3cfce3b2b4f8608b16b506be3b486b480ef86..0a61eac6fda8ec13e870c41fa180939ed5ad8c09 100644 (file)
@@ -1789,53 +1789,6 @@ UINT16 BTM_BuildOobData(UINT8 *p_data, UINT16 max_len, BT_OCTET16 c,
     return len;
 }
 
-/*******************************************************************************
-**
-** Function         BTM_BothEndsSupportSecureConnections
-**
-** Description      This function is called to check if both the local device and the peer device
-**                  specified by bd_addr support BR/EDR Secure Connections.
-**
-** Parameters:      bd_addr - address of the peer
-**
-** Returns          TRUE if BR/EDR Secure Connections are supported by both local
-**                  and the remote device.
-**                  else FALSE.
-**
-*******************************************************************************/
-BOOLEAN BTM_BothEndsSupportSecureConnections(BD_ADDR bd_addr)
-{
-    return ((controller_get_interface()->supports_secure_connections()) &&
-            (BTM_PeerSupportsSecureConnections(bd_addr)));
-}
-
-/*******************************************************************************
-**
-** Function         BTM_PeerSupportsSecureConnections
-**
-** Description      This function is called to check if the peer supports
-**                  BR/EDR Secure Connections.
-**
-** Parameters:      bd_addr - address of the peer
-**
-** Returns          TRUE if BR/EDR Secure Connections are supported by the peer,
-**                  else FALSE.
-**
-*******************************************************************************/
-BOOLEAN BTM_PeerSupportsSecureConnections(BD_ADDR bd_addr)
-{
-    tBTM_SEC_DEV_REC    *p_dev_rec;
-
-    if ((p_dev_rec = btm_find_dev(bd_addr)) == NULL) {
-        BTM_TRACE_WARNING("%s: unknown BDA: %08x%04x\n", __FUNCTION__,
-                          (bd_addr[0] << 24) + (bd_addr[1] << 16) + (bd_addr[2] << 8) + bd_addr[3],
-                          (bd_addr[4] << 8) + bd_addr[5]);
-        return FALSE;
-    }
-
-    return (p_dev_rec->remote_supports_secure_connections);
-}
-
 /*******************************************************************************
 **
 ** Function         BTM_ReadOobData
@@ -1899,6 +1852,54 @@ UINT8 *BTM_ReadOobData(UINT8 *p_data, UINT8 eir_tag, UINT8 *p_len)
 }
 #endif  ///BTM_OOB_INCLUDED == TRUE && SMP_INCLUDED == TRUE
 
+#if (CLASSIC_BT_INCLUDED == TRUE)
+/*******************************************************************************
+**
+** Function         BTM_BothEndsSupportSecureConnections
+**
+** Description      This function is called to check if both the local device and the peer device
+**                  specified by bd_addr support BR/EDR Secure Connections.
+**
+** Parameters:      bd_addr - address of the peer
+**
+** Returns          TRUE if BR/EDR Secure Connections are supported by both local
+**                  and the remote device.
+**                  else FALSE.
+**
+*******************************************************************************/
+BOOLEAN BTM_BothEndsSupportSecureConnections(BD_ADDR bd_addr)
+{
+    return ((controller_get_interface()->supports_secure_connections()) &&
+            (BTM_PeerSupportsSecureConnections(bd_addr)));
+}
+
+/*******************************************************************************
+**
+** Function         BTM_PeerSupportsSecureConnections
+**
+** Description      This function is called to check if the peer supports
+**                  BR/EDR Secure Connections.
+**
+** Parameters:      bd_addr - address of the peer
+**
+** Returns          TRUE if BR/EDR Secure Connections are supported by the peer,
+**                  else FALSE.
+**
+*******************************************************************************/
+BOOLEAN BTM_PeerSupportsSecureConnections(BD_ADDR bd_addr)
+{
+    tBTM_SEC_DEV_REC    *p_dev_rec;
+
+    if ((p_dev_rec = btm_find_dev(bd_addr)) == NULL) {
+        BTM_TRACE_WARNING("%s: unknown BDA: %08x%04x\n", __FUNCTION__,
+                          (bd_addr[0] << 24) + (bd_addr[1] << 16) + (bd_addr[2] << 8) + bd_addr[3],
+                          (bd_addr[4] << 8) + bd_addr[5]);
+        return FALSE;
+    }
+
+    return (p_dev_rec->remote_supports_secure_connections);
+}
+
 /*******************************************************************************
 **
 ** Function         BTM_SetOutService
@@ -1913,7 +1914,6 @@ UINT8 *BTM_ReadOobData(UINT8 *p_data, UINT8 eir_tag, UINT8 *p_len)
 ** Returns          void
 **
 *******************************************************************************/
-#if (CLASSIC_BT_INCLUDED == TRUE)
 void BTM_SetOutService(BD_ADDR bd_addr, UINT8 service_id, UINT32 mx_chan_id)
 {
     tBTM_SEC_DEV_REC *p_dev_rec;
index 510fab7ecffb639ae5b3c1afd98588ff2f03830a..bf3a55af8c5651d5526b8454c389d60397899e3f 100644 (file)
@@ -46,9 +46,8 @@
 
 #define BTU_TASK_PINNED_TO_CORE         (TASK_PINNED_TO_CORE)
 #define BTU_TASK_STACK_SIZE             (4096 + BT_TASK_EXTRA_STACK_SIZE)
-#define BTU_TASK_PRIO                   (configMAX_PRIORITIES - 5)
+#define BTU_TASK_PRIO                   (BT_TASK_MAX_PRIORITIES - 5)
 #define BTU_TASK_NAME                   "btuT"
-#define BTU_QUEUE_LEN                   50
 
 hash_map_t *btu_general_alarm_hash_map;
 osi_mutex_t btu_general_alarm_lock;
@@ -219,7 +218,7 @@ void BTU_ShutDown(void)
         btu_thread = NULL;
     }
 
-    btu_general_alarm_hash_map = NULL; 
+    btu_general_alarm_hash_map = NULL;
     btu_oneshot_alarm_hash_map = NULL;
     btu_l2cap_alarm_hash_map = NULL;
 }
index f3f33537cac8fc01178095d667da9c8243aa2cbe..2b2db28453895c28542813796a34f05aa073d8da 100644 (file)
@@ -18,8 +18,8 @@
 #ifndef DYN_MEM_H
 #define DYN_MEM_H
 
-#include "sdkconfig.h"
-#if CONFIG_BT_BLE_DYNAMIC_ENV_MEMORY
+#include "common/bt_target.h"
+#if BT_BLE_DYNAMIC_ENV_MEMORY
 #define BTU_DYNAMIC_MEMORY         TRUE
 #define BTM_DYNAMIC_MEMORY         TRUE
 #define L2C_DYNAMIC_MEMORY         TRUE
@@ -53,7 +53,7 @@
 #define BTC_SBC_DEC_DYNAMIC_MEMORY TRUE
 #define BTC_SBC_ENC_DYNAMIC_MEMORY TRUE
 
-#else  /* #if CONFIG_BT_BLE_DYNAMIC_ENV_MEMORY */
+#else  /* #if BT_BLE_DYNAMIC_ENV_MEMORY */
 
 #define SDP_DYNAMIC_MEMORY         FALSE
 #define RFC_DYNAMIC_MEMORY         FALSE
@@ -82,7 +82,7 @@
 #define BTC_SBC_DEC_DYNAMIC_MEMORY FALSE
 #define BTC_SBC_ENC_DYNAMIC_MEMORY FALSE
 
-#endif /* #if CONFIG_BT_BLE_DYNAMIC_ENV_MEMORY */
+#endif /* #if BT_BLE_DYNAMIC_ENV_MEMORY */
 /****************************************************************************
 ** Define memory usage for each CORE component (if not defined in bdroid_buildcfg.h)
 **  The default for each component is to use static memory allocations.