Hi Alain, On Mon, Jun 15, 2020 at 7:57 AM Alain Michaud <alainm@xxxxxxxxxxxx> 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