1984826cc158193e61e3a00359ef4f6699c7d748aMathias Agopian/*
2984826cc158193e61e3a00359ef4f6699c7d748aMathias Agopian * Copyright (C) 2011 The Android Open Source Project
3984826cc158193e61e3a00359ef4f6699c7d748aMathias Agopian *
4984826cc158193e61e3a00359ef4f6699c7d748aMathias Agopian * Licensed under the Apache License, Version 2.0 (the "License");
5984826cc158193e61e3a00359ef4f6699c7d748aMathias Agopian * you may not use this file except in compliance with the License.
6984826cc158193e61e3a00359ef4f6699c7d748aMathias Agopian * You may obtain a copy of the License at
7984826cc158193e61e3a00359ef4f6699c7d748aMathias Agopian *
8984826cc158193e61e3a00359ef4f6699c7d748aMathias Agopian *      http://www.apache.org/licenses/LICENSE-2.0
9984826cc158193e61e3a00359ef4f6699c7d748aMathias Agopian *
10984826cc158193e61e3a00359ef4f6699c7d748aMathias Agopian * Unless required by applicable law or agreed to in writing, software
11984826cc158193e61e3a00359ef4f6699c7d748aMathias Agopian * distributed under the License is distributed on an "AS IS" BASIS,
12984826cc158193e61e3a00359ef4f6699c7d748aMathias Agopian * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13984826cc158193e61e3a00359ef4f6699c7d748aMathias Agopian * See the License for the specific language governing permissions and
14984826cc158193e61e3a00359ef4f6699c7d748aMathias Agopian * limitations under the License.
15984826cc158193e61e3a00359ef4f6699c7d748aMathias Agopian */
16984826cc158193e61e3a00359ef4f6699c7d748aMathias Agopian
17984826cc158193e61e3a00359ef4f6699c7d748aMathias Agopian#ifndef ANDROID_CORRECTED_GYRO_SENSOR_H
18984826cc158193e61e3a00359ef4f6699c7d748aMathias Agopian#define ANDROID_CORRECTED_GYRO_SENSOR_H
19984826cc158193e61e3a00359ef4f6699c7d748aMathias Agopian
20984826cc158193e61e3a00359ef4f6699c7d748aMathias Agopian#include <stdint.h>
21984826cc158193e61e3a00359ef4f6699c7d748aMathias Agopian#include <sys/types.h>
22984826cc158193e61e3a00359ef4f6699c7d748aMathias Agopian
23984826cc158193e61e3a00359ef4f6699c7d748aMathias Agopian#include <gui/Sensor.h>
24984826cc158193e61e3a00359ef4f6699c7d748aMathias Agopian
25984826cc158193e61e3a00359ef4f6699c7d748aMathias Agopian#include "SensorInterface.h"
26984826cc158193e61e3a00359ef4f6699c7d748aMathias Agopian
27984826cc158193e61e3a00359ef4f6699c7d748aMathias Agopian// ---------------------------------------------------------------------------
28984826cc158193e61e3a00359ef4f6699c7d748aMathias Agopiannamespace android {
29984826cc158193e61e3a00359ef4f6699c7d748aMathias Agopian// ---------------------------------------------------------------------------
30984826cc158193e61e3a00359ef4f6699c7d748aMathias Agopian
31984826cc158193e61e3a00359ef4f6699c7d748aMathias Agopianclass SensorDevice;
32984826cc158193e61e3a00359ef4f6699c7d748aMathias Agopianclass SensorFusion;
33984826cc158193e61e3a00359ef4f6699c7d748aMathias Agopian
34755c451c7861a029e26e5f16e319b629169e656dPeng Xuclass CorrectedGyroSensor : public VirtualSensor {
35984826cc158193e61e3a00359ef4f6699c7d748aMathias Agopian    Sensor mGyro;
36984826cc158193e61e3a00359ef4f6699c7d748aMathias Agopian
37984826cc158193e61e3a00359ef4f6699c7d748aMathias Agopianpublic:
38984826cc158193e61e3a00359ef4f6699c7d748aMathias Agopian    CorrectedGyroSensor(sensor_t const* list, size_t count);
390cc8f809924706c7d683da30605f432635dd5bb6Peng Xu    virtual bool process(sensors_event_t* outEvent, const sensors_event_t& event) override;
400cc8f809924706c7d683da30605f432635dd5bb6Peng Xu    virtual status_t activate(void* ident, bool enabled) override;
410cc8f809924706c7d683da30605f432635dd5bb6Peng Xu    virtual status_t setDelay(void* ident, int handle, int64_t ns) override;
42984826cc158193e61e3a00359ef4f6699c7d748aMathias Agopian};
43984826cc158193e61e3a00359ef4f6699c7d748aMathias Agopian
44984826cc158193e61e3a00359ef4f6699c7d748aMathias Agopian// ---------------------------------------------------------------------------
45984826cc158193e61e3a00359ef4f6699c7d748aMathias Agopian}; // namespace android
46984826cc158193e61e3a00359ef4f6699c7d748aMathias Agopian
47984826cc158193e61e3a00359ef4f6699c7d748aMathias Agopian#endif // ANDROID_CORRECTED_GYRO_SENSOR_H
48