Elmo Terminal provides functionality to test Lora radio and access SX1272 chip registers delivered with Elmo board. This firmware allows the user to control the LoRa radio parameters (eg. frequency, bandwidth, spreading factor etc.) by entering console commands via serial terminal. Application also contains "Ping-Pong" and data transmission functionalities.

Dependencies:   SX1272lib mbed

Fork of Elmo-Terminal by Michal Leksinski

Committer:
WGorniak
Date:
Thu Oct 01 09:40:30 2015 +0200
Revision:
2:8d8295a51f68
added terminal app

Who changed what in which revision?

UserRevisionLine numberNew contents of line
WGorniak 2:8d8295a51f68 1 #ifndef LIBRARIES_TESTS_RADIO_SETTINGS_VARIABLE_H_
WGorniak 2:8d8295a51f68 2 #define LIBRARIES_TESTS_RADIO_SETTINGS_VARIABLE_H_
WGorniak 2:8d8295a51f68 3
WGorniak 2:8d8295a51f68 4 #include "stdint.h"
WGorniak 2:8d8295a51f68 5 #include <string>
WGorniak 2:8d8295a51f68 6
WGorniak 2:8d8295a51f68 7 class Variable
WGorniak 2:8d8295a51f68 8 {
WGorniak 2:8d8295a51f68 9 public:
WGorniak 2:8d8295a51f68 10 struct ValueDescription
WGorniak 2:8d8295a51f68 11 {
WGorniak 2:8d8295a51f68 12 const int32_t value;
WGorniak 2:8d8295a51f68 13 const char* description;
WGorniak 2:8d8295a51f68 14
WGorniak 2:8d8295a51f68 15 bool isEndRange() const
WGorniak 2:8d8295a51f68 16 {
WGorniak 2:8d8295a51f68 17 return (description == 0) && !isEnd();
WGorniak 2:8d8295a51f68 18 }
WGorniak 2:8d8295a51f68 19
WGorniak 2:8d8295a51f68 20 bool isEnd() const
WGorniak 2:8d8295a51f68 21 {
WGorniak 2:8d8295a51f68 22 return (description == 0) && (value == 0);
WGorniak 2:8d8295a51f68 23 }
WGorniak 2:8d8295a51f68 24
WGorniak 2:8d8295a51f68 25 static ValueDescription end()
WGorniak 2:8d8295a51f68 26 {
WGorniak 2:8d8295a51f68 27 ValueDescription vd = {0,0};
WGorniak 2:8d8295a51f68 28 return vd;
WGorniak 2:8d8295a51f68 29 }
WGorniak 2:8d8295a51f68 30 };
WGorniak 2:8d8295a51f68 31
WGorniak 2:8d8295a51f68 32 static ValueDescription none[];
WGorniak 2:8d8295a51f68 33
WGorniak 2:8d8295a51f68 34 Variable();
WGorniak 2:8d8295a51f68 35
WGorniak 2:8d8295a51f68 36 bool endGuard() const;
WGorniak 2:8d8295a51f68 37
WGorniak 2:8d8295a51f68 38 static int32_t nonSetValue();
WGorniak 2:8d8295a51f68 39
WGorniak 2:8d8295a51f68 40 Variable(const char* name, const char* description, int32_t value, const ValueDescription* const pValueDescriptions);
WGorniak 2:8d8295a51f68 41
WGorniak 2:8d8295a51f68 42 std::string name() const;
WGorniak 2:8d8295a51f68 43
WGorniak 2:8d8295a51f68 44 std::string help() const;
WGorniak 2:8d8295a51f68 45
WGorniak 2:8d8295a51f68 46 std::string describe(int32_t value) const;
WGorniak 2:8d8295a51f68 47
WGorniak 2:8d8295a51f68 48 bool set(int32_t value);
WGorniak 2:8d8295a51f68 49
WGorniak 2:8d8295a51f68 50 int32_t get() const;
WGorniak 2:8d8295a51f68 51
WGorniak 2:8d8295a51f68 52 std::string describe() const;
WGorniak 2:8d8295a51f68 53
WGorniak 2:8d8295a51f68 54 private:
WGorniak 2:8d8295a51f68 55 const char* name_;
WGorniak 2:8d8295a51f68 56 const char* description_;
WGorniak 2:8d8295a51f68 57 const ValueDescription* const pValueDescriptions_;
WGorniak 2:8d8295a51f68 58 int32_t value_;
WGorniak 2:8d8295a51f68 59 };
WGorniak 2:8d8295a51f68 60
WGorniak 2:8d8295a51f68 61 #endif /* LIBRARIES_TESTS_RADIO_SETTINGS_VARIABLE_H_ */