diff src/bluetooth/bluetooth.c @ 2882:15754379dbd5

fixed the remove bonding bug and made it thread safe
author Paula Stanciu <paula.stanciu@gmail.com>
date Thu, 07 Aug 2008 20:00:52 +0300
parents a9917a9cde99
children 67d527114af5
line wrap: on
line diff
--- a/src/bluetooth/bluetooth.c	Thu Aug 07 17:19:39 2008 +0300
+++ b/src/bluetooth/bluetooth.c	Thu Aug 07 20:00:52 2008 +0300
@@ -89,6 +89,9 @@
 void bt_about( void )
 {
     printf("about call\n");
+    dbus_g_object_register_marshaller(marshal_VOID__STRING_UINT_INT, G_TYPE_NONE, G_TYPE_STRING, G_TYPE_UINT, G_TYPE_INT, G_TYPE_INVALID);    
+    dbus_g_proxy_call(obj,"RemoveBonding",NULL,G_TYPE_STRING,((DeviceData*)(current_device->data))->address,G_TYPE_INVALID,G_TYPE_INVALID); 
+
 }
 
 void bt_cfg(void)
@@ -127,7 +130,9 @@
 static void remove_bonding()
 {
     dbus_g_object_register_marshaller(marshal_VOID__STRING_UINT_INT, G_TYPE_NONE, G_TYPE_STRING, G_TYPE_UINT, G_TYPE_INT, G_TYPE_INVALID);
-    dbus_g_proxy_call(obj,"RemoveBonding",NULL,G_TYPE_STRING,"00:0D:3C:B1:1C:7A",G_TYPE_INVALID,G_TYPE_INVALID); 
+    g_mutex_lock(bonded_dev_mutex);
+    dbus_g_proxy_call(obj,"RemoveBonding",NULL,G_TYPE_STRING,bonded_dev,G_TYPE_INVALID,G_TYPE_INVALID); 
+    g_mutex_unlock(bonded_dev_mutex);
 
 }
 void refresh_call(void)