platform_sensor_fusion_algorithm.cc 1.0 KB

1234567891011121314151617181920212223242526272829303132
  1. // Copyright 2017 The Chromium Authors. All rights reserved.
  2. // Use of this source code is governed by a BSD-style license that can be
  3. // found in the LICENSE file.
  4. #include "services/device/generic_sensor/platform_sensor_fusion_algorithm.h"
  5. #include <cmath>
  6. #include "base/containers/contains.h"
  7. namespace device {
  8. PlatformSensorFusionAlgorithm::PlatformSensorFusionAlgorithm(
  9. mojom::SensorType fused_type,
  10. const std::vector<mojom::SensorType>& source_types)
  11. : fused_type_(fused_type), source_types_(source_types) {
  12. DCHECK(!source_types_.empty());
  13. }
  14. PlatformSensorFusionAlgorithm::~PlatformSensorFusionAlgorithm() = default;
  15. bool PlatformSensorFusionAlgorithm::GetFusedData(
  16. mojom::SensorType which_sensor_changed,
  17. SensorReading* fused_reading) {
  18. DCHECK(base::Contains(source_types_, which_sensor_changed));
  19. return GetFusedDataInternal(which_sensor_changed, fused_reading);
  20. }
  21. void PlatformSensorFusionAlgorithm::Reset() {}
  22. void PlatformSensorFusionAlgorithm::SetFrequency(double) {}
  23. } // namespace device