Lines Matching refs:sensor
304 bool ContextHub::CalibrateSingleSensor(const SensorSpec& sensor) { in CalibrateSingleSensor() argument
308 req.config.sensor_type = static_cast<uint8_t>(sensor.sensor_type); in CalibrateSingleSensor()
312 LOGI("Issuing calibration request to sensor %d (%s)", sensor.sensor_type, in CalibrateSingleSensor()
313 ContextHub::SensorTypeToAbbrevName(sensor.sensor_type).c_str()); in CalibrateSingleSensor()
316 LOGE("Failed to calibrate sensor %d", sensor.sensor_type); in CalibrateSingleSensor()
321 auto calEventHandler = [this, &sensor, &success](const AppToHostEvent &event) -> bool { in CalibrateSingleSensor()
322 if (event.IsCalibrationEventForSensor(sensor.sensor_type)) { in CalibrateSingleSensor()
323 success = HandleCalibrationResult(sensor, event); in CalibrateSingleSensor()
349 bool ContextHub::HandleCalibrationResult(const SensorSpec& sensor, in HandleCalibrationResult() argument
354 sensor.sensor_type, in HandleCalibrationResult()
355 ContextHub::SensorTypeToAbbrevName(sensor.sensor_type).c_str(), in HandleCalibrationResult()
361 switch (sensor.sensor_type) { in HandleCalibrationResult()
366 success = SetCalibration(sensor.sensor_type, result->xBias, in HandleCalibrationResult()
374 if (sensor.have_cal_ref) { in HandleCalibrationResult()
375 success = SetCalibration(sensor.sensor_type, in HandleCalibrationResult()
376 (sensor.cal_ref - result->value)); in HandleCalibrationResult()
384 success = SetCalibration(sensor.sensor_type, result->xBias, in HandleCalibrationResult()
392 if (sensor.have_cal_ref && (result->value != 0.0f)) { in HandleCalibrationResult()
393 success = SetCalibration(sensor.sensor_type, in HandleCalibrationResult()
394 (sensor.cal_ref / result->value)); in HandleCalibrationResult()
401 static_cast<int>(sensor.sensor_type)); in HandleCalibrationResult()