Tizen IoT Extension SDK 1.0
1.0.1
|
#include <stdio.h>
#include <stdlib.h>
#include <stdbool.h>
#include <tizen.h>
#include <smartthings_payload.h>
Go to the source code of this file.
Typedefs | |
typedef struct smartthings_resource_s * | smartthings_resource_h |
The SmartThings resource handle. 1. | |
typedef void(* | smartthings_resource_connection_status_cb )(smartthings_resource_h handle, smartthings_resource_connection_status_e status, void *user_data) |
Callback for status of connection to SmartThings Thing agent. 1. | |
typedef void(* | smartthings_resource_request_cb )(smartthings_resource_h st_h, int req_id, const char *uri, smartthings_resource_req_type_e req_type, smartthings_payload_h payload, void *user_data) |
Callback for handling request(GET/SET) messages. 1. | |
typedef void(* | smartthings_resource_cloud_registration_status_cb )(smartthings_resource_h st_h, bool is_registered, void *user_data) |
Callback for status of resource registration to cloud. 1. | |
Enumerations | |
enum | smartthings_resource_error_e { SMARTTHINGS_RESOURCE_ERROR_NONE = TIZEN_ERROR_NONE, SMARTTHINGS_RESOURCE_ERROR_INVALID_PARAMETER = TIZEN_ERROR_INVALID_PARAMETER, SMARTTHINGS_RESOURCE_ERROR_OUT_OF_MEMORY = TIZEN_ERROR_OUT_OF_MEMORY, SMARTTHINGS_RESOURCE_ERROR_PERMISSION_DENIED = TIZEN_ERROR_PERMISSION_DENIED, SMARTTHINGS_RESOURCE_ERROR_NO_DATA = TIZEN_ERROR_NO_DATA, SMARTTHINGS_RESOURCE_ERROR_NOT_SUPPORTED = TIZEN_ERROR_NOT_SUPPORTED, SMARTTHINGS_RESOURCE_ERROR_OPERATION_FAILED = TIZEN_ERROR_UNKNOWN - 1, SMARTTHINGS_RESOURCE_ERROR_SERVICE_UNAVAILABLE = TIZEN_ERROR_UNKNOWN -2 } |
Enumeration for the SmartThings resource error. 1. More... | |
enum | smartthings_resource_req_type_e { SMARTTHINGS_RESOURCE_REQUEST_GET = 0, SMARTTHINGS_RESOURCE_REQUEST_SET = 1, SMARTTHINGS_RESOURCE_REQUEST_COLLECTION_GET = 2, SMARTTHINGS_RESOURCE_REQUEST_COLLECTION_SET = 3 } |
Enumeration for the request type of resource and collection resource. 1. More... | |
enum | smartthings_resource_connection_status_e { SMARTTHINGS_RESOURCE_CONNECTION_STATUS_CONNECTED = 0, SMARTTHINGS_RESOURCE_CONNECTION_STATUS_DISCONNECTED, SMARTTHINGS_RESOURCE_CONNECTION_STATUS_REJECTED } |
Enumeration for RPC connection status. 1. More... | |
Functions | |
int | smartthings_resource_initialize (smartthings_resource_h *st_h, smartthings_resource_connection_status_cb connection_status_cb, void *user_data) |
Initializes a resource handle and connects to agent. 1 http://com.samsung.tizen.smartthings-thing/appdefined/smartthings-thing.resource http://tizen.org/privilege/appmanager.launch http://tizen.org/privilege/datasharing. | |
int | smartthings_resource_deinitialize (smartthings_resource_h st_h) |
Deinitializes a resource handle and disconnects from the agent. 1. | |
int | smartthings_resource_set_request_cb (smartthings_resource_h st_h, smartthings_resource_request_cb req_cb, void *user_data) |
Sets resource request callback. 1 http://com.samsung.tizen.smartthings-thing/appdefined/smartthings-thing.resource http://tizen.org/privilege/appmanager.launch http://tizen.org/privilege/datasharing. | |
int | smartthings_resource_unset_request_cb (smartthings_resource_h st_h) |
Unsets resource request callback. 1 http://com.samsung.tizen.smartthings-thing/appdefined/smartthings-thing.resource http://tizen.org/privilege/appmanager.launch http://tizen.org/privilege/datasharing. | |
int | smartthings_resource_send_response (smartthings_resource_h st_h, int req_id, const char *uri, smartthings_payload_h payload, bool result) |
Sends response for resource request message. 1 http://com.samsung.tizen.smartthings-thing/appdefined/smartthings-thing.resource http://tizen.org/privilege/appmanager.launch http://tizen.org/privilege/datasharing http://tizen.org/privilege/internet. | |
int | smartthings_resource_notify (smartthings_resource_h st_h, const char *uri, smartthings_payload_h payload) |
Notifies resource change. 1 http://com.samsung.tizen.smartthings-thing/appdefined/smartthings-thing.resource http://tizen.org/privilege/appmanager.launch http://tizen.org/privilege/datasharing http://tizen.org/privilege/internet. | |
int | smartthings_resource_get_uris (smartthings_resource_h st_h, int *count, char ***uris) |
Gets resource URIs. 1 http://com.samsung.tizen.smartthings-thing/appdefined/smartthings-thing.resource http://tizen.org/privilege/appmanager.launch http://tizen.org/privilege/datasharing. | |
int | smartthings_resource_set_cloud_registration_status_cb (smartthings_resource_h st_h, smartthings_resource_cloud_registration_status_cb reg_cb, void *user_data) |
Sets cloud registration callback. 1 http://com.samsung.tizen.smartthings-thing/appdefined/smartthings-thing.resource http://tizen.org/privilege/appmanager.launch http://tizen.org/privilege/datasharing. | |
int | smartthings_resource_unset_cloud_registration_status_cb (smartthings_resource_h st_h) |
Unsets cloud registration callback. 1 http://com.samsung.tizen.smartthings-thing/appdefined/smartthings-thing.resource http://tizen.org/privilege/appmanager.launch http://tizen.org/privilege/datasharing. |