A multifunctional and modular Firmware for Multitech's mDot based on ARM mBed provides a widerange of functionality for several Sensors such as MAX44009, BME280, MPU9250, SI1143 and uBlox. It allows you to quickly build a Sensornode that measures specific data with its sensors and sends it via LoRaWAN.

Dependencies:   mDot_LoRa_Sensornode_Flowmeter_impl mbed-rtos mbed

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers TaskHumidity.h Source File

TaskHumidity.h

00001 /**
00002  * @file TaksHumidity.h
00003  *
00004  * @author Adrian
00005  * @date 30.05.2016
00006  *
00007 
00008  */
00009 #include "BME280.h"
00010 #include "BME280HumidityMessage.h "
00011 #include "main.h"
00012 #include "Task.h"
00013 
00014 #ifndef TASKHUMIDITY_H_
00015 #define TASKHUMIDITY_H_
00016 
00017 /**
00018  * @class TaskHumidity
00019  * @brief This TaskHumidity Class handles the humidity measurement using the BME280.
00020  * Starting the task using the start() starts the measurement.
00021  * It can be used alongside with other measurement Tasks inside the mbed::rtos
00022  * environment. The Task Class basically wraps mbeds Thread functionality.
00023  */
00024 class TaskHumidity : public Task {
00025 
00026 public:
00027     TaskHumidity(BME280*,Mutex*, Queue<BME280HumidityMessage,HUMIDITY_QUEUE_LENGHT>*);
00028     TaskHumidity(BME280*,Mutex*,Queue<BME280HumidityMessage,HUMIDITY_QUEUE_LENGHT>*,
00029             osPriority, uint32_t, unsigned char*);
00030     virtual ~TaskHumidity();
00031 
00032 
00033 private:
00034 
00035     rtos::Queue<BME280HumidityMessage,HUMIDITY_QUEUE_LENGHT>* queue;
00036 
00037     BME280* bme280;
00038     BME280_MODE bme280Mode;
00039 
00040     /**
00041      * @brief A thread safe method that measures the humidity. After measuring the humidity
00042      * it stores the humidity value inside a BME280HumidityMessage
00043      */
00044     void measure();
00045 
00046     /**
00047      * @brief Sets the message Queue of the Task where the measured values will be stored
00048      * after the measurement
00049      * @param queueHumidity the queue where the BME280Humidity will be stored
00050      */
00051     void setQueue(Queue<BME280HumidityMessage,HUMIDITY_QUEUE_LENGHT>* queueHumdity);
00052 
00053 };
00054 
00055 
00056 #endif /* TASKHUMIDITY_H_ */