[PATCH 15/15] test: Update test-thermometer for DBus.Properties

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



---
 test/test-thermometer | 13 +++++++------
 1 file changed, 7 insertions(+), 6 deletions(-)

diff --git a/test/test-thermometer b/test/test-thermometer
index 2ca260f..d56a8b2 100755
--- a/test/test-thermometer
+++ b/test/test-thermometer
@@ -29,9 +29,9 @@ class Watcher(dbus.service.Object):
 		if "Type" in measure:
 			print("Type: ", measure["Type"])
 
-def property_changed(name, value):
-
-	print("PropertyChanged('%s', '%s')" % (name, value))
+def properties_changed(interface, changed, invalidated):
+	for name, value in changed.iteritems():
+		print("Property %s changed:  %s" % (name, str(value)))
 
 if __name__ == "__main__":
 	dbus.mainloop.glib.DBusGMainLoop(set_as_default=True)
@@ -71,9 +71,10 @@ if __name__ == "__main__":
 
 	device_path = adapter.FindDevice(options.address)
 
-	bus.add_signal_receiver(property_changed, bus_name="org.bluez",
-				dbus_interface="org.bluez.Thermometer",
-				signal_name="PropertyChanged")
+	bus.add_signal_receiver(properties_changed, bus_name="org.bluez",
+			path=device_path,
+			dbus_interface="org.freedesktop.DBus.Properties",
+			signal_name="PropertiesChanged")
 
 	path = "/test/watcher"
 	watcher = Watcher(bus, path)
-- 
1.8.0

--
To unsubscribe from this list: send the line "unsubscribe linux-bluetooth" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Bluez Devel]     [Linux Wireless Networking]     [Linux Wireless Personal Area Networking]     [Linux ATH6KL]     [Linux USB Devel]     [Linux Media Drivers]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Big List of Linux Books]

  Powered by Linux