Skip to content

Commit

Permalink
Merge branch 'bugfix/fix_avrc_absolute_volume_compatibility_v5.3' int…
Browse files Browse the repository at this point in the history
…o 'release/v5.3'

bugfix/fix_avrc_absolute_volume_compatibility[backport v5.3]

See merge request espressif/esp-idf!34770
  • Loading branch information
Jiang Jiang Jian committed Nov 15, 2024
2 parents 3e700ef + 49c356a commit c54355e
Showing 1 changed file with 7 additions and 12 deletions.
19 changes: 7 additions & 12 deletions components/bt/host/bluedroid/btc/profile/std/avrc/btc_avrc.c
Original file line number Diff line number Diff line change
Expand Up @@ -170,8 +170,7 @@ bool btc_avrc_ct_init_p(void)
bool btc_avrc_tg_connected_p(void)
{
return (s_rc_tg_init == BTC_RC_TG_INIT_MAGIC) &&
(btc_rc_cb.rc_connected == TRUE) &&
(btc_rc_cb.rc_features & BTA_AV_FEAT_RCCT);
(btc_rc_cb.rc_connected == TRUE);
}

bool btc_avrc_ct_connected_p(void)
Expand Down Expand Up @@ -456,7 +455,7 @@ static void handle_rc_connect (tBTA_AV_RC_OPEN *p_rc_open)
btc_avrc_ct_cb_to_app(ESP_AVRC_CT_CONNECTION_STATE_EVT, &param);
}

if (p_rc_open->peer_features & BTA_AV_FEAT_RCCT) {
if (btc_avrc_tg_init_p()) {
esp_avrc_tg_cb_param_t param;
memset(&param, 0, sizeof(esp_avrc_tg_cb_param_t));
param.conn_stat.connected = true;
Expand Down Expand Up @@ -515,7 +514,7 @@ static void handle_rc_disconnect (tBTA_AV_RC_CLOSE *p_rc_close)
btc_avrc_ct_cb_to_app(ESP_AVRC_CT_CONNECTION_STATE_EVT, &param);
}

if (rc_features & BTA_AV_FEAT_RCCT) {
if (btc_avrc_tg_init_p()) {
esp_avrc_tg_cb_param_t param;
memset(&param, 0, sizeof(esp_avrc_ct_cb_param_t));
param.conn_stat.connected = false;
Expand Down Expand Up @@ -941,14 +940,10 @@ void btc_rc_handler(tBTA_AV_EVT event, tBTA_AV *p_data)
memcpy(param.conn_stat.remote_bda, btc_rc_cb.rc_addr, sizeof(esp_bd_addr_t));
btc_avrc_ct_cb_to_app(ESP_AVRC_CT_CONNECTION_STATE_EVT, &param);
}
if ((p_data->rc_feat.peer_features & BTA_AV_FEAT_RCCT) &&
!(old_feats & BTA_AV_FEAT_RCCT)) {
esp_avrc_tg_cb_param_t param;
memset(&param, 0, sizeof(esp_avrc_ct_cb_param_t));
param.conn_stat.connected = true;
memcpy(param.conn_stat.remote_bda, btc_rc_cb.rc_addr, sizeof(esp_bd_addr_t));
btc_avrc_tg_cb_to_app(ESP_AVRC_TG_CONNECTION_STATE_EVT, &param);
}
/**
* @note ESP_AVRC_TG_CONNECTION_STATE_EVT has been reported on rc connect/disconnect event,
* it doesn't rely on the SDP results.
*/
} while (0);
btc_rc_cb.rc_features = p_data->rc_feat.peer_features;
btc_rc_cb.rc_ct_features = p_data->rc_feat.peer_ct_features;
Expand Down

0 comments on commit c54355e

Please sign in to comment.