Diff between ebfa306d97b5020bf5ae55ab3821facfaf1c053c and 8fe6fddd9bfb4798d68c6df674f9d5d33d45c3c0

Changed Files

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

Full Patch

diff --git a/src/device.c b/src/device.c
index f7f8948..7b78084 100644
--- a/src/device.c
+++ b/src/device.c
@@ -4076,7 +4076,7 @@ static struct btd_device *device_new(struct btd_adapter *adapter,
 	device->db_id = gatt_db_register(device->db, gatt_service_added,
 					gatt_service_removed, device, NULL);
 
-	device->refresh_discovery = true;
+	device->refresh_discovery = main_opts.refresh_discovery;
 
 	return btd_device_ref(device);
 }
diff --git a/src/hcid.h b/src/hcid.h
index 5f249eb..3624ba6 100644
--- a/src/hcid.h
+++ b/src/hcid.h
@@ -100,6 +100,7 @@ struct main_opts {
 	gboolean	name_resolv;
 	gboolean	debug_keys;
 	gboolean	fast_conn;
+	gboolean	refresh_discovery;
 
 	uint16_t	did_source;
 	uint16_t	did_vendor;
diff --git a/src/main.c b/src/main.c
index 2c083de..b37c329 100644
--- a/src/main.c
+++ b/src/main.c
@@ -627,6 +627,13 @@ static void parse_config(GKeyFile *config)
 	else
 		main_opts.fast_conn = boolean;
 
+	boolean = g_key_file_get_boolean(config, "General",
+						"RefreshDiscovery", &err);
+	if (err)
+		g_clear_error(&err);
+	else
+		main_opts.refresh_discovery = boolean;
+
 	str = g_key_file_get_string(config, "GATT", "Cache", &err);
 	if (err) {
 		DBG("%s", err->message);
@@ -688,6 +695,7 @@ static void init_defaults(void)
 	main_opts.reverse_discovery = TRUE;
 	main_opts.name_resolv = TRUE;
 	main_opts.debug_keys = FALSE;
+	main_opts.refresh_discovery = TRUE;
 
 	main_opts.default_params.num_entries = 0;
 	main_opts.default_params.br_page_scan_type = 0xFFFF;
diff --git a/src/main.conf b/src/main.conf
index f41203b..42f7e41 100644
--- a/src/main.conf
+++ b/src/main.conf
@@ -82,6 +82,10 @@
 # 0 = disable timer, i.e. never keep temporary devices
 #TemporaryTimeout = 30
 
+# Enables the device to issue an SDP request to update known services when
+# profile is connected. Defaults to true.
+#RefreshDiscovery = true
+
 [Controller]
 # The following values are used to load default adapter parameters.  BlueZ loads
 # the values into the kernel before the adapter is powered if the kernel