Android Hardware Abstraction Layer
Data Fields
sensors_poll_device_1 Struct Reference

#include <sensors.h>

Data Fields

union {
   struct sensors_poll_device_t   v0
   struct {
      struct hw_device_t   common
      int(*   activate )(struct sensors_poll_device_t
         *dev, int handle, int enabled)
      int(*   setDelay )(struct sensors_poll_device_t
         *dev, int handle, int64_t
      int(*   poll )(struct sensors_poll_device_t
         *dev, sensors_event_t *data,
         int count)
int(* batch )(struct sensors_poll_device_1 *dev, int handle, int flags, int64_t period_ns, int64_t timeout)
int(* flush )(struct sensors_poll_device_1 *dev, int handle)
void(* reserved_procs [8])(void)

Detailed Description

Definition at line 984 of file sensors.h.

Field Documentation

union { ... }
int(* activate)(struct sensors_poll_device_t *dev, int handle, int enabled)

Definition at line 1020 of file sensors.h.

int(* batch)(struct sensors_poll_device_1 *dev, int handle, int flags, int64_t period_ns, int64_t timeout)

Definition at line 1261 of file sensors.h.

struct hw_device_t common

Definition at line 992 of file sensors.h.

int(* flush)(struct sensors_poll_device_1 *dev, int handle)

Definition at line 1291 of file sensors.h.

int(* 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.

return the number of events read on success, or -errno in case of an error.

The number of events returned in data must be less or equal to the "count" argument.

This function shall never return 0 (no event).

Definition at line 1059 of file sensors.h.

void(* reserved_procs[8])(void)

Definition at line 1293 of file sensors.h.

int(* setDelay)(struct sensors_poll_device_t *dev, int handle, int64_t period_ns)

Set the events's period in nanoseconds for a given sensor.

What the period_ns parameter means depends on the specified sensor's trigger mode:

continuous: setDelay() sets the sampling rate. on-change: setDelay() limits the delivery rate of events one-shot: setDelay() is ignored. it has no effect. special: see specific sensor type definitions

For continuous and on-change sensors, 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.

setDelay will not be called when the sensor is in batching mode. In this case, batch() will be called with the new period.

0 if successful, < 0 on error

Definition at line 1044 of file sensors.h.

Definition at line 989 of file sensors.h.

The documentation for this struct was generated from the following file: