Vehicle Properties  1.0.0-beta4
Vehicle Properties API
VehiclePropertyDataSource Class Reference

The VehiclePropertyDataSource extends the Kanzi DataSource to expose the Android CarPropertyManager properties. More...

Inherits DataSource.

Public Member Functions

void close ()
 Close the object, and release resources.
 
DataObject getData ()
 Retrieves the root object of the underlying data tree. More...
 

Static Public Member Functions

static< T extends VehiclePropertyDataSource > ObjectRef< T > create (Domain domain, String name)
 Creates a VehiclePropertyDataSource. More...
 

Static Public Attributes

static final Metaclass metaclass = new Metaclass("Kanzi.VehiclePropertyDataSource")
 The Metaclass for the class.
 

Protected Member Functions

 VehiclePropertyDataSource (Domain domain, long handle, Metaclass metaclass)
 Constructs the VehiclePropertyDataSource. More...
 
void addConfiguration (String name, int propertyId, int areaId, VehiclePropertyDataType type)
 Adds a configuration item. More...
 
void initialize ()
 Initialize the VehiclePropertyDataSource. More...
 
void loadConfiguration ()
 Loads the configuration used to define what properties are associated with the data source. More...
 

Detailed Description

The VehiclePropertyDataSource extends the Kanzi DataSource to expose the Android CarPropertyManager properties.

In a Kanzi application you can bind to the data source, update and access properties, and get information about the changes that happen over time.

You can configure the functionality by extending the class and overriding the loadConfiguration() method.

Constructor & Destructor Documentation

◆ VehiclePropertyDataSource()

VehiclePropertyDataSource ( Domain  domain,
long  handle,
Metaclass  metaclass 
)
protected

Constructs the VehiclePropertyDataSource.

Parameters
domainUI Domain to contain this object.
handleThe native handle for the VehiclePropertyDataSource.
metaclassThe metaclass for this object.

Member Function Documentation

◆ addConfiguration()

void addConfiguration ( String  name,
int  propertyId,
int  areaId,
VehiclePropertyDataType  type 
)
protected

Adds a configuration item.

You must call this method during the data source initialization inside the loadConfiguration() method.

Parameters
nameThe name of the property. This is the period delimited path to the DataObject within the DataSource.
propertyIdThe property id used by the Android CarPropertyManager.
areaIdThe area id used by the Android CarPropertyManager.
typeThe data type for the property.

◆ create()

static <T extends VehiclePropertyDataSource> ObjectRef<T> create ( Domain  domain,
String  name 
)
static

Creates a VehiclePropertyDataSource.

Parameters
domainUI Domain to contain this object.
nameThe name of the VehiclePropertyDataSource

◆ getData()

DataObject getData ( )

Retrieves the root object of the underlying data tree.

Returns
Data object that is the root of the data tree.

◆ initialize()

void initialize ( )
protected

Initialize the VehiclePropertyDataSource.

Configures and constructs the DataObject tree.

◆ loadConfiguration()

void loadConfiguration ( )
protected

Loads the configuration used to define what properties are associated with the data source.

By default, only a selection of HVAC controls are configured, override this method to customize the data source via the addConfiguration(String, int, int, VehiclePropertyDataType) method.