This method will be used to handle extra input which might be requested
when connecting to a peer or in case a peer wants to connect to us.
---

- v3: Added the method ReportPeerError()

- v2: Moved towards RequestPeerAuthorization name. Input could mean that much
      more fields could appear at some point but this will never happen.
      Added the Rejected Error, it's much nicer to reject an incoming connection

 doc/agent-api.txt | 61 +++++++++++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 61 insertions(+)

diff --git a/doc/agent-api.txt b/doc/agent-api.txt
index a98343f..a4db44b 100644
--- a/doc/agent-api.txt
+++ b/doc/agent-api.txt
@@ -23,6 +23,16 @@ Methods              void Release()
 
                        Possible Errors: net.connman.Agent.Error.Retry
 
+               void ReportPeerError(object peer, string error)
+
+                       This method gets called when an error has to be
+                       reported to the user about a peer connection.
+
+                       A special return value can be used to trigger a
+                       retry of the failed transaction.
+
+                       Possible Errors: net.connman.Agent.Error.Retry
+
                void RequestBrowser(object service, string url)
 
                        This method gets called when it is required
@@ -58,6 +68,25 @@ Methods              void Release()
                        Possible Errors: net.connman.Agent.Error.Canceled
                                         net.connman.Agent.Error.LaunchBrowser
 
+               dict RequestPeerAuthorization(object peer, dict fields)
+
+                       This method gets called when trying to connect to a
+                       peer or when an incoming peer connection is requested,
+                       for which some extra input is required. In this case,
+                       it will only deal with WPS input as well as accepting
+                       or rejecting an incoming connection.
+
+                       The return value should be a dictionary where the
+                       keys are the field names and the values are the
+                       actual fields. Alternatively an error indicating that
+                       the request got canceled or rejected can be returned.
+
+                       The dictionary arguments contains field names with
+                       their input parameters.
+
+                       Possible Errors: net.connman.Agent.Error.Canceled
+                                        net.connman.Agent.Error.Rejected
+
                void Cancel()
 
                        This method gets called to indicate that the agent
@@ -107,6 +136,9 @@ Fields              string Name
                        method, or a pin code if user wants to use the pin
                        method.
 
+                       In case of a RequestPeerAuthorization, this field will
+                       be set as mandatory.
+
                string Username
 
                        Username for WISPr authentication. This field will be
@@ -117,6 +149,12 @@ Fields             string Name
                        Password for WISPr authentication. This field will be
                        requested when connecting to a WISPr-enabled hotspot.
 
+               string AcceptConnection
+
+                       The answer about an incoming peer connection. This
+                       field will be requested only in this situation through
+                       RequestPeerAuthorization.
+
 Arguments      string Type
 
                        Contains the type of a field. For example "psk", "wep"
@@ -254,3 +292,26 @@ Examples   Requesting a passphrase for WPA2 network
                                }
 
                        ==> { "Username" : "foo", "Password": "secret" }
+
+               Requesting a answer about an inconming peer connection:
+
+                       RequestPeerAuthorization("/peer3",
+                               { "AcceptConnection" :
+                                       { "Type"        : "string",
+                                         "Requirement" : "mandatory"
+                                       }
+                               }
+
+                       ==> { "AcceptConnection" : "" }
+
+               Requesting the WPS details when connecting to a peer:
+
+                       RequestPeerAuthorization("/peer4",
+                               { "WPS":
+                                       { "Type"        : "wpspin",
+                                         "Requirement" : "mandatory"
+                                       }
+                               }
+
+                       ==> { "WPS" : "" }
+
-- 
1.8.5.5

_______________________________________________
connman mailing list
connman@connman.net
https://lists.connman.net/mailman/listinfo/connman

Reply via email to