Received: by 2002:a05:6a11:4021:0:0:0:0 with SMTP id ky33csp74239pxb; Tue, 21 Sep 2021 19:10:23 -0700 (PDT) X-Google-Smtp-Source: ABdhPJywzZT184pyA7LD+Njx2kt4hW+MJs7Ym+omrvEv2q/XW9BsdgUAqdeL9JCvY7clQNNeFcbr X-Received: by 2002:a05:6e02:1bad:: with SMTP id n13mr20385035ili.142.1632276623673; Tue, 21 Sep 2021 19:10:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1632276623; cv=none; d=google.com; s=arc-20160816; b=awmrsyb2rD+GWSz1iwqkyXS5eIwOj2mYoegI0q0IW7O8SR8mfUIscLdsnqDQmS4rBS rVdcaNRa8Alsm85Dn90imI1+281VfkvygJc+oJK/w5rOEDQV73BVDaBJmrIxbEhHIKnt +crzp2MvK9DDHce11e4c3RmZvaGT8dPJQpA45IF/lfJRm5vH526ws7+Qqa7Wx/40Q7Wn hcCXYuV/qHbAtL5eZFsdvKYnzakXbhWUBAXwgEKTB1TspHbeSk5BHkODI2wdL5j4rQ41 L0iob8tZyVkrhrPt8hTn11NhKYC8qpjt5qeStHneTN3MDzk4TmToXd5etOiduKywwYRW f0NA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:from:subject:mime-version:message-id:date :dkim-signature; bh=LUkTouXVptb2w1fLzS/6eN9YdRiSGEQDTx4Omuh6lfM=; b=ycA3gCMdzJmw8NVOezZXonu9ol/iYJVURvyjWBDg9TE7/Sc754kPCeqKdIDZJUnLAO kQRXm1Ju++B9qfSWOdmsSnW6TXtniPHlNE/sn7iJ0uOkftlPE9jmgmgQAPmgpbbbQSwX V6LeMJQ26QHqNXsnNQ1/sNjYZ2W4phA4dYk9C12N8GJJX5nlRHzHsfr3FM451hmOneXW 2WQczQ7LcOFO+tfYerHYgzyFtRlR558mecMiLm0pmsK/uHLPG1JFIHmJ1pRJK0nPyoTx 9M1KnQD3HlQ2MW0uWEpR6NcHd0bOCgj/UL3Uw7BeWcrRqRqhJOVJahYJp8JJmLRZIsej uLrQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b=o89AdwlD; 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=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id n13si905185ilo.25.2021.09.21.19.10.11; Tue, 21 Sep 2021 19:10:23 -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; dkim=pass header.i=@google.com header.s=20210112 header.b=o89AdwlD; 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=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231267AbhIVBPO (ORCPT + 99 others); Tue, 21 Sep 2021 21:15:14 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43518 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230469AbhIVBPO (ORCPT ); Tue, 21 Sep 2021 21:15:14 -0400 Received: from mail-qk1-x749.google.com (mail-qk1-x749.google.com [IPv6:2607:f8b0:4864:20::749]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DDC8FC061574 for ; Tue, 21 Sep 2021 18:13:44 -0700 (PDT) Received: by mail-qk1-x749.google.com with SMTP id az30-20020a05620a171e00b00432eb71d467so5974242qkb.18 for ; Tue, 21 Sep 2021 18:13:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=date:message-id:mime-version:subject:from:to:cc; bh=LUkTouXVptb2w1fLzS/6eN9YdRiSGEQDTx4Omuh6lfM=; b=o89AdwlDYT/EnQ7BY971VNMSjvR3Ch85Kj9BHsFsZ3VNVDtoZg4FBi22iT15e6BsI7 hjGMgKK3xscSJ8PPqb+4QpTbzp4Ing1+HR4lBG718rEt3fkXEnYc9eIRiGSLSiILbPWI nxTeByIokrbJvxhDjWDPTJkHQ2cnzFciMDtN7dLWZHbOWGtG8FdFwzr9kic0uI+1ZKkl MrAiuInpy6lgt/osWrGbE9v0xQDvmftfKh2RodilE4jfpqP14qms8Ho7CAUNjnaPwLkK ViOM4VQ+edMNw7Rvu8mdYEu27XPQ/aDPapNOsGWjh4Ph523uFc/nr43akJ9DEftQj0f7 5szg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:message-id:mime-version:subject:from:to:cc; bh=LUkTouXVptb2w1fLzS/6eN9YdRiSGEQDTx4Omuh6lfM=; b=Noyyt3bkL+P88m6xt5w9EYzI6rwQGX410YRQXJNnn+ixOdCItsP/9aIPISWsIAvcJx NfGJZSEPWxQvpNl0D3mgZCG0hpMoIjYvVdSLJtkJr/yEGbbBMlPamNPoZK7GkDZgJBl0 I5GBIt73S0898rtDiBqxpVGRHu6tEhs6mOI1YYgrhHlM0dPf2PvbVCExtJw5srU60Ecx SFYuer5Es49FlIPAXPFK6Iet75OjDh0J74ZsN4ks+KfaMGhJpukv7ILeuo9l1yJINdEH GlFGZaWIoUxeA6GCZ9CC8ylcfmb/7wPM/NPXSA5B7iGc61M8IZHZyLIW28Fe3aM7eA9e 9kFQ== X-Gm-Message-State: AOAM531Rh7xLpywAa4DVYH+/o3dWDfTx6TxZix+qoG1dP+jPIttKGN5o ELKeNm+lxyGQFIg4y+XtiCHYIT8xAma0xQ== X-Received: from mmandlik.mtv.corp.google.com ([2620:15c:202:201:98fb:b541:26ee:9c8a]) (user=mmandlik job=sendgmr) by 2002:a25:cc0a:: with SMTP id l10mr43286936ybf.10.1632273223960; Tue, 21 Sep 2021 18:13:43 -0700 (PDT) Date: Tue, 21 Sep 2021 18:13:23 -0700 Message-Id: <20210921181243.BlueZ.v1.1.I261f9c1ee78b90f81a6c323c23065615be917c33@changeid> Mime-Version: 1.0 X-Mailer: git-send-email 2.33.0.464.g1972c5931b-goog Subject: [BlueZ PATCH v1] adv_monitor: Mark the device as lost on device_lost_timeout From: Manish Mandlik To: luiz.dentz@gmail.com, marcel@holtmann.org Cc: chromeos-bluetooth-upstreaming@chromium.org, linux-bluetooth@vger.kernel.org, Manish Mandlik , Yun-Hao Chung Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-bluetooth@vger.kernel.org Mark the device as lost on device_lost_timeout so that it can be found again next time. Verified this by adding a monitor using bluetoothctl and confirming that the DeviceLost event is getting triggered when bt peer stops advertising and DeviceFound event gets triggered again when the bt peer restarts the advertising. Reviewed-by: Yun-Hao Chung --- src/adv_monitor.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/adv_monitor.c b/src/adv_monitor.c index 715ac5904..a55e1ea2d 100644 --- a/src/adv_monitor.c +++ b/src/adv_monitor.c @@ -1892,7 +1892,9 @@ static bool handle_device_lost_timeout(gpointer user_data) g_dbus_proxy_method_call(monitor->proxy, "DeviceLost", report_device_state_setup, NULL, dev->device, NULL); + dev->lost_timer = 0; + dev->found = false; return FALSE; } -- 2.33.0.464.g1972c5931b-goog