Linux-Bluetooth Archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/2] Set device non temp when synchronized with bcast source
@ 2023-08-30 13:29 Silviu Florian Barbulescu
  2023-08-30 13:29 ` [PATCH 1/2] Set temp if device is bcast source even if addr is private Silviu Florian Barbulescu
  2023-08-30 13:29 ` [PATCH 2/2] Set the device temp false when sync with a " Silviu Florian Barbulescu
  0 siblings, 2 replies; 4+ messages in thread
From: Silviu Florian Barbulescu @ 2023-08-30 13:29 UTC (permalink / raw
  To: linux-bluetooth
  Cc: claudia.rosu, mihai-octavian.urzica, silviu.barbulescu,
	vlad.pruteanu, andrei.istodorescu, iulia.tanasescu

Set scanned broadcast source device as nontemporary when broadcast
sink synchronized with it

Silviu Florian Barbulescu (2):
  For the audio LE broadcast, we need to set the device's temporary flag
    even if the address is private.
  Set the device temporarily false when sync is done with a broadcast
    source so the device will not be removed on the temporary timer.

 profiles/audio/bap.c |  5 +++++
 src/device.c         | 13 +++++++++++--
 2 files changed, 16 insertions(+), 2 deletions(-)


base-commit: 670f0d0f618d3f122e6d95c34de53f59a343a15f
-- 
2.34.1


^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCH 1/2] Set temp if device is bcast source even if addr is private
  2023-08-30 13:29 [PATCH 0/2] Set device non temp when synchronized with bcast source Silviu Florian Barbulescu
@ 2023-08-30 13:29 ` Silviu Florian Barbulescu
  2023-08-30 20:51   ` Set device non temp when synchronized with bcast source bluez.test.bot
  2023-08-30 13:29 ` [PATCH 2/2] Set the device temp false when sync with a " Silviu Florian Barbulescu
  1 sibling, 1 reply; 4+ messages in thread
From: Silviu Florian Barbulescu @ 2023-08-30 13:29 UTC (permalink / raw
  To: linux-bluetooth
  Cc: claudia.rosu, mihai-octavian.urzica, silviu.barbulescu,
	vlad.pruteanu, andrei.istodorescu, iulia.tanasescu

For audio LE broadcast we need to set the device temporary flag eaven
if the address is private

---
 src/device.c | 13 +++++++++++--
 1 file changed, 11 insertions(+), 2 deletions(-)

diff --git a/src/device.c b/src/device.c
index 9b58e0c4e..9ceffa118 100644
--- a/src/device.c
+++ b/src/device.c
@@ -5945,8 +5945,17 @@ void btd_device_set_temporary(struct btd_device *device, bool temporary)
 	if (device->temporary == temporary)
 		return;
 
-	if (device_address_is_private(device))
-		return;
+	if (device_address_is_private(device)) {
+		/* For audio LE broadcast, we need to set the device
+		 * temporary flag even if the address is private.
+		 * If the device that is temporarily set on
+		 * has BCAA_SERVICE_UUID (is a broadcast source)
+		 * will set the temporary flag even if the address
+		 * is private.
+		 */
+		if (!btd_device_has_uuid(device, BCAA_SERVICE_UUID))
+			return;
+	}
 
 	DBG("temporary %d", temporary);
 
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [PATCH 2/2] Set the device temp false when sync with a bcast source
  2023-08-30 13:29 [PATCH 0/2] Set device non temp when synchronized with bcast source Silviu Florian Barbulescu
  2023-08-30 13:29 ` [PATCH 1/2] Set temp if device is bcast source even if addr is private Silviu Florian Barbulescu
@ 2023-08-30 13:29 ` Silviu Florian Barbulescu
  1 sibling, 0 replies; 4+ messages in thread
From: Silviu Florian Barbulescu @ 2023-08-30 13:29 UTC (permalink / raw
  To: linux-bluetooth
  Cc: claudia.rosu, mihai-octavian.urzica, silviu.barbulescu,
	vlad.pruteanu, andrei.istodorescu, iulia.tanasescu

Set the device temporarily false when sync is done with a broadcast
source so the device will not be removed on the temporary timer

---
 profiles/audio/bap.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/profiles/audio/bap.c b/profiles/audio/bap.c
index dfc71edf6..ab0b2c22b 100644
--- a/profiles/audio/bap.c
+++ b/profiles/audio/bap.c
@@ -658,6 +658,9 @@ static void bap_io_close(struct bap_ep *ep)
 	g_io_channel_unref(ep->io);
 	ep->io = NULL;
 	ep->cig_active = false;
+
+	if (bt_bap_pac_get_type(ep->lpac) == BT_BAP_BCAST_SINK)
+		btd_device_set_temporary(ep->data->device, true);
 }
 
 static DBusMessage *set_configuration(DBusConnection *conn, DBusMessage *msg,
@@ -797,6 +800,8 @@ static void iso_bcast_confirm_cb(GIOChannel *io, GError *err, void *user_data)
 		goto drop;
 	}
 
+	btd_device_set_temporary(data->device, false);
+
 	g_io_channel_ref(io);
 	btd_service_connecting_complete(data->service, 0);
 	DBG("BCAST ISO: sync with %s (BIG 0x%02x BIS 0x%02x)",
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* RE: Set device non temp when synchronized with bcast source
  2023-08-30 13:29 ` [PATCH 1/2] Set temp if device is bcast source even if addr is private Silviu Florian Barbulescu
@ 2023-08-30 20:51   ` bluez.test.bot
  0 siblings, 0 replies; 4+ messages in thread
From: bluez.test.bot @ 2023-08-30 20:51 UTC (permalink / raw
  To: linux-bluetooth, silviu.barbulescu

[-- Attachment #1: Type: text/plain, Size: 949 bytes --]

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=780614

---Test result---

Test Summary:
CheckPatch                    PASS      1.02 seconds
GitLint                       PASS      0.67 seconds
BuildEll                      PASS      34.92 seconds
BluezMake                     PASS      1229.43 seconds
MakeCheck                     PASS      13.21 seconds
MakeDistcheck                 PASS      203.48 seconds
CheckValgrind                 PASS      330.33 seconds
CheckSmatch                   PASS      457.77 seconds
bluezmakeextell               PASS      136.69 seconds
IncrementalBuild              PASS      2114.09 seconds
ScanBuild                     PASS      1458.08 seconds



---
Regards,
Linux Bluetooth


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2023-08-30 20:53 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-08-30 13:29 [PATCH 0/2] Set device non temp when synchronized with bcast source Silviu Florian Barbulescu
2023-08-30 13:29 ` [PATCH 1/2] Set temp if device is bcast source even if addr is private Silviu Florian Barbulescu
2023-08-30 20:51   ` Set device non temp when synchronized with bcast source bluez.test.bot
2023-08-30 13:29 ` [PATCH 2/2] Set the device temp false when sync with a " Silviu Florian Barbulescu

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).