feat(bt/bluedroid): Add Kconfig options to controll AVRCP Cover Art feature

This commit is contained in:
linruihao
2024-08-26 17:27:59 +08:00
committed by BOT
parent cb0d073551
commit 0de83be0fe
15 changed files with 185 additions and 27 deletions

View File

@@ -84,9 +84,30 @@ config BT_A2DP_ENABLE
bool "A2DP"
depends on BT_CLASSIC_ENABLED
default n
select BT_AVRCP_ENABLED
help
Advanced Audio Distribution Profile
config BT_AVRCP_ENABLED
bool
depends on BT_A2DP_ENABLE
default y
help
Audio/Video Remote Control Profile, AVRCP and A2DP are coupled in Bluedroid,
AVRCP still controlled by A2DP option, this is a dummy option currently
menu "AVRCP Features"
depends on BT_AVRCP_ENABLED
config BT_AVRCP_CT_COVER_ART_ENABLED
bool "AVRCP CT Cover Art"
default y
select BT_GOEPC_ENABLED
help
This enable Cover Art feature of AVRCP CT role
endmenu
config BT_SPP_ENABLED
bool "SPP"
depends on BT_CLASSIC_ENABLED
@@ -143,13 +164,12 @@ endchoice
config BT_HFP_WBS_ENABLE
bool "Wide Band Speech"
depends on BT_HFP_AUDIO_DATA_PATH_HCI
depends on BT_HFP_ENABLE && BT_HFP_AUDIO_DATA_PATH_HCI
default y
help
This enables Wide Band Speech. Should disable it when SCO data path is PCM.
Otherwise there will be no data transmitted via GPIOs.
menuconfig BT_HID_ENABLED
bool "Classic BT HID"
depends on BT_CLASSIC_ENABLED
@@ -170,6 +190,13 @@ config BT_HID_DEVICE_ENABLED
help
This enables the BT HID Device
config BT_GOEPC_ENABLED
bool
depends on BT_CLASSIC_ENABLED
default n
help
This enables the BT GOEP Profile Client role
config BT_BLE_ENABLED
bool "Bluetooth Low Energy"
depends on BT_BLUEDROID_ENABLED

View File

@@ -232,6 +232,8 @@ esp_err_t esp_avrc_ct_send_passthrough_cmd(uint8_t tl, uint8_t key_code, uint8_t
return (stat == BT_STATUS_SUCCESS) ? ESP_OK : ESP_FAIL;
}
#if BTC_AV_CA_INCLUDED
esp_err_t esp_avrc_ct_cover_art_connect(uint16_t mtu)
{
if ((esp_bluedroid_get_status() != ESP_BLUEDROID_STATUS_ENABLED) ||
@@ -371,6 +373,8 @@ esp_err_t esp_avrc_ct_cover_art_get_linked_thumbnail(uint8_t *image_handle)
return (stat == BT_STATUS_SUCCESS) ? ESP_OK : ESP_FAIL;
}
#endif /* #if BTC_AV_CA_INCLUDED */
/*********************************************************************************************/
/** following is the API of AVRCP target role **/
/*********************************************************************************************/

View File

@@ -767,7 +767,8 @@ esp_err_t esp_avrc_tg_send_rn_rsp(esp_avrc_rn_event_ids_t event_id, esp_avrc_rn_
/**
*
* @brief Start the process to establish OBEX connection used in Cover Art Client. Once the operation done,
* ESP_AVRC_CT_COVER_ART_STATE_EVT will come, operation result can be found in event param.
* ESP_AVRC_CT_COVER_ART_STATE_EVT will come, operation result can be found in event param. This API
* can be used only when AVRC Cover Art feature is enabled.
*
* @param[in] mtu: MTU used in lower level connection, should not smaller than ESP_AVRC_CA_MTU_MIN or larger than
* ESP_AVRC_CA_MTU_MAX, if value is not valid, will be reset to ESP_AVRC_CA_MTU_MAX. This can limit
@@ -784,7 +785,8 @@ esp_err_t esp_avrc_ct_cover_art_connect(uint16_t mtu);
/**
*
* @brief Start the process to release the OBEX connection used in Cover Art Client.Once the operation done,
* ESP_AVRC_CT_COVER_ART_STATE_EVT will come, operation result can be found in event param.
* ESP_AVRC_CT_COVER_ART_STATE_EVT will come, operation result can be found in event param. This API
* can be used only when AVRC Cover Art feature is enabled.
*
* @return
* - ESP_OK: success
@@ -796,7 +798,8 @@ esp_err_t esp_avrc_ct_cover_art_disconnect(void);
/**
*
* @brief Start the process to get image properties from Cover Art server.
* @brief Start the process to get image properties from Cover Art server. This API can be used only when AVRC
* Cover Art feature is enabled.
*
* @param[in] image_handle: pointer to image handle with a length of ESP_AVRC_CA_IMAGE_HANDLE_LEN bytes, can be freed
* after this function return
@@ -811,7 +814,8 @@ esp_err_t esp_avrc_ct_cover_art_get_image_properties(uint8_t *image_handle);
/**
*
* @brief Start the process to get image from Cover Art server.
* @brief Start the process to get image from Cover Art server. This API can be used only when AVRC Cover Art
* feature is enabled.
*
* @param[in] image_handle: pointer to image handle with a length of ESP_AVRC_CA_IMAGE_HANDLE_LEN bytes, can be freed
* after this function return
@@ -831,7 +835,8 @@ esp_err_t esp_avrc_ct_cover_art_get_image(uint8_t *image_handle, uint8_t *image_
/**
*
* @brief Start the process to get linked thumbnail from Cover Art server.
* @brief Start the process to get linked thumbnail from Cover Art server. This API can be used only when AVRC
* Cover Art feature is enabled.
*
* @param[in] image_handle: pointer to image handle with a length of ESP_AVRC_CA_IMAGE_HANDLE_LEN bytes, can be freed
* after this function return

View File

@@ -34,11 +34,13 @@
#include "stack/l2c_api.h"
#include "osi/allocator.h"
#include "osi/list.h"
#include "stack/goep_common.h"
#include "stack/goepc_api.h"
#if( defined BTA_AR_INCLUDED ) && (BTA_AR_INCLUDED == TRUE)
#include "bta/bta_ar_api.h"
#endif
#if BTA_AV_CA_INCLUDED
#include "stack/goep_common.h"
#include "stack/goepc_api.h"
#endif
#define LOG_TAG "bt_bta_av"
// #include "osi/include/log.h"
@@ -100,9 +102,10 @@ void bta_av_del_rc(tBTA_AV_RCB *p_rcb)
p_scb = NULL;
if (p_rcb->handle != BTA_AV_RC_HANDLE_NONE) {
#if BTA_AV_CA_INCLUDED
/* reset cover art state */
bta_av_ca_reset(p_rcb);
#endif
if (p_rcb->shdl) {
/* Validate array index*/
if ((p_rcb->shdl - 1) < BTA_AV_NUM_STRS) {
@@ -1489,7 +1492,19 @@ static void bta_av_acp_sig_timer_cback (TIMER_LIST_ENT *p_tle)
}
}
UINT16 bta_av_extra_tg_cover_art_l2cap_psm(void)
#if BTA_AV_CA_INCLUDED
/*******************************************************************************
**
** Function bta_av_extra_tg_cover_art_l2cap_psm
**
** Description Extra the AVRC Cover Art L2CAP PSM of peer device from the
** SDP record
**
** Returns void
**
*******************************************************************************/
static UINT16 bta_av_extra_tg_cover_art_l2cap_psm(void)
{
tBTA_AV_CB *p_cb = &bta_av_cb;
tSDP_DISC_REC *p_rec = NULL;
@@ -1520,6 +1535,8 @@ UINT16 bta_av_extra_tg_cover_art_l2cap_psm(void)
return l2cap_psm;
}
#endif /* BTA_AV_CA_INCLUDED */
/*******************************************************************************
**
** Function bta_av_check_peer_rc_features
@@ -1613,7 +1630,9 @@ void bta_av_rc_disc_done(tBTA_AV_DATA *p_data)
tBTA_AV_FEAT peer_features; /* peer features mask */
UINT16 peer_ct_features; /* peer features mask as controller */
UINT16 peer_tg_features; /* peer features mask as target */
#if BTA_AV_CA_INCLUDED
UINT16 obex_l2cap_psm = 0; /* target obex l2cap psm */
#endif
UNUSED(p_data);
APPL_TRACE_DEBUG("bta_av_rc_disc_done disc:x%x", p_cb->disc);
@@ -1641,11 +1660,11 @@ void bta_av_rc_disc_done(tBTA_AV_DATA *p_data)
/* check peer version and whether support CT and TG role */
peer_features = bta_av_check_peer_rc_features (UUID_SERVCLASS_AV_REMOTE_CONTROL, &peer_ct_features);
peer_features |= bta_av_check_peer_rc_features (UUID_SERVCLASS_AV_REM_CTRL_TARGET, &peer_tg_features);
#if BTA_AV_CA_INCLUDED
if (peer_features & BTA_AV_FEAT_COVER_ART) {
obex_l2cap_psm = bta_av_extra_tg_cover_art_l2cap_psm();
}
#endif
p_cb->disc = 0;
utl_freebuf((void **) &p_cb->p_disc_db);
@@ -1663,7 +1682,9 @@ void bta_av_rc_disc_done(tBTA_AV_DATA *p_data)
p_cb->rcb[rc_handle].peer_features = peer_features;
p_cb->rcb[rc_handle].peer_ct_features = peer_ct_features;
p_cb->rcb[rc_handle].peer_tg_features = peer_tg_features;
#if BTA_AV_CA_INCLUDED
p_cb->rcb[rc_handle].cover_art_l2cap_psm = obex_l2cap_psm;
#endif
}
#if (BT_USE_TRACES == TRUE || BT_TRACE_APPL == TRUE)
else {
@@ -1682,7 +1703,9 @@ void bta_av_rc_disc_done(tBTA_AV_DATA *p_data)
}
} else {
p_cb->rcb[rc_handle].peer_features = peer_features;
#if BTA_AV_CA_INCLUDED
p_cb->rcb[rc_handle].cover_art_l2cap_psm = obex_l2cap_psm;
#endif
rc_feat.rc_handle = rc_handle;
rc_feat.peer_features = peer_features;
rc_feat.peer_ct_features = peer_ct_features;
@@ -1723,10 +1746,10 @@ void bta_av_rc_closed(tBTA_AV_DATA *p_data)
p_rcb->peer_features = 0;
p_rcb->peer_ct_features = 0;
p_rcb->peer_tg_features = 0;
#if BTA_AV_CA_INCLUDED
/* reset cover art state */
bta_av_ca_reset(p_rcb);
#endif
APPL_TRACE_DEBUG(" shdl:%d, lidx:%d", p_rcb->shdl, p_rcb->lidx);
if (p_rcb->shdl) {
if ((p_rcb->shdl - 1) < BTA_AV_NUM_STRS) {

View File

@@ -613,6 +613,8 @@ void BTA_AvMetaCmd(UINT8 rc_handle, UINT8 label, tBTA_AV_CMD cmd_code, BT_HDR *p
}
}
#if BTA_AV_CA_INCLUDED
/*******************************************************************************
**
** Function BTA_AvCaOpen
@@ -682,4 +684,6 @@ void BTA_AvCaGet(UINT8 rc_handle, tBTA_AV_GET_TYPE type, UINT8 *image_handle, UI
}
}
#endif /* BTA_AV_CA_INCLUDED */
#endif /* BTA_AV_INCLUDED */

View File

@@ -5,7 +5,7 @@
*/
#include "common/bt_target.h"
#if defined(BTA_AV_INCLUDED) && (BTA_AV_INCLUDED == TRUE)
#if BTA_AV_CA_INCLUDED
#include <string.h>
#include "bta/bta_av_api.h"
@@ -492,4 +492,4 @@ void bta_av_ca_reset(tBTA_AV_RCB *p_rcb)
p_rcb->cover_art_max_rx = 0;
}
#endif /* BTA_AV_INCLUDED */
#endif /* BTA_AV_CA_INCLUDED */

View File

@@ -5,7 +5,7 @@
*/
#include "common/bt_target.h"
#if defined(BTA_AV_INCLUDED) && (BTA_AV_INCLUDED == TRUE)
#if BTA_AV_CA_INCLUDED
#include <string.h>
#include "bta/bta_av_api.h"
@@ -167,4 +167,4 @@ void bta_av_ca_sm_execute(tBTA_AV_RCB *p_rcb, UINT16 event, tBTA_AV_DATA *p_data
}
}
#endif /* BTA_AV_INCLUDED */
#endif /* BTA_AV_CA_INCLUDED */

View File

@@ -1248,11 +1248,13 @@ BOOLEAN bta_av_hdl_event(BT_HDR *p_msg)
APPL_TRACE_VERBOSE("AV sm event=0x%x(%s)\n", event, bta_av_evt_code(event));
/* state machine events */
bta_av_sm_execute(&bta_av_cb, p_msg->event, (tBTA_AV_DATA *) p_msg);
#if BTA_AV_CA_INCLUDED
} else if (event >= BTA_AV_CA_FIRST_SM_EVT && event <= BTA_AV_CA_LAST_SM_EVT) {
if (p_msg->layer_specific < BTA_AV_NUM_RCB) {
tBTA_AV_RCB *p_rcb = &bta_av_cb.rcb[p_msg->layer_specific];
bta_av_ca_sm_execute(p_rcb, p_msg->event, (tBTA_AV_DATA *) p_msg);
}
#endif
} else {
APPL_TRACE_VERBOSE("handle=0x%x\n", p_msg->layer_specific);
tBTA_AV_SCB *p_scb = bta_av_hndl_to_scb(p_msg->layer_specific);

View File

@@ -85,7 +85,7 @@ enum {
BTA_AV_ROLE_CHANGE_EVT,
BTA_AV_AVDT_DELAY_RPT_EVT,
BTA_AV_ACP_CONNECT_EVT,
#if BTA_AV_CA_INCLUDED
/* these events are handled by the Cover Art Client state machine */
BTA_AV_API_CA_OPEN_EVT,
BTA_AV_API_CA_CLOSE_EVT,
@@ -94,7 +94,7 @@ enum {
BTA_AV_CA_RESPONSE_FINAL_EVT,
BTA_AV_CA_GOEP_CONNECT_EVT,
BTA_AV_CA_GOEP_DISCONNECT_EVT,
#endif
/* these events are handled outside of the state machine */
BTA_AV_API_ENABLE_EVT,
BTA_AV_API_REGISTER_EVT,
@@ -124,9 +124,11 @@ enum {
#define BTA_AV_FIRST_SM_EVT BTA_AV_API_DISABLE_EVT
#define BTA_AV_LAST_SM_EVT BTA_AV_AVRC_NONE_EVT
#if BTA_AV_CA_INCLUDED
/* events for AVRC Cover Art state machine */
#define BTA_AV_CA_FIRST_SM_EVT BTA_AV_API_CA_OPEN_EVT
#define BTA_AV_CA_LAST_SM_EVT BTA_AV_CA_GOEP_DISCONNECT_EVT
#endif
/* events for AV stream control block state machine */
#define BTA_AV_FIRST_SSM_EVT BTA_AV_API_OPEN_EVT
@@ -361,6 +363,8 @@ typedef struct {
BT_HDR hdr;
} tBTA_AV_API_GET_DELAY_VALUE;
#if BTA_AV_CA_INCLUDED
/* data type for BTA_AV_API_CA_OPEN_EVT */
typedef struct {
BT_HDR hdr;
@@ -403,6 +407,8 @@ typedef struct {
UINT16 reason;
} tBTA_AV_CA_DISCONNECT;
#endif /* BTA_AV_CA_INCLUDED */
/* initiator/acceptor role for adaption */
#define BTA_AV_ROLE_AD_INT 0x00 /* initiator */
#define BTA_AV_ROLE_AD_ACP 0x01 /* acceptor */
@@ -437,12 +443,14 @@ typedef union {
tBTA_AV_API_META_RSP api_meta_rsp;
tBTA_AV_API_SET_DELAY_VALUE api_set_delay_vlaue;
tBTA_AV_API_GET_DELAY_VALUE api_get_delay_value;
#if BTA_AV_CA_INCLUDED
tBTA_AV_API_CA_OPEN api_ca_open;
tBTA_AV_API_CA_CLOSE api_ca_close;
tBTA_AV_API_CA_GET api_ca_get;
tBTA_AV_CA_RESPONSE ca_response;
tBTA_AV_CA_CONNECT ca_connect;
tBTA_AV_CA_DISCONNECT ca_disconnect;
#endif
} tBTA_AV_DATA;
typedef void (tBTA_AV_VDP_DATA_ACT)(void *p_scb);
@@ -559,13 +567,14 @@ typedef struct {
tBTA_AV_FEAT peer_features; /* peer features mask */
UINT16 peer_ct_features;
UINT16 peer_tg_features;
#if BTA_AV_CA_INCLUDED
UINT16 cover_art_l2cap_psm; /* OBEX over L2CAP PSM */
UINT16 cover_art_goep_hdl; /* Cover Art client GOEP connection handle */
UINT8 cover_art_state; /* Cover Art client state machine */
UINT32 cover_art_cid; /* Cover Art client connection id */
UINT16 cover_art_max_tx; /* max packet length peer device can receive */
UINT16 cover_art_max_rx; /* max packet length we can receive */
#endif
} tBTA_AV_RCB;
#define BTA_AV_NUM_RCB (BTA_AV_NUM_STRS + 2)
@@ -780,6 +789,7 @@ extern void bta_av_do_disc_vdp (tBTA_AV_SCB *p_scb, tBTA_AV_DATA *p_data);
extern void bta_av_vdp_str_opened (tBTA_AV_SCB *p_scb, tBTA_AV_DATA *p_data);
extern void bta_av_reg_vdp (tAVDT_CS *p_cs, char *p_service_name, void *p_data);
#if BTA_AV_CA_INCLUDED
extern void bta_av_ca_api_open(tBTA_AV_RCB *p_rcb, tBTA_AV_DATA *p_data);
extern void bta_av_ca_api_close(tBTA_AV_RCB *p_rcb, tBTA_AV_DATA *p_data);
extern void bta_av_ca_api_get(tBTA_AV_RCB *p_rcb, tBTA_AV_DATA *p_data);
@@ -790,6 +800,7 @@ extern void bta_av_ca_goep_disconnect(tBTA_AV_RCB *p_rcb, tBTA_AV_DATA *p_data);
extern void bta_av_ca_force_disconnect(tBTA_AV_RCB *p_rcb, tBTA_AV_DATA *p_data);
extern void bta_av_ca_sm_execute(tBTA_AV_RCB *p_rcb, UINT16 event, tBTA_AV_DATA *p_data);
extern void bta_av_ca_reset(tBTA_AV_RCB *p_rcb);
#endif
#endif ///BTA_AV_INCLUDED == TRUE

View File

@@ -262,6 +262,7 @@ typedef UINT8 tBTA_AV_GET_TYPE;
#define BTA_AV_GET_DELAY_VALUE_EVT 23 /* get delay reporting value */
#define BTA_AV_SNK_PSC_CFG_EVT 24 /* Protocol service capabilities. */
/* still keep Cover Art event here if Cover Art feature not enabled */
#define BTA_AV_CA_STATUS_EVT 25 /* Cover Art Client status event */
#define BTA_AV_CA_DATA_EVT 26 /* Cover Art response body data */
@@ -493,6 +494,9 @@ typedef struct {
UINT16 psc_mask;
} tBTA_AV_SNK_PSC_CFG;
#if BTA_AV_CA_INCLUDED
/* data associated with BTA_AV_CA_STATUS_EVT */
typedef struct {
BOOLEAN connected; /* whether Cover Art connection is connected */
@@ -508,6 +512,8 @@ typedef struct {
BT_HDR *p_hdr; /* after data pass to application, free this packet */
} tBTA_AV_CA_DATA;
#endif
/* union of data associated with AV callback */
typedef union {
tBTA_AV_CHNL chnl;
@@ -532,8 +538,10 @@ typedef union {
tBTA_AV_RC_FEAT rc_feat;
tBTA_AV_DELAY delay;
tBTA_AV_SNK_PSC_CFG psc;
#if BTA_AV_CA_INCLUDED
tBTA_AV_CA_STATUS ca_status;
tBTA_AV_CA_DATA ca_data;
#endif
} tBTA_AV;
/* union of data associated with AV Media callback */
@@ -893,6 +901,8 @@ void BTA_AvMetaRsp(UINT8 rc_handle, UINT8 label, tBTA_AV_CODE rsp_code,
*******************************************************************************/
void BTA_AvMetaCmd(UINT8 rc_handle, UINT8 label, tBTA_AV_CMD cmd_code, BT_HDR *p_pkt);
#if BTA_AV_CA_INCLUDED
/*******************************************************************************
**
** Function BTA_AvCaOpen
@@ -930,6 +940,8 @@ void BTA_AvCaClose(UINT8 rc_handle);
*******************************************************************************/
void BTA_AvCaGet(UINT8 rc_handle, tBTA_AV_GET_TYPE type, UINT8 *image_handle, UINT8 *image_descriptor, UINT16 image_descriptor_len);
#endif /* BTA_AV_CA_INCLUDED */
#ifdef __cplusplus
}
#endif

View File

@@ -193,6 +193,7 @@ void btc_avrc_arg_deep_copy(btc_msg_t *msg, void *p_dest, void *p_src)
size_t len;
switch (msg->act) {
#if BTC_AV_CA_INCLUDED
case BTC_AVRC_CT_API_COVER_ART_GET_IMAGE_EVT:
len = src->ca_get_img.image_descriptor_len;
dst->ca_get_img.image_descriptor = (uint8_t *)osi_malloc(len);
@@ -202,8 +203,12 @@ void btc_avrc_arg_deep_copy(btc_msg_t *msg, void *p_dest, void *p_src)
BTC_TRACE_ERROR("%s %d no mem\n", __FUNCTION__, msg->act);
}
break;
#endif
default:
BTC_TRACE_DEBUG("%s Unhandled deep copy %d\n", __FUNCTION__, msg->act);
UNUSED(dst);
UNUSED(src);
UNUSED(len);
break;
}
}
@@ -213,13 +218,16 @@ void btc_avrc_arg_deep_free(btc_msg_t *msg)
btc_avrc_args_t *arg = (btc_avrc_args_t *)msg->arg;
switch (msg->act) {
#if BTC_AV_CA_INCLUDED
case BTC_AVRC_CT_API_COVER_ART_GET_IMAGE_EVT:
if (arg->ca_get_img.image_descriptor) {
osi_free(arg->ca_get_img.image_descriptor);
}
break;
#endif
default:
BTC_TRACE_DEBUG("%s Unhandled deep free %d\n", __FUNCTION__, msg->act);
UNUSED(arg);
break;
}
}
@@ -538,19 +546,21 @@ static void handle_rc_disconnect (tBTA_AV_RC_CLOSE *p_rc_close)
}
tBTA_AV_FEAT rc_features = btc_rc_cb.rc_features;
bool cover_art_connected = btc_rc_cb.rc_cover_art_connected;
// clean up the state
btc_rc_cb.rc_handle = 0;
btc_rc_cb.rc_connected = FALSE;
#if BTC_AV_CA_INCLUDED
bool cover_art_connected = btc_rc_cb.rc_cover_art_connected;
btc_rc_cb.rc_cover_art_connected = FALSE;
#endif
btc_rc_cb.rc_features = 0;
btc_rc_cb.rc_ct_features = 0;
btc_rc_cb.rc_tg_features = 0;
memset(btc_rc_cb.rc_addr, 0, sizeof(BD_ADDR));
memset(btc_rc_cb.rc_ntf, 0, sizeof(btc_rc_cb.rc_ntf));
#if BTC_AV_CA_INCLUDED
/* report connection state */
if (cover_art_connected) {
/* if rc disconnect, cover art disconnect too */
@@ -560,6 +570,7 @@ static void handle_rc_disconnect (tBTA_AV_RC_CLOSE *p_rc_close)
param.cover_art_state.reason = BT_STATUS_FAIL;
btc_avrc_ct_cb_to_app(ESP_AVRC_CT_COVER_ART_STATE_EVT, &param);
}
#endif
if (rc_features & BTA_AV_FEAT_RCTG) {
esp_avrc_ct_cb_param_t param;
@@ -1021,6 +1032,7 @@ void btc_rc_handler(tBTA_AV_EVT event, tBTA_AV *p_data)
handle_rc_passthrough_cmd(&p_data->remote_cmd);
}
break;
#if BTC_AV_CA_INCLUDED
case BTA_AV_CA_STATUS_EVT: {
btc_rc_cb.rc_cover_art_connected = p_data->ca_status.connected;
esp_avrc_ct_cb_param_t param;
@@ -1049,6 +1061,7 @@ void btc_rc_handler(tBTA_AV_EVT event, tBTA_AV *p_data)
}
}
break;
#endif /* BTC_AV_CA_INCLUDED */
default:
BTC_TRACE_DEBUG("Unhandled RC event : 0x%x", event);
}
@@ -1349,6 +1362,8 @@ static bt_status_t btc_avrc_ct_send_passthrough_cmd(uint8_t tl, uint8_t key_code
return status;
}
#if BTC_AV_CA_INCLUDED
static void btc_avrc_ct_cover_art_connect(UINT16 mtu)
{
if (!btc_rc_cb.rc_cover_art_connected) {
@@ -1404,6 +1419,8 @@ static void btc_avrc_ct_cover_art_get_linked_thumbnail(UINT8 *image_handle)
return;
}
#endif /* BTC_AV_CA_INCLUDED */
/*******************************************************************************
**
** Function btc_avrc_tg_init
@@ -1554,6 +1571,7 @@ void btc_avrc_ct_call_handler(btc_msg_t *msg)
btc_avrc_ct_send_set_absolute_volume_cmd(arg->set_abs_vol_cmd.tl, arg->set_abs_vol_cmd.volume);
break;
}
#if BTC_AV_CA_INCLUDED
case BTC_AVRC_CT_API_COVER_ART_CONNECT_EVT: {
btc_avrc_ct_cover_art_connect(arg->ca_conn.mtu);
break;
@@ -1574,6 +1592,7 @@ void btc_avrc_ct_call_handler(btc_msg_t *msg)
btc_avrc_ct_cover_art_get_linked_thumbnail(arg->ca_get_lk_thn.image_handle);
break;
}
#endif
default:
BTC_TRACE_WARNING("%s : unhandled event: %d\n", __FUNCTION__, msg->act);
}

View File

@@ -40,11 +40,13 @@ typedef enum {
BTC_AVRC_NOTIFY_API_SND_REG_NOTIFY_EVT,
BTC_AVRC_CTRL_API_SND_SET_PLAYER_SETTING_EVT,
BTC_AVRC_CTRL_API_SND_SET_ABSOLUTE_VOLUME_EVT,
#if BTC_AV_CA_INCLUDED
BTC_AVRC_CT_API_COVER_ART_CONNECT_EVT,
BTC_AVRC_CT_API_COVER_ART_DISCONNECT_EVT,
BTC_AVRC_CT_API_COVER_ART_GET_IMAGE_PROPERTIES_EVT,
BTC_AVRC_CT_API_COVER_ART_GET_IMAGE_EVT,
BTC_AVRC_CT_API_COVER_ART_GET_LINKED_THUMBNAIL_EVT,
#endif
} btc_avrc_act_t;
typedef struct {
@@ -82,6 +84,8 @@ typedef struct {
uint8_t volume;
} set_abs_vol_cmd_t;
#if BTC_AV_CA_INCLUDED
typedef struct {
uint16_t mtu;
} ca_conn_t;
@@ -100,6 +104,8 @@ typedef struct {
uint8_t image_handle[7];
} ca_get_lk_thn_t;
#endif /* BTC_AV_CA_INCLUDED */
/* btc_avrc_args_t */
typedef union {
pt_cmd_t pt_cmd;
@@ -108,10 +114,12 @@ typedef union {
ps_cmd_t ps_cmd;
get_caps_cmd_t get_caps_cmd;
set_abs_vol_cmd_t set_abs_vol_cmd;
#if BTC_AV_CA_INCLUDED
ca_conn_t ca_conn;
ca_get_img_prop_t ca_get_img_prop;
ca_get_img_t ca_get_img;
ca_get_lk_thn_t ca_get_lk_thn;
#endif
} btc_avrc_args_t;
/* btc_avrc_tg_act_t */
@@ -151,7 +159,9 @@ typedef struct {
typedef struct {
BOOLEAN rc_connected;
#if BTC_AV_CA_INCLUDED
BOOLEAN rc_cover_art_connected;
#endif
UINT8 rc_handle;
tBTA_AV_FEAT rc_features;
UINT16 rc_ct_features;

View File

@@ -39,6 +39,19 @@
#define UC_BT_A2DP_ENABLED FALSE
#endif
//AVRCP
#ifdef CONFIG_BT_AVRCP_ENABLED
#define UC_BT_AVRCP_ENABLED TRUE
#ifdef CONFIG_BT_AVRCP_CT_COVER_ART_ENABLED
#define UC_BT_AVRCP_CT_COVER_ART_ENABLED CONFIG_BT_AVRCP_CT_COVER_ART_ENABLED
#else
#define UC_BT_AVRCP_CT_COVER_ART_ENABLED FALSE
#endif
#else
#define UC_BT_AVRCP_ENABLED FALSE
#define UC_BT_AVRCP_CT_COVER_ART_ENABLED FALSE
#endif
//SPP
#ifdef CONFIG_BT_SPP_ENABLED
#define UC_BT_SPP_ENABLED CONFIG_BT_SPP_ENABLED
@@ -111,6 +124,13 @@
#define UC_BT_ENC_KEY_SIZE_CTRL_MODE 0
#endif
//GOEPC (BT)
#ifdef CONFIG_BT_GOEPC_ENABLED
#define UC_BT_GOEPC_ENABLED CONFIG_BT_GOEPC_ENABLED
#else
#define UC_BT_GOEPC_ENABLED FALSE
#endif
//BLE
#ifdef CONFIG_BT_BLE_ENABLED
#define UC_BT_BLE_ENABLED CONFIG_BT_BLE_ENABLED

View File

@@ -91,6 +91,11 @@
#define SBC_DEC_INCLUDED TRUE
#define BTC_AV_SRC_INCLUDED TRUE
#define SBC_ENC_INCLUDED TRUE
#if UC_BT_AVRCP_CT_COVER_ART_ENABLED
#define BTA_AV_CA_INCLUDED TRUE
#define BTC_AV_CA_INCLUDED TRUE
#define AVRC_CA_INCLUDED TRUE
#endif /* UC_BT_AVRCP_CT_COVER_ART_ENABLED */
#endif /* UC_BT_A2DP_ENABLED */
#if (UC_BT_SPP_ENABLED == TRUE)
@@ -171,8 +176,12 @@
#define BTC_HD_INCLUDED TRUE
#endif /* UC_BT_HID_DEVICE_ENABLED */
#if UC_BT_GOEPC_ENABLED
#ifndef OBEX_INCLUDED
#define OBEX_INCLUDED TRUE
#define GOEPC_INCLUDED TRUE
#endif
#define GOEPC_INCLUDED TRUE
#endif /* UC_BT_GOEPC_ENABLED */
#endif /* UC_BT_CLASSIC_ENABLED */
@@ -379,6 +388,10 @@
#define BTC_AV_INCLUDED FALSE
#endif
#ifndef BTC_AV_CA_INCLUDED
#define BTC_AV_CA_INCLUDED FALSE
#endif
#ifndef BTC_AV_SINK_INCLUDED
#define BTC_AV_SINK_INCLUDED FALSE
#endif
@@ -452,6 +465,10 @@
#define BTA_AV_INCLUDED FALSE
#endif
#ifndef BTA_AV_CA_INCLUDED
#define BTA_AV_CA_INCLUDED FALSE
#endif
#ifndef BTA_AV_SINK_INCLUDED
#define BTA_AV_SINK_INCLUDED FALSE
#endif
@@ -2216,6 +2233,10 @@
#define AVRC_INCLUDED FALSE
#endif
#ifndef AVRC_CA_INCLUDED
#define AVRC_CA_INCLUDED FALSE
#endif
#ifndef AVRC_METADATA_INCLUDED
#if AVRC_INCLUDED == TRUE
#define AVRC_METADATA_INCLUDED TRUE

View File

@@ -292,13 +292,13 @@ UINT16 AVRC_AddRecord(UINT16 service_uuid, char *p_service_name, char *p_provide
} else if (service_uuid == UUID_SERVCLASS_AV_REM_CTRL_TARGET && media_player_virtual_filesystem_supported) {
supported_feature |= AVRC_SUPF_TG_BROWSE;
}
#if AVRC_CA_INCLUDED
if (service_uuid == UUID_SERVCLASS_AV_REM_CTRL_CONTROL || service_uuid == UUID_SERVCLASS_AV_REMOTE_CONTROL) {
supported_feature |= AVRC_SUPF_CT_COVER_ART_GIP;
supported_feature |= AVRC_SUPF_CT_COVER_ART_GI;
supported_feature |= AVRC_SUPF_CT_COVER_ART_GLT;
}
#endif
/* add supported feature */
p = temp;
UINT16_TO_BE_STREAM(p, supported_feature);