ea725b50d1e12c2f9faa9689b7d4cddfb2004b9b
[framework/connectivity/connman.git] / doc / service-api.txt
1 Service hierarchy
2 =================
3
4 Service         org.moblin.connman
5 Interface       org.moblin.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                         Possible Errors: [service].Error.InvalidArguments
61
62                 void Remove()
63
64                         A successfully connected service with Favorite=true
65                         can be removed this way. If it is connected, it will
66                         be automatically disconnected first.
67
68                         If the service requires a passphrase it will be
69                         cleared and forgotten when removing.
70
71                         This is similar to setting the Favorite property
72                         to false, but that is currently not supported.
73
74                         Calling this method on Ethernet devices will cause
75                         an error message. It is not possible to remove these
76                         kind of devices.
77
78                         Possible Errors: [service].Error.InvalidArguments
79
80                 void MoveBefore(object service)
81
82                         If a service has been used before, this allows a
83                         reorder of the favorite services.
84
85                         The target service object must be part of this
86                         profile. Moving between profiles is not supported.
87
88                         Possible Errors: [service].Error.InvalidArguments
89
90                 void MoveAfter(object service)
91
92                         If a service has been used before, this allows a
93                         reorder of the favorite services.
94
95                         The target service object must be part of this
96                         profile. Moving between profiles is not supported.
97
98                         Possible Errors: [service].Error.InvalidArguments
99
100 Signals         PropertyChanged(string name, variant value)
101
102                         This signal indicates a changed value of the given
103                         property.
104
105 Properties      string State [readonly]
106
107                         The service state information.
108
109                         Valid states are "idle", "failure", "association",
110                         "configuration" and "ready".
111
112                 string Error [readonly]
113
114                         The service error status details.
115
116                         When error occur during connection or disconnection
117                         the detailed information are represented in this
118                         property to help the user interface to present the
119                         user with alternate options.
120
121                         This property is only valid when the service is in
122                         the "failure" state. Otherwise it might be empty or
123                         not present at all.
124
125                         Current defined error code is "dhcp-failed".
126
127                 string Name [readonly]
128
129                         The service name (for example "Wireless" etc.)
130
131                         This name can be used for directly displaying it in
132                         the application. It has pure informational purpose.
133
134                         For Ethernet devices and hidden WiFi networks it is
135                         not guaranteed that this property is present.
136
137                 string Type [readonly]
138
139                         The service type (for example "ethernet", "wifi" etc.)
140
141                         This information should only be used to determine
142                         advanced properties or showing the correct icon
143                         to the user.
144
145                 string Mode [readonly]
146
147                         If the service type is WiFi, then this property is
148                         present and contains the mode of the network. The
149                         possible values are "managed" or "adhoc".
150
151                         This property might be only present for WiFi
152                         services.
153
154                 string Security [readonly]
155
156                         If the service type is WiFi, then this property is
157                         present and contains the security method or key
158                         management setting.
159
160                         Possible values are "none", "wep", "wpa" and "rsn".
161
162                         This property might be only present for WiFi
163                         services.
164
165                 string Passphrase [readwrite]
166
167                         If the service type is WiFi, then this property
168                         can be used to store a passphrase.
169
170                         This property is still experimental and might be
171                         removed in future version.
172
173                 uint8 Strength [readonly]
174
175                         Indicates the signal strength of the service. This
176                         is a normalized value between 0 and 100.
177
178                         This property will not be present for Ethernet
179                         devices.
180
181                 boolean Favorite [readonly]
182
183                         Will be true if a cable is plugged in or the user
184                         selected and successfully connected to this service.
185
186                         Setting this property to true has no effect at all
187                         and setting it to false is similar to the Remove()
188                         method. So for now it will be considered a read
189                         only property.
190
191                 string IPv4.Method [readwrite]
192
193                         The IPv4 configuration method. Possible values here
194                         are "dhcp" and "static".
195
196                 string IPv4.Address [readwrite]
197
198                         The current configured IPv4 address.