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.
58 Most common return field names are "Name" and of
61 The dictionary arguments contains field names with
62 their input parameters.
64 In case of WISPr credentials requests and if the user
65 prefers to login through the browser by himself, agent
66 will have to return a LaunchBrowser error (see below).
68 Possible Errors: net.connman.Agent.Error.Canceled
69 net.connman.Agent.Error.LaunchBrowser
71 dict RequestPeerAuthorization(object peer, dict fields) [experimental]
73 This method gets called when trying to connect to a
74 peer or when an incoming peer connection is requested,
75 for which some extra input is required. In this case,
76 it will only deal with WPS input as well as accepting
77 or rejecting an incoming connection.
79 The return value should be a dictionary where the
80 keys are the field names and the values are the
81 actual fields. Alternatively an error indicating that
82 the request got canceled or rejected can be returned.
84 The dictionary arguments contains field names with
85 their input parameters.
87 Possible Errors: net.connman.Agent.Error.Canceled
88 net.connman.Agent.Error.Rejected
92 This method gets called to indicate that the agent
93 request failed before a reply was returned.
97 The name of a network. This field will be requested
98 when trying to connect to a hidden network.
102 This field is an alternative to "Name" for WiFi
103 networks and can be used to return the exact binary
104 representation of a network name.
106 Normally returning the "Name" field is the better
111 Identity (username) for EAP authentication methods.
115 The passphrase for authentication. For example a WEP
116 key, a PSK passphrase or a passphrase for EAP
117 authentication methods.
119 string PreviousPassphrase
121 The previous passphrase successfully saved, i.e.
122 which led to a successfull connection. This field is
123 provided as an informational argument when connecting
124 with it does not work anymore, for instance when it
125 has been changed on the AP. Such argument appears when
126 a RequestInput is raised after a retry. In case of WPS
127 association through PIN method: when retrying, the
128 previous wpspin will be provided.
132 This field requests the use of WPS to get associated.
133 This is an alternate choice against Passphrase when
134 requested service supports WPS. The reply can contain
135 either empty pin, if user wants to use push-button
136 method, or a pin code if user wants to use the pin
139 In case of a RequestPeerAuthorization, this field will
144 Username for WISPr authentication. This field will be
145 requested when connecting to a WISPr-enabled hotspot.
149 Password for WISPr authentication. This field will be
150 requested when connecting to a WISPr-enabled hotspot.
152 Arguments string Type
154 Contains the type of a field. For example "psk", "wep"
155 "passphrase", "response", "ssid", "wpspin" or plain
160 Contains the requirement option. Valid values are
161 "mandatory", "optional", "alternate" or
164 The "alternate" value specifies that this field can be
165 returned as an alternative to another one. An example
166 would be the network name or SSID.
168 All "mandatory" fields must be returned, while the
169 "optional" ones can be returned if available.
171 Nothing needs to be returned for "informational", as it
172 is here only to provide an information. A value is
175 array{string} Alternates
177 Contains the list of alternate field names this
178 field can be represented by.
182 Contains data as a string, relatively to an
183 "informational" argument.
185 Examples Requesting a passphrase for WPA2 network
187 RequestInput("/service1",
188 { "Passphrase" : { "Type" : "psk",
189 "Requirement" : "mandatory"
192 ==> { "Passphrase" : "secret123" }
194 Requesting a passphrase after an error on the previous one:
196 RequestInput("/service1",
197 { "Passphrase" : { "Type" : "psk",
198 "Requirement" : "mandatory"
200 "PreviousPassphrase" :
202 "Requirement : "informational",
203 "Value" : "secret123"
207 Requesting name for hidden network
209 RequestInput("/service2",
210 { "Name" : { "Type" : "string",
211 "Requirement" : "mandatory",
212 "Alternates" : [ "SSID" ]
214 "SSID" : { "Type" : "ssid",
215 "Requirement" : "alternate"
218 ==> { "Name" : "My hidden network" }
220 Requesting a passphrase for a WPA2 network with WPS alternative:
222 RequestInput("/service3",
223 { "Passphrase" : { "Type" : "psk",
224 "Requirement" : "mandatory",
225 "Alternates" : [ "WPS" ]
227 "WPS" : { "Type" : "wpspin",
228 "Requirement" : "alternate"
232 ==> { "WPS" : "123456" }
234 Requesting a passphrase for a WPA2 network with WPS alternative
235 after an error on the previous one:
237 RequestInput("/service3",
238 { "Passphrase" : { "Type" : "psk",
239 "Requirement" : "mandatory",
240 "Alternates" : [ "WPS" ]
242 "WPS" : { "Type" : "wpspin",
243 "Requirement" : "alternate"
245 "PreviousPassphrase" :
247 "Requirement : "informational",
251 Requesting passphrase for a WPA-Enterprise network:
253 RequestInput("/service4",
254 { "Identity" : { "Type" : "string",
255 "Requirement" : "mandatory"
257 "Passphrase" : { "Type" : "passphrase",
258 "Requirement" : "mandatory"
262 ==> { "Identity" : "alice", "Passphrase": "secret123" }
264 Requesting challenge response for a WPA-Enterprise network:
266 RequestInput("/service4",
267 { "Identity" : { "Type" : "string",
268 "Requirement" : "mandatory"
270 "Passphrase" : { "Type" : "response",
271 "Requirement" : "mandatory"
275 ==> { "Identity" : "bob", "Passphrase": "secret123" }
277 Requesting username and password for a WISPr-enabled hotspot:
279 RequestInput("/service5",
280 { "Username" : { "Type" : "string",
281 "Requirement" : "mandatory"
283 "Password" : { "Type" : "passphrase",
284 "Requirement" : "mandatory"
288 ==> { "Username" : "foo", "Password": "secret" }
290 Requesting a answer about an inconming peer connection:
292 RequestPeerAuthorization("/peer3", {})
296 Requesting the WPS details when connecting to a peer:
298 RequestPeerAuthorization("/peer4",
301 "Requirement" : "mandatory"