Diff between ebea66797df93c938913f7d1fc579026a9665fac and 1cd65e52665cfbf939c923baea51748e359abfa5

Changed Files

File Additions Deletions Status
src/adapter.c +4 -0 modified
src/hcid.h +1 -0 modified
src/main.c +8 -0 modified
src/main.conf +6 -0 modified

Full Patch

diff --git a/src/adapter.c b/src/adapter.c
index 93de573..329e9b4 100644
--- a/src/adapter.c
+++ b/src/adapter.c
@@ -7103,6 +7103,10 @@ static void read_info_complete(uint8_t status, uint16_t length,
 	if (missing_settings & MGMT_SETTING_SECURE_CONN)
 		set_mode(adapter, MGMT_OP_SET_SECURE_CONN, 0x01);
 
+	if (main_opts.fast_conn &&
+			(missing_settings & MGMT_SETTING_FAST_CONNECTABLE))
+		set_mode(adapter, MGMT_OP_SET_FAST_CONNECTABLE, 0x01);
+
 	err = adapter_register(adapter);
 	if (err < 0) {
 		error("Unable to register new adapter");
diff --git a/src/hcid.h b/src/hcid.h
index 0c91292..60e2b0a 100644
--- a/src/hcid.h
+++ b/src/hcid.h
@@ -38,6 +38,7 @@ struct main_opts {
 	gboolean	reverse_sdp;
 	gboolean	name_resolv;
 	gboolean	debug_keys;
+	gboolean	fast_conn;
 
 	uint16_t	did_source;
 	uint16_t	did_vendor;
diff --git a/src/main.c b/src/main.c
index f571479..0562b44 100644
--- a/src/main.c
+++ b/src/main.c
@@ -328,6 +328,14 @@ static void parse_config(GKeyFile *config)
 
 		g_free(str);
 	}
+
+	boolean = g_key_file_get_boolean(config, "General",
+						"FastConnectable", &err);
+	if (err)
+		g_clear_error(&err);
+	else
+		main_opts.fast_conn = boolean;
+
 }
 
 static void init_defaults(void)
diff --git a/src/main.conf b/src/main.conf
index 9be90af..9b41f8c 100644
--- a/src/main.conf
+++ b/src/main.conf
@@ -59,6 +59,12 @@
 # Possible values: "off", "single", "multiple"
 #MultiProfile = off
 
+# Permanently enables the Fast Connectable setting for adapters that
+# support it. When enabled other devices can connect faster to us,
+# however the tradeoff is increased power consumptions. Defaults to
+# 'false'.
+#FastConnectable = false
+
 #[Policy]
 #
 # The ReconnectUUIDs defines the set of remote services that should try