Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2172)

Unified Diff: device/generic_sensor/linux/sensor_data_linux.h

Issue 2492773002: [sensors][CrOS/Linux] Implementation of motion sensors for CrOS/Linux platforms (Closed)
Patch Set: rebased Created 4 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: device/generic_sensor/linux/sensor_data_linux.h
diff --git a/device/generic_sensor/linux/sensor_data_linux.h b/device/generic_sensor/linux/sensor_data_linux.h
index e45d992d7c6cb7e39d5a49db94235dc714993f36..3336a8e3d414911ac5b1acee468ac21b21c61989 100644
--- a/device/generic_sensor/linux/sensor_data_linux.h
+++ b/device/generic_sensor/linux/sensor_data_linux.h
@@ -10,11 +10,16 @@
namespace device {
+struct SensorReading;
+
// This structure represents a context that is used to
// create a type specific SensorReader and a concrete
// sensor that uses the SensorReader to read sensor
// data from files specified in the |sensor_file_names|.
struct DEVICE_GENERIC_SENSOR_EXPORT SensorDataLinux {
+ using ReaderFunctor =
+ base::Callback<void(double scaling, SensorReading& reading)>;
+
SensorDataLinux();
~SensorDataLinux();
SensorDataLinux(const SensorDataLinux& other);
@@ -24,6 +29,10 @@ struct DEVICE_GENERIC_SENSOR_EXPORT SensorDataLinux {
// Different sensors might have up to 3 different file name arrays.
// One file must be found from each array.
std::vector<std::vector<std::string>> sensor_file_names;
+ // Scaling file to be found.
+ std::string sensor_scale_name;
+ // Used to apply scalings to raw sensor data.
+ ReaderFunctor apply_scaling_func;
// Reporting mode of a sensor.
mojom::ReportingMode reporting_mode;
// Default configuration of a sensor.
« no previous file with comments | « device/generic_sensor/linux/platform_sensor_utils_linux.cc ('k') | device/generic_sensor/linux/sensor_data_linux.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698