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

MPU9250TeslaMessage.h

Go to the documentation of this file.
00001 /**
00002  * @file MPU9250TeslaMessage.h
00003  *
00004  * @author Adrian
00005  * @date 01.06.2016
00006  *
00007  */
00008 #include <stdio.h>
00009 #include <string>
00010 #include <vector>
00011 #include "SensorMessage.h "
00012 
00013 #ifndef MPU9250TESLAMESSAGE_H_
00014 #define MPU9250TESLAMESSAGE_H_
00015 
00016 #define MPU9250_X_TESLA_MESSAGE_ID      "M7"
00017 #define MPU9250_Y_TESLA_MESSAGE_ID      "M8"
00018 #define MPU9250_Z_TESLA_MESSAGE_ID      "M9"
00019 
00020 /**
00021  * @class MPU9250TeslaMessage
00022  * @brief A Container that can hold acquired tesla values from the MPU9250. The container will be
00023  * transported via a MessageQueue between different Tasks.
00024  */
00025 class MPU9250TeslaMessage: public SensorMessage {
00026 public:
00027     MPU9250TeslaMessage();
00028     virtual ~MPU9250TeslaMessage();
00029 
00030     /**
00031      * Sets the x-axis tesla value of the MPU9250TeslaMessage
00032      * @param xTesla x-axis tesla value to be stored
00033      */
00034     void setXTesla(float xTesla);
00035 
00036     /**
00037      * Sets the y-axis tesla value of the MPU9250TeslaMessage
00038      * @param yTesla y-axis tesla value to be stored
00039      */
00040     void setYTesla(float yTesla);
00041 
00042     /**
00043      * Sets the z-axis tesla value of the MPU9250TeslaMessage
00044      * @param zTesla z-axis tesla value to be stored
00045      */
00046     void setZTesla(float zTesla);
00047 
00048 
00049     /**
00050      * Gets the x-axis tesla value from the MPU9250TeslaMessage
00051      * @return
00052      */
00053     float getXTesla();
00054 
00055     /**
00056      * Gets the x-axis tesla value from the MPU9250TeslaMessage
00057      * @return
00058      */
00059     float getYTesla();
00060 
00061     /**
00062      * Gets the x-axis tesla value from the MPU9250TeslaMessage
00063      * @return
00064      */
00065     float getZTesla();
00066 
00067     /**
00068      * Gets a small LoRaMessage Type Formated String from the  MPU9250TeslaMessage.
00069      * This String can later be used for transportation via LoRa
00070      * @return
00071      */
00072     virtual char* getLoRaMessageString();
00073 
00074 private:
00075     std::string loraMessage;
00076     std::vector<std::string> loraMessageId;
00077 
00078     float xTesla;
00079     float yTesla;
00080     float zTesla;
00081 
00082 };
00083 
00084 
00085 #endif /* MPU9250TESLAMESSAGE_H_ */