mirror of
https://github.com/eclipse/upm.git
synced 2025-07-26 21:51:16 +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
@ -62,6 +62,11 @@ int Temperature::value ()
|
||||
return (int) round(t);
|
||||
}
|
||||
|
||||
float Temperature::getTemperature ()
|
||||
{
|
||||
return value();
|
||||
}
|
||||
|
||||
float Temperature::raw_value()
|
||||
{
|
||||
return (float) mraa_aio_read(m_aio);
|
||||
|
@ -28,6 +28,7 @@
|
||||
|
||||
#include <string>
|
||||
#include <mraa/aio.hpp>
|
||||
#include <interfaces/iTemperature.hpp>
|
||||
|
||||
namespace upm {
|
||||
/**
|
||||
@ -58,7 +59,7 @@ namespace upm {
|
||||
* @image html temp.jpg
|
||||
* @snippet temperature.cxx Interesting
|
||||
*/
|
||||
class Temperature {
|
||||
class Temperature : virtual public iTemperature {
|
||||
public:
|
||||
/**
|
||||
* Analog temperature sensor constructor
|
||||
@ -96,6 +97,13 @@ class Temperature {
|
||||
* @return Normalized temperature in Celsius
|
||||
*/
|
||||
int value();
|
||||
|
||||
/**
|
||||
* Gets the temperature in Celsius from the sensor
|
||||
*
|
||||
* @return Normalized temperature in Celsius
|
||||
*/
|
||||
virtual float getTemperature();
|
||||
private:
|
||||
mraa_aio_context m_aio;
|
||||
float m_scale;
|
||||
|
Reference in New Issue
Block a user