sap: retrigger bluetooth GetProperties call
authorGustavo F. Padovan <padovan@profusion.mobi>
Tue, 27 Sep 2011 21:04:15 +0000 (18:04 -0300)
committerDenis Kenzior <denkenz@gmail.com>
Wed, 28 Sep 2011 04:36:23 +0000 (23:36 -0500)
When plugging a SAP capable modem, GetProperties need to be called again
to fetch the SAP Server devices from BlueZ.

plugins/bluetooth.c
plugins/bluetooth.h
plugins/sap.c

index 274d25b..573c7c8 100644 (file)
@@ -900,6 +900,12 @@ static void bluetooth_unref(void)
        g_hash_table_destroy(adapter_address_hash);
 }
 
+void bluetooth_get_properties()
+{
+       g_hash_table_foreach(adapter_address_hash,
+                               (GHFunc) get_adapter_properties, NULL);
+}
+
 int bluetooth_register_uuid(const char *uuid, struct bluetooth_profile *profile)
 {
        bluetooth_ref();
index 6cde7bc..936659c 100644 (file)
@@ -52,6 +52,7 @@ struct server;
 
 typedef void (*ConnectFunc)(GIOChannel *io, GError *err, gpointer user_data);
 
+void bluetooth_get_properties();
 int bluetooth_register_uuid(const char *uuid,
                                struct bluetooth_profile *profile);
 void bluetooth_unregister_uuid(const char *uuid);
index 169bb7f..b679ce5 100644 (file)
@@ -66,6 +66,8 @@ int bluetooth_sap_client_register(struct bluetooth_sap_driver *sap,
        sap_hw_modem = modem;
        sap_hw_driver = sap;
 
+       bluetooth_get_properties();
+
        return 0;
 }