Telematics SDK - Interface Specification  v1.46.54
Sensor feature control

Data Structures

class  telux::sensor::ISensorFeatureEventListener
 ISensorFeatureEventListener interface is used to receive notifications related to sensor feature events. More...
 
class  telux::sensor::ISensorFeatureManager
 Sensor Feature Manager class provides APIs to interact with the sensor framework to list the available features, enable them or disable them. The availability of sensor features depends on the capabilities of the underlying hardware. More...
 

Detailed Description

This section contains APIs related to contrlling the features the sensor sub-system offers.


Data Structure Documentation

class telux::sensor::ISensorFeatureEventListener

ISensorFeatureEventListener interface is used to receive notifications related to sensor feature events.

The listener method can be invoked from multiple different threads. Client needs to make sure that implementation is thread-safe.

Public Member Functions

virtual void onEvent (SensorFeatureEvent event)
 
virtual void onBufferedEvent (std::string sensorName, std::shared_ptr< std::vector< SensorEvent >> events, bool isLast)
 
virtual ~ISensorFeatureEventListener ()
 

Constructor & Destructor Documentation

virtual telux::sensor::ISensorFeatureEventListener::~ISensorFeatureEventListener ( )
virtual

The destructor for the sensor feature event listener

Member Function Documentation

virtual void telux::sensor::ISensorFeatureEventListener::onEvent ( SensorFeatureEvent  event)
virtual

This function is called to notify about sensor feature events

Parameters
[in]event- The sensor feature event telux::sensor::SensorFeatureEvent that got triggered
Note
Eval: This is a new API and is being evaluated. It is subject to change and could break backwards compatibility.
virtual void telux::sensor::ISensorFeatureEventListener::onBufferedEvent ( std::string  sensorName,
std::shared_ptr< std::vector< SensorEvent >>  events,
bool  isLast 
)
virtual

This function is called to notify about available sensor events that caused one or more sensor feature events SensorFeatureEvent to occur.

The sensor events that occurred when the apps processor was in sleep mode and triggered the sensor feature to occur will be buffered and delivered using this method instead of telux::sensor::ISensorEventListener::onEvent.

In case a sensor event occurs when the system is active, this listener is not invoked. In this case, the required sensor data that triggered the feature can be obtained from the telux::sensor::ISensorEventListener::onEvent listener interface.

Note the following constraints on this listener API It shall not perform time consuming (compute or I/O intensive) operations on this thread It shall not inovke an sensor APIs on this thread due to the underlying concurrency model

Parameters
[in]sensorName- The name of the sensor that generated the buffered events
[in]events- List of sensor events
[in]isLast- Indicate if this is last notification for the buffered events.
                 Multiple @ref telux::sensor::SensorFeature can be enabled using
                 @ref telux::sensor::enableFeature, whose notification will be delivered
                 in sequence.
                 isLast will be set to true to signify last event of a SensorFeature.
Note
Eval: This is a new API and is being evaluated. It is subject to change and could break backwards compatibility.
class telux::sensor::ISensorFeatureManager

Sensor Feature Manager class provides APIs to interact with the sensor framework to list the available features, enable them or disable them. The availability of sensor features depends on the capabilities of the underlying hardware.

Public Member Functions

virtual telux::common::ServiceStatus getServiceStatus ()=0
 
virtual telux::common::Status getAvailableFeatures (std::vector< SensorFeature > &features)=0
 
virtual telux::common::Status enableFeature (std::string name)=0
 
virtual telux::common::Status disableFeature (std::string name)=0
 
virtual telux::common::Status registerListener (std::weak_ptr< ISensorFeatureEventListener > listener)=0
 
virtual telux::common::Status deregisterListener (std::weak_ptr< ISensorFeatureEventListener > listener)=0
 
virtual ~ISensorFeatureManager ()
 

Constructor & Destructor Documentation

virtual telux::sensor::ISensorFeatureManager::~ISensorFeatureManager ( )
virtual

Destructor for ISensorFeatureManager

Member Function Documentation

virtual telux::common::ServiceStatus telux::sensor::ISensorFeatureManager::getServiceStatus ( )
pure virtual

Checks the status of sensor sub-system and returns the result.

Returns
the status of sensor sub-system status telux::common::ServiceStatus
Note
Eval: This is a new API and is being evaluated. It is subject to change and could break backwards compatibility.
virtual telux::common::Status telux::sensor::ISensorFeatureManager::getAvailableFeatures ( std::vector< SensorFeature > &  features)
pure virtual

Request the sensor framework to provide the available features. The feature could be offered by the sensor framework or the underlying hardware.

Parameters
[out]featuresList of sensor features the sensor framework offers
Returns
status of the request telux::common::Status
Note
Eval: This is a new API and is being evaluated. It is subject to change and could break backwards compatibility.
virtual telux::common::Status telux::sensor::ISensorFeatureManager::enableFeature ( std::string  name)
pure virtual

Enable the requested feature.

Enabling a sensor feature when the system is active would additionally require enabling the corresponding sensor which is used by the sensor feature. For instance, if the sensor feature uses the accelerometer data, in addition to calling this method, the telux::sensor::ISensor::activate should also be invoked for the required sensor, in this case, the accelerometer.

If the sensor feature only needs to be enabled during suspend mode, just enabling the sensor feature using this method would be sufficient. The underlying framework would take care to enable the required sensor when the system is about to enter suspend state.

Parameters
[in]nameThe name of the feature to be enabled. Enabling an already enabled feature would result in the API returning telux::common::Status::SUCCESS.
Returns
status of the request telux::common::Status
Note
Eval: This is a new API and is being evaluated. It is subject to change and could break backwards compatibility.
virtual telux::common::Status telux::sensor::ISensorFeatureManager::disableFeature ( std::string  name)
pure virtual

Disable the requested feature

Parameters
[in]nameThe name of the feature to be disabled. Disabling an already disabled feature would result in the API returning telux::common::Status::SUCCESS.
Returns
status of the request telux::common::Status
Note
Eval: This is a new API and is being evaluated. It is subject to change and could break backwards compatibility.
virtual telux::common::Status telux::sensor::ISensorFeatureManager::registerListener ( std::weak_ptr< ISensorFeatureEventListener listener)
pure virtual

Register a listener for sensor feature related events

Returns
status of registration request - telux::common::Status
Note
Eval: This is a new API and is being evaluated. It is subject to change and could break backwards compatibility.
virtual telux::common::Status telux::sensor::ISensorFeatureManager::deregisterListener ( std::weak_ptr< ISensorFeatureEventListener listener)
pure virtual

Deregister a sensor feature event listener

Returns
status of deregistration request - telux::common::Status
Note
Eval: This is a new API and is being evaluated. It is subject to change and could break backwards compatibility.