summaryrefslogtreecommitdiff
path: root/src/bluez-manager
diff options
context:
space:
mode:
authorThomas Haller <thaller@redhat.com>2013-10-02 22:47:31 +0200
committerThomas Haller <thaller@redhat.com>2013-10-18 19:56:37 +0200
commitb3ec1587d353666b93bc51f036f19dcf9209ffcd (patch)
treedbf0e6985485b40c781f593d7ca9c0277dab5c73 /src/bluez-manager
parente46722b72b7d0ac03ab0be24f20c6a86d7300c13 (diff)
downloadNetworkManager-b3ec1587d353666b93bc51f036f19dcf9209ffcd.tar.gz
bluez: rename variables in nm-bluez-common.h for BlueZ 4 vs. 5
Signed-off-by: Thomas Haller <thaller@redhat.com>
Diffstat (limited to 'src/bluez-manager')
-rw-r--r--src/bluez-manager/nm-bluez-common.h24
-rw-r--r--src/bluez-manager/nm-bluez-device.c20
-rw-r--r--src/bluez-manager/nm-bluez-manager.c6
-rw-r--r--src/bluez-manager/nm-bluez4-adapter.c2
-rw-r--r--src/bluez-manager/nm-bluez4-manager.c2
5 files changed, 27 insertions, 27 deletions
diff --git a/src/bluez-manager/nm-bluez-common.h b/src/bluez-manager/nm-bluez-common.h
index ecc4d70947..f80cfc2e39 100644
--- a/src/bluez-manager/nm-bluez-common.h
+++ b/src/bluez-manager/nm-bluez-common.h
@@ -31,21 +31,15 @@
#define BLUEZ_MANAGER_PATH "/"
#define OBJECT_MANAGER_INTERFACE "org.freedesktop.DBus.ObjectManager"
-#if ! WITH_BLUEZ4
-
-#define BLUEZ_ADAPTER_INTERFACE "org.bluez.Adapter1"
-#define BLUEZ_DEVICE_INTERFACE "org.bluez.Device1"
-#define BLUEZ_NETWORK_INTERFACE "org.bluez.Network1"
-
-#else
-
-#define BLUEZ_MANAGER_INTERFACE "org.bluez.Manager"
-#define BLUEZ_ADAPTER_INTERFACE "org.bluez.Adapter"
-#define BLUEZ_DEVICE_INTERFACE "org.bluez.Device"
-#define BLUEZ_SERIAL_INTERFACE "org.bluez.Serial"
-#define BLUEZ_NETWORK_INTERFACE "org.bluez.Network"
-
-#endif /* WITH_BLUEZ */
+#define BLUEZ5_ADAPTER_INTERFACE "org.bluez.Adapter1"
+#define BLUEZ5_DEVICE_INTERFACE "org.bluez.Device1"
+#define BLUEZ5_NETWORK_INTERFACE "org.bluez.Network1"
+
+#define BLUEZ4_MANAGER_INTERFACE "org.bluez.Manager"
+#define BLUEZ4_ADAPTER_INTERFACE "org.bluez.Adapter"
+#define BLUEZ4_DEVICE_INTERFACE "org.bluez.Device"
+#define BLUEZ4_SERIAL_INTERFACE "org.bluez.Serial"
+#define BLUEZ4_NETWORK_INTERFACE "org.bluez.Network"
#endif /* NM_BLUEZ_COMMON_H */
diff --git a/src/bluez-manager/nm-bluez-device.c b/src/bluez-manager/nm-bluez-device.c
index c333796527..53fd994ce3 100644
--- a/src/bluez-manager/nm-bluez-device.c
+++ b/src/bluez-manager/nm-bluez-device.c
@@ -427,15 +427,18 @@ nm_bluez_device_disconnect (NMBluezDevice *self)
{
NMBluezDevicePrivate *priv = NM_BLUEZ_DEVICE_GET_PRIVATE (self);
GVariant *args = NULL;
- const char *dbus_iface = BLUEZ_NETWORK_INTERFACE;
+ const char *dbus_iface;
g_return_if_fail (priv->dbus_connection);
#if ! WITH_BLUEZ4
g_return_if_fail (priv->connection_bt_type == NM_BT_CAPABILITY_NAP);
+
+ dbus_iface = BLUEZ5_NETWORK_INTERFACE;
#else
g_return_if_fail (priv->connection_bt_type == NM_BT_CAPABILITY_NAP || priv->connection_bt_type == NM_BT_CAPABILITY_DUN);
+ dbus_iface = BLUEZ4_NETWORK_INTERFACE;
if (priv->connection_bt_type == NM_BT_CAPABILITY_DUN) {
/* Can't pass a NULL interface name through dbus to bluez, so just
* ignore the disconnect if the interface isn't known.
@@ -444,7 +447,7 @@ nm_bluez_device_disconnect (NMBluezDevice *self)
return;
args = g_variant_new ("(s)", priv->bt_iface),
- dbus_iface = BLUEZ_SERIAL_INTERFACE;
+ dbus_iface = BLUEZ4_SERIAL_INTERFACE;
}
#endif
@@ -504,17 +507,20 @@ nm_bluez_device_connect_async (NMBluezDevice *self,
{
GSimpleAsyncResult *simple;
NMBluezDevicePrivate *priv = NM_BLUEZ_DEVICE_GET_PRIVATE (self);
- const char *dbus_iface = BLUEZ_NETWORK_INTERFACE;
+ const char *dbus_iface;
const char *connect_type = BLUETOOTH_CONNECT_NAP;
g_return_if_fail (priv->capabilities & connection_bt_type & (NM_BT_CAPABILITY_DUN | NM_BT_CAPABILITY_NAP));
#if ! WITH_BLUEZ4
g_return_if_fail (connection_bt_type == NM_BT_CAPABILITY_NAP);
+
+ dbus_iface = BLUEZ5_NETWORK_INTERFACE;
#else
g_return_if_fail (connection_bt_type == NM_BT_CAPABILITY_NAP || connection_bt_type == NM_BT_CAPABILITY_DUN);
+ dbus_iface = BLUEZ4_NETWORK_INTERFACE;
if (connection_bt_type == NM_BT_CAPABILITY_DUN) {
- dbus_iface = BLUEZ_SERIAL_INTERFACE;
+ dbus_iface = BLUEZ4_SERIAL_INTERFACE;
connect_type = BLUETOOTH_CONNECT_DUN;
}
#endif
@@ -844,7 +850,7 @@ query_properties (NMBluezDevice *self)
NULL,
BLUEZ_SERVICE,
g_variant_get_string (v, NULL),
- BLUEZ_ADAPTER_INTERFACE,
+ BLUEZ5_ADAPTER_INTERFACE,
NULL,
(GAsyncReadyCallback) on_adapter_acquired,
g_object_ref (self));
@@ -1015,7 +1021,7 @@ nm_bluez_device_new (const char *path, NMConnectionProvider *provider)
NULL,
BLUEZ_SERVICE,
priv->path,
- BLUEZ_DEVICE_INTERFACE,
+ BLUEZ5_DEVICE_INTERFACE,
NULL,
(GAsyncReadyCallback) on_proxy_acquired,
self);
@@ -1025,7 +1031,7 @@ nm_bluez_device_new (const char *path, NMConnectionProvider *provider)
priv->proxy4 = dbus_g_proxy_new_for_name (connection,
BLUEZ_SERVICE,
priv->path,
- BLUEZ_DEVICE_INTERFACE);
+ BLUEZ4_DEVICE_INTERFACE);
dbus_g_object_register_marshaller (g_cclosure_marshal_generic,
G_TYPE_NONE,
diff --git a/src/bluez-manager/nm-bluez-manager.c b/src/bluez-manager/nm-bluez-manager.c
index 4c375c12f7..0f72a06d10 100644
--- a/src/bluez-manager/nm-bluez-manager.c
+++ b/src/bluez-manager/nm-bluez-manager.c
@@ -192,7 +192,7 @@ object_manager_g_signal (GDBusProxy *proxy,
ifaces = g_variant_get_strv (variant, &length);
for (i = 0; i < length; i++) {
- if (!strcmp (ifaces[i], BLUEZ_DEVICE_INTERFACE)) {
+ if (!strcmp (ifaces[i], BLUEZ5_DEVICE_INTERFACE)) {
device_removed (proxy, path, self);
break;
}
@@ -203,7 +203,7 @@ object_manager_g_signal (GDBusProxy *proxy,
} else if (!strcmp (signal_name, "InterfacesAdded")) {
g_variant_get (parameters, "(&o*)", &path, &variant);
- if (g_variant_lookup_value (variant, BLUEZ_DEVICE_INTERFACE,
+ if (g_variant_lookup_value (variant, BLUEZ5_DEVICE_INTERFACE,
G_VARIANT_TYPE_DICTIONARY))
device_added (proxy, path, self);
}
@@ -233,7 +233,7 @@ get_managed_objects_cb (GDBusProxy *proxy,
}
g_variant_iter_init (&i, g_variant_get_child_value (variant, 0));
while ((g_variant_iter_next (&i, "{&o*}", &path, &ifaces))) {
- if (g_variant_lookup_value (ifaces, BLUEZ_DEVICE_INTERFACE,
+ if (g_variant_lookup_value (ifaces, BLUEZ5_DEVICE_INTERFACE,
G_VARIANT_TYPE_DICTIONARY)) {
device_added (proxy, path, self);
}
diff --git a/src/bluez-manager/nm-bluez4-adapter.c b/src/bluez-manager/nm-bluez4-adapter.c
index e9f806f71b..182ee10bed 100644
--- a/src/bluez-manager/nm-bluez4-adapter.c
+++ b/src/bluez-manager/nm-bluez4-adapter.c
@@ -246,7 +246,7 @@ nm_bluez_adapter_new (const char *path, NMConnectionProvider *provider)
priv->proxy = dbus_g_proxy_new_for_name (connection,
BLUEZ_SERVICE,
priv->path,
- BLUEZ_ADAPTER_INTERFACE);
+ BLUEZ4_ADAPTER_INTERFACE);
dbus_g_proxy_add_signal (priv->proxy, "DeviceCreated",
DBUS_TYPE_G_OBJECT_PATH, G_TYPE_INVALID);
diff --git a/src/bluez-manager/nm-bluez4-manager.c b/src/bluez-manager/nm-bluez4-manager.c
index 882028cd04..bf06312d24 100644
--- a/src/bluez-manager/nm-bluez4-manager.c
+++ b/src/bluez-manager/nm-bluez4-manager.c
@@ -226,7 +226,7 @@ bluez_connect (NMBluezManager *self)
priv->proxy = dbus_g_proxy_new_for_name (connection,
BLUEZ_SERVICE,
BLUEZ_MANAGER_PATH,
- BLUEZ_MANAGER_INTERFACE);
+ BLUEZ4_MANAGER_INTERFACE);
dbus_g_proxy_add_signal (priv->proxy, "AdapterRemoved",
DBUS_TYPE_G_OBJECT_PATH, G_TYPE_INVALID);