mirror of
https://github.com/eclipse/upm.git
synced 2025-07-02 01:41:12 +03:00
Added initial interfaces and some sensors implementing them
This commit is contained in:

committed by
Serban Waltter

parent
85608a9f61
commit
e7820f2831
@ -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;
|
||||
|
@ -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.
|
||||
|
Reference in New Issue
Block a user