Android/Linux 方向传感器的调试经验
1、HAL层方向传感器信息:
文件路径:MSM8916.LA.1.1-PostCS-CT-CMCC-r113500.1srcLINUXandroidhardwareqcomsensors
文件名:NativeSensorManager.cpp
int NativeSensorManager::getDataInfo() {
……
if (has_acc && has_compass) {
int index;
list = &context[mSensorCount];
list->sensor = &sensor_list[mSensorCount];
list->sensor->name = "orientation";
list->sensor->vendor = "quic";
list->sensor->version = 1;
list->sensor->handle = '_ypr';
list->sensor->type = SENSOR_TYPE_ORIENTATION;
list->sensor->maxRange = 360.0f;
list->sensor->resolution = 1.0f/256.0f;
list->sensor->power = 1;
list->sensor->minDelay = 1;
list->data_fd = -1;
list->data_path = NULL;
list->enable_path = NULL;
list->driver = new OrientationSensor(list);
mSensorCount++;
list->dep_mask |= 1 << SENSOR_TYPE_ACCELEROMETER;
list->dep_mask |= 1 << SENSOR_TYPE_MAGNETIC_FIELD;
}
……
}