Tizen RT Public API  v1.1 D4
st_things.h
Go to the documentation of this file.
1 /* ****************************************************************
2  *
3  * Copyright 2017 Samsung Electronics All Rights Reserved.
4  *
5  * Licensed under the Apache License, Version 2.0 (the "License");
6  * you may not use this file except in compliance with the License.
7  * You may obtain a copy of the License at
8  *
9  * http://www.apache.org/licenses/LICENSE-2.0
10  *
11  * Unless required by applicable law or agreed to in writing, software
12  * distributed under the License is distributed on an "AS IS" BASIS,
13  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14  * See the License for the specific language governing permissions and
15  * limitations under the License.
16  *
17  ******************************************************************/
30 #ifndef __ST_THINGS_H__
31 #define __ST_THINGS_H__
32 
33 #include <stdint.h>
34 #include <stdbool.h>
35 
36 #ifdef __ST_THINGS_RTOS__
38 #else
39 #include "st_things_types.h"
40 #endif // __ST_THINGS_RTOS__
41 
42 #ifdef __cplusplus
43 extern "C" {
44 #endif /* __cplusplus */
45 
74 int st_things_initialize(const char *json_path, bool *easysetup_complete);
75 
76 //@cond
90 int st_things_deinitialize(void);
91 //@endcond
92 
103 
114 
133 
153 int st_things_start(void);
154 
162 typedef bool(*st_things_reset_confirm_cb) (void);
163 
171 typedef void (*st_things_reset_result_cb) (bool is_success);
172 
191 
206 int st_things_reset(void);
207 
217 typedef void (*st_things_pin_generated_cb) (const char *pin_data, const size_t pin_size);
218 
225 typedef void (*st_things_pin_display_close_cb) (void);
226 
227 //@cond
244 int st_things_register_pin_handling_cb(st_things_pin_generated_cb generated_cb, st_things_pin_display_close_cb close_cb);
245 //@endcond
246 
254 typedef bool(*st_things_user_confirm_cb) (void);
255 
272 
280 typedef void (*st_things_status_change_cb) (st_things_status_e things_status);
281 
298 
315 int st_things_notify_observers(const char *resource_uri);
316 
326 
335 
336 #ifdef __cplusplus
337 }
338 #endif /* __cplusplus */
339 #endif /* __ST_THINGS_H__ */
340 // end of SmartThings group
void(* st_things_pin_generated_cb)(const char *pin_data, const size_t pin_size)
Callback for carrying the randomly generated PIN info.
Definition: st_things.h:217
int st_things_notify_observers(const char *resource_uri)
Notify the observers of a specific resource. Stack should have been initialized and started before ca...
void(* st_things_status_change_cb)(st_things_status_e things_status)
Callback for getting the current state of ST Things.
Definition: st_things.h:280
int st_things_start(void)
Starts things stack. Parses the thing definition(whose path is passed to st_things_initialize(), configures the thing, creates the resources and prepares it for easy-setup. If easy-setup is not done yet, onboarding will be started using either SoftAP or BLE connection. Onboarding creates an ad-hoc network between the thing and the client for performing easy-setup. If easy-setup is already done, thing will be connected with the cloud. Application can know whether easy-setup is done or not through st_things_initialize API. Stack should have been initialized before calling this API.
bool(* st_things_get_request_cb)(st_things_get_request_message_s *req_msg, st_things_representation_s *resp_rep)
Callback for handling GET request.
Definition: st_things.h:102
void(* st_things_reset_result_cb)(bool is_success)
Callback for carrying the result of reset.
Definition: st_things.h:171
Provides structure definition for SmartThings Things SDK.
int st_things_register_user_confirm_cb(st_things_user_confirm_cb confirm_cb)
Callback registration function for getting user confirmation for MUTUAL VERIFICATION BASED JUST WORK ...
int st_things_register_things_status_change_cb(st_things_status_change_cb status_cb)
Callback registration function for getting notified when ST Things state changes. ...
int st_things_register_request_cb(st_things_get_request_cb get_cb, st_things_set_request_cb set_cb)
Callback registration function for handling request messages.
Structure for Representation.
int st_things_initialize(const char *json_path, bool *easysetup_complete)
Initializes things stack and returns whether easy-setup is completed or not. Easy-setup enable users ...
Structure for representing the Set Request Message.
bool(* st_things_user_confirm_cb)(void)
Callback for getting user&#39;s input regarding mutual verification.
Definition: st_things.h:254
Structure for representing the Get Request Message.
st_things_status_e
Enumeration for ST Things status.
int st_things_register_reset_cb(st_things_reset_confirm_cb confirm_cb, st_things_reset_result_cb result_cb)
Callback registration function for Reset-Confirmation and Reset-Result functions. ...
bool(* st_things_reset_confirm_cb)(void)
Callback for getting user&#39;s opinion regarding device reset.
Definition: st_things.h:162
st_things_representation_s * st_things_create_representation_inst(void)
Create an instance of representation.
void(* st_things_pin_display_close_cb)(void)
Callback for informing the application to close the PIN display.
Definition: st_things.h:225
int st_things_reset(void)
Reset all the data related to security and cloud being used in the stack. Stack should have been init...
bool(* st_things_set_request_cb)(st_things_set_request_message_s *req_msg, st_things_representation_s *resp_rep)
Callback for handling SET(POST) request.
Definition: st_things.h:113
void st_things_destroy_representation_inst(st_things_representation_s *rep)
Destroy an instance of representation.