2 * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
19 #include <sensor_log.h>
21 int sensor_recorder_is_supported(sensor_type_e type, bool *supported)
23 _D("Called : sensor[%#x]", type);
25 if (type <= SENSOR_ALL)
26 return SENSOR_ERROR_INVALID_PARAMETER;
28 return SENSOR_ERROR_INVALID_PARAMETER;
32 return SENSOR_ERROR_NONE;
35 int sensor_recorder_start(sensor_type_e type, sensor_recorder_option_h option)
37 _D("Called : sensor[%#x] with option[%d]", type, option);
39 if (type <= SENSOR_ALL)
40 return SENSOR_ERROR_INVALID_PARAMETER;
42 return SENSOR_ERROR_NOT_SUPPORTED;
45 int sensor_recorder_stop(sensor_type_e type)
47 _D("Called : sensor[%#x]", type);
49 if (type <= SENSOR_ALL)
50 return SENSOR_ERROR_INVALID_PARAMETER;
52 return SENSOR_ERROR_NOT_SUPPORTED;
55 int sensor_recorder_create_option(sensor_recorder_option_h *option)
57 _D("Called : option[%#x]", *option);
60 return SENSOR_ERROR_INVALID_PARAMETER;
62 *option = (sensor_recorder_option_h)malloc(sizeof(sensor_recorder_option_h));
64 return SENSOR_ERROR_OUT_OF_MEMORY;
66 return SENSOR_ERROR_NONE;
69 int sensor_recorder_destroy_option(sensor_recorder_option_h option)
71 _D("Called : option[%#x]", option);
74 return SENSOR_ERROR_INVALID_PARAMETER;
76 return SENSOR_ERROR_NONE;
79 int sensor_recorder_option_set_int(sensor_recorder_option_h option, sensor_recorder_option_e attribute, int value)
81 _D("Called : attribute[%d] with value[%d] to option[%#x]", attribute, value, option);
84 return SENSOR_ERROR_INVALID_PARAMETER;
86 return SENSOR_ERROR_INVALID_PARAMETER;
88 return SENSOR_ERROR_NONE;
91 int sensor_recorder_create_query(sensor_recorder_query_h *query)
93 _D("Called : query[%#x]", *query);
96 return SENSOR_ERROR_INVALID_PARAMETER;
98 *query = (sensor_recorder_query_h)malloc(sizeof(sensor_recorder_query_h));
100 return SENSOR_ERROR_OUT_OF_MEMORY;
102 return SENSOR_ERROR_NONE;
105 int sensor_recorder_destroy_query(sensor_recorder_query_h query)
107 _D("Called : query[%#x]", query);
110 return SENSOR_ERROR_INVALID_PARAMETER;
112 return SENSOR_ERROR_NONE;
115 int sensor_recorder_query_set_int(sensor_recorder_query_h query, sensor_recorder_query_e attribute, int value)
117 _D("Called : attribute[%d] with value[%d] to query[%#x]", attribute, value, query);
120 return SENSOR_ERROR_INVALID_PARAMETER;
122 return SENSOR_ERROR_INVALID_PARAMETER;
124 return SENSOR_ERROR_NONE;
127 int sensor_recorder_query_set_time(sensor_recorder_query_h query, sensor_recorder_query_e attribute, time_t t)
129 _D("Called : attribute[%d] with time[%d] to query[%#x]", attribute, time(&t), query);
132 return SENSOR_ERROR_INVALID_PARAMETER;
134 return SENSOR_ERROR_INVALID_PARAMETER;
136 return SENSOR_ERROR_INVALID_PARAMETER;
138 return SENSOR_ERROR_NONE;
141 int sensor_recorder_read(sensor_type_e type, sensor_recorder_query_h query, sensor_recorder_data_cb cb, void *user_data)
143 _D("Called : query[%#x]", query);
145 if (type <= SENSOR_ALL)
146 return SENSOR_ERROR_INVALID_PARAMETER;
148 return SENSOR_ERROR_INVALID_PARAMETER;
150 return SENSOR_ERROR_NONE;
153 int sensor_recorder_read_sync(sensor_type_e type, sensor_recorder_query_h query, sensor_recorder_data_cb cb, void *user_data)
155 _D("Called : query[%#x]", query);
157 if (type <= SENSOR_ALL)
158 return SENSOR_ERROR_INVALID_PARAMETER;
160 return SENSOR_ERROR_INVALID_PARAMETER;
162 return SENSOR_ERROR_NONE;
165 int sensor_recorder_data_get_time(sensor_recorder_data_h data, time_t *start_time, time_t *end_time)
167 _D("Called : data[%#x]", data);
169 if (!data || !start_time || !end_time)
170 return SENSOR_ERROR_INVALID_PARAMETER;
172 return SENSOR_ERROR_NONE;
175 int sensor_recorder_data_get_int(sensor_recorder_data_h data, sensor_recorder_data_e key, int *value)
177 _D("Called : key[%d], data[%#x]", key, data);
180 return SENSOR_ERROR_INVALID_PARAMETER;
182 return SENSOR_ERROR_INVALID_PARAMETER;
184 return SENSOR_ERROR_NONE;
187 int sensor_recorder_data_get_double(sensor_recorder_data_h data, sensor_recorder_data_e key, double *value)
189 _D("Called : key[%d], data[%#x]", key, data);
192 return SENSOR_ERROR_INVALID_PARAMETER;
194 return SENSOR_ERROR_INVALID_PARAMETER;
196 return SENSOR_ERROR_NONE;