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 22 08:03:32 2015 +0000
Revision:
12:26045241f50f
Parent:
2:8d8295a51f68
updated sx lib

Who changed what in which revision?

UserRevisionLine numberNew contents of line
WGorniak 2:8d8295a51f68 1 #include <cstdlib>
WGorniak 2:8d8295a51f68 2 #include "HelpCmd.h"
WGorniak 2:8d8295a51f68 3 #include "dbg.h"
WGorniak 2:8d8295a51f68 4 #include "Settings.h"
WGorniak 2:8d8295a51f68 5
WGorniak 2:8d8295a51f68 6 #include "CmdList.h"
WGorniak 2:8d8295a51f68 7
WGorniak 2:8d8295a51f68 8 HelpCmd::HelpCmd(Settings* settings)
WGorniak 2:8d8295a51f68 9 : Cmd()
WGorniak 2:8d8295a51f68 10 , settings_(settings)
WGorniak 2:8d8295a51f68 11 {
WGorniak 2:8d8295a51f68 12 }
WGorniak 2:8d8295a51f68 13
WGorniak 2:8d8295a51f68 14 HelpCmd::~HelpCmd()
WGorniak 2:8d8295a51f68 15 {
WGorniak 2:8d8295a51f68 16 }
WGorniak 2:8d8295a51f68 17
WGorniak 2:8d8295a51f68 18 string HelpCmd::cmd()
WGorniak 2:8d8295a51f68 19 {
WGorniak 2:8d8295a51f68 20 return "h";
WGorniak 2:8d8295a51f68 21 }
WGorniak 2:8d8295a51f68 22
WGorniak 2:8d8295a51f68 23 string HelpCmd::desc()
WGorniak 2:8d8295a51f68 24 {
WGorniak 2:8d8295a51f68 25 return "shows help";
WGorniak 2:8d8295a51f68 26 }
WGorniak 2:8d8295a51f68 27
WGorniak 2:8d8295a51f68 28 template <>
WGorniak 2:8d8295a51f68 29 void HelpCmd::help<int>()
WGorniak 2:8d8295a51f68 30 {
WGorniak 2:8d8295a51f68 31 }
WGorniak 2:8d8295a51f68 32
WGorniak 2:8d8295a51f68 33 template <typename cmds>
WGorniak 2:8d8295a51f68 34 void HelpCmd::help()
WGorniak 2:8d8295a51f68 35 {
WGorniak 2:8d8295a51f68 36 typedef typename cmds::t T;
WGorniak 2:8d8295a51f68 37
WGorniak 2:8d8295a51f68 38 printf(" %s: %s\r\n", T::cmd().c_str(), T::desc().c_str());
WGorniak 2:8d8295a51f68 39
WGorniak 2:8d8295a51f68 40 help<typename cmds::tn>(); // tail call recursion - optimized out (-O2)
WGorniak 2:8d8295a51f68 41 }
WGorniak 2:8d8295a51f68 42
WGorniak 2:8d8295a51f68 43 bool HelpCmd::execute(list<string> args)
WGorniak 2:8d8295a51f68 44 {
WGorniak 2:8d8295a51f68 45 printf("Terminal commands:\r\n");
WGorniak 2:8d8295a51f68 46 help<CmdList>();
WGorniak 2:8d8295a51f68 47 printf("\r\nButton starts ping-pong.\r\n\n");
WGorniak 2:8d8295a51f68 48 return true;
WGorniak 2:8d8295a51f68 49 }
WGorniak 2:8d8295a51f68 50
WGorniak 2:8d8295a51f68 51 string HelpCmd::getResponse(void)
WGorniak 2:8d8295a51f68 52 {
WGorniak 2:8d8295a51f68 53 return "";
WGorniak 2:8d8295a51f68 54 }
WGorniak 2:8d8295a51f68 55