blob: 46026a487c131675201d77753161eb0d459374d9 [file] [log] [blame]
Brian Stack897528d2018-10-23 10:38:03 -07001/*
2 * Copyright (C) 2018 The Android Open Source Project
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#ifndef ANDROID_HARDWARE_SENSORS_V2_0_SENSOR_H
18#define ANDROID_HARDWARE_SENSORS_V2_0_SENSOR_H
19
20#include <android/hardware/sensors/1.0/types.h>
21
22using ::android::hardware::sensors::V1_0::SensorInfo;
23
24namespace android {
25namespace hardware {
26namespace sensors {
27namespace V2_0 {
28namespace implementation {
29
30class Sensor {
31 public:
32 Sensor();
33
34 const SensorInfo& getSensorInfo() const;
35 bool batch(int32_t samplingPeriodNs);
36 void activate(bool enable);
37
38 protected:
39 bool mIsEnabled;
40 int64_t mSamplingPeriodNs;
41 SensorInfo mSensorInfo;
42};
43
44} // namespace implementation
45} // namespace V2_0
46} // namespace sensors
47} // namespace hardware
48} // namespace android
49
50#endif // ANDROID_HARDWARE_SENSORS_V2_0_SENSOR_H