Add ability to retrieve message and buffer counts for message queues. (#940)

This commit is contained in:
Jonathan Hui
2016-11-07 22:13:15 -08:00
committed by GitHub
parent b5c5079a6a
commit d44f39769f
12 changed files with 186 additions and 0 deletions
+22
View File
@@ -67,6 +67,7 @@ const struct Command Interpreter::sCommands[] =
{
{ "help", &Interpreter::ProcessHelp },
{ "blacklist", &Interpreter::ProcessBlacklist },
{ "bufferinfo", &Interpreter::ProcessBufferInfo },
{ "channel", &Interpreter::ProcessChannel },
{ "child", &Interpreter::ProcessChild },
{ "childmax", &Interpreter::ProcessChildMax },
@@ -303,6 +304,27 @@ exit:
AppendResult(error);
}
void Interpreter::ProcessBufferInfo(int argc, char *argv[])
{
otBufferInfo bufferInfo;
(void)argc;
(void)argv;
otGetMessageBufferInfo(mInstance, &bufferInfo);
sServer->OutputFormat("total: %d\r\n", bufferInfo.mTotalBuffers);
sServer->OutputFormat("free: %d\r\n", bufferInfo.mFreeBuffers);
sServer->OutputFormat("6lo send: %d %d\r\n", bufferInfo.m6loSendMessages, bufferInfo.m6loSendBuffers);
sServer->OutputFormat("6lo reas: %d %d\r\n", bufferInfo.m6loReassemblyMessages, bufferInfo.m6loReassemblyBuffers);
sServer->OutputFormat("ip6: %d %d\r\n", bufferInfo.mIp6Messages, bufferInfo.mIp6Buffers);
sServer->OutputFormat("mpl: %d %d\r\n", bufferInfo.mMplMessages, bufferInfo.mMplBuffers);
sServer->OutputFormat("mle: %d %d\r\n", bufferInfo.mMleMessages, bufferInfo.mMleBuffers);
sServer->OutputFormat("arp: %d %d\r\n", bufferInfo.mArpMessages, bufferInfo.mArpBuffers);
sServer->OutputFormat("coap: %d %d\r\n", bufferInfo.mCoapClientMessages, bufferInfo.mCoapClientBuffers);
AppendResult(kThreadError_None);
}
void Interpreter::ProcessChannel(int argc, char *argv[])
{
ThreadError error = kThreadError_None;