Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: MTS-Serial libmDot-mbed5
Fork of Dot-AT-Firmware by
Diff: CommandTerminal/CmdTimeOnAir.cpp
- Revision:
- 14:f9a77400b622
- Parent:
- 9:ff62b20f7000
--- a/CommandTerminal/CmdTimeOnAir.cpp Fri Nov 04 19:10:24 2016 +0000
+++ b/CommandTerminal/CmdTimeOnAir.cpp Fri Nov 04 14:25:43 2016 -0500
@@ -1,24 +1,17 @@
#include "CmdTimeOnAir.h"
-CmdTimeOnAir::CmdTimeOnAir(mDot* dot, mts::MTSSerial& serial)
-:
- Command(dot, "Time on air", "AT+TOA", "Get time in ms of packet tx with current datarate"),
- _serial(serial) {
- _help = std::string(text()) + ": " + std::string(desc());
- _usage = "(0-242)";
+CmdTimeOnAir::CmdTimeOnAir()
+: Command("Time on air", "AT+TOA", "Get time in ms of packet tx with current datarate", "(0-242)") {
_queryable = true;
}
uint32_t CmdTimeOnAir::action(std::vector<std::string> args) {
- if (_dot->getVerbose())
- _serial.writef("Time on air: ");
-
int bytes;
sscanf(args[1].c_str(), "%d", &bytes);
- _serial.writef("%lu\r\n", _dot->getTimeOnAir(bytes + 13));
+ CommandTerminal::Serial()->writef("%lu\r\n", CommandTerminal::Dot()->getTimeOnAir(bytes + 13));
return 0;
}
@@ -26,7 +19,7 @@
bool CmdTimeOnAir::verify(std::vector<std::string> args) {
if (args.size() < 2) {
- setErrorMessage("Invalid parameter, expects (0-242)");
+ CommandTerminal::setErrorMessage("Invalid parameter, expects (0-242)");
return false;
}
@@ -35,7 +28,7 @@
sscanf(args[1].c_str(), "%d", &bytes);
if (bytes < 0 || bytes > 242) {
- setErrorMessage("Invalid parameter, expects (0-242)");
+ CommandTerminal::setErrorMessage("Invalid parameter, expects (0-242)");
return false;
}
