1 /* ****************************************************************
3 * Copyright 2017 Samsung Electronics All Rights Reserved.
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
9 * http://www.apache.org/licenses/LICENSE-2.0
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.
17 ******************************************************************/
19 #ifndef __SENSOR_DATA_H__
20 #define __SENSOR_DATA_H__
25 SENSOR_DATA_TYPE_NONE = 0,
27 SENSOR_DATA_TYPE_UINT,
28 SENSOR_DATA_TYPE_BOOL,
29 SENSOR_DATA_TYPE_DOUBLE,
33 typedef struct __sensor_data_s sensor_data;
35 sensor_data *sensor_data_new(sensor_data_type_e type);
36 void sensor_data_free(sensor_data *data);
38 int sensor_data_set_int(sensor_data *data, int value);
39 int sensor_data_set_uint(sensor_data *data, unsigned int value);
40 int sensor_data_set_bool(sensor_data *data, bool value);
41 int sensor_data_set_double(sensor_data *data, double value);
42 int sensor_data_set_string(sensor_data *data, const char *value, unsigned int size);
44 int sensor_data_get_int(sensor_data *data, int *value);
45 int sensor_data_get_uint(sensor_data *data, unsigned int *value);
46 int sensor_data_get_bool(sensor_data *data, bool *value);
47 int sensor_data_get_double(sensor_data *data, double *value);
48 int sensor_data_get_string(sensor_data *data, const char **value);
50 #endif /* __SENSOR_DATA_H__ */