restructured classes to provide sensor interface

This commit is contained in:
Clemens-Dautermann 2022-02-06 12:32:49 +01:00 committed by Clemens-Dautermann
parent ad8b07167b
commit db1750ef53
4 changed files with 123 additions and 36 deletions

23
src/sensors/Sensor.h Normal file
View file

@ -0,0 +1,23 @@
#ifndef NEW_CLIMTE_GO_SENSOR_H
#define NEW_CLIMTE_GO_SENSOR_H
enum class SensorState : unsigned short {
AWAKE, ASLEEP
};
class Sensor {
public:
virtual void sample() = 0;
virtual void wakeUp() = 0;
virtual void enableStandbyMode() = 0;
protected:
SensorState state = SensorState::ASLEEP;
virtual void sensor_setup() = 0;
};
#endif //NEW_CLIMTE_GO_SENSOR_H