SensorProcessor allows processing sensor events from the Android container and perform sensor processing for a variety of sensor devices.
More...
#include <sensor_processor.h>
SensorProcessor allows processing sensor events from the Android container and perform sensor processing for a variety of sensor devices.
Definition at line 29 of file sensor_processor.h.
◆ SensorProcessor() [1/2]
anbox::SensorProcessor::SensorProcessor |
( |
| ) |
|
|
default |
◆ ~SensorProcessor()
virtual anbox::SensorProcessor::~SensorProcessor |
( |
| ) |
|
|
virtualdefault |
◆ SensorProcessor() [2/2]
◆ inject_data()
Inject sensor data into AnboxPlatform.
This function allows injecting sensor data into the platform and letting the SensorProcessor handle the sensor data.
- Parameters
-
data | a chunk of sensor data to be pushed into the internal queue. |
- Returns
- 0 on success, otherwise returns EINVAL on error occurs.
- Note
- This function is only used in our test suite to facilitate our automation tests and it is subject to change at any time.
◆ operator=()
◆ read_data()
virtual int anbox::SensorProcessor::read_data |
( |
AnboxSensorData * |
data, |
|
|
int |
timeout |
|
) |
| |
|
pure virtual |
Read available sensor data.
Anbox will call read_data() to query the plugin for the next available sensor data which is then forwarded to the Android container. If no sensor data is available and timeout is set to -1, the function must block until sensor data is available.
- Parameters
-
sensor | data provided by the processor on a successful read |
timeout | maximum number of milliseconds to wait for the next available sensor data. The following possible values for timeout must be handled:
timeout | Behavior |
0 | Non-blocking mode; return -EIO immediately if no sensor data to process. |
< 0 | Block indefinitely until a sensor data is available. |
> 0 | Wait up to a maximum of timeout milliseconds for a sensor data. |
|
- Returns
- 0 on success otherwise returns EINVAL on error occurs.
◆ supported_sensors()
virtual AnboxSensorType anbox::SensorProcessor::supported_sensors |
( |
| ) |
const |
|
pure virtual |
Sensors supported by this processor.
Internally Anbox will tell Android about the supported sensors and ensure they are being exposed through the right Android APIs. Multiple sensor types can be specified by using OR bitwise operator.
- Returns
- sensors that are supported by this processor
The documentation for this class was generated from the following file: