bluetooth: BlueZ 5 interface rename to org.bluez.Media1
authorMikel Astiz <mikel.astiz@bmw-carit.de>
Mon, 29 Apr 2013 16:28:03 +0000 (18:28 +0200)
committerArun Raghavan <arun.raghavan@collabora.co.uk>
Mon, 3 Jun 2013 19:08:41 +0000 (00:38 +0530)
Use the new interface name if BlueZ 5 has been detected.

src/modules/bluetooth/bluetooth-util.c

index 5d5c7abd7b6325ae80078f7e43c5802ae7d7ca93..ff83f53b3b9c9c1c515b09fc7f5bfa1b88daaa6c 100644 (file)
@@ -834,8 +834,7 @@ static void register_endpoint_reply(DBusPendingCall *pending, void *userdata) {
     }
 
     if (dbus_message_get_type(r) == DBUS_MESSAGE_TYPE_ERROR) {
-        pa_log("org.bluez.Media.RegisterEndpoint() failed: %s: %s", dbus_message_get_error_name(r),
-               pa_dbus_get_error_message(r));
+        pa_log("RegisterEndpoint() failed: %s: %s", dbus_message_get_error_name(r), pa_dbus_get_error_message(r));
         goto finish;
     }
 
@@ -852,10 +851,11 @@ static void register_endpoint(pa_bluetooth_discovery *y, const char *path, const
     DBusMessage *m;
     DBusMessageIter i, d;
     uint8_t codec = 0;
+    const char *interface = y->version == BLUEZ_VERSION_4 ? "org.bluez.Media" : "org.bluez.Media1";
 
     pa_log_debug("Registering %s on adapter %s.", endpoint, path);
 
-    pa_assert_se(m = dbus_message_new_method_call("org.bluez", path, "org.bluez.Media", "RegisterEndpoint"));
+    pa_assert_se(m = dbus_message_new_method_call("org.bluez", path, interface, "RegisterEndpoint"));
 
     dbus_message_iter_init_append(m, &i);