summary refs log tree commit diff
path: root/libnm-glib/nm-device-bt.c
diff options
context:
space:
mode:
authorMichael Biebl <biebl@debian.org>2014-07-06 02:16:10 +0200
committerMichael Biebl <biebl@debian.org>2014-07-06 02:16:10 +0200
commit33491bc4279481db8ae47213e34a6d695a0e8830 (patch)
tree097d2b0fdff3fae6885381ae5e57a182cd8cbbba /libnm-glib/nm-device-bt.c
parent59c3714a494c3b3765657c0551ad82842d98a7d2 (diff)
Imported Upstream version 0.9.10.0 upstream/0.9.10.0
Diffstat (limited to 'libnm-glib/nm-device-bt.c')
-rw-r--r--libnm-glib/nm-device-bt.c28
1 files changed, 16 insertions, 12 deletions
diff --git a/libnm-glib/nm-device-bt.c b/libnm-glib/nm-device-bt.c
index ccfa83ca..4c39ad04 100644
--- a/libnm-glib/nm-device-bt.c
+++ b/libnm-glib/nm-device-bt.c
@@ -55,10 +55,6 @@ enum {
 	LAST_PROP
 };
 
-#define DBUS_PROP_HW_ADDRESS      "HwAddress"
-#define DBUS_PROP_NAME            "Name"
-#define DBUS_PROP_BT_CAPABILITIES "BtCapabilities"
-
 /**
  * nm_device_bt_error_quark:
  *
@@ -182,8 +178,6 @@ connection_compatible (NMDevice *device, NMConnection *connection, GError **erro
 	NMBluetoothCapabilities dev_caps;
 	NMBluetoothCapabilities bt_type;
 
-	g_return_val_if_fail (error == NULL || *error == NULL, FALSE);
-
 	s_con = nm_connection_get_setting_connection (connection);
 	g_assert (s_con);
 
@@ -226,7 +220,19 @@ connection_compatible (NMDevice *device, NMConnection *connection, GError **erro
 		return FALSE;
 	}
 
-	return TRUE;
+	return NM_DEVICE_CLASS (nm_device_bt_parent_class)->connection_compatible (device, connection, error);
+}
+
+static GType
+get_setting_type (NMDevice *device)
+{
+	return NM_TYPE_SETTING_BLUETOOTH;
+}
+
+static const char *
+get_hw_address (NMDevice *device)
+{
+	return nm_device_bt_get_hw_address (NM_DEVICE_BT (device));
 }
 
 /************************************************************/
@@ -260,11 +266,7 @@ constructed (GObject *object)
 
 	G_OBJECT_CLASS (nm_device_bt_parent_class)->constructed (object);
 
-	priv->proxy = dbus_g_proxy_new_for_name (nm_object_get_connection (NM_OBJECT (object)),
-	                                         NM_DBUS_SERVICE,
-	                                         nm_object_get_path (NM_OBJECT (object)),
-	                                         NM_DBUS_INTERFACE_DEVICE_BLUETOOTH);
-
+	priv->proxy = _nm_object_new_proxy (NM_OBJECT (object), NULL, NM_DBUS_INTERFACE_DEVICE_BLUETOOTH);
 	register_properties (NM_DEVICE_BT (object));
 }
 
@@ -329,6 +331,8 @@ nm_device_bt_class_init (NMDeviceBtClass *bt_class)
 	object_class->finalize = finalize;
 	object_class->get_property = get_property;
 	device_class->connection_compatible = connection_compatible;
+	device_class->get_setting_type = get_setting_type;
+	device_class->get_hw_address = get_hw_address;
 
 	/* properties */