Added initial interfaces and some sensors implementing them

This commit is contained in:
Mihai Stefanescu
2018-06-12 18:46:49 +03:00
committed by Serban Waltter
parent 85608a9f61
commit e7820f2831
102 changed files with 1183 additions and 182 deletions

View File

@ -67,6 +67,12 @@ float URM37::getDistance(int degrees)
return (distance);
}
int URM37::getDistance()
{
/* TODO: compilation issue for swig. switched original method to not use default zero parameter. */
return getDistance(0);
}
float URM37::getTemperature()
{
float temperature;

View File

@ -32,6 +32,8 @@
#include <stdlib.h>
#include <unistd.h>
#include <string.h>
#include <interfaces/iDistance.hpp>
#include <interfaces/iTemperature.hpp>
#include "urm37.h"
@ -76,7 +78,7 @@ namespace upm {
* @snippet urm37-uart.cxx Interesting
*/
class URM37 {
class URM37 : virtual public iDistance, virtual public iTemperature {
public:
/**
@ -119,14 +121,22 @@ namespace upm {
* ignored in analog mode.
* @return The measured distance in cm
*/
float getDistance(int degrees=0);
float getDistance(int degrees);
/**
* Get the distance measurement. A return value of 65535.0
* in UART mode indicates an invalid measurement.
*
* @return The measured distance in cm
*/
virtual int getDistance();
/**
* Get the temperature measurement. This is only valid in UART mode.
*
* @return The measured temperature in degrees C
*/
float getTemperature();
virtual float getTemperature();
/**
* In UART mode only, read a value from the EEPROM and return it.