Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp3418858pxb; Wed, 13 Oct 2021 05:45:35 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzha0hLxZZvqmU24QlHwABK6EQI9A1pTjmpf/fMpAY63vNa0z3yIWmpfgKvsdfr3nPmZzGE X-Received: by 2002:a17:906:6691:: with SMTP id z17mr41141931ejo.207.1634129135464; Wed, 13 Oct 2021 05:45:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1634129135; cv=none; d=google.com; s=arc-20160816; b=X/WXr3nkWKRvPLhQFL8KoJfPBL8tFe5i+b9CIqvX2+ILTqvSwyDA+oOHkJltB9pXLM CX2CpdXd4QBU8dxuysPy0JoNH2SWzdvxXg6mgYcQElMWZigFmU6T9gmDWXpIt3ghBSdO 3qOEoPvfCcvpma8lLC7o1PexEpkNVXeFv2WrtDCsG0oZ/OWyC7EttBYfLEhhBNabFvOv EMb1r4C273+6Tw/opN1BC2uI+bGrE1VnXnLc72ktjRuID9/BNIhPk38RusHPAAOYM65t vhVXBFerOFzCbsICtNO8xE0MvRxTaAwR5M1aKJI0CBZLGq6ljQJpxWpGifGOGntKNnlX WgKw== 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=1mAFPS/bGBXyFYGcprUNaHQCPmzvwa9glEucWATbAv0=; b=cM80RJ0GcP6z6Ua2EJ1otSwjGqm5POSzxZsIIqnnc2cJNtroKZdiWVc8gM3dpWbdGo 5DeuH/05tSoDcPOeaoRZpyPBvZOFEHXW5z55oUDNvDfMOD1UtHv+Odn7Yx8nGupij3zD 5cQnaNjNozhMwVS1/Z4muhEd9BGhqMt7CxcnWWmWz8quo5dR0OYx7l+vWizPdc/ztLp4 ut06sAyYOT/rkh6I3zIyHx9uP/bCeanyoEBJip1ng5QSu7Tdc6pCEav/1n1aQ07/igpj dR5FVEutc7SCKuqmlZELbcN1LDGuzl4Ec3LJRUp5QNf1rqtPFsDf+fnoTL3+p1BMpqKu XOsA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b=redqpokn; 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 e8si19909020ejh.79.2021.10.13.05.45.05; Wed, 13 Oct 2021 05:45:35 -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=redqpokn; 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 S234294AbhJMMo5 (ORCPT + 99 others); Wed, 13 Oct 2021 08:44:57 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52780 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234141AbhJMMoz (ORCPT ); Wed, 13 Oct 2021 08:44:55 -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 80770C061753 for ; Wed, 13 Oct 2021 05:42:52 -0700 (PDT) Received: by mail-yb1-xb4a.google.com with SMTP id p8-20020a056902114800b005bad2571fbeso2873698ybu.23 for ; Wed, 13 Oct 2021 05:42:52 -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=1mAFPS/bGBXyFYGcprUNaHQCPmzvwa9glEucWATbAv0=; b=redqpoknCLS2ICQffg8NGQxkU3fHMeMs5+mPK3cclAGMlFUaYPoc4KA+tj+1ndIWRp lsQQc6p+M0XIvtQcCpDV2Il++6vBXaQwD9IR+wIIKF5tl0PHuKTIZRz+eiuX8mBxxe8A CZTyaWm+Ax3kAug+q962D8br+N/0kbv0dX9dFii3e5NPu26e8dU0/aYt2w7rDrXSCEpH qPLTFHeAlD1/SHHkKlqfR9A5/c+QfvGrRFsMz4FwZhkfgQlHcBqCzg5EpK1xHTUItdIZ jNEix5NRXRwz05NGBCnvnceWkJ2yanM+YERoQFBgn1IV0QWTufJkl2lHk3kOkrOZA4/a 1Yfg== 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=1mAFPS/bGBXyFYGcprUNaHQCPmzvwa9glEucWATbAv0=; b=KQ/OviYmme+aUmgKLeSToUkFZYiVa7SrWYyiYBTabbNWtrynSeUx8+ZBzVV9m6g+uR pUPtz3e9mTYYrIfslsm0cyZN9Qja1o+osfpxtknyGAougRXuhY/nuka/cLSUeRFxcIyy E49cUBhAg9RaTriSXWNjnfQOrouKDBH9sDD8dgZHa6e6HF6Ewh3pQyab0+R/0F8ovlvc 4U7n6ifawNXjAONx8SdcpEV8yK7+5ll9fShoRpVDpNbMqDR+Edlp1ElapO4su6q/CeYJ kuIS8kjeRbgRLt6nFDabO3bFOR/QmgpaHD0XZemOpyN5RNjDCZyIYWFRb2vslZyGsUx9 CAGQ== X-Gm-Message-State: AOAM530xs62pKqhePaBhOWC1XKjrBHwmAURJAjuBt5p2na2/P8mDpofS 6+v3/j9bXsUPw4DT6TlHa/2Z15fSPW51kQ== X-Received: from mmandlik.mtv.corp.google.com ([2620:15c:202:201:f8a0:57c1:fc2b:3837]) (user=mmandlik job=sendgmr) by 2002:a25:bd04:: with SMTP id f4mr34120640ybk.372.1634128971744; Wed, 13 Oct 2021 05:42:51 -0700 (PDT) Date: Wed, 13 Oct 2021 05:42:07 -0700 Message-Id: <20211013124210.1454876-1-mmandlik@google.com> Mime-Version: 1.0 X-Mailer: git-send-email 2.33.0.882.g93a45727a2-goog Subject: [BlueZ PATCH v2 0/3] Update Device Found event and add Adv 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 series adds a flag in the exiting 'Device Found' event to indicate that the device is being tracked by an Advertisement Monitor. Kernel updates this flag based on the receipt of the controller event HCI_VS_MSFT_LE_Monitor_Device_Event. A new MGMT event - 'Device Lost' has been added to indicate that the controller has stopped tracking a device already being tracked. Please let me know what you think about this or if you have any further questions. Thanks, Manish. 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 | 32 +++++++++++++++++++++++++++++++- lib/mgmt.h | 9 +++++++++ src/adv_monitor.c | 25 +++++++++++++++++++++++++ 3 files changed, 65 insertions(+), 1 deletion(-) -- 2.33.0.882.g93a45727a2-goog