Lines Matching refs:sensor_type
38 SensorType sensor_type;
79 SensorType sensor_type;
88 bool SensorTypeIsAliasOf(SensorType sensor_type, SensorType alias) {
90 if (sensor_aliases_[i].sensor_type == sensor_type
102 return sensor_names_[i].sensor_type;
113 std::string ContextHub::SensorTypeToAbbrevName(SensorType sensor_type) {
115 if (sensor_names_[i].sensor_type == sensor_type) {
121 if (sensor_aliases_[i].sensor_alias == sensor_type) {
128 static_cast<int>(sensor_type));
191 req.config.sensor_type = static_cast<uint8_t>(spec.sensor_type);
203 spec.sensor_type, spec.rate_hz, spec.special_rate,
207 sensor_is_active_[static_cast<int>(spec.sensor_type)] = true;
211 LOGE("Could not enable sensor %d", spec.sensor_type);
221 bool ContextHub::DisableSensor(SensorType sensor_type) {
225 req.config.sensor_type = static_cast<uint8_t>(sensor_type);
231 LOGI("Disabling sensor %d", sensor_type);
234 sensor_is_active_[static_cast<int>(sensor_type)] = false;
238 LOGE("Could not disable sensor %d", sensor_type);
244 return DisableSensor(spec.sensor_type);
252 success &= DisableSensor(sensor_names_[i].sensor_type);
263 if (sensor_is_active_[static_cast<int>(sensor_names_[i].sensor_type)]) {
264 success &= DisableSensor(sensor_names_[i].sensor_type);
347 if (sensors[i].sensor_type == event_source
348 || SensorTypeIsAliasOf(sensors[i].sensor_type, event_source)) {
365 req.config.sensor_type = static_cast<uint8_t>(sensor.sensor_type);
369 LOGI("Issuing calibration request to sensor %d (%s)", sensor.sensor_type,
370 ContextHub::SensorTypeToAbbrevName(sensor.sensor_type).c_str());
373 LOGE("Failed to calibrate sensor %d", sensor.sensor_type);
379 if (event.IsCalibrationEventForSensor(sensor.sensor_type)) {
399 req.config.sensor_type = static_cast<uint8_t>(sensor.sensor_type);
403 LOGI("Issuing test request to sensor %d (%s)", sensor.sensor_type,
404 ContextHub::SensorTypeToAbbrevName(sensor.sensor_type).c_str());
407 LOGE("Failed to test sensor %d", sensor.sensor_type);
413 if (event.IsTestEventForSensor(sensor.sensor_type)) {
445 sensor.sensor_type,
446 ContextHub::SensorTypeToAbbrevName(sensor.sensor_type).c_str(),
452 switch (sensor.sensor_type) {
457 success = SetCalibration(sensor.sensor_type, result->xBias,
466 success = SetCalibration(sensor.sensor_type,
475 success = SetCalibration(sensor.sensor_type, result->xBias,
484 success = SetCalibration(sensor.sensor_type,
492 static_cast<int>(sensor.sensor_type));
503 sensor.sensor_type,
504 ContextHub::SensorTypeToAbbrevName(sensor.sensor_type).c_str());
508 sensor.sensor_type,
509 ContextHub::SensorTypeToAbbrevName(sensor.sensor_type).c_str(),
580 bool ContextHub::SendCalibrationData(SensorType sensor_type,
585 req.config.sensor_type = static_cast<uint8_t>(sensor_type);
618 bool ContextHub::SetCalibration(SensorType sensor_type, int32_t data) {
619 UNUSED_PARAM(sensor_type);
624 bool ContextHub::SetCalibration(SensorType sensor_type, float data) {
625 UNUSED_PARAM(sensor_type);
630 bool ContextHub::SetCalibration(SensorType sensor_type, int32_t x,
632 UNUSED_PARAM(sensor_type);
639 bool ContextHub::SetCalibration(SensorType sensor_type, int32_t x,
641 UNUSED_PARAM(sensor_type);