Received: by 2002:a05:7412:3b8b:b0:fc:a2b0:25d7 with SMTP id nd11csp3035422rdb; Tue, 13 Feb 2024 05:12:29 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCVhOICNQvrqIsiAsyU0lMoL5XTM2yvQkkIWFOnJmFYAmm11qewJvGcWzCzx/LEDfo7vujKHFcDyOXD964xzX5Ov+d611T/5Rs2yDEmRBA== X-Google-Smtp-Source: AGHT+IG4CngFflPcqaerWgylW1Xh5mmwldkP7FZdbguWEdTF95I6GHFakDBqSdpQgT2YGIvDiRXd X-Received: by 2002:aa7:c748:0:b0:55f:ffb2:75ca with SMTP id c8-20020aa7c748000000b0055fffb275camr6049076eds.18.1707829948921; Tue, 13 Feb 2024 05:12:28 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707829948; cv=pass; d=google.com; s=arc-20160816; b=D/ifqM5dXMoglHwj/e+clTnTgt3HQLfeAWq0ZffD+2OxENjvLhmGvktu7OXNTH4NNB I7dIMDbSgcjmIEAOYHEnUc2kILjnkXID2br7R6OeuU4dkOvYL6hC9JXNVhkNawqTvvjz +MLiUkI6JaOZHRz//L+lMZcPxOP3rdKIT66L3xS7J4RIqgU1nRMMHSVFYMbTykXCISlQ eSa713UDBmrTMoZop575JydFMNjW4bhjqE+AFoaeLIXGXSaZSQhtdZk6HStEkgHFuKwl LJlfcfiRb8tXmHEI8wb0isX/KVy4Zx2P1czuAQxrfeCo9ddF94TR4+3lSTnKsSwYzDr7 b2RA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:message-id:date:subject:cc:to :from:dkim-signature; bh=k3BU+7FRfR3+9d+O9WCXoUhbfOb5KYxgSeXacKQ/Ukw=; fh=NqvpqnnLNUDp6z/QDTBEli9cmSc5stphGwQZ15dZZhs=; b=erw6uyuO1+ILUkCQ2gDbw+E3NxYFS20XZVDKAbC5lrVHgQJlEG8jwaUynvmN6aaInc e3iFW0SL0rJlaUxjoJnpqu3mxNE3gj46R5br8Ddbzypyh0c0thlAGWGZOe8NWPTppXNf rPuF/NLqnDrvHFDwRu0DLITgaKNACSeaUx9sLJPBB56KPp0B4malK6Tbc6z1jw0VQ0yO YnTPFus80Q/+k7MK4cPRV2LrmOaUNt1/NdhmaG53xiBfgJBocicukbV+nkG4pFnnrCzg SDrPziCupeZgxninx37B/mX+HK2z7x+HyW14MTw2r2HorCPEb6bhzv8No1dNuYAajZtr YfYQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=h6hN3n2Q; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com dmarc=pass fromdomain=gmail.com); spf=pass (google.com: domain of linux-bluetooth+bounces-1810-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-bluetooth+bounces-1810-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com X-Forwarded-Encrypted: i=2; AJvYcCVc5uooxK96QfWLV/60yL1i1PfrSejZ9PZ9+10cwggSIkRqTbhGs/5lSk4IUgxtulTrwTHyRD0OcC6vwaliK07ijsoKxD7nmHEAsF6wWA== Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id q16-20020a056402519000b00561ee0ec525si748323edd.416.2024.02.13.05.12.28 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 13 Feb 2024 05:12:28 -0800 (PST) Received-SPF: pass (google.com: domain of linux-bluetooth+bounces-1810-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=h6hN3n2Q; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com dmarc=pass fromdomain=gmail.com); spf=pass (google.com: domain of linux-bluetooth+bounces-1810-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-bluetooth+bounces-1810-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id A7F181F253C6 for ; Tue, 13 Feb 2024 13:12:28 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id BBE5855779; Tue, 13 Feb 2024 13:12:19 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="h6hN3n2Q" X-Original-To: linux-bluetooth@vger.kernel.org Received: from mail-ej1-f51.google.com (mail-ej1-f51.google.com [209.85.218.51]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id A471554FA6 for ; Tue, 13 Feb 2024 13:12:17 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.218.51 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707829939; cv=none; b=lrVUKCttnpF5t8gFvXbZPEnjmxkiQ7wjeeHgh55URJzDiIMB1AbR/9KU9PyHo1XB2OjL2rSTfgcinC9L1ldhGCUKatvSC+Ucg3gv5qDhxtPpzEz+0qXx8Wr2WPcKBj0CZsTCa3nhkZswDf4+QPdY9/eRtWs0LBlTU+TkKeg2eqM= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707829939; c=relaxed/simple; bh=8fxfnTIPMb2tnA2szCe2OOq/NJL/AcZBFVPZvQynbxs=; h=From:To:Cc:Subject:Date:Message-Id:MIME-Version; b=rhZ3S91cDpgotJLXYXVAPJ7gxhmwkM3IHQiS2vD+mK9VLAT2FRsUqY+jBY9mRHjDdS2ER49u2MniQBWimzXeksI3xWphsD7J5fukMlwlqe3+lStF5IJSTLGadBfHsHbcWVc3z9oeCm3FM2hD32WhGezukTQ09m7O+mj1O3eslN0= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=h6hN3n2Q; arc=none smtp.client-ip=209.85.218.51 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-ej1-f51.google.com with SMTP id a640c23a62f3a-a3d1151b497so54775066b.1 for ; Tue, 13 Feb 2024 05:12:17 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1707829935; x=1708434735; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=k3BU+7FRfR3+9d+O9WCXoUhbfOb5KYxgSeXacKQ/Ukw=; b=h6hN3n2Qz4wF5FadPoPDz4dFJuDOu+vTWZjOw/mGXnB3VEHPFijtBK3Ip75OPYSeO1 xHk5caQK3eEoT7WULBnRp6zt4ARBLq0/v4zE587Vp9Wp84xGYh0dgwQeK5fNlP/SZoCh kG8KT0vFfI5u9ntIXpSh1GBhTfJWD52+OzEqlswh5//WjukJIF6kHbnrEA2z70PSPY2i zh9yl6pNN/OFesIXwWCYxw/HZG0T49iIsKTC6cEhJb4LwsPbd0+JZeiLvNDsbjSizn31 JPPL+TM7l93HmuFh6GVoAqvFhZBdUfOKOZ5pRo4CnNg7yu9bOyiMmYVcCjiF8//z4VbK aVjA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1707829935; x=1708434735; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=k3BU+7FRfR3+9d+O9WCXoUhbfOb5KYxgSeXacKQ/Ukw=; b=o5WZ4M4bpFFJhe2k4aeCJ8IMw+V/6OTzxjqenEfEg9CHSYOv3SHX51lbm8m2ly5sn0 dXPG+lGyHyviF/1MmRUDyQyA+w8rNi3ukhGYaMjJm3XoRjkrSQSF/DruXghDfVIXPxAm 5LxLMh6DBwhgheyaWWdXcJ0Wn6cTvQSkiqpuO2fG7cbpx1h8CgeTOJ2iYXF6NAa6V8TO a3jmOhhSU7DOvacQ7JAz1zrqR67euybKy+oCEu170doKGKKipklWWBgbZSv7PVLwEfAd 0iKjaGH5BbVL5ZXH9OMJzBfGPMwqnxU41GxvUwWuHe8jjwEF8gHuTwrZ/BTALUrx/46p hGbA== X-Gm-Message-State: AOJu0Yy7PKZ/a0PUYi26q1EJsjcFEKtxXaTZc6SRZWWsJv6+oid528F1 HaYiVKBiDClLJs65FWfixQcHJspa8hSWPc2hJPwW+lOaJH0ZrYL3HZtGqAGU X-Received: by 2002:a17:906:af87:b0:a38:33bb:a7f0 with SMTP id mj7-20020a170906af8700b00a3833bba7f0mr7187303ejb.58.1707829933385; Tue, 13 Feb 2024 05:12:13 -0800 (PST) Received: from raspberrypi.home (46.205.193.64.nat.ftth.dynamic.t-mobile.pl. [46.205.193.64]) by smtp.gmail.com with ESMTPSA id cu3-20020a170906ba8300b00a3cb30d6271sm1293512ejd.143.2024.02.13.05.12.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 13 Feb 2024 05:12:12 -0800 (PST) From: Arkadiusz Bokowy To: linux-bluetooth@vger.kernel.org Cc: Arkadiusz Bokowy Subject: [PATCH BlueZ] advertising: Do not set timer if DiscoverableTimeout=0 Date: Tue, 13 Feb 2024 14:12:05 +0100 Message-Id: <20240213131205.28250-1-arkadiusz.bokowy@gmail.com> X-Mailer: git-send-email 2.39.2 Precedence: bulk X-Mailing-List: linux-bluetooth@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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