From e64bae3a0c5e8a57f3014ba9bb51840f32865dae Mon Sep 17 00:00:00 2001 From: baohongde Date: Mon, 8 Jul 2019 19:40:22 +0800 Subject: [PATCH] components/bt: Fix iphone can't get song's informations --- examples/bluetooth/a2dp_gatts_coex/main/bt_app_av.c | 7 ++----- examples/bluetooth/a2dp_sink/main/bt_app_av.c | 5 +---- 2 files changed, 3 insertions(+), 9 deletions(-) diff --git a/examples/bluetooth/a2dp_gatts_coex/main/bt_app_av.c b/examples/bluetooth/a2dp_gatts_coex/main/bt_app_av.c index 2bf069da2c..08a08f6442 100644 --- a/examples/bluetooth/a2dp_gatts_coex/main/bt_app_av.c +++ b/examples/bluetooth/a2dp_gatts_coex/main/bt_app_av.c @@ -66,7 +66,7 @@ void bt_app_alloc_meta_buffer(esp_avrc_ct_cb_param_t *param) uint8_t *attr_text = (uint8_t *) malloc (rc->meta_rsp.attr_length + 1); if(!attr_text) { ESP_LOGI(BT_AV_TAG, "malloc failed "); - return; + return; } memcpy(attr_text, rc->meta_rsp.attr_text, rc->meta_rsp.attr_length); attr_text[rc->meta_rsp.attr_length] = 0; @@ -170,10 +170,6 @@ static void bt_av_hdl_avrc_evt(uint16_t event, void *p_param) uint8_t *bda = rc->conn_stat.remote_bda; ESP_LOGI(BT_AV_TAG, "AVRC conn_state evt: state %d, [%02x:%02x:%02x:%02x:%02x:%02x]", rc->conn_stat.connected, bda[0], bda[1], bda[2], bda[3], bda[4], bda[5]); - - if (rc->conn_stat.connected) { - bt_av_new_track(); - } break; } case ESP_AVRC_CT_PASSTHROUGH_RSP_EVT: { @@ -192,6 +188,7 @@ static void bt_av_hdl_avrc_evt(uint16_t event, void *p_param) } case ESP_AVRC_CT_REMOTE_FEATURES_EVT: { ESP_LOGI(BT_AV_TAG, "AVRC remote features 0x%x", rc->rmt_feats.feat_mask); + bt_av_new_track(); break; } default: diff --git a/examples/bluetooth/a2dp_sink/main/bt_app_av.c b/examples/bluetooth/a2dp_sink/main/bt_app_av.c index d9bbbfbed8..5c12fae46a 100644 --- a/examples/bluetooth/a2dp_sink/main/bt_app_av.c +++ b/examples/bluetooth/a2dp_sink/main/bt_app_av.c @@ -171,10 +171,6 @@ static void bt_av_hdl_avrc_evt(uint16_t event, void *p_param) uint8_t *bda = rc->conn_stat.remote_bda; ESP_LOGI(BT_AV_TAG, "AVRC conn_state evt: state %d, [%02x:%02x:%02x:%02x:%02x:%02x]", rc->conn_stat.connected, bda[0], bda[1], bda[2], bda[3], bda[4], bda[5]); - - if (rc->conn_stat.connected) { - bt_av_new_track(); - } break; } case ESP_AVRC_CT_PASSTHROUGH_RSP_EVT: { @@ -193,6 +189,7 @@ static void bt_av_hdl_avrc_evt(uint16_t event, void *p_param) } case ESP_AVRC_CT_REMOTE_FEATURES_EVT: { ESP_LOGI(BT_AV_TAG, "AVRC remote features %x", rc->rmt_feats.feat_mask); + bt_av_new_track(); break; } default: