Diff between dfebcc9c100cdf59d4c00516b02cb72fe0d5e435 and 15fd57f26079d7bfd7b5797dd1cbd0192e68ac1f

Changed Files

File Additions Deletions Status
src/shared/bap.c +16 -0 modified

Full Patch

diff --git a/src/shared/bap.c b/src/shared/bap.c
index dbeb43f..ec23e88 100644
--- a/src/shared/bap.c
+++ b/src/shared/bap.c
@@ -1138,6 +1138,21 @@ static void stream_notify_release(struct bt_bap_stream *stream)
 					bt_bap_get_att(stream->bap));
 }
 
+static void stream_notify_idle(struct bt_bap_stream *stream)
+{
+	struct bt_bap_endpoint *ep = stream->ep;
+	struct bt_ascs_ase_status status;
+
+	DBG(stream->bap, "stream %p", stream);
+
+	memset(&status, 0, sizeof(status));
+	status.id = ep->id;
+	status.state = BT_ASCS_ASE_STATE_IDLE;
+
+	gatt_db_attribute_notify(ep->attr, (void *)&status, sizeof(status),
+					bt_bap_get_att(stream->bap));
+}
+
 static struct bt_bap *bt_bap_ref_safe(struct bt_bap *bap)
 {
 	if (!bap || !bap->ref_count || !queue_find(sessions, NULL, bap))
@@ -1712,6 +1727,7 @@ static void stream_notify(struct bt_bap_stream *stream, uint8_t state)
 
 	switch (state) {
 	case BT_ASCS_ASE_STATE_IDLE:
+		stream_notify_idle(stream);
 		break;
 	case BT_ASCS_ASE_STATE_CONFIG:
 		stream_notify_config(stream);