Received: by 2002:a25:6193:0:0:0:0:0 with SMTP id v141csp3582157ybb; Mon, 6 Apr 2020 11:25:52 -0700 (PDT) X-Google-Smtp-Source: APiQypJ3TTUnoO+r2vlZi9ek5MCQa4SH8f0XtEboliUKoiq4XjO4SzJoemg1IsO5zwhX+/Sqn1aD X-Received: by 2002:a4a:d88b:: with SMTP id b11mr442865oov.42.1586197552258; Mon, 06 Apr 2020 11:25:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1586197552; cv=none; d=google.com; s=arc-20160816; b=VRgdjeGfLg/7xogqNiQA12DV++xzyGQ8NX6cFU0L1PbWzTtO0KGmEhn+EQC01meajK retk9bwA+UeKiOCeNa9xpimxpQX4fnclbM4pHxiF32tlsBGX4WvN7/qKGZO6wyWSZ1XB IlhxLwiUR0P8Q6z/IBEWplSlJKtLQQkTSR97LMjxjXGpebiD+I1yOYaalsSOaX9F2FLD pR7cxY24+FmVmVPwY0zGuHeFdmbtlLd4SA65Gr2Mh9mThf4h10fhiESnrYhOn44T+/Ct ybeJvgd2TAtodMFmbBGVD5wBSWSmkK+4GjA2XA07LgNnO4IZtDlFaSROfERJdfoHc4YK Tbmw== 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=l8ZERAQIsOeA9+9QhHsLGZtE1muSv1tW/0JrDnxBwKc=; b=gRPVH1lku+6e+bMYlVwWLTB+YG7OqSn8GY5NfwCvLckFskvsvOO/aZw1sV7xsDrupR rP2JoJ0hxEYdA5W9Zir9y1RCsUI8UJF4iSgITUEroIvTr/uOYXqFpfqxBewSEr2qqK4q bU6WwtOUsAjEHV9WOTykX3pwSlySyT9Yjn9/4iXHJ4CdG8G1G23V2BTLkoIZugpt5qR8 7CZRrSI+dmTcasktW5Ar7Yw0eY2xdamHf7YfXwPdMgsSPjXJ3nZjuRqODvtjrnlhYGln /YXTZIje/yRkl5taR3O7LbZxVcSxa+evSgI4dUi94j6Gp01G9Nb+itSGAB7Qs1mOs4k9 o62Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=NtxHMgcs; spf=pass (google.com: best guess record for domain of linux-bluetooth-owner@vger.kernel.org designates 209.132.180.67 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. [209.132.180.67]) by mx.google.com with ESMTP id b17si138343otq.269.2020.04.06.11.25.29; Mon, 06 Apr 2020 11:25:52 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-bluetooth-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=NtxHMgcs; spf=pass (google.com: best guess record for domain of linux-bluetooth-owner@vger.kernel.org designates 209.132.180.67 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 S1726594AbgDFSYa (ORCPT + 99 others); Mon, 6 Apr 2020 14:24:30 -0400 Received: from mail-ua1-f65.google.com ([209.85.222.65]:35469 "EHLO mail-ua1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726475AbgDFSYa (ORCPT ); Mon, 6 Apr 2020 14:24:30 -0400 Received: by mail-ua1-f65.google.com with SMTP id a6so319877uao.2 for ; Mon, 06 Apr 2020 11:24:27 -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=l8ZERAQIsOeA9+9QhHsLGZtE1muSv1tW/0JrDnxBwKc=; b=NtxHMgcsQR3IpYSCNs0eGRlDajwaIa9MPyo5xfw8TTp2uwImZt2f5NKuEwL4JsQhqT ftBLT3yE0bek7vrsxCAakpHaOsi7vY4ncebV6/YNKNu7Hk0dyvqX26q6KJ06/RjMy8As 7R2161bUdJyJ0+wTHaSvyEU5OcBs4/OGpn4DU= 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=l8ZERAQIsOeA9+9QhHsLGZtE1muSv1tW/0JrDnxBwKc=; b=EaWqnVssOSipI4DMaHhkq6ESHnFiQmre8E0jHhZE+faOE1yr5/7GkuKPmWBv6dEJj+ UlRH+LlLSNxmxcV2VEFp5T4e//DC5diLbkHQxpF7nEacXdissIouf/IX9Y3tOa7wUjxw jvoBO1awyylnj5xbAD3xihLeRHwtuwCoY/GCmQ1NbVA5VYMVqYy2gvC+4YabLUFrvBIE ix29Phe1nTdKNvE+ffUj+VSpbqjxPBJG2fElVkB/rde7kVbjdvKA2bEJNesG34T7LT+v 9GnUT+/WZMI1xRNlR1q2Kyk5wNCArV2rLYDqidU4BBWCywSWUZ6hJ1hSliyB81v0PcnJ zqHQ== X-Gm-Message-State: AGi0PuZGlMn0OgN+1ctXWjCE8gTj+KVaRDxyZf6VMeQwoaXr3UGuB8o+ ddTouqnH8YlFGZdA0Xmm+yT/wGuNR0LvuwUQcDp1d1Gh X-Received: by 2002:ab0:911:: with SMTP id w17mr710975uag.60.1586197467055; Mon, 06 Apr 2020 11:24:27 -0700 (PDT) MIME-Version: 1.0 References: <20200406180331.891822-1-marcel@holtmann.org> In-Reply-To: <20200406180331.891822-1-marcel@holtmann.org> From: Abhishek Pandit-Subedi Date: Mon, 6 Apr 2020 11:24:15 -0700 Message-ID: Subject: Re: [PATCH] doc: Add commands and event for handling device flags To: Marcel Holtmann Cc: Bluez mailing list 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, On Mon, Apr 6, 2020 at 11:03 AM Marcel Holtmann wrote: > > --- > doc/mgmt-api.txt | 96 ++++++++++++++++++++++++++++++++++++++++++++++++ > 1 file changed, 96 insertions(+) > > diff --git a/doc/mgmt-api.txt b/doc/mgmt-api.txt > index 39f23c456080..ac5b6c97d64a 100644 > --- a/doc/mgmt-api.txt > +++ b/doc/mgmt-api.txt > @@ -3138,6 +3138,74 @@ Read Security Information Command > Invalid Index > > > +Get Device Flags Command > +======================== > + > + Command Code: 0x0049 > + Controller Index: > + Command Parameters: Address (6 Octets) > + Address_Type (1 Octet) > + Return Parameters: Address (6 Octets) > + Address_Type (1 Octet) > + Supported_Flags (4 Octets) > + Current_Flags (4 Octets) > + > + This command is used to retrieve additional flags and settings > + for devices that are added via Add Device command. > + > + Possible values for the Address_Type parameter: > + 0 BR/EDR > + 1 LE Public > + 2 LE Random > + > + The Flags parameters are a bitmask with currently the following > + available bits: > + > + 0 Remote Wakeup enabled > + > + This command generates a Command Complete event on success > + or a Command Status event on failure. > + > + Possible errors: Invalid Parameters > + Invalid Index > + > + Get device flags looks good to me. > +Set Device Flags Command > +======================== > + > + Command Code: 0x004a > + Controller Index: > + Command Parameters: Address (6 Octets) > + Address_Type (1 Octet) > + Current_Flags (4 Octets) I would prefer to use a mask and value rather than current_flags here. > + Return Parameters: Address (6 Octets) > + Address_Type (1 Octet) Prefer to also return an updated_mask and current_flags. This simplifies completion for userspace. Otherwise, we would need to keep a "pending flags" value on the device structure. > + > + This command is used to configure additional flags and settings > + for devices that are added via Add Device command. > + > + Possible values for the Address_Type parameter: > + 0 BR/EDR > + 1 LE Public > + 2 LE Random > + > + The list of supported Flags can be retrieved via the Get Device > + Flags or Device Flags Changed command. Selecting unsupported flags > + will result in an Invalid Parameter error; > + > + Refer to the Get Device Flags command for a detailed description > + of the Flags parameters. > + > + This command can be used when the controller is not powered and > + all settings will be programmed once powered. > + > + This command generates a Command Complete event on success > + or a Command Status event on failure. > + > + Possible errors: Invalid Parameters > + Invalid Index > + > + > Command Complete Event > ====================== > > @@ -4004,6 +4072,7 @@ Extended Controller Information Changed Event > The event will only be sent to management sockets other than the > one through which the change was triggered. > > + > PHY Configuration Changed Event > =============================== > > @@ -4020,3 +4089,30 @@ PHY Configuration Changed Event > one through which the change was triggered. > > Refer Get PHY Configuration command for PHYs parameter. > + > + > +Device Flags Changed Event > +========================== > + > + Event Code: 0x0027 > + Controller Index: > + Event Parameters: Address (6 Octets) > + Address_Type (1 Octet) > + Supported_Flags (4 Octets) > + Current_Flags (4 Octets) > + > + This event indicates that the device flags have been changed via > + the Set Device Flags command or that a new device has been added > + via the Add Device command. In the latter case it is send right > + after the Device Added event. > + > + Possible values for the Address_Type parameter: > + 0 BR/EDR > + 1 LE Public > + 2 LE Random > + > + The event will only be sent to management sockets other than the > + one through which the command was sent. > + > + In case this event is triggered by Add Device then it is sent to > + all management sockets. Event looks good to me. > -- > 2.25.1 >