anbox-platform-sdk  1.23.0
Anbox Platform SDK API documentation
anbox::GpsProcessor Class Referenceabstract

GpsProcessor allows forwarding the gps data from platform plugin to Android container and process gps data which is in one of the following forms . GGA NEMA sentence . RMC NEMA sentence . GNSS NEMA sentence Please check http://www.gpsinformation.org/dale/nmea.htm out for more details about the above NEMA sentence. More...

#include <gps_processor.h>

+ Collaboration diagram for anbox::GpsProcessor:

Public Member Functions

 GpsProcessor ()=default
 
virtual ~GpsProcessor ()=default
 
 GpsProcessor (const GpsProcessor &)=delete
 
GpsProcessoroperator= (const GpsProcessor &)=delete
 
virtual int read_data (AnboxGpsData *data, int timeout)=0
 Read available gps data. More...
 
virtual int inject_data (AnboxGpsData data)=0
 Inject gps data into AnboxPlatform. More...
 

Detailed Description

GpsProcessor allows forwarding the gps data from platform plugin to Android container and process gps data which is in one of the following forms . GGA NEMA sentence . RMC NEMA sentence . GNSS NEMA sentence Please check http://www.gpsinformation.org/dale/nmea.htm out for more details about the above NEMA sentence.

Definition at line 38 of file gps_processor.h.

Constructor & Destructor Documentation

◆ GpsProcessor() [1/2]

anbox::GpsProcessor::GpsProcessor ( )
default

◆ ~GpsProcessor()

virtual anbox::GpsProcessor::~GpsProcessor ( )
virtualdefault

◆ GpsProcessor() [2/2]

anbox::GpsProcessor::GpsProcessor ( const GpsProcessor )
delete

Member Function Documentation

◆ inject_data()

virtual int anbox::GpsProcessor::inject_data ( AnboxGpsData  data)
pure virtual

Inject gps data into AnboxPlatform.

This function allows injecting gps data into the platform and letting the GpsProcessor handle the gps data.

Parameters
dataa chunk of gps 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=()

GpsProcessor& anbox::GpsProcessor::operator= ( const GpsProcessor )
delete

◆ read_data()

virtual int anbox::GpsProcessor::read_data ( AnboxGpsData data,
int  timeout 
)
pure virtual

Read available gps data.

Anbox will call read_data() to query the plugin for the next available gps data which is then forwarded to the Android container. If no gps data is available and timeout is set to -1, the function must block until gps data is available.

Parameters
gpsdata provided by the processor on a successful read
timeoutmaximum number of milliseconds to wait for the next available gps data. The following possible values for timeout must be handled:
timeout Behavior
0 Non-blocking mode; return -EIO immediately if no gps data to process.
< 0 Block indefinitely until a gps data is available.
> 0 Wait up to a maximum of timeout milliseconds for a gps data.
Returns
0 on success otherwise returns EINVAL on error occurs.

The documentation for this class was generated from the following file: