summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorMarcel Holtmann <marcel@holtmann.org>2008-12-12 23:06:02 +0100
committerMarcel Holtmann <marcel@holtmann.org>2008-12-12 23:06:02 +0100
commita1953b25126c327c1bbfeb351b8649c1c1f82c0a (patch)
treeb6fa06356b97f32e40236a1a494534d520a97208 /test
parentb44bcd75905003183c1d5d352315b8a0f3f10e34 (diff)
downloadconnman-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.am2
-rwxr-xr-xtest/monitor-connman23
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()