lora sensnode

Dependencies:   libmDot mbed-rtos mbed

Fork of mDot_LoRa_Sensornode by Adrian Mitevski

Committer:
socie123
Date:
Wed Aug 10 12:54:10 2016 +0000
Revision:
1:e67174cc4953
Parent:
0:f2815503561f
lora sensnode

Who changed what in which revision?

UserRevisionLine numberNew contents of line
mitea1 0:f2815503561f 1 /*
mitea1 0:f2815503561f 2 * ApplicationConfig.h
mitea1 0:f2815503561f 3 *
mitea1 0:f2815503561f 4 * Created on: Jun 3, 2016
mitea1 0:f2815503561f 5 * Author: Adrian
mitea1 0:f2815503561f 6 */
mitea1 0:f2815503561f 7 #include "BME280Config.h"
mitea1 0:f2815503561f 8 #include "MPU9250Config.h"
mitea1 0:f2815503561f 9 #include "uBloxConfig.h"
mitea1 0:f2815503561f 10 #include "MAX44009Config.h"
mitea1 0:f2815503561f 11 #include "SI1143Config.h"
mitea1 0:f2815503561f 12 #include "LoRaConfig.h"
mitea1 0:f2815503561f 13 #include "main.h"
mitea1 0:f2815503561f 14 #ifndef APPLICATIONCONFIG_H_
mitea1 0:f2815503561f 15 #define APPLICATIONCONFIG_H_
mitea1 0:f2815503561f 16
mitea1 0:f2815503561f 17 /**
mitea1 0:f2815503561f 18 * Application Modes. Modes define different Usages of the LoRa sensor node
mitea1 0:f2815503561f 19 */
mitea1 0:f2815503561f 20 enum APPLICATION_MODE {
mitea1 0:f2815503561f 21 APPLICATION_MODE_1, //!< APPLICATION_MODE_1
mitea1 0:f2815503561f 22 APPLICATION_MODE_2, //!< APPLICATION_MODE_2
mitea1 0:f2815503561f 23 APPLICATION_MODE_3, //!< APPLICATION_MODE_3
mitea1 0:f2815503561f 24 APPLICATION_MODE_4, //!< APPLICATION_MODE_4
mitea1 0:f2815503561f 25 APPLICATION_MODE_5, //!< APPLICATION_MODE_5
mitea1 0:f2815503561f 26 APPLICATION_MODE_6, //!< APPLICATION_MODE_6
mitea1 0:f2815503561f 27 APPLICATION_MODE_7, //!< APPLICATION_MODE_7
mitea1 0:f2815503561f 28 APPLICATION_MODE_8, //!< APPLICATION_MODE_8
mitea1 0:f2815503561f 29 APPLICATION_MODE_9, //!< APPLICATION_MODE_9
mitea1 0:f2815503561f 30 APPLICATION_MODE_10, //!< APPLICATION_MODE_10
mitea1 0:f2815503561f 31 APPLICATION_MODE_11, //!< APPLICATION_MODE_11
mitea1 0:f2815503561f 32 APPLICATION_MODE_99, //!< APPLICATION_MODE_99
mitea1 0:f2815503561f 33 APPLICATION_MODE_TEST, //!< APPLICATION_MODE_TEST
mitea1 0:f2815503561f 34 APPLICATION_MODE_TEST_MAX44009, //!< APPLICATION_MODE_TEST_MAX44009
mitea1 0:f2815503561f 35 APPLICATION_MODE_TEST_BME280, //!< APPLICATION_MODE_TEST_BME280
mitea1 0:f2815503561f 36 APPLICATION_MODE_TEST_MPU9250, //!< APPLICATION_MODE_TEST_MPU9250
mitea1 0:f2815503561f 37 APPLICATION_MODE_TEST_SI1143, //!< APPLICATION_MODE_TEST_SI1143
mitea1 0:f2815503561f 38 APPLICATION_MODE_TEST_uBlox, //!< APPLICATION_MODE_TEST_uBlox
mitea1 0:f2815503561f 39 APPLICATION_MODE_LORA_MEASUREMENT,//!< APPLICATION_MODE_LORA_MEASUREMENT
mitea1 0:f2815503561f 40 WEATHER_MEASUREMENT, //!< WEATHER_STATION
mitea1 0:f2815503561f 41 ORIENTATATION_MEASUREMENT, //!< ORIENTATATION_SENSOR
mitea1 0:f2815503561f 42 DISTANCE_MEASUREMENT, //!< DISTANCE_SENSOR
mitea1 0:f2815503561f 43 };
mitea1 0:f2815503561f 44
mitea1 0:f2815503561f 45
mitea1 0:f2815503561f 46 class ApplicationConfig {
mitea1 0:f2815503561f 47 public:
mitea1 0:f2815503561f 48 ApplicationConfig();
mitea1 0:f2815503561f 49 virtual ~ApplicationConfig();
mitea1 0:f2815503561f 50
mitea1 0:f2815503561f 51 /**
mitea1 0:f2815503561f 52 * @brief Generates a configuration according to the chosen APPLICATION_MODE
mitea1 0:f2815503561f 53 * @param desiredMode the mode to build the configuration according to
mitea1 0:f2815503561f 54 */
mitea1 0:f2815503561f 55 void build(APPLICATION_MODE desiredMode);
mitea1 0:f2815503561f 56
mitea1 0:f2815503561f 57
mitea1 0:f2815503561f 58 /**
mitea1 0:f2815503561f 59 * @brief Get Information about the MAX44009_MODE of the actual ApplicationConfig
mitea1 0:f2815503561f 60 * @return the actual MAX44009_MODE
mitea1 0:f2815503561f 61 */
mitea1 0:f2815503561f 62 MAX44009_MODE getMAX44009_MODE();
mitea1 0:f2815503561f 63
mitea1 0:f2815503561f 64 /**
mitea1 0:f2815503561f 65 * @brief Get Information about the BME280_MODE of the actual ApplicationConfig
mitea1 0:f2815503561f 66 * @return the actual BME280_MODE
mitea1 0:f2815503561f 67 */
mitea1 0:f2815503561f 68 BME280_MODE getBME280_MODE();
mitea1 0:f2815503561f 69
mitea1 0:f2815503561f 70 /**
mitea1 0:f2815503561f 71 * @brief Get Information about the MPU9250_MODE of the actual ApplicationConfig
mitea1 0:f2815503561f 72 * @return the actual MPU9250_MODE
mitea1 0:f2815503561f 73 */
mitea1 0:f2815503561f 74 MPU9250_MODE getMPU9250_MODE();
mitea1 0:f2815503561f 75
mitea1 0:f2815503561f 76 /**
mitea1 0:f2815503561f 77 * @brief Get Information about the SI1143_MODE of the actual ApplicationConfig
mitea1 0:f2815503561f 78 * @return the actual SI1143_MODE
mitea1 0:f2815503561f 79 */
mitea1 0:f2815503561f 80 SI1143_MODE getSI1143_MODE();
mitea1 0:f2815503561f 81
mitea1 0:f2815503561f 82 /**
mitea1 0:f2815503561f 83 * @brief Get Information about the uBLOX_MODE of the actual ApplicationConfig
mitea1 0:f2815503561f 84 * @return the actual uBLOX_MODE
mitea1 0:f2815503561f 85 */
mitea1 0:f2815503561f 86 uBLOX_MODE getuBlox_MODE();
mitea1 0:f2815503561f 87
mitea1 0:f2815503561f 88 /**
mitea1 0:f2815503561f 89 * @brief Get Information about the LORA_MODE of the actual ApplicationConfig
mitea1 0:f2815503561f 90 * @return the actual LORA_MODE
mitea1 0:f2815503561f 91 */
mitea1 0:f2815503561f 92 LORA_MODE getLORA_MODE();
mitea1 0:f2815503561f 93
mitea1 0:f2815503561f 94
mitea1 0:f2815503561f 95 /**
mitea1 0:f2815503561f 96 * @brief Get Information about the TASK_STATE of the TaskLight in the actual ApplicationConfig
mitea1 0:f2815503561f 97 * @return the actual TASK_STATE (RUNNING,SLEEPING) of TaskLight
mitea1 0:f2815503561f 98 */
mitea1 0:f2815503561f 99 TASK_STATE getStateTaskLight();
mitea1 0:f2815503561f 100
mitea1 0:f2815503561f 101 /**
mitea1 0:f2815503561f 102 * @brief Get Information about the TASK_STATE of the TaskTemperature in the actual ApplicationConfig
mitea1 0:f2815503561f 103 * @return the actual TASK_STATE (RUNNING,SLEEPING) of TaskTemperature
mitea1 0:f2815503561f 104 */
mitea1 0:f2815503561f 105 TASK_STATE getStateTaskTemperature();
mitea1 0:f2815503561f 106
mitea1 0:f2815503561f 107 /**
mitea1 0:f2815503561f 108 * @brief Get Information about the TASK_STATE of the TaskPressure in the actual ApplicationConfig
mitea1 0:f2815503561f 109 * @return the actual TASK_STATE (RUNNING,SLEEPING) of TaskPressure
mitea1 0:f2815503561f 110 */
mitea1 0:f2815503561f 111 TASK_STATE getStateTaskPressure();
mitea1 0:f2815503561f 112
mitea1 0:f2815503561f 113 /**
mitea1 0:f2815503561f 114 * @brief Get Information about the TASK_STATE of the TaskHumidity in the actual ApplicationConfig
mitea1 0:f2815503561f 115 * @return the actual TASK_STATE (RUNNING,SLEEPING) of TaskHumidity
mitea1 0:f2815503561f 116 */
mitea1 0:f2815503561f 117 TASK_STATE getStateTaskHumidity();
mitea1 0:f2815503561f 118
mitea1 0:f2815503561f 119 /**
mitea1 0:f2815503561f 120 * @brief Get Information about the TASK_STATE of the TaskAcceleration in the actual ApplicationConfig
mitea1 0:f2815503561f 121 * @return the actual TASK_STATE (RUNNING,SLEEPING) of TaskAcceleration
mitea1 0:f2815503561f 122 */
mitea1 0:f2815503561f 123 TASK_STATE getStateTaskAcceleration();
mitea1 0:f2815503561f 124
mitea1 0:f2815503561f 125 /**
mitea1 0:f2815503561f 126 * @brief Get Information about the TASK_STATE of the TaskGyroscope in the actual ApplicationConfig
mitea1 0:f2815503561f 127 * @return the actual TASK_STATE (RUNNING,SLEEPING) of TaskGyroscope
mitea1 0:f2815503561f 128 */
mitea1 0:f2815503561f 129 TASK_STATE getStateTaskGyroscope();
mitea1 0:f2815503561f 130
mitea1 0:f2815503561f 131 /**
mitea1 0:f2815503561f 132 * @brief Get Information about the TASK_STATE of the TaskTesla in the actual ApplicationConfig
mitea1 0:f2815503561f 133 * @return the actual TASK_STATE (RUNNING,SLEEPING) of TaskTesla
mitea1 0:f2815503561f 134 */
mitea1 0:f2815503561f 135 TASK_STATE getStateTaskTesla();
mitea1 0:f2815503561f 136
mitea1 0:f2815503561f 137 /**
mitea1 0:f2815503561f 138 * @brief Get Information about the TASK_STATE of the TaskProximity in the actual ApplicationConfig
mitea1 0:f2815503561f 139 * @return the actual TASK_STATE (RUNNING,SLEEPING) of TaskProximity
mitea1 0:f2815503561f 140 */
mitea1 0:f2815503561f 141 TASK_STATE getStateTaskProximity();
mitea1 0:f2815503561f 142
mitea1 0:f2815503561f 143 /**
mitea1 0:f2815503561f 144 * @brief Get Information about the TASK_STATE of the TaskGPS in the actual ApplicationConfig
mitea1 0:f2815503561f 145 * @return the actual TASK_STATE (RUNNING,SLEEPING) of TaskGPS
mitea1 0:f2815503561f 146 */
mitea1 0:f2815503561f 147 TASK_STATE getStateTaskGPS();
mitea1 0:f2815503561f 148
mitea1 0:f2815503561f 149 /**
mitea1 0:f2815503561f 150 * @brief Get Information about the TASK_STATE of the TaskLoRaMeasurement in the actual ApplicationConfig
mitea1 0:f2815503561f 151 * @return the actual TASK_STATE (RUNNING,SLEEPING) of TaskLoRaMeasurement
mitea1 0:f2815503561f 152 */
mitea1 0:f2815503561f 153 TASK_STATE getStateTaskLoRaMeasurement();
mitea1 0:f2815503561f 154
mitea1 0:f2815503561f 155 /**
mitea1 0:f2815503561f 156 * @brief Get Information about the LORA_STATE of the LoRa Module in the actual ApplicationConfig
mitea1 0:f2815503561f 157 * @return the actual LORA_STATE (ON,OFF) of TaskLoRaMeasurement
mitea1 0:f2815503561f 158 */
mitea1 0:f2815503561f 159 LORA_STATE getStateLoRa();
mitea1 0:f2815503561f 160
mitea1 0:f2815503561f 161 private:
mitea1 0:f2815503561f 162 MAX44009_MODE max44009Mode;
mitea1 0:f2815503561f 163 BME280_MODE bme280Mode;
mitea1 0:f2815503561f 164 MPU9250_MODE mpu9250Mode;
mitea1 0:f2815503561f 165 SI1143_MODE si1143Mode;
mitea1 0:f2815503561f 166 uBLOX_MODE ubloxMode;
mitea1 0:f2815503561f 167 LORA_MODE loraMode;
mitea1 0:f2815503561f 168
mitea1 0:f2815503561f 169 TASK_STATE stateTaskLight;
mitea1 0:f2815503561f 170 TASK_STATE stateTaskTemperature;
mitea1 0:f2815503561f 171 TASK_STATE stateTaskPressure;
mitea1 0:f2815503561f 172 TASK_STATE stateTaskHumidity;
mitea1 0:f2815503561f 173 TASK_STATE stateTaskAcceleration;
mitea1 0:f2815503561f 174 TASK_STATE stateTaskGyroscope;
mitea1 0:f2815503561f 175 TASK_STATE stateTaskTesla;
mitea1 0:f2815503561f 176 TASK_STATE stateTaskProximity;
mitea1 0:f2815503561f 177 TASK_STATE stateTaskGPS;
mitea1 0:f2815503561f 178 TASK_STATE stateTaskLoraMeasurement;
mitea1 0:f2815503561f 179
mitea1 0:f2815503561f 180 LORA_STATE stateLoRa;
mitea1 0:f2815503561f 181
mitea1 0:f2815503561f 182 /**
mitea1 0:f2815503561f 183 * @brief Sets the MAX44009_MODE for that the MAX44009 Sensor has to be initialized for the actual ApplicationConfig
mitea1 0:f2815503561f 184 * @param the diseredMode
mitea1 0:f2815503561f 185 */
mitea1 0:f2815503561f 186 void setMAX44009_MODE(MAX44009_MODE desiredMode);
mitea1 0:f2815503561f 187
mitea1 0:f2815503561f 188 /**
mitea1 0:f2815503561f 189 * @brief Sets the BME280_MODE for that the BME280 Sensor has to be initialized for the actual ApplicationConfig
mitea1 0:f2815503561f 190 * @param the diseredMode
mitea1 0:f2815503561f 191 */
mitea1 0:f2815503561f 192 void setBME280_MODE(BME280_MODE desiredMode);
mitea1 0:f2815503561f 193
mitea1 0:f2815503561f 194 /**
mitea1 0:f2815503561f 195 * @brief Sets the MPU9250_MODE for that the MPU9250 Sensor has to be initialized for the actual ApplicationConfig
mitea1 0:f2815503561f 196 * @param the diseredMode
mitea1 0:f2815503561f 197 */
mitea1 0:f2815503561f 198 void setMPU9250_MODE(MPU9250_MODE desiredMode);
mitea1 0:f2815503561f 199
mitea1 0:f2815503561f 200 /**
mitea1 0:f2815503561f 201 * @brief Sets the SI1143_MODE for that the SI1143 Sensor has to be initialized for the actual ApplicationConfig
mitea1 0:f2815503561f 202 * @param the diseredMode
mitea1 0:f2815503561f 203 */
mitea1 0:f2815503561f 204 void setSI1143_MODE(SI1143_MODE desiredMode);
mitea1 0:f2815503561f 205
mitea1 0:f2815503561f 206 /**
mitea1 0:f2815503561f 207 * @brief Sets the uBLOX_MODE for that the uBlox Sensor has to be initialized for the actual ApplicationConfig
mitea1 0:f2815503561f 208 * @param the diseredMode
mitea1 0:f2815503561f 209 */
mitea1 0:f2815503561f 210 void setuBlox_MODE(uBLOX_MODE desiredMode);
mitea1 0:f2815503561f 211
mitea1 0:f2815503561f 212 /**
mitea1 0:f2815503561f 213 * @brief Sets the LORA_MODE for that the LORA device has to be initialized for the actual ApplicationConfig
mitea1 0:f2815503561f 214 * @param the diseredMode
mitea1 0:f2815503561f 215 */
mitea1 0:f2815503561f 216 void setLORA_MODE(LORA_MODE desiredMode);
mitea1 0:f2815503561f 217
mitea1 0:f2815503561f 218
mitea1 0:f2815503561f 219 /**
mitea1 0:f2815503561f 220 * @brief Sets the TASK_STATE (RUNNING,SLEEPING) of TaskLight for the actual ApplicationConfig
mitea1 0:f2815503561f 221 * @param the desired State
mitea1 0:f2815503561f 222 */
mitea1 0:f2815503561f 223 void setStateTaskLight(TASK_STATE desiredState);
mitea1 0:f2815503561f 224
mitea1 0:f2815503561f 225 /**
mitea1 0:f2815503561f 226 * @brief Sets the TASK_STATE (RUNNING,SLEEPING) of TaskTemperature for the actual ApplicationConfig
mitea1 0:f2815503561f 227 * @param the desired State
mitea1 0:f2815503561f 228 */
mitea1 0:f2815503561f 229 void setStateTaskTemperature(TASK_STATE desiredState);
mitea1 0:f2815503561f 230
mitea1 0:f2815503561f 231 /**
mitea1 0:f2815503561f 232 * @brief Sets the TASK_STATE (RUNNING,SLEEPING) of TaskPressure for the actual ApplicationConfig
mitea1 0:f2815503561f 233 * @param the desired State
mitea1 0:f2815503561f 234 */
mitea1 0:f2815503561f 235 void setStateTaskPressure(TASK_STATE desiredState);
mitea1 0:f2815503561f 236
mitea1 0:f2815503561f 237 /**
mitea1 0:f2815503561f 238 * @brief Sets the TASK_STATE (RUNNING,SLEEPING) of TaskHumidity for the actual ApplicationConfig
mitea1 0:f2815503561f 239 * @param the desired State
mitea1 0:f2815503561f 240 */
mitea1 0:f2815503561f 241 void setStateTaskHumidity(TASK_STATE desiredState);
mitea1 0:f2815503561f 242
mitea1 0:f2815503561f 243 /**
mitea1 0:f2815503561f 244 * @brief Sets the TASK_STATE (RUNNING,SLEEPING) of TaskAcceleration for the actual ApplicationConfig
mitea1 0:f2815503561f 245 * @param the desired State
mitea1 0:f2815503561f 246 */
mitea1 0:f2815503561f 247 void setStateTaskAcceleration(TASK_STATE desiredState);
mitea1 0:f2815503561f 248
mitea1 0:f2815503561f 249 /**
mitea1 0:f2815503561f 250 * @brief Sets the TASK_STATE (RUNNING,SLEEPING) of TaskGyroscope for the actual ApplicationConfig
mitea1 0:f2815503561f 251 * @param the desired State
mitea1 0:f2815503561f 252 */
mitea1 0:f2815503561f 253 void setStateTaskGyroscope(TASK_STATE desiredState);
mitea1 0:f2815503561f 254
mitea1 0:f2815503561f 255 /**
mitea1 0:f2815503561f 256 * @brief Sets the TASK_STATE (RUNNING,SLEEPING) of TaskTesla for the actual ApplicationConfig
mitea1 0:f2815503561f 257 * @param the desired State
mitea1 0:f2815503561f 258 */
mitea1 0:f2815503561f 259 void setStateTaskTesla(TASK_STATE desiredState);
mitea1 0:f2815503561f 260
mitea1 0:f2815503561f 261 /**
mitea1 0:f2815503561f 262 * @brief Sets the TASK_STATE (RUNNING,SLEEPING) of TaskProximity for the actual ApplicationConfig
mitea1 0:f2815503561f 263 * @param the desired State
mitea1 0:f2815503561f 264 */
mitea1 0:f2815503561f 265 void setStateTaskProximity(TASK_STATE desiredState);
mitea1 0:f2815503561f 266
mitea1 0:f2815503561f 267 /**
mitea1 0:f2815503561f 268 * @brief Sets the TASK_STATE (RUNNING,SLEEPING) of TaskGPS for the actual ApplicationConfig
mitea1 0:f2815503561f 269 * @param the desired State
mitea1 0:f2815503561f 270 */
mitea1 0:f2815503561f 271 void setStateTaskGPS(TASK_STATE desiredState);
mitea1 0:f2815503561f 272
mitea1 0:f2815503561f 273 /**
mitea1 0:f2815503561f 274 * @brief Sets the TASK_STATE (RUNNING,SLEEPING) of TaskLoRaMeasurement for the actual ApplicationConfig
mitea1 0:f2815503561f 275 * @param the desired State
mitea1 0:f2815503561f 276 */
mitea1 0:f2815503561f 277 void setStateTaskLoRaMeasurement(TASK_STATE desiredState);
mitea1 0:f2815503561f 278 /**
mitea1 0:f2815503561f 279 * @brief Sets the LORA_STATE (ON,OFF) of LoRa Device for the actual ApplicationConfig
mitea1 0:f2815503561f 280 * @param the desired State
mitea1 0:f2815503561f 281 */
mitea1 0:f2815503561f 282 void setStateLoRa(LORA_STATE);
mitea1 0:f2815503561f 283
mitea1 0:f2815503561f 284 };
mitea1 0:f2815503561f 285
mitea1 0:f2815503561f 286 #endif /* APPLICATIONCONFIG_H_ */