Received: by 2002:a25:1985:0:0:0:0:0 with SMTP id 127csp1311605ybz; Wed, 22 Apr 2020 18:16:07 -0700 (PDT) X-Google-Smtp-Source: APiQypIOkmLfSVTLAUuzFdEJkThrbiy5ZGeWzrB2fvOdji5s9Cp6H8HFiYXrsF2WxslSGFuFd159 X-Received: by 2002:a50:ef09:: with SMTP id m9mr929012eds.321.1587604567038; Wed, 22 Apr 2020 18:16:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1587604567; cv=none; d=google.com; s=arc-20160816; b=G392+aV5eBPSUB25drlVwSsY7NalyPJ1J0b0lqhY1u47iABqU3/dLquPwWPGM00dVO Day8nyr59HWLfvumxiQ/BFRq2jqYPWqsLQpH0a0TfOx3nqEgM20HRWEGO8WSsppEDRK3 +KCBDOdgX+qFbRtyD9P1BmmhljCbRh/oyO037cKflunhPjjcf3baT6mfsZjuU3zwCwTk qPZn8k6BNk8jEUimhR4ZGhDrBPR1ktO1nSJuX8E8AKdoOxnyjHsMHJhr+mlPOEuzhA0t cIZYOnBZTu0PCC4BaEoBioc1UOmoO+Zk13VJqu6j08ldFvw4HsHsq8FAOw1jLg3H+CiC e5Sw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=WIxIDnkpkhXz/Rc3cKucNn2E6xJY9rIKzkCq4UkDqbE=; b=o2hdEoOgao3okG26dtVQo5lEAkT2GS3B6y5iOBC4a7JgkafsGCf32iQ244tPHyLQRV BmQ/6U6gKWciZCJcdOCODRVqPXfDckVIyJW/KHlJ9ug5ePoMaCC30otlkLJ7/WWk0EO4 lvGbLYTP+gupQS/tUjS8z0k7WnqjApJ/IifQgW1uM+uLDASNdH+TeJv5cXyuSIrLejz0 k+BVbBSxOvOrZfY5/8Q5r0c7ZWUdJxvB3ndjNT6jqF/OO9j5toj+UErbYNn81yjEqDZV M2oQIjHS8L3cu+/wjEs06BCr+qWSQTdeAdA3Tn6lmzQWfzievooOjx+OljojFXO9DRx9 auCQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=DCPCgQQb; 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=NONE sp=NONE dis=NONE) header.from=chromium.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id g4si396263edu.287.2020.04.22.18.15.43; Wed, 22 Apr 2020 18:16:07 -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=@chromium.org header.s=google header.b=DCPCgQQb; 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=NONE sp=NONE dis=NONE) header.from=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1725895AbgDWBNB (ORCPT + 99 others); Wed, 22 Apr 2020 21:13:01 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60968 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1725846AbgDWBNB (ORCPT ); Wed, 22 Apr 2020 21:13:01 -0400 Received: from mail-lf1-x144.google.com (mail-lf1-x144.google.com [IPv6:2a00:1450:4864:20::144]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D7CB8C03C1AA for ; Wed, 22 Apr 2020 18:13:00 -0700 (PDT) Received: by mail-lf1-x144.google.com with SMTP id r17so3383806lff.2 for ; Wed, 22 Apr 2020 18:13:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=WIxIDnkpkhXz/Rc3cKucNn2E6xJY9rIKzkCq4UkDqbE=; b=DCPCgQQbkwvxW+acPi2jNXJa75MrIF7s0fecTlKtK1XtknhlFTWaxIWPZcKmhZULS/ Mu3ezsYSCJJtg7HVA1jzXPjqG6S7BM/KVr4iYjOeH4rZWDF0wsDxDh+VFRaHgfvBNoOh gwRIHrskoLJcBOKSlhcfbqiztk6YpqD1eMH+U= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=WIxIDnkpkhXz/Rc3cKucNn2E6xJY9rIKzkCq4UkDqbE=; b=LXqNaWa2gYOmkIPnersxQr/GNfYwoczukJY6gTow4Ld5NyWLt4uA03HnSO9ck6ixox TdGJjkWPyHvUvoCyaJah2ZNK/xR0BiJHMVBAy0s+EF8XVUHyHLsSdQWBL2xbHZFjAcmi Ecuj5ZpEyqZnQVeaA/xw2g4Wo3r4Sb5rfF+c6Rl0j1TjungUoZS5SNmFC3UQ0xtCmkZT 5zzaBGXD2aDcMgf+oElbQ+OW3HDrqj0xcuOf8zhCMbaEzRNk+dkWGnAlzGCeFb6qWhC+ Ly8p91afMcnu+NGvXdv92kZXs7hQtzXYCXwzny60dGt7kQ0o9azlD0PjBL2CYg7qGzQ/ nURA== X-Gm-Message-State: AGi0PuaAIOgu5t05pDmTEiMW/ytmdPK+7G6kJxkzQcpEqhcoiNPKIjiE QKz/PTMR5G1i91M0fmtefQDFB+b0yJmVKmAwSeB0LFsD X-Received: by 2002:a05:6512:308e:: with SMTP id z14mr797307lfd.110.1587604378911; Wed, 22 Apr 2020 18:12:58 -0700 (PDT) MIME-Version: 1.0 References: <20200422180939.BlueZ.v2.1.If9f6be992cbaeaa35423de29da6db28675b35fcc@changeid> In-Reply-To: <20200422180939.BlueZ.v2.1.If9f6be992cbaeaa35423de29da6db28675b35fcc@changeid> From: Miao-chen Chou Date: Wed, 22 Apr 2020 18:12:47 -0700 Message-ID: Subject: Re: [BlueZ PATCH v2] doc: Describe the new Advertisement Monitor support To: Bluetooth Kernel Mailing List Cc: Alain Michaud , Marcel Holtmann , Yoni Shavit , Michael Sun , Luiz Augusto von Dentz Content-Type: text/plain; charset="UTF-8" Sender: linux-bluetooth-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-bluetooth@vger.kernel.org Please ignore this patch, I should have update the version number. On Wed, Apr 22, 2020 at 6:10 PM Miao-chen Chou wrote: > > This describes the following commands and event. > - Read Advertisement Monitor Features command > - Add Advertisement Patterns Monitor command > - Remove Advertisement Monitor command > - Advertisement Monitor Added event > - Advertisement Monitor Removed event > Note that the content of a monitor can differ based on its type. For now we > introduce only pattern-based monitor, so you may find that unlike the > command of removing monitor(s), the Add command is tied to a specific type. > --- > > Changes in v3: > - Remove Advertisement Monitor can perform the removal of one monitor > or all monitors. > - Add Read Advertisement Monitor Features command. > - Add Advertisement Monitor Added event and dvertisement Monitor Removed > event. > > Changes in v2: > - Combine commands to remove one monitor and remove all monitors. The > refined command takes multiple handles and an extra field to indicate > whether to remove all monitors. > > doc/mgmt-api.txt | 118 +++++++++++++++++++++++++++++++++++++++++++++++ > 1 file changed, 118 insertions(+) > > diff --git a/doc/mgmt-api.txt b/doc/mgmt-api.txt > index 39f23c456..3cef3edbf 100644 > --- a/doc/mgmt-api.txt > +++ b/doc/mgmt-api.txt > @@ -3138,6 +3138,102 @@ Read Security Information Command > Invalid Index > > > +Read Advertisement Monitor Features Command > +=========================================== > + > + Command Code: 0x0049 > + Controller Index: > + Command Parameters: > + Return Parameters: Supported_Features (4 octets) > + Adopted_Features (4 octets) > + > + This command is used to read the advertisement monitor features supported > + by the controller and stack. Supported_Features lists all related > + features supported by the controller while Adopted_Features lists the > + ones currently adopted by the stack. > + > + Supported_Features and Adopted_Features are bitmasks with currently the > + following available bits: > + > + 1 Advertisement content monitoring based on Microsoft HCI > + extension. > + > + > +Add Advertisement Patterns Monitor Command > +========================================= > + > + Command Code: 0x004A > + Controller Index: > + Command Parameters: Pattern_count (1 Octets) > + Pattern1 { > + AD_Data_Type (1 Octet) > + Offset (1 Octet) > + Length (1 Octet) > + Value (variable length) > + } > + Pattern2 { } > + ... > + Return Parameters: Monitor_Handle (4 Octets) > + > + This command is used to add an advertisement monitor whose filtering > + conditions are patterns. The kernel would track the number of registered > + monitors to determine whether to perform LE scanning while there is > + ongoing LE scanning for other intentions, such as auto-reconnection and > + discovery session. If the controller supports advertisement filtering, > + the kernel would offload the content filtering to the controller in > + order to reduce power consumption; otherwise the kernel ignore the > + content of the monitor. Note that if the there are more than one > + patterns, OR logic would applied among patterns during filtering. In > + other words, any advertisement matching at least one pattern in a given > + monitor would be considered as a match. > + > + A pattern contain the following fields. > + AD_Data_Type Advertising Data Type. The possible values are > + defined in Core Specification Supplement. > + Offset The start index where pattern matching shall be > + performed with in the AD data. > + Length The length of the pattern value in bytes. > + Value The value of the pattern in bytes. > + > + Here is an example of a pattern. > + { > + 0x16, // Service Data - 16-bit UUID > + 0x02, // Skip the UUID part. > + 0x04, > + {0x11, 0x22, 0x33, 0x44}, > + } > + > + Possible errors: Failed > + Busy > + Invalid Parameters > + > + > +Remove Advertisement Monitor Command > +==================================== > + > + Command Code: 0x004B > + Controller Index: > + Command Parameters: Monitor_Handle (4 Octets) > + Return Parameters: > + > + This command is used to remove advertisement monitor(s). The kernel > + would remove the monitor(s) with Monitor_Index and update the LE > + scanning. If the controller supports advertisement filtering and the > + monitor(s) has been offloaded, the kernel would cancel the offloading; > + otherwise the kernel takes no further actions other than removing the > + monitor(s) from the list. > + > + Monitor_Handle can be the following values. > + Value Operation > + ------------------------- > + 0x00000000 Removes all existing monitor(s) > + 0x00000001 or greater Removes the monitor with that handle > + > + Possible errors: Failed > + Busy > + Invalid Index > + > + > Command Complete Event > ====================== > > @@ -4020,3 +4116,25 @@ PHY Configuration Changed Event > one through which the change was triggered. > > Refer Get PHY Configuration command for PHYs parameter. > + > + > +Advertisement Monitor Added Event > +================================= > + > + Event Code: 0x0027 > + Controller Index: > + Event Parameters: Monitor_Handle (4 Octets) > + > + This event indicates that an advertisement monitor has been added using > + the Add Advertisement Monitor command. > + > + > +Advertisement Monitor Removed Event > +=================================== > + > + Event Code: 0x0028 > + Controller Index: > + Event Parameters: Monitor_Handle (4 Octets) > + > + This event indicates that an advertisement monitor has been removed > + using the Remove Advertisement Monitor command. > -- > 2.24.1 >