1

我的意思是 TYPE_MAGNETIC_FIELD 值的源代码在哪里: case Sensor.TYPE_MAGNETIC_FIELD: geomagneticValues = sensorEvent.values.clone();

我已经搜索了硬件文件夹中的几乎所有文件。可能是我错过了那个片段。请帮助找到该源代码。(我认为传感器使用的公式如下: Btheta=(umsin(theta)/4(phi)(r^3) )

4

1 回答 1

0

请参阅hardware/libhardware/include/hardware/sensors.hAOSP 代码中的文件。OEM 提供的传感器库必须提供框架期望的数据。来自驱动程序本身的数据可能已经采用这种形式,也可能是其他形式。由 OEM HAL 来做正确的事情。此注释解释了设备的传感器库返回的内容。

/* * SENSOR_TYPE_GEOMAGNETIC_FIELD * trigger-mode: continuous * wake-up sensor: no * * All values are in micro-Tesla (uT) and measure the geomagnetic * field in the X, Y and Z axis. * * Returned values include calibration mechanisms such that the vector is * aligned with the magnetic declination and heading of the earth's * geomagnetic field. * * Magnetic Field sensors return sensor events for all 3 axes at a constant * rate defined by setDelay(). */

于 2014-03-07T14:41:44.667 回答