4 * Copyright (c) 2017 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 __AUTO_ROTATION_SENSOR_H__
21 #define __AUTO_ROTATION_SENSOR_H__
23 #include <fusion_sensor.h>
24 #include <sensor_types.h>
26 #include "auto_rotation_alg.h"
28 class auto_rotation_sensor : public fusion_sensor {
30 auto_rotation_sensor();
31 virtual ~auto_rotation_sensor();
33 int get_sensor_info(const sensor_info2_t **info);
34 int get_required_sensors(const required_sensor_s **sensors);
36 int update(uint32_t id, sensor_data_t *data, int len);
37 int get_data(sensor_data_t **data, int *len);
39 int start(observer_h ob);
40 int stop(observer_h ob);
42 int set_interval(observer_h ob, int32_t &interval);
48 auto_rotation_alg *get_alg(void);
51 unsigned long long m_rotation_time;
53 auto_rotation_alg *m_alg;
56 #endif /* __AUTO_ROTATION_SENSOR_H__ */