anbox-platform-sdk  1.23.0
Anbox Platform SDK API documentation
anbox::VhalConnector Class Reference

Connects a platform with the Android VHAL interface. The platform can invoke the callbacks which are provided by Anbox on demand when answering a request. More...

#include <vhal_connector.h>

+ Collaboration diagram for anbox::VhalConnector:

Public Member Functions

 VhalConnector ()=default
 
virtual ~VhalConnector ()=default
 
 VhalConnector (const VhalConnector &)=delete
 
VhalConnectoroperator= (const VhalConnector &)=delete
 
bool is_available ()
 Check if the Android VHAL is supported and available. More...
 
AnboxVhalAnswerStatus get_all_prop_configs (AnboxVhalAnswerGetConfigs *result)
 Get all property configs. More...
 
AnboxVhalAnswerStatus get_prop_configs (int32_t *props, size_t props_size, AnboxVhalAnswerGetConfigs *result)
 Get requested property configs. More...
 
AnboxVhalAnswerStatus get (AnboxVhalCommandGet *request, AnboxVhalPropertyValue *result)
 Get the requested value. More...
 
AnboxVhalAnswerStatus set (AnboxVhalCommandSet *request)
 Set the requested value. More...
 
void set_callbacks (const AnboxVhalConnectorCallbacks &callbacks, void *user_data)
 Set all VHAL-related callbacks. More...
 

Detailed Description

Connects a platform with the Android VHAL interface. The platform can invoke the callbacks which are provided by Anbox on demand when answering a request.

Definition at line 83 of file vhal_connector.h.

Constructor & Destructor Documentation

◆ VhalConnector() [1/2]

anbox::VhalConnector::VhalConnector ( )
default

◆ ~VhalConnector()

virtual anbox::VhalConnector::~VhalConnector ( )
virtualdefault

◆ VhalConnector() [2/2]

anbox::VhalConnector::VhalConnector ( const VhalConnector )
delete

Member Function Documentation

◆ get()

AnboxVhalAnswerStatus anbox::VhalConnector::get ( AnboxVhalCommandGet request,
AnboxVhalPropertyValue result 
)
inline

Get the requested value.

Parameters
requeststructure holding the Get request. It will not be modified by the callee.
resultstructure holding the returned value. All array members (int32_values, int64_values, float_values, bytes, string_value) are allocated on the heap. The caller is responsible for freeing their memory after the call.
Returns
ANBOX_VHAL_ANSWER_STATUS_OK on success, error code otherwise.

Definition at line 151 of file vhal_connector.h.

References ANBOX_VHAL_ANSWER_STATUS_INVALID, and AnboxVhalConnectorCallbacks::get_callback.

◆ get_all_prop_configs()

AnboxVhalAnswerStatus anbox::VhalConnector::get_all_prop_configs ( AnboxVhalAnswerGetConfigs result)
inline

Get all property configs.

Parameters
resultstructure holding the returned configs. The 'configs' member will be allocated on the heap, as well as all arrays for each AnboxVhalPropertyConfig (area_configs, config_array, config_string, prop_name). Each AnboxVhalAreaConfig has the area_names array also allocated on the heap. The caller is responsible for freeing their memory after the call.
Returns
ANBOX_VHAL_ANSWER_STATUS_OK on success, error code otherwise.

Definition at line 112 of file vhal_connector.h.

References ANBOX_VHAL_ANSWER_STATUS_INVALID, and AnboxVhalConnectorCallbacks::get_all_prop_configs_callback.

◆ get_prop_configs()

AnboxVhalAnswerStatus anbox::VhalConnector::get_prop_configs ( int32_t *  props,
size_t  props_size,
AnboxVhalAnswerGetConfigs result 
)
inline

Get requested property configs.

Parameters
propspointer to an array of size props_size. The array will not be modified by the callee.
props_sizeSize of the array pointed to by props.
resultstructure holding the returned configs. The 'configs' member will be allocated on the heap, as well as all arrays for each AnboxVhalPropertyConfig (area_configs, config_array, config_string, prop_name). The caller is responsible for freeing their memory after the call.
Returns
ANBOX_VHAL_ANSWER_STATUS_OK on success, error code otherwise.

Definition at line 132 of file vhal_connector.h.

References ANBOX_VHAL_ANSWER_STATUS_INVALID, and AnboxVhalConnectorCallbacks::get_prop_configs_callback.

◆ is_available()

bool anbox::VhalConnector::is_available ( )
inline

Check if the Android VHAL is supported and available.

Returns
true if available, false otherwise

Definition at line 95 of file vhal_connector.h.

References AnboxVhalConnectorCallbacks::is_available_callback.

◆ operator=()

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

◆ set()

AnboxVhalAnswerStatus anbox::VhalConnector::set ( AnboxVhalCommandSet request)
inline

Set the requested value.

Parameters
requeststructure holding the Set request. It will not be modified by the callee.
Returns
ANBOX_VHAL_ANSWER_STATUS_OK on success, error code otherwise.

Definition at line 165 of file vhal_connector.h.

References ANBOX_VHAL_ANSWER_STATUS_INVALID, and AnboxVhalConnectorCallbacks::set_callback.

◆ set_callbacks()

void anbox::VhalConnector::set_callbacks ( const AnboxVhalConnectorCallbacks callbacks,
void *  user_data 
)
inline

Set all VHAL-related callbacks.

Parameters
callbacksStructure holding all the callbacks.
user_dataPointer that will be passed to callbacks.

Definition at line 177 of file vhal_connector.h.


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