Browse Source

Force to implement BaseSensor methods that return values

ech1560
Maxim Prokhorov 6 years ago
parent
commit
fab9c0f741
2 changed files with 6 additions and 6 deletions
  1. +5
    -5
      code/espurna/sensors/BaseSensor.h
  2. +1
    -1
      code/espurna/sensors/EmonSensor.h

+ 5
- 5
code/espurna/sensors/BaseSensor.h View File

@ -46,19 +46,19 @@ class BaseSensor {
virtual void post() {}
// Descriptive name of the sensor
virtual String description() {}
virtual String description() = 0;
// Address of the sensor (it could be the GPIO or I2C address)
virtual String address(unsigned char index) {}
virtual String address(unsigned char index) = 0;
// Descriptive name of the slot # index
virtual String slot(unsigned char index) {};
virtual String slot(unsigned char index) = 0;
// Type for slot # index
virtual unsigned char type(unsigned char index) {}
virtual unsigned char type(unsigned char index) = 0;
// Current value for slot # index
virtual double value(unsigned char index) {}
virtual double value(unsigned char index) = 0;
// Retrieve current instance configuration
virtual void getConfig(JsonObject& root) {};


+ 1
- 1
code/espurna/sensors/EmonSensor.h View File

@ -146,7 +146,7 @@ class EmonSensor : public I2CSensor {
#endif
}
virtual unsigned int readADC(unsigned char channel) {}
virtual unsigned int readADC(unsigned char channel) = 0;
void calculateFactors(unsigned char channel) {


Loading…
Cancel
Save