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

LoRaMeasuermentMessage.h

Go to the documentation of this file.
00001 /**
00002  * @file LoRaMeasuermentMessage.h
00003  *
00004  * @author Adrian
00005  * @date 13.06.2016
00006  */
00007 
00008 #ifndef APP_LORAMEASUERMENTMESSAGE_H_
00009 #define APP_LORAMEASUERMENTMESSAGE_H_
00010 
00011 #include <stdio.h>
00012 #include <stdint.h>
00013 #include <string>
00014 #include <vector>
00015 #include "SensorMessage.h "
00016 
00017 /**
00018  * @class LoRaMeasurementMessage
00019  * @brief A Container that can hold acquired measurement values such as Rssi, Snr and some other config values from the LoRa Module.
00020  * The container will be transported via a MessageQueue between different Tasks and its intended to stored measurement results.
00021  */
00022 class LoRaMeasurementMessage: public SensorMessage {
00023 public:
00024     LoRaMeasurementMessage();
00025     virtual ~LoRaMeasurementMessage();
00026 
00027 
00028     /**
00029      * @brief Sets the rssi value of the LoRaMeasurementMessage
00030      * @param rssi rssi value to be stored
00031      */
00032     void setRssi(int16_t rssi);
00033 
00034     /**
00035      * @brief Gets the stored rssi value of the LoRaMeasurmentMessage
00036      * @return
00037      */
00038     int16_t getRssi();
00039 
00040     /**
00041      * @brief Sets the snr value of the LoRaMeasurementMessage
00042      * @param snr snr value to be stored
00043      */
00044     void setSnr(int16_t snr);
00045 
00046     /**
00047      * @brief Gets the stored snr value of the LoRaMeasurementMessage
00048      * @return
00049      */
00050     int16_t getSnr();
00051 
00052     /**
00053      * @brief Sets the spreadingFactor of the LoRaMeasurementMessage
00054      * @param spreadingFactor spreading Factor to be stored
00055      */
00056     void setSpreadingFactor(uint8_t spreadingFactor);
00057 
00058     /**
00059      * @brief Gets the stored spreading Factor of the LoRaMeasurementMessage
00060      * @return
00061      */
00062     uint8_t getSpreadingFactor();
00063 
00064     /**
00065      * @brief Sets the tx Power value in dBm of the LoRaMeasurementMessage
00066      * @param txPowerdBm tx Power in dBm to be stored
00067      */
00068     void setTxPowerdBm(uint8_t txPowerdBm);
00069 
00070     /**
00071      * @breif Gets the stored tx Power in dBm of the LoRaMeasurementMessage
00072      * @return
00073      */
00074     uint8_t getTxPowerdBm();
00075 
00076     /**
00077      * Gets a small LoRaMessage Type Formated String from the LoRaMeasurmentMessage.
00078      * This String can later be used for transportation via LoRa
00079      * @return
00080      */
00081     virtual char* getLoRaMessageString();
00082 
00083 private:
00084     std::string loraMessage;
00085     std::vector<std::string> loraMessageId;
00086 
00087     int16_t rssi;
00088     int16_t snr;
00089     uint8_t spreadingFactor;
00090     uint8_t txPowerdBm;
00091 
00092 
00093 };
00094 
00095 #endif /* APP_LORAMEASUERMENTMESSAGE_H_ */