2 * Copyright (c) 2018 Samsung Electronics Co., Ltd.
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
8 * http://www.apache.org/licenses/LICENSE-2.0
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.
17 #ifndef __SAMSUNG_EXPERIENCE_SERVICE_SMARTTHINGS_H__
18 #define __SAMSUNG_EXPERIENCE_SERVICE_SMARTTHINGS_H__
29 * @addtogroup CAPI_SMARTTHINGS_THING_MASTER_MODULE
34 * @brief Definition for the max length of SSID for access point.
37 #define SMARTTHINGS_SSID_LEN_MAX 32
40 * @brief Definition for the max length of cloud information.
43 #define SMARTTHINGS_CLOUD_INFO_LEN_MAX 128
46 * @brief Enumeration for the SmartThings error.
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;
61 * @brief Enumeration for SmartThings status.
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;
80 * @brief Enumeration for RPC connection status.
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;
90 * @brief The Wi-Fi mode.
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;
102 * @brief The Wi-Fi frequency band.
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;
111 * @brief The Wi-Fi authentication type of access point.
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;
122 * @brief The Wi-Fi encryption type of access point.
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;
135 * @brief The SmartThings handle.
138 typedef struct smartthings_s *smartthings_h;
141 * @brief The access point information handle.
144 typedef struct smartthings_ap_info_s *smartthings_ap_info_h;
147 * @brief The device provisioning information handle.
150 typedef struct smartthings_device_prov_info_s *smartthings_device_prov_info_h;
153 * @brief The cloud information handle for cloud sign-up.
156 typedef struct smartthings_cloud_info_s *smartthings_cloud_info_h;
159 * @brief The access point list handle.
162 typedef struct smartthings_ap_list_s *smartthings_ap_list_h;
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
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.
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
183 * @see smartthings_initialize()
185 typedef void (*smartthings_connection_status_cb)(smartthings_error_e result, smartthings_h handle, smartthings_connection_status_e status, void *user_data);
188 * @brief Callback for SmartThings Thing status.
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.
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
200 * @see smartthings_set_status_changed_cb()
201 * @see smartthings_unset_status_changed_cb()
203 typedef void (*smartthings_status_changed_cb)(smartthings_h handle, smartthings_status_e status, void *user_data);
206 * @brief Callback for getting user's input regarding mutual verification.
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.
214 * @param[in] handle The SmartThings handle
215 * @param[in] user_data The user data passed from the callback registration function
217 * @see smartthings_set_user_confirm_cb()
218 * @see smartthings_unset_user_confirm_cb()
220 typedef void (*smartthings_user_confirm_cb)(smartthings_h handle, void *user_data);
223 * @brief Callback for getting user's opinion regarding device reset.
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.
231 * @param[in] handle The SmartThings handle
232 * @param[in] user_data The user data passed from the callback registration function
234 * @see smartthings_set_reset_confirm_cb()
235 * @see smartthings_unset_reset_confirm_cb()
237 typedef void (*smartthings_reset_confirm_cb)(smartthings_h handle, void *user_data);
240 * @brief Callback for result of reset operation.
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.
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
252 * @see smartthings_set_reset_result_cb()
253 * @see smartthings_unset_reset_result_cb()
255 typedef void (*smartthings_reset_result_cb)(smartthings_h handle, bool result, void *user_data);
258 * @brief Callback for carrying the randomly generated PIN information.
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.
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
272 * @see smartthings_set_pin_cb()
273 * @see smartthings_unset_pin_cb()
275 typedef void (*smartthings_pin_generated_cb)(smartthings_h handle, const char* pin, size_t size, void *user_data);
278 * @brief Callback for informing the application to close the PIN display.
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.
286 * @param[in] handle The SmartThings handle
287 * @param[in] user_data The user data passed from the callback registration function
289 * @see smartthings_set_pin_cb()
290 * @see smartthings_unset_pin_cb()
292 typedef void (*smartthings_pin_display_close_cb)(smartthings_h handle, void *user_data);
295 * @brief Callback for informing Wi-Fi AP information to connect.
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.
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
309 * @see smartthings_set_wifi_ap_provisioning_cb()
310 * @see smartthings_unset_wifi_ap_provisioning_cb()
312 typedef void (*smartthings_wifi_ap_provisioning_cb)(smartthings_h handle, smartthings_ap_info_h ap_info_h, void *user_data);
315 * @brief Callback for informing device provisioning information.
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.
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
329 * @see smartthings_set_device_provisioning_cb()
330 * @see smartthings_unset_device_provisioning_cb()
332 typedef void (*smartthings_device_provisioning_cb)(smartthings_h handle, smartthings_device_prov_info_h dev_prov_h, void *user_data);
335 * @brief Callback for informing the scan AP list request.
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.
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
347 * @see smartthings_set_scan_ap_cb()
348 * @see smartthings_unset_scan_ap_cb()
350 typedef void (*smartthings_scan_ap_cb)(smartthings_h handle, int req_id, void *user_data);
353 * @brief Callback for informing the stop soft AP request.
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.
361 * @param[in] handle The SmartThings handle
362 * @param[in] user_data The user data passed from the callback registration function
364 * @see smartthings_set_stop_soft_ap_cb()
365 * @see smartthings_unset_stop_soft_ap_cb()
367 typedef void (*smartthings_stop_soft_ap_cb)(smartthings_h handle, void *user_data);
370 * @brief Creates a handle and connects to agent.
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
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'.
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
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
394 * @see smartthings_deinitialize()
396 int smartthings_initialize(smartthings_h *handle,
397 smartthings_connection_status_cb connection_status_cb,
401 * @brief Deinitializes a handle and disconnects from the agent.
404 * @param[in] handle The SmartThings handle
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
412 * @see smartthings_initialize()
414 int smartthings_deinitialize(smartthings_h handle);
417 * @brief Starts SmartThings Thing operation.
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
423 * @param[in] handle The SmartThings handle
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
433 * @see smartthings_stop()
435 int smartthings_start(smartthings_h handle);
438 * @brief Stops SmartThings Thing operation.
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
444 * @param[in] handle The SmartThings handle
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
454 * @see smartthings_start()
456 int smartthings_stop(smartthings_h handle);
459 * @brief Sets thing status changed callback.
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
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.
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
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
482 * @see smartthings_unset_status_changed_cb()
484 int smartthings_set_status_changed_cb(smartthings_h handle,
485 smartthings_status_changed_cb status_cb,
489 * @brief Unsets thing status changed callback.
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
495 * @param[in] handle The SmartThings handle
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
505 * @see smartthings_set_status_changed_cb()
507 int smartthings_unset_status_changed_cb(smartthings_h handle);
510 * @brief Sets test certificate files.
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
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()
520 * @param[in] handle The SmartThings handle
521 * @param[in] certificate The certificate file
522 * @param[in] private_key The private key file
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
532 int smartthings_set_certificate_file(smartthings_h handle, const char *certificate, const char *private_key);
535 * @brief Sets device property for Easy-setup.
538 * @remarks This function can be used before smartthings_start()
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)
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
550 int smartthings_set_device_property(smartthings_h handle, const char* dev_name, int wifi_mode, int wifi_freq);
553 * @brief Gets a device ID.
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
559 * @remarks The @a device_id should be released using free().
561 * @param[in] handle The SmartThings handle
562 * @param[out] device_id The device ID
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
572 int smartthings_get_device_id(smartthings_h handle, char **device_id);
575 * @brief Gets a Easy-setup status.
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
581 * @param[in] handle The SmartThings handle
582 * @param[out] is_completed The status of Easy-setup whether it is completed or not
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
592 int smartthings_get_easysetup_status(smartthings_h handle, bool *is_completed);
595 * @brief Starts Easy-setup mode.
597 * @details This function requests for turning on soft AP to SmartThings Thing agent.
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
604 * @param[in] handle The SmartThings handle
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
614 * @see smartthings_stop_easysetup()
616 int smartthings_start_easysetup(smartthings_h handle);
619 * @brief Stops Easy-setup mode.
621 * @details This function requests for turning off soft AP to SmartThings Thing agent.
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
628 * @param[in] handle The SmartThings handle
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
638 * @see smartthings_start_easysetup()
640 int smartthings_stop_easysetup(smartthings_h handle);
643 * @brief Sets callback for getting user confirmation for mutual verification based just work ownership transfer.
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
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.
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
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
666 * @see smartthings_unset_user_confirm_cb()
668 int smartthings_set_user_confirm_cb(smartthings_h handle,
669 smartthings_user_confirm_cb confirm_cb,
673 * @brief Unsets user confirmation callback.
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
679 * @param[in] handle The SmartThings handle
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
689 * @see smartthings_set_user_confirm_cb()
691 int smartthings_unset_user_confirm_cb(smartthings_h handle);
694 * @brief Sets reset confirmation callback.
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
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.
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
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
717 * @see smartthings_unset_reset_confirm_cb()
719 int smartthings_set_reset_confirm_cb(smartthings_h handle,
720 smartthings_reset_confirm_cb confirm_cb,
724 * @brief Unsets reset confirmation callback.
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
730 * @param[in] handle The SmartThings handle
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
740 * @see smartthings_set_reset_confirm_cb()
742 int smartthings_unset_reset_confirm_cb(smartthings_h handle);
745 * @brief Sets reset result callback.
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
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.
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
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
768 * @see smartthings_unset_reset_result_cb()
770 int smartthings_set_reset_result_cb(smartthings_h handle,
771 smartthings_reset_result_cb reset_result_cb,
775 * @brief Unsets reset result callback.
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
781 * @param[in] handle The SmartThings handle
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
791 * @see smartthings_set_reset_result_cb()
793 int smartthings_unset_reset_result_cb(smartthings_h handle);
797 * @brief Sets callback for getting randomly generated PIN for the PIN-based ownership transfer request.
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
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.
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
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
823 * @see smartthings_unset_pin_cb()
825 int smartthings_set_pin_cb(smartthings_h handle,
826 smartthings_pin_generated_cb generated_cb,
827 smartthings_pin_display_close_cb close_cb,
831 * @brief Unsets PIN callback.
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
837 * @param[in] handle The SmartThings handle
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
847 * @see smartthings_set_pin_cb()
849 int smartthings_unset_pin_cb(smartthings_h handle);
852 * @brief Sets callback for getting Wi-Fi AP information during Easy-setup.
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
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.
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
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
875 * @see smartthings_unset_wifi_ap_provisioning_cb()
877 int smartthings_set_wifi_ap_provisioning_cb(smartthings_h handle,
878 smartthings_wifi_ap_provisioning_cb wifi_ap_cb,
882 * @brief Unsets callback for getting Wi-Fi AP information during Easy-setup.
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
888 * @param[in] handle The SmartThings handle
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
898 * @see smartthings_set_wifi_ap_provisioning_cb()
900 int smartthings_unset_wifi_ap_provisioning_cb(smartthings_h handle);
903 * @brief Sets callback for getting device provisioning information.
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
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.
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
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
926 * @see smartthings_unset_device_provisioning_cb()
928 int smartthings_set_device_provisioning_cb(smartthings_h handle,
929 smartthings_device_provisioning_cb dev_prov_cb,
933 * @brief Unsets callback for getting device provisioning information.
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
939 * @param[in] handle The SmartThings handle
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
949 * @see smartthings_set_device_provisioning_cb()
951 int smartthings_unset_device_provisioning_cb(smartthings_h handle);
954 * @brief Sets callback for informing the scan AP list request.
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
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.
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
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
977 * @see smartthings_unset_scan_ap_cb()
978 * @see smartthings_send_ap_list()
980 int smartthings_set_scan_ap_cb(smartthings_h handle,
981 smartthings_scan_ap_cb scan_ap_cb,
985 * @brief Unsets callback for informing the scan AP list request.
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
991 * @param[in] handle The SmartThings handle
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
1001 * @see smartthings_set_scan_ap_cb()
1003 int smartthings_unset_scan_ap_cb(smartthings_h handle);
1006 * @brief Sets callback for informing the stop soft AP request.
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
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.
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
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
1029 * @see smartthings_unset_stop_soft_ap_cb()
1031 int smartthings_set_stop_soft_ap_cb(smartthings_h handle,
1032 smartthings_stop_soft_ap_cb stop_soft_ap_cb,
1036 * @brief Unsets callback for informing the stop soft AP request.
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
1042 * @param[in] handle The SmartThings handle
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
1052 * @see smartthings_set_stop_soft_ap_cb()
1054 int smartthings_unset_stop_soft_ap_cb(smartthings_h handle);
1057 * @brief Sends a user confirmation for MUTUAL VERIFICATION BASED JUST WORK Ownership transfer.
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
1064 * @param[in] handle The SmartThings handle
1065 * @param[in] confirm The user confirmation for OTM(ownership transfer method)
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
1075 * @see smartthings_set_user_confirm_cb()
1076 * @see smartthings_unset_user_confirm_cb()
1078 int smartthings_send_user_confirm(smartthings_h handle, bool confirm);
1082 * @brief Sends a reset confirmation.
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
1089 * @param[in] handle The SmartThings handle
1090 * @param[in] confirm The reset confirmation
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
1100 * @see smartthings_set_reset_confirm_cb()
1101 * @see smartthings_unset_reset_confirm_cb()
1103 int smartthings_send_reset_confirm(smartthings_h handle, bool confirm);
1106 * @brief Sends a reset command for resetting the device's Cloud signup and Easy-setup.
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
1113 * @param[in] handle The SmartThings handle
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
1123 * @see smartthings_set_reset_result_cb()
1124 * @see smartthings_unset_reset_result_cb()
1126 int smartthings_reset(smartthings_h handle);
1129 * @brief Gets SSID of access point.
1132 * @remarks The @a ssid should be released using free().
1134 * @param[in] ap_info_h The SmartThings AP information handle
1135 * @param[out] ssid The SSID name
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
1143 * @see smartthings_set_wifi_ap_provisioning_cb()
1144 * @see smartthings_unset_wifi_ap_provisioning_cb()
1146 int smartthings_apinfo_get_ssid(smartthings_ap_info_h ap_info_h, char **ssid);
1149 * @brief Gets password of access point.
1152 * @remarks The @a pwd should be released using free().
1154 * @param[in] ap_info_h The SmartThings AP information handle
1155 * @param[out] pwd The password
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
1163 * @see smartthings_set_wifi_ap_provisioning_cb()
1164 * @see smartthings_unset_wifi_ap_provisioning_cb()
1166 int smartthings_apinfo_get_password(smartthings_ap_info_h ap_info_h, char **pwd);
1169 * @brief Gets authentification type of access point.
1172 * @param[in] ap_info_h The SmartThings AP information handle
1173 * @param[out] authtype The authentification type
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
1181 * @see smartthings_set_wifi_ap_provisioning_cb()
1182 * @see smartthings_unset_wifi_ap_provisioning_cb()
1184 int smartthings_apinfo_get_authtype(smartthings_ap_info_h ap_info_h, smartthings_wifi_authtype_e *authtype);
1187 * @brief Gets encryption type of access point.
1190 * @param[in] ap_info_h The SmartThings AP information handle
1191 * @param[out] enctype The encryption type
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
1199 * @see smartthings_set_wifi_ap_provisioning_cb()
1200 * @see smartthings_unset_wifi_ap_provisioning_cb()
1202 int smartthings_apinfo_get_enctype(smartthings_ap_info_h ap_info_h, smartthings_wifi_enctype_e *enctype);
1205 * @brief Gets channel information of access point.
1208 * @param[in] ap_info_h The SmartThings AP information handle
1209 * @param[out] channel The frequency channel
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
1217 * @see smartthings_set_wifi_ap_provisioning_cb()
1218 * @see smartthings_unset_wifi_ap_provisioning_cb()
1220 int smartthings_apinfo_get_channel(smartthings_ap_info_h ap_info_h, int *channel);
1223 * @brief Gets language of device provisioing information.
1226 * @remarks The @a language should be released using free().
1228 * @param[in] dev_prov_h The SmartThings device provisioning information handle
1229 * @param[out] language The IETF language tag using ISO 639X
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
1237 * @see smartthings_set_device_provisioning_cb()
1238 * @see smartthings_unset_device_provisioning_cb()
1240 int smartthings_devinfo_get_language(smartthings_device_prov_info_h dev_prov_h, char **language);
1243 * @brief Gets country of device provisioing information.
1246 * @remarks The @a country should be released using free().
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)
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
1257 * @see smartthings_set_device_provisioning_cb()
1258 * @see smartthings_unset_device_provisioning_cb()
1260 int smartthings_devinfo_get_country(smartthings_device_prov_info_h dev_prov_h, char **country);
1263 * @brief Gets datetime of device provisioing information.
1266 * @remarks The @a datetime should be released using free().
1268 * @param[in] dev_prov_h The SmartThings device provisioning information handle
1269 * @param[out] datetime The date and time
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
1277 * @see smartthings_set_device_provisioning_cb()
1278 * @see smartthings_unset_device_provisioning_cb()
1280 int smartthings_devinfo_get_datetime(smartthings_device_prov_info_h dev_prov_h, char **datetime);
1283 * @brief Creates a SmartThings AP list handle.
1286 * @remarks The @a ap_list_h must be released using smartthings_aplist_destroy().
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
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
1297 * @see smartthings_aplist_destroy()
1299 int smartthings_aplist_create(smartthings_ap_list_h *ap_list_h, unsigned int count);
1302 * @brief Destroys a SmartThings AP list handle.
1305 * @param[in] ap_list_h The SmartThings AP list handle
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
1312 * @see smartthings_aplist_create()
1314 int smartthings_aplist_destroy(smartthings_ap_list_h ap_list_h);
1317 * @brief Sets SSID at the specific index of AP list handle.
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
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
1329 * @see smartthings_aplist_create()
1330 * @see smartthings_aplist_destroy()
1332 int smartthings_aplist_set_ssid(smartthings_ap_list_h ap_list_h, int idx, const char *ssid);
1335 * @brief Sets BSSID at the specific index of AP list handle.
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
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
1347 * @see smartthings_aplist_create()
1348 * @see smartthings_aplist_destroy()
1350 int smartthings_aplist_set_bssid(smartthings_ap_list_h ap_list_h, int idx, const char *bssid);
1353 * @brief Sets authentification type at the specific index of AP list handle.
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
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
1365 * @see smartthings_aplist_create()
1366 * @see smartthings_aplist_destroy()
1368 int smartthings_aplist_set_authtype(smartthings_ap_list_h ap_list_h, int idx, smartthings_wifi_authtype_e authtype);
1371 * @brief Sets encryption type at the specific index of AP list handle.
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
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
1383 * @see smartthings_aplist_create()
1384 * @see smartthings_aplist_destroy()
1386 int smartthings_aplist_set_enctype(smartthings_ap_list_h ap_list_h, int idx, smartthings_wifi_enctype_e enctype);
1389 * @brief Sets frequency channel at the specific index of AP list handle.
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
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
1401 * @see smartthings_aplist_create()
1402 * @see smartthings_aplist_destroy()
1404 int smartthings_aplist_set_channel(smartthings_ap_list_h ap_list_h, int idx, int channel);
1407 * @brief Sets signal level at the specific index of AP list handle.
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
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
1419 * @see smartthings_aplist_create()
1420 * @see smartthings_aplist_destroy()
1422 int smartthings_aplist_set_signal_level(smartthings_ap_list_h ap_list_h, int idx, int signal_level);
1425 * @brief Sets max speed rate at the specific index of AP list handle.
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
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
1437 * @see smartthings_aplist_create()
1438 * @see smartthings_aplist_destroy()
1440 int smartthings_aplist_set_max_rate(smartthings_ap_list_h ap_list_h, int idx, int max_rate);
1443 * @brief Sends the scanned AP list.
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
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
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
1463 * @see smartthings_aplist_create()
1464 * @see smartthings_aplist_destroy()
1465 * @see smartthings_set_scan_ap_cb()
1467 int smartthings_send_ap_list(smartthings_h handle, smartthings_ap_list_h ap_list_h, int req_id);
1470 * @brief Creates a SmartThings cloud information handle.
1473 * @remarks The @a cloud_info_h must be released using smartthings_cloudinfo_destroy().
1475 * @param[out] cloud_info_h The SmartThings cloud information handle to be newly created on success
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
1483 * @see smartthings_cloudinfo_destroy()
1485 int smartthings_cloudinfo_create(smartthings_cloud_info_h *cloud_info_h);
1488 * @brief Destroys a SmartThings cloud information handle.
1491 * @param[in] cloud_info_h The SmartThings cloud information handle
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
1498 * @see smartthings_cloudinfo_create()
1500 int smartthings_cloudinfo_destroy(smartthings_cloud_info_h cloud_info_h);
1503 * @brief Sets region of cloud information.
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.
1509 * @param[in] cloud_info_h The SmartThings cloud information handle
1510 * @param[in] region The region name
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
1517 int smartthings_cloudinfo_set_region(smartthings_cloud_info_h cloud_info_h, const char *region);
1520 * @brief Sets authentification provider of cloud information.
1523 * @param[in] cloud_info_h The SmartThings cloud information handle
1524 * @param[in] auth_provider The authentification provider
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
1531 int smartthings_cloudinfo_set_auth_provider(smartthings_cloud_info_h cloud_info_h, const char *auth_provider);
1534 * @brief Sets access token of cloud information.
1537 * @param[in] cloud_info_h The SmartThings cloud information handle
1538 * @param[in] access_token The access token
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
1545 int smartthings_cloudinfo_set_access_token(smartthings_cloud_info_h cloud_info_h, const char *access_token);
1548 * @brief Sets refresh token of cloud information.
1551 * @param[in] cloud_info_h The SmartThings cloud information handle
1552 * @param[in] refresh_token The refresh token
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
1559 int smartthings_cloudinfo_set_refresh_token(smartthings_cloud_info_h cloud_info_h, const char *refresh_token);
1562 * @brief Sets user ID of cloud information.
1565 * @param[in] cloud_info_h The SmartThings cloud information handle
1566 * @param[in] user_id The user ID
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
1573 int smartthings_cloudinfo_set_user_id(smartthings_cloud_info_h cloud_info_h, const char *user_id);
1576 * @brief Sets client ID of cloud information.
1579 * @param[in] cloud_info_h The SmartThings cloud information handle
1580 * @param[in] client_id The client ID
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
1587 int smartthings_cloudinfo_set_client_id(smartthings_cloud_info_h cloud_info_h, const char *client_id);
1590 * @brief Requests to sign up to cloud.
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
1597 * @param[in] handle The SmartThings handle
1598 * @param[in] cloud_info_h The handle for cloud signup
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
1608 int smartthings_sign_up_cloud(smartthings_h handle, smartthings_cloud_info_h cloud_info_h);
1611 * @brief Sets preconfigured PIN.
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
1617 * @param[in] handle The SmartThings handle
1618 * @param[in] pin The PIN code to preconfigure
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
1628 int smartthings_set_preconfigured_pin(smartthings_h handle, const char* pin);
1631 * @brief Sets MOT(multiple ownership transfer) status.
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
1637 * @param[in] handle The SmartThings handle
1638 * @param[in] enable The MOT(multiple ownership transfer) status
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
1648 int smartthings_set_mot_status(smartthings_h handle, bool enable);
1658 #endif /* __SAMSUNG_EXPERIENCE_SERVICE_SMARTTHINGS_H__ */