Received: by 2002:a05:6a10:9e8c:0:0:0:0 with SMTP id y12csp691230pxx; Wed, 28 Oct 2020 14:38:26 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwqqHsAxWf70wtxYzBBTsUdRJI8W4eeKvKL9TkmBf+mZap6YbsLatng/cZl7UEU9V7dMJ2m X-Received: by 2002:a17:906:3789:: with SMTP id n9mr1070396ejc.273.1603921106566; Wed, 28 Oct 2020 14:38:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1603921106; cv=none; d=google.com; s=arc-20160816; b=DLbXZNczhVCaHbDHJjcTWfn1Lb/hv2tC526WFTbUMtNYmMH2hiwy5m18rYZ5zrz0Z0 aG6TKS8KesI/IUsDAUMOLAJFUCnWsbxXQrvu4DdpaSLS8EzE0OsrYrE76WBnDaG8ysK6 IyWqxlHq6wOlSeO4nX+XUrC0oQNLSPz8fieEawpqr91dMtzcMaK6HTJuRbW95wNy6Q2k AxUz537BnVNenuI+dR82/tPt5N0rSVV50VvZaD76ErSCvg4yb6iSucSsGG+mtgzqT/gc 6O1f9SYnoADIsw+hVu+dFhYtZnDKX2puGeQpwTyqmy+3xjIb4nHAZ7B23X3xGZdCXLNG tDmg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=YH9eYeQk8+euv6FvSxItvZqW2L04axxJ5k/eDw4EpRo=; b=hLf/2NzovSiUifeIS4et03gzmsFOoEe2r2SyTece31wq4IPR40CP+97ptEjNdU+t/e vsgCGsU+qRMLNSO3QQ28IwdHHGT/2XHXROlvLim99cIVZwwc1TFc2b1fpCyH3H/LQJzi e316MnXNuG2bGDipnC4IA1krPnUum7y/+f+sF/OJPxu4IdmfIYs30pNnk0noxoPMP28y 3JwAzANGv83aRrPgyHt6myhpe7Tqw1dQivKxKAUS/b7+izRnYdFFc4+M/TbkzW/a1RyY vwiKezUIm29CdLe0voD8VJOkE+lVirGHyxmilgJmjq+YBiKVJgqCHPvWS84p+ygLwYjK 7e4Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b="npAO/YNL"; 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 s21si403744eju.119.2020.10.28.14.38.03; Wed, 28 Oct 2020 14:38:26 -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="npAO/YNL"; 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 S2505490AbgJ0WFZ (ORCPT + 99 others); Tue, 27 Oct 2020 18:05:25 -0400 Received: from mail-ot1-f67.google.com ([209.85.210.67]:36274 "EHLO mail-ot1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2505592AbgJ0WFY (ORCPT ); Tue, 27 Oct 2020 18:05:24 -0400 Received: by mail-ot1-f67.google.com with SMTP id 32so2552740otm.3 for ; Tue, 27 Oct 2020 15:05:24 -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=YH9eYeQk8+euv6FvSxItvZqW2L04axxJ5k/eDw4EpRo=; b=npAO/YNL/ikVy6h081iK2OZI4LvM14d04OdcrnIjtzcDMBNCkLftpxmHJ0Ez+I+6Q7 2mCsniwsit0tpJqZibJH6oaiZYAKVyylznFDBeHh8DnPti21as9WF/z1ibnkspdlbgqS Ot42VYURRDTiltwH8RHd23LjTFthpX6Kih4CJ/HXgttUJc4HTvndpJLpMuq2x92Ubdqx S9x/WVUjPLAVYNoL43MhZuoFkzeltTnMaqNVtJ5jGV0GqKlkfjVW+5t85mh/ypkpIrds y/aKMJ3FcnurLpef7Zjp5KmqXXCH4nvbNOjo6sLGH1KgiStddfqp2UJ8l/XTlusXOv6t IF7Q== 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=YH9eYeQk8+euv6FvSxItvZqW2L04axxJ5k/eDw4EpRo=; b=nuiwU6K8E+hSg5PfoZatmEjFnJuNct6PB0nADdvN48R3lLwnQINQ+w9T6JRwrNzj5b 9a2Ze9aiyOR8BIhGS7bFFmn/NMLc9J4ZEM1JlIKm9lpPfVyqGLFUTm5TMoJOJLXwokr5 Rbc+lvuWCfGvF3d/DAHZgKlc4b+ZlZj6LFZViNbkxdRg+xs7i8JcgjX0gHf0U3BLOOlx 78Z1bqC8I8I/VswPp28LkrESLR7vpselr4GVSu2Eb7Yul9QQkDAHj7xXHQF1V4YZDpc7 aE6KCmuAde6AwUiX06H/1U318r0fBKg1Si2mhFkaFA/nVThlvkF221z19kW/yT7rVxCO lw1Q== X-Gm-Message-State: AOAM5317taGvJddIN5K61suMHVd7nNmw0/iOWMN1ZhPZpHXwyeHfMuWh V8i1TIk/9USQa0/B6BzngjBXGvOHiTNE+QUwLDg= X-Received: by 2002:a05:6830:134c:: with SMTP id r12mr2916355otq.240.1603836323702; Tue, 27 Oct 2020 15:05:23 -0700 (PDT) MIME-Version: 1.0 References: <20201001230152.2422908-1-danielwinkler@google.com> <20201001155738.Bluez.v4.8.I4e536cf2c9b6c5571b4b3800dfb8338fce8e4421@changeid> In-Reply-To: <20201001155738.Bluez.v4.8.I4e536cf2c9b6c5571b4b3800dfb8338fce8e4421@changeid> From: Luiz Augusto von Dentz Date: Tue, 27 Oct 2020 15:05:12 -0700 Message-ID: Subject: Re: [Bluez PATCH v4 08/10] advertising: Expose SupportedCapabilities for advertising To: Daniel Winkler Cc: Luiz Augusto Von Dentz , "linux-bluetooth@vger.kernel.org" , ChromeOS Bluetooth Upstreaming , Sonny Sasaka , Alain Michaud Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-bluetooth@vger.kernel.org Hi Daniel, On Thu, Oct 1, 2020 at 4:07 PM Daniel Winkler wrote: > > To help our advertising clients understand the device capabilities, this > patch adds a SupportedCapabilities dbus endpoint for the advertising > manager. The primary reason behind this is to provide the valid LE tx > power range the controller supports (populated if controller supports > BT5), so a client can know the valid power range before requesting a tx > power for their advertisement. > > I also thought it would be useful to indicate the max advertising data > length and scan response length in this endpoint, since some clients > will find it useful to set their advertising data (currently > experimental feature) or scan response data (possible future feature) > directly. > > This patch has been tested on Hatch (BT5 support) and Kukui (No BT5 > support) chromebooks to verify that the dbus endpoint contains the > correct data. > > Reviewed-by: Sonny Sasaka > Reviewed-by: Alain Michaud > --- > > Changes in v4: None > Changes in v3: None > Changes in v2: None > > src/advertising.c | 34 ++++++++++++++++++++++++++++++++++ > 1 file changed, 34 insertions(+) > > diff --git a/src/advertising.c b/src/advertising.c > index 41d0658c8..f76831594 100644 > --- a/src/advertising.c > +++ b/src/advertising.c > @@ -1619,12 +1619,46 @@ static gboolean get_supported_secondary(const GDBusPropertyTable *property, > return TRUE; > } > > +static gboolean get_supported_cap(const GDBusPropertyTable *property, > + DBusMessageIter *iter, void *data) > +{ > + struct btd_adv_manager *manager = data; > + DBusMessageIter dict; > + int16_t min_tx_power = manager->min_tx_power; > + int16_t max_tx_power = manager->max_tx_power; > + > + dbus_message_iter_open_container(iter, DBUS_TYPE_ARRAY, > + DBUS_DICT_ENTRY_BEGIN_CHAR_AS_STRING > + DBUS_TYPE_STRING_AS_STRING > + DBUS_TYPE_VARIANT_AS_STRING > + DBUS_DICT_ENTRY_END_CHAR_AS_STRING, > + &dict); > + > + if (min_tx_power != ADV_TX_POWER_NO_PREFERENCE) > + dict_append_entry(&dict, "MinTxPower", DBUS_TYPE_INT16, > + &min_tx_power); > + > + if (max_tx_power != ADV_TX_POWER_NO_PREFERENCE) > + dict_append_entry(&dict, "MaxTxPower", DBUS_TYPE_INT16, > + &max_tx_power); > + > + dict_append_entry(&dict, "MaxAdvLen", DBUS_TYPE_BYTE, > + &manager->max_adv_len); > + dict_append_entry(&dict, "MaxScnRspLen", DBUS_TYPE_BYTE, > + &manager->max_scan_rsp_len); > + > + dbus_message_iter_close_container(iter, &dict); > + > + return TRUE; > +} > + > static const GDBusPropertyTable properties[] = { > { "ActiveInstances", "y", get_active_instances, NULL, NULL }, > { "SupportedInstances", "y", get_instances, NULL, NULL }, > { "SupportedIncludes", "as", get_supported_includes, NULL, NULL }, > { "SupportedSecondaryChannels", "as", get_supported_secondary, NULL, > secondary_exits }, > + { "SupportedCapabilities", "a{sv}", get_supported_cap, NULL, NULL}, Lets mark this as experimental for now. > { } > }; > > -- > 2.28.0.709.gb0816b6eb0-goog > -- Luiz Augusto von Dentz