Elmo Terminal provides functionality to test Lora radio and access SX1272 chip registers delivered with Elmo board. Also contains example ping-pong application.
Dependencies: SX1272lib mbed-src
Settings/Variable.h@6:453b018a9ba0, 2015-10-01 (annotated)
- Committer:
- WGorniak
- Date:
- Thu Oct 01 13:13:08 2015 +0000
- Revision:
- 6:453b018a9ba0
- Parent:
- 2:8d8295a51f68
removed sstream from radiocontext
Who changed what in which revision?
User | Revision | Line number | New 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_ */ |