ST Things SDK
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator
st_things_types.h
Go to the documentation of this file.
1 /* ****************************************************************
2  *
3  * Copyright 2017 Samsung Electronics All Rights Reserved.
4  *
5  *
6  *
7  * Licensed under the Apache License, Version 2.0 (the "License");
8  * you may not use this file except in compliance with the License.
9  * You may obtain a copy of the License at
10  *
11  * http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing, software
14  * distributed under the License is distributed on an "AS IS" BASIS,
15  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16  * See the License for the specific language governing permissions and
17  * limitations under the License.
18  *
19  ******************************************************************/
20 
21 #ifndef __ST_THINGS_TYPES_H__
22 #define __ST_THINGS_TYPES_H__
23 
24 #include <stdint.h>
25 #include <stdlib.h>
26 #include <stdbool.h>
27 
31 typedef enum {
40 
44 typedef enum {
57 
62 {
63  void* payload;
73  bool (*get_str_value) (struct _st_things_representation* rep, const char* key, char** value);
74 
82  bool (*get_bool_value) (struct _st_things_representation* rep, const char* key, bool* value);
83 
91  bool (*get_int_value) (struct _st_things_representation* rep, const char* key, int64_t* value);
92 
100  bool (*get_double_value) (struct _st_things_representation* rep, const char* key, double* value);
101 
111  bool (*get_byte_value) (struct _st_things_representation* rep, const char* key, uint8_t** value, size_t* size);
112 
122  bool (*get_object_value) (struct _st_things_representation* rep, const char* key, struct _st_things_representation** value);
123 
132  bool (*set_str_value) (struct _st_things_representation* rep, const char* key, const char* value);
133 
141  bool (*set_bool_value) (struct _st_things_representation* rep, const char* key, bool value);
142 
150  bool (*set_int_value) (struct _st_things_representation* rep, const char* key, int64_t value);
151 
159  bool (*set_double_value) (struct _st_things_representation* rep, const char* key, double value);
160 
170  bool (*set_byte_value) (struct _st_things_representation* rep, const char* key, const uint8_t* value, size_t size);
171 
180  bool (*set_object_value) (struct _st_things_representation* rep, const char* key, const struct _st_things_representation* value);
181 
191  bool (*get_str_array_value) (struct _st_things_representation* rep, const char* key, char*** array, size_t* length);
192 
202  bool (*get_int_array_value) (struct _st_things_representation* rep, const char* key, int64_t** array, size_t* length);
203 
213  bool (*get_double_array_value) (struct _st_things_representation* rep, const char* key, double** array, size_t* length);
214 
225  bool (*get_object_array_value) (struct _st_things_representation* rep, const char* key, struct _st_things_representation*** array, size_t* length);
226 
236  bool (*set_str_array_value) (struct _st_things_representation* rep, const char* key, const char** array, size_t length);
237 
247  bool (*set_int_array_value) (struct _st_things_representation* rep, const char* key, const int64_t* array, size_t length);
248 
258  bool (*set_double_array_value) (struct _st_things_representation* rep, const char* key, const double* array, size_t length);
259 
269  bool (*set_object_array_value) (struct _st_things_representation* rep, const char* key, const struct _st_things_representation** array, size_t length);
270 
272 
277 {
278  char* resource_uri;
279  char* query;
280  char* property_key;
289  bool (*get_query_value) (struct _st_things_get_request_message* req_msg, const char* key, char** value);
290 
297  bool (*has_property_key) (struct _st_things_get_request_message* req_msg, const char* key);
298 
300 
305 {
306  char* resource_uri;
307  char* query;
317  bool (*get_query_value) (struct _st_things_set_request_message* req_msg, const char* key, char** value);
318 
320 
321 #endif /* __ST_THINGS_TYPES_H__ */
Definition: st_things_types.h:33
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.
Definition: st_things_types.h:100
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.
Definition: st_things_types.h:297
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.
Definition: st_things_types.h:111
Definition: st_things_types.h:35
Definition: st_things_types.h:47
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.
Definition: st_things_types.h:202
char * resource_uri
Definition: st_things_types.h:278
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.
Definition: st_things_types.h:247
struct _st_things_set_request_message st_things_set_request_message_s
Structure for representing the Set Request Message.
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.
Definition: st_things_types.h:269
struct _st_things_representation * rep
Definition: st_things_types.h:308
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.
Definition: st_things_types.h:73
Definition: st_things_types.h:51
struct _st_things_representation st_things_representation_s
Structure for Representation.
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.
Definition: st_things_types.h:159
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.
Definition: st_things_types.h:317
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.
Definition: st_things_types.h:213
Definition: st_things_types.h:38
Definition: st_things_types.h:48
Definition: st_things_types.h:50
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.
Definition: st_things_types.h:225
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.
Definition: st_things_types.h:289
Definition: st_things_types.h:55
Definition: st_things_types.h:54
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.
Definition: st_things_types.h:191
Definition: st_things_types.h:52
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.
Definition: st_things_types.h:236
char * property_key
Definition: st_things_types.h:280
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.
Definition: st_things_types.h:132
Definition: st_things_types.h:45
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.
Definition: st_things_types.h:180
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.
Definition: st_things_types.h:91
Definition: st_things_types.h:32
struct _st_things_get_request_message st_things_get_request_message_s
Structure for representing the Get Request Message.
Definition: st_things_types.h:37
Structure for Representation.
Definition: st_things_types.h:61
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.
Definition: st_things_types.h:82
Structure for representing the Set Request Message.
Definition: st_things_types.h:304
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.
Definition: st_things_types.h:141
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.
Definition: st_things_types.h:150
Definition: st_things_types.h:36
void * payload
Definition: st_things_types.h:63
st_things_error_e
Enumeration for ST Things error code.
Definition: st_things_types.h:31
Structure for representing the Get Request Message.
Definition: st_things_types.h:276
st_things_status_e
Enumeration for ST Things status.
Definition: st_things_types.h:44
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.
Definition: st_things_types.h:122
Definition: st_things_types.h:53
char * query
Definition: st_things_types.h:279
Definition: st_things_types.h:49
char * query
Definition: st_things_types.h:307
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.
Definition: st_things_types.h:258
Definition: st_things_types.h:46
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.
Definition: st_things_types.h:170
char * resource_uri
Definition: st_things_types.h:306
Definition: st_things_types.h:34