Adding connman-test subpackage
[framework/connectivity/connman.git] / doc / service-api.txt
1 Service hierarchy
2 =================
3
4 Service         net.connman
5 Interface       net.connman.Service
6 Object path     [variable prefix]/{service0,service1,...}
7
8 Methods         dict GetProperties()
9
10                         Returns properties for the service object. See
11                         the properties section for available properties.
12
13                         Possible Errors: [service].Error.InvalidArguments
14
15                 void SetProperty(string name, variant value)
16
17                         Changes the value of the specified property. Only
18                         properties that are listed as read-write are
19                         changeable. On success a PropertyChanged signal
20                         will be emitted.
21
22                         Possible Errors: [service].Error.InvalidArguments
23                                          [service].Error.InvalidProperty
24
25                 void ClearProperty(string name)
26
27                         Clears the value of the specified property.
28
29                         Possible Errors: [service].Error.InvalidArguments
30                                          [service].Error.InvalidProperty
31
32                 void Connect()
33
34                         Connect this service. It will attempt to connect
35                         WiFi, WiMAX or Bluetooth services.
36
37                         For Ethernet devices this method can only be used
38                         if it has previously been disconnected. Otherwise
39                         the plugging of a cable will trigger connecting
40                         automatically. If no cable is plugged in this method
41                         will fail.
42
43                         This method call will only return in case of an
44                         error or when the service is fully connected. So
45                         setting a longer D-Bus timeout might be a really
46                         good idea.
47
48                         Possible Errors: [service].Error.InvalidArguments
49
50                 void Disconnect()
51
52                         Disconnect this service. If the service is not
53                         connected an error message will be generated.
54
55                         On Ethernet devices this will disconnect the IP
56                         details from the service. It will not magically
57                         unplug the cable. When no cable is plugged in this
58                         method will fail.
59
60                         This method can also be used to abort a previous
61                         connectiong attempt via the Connect method.
62
63                         Possible Errors: [service].Error.InvalidArguments
64
65                 void Remove()
66
67                         A successfully connected service with Favorite=true
68                         can be removed this way. If it is connected, it will
69                         be automatically disconnected first.
70
71                         If the service requires a passphrase it will be
72                         cleared and forgotten when removing.
73
74                         This is similar to setting the Favorite property
75                         to false, but that is currently not supported.
76
77                         In the case a connection attempt failed and the
78                         service is in the State=failure, this method can
79                         also be used to reset the service.
80
81                         Calling this method on Ethernet devices will cause
82                         an error message. It is not possible to remove these
83                         kind of devices.
84
85                         Possible Errors: [service].Error.InvalidArguments
86
87                 void MoveBefore(object service)
88
89                         If a service has been used before, this allows a
90                         reorder of the favorite services.
91
92                         The target service object must be part of this
93                         profile. Moving between profiles is not supported.
94
95                         Possible Errors: [service].Error.InvalidArguments
96
97                 void MoveAfter(object service)
98
99                         If a service has been used before, this allows a
100                         reorder of the favorite services.
101
102                         The target service object must be part of this
103                         profile. Moving between profiles is not supported.
104
105                         Possible Errors: [service].Error.InvalidArguments
106
107                 void ResetCounters()
108
109                         Reset the counter statistics.
110
111                         Possible Errors: None
112
113 Signals         PropertyChanged(string name, variant value)
114
115                         This signal indicates a changed value of the given
116                         property.
117
118 Properties      string State [readonly]
119
120                         The service state information.
121
122                         Valid states are "idle", "failure", "association",
123                         "configuration", "ready" and "online".
124
125                         The "ready" state signals a successfully
126                         connected device. "online" signals that an
127                         Internet connection is available and has been
128                         verified.
129
130                 string Error [readonly]
131
132                         The service error status details.
133
134                         When error occur during connection or disconnection
135                         the detailed information is represented in this
136                         property to help the user interface to present the
137                         user with alternate options.
138
139                         This property is only valid when the service is in
140                         the "failure" state. Otherwise it might be empty or
141                         not present at all.
142
143                         Current defined error code is "dhcp-failed".
144
145                 string Name [readonly]
146
147                         The service name (for example "Wireless" etc.)
148
149                         This name can be used for directly displaying it in
150                         the application. It has pure informational purpose.
151
152                         For Ethernet devices and hidden WiFi networks it is
153                         not guaranteed that this property is present.
154
155                 string Type [readonly]
156
157                         The service type (for example "ethernet", "wifi" etc.)
158
159                         This information should only be used to determine
160                         advanced properties or showing the correct icon
161                         to the user.
162
163                 array{string} Security [readonly]
164
165                         If the service type is WiFi, then this property is
166                         present and contains the list of security methods
167                         or key management settings.
168
169                         Possible values are "none", "wep", "psk", "ieee8021x"
170                         and also "wps". Alternate values for "psk" can also
171                         be "wpa" and "rsn".
172
173                         This property might be only present for WiFi
174                         services.
175
176                 boolean LoginRequired [readonly]
177
178                         This property indicates that an additional login
179                         step, like web based authentication, is needed
180                         before the connection establishment can proceed.
181
182                 string Passphrase [readwrite]
183
184                         If the service type is WiFi, then this property
185                         can be used to store a passphrase.
186
187                         No PropertyChanged signals will be sent for this
188                         property. The PassphraseRequired property should
189                         be monitored instead.
190
191                         This property might also not always be included
192                         since it is protected by a different security policy.
193
194                 boolean PassphraseRequired [readonly]
195
196                         If the service type is WiFi, then this property
197                         indicates if a passphrase is required.
198
199                         If a passphrase has been set already or if no
200                         passphrase is needed, then this property will
201                         be set to false.
202
203                 string BSSID [readonly]
204
205                         If the service type is WiFi, then this property
206                         indicates the BSSID of the service.
207
208                 uint32 MaxRate [readonly]
209
210                         If the service type is WiFi, then this property
211                         indicates the Maximum speed(bps) of the service.
212
213                 uint16 Frequency [readonly]
214
215                         If the service type is WiFi, then this property
216                         indicates the frequency band(MHz) of the service.
217
218                 string EncryptionMode [readonly]
219
220                         If the service type is WiFi, then this property
221                         indicates the key encryption mode.
222
223                         Possible values are "none", "wep", "tkip", "aes"
224                         and "mixed".
225
226                         This property might be only present for WiFi
227                         services.
228
229                 uint8 Strength [readonly]
230
231                         Indicates the signal strength of the service. This
232                         is a normalized value between 0 and 100.
233
234                         This property will not be present for Ethernet
235                         devices.
236
237                 boolean Favorite [readonly]
238
239                         Will be true if a cable is plugged in or the user
240                         selected and successfully connected to this service.
241
242                         This value is automatically changed and to revert
243                         it back to false the Remove() method needs to be
244                         used.
245
246                 boolean Immutable [readonly]
247
248                         This value will be set to true if the service is
249                         configured externally via a configuration file.
250
251                         The only valid operation are Connect() and of
252                         course Disconnect(). The Remove() method will
253                         result in an error.
254
255                 boolean AutoConnect [readwrite]
256
257                         If set to true, this service will auto-connect
258                         when no other connection is available.
259
260                         The service won't auto-connect while roaming.
261
262                         For favorite services it is possible to change
263                         this value to prevent or permit automatic
264                         connection attempts.
265
266                 boolean Roaming [readonly]
267
268                         This property indicates if this service is roaming.
269
270                         In the case of Cellular services this normally
271                         indicates connections to a foreign provider when
272                         traveling abroad.
273
274                 array{string} Nameservers [readonly]
275
276                         The list of currently active nameservers for this
277                         service. If the server is not in READY or ONLINE
278                         state than this list will be empty.
279
280                         Global nameservers are automatically added to this
281                         list. The array represents a sorted list of the
282                         current nameservers. The first one has the highest
283                         priority and is used by default.
284
285                         When using DHCP this array represents the nameservers
286                         provided by the network. In case of manual settings,
287                         the ones from Nameservers.Configuration are used.
288
289                 array{string} Nameservers.Configuration [readwrite]
290
291                         The list of manually configured domain name
292                         servers. Some 3G networks don't provide correct
293                         name servers and this allows for an override.
294
295                         This array is sorted by priority and the first
296                         entry in the list represents the nameserver with
297                         the highest priority.
298
299                         When using manual configuration and no global
300                         nameservers are configured, then it is useful
301                         to configure this setting.
302
303                         Changes to the domain name servers can be done
304                         at any time. It will not cause a disconnect of
305                         the service. However there might be small window
306                         where name resolution might fail.
307
308                 array{string} Domains [readonly]
309
310                         The list of currently used search domains.
311
312                 array{string} Domains.Configuration [readwrite]
313
314                         The list of manually configured search domains.
315
316                 dict IPv4 [readonly]
317
318                         string Method [readonly]
319
320                                 Possible values are "dhcp", "manual"
321                                 and "off".
322
323                                 The value "fixed" indicates an IP address
324                                 that can not be modified. For example
325                                 cellular networks return fixed information.
326
327                         string Address [readonly]
328
329                                 The current configured IPv4 address.
330
331                         string Netmask [readonly]
332
333                                 The current configured IPv4 netmask.
334
335                         string Gateway [readonly]
336
337                                 The current configured IPv4 gateway.
338
339                 dict IPv4.Configuration [readwrite]
340
341                         Same values as IPv4 property. The IPv4 represents
342                         the actual system configuration while this allows
343                         user configuration.
344
345                         Changing these settings will cause a state change
346                         of the service. The service will become unavailable
347                         until the new configuration has been successfully
348                         installed.
349
350                 dict IPv6 [readonly]
351
352                         string Method [readonly]
353
354                                 Possible values are "auto", "manual", "6to4"
355                                 and "off".
356
357                                 The value "fixed" indicates an IP address
358                                 that can not be modified. For example
359                                 cellular networks return fixed information.
360                                 The value "6to4" is returned if 6to4 tunnel
361                                 is created by connman. The tunnel can only be
362                                 created if method was set to "auto" by the
363                                 user. User cannot set the method to "6to4".
364
365                         string Address [readonly]
366
367                                 The current configured IPv6 address.
368
369                         uint8 PrefixLength [readonly]
370
371                                 The prefix length of the IPv6 address.
372
373                         string Gateway [readonly]
374
375                                 The current configured IPv6 gateway.
376
377                         string Privacy [readonly]
378
379                                 Enable or disable IPv6 privacy extension
380                                 that is described in RFC 4941. The value
381                                 has only meaning if Method is set to "auto".
382
383                                 Value "disabled" means that privacy extension
384                                 is disabled and normal autoconf addresses are
385                                 used.
386
387                                 Value "enabled" means that privacy extension is
388                                 enabled and system prefers to use public
389                                 addresses over temporary addresses.
390
391                                 Value "prefered" means that privacy extension is
392                                 enabled and system prefers temporary addresses
393                                 over public addresses.
394
395                                 Default value is "disabled".
396
397                 dict IPv6.Configuration [readwrite]
398
399                         Same values as IPv6 property. The IPv6 represents
400                         the actual system configuration while this allows
401                         user configuration.
402
403                         Changing these settings will cause a state change
404                         of the service. The service will become unavailable
405                         until the new configuration has been successfully
406                         installed.
407
408                 dict Proxy [readonly]
409
410                         string Method [readonly]
411
412                                 Possible values are "direct", "auto" and
413                                 "manual".
414
415                                 In case of "auto" method, the URL file can be
416                                 provided unless you want to let DHCP/WPAD
417                                 auto-discover to be tried. In such case if DHCP
418                                 and WPAD auto-discover methods fails then
419                                 method will be "direct".
420
421                                 In case of "direct" no additional information
422                                 are provided. For the "manual" method the
423                                 Servers have to be set, Excludes is optional.
424
425                         string URL [readonly]
426
427                                 Automatic proxy configuration URL. Used by
428                                 "auto" method.
429
430                         array{string} Servers [readonly]
431
432                                 Used when "manual" method is set.
433
434                                 List of proxy URIs. The URI without a protocol
435                                 will be interpreted as the generic proxy URI.
436                                 All others will target a specific protocol and
437                                 only once.
438
439                                 Example for generic proxy server entry would
440                                 be like this: "server.example.com:911".
441
442                         array{string} Excludes [readonly]
443
444                                 Used when "manual" method is set.
445
446                                 List of hosts which can be accessed directly.
447
448                 dict Proxy.Configuration [readwrite]
449
450                         Same values as Proxy property. The Proxy represents
451                         the actual system configuration while this allows
452                         user configuration.
453
454                         If "auto" method is set with an empty URL, then
455                         DHCP/WPAD auto-discover will be tried. Otherwise the
456                         specified URL will be used.
457
458                 dict Provider [readonly]
459
460                         string Host [readonly]
461
462                                VPN host IP.
463
464                         string Domain [readonly]
465
466                                VPN Domain.
467
468                         string Name [readonly]
469
470                                VPN provider Name.
471
472                         string Type [readonly]
473
474                                VPN provider type.
475
476                 dict Ethernet [readonly]
477
478                         string Method [readonly]
479
480                                 Possible values are "auto" and "manual".
481
482                         string Interface [readonly]
483
484                                 Interface name (for example eth0).
485
486                         string Address [readonly]
487
488                                 Ethernet device address (MAC address).
489
490                         uint16 MTU [readonly]
491
492                                 The Ethernet MTU (default is 1500).
493
494                         uint16 Speed [readonly]
495
496                                 Selected speed of the line.
497
498                                 This information might not always be
499                                 available.
500
501                         string Duplex [readonly]
502
503                                 Selected duplex settings of the line.
504
505                                 Possible values are "half" and "full".
506
507                                 This information might not always be
508                                 available.