3bd201df168856ac26fd20700b38edfef4b10b6e
[framework/connectivity/connman.git] / doc / manager-api.txt
1 Manager hierarchy
2 =================
3
4 Service         net.connman
5 Interface       net.connman.Manager
6 Object path     /
7
8 Methods         dict GetProperties()
9
10                         Returns all global system properties. See the
11                         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                 array{object,dict} GetTechnologies()
26
27                         Returns a list of tuples with technology object
28                         path and dictionary of technology properties.
29
30                         Possible Errors: [service].Error.InvalidArguments
31
32                 array{object,dict} GetServices()
33
34                         Returns a sorted list of tuples with service
35                         object path and dictionary of service properties.
36
37                         This list will not contain sensitive information
38                         like passphrases etc.
39
40                         Possible Errors: [service].Error.InvalidArguments
41
42                 object ConnectProvider(dict provider)
43
44                         Connect to a VPN specified by the given provider
45                         properties.
46
47                         When successful this method will return the object
48                         path of the VPN service object.
49
50                         This method can also be used to connect to an
51                         already existing VPN.
52
53                         This method call will only return in case of an
54                         error or when the service is fully connected. So
55                         setting a longer D-Bus timeout might be a really
56                         good idea.
57
58                         When 'SessionMode' property is enabled, this method
59                         call is disallowed.
60
61                         Possible Errors: [service].Error.InvalidArguments
62
63                 void RegisterAgent(object path)
64
65                         Register new agent for handling user requests.
66
67                         Possible Errors: [service].Error.InvalidArguments
68
69                 void UnregisterAgent(object path)
70
71                         Unregister an existing agent.
72
73                         Possible Errors: [service].Error.InvalidArguments
74
75                 void RegisterCounter(object path, uint32 accuracy, uint32 period)  [experimental]
76
77                         Register a new counter for user notifications.
78
79                         The accuracy is specified in kilo-bytes and defines
80                         a threshold for counter updates. Together with the
81                         period value it defines how often user space needs
82                         to be updated. The period value is in seconds.
83
84                         This interface is not meant for time tracking. If
85                         the time needs to be tracked down to the second, it
86                         is better to have a real timer running inside the
87                         application than using this interface.
88
89                         Also getting notified for every kilo-byte is a bad
90                         choice (even if the interface supports it). Something
91                         like 10 kilo-byte units or better 1 mega-byte seems
92                         to be a lot more reasonable and better for the user.
93
94                         Possible Errors: [service].Error.InvalidArguments
95
96                 void UnregisterCounter(object path)  [experimental]
97
98                         Unregister an existing counter.
99
100                         Possible Errors: [service].Error.InvalidArguments
101
102                 object CreateSession(dict settings, object notifier)  [experimental]
103
104                         Create a new session for the application. Every
105                         application can create multiple session with
106                         different settings. The settings are described
107                         as part of the session interface.
108
109                         The notifier allows asynchronous notification about
110                         session specific changes. These changes can be
111                         for online/offline state or IP address changes or
112                         similar things the application is required to
113                         handle.
114
115                         Every application should at least create one session
116                         to inform about its requirements and it purpose.
117
118                 void DestroySession(object session)  [experimental]
119
120                         Remove the previously created session.
121
122                         If an application exits unexpectatly the session
123                         will be automatically destroyed.
124
125                 object path, dict, fd RequestPrivateNetwork(dict options)
126                                                                 [experimental]
127
128                         Request a new Private Network, which includes the
129                         creation of a tun/tap interface, and IP
130                         configuration, NAT and IP forwarding on that
131                         interface.
132                         An object path, a dictionnary and a file descriptor
133                         with IP settings are returned.
134
135                         Possible Errors: [service].Error.InvalidArguments
136                                          [service].Error.NotSupported
137
138                 void ReleasePrivateNetwork(object path) [experimental]
139
140                         Releases a private network.
141
142                         Possible Errors: [service].Error.InvalidArguments
143
144 Signals         TechnologyAdded(object path, dict properties)
145
146                         Signal that is sent when a new technology is added.
147
148                         It contains the object path of the technology and
149                         also its properties.
150
151                 TechnologyRemoved(object path)
152
153                         Signal that is sent when a modem has been removed.
154
155                         The object path is no longer accessible after this
156                         signal and only emitted for reference.
157
158                 ServicesChanged(array{object, dict}, array{object})
159
160                         Signals a list of services that have been changed
161                         via the first array. And a list of service that
162                         have been removed via the second array.
163
164                         The list of added services is sorted. The dictionary
165                         with the properties might be empty in case none of
166                         the properties have changed. Or only contains the
167                         properties that have changed.
168
169                         For newly added services the whole set of properties
170                         will be present.
171
172                         The list of removed services can be empty.
173
174                         This signal will only be triggered when the sort
175                         order of the service list or the number of services
176                         changes. It will not be emitted if only a property
177                         of the service object changes. For that it is
178                         required to watch the PropertyChanged signal of
179                         the service object.
180
181                 PropertyChanged(string name, variant value)
182
183                         This signal indicates a changed value of the given
184                         property.
185
186 Properties      string State [readonly]
187
188                         The global connection state of a system. Possible
189                         values are "offline", "idle", "ready" and "online".
190
191                         If the device is in offline mode, the value "offline"
192                         indicates this special global state. It can also be
193                         retrieved via the OfflineMode property, but is kept
194                         here for consistency and to differentiate from "idle".
195
196                         However when OfflineMode property is true, the State
197                         property can still be "idle", "ready" or "online"
198                         since it is possible by the end user to re-enable
199                         individual technologies like WiFi and Bluetooth while
200                         in offline mode.
201
202                         The states "idle", "ready" and "online" match to
203                         states from the services. If no service is in
204                         either "ready" or "online" state it will indicate
205                         the "idle" state.
206
207                         If at least one service is in "ready" state and no
208                         service is in "online" state, then it will indicate
209                         the "ready" state.
210
211                         When at least one service is in "online" state,
212                         this property will indicate "online" as well.
213
214                 boolean OfflineMode [readwrite]
215
216                         The offline mode indicates the global setting for
217                         switching all radios on or off. Changing offline mode
218                         to true results in powering down all devices. When
219                         leaving offline mode the individual policy of each
220                         device decides to switch the radio back on or not.
221
222                         During offline mode, it is still possible to switch
223                         certain technologies manually back on. For example
224                         the limited usage of WiFi or Bluetooth devices might
225                         be allowed in some situations.
226
227                 boolean SessionMode [readwrite]  [experminental]
228
229                         This disables the auto connect feature. It should be
230                         enabled when the Session API is used. When SessionMode
231                         is enabled, 'ConnectService' and 'ConnectProvider'
232                         method calls are disallowed.
233
234                         The default value is false.