[pulseaudio-discuss] [RFC v0 14/15] bluetooth: Update to new property setter API in BlueZ 5
Mikel Astiz
mikel.astiz.oss at gmail.com
Wed Dec 19 04:58:33 PST 2012
From: Mikel Astiz <mikel.astiz at bmw-carit.de>
If BlueZ 5 is in use, the standard org.freedesktop.DBus.Properties needs
to be used instead of the old SetProperty() method.
---
src/modules/bluetooth/bluetooth-util.c | 14 ++++++++++++++
1 file changed, 14 insertions(+)
diff --git a/src/modules/bluetooth/bluetooth-util.c b/src/modules/bluetooth/bluetooth-util.c
index fe4ad03..16aee20 100644
--- a/src/modules/bluetooth/bluetooth-util.c
+++ b/src/modules/bluetooth/bluetooth-util.c
@@ -1548,6 +1548,20 @@ static void set_property(pa_bluetooth_discovery *y, const char *bus, const char
pa_assert(interface);
pa_assert(prop_name);
+ if (y->version >= BLUEZ_VERSION_5) {
+ pa_assert_se(m = dbus_message_new_method_call(bus, path, "org.freedesktop.DBus.Properties", "Set"));
+ dbus_message_iter_init_append(m, &i);
+ dbus_message_iter_append_basic(&i, DBUS_TYPE_STRING, &interface);
+ dbus_message_iter_append_basic(&i, DBUS_TYPE_STRING, &prop_name);
+ pa_dbus_append_basic_variant(&i, prop_type, prop_value);
+
+ dbus_message_set_no_reply(m, true);
+ pa_assert_se(dbus_connection_send(pa_dbus_connection_get(y->connection), m, NULL));
+ dbus_message_unref(m);
+
+ return;
+ }
+
pa_assert_se(m = dbus_message_new_method_call(bus, path, interface, "SetProperty"));
dbus_message_iter_init_append(m, &i);
dbus_message_iter_append_basic(&i, DBUS_TYPE_STRING, &prop_name);
--
1.7.11.7
More information about the pulseaudio-discuss
mailing list