Tizen RT Public API  v1.1 D4
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;
82  bool(*get_str_value) (struct _st_things_representation *rep, const char *key, char **value);
83 
92  bool(*get_bool_value) (struct _st_things_representation *rep, const char *key, bool *value);
93 
102  bool(*get_int_value) (struct _st_things_representation *rep, const char *key, int64_t *value);
103 
112  bool(*get_double_value) (struct _st_things_representation *rep, const char *key, double *value);
113 
124  bool(*get_byte_value) (struct _st_things_representation *rep, const char *key, uint8_t **value, size_t *size);
125 
136  bool(*get_object_value) (struct _st_things_representation *rep, const char *key, struct _st_things_representation **value);
137 
147  bool(*set_str_value) (struct _st_things_representation *rep, const char *key, const char *value);
148 
157  bool(*set_bool_value) (struct _st_things_representation *rep, const char *key, bool value);
158 
167  bool(*set_int_value) (struct _st_things_representation *rep, const char *key, int64_t value);
168 
177  bool(*set_double_value) (struct _st_things_representation *rep, const char *key, double value);
178 
189  bool(*set_byte_value) (struct _st_things_representation *rep, const char *key, const uint8_t *value, size_t size);
190 
200  bool(*set_object_value) (struct _st_things_representation *rep, const char *key, const struct _st_things_representation *value);
201 
212  bool(*get_str_array_value) (struct _st_things_representation *rep, const char *key, char ***array, size_t *length);
213 
224  bool(*get_int_array_value) (struct _st_things_representation *rep, const char *key, int64_t **array, size_t *length);
225 
236  bool(*get_double_array_value) (struct _st_things_representation *rep, const char *key, double **array, size_t *length);
237 
249  bool(*get_object_array_value) (struct _st_things_representation *rep, const char *key, struct _st_things_representation ***array, size_t *length);
250 
261  bool(*set_str_array_value) (struct _st_things_representation *rep, const char *key, const char **array, size_t length);
262 
273  bool(*set_int_array_value) (struct _st_things_representation *rep, const char *key, const int64_t *array, size_t length);
274 
285  bool(*set_double_array_value) (struct _st_things_representation *rep, const char *key, const double *array, size_t length);
286 
297  bool(*set_object_array_value) (struct _st_things_representation *rep, const char *key, const struct _st_things_representation **array, size_t length);
298 
300 
306  char *resource_uri;
307  char *query;
308  char *property_key;
318  bool(*get_query_value) (struct _st_things_get_request_message *req_msg, const char *key, char **value);
319 
327  bool(*has_property_key) (struct _st_things_get_request_message *req_msg, const char *key);
328 
330 
336  char *resource_uri;
337  char *query;
348  bool(*get_query_value) (struct _st_things_set_request_message *req_msg, const char *key, char **value);
349 
351 
352 #endif /* __ST_THINGS_TYPES_H__ */
353 // 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
bool(* get_query_value)(struct _st_things_set_request_message *req_msg, const char *key, char **value)
API for getting the value of a specific query from the query parameters of the request.
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_query_value)(struct _st_things_get_request_message *req_msg, const char *key, char **value)
API for getting the value of a specific query from the query parameters of the request.
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.