mDot AT-Firmware for testing

Dependencies:   MTS-Serial libmDot-mbed5

Fork of Dot-AT-Firmware by MultiTech

Revision:
14:f9a77400b622
Parent:
9:ff62b20f7000
diff -r b0f5ae12dc05 -r f9a77400b622 CommandTerminal/CmdRssi.cpp
--- a/CommandTerminal/CmdRssi.cpp	Fri Nov 04 19:10:24 2016 +0000
+++ b/CommandTerminal/CmdRssi.cpp	Fri Nov 04 14:25:43 2016 -0500
@@ -1,23 +1,15 @@
 #include "CmdRssi.h"
 
-CmdRssi::CmdRssi(mDot* dot, mts::MTSSerial& serial) :
-        Command(dot, "Signal Strength", "AT+RSSI", "Displays signal strength information for received packets: last, min, max, avg in dB"),
-        _serial(serial)
+CmdRssi::CmdRssi() :
+        Command("Signal Strength", "AT+RSSI", "Displays signal strength information for received packets: last, min, max, avg in dB", "(-140-0),(-140-0),(-140-0),(-140-0)")
 {
-    _help = std::string(text()) + ": " + std::string(desc());
-    _usage = "(-140-0),(-140-0),(-140-0),(-140-0)";
     _queryable = true;
 }
 
 uint32_t CmdRssi::action(std::vector<std::string> args)
 {
-    mDot::rssi_stats stats = _dot->getRssiStats();
-
-    if (_dot->getVerbose())
-        _serial.writef("RSSI stats: ");
-
-    _serial.writef("%d, %d, %d, %d\r\n", stats.last, stats.min, stats.max, stats.avg);
-
+    mDot::rssi_stats stats = CommandTerminal::Dot()->getRssiStats();
+    CommandTerminal::Serial()->writef("%d, %d, %d, %d\r\n", stats.last, stats.min, stats.max, stats.avg);
     return 0;
 }