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
				
			| @@ -166,9 +166,10 @@ float RSC::getTemperature() | ||||
|     return rsc_get_temperature(m_rsc); | ||||
| } | ||||
|  | ||||
| #define INH20_TO_PA 248.84 | ||||
| float RSC::getPressure() | ||||
| { | ||||
|     return rsc_get_pressure(m_rsc); | ||||
|     return rsc_get_pressure(m_rsc) * INH20_TO_PA; | ||||
| } | ||||
|  | ||||
| void RSC::setMode(RSC_MODE mode) | ||||
|   | ||||
| @@ -26,6 +26,8 @@ | ||||
|  | ||||
| #include "rsc.h" | ||||
| #include <string> | ||||
| #include <interfaces/iPressure.hpp> | ||||
| #include <interfaces/iTemperature.hpp> | ||||
|  | ||||
| namespace upm { | ||||
|     /** | ||||
| @@ -74,7 +76,7 @@ namespace upm { | ||||
|      * | ||||
|      * @snippet rsc.cxx Interesting | ||||
|      */ | ||||
|     class RSC { | ||||
|     class RSC : virtual public iPressure, virtual public iTemperature { | ||||
|  | ||||
|     public: | ||||
|         /** | ||||
| @@ -194,14 +196,14 @@ namespace upm { | ||||
|          * | ||||
|          * @return float compensated temperature value | ||||
|          */ | ||||
|         float getTemperature(); | ||||
|         virtual float getTemperature(); | ||||
|  | ||||
|         /** | ||||
|          * Function to get the compensated pressure value | ||||
|          * | ||||
|          * @return float compensated pressure value | ||||
|          */ | ||||
|         float getPressure(); | ||||
|         virtual float getPressure(); | ||||
|  | ||||
|         /** | ||||
|          * Function to set the mode for the RSC sensor: | ||||
|   | ||||
		Reference in New Issue
	
	Block a user