All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] android: Fix not sending scan mode change notification
@ 2013-11-04  9:59 Szymon Janc
  2013-11-04 10:15 ` Johan Hedberg
  0 siblings, 1 reply; 2+ messages in thread
From: Szymon Janc @ 2013-11-04  9:59 UTC (permalink / raw)
  To: linux-bluetooth; +Cc: Szymon Janc

Check for current settings instead of changed setting mask when
sending notification. Otherwise scan mode change would be communicated
only if power state changed at the same time.
---
 android/adapter.c | 17 +++++++++--------
 1 file changed, 9 insertions(+), 8 deletions(-)

diff --git a/android/adapter.c b/android/adapter.c
index af62b11..efe3e8b 100644
--- a/android/adapter.c
+++ b/android/adapter.c
@@ -174,19 +174,20 @@ static void settings_changed(uint32_t settings)
 
 	DBG("0x%08x", changed_mask);
 
-	if (changed_mask & MGMT_SETTING_POWERED) {
+	if (changed_mask & MGMT_SETTING_POWERED)
 		powered_changed();
 
-		/*
-		 * Only when powered, the connectable and discoverable
-		 * state changes should be communicated.
-		 */
-		scan_mode_mask = MGMT_SETTING_CONNECTABLE |
-						MGMT_SETTING_DISCOVERABLE;
 
+	scan_mode_mask = MGMT_SETTING_CONNECTABLE |
+					MGMT_SETTING_DISCOVERABLE;
+
+	/*
+	 * Only when powered, the connectable and discoverable
+	 * state changes should be communicated.
+	 */
+	if (adapter->current_settings & MGMT_SETTING_POWERED)
 		if (changed_mask & scan_mode_mask)
 			scan_mode_changed();
-	}
 }
 
 static void new_settings_callback(uint16_t index, uint16_t length,
-- 
1.8.4.1


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

* Re: [PATCH] android: Fix not sending scan mode change notification
  2013-11-04  9:59 [PATCH] android: Fix not sending scan mode change notification Szymon Janc
@ 2013-11-04 10:15 ` Johan Hedberg
  0 siblings, 0 replies; 2+ messages in thread
From: Johan Hedberg @ 2013-11-04 10:15 UTC (permalink / raw)
  To: Szymon Janc; +Cc: linux-bluetooth

Hi Szymon,

On Mon, Nov 04, 2013, Szymon Janc wrote:
> Check for current settings instead of changed setting mask when
> sending notification. Otherwise scan mode change would be communicated
> only if power state changed at the same time.
> ---
>  android/adapter.c | 17 +++++++++--------
>  1 file changed, 9 insertions(+), 8 deletions(-)

Applied. Thanks.

Johan

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

end of thread, other threads:[~2013-11-04 10:15 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-11-04  9:59 [PATCH] android: Fix not sending scan mode change notification Szymon Janc
2013-11-04 10:15 ` 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.