]> granicus.if.org Git - esp-idf/commitdiff
component/bt: fix API typos, add license headers and fix some log messages
authorwangmengyang <wangmengyang@espressif.com>
Tue, 27 Dec 2016 05:48:07 +0000 (13:48 +0800)
committerwangmengyang <wangmengyang@espressif.com>
Tue, 27 Dec 2016 05:48:07 +0000 (13:48 +0800)
components/bt/bluedroid/api/include/esp_a2dp_api.h
components/bt/bluedroid/btif/btif_media_task.c
components/bt/bluedroid/main/bte_main.c
components/bt/bluedroid/osi/alarm.c
examples/09_a2dp/components/bluedroid_demos/app_core/bt_app_main.c
examples/09_a2dp/components/bluedroid_demos/app_project/SampleA2dp.c

index 5a9c9928624724e6865c4f929f5662e2e3086fdc..8ff1a0cc6afdaa750426431d1db1e213243e7d40 100644 (file)
@@ -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
  *
index c2ab0bc6cd897daf71df78a2e79167db8de89c9a..992a324b10c47bfeceffba18eaea0004752aa4f1 100644 (file)
@@ -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;
index 1ca3946d62d4747931185523c2558b4ee04f1440..a973877a2ade5cde75ca8ea64b1b59efd804cc92 100644 (file)
@@ -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();
 }
 
index 1815705d59471068adcc5eae47946c6711a5de1b..4c36f479734678edc324cfb532920c0e0f5817c3 100644 (file)
@@ -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;
     }
 
index 1f47962aa3cc60c41017a6fd9859d91b9d29f35a..1d79d2f2b058b0c06e45ddf4600cae240427784a 100644 (file)
@@ -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);
     }
index 28f231b6a67d4e64c7895593b9f2af0228e6c0d4..21522ade75c27911585efdd1d7fe975ad8344590 100644 (file)
@@ -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);