[PATCH v3] storage: Fix Discoverable mode not updated on storage.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Chan-yeol Park <chanyeol.park@xxxxxxxxxxx>

This patch fixes the problem that storage's Discoverable value is
not updated like hciconfig when BlueZ receives the MGMT adapter mode
changed event after DiscoverableTimeout has been expired.

This problem occurs because no longer bluetoothd does not take on
requesting part to disable discoverable when the timer expires.
---
 src/adapter.c |   15 +++++----------
 1 file changed, 5 insertions(+), 10 deletions(-)

diff --git a/src/adapter.c b/src/adapter.c
index 69ec821..7d06633 100644
--- a/src/adapter.c
+++ b/src/adapter.c
@@ -2249,6 +2249,11 @@ static void set_mode_complete(struct btd_adapter *adapter)
 		adapter->mode_sessions = NULL;
 	}
 
+	modestr = mode2str(adapter->mode);
+	write_device_mode(&adapter->bdaddr, modestr);
+
+	DBG("%s", modestr);
+
 	if (adapter->pending_mode == NULL)
 		return;
 
@@ -2273,16 +2278,6 @@ static void set_mode_complete(struct btd_adapter *adapter)
 		g_dbus_send_message(connection, reply);
 	}
 
-	modestr = mode2str(adapter->mode);
-
-	DBG("%s", modestr);
-
-	/* restore if the mode doesn't matches the pending */
-	if (err != 0) {
-		write_device_mode(&adapter->bdaddr, modestr);
-		error("unable to set mode: %s", mode2str(pending->mode));
-	}
-
 	session_unref(pending);
 }
 
-- 
1.7.9.5

--
To unsubscribe from this list: send the line "unsubscribe linux-bluetooth" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Bluez Devel]     [Linux Wireless Networking]     [Linux Wireless Personal Area Networking]     [Linux ATH6KL]     [Linux USB Devel]     [Linux Media Drivers]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Big List of Linux Books]

  Powered by Linux