5 Interface net.connman.Agent
6 Object path freely definable
10 This method gets called when the service daemon
11 unregisters the agent. An agent can use it to do
12 cleanup tasks. There is no need to unregister the
13 agent, because when this method gets called it has
14 already been unregistered.
16 void ReportError(object service, string error)
18 This method gets called when an error has to be
21 A special return value can be used to trigger a
22 retry of the failed transaction.
24 Possible Errors: net.connman.Agent.Error.Retry
26 void ReportPeerError(object peer, string error)
28 This method gets called when an error has to be
29 reported to the user about a peer connection.
31 A special return value can be used to trigger a
32 retry of the failed transaction.
34 Possible Errors: net.connman.Agent.Error.Retry
36 void RequestBrowser(object service, string url)
38 This method gets called when it is required
39 to ask the user to open a website to procceed
42 This can happen if connected to a hotspot portal
43 page without WISPr support.
45 Possible Errors: net.connman.Agent.Error.Canceled
47 dict RequestInput(object service, dict fields)
49 This method gets called when trying to connect to
50 a service and some extra input is required. For
51 example a passphrase or the name of a hidden network.
53 The return value should be a dictionary where the
54 keys are the field names and the values are the
55 actual fields. Alternatively an error indicating that
56 the request got canceled can be returned.
57 OperationAborted will be return on a successfull
60 Most common return field names are "Name" and of
63 The dictionary arguments contains field names with
64 their input parameters.
66 In case of WISPr credentials requests and if the user
67 prefers to login through the browser by himself, agent
68 will have to return a LaunchBrowser error (see below).
70 Possible Errors: net.connman.Agent.Error.Canceled
71 net.connman.Agent.Error.LaunchBrowser
73 dict RequestPeerAuthorization(object peer, dict fields) [experimental]
75 This method gets called when trying to connect to a
76 peer or when an incoming peer connection is requested,
77 for which some extra input is required. In this case,
78 it will only deal with WPS input as well as accepting
79 or rejecting an incoming connection.
81 The return value should be a dictionary where the
82 keys are the field names and the values are the
83 actual fields. Alternatively an error indicating that
84 the request got canceled or rejected can be returned.
86 The dictionary arguments contains field names with
87 their input parameters.
89 Possible Errors: net.connman.Agent.Error.Canceled
90 net.connman.Agent.Error.Rejected
94 This method gets called to indicate that the agent
95 request failed before a reply was returned.
99 The name of a network. This field will be requested
100 when trying to connect to a hidden network.
104 This field is an alternative to "Name" for WiFi
105 networks and can be used to return the exact binary
106 representation of a network name.
108 Normally returning the "Name" field is the better
113 Identity (username) for EAP authentication methods.
117 The passphrase for authentication. For example a WEP
118 key, a PSK passphrase or a passphrase for EAP
119 authentication methods.
121 string PreviousPassphrase
123 The previous passphrase successfully saved, i.e.
124 which led to a successfull connection. This field is
125 provided as an informational argument when connecting
126 with it does not work anymore, for instance when it
127 has been changed on the AP. Such argument appears when
128 a RequestInput is raised after a retry. In case of WPS
129 association through PIN method: when retrying, the
130 previous wpspin will be provided.
134 This field requests the use of WPS to get associated.
135 This is an alternate choice against Passphrase when
136 requested service supports WPS. The reply can contain
137 either empty pin, if user wants to use push-button
138 method, or a pin code if user wants to use the pin
141 In case of a RequestPeerAuthorization, this field will
146 Username for WISPr authentication. This field will be
147 requested when connecting to a WISPr-enabled hotspot.
151 Password for WISPr authentication. This field will be
152 requested when connecting to a WISPr-enabled hotspot.
154 Arguments string Type
156 Contains the type of a field. For example "psk", "wep"
157 "passphrase", "response", "ssid", "wpspin" or plain
162 Contains the requirement option. Valid values are
163 "mandatory", "optional", "alternate" or
166 The "alternate" value specifies that this field can be
167 returned as an alternative to another one. An example
168 would be the network name or SSID.
170 All "mandatory" fields must be returned, while the
171 "optional" ones can be returned if available.
173 Nothing needs to be returned for "informational", as it
174 is here only to provide an information. A value is
177 array{string} Alternates
179 Contains the list of alternate field names this
180 field can be represented by.
184 Contains data as a string, relatively to an
185 "informational" argument.
187 Examples Requesting a passphrase for WPA2 network
189 RequestInput("/service1",
190 { "Passphrase" : { "Type" : "psk",
191 "Requirement" : "mandatory"
194 ==> { "Passphrase" : "secret123" }
196 Requesting a passphrase after an error on the previous one:
198 RequestInput("/service1",
199 { "Passphrase" : { "Type" : "psk",
200 "Requirement" : "mandatory"
202 "PreviousPassphrase" :
204 "Requirement : "informational",
205 "Value" : "secret123"
209 Requesting name for hidden network
211 RequestInput("/service2",
212 { "Name" : { "Type" : "string",
213 "Requirement" : "mandatory",
214 "Alternates" : [ "SSID" ]
216 "SSID" : { "Type" : "ssid",
217 "Requirement" : "alternate"
220 ==> { "Name" : "My hidden network" }
222 Requesting a passphrase for a WPA2 network with WPS alternative:
224 RequestInput("/service3",
225 { "Passphrase" : { "Type" : "psk",
226 "Requirement" : "mandatory",
227 "Alternates" : [ "WPS" ]
229 "WPS" : { "Type" : "wpspin",
230 "Requirement" : "alternate"
234 ==> { "WPS" : "123456" }
236 Requesting a passphrase for a WPA2 network with WPS alternative
237 after an error on the previous one:
239 RequestInput("/service3",
240 { "Passphrase" : { "Type" : "psk",
241 "Requirement" : "mandatory",
242 "Alternates" : [ "WPS" ]
244 "WPS" : { "Type" : "wpspin",
245 "Requirement" : "alternate"
247 "PreviousPassphrase" :
249 "Requirement : "informational",
253 Requesting passphrase for a WPA-Enterprise network:
255 RequestInput("/service4",
256 { "Identity" : { "Type" : "string",
257 "Requirement" : "mandatory"
259 "Passphrase" : { "Type" : "passphrase",
260 "Requirement" : "mandatory"
264 ==> { "Identity" : "alice", "Passphrase": "secret123" }
266 Requesting challenge response for a WPA-Enterprise network:
268 RequestInput("/service4",
269 { "Identity" : { "Type" : "string",
270 "Requirement" : "mandatory"
272 "Passphrase" : { "Type" : "response",
273 "Requirement" : "mandatory"
277 ==> { "Identity" : "bob", "Passphrase": "secret123" }
279 Requesting username and password for a WISPr-enabled hotspot:
281 RequestInput("/service5",
282 { "Username" : { "Type" : "string",
283 "Requirement" : "mandatory"
285 "Password" : { "Type" : "passphrase",
286 "Requirement" : "mandatory"
290 ==> { "Username" : "foo", "Password": "secret" }
292 Requesting a answer about an inconming peer connection:
294 RequestPeerAuthorization("/peer3", {})
298 Requesting the WPS details when connecting to a peer:
300 RequestPeerAuthorization("/peer4",
303 "Requirement" : "mandatory"