[PATCH BlueZ 7/7] shared/bap: check ASE state in find_ep_ucast

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



ASE may be in non-configurable state also if it has no associated
stream, eg. as a result of failed stream teardown or other misbehavior.
Check also ASE state when selecting a "free" one.

Fixes wrongly picking ASE that is not IDLE/CONFIG/QOS and cannot be
configured.
---
 src/shared/bap.c | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/src/shared/bap.c b/src/shared/bap.c
index c27e675ff..ed5c322b4 100644
--- a/src/shared/bap.c
+++ b/src/shared/bap.c
@@ -6224,6 +6224,15 @@ static bool find_ep_ucast(const void *data, const void *user_data)
 		}
 	}
 
+	switch (ep->state) {
+	case BT_ASCS_ASE_STATE_IDLE:
+	case BT_ASCS_ASE_STATE_CONFIG:
+	case BT_ASCS_ASE_STATE_QOS:
+		break;
+	default:
+		return false;
+	}
+
 	if (ep->dir != match->rpac->type)
 		return false;
 
-- 
2.50.1





[Index of Archives]     [Bluez Devel]     [Linux Wireless Networking]     [Linux Wireless Personal Area Networking]     [Linux ATH6KL]     [Linux USB Devel]     [Linux Media Drivers]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Big List of Linux Books]

  Powered by Linux