mirror of
https://github.com/eclipse/upm.git
synced 2025-07-27 06:01: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
@ -141,6 +141,11 @@ float TEX00::getTemperature(bool fahrenheit)
|
||||
return m_temperature;
|
||||
}
|
||||
|
||||
float TEX00::getTemperature()
|
||||
{
|
||||
return getTemperature(false);
|
||||
}
|
||||
|
||||
int TEX00::average(int samples)
|
||||
{
|
||||
if (samples <= 0)
|
||||
|
@ -28,6 +28,7 @@
|
||||
#include <vector>
|
||||
|
||||
#include <mraa/aio.hpp>
|
||||
#include <interfaces/iTemperature.hpp>
|
||||
|
||||
#define TEX00_DEFAULT_AREF 5.0
|
||||
|
||||
@ -74,7 +75,7 @@ namespace upm {
|
||||
* @snippet tex00.cxx Interesting
|
||||
*/
|
||||
|
||||
class TEX00 {
|
||||
class TEX00 : virtual public iTemperature {
|
||||
public:
|
||||
|
||||
typedef enum {
|
||||
@ -126,7 +127,15 @@ namespace upm {
|
||||
* The default is false (degrees Celsius).
|
||||
* @return The last temperature reading in Celsius or Fahrenheit
|
||||
*/
|
||||
float getTemperature(bool fahrenheit=false);
|
||||
float getTemperature(bool fahrenheit);
|
||||
|
||||
/**
|
||||
* Get the current temperature. update() must have been called
|
||||
* prior to calling this method.
|
||||
*
|
||||
* @return The last temperature reading in Celsius or Fahrenheit
|
||||
*/
|
||||
virtual float getTemperature();
|
||||
|
||||
/**
|
||||
* Return the smallest temperature that can be measured by the
|
||||
|
Reference in New Issue
Block a user