From: Patrik Flykt <[email protected]>

simple-agent receives the ReportError method call and prompts whether to
retry the service.
---
 test/simple-agent |   15 +++++++++++++++
 1 files changed, 15 insertions(+), 0 deletions(-)

diff --git a/test/simple-agent b/test/simple-agent
index 54e857a..859d403 100755
--- a/test/simple-agent
+++ b/test/simple-agent
@@ -33,6 +33,21 @@ class Agent(dbus.service.Object):
                return response
 
        @dbus.service.method("net.connman.Agent",
+                                       in_signature='os',
+                                       out_signature='')
+       def ReportError(self, path, error):
+               print "ReportError %s, %s" % (path, error)
+               retry = raw_input("Retry service (yes/no): ")
+               if (retry == "yes"):
+                       class Retry(dbus.DBusException):
+                               _dbus_error_name = 
"net.connman.Agent.Error.Retry"
+
+                       raise Retry("retry service")
+               else:
+                       return
+
+
+       @dbus.service.method("net.connman.Agent",
                                        in_signature='', out_signature='')
        def Cancel(self):
                print "Cancel"
-- 
1.7.2.3

_______________________________________________
connman mailing list
[email protected]
http://lists.connman.net/listinfo/connman

Reply via email to