-EXTRA_DIST = list-interfaces start-scanning
+EXTRA_DIST = list-interfaces start-scanning simple-agent
MAINTAINERCLEANFILES = Makefile.in
--- /dev/null
+#!/usr/bin/python
+
+import gobject
+
+import dbus
+import dbus.service
+import dbus.mainloop.glib
+
+class Agent(dbus.service.Object):
+ @dbus.service.method("org.freedesktop.connman.Agent",
+ in_signature='', out_signature='')
+ def Release(self):
+ print("Release")
+ mainloop.quit()
+
+if __name__ == '__main__':
+ dbus.mainloop.glib.DBusGMainLoop(set_as_default=True)
+
+ bus = dbus.SystemBus()
+ manager = dbus.Interface(bus.get_object('org.freedesktop.connman', "/"),
+ 'org.freedesktop.connman.Manager')
+
+ path = "/test/agent"
+ object = Agent(bus, path)
+
+ manager.RegisterAgent(path)
+
+ mainloop = gobject.MainLoop()
+ mainloop.run()
+
+ #manager.UnregisterAgent(path)