mirror of
https://github.com/eclipse/upm.git
synced 2025-09-14 06:07:30 +03:00
Added initial interfaces and some sensors implementing them
Signed-off-by: Mihai Tudor Panu <mihai.tudor.panu@intel.com>
This commit is contained in:

committed by
Mihai Tudor Panu

parent
6bf21a23e7
commit
f035470822
@@ -46,3 +46,8 @@ int Moisture::value()
|
||||
{
|
||||
return mraa_aio_read(m_aio);
|
||||
}
|
||||
|
||||
int Moisture::getMoisture()
|
||||
{
|
||||
return value();
|
||||
}
|
||||
|
@@ -25,6 +25,7 @@
|
||||
|
||||
#include <string>
|
||||
#include <mraa/aio.h>
|
||||
#include <interfaces/iMoisture.hpp>
|
||||
|
||||
namespace upm {
|
||||
/**
|
||||
@@ -55,7 +56,7 @@ namespace upm {
|
||||
* @image html moisture.jpg
|
||||
* @snippet moisture.cxx Interesting
|
||||
*/
|
||||
class Moisture {
|
||||
class Moisture : virtual public iMoisture {
|
||||
public:
|
||||
/**
|
||||
* Analog moisture sensor constructor
|
||||
@@ -74,6 +75,13 @@ namespace upm {
|
||||
*/
|
||||
int value();
|
||||
|
||||
/**
|
||||
* Gets the moisture value from the sensor
|
||||
*
|
||||
* @return Moisture reading
|
||||
*/
|
||||
virtual int getMoisture();
|
||||
|
||||
private:
|
||||
mraa_aio_context m_aio;
|
||||
};
|
||||
|
Reference in New Issue
Block a user