c9dd7e2f4b77239f57e874d3f77acf0511b15be6
[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 Signals         PropertyChanged(string name, variant value)
126
127                         This signal indicates a changed value of the given
128                         property.
129
130 Properties      string State [readonly]
131
132                         The service state information.
133
134                         Valid states are "idle", "failure", "association",
135                         "configuration", "ready", "disconnect" and "online".
136
137                         The "ready" state signals a successfully
138                         connected device. "online" signals that an
139                         Internet connection is available and has been
140                         verified.
141
142                         See doc/overview-api.txt for more information about
143                         state transitions.
144
145                 string Error [readonly]
146
147                         The service error status details.
148
149                         When error occur during connection or disconnection
150                         the detailed information is represented in this
151                         property to help the user interface to present the
152                         user with alternate options.
153
154                         This property is only valid when the service is in
155                         the "failure" state. Otherwise it might be empty or
156                         not present at all.
157
158                         Current defined error code is "dhcp-failed".
159
160                 string Name [readonly]
161
162                         The service name (for example "Wireless" etc.)
163
164                         This name can be used for directly displaying it in
165                         the application. It has pure informational purpose
166                         and no attempt should be made to translate it.
167
168                         For Ethernet devices and hidden WiFi networks this
169                         property is not present.
170
171                 string Type [readonly]
172
173                         The service type (for example "ethernet", "wifi" etc.)
174
175                         This information should only be used to determine
176                         advanced properties or showing the correct icon
177                         to the user.
178
179                         Together with a missing Name property, this can
180                         be used to identify hidden WiFi networks.
181
182                 array{string} Security [readonly]
183
184                         If the service type is WiFi, then this property is
185                         present and contains the list of security methods
186                         or key management settings.
187
188                         Possible values are "none", "wep", "psk", "ieee8021x"
189                         and also "wps".
190
191                         This property might be only present for WiFi
192                         services.
193
194                 uint8 Strength [readonly]
195
196                         Indicates the signal strength of the service. This
197                         is a normalized value between 0 and 100.
198
199                         This property will not be present for Ethernet
200                         devices.
201
202                 boolean Favorite [readonly]
203
204                         Will be true if a cable is plugged in or the user
205                         selected and successfully connected to this service.
206
207                         This value is automatically changed and to revert
208                         it back to false the Remove() method needs to be
209                         used.
210
211                 boolean Immutable [readonly]
212
213                         This value will be set to true if the service is
214                         configured externally via a configuration file.
215
216                         The only valid operation are Connect() and of
217                         course Disconnect(). The Remove() method will
218                         result in an error.
219
220                 boolean AutoConnect [readwrite]
221
222                         If set to true, this service will auto-connect
223                         when no other connection is available.
224
225                         The service won't auto-connect while roaming.
226
227                         For favorite services it is possible to change
228                         this value to prevent or permit automatic
229                         connection attempts.
230
231                 boolean Roaming [readonly]
232
233                         This property indicates if this service is roaming.
234
235                         In the case of Cellular services this normally
236                         indicates connections to a foreign provider when
237                         traveling abroad.
238
239                 array{string} Nameservers [readonly]
240
241                         The list of currently active nameservers for this
242                         service. If the server is not in READY or ONLINE
243                         state than this list will be empty.
244
245                         Global nameservers are automatically added to this
246                         list. The array represents a sorted list of the
247                         current nameservers. The first one has the highest
248                         priority and is used by default.
249
250                         When using DHCP this array represents the nameservers
251                         provided by the network. In case of manual settings,
252                         the ones from Nameservers.Configuration are used.
253
254                 array{string} Nameservers.Configuration [readwrite]
255
256                         The list of manually configured domain name
257                         servers. Some cellular networks don't provide
258                         correct name servers and this allows for an
259                         override.
260
261                         This array is sorted by priority and the first
262                         entry in the list represents the nameserver with
263                         the highest priority.
264
265                         When using manual configuration and no global
266                         nameservers are configured, then it is useful
267                         to configure this setting.
268
269                         Changes to the domain name servers can be done
270                         at any time. It will not cause a disconnect of
271                         the service. However there might be small window
272                         where name resolution might fail.
273
274                 array{string} Timeservers [readonly]
275
276                         The list of currently active timeservers for this
277                         service. If the server is not in READY or ONLINE
278                         state than this list will be empty.
279
280                 array{string} Timeservers.Configuration [readwrite]
281
282                         The list of manually configured time servers.
283
284                         The first entry in the list represents the
285                         timeserver with the highest priority.
286
287                         When using manual configuration this setting
288                         is useful to override all the other timeserver
289                         settings. This is service specific, hence only
290                         the values for the default service are used.
291
292                         Changes to this property will result in restart
293                         of NTP query.
294
295                 array{string} Domains [readonly]
296
297                         The list of currently used search domains taken
298                         from Domains.Configurations if set, otherwise a
299                         domain name if provided by DHCP or VPNs.
300
301                 array{string} Domains.Configuration [readwrite]
302
303                         The list of manually configured search domains.
304
305                 dict IPv4 [readonly]
306
307                         string Method [readonly]
308
309                                 Possible values are "dhcp", "manual"
310                                 and "off".
311
312                                 The value "fixed" indicates an IP address
313                                 that can not be modified. For example
314                                 cellular networks return fixed information.
315
316                         string Address [readonly]
317
318                                 The current configured IPv4 address.
319
320                         string Netmask [readonly]
321
322                                 The current configured IPv4 netmask.
323
324                         string Gateway [readonly]
325
326                                 The current configured IPv4 gateway.
327
328                 dict IPv4.Configuration [readwrite]
329
330                         Same values as IPv4 property. The IPv4 represents
331                         the actual system configuration while this allows
332                         user configuration.
333
334                         Changing these settings will cause a state change
335                         of the service. The service will become unavailable
336                         until the new configuration has been successfully
337                         installed.
338
339                 dict IPv6 [readonly]
340
341                         string Method [readonly]
342
343                                 Possible values are "auto", "manual", "6to4"
344                                 and "off".
345
346                                 The value "fixed" indicates an IP address
347                                 that can not be modified. For example
348                                 cellular networks return fixed information.
349                                 The value "6to4" is returned if 6to4 tunnel
350                                 is created by connman. The tunnel can only be
351                                 created if method was set to "auto" by the
352                                 user. User cannot set the method to "6to4".
353
354                         string Address [readonly]
355
356                                 The current configured IPv6 address.
357
358                         uint8 PrefixLength [readonly]
359
360                                 The prefix length of the IPv6 address.
361
362                         string Gateway [readonly]
363
364                                 The current configured IPv6 gateway.
365
366                         string Privacy [readonly]
367
368                                 Enable or disable IPv6 privacy extension
369                                 that is described in RFC 4941. The value
370                                 has only meaning if Method is set to "auto".
371
372                                 Value "disabled" means that privacy extension
373                                 is disabled and normal autoconf addresses are
374                                 used.
375
376                                 Value "enabled" means that privacy extension is
377                                 enabled and system prefers to use public
378                                 addresses over temporary addresses.
379
380                                 Value "prefered" means that privacy extension is
381                                 enabled and system prefers temporary addresses
382                                 over public addresses.
383
384                                 Default value is "disabled".
385
386                 dict IPv6.Configuration [readwrite]
387
388                         Same values as IPv6 property. The IPv6 represents
389                         the actual system configuration while this allows
390                         user configuration.
391
392                         Changing these settings will cause a state change
393                         of the service. The service will become unavailable
394                         until the new configuration has been successfully
395                         installed.
396
397                 dict Proxy [readonly]
398
399                         string Method [readonly]
400
401                                 Possible values are "direct", "auto" and
402                                 "manual".
403
404                                 In case of "auto" method, the URL file can be
405                                 provided unless you want to let DHCP/WPAD
406                                 auto-discover to be tried. In such case if DHCP
407                                 and WPAD auto-discover methods fails then
408                                 method will be "direct".
409
410                                 In case of "direct" no additional information
411                                 are provided. For the "manual" method the
412                                 Servers have to be set, Excludes is optional.
413
414                         string URL [readonly]
415
416                                 Automatic proxy configuration URL. Used by
417                                 "auto" method.
418
419                         array{string} Servers [readonly]
420
421                                 Used when "manual" method is set.
422
423                                 List of proxy URIs. The URI without a protocol
424                                 will be interpreted as the generic proxy URI.
425                                 All others will target a specific protocol and
426                                 only once.
427
428                                 Example for generic proxy server entry would
429                                 be like this: "server.example.com:911".
430
431                         array{string} Excludes [readonly]
432
433                                 Used when "manual" method is set.
434
435                                 List of hosts which can be accessed directly.
436
437                 dict Proxy.Configuration [readwrite]
438
439                         Same values as Proxy property. The Proxy represents
440                         the actual system configuration while this allows
441                         user configuration.
442
443                         If "auto" method is set with an empty URL, then
444                         DHCP/WPAD auto-discover will be tried. Otherwise the
445                         specified URL will be used.
446
447                 dict Provider [readonly]
448
449                         string Host [readonly]
450
451                                 VPN host IP.
452
453                         string Domain [readonly]
454
455                                 VPN Domain.
456
457                         string Name [readonly]
458
459                                 VPN provider Name.
460
461                         string Type [readonly]
462
463                                 VPN provider type.
464
465                 dict Ethernet [readonly]
466
467                         string Method [readonly]
468
469                                 Possible values are "auto" and "manual".
470
471                         string Interface [readonly]
472
473                                 Interface name (for example eth0).
474
475                         string Address [readonly]
476
477                                 Ethernet device address (MAC address).
478
479                         uint16 MTU [readonly]
480
481                                 The Ethernet MTU (default is 1500).
482
483                         uint16 Speed [readonly] [deprecated]
484
485                                 Selected speed of the line.
486
487                                 This information is not available.
488
489                         string Duplex [readonly] [deprecated]
490
491                                 Selected duplex settings of the line.
492                                 Possible values are "half" and "full".
493
494                                 This information is not available.