linux-bluetooth.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/3] mgmtops: When settings discoverable also set connectable if not set yet
@ 2012-03-05 19:05 Szymon Janc
  2012-03-05 19:05 ` [PATCH 2/3] mgmtops: Add debug print to update_settings Szymon Janc
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Szymon Janc @ 2012-03-05 19:05 UTC (permalink / raw)
  To: linux-bluetooth; +Cc: Szymon Janc

Otherwise command would be rejected e.g. when setting discoverable at
bluetoothd startup.
---
 plugins/mgmtops.c |    9 ++++++---
 1 files changed, 6 insertions(+), 3 deletions(-)

diff --git a/plugins/mgmtops.c b/plugins/mgmtops.c
index 89355ad..afed165 100644
--- a/plugins/mgmtops.c
+++ b/plugins/mgmtops.c
@@ -317,12 +317,15 @@ static void update_settings(struct btd_adapter *adapter, uint32_t settings)
 
 	info = &controllers[index];
 
-	if (on_mode == MODE_DISCOVERABLE && !mgmt_discoverable(settings))
+	if (on_mode == MODE_DISCOVERABLE && !mgmt_discoverable(settings)) {
+		if(!mgmt_connectable(settings))
+			mgmt_set_connectable(index, TRUE);
 		mgmt_set_discoverable(index, TRUE, discoverable_timeout);
-	else if (on_mode == MODE_CONNECTABLE && !mgmt_connectable(settings))
+	} else if (on_mode == MODE_CONNECTABLE && !mgmt_connectable(settings)) {
 		mgmt_set_connectable(index, TRUE);
-	else if (mgmt_powered(settings))
+	} else if (mgmt_powered(settings)) {
 		adapter_mode_changed(adapter, create_mode(settings));
+	}
 
 	if (mgmt_pairable(settings) != pairable)
 		mgmt_set_pairable(index, pairable);
-- 
1.7.9.1



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

* [PATCH 2/3] mgmtops: Add debug print to update_settings
  2012-03-05 19:05 [PATCH 1/3] mgmtops: When settings discoverable also set connectable if not set yet Szymon Janc
@ 2012-03-05 19:05 ` Szymon Janc
  2012-03-05 19:05 ` [PATCH 3/3] mgmtops: Use DBG not error for printing name in read_info_complete Szymon Janc
  2012-03-05 19:36 ` [PATCH 1/3] mgmtops: When settings discoverable also set connectable if not set yet Johan Hedberg
  2 siblings, 0 replies; 4+ messages in thread
From: Szymon Janc @ 2012-03-05 19:05 UTC (permalink / raw)
  To: linux-bluetooth; +Cc: Szymon Janc

Print settings for easier tracking what has changed.
---
 plugins/mgmtops.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/plugins/mgmtops.c b/plugins/mgmtops.c
index afed165..4970b7c 100644
--- a/plugins/mgmtops.c
+++ b/plugins/mgmtops.c
@@ -310,6 +310,8 @@ static void update_settings(struct btd_adapter *adapter, uint32_t settings)
 	uint8_t on_mode;
 	uint16_t index, discoverable_timeout;
 
+	DBG("new settings %x", settings);
+
 	btd_adapter_get_mode(adapter, NULL, &on_mode, &discoverable_timeout,
 								&pairable);
 
-- 
1.7.9.1



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

* [PATCH 3/3] mgmtops: Use DBG not error for printing name in read_info_complete
  2012-03-05 19:05 [PATCH 1/3] mgmtops: When settings discoverable also set connectable if not set yet Szymon Janc
  2012-03-05 19:05 ` [PATCH 2/3] mgmtops: Add debug print to update_settings Szymon Janc
@ 2012-03-05 19:05 ` Szymon Janc
  2012-03-05 19:36 ` [PATCH 1/3] mgmtops: When settings discoverable also set connectable if not set yet Johan Hedberg
  2 siblings, 0 replies; 4+ messages in thread
From: Szymon Janc @ 2012-03-05 19:05 UTC (permalink / raw)
  To: linux-bluetooth; +Cc: Szymon Janc

This is debug not an error message.
---
 plugins/mgmtops.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/plugins/mgmtops.c b/plugins/mgmtops.c
index 4970b7c..4aa38fe 100644
--- a/plugins/mgmtops.c
+++ b/plugins/mgmtops.c
@@ -1083,7 +1083,7 @@ static void read_info_complete(int sk, uint16_t index, void *buf, size_t len)
 
 	name = btd_adapter_get_name(adapter);
 
-	error("mgmtops setting name %s", name);
+	DBG("mgmtops setting name %s", name);
 
 	if (name)
 		mgmt_set_name(index, name);
-- 
1.7.9.1



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

* Re: [PATCH 1/3] mgmtops: When settings discoverable also set connectable if not set yet
  2012-03-05 19:05 [PATCH 1/3] mgmtops: When settings discoverable also set connectable if not set yet Szymon Janc
  2012-03-05 19:05 ` [PATCH 2/3] mgmtops: Add debug print to update_settings Szymon Janc
  2012-03-05 19:05 ` [PATCH 3/3] mgmtops: Use DBG not error for printing name in read_info_complete Szymon Janc
@ 2012-03-05 19:36 ` Johan Hedberg
  2 siblings, 0 replies; 4+ messages in thread
From: Johan Hedberg @ 2012-03-05 19:36 UTC (permalink / raw)
  To: Szymon Janc; +Cc: linux-bluetooth

Hi Szymon,

On Mon, Mar 05, 2012, Szymon Janc wrote:
> Otherwise command would be rejected e.g. when setting discoverable at
> bluetoothd startup.
> ---
>  plugins/mgmtops.c |    9 ++++++---
>  1 files changed, 6 insertions(+), 3 deletions(-)

All three patches have been applied. Thanks.

Johan

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

end of thread, other threads:[~2012-03-05 19:36 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-03-05 19:05 [PATCH 1/3] mgmtops: When settings discoverable also set connectable if not set yet Szymon Janc
2012-03-05 19:05 ` [PATCH 2/3] mgmtops: Add debug print to update_settings Szymon Janc
2012-03-05 19:05 ` [PATCH 3/3] mgmtops: Use DBG not error for printing name in read_info_complete Szymon Janc
2012-03-05 19:36 ` [PATCH 1/3] mgmtops: When settings discoverable also set connectable if not set yet 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).