component/bt: fix API typos, add license headers and fix some log messages

This commit is contained in:
wangmengyang 2016-12-27 13:48:07 +08:00
parent 9b6247a507
commit d7c1c0b1f6
6 changed files with 25 additions and 18 deletions

View 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__ #ifndef __ESP_A2DP_API_H__
#define __ESP_A2DP_API_H__ #define __ESP_A2DP_API_H__
@ -13,7 +27,7 @@
typedef uint8_t esp_a2d_mct_t; 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 * @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 * @param[in] callback: A2DP data callback function
* *

View 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) static void btif_media_thread_init(UNUSED_ATTR void *context)
{ {
memset(&btif_media_cb, 0, sizeof(btif_media_cb)); memset(&btif_media_cb, 0, sizeof(btif_media_cb));
LOG_ERROR("med thread init\n"); LOG_INFO("media 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 */
btif_media_cb.av_sm_hdl = btif_av_get_sm_handle(); btif_media_cb.av_sm_hdl = btif_av_get_sm_handle();
raise_priority_a2dp(TASK_HIGH_MEDIA); raise_priority_a2dp(TASK_HIGH_MEDIA);
media_task_running = MEDIA_TASK_STATE_ON; media_task_running = MEDIA_TASK_STATE_ON;

View file

@ -207,7 +207,7 @@ static void bte_main_enable(void)
} }
//Now Test Case Not Supported BTU //Now Test Case Not Supported BTU
LOG_ERROR("Startup BTU\n"); LOG_INFO("Startup BTU\n");
BTU_StartUp(); BTU_StartUp();
} }

View 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) int osi_alarm_free(osi_alarm_t *alarm)
{ {
if (!alarm) { if (!alarm) {
LOG_ERROR("%s null\n", __func__); LOG_INFO("%s null\n", __func__);
return -1; return -1;
} }

View 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) 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) { if (msg->cb) {
msg->cb(msg->event, msg->param); msg->cb(msg->event, msg->param);
} }

View 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) 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; esp_a2d_cb_param_t *a2d = NULL;
switch (event) { switch (event) {
case BT_APP_EVT_STACK_ON: { 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: { case ESP_A2D_CONNECTION_STATE_EVT: {
a2d = (esp_a2d_cb_param_t *)(p_param); 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; break;
} }
case ESP_A2D_AUDIO_STATE_EVT: { case ESP_A2D_AUDIO_STATE_EVT: {
a2d = (esp_a2d_cb_param_t *)(p_param); 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; break;
} }
case ESP_A2D_AUDIO_CFG_EVT: { case ESP_A2D_AUDIO_CFG_EVT: {
a2d = (esp_a2d_cb_param_t *)(p_param); 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) { if (a2d->audio_cfg.mcc.type == ESP_A2D_MCT_SBC) {
// temporarily hardcoded the PCM configuaration // 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); // EspAudioPlayerStreamCfg(StreamSampleRate_44k, 2, StreamBitLen_16BIT);
// EspAudio_SetupStream("stream.pcm", InputSrcType_Stream); // EspAudio_SetupStream("stream.pcm", InputSrcType_Stream);
// EspAudio_SetVolume(99); // EspAudio_SetVolume(99);