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_NONE;
67 int sensor_recorder_destroy_option(sensor_recorder_option_h option)
69 _D("Called : option[%#x]", option);
72 return SENSOR_ERROR_INVALID_PARAMETER;
74 return SENSOR_ERROR_NONE;
77 int sensor_recorder_option_set_int(sensor_recorder_option_h option, sensor_recorder_option_e attribute, int value)
79 _D("Called : attribute[%d] with value[%d] to option[%#x]", attribute, value, option);
82 return SENSOR_ERROR_INVALID_PARAMETER;
84 return SENSOR_ERROR_INVALID_PARAMETER;
86 return SENSOR_ERROR_NONE;
89 int sensor_recorder_create_query(sensor_recorder_query_h *query)
91 _D("Called : query[%#x]", *query);
94 return SENSOR_ERROR_INVALID_PARAMETER;
96 *query = (sensor_recorder_query_h)malloc(sizeof(sensor_recorder_query_h));
98 return SENSOR_ERROR_NONE;
101 int sensor_recorder_destroy_query(sensor_recorder_query_h query)
103 _D("Called : query[%#x]", query);
106 return SENSOR_ERROR_INVALID_PARAMETER;
108 return SENSOR_ERROR_NONE;
111 int sensor_recorder_query_set_int(sensor_recorder_query_h query, sensor_recorder_query_e attribute, int value)
113 _D("Called : attribute[%d] with value[%d] to query[%#x]", attribute, value, query);
116 return SENSOR_ERROR_INVALID_PARAMETER;
118 return SENSOR_ERROR_INVALID_PARAMETER;
120 return SENSOR_ERROR_NONE;
123 int sensor_recorder_query_set_time(sensor_recorder_query_h query, sensor_recorder_query_e attribute, time_t t)
125 _D("Called : attribute[%d] with time[%d] to query[%#x]", attribute, time(&t), query);
128 return SENSOR_ERROR_INVALID_PARAMETER;
130 return SENSOR_ERROR_INVALID_PARAMETER;
132 return SENSOR_ERROR_NONE;
135 int sensor_recorder_read(sensor_type_e type, sensor_recorder_query_h query, sensor_recorder_data_cb cb, void *user_data)
137 _D("Called : query[%#x]", query);
139 if (type <= SENSOR_ALL)
140 return SENSOR_ERROR_INVALID_PARAMETER;
142 return SENSOR_ERROR_INVALID_PARAMETER;
144 return SENSOR_ERROR_NONE;
147 int sensor_recorder_read_sync(sensor_type_e type, sensor_recorder_query_h query, sensor_recorder_data_cb cb, void *user_data)
149 _D("Called : query[%#x]", query);
151 if (type <= SENSOR_ALL)
152 return SENSOR_ERROR_INVALID_PARAMETER;
154 return SENSOR_ERROR_INVALID_PARAMETER;
156 return SENSOR_ERROR_NONE;
159 int sensor_recorder_data_get_time(sensor_recorder_data_h data, time_t *start_time, time_t *end_time)
161 _D("Called : data[%#x]", data);
163 if (!data || !start_time || !end_time)
164 return SENSOR_ERROR_INVALID_PARAMETER;
166 return SENSOR_ERROR_NONE;
169 int sensor_recorder_data_get_int(sensor_recorder_data_h data, sensor_recorder_data_e key, int *value)
171 _D("Called : key[%d], data[%#x]", key, data);
174 return SENSOR_ERROR_INVALID_PARAMETER;
176 return SENSOR_ERROR_INVALID_PARAMETER;
178 return SENSOR_ERROR_NONE;
181 int sensor_recorder_data_get_double(sensor_recorder_data_h data, sensor_recorder_data_e key, double *value)
183 _D("Called : key[%d], data[%#x]", key, data);
186 return SENSOR_ERROR_INVALID_PARAMETER;
188 return SENSOR_ERROR_INVALID_PARAMETER;
190 return SENSOR_ERROR_NONE;