[PATCH BlueZ v5 2/6] shared/bap: Add function to check the validity of a BIS

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

 



Add utilitary function to check if the information from a BIS is matching
the capabilities in bt_bap. This utilitary is used when parsing the BASE
data so that we can decide if we create a new setup/stream/transport for
it, or advance to the next BIS.
---
 src/shared/bap.c | 21 +++++++++++++++++++++
 src/shared/bap.h |  7 +++++++
 2 files changed, 28 insertions(+)

diff --git a/src/shared/bap.c b/src/shared/bap.c
index 919ecbb6a016..c927ddc21572 100644
--- a/src/shared/bap.c
+++ b/src/shared/bap.c
@@ -6521,3 +6521,24 @@ void bt_bap_add_bis(struct bt_bap *bap, uint8_t bis_index,
 cleanup:
 	util_iov_free(merge_data.result, 1);
 }
+
+void bt_bap_verify_bis(struct bt_bap *bap, uint8_t bis_index,
+		struct bt_bap_codec *codec,
+		struct iovec *l2_caps,
+		struct iovec *l3_caps,
+		struct bt_bap_pac **lpac,
+		struct iovec **caps)
+{
+	struct bt_ltv_extract merge_data = {0};
+
+	merge_data.src = l3_caps;
+	merge_data.result = new0(struct iovec, 1);
+
+	/* Create a Codec Specific Configuration with LTVs at level 2 (subgroup)
+	 * overwritten by LTVs at level 3 (BIS)
+	 */
+	util_ltv_foreach(l2_caps->iov_base,
+			l2_caps->iov_len,
+			NULL,
+			bap_sink_check_level2_ltv, &merge_data);
+}
diff --git a/src/shared/bap.h b/src/shared/bap.h
index 62e2104850c7..c9cc4c3a4db7 100644
--- a/src/shared/bap.h
+++ b/src/shared/bap.h
@@ -257,3 +257,10 @@ void bt_bap_add_bis(struct bt_bap *bap, uint8_t bis_index,
 		struct iovec *l3_caps,
 		struct iovec *meta);
 
+void bt_bap_verify_bis(struct bt_bap *bap, uint8_t bis_index,
+		struct bt_bap_codec *codec,
+		struct iovec *l2_caps,
+		struct iovec *l3_caps,
+		struct bt_bap_pac **lpac,
+		struct iovec **caps);
+
-- 
2.40.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