diff options
author | Luiz Augusto von Dentz <luiz.von.dentz@intel.com> | 2012-12-14 11:13:04 +0200 |
---|---|---|
committer | Johan Hedberg <johan.hedberg@intel.com> | 2012-12-14 11:24:28 +0200 |
commit | 4750e35620e7e5444f2e6cba7e73c28d9de58c36 (patch) | |
tree | 3c20fd68a24efe826d6b6394b88313c008ddf334 /test | |
parent | 643ad03cf217ad552530ad4ed5a86a8e322474b3 (diff) | |
download | bluez-4750e35620e7e5444f2e6cba7e73c28d9de58c36.tar.gz |
proximity: Append version to Proximity interfaces
Diffstat (limited to 'test')
-rwxr-xr-x | test/test-proximity | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/test/test-proximity b/test/test-proximity index d6862de3a..0cbf31581 100755 --- a/test/test-proximity +++ b/test/test-proximity @@ -14,8 +14,11 @@ import dbus.mainloop.glib from optparse import OptionParser, make_option import bluezutils +BUS_NAME = 'org.bluez' +PROXIMITY_MONITOR_INTERFACE = 'org.bluez.ProxymityMonitor1' + def properties_changed(interface, changed, invalidated): - if interface != "org.bluez.ProximityMonitor": + if interface != PROXIMITY_MONITOR_INTERFACE: return for name, value in changed.iteritems(): @@ -45,19 +48,19 @@ if __name__ == "__main__": device = bluezutils.find_device(options.address, options.dev_id) device_path = device.object_path - bus.add_signal_receiver(properties_changed, bus_name="org.bluez", + bus.add_signal_receiver(properties_changed, bus_name=BUS_NAME, path=device_path, dbus_interface="org.freedesktop.DBus.Properties", signal_name="PropertiesChanged") - proximity = dbus.Interface(bus.get_object("org.bluez", - device_path), "org.bluez.ProximityMonitor") + proximity = dbus.Interface(bus.get_object(BUS_NAME, device_path), + PROXIMITY_MONITOR_INTERFACE) - device_prop = dbus.Interface(bus.get_object("org.bluez", device_path), + device_prop = dbus.Interface(bus.get_object(BUS_NAME, device_path), "org.freedesktop.DBus.Properties") print("Proximity SetProperty('%s', '%s')" % (args[0], args[1])) - device_prop.Set("org.bluez.ProximityMonitor", args[0], args[1]) + device_prop.Set(PROXIMITY_MONITOR_INTERFACE, args[0], args[1]) mainloop = gobject.MainLoop() mainloop.run() |