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
CmdTimeOnAir.cpp
00001 #include "CmdTimeOnAir.h" 00002 00003 CmdTimeOnAir::CmdTimeOnAir() 00004 : Command("Time on air", "AT+TOA", "Get time in ms of packet tx with current datarate", "(0-242)") { 00005 _queryable = true; 00006 } 00007 00008 uint32_t CmdTimeOnAir::action(std::vector<std::string> args) { 00009 00010 int bytes; 00011 00012 sscanf(args[1].c_str(), "%d", &bytes); 00013 00014 CommandTerminal::Serial()->writef("%lu\r\n", CommandTerminal::Dot()->getTimeOnAir(bytes + 13)); 00015 00016 return 0; 00017 } 00018 00019 bool CmdTimeOnAir::verify(std::vector<std::string> args) { 00020 00021 if (args.size() < 2) { 00022 CommandTerminal::setErrorMessage("Invalid parameter, expects (0-242)"); 00023 return false; 00024 } 00025 00026 int bytes; 00027 00028 sscanf(args[1].c_str(), "%d", &bytes); 00029 00030 if (bytes < 0 || bytes > 242) { 00031 CommandTerminal::setErrorMessage("Invalid parameter, expects (0-242)"); 00032 return false; 00033 } 00034 00035 return true; 00036 }
Generated on Tue Jul 12 2022 20:40:04 by
