1f001c92436b4a66eb7687286325ced7f10c9f917Mathias Agopian/* 2f001c92436b4a66eb7687286325ced7f10c9f917Mathias Agopian * Copyright (C) 2010 The Android Open Source Project 3f001c92436b4a66eb7687286325ced7f10c9f917Mathias Agopian * 4f001c92436b4a66eb7687286325ced7f10c9f917Mathias Agopian * Licensed under the Apache License, Version 2.0 (the "License"); 5f001c92436b4a66eb7687286325ced7f10c9f917Mathias Agopian * you may not use this file except in compliance with the License. 6f001c92436b4a66eb7687286325ced7f10c9f917Mathias Agopian * You may obtain a copy of the License at 7f001c92436b4a66eb7687286325ced7f10c9f917Mathias Agopian * 8f001c92436b4a66eb7687286325ced7f10c9f917Mathias Agopian * http://www.apache.org/licenses/LICENSE-2.0 9f001c92436b4a66eb7687286325ced7f10c9f917Mathias Agopian * 10f001c92436b4a66eb7687286325ced7f10c9f917Mathias Agopian * Unless required by applicable law or agreed to in writing, software 11f001c92436b4a66eb7687286325ced7f10c9f917Mathias Agopian * distributed under the License is distributed on an "AS IS" BASIS, 12f001c92436b4a66eb7687286325ced7f10c9f917Mathias Agopian * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13f001c92436b4a66eb7687286325ced7f10c9f917Mathias Agopian * See the License for the specific language governing permissions and 14f001c92436b4a66eb7687286325ced7f10c9f917Mathias Agopian * limitations under the License. 15f001c92436b4a66eb7687286325ced7f10c9f917Mathias Agopian */ 16f001c92436b4a66eb7687286325ced7f10c9f917Mathias Agopian 17f001c92436b4a66eb7687286325ced7f10c9f917Mathias Agopian#ifndef ANDROID_LINEAR_ACCELERATION_SENSOR_H 18f001c92436b4a66eb7687286325ced7f10c9f917Mathias Agopian#define ANDROID_LINEAR_ACCELERATION_SENSOR_H 19f001c92436b4a66eb7687286325ced7f10c9f917Mathias Agopian 20f001c92436b4a66eb7687286325ced7f10c9f917Mathias Agopian#include <stdint.h> 21f001c92436b4a66eb7687286325ced7f10c9f917Mathias Agopian#include <sys/types.h> 22f001c92436b4a66eb7687286325ced7f10c9f917Mathias Agopian 23801ea093b0e923a61b832f2adba698a273479880Mathias Agopian#include <sensor/Sensor.h> 24f001c92436b4a66eb7687286325ced7f10c9f917Mathias Agopian 25f001c92436b4a66eb7687286325ced7f10c9f917Mathias Agopian#include "SensorInterface.h" 26f001c92436b4a66eb7687286325ced7f10c9f917Mathias Agopian#include "GravitySensor.h" 27f001c92436b4a66eb7687286325ced7f10c9f917Mathias Agopian 28f001c92436b4a66eb7687286325ced7f10c9f917Mathias Agopian// --------------------------------------------------------------------------- 29f001c92436b4a66eb7687286325ced7f10c9f917Mathias Agopiannamespace android { 30f001c92436b4a66eb7687286325ced7f10c9f917Mathias Agopian// --------------------------------------------------------------------------- 31f001c92436b4a66eb7687286325ced7f10c9f917Mathias Agopian 32984826cc158193e61e3a00359ef4f6699c7d748aMathias Agopianclass SensorDevice; 33984826cc158193e61e3a00359ef4f6699c7d748aMathias Agopianclass SensorFusion; 34984826cc158193e61e3a00359ef4f6699c7d748aMathias Agopian 35755c451c7861a029e26e5f16e319b629169e656dPeng Xuclass LinearAccelerationSensor : public VirtualSensor { 36f001c92436b4a66eb7687286325ced7f10c9f917Mathias Agopian GravitySensor mGravitySensor; 37f001c92436b4a66eb7687286325ced7f10c9f917Mathias Agopian 38f001c92436b4a66eb7687286325ced7f10c9f917Mathias Agopian virtual bool process(sensors_event_t* outEvent, 39f001c92436b4a66eb7687286325ced7f10c9f917Mathias Agopian const sensors_event_t& event); 40f001c92436b4a66eb7687286325ced7f10c9f917Mathias Agopianpublic: 41f001c92436b4a66eb7687286325ced7f10c9f917Mathias Agopian LinearAccelerationSensor(sensor_t const* list, size_t count); 420cc8f809924706c7d683da30605f432635dd5bb6Peng Xu virtual status_t activate(void* ident, bool enabled) override; 430cc8f809924706c7d683da30605f432635dd5bb6Peng Xu virtual status_t setDelay(void* ident, int handle, int64_t ns) override; 44f001c92436b4a66eb7687286325ced7f10c9f917Mathias Agopian}; 45f001c92436b4a66eb7687286325ced7f10c9f917Mathias Agopian 46f001c92436b4a66eb7687286325ced7f10c9f917Mathias Agopian// --------------------------------------------------------------------------- 47f001c92436b4a66eb7687286325ced7f10c9f917Mathias Agopian}; // namespace android 48f001c92436b4a66eb7687286325ced7f10c9f917Mathias Agopian 49f001c92436b4a66eb7687286325ced7f10c9f917Mathias Agopian#endif // ANDROID_LINEAR_ACCELERATION_SENSOR_H 50