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
@ -47,3 +47,8 @@ int MB704X::getRange()
|
||||
{
|
||||
return mb704x_get_range(m_mb704x);
|
||||
}
|
||||
|
||||
int MB704X::getDistance()
|
||||
{
|
||||
return getRange();
|
||||
}
|
||||
|
@ -25,6 +25,7 @@
|
||||
|
||||
#include <string>
|
||||
#include <iostream>
|
||||
#include <interfaces/iDistance.hpp>
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <unistd.h>
|
||||
@ -58,7 +59,7 @@ namespace upm {
|
||||
* @snippet mb704x.cxx Interesting
|
||||
*/
|
||||
|
||||
class MB704X {
|
||||
class MB704X : virtual public iDistance {
|
||||
public:
|
||||
|
||||
/**
|
||||
@ -84,7 +85,12 @@ namespace upm {
|
||||
*/
|
||||
int getRange();
|
||||
|
||||
|
||||
/**
|
||||
* Gets the distance to the object in cm
|
||||
*
|
||||
* @return Distance to the object in cm
|
||||
*/
|
||||
virtual int getDistance();
|
||||
protected:
|
||||
// mb704x device context
|
||||
mb704x_context m_mb704x;
|
||||
|
Reference in New Issue
Block a user