Received: by 2002:a25:1985:0:0:0:0:0 with SMTP id 127csp4104898ybz; Mon, 20 Apr 2020 15:54:50 -0700 (PDT) X-Google-Smtp-Source: APiQypJsn7ZNECR6GCU/fM0H1BzDl3fSlAHcJjquYMzcug5v1Ssa4KjYdBbVrpAIseTWt+skV/2c X-Received: by 2002:a50:d596:: with SMTP id v22mr16160445edi.91.1587423290130; Mon, 20 Apr 2020 15:54:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1587423290; cv=none; d=google.com; s=arc-20160816; b=EBUQL2wwK82WDky+Z00m2g9KrOpE7oIQRgRuVu02KBY0v+Y4Jw/jOoCyJYzt+wTJMs SKF+83o4AkUscIqLLcA5ZBwYc41OE06h6nQSDPynZdsePHlRK2KLkABVFwsaLhOjRRCt 250p/3DgbF96NqFoc1c861vlCjFvQdpSRGHuUw9G/GECBkpjYSNyzaFnftRvDXzQSpXt nrEYB1+zj9uTnJp7sFYA5HIENtLEXvQuvgym04I1U8ETBeNZJ6o8aYsPC7ZSRemx8VAp q18c87rPFfB4hJPuJiW1zIxLB5JzwNnwSXbSDiO1EO8H2r2QqInchOjvJSKDITkvBUFl CALA== 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=fVjHHYJ1vId2KvrdWJsFEYl7QgTMuUSpPwB3r8jfRdQ=; b=IPRbgS/NGei1yQMqBG8VHIh2GMuDuewGTksoRFG9+ybmPuK40x2LkSXYYLZXxhYYUQ G0kHuOsKsBiaVeNdQid97exA1KaXLX4mfPdRY8/rrEC+xbp6qVCFi8Q7VCWgKB38EvYn rKxSUO5XIhK9+ZQYNZu6L7bPHl7rfcoF2OKVTZcysU9UmHymeRaOBJIcbQ2pPQZ1hb6w Gm05dcWcQePzV4Od27Lx0eo6VW7c/d3zKvMAmCq004YhsdiGtDlv9EBESmt5gwDLAaxX nA58B60P1+11Ja63PW2pfhauILyHCinWS+iR1+wNl1LtiMAshS8m5nvjC9J8vk6RIDF1 0/cQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=d6PuOtT0; 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=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id w16si448759edr.110.2020.04.20.15.54.16; Mon, 20 Apr 2020 15:54:50 -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=@gmail.com header.s=20161025 header.b=d6PuOtT0; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726884AbgDTWxu (ORCPT + 99 others); Mon, 20 Apr 2020 18:53:50 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44618 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726539AbgDTWxu (ORCPT ); Mon, 20 Apr 2020 18:53:50 -0400 Received: from mail-oi1-x241.google.com (mail-oi1-x241.google.com [IPv6:2607:f8b0:4864:20::241]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4D695C061A0E for ; Mon, 20 Apr 2020 15:53:50 -0700 (PDT) Received: by mail-oi1-x241.google.com with SMTP id s202so10396658oih.3 for ; Mon, 20 Apr 2020 15:53:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=fVjHHYJ1vId2KvrdWJsFEYl7QgTMuUSpPwB3r8jfRdQ=; b=d6PuOtT0OjYP0h177+RYqdTNWmYdqFimtCIHTA3Wy8z47WruPS+ayp322by+LF8u4G 0Mclu56MbEAvOtx2Lz6HLnxfE5mGbwSayA0DFvf4nEH5hVcRqPHUdQ114V+4mCtmD7Jj DVAUhfccjnt0n2zHgQDANbBAEoYdAcY9xOvUGbjSJMvbTHVQjpczaN9ha5KGa5KwLkom mlhNnEkMkpEOsw+TUVZWKq15G73E0Jk4pDFpRZ/NfJN8eYJVVTJI/320fPsXhclxmE2a KLfXmcNcilJuA7rD8j7QO6OBXjguuUpil0zuh40alselsiGsXNszweoCaILMynaeS6YM K7CQ== 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=fVjHHYJ1vId2KvrdWJsFEYl7QgTMuUSpPwB3r8jfRdQ=; b=crXDFse179jmvZ8yv0GNWRfeLxSlPxnZip5BaMuGCsIckbQdfSNyj+QFM3Uak6PuV9 eDTyORN4TBd+p5uOo3yQhayLiYcXR+Qst0DOBXVm/rPSHdqKqpLzn9quZZgSyqza5NpX Rd/CIOPgzPP3so3//hUDODlVf9sX9cOknQNACXB1TR1YkbKp0UGSxS1r9p2hRs44FH3E qe/JQvMB4+Qhm42Zczc5BbAhxnVb+OHaq4wo//SvE/kxHFQTxZFq+uVmsKIXMOxW445k 87hlE1oY0Wq4ekgpMLm36KBNpByh+XC8eg5SQMtbSG0XEFdKQIzyMHedOlqMztoEyaXT fMGg== X-Gm-Message-State: AGi0PuYqunILY18Zc6oe9GbcrvoEQTR21nnWkKvvxT/es3uTZC8Rt2uG 7d9DNoKlP0vh+yR8PZplYhVFxtqycWlJBzsS3wk= X-Received: by 2002:aca:f584:: with SMTP id t126mr1275141oih.108.1587423229576; Mon, 20 Apr 2020 15:53:49 -0700 (PDT) MIME-Version: 1.0 References: <20200417200903.BlueZ.v1.1.If9f6be992cbaeaa35423de29da6db28675b35fcc@changeid> In-Reply-To: <20200417200903.BlueZ.v1.1.If9f6be992cbaeaa35423de29da6db28675b35fcc@changeid> From: Luiz Augusto von Dentz Date: Mon, 20 Apr 2020 15:53:38 -0700 Message-ID: Subject: Re: [BlueZ PATCH v1] doc: Describe the new Advertisement Monitor support To: Miao-chen Chou Cc: Bluetooth Kernel Mailing List , Alain Michaud , Luiz Augusto von Dentz , Marcel Holtmann , Michael Sun , 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 Miao, On Fri, Apr 17, 2020 at 8:13 PM Miao-chen Chou wrote: > > This describes the following commands. > - Add Advertisement Patterns Monitor > - Remove Advertisement Monitor > - Remove All Advertisement Monitors > 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 commands > for removing monitor(s), the Add command is tied to a specific type. > > Signed-off-by: Miao-chen Chou For userspace we don't require signed-of-by line. > --- > > doc/mgmt-api.txt | 68 ++++++++++++++++++++++++++++++++++++++++++++++++ > 1 file changed, 68 insertions(+) > > diff --git a/doc/mgmt-api.txt b/doc/mgmt-api.txt > index 39f23c456..fcd281a35 100644 > --- a/doc/mgmt-api.txt > +++ b/doc/mgmt-api.txt > @@ -3138,6 +3138,74 @@ Read Security Information Command > Invalid Index > > > +Add Advertisement Patterns Monitor Command > +========================================= > + > + Command Code: 0x0049 > + Controller Index: > + Command Parameters: Pattern_count (1 Octets) > + Pattern1 { > + AD_Data_Type (1 Octet) > + Index (1 Octet) What is this index for, it is not very clear why would we need it here since we are going to return a index already. > + Length (1 Octet) > + Value (variable length) > + } > + Pattern2 { } > + ... > + Return Parameters: Monitor_Index (8 Octets) I guess we could call this a handle if the is assigned by the controller not the host stack, also it might be more a good idea to put some example on how to build the parameter list, etc, to make it easier to visualize how these parameters are put together. > + > + 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 Microsoft HCI extension, > + 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. > + > + Possible errors: Failed > + Busy > + Invalid Parameters > + > + > +Remove Advertisement Monitor Command > +==================================== > + > + Command Code: 0x004A > + Controller Index: > + Command Parameters: Monitor_Index (8 Octets) > + Return Parameters: Monitor_Index (8 Octets) > + > + This command is used to remove an advertisement monitor. The kernel > + would remove the monitor with Monitor_Index and update the LE scanning. > + If the controller supports Microsoft HCI extension and the monitor has > + been offloaded, the kernel would cancel the offloading; otherwise the > + kernel takes no further actions other than removing it from the list. > + > + Possible errors: Failed > + Busy > + Invalid Index > + > + > +Remove All Advertisement Monitors Command > +========================================= > + > + Command Code: 0x004B > + Controller Index: > + Command Parameters: > + Return Parameters: Num_removed_Monitors (2 Octets) > + Monitor_Index[i] (2 Octets) > + > + This command is used to remove all advertisement monitors. The kernel > + would remove all monitors and update the LE scanning if needed. If the > + controller supports Microsoft HCI extension the monitors have been > + offloaded, the kernel would cancel all offloadings; otherwise the kernel > + takes no further actions other than removing all monitors from the list. > + > + Possible errors: Failed > + Busy I wonder if we could keep this simple and just have a special value passed to Remove that would be consider remove all e.g. 0x0000000000000000, that way we don't have to allocate yet another opcode for removing all, though Im not sure how the values are managed in that namespace so it may not be possible allocate one for use with remote all logic, the other option would be to have a num_monitors and then in case none is provided do the remove all, that actually might be useful since if there are multiple application/monitors we can remove all monitors from one application without afting the others leaving remove all logic just for when bluetoothd is restarted which is basically a cleanup. > + > Command Complete Event > ====================== > > -- > 2.24.1 > -- Luiz Augusto von Dentz