Ubuntu Platform API  3.0.0
A library helping with tight integration into the Ubuntu platform
pressure.h File Reference
+ Include dependency graph for pressure.h:

Go to the source code of this file.

Typedefs

typedef void UASensorsPressure
 Opaque type that models the pressure sensor. More...
 
typedef void(* on_pressure_event_cb) (UASPressureEvent *event, void *context)
 Callback type used by applications to subscribe to pressure sensor events. More...
 

Functions

UBUNTU_DLL_PUBLIC UASensorsPressureua_sensors_pressure_new ()
 Create a new object for accessing the ambient light sensor. More...
 
UBUNTU_DLL_PUBLIC UStatus ua_sensors_pressure_enable (UASensorsPressure *sensor)
 Enables the supplied ambient light sensor. More...
 
UBUNTU_DLL_PUBLIC UStatus ua_sensors_pressure_disable (UASensorsPressure *sensor)
 Disables the supplied ambient light sensor. More...
 
UBUNTU_DLL_PUBLIC uint32_t ua_sensors_pressure_get_min_delay (UASensorsPressure *sensor)
 Queries the minimum delay between two readings for the supplied sensor. More...
 
UBUNTU_DLL_PUBLIC UStatus ua_sensors_pressure_get_min_value (UASensorsPressure *sensor, float *value)
 Queries the minimum value that can be reported by the sensor. More...
 
UBUNTU_DLL_PUBLIC UStatus ua_sensors_pressure_get_max_value (UASensorsPressure *sensor, float *value)
 Queries the maximum value that can be reported by the sensor. More...
 
UBUNTU_DLL_PUBLIC UStatus ua_sensors_pressure_get_resolution (UASensorsPressure *sensor, float *value)
 Queries the numeric resolution supported by the sensor. More...
 
UBUNTU_DLL_PUBLIC void ua_sensors_pressure_set_reading_cb (UASensorsPressure *sensor, on_pressure_event_cb cb, void *ctx)
 Set the callback to be invoked whenever a new sensor reading is available. More...
 
UBUNTU_DLL_PUBLIC UStatus ua_sensors_pressure_set_event_rate (UASensorsPressure *sensor, uint32_t rate)
 Set the sensor event delivery rate in nanoseconds.. More...
 

Typedef Documentation

typedef void(* on_pressure_event_cb) (UASPressureEvent *event, void *context)

Callback type used by applications to subscribe to pressure sensor events.

Definition at line 41 of file pressure.h.

typedef void UASensorsPressure

Opaque type that models the pressure sensor.

Definition at line 35 of file pressure.h.

Function Documentation

UBUNTU_DLL_PUBLIC UStatus ua_sensors_pressure_disable ( UASensorsPressure sensor)

Disables the supplied ambient light sensor.

Returns
U_STATUS_SUCCESS if successful or U_STATUS_ERROR if an error occured.
Parameters
[in]sensorThe sensor instance to be disabled.
UBUNTU_DLL_PUBLIC UStatus ua_sensors_pressure_enable ( UASensorsPressure sensor)

Enables the supplied ambient light sensor.

Returns
U_STATUS_SUCCESS if successful or U_STATUS_ERROR if an error occured.
Parameters
[in]sensorThe sensor instance to be enabled.
UBUNTU_DLL_PUBLIC UStatus ua_sensors_pressure_get_max_value ( UASensorsPressure sensor,
float *  value 
)

Queries the maximum value that can be reported by the sensor.

Returns
The maximum value that can be reported by the sensor.
Parameters
[in]sensorThe sensor instance to be queried.
UBUNTU_DLL_PUBLIC uint32_t ua_sensors_pressure_get_min_delay ( UASensorsPressure sensor)

Queries the minimum delay between two readings for the supplied sensor.

Returns
The minimum delay between two readings in [ms].
Parameters
[in]sensorThe sensor instance to be queried.
UBUNTU_DLL_PUBLIC UStatus ua_sensors_pressure_get_min_value ( UASensorsPressure sensor,
float *  value 
)

Queries the minimum value that can be reported by the sensor.

Returns
The minimum value that can be reported by the sensor.
Parameters
[in]sensorThe sensor instance to be queried.
UBUNTU_DLL_PUBLIC UStatus ua_sensors_pressure_get_resolution ( UASensorsPressure sensor,
float *  value 
)

Queries the numeric resolution supported by the sensor.

Returns
The numeric resolution supported by the sensor.
Parameters
[in]sensorThe sensor instance to be queried.
UBUNTU_DLL_PUBLIC UASensorsPressure* ua_sensors_pressure_new ( )

Create a new object for accessing the ambient light sensor.

Returns
A new instance or NULL in case of errors.
UBUNTU_DLL_PUBLIC UStatus ua_sensors_pressure_set_event_rate ( UASensorsPressure sensor,
uint32_t  rate 
)

Set the sensor event delivery rate in nanoseconds..

Returns
U_STATUS_SUCCESS if successful or U_STATUS_ERROR if an error occured.
Parameters
[in]sensorThe sensor instance to be modified.
[in]rateThe new event delivery rate.
UBUNTU_DLL_PUBLIC void ua_sensors_pressure_set_reading_cb ( UASensorsPressure sensor,
on_pressure_event_cb  cb,
void *  ctx 
)

Set the callback to be invoked whenever a new sensor reading is available.

Parameters
[in]sensorThe sensor instance to associate the callback with.
[in]cbThe callback to be invoked.
[in]ctxThe context supplied to the callback invocation.