Base Code merged to SPIN 2.4
[platform/upstream/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()  [deprecated]
9
10                         Returns properties for the service object. See
11                         the properties section for available properties.
12
13                         Usage of this method is highly discouraged. Use
14                         the Manager.GetServices() method instead.
15
16                         Possible Errors: [service].Error.InvalidArguments
17
18                 void SetProperty(string name, variant value)
19
20                         Changes the value of the specified property. Only
21                         properties that are listed as read-write are
22                         changeable. On success a PropertyChanged signal
23                         will be emitted.
24
25                         Properties cannot be set for hidden WiFi service
26                         entries or provisioned services.
27
28                         Possible Errors: [service].Error.InvalidArguments
29                                          [service].Error.InvalidProperty
30
31                 void ClearProperty(string name)
32
33                         Clears the value of the specified property.
34
35                         Properties cannot be cleared for hidden WiFi service
36                         entries or provisioned services.
37
38                         Possible Errors: [service].Error.InvalidArguments
39                                          [service].Error.InvalidProperty
40
41                 void Connect()
42
43                         Connect this service. It will attempt to connect
44                         WiFi or Bluetooth services.
45
46                         For Ethernet devices this method can only be used
47                         if it has previously been disconnected. Otherwise
48                         the plugging of a cable will trigger connecting
49                         automatically. If no cable is plugged in this method
50                         will fail.
51
52                         This method call will only return in case of an
53                         error or when the service is fully connected. So
54                         setting a longer D-Bus timeout might be a really
55                         good idea.
56
57                         Calling Connect() on a hidden WiFi service entry will
58                         query the missing SSID via the Agent API causing a
59                         WiFi service with the given SSID to be scanned,
60                         created and connected.
61
62                         Possible Errors: [service].Error.InvalidArguments
63
64                 void Disconnect()
65
66                         Disconnect this service. If the service is not
67                         connected an error message will be generated.
68
69                         On Ethernet devices this will disconnect the IP
70                         details from the service. It will not magically
71                         unplug the cable. When no cable is plugged in this
72                         method will fail.
73
74                         This method can also be used to abort a previous
75                         connection attempt via the Connect method.
76
77                         Hidden WiFi service entries cannot be disconnected
78                         as they always stay in idle state.
79
80                         Possible Errors: [service].Error.InvalidArguments
81
82                 void Remove()
83
84                         A successfully connected service with Favorite=true
85                         can be removed this way. If it is connected, it will
86                         be automatically disconnected first.
87
88                         If the service requires a passphrase it will be
89                         cleared and forgotten when removing.
90
91                         This is similar to setting the Favorite property
92                         to false, but that is currently not supported.
93
94                         In the case a connection attempt failed and the
95                         service is in the State=failure, this method can
96                         also be used to reset the service.
97
98                         Calling this method on Ethernet devices, hidden WiFi
99                         services or provisioned services will cause an error
100                         message. It is not possible to remove these kind of
101                         services.
102
103                         Possible Errors: [service].Error.InvalidArguments
104
105                 void MoveBefore(object service)
106
107                         If a service has been used before, this allows a
108                         reorder of the favorite services.
109
110                         Possible Errors: [service].Error.InvalidArguments
111
112                 void MoveAfter(object service)
113
114                         If a service has been used before, this allows a
115                         reorder of the favorite services.
116
117                         Possible Errors: [service].Error.InvalidArguments
118
119                 void ResetCounters()  [experimental]
120
121                         Reset the counter statistics.
122
123                         Possible Errors: None
124
125                 boolean GetUserFavorite() [experimental]
126
127                         This function is used to check whether this service
128                         is favorite to the current user.
129
130                         Possible Errors: None
131
132 Signals         PropertyChanged(string name, variant value)
133
134                         This signal indicates a changed value of the given
135                         property.
136
137 Properties      string State [readonly]
138
139                         The service state information.
140
141                         Valid states are "idle", "failure", "association",
142                         "configuration", "ready", "disconnect" and "online".
143
144                         The "ready" state signals a successfully
145                         connected device. "online" signals that an
146                         Internet connection is available and has been
147                         verified.
148
149                         See doc/overview-api.txt for more information about
150                         state transitions.
151
152                 string Error [readonly]
153
154                         The service error status details.
155
156                         When error occur during connection or disconnection
157                         the detailed information is represented in this
158                         property to help the user interface to present the
159                         user with alternate options.
160
161                         This property is only valid when the service is in
162                         the "failure" state. Otherwise it might be empty or
163                         not present at all.
164
165                         Currently defined error codes are: "out-of-range",
166                         "pin-missing", "dhcp-failed", "connect-failed",
167                         "login-failed", "auth-failed" and "invalid-key".
168
169                 string Name [readonly]
170
171                         The service name (for example "Wireless" etc.)
172
173                         This name can be used for directly displaying it in
174                         the application. It has pure informational purpose
175                         and no attempt should be made to translate it.
176
177                         For Ethernet devices and hidden WiFi networks this
178                         property is not present.
179
180                 string Type [readonly]
181
182                         The service type (for example "ethernet", "wifi" etc.)
183
184                         This information should only be used to determine
185                         advanced properties or showing the correct icon
186                         to the user.
187
188                         Together with a missing Name property, this can
189                         be used to identify hidden WiFi networks.
190
191                 array{string} Security [readonly]
192
193                         If the service type is WiFi, then this property is
194                         present and contains the list of security methods
195                         or key management settings.
196
197                         Possible values are "none", "wep", "psk", "ieee8021x"
198                         and also "wps".
199
200                         This property might be only present for WiFi
201                         services.
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 cellular networks don't provide
293                         correct name servers and this allows for an
294                         override.
295
296                         This array is sorted by priority and the first
297                         entry in the list represents the nameserver with
298                         the highest priority.
299
300                         When using manual configuration and no global
301                         nameservers are configured, then it is useful
302                         to configure this setting.
303
304                         Changes to the domain name servers can be done
305                         at any time. It will not cause a disconnect of
306                         the service. However there might be small window
307                         where name resolution might fail.
308
309                 array{string} Timeservers [readonly]
310
311                         The list of currently active timeservers for this
312                         service. If the server is not in READY or ONLINE
313                         state than this list will be empty.
314
315                 array{string} Timeservers.Configuration [readwrite]
316
317                         The list of manually configured time servers.
318
319                         The first entry in the list represents the
320                         timeserver with the highest priority.
321
322                         When using manual configuration this setting
323                         is useful to override all the other timeserver
324                         settings. This is service specific, hence only
325                         the values for the default service are used.
326
327                         Changes to this property will result in restart
328                         of NTP query.
329
330                 array{string} Domains [readonly]
331
332                         The list of currently used search domains taken
333                         from Domains.Configurations if set, otherwise a
334                         domain name if provided by DHCP or VPNs.
335
336                 array{string} Domains.Configuration [readwrite]
337
338                         The list of manually configured search domains.
339
340                 dict IPv4 [readonly]
341
342                         string Method [readonly]
343
344                                 Possible values are "dhcp", "manual"
345                                 and "off".
346
347                                 The value "fixed" indicates an IP address
348                                 that can not be modified. For example
349                                 cellular networks return fixed information.
350
351                         string Address [readonly]
352
353                                 The current configured IPv4 address.
354
355                         string Netmask [readonly]
356
357                                 The current configured IPv4 netmask.
358
359                         string Gateway [readonly]
360
361                                 The current configured IPv4 gateway.
362
363                 dict IPv4.Configuration [readwrite]
364
365                         Same values as IPv4 property. The IPv4 represents
366                         the actual system configuration while this allows
367                         user configuration.
368
369                         Changing these settings will cause a state change
370                         of the service. The service will become unavailable
371                         until the new configuration has been successfully
372                         installed.
373
374                 dict IPv6 [readonly]
375
376                         string Method [readonly]
377
378                                 Possible values are "auto", "manual", "6to4"
379                                 and "off".
380
381                                 The value "fixed" indicates an IP address
382                                 that can not be modified. For example
383                                 cellular networks return fixed information.
384                                 The value "6to4" is returned if 6to4 tunnel
385                                 is created by connman. The tunnel can only be
386                                 created if method was set to "auto" by the
387                                 user. User cannot set the method to "6to4".
388
389                         string Address [readonly]
390
391                                 The current configured IPv6 address.
392
393                         uint8 PrefixLength [readonly]
394
395                                 The prefix length of the IPv6 address.
396
397                         string Gateway [readonly]
398
399                                 The current configured IPv6 gateway.
400
401                         string Privacy [readonly]
402
403                                 Enable or disable IPv6 privacy extension
404                                 that is described in RFC 4941. The value
405                                 has only meaning if Method is set to "auto".
406
407                                 Value "disabled" means that privacy extension
408                                 is disabled and normal autoconf addresses are
409                                 used.
410
411                                 Value "enabled" means that privacy extension is
412                                 enabled and system prefers to use public
413                                 addresses over temporary addresses.
414
415                                 Value "prefered" means that privacy extension is
416                                 enabled and system prefers temporary addresses
417                                 over public addresses.
418
419                                 Default value is "disabled".
420
421                 dict IPv6.Configuration [readwrite]
422
423                         Same values as IPv6 property. The IPv6 represents
424                         the actual system configuration while this allows
425                         user configuration.
426
427                         Changing these settings will cause a state change
428                         of the service. The service will become unavailable
429                         until the new configuration has been successfully
430                         installed.
431
432                 dict Proxy [readonly]
433
434                         string Method [readonly]
435
436                                 Possible values are "direct", "auto" and
437                                 "manual".
438
439                                 In case of "auto" method, the URL file can be
440                                 provided unless you want to let DHCP/WPAD
441                                 auto-discover to be tried. In such case if DHCP
442                                 and WPAD auto-discover methods fails then
443                                 method will be "direct".
444
445                                 In case of "direct" no additional information
446                                 are provided. For the "manual" method the
447                                 Servers have to be set, Excludes is optional.
448
449                         string URL [readonly]
450
451                                 Automatic proxy configuration URL. Used by
452                                 "auto" method.
453
454                         array{string} Servers [readonly]
455
456                                 Used when "manual" method is set.
457
458                                 List of proxy URIs. The URI without a protocol
459                                 will be interpreted as the generic proxy URI.
460                                 All others will target a specific protocol and
461                                 only once.
462
463                                 Example for generic proxy server entry would
464                                 be like this: "server.example.com:911".
465
466                         array{string} Excludes [readonly]
467
468                                 Used when "manual" method is set.
469
470                                 List of hosts which can be accessed directly.
471
472                 dict Proxy.Configuration [readwrite]
473
474                         Same values as Proxy property. The Proxy represents
475                         the actual system configuration while this allows
476                         user configuration.
477
478                         If "auto" method is set with an empty URL, then
479                         DHCP/WPAD auto-discover will be tried. Otherwise the
480                         specified URL will be used.
481
482                 dict Provider [readonly]
483
484                         string Host [readonly]
485
486                                 VPN host IP.
487
488                         string Domain [readonly]
489
490                                 VPN Domain.
491
492                         string Name [readonly]
493
494                                 VPN provider Name.
495
496                         string Type [readonly]
497
498                                 VPN provider type.
499
500                 dict Ethernet [readonly]
501
502                         string Method [readonly]
503
504                                 Possible values are "auto" and "manual".
505
506                         string Interface [readonly]
507
508                                 Interface name (for example eth0).
509
510                         string Address [readonly]
511
512                                 Ethernet device address (MAC address).
513
514                         uint16 MTU [readonly]
515
516                                 The Ethernet MTU (default is 1500).
517
518                         uint16 Speed [readonly] [deprecated]
519
520                                 Selected speed of the line.
521
522                                 This information is not available.
523
524                         string Duplex [readonly] [deprecated]
525
526                                 Selected duplex settings of the line.
527                                 Possible values are "half" and "full".
528
529                                 This information is not available.