From: wangmengyang Date: Tue, 27 Dec 2016 05:48:07 +0000 (+0800) Subject: component/bt: fix API typos, add license headers and fix some log messages X-Git-Tag: v2.1-rc1~196^2~51 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=d7c1c0b1f6d56d19b40cddd6bef335e0e393f6e8;p=esp-idf component/bt: fix API typos, add license headers and fix some log messages --- diff --git a/components/bt/bluedroid/api/include/esp_a2dp_api.h b/components/bt/bluedroid/api/include/esp_a2dp_api.h index 5a9c992862..8ff1a0cc6a 100644 --- a/components/bt/bluedroid/api/include/esp_a2dp_api.h +++ b/components/bt/bluedroid/api/include/esp_a2dp_api.h @@ -1,3 +1,17 @@ +// 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_A2DP_API_H__ #define __ESP_A2DP_API_H__ @@ -13,7 +27,7 @@ typedef uint8_t esp_a2d_mct_t; /** - * @brief Codec specific information for different codec types + * @brief Codec specific information elements as defined in A2DP spec. */ /** @@ -131,7 +145,7 @@ esp_err_t esp_a2d_register_callback(esp_profile_cb_t callback); /** * @brief This function is called to register A2DP sink data output function - * currently only supports SBC codec, and the output data is PCM format + * for now only supports SBC codec, and the output is PCM data stream * * @param[in] callback: A2DP data callback function * diff --git a/components/bt/bluedroid/btif/btif_media_task.c b/components/bt/bluedroid/btif/btif_media_task.c index c2ab0bc6cd..992a324b10 100644 --- a/components/bt/bluedroid/btif/btif_media_task.c +++ b/components/bt/bluedroid/btif/btif_media_task.c @@ -700,14 +700,7 @@ static void btif_media_task_avk_handle_timer(UNUSED_ATTR void *context) {} static void btif_media_thread_init(UNUSED_ATTR void *context) { memset(&btif_media_cb, 0, sizeof(btif_media_cb)); - LOG_ERROR("med thread init\n"); -#if (UIPC_INCLUDED == TRUE) - UIPC_Init(NULL); - -#if (BTA_AV_INCLUDED == TRUE) - UIPC_Open(UIPC_CH_ID_AV_CTRL , btif_a2dp_ctrl_cb); -#endif ( BTA_AV_INCLUDED == TRUE) -#endif /* UIPC_INCLUDED == TRUE */ + LOG_INFO("media thread init\n"); btif_media_cb.av_sm_hdl = btif_av_get_sm_handle(); raise_priority_a2dp(TASK_HIGH_MEDIA); media_task_running = MEDIA_TASK_STATE_ON; diff --git a/components/bt/bluedroid/main/bte_main.c b/components/bt/bluedroid/main/bte_main.c index 1ca3946d62..a973877a2a 100644 --- a/components/bt/bluedroid/main/bte_main.c +++ b/components/bt/bluedroid/main/bte_main.c @@ -207,7 +207,7 @@ static void bte_main_enable(void) } //Now Test Case Not Supported BTU - LOG_ERROR("Startup BTU\n"); + LOG_INFO("Startup BTU\n"); BTU_StartUp(); } diff --git a/components/bt/bluedroid/osi/alarm.c b/components/bt/bluedroid/osi/alarm.c index 1815705d59..4c36f47973 100644 --- a/components/bt/bluedroid/osi/alarm.c +++ b/components/bt/bluedroid/osi/alarm.c @@ -107,7 +107,7 @@ osi_alarm_t *osi_alarm_new(char *alarm_name, osi_alarm_callback_t callback, void int osi_alarm_free(osi_alarm_t *alarm) { if (!alarm) { - LOG_ERROR("%s null\n", __func__); + LOG_INFO("%s null\n", __func__); return -1; } diff --git a/examples/09_a2dp/components/bluedroid_demos/app_core/bt_app_main.c b/examples/09_a2dp/components/bluedroid_demos/app_core/bt_app_main.c index 1f47962aa3..1d79d2f2b0 100644 --- a/examples/09_a2dp/components/bluedroid_demos/app_core/bt_app_main.c +++ b/examples/09_a2dp/components/bluedroid_demos/app_core/bt_app_main.c @@ -61,7 +61,7 @@ static bool bt_app_post_msg(bt_app_msg_t *msg) static void bt_app_context_switched(bt_app_msg_t *msg) { - BT_APP_TRACE_DEBUG(" context switched\n"); + BT_APP_TRACE_DEBUG("bt app context switched\n"); if (msg->cb) { msg->cb(msg->event, msg->param); } diff --git a/examples/09_a2dp/components/bluedroid_demos/app_project/SampleA2dp.c b/examples/09_a2dp/components/bluedroid_demos/app_project/SampleA2dp.c index 28f231b6a6..21522ade75 100644 --- a/examples/09_a2dp/components/bluedroid_demos/app_project/SampleA2dp.c +++ b/examples/09_a2dp/components/bluedroid_demos/app_project/SampleA2dp.c @@ -51,7 +51,7 @@ static void bt_app_a2d_data_cb(uint8_t *data, uint32_t len) static void bt_app_handle_evt(UINT16 event, void *p_param) { - BT_APP_TRACE_EVENT("bt_app_handle_evt 0x%x\n", event); + BT_APP_TRACE_DEBUG("bt_app_handle_evt 0x%x\n", event); esp_a2d_cb_param_t *a2d = NULL; switch (event) { case BT_APP_EVT_STACK_ON: { @@ -68,20 +68,20 @@ static void bt_app_handle_evt(UINT16 event, void *p_param) } case ESP_A2D_CONNECTION_STATE_EVT: { a2d = (esp_a2d_cb_param_t *)(p_param); - BT_APP_TRACE_ERROR("===a2dp conn_state_cb %d ===\n", a2d->conn_stat.state); + BT_APP_TRACE_EVENT("===a2dp conn_state_cb %d ===\n", a2d->conn_stat.state); break; } case ESP_A2D_AUDIO_STATE_EVT: { a2d = (esp_a2d_cb_param_t *)(p_param); - BT_APP_TRACE_ERROR("===a2dp audio_state_cb %d ===\n", a2d->audio_stat.state); + BT_APP_TRACE_EVENT("===a2dp audio_state_cb %d ===\n", a2d->audio_stat.state); break; } case ESP_A2D_AUDIO_CFG_EVT: { a2d = (esp_a2d_cb_param_t *)(p_param); - BT_APP_TRACE_ERROR("===a2dp audio_cfg_cb type %d ===\n", a2d->audio_cfg.mcc.type); + BT_APP_TRACE_EVENT("===a2dp audio_cfg_cb type %d ===\n", a2d->audio_cfg.mcc.type); if (a2d->audio_cfg.mcc.type == ESP_A2D_MCT_SBC) { // temporarily hardcoded the PCM configuaration - BT_APP_TRACE_ERROR("configure audio player\n"); + BT_APP_TRACE_EVENT("configure audio player\n"); // EspAudioPlayerStreamCfg(StreamSampleRate_44k, 2, StreamBitLen_16BIT); // EspAudio_SetupStream("stream.pcm", InputSrcType_Stream); // EspAudio_SetVolume(99);