[PATCH BlueZ] advertising: Do not set timer if DiscoverableTimeout=0

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

 



According to org.bluez.LEAdvertisement.rst documentation, the value of
zero should disable timeout and keep device in the discoverable mode
forever.
---
 src/advertising.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/src/advertising.c b/src/advertising.c
index 2c9a5a443..c036065c4 100644
--- a/src/advertising.c
+++ b/src/advertising.c
@@ -1065,7 +1065,9 @@ static bool parse_discoverable_timeout(DBusMessageIter *iter,
 	if (client->disc_to_id)
 		timeout_remove(client->disc_to_id);
 
-	client->disc_to_id = timeout_add_seconds(client->discoverable_to,
+	if (client->discoverable_to > 0)
+		client->disc_to_id = timeout_add_seconds(
+						client->discoverable_to,
 						client_discoverable_timeout,
 						client, NULL);
 
-- 
2.39.2





[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