[gnome-bluetooth] lib: Don't forget to set the DiscoverableTimeout too



commit b0f7122a4f3df1d026615150abc2770505c41303
Author: Bastien Nocera <hadess hadess net>
Date:   Wed Nov 13 15:17:31 2013 +0100

    lib: Don't forget to set the DiscoverableTimeout too
    
    Otherwise the visibility will reset after 3 minutes by default.

 lib/bluetooth-client.c |   10 ++++++++++
 1 files changed, 10 insertions(+), 0 deletions(-)
---
diff --git a/lib/bluetooth-client.c b/lib/bluetooth-client.c
index d6d5ba2..330c9ed 100644
--- a/lib/bluetooth-client.c
+++ b/lib/bluetooth-client.c
@@ -973,6 +973,16 @@ _bluetooth_client_set_discoverable (BluetoothClient *client,
        if (ret == FALSE) {
                g_warning ("Failed to set Discoverable to %d: %s", discoverable, error->message);
                g_error_free (error);
+       } else {
+               ret = properties_call_set_sync (properties,
+                                               BLUEZ_ADAPTER_INTERFACE,
+                                               "DiscoverableTimeout",
+                                               g_variant_new_variant (g_variant_new_uint32 (timeout)),
+                                               NULL, &error);
+               if (ret == FALSE) {
+                       g_warning ("Failed to set DiscoverableTimeout to %d: %s", timeout, error->message);
+                       g_error_free (error);
+               }
        }
 
        g_object_unref (properties);


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