summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorAndrzej Kaczmarek <andrzej.kaczmarek@tieto.com>2012-10-09 13:19:49 +0200
committerJohan Hedberg <johan.hedberg@intel.com>2012-10-09 17:53:05 +0200
commitbe551a275bd4b4f4c1e6430614399bd77f64838f (patch)
treecc0af84307935bc69c41ba4228f8fe8b81adcaa5 /test
parent7251c328399f86e95f8882f81f86e5f3bfa8b0fe (diff)
thermometer: Update test script
Diffstat (limited to 'test')
-rwxr-xr-xtest/test-thermometer16
1 files changed, 8 insertions, 8 deletions
diff --git a/test/test-thermometer b/test/test-thermometer
index 92162640..2ca260f5 100755
--- a/test/test-thermometer
+++ b/test/test-thermometer
@@ -16,9 +16,9 @@ from optparse import OptionParser, make_option
class Watcher(dbus.service.Object):
@dbus.service.method("org.bluez.ThermometerWatcher",
- in_signature="a{sv}", out_signature="")
- def MeasurementReceived(self, measure):
- print(measure["Measurement"], " measurement received")
+ in_signature="oa{sv}", out_signature="")
+ def MeasurementReceived(self, device, measure):
+ print("%s measurement received from %s" % (measure["Measurement"], device))
print("Exponent: ", measure["Exponent"])
print("Mantissa: ", measure["Mantissa"])
print("Unit: ", measure["Unit"])
@@ -66,23 +66,23 @@ if __name__ == "__main__":
adapter = dbus.Interface(bus.get_object("org.bluez", adapter_path),
"org.bluez.Adapter")
+ thermometer_manager = dbus.Interface(bus.get_object("org.bluez",
+ adapter_path), "org.bluez.ThermometerManager")
+
device_path = adapter.FindDevice(options.address)
bus.add_signal_receiver(property_changed, bus_name="org.bluez",
dbus_interface="org.bluez.Thermometer",
signal_name="PropertyChanged")
- thermometer = dbus.Interface(bus.get_object("org.bluez",
- device_path), "org.bluez.Thermometer")
-
path = "/test/watcher"
watcher = Watcher(bus, path)
- thermometer.RegisterWatcher(path)
+ thermometer_manager.RegisterWatcher(path)
if len(args) > 0:
if args[0] == "EnableIntermediateMeasurement":
- thermometer.EnableIntermediateMeasurement(path)
+ thermometer_manager.EnableIntermediateMeasurement(path)
else:
print("unknown command")
sys.exit(1)