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 * @file uBloxConfig.h
mitea1 0:f2815503561f 3 *
mitea1 0:f2815503561f 4 * @author Adrian
mitea1 0:f2815503561f 5 * @date 30.05.2016
mitea1 0:f2815503561f 6 *
mitea1 0:f2815503561f 7 */
mitea1 0:f2815503561f 8 #include <string>
mitea1 0:f2815503561f 9 #include <map>
mitea1 0:f2815503561f 10 #include <vector>
mitea1 0:f2815503561f 11 #include <stdint.h>
mitea1 0:f2815503561f 12 #ifndef UBLOXCONFIG_H_
mitea1 0:f2815503561f 13 #define UBLOXCONFIG_H_
mitea1 0:f2815503561f 14
mitea1 0:f2815503561f 15
mitea1 0:f2815503561f 16 #define UBLOX_DISABLE_ALL_STRING "DISABLE ALL STRINGS"
mitea1 0:f2815503561f 17 #define UBLOX_ENABLE_POSLLH_STRING "ENABLE POSLLH STRING"
mitea1 0:f2815503561f 18 #define UBLOX_GNSS_ON "GNSS ON"
mitea1 0:f2815503561f 19 #define UBLOX_GNSS_OFF "GNSS OFF"
mitea1 0:f2815503561f 20 #define UBLOX_CONTINUOUS_MODE "CONTINUOUS MODE"
mitea1 0:f2815503561f 21 #define UBLOX_POWER_SAVE_MODE "POWER SAVE MODE"
mitea1 0:f2815503561f 22 #define UBLOX_ECO_MODE "POWER SAVE MODE"
mitea1 0:f2815503561f 23
mitea1 0:f2815503561f 24 /**
mitea1 0:f2815503561f 25 * uBlox Modes. Modes define Sensor functionality
mitea1 0:f2815503561f 26 */
mitea1 0:f2815503561f 27 enum uBLOX_MODE{
mitea1 0:f2815503561f 28 uBLOX_MODE_0,//!< uBLOX_MODE_0
mitea1 0:f2815503561f 29 uBLOX_MODE_1,//!< uBLOX_MODE_1
mitea1 0:f2815503561f 30 uBLOX_MODE_2,//!< uBLOX_MODE_2
mitea1 0:f2815503561f 31 uBLOX_MODE_3,//!< uBLOX_MODE_3
mitea1 0:f2815503561f 32 };
mitea1 0:f2815503561f 33
mitea1 0:f2815503561f 34 /**
mitea1 0:f2815503561f 35 * @class uBloxConfig
mitea1 0:f2815503561f 36 * @brief A configuration container for the uBlox.
mitea1 0:f2815503561f 37 * All its configuration values are stored an held inside
mitea1 0:f2815503561f 38 * this Class. Depending on the uBLOX_MODE it sets all the configuration values.
mitea1 0:f2815503561f 39 */
mitea1 0:f2815503561f 40 class uBloxConfig {
mitea1 0:f2815503561f 41 public:
mitea1 0:f2815503561f 42 uBloxConfig();
mitea1 0:f2815503561f 43 virtual ~uBloxConfig();
mitea1 0:f2815503561f 44
mitea1 0:f2815503561f 45 /**
mitea1 0:f2815503561f 46 * @brief Generates a configuration according to the chosen uBLOX_MODE. More exactly it builds
mitea1 0:f2815503561f 47 * the strings that have to be sent at the initialization of the uBlox to run the uBlox to
mitea1 0:f2815503561f 48 * run it in a specific configuration
mitea1 0:f2815503561f 49 * @param desiredMode the mode to build the configuration according to
mitea1 0:f2815503561f 50 */
mitea1 0:f2815503561f 51 void build(uBLOX_MODE);
mitea1 0:f2815503561f 52
mitea1 0:f2815503561f 53 std::vector< std::vector<uint8_t> > getInitialConfigurationString();
mitea1 0:f2815503561f 54 private:
mitea1 0:f2815503561f 55
mitea1 0:f2815503561f 56 std::map<std::string,std::vector<uint8_t> > configCommands;
mitea1 0:f2815503561f 57 std::vector< std::vector<uint8_t> > initialCommands;
mitea1 0:f2815503561f 58
mitea1 0:f2815503561f 59 /**
mitea1 0:f2815503561f 60 * @brief Connects a command and its string that consists of Bytes
mitea1 0:f2815503561f 61 * @param command a command string describing the command
mitea1 0:f2815503561f 62 * @param string the content of the command
mitea1 0:f2815503561f 63 */
mitea1 0:f2815503561f 64 void connectCommandAndString(std::string command, uint8_t* string, uint8_t stringSize);
mitea1 0:f2815503561f 65
mitea1 0:f2815503561f 66
mitea1 0:f2815503561f 67 };
mitea1 0:f2815503561f 68
mitea1 0:f2815503561f 69 #endif /* UBLOXCONFIG_H_ */