Received: by 2002:a25:23cc:0:0:0:0:0 with SMTP id j195csp1319589ybj; Tue, 5 May 2020 18:01:36 -0700 (PDT) X-Google-Smtp-Source: APiQypKzuBc8r3b6hmrcm7LR6Khv+NrPJEARCjrothgrab8UL8yVdLi/A4yidb7TSntO/PEONeQ5 X-Received: by 2002:a17:906:b896:: with SMTP id hb22mr5001921ejb.209.1588726896780; Tue, 05 May 2020 18:01:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1588726896; cv=none; d=google.com; s=arc-20160816; b=O1ZUPU96TWjhGX25vTjN3G8G9gVji944XZqIkDNfVzS5BK6K49wUb2tBF56Ick1zKE Nj+rm4qvLiZrHStMKmndi4wajHccTek/FGwIsK7a7UXSwneaoFGCk3DLTb41JcCD74DK 1EDq7VSA+rKJO/fycFccJSSdPgd6KTzCGUYnQkCBRyd5SAa7QL0l4njDLoBHo74JagyG dVmAUHcgkAeO7VcZUkSj5WmNgTlXVvzVyQXqEqYEAbkWpwxGCFPOueEB4AEP/qESFKBT KpgfkzVWiXeyxQy69Dn3RQJ1YtGJibEn9kW/N1s22oNd0+qaBoAAwv8ciio5sAJ2fict t0Hg== 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=zPAW4bbe2M4P8Ml3BobukMtErUA+qywn9gXeW5XwNPU=; b=XXHmxqqWPOGIjNunIx3DrtIXqWzTem9oq2r4eykKusmaTpOk28SZET5k2r70rsdl1B 4jlbYyHL77NTRwYWlH0P3Y7krr7k4m6H1B13QDPxGEvfvakACMZxA5h1Vn6NdZsoivYy QP0l52/ZFNaudC0yQ7G2N2e6OzNxIf7UxHwyWPHw0y6VNX+W0Ie2revsWkUm5DcD6x9c ZPXohkyVcIWM2bHOLCLCs+sb50sRguR+PfdwvlGRxSQCbpk/VURbZjQ7ob6Hkh/M1c9N wS6rVuwsBTtLiCbRV69FyT+8CkoRj4btvSjE/HoxvyPScduRPaqRFo5G7ws6lDtgMhT/ dH8Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=B1U1KxOW; 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 m13si209344eja.163.2020.05.05.18.01.12; Tue, 05 May 2020 18:01:36 -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=B1U1KxOW; 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 S1729332AbgEFA75 (ORCPT + 99 others); Tue, 5 May 2020 20:59:57 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37054 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1729247AbgEFA74 (ORCPT ); Tue, 5 May 2020 20:59:56 -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 9253CC061A0F for ; Tue, 5 May 2020 17:59:56 -0700 (PDT) Received: by mail-lf1-x144.google.com with SMTP id d25so2929529lfi.11 for ; Tue, 05 May 2020 17:59:56 -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=zPAW4bbe2M4P8Ml3BobukMtErUA+qywn9gXeW5XwNPU=; b=B1U1KxOWnSwTAG6qa4s0/YDP6q4pHeCW1opMlEGP2/U403iYKh/ZlV8cdwoznCiGpL tL5MD4Iq5atCC/5J2QuUVsc/rKOofbdG5wZeOE0DarEnTPtBTRNBul+/y19PFSZ+u1SG nJJS0HhLVhKs/GjwWeMKMZpoHPzyg6DBWdYT4= 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=zPAW4bbe2M4P8Ml3BobukMtErUA+qywn9gXeW5XwNPU=; b=Z3h3ZUDH2x6+aMg5ZnUuEDkUWySBpeu8hrJEbeimSa3J2gjZQpMtFKaBBL6PTCITXd 9v0UBmaIe7PXgay0AEH8CoARo1xQUonCuGiXFD0FvjO2Q/s493yS68XUp1jimuSSOfQ6 D9MGwk6nb8rhR2lAkW5KRFkk4ZYt22BX2XdRr/Y8Z8k1Ss3tbHFR88Lo5ASXxZ9Au8q1 dvP2Vfo5I3V445RyeZA5940vbUxRO55sP4LLcAQpDonDlP9K3CSOqAUEPxodZRY+Z9xz NPIVdvC7ZqnWMjSgJrX7VLG8ts47ALLjTfhadUMSAdS2oFy081jcoU/p7XChlxWp0TNP 5lNA== X-Gm-Message-State: AGi0PuYv9xFBRU29dQyh12Rrq4Cl3w55PqanlaODnVSmSwdwZ1WPObAZ 9PfBucQLmRlVCzEwIMxL2d01tJ20buzScEk4GRNngtf+ X-Received: by 2002:a05:6512:686:: with SMTP id t6mr3328850lfe.163.1588726794351; Tue, 05 May 2020 17:59:54 -0700 (PDT) MIME-Version: 1.0 References: <20200429203031.BlueZ.v5.1.If9f6be992cbaeaa35423de29da6db28675b35fcc@changeid> In-Reply-To: <20200429203031.BlueZ.v5.1.If9f6be992cbaeaa35423de29da6db28675b35fcc@changeid> From: Miao-chen Chou Date: Tue, 5 May 2020 17:59:43 -0700 Message-ID: Subject: Re: [BlueZ PATCH v5] doc: Describe the new Advertisement Monitor support To: Bluetooth Kernel Mailing List Cc: Alain Michaud , Michael Sun , Luiz Augusto von Dentz , Marcel Holtmann , Yoni Shavit 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 Hi Marcel, In case you didn't notice this patch from last week. Somehow v5 was recognized as a follow-up of v4 without having its own thread. Thanks, Miao On Wed, Apr 29, 2020 at 8:30 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 v5: > - Add more fields in the return value of Read Advertisement Monitor > Features command. > - Refine the description of commands and events. > > Changes in v4: > - In Read Advertisement Monitor Features command, rename > Adopted_Features to Enabled_Features. > > 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 | 147 +++++++++++++++++++++++++++++++++++++++++++++++ > 1 file changed, 147 insertions(+) > > diff --git a/doc/mgmt-api.txt b/doc/mgmt-api.txt > index 39f23c456..4aa755c45 100644 > --- a/doc/mgmt-api.txt > +++ b/doc/mgmt-api.txt > @@ -3138,6 +3138,125 @@ Read Security Information Command > Invalid Index > > > +Read Advertisement Monitor Features Command > +=========================================== > + > + Command Code: 0x0049 > + Controller Index: > + Command Parameters: > + Return Parameters: Supported_Features (4 octets) > + Enabled_Features (4 octets) > + Max_Num_Handles (2 octets) > + Max_Num_Patterns (1 octet) > + Num_Handles (2 octets) > + Handle1 (2 octets) > + Handle2 (2 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 Enabled_Features > + lists the ones currently used by the kernel. > + > + Supported_Features and Enabled_Features are bitmasks with currently > + the following available bits: > + > + 1 Advertisement content monitoring based on Microsoft > + HCI extension. > + > + Max_Num_Handles indicates the maximum number of supported > + advertisement monitors. Note that the actual number of supported > + ones might be less depending on the limitation of the controller. > + > + Max_Num_Pattern indicates the maximum number of supported patterns > + in an advertisement patterns monitor. Note that the actual number > + of supported ones might be less depending on the limitation of the > + controller. > + > + Num_Handles indicates the number of added advertisement monitors, > + and it is followed by a list of handles. > + > + This command can be used when the controller is not powered. > + > + > +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 (2 Octets) > + > + This command is used to add an advertisement monitor whose > + filtering conditions are patterns. The kernel will trigger scanning > + if there is at least one monitor added. 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 ignores 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 contains 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}, > + } > + > + This command can be used when the controller is not powered and > + all settings will be programmed once powered. > + > + Possible errors: Failed > + Busy > + No Resources > + Invalid Parameters > + > + > +Remove Advertisement Monitor Command > +==================================== > + > + Command Code: 0x004B > + Controller Index: > + Command Parameters: Monitor_Handle (2 Octets) > + Return Parameters: > + > + This command is used to remove advertisement monitor(s). The kernel > + would remove the monitor(s) with Monitor_Handle and update the LE > + scanning. > + > + When the Monitor_Handle is set to zero, then all previously added > + handles will be removed. > + > + Removing a monitor while it is being added will be ignored. > + > + This command can be used when the controller is not powered and > + all settings will be programmed once powered. > + > + Possible errors: Failed > + Busy > + Invalid Index > + > + > Command Complete Event > ====================== > > @@ -4020,3 +4139,31 @@ 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 (2 Octets) > + > + This event indicates that an advertisement monitor has been added > + using the Add Advertisement Monitor command. > + > + The event will only be sent to management sockets other than the > + one through which the command was sent. > + > + > +Advertisement Monitor Removed Event > +=================================== > + > + Event Code: 0x0028 > + Controller Index: > + Event Parameters: Monitor_Handle (2 Octets) > + > + This event indicates that an advertisement monitor has been removed > + using the Remove Advertisement Monitor command. > + > + The event will only be sent to management sockets other than the > + one through which the command was sent. > -- > 2.24.1 >