From: Kalle Valo Date: Mon, 11 Oct 2010 12:12:10 +0000 (+0300) Subject: simple-agent: update to new agent api X-Git-Tag: accepted/2.0alpha-wayland/20121110.002834~2294 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=05becd265667dd8b48c220f6bb1a936ffc0afeb1;p=profile%2Fivi%2Fconnman.git simple-agent: update to new agent api simple-agent was still using the old agent api and didn't work anymore. Update it to use the new api. --- diff --git a/test/simple-agent b/test/simple-agent index b8e4efc..7e1ce8b 100755 --- a/test/simple-agent +++ b/test/simple-agent @@ -20,24 +20,17 @@ class Agent(dbus.service.Object): mainloop.quit() @dbus.service.method("org.moblin.connman.Agent", - in_signature='o', out_signature='') - def RequestPassphrase(self, path): - print "PassphraseRequested (%s)" % (path) + in_signature='oa{sv}', + out_signature='a{sv}') + def RequestInput(self, path, fields): + print "RequestInput (%s,%s)" % (path, fields) - service = dbus.Interface(bus.get_object("org.moblin.connman", - path), - "org.moblin.connman.Service") + response = {} + response["Passphrase"] = self.passphrase - try: - print "setting passphrase (%s)" % (self.passphrase) + print "returning (%s)" % (response) - service.SetProperty("Passphrase", - dbus.String(self.passphrase, - variant_level=1)) - - service.Connect(timeout=60000) - except dbus.DBusException, error: - print "%s: %s" % (error._dbus_error_name, error.message) + return response @dbus.service.method("org.moblin.connman.Agent", in_signature='', out_signature='')