All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH BlueZ] core: Remove DiscoverSchedulerInterval option from main.conf
@ 2012-04-19 18:03 Luiz Augusto von Dentz
  2012-04-20 11:48 ` Anderson Lizardo
  2012-04-23 10:41 ` Johan Hedberg
  0 siblings, 2 replies; 4+ messages in thread
From: Luiz Augusto von Dentz @ 2012-04-19 18:03 UTC (permalink / raw)
  To: linux-bluetooth

From: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>

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 |    5 ++---
 src/hcid.h    |    1 -
 src/main.c    |   10 ----------
 src/main.conf |    4 ----
 4 files changed, 2 insertions(+), 18 deletions(-)

diff --git a/src/adapter.c b/src/adapter.c
index 01630dd..e5605c7 100644
--- a/src/adapter.c
+++ b/src/adapter.c
@@ -2541,11 +2541,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)
diff --git a/src/hcid.h b/src/hcid.h
index 2c1cbff..1e5e15a 100644
--- a/src/hcid.h
+++ b/src/hcid.h
@@ -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;
diff --git a/src/main.c b/src/main.c
index 8763bf9..b062b4a 100644
--- a/src/main.c
+++ b/src/main.c
@@ -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) {
diff --git a/src/main.conf b/src/main.conf
index 3419d07..787ef4f 100644
--- a/src/main.conf
+++ b/src/main.conf
@@ -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
-- 
1.7.7.6


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH BlueZ] core: Remove DiscoverSchedulerInterval option from main.conf
  2012-04-19 18:03 [PATCH BlueZ] core: Remove DiscoverSchedulerInterval option from main.conf Luiz Augusto von Dentz
@ 2012-04-20 11:48 ` Anderson Lizardo
  2012-04-20 11:57   ` Luiz Augusto von Dentz
  2012-04-23 10:41 ` Johan Hedberg
  1 sibling, 1 reply; 4+ messages in thread
From: Anderson Lizardo @ 2012-04-20 11:48 UTC (permalink / raw)
  To: Luiz Augusto von Dentz; +Cc: linux-bluetooth

Hi Luiz,

On Thu, Apr 19, 2012 at 2:03 PM, Luiz Augusto von Dentz
<luiz.dentz@gmail.com> wrote:
> @@ -2541,11 +2541,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);

Is it necessary to keep this id? I thought g_idle_add() would run as
soon as (or close) control returns to mainloop.

>  }

Best Regards,
-- 
Anderson Lizardo
Instituto Nokia de Tecnologia - INdT
Manaus - Brazil

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH BlueZ] core: Remove DiscoverSchedulerInterval option from main.conf
  2012-04-20 11:48 ` Anderson Lizardo
@ 2012-04-20 11:57   ` Luiz Augusto von Dentz
  0 siblings, 0 replies; 4+ messages in thread
From: Luiz Augusto von Dentz @ 2012-04-20 11:57 UTC (permalink / raw)
  To: Anderson Lizardo; +Cc: linux-bluetooth

Hi Anderson,

On Fri, Apr 20, 2012 at 2:48 PM, Anderson Lizardo
<anderson.lizardo@openbossa.org> wrote:
> Hi Luiz,
>
> On Thu, Apr 19, 2012 at 2:03 PM, Luiz Augusto von Dentz
> <luiz.dentz@gmail.com> wrote:
>> @@ -2541,11 +2541,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);
>
> Is it necessary to keep this id? I thought g_idle_add() would run as
> soon as (or close) control returns to mainloop.

I keep it just to avoid having to cancel the discovery in case the
discovery session is dropped during the same mainloop iteration, so it
let all the events be processed before restarting the discovery.


-- 
Luiz Augusto von Dentz

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH BlueZ] core: Remove DiscoverSchedulerInterval option from main.conf
  2012-04-19 18:03 [PATCH BlueZ] core: Remove DiscoverSchedulerInterval option from main.conf Luiz Augusto von Dentz
  2012-04-20 11:48 ` Anderson Lizardo
@ 2012-04-23 10:41 ` Johan Hedberg
  1 sibling, 0 replies; 4+ messages in thread
From: Johan Hedberg @ 2012-04-23 10:41 UTC (permalink / raw)
  To: Luiz Augusto von Dentz; +Cc: linux-bluetooth

Hi Luiz,

On Thu, Apr 19, 2012, Luiz Augusto von Dentz wrote:
> 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 |    5 ++---
>  src/hcid.h    |    1 -
>  src/main.c    |   10 ----------
>  src/main.conf |    4 ----
>  4 files changed, 2 insertions(+), 18 deletions(-)

Applied. Thanks.

Johan

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2012-04-23 10:41 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-04-19 18:03 [PATCH BlueZ] core: Remove DiscoverSchedulerInterval option from main.conf Luiz Augusto von Dentz
2012-04-20 11:48 ` Anderson Lizardo
2012-04-20 11:57   ` Luiz Augusto von Dentz
2012-04-23 10:41 ` Johan Hedberg

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.