• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (c) 2020-2021 Huawei Device Co., Ltd.
3  *
4  * HDF is dual licensed: you can use it either under the terms of
5  * the GPL, or the BSD license, at your option.
6  * See the LICENSE file in the root of this repository for complete details.
7  */
8 
9 #ifndef SENSOR_DEVICE_IF_H
10 #define SENSOR_DEVICE_IF_H
11 
12 #include "sensor_device_type.h"
13 
14 struct SensorOps {
15     int32_t (*Enable)(void);
16     int32_t (*Disable)(void);
17     int32_t (*SetBatch)(int64_t samplingInterval, int64_t reportInterval);
18     int32_t (*SetMode)(int32_t mode);
19     int32_t (*SetOption)(uint32_t option);
20 };
21 
22 struct SensorDeviceInfo {
23     struct SensorBasicInfo sensorInfo;
24     struct SensorOps ops;
25 };
26 
27 int32_t AddSensorDevice(const struct SensorDeviceInfo *deviceInfo);
28 int32_t DeleteSensorDevice(const struct SensorBasicInfo *sensorBaseInfo);
29 int32_t ReportSensorEvent(const struct SensorReportEvent *events);
30 
31 #endif /* SENSOR_DEVICE_IF_H */
32