Otpvondoiats commented on PR #17837: URL: https://github.com/apache/nuttx/pull/17837#issuecomment-3742360791
> What if you record a data stream / log with these identifiers, use current code to decode it, then someone changes the numbers and you want to decode old recording with a new code? > > What if the application and kernel versions mismatch and they contain different identifiers for the same sensor? > > 3 people are telling you that this is bad practice to add one new thing and break everything around.. usually you append new identifiers to the end of exiting list so that existing identifiers are untouched ;-) https://cs.android.com/android/_/android/platform/hardware/libhardware/+/7e08958a6cbe2b02c9d80a66fba68fd8a864d73d:include_all/hardware/sensors-base.h?hl=zh-cn ~~~ enum { SENSOR_TYPE_META_DATA = 0, SENSOR_TYPE_ACCELEROMETER = 1, SENSOR_TYPE_MAGNETIC_FIELD = 2, SENSOR_TYPE_ORIENTATION = 3, SENSOR_TYPE_GYROSCOPE = 4, SENSOR_TYPE_LIGHT = 5, SENSOR_TYPE_PRESSURE = 6, SENSOR_TYPE_TEMPERATURE = 7, SENSOR_TYPE_PROXIMITY = 8, SENSOR_TYPE_GRAVITY = 9, SENSOR_TYPE_LINEAR_ACCELERATION = 10, SENSOR_TYPE_ROTATION_VECTOR = 11, SENSOR_TYPE_RELATIVE_HUMIDITY = 12, SENSOR_TYPE_AMBIENT_TEMPERATURE = 13, SENSOR_TYPE_MAGNETIC_FIELD_UNCALIBRATED = 14, SENSOR_TYPE_GAME_ROTATION_VECTOR = 15, SENSOR_TYPE_GYROSCOPE_UNCALIBRATED = 16, SENSOR_TYPE_SIGNIFICANT_MOTION = 17, SENSOR_TYPE_STEP_DETECTOR = 18, SENSOR_TYPE_STEP_COUNTER = 19, SENSOR_TYPE_GEOMAGNETIC_ROTATION_VECTOR = 20, SENSOR_TYPE_HEART_RATE = 21, SENSOR_TYPE_TILT_DETECTOR = 22, SENSOR_TYPE_WAKE_GESTURE = 23, SENSOR_TYPE_GLANCE_GESTURE = 24, SENSOR_TYPE_PICK_UP_GESTURE = 25, SENSOR_TYPE_WRIST_TILT_GESTURE = 26, SENSOR_TYPE_DEVICE_ORIENTATION = 27, SENSOR_TYPE_POSE_6DOF = 28, SENSOR_TYPE_STATIONARY_DETECT = 29, SENSOR_TYPE_MOTION_DETECT = 30, SENSOR_TYPE_HEART_BEAT = 31, SENSOR_TYPE_DYNAMIC_SENSOR_META = 32, SENSOR_TYPE_ADDITIONAL_INFO = 33, SENSOR_TYPE_LOW_LATENCY_OFFBODY_DETECT = 34, SENSOR_TYPE_ACCELEROMETER_UNCALIBRATED = 35, SENSOR_TYPE_HINGE_ANGLE = 36, SENSOR_TYPE_HEAD_TRACKER = 37, SENSOR_TYPE_ACCELEROMETER_LIMITED_AXES = 38, SENSOR_TYPE_GYROSCOPE_LIMITED_AXES = 39, SENSOR_TYPE_ACCELEROMETER_LIMITED_AXES_UNCALIBRATED = 40, SENSOR_TYPE_GYROSCOPE_LIMITED_AXES_UNCALIBRATED = 41, SENSOR_TYPE_HEADING = 42, SENSOR_TYPE_DEVICE_PRIVATE_BASE = 65536 /* 0x10000 */, }; ~~~ nuttx:https://cs.android.com/android/_/android/platform/hardware/libhardware/+/7e08958a6cbe2b02c9d80a66fba68fd8a864d73d:include_all/hardware/sensors-base.h?hl=zh-cn -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
