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
				
			| @@ -99,6 +99,11 @@ float RHUSB::getTemperature(bool fahrenheit) | ||||
|     return m_temperature; | ||||
| } | ||||
|  | ||||
| float RHUSB::getTemperature() | ||||
| { | ||||
|   return getTemperature(false); | ||||
| } | ||||
|  | ||||
| float RHUSB::getHumidity() | ||||
| { | ||||
|   return m_humidity; | ||||
|   | ||||
| @@ -25,6 +25,8 @@ | ||||
|  | ||||
| #include <string> | ||||
| #include <mraa/uart.hpp> | ||||
| #include <interfaces/iHumidity.hpp> | ||||
| #include <interfaces/iTemperature.hpp> | ||||
|  | ||||
| namespace upm { | ||||
|  | ||||
| @@ -53,7 +55,7 @@ namespace upm { | ||||
|    * @snippet rhusb.cxx Interesting | ||||
|    */ | ||||
|  | ||||
|   class RHUSB { | ||||
|   class RHUSB : virtual public iHumidity, virtual public iTemperature { | ||||
|   public: | ||||
|     /** | ||||
|      * RHUSB constructor | ||||
| @@ -83,7 +85,15 @@ namespace upm { | ||||
|      * The default is false (degrees Celsius). | ||||
|      * @return The last temperature reading in Celsius or Fahrenheit | ||||
|      */ | ||||
|     float getTemperature(bool fahrenheit=false); | ||||
|     float getTemperature(bool fahrenheit); | ||||
|  | ||||
|     /** | ||||
|      * Get the current temperature.  update() must have been called | ||||
|      * prior to calling this method. | ||||
|      * | ||||
|      * @return The last temperature reading in Celsius | ||||
|      */ | ||||
|     virtual float getTemperature(); | ||||
|  | ||||
|     /** | ||||
|      * Get the current relative humidity.  update() must have been called | ||||
| @@ -91,7 +101,7 @@ namespace upm { | ||||
|      * | ||||
|      * @return The last humidity reading | ||||
|      */ | ||||
|     float getHumidity(); | ||||
|     virtual float getHumidity(); | ||||
|  | ||||
|     /** | ||||
|      * Get the firmware identification string. | ||||
|   | ||||
		Reference in New Issue
	
	Block a user