From cbaecc326b344272ce377d0f88b813de2e884c68 Mon Sep 17 00:00:00 2001 From: lixiangpeng5 Date: Sat, 7 Sep 2024 12:38:43 +0000 Subject: [PATCH] add linear acc and game rotation vector Signed-off-by: lixiangpeng5 Change-Id: I45a708cf4d22f7f7ddb69f7db08328fe3eca972f --- sensors/sensor/oh_sensor_type.h | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/sensors/sensor/oh_sensor_type.h b/sensors/sensor/oh_sensor_type.h index 6f2cc925a..0641a9c0c 100644 --- a/sensors/sensor/oh_sensor_type.h +++ b/sensors/sensor/oh_sensor_type.h @@ -91,11 +91,21 @@ typedef enum Sensor_Type { * @since 11 */ SENSOR_TYPE_GRAVITY = 257, + /** + * Linear acceleration sensor. + * @since 13 + */ + SENSOR_TYPE_LINEAR_ACCELERATION = 258, /** * Rotation vector sensor. * @since 11 */ SENSOR_TYPE_ROTATION_VECTOR = 259, + /** + * Game rotation vector sensor. + * @since 13 + */ + SENSOR_TYPE_GAME_ROTATION_VECTOR = 262, /** * Pedometer detection sensor. * @since 11 @@ -334,6 +344,11 @@ int32_t OH_SensorEvent_GetAccuracy(Sensor_Event* sensorEvent, Sensor_Accuracy *a * The value 1 means that the number of detected steps changes. * SENSOR_TYPE_PEDOMETER: data[0], indicating the number of steps a user has walked. * SENSOR_TYPE_HEART_RATE: data[0], indicating the heart rate value. + * SENSOR_TYPE_LINEAR_ACCELERATION: Supported from api version 13. data[0], data[1], and data[2], indicating the + * linear acceleration around the x, y, and z axes of the device, respectively, in m/s2. + * SENSOR_TYPE_GAME_ROTATION_VECTOR: Supported from api version 13. data[0], data[1] and data[2], indicating the + * rotation angles of a device around the x, y, and z axes, respectively, in degree. data[3] indicates the rotation + * vector. * * @param sensorEvent - Pointer to the sensor data information. * @param data - Double pointer to the sensor data. -- Gitee