mirror of
https://github.com/eclipse/upm.git
synced 2025-07-03 18:31:13 +03:00
C++ Core: Add base class per sensor/actuator type
Adding base classes for UPM sensors and actuators. Signed-off-by: Noel Eck <noel.eck@intel.com>
This commit is contained in:
@ -26,7 +26,7 @@
|
||||
#pragma once
|
||||
|
||||
#include <string>
|
||||
#include "interfaces/iHumiditySensor.hpp"
|
||||
#include "iHumiditySensor.hpp"
|
||||
|
||||
#include "bmp280.hpp"
|
||||
|
||||
@ -57,7 +57,7 @@ namespace upm {
|
||||
* @snippet bmp280-bme280.cxx Interesting
|
||||
*/
|
||||
|
||||
class BME280 : public BMP280, public IHumiditySensor {
|
||||
class BME280 : public virtual BMP280, public virtual iHumiditySensor {
|
||||
public:
|
||||
|
||||
/**
|
||||
@ -88,6 +88,12 @@ namespace upm {
|
||||
*/
|
||||
virtual ~BME280();
|
||||
|
||||
virtual std::string Name () {return "BME280";}
|
||||
virtual std::string Description () {return "Digital absolute pressure sensor with humidity";}
|
||||
|
||||
/* Provide an implementation of a method to get sensor values by source */
|
||||
virtual std::map<std::string, float> HumidityForSources(std::vector<std::string> sources);
|
||||
|
||||
/**
|
||||
* Return the current measured relative humidity. update()
|
||||
* must have been called prior to calling this method. If the
|
||||
@ -108,12 +114,6 @@ namespace upm {
|
||||
*/
|
||||
void setOversampleRateHumidity(BME280_OSRS_H_T rate);
|
||||
|
||||
// Interface support
|
||||
const char *getModuleName()
|
||||
{
|
||||
return "BME280";
|
||||
};
|
||||
|
||||
int getHumidityRelative()
|
||||
{
|
||||
return int(getHumidity());
|
||||
|
Reference in New Issue
Block a user