[PATCH BlueZ v1] shared/bap: Use read long procedure with PAC Sink/Source

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

 



From: Luiz Augusto von Dentz <luiz.von.dentz@xxxxxxxxx>

Since the PAC records is not of a fixed size and can spam into more data
than it fits in a single MTU it shall be read with
bt_gatt_client_read_long_value otherwise the record maybe truncated.
---
 src/shared/bap.c | 18 ++++++++++--------
 1 file changed, 10 insertions(+), 8 deletions(-)

diff --git a/src/shared/bap.c b/src/shared/bap.c
index 1c15a4ecb3f7..4827f77408ef 100644
--- a/src/shared/bap.c
+++ b/src/shared/bap.c
@@ -4784,7 +4784,8 @@ static void read_source_pac_loc(bool success, uint8_t att_ecode,
 		if (gatt_db_attribute_get_char_data(pacs->source,
 						NULL, &value_handle,
 						NULL, NULL, NULL))
-			bt_gatt_client_read_value(bap->client, value_handle,
+			bt_gatt_client_read_long_value(bap->client,
+							value_handle, 0,
 							read_source_pac, bap,
 							NULL);
 	}
@@ -4817,7 +4818,8 @@ static void read_sink_pac_loc(bool success, uint8_t att_ecode,
 		if (gatt_db_attribute_get_char_data(pacs->sink,
 						NULL, &value_handle,
 						NULL, NULL, NULL))
-			bt_gatt_client_read_value(bap->client, value_handle,
+			bt_gatt_client_read_long_value(bap->client,
+							value_handle, 0,
 							read_sink_pac, bap,
 							NULL);
 	}
@@ -4897,7 +4899,7 @@ static void foreach_pacs_char(struct gatt_db_attribute *attr, void *user_data)
 		if (!pacs->sink)
 			pacs->sink = attr;
 
-		bt_gatt_client_read_value(bap->client, value_handle,
+		bt_gatt_client_read_long_value(bap->client, value_handle, 0,
 						read_sink_pac, bap, NULL);
 	}
 
@@ -4911,7 +4913,7 @@ static void foreach_pacs_char(struct gatt_db_attribute *attr, void *user_data)
 		if (!pacs->source)
 			pacs->source = attr;
 
-		bt_gatt_client_read_value(bap->client, value_handle,
+		bt_gatt_client_read_long_value(bap->client, value_handle, 0,
 						read_source_pac, bap, NULL);
 	}
 
@@ -5515,8 +5517,8 @@ clone:
 			if (gatt_db_attribute_get_char_data(pacs->sink,
 							NULL, &value_handle,
 							NULL, NULL, NULL)) {
-				bt_gatt_client_read_value(bap->client,
-							value_handle,
+				bt_gatt_client_read_long_value(bap->client,
+							value_handle, 0,
 							read_sink_pac,
 							bap, NULL);
 			}
@@ -5539,8 +5541,8 @@ clone:
 			if (gatt_db_attribute_get_char_data(pacs->source,
 							NULL, &value_handle,
 							NULL, NULL, NULL)) {
-				bt_gatt_client_read_value(bap->client,
-							value_handle,
+				bt_gatt_client_read_long_value(bap->client,
+							value_handle, 0,
 							read_source_pac,
 							bap, NULL);
 			}
-- 
2.49.0





[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