4 * Copyright (c) 2014 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.
20 #ifndef _ACCEL_SENSOR_DEVICE_H_
21 #define _ACCEL_SENSOR_DEVICE_H_
23 #include <sensor_device_base.h>
25 class accel_sensor_device : public sensor_device_base
28 accel_sensor_device();
29 virtual ~accel_sensor_device();
31 int get_poll_fd(void);
32 bool get_sensors(std::vector<sensor_handle_t> &sensors);
33 bool enable(uint32_t id);
34 bool disable(uint32_t id);
35 bool set_interval(uint32_t id, unsigned long val);
36 bool set_batch_latency(uint32_t id, unsigned long val);
37 bool set_command(uint32_t id, std::string command, std::string value);
38 bool is_data_ready(void);
39 bool get_sensor_data(uint32_t id, sensor_data_t &data);
40 int get_sensor_event(uint32_t id, sensor_event_t **event);
41 bool get_properties(uint32_t id, sensor_properties_s &properties);
48 unsigned long m_polling_interval;
49 unsigned long long m_fired_time;
50 bool m_sensorhub_controlled;
52 std::string m_data_node;
53 std::string m_enable_node;
54 std::string m_interval_node;
56 bool update_value_input_event(void);
57 void raw_to_base(sensor_data_t &data);
59 #endif /*_ACCEL_SENSOR_DEVICE_CLASS_H_*/