diff options
author | Marcel Holtmann <marcel@holtmann.org> | 2008-11-30 20:00:15 +0100 |
---|---|---|
committer | Marcel Holtmann <marcel@holtmann.org> | 2008-11-30 20:00:15 +0100 |
commit | 26e5560e929d75274e904da7af5152c6a725fd87 (patch) | |
tree | da6034946f0065ed6a9bb94fc553c61b204dfd3b /test/test-manager | |
parent | 8d88431aa83063b5749f7000b4911287d8b08d12 (diff) |
Replace old manager object path
Diffstat (limited to 'test/test-manager')
-rwxr-xr-x | test/test-manager | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/test/test-manager b/test/test-manager index 759b6a48..c6cf5601 100755 --- a/test/test-manager +++ b/test/test-manager @@ -11,17 +11,28 @@ def adapter_added(path): def adapter_removed(path): print "Adapter with path %s removed" % (path) +def default_changed(path): + print "Default adapter is now at path %s" % (path) + if __name__ == "__main__": dbus.mainloop.glib.DBusGMainLoop(set_as_default=True) bus = dbus.SystemBus() - manager = dbus.Interface(bus.get_object('org.bluez', '/org/bluez'), + manager = dbus.Interface(bus.get_object('org.bluez', '/'), 'org.bluez.Manager') manager.connect_to_signal("AdapterAdded", adapter_added) manager.connect_to_signal("AdapterRemoved", adapter_removed) + manager.connect_to_signal("DefaultAdapterChanged", default_changed) + + try: + path = manager.DefaultAdapter() + default_changed(path) + except: + pass + mainloop = gobject.MainLoop() mainloop.run() |