mirror of
				https://github.com/eclipse/upm.git
				synced 2025-10-31 15:15:07 +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:
		 Mihai Stefanescu
					Mihai Stefanescu
				
			
				
					committed by
					
						 Mihai Tudor Panu
						Mihai Tudor Panu
					
				
			
			
				
	
			
			
			 Mihai Tudor Panu
						Mihai Tudor Panu
					
				
			
						parent
						
							6bf21a23e7
						
					
				
				
					commit
					f035470822
				
			| @@ -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