TizenRT Public API  v2.0 M2
st_things_types.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  ******************************************************************/
27 #ifndef __ST_THINGS_TYPES_H__
28 #define __ST_THINGS_TYPES_H__
29 
30 #include <stdint.h>
31 #include <stdlib.h>
32 #include <stdbool.h>
33 
38 typedef enum {
47 
52 typedef enum {
65 
70 typedef struct _st_things_representation {
71  void *payload;
84  bool (*get_str_value)(struct _st_things_representation *rep, const char *key, char **value);
85 
96  bool (*get_bool_value)(struct _st_things_representation *rep, const char *key, bool *value);
97 
108  bool (*get_int_value)(struct _st_things_representation *rep, const char *key, int64_t *value);
109 
120  bool (*get_double_value)(struct _st_things_representation *rep, const char *key, double *value);
121 
134  bool (*get_byte_value)(struct _st_things_representation *rep, const char *key, uint8_t **value, size_t *size);
135 
148  bool (*get_object_value)(struct _st_things_representation *rep, const char *key, struct _st_things_representation **value);
149 
161  bool (*set_str_value)(struct _st_things_representation *rep, const char *key, const char *value);
162 
173  bool (*set_bool_value)(struct _st_things_representation *rep, const char *key, bool value);
174 
185  bool (*set_int_value)(struct _st_things_representation *rep, const char *key, int64_t value);
186 
197  bool (*set_double_value)(struct _st_things_representation *rep, const char *key, double value);
198 
211  bool (*set_byte_value)(struct _st_things_representation *rep, const char *key, const uint8_t *value, size_t size);
212 
224  bool (*set_object_value)(struct _st_things_representation *rep, const char *key, const struct _st_things_representation *value);
225 
238  bool (*get_str_array_value)(struct _st_things_representation *rep, const char *key, char ***array, size_t *length);
239 
252  bool (*get_int_array_value)(struct _st_things_representation *rep, const char *key, int64_t **array, size_t *length);
253 
266  bool (*get_double_array_value)(struct _st_things_representation *rep, const char *key, double **array, size_t *length);
267 
281  bool (*get_object_array_value)(struct _st_things_representation *rep, const char *key, struct _st_things_representation ***array, size_t *length);
282 
295  bool (*set_str_array_value)(struct _st_things_representation *rep, const char *key, const char **array, size_t length);
296 
309  bool (*set_int_array_value)(struct _st_things_representation *rep, const char *key, const int64_t *array, size_t length);
310 
323  bool (*set_double_array_value)(struct _st_things_representation *rep, const char *key, const double *array, size_t length);
324 
337  bool (*set_object_array_value)(struct _st_things_representation *rep, const char *key, const struct _st_things_representation **array, size_t length);
338 
340 
346  char *resource_uri;
347  char *query;
348  char *property_key;
360  bool (*get_query_value)(struct _st_things_get_request_message *req_msg, const char *key, char **value);
361 
371  bool (*has_property_key)(struct _st_things_get_request_message *req_msg, const char *key);
372 
374 
380  char *resource_uri;
381  char *query;
394  bool (*get_query_value)(struct _st_things_set_request_message *req_msg, const char *key, char **value);
395 
397 
398 #endif /* __ST_THINGS_TYPES_H__ */
399 // end of SmartThings group
bool(* set_object_value)(struct _st_things_representation *rep, const char *key, const struct _st_things_representation *value)
API for setting the value of object type property with a key.
bool(* set_object_array_value)(struct _st_things_representation *rep, const char *key, const struct _st_things_representation **array, size_t length)
API for setting the value of object array type property with a key.
bool(* has_property_key)(struct _st_things_get_request_message *req_msg, const char *key)
API for checking whether the request has a specific property key or not.
bool(* set_int_array_value)(struct _st_things_representation *rep, const char *key, const int64_t *array, size_t length)
API for setting the value of integer array type property with a key.
struct _st_things_set_request_message st_things_set_request_message_s
Structure for representing the Set Request Message.
struct _st_things_representation * rep
struct _st_things_representation st_things_representation_s
Structure for Representation.
bool(* set_byte_value)(struct _st_things_representation *rep, const char *key, const uint8_t *value, size_t size)
API for setting the value of byte array type property with a key.
bool(* get_double_value)(struct _st_things_representation *rep, const char *key, double *value)
API for getting the value of double type property with a key.
bool(* get_str_value)(struct _st_things_representation *rep, const char *key, char **value)
API for getting the value of string type property with a key.
bool(* set_double_value)(struct _st_things_representation *rep, const char *key, double value)
API for setting the value of double type property with a key.
bool(* get_str_array_value)(struct _st_things_representation *rep, const char *key, char ***array, size_t *length)
API for getting the value of string array type property with a key.
bool(* get_int_array_value)(struct _st_things_representation *rep, const char *key, int64_t **array, size_t *length)
API for getting the value of integer array type property with a key.
bool(* get_double_array_value)(struct _st_things_representation *rep, const char *key, double **array, size_t *length)
API for getting the value of double array type property with a key.
bool(* get_int_value)(struct _st_things_representation *rep, const char *key, int64_t *value)
API for getting the value of integer type property with a key.
struct _st_things_get_request_message st_things_get_request_message_s
Structure for representing the Get Request Message.
bool(* get_object_array_value)(struct _st_things_representation *rep, const char *key, struct _st_things_representation ***array, size_t *length)
API for getting the value of object array type property with a key.
bool(* set_str_array_value)(struct _st_things_representation *rep, const char *key, const char **array, size_t length)
API for setting the value of string array type property with a key.
Structure for Representation.
Structure for representing the Set Request Message.
bool(* set_bool_value)(struct _st_things_representation *rep, const char *key, bool value)
API for setting the value of boolean type property with a key.
bool(* get_bool_value)(struct _st_things_representation *rep, const char *key, bool *value)
API for getting the value of boolean type property with a key.
st_things_error_e
Enumeration for ST Things error code.
Structure for representing the Get Request Message.
bool(* set_str_value)(struct _st_things_representation *rep, const char *key, const char *value)
API for setting the value of string type property with a key.
st_things_status_e
Enumeration for ST Things status.
bool(* set_double_array_value)(struct _st_things_representation *rep, const char *key, const double *array, size_t length)
API for setting the value of double array type property with a key.
bool(* set_int_value)(struct _st_things_representation *rep, const char *key, int64_t value)
API for setting the value of integer type property with a key.
bool(* get_object_value)(struct _st_things_representation *rep, const char *key, struct _st_things_representation **value)
API for getting the value of object type property with a key.
bool(* get_byte_value)(struct _st_things_representation *rep, const char *key, uint8_t **value, size_t *size)
API for getting the value of byte array type property with a key.