This introduces MaxControllers which can be used to limit the number of
adapters exposed in the system.
Signed-off-by: Manika Shrivastava <manika.sh@samsung.com>
Signed-off-by: Ayush Garg <ayush.garg@samsung.com>
return;
}
+ /* Check if at maximum adapters allowed in the system then ignore the
+ * adapter.
+ */
+ if (btd_opts.max_adapters &&
+ btd_opts.max_adapters == g_slist_length(adapters))
+ return;
+
reset_adv_monitors(index);
adapter = btd_adapter_new(index);
uint16_t did_version;
bt_mode_t mode;
+ uint16_t max_adapters;
bt_gatt_cache_t gatt_cache;
uint16_t gatt_mtu;
uint8_t gatt_channels;
"NameResolving",
"DebugKeys",
"ControllerMode",
+ "MaxControllers"
"MultiProfile",
"FastConnectable",
"Privacy",
g_free(str);
}
+ val = g_key_file_get_integer(config, "General", "MaxControllers", &err);
+ if (err) {
+ g_clear_error(&err);
+ } else {
+ DBG("MaxControllers=%d", val);
+ btd_opts.max_adapters = val;
+ }
+
str = g_key_file_get_string(config, "General", "MultiProfile", &err);
if (err) {
g_clear_error(&err);
# Possible values: "dual", "bredr", "le"
#ControllerMode = dual
+# Maximum number of controllers allowed to be exposed to the system.
+# Default=0 (unlimited)
+#MaxControllers=0
+
# Enables Multi Profile Specification support. This allows to specify if
# system supports only Multiple Profiles Single Device (MPSD) configuration
# or both Multiple Profiles Single Device (MPSD) and Multiple Profiles Multiple