restructured classes to provide sensor interface
This commit is contained in:
parent
ad8b07167b
commit
db1750ef53
4 changed files with 123 additions and 36 deletions
23
src/sensors/Sensor.h
Normal file
23
src/sensors/Sensor.h
Normal 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
|
||||
Loading…
Add table
Add a link
Reference in a new issue