# Sensor feature control

**Detailed Description**

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

- *group* Telematics\_sensor\_feature\_control

    - - class ISensorFeatureEventListener : public telux::common::[ISDKListener](https://docs.qualcomm.com/doc/80-PF458-8/topic/class_a00046.html#_CPPv4N5telux6common12ISDKListenerE)

    - [ISensorFeatureEventListener](https://docs.qualcomm.com/doc/80-PF458-8/topic/sensor_feature_control.html#a00629) 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 Functions

- inline virtual void onEvent([SensorFeatureEvent](https://docs.qualcomm.com/doc/80-PF458-8/topic/sensor_service.html#_CPPv4N5telux6sensor18SensorFeatureEventE) event)

    - This function is called to notify about sensor feature events

On platforms with Access control enabled, the client needs to have TELUX\_SENSOR\_FEATURE\_CONTROL permission for this listener API to be invoked.

- Parameters:

    - **event** – **[in]** - The sensor feature event [telux::sensor::SensorFeatureEvent](https://docs.qualcomm.com/doc/80-PF458-8/topic/struct_a00625.html#a00625) that got triggered

- inline virtual void onBufferedEvent(std::string sensorName, std::shared\_ptr&lt;std::vector&lt;[SensorEvent](https://docs.qualcomm.com/doc/80-PF458-8/topic/sensor_service.html#_CPPv4N5telux6sensor11SensorEventE)&gt;&gt; events, bool isLast)

    - This function is called to notify about available sensor events that caused one or more sensor feature events [SensorFeatureEvent](https://docs.qualcomm.com/doc/80-PF458-8/topic/struct_a00625.html#a00625) 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.

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](https://docs.qualcomm.com/doc/80-PF458-8/topic/sensor_control.html#a00616_1ab357afb7ab27fb33b127f3f093bc7c5c) 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 invoke 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.

- Parameters:

    - - **sensorName** – **[in]** - The name of the sensor that generated the buffered events
- **events** – **[in]** - List of sensor events
- **isLast** – **[in]** - 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.
        Copy to clipboard

- inline virtual void onMotionDetectionEnabled(std::vector&lt;[MotionDetectionConfig](https://docs.qualcomm.com/doc/80-PF458-8/topic/sensor_service.html#_CPPv4N5telux6sensor21MotionDetectionConfigE)&gt; motionDetectionConfigs)

    - This API is called to notify the clients about the motion detection parameters that are currently configured and enabled.

This API will only be invoked if the client sets and enables the motion detection configurations for a sensor using [telux::sensor::ISensorFeatureManager::enableMotionDetection](https://docs.qualcomm.com/doc/80-PF458-8/topic/sensor_feature_control.html#a00630_1a96cab498d5cb29376f9b65ce31e6a1a4) API.

On platforms with Access control enabled, the client needs to have TELUX\_SENSOR\_MOTION\_DETECTION permission for this listener API to be invoked.

- Parameters:

    - **motionDetectionConfigs** – **[in]** - Represents the enabled motion detection configurations.

- inline virtual void onMotionDetectionDisabled()

    - This API will only be invoked when a client disables the motion detection configurations for a sensor using [telux::sensor::ISensorFeatureManager::disableMotionDetection](https://docs.qualcomm.com/doc/80-PF458-8/topic/sensor_feature_control.html#a00630_1ac852639f65a9c32fb07c70bee0dde57a) API.

On platforms with Access control enabled, the client needs to have TELUX\_SENSOR\_MOTION\_DETECTION permission for this listener API to be invoked.

- inline virtual void onMotionDetected(int sensorId, struct iio\_event\_data event)

    - This function is called to notify about event data whenever a motion is detected.

This API will only be invoked if the client sets and enables the motion detection configurations for a sensor using [telux::sensor::ISensorFeatureManager::enableMotionDetection](https://docs.qualcomm.com/doc/80-PF458-8/topic/sensor_feature_control.html#a00630_1a96cab498d5cb29376f9b65ce31e6a1a4) API.

On platforms with Access control enabled, the client needs to have TELUX\_SENSOR\_MOTION\_DETECTION permission for this listener API to be invoked.

struct iio\_event\_data { //Encoded event metadata. \_\_u64 id; //Boot Timestamp of the event occurence in nanoseconds. \_\_s64 timestamp; };

The encoded ID uniquely describes the type of event that occurred on an IIO device. It includes: Event Type (e.g., threshold, data-ready) Channel Type (e.g., accelerometer, temperature) Modifier (e.g., axis like X, Y, Z) Direction (e.g., rising or falling) Channel Number (if applicable)

- Parameters:

    - - **sensorId** – **[in]** - The id of the sensor for which the motion is detected.
- **event** – **[in]** - The sensor motion detection event defined as per the Linux Industrial I/O (IIO) subsystem. The iio\_event\_data represents the sensor generated event which is motion detection in this case and comprises of below information-

- inline virtual ~ISensorFeatureEventListener()

    - The destructor for the sensor feature event listener

- class 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 Functions

- virtual telux::common::[ServiceStatus](https://docs.qualcomm.com/doc/80-PF458-8/topic/enum_a00023_1ga7063b4a1071b6581022e30b730684e4d.html#_CPPv4N5telux6common13ServiceStatusE) getServiceStatus() = 0

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

- Returns:

    - the status of sensor sub-system status [telux::common::ServiceStatus](https://docs.qualcomm.com/doc/80-PF458-8/topic/enum_a00023_1ga7063b4a1071b6581022e30b730684e4d.html#a00023_1ga7063b4a1071b6581022e30b730684e4d)

- virtual telux::common::[Status](https://docs.qualcomm.com/doc/80-PF458-8/topic/enum_a00023_1ga45eeeff7c2860e02ae447d588d3d6e4d.html#_CPPv4N5telux6common6StatusE) getAvailableFeatures(std::vector&lt;[SensorFeature](https://docs.qualcomm.com/doc/80-PF458-8/topic/sensor_service.html#_CPPv4N5telux6sensor13SensorFeatureE)&gt; &features) = 0

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

- Parameters:

    - **features** – **[out]** List of sensor features the sensor framework offers

- Returns:

    - status of the request [telux::common::Status](https://docs.qualcomm.com/doc/80-PF458-8/topic/enum_a00023_1ga45eeeff7c2860e02ae447d588d3d6e4d.html#a00023_1ga45eeeff7c2860e02ae447d588d3d6e4d)

- virtual telux::common::[Status](https://docs.qualcomm.com/doc/80-PF458-8/topic/enum_a00023_1ga45eeeff7c2860e02ae447d588d3d6e4d.html#_CPPv4N5telux6common6StatusE) enableFeature(std::string name) = 0

    - 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](https://docs.qualcomm.com/doc/80-PF458-8/topic/sensor_control.html#a00618_1a27d8de591ab7adfe4fe25fb96f182698) 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.

- Parameters:

    - **name** – **[in]** The 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](https://docs.qualcomm.com/doc/80-PF458-8/topic/enum_a00023_1ga45eeeff7c2860e02ae447d588d3d6e4d.html#a00023_1ga45eeeff7c2860e02ae447d588d3d6e4d)

- virtual telux::common::[Status](https://docs.qualcomm.com/doc/80-PF458-8/topic/enum_a00023_1ga45eeeff7c2860e02ae447d588d3d6e4d.html#_CPPv4N5telux6common6StatusE) disableFeature(std::string name) = 0

    - Disable the requested feature

- Parameters:

    - **name** – **[in]** 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.

- Returns:

    - status of the request [telux::common::Status](https://docs.qualcomm.com/doc/80-PF458-8/topic/enum_a00023_1ga45eeeff7c2860e02ae447d588d3d6e4d.html#a00023_1ga45eeeff7c2860e02ae447d588d3d6e4d)

- virtual telux::common::[Status](https://docs.qualcomm.com/doc/80-PF458-8/topic/enum_a00023_1ga45eeeff7c2860e02ae447d588d3d6e4d.html#_CPPv4N5telux6common6StatusE) registerListener(std::weak\_ptr&lt;[ISensorFeatureEventListener](https://docs.qualcomm.com/doc/80-PF458-8/topic/class_a00629.html#_CPPv4N5telux6sensor27ISensorFeatureEventListenerE)&gt; listener) = 0

    - Register a listener for sensor feature related events

- Returns:

    - status of registration request - [telux::common::Status](https://docs.qualcomm.com/doc/80-PF458-8/topic/enum_a00023_1ga45eeeff7c2860e02ae447d588d3d6e4d.html#a00023_1ga45eeeff7c2860e02ae447d588d3d6e4d)

- virtual telux::common::[Status](https://docs.qualcomm.com/doc/80-PF458-8/topic/enum_a00023_1ga45eeeff7c2860e02ae447d588d3d6e4d.html#_CPPv4N5telux6common6StatusE) deregisterListener(std::weak\_ptr&lt;[ISensorFeatureEventListener](https://docs.qualcomm.com/doc/80-PF458-8/topic/class_a00629.html#_CPPv4N5telux6sensor27ISensorFeatureEventListenerE)&gt; listener) = 0

    - Deregister a sensor feature event listener

- Returns:

    - status of deregistration request - [telux::common::Status](https://docs.qualcomm.com/doc/80-PF458-8/topic/enum_a00023_1ga45eeeff7c2860e02ae447d588d3d6e4d.html#a00023_1ga45eeeff7c2860e02ae447d588d3d6e4d)

- virtual telux::common::[Status](https://docs.qualcomm.com/doc/80-PF458-8/topic/enum_a00023_1ga45eeeff7c2860e02ae447d588d3d6e4d.html#_CPPv4N5telux6common6StatusE) getAvailableSensorInfo(std::vector&lt;[SensorInfo](https://docs.qualcomm.com/doc/80-PF458-8/topic/sensor_service.html#_CPPv4N5telux6sensor10SensorInfoE)&gt; &info) = 0

    - Get information related to the sensors available in the system.

- Parameters:

    - **info** – **[out]** List of information on sensors available in the system [telux::sensor::SensorInfo](https://docs.qualcomm.com/doc/80-PF458-8/topic/struct_a00619.html#a00619)

- Returns:

    - status of the request [telux::common::Status](https://docs.qualcomm.com/doc/80-PF458-8/topic/enum_a00023_1ga45eeeff7c2860e02ae447d588d3d6e4d.html#a00023_1ga45eeeff7c2860e02ae447d588d3d6e4d)

- virtual telux::common::[Status](https://docs.qualcomm.com/doc/80-PF458-8/topic/enum_a00023_1ga45eeeff7c2860e02ae447d588d3d6e4d.html#_CPPv4N5telux6common6StatusE) getMotionDetectionConfigLimits(int sensorId, [MotionDetectionConfigLimits](https://docs.qualcomm.com/doc/80-PF458-8/topic/sensor_service.html#_CPPv4N5telux6sensor27MotionDetectionConfigLimitsE) &motionDetectionConfigLimits) = 0

    - Request a sensor’s upper and lower bound limit for each motion detection configuration parameter.

This API needs to be invoked before setting the motion detection configuration for the sensor using [telux::sensor::ISensorFeatureManager::enableMotionDetection](https://docs.qualcomm.com/doc/80-PF458-8/topic/sensor_feature_control.html#a00630_1a96cab498d5cb29376f9b65ce31e6a1a4) API.

- Parameters:

    - - **sensorId** – **[in]** - The id of the sensor for which the limits for the motion detection configuration is requested. To provide the sensor ID, refer to [telux::sensor::ISensorManager::getAvailableSensorInfo](https://docs.qualcomm.com/doc/80-PF458-8/topic/sensor_control.html#a00631_1af90c201e77bf40b4524b75a281b49f96) API.
- **motionDetectionConfigLimits** – **[out]** - Limits for the motion detection configurations.

- Returns:

    - - status of the request [telux::common::Status](https://docs.qualcomm.com/doc/80-PF458-8/topic/enum_a00023_1ga45eeeff7c2860e02ae447d588d3d6e4d.html#a00023_1ga45eeeff7c2860e02ae447d588d3d6e4d)

- virtual telux::common::[Status](https://docs.qualcomm.com/doc/80-PF458-8/topic/enum_a00023_1ga45eeeff7c2860e02ae447d588d3d6e4d.html#_CPPv4N5telux6common6StatusE) enableMotionDetection([MotionDetectionConfig](https://docs.qualcomm.com/doc/80-PF458-8/topic/sensor_service.html#_CPPv4N5telux6sensor21MotionDetectionConfigE) motionDetectionConfig) = 0

    - This API is used to enable motion detection, with a given configuration.

The attributes should be set within the limits provided using [telux::sensor::ISensorFeatureManager::getMotionDetectionConfigLimits](https://docs.qualcomm.com/doc/80-PF458-8/topic/sensor_feature_control.html#a00630_1a7b7a475eb76c380b06961be0fa1f3dae) API.

These configurations are a global setting. This API would fail if the configurations are set again without disabling an active configuration, returning telux::common::Status::ALREADY

On platforms with Access control enabled, Caller needs to have TELUX\_SENSOR\_MOTION\_DETECTION permission to invoke this API successfully.

- Parameters:

    - **motionDetectionConfig** – **[in]** - Motion detection attributes to be set.

- Returns:

    - - status of the request [telux::common::Status](https://docs.qualcomm.com/doc/80-PF458-8/topic/enum_a00023_1ga45eeeff7c2860e02ae447d588d3d6e4d.html#a00023_1ga45eeeff7c2860e02ae447d588d3d6e4d)

- virtual telux::common::[Status](https://docs.qualcomm.com/doc/80-PF458-8/topic/enum_a00023_1ga45eeeff7c2860e02ae447d588d3d6e4d.html#_CPPv4N5telux6common6StatusE) disableMotionDetection(int sensorId) = 0

    - This API is used to disable motion detection for the given sensor.

Only the client which has set the motion configuration parameters using [telux::sensor::ISensorFeatureManager::enableMotionDetection](https://docs.qualcomm.com/doc/80-PF458-8/topic/sensor_feature_control.html#a00630_1a96cab498d5cb29376f9b65ce31e6a1a4) API can disable an active configuration.

This API would fail if the client tries to disable when there is no active configuration, returning telux::common::Status::ALREADY

On platforms with Access control enabled, Caller needs to have TELUX\_SENSOR\_MOTION\_DETECTION permission to invoke this API successfully.

- Parameters:

    - **sensorId** – **[in]** - The id of the sensor used to set the motion detection configuration using [telux::sensor::ISensorFeatureManager::enableMotionDetection](https://docs.qualcomm.com/doc/80-PF458-8/topic/sensor_feature_control.html#a00630_1a96cab498d5cb29376f9b65ce31e6a1a4) API.

- Returns:

    - - status of the request [telux::common::Status](https://docs.qualcomm.com/doc/80-PF458-8/topic/enum_a00023_1ga45eeeff7c2860e02ae447d588d3d6e4d.html#a00023_1ga45eeeff7c2860e02ae447d588d3d6e4d)

- virtual telux::common::[Status](https://docs.qualcomm.com/doc/80-PF458-8/topic/enum_a00023_1ga45eeeff7c2860e02ae447d588d3d6e4d.html#_CPPv4N5telux6common6StatusE) getMotionDetectionConfigs(std::vector&lt;[MotionDetectionConfig](https://docs.qualcomm.com/doc/80-PF458-8/topic/sensor_service.html#_CPPv4N5telux6sensor21MotionDetectionConfigE)&gt; &motionDetectionConfigs) = 0

    - This API is used to get the motion detection configuration which is currently enabled using [telux::sensor::ISensorFeatureManager::enableMotionDetection](https://docs.qualcomm.com/doc/80-PF458-8/topic/sensor_feature_control.html#a00630_1a96cab498d5cb29376f9b65ce31e6a1a4) API.

This API would fail if no configuration is set, returning telux::common::Status::NOSUCH.

- Parameters:

    - **motionDetectionConfigs** – **[out]** - List of enabled Motion detection configurations.

- Returns:

    - - status of the request [telux::common::Status](https://docs.qualcomm.com/doc/80-PF458-8/topic/enum_a00023_1ga45eeeff7c2860e02ae447d588d3d6e4d.html#a00023_1ga45eeeff7c2860e02ae447d588d3d6e4d)

- inline virtual ~ISensorFeatureManager()

    - Destructor for [ISensorFeatureManager](https://docs.qualcomm.com/doc/80-PF458-8/topic/sensor_feature_control.html#a00630)

Last Published: May 20, 2026

[Previous Topic
telux::sensor::ISensorManager](https://docs.qualcomm.com/bundle/publicresource/80-PF458-8/topics/sensor_control.md) [Next Topic
Telephony](https://docs.qualcomm.com/bundle/publicresource/80-PF458-8/topics/telephony.md)