Telematics SDK - API Reference
v1.51.0
|
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... | |
This section contains APIs related to contrlling the features the sensor sub-system offers.
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 () |
|
virtual |
The destructor for the sensor feature event listener
|
virtual |
This function is called to notify about sensor feature events
[in] | event | - The sensor feature event telux::sensor::SensorFeatureEvent that got triggered |
On platforms with Access control enabled, the client needs to have TELUX_SENSOR_FEATURE_CONTROL permission for this listener API to be invoked.
|
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
On platforms with Access control enabled, the client needs to have TELUX_SENSOR_FEATURE_CONTROL permission for this listener API to be invoked.
[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. |
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 () |
|
virtual |
Destructor for ISensorFeatureManager
|
pure virtual |
Checks the status of sensor sub-system and returns the result.
|
pure virtual |
Request the sensor framework to provide the available features. The feature could be offered by the sensor framework or the underlying hardware.
[out] | features | List of sensor features the sensor framework offers |
|
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::ISensorClient::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.
On platforms with Access control enabled, Caller needs to have TELUX_SENSOR_FEATURE_CONTROL permission to invoke this API successfully.
[in] | name | The name of the feature to be enabled. Enabling an already enabled feature would result in the API returning telux::common::Status::SUCCESS. |
|
pure virtual |
Disable the requested feature
[in] | name | The name of the feature to be disabled. Disabling an already disabled feature would result in the API returning telux::common::Status::SUCCESS. On platforms with Access control enabled, Caller needs to have TELUX_SENSOR_FEATURE_CONTROL permission to invoke this API successfully. |
|
pure virtual |
Register a listener for sensor feature related events
|
pure virtual |
Deregister a sensor feature event listener