Add A2DP Init and Deinit Complete Evt

This commit is contained in:
weitianhua 2020-08-04 18:23:50 +08:00 committed by maojianxin
parent 69fd702b1d
commit d2ddfa5183
2 changed files with 17 additions and 1 deletions

View File

@ -89,6 +89,7 @@ typedef enum {
ESP_A2D_AUDIO_STATE_EVT, /*!< audio stream transmission state changed event */
ESP_A2D_AUDIO_CFG_EVT, /*!< audio codec is configured, only used for A2DP SINK */
ESP_A2D_MEDIA_CTRL_ACK_EVT, /*!< acknowledge event in response to media control commands */
ESP_A2D_PROF_STATE_EVT, /*!< indicate a2dp deinit complete */
} esp_a2d_cb_event_t;
/// A2DP state callback parameters
@ -125,6 +126,13 @@ typedef union {
esp_a2d_media_ctrl_t cmd; /*!< media control commands to acknowledge */
esp_a2d_media_ctrl_ack_t status; /*!< acknowledgement to media control commands */
} media_ctrl_stat; /*!< status in acknowledgement to media control commands */
/**
* @brief ESP_A2D_PROF_STATE_EVT
*/
struct a2d_prof_stat_param {
int init_state; /*!< a2dp profile state param */
} a2d_prof_stat; /*!< status to indicate a2d prof init or deinit */
} esp_a2d_cb_param_t;
/**

View File

@ -989,7 +989,10 @@ static bt_status_t btc_av_init(int service_id)
}
btc_a2dp_on_init();
esp_a2d_cb_param_t param;
memset(&param, 0, sizeof(esp_a2d_cb_param_t));
param.a2d_prof_stat.init_state = 1;
btc_a2d_cb_to_app(ESP_A2D_PROF_STATE_EVT, &param);
return BT_STATUS_SUCCESS;
}
@ -1056,6 +1059,11 @@ static void clean_up(int service_id)
} else {
BTC_TRACE_WARNING("AV sm handle already free\n");
}
esp_a2d_cb_param_t param;
memset(&param, 0, sizeof(esp_a2d_cb_param_t));
param.a2d_prof_stat.init_state = 0;
btc_a2d_cb_to_app(ESP_A2D_PROF_STATE_EVT, &param);
}
/*******************************************************************************