Telematics SDK - Interface Specification
v1.46.54
|
Data Structures | |
class | telux::sensor::ISensorEventListener |
ISensorEventListener interface is used to receive notifications related to sensor events and configuration updates. More... | |
class | telux::sensor::ISensor |
ISensor interface is used to access the different services provided by the sensor to configure, activate and get sensor data. More... | |
class | telux::sensor::ISensorManager |
Sensor Manager class provides APIs to interact with the sensor sub-system and get access to other sensor objects which can be used to configure, activate or get data from the individual sensors available - Gyro, Accelero, etc. More... | |
Typedefs | |
using | telux::sensor::SelfTestResultCallback = std::function< void(telux::common::ErrorCode result)> |
This file hosts the sensor interfaces to configure, activate or get data from the individual sensors available - Gyroscope, Accelerometer, etc. More... | |
This section contains APIs related to sensor configuration, sensor control and data acquisition from sensors.
class telux::sensor::ISensorEventListener |
ISensorEventListener interface is used to receive notifications related to sensor events and configuration updates.
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 (std::shared_ptr< std::vector< SensorEvent >> events) |
virtual void | onConfigurationUpdate (SensorConfiguration configuration) |
virtual | ~ISensorEventListener () |
|
virtual |
The destructor for the sensor event listener
|
virtual |
This function is called to notify about available sensor events. 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
[in] | events | - List of sensor events |
|
virtual |
This function is called to notify any change in sensor configuration.
[in] | configuration | - The new configuration for the sensor telux::sensor::SensorConfiguration. Fields that have changed can be identified using the telux::sensor::SensorConfiguration::updateMask and fields that are valid can be identified using telux::sensor::SensorConfiguration::validityMask |
class telux::sensor::ISensor |
ISensor interface is used to access the different services provided by the sensor to configure, activate and get sensor data.
Public Member Functions | |
virtual SensorInfo | getSensorInfo ()=0 |
virtual telux::common::Status | configure (SensorConfiguration configuration)=0 |
virtual SensorConfiguration | getConfiguration ()=0 |
virtual telux::common::Status | activate ()=0 |
virtual telux::common::Status | deactivate ()=0 |
virtual telux::common::Status | enableLowPowerMode ()=0 |
virtual telux::common::Status | disableLowPowerMode ()=0 |
virtual telux::common::Status | selfTest (SelfTestType selfTestType, SelfTestResultCallback cb)=0 |
virtual telux::common::Status | registerListener (std::weak_ptr< ISensorEventListener > listener)=0 |
virtual telux::common::Status | deregisterListener (std::weak_ptr< ISensorEventListener > listener)=0 |
virtual | ~ISensor () |
|
virtual |
Destructor for ISensor
|
pure virtual |
Get the information related to sensor
|
pure virtual |
Configure sensor with desired sampling rate and batch count. Any change in sampling rate or batch count of the sensor will be notified via telux::sensor::ISensorEventListener::onConfigurationUpdate.
In case a sensor needs to be reconfigured after having been activated, the sensor should be deactivated, configured and activated again as a part of the reconfiguration process.
It is always recommended that configuration of a sensor is done before activating it. If a sensor is activated without configuration, the sensor is configured with a default configuration and activated. The default configuration would have the sampling rate set to minimum sampling rate supported telux::sensor::SensorInfo::samplingRates and the batch count set to maximum batch count supported telux::sensor::SensorInfo::maxBatchCountSupported
[in] | configuration | - The desired configuration for the sensor telux::sensor::SensorConfiguration. Ensure the required validity mask telux::sensor::SensorConfiguration::validityMask is set for the configuration. |
|
pure virtual |
Get the current configuration of this sensor
|
pure virtual |
Activate the sensor. Once activated, any available sensor event will be notified via telux::sensor::ISensorEventListener::onEvent
It is always recommended that configuration of a sensor is done before activating it. If a sensor is activated without configuration, the sensor is configured with a default configuration and activated. The default configuration would have the sampling rate set to minimum sampling rate supported telux::sensor::SensorInfo::samplingRates and the batch count set to maximum batch count supported telux::sensor::SensorInfo::maxBatchCountSupported. Activating an already activated sensor would result in the API returning telux::common::Status::SUCCESS.
|
pure virtual |
Deactivate the sensor. Once deactivated, no further sensor events will be notified via telux::sensor::ISensorEventListener::onEvent. Deactivating an already inactive sensor would result in the API returning telux::common::Status::SUCCESS.
|
pure virtual |
Request the sensor to operate in low power mode. The sensor should be in deactivated state to exercise this API. The success of this request depends on the capabilities of the underlying hardware.
|
pure virtual |
Request the sensor to exit low power mode. The sensor should be in deactivated state to exercise this API. The success of this request depends on the capabilities of the underlying hardware.
|
pure virtual |
Initiate self test on this sensor
If there are active data acquisition sessions corresponding to this sensor, these will be paused and the self test is initiated. Once the self test is complete the sensor data sessions will be restored.
[in] | selfTestType | - The type of self test to be performed - telux::sensor::SelfTestType |
[in] | SelfTestResultCallback | - Callback to get the result of the self test initiated |
|
pure virtual |
Register a listener for sensor related events
|
pure virtual |
Deregister a sensor event listener
class telux::sensor::ISensorManager |
Sensor Manager class provides APIs to interact with the sensor sub-system and get access to other sensor objects which can be used to configure, activate or get data from the individual sensors available - Gyro, Accelero, etc.
Public Member Functions | |
virtual telux::common::ServiceStatus | getServiceStatus ()=0 |
virtual telux::common::Status | getAvailableSensorInfo (std::vector< SensorInfo > &info)=0 |
virtual telux::common::Status | getSensor (std::shared_ptr< ISensor > &sensor, std::string name)=0 |
virtual | ~ISensorManager () |
|
virtual |
Destructor for ISensorManager
|
pure virtual |
Checks the status of sensor sub-system and returns the result.
|
pure virtual |
Get information related to the sensors available in the system.
[out] | info | List of information on sensors available in the system telux::sensor::SensorInfo |
|
pure virtual |
Get an instance of ISensor to interact with the underlying sensor. The provided instance is not a singleton. Everytime this method is called a new sensor object is created. It is the caller's responsibility to maintain the object Every instance of the sensor returned acts as new client and can configure the underlying sensor with it's own configuration and it's own callbacks for telux::sensor::ISensorEvent and configuration update among other events telux::sensor::ISenorEventListener.
[out] | sensor | - An instance of telux::sensor::ISensor to interact with the underlying sensor is provided as a result of the method If the initialization of the sensor and underlying system fails, sensor is set to nullptr |
[in] | name | - The unique name of the sensor telux::sensor::SensorInfo::name that was provided in the list of sensor information by telux::sensor::getAvailableSensorInfo |
using telux::sensor::SelfTestResultCallback = typedef std::function<void(telux::common::ErrorCode result)> |
This file hosts the sensor interfaces to configure, activate or get data from the individual sensors available - Gyroscope, Accelerometer, etc.
This function is invoked when a result for a self-test initiated using telux::sensor::ISensor::selfTest is available .
[in] | result | The result of the self test - telux::common::ErrorCode |