|
|
@@ -84,12 +84,19 @@ typedef enum {
|
|
|
ESP_A2D_MEDIA_CTRL_SUSPEND, /*!< command to suspend media transmission */
|
|
|
} esp_a2d_media_ctrl_t;
|
|
|
|
|
|
+/// Bluetooth A2DP Initiation states
|
|
|
+typedef enum {
|
|
|
+ ESP_A2D_DEINIT_SUCCESS = 0, /*!< A2DP profile deinit successful event */
|
|
|
+ ESP_A2D_INIT_SUCCESS /*!< A2DP profile deinit successful event */
|
|
|
+} esp_a2d_init_state_t;
|
|
|
+
|
|
|
/// A2DP callback events
|
|
|
typedef enum {
|
|
|
ESP_A2D_CONNECTION_STATE_EVT = 0, /*!< connection state changed event */
|
|
|
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 init&deinit complete */
|
|
|
} esp_a2d_cb_event_t;
|
|
|
|
|
|
/// A2DP state callback parameters
|
|
|
@@ -126,6 +133,12 @@ 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 {
|
|
|
+ esp_a2d_init_state_t init_state; /*!< a2dp profile state param */
|
|
|
+ } a2d_prof_stat; /*!< status to indicate a2d prof init or deinit */
|
|
|
} esp_a2d_cb_param_t;
|
|
|
|
|
|
/**
|
|
|
@@ -194,7 +207,8 @@ esp_err_t esp_a2d_sink_register_data_callback(esp_a2d_sink_data_cb_t callback);
|
|
|
/**
|
|
|
*
|
|
|
* @brief Initialize the bluetooth A2DP sink module. This function should be called
|
|
|
- * after esp_bluedroid_enable() completes successfully. Note: A2DP can work independently.
|
|
|
+ * after esp_bluedroid_enable() completes successfully, and ESP_A2D_PROF_STATE_EVT
|
|
|
+ * with ESP_A2D_INIT_SUCCESS will reported to the APP layer. Note: A2DP can work independently.
|
|
|
* If you want to use AVRC together, you should initiate AVRC first.
|
|
|
*
|
|
|
* @return
|
|
|
@@ -209,7 +223,8 @@ esp_err_t esp_a2d_sink_init(void);
|
|
|
/**
|
|
|
*
|
|
|
* @brief De-initialize for A2DP sink module. This function
|
|
|
- * should be called only after esp_bluedroid_enable() completes successfully
|
|
|
+ * should be called only after esp_bluedroid_enable() completes successfully,
|
|
|
+ * and ESP_A2D_PROF_STATE_EVT with ESP_A2D_DEINIT_SUCCESS will reported to APP layer.
|
|
|
*
|
|
|
* @return
|
|
|
* - ESP_OK: success
|
|
|
@@ -266,7 +281,8 @@ esp_err_t esp_a2d_media_ctrl(esp_a2d_media_ctrl_t ctrl);
|
|
|
/**
|
|
|
*
|
|
|
* @brief Initialize the bluetooth A2DP source module. This function should be called
|
|
|
- * after esp_bluedroid_enable() completes successfully. Note: A2DP can work independently.
|
|
|
+ * after esp_bluedroid_enable() completes successfully, and ESP_A2D_PROF_STATE_EVT
|
|
|
+ * with ESP_A2D_INIT_SUCCESS will reported to the APP layer. Note: A2DP can work independently.
|
|
|
* If you want to use AVRC together, you should initiate AVRC first.
|
|
|
*
|
|
|
* @return
|
|
|
@@ -281,7 +297,8 @@ esp_err_t esp_a2d_source_init(void);
|
|
|
/**
|
|
|
*
|
|
|
* @brief De-initialize for A2DP source module. This function
|
|
|
- * should be called only after esp_bluedroid_enable() completes successfully
|
|
|
+ * should be called only after esp_bluedroid_enable() completes successfully,
|
|
|
+ * and ESP_A2D_PROF_STATE_EVT with ESP_A2D_DEINIT_SUCCESS will reported to APP layer.
|
|
|
*
|
|
|
* @return
|
|
|
* - ESP_OK: success
|