Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp4450632pxf; Tue, 16 Mar 2021 13:55:40 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy10qv9cTcDj7aaKT1bE1lzqVurRQGkzc9sZ5C2pJ7jPFUcmgogic5wxH62aM0qHwm9NZcM X-Received: by 2002:a17:906:a94b:: with SMTP id hh11mr32214423ejb.459.1615928140075; Tue, 16 Mar 2021 13:55:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1615928140; cv=none; d=google.com; s=arc-20160816; b=YATeX+y84hkC8+8NqaA0y0UXReXbTckCzY02U46OoCVME90Ke5lg5QoYejMqFQlf9K 1J9rZcfDrxo/A8Tzc+oulLI20YAQn/O1z/XuRGcQh5TAAPztj2L+EzB1DLvLCzgf3Glw PI2KD7kWimRkTvMOUoEaWA/DRJ/WcBhkKRFt+CX0sBghwpnHRL92ycuadZkLpUm74o1t mEz/n2VtXnySgr+j4Zrs4PHl8OFWYIAfQvdKdpf0eUtpADpSvuIfWWSE8jqIvJbimF+6 cPHgQMUtSc03/uisg4xX2whosQROJ3KLFRxWhoklipRr9BGRdZcdzeJWIlH7W0G4XYH+ 6J4Q== 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=t+80nFaKwRmJo0eemNdxTiZ6Us8jvkeSFQfD1dSbVq8=; b=yfZOAmdVBgOgijDodJlfsmLsxBq8tMX24Y77Iw94UQnBcG98eiaRIaTG52702t5d/p 6qG3X6AFXSc3yQ2nslaDvJd8pVHMt5fzBy+TkmmQstjGPzj5chHSrXgy0NF9de108pB2 96RXmqR3T5y4G+OTBNYacUmVi6FbnDKmT528avKmJkwf3w+F+89sK6cRvmwGpM99Monx d3nEjsongPzEIRiTJ3S5zCGpbmQJZNTfycgh0fXCX7r+0Q0ljLdL/uC32qn7wE+PuC11 R7VqUCaCbWBp5CgB8oQlxB2xcXRvecU1LFV8Cd7KvZAN8udZME2Nz6+0gpaSniLtjg2T pCmw== 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 y40si16167366ede.204.2021.03.16.13.55.05; Tue, 16 Mar 2021 13:55:40 -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 S237922AbhCPQjv (ORCPT + 99 others); Tue, 16 Mar 2021 12:39:51 -0400 Received: from bhuna.collabora.co.uk ([46.235.227.227]:43106 "EHLO bhuna.collabora.co.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238760AbhCPQjh (ORCPT ); Tue, 16 Mar 2021 12:39:37 -0400 Received: from [127.0.0.1] (localhost [127.0.0.1]) (Authenticated sender: fdanis) with ESMTPSA id A82F21F44AEB From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Danis?= To: linux-bluetooth@vger.kernel.org Subject: [PATCH Bluez v4 0/4] adapter: Fix discovery trigger for 0 second delay Date: Tue, 16 Mar 2021 17:39:24 +0100 Message-Id: <20210316163928.27279-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. v2: Fix issue found by CI v3: Add a wrapper function for g_timeout_add_seconds and replace calls to it in src/*, profiles/* and plugins/* v4: 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