summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorLuiz Augusto von Dentz <luiz.dentz@openbossa.org>2008-09-09 18:10:54 -0300
committerLuiz Augusto von Dentz <luiz.dentz@openbossa.org>2008-09-09 18:10:54 -0300
commitf7637f674bd5a57dde9804d5352a59db16b2ec3b (patch)
tree23edf56aa8e1c7dad60017baa208cdab7b815ea4 /test
parent618258d5f4e43ef2fb2f48f3ab395b9ace045019 (diff)
Update test-discovery.
Diffstat (limited to 'test')
-rwxr-xr-xtest/test-discovery11
1 files changed, 6 insertions, 5 deletions
diff --git a/test/test-discovery b/test/test-discovery
index 874de66f..e45bcc02 100755
--- a/test/test-discovery
+++ b/test/test-discovery
@@ -15,8 +15,9 @@ def device_found(address, properties):
else:
print " %s = %s" % (key, value)
-def discovery_completed():
- mainloop.quit()
+def property_changed(name, value):
+ if (name == "Discovering" and not value):
+ mainloop.quit()
if __name__ == '__main__':
dbus.mainloop.glib.DBusGMainLoop(set_as_default=True)
@@ -33,11 +34,11 @@ if __name__ == '__main__':
dbus_interface = "org.bluez.Adapter",
signal_name = "DeviceFound")
- bus.add_signal_receiver(discovery_completed,
+ bus.add_signal_receiver(property_changed,
dbus_interface = "org.bluez.Adapter",
- signal_name = "DiscoveryCompleted")
+ signal_name = "PropertyChanged")
- adapter.DiscoverDevices()
+ adapter.StartDiscovery()
mainloop = gobject.MainLoop()
mainloop.run()