@@ -30,6 +30,7 @@
#define BT_BAP_STREAM_STATE_STREAMING 0x04
#define BT_BAP_STREAM_STATE_DISABLING 0x05
#define BT_BAP_STREAM_STATE_RELEASING 0x06
+#define BT_BAP_STREAM_STATE_PENDING 0x07
#define BT_BAP_CONFIG_LATENCY_LOW 0x01
#define BT_BAP_CONFIG_LATENCY_BALANCED 0x02
@@ -2146,7 +2146,13 @@ static unsigned int bap_bcast_disable(struct bt_bap_stream *stream,
void *user_data)
{
bap_stream_io_detach(stream);
- stream_set_state(stream, BT_BAP_STREAM_STATE_CONFIG);
+ if (bt_bap_stream_get_state(stream) == BT_BAP_STREAM_STATE_RELEASING)
+ /* Change state to PENDING, signifying that the transport for
+ * this stream should be reacquired.
+ */
+ stream_set_state(stream, BT_BAP_STREAM_STATE_PENDING);
+ else
+ stream_set_state(stream, BT_BAP_STREAM_STATE_CONFIG);
return 1;
}
@@ -5200,6 +5206,8 @@ const char *bt_bap_stream_statestr(uint8_t state)
return "disabling";
case BT_BAP_STREAM_STATE_RELEASING:
return "releasing";
+ case BT_BAP_STREAM_STATE_PENDING:
+ return "pending";
}
return "unknown";