[gnome-bluetooth/gnome-3-4] lib: Add better debug for Connect/Disconnect
- From: Bastien Nocera <hadess src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-bluetooth/gnome-3-4] lib: Add better debug for Connect/Disconnect
- Date: Tue, 30 Oct 2012 11:21:53 +0000 (UTC)
commit 702e1517bbccaeed37a17e1f22bd6a41ada491c4
Author: Bastien Nocera <hadess hadess net>
Date: Tue Oct 30 12:14:54 2012 +0100
lib: Add better debug for Connect/Disconnect
lib/bluetooth-client.c | 27 +++++++++++++++++++++++++--
1 files changed, 25 insertions(+), 2 deletions(-)
---
diff --git a/lib/bluetooth-client.c b/lib/bluetooth-client.c
index 3b07b67..10e4992 100644
--- a/lib/bluetooth-client.c
+++ b/lib/bluetooth-client.c
@@ -1634,9 +1634,12 @@ connect_callback (GDBusProxy *proxy,
variant = g_dbus_proxy_call_finish (proxy, res, &error);
if (variant == NULL) {
retval = FALSE;
- g_debug ("Connect failed: %s", error->message);
+ g_debug ("Connect failed for %s: %s",
+ g_dbus_proxy_get_object_path (proxy), error->message);
g_error_free (error);
} else {
+ g_debug ("Connect succeeded for %s",
+ g_dbus_proxy_get_object_path (proxy));
g_variant_unref (variant);
retval = TRUE;
}
@@ -1660,8 +1663,14 @@ disconnect_callback (GDBusProxy *proxy,
if (conndata->services == NULL) {
retval = device_call_disconnect_finish (conndata->device, res, &error);
if (retval == FALSE) {
+ g_debug ("Disconnect failed for %s: %s",
+ g_dbus_proxy_get_object_path (G_DBUS_PROXY (conndata->device)),
+ error->message);
g_debug ("Disconnect failed: %s", error->message);
g_error_free (error);
+ } else {
+ g_debug ("Disconnect succeeded for %s",
+ g_dbus_proxy_get_object_path (G_DBUS_PROXY (conndata->device)));
}
} else {
GDBusProxy *service;
@@ -1671,9 +1680,15 @@ disconnect_callback (GDBusProxy *proxy,
variant = g_dbus_proxy_call_finish (proxy, res, &error);
if (variant == NULL) {
retval = FALSE;
- g_debug ("Disconnect failed: %s", error->message);
+ g_debug ("Disconnect failed for %s on %s: %s",
+ g_dbus_proxy_get_object_path (proxy),
+ g_dbus_proxy_get_interface_name (proxy),
+ error->message);
g_error_free (error);
} else {
+ g_debug ("Disconnect succeeded for %s on %s",
+ g_dbus_proxy_get_object_path (proxy),
+ g_dbus_proxy_get_interface_name (proxy));
g_variant_unref (variant);
retval = TRUE;
}
@@ -1834,6 +1849,9 @@ bluetooth_client_connect_service (BluetoothClient *client,
service = get_proxy_for_iface (DEVICE (proxy), iface_name, client);
+ g_debug ("Calling 'Connect' on interface %s for %s",
+ iface_name, g_dbus_proxy_get_object_path (service));
+
g_dbus_proxy_call (G_DBUS_PROXY (service),
"Connect",
NULL,
@@ -1852,6 +1870,9 @@ bluetooth_client_connect_service (BluetoothClient *client,
service = get_proxy_for_iface (conndata->device, conndata->services->data, client);
+ g_debug ("Calling 'Disconnect' on interface %s for %s",
+ (char *) conndata->services->data, g_dbus_proxy_get_object_path (service));
+
conndata->services = g_list_remove (conndata->services, conndata->services->data);
g_dbus_proxy_call (G_DBUS_PROXY (service),
@@ -1863,6 +1884,8 @@ bluetooth_client_connect_service (BluetoothClient *client,
(GAsyncReadyCallback) disconnect_callback,
conndata);
} else if (table == NULL) {
+ g_debug ("Calling device_call_disconnect() for %s",
+ g_dbus_proxy_get_object_path (proxy));
device_call_disconnect (DEVICE (proxy),
NULL,
(GAsyncReadyCallback) disconnect_callback,
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]