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.
---
I have already the code for this, but I figured out it could be better to
discuss
and agree on the Peer Agent API first.
Please review,
doc/agent-api.txt | 54 --
1 file changed, 52 insertions(+), 2 deletions(-)
diff --git a/doc/agent-api.txt b/doc/agent-api.txt
index a98343f..65b65a9 100644
--- a/doc/agent-api.txt
+++ b/doc/agent-api.txt
@@ -58,6 +58,24 @@ Methods void Release()
Possible Errors: net.connman.Agent.Error.Canceled
net.connman.Agent.Error.LaunchBrowser
+ dict RequestPeerInput(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 can be returned.
+
+ The dictionary arguments contains field names with
+ their input parameters.
+
+ Possible Errors: net.connman.Agent.Error.Canceled
+
void Cancel()
This method gets called to indicate that the agent
@@ -107,6 +125,9 @@ Fields string Name
method, or a pin code if user wants to use the pin
method.
+ In case of a RequestPeerInput, this field will be set
+ as mandatory.
+
string Username
Username for WISPr authentication. This field will be
@@ -117,11 +138,17 @@ Fieldsstring 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
+ RequestPeerInput.
+
Arguments string Type
Contains the type of a field. For example psk, wep
- passphrase, response, ssid, wpspin or plain
- string.
+ passphrase, response, ssid, wpspin, plain
+ string or boolean.
string Requirement
@@ -254,3 +281,26 @@ Examples Requesting a passphrase for WPA2 network
}
== { Username : foo, Password: secret }
+
+ Requesting a answer about an inconming peer connection:
+
+ RequestPeerInput(/peer3,
+ { AcceptConnection :
+ { Type: boolean,
+ Requirement : mandatory
+ }
+ }
+
+ == { AcceptConnection : false }
+
+ Requesting the WPS details when connecting to a peer:
+
+ RequestPeerInput(/peer4,
+ { WPS:
+ { Type: wpspin,
+ Requirement : mandatory
+ }
+ }
+
+ == { WPS : }
+
--
1.8.5.5
___
connman mailing list
connman@connman.net
https://lists.connman.net/mailman/listinfo/connman