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 TaskPressure.h Source File

TaskPressure.h

Go to the documentation of this file.
00001 /**
00002  * @file TaskPressure.h
00003  *
00004  * @author Adrian
00005  * @date 30.05.2016
00006  *
00007  */
00008 
00009 #include "BME280.h"
00010 #include "BME280PressureMessage.h "
00011 #include "main.h"
00012 #include "Task.h"
00013 
00014 #ifndef TASKPRESSURE_H_
00015 #define TASKPRESSURE_H_
00016 
00017 /**
00018  * @class TaskPressure
00019  * @brief This TaskPressure Class handles the pressure 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 TaskPressure : public Task {
00025 public:
00026     TaskPressure(BME280*,Mutex*, Queue<BME280PressureMessage,PRESSURE_QUEUE_LENGHT>*);
00027     TaskPressure(BME280*,Mutex*,Queue<BME280PressureMessage,PRESSURE_QUEUE_LENGHT>*,
00028             osPriority, uint32_t, unsigned char*);
00029     virtual ~TaskPressure();
00030 
00031 private:
00032     rtos::Queue<BME280PressureMessage,PRESSURE_QUEUE_LENGHT>* queue;
00033     BME280* bme280;
00034 
00035     /**
00036      * @brief A thread safe method that measures the actual pressure. After measuring the pressure
00037      * it stores the value inside a BME280PressureMessage
00038      */
00039     void measure();
00040 
00041     /**
00042      * @brief Sets the message Queue of the Task where the measured values will be stored
00043      * after the measurement
00044      * @param queuePressure the queue where the BME280PressureMessage will be stored
00045      */
00046     void setQueue(Queue<BME280PressureMessage,PRESSURE_QUEUE_LENGHT>* queuePressure);
00047 };
00048 
00049 #endif /* TASKPRESSURE_H_ */