summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorMarcel Holtmann <marcel@holtmann.org>2010-01-04 22:42:45 -0800
committerMarcel Holtmann <marcel@holtmann.org>2010-01-04 22:42:45 -0800
commit29b2c9556ff6965d3b688e2ff6483dd8ffd43519 (patch)
treef2ee081afe198b86658f893ef27b6eebf666d163 /test
parent65afea87023cc3e3cec215c6f2f0fa1f1e250040 (diff)
downloadconnman-29b2c9556ff6965d3b688e2ff6483dd8ffd43519.tar.gz
connman-29b2c9556ff6965d3b688e2ff6483dd8ffd43519.tar.bz2
connman-29b2c9556ff6965d3b688e2ff6483dd8ffd43519.zip
Add framework for counter callbacks
Diffstat (limited to 'test')
-rwxr-xr-xtest/test-counter36
1 files changed, 36 insertions, 0 deletions
diff --git a/test/test-counter b/test/test-counter
new file mode 100755
index 00000000..b0173a4a
--- /dev/null
+++ b/test/test-counter
@@ -0,0 +1,36 @@
+#!/usr/bin/python
+
+import gobject
+
+import dbus
+import dbus.service
+import dbus.mainloop.glib
+
+class Counter(dbus.service.Object):
+ @dbus.service.method("org.moblin.connman.Counter",
+ in_signature='', out_signature='')
+ def Release(self):
+ print("Release")
+ mainloop.quit()
+
+ @dbus.service.method("org.moblin.connman.Counter",
+ in_signature='', out_signature='')
+ def Usage(self):
+ print("Usage")
+
+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')
+
+ path = "/test/counter"
+ object = Counter(bus, path)
+
+ manager.RegisterCounter(path, dbus.UInt32(2))
+
+ mainloop = gobject.MainLoop()
+ mainloop.run()
+
+ #manager.UnregisterCounter(path)