mirror of
https://github.com/espressif/esp-idf
synced 2025-03-12 02:29:10 -04:00
Merge branch 'bugfix/bredr_bugfix_release_for_qa_dummy_disconnect_4_1' into 'release/v4.1'
Bugfix/bredr bugfix release for qa dummy disconnect 4.1 See merge request espressif/esp-idf!10646
This commit is contained in:
commit
447708ef05
@ -76,7 +76,7 @@ typedef enum {
|
|||||||
|
|
||||||
/// A2DP media control commands
|
/// A2DP media control commands
|
||||||
typedef enum {
|
typedef enum {
|
||||||
ESP_A2D_MEDIA_CTRL_NONE = 0, /*!< dummy command */
|
ESP_A2D_MEDIA_CTRL_NONE = 0, /*!< Not for application use, use inside stack only. */
|
||||||
ESP_A2D_MEDIA_CTRL_CHECK_SRC_RDY, /*!< check whether AVDTP is connected, only used in A2DP source */
|
ESP_A2D_MEDIA_CTRL_CHECK_SRC_RDY, /*!< check whether AVDTP is connected, only used in A2DP source */
|
||||||
ESP_A2D_MEDIA_CTRL_START, /*!< command to set up media transmission channel */
|
ESP_A2D_MEDIA_CTRL_START, /*!< command to set up media transmission channel */
|
||||||
ESP_A2D_MEDIA_CTRL_STOP, /*!< command to stop media transmission */
|
ESP_A2D_MEDIA_CTRL_STOP, /*!< command to stop media transmission */
|
||||||
|
@ -127,12 +127,16 @@ void btc_a2dp_control_media_ctrl(esp_a2d_media_ctrl_t ctrl)
|
|||||||
switch (ctrl) {
|
switch (ctrl) {
|
||||||
case ESP_A2D_MEDIA_CTRL_CHECK_SRC_RDY:
|
case ESP_A2D_MEDIA_CTRL_CHECK_SRC_RDY:
|
||||||
#if BTC_AV_SRC_INCLUDED
|
#if BTC_AV_SRC_INCLUDED
|
||||||
if (btc_a2dp_source_is_task_shutting_down()) {
|
if (btc_av_get_service_id() == BTA_A2DP_SOURCE_SERVICE_ID) {
|
||||||
btc_a2dp_control_command_ack(ESP_A2D_MEDIA_CTRL_ACK_FAILURE);
|
if (btc_a2dp_source_is_task_shutting_down()) {
|
||||||
} else if ((btc_av_stream_ready() == TRUE) ||
|
btc_a2dp_control_command_ack(ESP_A2D_MEDIA_CTRL_ACK_FAILURE);
|
||||||
(btc_av_stream_started_ready() == TRUE)) {
|
} else if ((btc_av_stream_ready() == TRUE) ||
|
||||||
/* check whether av is ready to setup a2dp datapath */
|
(btc_av_stream_started_ready() == TRUE)) {
|
||||||
btc_a2dp_control_command_ack(ESP_A2D_MEDIA_CTRL_ACK_SUCCESS);
|
/* check whether av is ready to setup a2dp datapath */
|
||||||
|
btc_a2dp_control_command_ack(ESP_A2D_MEDIA_CTRL_ACK_SUCCESS);
|
||||||
|
} else {
|
||||||
|
btc_a2dp_control_command_ack(ESP_A2D_MEDIA_CTRL_ACK_FAILURE);
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
btc_a2dp_control_command_ack(ESP_A2D_MEDIA_CTRL_ACK_FAILURE);
|
btc_a2dp_control_command_ack(ESP_A2D_MEDIA_CTRL_ACK_FAILURE);
|
||||||
}
|
}
|
||||||
@ -159,6 +163,10 @@ void btc_a2dp_control_media_ctrl(esp_a2d_media_ctrl_t ctrl)
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case ESP_A2D_MEDIA_CTRL_STOP:
|
case ESP_A2D_MEDIA_CTRL_STOP:
|
||||||
|
if (btc_av_is_connected() == FALSE) {
|
||||||
|
btc_a2dp_control_command_ack(ESP_A2D_MEDIA_CTRL_ACK_FAILURE);
|
||||||
|
break;
|
||||||
|
}
|
||||||
#if BTC_AV_SRC_INCLUDED
|
#if BTC_AV_SRC_INCLUDED
|
||||||
if (btc_av_get_peer_sep() == AVDT_TSEP_SNK && !btc_a2dp_source_is_streaming() &&
|
if (btc_av_get_peer_sep() == AVDT_TSEP_SNK && !btc_a2dp_source_is_streaming() &&
|
||||||
btc_av_get_service_id() == BTA_A2DP_SOURCE_SERVICE_ID) {
|
btc_av_get_service_id() == BTA_A2DP_SOURCE_SERVICE_ID) {
|
||||||
@ -174,7 +182,6 @@ void btc_a2dp_control_media_ctrl(esp_a2d_media_ctrl_t ctrl)
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case ESP_A2D_MEDIA_CTRL_SUSPEND:
|
case ESP_A2D_MEDIA_CTRL_SUSPEND:
|
||||||
/* local suspend */
|
/* local suspend */
|
||||||
if (btc_av_stream_started_ready()) {
|
if (btc_av_stream_started_ready()) {
|
||||||
@ -184,14 +191,15 @@ void btc_a2dp_control_media_ctrl(esp_a2d_media_ctrl_t ctrl)
|
|||||||
btc_a2dp_control_command_ack(ESP_A2D_MEDIA_CTRL_ACK_SUCCESS);
|
btc_a2dp_control_command_ack(ESP_A2D_MEDIA_CTRL_ACK_SUCCESS);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
} else {
|
} else if (btc_av_is_connected() == TRUE) {
|
||||||
/* we are not in started state; just ack back ok. This can happen if we are
|
/* we are not in started state; just ack back ok. This can happen if we are
|
||||||
remotely suspended; clear REMOTE SUSPEND Flag */
|
remotely suspended; clear REMOTE SUSPEND Flag */
|
||||||
btc_av_clear_remote_suspend_flag();
|
btc_av_clear_remote_suspend_flag();
|
||||||
btc_a2dp_control_command_ack(ESP_A2D_MEDIA_CTRL_ACK_SUCCESS);
|
btc_a2dp_control_command_ack(ESP_A2D_MEDIA_CTRL_ACK_SUCCESS);
|
||||||
|
} else {
|
||||||
|
btc_a2dp_control_command_ack(ESP_A2D_MEDIA_CTRL_ACK_FAILURE);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default :
|
default :
|
||||||
APPL_TRACE_ERROR("### A2DP-MEDIA EVENT %u NOT HANDLED ###", ctrl);
|
APPL_TRACE_ERROR("### A2DP-MEDIA EVENT %u NOT HANDLED ###", ctrl);
|
||||||
btc_a2dp_control_command_ack(ESP_A2D_MEDIA_CTRL_ACK_FAILURE);
|
btc_a2dp_control_command_ack(ESP_A2D_MEDIA_CTRL_ACK_FAILURE);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user