@@ -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);
}
@@ -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;
@@ -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;
@@ -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
From: Archie Pusaka <apusaka@chromium.org> This is to configure the default behavior of issuing SDP query to update the services upon profile connection. --- Changes in v3: * Add main_opts.refresh_discovery Changes in v2: None src/device.c | 2 +- src/hcid.h | 1 + src/main.c | 8 ++++++++ src/main.conf | 4 ++++ 4 files changed, 14 insertions(+), 1 deletion(-)