linux-bluetooth.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH BlueZ] Fix global_mode shall be updated by plug-in
@ 2011-07-29  8:33 Dmitriy Paliy
  2011-07-29  9:14 ` Johan Hedberg
  0 siblings, 1 reply; 2+ messages in thread
From: Dmitriy Paliy @ 2011-07-29  8:33 UTC (permalink / raw)
  To: linux-bluetooth; +Cc: Dmitriy Paliy

Currently, use of RequestSession and SetProperty adapter method
calls sets global_mode to on. Switching adapter off via plug-in
interface in this scenario releases all sessions, that, in turn,
restores adapter's state to global_mode, which is on.

Result is the adapter is switched off and immediately switched on.
This patch fixes such inconsistency by overwriting global_mode to
mode off when request comes from plug-in.
---
 src/adapter.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/src/adapter.c b/src/adapter.c
index e1b8d5d..4c88a0e 100644
--- a/src/adapter.c
+++ b/src/adapter.c
@@ -3425,6 +3425,8 @@ int btd_adapter_switch_offline(struct btd_adapter *adapter)
 	if (adapter->off_timer)
 		return 0;
 
+	adapter->global_mode = MODE_OFF;
+
 	if (adapter->connections == NULL)
 		return adapter_ops->set_powered(adapter->dev_id, FALSE);
 
-- 
1.7.4.1


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

* Re: [PATCH BlueZ] Fix global_mode shall be updated by plug-in
  2011-07-29  8:33 [PATCH BlueZ] Fix global_mode shall be updated by plug-in Dmitriy Paliy
@ 2011-07-29  9:14 ` Johan Hedberg
  0 siblings, 0 replies; 2+ messages in thread
From: Johan Hedberg @ 2011-07-29  9:14 UTC (permalink / raw)
  To: Dmitriy Paliy; +Cc: linux-bluetooth

Hi Dmitriy,

On Fri, Jul 29, 2011, Dmitriy Paliy wrote:
> Currently, use of RequestSession and SetProperty adapter method
> calls sets global_mode to on. Switching adapter off via plug-in
> interface in this scenario releases all sessions, that, in turn,
> restores adapter's state to global_mode, which is on.
> 
> Result is the adapter is switched off and immediately switched on.
> This patch fixes such inconsistency by overwriting global_mode to
> mode off when request comes from plug-in.
> ---
>  src/adapter.c |    2 ++
>  1 files changed, 2 insertions(+), 0 deletions(-)

Applied. Thanks.

Johan

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

end of thread, other threads:[~2011-07-29  9:14 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-07-29  8:33 [PATCH BlueZ] Fix global_mode shall be updated by plug-in Dmitriy Paliy
2011-07-29  9:14 ` Johan Hedberg

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).