/*
* sensord
*
- * Copyright (c) 2014 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2017 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
*
*/
-#ifndef _AUTO_ROTATION_SENSOR_H_
-#define _AUTO_ROTATION_SENSOR_H_
+#ifndef __AUTO_ROTATION_SENSOR_H__
+#define __AUTO_ROTATION_SENSOR_H__
-#include <virtual_sensor.h>
+#include <fusion_sensor.h>
#include <sensor_types.h>
-#include <auto_rotation_alg.h>
-class auto_rotation_sensor : public virtual_sensor {
+#include "auto_rotation_alg.h"
+
+class auto_rotation_sensor : public fusion_sensor {
public:
auto_rotation_sensor();
virtual ~auto_rotation_sensor();
- /* initialize sensor */
- bool init(void);
+ int get_sensor_info(const sensor_info2_t **info);
+ int get_required_sensors(const required_sensor_s **sensors);
- /* sensor info */
- virtual sensor_type_t get_type(void);
- virtual unsigned int get_event_type(void);
- virtual const char* get_name(void);
+ int update(uint32_t id, sensor_data_t *data, int len);
+ int get_data(sensor_data_t **data, int *len);
- virtual bool get_sensor_info(sensor_info &info);
+ int start(observer_h ob);
+ int stop(observer_h ob);
- /* synthesize event */
- virtual void synthesize(const sensor_event_t& event);
+ int set_interval(observer_h ob, int32_t &interval);
- /* get data */
- virtual int get_data(sensor_data_t **data, int *length);
private:
- sensor_base *m_accel_sensor;
- auto_rotation_alg *m_alg;
+ bool init(void);
+ void deinit(void);
+
+ auto_rotation_alg *get_alg(void);
int m_rotation;
- unsigned int m_interval;
unsigned long long m_rotation_time;
- virtual bool set_interval(unsigned long interval);
- virtual bool set_batch_latency(unsigned long latency);
- virtual bool set_wakeup(int wakeup);
-
- virtual bool on_start(void);
- virtual bool on_stop(void);
-
- auto_rotation_alg *get_alg(void);
+ auto_rotation_alg *m_alg;
};
-#endif /* _AUTO_ROTATION_SENSOR_H_ */
+#endif /* __AUTO_ROTATION_SENSOR_H__ */