Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp3744836pxb; Wed, 13 Oct 2021 12:03:50 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwl2M4Fe4cmzxEZlgqhVHBIckn3ET5I6wuvdFXTn31ZVou3b8LnQ7p/HiCh+Uk3+gjwb7CX X-Received: by 2002:a17:906:cccb:: with SMTP id ot11mr1131336ejb.219.1634151829937; Wed, 13 Oct 2021 12:03:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1634151829; cv=none; d=google.com; s=arc-20160816; b=rcUV5TlBGoUEJDYcoEwFItWLTQv5kPHGCrmthUL52lgvO5Ka1GJZA9BeHcSDSkqh5l VjaAMkefqoUFoCKXsdI3Eihqz98p1j7rIHgb9+Fz7Tbk8JVzPIzsWuZD7XclCMBmvrH6 MnMfU5gKxIqr2q6YxBJX3v8lz4gObNwqD3JxiQZmQblpl/drea42uc4Px7Uz6Tnzfigq T5L/wpJFpc22TiPBpVsoOft3evndAD6TphCo5jXUOX2c9vda+5Mp5FNSl3HsqYWT/FjP HoUefMZ5X9tBH8dPkuE3TVAnyKjltntFq+8Z3mkqlqG+ueD1y7XkORys769FuVEH+j6n gGmg== 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=IWuuhlIKRosdEBL6rQjGU4vIiE800u+U3smRxZuRX4g=; b=lj/e7qW2FbKbJHXp4E3SK+E7aK5vkYus2N8DhzygddTgkdmdWvzgo6lX9MOvxpi/IF 5TpYBTPORu9tHFjNjcNcd/obdkLbgsd3uHSj6G11HnbM5isu14bvWlMsI0+7QfFogBsK EJ2aHbzZ8PQHXKfgRnHnTO1NeDdhz302Eh9/f/r2+YE6hyjgOESdoW6v5ssnyTZlSXWa pz7Ii87TOD67S5pawiiuAvd4WdHt8cBiMNQ+QY8PRFvWHhhfvip2YVSaevtu3xAuQfn+ d2XocLvJWNth6USD9BlEKKeEtQgxLVoPo1jcbCQ6eZMixWn4SxpksqYA1/J2mK7+ghVG iv+Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b=CcB5QioG; 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 z4si589411ejw.190.2021.10.13.12.02.34; Wed, 13 Oct 2021 12:03:49 -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=CcB5QioG; 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 S238991AbhJMTCr (ORCPT + 99 others); Wed, 13 Oct 2021 15:02:47 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57158 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238916AbhJMTCq (ORCPT ); Wed, 13 Oct 2021 15:02:46 -0400 Received: from mail-yb1-xb4a.google.com (mail-yb1-xb4a.google.com [IPv6:2607:f8b0:4864:20::b4a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2301BC061570 for ; Wed, 13 Oct 2021 12:00:43 -0700 (PDT) Received: by mail-yb1-xb4a.google.com with SMTP id b126-20020a251b84000000b005bd8aca71a2so4255986ybb.4 for ; Wed, 13 Oct 2021 12:00:43 -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=IWuuhlIKRosdEBL6rQjGU4vIiE800u+U3smRxZuRX4g=; b=CcB5QioGadoZMtNsP4VqK78XN/BKxpGaqiCy/7uNIgJxkag6wy1f+3bgZAgQ7b5qfz 3s9c1kxroNk00Kebrro1T2nyy9IifAnAmyWScayxkYf1FuZM9JK11PVYBibhnxCaDhwb fzu8Qm0gV/AuN3nq43FY2uVIl38W5QmsbzIeBs/LfWSwFoqDPHueTS5HXIkhlDn44Gea /K+AGO+2GB7+H3/nzClcIqyusKHlPyNlr32FdM/NFfwbCehNXJAYamkvBzfFxFpf4kr8 5QpejfTYpigDntWKaw9SPmf9CtYybrmXDLAxVboiyG2cJcMThre8V5aE8g9p0s0g9EhZ ysWg== 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=IWuuhlIKRosdEBL6rQjGU4vIiE800u+U3smRxZuRX4g=; b=qeP/2mi8HSBmkeE2Nhq5BY+a4TO6iAYuVFTUxRmbPWS2n9nJapyHzFMJz6kTwLlfAg xEKDT4ICkKZcYNqsRstv6wI13jmMoWenqs/sFSLntP61nFyK9glTMeenMMl+7962TPpV QByYkGkM99NPUW9b+O/mvL+CF9H/Pn+9FgqBItP9G8o58iKaRimcqMgihfI/UcwJiQvF pTshRH4LHIgIQNrFOnsPRJlm0YLAYAGNFBNWKIaW8Q6T+HGW6lqbAdje5WgfGCl9iCXU xVgjRU2bqSIdzPqsyYPNd2ygAi6QWPOLvkHu0D0NXcCxjoYMgJpLbsg3NiVsdUTEEvc1 PpCA== X-Gm-Message-State: AOAM531C8DlpCv45p9FGKIL8YuxhokZ8jZilYi8v5sCgrVmM/PpSvjg8 wwzfKbiq8xLWQNVEqmZ6UCcztNij+Wh73Q== X-Received: from mmandlik.mtv.corp.google.com ([2620:15c:202:201:9910:f10f:1467:c3f]) (user=mmandlik job=sendgmr) by 2002:a25:dc82:: with SMTP id y124mr1195274ybe.521.1634151642354; Wed, 13 Oct 2021 12:00:42 -0700 (PDT) Date: Wed, 13 Oct 2021 12:00:32 -0700 Message-Id: <20211013190035.1876237-1-mmandlik@google.com> Mime-Version: 1.0 X-Mailer: git-send-email 2.33.0.882.g93a45727a2-goog Subject: [BlueZ PATCH v3 0/3] Add Advertisement Monitor Device Lost event From: Manish Mandlik To: marcel@holtmann.org, luiz.dentz@gmail.com Cc: chromeos-bluetooth-upstreaming@chromium.org, linux-bluetooth@vger.kernel.org, Manish Mandlik Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-bluetooth@vger.kernel.org Hello Bt-Maintainers, Bluetooth Advertisement Monitor API was introduced to support background scanning and proximity detection based on the application specified RSSI thresholds and content filters on LE advertisement packets. To optimize the power consumption, the API offloads the content filtering and RSSI tracking to the controller if the controller offloading support is available. However, this monitoring is not completely offloaded as the bluetoothd also handles RSSI thresholds and timeouts in order to fulfill high/low thresholds/timeouts filtering with D-bus clients. There is further room to achieve better power optimization by supporting the controller event HCI_VS_MSFT_LE_Monitor_Device_Event to fulfill true monitor offloading. This is currently not supported as it was originally desired to minimize the changes to the MGMT interface and reuse the existing MGMT event - MGMT_EV_DEVICE_FOUND to pass advertisements to bluetoothd and let bluetoothd handle the RSSI thresholds and timeouts in order to fulfill the D-bus API requirements for the client. This patch introduces a new MGMT event 'Device Lost' to indicate that the controller has stopped tracking a particular device. There is no need to send another event when the controller starts tracking a device as 'Device Found' event is sent anyway. Please let me know what you think about this or if you have any further questions. Thanks, Manish. Changes in v3: - Discard changes to the Device Found event and notify bluetoothd only when the controller stops monitoring the device via new Device Lost event. - Discard changes to the Device Found event and notify bluetoothd only when the controller stops monitoring the device via new Device Lost event. - Fix indentation of the adv_monitor_device_lost_callback() name and it's arguments. Changes in v2: - Instead of creating a new 'Device Tracking' event, add a flag 'Device Tracked' in the existing 'Device Found' event and add a new 'Device Lost' event to indicate that the controller has stopped tracking that device. - Instead of creating a new 'Device Tracking' event, add a flag 'Device Tracked' in the existing 'Device Found' event and add a new 'Device Lost' event to indicate that the controller has stopped tracking that device. - Update function name adv_monitor_tracking_callback() to adv_monitor_device_lost_callback() as it will receive only Device Lost event. Manish Mandlik (3): doc: Introduce the Adv Monitor Device Lost event lib: Add definition of the Adv Monitor Device Lost event adv_monitor: Receive the Device Lost event doc/mgmt-api.txt | 26 +++++++++++++++++++++++++- lib/mgmt.h | 7 +++++++ src/adv_monitor.c | 25 +++++++++++++++++++++++++ 3 files changed, 57 insertions(+), 1 deletion(-) -- 2.33.0.882.g93a45727a2-goog