blip  0.1
SensorManager Class Reference

A class that provides access to the hardware sensors. More...

#include <SensorManager.hpp>

Public Member Functions

 ~SensorManager ()
 Destructor. More...
 
int getSensorCount () const
 Get the number of sensors in the system. More...
 
SensorgetSensor (int index)
 Get the sensor at the given index. More...
 
SensorgetDefaultSensor (Sensor::Type type)
 Get the default sensor for the given sensor type. More...
 
bool enableSensor (Sensor *sensor)
 Enable the given sensor, so that the application may begin receiving events from it. More...
 
bool disableSensor (Sensor *sensor)
 Disable the given sensor, so that the application will no longer receive events from it. More...
 
bool setSensorEventRate (Sensor *sensor, timespan_us_t rate)
 Set the rate, in microseconds, at which the given sensor will send events to the application. More...
 

Detailed Description

A class that provides access to the hardware sensors.

Author
Mark Lindner

Constructor & Destructor Documentation

◆ ~SensorManager()

Destructor.

Member Function Documentation

◆ disableSensor()

bool disableSensor ( Sensor sensor)

Disable the given sensor, so that the application will no longer receive events from it.

Parameters
sensorThe sensor to disable.
Returns
true if the sensor was successfully disabled, false otherwise.

◆ enableSensor()

bool enableSensor ( Sensor sensor)

Enable the given sensor, so that the application may begin receiving events from it.

Parameters
sensorThe sensor to enable.
Returns
true if the sensor was successfully enabled, false otherwise.

◆ getDefaultSensor()

Sensor * getDefaultSensor ( Sensor::Type  type)

Get the default sensor for the given sensor type.

Parameters
typeThe sensor type.
Returns
The default sensor, or NULL if there are no sensors of the given type.

◆ getSensor()

Sensor * getSensor ( int  index)

Get the sensor at the given index.

Parameters
indexThe index.
Returns
The sensor.
Exceptions
OutOfBoundsExceptionIf index is invalid.

◆ getSensorCount()

int getSensorCount ( ) const

Get the number of sensors in the system.

◆ setSensorEventRate()

bool setSensorEventRate ( Sensor sensor,
timespan_us_t  rate 
)

Set the rate, in microseconds, at which the given sensor will send events to the application.

Parameters
sensorThe sensor.
rateThe new rate, in microseconds. The rate must be greater than or equal to the value returned by Sensor::getMinimumDelay() for the given sensor.
Returns
true if the sensor event rate was successfully changed, false otherwise.

The documentation for this class was generated from the following files: