32153b36f940a7a038acd6ebef34d9943690f984
[platform/core/system/sensord.git] / src / sensor / pedometer / pedometer_sensor.h
1 /*
2  * Copyright (c) 2017 Samsung Electronics Co., Ltd.
3  *
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
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
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.
15  *
16  */
17
18 #ifndef __PEDOMETER_SENSOR_H__
19 #define __PEDOMETER_SENSOR_H__
20
21 #include <fusion_sensor.h>
22 #include <sensor_types.h>
23
24 #include "pedometer.h"
25
26 class pedometer_sensor : public fusion_sensor {
27 public:
28         pedometer_sensor();
29         virtual ~pedometer_sensor();
30
31         int get_sensor_info(const sensor_info2_t **info);
32         int get_required_sensors(const required_sensor_s **sensors);
33
34         int update(uint32_t id, sensor_data_t *data, int len);
35         int get_data(sensor_data_t **data, int *len);
36
37         int start(observer_h ob);
38         int stop(observer_h ob);
39
40 private:
41         long long m_step_count;
42         float m_step_length;
43         float m_step_total_length;
44         float m_step_speed;
45         unsigned long long m_time;
46
47         pedometer m_pedometer;
48 };
49
50 #endif /* __PEDOMETER_SENSOR_H__ */