diff mbox series

[BlueZ,1/5] shared/bap: Fix not reading all instances of PAC Sinks/Sources

Message ID 20221129204556.1535821-1-luiz.dentz@gmail.com (mailing list archive)
State Superseded
Headers show
Series [BlueZ,1/5] shared/bap: Fix not reading all instances of PAC Sinks/Sources | expand

Checks

Context Check Description
tedd_an/pre-ci_am success Success
tedd_an/CheckPatch success CheckPatch PASS
tedd_an/GitLint success Gitlint PASS
tedd_an/BuildEll success Build ELL PASS
tedd_an/BluezMake success Bluez Make PASS
tedd_an/MakeCheck success Bluez Make Check PASS
tedd_an/MakeDistcheck success Make Distcheck PASS
tedd_an/CheckValgrind success Check Valgrind PASS
tedd_an/bluezmakeextell success Make External ELL PASS
tedd_an/IncrementalBuild success Incremental Build PASS
tedd_an/ScanBuild success Scan Build PASS

Commit Message

Luiz Augusto von Dentz Nov. 29, 2022, 8:45 p.m. UTC
From: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>

Both PAC Sink and Source are allowed to have multiple instances:

 - The server wanted to support a smaller maximum transmission unit
 (ATT_MTU, as defined in Volume 3, Part F, Section 3.2.8 in [2]) size.
 Exposing all supported PAC records in a single Sink PAC characteristic
 would require the server to increase its supported Maximum
 Transmission Unit (MTU) size to a value the server considered
 excessive.
 - The server wanted to expose support for proprietary audio
 capabilities (such as vendor-specific audio codecs, as denoted by the
 Codec_ID parameter value) separately from support for
 non-vendor-specific audio capabilities and used separate Sink PAC
 characteristics to expose such support.
 - The server wanted to minimize the amount of data to be transferred,
 when sending notifications to a client that the Sink PAC
 characteristic value changed, by exposing the audio capabilities
 likely to change quicker than others in separate Sink PAC
 characteristics.
---
 src/shared/bap.c | 12 ++++++++----
 1 file changed, 8 insertions(+), 4 deletions(-)

Comments

bluez.test.bot@gmail.com Nov. 29, 2022, 11:12 p.m. UTC | #1
This is automated email and please do not reply to this email!

Dear submitter,

Thank you for submitting the patches to the linux bluetooth mailing list.
This is a CI test results with your patch series:
PW Link:https://patchwork.kernel.org/project/bluetooth/list/?series=700234

---Test result---

Test Summary:
CheckPatch                    PASS      2.95 seconds
GitLint                       PASS      1.87 seconds
BuildEll                      PASS      33.94 seconds
BluezMake                     PASS      1007.00 seconds
MakeCheck                     PASS      13.20 seconds
MakeDistcheck                 PASS      183.09 seconds
CheckValgrind                 PASS      297.60 seconds
bluezmakeextell               PASS      116.65 seconds
IncrementalBuild              PASS      4089.08 seconds
ScanBuild                     PASS      1243.14 seconds



---
Regards,
Linux Bluetooth
diff mbox series

Patch

diff --git a/src/shared/bap.c b/src/shared/bap.c
index 21aa8aa6c5ca..7a24824a71fc 100644
--- a/src/shared/bap.c
+++ b/src/shared/bap.c
@@ -2908,10 +2908,12 @@  static void foreach_pacs_char(struct gatt_db_attribute *attr, void *user_data)
 		DBG(bap, "Sink PAC found: handle 0x%04x", value_handle);
 
 		pacs = bap_get_pacs(bap);
-		if (!pacs || pacs->sink)
+		if (!pacs)
 			return;
 
-		pacs->sink = attr;
+		if (!pacs->sink)
+			pacs->sink = attr;
+
 		bap_read_value(bap, value_handle, read_sink_pac, bap);
 	}
 
@@ -2919,10 +2921,12 @@  static void foreach_pacs_char(struct gatt_db_attribute *attr, void *user_data)
 		DBG(bap, "Source PAC found: handle 0x%04x", value_handle);
 
 		pacs = bap_get_pacs(bap);
-		if (!pacs || pacs->source)
+		if (!pacs)
 			return;
 
-		pacs->source = attr;
+		if (!pacs->source)
+			pacs->source = attr;
+
 		bap_read_value(bap, value_handle, read_source_pac, NULL);
 	}