From: wangmengyang Date: Fri, 17 Mar 2017 07:08:47 +0000 (+0800) Subject: component/bt: add conditional compilation direvatives to control the source code... X-Git-Tag: v2.1-rc1~196^2~14 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=fda2e89a1e1e741e4ccfab2f70d8f0206760a58a;p=esp-idf component/bt: add conditional compilation direvatives to control the source code building of classic bluetooth --- diff --git a/components/bt/bluedroid/api/esp_a2dp_api.c b/components/bt/bluedroid/api/esp_a2dp_api.c index 7e9217419e..cb635908c2 100644 --- a/components/bt/bluedroid/api/esp_a2dp_api.c +++ b/components/bt/bluedroid/api/esp_a2dp_api.c @@ -12,6 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. +#include "bt_target.h" #include #include "esp_err.h" #include "esp_a2dp_api.h" @@ -19,6 +20,8 @@ #include "btc_manage.h" #include "btc_av.h" +#if BTC_AV_INCLUDED + esp_err_t esp_a2d_register_callback(esp_a2d_cb_t callback) { if (esp_bluedroid_get_status() != ESP_BLUEDROID_STATUS_ENABLED) { @@ -126,3 +129,5 @@ esp_err_t esp_a2d_sink_disconnect(esp_bd_addr_t remote_bda) stat = btc_transfer_context(&msg, NULL, 0, NULL); return (stat == BT_STATUS_SUCCESS) ? ESP_OK : ESP_FAIL; } + +#endif /* #if BTC_AV_INCLUDED */ diff --git a/components/bt/bluedroid/api/esp_avrc_api.c b/components/bt/bluedroid/api/esp_avrc_api.c index c8de45eeef..cf4a8e003d 100644 --- a/components/bt/bluedroid/api/esp_avrc_api.c +++ b/components/bt/bluedroid/api/esp_avrc_api.c @@ -12,6 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. +#include "bt_target.h" #include #include "esp_err.h" #include "esp_avrc_api.h" @@ -19,6 +20,8 @@ #include "btc_manage.h" #include "btc_avrc.h" +#if BTC_AV_INCLUDED + esp_err_t esp_avrc_ct_register_callback(esp_avrc_ct_cb_t callback) { if (esp_bluedroid_get_status() != ESP_BLUEDROID_STATUS_ENABLED) { @@ -89,3 +92,5 @@ esp_err_t esp_avrc_ct_send_passthrough_cmd(uint8_t tl, uint8_t key_code, uint8_t bt_status_t stat = btc_transfer_context(&msg, &arg, sizeof(btc_avrc_args_t), NULL); return (stat == BT_STATUS_SUCCESS) ? ESP_OK : ESP_FAIL; } + +#endif /* #if BTC_AV_INCLUDED */ diff --git a/components/bt/bluedroid/api/esp_gap_bt_api.c b/components/bt/bluedroid/api/esp_gap_bt_api.c index adbaef52fb..7c4855e27b 100644 --- a/components/bt/bluedroid/api/esp_gap_bt_api.c +++ b/components/bt/bluedroid/api/esp_gap_bt_api.c @@ -12,6 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. +#include "bt_target.h" #include #include "esp_bt_main.h" #include "esp_gap_bt_api.h" @@ -19,6 +20,8 @@ #include "btc_manage.h" #include "btc_gap_bt.h" +#if BTC_GAP_BT_INCLUDED + esp_err_t esp_bt_gap_set_scan_mode(esp_bt_scan_mode_t mode) { btc_msg_t msg; @@ -63,3 +66,5 @@ esp_err_t esp_bt_gap_set_device_name(const char *name) return (btc_transfer_context(&msg, &arg, sizeof(btc_gap_bt_args_t), NULL) == BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL); } + +#endif /* #if BTC_GAP_BT_INCLUDED */ diff --git a/components/bt/bluedroid/bta/ar/bta_ar.c b/components/bt/bluedroid/bta/ar/bta_ar.c index d58fe7b79f..a3e51aa057 100755 --- a/components/bt/bluedroid/bta/ar/bta_ar.c +++ b/components/bt/bluedroid/bta/ar/bta_ar.c @@ -22,10 +22,12 @@ * ******************************************************************************/ +#include "bt_target.h" #include #include "bta_ar_api.h" #include "bta_ar_int.h" +#if BTA_AR_INCLUDED /* AV control block */ #if BTA_DYNAMIC_MEMORY == FALSE @@ -338,3 +340,5 @@ void bta_ar_dereg_avrc(UINT16 service_uuid, tBTA_SYS_ID sys_id) } } + +#endif /* #if BTA_AR_INCLUDED */ diff --git a/components/bt/bluedroid/bta/av/bta_av_cfg.c b/components/bt/bluedroid/bta/av/bta_av_cfg.c index a7db8ffc29..dade8ca1e0 100755 --- a/components/bt/bluedroid/bta/av/bta_av_cfg.c +++ b/components/bt/bluedroid/bta/av/bta_av_cfg.c @@ -30,6 +30,8 @@ #include "bta_api.h" #include "bta_av_int.h" +#if defined(BTA_AV_INCLUDED) && (BTA_AV_INCLUDED == TRUE) + #ifndef BTA_AV_RC_PASS_RSP_CODE #define BTA_AV_RC_PASS_RSP_CODE BTA_AV_RSP_NOT_IMPL #endif @@ -205,3 +207,5 @@ UINT16 *p_bta_av_rc_id_ac = NULL; #endif UINT16 *p_bta_av_rc_id = (UINT16 *) bta_av_rc_id; + +#endif /* if defined(BTA_AV_INCLUDED) && (BTA_AV_INCLUDED == TRUE) */ diff --git a/components/bt/bluedroid/bta/av/bta_av_ci.c b/components/bt/bluedroid/bta/av/bta_av_ci.c index 2da1d9767e..5fdf682611 100755 --- a/components/bt/bluedroid/bta/av/bta_av_ci.c +++ b/components/bt/bluedroid/bta/av/bta_av_ci.c @@ -23,6 +23,7 @@ * ******************************************************************************/ +#include "bt_target.h" #include "bta_api.h" #include "bta_sys.h" #include "bta_av_int.h" @@ -30,6 +31,7 @@ #include +#if defined(BTA_AV_INCLUDED) && (BTA_AV_INCLUDED == TRUE) /******************************************************************************* ** ** Function bta_av_ci_src_data_ready @@ -97,3 +99,4 @@ void bta_av_ci_setconfig(tBTA_AV_HNDL hndl, UINT8 err_code, UINT8 category, } } +#endif /* #if defined(BTA_AV_INCLUDED) && (BTA_AV_INCLUDED == TRUE) */ diff --git a/components/bt/bluedroid/bta/av/bta_av_sbc.c b/components/bt/bluedroid/bta/av/bta_av_sbc.c index 4d539cfbb7..2ed7250785 100755 --- a/components/bt/bluedroid/bta/av/bta_av_sbc.c +++ b/components/bt/bluedroid/bta/av/bta_av_sbc.c @@ -23,12 +23,15 @@ * ******************************************************************************/ +#include "bt_target.h" #include "a2d_api.h" #include "a2d_sbc.h" #include "bta_av_sbc.h" #include "utl.h" #include "bt_utils.h" +#if defined(BTA_AV_INCLUDED) && (BTA_AV_INCLUDED == TRUE) + typedef int (tBTA_AV_SBC_ACT)(void *p_src, void *p_dst, UINT32 src_samples, UINT32 dst_samples, UINT32 *p_ret); @@ -664,3 +667,4 @@ void bta_av_sbc_bld_hdr(BT_HDR *p_buf, UINT16 fr_per_pkt) A2D_BldSbcMplHdr(p, FALSE, FALSE, FALSE, (UINT8) fr_per_pkt); } +#endif /* #if defined(BTA_AV_INCLUDED) && (BTA_AV_INCLUDED == TRUE) */ diff --git a/components/bt/bluedroid/bta/sdp/bta_sdp.c b/components/bt/bluedroid/bta/sdp/bta_sdp.c index 9d6c9b0a26..f079d2f928 100644 --- a/components/bt/bluedroid/bta/sdp/bta_sdp.c +++ b/components/bt/bluedroid/bta/sdp/bta_sdp.c @@ -23,12 +23,14 @@ ******************************************************************************/ #include - +#include "bt_target.h" #include "bta_api.h" #include "bta_sys.h" #include "bta_sdp_api.h" #include "bta_sdp_int.h" +#if defined(BTA_SDP_INCLUDED) && (BTA_SDP_INCLUDED == TRUE) + /***************************************************************************** ** Constants and types *****************************************************************************/ @@ -75,3 +77,5 @@ BOOLEAN bta_sdp_sm_execute(BT_HDR *p_msg) return (ret); } + +#endif /* #if defined(BTA_SDP_INCLUDED) && (BTA_SDP_INCLUDED == TRUE) */ diff --git a/components/bt/bluedroid/bta/sdp/bta_sdp_act.c b/components/bt/bluedroid/bta/sdp/bta_sdp_act.c index 1281b50ab2..de563b56c1 100644 --- a/components/bt/bluedroid/bta/sdp/bta_sdp_act.c +++ b/components/bt/bluedroid/bta/sdp/bta_sdp_act.c @@ -26,7 +26,7 @@ #include "bt_defs.h" #include #include - +#include "bt_target.h" #include "allocator.h" #include "bt_types.h" #include "gki.h" @@ -39,6 +39,7 @@ #include "btm_int.h" #include "sdp_api.h" +#if defined(BTA_SDP_INCLUDED) && (BTA_SDP_INCLUDED == TRUE) /***************************************************************************** ** Constants *****************************************************************************/ @@ -543,3 +544,5 @@ void bta_sdp_remove_record(tBTA_SDP_MSG *p_data) bta_sdp_cb.p_dm_cback(BTA_SDP_REMOVE_RECORD_USER_EVT, NULL, p_data->record.user_data); } } + +#endif /* #if defined(BTA_SDP_INCLUDED) && (BTA_SDP_INCLUDED == TRUE) */ diff --git a/components/bt/bluedroid/bta/sdp/bta_sdp_api.c b/components/bt/bluedroid/bta/sdp/bta_sdp_api.c index 3969b45d8e..cbbf0f4755 100644 --- a/components/bt/bluedroid/bta/sdp/bta_sdp_api.c +++ b/components/bt/bluedroid/bta/sdp/bta_sdp_api.c @@ -22,6 +22,7 @@ * ******************************************************************************/ +#include "bt_target.h" #include "bta_api.h" #include "bta_sys.h" #include "bta_sdp_api.h" @@ -31,6 +32,7 @@ // #include "port_api.h" #include "sdp_api.h" +#if defined(BTA_SDP_INCLUDED) && (BTA_SDP_INCLUDED == TRUE) /***************************************************************************** ** Constants *****************************************************************************/ @@ -165,3 +167,4 @@ tBTA_SDP_STATUS BTA_SdpRemoveRecordByUser(void *user_data) } +#endif /* #if defined(BTA_SDP_INCLUDED) && (BTA_SDP_INCLUDED == TRUE) */ diff --git a/components/bt/bluedroid/bta/sdp/bta_sdp_cfg.c b/components/bt/bluedroid/bta/sdp/bta_sdp_cfg.c index bfd02d279c..bbdd8c78e9 100644 --- a/components/bt/bluedroid/bta/sdp/bta_sdp_cfg.c +++ b/components/bt/bluedroid/bta/sdp/bta_sdp_cfg.c @@ -20,10 +20,13 @@ * This file contains compile-time configurable constants for SDP Search ******************************************************************************/ +#include "bt_target.h" #include "gki.h" #include "bta_api.h" #include "bta_sdp_api.h" +#if defined(BTA_SDP_INCLUDED) && (BTA_SDP_INCLUDED == TRUE) + #ifndef BTA_SDP_DB_SIZE #define BTA_SDP_DB_SIZE 1500 #endif @@ -37,3 +40,5 @@ const tBTA_SDP_CFG bta_sdp_cfg = { }; tBTA_SDP_CFG *p_bta_sdp_cfg = (tBTA_SDP_CFG *) &bta_sdp_cfg; + +#endif /* #if defined(BTA_SDP_INCLUDED) && (BTA_SDP_INCLUDED == TRUE) */ diff --git a/components/bt/bluedroid/btc/core/btc_dm.c b/components/bt/bluedroid/btc/core/btc_dm.c index a4afc98c03..7cf9d643ec 100644 --- a/components/bt/bluedroid/btc/core/btc_dm.c +++ b/components/bt/bluedroid/btc/core/btc_dm.c @@ -1,3 +1,18 @@ +// 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. + +#include "bt_target.h" #include #include #include "btc_common.h" @@ -24,9 +39,10 @@ static tBTA_SERVICE_MASK btc_enabled_services = 0; /****************************************************************************** ** Externs ******************************************************************************/ +#if BTC_AV_INCLUDED extern bt_status_t btc_av_execute_service(BOOLEAN b_enable); extern bt_status_t btc_av_sink_execute_service(BOOLEAN b_enable); - +#endif /****************************************************************************** ** Functions ******************************************************************************/ @@ -194,12 +210,14 @@ static bt_status_t btc_in_execute_service_request(tBTA_SERVICE_ID service_id, LOG_DEBUG("%s service_id: %d\n", __FUNCTION__, service_id); /* Check the service_ID and invoke the profile's BT state changed API */ switch (service_id) { +#if BTC_AV_INCLUDED case BTA_A2DP_SOURCE_SERVICE_ID: btc_av_execute_service(b_enable); break; case BTA_A2DP_SINK_SERVICE_ID: btc_av_sink_execute_service(b_enable); break; +#endif default: LOG_ERROR("%s: Unknown service being enabled\n", __FUNCTION__); return BT_STATUS_FAIL; diff --git a/components/bt/bluedroid/btc/core/btc_profile_queue.c b/components/bt/bluedroid/btc/core/btc_profile_queue.c index 64406af4f0..23dc6bf3dd 100644 --- a/components/bt/bluedroid/btc/core/btc_profile_queue.c +++ b/components/bt/bluedroid/btc/core/btc_profile_queue.c @@ -12,16 +12,17 @@ // See the License for the specific language governing permissions and // limitations under the License. +#include "bt_target.h" #include #include "esp_bt_main.h" #include "bt_trace.h" #include "bt_defs.h" - #include "btc_profile_queue.h" #include "gki.h" #include "list.h" #include "allocator.h" +#if BTC_PRF_QUEUE_INCLUDED /******************************************************************************* ** Local type definitions *******************************************************************************/ @@ -167,3 +168,5 @@ void btc_queue_release(void) list_free(connect_queue); connect_queue = NULL; } + +#endif /* if BTC_PRF_QUEUE_INCLUDED */ diff --git a/components/bt/bluedroid/btc/core/btc_sm.c b/components/bt/bluedroid/btc/core/btc_sm.c index 6cc4f679b9..c19434cb0d 100644 --- a/components/bt/bluedroid/btc/core/btc_sm.c +++ b/components/bt/bluedroid/btc/core/btc_sm.c @@ -20,13 +20,14 @@ * Description: Generic BTC state machine API * *****************************************************************************/ - +#include "bt_target.h" #include "bt_defs.h" #include "allocator.h" #include "btc_common.h" #include "btc_sm.h" #include "gki.h" +#if BTC_SM_INCLUDED /***************************************************************************** ** Constants & Macros ******************************************************************************/ @@ -195,3 +196,5 @@ bt_status_t btc_sm_change_state(btc_sm_handle_t handle, btc_sm_state_t state) return status; } + +#endif /* #if BTC_SM_INCLUDED */ diff --git a/components/bt/bluedroid/btc/profile/std/a2dp/bta_av_co.c b/components/bt/bluedroid/btc/profile/std/a2dp/bta_av_co.c index 209aa5a641..4ee4ed3f12 100644 --- a/components/bt/bluedroid/btc/profile/std/a2dp/bta_av_co.c +++ b/components/bt/bluedroid/btc/profile/std/a2dp/bta_av_co.c @@ -22,8 +22,8 @@ * BTC. * ******************************************************************************/ - #include "string.h" +#include "bt_target.h" #include "a2d_api.h" #include "a2d_sbc.h" #include "bta_sys.h" @@ -35,6 +35,8 @@ #include "btc_av_co.h" #include "btc_util.h" +#if BTC_AV_INCLUDED + /***************************************************************************** ** Constants *****************************************************************************/ @@ -1745,3 +1747,5 @@ tBTA_AV_CO_FUNCTS bta_av_a2d_cos = { bta_av_co_audio_src_data_path, bta_av_co_audio_delay }; + +#endif /* #if BTC_AV_INCLUDED */ diff --git a/components/bt/bluedroid/btc/profile/std/a2dp/btc_avk.c b/components/bt/bluedroid/btc/profile/std/a2dp/btc_avk.c index 7d7819f26f..d9872e7ade 100644 --- a/components/bt/bluedroid/btc/profile/std/a2dp/btc_avk.c +++ b/components/bt/bluedroid/btc/profile/std/a2dp/btc_avk.c @@ -19,6 +19,7 @@ * Description: AV implementation * *****************************************************************************/ +#include "bt_target.h" #include #include "bt_trace.h" #include "bt_defs.h" @@ -39,6 +40,8 @@ #include "btc_common.h" #include "btc_manage.h" +#if BTC_AV_INCLUDED + /***************************************************************************** ** Constants & Macros ******************************************************************************/ @@ -1240,3 +1243,5 @@ void btc_a2dp_cb_handler(btc_msg_t *msg) btc_sm_dispatch(btc_av_cb.sm_handle, msg->act, (void *)(msg->arg)); btc_av_event_free_data(msg->act, msg->arg); } + +#endif /* #if BTC_AV_INCLUDED */ diff --git a/components/bt/bluedroid/btc/profile/std/a2dp/btc_media_task.c b/components/bt/bluedroid/btc/profile/std/a2dp/btc_media_task.c index ae190b4f06..aba25fd747 100644 --- a/components/bt/bluedroid/btc/profile/std/a2dp/btc_media_task.c +++ b/components/bt/bluedroid/btc/profile/std/a2dp/btc_media_task.c @@ -22,12 +22,11 @@ ** ******************************************************************************/ +#include "bt_target.h" #include "bt_trace.h" #include #include #include - -#include "bt_target.h" #include "fixed_queue.h" #include "gki.h" #include "bta_api.h" @@ -59,6 +58,8 @@ #include "oi_status.h" // #endif +#if BTC_AV_INCLUDED + // #if (BTA_AV_SINK_INCLUDED == TRUE) OI_CODEC_SBC_DECODER_CONTEXT context; OI_UINT32 contextData[CODEC_DATA_WORDS(2, SBC_CODEC_FAST_FILTER_BUFFERS)]; @@ -1009,3 +1010,5 @@ void dump_codec_info(unsigned char *p_codec) APPL_TRACE_DEBUG("\tBit pool Min:%d Max:%d\n", sbc_cie.min_bitpool, sbc_cie.max_bitpool); } + +#endif /* #if BTC_AV_INCLUDED */ diff --git a/components/bt/bluedroid/btc/profile/std/avrc/btc_avrc.c b/components/bt/bluedroid/btc/profile/std/avrc/btc_avrc.c index d4088d3911..0c20b66424 100644 --- a/components/bt/bluedroid/btc/profile/std/avrc/btc_avrc.c +++ b/components/bt/bluedroid/btc/profile/std/avrc/btc_avrc.c @@ -19,18 +19,19 @@ * Description: Bluetooth AVRC implementation * *****************************************************************************/ +#include "bt_target.h" #include #include "bta_api.h" #include "bta_av_api.h" #include "avrc_defs.h" #include "gki.h" - #include "btc_common.h" #include "btc_util.h" #include "btc_av.h" #include "btc_avrc.h" #include "btc_manage.h" #include "esp_avrc_api.h" +#if BTC_AV_INCLUDED /***************************************************************************** ** Constants & Macros @@ -462,3 +463,5 @@ void btc_avrc_call_handler(btc_msg_t *msg) LOG_WARN("%s : unhandled event: %d\n", __FUNCTION__, msg->act); } } + +#endif /* #if BTC_AV_INCLUDED */ diff --git a/components/bt/bluedroid/btc/profile/std/gap/btc_gap_bt.c b/components/bt/bluedroid/btc/profile/std/gap/btc_gap_bt.c index d5f508b081..a9a461679b 100644 --- a/components/bt/bluedroid/btc/profile/std/gap/btc_gap_bt.c +++ b/components/bt/bluedroid/btc/profile/std/gap/btc_gap_bt.c @@ -17,7 +17,9 @@ #include "bta_api.h" #include "bt_trace.h" #include +#include "bt_target.h" +#if BTC_GAP_BT_INCLUDED void btc_gap_bt_arg_deep_copy(btc_msg_t *msg, void *p_dest, void *p_src) { switch (msg->act) { @@ -85,3 +87,5 @@ void btc_gap_bt_call_handler(btc_msg_t *msg) } btc_gap_bt_arg_deep_free(msg); } + +#endif /* #if BTC_GAP_BT_INCLUDED */ diff --git a/components/bt/bluedroid/btc/profile/std/sdp/btc_sdp.c b/components/bt/bluedroid/btc/profile/std/sdp/btc_sdp.c deleted file mode 100644 index 382f6dc021..0000000000 --- a/components/bt/bluedroid/btc/profile/std/sdp/btc_sdp.c +++ /dev/null @@ -1,125 +0,0 @@ -// 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. - -#include "esp_sdp_api.h" - - -esp_err_t esp_bt_sdp_enable(bt_sdp_cb_t *cback) -{ - tBTA_SDP_STATUS status = BTA_SdpEnable((tBTA_SDP_DM_CBACK *)cback); - - return (status == BTA_SDP_SUCCESS) ? ESP_OK : ESP_FAIL; -} - -esp_err_t esp_bt_sdp_search(esp_bd_addr_t bd_addr, esp_bt_uuid_t *uuid) -{ - tBTA_SDP_STATUS status = BTA_SdpSearch(bd_addr, (tSDP_UUID *)uuid); - return (status == BTA_SDP_SUCCESS) ? ESP_OK : ESP_FAIL; -} - -esp_err_t esp_bt_sdp_create_record_by_user(void *user_data) -{ - tBTA_SDP_STATUS status = BTA_SdpCreateRecordByUser(user_data); - return (status == BTA_SDP_SUCCESS) ? ESP_OK : ESP_FAIL; -} - -esp_err_t esp_bt_sdp_remove_record_by_user(void *user_data) -{ - tBTA_SDP_STATUS status = BTA_SdpRemoveRecordByUser(user_data); - return (status == BTA_SDP_SUCCESS) ? ESP_OK : ESP_FAIL; -} - - -/**********************************************************************************************/ -/**********************************************************************************************/ -/* API into SDP for local service database updates */ -/* these APIs are indended to be called in callback function in the context of stack task, - * to handle BT_SDP_CREATE_RECORD_USER_EVT and BT_SDP_REMOVE_RECORD_USER_EVT - */ -uint32_t esp_bt_sdp_create_record(void) -{ - return SDP_CreateRecord(); -} - -bool esp_bt_sdp_delete_record(uint32_t handle) -{ - return SDP_DeleteRecord(handle); -} - -int32_t esp_bt_sdp_read_record(uint32_t handle, uint8_t *data, int32_t *data_len) -{ - return SDP_ReadRecord(handle, data, data_len); -} - -bool esp_bt_sdp_add_attribute (uint32_t handle, uint16_t attr_id, - uint8_t attr_type, uint32_t attr_len, - uint8_t *p_val) -{ - return SDP_AddAttribute(handle, attr_id, attr_type, attr_len, p_val); -} - -bool esp_bt_sdp_add_sequence (uint32_t handle, uint16_t attr_id, - uint16_t num_elem, uint8_t type[], - uint8_t len[], uint8_t *p_val[]) -{ - return SDP_AddSequence(handle, attr_id, num_elem, type, len, p_val); -} - -bool esp_bt_sdp_add_uuid_sequence (uint32_t handle, uint16_t attr_id, - uint16_t num_uuids, uint16_t *p_uuids) -{ - return SDP_AddUuidSequence(handle, attr_id, num_uuids, p_uuids); -} - - -bool esp_bt_sdp_add_protocol_list (uint32_t handle, uint16_t num_elem, - sdp_proto_elem_t *p_elem_list) -{ - return SDP_AddProtocolList(handle, num_elem, (tSDP_PROTOCOL_ELEM *)p_elem_list); -} - -bool esp_bt_sdp_add_addition_protocol_lists(uint32_t handle, uint16_t num_elem, - sdp_proto_list_elem_t *p_proto_list) -{ - return SDP_AddAdditionProtoLists(handle, num_elem, (tSDP_PROTO_LIST_ELEM *)p_proto_list); -} - -bool esp_bt_sdp_add_profile_dscp_list (uint32_t handle, - uint16_t profile_uuid, - uint16_t version) -{ - return SDP_AddProfileDescriptorList(handle, profile_uuid, version); -} - -bool esp_bt_sdp_add_lang_base_attr_id_list(uint32_t handle, - uint16_t lang, uint16_t char_enc, - uint16_t base_id) -{ - return SDP_AddLanguageBaseAttrIDList(handle, lang, char_enc, base_id); -} - -bool esp_bt_sdp_add_service_class_id_list(uint32_t handle, - uint16_t num_services, - uint16_t *p_service_uuids) -{ - return SDP_AddServiceClassIdList(handle, num_services, p_service_uuids); -} - -bool esp_bt_sdp_delete_attribute(uint32_t handle, uint16_t attr_id) -{ - return SDP_DeleteAttribute(handle, attr_id); -} - -/**********************************************************************************************/ -/**********************************************************************************************/ diff --git a/components/bt/bluedroid/btc/profile/std/sdp/include/btc_sdp.h b/components/bt/bluedroid/btc/profile/std/sdp/include/btc_sdp.h deleted file mode 100644 index db7984b9b9..0000000000 --- a/components/bt/bluedroid/btc/profile/std/sdp/include/btc_sdp.h +++ /dev/null @@ -1,129 +0,0 @@ -// 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 __ESP_SDP_API_H__ -#define __ESP_SDP_API_H__ - -#include -#include "esp_err.h" -#include "esp_bt_common.h" -#include "bta_sdp_api.h" -#include "bt_sdp.h" - -#define BT_SDP_STAT_SUCCESS BTA_SDP_SUCCESS -#define BT_SDP_STAT_FAILURE BTA_SDP_FAILURE -#define BT_SDP_STAT_BUSY BTA_SDP_BUSY - -#define BT_SDP_ENABLE_EVT BTA_SDP_ENABLE_EVT -#define BT_SDP_SEARCH_EVT BTA_SDP_SEARCH_EVT -#define BT_SDP_SEARCH_COMP_EVT BTA_SDP_SEARCH_COMP_EVT -#define BT_SDP_CREATE_RECORD_USER_EVT BTA_SDP_CREATE_RECORD_USER_EVT -#define BT_SDP_REMOVE_RECORD_USER_EVT BTA_SDP_REMOVE_RECORD_USER_EVT -#define BT_SDP_MAX_EVT BTA_SDP_MAX_EVT - -#define BT_SDP_MAX_RECORDS BTA_SDP_MAX_RECORDS - -typedef tBTA_SDP_STATUS bt_sdp_status_t; - -typedef tBTA_SDP_EVT bt_sdp_evt_t; - -typedef bluetooth_sdp_record bt_sdp_record_t; - -/* tBTA_SEARCH_COMP, bta_sdp_api.h */ -typedef struct { - bt_sdp_status_t status; - esp_bd_addr_t remote_addr; - esp_bt_uuid_t uuid; - int record_count; - bt_sdp_record_t records[BT_SDP_MAX_RECORDS]; -} bt_sdp_search_comp_t; - -/* tBTA_SDP, bta_sdp_api.h */ -typedef union { - bt_sdp_status_t status; - bt_sdp_search_comp_t sdp_search_comp; -} bt_sdp_t; - -typedef void (bt_sdp_cb_t)(bt_sdp_evt_t event, bt_sdp_t *p_data, void *user_data); - -esp_err_t esp_bt_sdp_enable(bt_sdp_cb_t *cback); - -esp_err_t esp_bt_sdp_search(esp_bd_addr_t bd_addr, esp_bt_uuid_t *uuid); - -esp_err_t esp_bt_sdp_create_record_by_user(void *user_data); - -esp_err_t esp_bt_sdp_remove_record_by_user(void *user_data); - - -/**********************************************************************************************/ -/**********************************************************************************************/ -/* API into SDP for local service database updates - * these APIs are indended to be called in callback function in the context of stack task, - * to handle BT_SDP_CREATE_RECORD_USER_EVT and BT_SDP_REMOVE_RECORD_USER_EVT - */ - -/* This structure is used to add protocol lists and find protocol elements */ -#define ESP_BT_SDP_MAX_PROTOCOL_PARAMS SDP_MAX_PROTOCOL_PARAMS // bt_target.h -typedef struct { - uint16_t protocol_uuid; - uint16_t num_params; - uint16_t params[ESP_BT_SDP_MAX_PROTOCOL_PARAMS]; -} sdp_proto_elem_t; // tSDP_PROTOCOL_ELEM, sdp_api.h - -#define ESP_BT_SDP_MAX_LIST_ELEMS SDP_MAX_LIST_ELEMS // sdp_api.h -typedef struct { - uint16_t num_elems; - sdp_proto_elem_t list_elem[ESP_BT_SDP_MAX_LIST_ELEMS]; -} sdp_proto_list_elem_t; // tSDP_PROTO_LIST_ELEM, sdp_api.h - - -uint32_t esp_bt_sdp_create_record(void); - -bool esp_bt_sdp_delete_record(uint32_t handle); - -int32_t esp_bt_sdp_read_record(uint32_t handle, uint8_t *data, int32_t *data_len); - -bool esp_bt_sdp_add_attribute (uint32_t handle, uint16_t attr_id, - uint8_t attr_type, uint32_t attr_len, - uint8_t *p_val); - -bool esp_bt_sdp_add_sequence (uint32_t handle, uint16_t attr_id, - uint16_t num_elem, uint8_t type[], - uint8_t len[], uint8_t *p_val[]); - -bool esp_bt_sdp_add_uuid_sequence (uint32_t handle, uint16_t attr_id, - uint16_t num_uuids, uint16_t *p_uuids); - - -bool esp_bt_sdp_add_protocol_list (uint32_t handle, uint16_t num_elem, - sdp_proto_elem_t *p_elem_list); - -bool esp_bt_sdp_add_addition_protocol_lists(uint32_t handle, uint16_t num_elem, - sdp_proto_list_elem_t *p_proto_list); - -bool esp_bt_sdp_add_profile_dscp_list (uint32_t handle, - uint16_t profile_uuid, - uint16_t version); - -bool esp_bt_sdp_add_lang_base_attr_id_list(uint32_t handle, - uint16_t lang, uint16_t char_enc, - uint16_t base_id); - -bool esp_bt_sdp_add_service_class_id_list(uint32_t handle, - uint16_t num_services, - uint16_t *p_service_uuids); - -bool esp_bt_sdp_delete_attribute(uint32_t handle, uint16_t attr_id); - -#endif /* __ESP_SDP_API_H__ */ diff --git a/components/bt/bluedroid/include/bt_target.h b/components/bt/bluedroid/include/bt_target.h index fd9879a5bc..02a684411c 100644 --- a/components/bt/bluedroid/include/bt_target.h +++ b/components/bt/bluedroid/include/bt_target.h @@ -43,6 +43,7 @@ #if CONFIG_CLASSIC_BT_ENABLED +#define BTA_SDP_INCLUDED TRUE #define BTA_PAN_INCLUDED FALSE #define BTA_HH_INCLUDED FALSE #define BTA_AR_INCLUDED TRUE @@ -52,12 +53,19 @@ #define RFCOMM_INCLUDED FALSE #define PAN_INCLUDED FALSE #define HID_HOST_INCLUDED FALSE +#define AVDT_INCLUDED TRUE #define A2D_INCLUDED TRUE +#define AVCT_INCLUDED TRUE #define AVRC_INCLUDED TRUE #define MCA_INCLUDED FALSE +#define BTC_SM_INCLUDED TRUE +#define BTC_PRF_QUEUE_INCLUDED TRUE +#define BTC_GAP_BT_INCLUDED TRUE +#define BTC_AV_INCLUDED TRUE #else /* #if CONFIG_CLASSIC_BT_ENABLED */ +#define BTA_SDP_INCLUDED FALSE #define BTA_PAN_INCLUDED FALSE #define BTA_HH_INCLUDED FALSE #define BTA_AR_INCLUDED FALSE @@ -67,9 +75,15 @@ #define RFCOMM_INCLUDED FALSE #define PAN_INCLUDED FALSE #define HID_HOST_INCLUDED FALSE +#define AVDT_INCLUDED FALSE #define A2D_INCLUDED FALSE +#define AVCT_INCLUDED FALSE #define AVRC_INCLUDED FALSE #define MCA_INCLUDED FALSE +#define BTC_SM_INCLUDED FALSE +#define BTC_PRF_QUEUE_INCLUDED FALSE +#define BTC_GAP_BT_INCLUDED FALSE +#define BTC_AV_INCLUDED FALSE #endif /* #if CONFIG_CLASSIC_BT_ENABLED */ diff --git a/components/bt/bluedroid/stack/a2dp/a2d_api.c b/components/bt/bluedroid/stack/a2dp/a2d_api.c index f0f4a8334d..9b71bd5c8d 100755 --- a/components/bt/bluedroid/stack/a2dp/a2d_api.c +++ b/components/bt/bluedroid/stack/a2dp/a2d_api.c @@ -28,6 +28,8 @@ #include "a2d_int.h" #include "avdt_api.h" +#if (defined(A2D_INCLUDED) && A2D_INCLUDED == TRUE) + /***************************************************************************** ** Global data *****************************************************************************/ @@ -393,3 +395,4 @@ void A2D_Init(void) #endif } +#endif /* #if (defined(A2D_INCLUDED) && A2D_INCLUDED == TRUE) */ diff --git a/components/bt/bluedroid/stack/a2dp/a2d_sbc.c b/components/bt/bluedroid/stack/a2dp/a2d_sbc.c index 6ef76fcf34..dceea21250 100755 --- a/components/bt/bluedroid/stack/a2dp/a2d_sbc.c +++ b/components/bt/bluedroid/stack/a2dp/a2d_sbc.c @@ -31,6 +31,8 @@ #include "a2d_sbc.h" #include "bt_utils.h" +#if (defined(A2D_INCLUDED) && A2D_INCLUDED == TRUE) + /************************************************************************************************* * SBC descramble code * Purpose: to tie the SBC code with BTE/mobile stack code, @@ -397,3 +399,4 @@ void A2D_ParsSbcMplHdr(UINT8 *p_src, BOOLEAN *p_frag, BOOLEAN *p_start, BOOLEAN } } +#endif /* #if (defined(A2D_INCLUDED) && A2D_INCLUDED == TRUE) */ diff --git a/components/bt/bluedroid/stack/avct/avct_api.c b/components/bt/bluedroid/stack/avct/avct_api.c index bf3dd1854b..268b2d6c49 100755 --- a/components/bt/bluedroid/stack/avct/avct_api.c +++ b/components/bt/bluedroid/stack/avct/avct_api.c @@ -33,6 +33,8 @@ #include "avct_api.h" #include "avct_int.h" +#if (defined(AVCT_INCLUDED) && AVCT_INCLUDED == TRUE) + /* Control block for AVCT */ #if AVCT_DYNAMIC_MEMORY == FALSE tAVCT_CB avct_cb; @@ -471,3 +473,4 @@ UINT16 AVCT_MsgReq(UINT8 handle, UINT8 label, UINT8 cr, BT_HDR *p_msg) return result; } +#endif /* #if (defined(AVCT_INCLUDED) && AVCT_INCLUDED == TRUE) */ diff --git a/components/bt/bluedroid/stack/avct/avct_ccb.c b/components/bt/bluedroid/stack/avct/avct_ccb.c index e0f87de6a9..1226c34309 100755 --- a/components/bt/bluedroid/stack/avct/avct_ccb.c +++ b/components/bt/bluedroid/stack/avct/avct_ccb.c @@ -29,6 +29,8 @@ #include "avct_api.h" #include "avct_int.h" +#if (defined(AVCT_INCLUDED) && AVCT_INCLUDED == TRUE) + /******************************************************************************* ** ** Function avct_ccb_alloc @@ -148,3 +150,5 @@ tAVCT_CCB *avct_ccb_by_idx(UINT8 idx) } return p_ccb; } + +#endif /* #if (defined(AVCT_INCLUDED) && AVCT_INCLUDED == TRUE) */ diff --git a/components/bt/bluedroid/stack/avct/avct_l2c.c b/components/bt/bluedroid/stack/avct/avct_l2c.c index 815fa4b333..dd1818ee10 100755 --- a/components/bt/bluedroid/stack/avct/avct_l2c.c +++ b/components/bt/bluedroid/stack/avct/avct_l2c.c @@ -31,6 +31,8 @@ #include "l2c_api.h" #include "l2cdefs.h" +#if (defined(AVCT_INCLUDED) && AVCT_INCLUDED == TRUE) + /* Configuration flags. */ #define AVCT_L2C_CFG_IND_DONE (1<<0) #define AVCT_L2C_CFG_CFM_DONE (1<<1) @@ -434,3 +436,4 @@ void avct_l2c_data_ind_cback(UINT16 lcid, BT_HDR *p_buf) } } +#endif /* #if (defined(AVCT_INCLUDED) && AVCT_INCLUDED == TRUE) */ diff --git a/components/bt/bluedroid/stack/avct/avct_lcb.c b/components/bt/bluedroid/stack/avct/avct_lcb.c index 2c5e316a31..44321136d0 100755 --- a/components/bt/bluedroid/stack/avct/avct_lcb.c +++ b/components/bt/bluedroid/stack/avct/avct_lcb.c @@ -31,6 +31,8 @@ #include "avct_int.h" #include "gki.h" +#if (defined(AVCT_INCLUDED) && AVCT_INCLUDED == TRUE) + /***************************************************************************** ** state machine constants and types *****************************************************************************/ @@ -470,4 +472,4 @@ BOOLEAN avct_lcb_last_ccb(tAVCT_LCB *p_lcb, tAVCT_CCB *p_ccb_last) } - +#endif /* #if (defined(AVCT_INCLUDED) && AVCT_INCLUDED == TRUE) */ diff --git a/components/bt/bluedroid/stack/avct/avct_lcb_act.c b/components/bt/bluedroid/stack/avct/avct_lcb_act.c index 99a7c818d4..da78ce957b 100755 --- a/components/bt/bluedroid/stack/avct/avct_lcb_act.c +++ b/components/bt/bluedroid/stack/avct/avct_lcb_act.c @@ -31,6 +31,8 @@ #include "gki.h" #include "btm_api.h" +#if (defined(AVCT_INCLUDED) && AVCT_INCLUDED == TRUE) + /* packet header length lookup table */ const UINT8 avct_lcb_pkt_type_len[] = { AVCT_HDR_LEN_SINGLE, @@ -732,3 +734,5 @@ void avct_lcb_msg_ind(tAVCT_LCB *p_lcb, tAVCT_LCB_EVT *p_data) } } } + +#endif /* #if (defined(AVCT_INCLUDED) && AVCT_INCLUDED == TRUE) */ diff --git a/components/bt/bluedroid/stack/avdt/avdt_ad.c b/components/bt/bluedroid/stack/avdt/avdt_ad.c index 67fb490d69..f576fafb51 100755 --- a/components/bt/bluedroid/stack/avdt/avdt_ad.c +++ b/components/bt/bluedroid/stack/avdt/avdt_ad.c @@ -35,7 +35,7 @@ #include "l2c_api.h" #include "l2cdefs.h" - +#if (defined(AVDT_INCLUDED) && AVDT_INCLUDED == TRUE) /******************************************************************************* ** ** Function avdt_ad_type_to_tcid @@ -643,3 +643,4 @@ void avdt_ad_close_req(UINT8 type, tAVDT_CCB *p_ccb, tAVDT_SCB *p_scb) } } +#endif /* #if (defined(AVDT_INCLUDED) && AVDT_INCLUDED == TRUE) */ diff --git a/components/bt/bluedroid/stack/avdt/avdt_api.c b/components/bt/bluedroid/stack/avdt/avdt_api.c index 8c274f32c6..9a7392df67 100755 --- a/components/bt/bluedroid/stack/avdt/avdt_api.c +++ b/components/bt/bluedroid/stack/avdt/avdt_api.c @@ -33,13 +33,13 @@ #include "btm_api.h" #include "btu.h" +#if (defined(AVDT_INCLUDED) && AVDT_INCLUDED == TRUE) /* Control block for AVDT */ #if AVDT_DYNAMIC_MEMORY == FALSE tAVDT_CB avdt_cb; #endif - /******************************************************************************* ** ** Function avdt_process_timeout @@ -1434,3 +1434,5 @@ UINT8 AVDT_SetTraceLevel (UINT8 new_level) return (avdt_cb.trace_level); } + +#endif /* #if (defined(AVDT_INCLUDED) && AVDT_INCLUDED == TRUE) */ diff --git a/components/bt/bluedroid/stack/avdt/avdt_ccb.c b/components/bt/bluedroid/stack/avdt/avdt_ccb.c index a448a7cd8b..81d39c0300 100755 --- a/components/bt/bluedroid/stack/avdt/avdt_ccb.c +++ b/components/bt/bluedroid/stack/avdt/avdt_ccb.c @@ -33,6 +33,8 @@ #include "gki.h" #include "btu.h" +#if (defined(AVDT_INCLUDED) && AVDT_INCLUDED == TRUE) + /***************************************************************************** ** state machine constants and types *****************************************************************************/ @@ -463,3 +465,4 @@ tAVDT_CCB *avdt_ccb_by_idx(UINT8 idx) return p_ccb; } +#endif /* #if (defined(AVDT_INCLUDED) && AVDT_INCLUDED == TRUE) */ diff --git a/components/bt/bluedroid/stack/avdt/avdt_ccb_act.c b/components/bt/bluedroid/stack/avdt/avdt_ccb_act.c index 8b3dbfa6a6..915d3c0766 100755 --- a/components/bt/bluedroid/stack/avdt/avdt_ccb_act.c +++ b/components/bt/bluedroid/stack/avdt/avdt_ccb_act.c @@ -34,6 +34,8 @@ #include "btu.h" #include "btm_api.h" +#if (defined(AVDT_INCLUDED) && AVDT_INCLUDED == TRUE) + /******************************************************************************* ** ** Function avdt_ccb_clear_ccb @@ -1131,3 +1133,5 @@ void avdt_ccb_ll_opened(tAVDT_CCB *p_ccb, tAVDT_CCB_EVT *p_data) (*p_ccb->p_conn_cback)(0, p_ccb->peer_addr, AVDT_CONNECT_IND_EVT, &avdt_ctrl); } } + +#endif /* #if (defined(AVDT_INCLUDED) && AVDT_INCLUDED == TRUE) */ diff --git a/components/bt/bluedroid/stack/avdt/avdt_l2c.c b/components/bt/bluedroid/stack/avdt/avdt_l2c.c index a01ed9dbdc..afb562cdce 100755 --- a/components/bt/bluedroid/stack/avdt/avdt_l2c.c +++ b/components/bt/bluedroid/stack/avdt/avdt_l2c.c @@ -34,6 +34,7 @@ #include "btm_api.h" #include "btm_int.h" +#if (defined(AVDT_INCLUDED) && AVDT_INCLUDED == TRUE) /* callback function declarations */ void avdt_l2c_connect_ind_cback(BD_ADDR bd_addr, UINT16 lcid, UINT16 psm, UINT8 id); @@ -529,3 +530,4 @@ void avdt_l2c_data_ind_cback(UINT16 lcid, BT_HDR *p_buf) GKI_freebuf(p_buf); } +#endif /* #if (defined(AVDT_INCLUDED) && AVDT_INCLUDED == TRUE) */ diff --git a/components/bt/bluedroid/stack/avdt/avdt_msg.c b/components/bt/bluedroid/stack/avdt/avdt_msg.c index e5f7e894b5..4715999938 100755 --- a/components/bt/bluedroid/stack/avdt/avdt_msg.c +++ b/components/bt/bluedroid/stack/avdt/avdt_msg.c @@ -36,6 +36,7 @@ #include "gki.h" #include "btu.h" +#if (defined(AVDT_INCLUDED) && AVDT_INCLUDED == TRUE) /***************************************************************************** ** constants *****************************************************************************/ @@ -1899,3 +1900,5 @@ void avdt_msg_ind(tAVDT_CCB *p_ccb, BT_HDR *p_buf) avdt_ccb_event(p_ccb, AVDT_CCB_RCVRSP_EVT, NULL); } } + +#endif /* #if (defined(AVDT_INCLUDED) && AVDT_INCLUDED == TRUE) */ diff --git a/components/bt/bluedroid/stack/avdt/avdt_scb.c b/components/bt/bluedroid/stack/avdt/avdt_scb.c index 7362c37b45..04f0bba18c 100755 --- a/components/bt/bluedroid/stack/avdt/avdt_scb.c +++ b/components/bt/bluedroid/stack/avdt/avdt_scb.c @@ -33,6 +33,8 @@ #include "gki.h" #include "btu.h" +#if (defined(AVDT_INCLUDED) && AVDT_INCLUDED == TRUE) + /***************************************************************************** ** state machine constants and types *****************************************************************************/ @@ -797,3 +799,4 @@ void avdt_scb_peer_seid_list(tAVDT_MULTI *p_multi) } } +#endif /* #if (defined(AVDT_INCLUDED) && AVDT_INCLUDED == TRUE) */ diff --git a/components/bt/bluedroid/stack/avdt/avdt_scb_act.c b/components/bt/bluedroid/stack/avdt/avdt_scb_act.c index f0a4d9dc5f..7882cc90af 100755 --- a/components/bt/bluedroid/stack/avdt/avdt_scb_act.c +++ b/components/bt/bluedroid/stack/avdt/avdt_scb_act.c @@ -33,6 +33,8 @@ #include "gki.h" #include "btu.h" +#if (defined(AVDT_INCLUDED) && AVDT_INCLUDED == TRUE) + /* This table is used to lookup the callback event that matches a particular ** state machine API request event. Note that state machine API request ** events are at the beginning of the event list starting at zero, thus @@ -2174,3 +2176,4 @@ void avdt_scb_queue_frags(tAVDT_SCB *p_scb, UINT8 **pp_data, UINT32 *p_data_len, } #endif +#endif /* #if (defined(AVDT_INCLUDED) && AVDT_INCLUDED == TRUE) */ diff --git a/components/bt/bluedroid/stack/avrc/avrc_api.c b/components/bt/bluedroid/stack/avrc/avrc_api.c index e717f9e495..da72842a92 100755 --- a/components/bt/bluedroid/stack/avrc/avrc_api.c +++ b/components/bt/bluedroid/stack/avrc/avrc_api.c @@ -24,11 +24,13 @@ // #include #include "bt_trace.h" #include - +#include "bt_target.h" #include "gki.h" #include "avrc_api.h" #include "avrc_int.h" +#if (defined(AVRC_INCLUDED) && AVRC_INCLUDED == TRUE) + /***************************************************************************** ** Global data *****************************************************************************/ @@ -1167,3 +1169,4 @@ UINT16 AVRC_PassRsp(UINT8 handle, UINT8 label, tAVRC_MSG_PASS *p_msg) return AVRC_NO_RESOURCES; } +#endif /* #if (defined(AVRC_INCLUDED) && AVRC_INCLUDED == TRUE) */ diff --git a/components/bt/bluedroid/stack/avrc/avrc_bld_ct.c b/components/bt/bluedroid/stack/avrc/avrc_bld_ct.c index 7e23967684..7b6613af3a 100755 --- a/components/bt/bluedroid/stack/avrc/avrc_bld_ct.c +++ b/components/bt/bluedroid/stack/avrc/avrc_bld_ct.c @@ -16,12 +16,14 @@ * ******************************************************************************/ #include - +#include "bt_target.h" #include "gki.h" #include "avrc_api.h" #include "avrc_defs.h" #include "avrc_int.h" +#if (defined(AVRC_INCLUDED) && AVRC_INCLUDED == TRUE) + /***************************************************************************** ** Global data *****************************************************************************/ @@ -248,3 +250,4 @@ tAVRC_STS AVRC_BldCommand( tAVRC_COMMAND *p_cmd, BT_HDR **pp_pkt) } #endif /* (AVRC_METADATA_INCLUDED == TRUE) */ +#endif /* #if (defined(AVRC_INCLUDED) && AVRC_INCLUDED == TRUE) */ diff --git a/components/bt/bluedroid/stack/avrc/avrc_bld_tg.c b/components/bt/bluedroid/stack/avrc/avrc_bld_tg.c index 5bf7ecf4eb..a9d0b50cbd 100755 --- a/components/bt/bluedroid/stack/avrc/avrc_bld_tg.c +++ b/components/bt/bluedroid/stack/avrc/avrc_bld_tg.c @@ -16,13 +16,15 @@ * ******************************************************************************/ #include - +#include "bt_target.h" #include "gki.h" #include "avrc_api.h" #include "avrc_defs.h" #include "avrc_int.h" #include "bt_utils.h" +#if (defined(AVRC_INCLUDED) && AVRC_INCLUDED == TRUE) + /***************************************************************************** ** Global data *****************************************************************************/ @@ -915,3 +917,4 @@ tAVRC_STS AVRC_BldResponse( UINT8 handle, tAVRC_RESPONSE *p_rsp, BT_HDR **pp_pkt #endif /* (AVRC_METADATA_INCLUDED == TRUE)*/ +#endif /* #if (defined(AVRC_INCLUDED) && AVRC_INCLUDED == TRUE) */ diff --git a/components/bt/bluedroid/stack/avrc/avrc_opt.c b/components/bt/bluedroid/stack/avrc/avrc_opt.c index 9dc9413cfc..10cdfdabb6 100755 --- a/components/bt/bluedroid/stack/avrc/avrc_opt.c +++ b/components/bt/bluedroid/stack/avrc/avrc_opt.c @@ -24,11 +24,12 @@ // #include #include "bt_target.h" #include - #include "gki.h" #include "avrc_api.h" #include "avrc_int.h" +#if (defined(AVRC_INCLUDED) && AVRC_INCLUDED == TRUE) + /****************************************************************************** ** ** Function avrc_vendor_msg @@ -230,5 +231,4 @@ UINT16 AVRC_VendorRsp(UINT8 handle, UINT8 label, tAVRC_MSG_VENDOR *p_msg) return AVCT_NO_RESOURCES; } - - +#endif /* #if (defined(AVRC_INCLUDED) && AVRC_INCLUDED == TRUE) */ diff --git a/components/bt/bluedroid/stack/avrc/avrc_pars_ct.c b/components/bt/bluedroid/stack/avrc/avrc_pars_ct.c index 24204eda55..26cb273209 100755 --- a/components/bt/bluedroid/stack/avrc/avrc_pars_ct.c +++ b/components/bt/bluedroid/stack/avrc/avrc_pars_ct.c @@ -16,13 +16,15 @@ * ******************************************************************************/ #include - +#include "bt_target.h" #include "gki.h" #include "avrc_api.h" #include "avrc_defs.h" #include "avrc_int.h" #include "bt_utils.h" +#if (defined(AVRC_INCLUDED) && AVRC_INCLUDED == TRUE) + /***************************************************************************** ** Global data *****************************************************************************/ @@ -148,3 +150,5 @@ tAVRC_STS AVRC_ParsResponse (tAVRC_MSG *p_msg, tAVRC_RESPONSE *p_result, UINT8 * #endif /* (AVRC_METADATA_INCLUDED == TRUE) */ + +#endif /* #if (defined(AVRC_INCLUDED) && AVRC_INCLUDED == TRUE) */ diff --git a/components/bt/bluedroid/stack/avrc/avrc_pars_tg.c b/components/bt/bluedroid/stack/avrc/avrc_pars_tg.c index b709c0f8f7..60c5a5b34c 100755 --- a/components/bt/bluedroid/stack/avrc/avrc_pars_tg.c +++ b/components/bt/bluedroid/stack/avrc/avrc_pars_tg.c @@ -16,12 +16,14 @@ * ******************************************************************************/ #include - +#include "bt_target.h" #include "gki.h" #include "avrc_api.h" #include "avrc_defs.h" #include "avrc_int.h" +#if (defined(AVRC_INCLUDED) && AVRC_INCLUDED == TRUE) + /***************************************************************************** ** Global data *****************************************************************************/ @@ -320,3 +322,4 @@ tAVRC_STS AVRC_ParsCommand (tAVRC_MSG *p_msg, tAVRC_COMMAND *p_result, UINT8 *p_ #endif /* (AVRC_METADATA_INCLUDED == TRUE) */ +#endif /* #if (defined(AVRC_INCLUDED) && AVRC_INCLUDED == TRUE) */ diff --git a/components/bt/bluedroid/stack/avrc/avrc_sdp.c b/components/bt/bluedroid/stack/avrc/avrc_sdp.c index ba10c1c5a5..5cd20734e7 100755 --- a/components/bt/bluedroid/stack/avrc/avrc_sdp.c +++ b/components/bt/bluedroid/stack/avrc/avrc_sdp.c @@ -22,11 +22,13 @@ * ******************************************************************************/ #include - +#include "bt_target.h" #include "gki.h" #include "avrc_api.h" #include "avrc_int.h" +#if (defined(AVRC_INCLUDED) && AVRC_INCLUDED == TRUE) + #ifndef SDP_AVRCP_1_4 #define SDP_AVRCP_1_4 FALSE #endif @@ -350,3 +352,4 @@ void AVRC_Init(void) #endif } +#endif /* #if (defined(AVRC_INCLUDED) && AVRC_INCLUDED == TRUE) */ diff --git a/components/bt/bluedroid/stack/avrc/avrc_utils.c b/components/bt/bluedroid/stack/avrc/avrc_utils.c index 432ecc0cd6..1346d3bf82 100755 --- a/components/bt/bluedroid/stack/avrc/avrc_utils.c +++ b/components/bt/bluedroid/stack/avrc/avrc_utils.c @@ -16,11 +16,12 @@ * ******************************************************************************/ #include - +#include "bt_target.h" #include "gki.h" #include "avrc_api.h" #include "avrc_int.h" +#if (defined(AVRC_INCLUDED) && AVRC_INCLUDED == TRUE) #if (AVRC_METADATA_INCLUDED == TRUE) @@ -237,3 +238,4 @@ BOOLEAN avrc_is_valid_opcode(UINT8 opcode) #endif /* (AVRC_METADATA_INCLUDED == TRUE) */ +#endif /* #if (defined(AVRC_INCLUDED) && AVRC_INCLUDED == TRUE) */ diff --git a/components/bt/component.mk b/components/bt/component.mk index 4323a929cb..d9d6e1cf3a 100644 --- a/components/bt/component.mk +++ b/components/bt/component.mk @@ -18,7 +18,6 @@ COMPONENT_ADD_INCLUDEDIRS := bluedroid/bta/include \ bluedroid/btc/profile/std/gatt/include \ bluedroid/btc/profile/std/gap/include \ bluedroid/btc/profile/std/a2dp/include \ - bluedroid/btc/profile/std/sdp/include \ bluedroid/btc/profile/std/include \ bluedroid/btc/include \ bluedroid/btif/include \