Data Fields
sensors_poll_device_t Struct Reference

Every device data structure must begin with hw_device_t followed by module specific public methods and attributes. More...

Data Fields

int(* activate )(struct sensors_poll_device_t *dev, int handle, int enabled)
 Activate/deactivate one sensor. More...
 
struct hw_device_t common
 
int(* poll )(struct sensors_poll_device_t *dev, sensors_event_t *data, int count)
 Returns an array of sensor data. More...
 
int(* setDelay )(struct sensors_poll_device_t *dev, int handle, int64_t ns)
 Set the delay between sensor events in nanoseconds for a given sensor. More...
 

Detailed Description

Every device data structure must begin with hw_device_t followed by module specific public methods and attributes.

Definition at line 434 of file sensors.h.

Field Documentation

int(* sensors_poll_device_t::activate)(struct sensors_poll_device_t *dev, int handle, int enabled)

Activate/deactivate one sensor.

Parameters
handleis the handle of the sensor to change.
enabledset to 1 to enable, or 0 to disable the sensor.
Returns
0 on success, negative errno code otherwise

Definition at line 444 of file sensors.h.

struct hw_device_t sensors_poll_device_t::common

Definition at line 435 of file sensors.h.

int(* sensors_poll_device_t::poll)(struct sensors_poll_device_t *dev, sensors_event_t *data, int count)

Returns an array of sensor data.

This function must block until events are available.

Returns
the number of events read on success, or -errno in case of an error. This function should never return 0 (no event).

Definition at line 467 of file sensors.h.

int(* sensors_poll_device_t::setDelay)(struct sensors_poll_device_t *dev, int handle, int64_t ns)

Set the delay between sensor events in nanoseconds for a given sensor.

If the requested value is less than sensor_t::minDelay, then it's silently clamped to sensor_t::minDelay unless sensor_t::minDelay is 0, in which case it is clamped to >= 1ms.

Returns
0 if successful, < 0 on error

Definition at line 456 of file sensors.h.