Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp4270735pxf; Tue, 16 Mar 2021 09:23:45 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzXjbTeYcl93wgj8WfpKEFMDazhOYHA3uG+KQdtMfM2OAVAa0Dl32eXBLGr3c90PafUUye0 X-Received: by 2002:aa7:c0cd:: with SMTP id j13mr38215010edp.41.1615911824959; Tue, 16 Mar 2021 09:23:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1615911824; cv=none; d=google.com; s=arc-20160816; b=OeLTpIRIgT72HU2l5WTN83ChAzK8AyrrxrMWnP5aMjsjiw1Oo2VZlCEW//FQMIBTTI UjPhbVSiFf8FuEd0MBfmkcJGH9oVhl7LZSNf7fozTuJJ/0XriVCm6BcQMWrkrSBGPyIg ZqIDxwKjroWAPqMePuybr23d+Ev/zmxMvdmwgyxrxMHzmbF5byQa2+mOU2i2eeLijMHb PMy9TUfXb6cqMEwWJ1MV7MtIw5hTTI1CPZdeidjelBCBRGLu8AKa63WUKrxdXMDYsJW1 Y50JkOFJo6f7EdzeC89L/BxwDBdtKbK9FTJbbyzwylkPHW69u1zsg8ZGcxftDlLNd/ga lkMg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:to:from; bh=0ZgKyHlsWhnwSFwsYNHHcbQfWZrJuvJUPs9BlzStyzM=; b=r+vbPDNGVDSb31hWeIULViraEVz6iZ0LcMuiQpf9BP33oYqc3WdYqfAUG94da459ff rDVe8LZo969p7byT9vDsYqAIb1Dj+Pc4RykSTTYLQT/SjX7oNRmsV0bzJDnL0nM/6ak7 70WF9yOUUWB5Gm6cZ5GWuz/0u9paP/H72wVRgLUqbuuWKqJ2A0ykJSk5msCdyNLimy4E +0Kvg1LlsoYqG12LeL5cD+QWmXhLWmxFBrNISiZLCQ460UK6QJJiwMk102tZNHSwvlHi 2Wc22NcS2vjXcfmXdoYYPEMd9EwORozBYz33JHvay+fGEjw0Pi9H7vFNXDKHcFaqBZJj nWqw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-bluetooth-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-bluetooth-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=collabora.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id w9si15761797edi.363.2021.03.16.09.23.21; Tue, 16 Mar 2021 09:23:44 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-bluetooth-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-bluetooth-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-bluetooth-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=collabora.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235330AbhCPO04 (ORCPT + 99 others); Tue, 16 Mar 2021 10:26:56 -0400 Received: from bhuna.collabora.co.uk ([46.235.227.227]:41862 "EHLO bhuna.collabora.co.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235283AbhCPO0j (ORCPT ); Tue, 16 Mar 2021 10:26:39 -0400 Received: from [127.0.0.1] (localhost [127.0.0.1]) (Authenticated sender: fdanis) with ESMTPSA id A87201F44BC6 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Danis?= To: linux-bluetooth@vger.kernel.org Subject: [PATCH Bluez v3 0/4] adapter: Fix discovery trigger for 0 second delay Date: Tue, 16 Mar 2021 15:26:23 +0100 Message-Id: <20210316142627.23692-1-frederic.danis@collabora.com> X-Mailer: git-send-email 2.18.0 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-bluetooth@vger.kernel.org When calling `StartDiscovery` the effective start can take around 10 ms or up to 700 ms. g_timeout_add_seconds() call doesn't ensure the time for the first call of the timer if the delay is less or equal to 1 second. v3: Add a wrapper function for g_timeout_add_seconds and replace calls to it in src/*, profiles/* and plugins/* v2: Fix issue found by CI Frédéric Danis (4): shared/timeout: Add timeout_add_seconds abstraction src: Replace calls to g_timeout_add_seconds by timeout_add_seconds plugins: Replace calls to g_timeout_add_seconds by timeout_add_seconds profiles: Replace calls to g_timeout_add_seconds by timeout_add_seconds plugins/policy.c | 91 ++++++++++++++++++----------------- profiles/audio/a2dp.c | 17 ++++--- profiles/audio/avctp.c | 44 +++++++++-------- profiles/audio/avdtp.c | 61 ++++++++++++----------- profiles/audio/avrcp.c | 13 ++--- profiles/health/hdp.c | 16 +++--- profiles/health/mcap.c | 21 ++++---- profiles/input/device.c | 33 +++++++------ profiles/network/bnep.c | 12 +++-- profiles/sap/server.c | 13 ++--- src/adapter.c | 90 ++++++++++++++++++---------------- src/adv_monitor.c | 14 +++--- src/advertising.c | 28 ++++++----- src/device.c | 60 ++++++++++++----------- src/main.c | 7 +-- src/sdp-client.c | 13 ++--- src/shared/tester.c | 16 +++--- src/shared/timeout-ell.c | 6 +++ src/shared/timeout-glib.c | 27 +++++++++++ src/shared/timeout-mainloop.c | 6 +++ src/shared/timeout.h | 3 ++ 21 files changed, 332 insertions(+), 259 deletions(-) -- 2.18.0