platform_sensor_base.h revision 48fda6e1eedf6ba80ae7596fc7676f8318a1e88e
1/*
2 * Copyright (C) 2016 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 CHRE_PLATFORM_SLPI_PLATFORM_SENSOR_BASE_H_
18#define CHRE_PLATFORM_SLPI_PLATFORM_SENSOR_BASE_H_
19
20extern "C" {
21
22#include "sns_smgr_api_v01.h"
23
24}  // extern "C"
25
26namespace chre {
27
28/**
29 * Storage for the SLPI implementation of the PlatformSensor class.
30 */
31class PlatformSensorBase {
32 public:
33  //! The handle to uniquely identify this sensor.
34  uint8_t sensorId;
35
36  //! The type of data that this sensor uses. SMGR overloads sensor IDs and
37  //! allows them to behave as two sensors. The data type differentiates which
38  //! sensor this object refers to.
39  uint8_t dataType;
40
41  //! The calibration type of this sensor. SMGR overloads sensorId and dataType
42  //! and allows them to represent both uncalibrated and calibrated sensors.
43  uint8_t calType = 0;
44
45  //! The name (type and model) of this sensor.
46  char sensorName[SNS_SMGR_MAX_SENSOR_NAME_SIZE_V01];
47};
48
49}  // namespace chre
50
51#endif  // CHRE_PLATFORM_SLPI_PLATFORM_SENSOR_BASE_H_
52