mirror of
https://github.com/espressif/openthread.git
synced 2026-07-08 13:20:25 +00:00
add mac layer counter (#90)
* add mac layer counter * add more counters and Doxygen for MAC counters * have a seperate counter for acked data transmission and refine the code based on the comments * refine counters for acked and unacked transmissions * fix check test error * refine code style and use VerifyOrExit to exit * move all events tracker to tx/rx done task, and add more counters * fix other error counter * refine counters structure to be clearer * add Doxygen for the added thread errors * fix conflicts
This commit is contained in:
@@ -52,6 +52,7 @@ const struct Command Interpreter::sCommands[] =
|
||||
{ "channel", &ProcessChannel },
|
||||
{ "childtimeout", &ProcessChildTimeout },
|
||||
{ "contextreusedelay", &ProcessContextIdReuseDelay },
|
||||
{ "counter", &ProcessCounters },
|
||||
{ "extaddr", &ProcessExtAddress },
|
||||
{ "extpanid", &ProcessExtPanId },
|
||||
{ "ipaddr", &ProcessIpAddr },
|
||||
@@ -217,6 +218,47 @@ exit:
|
||||
AppendResult(error);
|
||||
}
|
||||
|
||||
void Interpreter::ProcessCounters(int argc, char *argv[])
|
||||
{
|
||||
if (argc == 0)
|
||||
{
|
||||
sServer->OutputFormat("mac\r\n");
|
||||
sServer->OutputFormat("Done\r\n");
|
||||
}
|
||||
else
|
||||
{
|
||||
if (strcmp(argv[0], "mac") == 0)
|
||||
{
|
||||
const otMacCounters *counters = otGetMacCounters();
|
||||
sServer->OutputFormat("TxTotal: %d\r\n", counters->mTxTotal);
|
||||
sServer->OutputFormat(" TxAckRequested: %d\r\n", counters->mTxAckRequested);
|
||||
sServer->OutputFormat(" TxAcked: %d\r\n", counters->mTxAcked);
|
||||
sServer->OutputFormat(" TxNoAckRequested: %d\r\n", counters->mTxNoAckRequested);
|
||||
sServer->OutputFormat(" TxData: %d\r\n", counters->mTxData);
|
||||
sServer->OutputFormat(" TxDataPoll: %d\r\n", counters->mTxDataPoll);
|
||||
sServer->OutputFormat(" TxBeacon: %d\r\n", counters->mTxBeacon);
|
||||
sServer->OutputFormat(" TxBeaconRequest: %d\r\n", counters->mTxBeaconRequest);
|
||||
sServer->OutputFormat(" TxOther: %d\r\n", counters->mTxOther);
|
||||
sServer->OutputFormat(" TxRetry: %d\r\n", counters->mTxRetry);
|
||||
sServer->OutputFormat(" TxErrCca: %d\r\n", counters->mTxErrCca);
|
||||
sServer->OutputFormat("RxTotal: %d\r\n", counters->mRxTotal);
|
||||
sServer->OutputFormat(" RxData: %d\r\n", counters->mRxData);
|
||||
sServer->OutputFormat(" RxDataPoll: %d\r\n", counters->mRxDataPoll);
|
||||
sServer->OutputFormat(" RxBeacon: %d\r\n", counters->mRxBeacon);
|
||||
sServer->OutputFormat(" RxBeaconRequest: %d\r\n", counters->mRxBeaconRequest);
|
||||
sServer->OutputFormat(" RxOther: %d\r\n", counters->mRxOther);
|
||||
sServer->OutputFormat(" RxWhitelistFiltered: %d\r\n", counters->mRxWhitelistFiltered);
|
||||
sServer->OutputFormat(" RxDestAddrFiltered: %d\r\n", counters->mRxDestAddrFiltered);
|
||||
sServer->OutputFormat(" RxErrNoFrame: %d\r\n", counters->mRxErrNoFrame);
|
||||
sServer->OutputFormat(" RxErrNoUnknownNeighbor: %d\r\n", counters->mRxErrUnknownNeighbor);
|
||||
sServer->OutputFormat(" RxErrInvalidSrcAddr: %d\r\n", counters->mRxErrInvalidSrcAddr);
|
||||
sServer->OutputFormat(" RxErrSec: %d\r\n", counters->mRxErrSec);
|
||||
sServer->OutputFormat(" RxErrFcs: %d\r\n", counters->mRxErrFcs);
|
||||
sServer->OutputFormat(" RxErrOther: %d\r\n", counters->mRxErrOther);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void Interpreter::ProcessExtAddress(int argc, char *argv[])
|
||||
{
|
||||
const uint8_t *extAddress = otGetExtendedAddress();
|
||||
|
||||
Reference in New Issue
Block a user