sensors_control_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_control_device_t *dev, int handle, int enabled)
 Activate/deactivate one sensor.
struct hw_device_t common
native_handle_t *(* open_data_source )(struct sensors_control_device_t *dev)
 Returns a native_handle_t, which will be the parameter to sensors_data_device_t::open_data().
int(* set_delay )(struct sensors_control_device_t *dev, int32_t ms)
 Set the delay between sensor events in ms.
int(* wake )(struct sensors_control_device_t *dev)
 Causes sensors_data_device_t.poll() to return -EWOULDBLOCK immediately.

Detailed Description

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

Definition at line 278 of file sensors.h.


Field Documentation

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

Activate/deactivate one sensor.

Parameters:
handle is the handle of the sensor to change.
enabled set to 1 to enable, or 0 to disable the sensor.
Returns:
0 on success, negative errno code otherwise

struct hw_device_t sensors_control_device_t::common [read]

Definition at line 279 of file sensors.h.

Returns a native_handle_t, which will be the parameter to sensors_data_device_t::open_data().

The caller takes ownership of this handle. This is intended to be passed cross processes.

Returns:
a native_handle_t if successful, NULL on error

Set the delay between sensor events in ms.

Returns:
0 if successful, < 0 on error

Causes sensors_data_device_t.poll() to return -EWOULDBLOCK immediately.