Lines Matching refs:sensor
190 LOGI("Enabling sensor %d at rate %.0f Hz (special 0x%x) and latency %.2f ms",
199 LOGE("Could not enable sensor %d", spec.sensor_type);
218 // twice then disable once, the sensor will be disabled
219 LOGI("Disabling sensor %d", sensor_type);
226 LOGE("Could not disable sensor %d", sensor_type);
304 bool ContextHub::CalibrateSingleSensor(const SensorSpec& sensor) {
308 req.config.sensor_type = static_cast<uint8_t>(sensor.sensor_type);
312 LOGI("Issuing calibration request to sensor %d (%s)", sensor.sensor_type,
313 ContextHub::SensorTypeToAbbrevName(sensor.sensor_type).c_str());
316 LOGE("Failed to calibrate sensor %d", sensor.sensor_type);
321 auto calEventHandler = [this, &sensor, &success](const AppToHostEvent &event) -> bool {
322 if (event.IsCalibrationEventForSensor(sensor.sensor_type)) {
323 success = HandleCalibrationResult(sensor, event);
349 bool ContextHub::HandleCalibrationResult(const SensorSpec& sensor,
353 LOGE("Calibration of sensor %d (%s) failed with status %u",
354 sensor.sensor_type,
355 ContextHub::SensorTypeToAbbrevName(sensor.sensor_type).c_str(),
361 switch (sensor.sensor_type) {
366 success = SetCalibration(sensor.sensor_type, result->xBias,
374 if (sensor.have_cal_ref) {
375 success = SetCalibration(sensor.sensor_type,
376 (sensor.cal_ref - result->value));
384 success = SetCalibration(sensor.sensor_type, result->xBias,
392 if (sensor.have_cal_ref && (result->value != 0.0f)) {
393 success = SetCalibration(sensor.sensor_type,
394 (sensor.cal_ref / result->value));
400 LOGE("Calibration not supported for sensor type %d",
401 static_cast<int>(sensor.sensor_type));
466 LOGD("Ignoring non-sensor event");