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 RequestBrowser(object service, string url)
28 This method gets called when it is required
29 to ask the user to open a website to procceed
32 This can happen if connected to a hotspot portal
33 page without WISPr support.
35 Possible Errors: net.connman.Agent.Error.Canceled
37 dict RequestInput(object service, dict fields)
39 This method gets called when trying to connect to
40 a service and some extra input is required. For
41 example a passphrase or the name of a hidden network.
43 The return value should be a dictionary where the
44 keys are the field names and the values are the
45 actual fields. Alternatively an error indicating that
46 the request got canceled can be returned.
48 Most common return field names are "Name" and of
51 The dictionary arguments contains field names with
52 their input parameters.
54 In case of WISPr credentials requests and if the user
55 prefers to login through the browser by himself, agent
56 will have to return a LaunchBrowser error (see below).
58 Possible Errors: net.connman.Agent.Error.Canceled
59 net.connman.Agent.Error.LaunchBrowser
63 This method gets called to indicate that the agent
64 request failed before a reply was returned.
68 The name of a network. This field will be requested
69 when trying to connect to a hidden network.
73 This field is an alternative to "Name" for WiFi
74 networks and can be used to return the exact binary
75 representation of a network name.
77 Normally returning the "Name" field is the better
82 Identity (username) for EAP authentication methods.
86 The passphrase for authentication. For example a WEP
87 key, a PSK passphrase or a passphrase for EAP
88 authentication methods.
90 string PreviousPassphrase
92 The previous passphrase successfully saved, i.e.
93 which lead to a successfull connection. This field is
94 provided as an informational argument when connecting
95 with it does not work anymore, for instance when it
96 has been changed on the AP. Such argument appears when
97 a RequestInput is raised after a retry.
101 This field requests the use of WPS to get associated.
102 This is an alternate choice against Passphrase when
103 requested service supports WPS. The reply can contain
104 either empty pin, if user wants to use push-button
105 method, or a pin code if user wants to use the pin
110 Username for WISPr authentication. This field will be
111 requested when connecting to a WISPr-enabled hotspot.
115 Password for WISPr authentication. This field will be
116 requested when connecting to a WISPr-enabled hotspot.
118 Arguments string Type
120 Contains the type of a field. For example "psk", "wep"
121 "passphrase", "response", "ssid", "wpspin" or plain
126 Contains the requirement option. Valid values are
127 "mandatory", "optional", "alternate" or
130 The "alternate" value specifies that this field can be
131 returned as an alternative to another one. An example
132 would be the network name or SSID.
134 All "mandatory" fields must be returned, while the
135 "optional" can be returned if available.
137 Nothing needs to be returned for "informational", as it
138 is here only to provide an information so a value is
141 array{string} Alternates
143 Contains the list of alternate field names this
144 field can be represented by.
148 Contains data as a string, relatively to an
149 "informational" argument.
151 Examples Requesting a passphrase for WPA2 network
153 RequestInput("/service1",
154 { "Passphrase" : { "Type" : "psk",
155 "Requirement" : "mandatory"
158 ==> { "Passphrase" : "secret123" }
160 Requesting a passphrase after an error on the previous one:
162 RequestInput("/service1",
163 { "Passphrase" : { "Type" : "psk",
164 "Requirement" : "mandatory"
166 "PreviousPassphrase" :
168 "Requirement : "informational",
169 "Value" : "secret123"
173 Requesting name for hidden network
175 RequestInput("/service2",
176 { "Name" : { "Type" : "string",
177 "Requirement" : "mandatory",
178 "Alternates" : [ "SSID" ]
180 "SSID" : { "Type" : "ssid",
181 "Requirement" : "alternate"
184 ==> { "Name" : "My hidden network" }
186 Requesting a passphrase for a WPA2 network with WPS alternative:
188 RequestInput("/service3",
189 { "Passphrase" : { "Type" : "psk",
190 "Requirement" : "mandatory",
191 "Alternates" : [ "WPS" ]
193 "WPS" : { "Type" : "wpspin",
194 "Requirement" : "alternate"
198 ==> { "WPS" : "123456" }
200 Requesting passphrase for a WPA-Enterprise network:
202 RequestInput("/service4",
203 { "Identity" : { "Type" : "string",
204 "Requirement" : "mandatory"
206 "Passphrase" : { "Type" : "passphrase",
207 "Requirement" : "mandatory"
211 ==> { "Identity" : "alice", "Passphrase": "secret123" }
213 Requesting challenge response for a WPA-Enterprise network:
215 RequestInput("/service4",
216 { "Identity" : { "Type" : "string",
217 "Requirement" : "mandatory"
219 "Passphrase" : { "Type" : "response",
220 "Requirement" : "mandatory"
224 ==> { "Identity" : "bob", "Passphrase": "secret123" }
226 Requesting username and password for a WISPr-enabled hotspot:
228 RequestInput("/service5",
229 { "Username" : { "Type" : "string",
230 "Requirement" : "mandatory"
232 "Password" : { "Type" : "passphrase",
233 "Requirement" : "mandatory"
237 ==> { "Username" : "foo", "Password": "secret" }