diff options
author | Marcel Holtmann <marcel@holtmann.org> | 2008-12-12 23:06:02 +0100 |
---|---|---|
committer | Marcel Holtmann <marcel@holtmann.org> | 2008-12-12 23:06:02 +0100 |
commit | a1953b25126c327c1bbfeb351b8649c1c1f82c0a (patch) | |
tree | b6fa06356b97f32e40236a1a494534d520a97208 /test | |
parent | b44bcd75905003183c1d5d352315b8a0f3f10e34 (diff) | |
download | connman-a1953b25126c327c1bbfeb351b8649c1c1f82c0a.tar.gz connman-a1953b25126c327c1bbfeb351b8649c1c1f82c0a.tar.bz2 connman-a1953b25126c327c1bbfeb351b8649c1c1f82c0a.zip |
Add script to monitor property changes
Diffstat (limited to 'test')
-rw-r--r-- | test/Makefile.am | 2 | ||||
-rwxr-xr-x | test/monitor-connman | 23 |
2 files changed, 24 insertions, 1 deletions
diff --git a/test/Makefile.am b/test/Makefile.am index 1e38effb..e4ea64f7 100644 --- a/test/Makefile.am +++ b/test/Makefile.am @@ -3,6 +3,6 @@ EXTRA_DIST = get-state list-profiles list-connections \ list-devices enable-device disable-device start-scanning \ list-networks select-network disable-network create-network \ set-passphrase simple-agent show-introspection \ - test-manager test-compat + test-manager test-compat monitor-connman MAINTAINERCLEANFILES = Makefile.in diff --git a/test/monitor-connman b/test/monitor-connman new file mode 100755 index 00000000..86c7d42d --- /dev/null +++ b/test/monitor-connman @@ -0,0 +1,23 @@ +#!/usr/bin/python + +import gobject + +import dbus +import dbus.mainloop.glib + +def property_changed(name, value, path): + print "[%s] %s = %s" % (path, name, str(value)) + +if __name__ == '__main__': + dbus.mainloop.glib.DBusGMainLoop(set_as_default=True) + + bus = dbus.SystemBus() + manager = dbus.Interface(bus.get_object("org.moblin.connman", "/"), + "org.moblin.connman.Manager") + + bus.add_signal_receiver(property_changed, + signal_name = "PropertyChanged", + path_keyword="path") + + mainloop = gobject.MainLoop() + mainloop.run() |