Skip to content

Most visited

Recently visited

navigation

sensor.h File Reference

sensor.h File Reference

Data Structures

struct  ASensorVector
 
struct  AMetaDataEvent
 
struct  AUncalibratedEvent
 
struct  AHeartRateEvent
 
struct  ADynamicSensorEvent
 
struct  AAdditionalInfoEvent
 
struct  ASensorEvent
 

Typedefs

typedef struct AHardwareBuffer AHardwareBuffer
 
typedef struct ASensorVector ASensorVector
 
typedef struct AMetaDataEvent AMetaDataEvent
 
typedef struct AUncalibratedEvent AUncalibratedEvent
 
typedef struct AHeartRateEvent AHeartRateEvent
 
typedef struct ADynamicSensorEvent ADynamicSensorEvent
 
typedef struct ASensorEvent ASensorEvent
 
typedef struct ASensorManager ASensorManager
 
typedef struct ASensorEventQueue ASensorEventQueue
 
typedef struct ASensor ASensor
 
typedef ASensor const * ASensorRef
 
typedef ASensorRef const * ASensorList
 

Enumerations

enum  {
  ASENSOR_TYPE_INVALID = -1, ASENSOR_TYPE_ACCELEROMETER = 1, ASENSOR_TYPE_MAGNETIC_FIELD = 2, ASENSOR_TYPE_GYROSCOPE = 4,
  ASENSOR_TYPE_LIGHT = 5, ASENSOR_TYPE_PRESSURE = 6, ASENSOR_TYPE_PROXIMITY = 8, ASENSOR_TYPE_GRAVITY = 9,
  ASENSOR_TYPE_LINEAR_ACCELERATION = 10, ASENSOR_TYPE_ROTATION_VECTOR = 11, ASENSOR_TYPE_RELATIVE_HUMIDITY = 12, ASENSOR_TYPE_AMBIENT_TEMPERATURE = 13,
  ASENSOR_TYPE_MAGNETIC_FIELD_UNCALIBRATED = 14, ASENSOR_TYPE_GAME_ROTATION_VECTOR = 15, ASENSOR_TYPE_GYROSCOPE_UNCALIBRATED = 16, ASENSOR_TYPE_SIGNIFICANT_MOTION = 17,
  ASENSOR_TYPE_STEP_DETECTOR = 18, ASENSOR_TYPE_STEP_COUNTER = 19, ASENSOR_TYPE_GEOMAGNETIC_ROTATION_VECTOR = 20, ASENSOR_TYPE_HEART_RATE = 21,
  ASENSOR_TYPE_POSE_6DOF = 28, ASENSOR_TYPE_STATIONARY_DETECT = 29, ASENSOR_TYPE_MOTION_DETECT = 30, ASENSOR_TYPE_HEART_BEAT = 31,
  ASENSOR_TYPE_LOW_LATENCY_OFFBODY_DETECT = 34, ASENSOR_TYPE_ACCELEROMETER_UNCALIBRATED = 35
}
 
enum  {
  ASENSOR_STATUS_NO_CONTACT = -1, ASENSOR_STATUS_UNRELIABLE = 0, ASENSOR_STATUS_ACCURACY_LOW = 1, ASENSOR_STATUS_ACCURACY_MEDIUM = 2,
  ASENSOR_STATUS_ACCURACY_HIGH = 3
}
 
enum  {
  AREPORTING_MODE_INVALID = -1, AREPORTING_MODE_CONTINUOUS = 0, AREPORTING_MODE_ON_CHANGE = 1, AREPORTING_MODE_ONE_SHOT = 2,
  AREPORTING_MODE_SPECIAL_TRIGGER = 3
}
 
enum  { ASENSOR_DIRECT_RATE_STOP = 0, ASENSOR_DIRECT_RATE_NORMAL = 1, ASENSOR_DIRECT_RATE_FAST = 2, ASENSOR_DIRECT_RATE_VERY_FAST = 3 }
 
enum  { ASENSOR_DIRECT_CHANNEL_TYPE_SHARED_MEMORY = 1, ASENSOR_DIRECT_CHANNEL_TYPE_HARDWARE_BUFFER = 2 }
 

Functions

 __attribute__ ((deprecated)) ASensorManager *ASensorManager_getInstance()
 
ASensorManagerASensorManager_getInstance ()
 
ASensorManagerASensorManager_getInstanceForPackage (const char *packageName)
 
int ASensorManager_getSensorList (ASensorManager *manager, ASensorList *list)
 
ASensor const * ASensorManager_getDefaultSensor (ASensorManager *manager, int type)
 
ASensor const * ASensorManager_getDefaultSensorEx (ASensorManager *manager, int type, bool wakeUp)
 
ASensorEventQueueASensorManager_createEventQueue (ASensorManager *manager, ALooper *looper, int ident, ALooper_callbackFunc callback, void *data)
 
int ASensorManager_destroyEventQueue (ASensorManager *manager, ASensorEventQueue *queue)
 
int ASensorManager_createSharedMemoryDirectChannel (ASensorManager *manager, int fd, size_t size)
 
int ASensorManager_createHardwareBufferDirectChannel (ASensorManager *manager, AHardwareBuffer const *buffer, size_t size)
 
void ASensorManager_destroyDirectChannel (ASensorManager *manager, int channelId)
 
int ASensorManager_configureDirectReport (ASensorManager *manager, ASensor const *sensor, int channelId, int rate)
 
int ASensorEventQueue_registerSensor (ASensorEventQueue *queue, ASensor const *sensor, int32_t samplingPeriodUs, int64_t maxBatchReportLatencyUs)
 
int ASensorEventQueue_enableSensor (ASensorEventQueue *queue, ASensor const *sensor)
 
int ASensorEventQueue_disableSensor (ASensorEventQueue *queue, ASensor const *sensor)
 
int ASensorEventQueue_setEventRate (ASensorEventQueue *queue, ASensor const *sensor, int32_t usec)
 
int ASensorEventQueue_hasEvents (ASensorEventQueue *queue)
 
ssize_t ASensorEventQueue_getEvents (ASensorEventQueue *queue, ASensorEvent *events, size_t count)
 
const char * ASensor_getName (ASensor const *sensor)
 
const char * ASensor_getVendor (ASensor const *sensor)
 
int ASensor_getType (ASensor const *sensor)
 
float ASensor_getResolution (ASensor const *sensor)
 
int ASensor_getMinDelay (ASensor const *sensor)
 
int ASensor_getFifoMaxEventCount (ASensor const *sensor)
 
int ASensor_getFifoReservedEventCount (ASensor const *sensor)
 
const char * ASensor_getStringType (ASensor const *sensor)
 
int ASensor_getReportingMode (ASensor const *sensor)
 
bool ASensor_isWakeUpSensor (ASensor const *sensor)
 
bool ASensor_isDirectChannelTypeSupported (ASensor const *sensor, int channelType)
 
int ASensor_getHighestDirectReportRateLevel (ASensor const *sensor)
 
This site uses cookies to store your preferences for site-specific language and display options.

Get the latest Android developer news and tips that will help you find success on Google Play.

* Required Fields

Hooray!

Follow Google Developers on WeChat

Browse this site in ?

You requested a page in , but your language preference for this site is .

Would you like to change your language preference and browse this site in ? If you want to change your language preference later, use the language menu at the bottom of each page.

This class requires API level or higher

This doc is hidden because your selected API level for the documentation is . You can change the documentation API level with the selector above the left navigation.

For more information about specifying the API level your app requires, read Supporting Different Platform Versions.

Take a short survey?
Help us improve the Android developer experience. (April 2018 — Developer Survey)