mirror of
https://github.com/eclipse/upm.git
synced 2025-07-02 01:41:12 +03:00
Added iGas interface
Signed-off-by: Serban Waltter <serban.waltter@rinftech.com> Signed-off-by: Mihai Tudor Panu <mihai.tudor.panu@intel.com>
This commit is contained in:

committed by
Mihai Tudor Panu

parent
f28a6d2561
commit
e4f106a0c7
@ -2,4 +2,5 @@ set (libname "mhz16")
|
||||
set (libdescription "CO2 Sensor")
|
||||
set (module_src ${libname}.cxx)
|
||||
set (module_hpp ${libname}.hpp)
|
||||
set (module_iface iGas.hpp)
|
||||
upm_module_init(mraa)
|
||||
|
@ -244,8 +244,15 @@ int MHZ16::getGas()
|
||||
return gas;
|
||||
}
|
||||
|
||||
int MHZ16::getTemperature()
|
||||
float MHZ16::getConcentration()
|
||||
{
|
||||
getData();
|
||||
return gas;
|
||||
}
|
||||
|
||||
float MHZ16::getTemperature()
|
||||
{
|
||||
getData();
|
||||
return temp;
|
||||
}
|
||||
|
||||
|
@ -38,6 +38,9 @@
|
||||
#include <sys/types.h>
|
||||
#include <sys/stat.h>
|
||||
|
||||
#include <interfaces/iTemperature.hpp>
|
||||
#include <interfaces/iGas.hpp>
|
||||
|
||||
#include <mraa/uart.h>
|
||||
|
||||
namespace upm {
|
||||
@ -67,7 +70,7 @@ namespace upm {
|
||||
* @image html mhz16.jpg
|
||||
* @snippet mhz16.cxx Interesting
|
||||
*/
|
||||
class MHZ16 {
|
||||
class MHZ16: virtual public iGas, virtual public iTemperature {
|
||||
public:
|
||||
|
||||
|
||||
@ -151,13 +154,14 @@ namespace upm {
|
||||
* @return Gas concentration
|
||||
*/
|
||||
int getGas();
|
||||
float getConcentration();
|
||||
|
||||
/**
|
||||
* Returns the temperature data.
|
||||
*
|
||||
* @return Temperature in Celsius
|
||||
*/
|
||||
int getTemperature();
|
||||
float getTemperature();
|
||||
|
||||
/**
|
||||
* Sets the zero point of the sensor
|
||||
|
@ -1,7 +1,17 @@
|
||||
#ifdef SWIGPYTHON
|
||||
%module (package="upm") cwlsxxa
|
||||
#endif
|
||||
|
||||
%import "interfaces/interfaces.i"
|
||||
|
||||
%include "../common_top.i"
|
||||
|
||||
/* BEGIN Java syntax ------------------------------------------------------- */
|
||||
#ifdef SWIGJAVA
|
||||
%typemap(javaimports) SWIGTYPE %{
|
||||
import upm_interfaces.*;
|
||||
%}
|
||||
|
||||
%include "arrays_java.i";
|
||||
%include "../java_buffer.i"
|
||||
|
||||
|
Reference in New Issue
Block a user