summaryrefslogtreecommitdiff
path: root/src/main.c
diff options
context:
space:
mode:
authorLuiz Augusto von Dentz <luiz.von.dentz@intel.com>2020-01-07 11:47:49 -0800
committerLuiz Augusto von Dentz <luiz.von.dentz@intel.com>2020-03-02 14:42:35 -0800
commitcc441474e77d098c84a9b4140d5e213ccef5d12e (patch)
treeb63b1212a82e55ec128c1efc64a80322af6d56d4 /src/main.c
parentb8b59af4e88069cb2f67b0168113aa489f6e1fe9 (diff)
downloadbluez-cc441474e77d098c84a9b4140d5e213ccef5d12e.tar.gz
core: Add support for setting the number of GATT bearers
This adds option to set the numbers of GATT Channels/Bearers to be connected in main.conf.
Diffstat (limited to 'src/main.c')
-rw-r--r--src/main.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/main.c b/src/main.c
index fc8c869fc..7b927ac79 100644
--- a/src/main.c
+++ b/src/main.c
@@ -109,6 +109,7 @@ static const char *gatt_options[] = {
"Cache",
"KeySize",
"ExchangeMTU",
+ "EATTChannels",
NULL
};
@@ -471,6 +472,18 @@ static void parse_config(GKeyFile *config)
DBG("ExchangeMTU=%d", val);
main_opts.gatt_mtu = val;
}
+
+ val = g_key_file_get_integer(config, "GATT", "Channels", &err);
+ if (err) {
+ DBG("%s", err->message);
+ g_clear_error(&err);
+ } else {
+ DBG("Channels=%d", val);
+ /* Ensure the channels is within a valid range. */
+ val = MIN(val, 5);
+ val = MAX(val, 1);
+ main_opts.gatt_channels = val;
+ }
}
static void init_defaults(void)
@@ -497,6 +510,7 @@ static void init_defaults(void)
main_opts.gatt_cache = BT_GATT_CACHE_ALWAYS;
main_opts.gatt_mtu = BT_ATT_MAX_LE_MTU;
+ main_opts.gatt_channels = 3;
}
static void log_handler(const gchar *log_domain, GLogLevelFlags log_level,