diff --git a/components/bt/bluedroid/bta/av/bta_av_act.c b/components/bt/bluedroid/bta/av/bta_av_act.c index 8c9840e4b8..b1b0e5805b 100755 --- a/components/bt/bluedroid/bta/av/bta_av_act.c +++ b/components/bt/bluedroid/bta/av/bta_av_act.c @@ -506,7 +506,7 @@ void bta_av_rc_opened(tBTA_AV_CB *p_cb, tBTA_AV_DATA *p_data) p_scb->rc_handle = p_data->rc_conn_chg.handle; APPL_TRACE_DEBUG("bta_av_rc_opened shdl:%d, srch %d", i + 1, p_scb->rc_handle); shdl = i+1; - APPL_TRACE_DEBUG("%s allow incoming AVRCP connections:%d", __func__, p_scb->use_rc); + LOG_INFO("%s allow incoming AVRCP connections:%d", __func__, p_scb->use_rc); bta_sys_stop_timer(&p_scb->timer); disc = p_scb->hndl; break; diff --git a/components/bt/bluedroid/bta/av/bta_av_main.c b/components/bt/bluedroid/bta/av/bta_av_main.c index 7acf903ca4..cbe6b12f99 100755 --- a/components/bt/bluedroid/bta/av/bta_av_main.c +++ b/components/bt/bluedroid/bta/av/bta_av_main.c @@ -38,6 +38,7 @@ #if( defined BTA_AR_INCLUDED ) && (BTA_AR_INCLUDED == TRUE) #include "bta_ar_api.h" #endif +#include "osi.h" /***************************************************************************** ** Constants and types @@ -407,7 +408,7 @@ static tBTA_AV_SCB * bta_av_alloc_scb(tBTA_AV_CHNL chnl) ** Returns void ** *******************************************************************************/ -static void bta_av_free_scb(tBTA_AV_SCB *p_scb) +UNUSED_ATTR static void bta_av_free_scb(tBTA_AV_SCB *p_scb) { // NOTE(google) This free currently is not called assert(p_scb != NULL); diff --git a/components/bt/bluedroid/bta/dm/bta_dm_act.c b/components/bt/bluedroid/bta/dm/bta_dm_act.c index 8ebd3a8f31..37c616d1ca 100644 --- a/components/bt/bluedroid/bta/dm/bta_dm_act.c +++ b/components/bt/bluedroid/bta/dm/bta_dm_act.c @@ -65,7 +65,9 @@ static void bta_dm_bl_change_cback (tBTM_BL_EVENT_DATA *p_data); static void bta_dm_policy_cback(tBTA_SYS_CONN_STATUS status, UINT8 id, UINT8 app_id, BD_ADDR peer_addr); /* Extended Inquiry Response */ +#if (BTM_LOCAL_IO_CAPS != BTM_IO_CAP_NONE) static UINT8 bta_dm_sp_cback (tBTM_SP_EVT event, tBTM_SP_EVT_DATA *p_data); +#endif /* (BTM_LOCAL_IO_CAPS != BTM_IO_CAP_NONE) */ static void bta_dm_set_eir (char *local_name); @@ -2714,6 +2716,7 @@ static UINT8 bta_dm_authentication_complete_cback(BD_ADDR bd_addr, DEV_CLASS dev return BTM_SUCCESS; } +#if (BTM_LOCAL_IO_CAPS != BTM_IO_CAP_NONE) /******************************************************************************* ** ** Function bta_dm_sp_cback @@ -2868,6 +2871,7 @@ static UINT8 bta_dm_sp_cback (tBTM_SP_EVT event, tBTM_SP_EVT_DATA *p_data) APPL_TRACE_EVENT("dm status: %d", status); return status; } +#endif /* (BTM_LOCAL_IO_CAPS != BTM_IO_CAP_NONE) */ /******************************************************************************* ** diff --git a/components/bt/bluedroid/bta/include/bta_api.h b/components/bt/bluedroid/bta/include/bta_api.h index 3e8e6bbdf6..8e4b927aa4 100644 --- a/components/bt/bluedroid/bta/include/bta_api.h +++ b/components/bt/bluedroid/bta/include/bta_api.h @@ -28,7 +28,7 @@ #include "bt_target.h" #include "bt_types.h" #include "btm_api.h" -#include "uipc_msg.h" +// #include "uipc_msg.h" #include "sdp_api.h" #if BLE_INCLUDED == TRUE diff --git a/components/bt/bluedroid/bta/sys/bta_sys_main.c b/components/bt/bluedroid/bta/sys/bta_sys_main.c index 56c1d051f5..59b9ed4d37 100644 --- a/components/bt/bluedroid/bta/sys/bta_sys_main.c +++ b/components/bt/bluedroid/bta/sys/bta_sys_main.c @@ -59,8 +59,8 @@ static pthread_mutex_t bta_alarm_lock; /* trace level */ /* TODO Bluedroid - Hard-coded trace levels - Needs to be configurable */ -UINT8 appl_trace_level = APPL_INITIAL_TRACE_LEVEL; -UINT8 btif_trace_level = BT_TRACE_LEVEL_NONE; +UINT8 appl_trace_level = BT_TRACE_LEVEL_WARNING; //APPL_INITIAL_TRACE_LEVEL; +UINT8 btif_trace_level = BT_TRACE_LEVEL_WARNING; // Communication queue between btu_task and bta. extern fixed_queue_t *btu_bta_msg_queue; @@ -609,7 +609,7 @@ void bta_sys_start_timer(TIMER_LIST_ENT *p_tle, UINT16 type, INT32 timeout_ms) // Get the alarm for this p_tle. pthread_mutex_lock(&bta_alarm_lock); if (!hash_map_has_key(bta_alarm_hash_map, p_tle)) { - hash_map_set(bta_alarm_hash_map, p_tle, osi_alarm_new("bta_sys", bta_alarm_cb, p_tle, 0, false)); + hash_map_set(bta_alarm_hash_map, p_tle, osi_alarm_new("bta_sys", bta_alarm_cb, p_tle, 0)); } pthread_mutex_unlock(&bta_alarm_lock); diff --git a/components/bt/bluedroid/btc/core/btc_config.c b/components/bt/bluedroid/btc/core/btc_config.c index 5b642ea2f9..bd0bd03187 100644 --- a/components/bt/bluedroid/btc/core/btc_config.c +++ b/components/bt/bluedroid/btc/core/btc_config.c @@ -101,7 +101,7 @@ bool btc_config_init(void) // TODO(sharvil): use a non-wake alarm for this once we have // API support for it. There's no need to wake the system to // write back to disk. - alarm_timer = osi_alarm_new("btc_config", timer_config_save, NULL, CONFIG_SETTLE_PERIOD_MS, false); + alarm_timer = osi_alarm_new("btc_config", timer_config_save, NULL, CONFIG_SETTLE_PERIOD_MS); if (!alarm_timer) { LOG_ERROR("%s unable to create alarm.\n", __func__); goto error; diff --git a/components/bt/bluedroid/btc/core/btc_main.c b/components/bt/bluedroid/btc/core/btc_main.c index ae3d3f5fc9..9181b6ab2a 100644 --- a/components/bt/bluedroid/btc/core/btc_main.c +++ b/components/bt/bluedroid/btc/core/btc_main.c @@ -29,18 +29,6 @@ future_t **btc_main_get_future_p(btc_main_future_type_t type) return &main_future[type]; } -static void btc_sec_callback(tBTA_DM_SEC_EVT event, tBTA_DM_SEC *p_data) -{ - switch (event) { - case BTA_DM_ENABLE_EVT: - future_ready(*btc_main_get_future_p(BTC_MAIN_ENABLE_FUTURE), FUTURE_SUCCESS); - break; - case BTA_DM_DISABLE_EVT: - future_ready(*btc_main_get_future_p(BTC_MAIN_DISABLE_FUTURE), FUTURE_SUCCESS); - break; - } -} - static void btc_enable_bluetooth(void) { if (BTA_EnableBluetooth(btc_dm_sec_evt) != BTA_SUCCESS) { 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 4e037b3c8c..02290bc3f5 100644 --- a/components/bt/bluedroid/btc/profile/std/a2dp/btc_avk.c +++ b/components/bt/bluedroid/btc/profile/std/a2dp/btc_avk.c @@ -152,7 +152,7 @@ static const char *dump_av_sm_state_name(btc_av_state_t state) } } -static const char *dump_av_sm_event_name(btc_av_sm_event_t event) +UNUSED_ATTR static const char *dump_av_sm_event_name(btc_av_sm_event_t event) { switch ((int)event) { CASE_RETURN_STR(BTA_AV_ENABLE_EVT) 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 97e366baec..ae190b4f06 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 @@ -228,14 +228,6 @@ static void btc_media_data_post(void) } } -static void btc_media_data_handler(BtTaskEvt_t *e) -{ - if (e == NULL) { - return; - } - btc_media_task_avk_data_ready(NULL); -} - static void btc_media_ctrl_handler(BtTaskEvt_t *e) { if (e == NULL) diff --git a/components/bt/bluedroid/gki/gki_buffer.c b/components/bt/bluedroid/gki/gki_buffer.c index bb7ccd17db..9ce9a12149 100644 --- a/components/bt/bluedroid/gki/gki_buffer.c +++ b/components/bt/bluedroid/gki/gki_buffer.c @@ -181,7 +181,6 @@ void GKI_init_q (BUFFER_Q *p_q) void *GKI_getbuf_func(UINT16 size) { BUFFER_HDR_T *header = osi_malloc(size + BUFFER_HDR_SIZE); - assert(header != NULL); if (header != NULL) { header->status = BUF_STATUS_UNLINKED; header->p_next = NULL; diff --git a/components/bt/bluedroid/hci/hci_hal_h4.c b/components/bt/bluedroid/hci/hci_hal_h4.c index 5d4824d9b0..f26365e3ac 100644 --- a/components/bt/bluedroid/hci/hci_hal_h4.c +++ b/components/bt/bluedroid/hci/hci_hal_h4.c @@ -107,6 +107,7 @@ static bool hal_open(const hci_hal_callbacks_t *upper_callbacks) //register vhci host cb esp_vhci_host_register_callback(&vhci_host_cb); + return true; } @@ -159,6 +160,7 @@ static uint16_t transmit_data(serial_data_type_t type, static void hci_hal_h4_rx_handler(void *arg) { BtTaskEvt_t e; + for (;;) { if (pdTRUE == xQueueReceive(xHciH4Queue, &e, (portTickType)portMAX_DELAY)) { if (e.sig == 0xff) { diff --git a/components/bt/bluedroid/hci/hci_layer.c b/components/bt/bluedroid/hci/hci_layer.c index f39c06caed..8534436fb0 100644 --- a/components/bt/bluedroid/hci/hci_layer.c +++ b/components/bt/bluedroid/hci/hci_layer.c @@ -184,7 +184,7 @@ static int hci_layer_init_env(void) return -1; } pthread_mutex_init(&cmd_wait_q->commands_pending_response_lock, NULL); - cmd_wait_q->command_response_timer = osi_alarm_new("cmd_rsp_to", command_timed_out, cmd_wait_q, COMMAND_PENDING_TIMEOUT, false); + cmd_wait_q->command_response_timer = osi_alarm_new("cmd_rsp_to", command_timed_out, cmd_wait_q, COMMAND_PENDING_TIMEOUT); if (!cmd_wait_q->command_response_timer) { LOG_ERROR("%s unable to create command response timer.", __func__); return -1; @@ -223,8 +223,10 @@ static void hci_host_thread_handler(void *arg) */ BtTaskEvt_t e; + for (;;) { if (pdTRUE == xQueueReceive(xHciHostQueue, &e, (portTickType)portMAX_DELAY)) { + if (e.sig == 0xff) { if (esp_vhci_host_check_send_available()) { /*Now Target only allowed one packet per TX*/ diff --git a/components/bt/bluedroid/include/bt_defs.h b/components/bt/bluedroid/include/bt_defs.h index ef236f663d..3f12d578a1 100644 --- a/components/bt/bluedroid/include/bt_defs.h +++ b/components/bt/bluedroid/include/bt_defs.h @@ -28,7 +28,7 @@ #define UNUSED(x) (void)(x) #ifndef SIZE_MAX -#define SIZE_MAX 128 +#define SIZE_MAX 254 #endif /*Timer Related Defination*/ diff --git a/components/bt/bluedroid/main/bte_main.c b/components/bt/bluedroid/main/bte_main.c index a973877a2a..1ca3946d62 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_INFO("Startup BTU\n"); + LOG_ERROR("Startup BTU\n"); BTU_StartUp(); } diff --git a/components/bt/bluedroid/osi/alarm.c b/components/bt/bluedroid/osi/alarm.c index 4c36f47973..6ef8d304ad 100644 --- a/components/bt/bluedroid/osi/alarm.c +++ b/components/bt/bluedroid/osi/alarm.c @@ -73,7 +73,7 @@ static void alarm_cb_handler(TimerHandle_t xTimer) } } -osi_alarm_t *osi_alarm_new(char *alarm_name, osi_alarm_callback_t callback, void *data, period_ms_t timer_expire, bool is_periodic) +osi_alarm_t *osi_alarm_new(char *alarm_name, osi_alarm_callback_t callback, void *data, period_ms_t timer_expire) { struct alarm_t *timer_id; TimerHandle_t t; @@ -89,8 +89,7 @@ osi_alarm_t *osi_alarm_new(char *alarm_name, osi_alarm_callback_t callback, void return NULL; } - portBASE_TYPE auto_reload = is_periodic ? pdTRUE : pdFALSE; - t = xTimerCreate(alarm_name, timer_expire / portTICK_PERIOD_MS, auto_reload, timer_id, alarm_cb_handler); + t = xTimerCreate(alarm_name, timer_expire / portTICK_PERIOD_MS, pdFALSE, timer_id, alarm_cb_handler); if (!t) { LOG_ERROR("%s error\n", __func__); return NULL; @@ -107,7 +106,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_INFO("%s null\n", __func__); + LOG_ERROR("%s null\n", __func__); return -1; } diff --git a/components/bt/bluedroid/osi/include/alarm.h b/components/bt/bluedroid/osi/include/alarm.h index 480bf73d27..2e226ed27f 100644 --- a/components/bt/bluedroid/osi/include/alarm.h +++ b/components/bt/bluedroid/osi/include/alarm.h @@ -20,7 +20,6 @@ #define _ALARM_H_ #include -#include #include #include @@ -40,7 +39,7 @@ void osi_alarm_init(void); // Creates a new alarm object. The returned object must be freed by calling // |alarm_free|. Returns NULL on failure. -osi_alarm_t *osi_alarm_new(char *alarm_name, osi_alarm_callback_t callback, void *data, period_ms_t timer_expire, bool is_periodc); +osi_alarm_t *osi_alarm_new(char *alarm_name, osi_alarm_callback_t callback, void *data, period_ms_t timer_expire); // Frees an alarm object created by |alarm_new|. |alarm| may be NULL. If the // alarm is pending, it will be cancelled. It is not safe to call |alarm_free| diff --git a/components/bt/bluedroid/osi/include/thread.h b/components/bt/bluedroid/osi/include/thread.h index e297a6b2d2..8b61574499 100644 --- a/components/bt/bluedroid/osi/include/thread.h +++ b/components/bt/bluedroid/osi/include/thread.h @@ -40,7 +40,6 @@ enum { SIG_PRF_WORK = 0xfd, SIG_BTU_START_UP = 0xfe, SIG_BTU_WORK = 0xff, - // SIG_BTIF_WORK = 0xff }; #define HCI_HOST_TASK_STACK_SIZE (2048 + BT_TASK_EXTRA_STACK_SIZE) diff --git a/components/bt/bluedroid/stack/btu/btu_task.c b/components/bt/bluedroid/stack/btu/btu_task.c index 1123c064e8..4c640fad7c 100644 --- a/components/bt/bluedroid/stack/btu/btu_task.c +++ b/components/bt/bluedroid/stack/btu/btu_task.c @@ -524,7 +524,7 @@ void btu_start_timer(TIMER_LIST_ENT *p_tle, UINT16 type, UINT32 timeout_sec) // Get the alarm for the timer list entry. pthread_mutex_lock(&btu_general_alarm_lock); if (!hash_map_has_key(btu_general_alarm_hash_map, p_tle)) { - alarm = osi_alarm_new("btu_gen", btu_general_alarm_cb, (void *)p_tle, 0, false); + alarm = osi_alarm_new("btu_gen", btu_general_alarm_cb, (void *)p_tle, 0); hash_map_set(btu_general_alarm_hash_map, p_tle, alarm); } pthread_mutex_unlock(&btu_general_alarm_lock); @@ -614,7 +614,7 @@ void btu_start_quick_timer(TIMER_LIST_ENT *p_tle, UINT16 type, UINT32 timeout_ti // Get the alarm for the timer list entry. pthread_mutex_lock(&btu_l2cap_alarm_lock); if (!hash_map_has_key(btu_l2cap_alarm_hash_map, p_tle)) { - alarm = osi_alarm_new("btu_l2cap", btu_l2cap_alarm_cb, (void *)p_tle, 0, false); + alarm = osi_alarm_new("btu_l2cap", btu_l2cap_alarm_cb, (void *)p_tle, 0); hash_map_set(btu_l2cap_alarm_hash_map, p_tle, (void *)alarm); } pthread_mutex_unlock(&btu_l2cap_alarm_lock); @@ -685,7 +685,7 @@ void btu_start_timer_oneshot(TIMER_LIST_ENT *p_tle, UINT16 type, UINT32 timeout_ // Get the alarm for the timer list entry. pthread_mutex_lock(&btu_oneshot_alarm_lock); if (!hash_map_has_key(btu_oneshot_alarm_hash_map, p_tle)) { - alarm = osi_alarm_new("btu_oneshot", btu_oneshot_alarm_cb, (void *)p_tle, 0, false); + alarm = osi_alarm_new("btu_oneshot", btu_oneshot_alarm_cb, (void *)p_tle, 0); hash_map_set(btu_oneshot_alarm_hash_map, p_tle, alarm); } pthread_mutex_unlock(&btu_oneshot_alarm_lock); diff --git a/components/bt/bluedroid/stack/gatt/gatt_attr.c b/components/bt/bluedroid/stack/gatt/gatt_attr.c index f50a6491f2..421b17cab7 100755 --- a/components/bt/bluedroid/stack/gatt/gatt_attr.c +++ b/components/bt/bluedroid/stack/gatt/gatt_attr.c @@ -279,7 +279,7 @@ void gatt_profile_db_init (void) GATT_StartIf(gatt_cb.gatt_if); service_handle = GATTS_CreateService (gatt_cb.gatt_if , &uuid, 0, GATTP_MAX_ATTR_NUM, TRUE); - GATT_TRACE_DEBUG ("GATTS_CreateService: handle of service handle%x", service_handle); + GATT_TRACE_ERROR ("GATTS_CreateService: handle of service handle%x", service_handle); /* add Service Changed characteristic */ diff --git a/components/bt/bluedroid/stack/include/uipc_msg.h b/components/bt/bluedroid/stack/include/uipc_msg.h deleted file mode 100755 index 53cdccfc84..0000000000 --- a/components/bt/bluedroid/stack/include/uipc_msg.h +++ /dev/null @@ -1,568 +0,0 @@ -/****************************************************************************** - * - * Copyright (C) 1999-2012 Broadcom Corporation - * - * 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. - * - ******************************************************************************/ - -/****************************************************************************** - * - * This file contains sync message over UIPC - * - ******************************************************************************/ - -#ifndef UIPC_MSG_H -#define UIPC_MSG_H - -#include "bt_types.h" - -/****************************************************************************/ -/* UIPC version number: 1.0 */ -/****************************************************************************/ -#define UIPC_VERSION_MAJOR 0x0001 -#define UIPC_VERSION_MINOR 0x0000 - - -/******************************** - - UIPC Management Messages - -********************************/ - -/* tUIPC_STATUS codes*/ -enum -{ - UIPC_STATUS_SUCCESS, - UIPC_STATUS_FAIL -}; -typedef UINT8 tUIPC_STATUS; - -/* op_code */ -#define UIPC_OPEN_REQ 0x00 -#define UIPC_OPEN_RSP 0x01 -#define UIPC_CLOSE_REQ 0x02 -#define UIPC_CLOSE_RSP 0x03 - -/* Structure of UIPC_OPEN_REQ message */ -typedef struct -{ - UINT8 opcode; /* UIPC_OPEN_REQ */ -} tUIPC_OPEN_REQ; -#define UIPC_OPEN_REQ_MSGLEN (1) - -/* Structure of UIPC_OPEN_RSP message */ -typedef struct -{ - UINT8 opcode; /* UIPC_OPEN_RESP */ - tUIPC_STATUS status; /* UIPC_STATUS */ - UINT16 version_major; /* UIPC_VERSION_MAJOR */ - UINT16 version_minor; /* UIPC_VERSION_MINOR */ - UINT8 num_streams; /* Number of simultaneous streams supported by the light stack */ -} tUIPC_OPEN_RSP; -#define UIPC_OPEN_RSP_MSGLEN (7) - -/* Structure of UIPC_CLOSE_REQ message */ -typedef struct t_uipc_close_req -{ - UINT8 opcode; /* UIPC_CLOSE_REQ */ -} tUIPC_CLOSE_REQ; -#define UIPC_CLOSE_REQ_MSGLEN (1) - -/* Structure of UIPC_CLOSE_RSP message, only for BTC, full stack may ignore it */ -typedef struct t_uipc_close_rsp -{ - UINT8 opcode; /* UIPC_CLOSE_RSP */ -} tUIPC_CLOSE_RSP; -#define UIPC_CLOSE_RSP_MSGLEN (1) - -/* UIPC management message structures */ -typedef union -{ - UINT8 opcode; - tUIPC_OPEN_REQ open_req; - tUIPC_OPEN_RSP open_resp; - tUIPC_CLOSE_REQ close_req; -} tUIPC_MSG; - -#define UIPC_MGMT_MSG_MAXLEN (sizeof(tUIPC_MSG)) - -#define IPC_LOG_MSG_LEN 100 -typedef struct t_uipc_log_msg -{ - UINT32 trace_set_mask; - UINT8 msg[IPC_LOG_MSG_LEN]; -} tUIPC_LOG_MSG; -#define UIPC_LOG_MSGLEN (IPC_LOG_MSG_LEN + 4) - -typedef struct -{ - UINT8 opcode; /* A2DP_START_REQ */ - UINT16 lcid; - UINT16 curr_mtu; -}tA2DP_START_REQ; - -typedef struct -{ - UINT8 opcode; /* A2DP_STOP_REQ */ - UINT16 lcid; -}tA2DP_STOP_REQ; - -typedef struct -{ - UINT8 opcode; /* A2DP_SUSPEND_REQ */ - UINT16 lcid; -}tA2DP_SUSPEND_REQ; - -typedef struct -{ - UINT8 opcode; /* A2DP_CLEANUP_REQ */ - UINT16 lcid; - UINT16 curr_mtu; -} tA2DP_CLEANUP_REQ; - -typedef struct -{ - UINT8 opcode; /* A2DP_START_RESP, A2DP_STOP_RESP, A2DP_CLEANUP_RESP, A2DP_SUSPEND_RESP */ - UINT16 lcid; -}tA2DP_GENERIC_RESP; - -#define AUDIO_CODEC_NONE 0x0000 -#define AUDIO_CODEC_SBC_ENC 0x0001 -#define AUDIO_CODEC_SBC_DEC 0x0002 -#define AUDIO_CODEC_MP3_ENC 0x0004 -#define AUDIO_CODEC_MP3_DEC 0x0008 -#define AUDIO_CODEC_AAC_ENC 0x0010 -#define AUDIO_CODEC_AAC_DEC 0x0020 -#define AUDIO_CODEC_AAC_PLUS_ENC 0x0040 -#define AUDIO_CODEC_AAC_PLUS_DEC 0x0080 -#define AUDIO_CODEC_MP2_ENC 0x0100 -#define AUDIO_CODEC_MP2_DEC 0x0200 -#define AUDIO_CODEC_MP2_5_ENC 0x0400 -#define AUDIO_CODEC_MP2_5_DEC 0x0800 - -typedef UINT16 tAUDIO_CODEC_TYPE; - -/* SBC CODEC Parameters */ - -#define CODEC_INFO_SBC_SF_16K 0x00 -#define CODEC_INFO_SBC_SF_32K 0x01 -#define CODEC_INFO_SBC_SF_44K 0x02 -#define CODEC_INFO_SBC_SF_48K 0x03 - -#define CODEC_INFO_SBC_BLOCK_4 0x00 -#define CODEC_INFO_SBC_BLOCK_8 0x01 -#define CODEC_INFO_SBC_BLOCK_12 0x02 -#define CODEC_INFO_SBC_BLOCK_16 0x03 - -#define CODEC_INFO_SBC_CH_MONO 0x00 -#define CODEC_INFO_SBC_CH_DUAL 0x01 -#define CODEC_INFO_SBC_CH_STEREO 0x02 -#define CODEC_INFO_SBC_CH_JS 0x03 - -#define CODEC_INFO_SBC_ALLOC_LOUDNESS 0x00 -#define CODEC_INFO_SBC_ALLOC_SNR 0x01 - -#define CODEC_INFO_SBC_SUBBAND_4 0x00 -#define CODEC_INFO_SBC_SUBBAND_8 0x01 - -/* MPEG audio version ID */ -#define CODEC_INFO_MP25_ID 0x00 -#define CODEC_INFO_RESERVE 0x01 -#define CODEC_INFO_MP2_ID 0x02 -#define CODEC_INFO_MP3_ID 0x03 - -#define CODEC_INFO_MP3_PROTECTION_ON 0x00 -#define CODEC_INFO_MP3_PROTECTION_OFF 0x01 - -#define CODEC_INFO_MP3_BR_IDX_FREE 0x00 -#define CODEC_INFO_MP3_BR_IDX_32K 0x01 -#define CODEC_INFO_MP3_BR_IDX_40K 0x02 -#define CODEC_INFO_MP3_BR_IDX_48K 0x03 -#define CODEC_INFO_MP3_BR_IDX_56K 0x04 -#define CODEC_INFO_MP3_BR_IDX_64K 0x05 -#define CODEC_INFO_MP3_BR_IDX_80K 0x06 -#define CODEC_INFO_MP3_BR_IDX_96K 0x07 -#define CODEC_INFO_MP3_BR_IDX_112K 0x08 -#define CODEC_INFO_MP3_BR_IDX_128K 0x09 -#define CODEC_INFO_MP3_BR_IDX_160K 0x0A -#define CODEC_INFO_MP3_BR_IDX_192K 0x0B -#define CODEC_INFO_MP3_BR_IDX_224K 0x0C -#define CODEC_INFO_MP3_BR_IDX_256K 0x0D -#define CODEC_INFO_MP3_BR_IDX_320K 0x0E - -#define CODEC_INFO_MP3_SF_44K 0x00 -#define CODEC_INFO_MP3_SF_48K 0x01 -#define CODEC_INFO_MP3_SF_32K 0x02 - -#define CODEC_INFO_MP3_MODE_STEREO 0x00 -#define CODEC_INFO_MP3_MODE_JS 0x01 -#define CODEC_INFO_MP3_MODE_DUAL 0x02 -#define CODEC_INFO_MP3_MODE_SINGLE 0x03 - -/* layer 3, type of joint stereo coding method (intensity and ms) */ -#define CODEC_INFO_MP3_MODE_EXT_OFF_OFF 0x00 -#define CODEC_INFO_MP3_MODE_EXT_ON_OFF 0x01 -#define CODEC_INFO_MP3_MODE_EXT_OFF_ON 0x02 -#define CODEC_INFO_MP3_MODE_EXT_ON_ON 0x03 - - -#define CODEC_INFO_MP2_PROTECTION_ON 0x00 -#define CODEC_INFO_MP2_PROTECTION_OFF 0x01 - -#define CODEC_INFO_MP2_BR_IDX_FREE 0x00 -#define CODEC_INFO_MP2_BR_IDX_8K 0x01 -#define CODEC_INFO_MP2_BR_IDX_16K 0x02 -#define CODEC_INFO_MP2_BR_IDX_24K 0x03 -#define CODEC_INFO_MP2_BR_IDX_32K 0x04 -#define CODEC_INFO_MP2_BR_IDX_40K 0x05 -#define CODEC_INFO_MP2_BR_IDX_48K 0x06 -#define CODEC_INFO_MP2_BR_IDX_56K 0x07 -#define CODEC_INFO_MP2_BR_IDX_64K 0x08 -#define CODEC_INFO_MP2_BR_IDX_80K 0x09 -#define CODEC_INFO_MP2_BR_IDX_96K 0x0A -#define CODEC_INFO_MP2_BR_IDX_112K 0x0B -#define CODEC_INFO_MP2_BR_IDX_128K 0x0C -#define CODEC_INFO_MP2_BR_IDX_144K 0x0D -#define CODEC_INFO_MP2_BR_IDX_160K 0x0E - -#define CODEC_INFO_MP2_SF_22K 0x00 -#define CODEC_INFO_MP2_SF_24K 0x01 -#define CODEC_INFO_MP2_SF_16K 0x02 - -#define CODEC_INFO_MP2_MODE_STEREO 0x00 -#define CODEC_INFO_MP2_MODE_JS 0x01 -#define CODEC_INFO_MP2_MODE_DUAL 0x02 -#define CODEC_INFO_MP2_MODE_SINGLE 0x03 - -/* layer 3, type of joint stereo coding method (intensity and ms) */ -#define CODEC_INFO_MP2_MODE_EXT_OFF_OFF 0x00 -#define CODEC_INFO_MP2_MODE_EXT_ON_OFF 0x01 -#define CODEC_INFO_MP2_MODE_EXT_OFF_ON 0x02 -#define CODEC_INFO_MP2_MODE_EXT_ON_ON 0x03 - -#define CODEC_INFO_MP2_SAMPLE_PER_FRAME 576 - -/* mpeg 2.5 layer 3 decoder */ - -#define CODEC_INFO_MP25_PROTECTION_ON 0x00 -#define CODEC_INFO_MP25_PROTECTION_OFF 0x01 - -#define CODEC_INFO_MP25_BR_IDX_FREE 0x00 -#define CODEC_INFO_MP25_BR_IDX_8K 0x01 -#define CODEC_INFO_MP25_BR_IDX_16K 0x02 -#define CODEC_INFO_MP25_BR_IDX_24K 0x03 -#define CODEC_INFO_MP25_BR_IDX_32K 0x04 -#define CODEC_INFO_MP25_BR_IDX_40K 0x05 -#define CODEC_INFO_MP25_BR_IDX_48K 0x06 -#define CODEC_INFO_MP25_BR_IDX_56K 0x07 -#define CODEC_INFO_MP25_BR_IDX_64K 0x08 -#define CODEC_INFO_MP25_BR_IDX_80K 0x09 -#define CODEC_INFO_MP25_BR_IDX_96K 0x0A -#define CODEC_INFO_MP25_BR_IDX_112K 0x0B -#define CODEC_INFO_MP25_BR_IDX_128K 0x0C -#define CODEC_INFO_MP25_BR_IDX_144K 0x0D -#define CODEC_INFO_MP25_BR_IDX_160K 0x0E - -#define CODEC_INFO_MP25_SF_11K 0x00 -#define CODEC_INFO_MP25_SF_12K 0x01 -#define CODEC_INFO_MP25_SF_8K 0x02 - -#define CODEC_INFO_MP25_MODE_STEREO 0x00 -#define CODEC_INFO_MP25_MODE_JS 0x01 -#define CODEC_INFO_MP25_MODE_DUAL 0x02 -#define CODEC_INFO_MP25_MODE_SINGLE 0x03 - -/* layer 3, type of joint stereo coding method (intensity and ms) */ -#define CODEC_INFO_MP25_MODE_EXT_OFF_OFF 0x00 -#define CODEC_INFO_MP25_MODE_EXT_ON_OFF 0x01 -#define CODEC_INFO_MP25_MODE_EXT_OFF_ON 0x02 -#define CODEC_INFO_MP25_MODE_EXT_ON_ON 0x03 - -#define CODEC_INFO_MP25_SAMPLE_PER_FRAME 576 - -/* AAC/AAC+ CODEC Parameters */ -#define CODEC_INFO_AAC_SF_IDX_96K 0x0 -#define CODEC_INFO_AAC_SF_IDX_88K 0x1 -#define CODEC_INFO_AAC_SF_IDX_64K 0x2 -#define CODEC_INFO_AAC_SF_IDX_48K 0x3 -#define CODEC_INFO_AAC_SF_IDX_44K 0x4 -#define CODEC_INFO_AAC_SF_IDX_32K 0x5 -#define CODEC_INFO_AAC_SF_IDX_24K 0x6 -#define CODEC_INFO_AAC_SF_IDX_22K 0x7 -#define CODEC_INFO_AAC_SF_IDX_16K 0x8 -#define CODEC_INFO_AAC_SF_IDX_12K 0x9 -#define CODEC_INFO_AAC_SF_IDX_11K 0xA -#define CODEC_INFO_AAC_SF_IDX_08K 0xB -#define CODEC_INFO_AAC_SF_IDX_RESERVE 0xC - -#define CODEC_INFO_AAC_BR_RATE_48K 288000 -#define CODEC_INFO_AAC_BR_RATE_44K 264600 -#define CODEC_INFO_AAC_BR_RATE_32K 192000 - - -#define CODEC_INFO_AAC_1_CH 1 /*center front speaker */ -#define CODEC_INFO_AAC_2_CH 2 /*left, right front speaker */ -#define CODEC_INFO_AAC_3_CH 3 /*center front speaker, left right front speaker */ -#define CODEC_INFO_AAC_4_CH 4 /*center/rear front speaker, left/right front speaker */ -#define CODEC_INFO_AAC_5_CH 5 /*center, left, right front speaker, left/right surround */ -#define CODEC_INFO_AAC_6_CH 6 /*center, left, right front speaker, left/right surround, LFE */ -#define CODEC_INFO_AAC_7_CH 7 /*(left, right)center/left,right front speaker, left/right surround, LFE */ - - -typedef struct -{ - UINT8 sampling_freq; - UINT8 channel_mode; - UINT8 block_length; - UINT8 num_subbands; - UINT8 alloc_method; - UINT8 bitpool_size; /* 2 - 250 */ -} tCODEC_INFO_SBC; - -typedef struct -{ - UINT8 ch_mode; - UINT8 sampling_freq; - UINT8 bitrate_index; /* 0 - 14 */ -} tCODEC_INFO_MP3; - -typedef struct -{ - UINT8 ch_mode; - UINT8 sampling_freq; - UINT8 bitrate_index; /* 0 - 14 */ -} tCODEC_INFO_MP2; - - -typedef struct -{ - UINT8 ch_mode; - UINT8 sampling_freq; - UINT8 bitrate_index; /* 0 - 14 */ -} tCODEC_INFO_MP2_5; - -typedef struct -{ - UINT16 sampling_freq; - UINT8 channel_mode; /* 0x02:mono, 0x01:dual */ - UINT32 bitrate; /* 0 - 320K */ - UINT32 sbr_profile; /* 1: ON, 0: OFF */ -} tCODEC_INFO_AAC; - -typedef union -{ - tCODEC_INFO_SBC sbc; - tCODEC_INFO_MP3 mp3; - tCODEC_INFO_MP2 mp2; - tCODEC_INFO_MP2_5 mp2_5; - tCODEC_INFO_AAC aac; -} tCODEC_INFO; - -typedef struct -{ - UINT8 opcode; /* AUDIO_CODEC_CONFIG_REQ */ - tAUDIO_CODEC_TYPE codec_type; - tCODEC_INFO codec_info; -} tAUDIO_CODEC_CONFIG_REQ; - -#define AUDIO_CONFIG_SUCCESS 0x00 -#define AUDIO_CONFIG_NOT_SUPPORTED 0x01 -#define AUDIO_CONFIG_FAIL_OUT_OF_MEMORY 0x02 -#define AUDIO_CONFIG_FAIL_CODEC_USED 0x03 -#define AUDIO_CONFIG_FAIL_ROUTE 0x04 -typedef UINT8 tAUDIO_CONFIG_STATUS; - -typedef struct -{ - UINT8 opcode; /* AUDIO_CODEC_CONFIG_RESP */ - tAUDIO_CONFIG_STATUS status; -} tAUDIO_CODEC_CONFIG_RESP; - -typedef struct -{ - UINT8 opcode; /* AUDIO_CODEC_SET_BITRATE_REQ */ - tAUDIO_CODEC_TYPE codec_type; - union - { - UINT8 sbc; - UINT8 mp3; - UINT32 aac; - } codec_bitrate; -} tAUDIO_CODEC_SET_BITRATE_REQ; - -#define AUDIO_ROUTE_SRC_FMRX 0x00 -#define AUDIO_ROUTE_SRC_I2S 0x01 -#define AUDIO_ROUTE_SRC_ADC 0x02 -#define AUDIO_ROUTE_SRC_HOST 0x03 -#define AUDIO_ROUTE_SRC_PTU 0x04 -#define AUDIO_ROUTE_SRC_BTSNK 0x05 -#define AUDIO_ROUTE_SRC_NONE 0x80 -#define MAX_AUDIO_ROUTE_SRC 6 -typedef UINT8 tAUDIO_ROUTE_SRC; - -#define AUDIO_ROUTE_MIX_NONE 0x00 -#define AUDIO_ROUTE_MIX_HOST 0x01 -#define AUDIO_ROUTE_MIX_PCM 0x02 -#define AUDIO_ROUTE_MIX_CHIRP 0x03 -#define AUDIO_ROUTE_MIX_I2S 0x04 -#define AUDIO_ROUTE_MIX_ADC 0x05 -#define AUDIO_ROUTE_MIX_RESERVED 0x06 -#define MAX_AUDIO_ROUTE_MIX 7 -typedef UINT8 tAUDIO_ROUTE_MIX; - -#define AUDIO_ROUTE_OUT_NONE 0x0000 -#define AUDIO_ROUTE_OUT_BTA2DP 0x0001 -#define AUDIO_ROUTE_OUT_FMTX 0x0002 -#define AUDIO_ROUTE_OUT_BTSCO 0x0004 -#define AUDIO_ROUTE_OUT_HOST 0x0008 -#define AUDIO_ROUTE_OUT_DAC 0x0010 -#define AUDIO_ROUTE_OUT_I2S 0x0020 -#define AUDIO_ROUTE_OUT_BTA2DP_DAC 0x0040 -#define AUDIO_ROUTE_OUT_BTA2DP_I2S 0x0080 -#define AUDIO_ROUTE_OUT_BTSCO_DAC 0x0100 -#define AUDIO_ROUTE_OUT_BTSCO_I2S 0x0200 -#define AUDIO_ROUTE_OUT_HOST_BTA2DP 0x0400 -#define AUDIO_ROUTE_OUT_HOST_BTSCO 0x0800 -#define AUDIO_ROUTE_OUT_HOST_DAC 0x1000 -#define AUDIO_ROUTE_OUT_HOST_I2S 0x2000 -#define AUDIO_ROUTE_OUT_DAC_I2S 0x4000 -#define AUDIO_ROUTE_OUT_RESERVED_2 0x8000 - -#define MAX_AUDIO_SINGLE_ROUTE_OUT 6 -#define MAX_AUDIO_MULTI_ROUTE_OUT 16 -typedef UINT16 tAUDIO_MULTI_ROUTE_OUT; -typedef UINT8 tAUDIO_ROUTE_OUT; - -#define AUDIO_ROUTE_SF_8K 0x00 -#define AUDIO_ROUTE_SF_16K 0x01 -#define AUDIO_ROUTE_SF_32K 0x02 -#define AUDIO_ROUTE_SF_44_1K 0x03 -#define AUDIO_ROUTE_SF_48K 0x04 -#define AUDIO_ROUTE_SF_11K 0x05 -#define AUDIO_ROUTE_SF_12K 0x06 -#define AUDIO_ROUTE_SF_22K 0x07 -#define AUDIO_ROUTE_SF_24K 0x08 -#define AUDIO_ROUTE_SF_NA 0xFF -typedef UINT8 tAUDIO_ROUTE_SF; - -#define AUDIO_ROUTE_EQ_BASS_BOOST 0x00 -#define AUDIO_ROUTE_EQ_CLASSIC 0x01 -#define AUDIO_ROUTE_EQ_JAZZ 0x02 -#define AUDIO_ROUTE_EQ_LIVE 0x03 -#define AUDIO_ROUTE_EQ_NORMAL 0x04 -#define AUDIO_ROUTE_EQ_ROCK 0x05 -#define AUDIO_ROUTE_EQ_BYPASS 0x06 - -#define AUDIO_ROUTE_DIGITAL_VOLUME_CONTROL 0x07 - -#define AUDIO_ROUTE_EQ_CONFIG_GAIN 0xFF /* Custion Gain Config */ -typedef UINT8 tAUDIO_ROUTE_EQ; - -typedef struct -{ - UINT8 opcode; /* AUDIO_ROUTE_CONFIG_REQ */ - tAUDIO_ROUTE_SRC src; - tAUDIO_ROUTE_SF src_sf; - tAUDIO_ROUTE_OUT out; - tAUDIO_ROUTE_SF out_codec_sf; - tAUDIO_ROUTE_SF out_i2s_sf; - tAUDIO_ROUTE_EQ eq_mode; -} tAUDIO_ROUTE_CONFIG_REQ; - -typedef struct -{ - UINT8 opcode; /* AUDIO_ROUTE_CONFIG_RESP */ - tAUDIO_CONFIG_STATUS status; -} tAUDIO_ROUTE_CONFIG_RESP; - -typedef struct -{ - UINT16 amp[2]; /* left/right 15 bit amplitude value */ - UINT16 tone[2]; /* left/right 12 bit frequency 0 - 4096Hz */ - UINT16 mark[2]; /* left/right 16 bit mark time 0 - 65535ms */ - UINT16 space[2]; /* left/right 16 bit space time 0 - 65535ms */ -} tCHIRP_CONFIG; - -typedef struct -{ - UINT8 pri_l; /* Primary Left scale : 0 ~ 255 */ - UINT8 mix_l; /* Mixing Left scale : 0 ~ 255 */ - UINT8 pri_r; /* Primary Right scale : 0 ~ 255 */ - UINT8 mix_r; /* Mixing Right scale : 0 ~ 255 */ -} tMIX_SCALE_CONFIG; - -/* For custon equalizer gain configuration */ -typedef struct -{ - UINT32 audio_l_g0; /* IIR biquad filter left ch gain 0 */ - UINT32 audio_l_g1; /* IIR biquad filter left ch gain 1 */ - UINT32 audio_l_g2; /* IIR biquad filter left ch gain 2 */ - UINT32 audio_l_g3; /* IIR biquad filter left ch gain 3 */ - UINT32 audio_l_g4; /* IIR biquad filter left ch gain 4 */ - UINT32 audio_l_gl; /* IIR biquad filter left ch global gain */ - UINT32 audio_r_g0; /* IIR biquad filter left ch gain 0 */ - UINT32 audio_r_g1; /* IIR biquad filter left ch gain 1 */ - UINT32 audio_r_g2; /* IIR biquad filter left ch gain 2 */ - UINT32 audio_r_g3; /* IIR biquad filter left ch gain 3 */ - UINT32 audio_r_g4; /* IIR biquad filter left ch gain 4 */ - UINT32 audio_r_gl; /* IIR biquad filter left ch global gain */ -} tEQ_GAIN_CONFIG; - -typedef struct -{ - UINT8 opcode; /* AUDIO_MIX_CONFIG_REQ */ - tAUDIO_ROUTE_MIX mix_src; - tAUDIO_ROUTE_SF mix_src_sf; - tMIX_SCALE_CONFIG mix_scale; - tCHIRP_CONFIG chirp_config; -} tAUDIO_MIX_CONFIG_REQ; - -typedef struct -{ - UINT8 opcode; /* AUDIO_MIX_CONFIG_RESP */ - tAUDIO_CONFIG_STATUS status; -} tAUDIO_MIX_CONFIG_RESP; - - -typedef struct -{ - UINT8 opcode; /* AUDIO_BURST_FRAMES_IND */ - UINT32 burst_size; /* in bytes */ -} tAUDIO_BURST_FRAMES_IND; - -typedef struct -{ - UINT8 opcode; /* AUDIO_BURST_END_IND */ -} tAUDIO_BURST_END_IND; - -typedef struct -{ - UINT8 opcode; /* AUDIO_CODEC_FLUSH_REQ */ -} tAUDIO_CODEC_FLUSH_REQ; - -typedef struct -{ - UINT8 opcode; /* AUDIO_EQ_MODE_CONFIG_REQ */ - tAUDIO_ROUTE_EQ eq_mode; - tEQ_GAIN_CONFIG filter_gain; /* Valid only when eq_mode is 0xFF */ -} tAUDIO_EQ_MODE_CONFIG_REQ; - -typedef struct -{ - UINT8 opcode; /* AUDIO_SCALE_CONFIG_REQ */ - tMIX_SCALE_CONFIG mix_scale; -} tAUDIO_SCALE_CONFIG_REQ; - -#endif /* UIPC_MSG_H */ -