3
似乎某些傳感器的枚舉值從<android/sensor.h>
中丟失。爲什麼一些傳感器的枚舉值從<android/sensor.h>中丟失?使用它們是否安全?
文件定義了以下枚舉:
/*
* Sensor types
* (keep in sync with hardware/sensor.h)
*/
enum {
ASENSOR_TYPE_ACCELEROMETER = 1,
ASENSOR_TYPE_MAGNETIC_FIELD = 2,
ASENSOR_TYPE_GYROSCOPE = 4,
ASENSOR_TYPE_LIGHT = 5,
ASENSOR_TYPE_PROXIMITY = 8
};
的評論說,這枚舉與<hardware/sensor.h>
同步(不暴露,它的Android源的一部分)。
但在<hardware/sensor.h>
我發現values更多的有用的傳感器,如壓力,溫度和溼度的:
#define SENSOR_TYPE_ACCELEROMETER (1)
#define SENSOR_TYPE_GEOMAGNETIC_FIELD (2)
#define SENSOR_TYPE_ORIENTATION (3)
#define SENSOR_TYPE_GYROSCOPE (4)
#define SENSOR_TYPE_LIGHT (5)
#define SENSOR_TYPE_PRESSURE (6)
#define SENSOR_TYPE_TEMPERATURE (7)
#define SENSOR_TYPE_PROXIMITY (8)
#define SENSOR_TYPE_GRAVITY (9)
#define SENSOR_TYPE_LINEAR_ACCELERATION (10)
#define SENSOR_TYPE_ROTATION_VECTOR (11)
#define SENSOR_TYPE_RELATIVE_HUMIDITY (12)
// ...
#define SENSOR_TYPE_HEART_BEAT (31)
爲什麼一些傳感器在<android/sensor.h>
不上市?它使用它安全和便攜?