4 * Copyright (c) 2013 Samsung Electronics Co., Ltd.
6 * Licensed under the Apache License, Version 2.0 (the "License");
7 * you may not use this file except in compliance with the License.
8 * You may obtain a copy of the License at
10 * http://www.apache.org/licenses/LICENSE-2.0
12 * Unless required by applicable law or agreed to in writing, software
13 * distributed under the License is distributed on an "AS IS" BASIS,
14 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 * See the License for the specific language governing permissions and
16 * limitations under the License.
21 #include <sensor_types.h>
23 #include <sensor_internal.h>
24 #include <sensor_internal_deprecated.h>
26 API int sensord_get_sensors(sensor_type_t type, sensor_t **list, int *sensor_count)
31 API int sensord_get_default_sensor(sensor_type_t type, sensor_t *sensor)
36 API bool sensord_get_sensor_list(sensor_type_t type, sensor_t **list, int *sensor_count)
41 API sensor_t sensord_get_sensor(sensor_type_t type)
46 API bool sensord_get_type(sensor_t sensor, sensor_type_t *type)
51 API const char* sensord_get_uri(sensor_t sensor)
56 API const char* sensord_get_name(sensor_t sensor)
61 API const char* sensord_get_vendor(sensor_t sensor)
66 API bool sensord_get_privilege(sensor_t sensor, sensor_privilege_t *privilege)
71 API bool sensord_get_min_range(sensor_t sensor, float *min_range)
76 API bool sensord_get_max_range(sensor_t sensor, float *max_range)
81 API bool sensord_get_resolution(sensor_t sensor, float *resolution)
86 API bool sensord_get_min_interval(sensor_t sensor, int *min_interval)
91 API bool sensord_get_fifo_count(sensor_t sensor, int *fifo_count)
96 API bool sensord_get_max_batch_count(sensor_t sensor, int *max_batch_count)
101 API bool sensord_get_supported_event_types(sensor_t sensor, unsigned int **event_types, int *count)
106 API bool sensord_is_supported_event_type(sensor_t sensor, unsigned int event_type, bool *supported)
111 API bool sensord_is_wakeup_supported(sensor_t sensor)
116 API int sensord_connect(sensor_t sensor)
121 API bool sensord_disconnect(int handle)
126 API bool sensord_register_event(int handle, unsigned int event_type, unsigned int interval, unsigned int max_batch_latency, sensor_cb_t cb, void *user_data)
131 API bool sensord_unregister_event(int handle, unsigned int event_type)
136 API bool sensord_register_accuracy_cb(int handle, sensor_accuracy_changed_cb_t cb, void *user_data)
141 API bool sensord_unregister_accuracy_cb(int handle)
146 API bool sensord_start(int handle, int option)
151 API bool sensord_stop(int handle)
156 API bool sensord_change_event_interval(int handle, unsigned int event_type, unsigned int interval)
161 API bool sensord_change_event_max_batch_latency(int handle, unsigned int event_type, unsigned int max_batch_latency)
166 API bool sensord_set_option(int handle, int option)
171 API int sensord_set_attribute_int(int handle, int attribute, int value)
176 API int sensord_set_attribute_str(int handle, int attribute, const char *value, int len)
181 API bool sensord_send_sensorhub_data(int handle, const char *data, int data_len)
186 API bool sensord_send_command(int handle, const char *command, int command_len)
191 API bool sensord_get_data(int handle, unsigned int data_id, sensor_data_t* sensor_data)
196 API bool sensord_flush(int handle)
201 API bool sensord_register_hub_event(int handle, unsigned int event_type, unsigned int interval, unsigned int max_batch_latency, sensorhub_cb_t cb, void *user_data)
206 API bool sensord_set_passive_mode(int handle, bool passive)
211 /* Sensor Internal API using URI */
212 API int sensord_get_default_sensor_by_uri(const char *uri, sensor_t *sensor)
217 API int sensord_get_sensors_by_uri(const char *uri, sensor_t **list, int *count)
222 API int sensord_add_sensor_added_cb(sensord_added_cb callback, void *user_data)
227 API int sensord_remove_sensor_added_cb(sensord_added_cb callback)
232 API int sensord_add_sensor_removed_cb(sensord_removed_cb callback, void *user_data)
237 API int sensord_remove_sensor_removed_cb(sensord_removed_cb callback)
242 /* Sensor provider */
243 API int sensord_create_provider(const char *uri, sensord_provider_h *provider)
248 API int sensord_destroy_provider(sensord_provider_h provider)
253 API int sensord_add_provider(sensord_provider_h provider)
258 API int sensord_remove_provider(sensord_provider_h provider)
263 API int sensord_provider_set_name(sensord_provider_h provider, const char *name)
268 API int sensord_provider_set_vendor(sensord_provider_h provider, const char *vendor)
273 API int sensord_provider_set_range(sensord_provider_h provider, float min_range, float max_range)
278 API int sensord_provider_set_resolution(sensord_provider_h provider, float resolution)
283 API int sensord_provider_set_start_cb(sensord_provider_h provider, sensord_provider_start_cb callback, void *user_data)
288 API int sensord_provider_set_stop_cb(sensord_provider_h provider, sensord_provider_stop_cb callback, void *user_data)
293 API int sensord_provider_set_interval_changed_cb(sensord_provider_h provider, sensord_provider_interval_changed_cb callback, void *user_data)
298 API int sensord_provider_publish(sensord_provider_h provider, sensor_data_t data)