# ASensorEvent

Information that describes a sensor event, refer to [SensorEvent](https://developer.android.com/reference/android/hardware/SensorEvent) for additional documentation.

## Summary

NOTE: changes to this struct has to be backward compatible and reflected in sensors_event_t

| ### Public attributes ||
|---|---|
| `https://developer.android.com/ndk/reference/struct/a-sensor-event#struct_a_sensor_event_1ae7279e595f3e0876cbdf30fb84f9a596` | `union ASensorEvent::@102` |
| `https://developer.android.com/ndk/reference/struct/a-sensor-event#struct_a_sensor_event_1ac7300131e6d0f2a8e55652c12fb655ea` | `https://developer.android.com/ndk/reference/struct/a-sensor-vector#struct_a_sensor_vector` |
| `https://developer.android.com/ndk/reference/struct/a-sensor-event#struct_a_sensor_event_1af85b3be06e45f64fe5d456f4a9bcb3be` | `https://developer.android.com/ndk/reference/struct/a-additional-info-event#struct_a_additional_info_event` |
| `https://developer.android.com/ndk/reference/struct/a-sensor-event#struct_a_sensor_event_1a72473c9050bfc2ba974de6224a6f4151[16]` | `float` |
| `https://developer.android.com/ndk/reference/struct/a-sensor-event#struct_a_sensor_event_1ad4a4fbc1f5590d71819da2a829c1dc1a[8]` | `uint64_t` |
| `https://developer.android.com/ndk/reference/struct/a-sensor-event#struct_a_sensor_event_1a5f62fdc3a708ee5515fbb1ca3f59beb8` | `float` |
| `https://developer.android.com/ndk/reference/struct/a-sensor-event#struct_a_sensor_event_1abdb3f8f5df20b4c9b94409dbc41585e9` | `https://developer.android.com/ndk/reference/struct/a-dynamic-sensor-event#struct_a_dynamic_sensor_event` |
| `https://developer.android.com/ndk/reference/struct/a-sensor-event#struct_a_sensor_event_1adc18cf0513e45fa9146a73c40212fb62` | `uint32_t` |
| `https://developer.android.com/ndk/reference/struct/a-sensor-event#struct_a_sensor_event_1abd3b91af6641a0202a1c5bd2cf906eb6` | `https://developer.android.com/ndk/reference/struct/a-sensor-vector#struct_a_sensor_vector` |
| `https://developer.android.com/ndk/reference/struct/a-sensor-event#struct_a_sensor_event_1acede8a6fc3ce592549e7fcda01efbb92` | `https://developer.android.com/ndk/reference/struct/a-head-tracker-event#struct_a_head_tracker_event` |
| `https://developer.android.com/ndk/reference/struct/a-sensor-event#struct_a_sensor_event_1a0329ac64e7800ec7e343b2ae733c3a04` | `https://developer.android.com/ndk/reference/struct/a-heading-event#struct_a_heading_event` |
| `https://developer.android.com/ndk/reference/struct/a-sensor-event#struct_a_sensor_event_1ab2d1fb4d1838863b255854261d9077c8` | `https://developer.android.com/ndk/reference/struct/a-heart-rate-event#struct_a_heart_rate_event` |
| `https://developer.android.com/ndk/reference/struct/a-sensor-event#struct_a_sensor_event_1a0b0cc6c167bedb7757931b7162300cf9` | `float` |
| `https://developer.android.com/ndk/reference/struct/a-sensor-event#struct_a_sensor_event_1a293879c4751de99563df4627f8f9e721` | `https://developer.android.com/ndk/reference/struct/a-limited-axes-imu-event#struct_a_limited_axes_imu_event` |
| `https://developer.android.com/ndk/reference/struct/a-sensor-event#struct_a_sensor_event_1a6b35ef95a3858447ecbea8bd3b117311` | `https://developer.android.com/ndk/reference/struct/a-limited-axes-imu-uncalibrated-event#struct_a_limited_axes_imu_uncalibrated_event` |
| `https://developer.android.com/ndk/reference/struct/a-sensor-event#struct_a_sensor_event_1a699d43828811c8e2fefc724cf9799b70` | `https://developer.android.com/ndk/reference/struct/a-sensor-vector#struct_a_sensor_vector` |
| `https://developer.android.com/ndk/reference/struct/a-sensor-event#struct_a_sensor_event_1ae2269c3cf421d05bae425bdfedf3b4ca` | `https://developer.android.com/ndk/reference/struct/a-meta-data-event#struct_a_meta_data_event` |
| `https://developer.android.com/ndk/reference/struct/a-sensor-event#struct_a_sensor_event_1a4e14e68ef80f0c5a63f9a403f1997942` | `float` |
| `https://developer.android.com/ndk/reference/struct/a-sensor-event#struct_a_sensor_event_1ad0bb2e11da43b53dac477c61c79bcdbf` | `float` |
| `https://developer.android.com/ndk/reference/struct/a-sensor-event#struct_a_sensor_event_1a0e57827dc03dbba3a29e657664338485` | `int32_t` do not use |
| `https://developer.android.com/ndk/reference/struct/a-sensor-event#struct_a_sensor_event_1a446e76af93bbd0e84e0e08f16d35f6e8[3]` | `int32_t` |
| `https://developer.android.com/ndk/reference/struct/a-sensor-event#struct_a_sensor_event_1aa566296348ced5b44b3259aafc9bbf07` | `int32_t` The sensor that generates this event. |
| `https://developer.android.com/ndk/reference/struct/a-sensor-event#struct_a_sensor_event_1acc5f4b43ace135d99eed01b0d544f0d2` | `uint64_t` |
| `https://developer.android.com/ndk/reference/struct/a-sensor-event#struct_a_sensor_event_1a8420e9a74e6c27fd6fdf99c7b8ca33a2` | `float` |
| `https://developer.android.com/ndk/reference/struct/a-sensor-event#struct_a_sensor_event_1ab44e3dd8e3359e4920dc3f80df0bd12d` | `int64_t` The time in nanoseconds at which the event happened, and its behavior is identical to [SensorEvent::timestamp](https://developer.android.com/reference/android/hardware/SensorEvent#timestamp) in Java API. |
| `https://developer.android.com/ndk/reference/struct/a-sensor-event#struct_a_sensor_event_1ae7b3559b790a24062c6ae9bc98a9ef0e` | `int32_t` Sensor type for the event, such as [ASENSOR_TYPE_ACCELEROMETER](https://developer.android.com/ndk/reference/group/sensor#group___sensor_1ggaa156d1cebb38c8a65846c4d9c006012aad72017f34c12971593a8cb14f4f254df). |
| `https://developer.android.com/ndk/reference/struct/a-sensor-event#struct_a_sensor_event_1a2ccf2112b281a3c154f816c1f588e81b` | `union ASensorEvent::@102::@106` |
| `https://developer.android.com/ndk/reference/struct/a-sensor-event#struct_a_sensor_event_1ad6b9e9d3f1c8d4cbf26050f37b3794d8` | `https://developer.android.com/ndk/reference/struct/a-uncalibrated-event#struct_a_uncalibrated_event` |
| `https://developer.android.com/ndk/reference/struct/a-sensor-event#struct_a_sensor_event_1a6c125439317d8600c904306e14963573` | `https://developer.android.com/ndk/reference/struct/a-uncalibrated-event#struct_a_uncalibrated_event` |
| `https://developer.android.com/ndk/reference/struct/a-sensor-event#struct_a_sensor_event_1acbabbc45cb51594f5ceeda03bced90aa` | `https://developer.android.com/ndk/reference/struct/a-uncalibrated-event#struct_a_uncalibrated_event` |
| `https://developer.android.com/ndk/reference/struct/a-sensor-event#struct_a_sensor_event_1a11523d14b5327a8356fd8ea8738f8b4f` | `https://developer.android.com/ndk/reference/struct/a-sensor-vector#struct_a_sensor_vector` |
| `https://developer.android.com/ndk/reference/struct/a-sensor-event#struct_a_sensor_event_1a1e6e333d7834f8a077f760c16c3567d3` | `int32_t` |

## Public attributes

### @103

Declared in `android/sensor.h`

```objective-c
union ASensorEvent::@102 ASensorEvent::@103
```

### acceleration

Declared in `android/sensor.h`

```text
ASensorVector ASensorEvent::acceleration
```

### additional_info

Declared in `android/sensor.h`

```scdoc
AAdditionalInfoEvent ASensorEvent::additional_info
```

### data

Declared in `android/sensor.h`

```text
float ASensorEvent::data[16]
```

### data

Declared in `android/sensor.h`

```scdoc
uint64_t ASensorEvent::data[8]
```

### distance

Declared in `android/sensor.h`

```text
float ASensorEvent::distance
```

### dynamic_sensor_meta

Declared in `android/sensor.h`

```scdoc
ADynamicSensorEvent ASensorEvent::dynamic_sensor_meta
```

### flags

Declared in `android/sensor.h`

```scdoc
uint32_t ASensorEvent::flags
```

### gyro

Declared in `android/sensor.h`

```text
ASensorVector ASensorEvent::gyro
```

### head_tracker

Declared in `android/sensor.h`

```scdoc
AHeadTrackerEvent ASensorEvent::head_tracker
```

### heading

Declared in `android/sensor.h`

```text
AHeadingEvent ASensorEvent::heading
```

### heart_rate

Declared in `android/sensor.h`

```scdoc
AHeartRateEvent ASensorEvent::heart_rate
```

### light

Declared in `android/sensor.h`

```text
float ASensorEvent::light
```

### limited_axes_imu

Declared in `android/sensor.h`

```scdoc
ALimitedAxesImuEvent ASensorEvent::limited_axes_imu
```

### limited_axes_imu_uncalibrated

Declared in `android/sensor.h`

```scdoc
ALimitedAxesImuUncalibratedEvent ASensorEvent::limited_axes_imu_uncalibrated
```

### magnetic

Declared in `android/sensor.h`

```text
ASensorVector ASensorEvent::magnetic
```

### meta_data

Declared in `android/sensor.h`

```scdoc
AMetaDataEvent ASensorEvent::meta_data
```

### pressure

Declared in `android/sensor.h`

```text
float ASensorEvent::pressure
```

### relative_humidity

Declared in `android/sensor.h`

```scdoc
float ASensorEvent::relative_humidity
```

### reserved0

Declared in `android/sensor.h`

```scdoc
int32_t ASensorEvent::reserved0
```
do not use

### reserved1

Declared in `android/sensor.h`

```scdoc
int32_t ASensorEvent::reserved1[3]
```

### sensor

Declared in `android/sensor.h`

```scdoc
int32_t ASensorEvent::sensor
```
The sensor that generates this event.

### step_counter

Declared in `android/sensor.h`

```scdoc
uint64_t ASensorEvent::step_counter
```

### temperature

Declared in `android/sensor.h`

```text
float ASensorEvent::temperature
```

### timestamp

Declared in `android/sensor.h`

```scdoc
int64_t ASensorEvent::timestamp
```
The time in nanoseconds at which the event happened, and its behavior is identical to [SensorEvent::timestamp](https://developer.android.com/reference/android/hardware/SensorEvent#timestamp) in Java API.

### type

Declared in `android/sensor.h`

```carbon
int32_t ASensorEvent::type
```
Sensor type for the event, such as [ASENSOR_TYPE_ACCELEROMETER](https://developer.android.com/ndk/reference/group/sensor#group___sensor_1ggaa156d1cebb38c8a65846c4d9c006012aad72017f34c12971593a8cb14f4f254df).

### u64

Declared in `android/sensor.h`

```objective-c
union ASensorEvent::@102::@106 ASensorEvent::u64
```

### uncalibrated_acceleration

Declared in `android/sensor.h`

```scdoc
AUncalibratedEvent ASensorEvent::uncalibrated_acceleration
```

### uncalibrated_gyro

Declared in `android/sensor.h`

```scdoc
AUncalibratedEvent ASensorEvent::uncalibrated_gyro
```

### uncalibrated_magnetic

Declared in `android/sensor.h`

```scdoc
AUncalibratedEvent ASensorEvent::uncalibrated_magnetic
```

### vector

Declared in `android/sensor.h`

```text
ASensorVector ASensorEvent::vector
```

### version

Declared in `android/sensor.h`

```scdoc
int32_t ASensorEvent::version
```