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 libxDot-dev-mbed5-deprecated
Fork of Dot-AT-Firmware by
CommandTerminal/CmdSnr.cpp
- Committer:
- Mike Fiore
- Date:
- 2016-04-04
- Revision:
- 9:ff62b20f7000
- Parent:
- 1:e52ae6584f1c
- Child:
- 14:f9a77400b622
File content as of revision 9:ff62b20f7000:
#include "CmdSnr.h"
CmdSnr::CmdSnr(mDot* dot, mts::MTSSerial& serial) :
Command(dot, "Signal To Noise Ratio", "AT+SNR", "Display signal to noise ratio of received packets: last, min, max, avg in dB"),
_serial(serial)
{
_help = std::string(text()) + ": " + std::string(desc());
_usage = "(-20.0-20.0),(-20.0-20.0),(-20.0-20.0),(-20.0-20.0)";
_queryable = true;
}
uint32_t CmdSnr::action(std::vector<std::string> args)
{
mDot::snr_stats stats = _dot->getSnrStats();
if (_dot->getVerbose())
_serial.writef("SNR stats: ");
_serial.writef("%d.%d, %d.%d, %d.%d, %d.%d\r\n", stats.last / 10, abs(stats.last % 10), stats.min / 10, abs(stats.min % 10), stats.max / 10, abs(stats.max % 10), stats.avg / 10, abs(stats.avg % 10));
return 0;
}
