Add APIs of 2.4
[platform/core/convergence/service-adaptor.git] / client / sal_service_adaptor.h
1 /*
2  * Service Adaptor
3  *
4  * Copyright (c) 2014 - 2015 Samsung Electronics Co., Ltd. All rights reserved.
5  *
6  * Licensed under the Apache License, Version 2.0 (the "License");
7  * you may not use this file except in compliance with the License.
8  * You may obtain a copy of the License at
9  *
10  * http://www.apache.org/licenses/LICENSE-2.0
11  *
12  * Unless required by applicable law or agreed to in writing, software
13  * distributed under the License is distributed on an "AS IS" BASIS,
14  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15  * See the License for the specific language governing permissions and
16  * limitations under the License.
17  *
18  */
19
20 #ifndef __SERVICE_ADAPTOR_H__
21 #define __SERVICE_ADAPTOR_H__
22
23 #ifndef API
24 #define API __attribute__ ((visibility("default")))
25 #endif
26
27 #ifdef __cplusplus
28 extern "C"
29 {
30 #endif
31
32 #include <glib.h>
33
34 /**
35  * @addtogroup  SERVICE_ADAPTOR_MODULE
36  * @{
37  */
38
39 /**
40  * @brief Type of service in plugin
41  */
42 typedef enum _service_plugin_type_e
43 {
44         SERVICE_PLUGIN_AUTH     = (0x01 << 0),          /**< Auth service type flag */
45         SERVICE_PLUGIN_STORAGE  = (0x01 << 1),          /**< Storage service type flag */
46 } service_plugin_type_e;
47
48 /** 2.4
49  * @brief Type of service in plugin
50  */
51 typedef enum _service_plugin_service_type_e
52 {
53         SERVICE_PLUGIN_SERVICE_AUTH     = (0x01 << 0),          /**< Auth service type flag */
54         SERVICE_PLUGIN_SERVICE_STORAGE  = (0x01 << 1),          /**< Storage service type flag */
55 } service_plugin_service_type_e;
56
57 /**
58  * @brief Definition for the service_plugin property: The application id be issued from service provider for 3rd party developer.
59  * @since_tizen 2.4
60  * @see service_plugin_add_property()
61  * @see service_plugin_remove_property()
62  * @see service_plugin_get_property()
63  */
64 #define SERVICE_PLUGIN_PROPERTY_APP_KEY         "http://tizen.org/service-adaptor/plugin/property/app_key"
65
66 /**
67  * @brief Definition for the service_plugin property: The application password be issued from service provider for 3rd party developer.
68  * @since_tizen 2.4
69  * @see service_plugin_add_property()
70  * @see service_plugin_remove_property()
71  * @see service_plugin_get_property()
72  */
73 #define SERVICE_PLUGIN_PROPERTY_APP_SECRET      "http://tizen.org/service-adaptor/plugin/property/app_secret"
74
75 /**
76  * @brief Definition for the service_plugin property: The user id for using specific service.
77  * @since_tizen 2.4
78  * @see service_plugin_add_property()
79  * @see service_plugin_remove_property()
80  * @see service_plugin_get_property()
81  */
82 #define SERVICE_PLUGIN_PROPERTY_USER_ID         "http://tizen.org/service-adaptor/plugin/property/user_id"
83
84 /** 2.4
85 * @brief The handle for connection and managing plugin handle of Service Adaptor
86 * @details The handle can be created by service_adaptor_create()<br>
87 *  When a handle is no longer needed, use service_adaptor_destroy()
88 * @see #service_adaptor_create()
89 * @see #service_adaptor_destroy()
90 */
91 typedef struct _service_adaptor_s *service_adaptor_h;
92
93 /**
94  * @brief The handle for connection and managing handle of Service Plugin
95  * @details The handle can be created by service_plugin_create()<br>
96  *  When a handle is no longer needed, use service_plugin_destroy()
97  * @see #service_plugin_create()
98  * @see #service_plugin_destroy()
99  */
100 typedef struct _service_plugin_s *service_plugin_h;
101
102 /**
103  * @brief Callback for service_adaptor_foreach_plugin API
104  *
105  * @param[in]    uri      The service plugin's unique uri, this value be set by plugin
106  * @param[in]    service_mask    Masked value for <b>installed</b> service plugins, this value can be masked multiple enum (#service_plugin_service_type_e)
107  * @param[in]    user_data       Passed data from #service_adaptor_foreach_plugin()
108  * @remarks      @a service_mask check using 'bit and' operation with #service_plugin_service_type_e
109  * @remarks      - for example,
110  * @remarks      &nbsp;&nbsp;&nbsp;&nbsp;        if(@a service_mask & SERVICE_PLUGIN_SERVICE_STORAGE)
111  * @remarks      &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;        { @a USING_STORAGE_CODE }
112  * @remarks Do not release memory of @a plugin_uri
113  * @see          service_plugin_service_type_e
114  * @return @c true to continue with the next iteration of the loop,
115  *         otherwise @c false to break out of the loop
116  * @pre  service_adaptor_foreach_plugin() will invoke this callback.
117  */
118 typedef bool (*service_adaptor_plugin_cb)(const char *uri,
119                 int service_mask,
120                 void *user_data);
121
122 /**
123  * @brief Callback for service_plugin_login API
124  *
125  * @param[in]    result
126  * @param[in]    user_data       Passed data from #service_plugin_login()
127  * @remarks
128  * @return void
129  * @pre  service_plugin_login() will invoke this callback.
130  */
131 typedef void (*service_plugin_login_cb)(int result,
132                 void *user_data);
133
134 /*==================================================================================================
135                                          FUNCTION PROTOTYPES
136 ==================================================================================================*/
137
138 /** 2.4
139 * @brief Create Service Adaptor
140 * @since_tizen 2.4
141 *
142 * @param[out]   service_adaptor The Service Adaptor handle
143 * @remarks      @a service_adaptor must be released memory using service_adaptor_destroy(), when a program no longer needs any function of Service Adaptor
144 * @see          service_adaptor_destroy()
145 * @return 0 on success, otherwise a negative error value
146 * @retval #SERVICE_ADAPTOR_ERROR_NONE Successful
147 * @retval #SERVICE_ADAPTOR_ERROR_INVALID_PARAMETER Invalid parameter
148 * @retval #SERVICE_ADAPTOR_ERROR_UNKNOWN Unknown error
149 */
150 int service_adaptor_create(service_adaptor_h *service_adaptor);
151
152 /** 2.4
153 * @brief        Destroy Service Adaptor
154 * @details      It must called after a program no longer needs any function of Service Adaptor
155 * @since_tizen 2.4
156 *
157 * @param[in]    service_adaptor The handle of Service Adaptor
158 * @see          service_adaptor_create()
159 * @return 0 on success, otherwise a negative error value
160 * @retval #SERVICE_ADAPTOR_ERROR_NONE Successful
161 * @retval #SERVICE_ADAPTOR_ERROR_INVALID_PARAMETER Invalid parameter
162 * @retval #SERVICE_ADAPTOR_ERROR_UNKNOWN Unknown error
163 * @pre  @a service_adaptor must be issued by service_adaptor_create()
164 */
165 int service_adaptor_destroy(service_adaptor_h service_adaptor);
166
167 /**
168  * @brief Create Service Adaptor
169  * @since_tizen 2.4
170  *
171  * @param[out]  service_adaptor The Service Adaptor handle
172  * @remarks     @a service_adaptor must be released memory using service_adaptor_destroy(), when a program no longer needs any function of Service Adaptor
173  * @see         service_adaptor_destroy()
174  * @return 0 on success, otherwise a negative error value
175  * @retval #SERVICE_ADAPTOR_ERROR_NONE Successful
176  * @retval #SERVICE_ADAPTOR_ERROR_INVALID_PARAMETER Invalid parameter
177  * @retval #SERVICE_ADAPTOR_ERROR_UNKNOWN Unknown error
178  */
179 int service_adaptor_connect();
180
181 /**
182  * @brief       Destroy Service Adaptor
183  * @details     It must called after a program no longer needs any function of Service Adaptor
184  * @since_tizen 2.4
185  *
186  * @param[in]   service_adaptor The handle of Service Adaptor
187  * @see         service_adaptor_create()
188  * @return 0 on success, otherwise a negative error value
189  * @retval #SERVICE_ADAPTOR_ERROR_NONE Successful
190  * @retval #SERVICE_ADAPTOR_ERROR_INVALID_PARAMETER Invalid parameter
191  * @retval #SERVICE_ADAPTOR_ERROR_UNKNOWN Unknown error
192  * @pre  @a service_adaptor must be issued by service_adaptor_create()
193  */
194 int service_adaptor_disconnect();
195
196 /** 2.4
197 * @brief Foreach the list of plugin
198 * @details Iterate to all installed plugin
199 * @since_tizen 2.4
200 *
201 * @param[in]    service_adaptor The handle of Service Adaptor
202 * @param[in]    callback        The callback for foreach plugin
203 * @param[in]    user_data       Passed data to callback
204 * @return 0 on success, otherwise a negative error value
205 * @retval #SERVICE_ADAPTOR_ERROR_NONE Successful
206 * @retval #SERVICE_ADAPTOR_ERROR_NO_DATA There is no available plugins
207 * @retval #SERVICE_ADAPTOR_ERROR_INVALID_PARAMETER Invalid parameter
208 * @retval #SERVICE_ADAPTOR_ERROR_UNKNOWN Unknown error
209 * @pre  @a service_adaptor must be issued by service_adaptor_create()
210 */
211 int service_adaptor_foreach_plugin(service_adaptor_h service_adaptor,
212                                                 service_adaptor_plugin_cb callback,
213                                                 void *user_data);
214
215 /**
216  * @brief Foreach the list of plugin
217  * @details Iterate to all installed plugin
218  * @since_tizen 2.4
219  *
220  * @param[in]    callback        The callback for foreach plugin
221  * @param[in]    user_data       Passed data to callback
222  * @return 0 on success, otherwise a negative error value
223  * @retval #SERVICE_ADAPTOR_ERROR_NONE Successful
224  * @retval #SERVICE_ADAPTOR_ERROR_NO_DATA There is no available plugins
225  * @retval #SERVICE_ADAPTOR_ERROR_INVALID_PARAMETER Invalid parameter
226  * @retval #SERVICE_ADAPTOR_ERROR_UNKNOWN Unknown error
227  * @pre  @a service_adaptor must be issued by service_adaptor_create()
228  */
229 int service_adaptor_foreach_plugin2(service_adaptor_plugin_cb callback,
230                 void *user_data);
231
232 /**
233  * @brief Gets service specfic last result
234  * @details This function retrieves the last error code that be issued from plugin.<br>
235  *  When if API function returns #SERVICE_ADAPTOR_ERROR_PLUGIN_FAILED, gets using this function.
236  * @since_tizen 2.4
237  *
238  * @param[out]   err     The error number that is defined service plugin SPEC
239  * @remarks      Thread safe functions
240  * @remarks      The result number's detail specification is defined service plugin or provider.
241  * @remarks      The detail error message can be got using service_adaptor_get_last_error_message()
242  * @see          service_adaptor_get_last_error_message()
243  * @return 0 on success, otherwise a negative error value
244  * @retval #SERVICE_ADAPTOR_ERROR_NONE Successful
245  * @retval #SERVICE_ADAPTOR_ERROR_INVALID_PARAMETER Invalid parameter
246  * @retval #SERVICE_ADAPTOR_ERROR_NO_DATA There is no result
247  * @retval #SERVICE_ADAPTOR_ERROR_UNKNOWN Unknown error
248  */
249 int service_adaptor_get_last_result(int *err);
250
251 /**
252  * @brief Gets service specfic last result error message
253  * @details This function retrieves the last error code that be issued from plugin.<br>
254  *  When if API function returns #SERVICE_ADAPTOR_ERROR_PLUGIN_FAILED, gets using this function.
255  * @since_tizen 2.4
256  *
257  * @param[out]   message The error message that is defined service plugin SPEC
258  * @remarks      @a message must be released using free()
259  * @remarks      Thread safe functions
260  * @remarks      The result string's detail specification is defined service plugin or provider.
261  * @see          service_adaptor_get_last_result()
262  * @return 0 on success, otherwise a negative error value
263  * @retval #SERVICE_ADAPTOR_ERROR_NONE Successful
264  * @retval #SERVICE_ADAPTOR_ERROR_INVALID_PARAMETER Invalid parameter
265  * @retval #SERVICE_ADAPTOR_ERROR_NO_DATA There is no error message
266  * @retval #SERVICE_ADAPTOR_ERROR_UNKNOWN Unknown error
267  */
268 int service_adaptor_get_last_error_message(char **message);
269
270 /*
271 int service_adaptor_add_plugin(service_adaptor_h adaptor_client, const char *plugin_uri);
272 int service_adaptor_remove_plugin(service_adaptor_h adaptor_client, const char *plugin_uri);
273 int service_adaptor_get_auth(service_adaptor_h adaptor_client, const char *uri, service_auth_h *auth);
274 */
275
276 /** 2.4
277 * @brief Create service plugin handle
278 * @details Create plugin handle using @a plugin_uri
279 * @since_tizen 2.4
280 *
281 * @param[in]    service_adaptor The handle of Service Adaptor
282 * @param[in]    plugin_uri      The specfic string for use plugin, this values are set by plugin
283 * @param[out]   plugin          The handle for use Plugin APIs
284 * @remarks      @a plugin must be released memory using service_plugin_destroy() when you no longer needs plugin's API
285 * @see          service_plugin_destroy()
286 * @return 0 on success, otherwise a negative error value
287 * @retval #SERVICE_ADAPTOR_ERROR_NONE Successful
288 * @retval #SERVICE_ADAPTOR_ERROR_INVALID_PARAMETER Invalid parameter
289 * @retval #SERVICE_ADAPTOR_ERROR_UNKNOWN Unknown error
290 * @pre  @a service_adaptor must be issued by service_adaptor_create()
291 */
292 int service_adaptor_create_plugin(service_adaptor_h service_adaptor,
293                                                 const char *plugin_uri,
294                                                 service_plugin_h *plugin);
295
296 /**
297  * @brief Create service plugin handle
298  * @details Create plugin handle using @a plugin_uri
299  * @since_tizen 2.4
300  *
301  * @param[in]    service_adaptor The handle of Service Adaptor
302  * @param[in]    plugin_uri      The specfic string for use plugin, this values are set by plugin
303  * @param[out]   plugin          The handle for use Plugin APIs
304  * @remarks      @a plugin must be released memory using service_plugin_destroy() when you no longer needs plugin's API
305  * @see          service_plugin_destroy()
306  * @return 0 on success, otherwise a negative error value
307  * @retval #SERVICE_ADAPTOR_ERROR_NONE Successful
308  * @retval #SERVICE_ADAPTOR_ERROR_INVALID_PARAMETER Invalid parameter
309  * @retval #SERVICE_ADAPTOR_ERROR_UNKNOWN Unknown error
310  * @pre  @a service_adaptor must be issued by service_adaptor_create()
311  */
312 int service_plugin_create(const char *uri, service_plugin_h *plugin);
313
314 /**
315  * @brief        Destroy service plugin handle
316  * @details      It must called after a program no longer needs APIs of specfic plugin
317  * @since_tizen 2.4
318  *
319  * @param[in]    plugin  The handle for use Plugin APIs
320  * @see  service_adaptor_create_plugin()
321  * @return 0 on success, otherwise a negative error value
322  * @retval #SERVICE_ADAPTOR_ERROR_NONE Successful
323  * @retval #SERVICE_ADAPTOR_ERROR_INVALID_PARAMETER Invalid parameter
324  * @retval #SERVICE_ADAPTOR_ERROR_UNKNOWN Unknown error
325  * @pre  @a plugin must be issued by service_adaptor_create_plugin()
326  */
327 int service_plugin_destroy(service_plugin_h plugin);
328
329 /**
330  * @brief Add Plugin Property
331  * @details The plguin property is used for plugin's basic or optional requirement.<br>
332  *  This value is not used in Adaptor layer, but it can be uesd to important Key for plugin with service provider.<br>
333  * @since_tizen 2.4
334  *
335  * @param[in]    plugin  The handle for use Plugin APIs
336  * @param[in]    key     The key of plugin property
337  * @param[in]    value   The value of plugin property that matched @a key
338  * @remarks      Some kind of property key(Not mandatory) is defined in this API (That is named to SERVICE_PLUGIN_PROPERTY_XXX)
339  * @remarks      If the @a key already exists in the property its current value is replaced with the new @a value.
340  * @remarks      @a plugin must be released memory using #service_plugin_destroy() when you no longer needs plugin's API
341  * @return 0 on success, otherwise a negative error value
342  * @retval #SERVICE_ADAPTOR_ERROR_NONE Successful
343  * @retval #SERVICE_ADAPTOR_ERROR_INVALID_PARAMETER Invalid parameter
344  * @retval #SERVICE_ADAPTOR_ERROR_UNKNOWN Unknown error
345  * @see  SERVICE_PLUGIN_PROPERTY_APP_KEY
346  * @see  SERVICE_PLUGIN_PROPERTY_APP_SECRET
347  * @see  SERVICE_PLUGIN_PROPERTY_USER_ID
348  * @pre  @a plugin must be issued by service_adaptor_create_plugin()
349  */
350 int service_plugin_add_property(service_plugin_h plugin,
351                 const char *key,
352                 const char *value);
353
354 /**
355  * @brief Remove Plugin Property
356  * @since_tizen 2.4
357  *
358  * @param[in]    plugin  The handle for use Plugin APIs
359  * @param[in]    key     The key of plugin property
360  * @remarks      Some kind of property key(Not mandatory) is defined in this API (That is named to SERVICE_PLUGIN_PROPERTY_XXX)
361  * @return 0 on success, otherwise a negative error value
362  * @retval #SERVICE_ADAPTOR_ERROR_NONE Successful
363  * @retval #SERVICE_ADAPTOR_ERROR_INVALID_PARAMETER Invalid parameter
364  * @retval #SERVICE_ADAPTOR_ERROR_UNKNOWN Unknown error
365  * @see  SERVICE_PLUGIN_PROPERTY_APP_KEY
366  * @see  SERVICE_PLUGIN_PROPERTY_APP_SECRET
367  * @see  SERVICE_PLUGIN_PROPERTY_USER_ID
368  */
369 int service_plugin_remove_property(service_plugin_h plugin,
370                 const char *key);
371
372 /**
373  * @brief Gets Plugin Property
374  * @since_tizen 2.4
375  *
376  * @param[in]    plugin  The handle for use Plugin APIs
377  * @param[in]    key     The key of plugin property
378  * @param[out]   value   The value of plugin property that matched @a key
379  * @remarks      Some kind of property key(Not mandatory) is defined in this API (That is named to SERVICE_PLUGIN_PROPERTY_XXX)
380  * @remarks      @a value must be released using free()
381  * @return 0 on success, otherwise a negative error value
382  * @retval #SERVICE_ADAPTOR_ERROR_NONE Successful
383  * @retval #SERVICE_ADAPTOR_ERROR_NO_DATA There is no property
384  * @retval #SERVICE_ADAPTOR_ERROR_INVALID_PARAMETER Invalid parameter
385  * @retval #SERVICE_ADAPTOR_ERROR_UNKNOWN Unknown error
386  * @see  SERVICE_PLUGIN_PROPERTY_APP_KEY
387  * @see  SERVICE_PLUGIN_PROPERTY_APP_SECRET
388  * @see  SERVICE_PLUGIN_PROPERTY_USER_ID
389  * @pre  The function get property already set by service_adaptor_set_plugin_property()
390  */
391 int service_plugin_get_property(service_plugin_h plugin,
392                 const char *key,
393                 char **value);
394
395 /**
396  * @brief Logins Plugin using Property
397  * @since_tizen 3.0
398  *
399  * @param[in]    plugin  The handle for use Plugin APIs
400  * @param[in]    callback        The callback for login
401  * @param[in]    user_data       Passed data to callback
402  * @remarks
403  * @remarks      @a value must be released using free()
404  * @return 0 on success, otherwise a negative error value
405  * @retval #SERVICE_ADAPTOR_ERROR_NONE Successful
406  * @retval #SERVICE_ADAPTOR_ERROR_NO_DATA There is no property
407  * @retval #SERVICE_ADAPTOR_ERROR_INVALID_PARAMETER Invalid parameter
408  * @retval #SERVICE_ADAPTOR_ERROR_UNKNOWN Unknown error
409  * @pre  The function get property already set by service_adaptor_set_plugin_property()
410  */
411 int service_plugin_login(service_plugin_h plugin, service_plugin_login_cb callback, void *user_data);
412
413 /** 2.4
414 * @brief Requests start initalization for service plugin
415 * @since_tizen 2.4
416 *
417 * @param[in]    plugin          The handle for use Plugin APIs
418 * @param[in]    service_mask    The flag for use service plugins, this flag can be masked multiple enum (#service_plugin_service_type_e)
419 * @remarks      @a service_mask must be input using 'bit or' operation with #service_plugin_service_type_e
420 * @remarks      - for example,
421 * @remarks      &nbsp;&nbsp;&nbsp;&nbsp;        <b>int</b> @a service_mask |= SERVIE_PLUGIN_SERVICE_AUTH;
422 * @remarks      &nbsp;&nbsp;&nbsp;&nbsp;        @a service_mask |= SERVICE_PLUGIN_SERVICE_STORAGE;
423 * @remarks      &nbsp;&nbsp;&nbsp;&nbsp;        <b>int</b> ret = service_plugin_start(@a m_plugin, @a service_mask);
424 * @remarks      If a program needs to stop plugin manually, use #service_plugin_stop(). <br>But in #service_plugin_destroy(), automatically stop service plugin
425 * @see          service_plugin_service_type_e
426 * @see          service_plugin_stop()
427 * @return 0 on success, otherwise a negative error value
428 * @return If return value is #SERVICE_ADAPTOR_ERROR_NOT_AUTHORIZED, request authorization to signup application
429 * @retval #SERVICE_ADAPTOR_ERROR_NONE Successful
430 * @retval #SERVICE_ADAPTOR_ERROR_INVALID_PARAMETER Invalid parameter
431 * @retval #SERVICE_ADAPTOR_ERROR_NOT_AUTHORIZED Need authorization
432 * @retval #SERVICE_ADAPTOR_ERROR_TIMED_OUT Timed out
433 * @retval #SERVICE_ADAPTOR_ERROR_IPC_UNSTABLE IPC failed with Service Adaptor Daemon
434 * @retval #SERVICE_ADAPTOR_ERROR_UNKNOWN Unknown error
435 */
436 int service_plugin_start(service_plugin_h plugin,
437                                                 int service_mask);
438
439 /**
440  * @brief Requests start initalization for service plugin
441  * @since_tizen 2.4
442  *
443  * @param[in]    plugin          The handle for use Plugin APIs
444  * @remarks      @a service_mask must be input using 'bit or' operation with #service_plugin_service_type_e
445  * @remarks      - for example,
446  * @remarks      &nbsp;&nbsp;&nbsp;&nbsp;        <b>int</b> @a service_mask |= SERVIE_PLUGIN_SERVICE_AUTH;
447  * @remarks      &nbsp;&nbsp;&nbsp;&nbsp;        @a service_mask |= SERVICE_PLUGIN_SERVICE_STORAGE;
448  * @remarks      &nbsp;&nbsp;&nbsp;&nbsp;        <b>int</b> ret = service_plugin_start(@a m_plugin, @a service_mask);
449  * @remarks      If a program needs to stop plugin manually, use #service_plugin_stop(). <br>But in #service_plugin_destroy(), automatically stop service plugin
450  * @see          service_plugin_service_type_e
451  * @see          service_plugin_stop()
452  * @return 0 on success, otherwise a negative error value
453  * @return If return value is #SERVICE_ADAPTOR_ERROR_NOT_AUTHOLIZED, request signup to autholization application
454  * @retval #SERVICE_ADAPTOR_ERROR_NONE Successful
455  * @retval #SERVICE_ADAPTOR_ERROR_INVALID_PARAMETER Invalid parameter
456  * @retval #SERVICE_ADAPTOR_ERROR_NOT_AUTHOLIZED Need atholization
457  * @retval #SERVICE_ADAPTOR_ERROR_TIMED_OUT Timed out
458  * @retval #SERVICE_ADAPTOR_ERROR_IPC_UNSTABLE IPC failed with Service Adaptor Daemon
459  * @retval #SERVICE_ADAPTOR_ERROR_UNKNOWN Unknown error
460  */
461 int service_plugin_start2(service_plugin_h plugin);
462
463 /**
464  * @brief Requests stop manually for service plugin
465  * @since_tizen 2.4
466  *
467  * @param[in]    plugin          The handle for use Plugin APIs
468  * @remarks      If a program needs to stop plugin manually, use this function. <br>But in #service_plugin_destroy(), automatically stop service plugin
469  * @remarks      @a plugin must be released memory using #service_plugin_destroy() when you no longer needs plugin's API
470  * @see          service_plugin_start()
471  * @see          service_plugin_destroy()
472  * @return 0 on success, otherwise a negative error value
473  * @retval #SERVICE_ADAPTOR_ERROR_NONE Successful
474  * @retval #SERVICE_ADAPTOR_ERROR_TIMED_OUT Timed out
475  * @retval #SERVICE_ADAPTOR_ERROR_IPC_UNSTABLE IPC failed with Service Adaptor Daemon
476  * @retval #SERVICE_ADAPTOR_ERROR_UNKNOWN Unknown error
477  * @pre  service_plugin_start()
478  */
479 int service_plugin_stop(service_plugin_h plugin);
480
481 /**
482  * @}
483  */
484
485 #ifdef __cplusplus
486 }
487 #endif
488
489 #endif /* __SERVICE_ADAPTOR_H__ */