From: Luiz Augusto von Dentz <luiz.dentz@gmail.com>
To: linux-bluetooth@vger.kernel.org
Subject: [PATCH BlueZ] main.conf: Add option to enable experimental features
Date: Fri, 14 May 2021 14:13:04 -0700 [thread overview]
Message-ID: <20210514211304.17237-1-luiz.dentz@gmail.com> (raw)
From: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
The adds options Experimental which is the equivalent to
-E/--experimental command line option.
---
src/btd.h | 1 +
src/main.c | 13 ++++++++++---
src/main.conf | 4 ++++
3 files changed, 15 insertions(+), 3 deletions(-)
diff --git a/src/btd.h b/src/btd.h
index a3247e4fd..6af54a99a 100644
--- a/src/btd.h
+++ b/src/btd.h
@@ -105,6 +105,7 @@ struct btd_opts {
gboolean debug_keys;
gboolean fast_conn;
gboolean refresh_discovery;
+ gboolean experimental;
uint16_t did_source;
uint16_t did_vendor;
diff --git a/src/main.c b/src/main.c
index c32bda7d4..c82812201 100644
--- a/src/main.c
+++ b/src/main.c
@@ -715,6 +715,13 @@ static void parse_config(GKeyFile *config)
else
btd_opts.refresh_discovery = boolean;
+ boolean = g_key_file_get_boolean(config, "General",
+ "Experimental", &err);
+ if (err)
+ g_clear_error(&err);
+ else
+ btd_opts.experimental = boolean;
+
str = g_key_file_get_string(config, "GATT", "Cache", &err);
if (err) {
DBG("%s", err->message);
@@ -812,6 +819,7 @@ static void init_defaults(void)
btd_opts.name_resolv = TRUE;
btd_opts.debug_keys = FALSE;
btd_opts.refresh_discovery = TRUE;
+ btd_opts.experimental = false;
btd_opts.defaults.num_entries = 0;
btd_opts.defaults.br.page_scan_type = 0xFFFF;
@@ -891,7 +899,6 @@ static char *option_configfile = NULL;
static gboolean option_compat = FALSE;
static gboolean option_detach = TRUE;
static gboolean option_version = FALSE;
-static gboolean option_experimental = FALSE;
static void free_options(void)
{
@@ -975,7 +982,7 @@ static GOptionEntry options[] = {
"Specify an explicit path to the config file", "FILE"},
{ "compat", 'C', 0, G_OPTION_ARG_NONE, &option_compat,
"Provide deprecated command line interfaces" },
- { "experimental", 'E', 0, G_OPTION_ARG_NONE, &option_experimental,
+ { "experimental", 'E', 0, G_OPTION_ARG_NONE, &btd_opts.experimental,
"Enable experimental interfaces" },
{ "nodetach", 'n', G_OPTION_FLAG_REVERSE,
G_OPTION_ARG_NONE, &option_detach,
@@ -1042,7 +1049,7 @@ int main(int argc, char *argv[])
exit(1);
}
- if (option_experimental)
+ if (btd_opts.experimental)
gdbus_flags = G_DBUS_FLAG_ENABLE_EXPERIMENTAL;
g_dbus_set_flags(gdbus_flags);
diff --git a/src/main.conf b/src/main.conf
index f47cab46d..bf8a86080 100644
--- a/src/main.conf
+++ b/src/main.conf
@@ -86,6 +86,10 @@
# profile is connected. Defaults to true.
#RefreshDiscovery = true
+# Enables experimental features and interfaces.
+# Defaults to false.
+#Experimental = false
+
[BR]
# The following values are used to load default adapter parameters for BR/EDR.
# BlueZ loads the values into the kernel before the adapter is powered if the
--
2.30.2
next reply other threads:[~2021-05-14 21:13 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-05-14 21:13 Luiz Augusto von Dentz [this message]
2021-05-14 21:42 ` [BlueZ] main.conf: Add option to enable experimental features bluez.test.bot
2021-05-17 21:54 ` Luiz Augusto von Dentz
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20210514211304.17237-1-luiz.dentz@gmail.com \
--to=luiz.dentz@gmail.com \
--cc=linux-bluetooth@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).