initial upload
[apps/native/smart-surveillance-camera.git] / include / smartthings.h
1  /*
2  * Copyright (c) 2018 Samsung Electronics Co., Ltd.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an AS IS BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16
17 #ifndef __SAMSUNG_EXPERIENCE_SERVICE_SMARTTHINGS_H__
18 #define __SAMSUNG_EXPERIENCE_SERVICE_SMARTTHINGS_H__
19
20 #include <stdlib.h>
21 #include <stdbool.h>
22 #include <tizen.h>
23
24 #ifdef __cplusplus
25 extern "C" {
26 #endif
27
28 /**
29  * @addtogroup CAPI_SMARTTHINGS_THING_MASTER_MODULE
30  * @{
31  */
32
33 /**
34  * @brief Definition for the max length of SSID for access point.
35  * @since_ses 1
36  */
37 #define SMARTTHINGS_SSID_LEN_MAX 32
38
39 /**
40  * @brief Definition for the max length of cloud information.
41  * @since_ses 1
42  */
43 #define SMARTTHINGS_CLOUD_INFO_LEN_MAX 128
44
45 /**
46  * @brief Enumeration for the SmartThings error.
47  * @since_ses 1
48  */
49 typedef enum {
50         SMARTTHINGS_ERROR_NONE = TIZEN_ERROR_NONE,                                /**< Successful */
51         SMARTTHINGS_ERROR_INVALID_PARAMETER = TIZEN_ERROR_INVALID_PARAMETER,      /**< Invalid parameter */
52         SMARTTHINGS_ERROR_OUT_OF_MEMORY = TIZEN_ERROR_OUT_OF_MEMORY,              /**< Out of memory */
53         SMARTTHINGS_ERROR_PERMISSION_DENIED = TIZEN_ERROR_PERMISSION_DENIED,      /**< Permission denied */
54         SMARTTHINGS_ERROR_NO_DATA = TIZEN_ERROR_NO_DATA,                          /**< No data */
55         SMARTTHINGS_ERROR_NOT_SUPPORTED = TIZEN_ERROR_NOT_SUPPORTED,              /**< Not supported */
56         SMARTTHINGS_ERROR_OPERATION_FAILED = TIZEN_ERROR_UNKNOWN - 1,             /**< Operation failed */
57         SMARTTHINGS_ERROR_SERVICE_UNAVAILABLE = TIZEN_ERROR_UNKNOWN -2            /**< Service unavailable */
58 } smartthings_error_e;
59
60 /**
61  * @brief Enumeration for SmartThings status.
62  * @since_ses 1
63  */
64 typedef enum {
65         SMARTTHINGS_STATUS_NOT_READY = -1,                   /**< Service agent is not ready */
66         SMARTTHINGS_STATUS_INIT = 0,                         /**< Initial state of SmartThings Thing */
67         SMARTTHINGS_STATUS_ES_STARTED,                       /**< Easy-setup is started */
68         SMARTTHINGS_STATUS_ES_DONE,                          /**< Easy-setup is done */
69         SMARTTHINGS_STATUS_ES_FAILED_ON_OWNERSHIP_TRANSFER,  /**< Easy-setup failed due to Ownership-Transfer failure */
70         SMARTTHINGS_STATUS_CONNECTING_TO_AP,                 /**< Connecting to target Wi-Fi access point */
71         SMARTTHINGS_STATUS_CONNECTED_TO_AP,                  /**< Connected to target Wi-Fi access point */
72         SMARTTHINGS_STATUS_CONNECTING_TO_AP_FAILED,          /**< Failed to connect to target Wi-Fi access point */
73         SMARTTHINGS_STATUS_REGISTERING_TO_CLOUD,             /**< Trying to sign up, sign in and publish resources to cloud */
74         SMARTTHINGS_STATUS_REGISTERED_TO_CLOUD,              /**< Publish resources to cloud is complete. Now the thing is ready to be controlled via cloud */
75         SMARTTHINGS_STATUS_REGISTERING_FAILED_ON_SIGN_IN,    /**< Failed to sign in to cloud */
76         SMARTTHINGS_STATUS_REGISTERING_FAILED_ON_PUB_RES     /**< Failed to publish resources to cloud */
77 } smartthings_status_e;
78
79 /**
80  * @brief Enumeration for RPC connection status.
81  * @since_ses 1
82  */
83 typedef enum {
84         SMARTTHINGS_CONNECTION_STATUS_CONNECTED = 0,            /**< Connection is connected */
85         SMARTTHINGS_CONNECTION_STATUS_DISCONNECTED,             /**< Connection is disconnected */
86         SMARTTHINGS_CONNECTION_STATUS_REJECTED,                 /**< Connection is rejected */
87 } smartthings_connection_status_e;
88
89 /**
90  * @brief The Wi-Fi mode.
91  * @since_ses 1
92  */
93 typedef enum {
94         SMARTTHINGS_WIFI_MODE_11A = (1 << 0),   /**< Wi-Fi 11A */
95         SMARTTHINGS_WIFI_MODE_11B = (1 << 1),   /**< Wi-Fi 11B */
96         SMARTTHINGS_WIFI_MODE_11G = (1 << 2),   /**< Wi-Fi 11G */
97         SMARTTHINGS_WIFI_MODE_11N = (1 << 3),   /**< Wi-Fi 11N */
98         SMARTTHINGS_WIFI_MODE_11AC = (1 << 4)   /**< Wi-Fi 11AC */
99 } smartthings_wifi_mode_e;
100
101 /**
102  * @brief The Wi-Fi frequency band.
103  * @since_ses 1
104  */
105 typedef enum {
106         SMARTTHINGS_WIFI_FREQ_24G = (1 << 0),       /**< Wi-Fi 2.4GHz */
107         SMARTTHINGS_WIFI_FREQ_5G = (1 << 1),        /**< Wi-Fi 5GHz */
108 } smartthings_wifi_freq_e;
109
110 /**
111  * @brief The Wi-Fi authentication type of access point.
112  * @since_ses 1
113  */
114 typedef enum {
115         SMARTTHINGS_WIFI_AUTHTYPE_NONE = 0, /**< No authentication */
116         SMARTTHINGS_WIFI_AUTHTYPE_WEP,      /**< WEP */
117         SMARTTHINGS_WIFI_AUTHTYPE_WPA_PSK,  /**< WPA-PSK */
118         SMARTTHINGS_WIFI_AUTHTYPE_WPA2_PSK  /**< WPA2-PSK */
119 } smartthings_wifi_authtype_e;
120
121 /**
122  * @brief The Wi-Fi encryption type of access point.
123  * @since_ses 1
124  */
125 typedef enum {
126         SMARTTHINGS_WIFI_ENCTYPE_NONE = 0,      /**< No encryption */
127         SMARTTHINGS_WIFI_ENCTYPE_WEP_64,        /**< WEP 64 */
128         SMARTTHINGS_WIFI_ENCTYPE_WEP_128,       /**< WEP 128 */
129         SMARTTHINGS_WIFI_ENCTYPE_TKIP,          /**< TKIP */
130         SMARTTHINGS_WIFI_ENCTYPE_AES,           /**< AES */
131         SMARTTHINGS_WIFI_ENCTYPE_TKIP_AES       /**< TKIP/AES */
132 } smartthings_wifi_enctype_e;
133
134 /**
135  * @brief The SmartThings handle.
136  * @since_ses 1
137  */
138 typedef struct smartthings_s *smartthings_h;
139
140 /**
141  * @brief The access point information handle.
142  * @since_ses 1
143  */
144 typedef struct smartthings_ap_info_s *smartthings_ap_info_h;
145
146 /**
147  * @brief The device provisioning information handle.
148  * @since_ses 1
149  */
150 typedef struct smartthings_device_prov_info_s *smartthings_device_prov_info_h;
151
152 /**
153  * @brief The cloud information handle for cloud sign-up.
154  * @since_ses 1
155  */
156 typedef struct smartthings_cloud_info_s *smartthings_cloud_info_h;
157
158 /**
159  * @brief The access point list handle.
160  * @since_ses 1
161  */
162 typedef struct smartthings_ap_list_s *smartthings_ap_list_h;
163
164 /**
165  * @brief Callback for status of connection to SmartThings Thing agent.
166  * @details The following error codes can be received: \n
167         #SMARTTHINGS_ERROR_NONE:                               Success \n
168         #SMARTTHINGS_ERROR_PERMISSION_DENIED:      Permission denied \n
169         #SMARTTHINGS_ERROR_SERVICE_UNAVAILABLE:   Service unavailable \n
170  * @since_ses 1
171  *
172  * @remarks The @a handle should not be released.
173  * @remarks The @a handle is the same object for which the callback was set/added.
174  * @remarks The @a handle will be released when smartthings_deinitialize() is called.
175  * @remarks When callback is called, user can see result as #smartthings_error_e enumeration value.
176  * @remarks When callback is called, user can see connection status as #smartthings_connection_status_e enumeration value.
177  *
178  * @param[in] result The result of connection operation
179  * @param[in] handle The SmartThings handle
180  * @param[in] status The status of connection
181  * @param[in] user_data The user data passed from the callback registration function
182  *
183  * @see smartthings_initialize()
184  */
185 typedef void (*smartthings_connection_status_cb)(smartthings_error_e result, smartthings_h handle, smartthings_connection_status_e status, void *user_data);
186
187 /**
188  * @brief Callback for SmartThings Thing status.
189  * @since_ses 1
190  *
191  * @remarks The @a handle should not be released.
192  * @remarks The @a handle is the same object for which the callback was set/added.
193  * @remarks The @a handle will be released when smartthings_deinitialize() is called.
194  * @remarks When callback is called, user can see SmartThings status as #smartthings_status_e enumeration value.
195  *
196  * @param[in] handle The SmartThings handle
197  * @param[in] status The status of SmartThings
198  * @param[in] user_data The user data passed from the callback registration function
199  *
200  * @see smartthings_set_status_changed_cb()
201  * @see smartthings_unset_status_changed_cb()
202  */
203 typedef void (*smartthings_status_changed_cb)(smartthings_h handle, smartthings_status_e status, void *user_data);
204
205 /**
206  * @brief Callback for getting user's input regarding mutual verification.
207  * @since_ses 1
208  *
209  * @remarks The @a handle should not be released.
210  * @remarks The @a handle is the same object for which the callback was set/added.
211  * @remarks The @a handle will be released when smartthings_deinitialize() is called.
212  * @remarks When callback is called, user can send a confirmation for mutual verification as true or false.
213  *
214  * @param[in] handle The SmartThings handle
215  * @param[in] user_data The user data passed from the callback registration function
216  *
217  * @see smartthings_set_user_confirm_cb()
218  * @see smartthings_unset_user_confirm_cb()
219  */
220 typedef void (*smartthings_user_confirm_cb)(smartthings_h handle, void *user_data);
221
222 /**
223  * @brief Callback for getting user's opinion regarding device reset.
224  * @since_ses 1
225  *
226  * @remarks The @a handle should not be released.
227  * @remarks The @a handle is the same object for which the callback was set/added.
228  * @remarks The @a handle will be released when smartthings_deinitialize() is called.
229  * @remarks When callback is called, user can sends a confirmation for reset as true or false.
230  *
231  * @param[in] handle The SmartThings handle
232  * @param[in] user_data The user data passed from the callback registration function
233  *
234  * @see smartthings_set_reset_confirm_cb()
235  * @see smartthings_unset_reset_confirm_cb()
236  */
237 typedef void (*smartthings_reset_confirm_cb)(smartthings_h handle, void *user_data);
238
239 /**
240  * @brief Callback for result of reset operation.
241  * @since_ses 1
242  *
243  * @remarks The @a handle should not be released.
244  * @remarks The @a handle is the same object for which the callback was set/added.
245  * @remarks The @a handle will be released when smartthings_deinitialize() is called.
246  * @remarks When callback is called, user can check reset operation succeeds or fails.
247  *
248  * @param[in] handle The SmartThings handle
249  * @param[in] result The result of reset
250  * @param[in] user_data The user data passed from the callback registration function
251  *
252  * @see smartthings_set_reset_result_cb()
253  * @see smartthings_unset_reset_result_cb()
254  */
255 typedef void (*smartthings_reset_result_cb)(smartthings_h handle, bool result, void *user_data);
256
257 /**
258  * @brief Callback for carrying the randomly generated PIN information.
259  * @since_ses 1
260  *
261  * @remarks The @a handle should not be released.
262  * @remarks The @a handle is the same object for which the callback was set/added.
263  * @remarks The @a handle will be released when smartthings_deinitialize() is called.
264  * @remarks The @a pin can be used only in the callback. To use outside, make a copy.
265  * @remarks When callback is called, user can see PIN value and length.
266  *
267  * @param[in] handle The SmartThings handle
268  * @param[in] pin The PIN data in string format
269  * @param[in] size The PIN length of @a pin
270  * @param[in] user_data The user data passed from the callback registration function
271  *
272  * @see smartthings_set_pin_cb()
273  * @see smartthings_unset_pin_cb()
274  */
275 typedef void (*smartthings_pin_generated_cb)(smartthings_h handle, const char* pin, size_t size, void *user_data);
276
277 /**
278  * @brief Callback for informing the application to close the PIN display.
279  * @since_ses 1
280  *
281  * @remarks The @a handle should not be released.
282  * @remarks The @a handle is the same object for which the callback was set/added.
283  * @remarks The @a handle will be released when smartthings_deinitialize() is called.
284  * @remarks When callback is called, user can know PIN based ownership transfer is finished.
285  *
286  * @param[in] handle The SmartThings handle
287  * @param[in] user_data The user data passed from the callback registration function
288  *
289  * @see smartthings_set_pin_cb()
290  * @see smartthings_unset_pin_cb()
291  */
292 typedef void (*smartthings_pin_display_close_cb)(smartthings_h handle, void *user_data);
293
294 /**
295  * @brief Callback for informing Wi-Fi AP information to connect.
296  * @since_ses 1
297  *
298  * @remarks The @a handle should not be released.
299  * @remarks The @a handle is the same object for which the callback was set/added.
300  * @remarks The @a handle will be released when smartthings_deinitialize() is called.
301  * @remarks The @a ap_info_h should not be released.
302  * @remarks The @a ap_info_h will be released when smartthings_unset_wifi_ap_provisioning_cb() is called.
303  * @remarks When callback is called, user can get Wi-Fi provisioning information.
304  *
305  * @param[in] handle The SmartThings handle
306  * @param[in] ap_info_h The AP information handle
307  * @param[in] user_data The user data passed from the callback registration function
308  *
309  * @see smartthings_set_wifi_ap_provisioning_cb()
310  * @see smartthings_unset_wifi_ap_provisioning_cb()
311  */
312 typedef void (*smartthings_wifi_ap_provisioning_cb)(smartthings_h handle, smartthings_ap_info_h ap_info_h, void *user_data);
313
314 /**
315  * @brief Callback for informing device provisioning information.
316  * @since_ses 1
317  *
318  * @remarks The @a handle should not be released.
319  * @remarks The @a handle is the same object for which the callback was set/added.
320  * @remarks The @a handle will be released when smartthings_deinitialize() is called.
321  * @remarks The @a dev_prov_h should not be released.
322  * @remarks The @a dev_prov_h will be released when smartthings_unset_device_provisioning_cb() is called.
323  * @remarks When callback is called, user can get device provisioning information.
324  *
325  * @param[in] handle The SmartThings handle
326  * @param[in] dev_prov_h The device provisioning information handle
327  * @param[in] user_data The user data passed from the callback registration function
328  *
329  * @see smartthings_set_device_provisioning_cb()
330  * @see smartthings_unset_device_provisioning_cb()
331  */
332 typedef void (*smartthings_device_provisioning_cb)(smartthings_h handle, smartthings_device_prov_info_h dev_prov_h, void *user_data);
333
334 /**
335  * @brief Callback for informing the scan AP list request.
336  * @since_ses 1
337  *
338  * @remarks The @a handle should not be released.
339  * @remarks The @a handle is the same object for which the callback was set/added.
340  * @remarks The @a handle will be released when smartthings_deinitialize() is called.
341  * @remarks When callback is called, user scans access points, sets AP list and sends it to agent.
342  *
343  * @param[in] handle The SmartThings handle
344  * @param[in] req_id The request ID
345  * @param[in] user_data The user data passed from the callback registration function
346  *
347  * @see smartthings_set_scan_ap_cb()
348  * @see smartthings_unset_scan_ap_cb()
349  */
350 typedef void (*smartthings_scan_ap_cb)(smartthings_h handle, int req_id, void *user_data);
351
352 /**
353  * @brief Callback for informing the stop soft AP request.
354  * @since_ses 1
355  *
356  * @remarks The @a handle should not be released.
357  * @remarks The @a handle is the same object for which the callback was set/added.
358  * @remarks The @a handle will be released when smartthings_deinitialize() is called.
359  * @remarks When callback is called, user stops soft AP.
360  *
361  * @param[in] handle The SmartThings handle
362  * @param[in] user_data The user data passed from the callback registration function
363  *
364  * @see smartthings_set_stop_soft_ap_cb()
365  * @see smartthings_unset_stop_soft_ap_cb()
366  */
367 typedef void (*smartthings_stop_soft_ap_cb)(smartthings_h handle, void *user_data);
368
369 /**
370  * @brief Creates a handle and connects to agent.
371  * @since_ses 1
372  * @privilege %http://com.samsung.tizen.smartthings-thing/appdefined/smartthings-thing.master \n
373  *            %http://tizen.org/privilege/appmanager.launch \n
374  *            %http://tizen.org/privilege/datasharing
375  *
376  * @remarks The @a handle must be released using smartthings_deinitialize().
377  * @remarks Ths function returns #SMARTTHINGS_ERROR_PERMISSION_DENIED\n
378  *          if the application has no app-defined privilege for 'http://com.samsung.tizen.smartthings-thing/appdefined/smartthings-thing.master'.
379  *
380  * @param[out] handle The SmartThings handle to be newly created on success
381  * @param[in] connection_status_cb The RPC connection status callback to register
382  * @param[in] user_data The user data to be passed to the callback function
383  *
384  * @return @c 0 on success,
385  *         otherwise a negative error value
386  * @retval #SMARTTHINGS_ERROR_NONE Successful
387  * @retval #SMARTTHINGS_ERROR_INVALID_PARAMETER Invalid parameter
388  * @retval #SMARTTHINGS_ERROR_OUT_OF_MEMORY Out of memory
389  * @retval #SMARTTHINGS_ERROR_PERMISSION_DENIED Permission denied
390  * @retval #SMARTTHINGS_ERROR_OPERATION_FAILED Operation failed
391  * @retval #SMARTTHINGS_ERROR_NOT_SUPPORTED Not supported
392  * @retval #SMARTTHINGS_ERROR_SERVICE_UNAVAILABLE Service unavailable
393  *
394  * @see smartthings_deinitialize()
395  */
396 int smartthings_initialize(smartthings_h *handle,
397                                                 smartthings_connection_status_cb connection_status_cb,
398                                                 void *user_data);
399
400 /**
401  * @brief Deinitializes a handle and disconnects from the agent.
402  * @since_ses 1
403  *
404  * @param[in] handle The SmartThings handle
405  *
406  * @return @c 0 on success,
407  *         otherwise a negative error value
408  * @retval #SMARTTHINGS_ERROR_NONE Successful
409  * @retval #SMARTTHINGS_ERROR_INVALID_PARAMETER Invalid parameter
410  * @retval #SMARTTHINGS_ERROR_OPERATION_FAILED Operation failed
411  *
412  * @see smartthings_initialize()
413  */
414 int smartthings_deinitialize(smartthings_h handle);
415
416 /**
417  * @brief Starts SmartThings Thing operation.
418  * @since_ses 1
419  * @privilege %http://com.samsung.tizen.smartthings-thing/appdefined/smartthings-thing.master \n
420  *            %http://tizen.org/privilege/appmanager.launch \n
421  *            %http://tizen.org/privilege/datasharing
422  *
423  * @param[in] handle The SmartThings handle
424  *
425  * @return @c 0 on success,
426  *         otherwise a negative error value
427  * @retval #SMARTTHINGS_ERROR_NONE Successful
428  * @retval #SMARTTHINGS_ERROR_INVALID_PARAMETER Invalid parameter
429  * @retval #SMARTTHINGS_ERROR_PERMISSION_DENIED Permission denied
430  * @retval #SMARTTHINGS_ERROR_OPERATION_FAILED Operation failed
431  * @retval #SMARTTHINGS_ERROR_SERVICE_UNAVAILABLE Service unavailable
432  *
433  * @see smartthings_stop()
434  */
435 int smartthings_start(smartthings_h handle);
436
437 /**
438  * @brief Stops SmartThings Thing operation.
439  * @since_ses 1
440  * @privilege %http://com.samsung.tizen.smartthings-thing/appdefined/smartthings-thing.master \n
441  *            %http://tizen.org/privilege/appmanager.launch \n
442  *            %http://tizen.org/privilege/datasharing
443  *
444  * @param[in] handle The SmartThings handle
445  *
446  * @return @c 0 on success,
447  *         otherwise a negative error value
448  * @retval #SMARTTHINGS_ERROR_NONE Successful
449  * @retval #SMARTTHINGS_ERROR_INVALID_PARAMETER Invalid parameter
450  * @retval #SMARTTHINGS_ERROR_PERMISSION_DENIED Permission denied
451  * @retval #SMARTTHINGS_ERROR_OPERATION_FAILED Operation failed
452  * @retval #SMARTTHINGS_ERROR_SERVICE_UNAVAILABLE Service unavailable
453  *
454  * @see smartthings_start()
455  */
456 int smartthings_stop(smartthings_h handle);
457
458 /**
459  * @brief Sets thing status changed callback.
460  * @since_ses 1
461  * @privilege %http://com.samsung.tizen.smartthings-thing/appdefined/smartthings-thing.master \n
462  *            %http://tizen.org/privilege/appmanager.launch \n
463  *            %http://tizen.org/privilege/datasharing
464  *
465  * @remarks Only one callback function can be set with this function.
466  * @remarks If multiple callbacks are set, the last one is registered only.
467  * @remarks Callback is called when SmartThings status is changed.
468  * @remarks When callback is called, user can get SmartThings status as #smartthings_status_e enumeration value.
469  *
470  * @param[in] handle The SmartThings handle
471  * @param[in] status_cb The status changed callback to register
472  * @param[in] user_data The user data to be passed to the callback function
473  *
474  * @return @c 0 on success,
475  *         otherwise a negative error value
476  * @retval #SMARTTHINGS_ERROR_NONE Successful
477  * @retval #SMARTTHINGS_ERROR_INVALID_PARAMETER Invalid parameter
478  * @retval #SMARTTHINGS_ERROR_PERMISSION_DENIED Permission denied
479  * @retval #SMARTTHINGS_ERROR_OPERATION_FAILED Operation failed
480  * @retval #SMARTTHINGS_ERROR_SERVICE_UNAVAILABLE Service unavailable
481  *
482  * @see smartthings_unset_status_changed_cb()
483  */
484 int smartthings_set_status_changed_cb(smartthings_h handle,
485                                                                 smartthings_status_changed_cb status_cb,
486                                                                 void *user_data);
487
488 /**
489  * @brief Unsets thing status changed callback.
490  * @since_ses 1
491  * @privilege %http://com.samsung.tizen.smartthings-thing/appdefined/smartthings-thing.master \n
492  *            %http://tizen.org/privilege/appmanager.launch \n
493  *            %http://tizen.org/privilege/datasharing
494  *
495  * @param[in] handle The SmartThings handle
496  *
497  * @return @c 0 on success,
498  *         otherwise a negative error value
499  * @retval #SMARTTHINGS_ERROR_NONE Successful
500  * @retval #SMARTTHINGS_ERROR_INVALID_PARAMETER Invalid parameter
501  * @retval #SMARTTHINGS_ERROR_PERMISSION_DENIED Permission denied
502  * @retval #SMARTTHINGS_ERROR_OPERATION_FAILED Operation failed
503  * @retval #SMARTTHINGS_ERROR_SERVICE_UNAVAILABLE Service unavailable
504  *
505  * @see smartthings_set_status_changed_cb()
506  */
507 int smartthings_unset_status_changed_cb(smartthings_h handle);
508
509 /**
510  * @brief Sets test certificate files.
511  * @since_ses 1
512  * @privilege %http://com.samsung.tizen.smartthings-thing/appdefined/smartthings-thing.master \n
513  *            %http://tizen.org/privilege/appmanager.launch \n
514  *            %http://tizen.org/privilege/datasharing
515  *
516  * @remarks These files should be placed in 'res' directory of application.
517  * @remarks This function is needed only for using test certificate.
518  * @remarks This function can be used before smartthings_start()
519  *
520  * @param[in] handle The SmartThings handle
521  * @param[in] certificate The certificate file
522  * @param[in] private_key The private key file
523  *
524  * @return @c 0 on success,
525  *         otherwise a negative error value
526  * @retval #SMARTTHINGS_ERROR_NONE Successful
527  * @retval #SMARTTHINGS_ERROR_INVALID_PARAMETER Invalid parameter
528  * @retval #SMARTTHINGS_ERROR_PERMISSION_DENIED Permission denied
529  * @retval #SMARTTHINGS_ERROR_OPERATION_FAILED Operation failed
530  * @retval #SMARTTHINGS_ERROR_SERVICE_UNAVAILABLE Service unavailable
531  */
532 int smartthings_set_certificate_file(smartthings_h handle, const char *certificate, const char *private_key);
533
534 /**
535  * @brief Sets device property for Easy-setup.
536  * @since_ses 1
537  *
538  * @remarks This function can be used before smartthings_start()
539  *
540  * @param[in] handle The SmartThings handle
541  * @param[in] dev_name The device name
542  * @param[in] wifi_mode The supported Wi-Fi mode (bit masked value for #smartthings_wifi_mode_e)
543  * @param[in] wifi_freq The supported Wi-Fi frequency (bit masked value for #smartthings_wifi_freq_e)
544  *
545  * @return @c 0 on success,
546  *         otherwise a negative error value
547  * @retval #SMARTTHINGS_ERROR_NONE Successful
548  * @retval #SMARTTHINGS_ERROR_INVALID_PARAMETER Invalid parameter
549  */
550 int smartthings_set_device_property(smartthings_h handle, const char* dev_name, int wifi_mode, int wifi_freq);
551
552 /**
553  * @brief Gets a device ID.
554  * @since_ses 1
555  * @privilege %http://com.samsung.tizen.smartthings-thing/appdefined/smartthings-thing.master \n
556  *            %http://tizen.org/privilege/appmanager.launch \n
557  *            %http://tizen.org/privilege/datasharing
558  *
559  * @remarks The @a device_id should be released using free().
560  *
561  * @param[in] handle The SmartThings handle
562  * @param[out] device_id The device ID
563  *
564  * @return @c 0 on success,
565  *         otherwise a negative error value
566  * @retval #SMARTTHINGS_ERROR_NONE Successful
567  * @retval #SMARTTHINGS_ERROR_INVALID_PARAMETER Invalid parameter
568  * @retval #SMARTTHINGS_ERROR_PERMISSION_DENIED Permission denied
569  * @retval #SMARTTHINGS_ERROR_OPERATION_FAILED Operation failed
570  * @retval #SMARTTHINGS_ERROR_SERVICE_UNAVAILABLE Service unavailable
571  */
572 int smartthings_get_device_id(smartthings_h handle, char **device_id);
573
574 /**
575  * @brief Gets a Easy-setup status.
576  * @since_ses 1
577  * @privilege %http://com.samsung.tizen.smartthings-thing/appdefined/smartthings-thing.master \n
578  *            %http://tizen.org/privilege/appmanager.launch \n
579  *            %http://tizen.org/privilege/datasharing
580  *
581  * @param[in] handle The SmartThings handle
582  * @param[out] is_completed The status of Easy-setup whether it is completed or not
583  *
584  * @return @c 0 on success,
585  *         otherwise a negative error value
586  * @retval #SMARTTHINGS_ERROR_NONE Successful
587  * @retval #SMARTTHINGS_ERROR_INVALID_PARAMETER Invalid parameter
588  * @retval #SMARTTHINGS_ERROR_PERMISSION_DENIED Permission denied
589  * @retval #SMARTTHINGS_ERROR_OPERATION_FAILED Operation failed
590  * @retval #SMARTTHINGS_ERROR_SERVICE_UNAVAILABLE Service unavailable
591  */
592 int smartthings_get_easysetup_status(smartthings_h handle, bool *is_completed);
593
594 /**
595  * @brief Starts Easy-setup mode.
596  *
597  * @details This function requests for turning on soft AP to SmartThings Thing agent.
598  * @since_ses 1
599  * @privilege %http://com.samsung.tizen.smartthings-thing/appdefined/smartthings-thing.master \n
600  *            %http://tizen.org/privilege/appmanager.launch \n
601  *            %http://tizen.org/privilege/datasharing \n
602  *            %http://tizen.org/privilege/softap
603  *
604  * @param[in] handle The SmartThings handle
605  *
606  * @return @c 0 on success,
607  *         otherwise a negative error value
608  * @retval #SMARTTHINGS_ERROR_NONE Successful
609  * @retval #SMARTTHINGS_ERROR_INVALID_PARAMETER Invalid parameter
610  * @retval #SMARTTHINGS_ERROR_PERMISSION_DENIED Permission denied
611  * @retval #SMARTTHINGS_ERROR_OPERATION_FAILED Operation failed
612  * @retval #SMARTTHINGS_ERROR_SERVICE_UNAVAILABLE Service unavailable
613  *
614  * @see smartthings_stop_easysetup()
615  */
616 int smartthings_start_easysetup(smartthings_h handle);
617
618 /**
619  * @brief Stops Easy-setup mode.
620  *
621  * @details This function requests for turning off soft AP to SmartThings Thing agent.
622  * @since_ses 1
623  * @privilege %http://com.samsung.tizen.smartthings-thing/appdefined/smartthings-thing.master \n
624  *            %http://tizen.org/privilege/appmanager.launch \n
625  *            %http://tizen.org/privilege/datasharing \n
626  *            %http://tizen.org/privilege/softap
627  *
628  * @param[in] handle The SmartThings handle
629  *
630  * @return @c 0 on success,
631  *         otherwise a negative error value
632  * @retval #SMARTTHINGS_ERROR_NONE Successful
633  * @retval #SMARTTHINGS_ERROR_INVALID_PARAMETER Invalid parameter
634  * @retval #SMARTTHINGS_ERROR_PERMISSION_DENIED Permission denied
635  * @retval #SMARTTHINGS_ERROR_OPERATION_FAILED Operation failed
636  * @retval #SMARTTHINGS_ERROR_SERVICE_UNAVAILABLE Service unavailable
637  *
638  * @see smartthings_start_easysetup()
639  */
640 int smartthings_stop_easysetup(smartthings_h handle);
641
642 /**
643  * @brief Sets callback for getting user confirmation for mutual verification based just work ownership transfer.
644  * @since_ses 1
645  * @privilege %http://com.samsung.tizen.smartthings-thing/appdefined/smartthings-thing.master \n
646  *            %http://tizen.org/privilege/appmanager.launch \n
647  *            %http://tizen.org/privilege/datasharing
648  *
649  * @remarks Only one callback function can be set with this function.
650  * @remarks If multiple callbacks are set, the last one is registered only.
651  * @remarks Callback is called when it needs user's confirm for mutual verification based just work ownership transfer.
652  * @remarks When callback is called, user can send a confirmation for mutual verification based just work ownership transfer as true or false.
653  *
654  * @param[in] handle The SmartThings handle
655  * @param[in] confirm_cb The user confirm callback to register
656  * @param[in] user_data The user data to be passed to the callback function
657  *
658  * @return @c 0 on success,
659  *         otherwise a negative error value
660  * @retval #SMARTTHINGS_ERROR_NONE Successful
661  * @retval #SMARTTHINGS_ERROR_INVALID_PARAMETER Invalid parameter
662  * @retval #SMARTTHINGS_ERROR_PERMISSION_DENIED Permission denied
663  * @retval #SMARTTHINGS_ERROR_OPERATION_FAILED Operation failed
664  * @retval #SMARTTHINGS_ERROR_SERVICE_UNAVAILABLE Service unavailable
665  *
666  * @see smartthings_unset_user_confirm_cb()
667  */
668 int smartthings_set_user_confirm_cb(smartthings_h handle,
669                                                                 smartthings_user_confirm_cb confirm_cb,
670                                                                 void *user_data);
671
672 /**
673  * @brief Unsets user confirmation callback.
674  * @since_ses 1
675  * @privilege %http://com.samsung.tizen.smartthings-thing/appdefined/smartthings-thing.master \n
676  *            %http://tizen.org/privilege/appmanager.launch \n
677  *            %http://tizen.org/privilege/datasharing
678  *
679  * @param[in] handle The SmartThings handle
680  *
681  * @return @c 0 on success,
682  *         otherwise a negative error value
683  * @retval #SMARTTHINGS_ERROR_NONE Successful
684  * @retval #SMARTTHINGS_ERROR_INVALID_PARAMETER Invalid parameter
685  * @retval #SMARTTHINGS_ERROR_PERMISSION_DENIED Permission denied
686  * @retval #SMARTTHINGS_ERROR_OPERATION_FAILED Operation failed
687  * @retval #SMARTTHINGS_ERROR_SERVICE_UNAVAILABLE Service unavailable
688  *
689  * @see smartthings_set_user_confirm_cb()
690  */
691 int smartthings_unset_user_confirm_cb(smartthings_h handle);
692
693 /**
694  * @brief Sets reset confirmation callback.
695  * @since_ses 1
696  * @privilege %http://com.samsung.tizen.smartthings-thing/appdefined/smartthings-thing.master \n
697  *            %http://tizen.org/privilege/appmanager.launch \n
698  *            %http://tizen.org/privilege/datasharing
699  *
700  * @remarks Only one callback function can be set with this function.
701  * @remarks If multiple callbacks are set, the last one is registered only.
702  * @remarks Callback is called when it needs user's confirm for reset.
703  * @remarks When callback is called, user can send a confirmation for reset as true or false.
704  *
705  * @param[in] handle The SmartThings handle
706  * @param[in] confirm_cb The reset confirm callback to register
707  * @param[in] user_data The user data to be passed to the callback function
708  *
709  * @return @c 0 on success,
710  *         otherwise a negative error value
711  * @retval #SMARTTHINGS_ERROR_NONE Successful
712  * @retval #SMARTTHINGS_ERROR_INVALID_PARAMETER Invalid parameter
713  * @retval #SMARTTHINGS_ERROR_PERMISSION_DENIED Permission denied
714  * @retval #SMARTTHINGS_ERROR_OPERATION_FAILED Operation failed
715  * @retval #SMARTTHINGS_ERROR_SERVICE_UNAVAILABLE Service unavailable
716  *
717  * @see smartthings_unset_reset_confirm_cb()
718  */
719 int smartthings_set_reset_confirm_cb(smartthings_h handle,
720                                                                 smartthings_reset_confirm_cb confirm_cb,
721                                                                 void *user_data);
722
723 /**
724  * @brief Unsets reset confirmation callback.
725  * @since_ses 1
726  * @privilege %http://com.samsung.tizen.smartthings-thing/appdefined/smartthings-thing.master \n
727  *            %http://tizen.org/privilege/appmanager.launch \n
728  *            %http://tizen.org/privilege/datasharing
729  *
730  * @param[in] handle The SmartThings handle
731  *
732  * @return @c 0 on success,
733  *         otherwise a negative error value
734  * @retval #SMARTTHINGS_ERROR_NONE Successful
735  * @retval #SMARTTHINGS_ERROR_INVALID_PARAMETER Invalid parameter
736  * @retval #SMARTTHINGS_ERROR_PERMISSION_DENIED Permission denied
737  * @retval #SMARTTHINGS_ERROR_OPERATION_FAILED Operation failed
738  * @retval #SMARTTHINGS_ERROR_SERVICE_UNAVAILABLE Service unavailable
739  *
740  * @see smartthings_set_reset_confirm_cb()
741  */
742 int smartthings_unset_reset_confirm_cb(smartthings_h handle);
743
744 /**
745  * @brief Sets reset result callback.
746  * @since_ses 1
747  * @privilege %http://com.samsung.tizen.smartthings-thing/appdefined/smartthings-thing.master \n
748  *            %http://tizen.org/privilege/appmanager.launch \n
749  *            %http://tizen.org/privilege/datasharing
750  *
751  * @remarks Only one callback function can be set with this function.
752  * @remarks If multiple callbacks are set, the last one is registered only.
753  * @remarks Callback is called when reset operation returns its result.
754  * @remarks When callback is called, user can check reset operation succeeds or fails.
755  *
756  * @param[in] handle The SmartThings handle
757  * @param[in] reset_result_cb The reset result callback to register
758  * @param[in] user_data The user data to be passed to the callback function
759  *
760  * @return @c 0 on success,
761  *         otherwise a negative error value
762  * @retval #SMARTTHINGS_ERROR_NONE Successful
763  * @retval #SMARTTHINGS_ERROR_INVALID_PARAMETER Invalid parameter
764  * @retval #SMARTTHINGS_ERROR_PERMISSION_DENIED Permission denied
765  * @retval #SMARTTHINGS_ERROR_OPERATION_FAILED Operation failed
766  * @retval #SMARTTHINGS_ERROR_SERVICE_UNAVAILABLE Service unavailable
767  *
768  * @see smartthings_unset_reset_result_cb()
769  */
770 int smartthings_set_reset_result_cb(smartthings_h handle,
771                                                                 smartthings_reset_result_cb reset_result_cb,
772                                                                 void *user_data);
773
774 /**
775  * @brief Unsets reset result callback.
776  * @since_ses 1
777  * @privilege %http://com.samsung.tizen.smartthings-thing/appdefined/smartthings-thing.master \n
778  *            %http://tizen.org/privilege/appmanager.launch \n
779  *            %http://tizen.org/privilege/datasharing
780  *
781  * @param[in] handle The SmartThings handle
782  *
783  * @return @c 0 on success,
784  *         otherwise a negative error value
785  * @retval #SMARTTHINGS_ERROR_NONE Successful
786  * @retval #SMARTTHINGS_ERROR_INVALID_PARAMETER Invalid parameter
787  * @retval #SMARTTHINGS_ERROR_PERMISSION_DENIED Permission denied
788  * @retval #SMARTTHINGS_ERROR_OPERATION_FAILED Operation failed
789  * @retval #SMARTTHINGS_ERROR_SERVICE_UNAVAILABLE Service unavailable
790  *
791  * @see smartthings_set_reset_result_cb()
792  */
793 int smartthings_unset_reset_result_cb(smartthings_h handle);
794
795
796 /**
797  * @brief Sets callback for getting randomly generated PIN for the PIN-based ownership transfer request.
798  * @since_ses 1
799  * @privilege %http://com.samsung.tizen.smartthings-thing/appdefined/smartthings-thing.master \n
800  *            %http://tizen.org/privilege/appmanager.launch \n
801  *            %http://tizen.org/privilege/datasharing
802  *
803  * @remarks Only one callback function can be set with this function.
804  * @remarks If multiple callbacks are set, the last one is registered only.
805  * @remarks @a generated_cb callback is called when PIN is generated.
806  * @remarks @a close_cb callback is called when PIN based ownership transfer is finished.
807  * @remarks When @a generated_cb callback is called, user can see PIN value and length.
808  * @remarks When @a close_cb callback is called, user can know PIN based ownership transfer is finished.
809  *
810  * @param[in] handle The SmartThings handle
811  * @param[in] generated_cb The PIN generation callback to register
812  * @param[in] close_cb The PIN display close callback to register
813  * @param[in] user_data The user data to be passed to the callback function
814  *
815  * @return @c 0 on success,
816  *         otherwise a negative error value
817  * @retval #SMARTTHINGS_ERROR_NONE Successful
818  * @retval #SMARTTHINGS_ERROR_INVALID_PARAMETER Invalid parameter
819  * @retval #SMARTTHINGS_ERROR_PERMISSION_DENIED Permission denied
820  * @retval #SMARTTHINGS_ERROR_OPERATION_FAILED Operation failed
821  * @retval #SMARTTHINGS_ERROR_SERVICE_UNAVAILABLE Service unavailable
822  *
823  * @see smartthings_unset_pin_cb()
824  */
825 int smartthings_set_pin_cb(smartthings_h handle,
826                                                                 smartthings_pin_generated_cb generated_cb,
827                                                                 smartthings_pin_display_close_cb close_cb,
828                                                                 void *user_data);
829
830 /**
831  * @brief Unsets PIN callback.
832  * @since_ses 1
833  * @privilege %http://com.samsung.tizen.smartthings-thing/appdefined/smartthings-thing.master \n
834  *            %http://tizen.org/privilege/appmanager.launch \n
835  *            %http://tizen.org/privilege/datasharing
836  *
837  * @param[in] handle The SmartThings handle
838  *
839  * @return @c 0 on success,
840  *         otherwise a negative error value
841  * @retval #SMARTTHINGS_ERROR_NONE Successful
842  * @retval #SMARTTHINGS_ERROR_INVALID_PARAMETER Invalid parameter
843  * @retval #SMARTTHINGS_ERROR_PERMISSION_DENIED Permission denied
844  * @retval #SMARTTHINGS_ERROR_OPERATION_FAILED Operation failed
845  * @retval #SMARTTHINGS_ERROR_SERVICE_UNAVAILABLE Service unavailable
846  *
847  * @see smartthings_set_pin_cb()
848  */
849 int smartthings_unset_pin_cb(smartthings_h handle);
850
851 /**
852  * @brief Sets callback for getting Wi-Fi AP information during Easy-setup.
853  * @since_ses 1
854  * @privilege %http://com.samsung.tizen.smartthings-thing/appdefined/smartthings-thing.master \n
855  *            %http://tizen.org/privilege/appmanager.launch \n
856  *            %http://tizen.org/privilege/datasharing
857  *
858  * @remarks Only one callback function can be set with this function.
859  * @remarks If multiple callbacks are set, the last one is registered only.
860  * @remarks Callback is called when Wi-Fi provisioning event occurs.
861  * @remarks When callback is called, user can get Wi-Fi provisioning information.
862  *
863  * @param[in] handle The SmartThings handle
864  * @param[in] wifi_ap_cb The Wi-Fi AP callback to register
865  * @param[in] user_data The user data to be passed to the callback function
866  *
867  * @return @c 0 on success,
868  *         otherwise a negative error value
869  * @retval #SMARTTHINGS_ERROR_NONE Successful
870  * @retval #SMARTTHINGS_ERROR_INVALID_PARAMETER Invalid parameter
871  * @retval #SMARTTHINGS_ERROR_PERMISSION_DENIED Permission denied
872  * @retval #SMARTTHINGS_ERROR_OPERATION_FAILED Operation failed
873  * @retval #SMARTTHINGS_ERROR_SERVICE_UNAVAILABLE Service unavailable
874  *
875  * @see smartthings_unset_wifi_ap_provisioning_cb()
876  */
877 int smartthings_set_wifi_ap_provisioning_cb(smartthings_h handle,
878                                                                 smartthings_wifi_ap_provisioning_cb wifi_ap_cb,
879                                                                 void *user_data);
880
881 /**
882  * @brief Unsets callback for getting Wi-Fi AP information during Easy-setup.
883  * @since_ses 1
884  * @privilege %http://com.samsung.tizen.smartthings-thing/appdefined/smartthings-thing.master \n
885  *            %http://tizen.org/privilege/appmanager.launch \n
886  *            %http://tizen.org/privilege/datasharing
887  *
888  * @param[in] handle The SmartThings handle
889  *
890  * @return @c 0 on success,
891  *         otherwise a negative error value
892  * @retval #SMARTTHINGS_ERROR_NONE Successful
893  * @retval #SMARTTHINGS_ERROR_INVALID_PARAMETER Invalid parameter
894  * @retval #SMARTTHINGS_ERROR_PERMISSION_DENIED Permission denied
895  * @retval #SMARTTHINGS_ERROR_OPERATION_FAILED Operation failed
896  * @retval #SMARTTHINGS_ERROR_SERVICE_UNAVAILABLE Service unavailable
897  *
898  * @see smartthings_set_wifi_ap_provisioning_cb()
899  */
900 int smartthings_unset_wifi_ap_provisioning_cb(smartthings_h handle);
901
902 /**
903  * @brief Sets callback for getting device provisioning information.
904  * @since_ses 1
905  * @privilege %http://com.samsung.tizen.smartthings-thing/appdefined/smartthings-thing.master \n
906  *            %http://tizen.org/privilege/appmanager.launch \n
907  *            %http://tizen.org/privilege/datasharing
908  *
909  * @remarks Only one callback function can be set with this function.
910  * @remarks If multiple callbacks are set, the last one is registered only.
911  * @remarks Callback is called when device provisioning event occurs.
912  * @remarks When callback is called, user can get device provisioning information.
913  *
914  * @param[in] handle The SmartThings handle
915  * @param[in] dev_prov_cb The device provisioning callback to register
916  * @param[in] user_data The user data to be passed to the callback function
917  *
918  * @return @c 0 on success,
919  *         otherwise a negative error value
920  * @retval #SMARTTHINGS_ERROR_NONE Successful
921  * @retval #SMARTTHINGS_ERROR_INVALID_PARAMETER Invalid parameter
922  * @retval #SMARTTHINGS_ERROR_PERMISSION_DENIED Permission denied
923  * @retval #SMARTTHINGS_ERROR_OPERATION_FAILED Operation failed
924  * @retval #SMARTTHINGS_ERROR_SERVICE_UNAVAILABLE Service unavailable
925  *
926  * @see smartthings_unset_device_provisioning_cb()
927  */
928 int smartthings_set_device_provisioning_cb(smartthings_h handle,
929                                                                 smartthings_device_provisioning_cb dev_prov_cb,
930                                                                 void *user_data);
931
932 /**
933  * @brief Unsets callback for getting device provisioning information.
934  * @since_ses 1
935  * @privilege %http://com.samsung.tizen.smartthings-thing/appdefined/smartthings-thing.master \n
936  *            %http://tizen.org/privilege/appmanager.launch \n
937  *            %http://tizen.org/privilege/datasharing
938  *
939  * @param[in] handle The SmartThings handle
940  *
941  * @return @c 0 on success,
942  *         otherwise a negative error value
943  * @retval #SMARTTHINGS_ERROR_NONE Successful
944  * @retval #SMARTTHINGS_ERROR_INVALID_PARAMETER Invalid parameter
945  * @retval #SMARTTHINGS_ERROR_PERMISSION_DENIED Permission denied
946  * @retval #SMARTTHINGS_ERROR_OPERATION_FAILED Operation failed
947  * @retval #SMARTTHINGS_ERROR_SERVICE_UNAVAILABLE Service unavailable
948  *
949  * @see smartthings_set_device_provisioning_cb()
950  */
951 int smartthings_unset_device_provisioning_cb(smartthings_h handle);
952
953 /**
954  * @brief Sets callback for informing the scan AP list request.
955  * @since_ses 1
956  * @privilege %http://com.samsung.tizen.smartthings-thing/appdefined/smartthings-thing.master \n
957  *            %http://tizen.org/privilege/appmanager.launch \n
958  *            %http://tizen.org/privilege/datasharing
959  *
960  * @remarks Only one callback function can be set with this function.
961  * @remarks If multiple callbacks are set, the last one is registered only.
962  * @remarks Callback is called when GET request for access point list.
963  * @remarks When callback is called, user scans access points, sets AP list and sends it to agent.
964  *
965  * @param[in] handle The SmartThings handle
966  * @param[in] scan_ap_cb The callback to register
967  * @param[in] user_data The user data to be passed to the callback function
968  *
969  * @return @c 0 on success,
970  *         otherwise a negative error value
971  * @retval #SMARTTHINGS_ERROR_NONE Successful
972  * @retval #SMARTTHINGS_ERROR_INVALID_PARAMETER Invalid parameter
973  * @retval #SMARTTHINGS_ERROR_PERMISSION_DENIED Permission denied
974  * @retval #SMARTTHINGS_ERROR_OPERATION_FAILED Operation failed
975  * @retval #SMARTTHINGS_ERROR_SERVICE_UNAVAILABLE Service unavailable
976  *
977  * @see smartthings_unset_scan_ap_cb()
978  * @see smartthings_send_ap_list()
979  */
980 int smartthings_set_scan_ap_cb(smartthings_h handle,
981                                                                 smartthings_scan_ap_cb scan_ap_cb,
982                                                                 void *user_data);
983
984 /**
985  * @brief Unsets callback for informing the scan AP list request.
986  * @since_ses 1
987  * @privilege %http://com.samsung.tizen.smartthings-thing/appdefined/smartthings-thing.master \n
988  *            %http://tizen.org/privilege/appmanager.launch \n
989  *            %http://tizen.org/privilege/datasharing
990  *
991  * @param[in] handle The SmartThings handle
992  *
993  * @return @c 0 on success,
994  *         otherwise a negative error value
995  * @retval #SMARTTHINGS_ERROR_NONE Successful
996  * @retval #SMARTTHINGS_ERROR_INVALID_PARAMETER Invalid parameter
997  * @retval #SMARTTHINGS_ERROR_PERMISSION_DENIED Permission denied
998  * @retval #SMARTTHINGS_ERROR_OPERATION_FAILED Operation failed
999  * @retval #SMARTTHINGS_ERROR_SERVICE_UNAVAILABLE Service unavailable
1000  *
1001  * @see smartthings_set_scan_ap_cb()
1002  */
1003 int smartthings_unset_scan_ap_cb(smartthings_h handle);
1004
1005 /**
1006  * @brief Sets callback for informing the stop soft AP request.
1007  * @since_ses 1
1008  * @privilege %http://com.samsung.tizen.smartthings-thing/appdefined/smartthings-thing.master \n
1009  *            %http://tizen.org/privilege/appmanager.launch \n
1010  *            %http://tizen.org/privilege/datasharing
1011  *
1012  * @remarks Only one callback function can be set with this function.
1013  * @remarks If multiple callbacks are set, the last one is registered only.
1014  * @remarks Callback is called when POST request for stopping soft AP.
1015  * @remarks When callback is called, user stops soft AP.
1016  *
1017  * @param[in] handle The SmartThings handle
1018  * @param[in] stop_soft_ap_cb The callback to register
1019  * @param[in] user_data The user data to be passed to the callback function
1020  *
1021  * @return @c 0 on success,
1022  *         otherwise a negative error value
1023  * @retval #SMARTTHINGS_ERROR_NONE Successful
1024  * @retval #SMARTTHINGS_ERROR_INVALID_PARAMETER Invalid parameter
1025  * @retval #SMARTTHINGS_ERROR_PERMISSION_DENIED Permission denied
1026  * @retval #SMARTTHINGS_ERROR_OPERATION_FAILED Operation failed
1027  * @retval #SMARTTHINGS_ERROR_SERVICE_UNAVAILABLE Service unavailable
1028  *
1029  * @see smartthings_unset_stop_soft_ap_cb()
1030  */
1031 int smartthings_set_stop_soft_ap_cb(smartthings_h handle,
1032                                                                 smartthings_stop_soft_ap_cb stop_soft_ap_cb,
1033                                                                 void *user_data);
1034
1035 /**
1036  * @brief Unsets callback for informing the stop soft AP request.
1037  * @since_ses 1
1038  * @privilege %http://com.samsung.tizen.smartthings-thing/appdefined/smartthings-thing.master \n
1039  *            %http://tizen.org/privilege/appmanager.launch \n
1040  *            %http://tizen.org/privilege/datasharing
1041  *
1042  * @param[in] handle The SmartThings handle
1043  *
1044  * @return @c 0 on success,
1045  *         otherwise a negative error value
1046  * @retval #SMARTTHINGS_ERROR_NONE Successful
1047  * @retval #SMARTTHINGS_ERROR_INVALID_PARAMETER Invalid parameter
1048  * @retval #SMARTTHINGS_ERROR_PERMISSION_DENIED Permission denied
1049  * @retval #SMARTTHINGS_ERROR_OPERATION_FAILED Operation failed
1050  * @retval #SMARTTHINGS_ERROR_SERVICE_UNAVAILABLE Service unavailable
1051  *
1052  * @see smartthings_set_stop_soft_ap_cb()
1053  */
1054 int smartthings_unset_stop_soft_ap_cb(smartthings_h handle);
1055
1056 /**
1057  * @brief Sends a user confirmation for MUTUAL VERIFICATION BASED JUST WORK Ownership transfer.
1058  * @since_ses 1
1059  * @privilege %http://com.samsung.tizen.smartthings-thing/appdefined/smartthings-thing.master \n
1060  *            %http://tizen.org/privilege/appmanager.launch \n
1061  *            %http://tizen.org/privilege/datasharing \n
1062  *            %http://tizen.org/privilege/internet
1063  *
1064  * @param[in] handle The SmartThings handle
1065  * @param[in] confirm The user confirmation for OTM(ownership transfer method)
1066  *
1067  * @return @c 0 on success,
1068  *         otherwise a negative error value
1069  * @retval #SMARTTHINGS_ERROR_NONE Successful
1070  * @retval #SMARTTHINGS_ERROR_INVALID_PARAMETER Invalid parameter
1071  * @retval #SMARTTHINGS_ERROR_PERMISSION_DENIED Permission denied
1072  * @retval #SMARTTHINGS_ERROR_OPERATION_FAILED Operation failed
1073  * @retval #SMARTTHINGS_ERROR_SERVICE_UNAVAILABLE Service unavailable
1074  *
1075  * @see smartthings_set_user_confirm_cb()
1076  * @see smartthings_unset_user_confirm_cb()
1077  */
1078 int smartthings_send_user_confirm(smartthings_h handle, bool confirm);
1079
1080
1081 /**
1082  * @brief Sends a reset confirmation.
1083  * @since_ses 1
1084  * @privilege %http://com.samsung.tizen.smartthings-thing/appdefined/smartthings-thing.master \n
1085  *            %http://tizen.org/privilege/appmanager.launch \n
1086  *            %http://tizen.org/privilege/datasharing \n
1087  *            %http://tizen.org/privilege/internet
1088  *
1089  * @param[in] handle The SmartThings handle
1090  * @param[in] confirm The reset confirmation
1091  *
1092  * @return @c 0 on success,
1093  *         otherwise a negative error value
1094  * @retval #SMARTTHINGS_ERROR_NONE Successful
1095  * @retval #SMARTTHINGS_ERROR_INVALID_PARAMETER Invalid parameter
1096  * @retval #SMARTTHINGS_ERROR_PERMISSION_DENIED Permission denied
1097  * @retval #SMARTTHINGS_ERROR_OPERATION_FAILED Operation failed
1098  * @retval #SMARTTHINGS_ERROR_SERVICE_UNAVAILABLE Service unavailable
1099  *
1100  * @see smartthings_set_reset_confirm_cb()
1101  * @see smartthings_unset_reset_confirm_cb()
1102  */
1103 int smartthings_send_reset_confirm(smartthings_h handle, bool confirm);
1104
1105 /**
1106  * @brief Sends a reset command for resetting the device's Cloud signup and Easy-setup.
1107  * @since_ses 1
1108  * @privilege %http://com.samsung.tizen.smartthings-thing/appdefined/smartthings-thing.master \n
1109  *            %http://tizen.org/privilege/appmanager.launch \n
1110  *            %http://tizen.org/privilege/datasharing \n
1111  *            %http://tizen.org/privilege/internet
1112  *
1113  * @param[in] handle The SmartThings handle
1114  *
1115  * @return @c 0 on success,
1116  *         otherwise a negative error value
1117  * @retval #SMARTTHINGS_ERROR_NONE Successful
1118  * @retval #SMARTTHINGS_ERROR_INVALID_PARAMETER Invalid parameter
1119  * @retval #SMARTTHINGS_ERROR_PERMISSION_DENIED Permission denied
1120  * @retval #SMARTTHINGS_ERROR_OPERATION_FAILED Operation failed
1121  * @retval #SMARTTHINGS_ERROR_SERVICE_UNAVAILABLE Service unavailable
1122  *
1123  * @see smartthings_set_reset_result_cb()
1124  * @see smartthings_unset_reset_result_cb()
1125  */
1126 int smartthings_reset(smartthings_h handle);
1127
1128 /**
1129  * @brief Gets SSID of access point.
1130  * @since_ses 1
1131  *
1132  * @remarks The @a ssid should be released using free().
1133  *
1134  * @param[in] ap_info_h The SmartThings AP information handle
1135  * @param[out] ssid The SSID name
1136  *
1137  * @return @c 0 on success,
1138  *         otherwise a negative error value
1139  * @retval #SMARTTHINGS_ERROR_NONE Successful
1140  * @retval #SMARTTHINGS_ERROR_INVALID_PARAMETER Invalid parameter
1141  * @retval #SMARTTHINGS_ERROR_OPERATION_FAILED Operation failed
1142  *
1143  * @see smartthings_set_wifi_ap_provisioning_cb()
1144  * @see smartthings_unset_wifi_ap_provisioning_cb()
1145  */
1146 int smartthings_apinfo_get_ssid(smartthings_ap_info_h ap_info_h, char **ssid);
1147
1148 /**
1149  * @brief Gets password of access point.
1150  * @since_ses 1
1151  *
1152  * @remarks The @a pwd should be released using free().
1153  *
1154  * @param[in] ap_info_h The SmartThings AP information handle
1155  * @param[out] pwd The password
1156  *
1157  * @return @c 0 on success,
1158  *         otherwise a negative error value
1159  * @retval #SMARTTHINGS_ERROR_NONE Successful
1160  * @retval #SMARTTHINGS_ERROR_INVALID_PARAMETER Invalid parameter
1161  * @retval #SMARTTHINGS_ERROR_OPERATION_FAILED Operation failed
1162  *
1163  * @see smartthings_set_wifi_ap_provisioning_cb()
1164  * @see smartthings_unset_wifi_ap_provisioning_cb()
1165  */
1166 int smartthings_apinfo_get_password(smartthings_ap_info_h ap_info_h, char **pwd);
1167
1168 /**
1169  * @brief Gets authentification type of access point.
1170  * @since_ses 1
1171  *
1172  * @param[in] ap_info_h The SmartThings AP information handle
1173  * @param[out] authtype The authentification type
1174  *
1175  * @return @c 0 on success,
1176  *         otherwise a negative error value
1177  * @retval #SMARTTHINGS_ERROR_NONE Successful
1178  * @retval #SMARTTHINGS_ERROR_INVALID_PARAMETER Invalid parameter
1179  * @retval #SMARTTHINGS_ERROR_OPERATION_FAILED Operation failed
1180  *
1181  * @see smartthings_set_wifi_ap_provisioning_cb()
1182  * @see smartthings_unset_wifi_ap_provisioning_cb()
1183  */
1184 int smartthings_apinfo_get_authtype(smartthings_ap_info_h ap_info_h, smartthings_wifi_authtype_e *authtype);
1185
1186 /**
1187  * @brief Gets encryption type of access point.
1188  * @since_ses 1
1189  *
1190  * @param[in] ap_info_h The SmartThings AP information handle
1191  * @param[out] enctype The encryption type
1192  *
1193  * @return @c 0 on success,
1194  *         otherwise a negative error value
1195  * @retval #SMARTTHINGS_ERROR_NONE Successful
1196  * @retval #SMARTTHINGS_ERROR_INVALID_PARAMETER Invalid parameter
1197  * @retval #SMARTTHINGS_ERROR_OPERATION_FAILED Operation failed
1198  *
1199  * @see smartthings_set_wifi_ap_provisioning_cb()
1200  * @see smartthings_unset_wifi_ap_provisioning_cb()
1201  */
1202 int smartthings_apinfo_get_enctype(smartthings_ap_info_h ap_info_h, smartthings_wifi_enctype_e *enctype);
1203
1204 /**
1205  * @brief Gets channel information of access point.
1206  * @since_ses 1
1207  *
1208  * @param[in] ap_info_h The SmartThings AP information handle
1209  * @param[out] channel The frequency channel
1210  *
1211  * @return @c 0 on success,
1212  *         otherwise a negative error value
1213  * @retval #SMARTTHINGS_ERROR_NONE Successful
1214  * @retval #SMARTTHINGS_ERROR_INVALID_PARAMETER Invalid parameter
1215  * @retval #SMARTTHINGS_ERROR_OPERATION_FAILED Operation failed
1216  *
1217  * @see smartthings_set_wifi_ap_provisioning_cb()
1218  * @see smartthings_unset_wifi_ap_provisioning_cb()
1219  */
1220 int smartthings_apinfo_get_channel(smartthings_ap_info_h ap_info_h, int *channel);
1221
1222 /**
1223  * @brief Gets language of device provisioing information.
1224  * @since_ses 1
1225  *
1226  * @remarks The @a language should be released using free().
1227  *
1228  * @param[in] dev_prov_h The SmartThings device provisioning information handle
1229  * @param[out] language The IETF language tag using ISO 639X
1230  *
1231  * @return @c 0 on success,
1232  *         otherwise a negative error value
1233  * @retval #SMARTTHINGS_ERROR_NONE Successful
1234  * @retval #SMARTTHINGS_ERROR_INVALID_PARAMETER Invalid parameter
1235  * @retval #SMARTTHINGS_ERROR_OPERATION_FAILED Operation failed
1236  *
1237  * @see smartthings_set_device_provisioning_cb()
1238  * @see smartthings_unset_device_provisioning_cb()
1239  */
1240 int smartthings_devinfo_get_language(smartthings_device_prov_info_h dev_prov_h, char **language);
1241
1242 /**
1243  * @brief Gets country of device provisioing information.
1244  * @since_ses 1
1245  *
1246  * @remarks The @a country should be released using free().
1247  *
1248  * @param[in] dev_prov_h The SmartThings device provisioning information handle
1249  * @param[out] country The ISO Country Code (ISO 3166-1 Alpha-2)
1250  *
1251  * @return @c 0 on success,
1252  *         otherwise a negative error value
1253  * @retval #SMARTTHINGS_ERROR_NONE Successful
1254  * @retval #SMARTTHINGS_ERROR_INVALID_PARAMETER Invalid parameter
1255  * @retval #SMARTTHINGS_ERROR_OPERATION_FAILED Operation failed
1256  *
1257  * @see smartthings_set_device_provisioning_cb()
1258  * @see smartthings_unset_device_provisioning_cb()
1259  */
1260 int smartthings_devinfo_get_country(smartthings_device_prov_info_h dev_prov_h, char **country);
1261
1262 /**
1263  * @brief Gets datetime of device provisioing information.
1264  * @since_ses 1
1265  *
1266  * @remarks The @a datetime should be released using free().
1267  *
1268  * @param[in] dev_prov_h The SmartThings device provisioning information handle
1269  * @param[out] datetime The date and time
1270  *
1271  * @return @c 0 on success,
1272  *         otherwise a negative error value
1273  * @retval #SMARTTHINGS_ERROR_NONE Successful
1274  * @retval #SMARTTHINGS_ERROR_INVALID_PARAMETER Invalid parameter
1275  * @retval #SMARTTHINGS_ERROR_OPERATION_FAILED Operation failed
1276  *
1277  * @see smartthings_set_device_provisioning_cb()
1278  * @see smartthings_unset_device_provisioning_cb()
1279  */
1280 int smartthings_devinfo_get_datetime(smartthings_device_prov_info_h dev_prov_h, char **datetime);
1281
1282 /**
1283  * @brief Creates a SmartThings AP list handle.
1284  * @since_ses 1
1285  *
1286  * @remarks The @a ap_list_h must be released using smartthings_aplist_destroy().
1287  *
1288  * @param[out] ap_list_h The SmartThings AP list handle to be newly created on success
1289  * @param[in] count The count of AP
1290  *
1291  * @return @c 0 on success,
1292  *         otherwise a negative error value
1293  * @retval #SMARTTHINGS_ERROR_NONE Successful
1294  * @retval #SMARTTHINGS_ERROR_INVALID_PARAMETER Invalid parameter
1295  * @retval #SMARTTHINGS_ERROR_OUT_OF_MEMORY Out of memory
1296  *
1297  * @see smartthings_aplist_destroy()
1298  */
1299 int smartthings_aplist_create(smartthings_ap_list_h *ap_list_h, unsigned int count);
1300
1301 /**
1302  * @brief Destroys a SmartThings AP list handle.
1303  * @since_ses 1
1304  *
1305  * @param[in] ap_list_h The SmartThings AP list handle
1306  *
1307  * @return @c 0 on success,
1308  *         otherwise a negative error value
1309  * @retval #SMARTTHINGS_ERROR_NONE Successful
1310  * @retval #SMARTTHINGS_ERROR_INVALID_PARAMETER Invalid parameter
1311  *
1312  * @see smartthings_aplist_create()
1313  */
1314 int smartthings_aplist_destroy(smartthings_ap_list_h ap_list_h);
1315
1316 /**
1317  * @brief Sets SSID at the specific index of AP list handle.
1318  * @since_ses 1
1319  *
1320  * @param[in] ap_list_h The SmartThings AP list handle
1321  * @param[in] idx The index
1322  * @param[in] ssid The SSID of AP
1323  *
1324  * @return @c 0 on success,
1325  *         otherwise a negative error value
1326  * @retval #SMARTTHINGS_ERROR_NONE Successful
1327  * @retval #SMARTTHINGS_ERROR_INVALID_PARAMETER Invalid parameter
1328  *
1329  * @see smartthings_aplist_create()
1330  * @see smartthings_aplist_destroy()
1331  */
1332 int smartthings_aplist_set_ssid(smartthings_ap_list_h ap_list_h, int idx, const char *ssid);
1333
1334 /**
1335  * @brief Sets BSSID at the specific index of AP list handle.
1336  * @since_ses 1
1337  *
1338  * @param[in] ap_list_h The SmartThings AP list handle
1339  * @param[in] idx The index
1340  * @param[in] bssid The BSSID of AP
1341  *
1342  * @return @c 0 on success,
1343  *         otherwise a negative error value
1344  * @retval #SMARTTHINGS_ERROR_NONE Successful
1345  * @retval #SMARTTHINGS_ERROR_INVALID_PARAMETER Invalid parameter
1346  *
1347  * @see smartthings_aplist_create()
1348  * @see smartthings_aplist_destroy()
1349  */
1350 int smartthings_aplist_set_bssid(smartthings_ap_list_h ap_list_h, int idx, const char *bssid);
1351
1352 /**
1353  * @brief Sets authentification type at the specific index of AP list handle.
1354  * @since_ses 1
1355  *
1356  * @param[in] ap_list_h The SmartThings AP list handle
1357  * @param[in] idx The index
1358  * @param[in] authtype The authentification type of AP
1359  *
1360  * @return @c 0 on success,
1361  *         otherwise a negative error value
1362  * @retval #SMARTTHINGS_ERROR_NONE Successful
1363  * @retval #SMARTTHINGS_ERROR_INVALID_PARAMETER Invalid parameter
1364  *
1365  * @see smartthings_aplist_create()
1366  * @see smartthings_aplist_destroy()
1367  */
1368 int smartthings_aplist_set_authtype(smartthings_ap_list_h ap_list_h, int idx, smartthings_wifi_authtype_e authtype);
1369
1370 /**
1371  * @brief Sets encryption type at the specific index of AP list handle.
1372  * @since_ses 1
1373  *
1374  * @param[in] ap_list_h The SmartThings AP list handle
1375  * @param[in] idx The index
1376  * @param[in] enctype The encryption type of AP
1377  *
1378  * @return @c 0 on success,
1379  *         otherwise a negative error value
1380  * @retval #SMARTTHINGS_ERROR_NONE Successful
1381  * @retval #SMARTTHINGS_ERROR_INVALID_PARAMETER Invalid parameter
1382  *
1383  * @see smartthings_aplist_create()
1384  * @see smartthings_aplist_destroy()
1385  */
1386 int smartthings_aplist_set_enctype(smartthings_ap_list_h ap_list_h, int idx, smartthings_wifi_enctype_e enctype);
1387
1388 /**
1389  * @brief Sets frequency channel at the specific index of AP list handle.
1390  * @since_ses 1
1391  *
1392  * @param[in] ap_list_h The SmartThings AP list handle
1393  * @param[in] idx The index
1394  * @param[in] channel The frequency channel of AP
1395  *
1396  * @return @c 0 on success,
1397  *         otherwise a negative error value
1398  * @retval #SMARTTHINGS_ERROR_NONE Successful
1399  * @retval #SMARTTHINGS_ERROR_INVALID_PARAMETER Invalid parameter
1400  *
1401  * @see smartthings_aplist_create()
1402  * @see smartthings_aplist_destroy()
1403  */
1404 int smartthings_aplist_set_channel(smartthings_ap_list_h ap_list_h, int idx, int channel);
1405
1406 /**
1407  * @brief Sets signal level at the specific index of AP list handle.
1408  * @since_ses 1
1409  *
1410  * @param[in] ap_list_h The SmartThings AP list handle
1411  * @param[in] idx The index
1412  * @param[in] signal_level The signal level of AP
1413  *
1414  * @return @c 0 on success,
1415  *         otherwise a negative error value
1416  * @retval #SMARTTHINGS_ERROR_NONE Successful
1417  * @retval #SMARTTHINGS_ERROR_INVALID_PARAMETER Invalid parameter
1418  *
1419  * @see smartthings_aplist_create()
1420  * @see smartthings_aplist_destroy()
1421  */
1422 int smartthings_aplist_set_signal_level(smartthings_ap_list_h ap_list_h, int idx, int signal_level);
1423
1424 /**
1425  * @brief Sets max speed rate at the specific index of AP list handle.
1426  * @since_ses 1
1427  *
1428  * @param[in] ap_list_h The SmartThings AP list handle
1429  * @param[in] idx The index
1430  * @param[in] max_rate The max speed rate of AP
1431  *
1432  * @return @c 0 on success,
1433  *         otherwise a negative error value
1434  * @retval #SMARTTHINGS_ERROR_NONE Successful
1435  * @retval #SMARTTHINGS_ERROR_INVALID_PARAMETER Invalid parameter
1436  *
1437  * @see smartthings_aplist_create()
1438  * @see smartthings_aplist_destroy()
1439  */
1440 int smartthings_aplist_set_max_rate(smartthings_ap_list_h ap_list_h, int idx, int max_rate);
1441
1442 /**
1443  * @brief Sends the scanned AP list.
1444  * @since_ses 1
1445  * @privilege %http://com.samsung.tizen.smartthings-thing/appdefined/smartthings-thing.master \n
1446  *            %http://tizen.org/privilege/appmanager.launch \n
1447  *            %http://tizen.org/privilege/datasharing \n
1448  *            %http://tizen.org/privilege/internet
1449  *
1450  * @param[in] handle The SmartThings handle
1451  * @param[in] ap_list_h The SmartThings AP list handle
1452  * @param[in] req_id The request ID
1453  *
1454  * @return @c 0 on success,
1455  *         otherwise a negative error value
1456  * @retval #SMARTTHINGS_ERROR_NONE Successful
1457  * @retval #SMARTTHINGS_ERROR_INVALID_PARAMETER Invalid parameter
1458  * @retval #SMARTTHINGS_ERROR_OUT_OF_MEMORY Out of memory
1459  * @retval #SMARTTHINGS_ERROR_PERMISSION_DENIED Permission denied
1460  * @retval #SMARTTHINGS_ERROR_OPERATION_FAILED Operation failed
1461  * @retval #SMARTTHINGS_ERROR_SERVICE_UNAVAILABLE Service unavailable
1462  *
1463  * @see smartthings_aplist_create()
1464  * @see smartthings_aplist_destroy()
1465  * @see smartthings_set_scan_ap_cb()
1466  */
1467 int smartthings_send_ap_list(smartthings_h handle, smartthings_ap_list_h ap_list_h, int req_id);
1468
1469 /**
1470  * @brief Creates a SmartThings cloud information handle.
1471  * @since_ses 1
1472  *
1473  * @remarks The @a cloud_info_h must be released using smartthings_cloudinfo_destroy().
1474  *
1475  * @param[out] cloud_info_h The SmartThings cloud information handle to be newly created on success
1476  *
1477  * @return @c 0 on success,
1478  *         otherwise a negative error value
1479  * @retval #SMARTTHINGS_ERROR_NONE Successful
1480  * @retval #SMARTTHINGS_ERROR_INVALID_PARAMETER Invalid parameter
1481  * @retval #SMARTTHINGS_ERROR_OUT_OF_MEMORY Out of memory
1482  *
1483  * @see smartthings_cloudinfo_destroy()
1484  */
1485 int smartthings_cloudinfo_create(smartthings_cloud_info_h *cloud_info_h);
1486
1487 /**
1488  * @brief Destroys a SmartThings cloud information handle.
1489  * @since_ses 1
1490  *
1491  * @param[in] cloud_info_h The SmartThings cloud information handle
1492  *
1493  * @return @c 0 on success,
1494  *         otherwise a negative error value
1495  * @retval #SMARTTHINGS_ERROR_NONE Successful
1496  * @retval #SMARTTHINGS_ERROR_INVALID_PARAMETER Invalid parameter
1497  *
1498  * @see smartthings_cloudinfo_create()
1499  */
1500 int smartthings_cloudinfo_destroy(smartthings_cloud_info_h cloud_info_h);
1501
1502 /**
1503  * @brief Sets region of cloud information.
1504  * @since_ses 1
1505  *
1506  * @remarks The @a region can be set to one of "global" or "china".
1507  * @remarks If it doesn't use this function, the @a region will be set to "global" internally.
1508  *
1509  * @param[in] cloud_info_h The SmartThings cloud information handle
1510  * @param[in] region The region name
1511  *
1512  * @return @c 0 on success,
1513  *         otherwise a negative error value
1514  * @retval #SMARTTHINGS_ERROR_NONE Successful
1515  * @retval #SMARTTHINGS_ERROR_INVALID_PARAMETER Invalid parameter
1516  */
1517 int smartthings_cloudinfo_set_region(smartthings_cloud_info_h cloud_info_h, const char *region);
1518
1519 /**
1520  * @brief Sets authentification provider of cloud information.
1521  * @since_ses 1
1522  *
1523  * @param[in] cloud_info_h The SmartThings cloud information handle
1524  * @param[in] auth_provider The authentification provider
1525  *
1526  * @return @c 0 on success,
1527  *         otherwise a negative error value
1528  * @retval #SMARTTHINGS_ERROR_NONE Successful
1529  * @retval #SMARTTHINGS_ERROR_INVALID_PARAMETER Invalid parameter
1530  */
1531 int smartthings_cloudinfo_set_auth_provider(smartthings_cloud_info_h cloud_info_h, const char *auth_provider);
1532
1533 /**
1534  * @brief Sets access token of cloud information.
1535  * @since_ses 1
1536  *
1537  * @param[in] cloud_info_h The SmartThings cloud information handle
1538  * @param[in] access_token The access token
1539  *
1540  * @return @c 0 on success,
1541  *         otherwise a negative error value
1542  * @retval #SMARTTHINGS_ERROR_NONE Successful
1543  * @retval #SMARTTHINGS_ERROR_INVALID_PARAMETER Invalid parameter
1544  */
1545 int smartthings_cloudinfo_set_access_token(smartthings_cloud_info_h cloud_info_h, const char *access_token);
1546
1547 /**
1548  * @brief Sets refresh token of cloud information.
1549  * @since_ses 1
1550  *
1551  * @param[in] cloud_info_h The SmartThings cloud information handle
1552  * @param[in] refresh_token The refresh token
1553  *
1554  * @return @c 0 on success,
1555  *         otherwise a negative error value
1556  * @retval #SMARTTHINGS_ERROR_NONE Successful
1557  * @retval #SMARTTHINGS_ERROR_INVALID_PARAMETER Invalid parameter
1558  */
1559 int smartthings_cloudinfo_set_refresh_token(smartthings_cloud_info_h cloud_info_h, const char *refresh_token);
1560
1561 /**
1562  * @brief Sets user ID of cloud information.
1563  * @since_ses 1
1564  *
1565  * @param[in] cloud_info_h The SmartThings cloud information handle
1566  * @param[in] user_id The user ID
1567  *
1568  * @return @c 0 on success,
1569  *         otherwise a negative error value
1570  * @retval #SMARTTHINGS_ERROR_NONE Successful
1571  * @retval #SMARTTHINGS_ERROR_INVALID_PARAMETER Invalid parameter
1572  */
1573 int smartthings_cloudinfo_set_user_id(smartthings_cloud_info_h cloud_info_h, const char *user_id);
1574
1575 /**
1576  * @brief Sets client ID of cloud information.
1577  * @since_ses 1
1578  *
1579  * @param[in] cloud_info_h The SmartThings cloud information handle
1580  * @param[in] client_id The client ID
1581  *
1582  * @return @c 0 on success,
1583  *         otherwise a negative error value
1584  * @retval #SMARTTHINGS_ERROR_NONE Successful
1585  * @retval #SMARTTHINGS_ERROR_INVALID_PARAMETER Invalid parameter
1586  */
1587 int smartthings_cloudinfo_set_client_id(smartthings_cloud_info_h cloud_info_h, const char *client_id);
1588
1589 /**
1590  * @brief Requests to sign up to cloud.
1591  * @since_ses 1
1592  * @privilege %http://com.samsung.tizen.smartthings-thing/appdefined/smartthings-thing.master \n
1593  *            %http://tizen.org/privilege/appmanager.launch \n
1594  *            %http://tizen.org/privilege/datasharing \n
1595  *            %http://tizen.org/privilege/internet
1596  *
1597  * @param[in] handle The SmartThings handle
1598  * @param[in] cloud_info_h The handle for cloud signup
1599  *
1600  * @return @c 0 on success,
1601  *         otherwise a negative error value
1602  * @retval #SMARTTHINGS_ERROR_NONE Successful
1603  * @retval #SMARTTHINGS_ERROR_INVALID_PARAMETER Invalid parameter
1604  * @retval #SMARTTHINGS_ERROR_PERMISSION_DENIED Permission denied
1605  * @retval #SMARTTHINGS_ERROR_OPERATION_FAILED Operation failed
1606  * @retval #SMARTTHINGS_ERROR_SERVICE_UNAVAILABLE Service unavailable
1607  */
1608 int smartthings_sign_up_cloud(smartthings_h handle, smartthings_cloud_info_h cloud_info_h);
1609
1610 /**
1611  * @brief Sets preconfigured PIN.
1612  * @since_ses 1
1613  * @privilege %http://com.samsung.tizen.smartthings-thing/appdefined/smartthings-thing.master \n
1614  *            %http://tizen.org/privilege/appmanager.launch \n
1615  *            %http://tizen.org/privilege/datasharing
1616  *
1617  * @param[in] handle The SmartThings handle
1618  * @param[in] pin The PIN code to preconfigure
1619  *
1620  * @return @c 0 on success,
1621  *         otherwise a negative error value
1622  * @retval #SMARTTHINGS_ERROR_NONE Successful
1623  * @retval #SMARTTHINGS_ERROR_INVALID_PARAMETER Invalid parameter
1624  * @retval #SMARTTHINGS_ERROR_PERMISSION_DENIED Permission denied
1625  * @retval #SMARTTHINGS_ERROR_OPERATION_FAILED Operation failed
1626  * @retval #SMARTTHINGS_ERROR_SERVICE_UNAVAILABLE Service unavailable
1627  */
1628 int smartthings_set_preconfigured_pin(smartthings_h handle, const char* pin);
1629
1630 /**
1631  * @brief Sets MOT(multiple ownership transfer) status.
1632  * @since_ses 1
1633  * @privilege %http://com.samsung.tizen.smartthings-thing/appdefined/smartthings-thing.master \n
1634  *            %http://tizen.org/privilege/appmanager.launch \n
1635  *            %http://tizen.org/privilege/datasharing
1636  *
1637  * @param[in] handle The SmartThings handle
1638  * @param[in] enable The MOT(multiple ownership transfer) status
1639  *
1640  * @return @c 0 on success,
1641  *         otherwise a negative error value
1642  * @retval #SMARTTHINGS_ERROR_NONE Successful
1643  * @retval #SMARTTHINGS_ERROR_INVALID_PARAMETER Invalid parameter
1644  * @retval #SMARTTHINGS_ERROR_PERMISSION_DENIED Permission denied
1645  * @retval #SMARTTHINGS_ERROR_OPERATION_FAILED Operation failed
1646  * @retval #SMARTTHINGS_ERROR_SERVICE_UNAVAILABLE Service unavailable
1647  */
1648 int smartthings_set_mot_status(smartthings_h handle, bool enable);
1649
1650 /**
1651  * @}
1652  */
1653
1654 #ifdef __cplusplus
1655 }
1656 #endif
1657
1658 #endif /* __SAMSUNG_EXPERIENCE_SERVICE_SMARTTHINGS_H__ */