OSDN Git Service

core: Remove DiscoverSchedulerInterval option from main.conf
authorLuiz Augusto von Dentz <luiz.von.dentz@intel.com>
Thu, 19 Apr 2012 18:03:35 +0000 (21:03 +0300)
committerJohan Hedberg <johan.hedberg@intel.com>
Mon, 23 Apr 2012 10:40:52 +0000 (13:40 +0300)
This option was designed to be the time where name resolving would happen
in between inquiries, but with the introdution of mgmt interface this is
no longer the case as it treats the discovery as both inquiry/scan + name
resolving and keeping it just to delay discovery rounds is probably
useless.

src/adapter.c
src/hcid.h
src/main.c
src/main.conf

index a4180b1..94df0a2 100644 (file)
@@ -2528,11 +2528,10 @@ void adapter_set_discovering(struct btd_adapter *adapter,
        if (!adapter_has_discov_sessions(adapter) || adapter->discov_suspended)
                return;
 
-       DBG("hci%u enabling timer, disc_sessions %u", adapter->dev_id,
+       DBG("hci%u restarting discovery, disc_sessions %u", adapter->dev_id,
                                        g_slist_length(adapter->disc_sessions));
 
-       adapter->discov_id = g_timeout_add_seconds(main_opts.discov_interval,
-                                                       discovery_cb, adapter);
+       adapter->discov_id = g_idle_add(discovery_cb, adapter);
 }
 
 static void suspend_discovery(struct btd_adapter *adapter)
index 2c1cbff..1e5e15a 100644 (file)
@@ -41,7 +41,6 @@ struct main_opts {
        gboolean        gatt_enabled;
 
        uint8_t         mode;
-       uint8_t         discov_interval;
 
        uint16_t        did_source;
        uint16_t        did_vendor;
index 8763bf9..b062b4a 100644 (file)
@@ -190,16 +190,6 @@ static void parse_config(GKeyFile *config)
                g_free(str);
        }
 
-       val = g_key_file_get_integer(config, "General",
-                                       "DiscoverSchedulerInterval", &err);
-       if (err) {
-               DBG("%s", err->message);
-               g_clear_error(&err);
-       } else {
-               DBG("discov_interval=%d", val);
-               main_opts.discov_interval = val;
-       }
-
        boolean = g_key_file_get_boolean(config, "General",
                                                "InitiallyPowered", &err);
        if (err) {
index 3419d07..787ef4f 100644 (file)
@@ -26,10 +26,6 @@ PairableTimeout = 0
 # which is 16384 (10 seconds).
 PageTimeout = 8192
 
-# Discover scheduler interval used in Adapter.DiscoverDevices
-# The value is in seconds. Defaults is 30.
-DiscoverSchedulerInterval = 30
-
 # Automatic connection for bonded devices driven by platform/user events.
 # If a platform plugin uses this mechanism, automatic connections will be
 # enabled during the interval defined below. Initially, this feature