sensors.h File Reference
#include <stdint.h>
#include <sys/cdefs.h>
#include <sys/types.h>
#include <hardware/hardware.h>
#include <cutils/native_handle.h>

Go to the source code of this file.

Data Structures

struct  sensors_vec_t
 
struct  uncalibrated_event_t
 
struct  meta_data_event
 
struct  dynamic_sensor_meta_event
 
struct  heart_rate_event_t
 
struct  additional_info_event_t
 
struct  sensors_event_t
 
struct  sensors_module_t
 
struct  sensor_t
 
struct  sensors_poll_device_t
 
struct  sensors_poll_device_1
 

Macros

#define SENSORS_HEADER_VERSION   1
 
#define SENSORS_MODULE_API_VERSION_0_1   HARDWARE_MODULE_API_VERSION(0, 1)
 
#define SENSORS_DEVICE_API_VERSION_0_1   HARDWARE_DEVICE_API_VERSION_2(0, 1, SENSORS_HEADER_VERSION)
 
#define SENSORS_DEVICE_API_VERSION_1_0   HARDWARE_DEVICE_API_VERSION_2(1, 0, SENSORS_HEADER_VERSION)
 
#define SENSORS_DEVICE_API_VERSION_1_1   HARDWARE_DEVICE_API_VERSION_2(1, 1, SENSORS_HEADER_VERSION)
 
#define SENSORS_DEVICE_API_VERSION_1_2   HARDWARE_DEVICE_API_VERSION_2(1, 2, SENSORS_HEADER_VERSION)
 
#define SENSORS_DEVICE_API_VERSION_1_3   HARDWARE_DEVICE_API_VERSION_2(1, 3, SENSORS_HEADER_VERSION)
 
#define SENSORS_DEVICE_API_VERSION_1_4   HARDWARE_DEVICE_API_VERSION_2(1, 4, SENSORS_HEADER_VERSION)
 
#define SENSORS_HARDWARE_MODULE_ID   "sensors"
 
#define SENSORS_HARDWARE_POLL   "poll"
 
#define SENSORS_HANDLE_BASE   0
 
#define SENSORS_HANDLE_BITS   8
 
#define SENSORS_HANDLE_COUNT   (1<<SENSORS_HANDLE_BITS)
 
#define SENSOR_PERMISSION_BODY_SENSORS   "android.permission.BODY_SENSORS"
 
#define SENSOR_FLAG_MASK(nbit, shift)   (((1<<(nbit))-1)<<(shift))
 
#define SENSOR_FLAG_MASK_1(shift)   SENSOR_FLAG_MASK(1, shift)
 
#define REPORTING_MODE_SHIFT   (1)
 
#define REPORTING_MODE_NBIT   (3)
 
#define REPORTING_MODE_MASK   SENSOR_FLAG_MASK(REPORTING_MODE_NBIT, REPORTING_MODE_SHIFT)
 
#define DATA_INJECTION_SHIFT   (4)
 
#define DATA_INJECTION_MASK   SENSOR_FLAG_MASK_1(DATA_INJECTION_SHIFT)
 
#define DYNAMIC_SENSOR_SHIFT   (5)
 
#define DYNAMIC_SENSOR_MASK   SENSOR_FLAG_MASK_1(DYNAMIC_SENSOR_SHIFT)
 
#define ADDITIONAL_INFO_SHIFT   (6)
 
#define ADDITIONAL_INFO_MASK   SENSOR_FLAG_MASK_1(ADDITIONAL_INFO_SHIFT)
 
#define SENSOR_TYPE_DEVICE_PRIVATE_BASE   0x10000
 
#define SENSOR_TYPE_META_DATA   (0)
 
#define SENSOR_TYPE_ACCELEROMETER   (1)
 
#define SENSOR_STRING_TYPE_ACCELEROMETER   "android.sensor.accelerometer"
 
#define SENSOR_TYPE_GEOMAGNETIC_FIELD   (2)
 
#define SENSOR_TYPE_MAGNETIC_FIELD   SENSOR_TYPE_GEOMAGNETIC_FIELD
 
#define SENSOR_STRING_TYPE_MAGNETIC_FIELD   "android.sensor.magnetic_field"
 
#define SENSOR_TYPE_ORIENTATION   (3)
 
#define SENSOR_STRING_TYPE_ORIENTATION   "android.sensor.orientation"
 
#define SENSOR_TYPE_GYROSCOPE   (4)
 
#define SENSOR_STRING_TYPE_GYROSCOPE   "android.sensor.gyroscope"
 
#define SENSOR_TYPE_LIGHT   (5)
 
#define SENSOR_STRING_TYPE_LIGHT   "android.sensor.light"
 
#define SENSOR_TYPE_PRESSURE   (6)
 
#define SENSOR_STRING_TYPE_PRESSURE   "android.sensor.pressure"
 
#define SENSOR_TYPE_TEMPERATURE   (7)
 
#define SENSOR_STRING_TYPE_TEMPERATURE   "android.sensor.temperature"
 
#define SENSOR_TYPE_PROXIMITY   (8)
 
#define SENSOR_STRING_TYPE_PROXIMITY   "android.sensor.proximity"
 
#define SENSOR_TYPE_GRAVITY   (9)
 
#define SENSOR_STRING_TYPE_GRAVITY   "android.sensor.gravity"
 
#define SENSOR_TYPE_LINEAR_ACCELERATION   (10)
 
#define SENSOR_STRING_TYPE_LINEAR_ACCELERATION   "android.sensor.linear_acceleration"
 
#define SENSOR_TYPE_ROTATION_VECTOR   (11)
 
#define SENSOR_STRING_TYPE_ROTATION_VECTOR   "android.sensor.rotation_vector"
 
#define SENSOR_TYPE_RELATIVE_HUMIDITY   (12)
 
#define SENSOR_STRING_TYPE_RELATIVE_HUMIDITY   "android.sensor.relative_humidity"
 
#define SENSOR_TYPE_AMBIENT_TEMPERATURE   (13)
 
#define SENSOR_STRING_TYPE_AMBIENT_TEMPERATURE   "android.sensor.ambient_temperature"
 
#define SENSOR_TYPE_MAGNETIC_FIELD_UNCALIBRATED   (14)
 
#define SENSOR_STRING_TYPE_MAGNETIC_FIELD_UNCALIBRATED   "android.sensor.magnetic_field_uncalibrated"
 
#define SENSOR_TYPE_GAME_ROTATION_VECTOR   (15)
 
#define SENSOR_STRING_TYPE_GAME_ROTATION_VECTOR   "android.sensor.game_rotation_vector"
 
#define SENSOR_TYPE_GYROSCOPE_UNCALIBRATED   (16)
 
#define SENSOR_STRING_TYPE_GYROSCOPE_UNCALIBRATED   "android.sensor.gyroscope_uncalibrated"
 
#define SENSOR_TYPE_SIGNIFICANT_MOTION   (17)
 
#define SENSOR_STRING_TYPE_SIGNIFICANT_MOTION   "android.sensor.significant_motion"
 
#define SENSOR_TYPE_STEP_DETECTOR   (18)
 
#define SENSOR_STRING_TYPE_STEP_DETECTOR   "android.sensor.step_detector"
 
#define SENSOR_TYPE_STEP_COUNTER   (19)
 
#define SENSOR_STRING_TYPE_STEP_COUNTER   "android.sensor.step_counter"
 
#define SENSOR_TYPE_GEOMAGNETIC_ROTATION_VECTOR   (20)
 
#define SENSOR_STRING_TYPE_GEOMAGNETIC_ROTATION_VECTOR   "android.sensor.geomagnetic_rotation_vector"
 
#define SENSOR_TYPE_HEART_RATE   (21)
 
#define SENSOR_STRING_TYPE_HEART_RATE   "android.sensor.heart_rate"
 
#define SENSOR_TYPE_TILT_DETECTOR   (22)
 
#define SENSOR_STRING_TYPE_TILT_DETECTOR   "android.sensor.tilt_detector"
 
#define SENSOR_TYPE_WAKE_GESTURE   (23)
 
#define SENSOR_STRING_TYPE_WAKE_GESTURE   "android.sensor.wake_gesture"
 
#define SENSOR_TYPE_GLANCE_GESTURE   (24)
 
#define SENSOR_STRING_TYPE_GLANCE_GESTURE   "android.sensor.glance_gesture"
 
#define SENSOR_TYPE_PICK_UP_GESTURE   (25)
 
#define SENSOR_STRING_TYPE_PICK_UP_GESTURE   "android.sensor.pick_up_gesture"
 
#define SENSOR_TYPE_WRIST_TILT_GESTURE   (26)
 
#define SENSOR_STRING_TYPE_WRIST_TILT_GESTURE   "android.sensor.wrist_tilt_gesture"
 
#define SENSOR_TYPE_DEVICE_ORIENTATION   (27)
 
#define SENSOR_STRING_TYPE_DEVICE_ORIENTATION   "android.sensor.device_orientation"
 
#define SENSOR_TYPE_POSE_6DOF   (28)
 
#define SENSOR_STRING_TYPE_POSE_6DOF   "android.sensor.pose_6dof"
 
#define SENSOR_TYPE_STATIONARY_DETECT   (29)
 
#define SENSOR_STRING_TYPE_STATIONARY_DETECT   "android.sensor.stationary_detect"
 
#define SENSOR_TYPE_MOTION_DETECT   (30)
 
#define SENSOR_STRING_TYPE_MOTION_DETECT   "android.sensor.motion_detect"
 
#define SENSOR_TYPE_HEART_BEAT   (31)
 
#define SENSOR_STRING_TYPE_HEART_BEAT   "android.sensor.heart_beat"
 
#define SENSOR_TYPE_DYNAMIC_SENSOR_META   (32)
 
#define SENSOR_STRING_TYPE_DYNAMIC_SENSOR_META   "android.sensor.dynamic_sensor_meta"
 
#define SENSOR_TYPE_ADDITIONAL_INFO   (33)
 
#define SENSOR_STRING_TYPE_ADDITIONAL_INFO   "android.sensor.additional_info"
 
#define GRAVITY_SUN   (275.0f)
 
#define GRAVITY_EARTH   (9.80665f)
 
#define MAGNETIC_FIELD_EARTH_MAX   (60.0f)
 
#define MAGNETIC_FIELD_EARTH_MIN   (30.0f)
 
#define SENSOR_STATUS_NO_CONTACT   -1
 
#define SENSOR_STATUS_UNRELIABLE   0
 
#define SENSOR_STATUS_ACCURACY_LOW   1
 
#define SENSOR_STATUS_ACCURACY_MEDIUM   2
 
#define SENSOR_STATUS_ACCURACY_HIGH   3
 

Typedefs

typedef struct meta_data_event meta_data_event_t
 
typedef struct
dynamic_sensor_meta_event 
dynamic_sensor_meta_event_t
 
typedef enum additional_info_type additional_info_type_t
 
typedef struct sensors_event_t sensors_event_t
 
typedef sensors_event_t sensors_meta_data_event_t
 
typedef struct
sensors_poll_device_1 
sensors_poll_device_1_t
 

Enumerations

enum  { SENSORS_BATCH_DRY_RUN = 0x00000001, SENSORS_BATCH_WAKE_UPON_FIFO_FULL = 0x00000002 }
 
enum  { META_DATA_FLUSH_COMPLETE = 1, META_DATA_VERSION }
 
enum  { SENSOR_HAL_NORMAL_MODE = 0, SENSOR_HAL_DATA_INJECTION_MODE = 0x1 }
 
enum  {
  SENSOR_FLAG_WAKE_UP = 1U << 0, SENSOR_FLAG_CONTINUOUS_MODE = 0, SENSOR_FLAG_ON_CHANGE_MODE = 0x2, SENSOR_FLAG_ONE_SHOT_MODE = 0x4,
  SENSOR_FLAG_SPECIAL_REPORTING_MODE = 0x6, SENSOR_FLAG_SUPPORTS_DATA_INJECTION = DATA_INJECTION_MASK, SENSOR_FLAG_DYNAMIC_SENSOR = DYNAMIC_SENSOR_MASK, SENSOR_FLAG_ADDITIONAL_INFO = ADDITIONAL_INFO_MASK
}
 
enum  additional_info_type {
  AINFO_BEGIN = 0x0, AINFO_END = 0x1, AINFO_UNTRACKED_DELAY = 0x10000, AINFO_INTERNAL_TEMPERATURE,
  AINFO_VEC3_CALIBRATION, AINFO_SENSOR_PLACEMENT, AINFO_SAMPLING, AINFO_CHANNEL_NOISE = 0x20000,
  AINFO_CHANNEL_SAMPLER, AINFO_CHANNEL_FILTER, AINFO_CHANNEL_LINEAR_TRANSFORM, AINFO_CHANNEL_NONLINEAR_MAP,
  AINFO_CHANNEL_RESAMPLER, AINFO_CUSTOM_START = 0x10000000, AINFO_DEBUGGING_START = 0x40000000
}
 

Macro Definition Documentation

#define ADDITIONAL_INFO_MASK   SENSOR_FLAG_MASK_1(ADDITIONAL_INFO_SHIFT)

Definition at line 146 of file sensors.h.

#define ADDITIONAL_INFO_SHIFT   (6)

Definition at line 145 of file sensors.h.

#define DATA_INJECTION_MASK   SENSOR_FLAG_MASK_1(DATA_INJECTION_SHIFT)

Definition at line 134 of file sensors.h.

#define DATA_INJECTION_SHIFT   (4)

Definition at line 133 of file sensors.h.

#define DYNAMIC_SENSOR_MASK   SENSOR_FLAG_MASK_1(DYNAMIC_SENSOR_SHIFT)

Definition at line 140 of file sensors.h.

#define DYNAMIC_SENSOR_SHIFT   (5)

Definition at line 139 of file sensors.h.

#define GRAVITY_EARTH   (9.80665f)

Definition at line 871 of file sensors.h.

#define GRAVITY_SUN   (275.0f)

Values returned by the accelerometer in various locations in the universe. all values are in SI units (m/s^2)

Definition at line 870 of file sensors.h.

#define MAGNETIC_FIELD_EARTH_MAX   (60.0f)

Maximum magnetic field on Earth's surface

Definition at line 874 of file sensors.h.

#define MAGNETIC_FIELD_EARTH_MIN   (30.0f)

Minimum magnetic field on Earth's surface

Definition at line 877 of file sensors.h.

#define REPORTING_MODE_MASK   SENSOR_FLAG_MASK(REPORTING_MODE_NBIT, REPORTING_MODE_SHIFT)

Definition at line 127 of file sensors.h.

#define REPORTING_MODE_NBIT   (3)

Definition at line 126 of file sensors.h.

#define REPORTING_MODE_SHIFT   (1)

Definition at line 125 of file sensors.h.

#define SENSOR_FLAG_MASK (   nbit,
  shift 
)    (((1<<(nbit))-1)<<(shift))

Definition at line 119 of file sensors.h.

#define SENSOR_FLAG_MASK_1 (   shift)    SENSOR_FLAG_MASK(1, shift)

Definition at line 120 of file sensors.h.

#define SENSOR_PERMISSION_BODY_SENSORS   "android.permission.BODY_SENSORS"

Definition at line 94 of file sensors.h.

#define SENSOR_STATUS_ACCURACY_HIGH   3

Definition at line 886 of file sensors.h.

#define SENSOR_STATUS_ACCURACY_LOW   1

Definition at line 884 of file sensors.h.

#define SENSOR_STATUS_ACCURACY_MEDIUM   2

Definition at line 885 of file sensors.h.

#define SENSOR_STATUS_NO_CONTACT   -1

Possible values of the status field of sensor events.

Definition at line 882 of file sensors.h.

#define SENSOR_STATUS_UNRELIABLE   0

Definition at line 883 of file sensors.h.

#define SENSOR_STRING_TYPE_ACCELEROMETER   "android.sensor.accelerometer"

Definition at line 317 of file sensors.h.

#define SENSOR_STRING_TYPE_ADDITIONAL_INFO   "android.sensor.additional_info"

Definition at line 864 of file sensors.h.

#define SENSOR_STRING_TYPE_AMBIENT_TEMPERATURE   "android.sensor.ambient_temperature"

Definition at line 462 of file sensors.h.

#define SENSOR_STRING_TYPE_DEVICE_ORIENTATION   "android.sensor.device_orientation"

Definition at line 722 of file sensors.h.

#define SENSOR_STRING_TYPE_DYNAMIC_SENSOR_META   "android.sensor.dynamic_sensor_meta"

Definition at line 834 of file sensors.h.

#define SENSOR_STRING_TYPE_GAME_ROTATION_VECTOR   "android.sensor.game_rotation_vector"

Definition at line 488 of file sensors.h.

#define SENSOR_STRING_TYPE_GEOMAGNETIC_ROTATION_VECTOR   "android.sensor.geomagnetic_rotation_vector"

Definition at line 559 of file sensors.h.

#define SENSOR_STRING_TYPE_GLANCE_GESTURE   "android.sensor.glance_gesture"

Definition at line 659 of file sensors.h.

#define SENSOR_STRING_TYPE_GRAVITY   "android.sensor.gravity"

Definition at line 412 of file sensors.h.

#define SENSOR_STRING_TYPE_GYROSCOPE   "android.sensor.gyroscope"

Definition at line 359 of file sensors.h.

#define SENSOR_STRING_TYPE_GYROSCOPE_UNCALIBRATED   "android.sensor.gyroscope_uncalibrated"

Definition at line 501 of file sensors.h.

#define SENSOR_STRING_TYPE_HEART_BEAT   "android.sensor.heart_beat"

Definition at line 796 of file sensors.h.

#define SENSOR_STRING_TYPE_HEART_RATE   "android.sensor.heart_rate"

Definition at line 583 of file sensors.h.

#define SENSOR_STRING_TYPE_LIGHT   "android.sensor.light"

Definition at line 370 of file sensors.h.

#define SENSOR_STRING_TYPE_LINEAR_ACCELERATION   "android.sensor.linear_acceleration"

Definition at line 425 of file sensors.h.

#define SENSOR_STRING_TYPE_MAGNETIC_FIELD   "android.sensor.magnetic_field"

Definition at line 331 of file sensors.h.

#define SENSOR_STRING_TYPE_MAGNETIC_FIELD_UNCALIBRATED   "android.sensor.magnetic_field_uncalibrated"

Definition at line 475 of file sensors.h.

#define SENSOR_STRING_TYPE_MOTION_DETECT   "android.sensor.motion_detect"

Definition at line 774 of file sensors.h.

#define SENSOR_STRING_TYPE_ORIENTATION   "android.sensor.orientation"

Definition at line 346 of file sensors.h.

#define SENSOR_STRING_TYPE_PICK_UP_GESTURE   "android.sensor.pick_up_gesture"

Definition at line 672 of file sensors.h.

#define SENSOR_STRING_TYPE_POSE_6DOF   "android.sensor.pose_6dof"

Definition at line 741 of file sensors.h.

#define SENSOR_STRING_TYPE_PRESSURE   "android.sensor.pressure"

Definition at line 382 of file sensors.h.

#define SENSOR_STRING_TYPE_PROXIMITY   "android.sensor.proximity"

Definition at line 399 of file sensors.h.

#define SENSOR_STRING_TYPE_RELATIVE_HUMIDITY   "android.sensor.relative_humidity"

Definition at line 451 of file sensors.h.

#define SENSOR_STRING_TYPE_ROTATION_VECTOR   "android.sensor.rotation_vector"

Definition at line 439 of file sensors.h.

#define SENSOR_STRING_TYPE_SIGNIFICANT_MOTION   "android.sensor.significant_motion"

Definition at line 516 of file sensors.h.

#define SENSOR_STRING_TYPE_STATIONARY_DETECT   "android.sensor.stationary_detect"

Definition at line 756 of file sensors.h.

#define SENSOR_STRING_TYPE_STEP_COUNTER   "android.sensor.step_counter"

Definition at line 546 of file sensors.h.

#define SENSOR_STRING_TYPE_STEP_DETECTOR   "android.sensor.step_detector"

Definition at line 530 of file sensors.h.

#define SENSOR_STRING_TYPE_TEMPERATURE   "android.sensor.temperature"

Definition at line 386 of file sensors.h.

#define SENSOR_STRING_TYPE_TILT_DETECTOR   "android.sensor.tilt_detector"

Definition at line 611 of file sensors.h.

#define SENSOR_STRING_TYPE_WAKE_GESTURE   "android.sensor.wake_gesture"

Definition at line 633 of file sensors.h.

#define SENSOR_STRING_TYPE_WRIST_TILT_GESTURE   "android.sensor.wrist_tilt_gesture"

Definition at line 688 of file sensors.h.

#define SENSOR_TYPE_ACCELEROMETER   (1)

Definition at line 316 of file sensors.h.

#define SENSOR_TYPE_ADDITIONAL_INFO   (33)

SENSOR_TYPE_ADDITIONAL_INFO reporting-mode: N/A

This sensor type is for delivering additional sensor information aside from sensor event data. Additional information may include sensor front-end group delay, internal calibration parameters, noise level metrics, device internal temperature, etc.

This type will never bind to a sensor. In other words, no sensor in the sensor list should be of the type SENSOR_TYPE_ADDITIONAL_INFO. If a sensor HAL supports sensor additional information feature, it reports sensor_event_t with "sensor" field set to handle of the reporting sensor and "type" field set to SENSOR_TYPE_ADDITIONAL_INFO. Delivery of additional information events is triggered under two conditions: an enable activate() call or a flush() call to the corresponding sensor.

A single additional information report consists of multiple frames. Sequences of these frames are ordered using timestamps, which means the timestamps of sequential frames have to be at least 1 nanosecond apart from each other. Each frame is a sensor_event_t delivered through the HAL interface, with related data stored in the "additional_info" field, which is of type additional_info_event_t. The "type" field of additional_info_event_t denotes the nature of the payload data (see additional_info_type_t). The "serial" field is used to keep the sequence of payload data that spans multiple frames. The first frame of the entire report is always of type AINFO_BEGIN, and the last frame is always AINFO_END.

All additional information frames have to be delivered after flush complete event if flush() was triggering the report.

Definition at line 863 of file sensors.h.

#define SENSOR_TYPE_AMBIENT_TEMPERATURE   (13)

Definition at line 461 of file sensors.h.

#define SENSOR_TYPE_DEVICE_ORIENTATION   (27)

Definition at line 721 of file sensors.h.

#define SENSOR_TYPE_DEVICE_PRIVATE_BASE   0x10000

Definition at line 246 of file sensors.h.

#define SENSOR_TYPE_DYNAMIC_SENSOR_META   (32)

SENSOR_TYPE_DYNAMIC_SENSOR_META trigger-mode: special

A sensor event of this type is received when a dynamic sensor is added to or removed from the system. At most one sensor of this type can be present in one sensor HAL implementation and presence of a sensor of this type in sensor HAL implementation indicates that this sensor HAL supports dynamic sensor feature. Operations, such as batch, activate and setDelay, to this special purpose sensor should be treated as no-op and return successful.

A dynamic sensor connection indicates connection of a physical device or instantiation of a virtual sensor backed by algorithm; and a dynamic sensor disconnection indicates the the opposite. A sensor event of SENSOR_TYPE_DYNAMIC_SENSOR_META type should be delivered regardless of the activation status of the sensor in the event of dynamic sensor connection and disconnection. In the sensor event, besides the common data entries, "dynamic_sensor_meta", which includes fields for connection status, handle of the sensor involved, pointer to sensor_t structure and a uuid field, should be populated.

At a dynamic sensor connection event, fields of sensor_t structure referenced by a pointer in dynamic_sensor_meta should be filled as if it was regular sensors. Sensor HAL is responsible for recovery of memory if the corresponding data is dynamicially allocated. However, the the pointer must be valid until the first activate call to the sensor reported in this connection event. At a dynamic sensor disconnection, the sensor_t pointer should be NULL.

The sensor handle assigned to dynamic sensors should never be the same as that of any regular static sensors, and should be unique until next boot. In another word, if a handle h is used for a dynamic sensor A, that same number cannot be used for the same dynamic sensor A or another dynamic sensor B even after disconnection of A until reboot.

The UUID field will be used for identifying the sensor in addition to name, vendor and version and type. For physical sensors of the same model, all sensors will have the same values in sensor_t, but the UUID should be unique and persistent for each individual unit. An all zero UUID indicates it is not possible to differentiate individual sensor unit.

Definition at line 833 of file sensors.h.

#define SENSOR_TYPE_GAME_ROTATION_VECTOR   (15)

Definition at line 487 of file sensors.h.

#define SENSOR_TYPE_GEOMAGNETIC_FIELD   (2)

Definition at line 329 of file sensors.h.

#define SENSOR_TYPE_GEOMAGNETIC_ROTATION_VECTOR   (20)

Definition at line 558 of file sensors.h.

#define SENSOR_TYPE_GLANCE_GESTURE   (24)

Definition at line 658 of file sensors.h.

#define SENSOR_TYPE_GRAVITY   (9)

Definition at line 411 of file sensors.h.

#define SENSOR_TYPE_GYROSCOPE   (4)

Definition at line 358 of file sensors.h.

#define SENSOR_TYPE_GYROSCOPE_UNCALIBRATED   (16)

Definition at line 500 of file sensors.h.

#define SENSOR_TYPE_HEART_BEAT   (31)

Definition at line 795 of file sensors.h.

#define SENSOR_TYPE_HEART_RATE   (21)

Definition at line 582 of file sensors.h.

#define SENSOR_TYPE_LIGHT   (5)

Definition at line 369 of file sensors.h.

#define SENSOR_TYPE_LINEAR_ACCELERATION   (10)

Definition at line 424 of file sensors.h.

#define SENSOR_TYPE_MAGNETIC_FIELD   SENSOR_TYPE_GEOMAGNETIC_FIELD

Definition at line 330 of file sensors.h.

#define SENSOR_TYPE_MAGNETIC_FIELD_UNCALIBRATED   (14)

Definition at line 474 of file sensors.h.

#define SENSOR_TYPE_META_DATA   (0)

Definition at line 279 of file sensors.h.

#define SENSOR_TYPE_MOTION_DETECT   (30)

Definition at line 773 of file sensors.h.

#define SENSOR_TYPE_ORIENTATION   (3)

Definition at line 345 of file sensors.h.

#define SENSOR_TYPE_PICK_UP_GESTURE   (25)

SENSOR_TYPE_PICK_UP_GESTURE reporting-mode: one-shot

A sensor of this type triggers when the device is picked up regardless of wherever is was before (desk, pocket, bag). The only allowed return value is 1.0. This sensor de-activates itself immediately after it triggers.

Implement only the wake-up version of this sensor.

Definition at line 671 of file sensors.h.

#define SENSOR_TYPE_POSE_6DOF   (28)

Definition at line 740 of file sensors.h.

#define SENSOR_TYPE_PRESSURE   (6)

Definition at line 381 of file sensors.h.

#define SENSOR_TYPE_PROXIMITY   (8)

Definition at line 398 of file sensors.h.

#define SENSOR_TYPE_RELATIVE_HUMIDITY   (12)

Definition at line 450 of file sensors.h.

#define SENSOR_TYPE_ROTATION_VECTOR   (11)

Definition at line 438 of file sensors.h.

#define SENSOR_TYPE_SIGNIFICANT_MOTION   (17)

Definition at line 515 of file sensors.h.

#define SENSOR_TYPE_STATIONARY_DETECT   (29)

Definition at line 755 of file sensors.h.

#define SENSOR_TYPE_STEP_COUNTER   (19)

Definition at line 545 of file sensors.h.

#define SENSOR_TYPE_STEP_DETECTOR   (18)

Definition at line 529 of file sensors.h.

#define SENSOR_TYPE_TEMPERATURE   (7)

Definition at line 385 of file sensors.h.

#define SENSOR_TYPE_TILT_DETECTOR   (22)

Definition at line 610 of file sensors.h.

#define SENSOR_TYPE_WAKE_GESTURE   (23)

Definition at line 632 of file sensors.h.

#define SENSOR_TYPE_WRIST_TILT_GESTURE   (26)

Definition at line 687 of file sensors.h.

#define SENSORS_DEVICE_API_VERSION_0_1   HARDWARE_DEVICE_API_VERSION_2(0, 1, SENSORS_HEADER_VERSION)

Definition at line 33 of file sensors.h.

#define SENSORS_DEVICE_API_VERSION_1_0   HARDWARE_DEVICE_API_VERSION_2(1, 0, SENSORS_HEADER_VERSION)

Definition at line 34 of file sensors.h.

#define SENSORS_DEVICE_API_VERSION_1_1   HARDWARE_DEVICE_API_VERSION_2(1, 1, SENSORS_HEADER_VERSION)

Definition at line 35 of file sensors.h.

#define SENSORS_DEVICE_API_VERSION_1_2   HARDWARE_DEVICE_API_VERSION_2(1, 2, SENSORS_HEADER_VERSION)

Definition at line 36 of file sensors.h.

#define SENSORS_DEVICE_API_VERSION_1_3   HARDWARE_DEVICE_API_VERSION_2(1, 3, SENSORS_HEADER_VERSION)

Definition at line 37 of file sensors.h.

#define SENSORS_DEVICE_API_VERSION_1_4   HARDWARE_DEVICE_API_VERSION_2(1, 4, SENSORS_HEADER_VERSION)

Definition at line 38 of file sensors.h.

#define SENSORS_HANDLE_BASE   0

Handles must be higher than SENSORS_HANDLE_BASE and must be unique. A Handle identifies a given sensors. The handle is used to activate and/or deactivate sensors. In this version of the API there can only be 256 handles.

Definition at line 62 of file sensors.h.

#define SENSORS_HANDLE_BITS   8

Definition at line 63 of file sensors.h.

#define SENSORS_HANDLE_COUNT   (1<<SENSORS_HANDLE_BITS)

Definition at line 64 of file sensors.h.

#define SENSORS_HARDWARE_MODULE_ID   "sensors"

Please see the Sensors section of source.android.com for an introduction to and detailed descriptions of Android sensor types: http://source.android.com/devices/sensors/index.html The id of this module

Definition at line 49 of file sensors.h.

#define SENSORS_HARDWARE_POLL   "poll"

Name of the sensors device to open

Definition at line 54 of file sensors.h.

#define SENSORS_HEADER_VERSION   1

Definition at line 31 of file sensors.h.

#define SENSORS_MODULE_API_VERSION_0_1   HARDWARE_MODULE_API_VERSION(0, 1)

Definition at line 32 of file sensors.h.

Typedef Documentation

Dynamic sensor meta event. See the description of SENSOR_TYPE_DYNAMIC_SENSOR_META type for details.

Meta data event data

Union of the various types of sensor data that can be returned.

Definition at line 1141 of file sensors.h.

Enumeration Type Documentation

anonymous enum
Enumerator
SENSORS_BATCH_DRY_RUN 
SENSORS_BATCH_WAKE_UPON_FIFO_FULL 

Definition at line 75 of file sensors.h.

anonymous enum
Enumerator
META_DATA_FLUSH_COMPLETE 
META_DATA_VERSION 

Definition at line 83 of file sensors.h.

anonymous enum
Enumerator
SENSOR_HAL_NORMAL_MODE 
SENSOR_HAL_DATA_INJECTION_MODE 

Definition at line 100 of file sensors.h.

anonymous enum
Enumerator
SENSOR_FLAG_WAKE_UP 
SENSOR_FLAG_CONTINUOUS_MODE 
SENSOR_FLAG_ON_CHANGE_MODE 
SENSOR_FLAG_ONE_SHOT_MODE 
SENSOR_FLAG_SPECIAL_REPORTING_MODE 
SENSOR_FLAG_SUPPORTS_DATA_INJECTION 
SENSOR_FLAG_DYNAMIC_SENSOR 
SENSOR_FLAG_ADDITIONAL_INFO 

Definition at line 152 of file sensors.h.

Enumerator
AINFO_BEGIN 
AINFO_END 
AINFO_UNTRACKED_DELAY 
AINFO_INTERNAL_TEMPERATURE 
AINFO_VEC3_CALIBRATION 
AINFO_SENSOR_PLACEMENT 
AINFO_SAMPLING 
AINFO_CHANNEL_NOISE 
AINFO_CHANNEL_SAMPLER 
AINFO_CHANNEL_FILTER 
AINFO_CHANNEL_LINEAR_TRANSFORM 
AINFO_CHANNEL_NONLINEAR_MAP 
AINFO_CHANNEL_RESAMPLER 
AINFO_CUSTOM_START 
AINFO_DEBUGGING_START 

Definition at line 980 of file sensors.h.