Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp1036563ybt; Wed, 17 Jun 2020 21:49:05 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxd3uukbZOYMaNjSMXkZ0NlMY4iqcHYrSedZaqLWfuD+FBlzUEVWZfkFWV5vs6Wj3edrh+j X-Received: by 2002:a05:6402:3044:: with SMTP id bu4mr2330300edb.69.1592455745320; Wed, 17 Jun 2020 21:49:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1592455745; cv=none; d=google.com; s=arc-20160816; b=aXLLs6yQDRK3ShISDY3eISgJ1qVyjKAylDfMsuf0t74cc0TgJ2GAjlFcVi9aafV+Ci /+6j/JQiVf4LMVYYMBhqHAsWIjG4VwNAS9oI/ozGYZuVrORgLOSnTpUZ8lIXYjpjN+SH JmNzfyKPJwGiZUHVIEe6vV9y+CwQI7yjr9q3bU0To+PrtUtkk4Q1YF1Y/SAaq3glbpTD BVNszKjvkaPb4qSVarIatcPzyuIe2qBUQ60V1LGt8JOaB1zwQVgScFk1Z2rjOUniAFIE ekFgU5xQqA6BKdfbiRB8Zz1lm9Hv4y+FqzxQNgXP2FjbGy0YDQdexM8isKRYsrJIDqMB yjRw== 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=aNGRm/uT8MggjM6+qpD2PxualvaE2mM+LeQP0hJ3bi0=; b=Kff8HWVF7GFyZec4QFkefHEcUjoPpNMAjy1XdvNTIi/U+GNdg+UHSS791QBZGsTJBv Ny9mhQvMGpTDudgpAtpGmXJl4wuJ7gAXJQykRQP9CWkAT/t8ChapKNtvoGqySrptW8iY V2pmvzPL6z1PRIctBEUKTGryINgftntRFklOF5S8FdZqGsGNVlFPXNxm1sv3HbNx6Tqn huY0L9T99r5IwWhpBGjThSZqkPuUSMRYWhf729D/HvtCDczNl3gBPhe67pIOB7g9i6X/ cSRSzhPW5GYpHBp1oAtq2QXM/D7JT1W7WSbWnaPqu9kQ6JmY5SX3ZmvwgY564wTf17P2 tKPg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=d+moL1DL; 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 w23si1101990ejn.709.2020.06.17.21.48.41; Wed, 17 Jun 2020 21:49:05 -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=d+moL1DL; 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 S1726193AbgFREnE (ORCPT + 99 others); Thu, 18 Jun 2020 00:43:04 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49582 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726020AbgFREnD (ORCPT ); Thu, 18 Jun 2020 00:43:03 -0400 Received: from mail-ot1-x344.google.com (mail-ot1-x344.google.com [IPv6:2607:f8b0:4864:20::344]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A57C7C06174E for ; Wed, 17 Jun 2020 21:43:03 -0700 (PDT) Received: by mail-ot1-x344.google.com with SMTP id k15so3519621otp.8 for ; Wed, 17 Jun 2020 21:43:03 -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=aNGRm/uT8MggjM6+qpD2PxualvaE2mM+LeQP0hJ3bi0=; b=d+moL1DLj+fYtShyVzQe+D2yeEGh5CfUt4mhNn6uQIgcEGrujOZDwurth5csod2NTR NqAfI7PaMEB798uHCS1KZhlhwwnn2mTV0dAY0pFns05TESCthnA87OXZjFZiwnJhgVqC putoxCOD1lwawAQiyRANNyMhI+pjvAGekAMK74WjknizozKKvV+S1oOExGfBzZ7ptMTl LMQJ/1Bk6Vry1iKJGvBez6IQ9lugelPSxAwePX/W0Q40dPDuIkOo9fZDHzpiZxkCK1OE z9FWTNhB3b5r/zxDqyByC5QCSUB8pY3YBjTwAcjDKIpuPVBqDuEMlmgzgiH+MaW2Qzh2 TViw== 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=aNGRm/uT8MggjM6+qpD2PxualvaE2mM+LeQP0hJ3bi0=; b=GYhDcBrmQgfdw9hSGOvLJ2rwEFxCFRUM49FkJXvs9X35IkKeHWCrBiPJzfhg5umn7r 1Ylbsx1y5Zk4Lupv3urf+7UschJVPkKbpeHNqz4Y4IzgLD1IeYVCRQihFQ6QLhJvz3BK kVDcrt0dvfh6cByvr3oIe6V1damnZLrFmVEOEGZnK05KmK+FkeeJyCIiFhwhL/YENgF8 NmlpjvN2oJ2Uxi/d0hColFHm3keFnTs2kxJ3C2I+ghEJ6FeaxL2mLNBfmFzKmmVGlIo6 4VVldBvPAsy59IwRR9IGIhwRUnbCzLJMaBGsatohLZZqyXDbcEF3aWCYNVen8Y5tnfFn 6jsQ== X-Gm-Message-State: AOAM533gt0ZRlUw5/qYrps4G93bqwEKrM/fup0t3dhPWyyRcxqI84cUh xwgk70kP5NFggx1hYbsZPdouiu9a2WDNojoHGwOWmg== X-Received: by 2002:a05:6830:8d:: with SMTP id a13mr1943250oto.91.1592455383001; Wed, 17 Jun 2020 21:43:03 -0700 (PDT) MIME-Version: 1.0 References: <20200615145252.259971-1-alainm@chromium.org> In-Reply-To: <20200615145252.259971-1-alainm@chromium.org> From: Luiz Augusto von Dentz Date: Wed, 17 Jun 2020 21:42:52 -0700 Message-ID: Subject: Re: [BlueZ PATCH v1] adding a configurable le autoconnect timeout value To: Alain Michaud Cc: "linux-bluetooth@vger.kernel.org" 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 Alain, On Mon, Jun 15, 2020 at 7:57 AM Alain Michaud wrote: > > This patch adds support for a configurable le autoconnect timer. > > --- > > doc/mgmt-api.txt | 1 + > src/adapter.c | 8 ++++++++ > src/hcid.h | 1 + > src/main.c | 5 +++++ > src/main.conf | 1 + > 5 files changed, 16 insertions(+) > > diff --git a/doc/mgmt-api.txt b/doc/mgmt-api.txt > index 80c483f8b..ca0d38469 100644 > --- a/doc/mgmt-api.txt > +++ b/doc/mgmt-api.txt > @@ -3278,6 +3278,7 @@ Read Default System Configuration Command > 0x0018 LE Max Connection Interval > 0x0019 LE Connection Latency > 0x001a LE Connection Supervision Timeout > + 0x001b LE Autoconnect Timeout > > This command can be used at any time and will return a list of > supported default parameters as well as their current value. > diff --git a/src/adapter.c b/src/adapter.c > index 92002673b..9ce351893 100644 > --- a/src/adapter.c > +++ b/src/adapter.c > @@ -4423,6 +4423,14 @@ static void load_default_system_params(struct btd_adapter *adapter) > len += sizeof(params[i].u16); > } > > + if (main_opts.default_params.le_autoconnect_timeout) { > + params[i].entry.type = 0x001b; > + params[i].entry.length = sizeof(params[i].u16); > + params[i].u16 = main_opts.default_params.le_autoconnect_timeout; > + ++i; > + len += sizeof(params[i].u16); > + } > + > err = mgmt_send(adapter->mgmt, MGMT_OP_SET_DEF_SYSTEM_CONFIG, > adapter->dev_id, len, params, NULL, NULL, NULL); > if (!err) > diff --git a/src/hcid.h b/src/hcid.h > index 1b2714b1d..c21ac9980 100644 > --- a/src/hcid.h > +++ b/src/hcid.h > @@ -91,6 +91,7 @@ struct main_opts { > uint16_t le_max_conn_interval; > uint16_t le_conn_latency; > uint16_t le_conn_lsto; > + uint16_t le_autoconnect_timeout; > } default_params; > > > diff --git a/src/main.c b/src/main.c > index e51f614b3..77886d58e 100644 > --- a/src/main.c > +++ b/src/main.c > @@ -120,6 +120,7 @@ static const char *controller_options[] = { > "LEMaxConnectionInterval", > "LEConnectionLatency", > "LEConnectionSupervisionTimeout", > + "LEAutoconnecttimeout", > NULL > }; > > @@ -410,6 +411,10 @@ static void parse_controller_config(GKeyFile *config) > &main_opts.default_params.le_scan_win_connect, > 0x0004, > 0x4000}, > + { "LEAutoconnecttimeout", > + &main_opts.default_params.le_autoconnect_timeout, > + 0x0001, > + 0x4000}, > }; > uint16_t i; > > diff --git a/src/main.conf b/src/main.conf > index 92d937f0c..6a6f7d4b4 100644 > --- a/src/main.conf > +++ b/src/main.conf > @@ -141,6 +141,7 @@ > #LEMaxConnectionInterval= > #LEConnectionLatency= > #LEConnectionSupervisionTimeout= > +#LEAutoconnecttimeout= > > [GATT] > # GATT attribute cache. > -- > 2.27.0.290.gba653c62da-goog > Applied, thanks. Note that it might be better to send the documentation changes as a separate patch next time. -- Luiz Augusto von Dentz