firm newest

Dependencies:   MTS-Serial libmDot-dev-mbed5-deprecated

CommandTerminal/CmdDisplayStats.cpp

Committer:
nguyenhoang9x5555
Date:
2018-10-18
Revision:
0:3c869a8cb8f8

File content as of revision 0:3c869a8cb8f8:

#include "CmdDisplayStats.h"

CmdDisplayStats::CmdDisplayStats() :
  Command("Display Stats", "AT&S", "Display statistics", "TABLE") {

}

uint32_t CmdDisplayStats::action(std::vector<std::string> args) {

    mDot::mdot_stats stats = CommandTerminal::Dot()->getStats();

    CommandTerminal::Serial()->writef("Join Attempts:  %5lu\r\n", stats.Joins);
    CommandTerminal::Serial()->writef("Join Fails:     %5lu\r\n", stats.JoinFails);
    CommandTerminal::Serial()->writef("Up Packets:     %5lu\r\n", stats.Up);
    CommandTerminal::Serial()->writef("Down Packets:   %5lu\r\n", stats.Down);
    CommandTerminal::Serial()->writef("Missed Acks:    %5lu\r\n", stats.MissedAcks);
    CommandTerminal::Serial()->writef("CRC Errors:     %5lu\r\n", stats.CRCErrors);

    return 0;
}