summary refs log tree commit diff
path: root/src/devices/bluetooth
diff options
context:
space:
mode:
authorMichael Biebl <biebl@debian.org>2016-03-30 00:56:30 +0200
committerMichael Biebl <biebl@debian.org>2016-03-30 00:56:30 +0200
commitd9c99a29a0d3384c9c3d2adce430f5cb1134ab6a (patch)
treefa41baf72753961e71dd8d5bdbe2b89c9109e4f1 /src/devices/bluetooth
parentc2de0d98ba39e0a1a970d066fd19be786092f376 (diff)
Imported Upstream version 1.1.92 upstream/1.1.92
Diffstat (limited to 'src/devices/bluetooth')
-rw-r--r--src/devices/bluetooth/nm-bluez-device.c5
-rw-r--r--src/devices/bluetooth/nm-bluez-manager.c26
-rw-r--r--src/devices/bluetooth/nm-bluez4-adapter.c2
-rw-r--r--src/devices/bluetooth/nm-bluez5-manager.c4
-rw-r--r--src/devices/bluetooth/nm-bluez5-manager.h2
-rw-r--r--src/devices/bluetooth/nm-device-bt.c14
6 files changed, 32 insertions, 21 deletions
diff --git a/src/devices/bluetooth/nm-bluez-device.c b/src/devices/bluetooth/nm-bluez-device.c
index 71226813..a009746d 100644
--- a/src/devices/bluetooth/nm-bluez-device.c
+++ b/src/devices/bluetooth/nm-bluez-device.c
@@ -246,9 +246,8 @@ pan_connection_check_create (NMBluezDevice *self)
 		priv->pan_connection = added;
 		nm_log_dbg (LOGD_BT, "bluez[%s] added new Bluetooth connection for NAP device: '%s' (%s)", priv->path, id, uuid);
 	} else {
-		nm_log_warn (LOGD_BT, "bluez[%s] couldn't add new Bluetooth connection for NAP device: '%s' (%s): %d / %s",
-		             priv->path, id, uuid, error ? error->code : -1,
-		             (error && error->message) ? error->message : "(unknown)");
+		nm_log_warn (LOGD_BT, "bluez[%s] couldn't add new Bluetooth connection for NAP device: '%s' (%s): %s",
+		             priv->path, id, uuid, error->message);
 		g_clear_error (&error);
 
 	}
diff --git a/src/devices/bluetooth/nm-bluez-manager.c b/src/devices/bluetooth/nm-bluez-manager.c
index f66b5abe..766ecc0a 100644
--- a/src/devices/bluetooth/nm-bluez-manager.c
+++ b/src/devices/bluetooth/nm-bluez-manager.c
@@ -38,6 +38,16 @@
 #include "nm-platform.h"
 #include "nm-dbus-compat.h"
 
+#define _NMLOG_DOMAIN        LOGD_BT
+#define _NMLOG_PREFIX_NAME   "bluez"
+#define _NMLOG(level, ...) \
+    G_STMT_START { \
+        nm_log ((level), _NMLOG_DOMAIN, \
+                "%s" _NM_UTILS_MACRO_FIRST(__VA_ARGS__), \
+                _NMLOG_PREFIX_NAME": " \
+                _NM_UTILS_MACRO_REST(__VA_ARGS__)); \
+    } G_STMT_END
+
 typedef struct {
 	int bluez_version;
 
@@ -146,12 +156,12 @@ manager_bdaddr_added_cb (NMBluez4Manager *bluez_mgr,
 	if (!device)
 		return;
 
-	nm_log_info (LOGD_BT, "BT device %s (%s) added (%s%s%s)",
-	             name,
-	             bdaddr,
-	             has_dun ? "DUN" : "",
-	             has_dun && has_nap ? " " : "",
-	             has_nap ? "NAP" : "");
+	_LOGI ("BT device %s (%s) added (%s%s%s)",
+	       name,
+	       bdaddr,
+	       has_dun ? "DUN" : "",
+	       has_dun && has_nap ? " " : "",
+	       has_nap ? "NAP" : "");
 	g_signal_emit_by_name (self, NM_DEVICE_FACTORY_DEVICE_ADDED, device);
 	g_object_unref (device);
 }
@@ -163,7 +173,7 @@ setup_version_number (NMBluezManager *self, int bluez_version)
 
 	g_return_if_fail (!priv->bluez_version);
 
-	nm_log_info (LOGD_BT, "use BlueZ version %d", bluez_version);
+	_LOGI ("use BlueZ version %d", bluez_version);
 
 	priv->bluez_version = bluez_version;
 
@@ -235,7 +245,7 @@ check_bluez_and_try_setup_final_step (NMBluezManager *self, int bluez_version, c
 		setup_bluez5 (self);
 		break;
 	default:
-		nm_log_dbg (LOGD_BT, "detecting BlueZ version failed: %s", reason);
+		_LOGD ("detecting BlueZ version failed: %s", reason);
 
 		/* cancel current attempts to detect the version. */
 		cleanup_checking (self, FALSE);
diff --git a/src/devices/bluetooth/nm-bluez4-adapter.c b/src/devices/bluetooth/nm-bluez4-adapter.c
index deeebcb6..9d8fd210 100644
--- a/src/devices/bluetooth/nm-bluez4-adapter.c
+++ b/src/devices/bluetooth/nm-bluez4-adapter.c
@@ -203,7 +203,7 @@ get_properties_cb (GObject *proxy, GAsyncResult *result, gpointer user_data)
 
 	properties = g_variant_get_child_value (ret, 0);
 
-	g_variant_lookup (properties, "Address", "s", &priv->address);
+	(void) g_variant_lookup (properties, "Address", "s", &priv->address);
 	if (g_variant_lookup (properties, "Devices", "^ao", &devices)) {
 		for (i = 0; devices[i]; i++)
 			device_created (priv->proxy, devices[i], self);
diff --git a/src/devices/bluetooth/nm-bluez5-manager.c b/src/devices/bluetooth/nm-bluez5-manager.c
index e44e87d8..66d171bf 100644
--- a/src/devices/bluetooth/nm-bluez5-manager.c
+++ b/src/devices/bluetooth/nm-bluez5-manager.c
@@ -213,6 +213,7 @@ get_managed_objects_cb (GDBusProxy *proxy,
 		                            G_VARIANT_TYPE_DICTIONARY)) {
 			device_added (proxy, path, self);
 		}
+		g_variant_unref (ifaces);
 	}
 
 	g_variant_unref (variant);
@@ -231,8 +232,7 @@ on_proxy_acquired (GObject *object,
 	priv->proxy = g_dbus_proxy_new_for_bus_finish (res, &error);
 
 	if (!priv->proxy) {
-		nm_log_warn (LOGD_BT, "Couldn't acquire object manager proxy: %s",
-		             error && error->message ? error->message : "(unknown)");
+		nm_log_warn (LOGD_BT, "Couldn't acquire object manager proxy: %s", error->message);
 		g_clear_error (&error);
 		return;
 	}
diff --git a/src/devices/bluetooth/nm-bluez5-manager.h b/src/devices/bluetooth/nm-bluez5-manager.h
index ae5512f8..1c531090 100644
--- a/src/devices/bluetooth/nm-bluez5-manager.h
+++ b/src/devices/bluetooth/nm-bluez5-manager.h
@@ -1,4 +1,4 @@
-/* -*- Mode: C; tab-width: 5; indent-tabs-mode: t; c-basic-offset: 5 -*- */
+/* -*- Mode: C; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */
 /* NetworkManager -- Network link manager
  *
  * This program is free software; you can redistribute it and/or modify
diff --git a/src/devices/bluetooth/nm-device-bt.c b/src/devices/bluetooth/nm-device-bt.c
index e151b795..eef4ed0a 100644
--- a/src/devices/bluetooth/nm-device-bt.c
+++ b/src/devices/bluetooth/nm-device-bt.c
@@ -20,12 +20,13 @@
 
 #include "nm-default.h"
 
+#include "nm-device-bt.h"
+
 #include <stdio.h>
 #include <string.h>
 
 #include "nm-bluez-common.h"
 #include "nm-bluez-device.h"
-#include "nm-device-bt.h"
 #include "nm-device-private.h"
 #include "ppp-manager/nm-ppp-manager.h"
 #include "nm-setting-connection.h"
@@ -39,6 +40,7 @@
 #include "nm-utils.h"
 #include "nm-bt-error.h"
 #include "nm-bt-enum-types.h"
+#include "nm-platform.h"
 
 #include "nmdbus-device-bt.h"
 
@@ -315,7 +317,8 @@ complete_connection (NMDevice *device,
 		return FALSE;
 	}
 
-	nm_utils_complete_generic (connection,
+	nm_utils_complete_generic (NM_PLATFORM_GET,
+	                           connection,
 	                           NM_SETTING_BLUETOOTH_SETTING_NAME,
 	                           existing_connections,
 	                           preferred,
@@ -497,8 +500,8 @@ modem_ip4_config_result (NMModem *modem,
 
 	if (error) {
 		_LOGW (LOGD_MB | LOGD_IP4 | LOGD_BT,
-		       "retrieving IP4 configuration failed: (%d) %s",
-		       error->code, error->message ? error->message : "(unknown)");
+		       "retrieving IP4 configuration failed: %s",
+		       error->message);
 
 		nm_device_state_changed (device, NM_DEVICE_STATE_FAILED, NM_DEVICE_STATE_REASON_IP_CONFIG_UNAVAILABLE);
 	} else
@@ -728,8 +731,7 @@ bluez_connect_cb (GObject *object,
 	                                         res, &error);
 
 	if (!device) {
-		_LOGW (LOGD_BT, "Error connecting with bluez: %s",
-		       error && error->message ? error->message : "(unknown)");
+		_LOGW (LOGD_BT, "Error connecting with bluez: %s", error->message);
 		g_clear_error (&error);
 
 		nm_device_state_changed (NM_DEVICE (self),