summaryrefslogtreecommitdiff
path: root/src/modules/bluetooth/bluez5-util.c
diff options
context:
space:
mode:
authorJoão Paulo Rechi Vita <jprvita@openbossa.org>2013-09-24 19:45:37 -0300
committerTanu Kaskinen <tanu.kaskinen@linux.intel.com>2013-09-29 16:54:37 +0300
commitf65cafe64dbc9c3c2856d3e28827e931bf51f9ed (patch)
tree62eb2612f52bc9a0a9a514c2e487e269f86c92b9 /src/modules/bluetooth/bluez5-util.c
parent82fd8cc845f9366405d0093a1219cd11f521c96d (diff)
downloadpulseaudio-f65cafe64dbc9c3c2856d3e28827e931bf51f9ed.tar.gz
bluetooth: Handle PropertiesChanged for org.bluez.Device1
Diffstat (limited to 'src/modules/bluetooth/bluez5-util.c')
-rw-r--r--src/modules/bluetooth/bluez5-util.c21
1 files changed, 21 insertions, 0 deletions
diff --git a/src/modules/bluetooth/bluez5-util.c b/src/modules/bluetooth/bluez5-util.c
index 17889b61c..0d19091bb 100644
--- a/src/modules/bluetooth/bluez5-util.c
+++ b/src/modules/bluetooth/bluez5-util.c
@@ -936,6 +936,23 @@ static DBusHandlerResult filter_cb(DBusConnection *bus, DBusMessage *m, void *us
}
parse_adapter_properties(a, &arg_i, true);
+
+ } else if (pa_streq(iface, BLUEZ_DEVICE_INTERFACE)) {
+ pa_bluetooth_device *d;
+
+ pa_log_debug("Properties changed in device %s", dbus_message_get_path(m));
+
+ if (!(d = pa_hashmap_get(y->devices, dbus_message_get_path(m)))) {
+ pa_log_warn("Properties changed in unknown device");
+ return DBUS_HANDLER_RESULT_NOT_YET_HANDLED;
+ }
+
+ if (d->device_info_valid != 1) {
+ pa_log_warn("Properties changed in a device which information is unknown or invalid");
+ return DBUS_HANDLER_RESULT_NOT_YET_HANDLED;
+ }
+
+ parse_device_properties(d, &arg_i, true);
}
return DBUS_HANDLER_RESULT_NOT_YET_HANDLED;
@@ -1461,6 +1478,8 @@ pa_bluetooth_discovery* pa_bluetooth_discovery_get(pa_core *c) {
"member='InterfacesRemoved'",
"type='signal',sender='" BLUEZ_SERVICE "',interface='org.freedesktop.DBus.Properties',member='PropertiesChanged'"
",arg0='" BLUEZ_ADAPTER_INTERFACE "'",
+ "type='signal',sender='" BLUEZ_SERVICE "',interface='org.freedesktop.DBus.Properties',member='PropertiesChanged'"
+ ",arg0='" BLUEZ_DEVICE_INTERFACE "'",
NULL) < 0) {
pa_log_error("Failed to add D-Bus matches: %s", err.message);
goto fail;
@@ -1526,6 +1545,8 @@ void pa_bluetooth_discovery_unref(pa_bluetooth_discovery *y) {
"member='InterfacesRemoved'",
"type='signal',sender='" BLUEZ_SERVICE "',interface='org.freedesktop.DBus.Properties',"
"member='PropertiesChanged',arg0='" BLUEZ_ADAPTER_INTERFACE "'",
+ "type='signal',sender='" BLUEZ_SERVICE "',interface='org.freedesktop.DBus.Properties',"
+ "member='PropertiesChanged',arg0='" BLUEZ_DEVICE_INTERFACE "'",
NULL);
if (y->filter_added)