anbox-platform-sdk 1.28.0
Anbox Platform SDK API documentation
sensor_processor.h
Go to the documentation of this file.
1/*
2 * This file is part of Anbox Platform SDK
3 *
4 * Copyright 2021 Canonical Ltd.
5 *
6 * Licensed under the Apache License, Version 2.0 (the "License");
7 * you may not use this file except in compliance with the License.
8 * You may obtain a copy of the License at
9 *
10 * http://www.apache.org/licenses/LICENSE-2.0
11 *
12 * Unless required by applicable law or agreed to in writing, software
13 * distributed under the License is distributed on an "AS IS" BASIS,
14 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 * See the License for the specific language governing permissions and
16 * limitations under the License.
17 */
18
19#ifndef ANBOX_SDK_SENSOR_PROCESSOR_H_
20#define ANBOX_SDK_SENSOR_PROCESSOR_H_
21
23
24#include <errno.h>
25
26namespace anbox {
32 public:
33 SensorProcessor() = default;
34 virtual ~SensorProcessor() = default;
37
48
67 virtual int read_data(AnboxSensorData* data, int timeout) = 0;
68
80 virtual int inject_data(AnboxSensorData data) = 0;
81
94 virtual int activate_sensor(AnboxSensorType type, bool on) {
95 (void) type;
96 (void) on;
97 return -EIO;
98 }
99};
100} // namespace anbox
101
102#endif
SensorProcessor allows processing sensor events from the Android container and perform sensor process...
virtual AnboxSensorType supported_sensors() const =0
Sensors supported by this processor.
virtual int read_data(AnboxSensorData *data, int timeout)=0
Read available sensor data.
SensorProcessor & operator=(const SensorProcessor &)=delete
SensorProcessor(const SensorProcessor &)=delete
virtual int inject_data(AnboxSensorData data)=0
Inject sensor data into AnboxPlatform.
virtual int activate_sensor(AnboxSensorType type, bool on)
Activate or deactivate a specific sensor.
virtual ~SensorProcessor()=default
AnboxSensorData represents the sensor data stucture,.
Definition types.h:1406
AnboxSensorType
AnboxSensorType describes all sensor types supported by Anbox.
Definition types.h:1353