[debug] add debug uart (#2082)

This commit is contained in:
DuaneEllis-TI
2017-08-24 10:28:01 -07:00
committed by Jonathan Hui
parent 5c52373c99
commit e937542990
82 changed files with 1456 additions and 187 deletions
+28
View File
@@ -77,6 +77,10 @@
#include "cli_coap.hpp"
#endif
#if (OPENTHREAD_CONFIG_LOG_OUTPUT == OPENTHREAD_CONFIG_LOG_OUTPUT_DEBUG_UART) && OPENTHREAD_EXAMPLES_POSIX
#include <openthread/platform/debug_uart.h>
#endif
#include "common/encoding.hpp"
using ot::Encoding::BigEndian::HostSwap16;
@@ -124,6 +128,9 @@ const struct Command Interpreter::sCommands[] =
{ "eui64", &Interpreter::ProcessEui64 },
#ifdef OPENTHREAD_EXAMPLES_POSIX
{ "exit", &Interpreter::ProcessExit },
#endif
#if (OPENTHREAD_CONFIG_LOG_OUTPUT == OPENTHREAD_CONFIG_LOG_OUTPUT_DEBUG_UART) && OPENTHREAD_EXAMPLES_POSIX
{ "logfilename", &Interpreter::ProcessLogFilename },
#endif
{ "extaddr", &Interpreter::ProcessExtAddress },
{ "extpanid", &Interpreter::ProcessExtPanId },
@@ -907,6 +914,27 @@ void Interpreter::ProcessExit(int argc, char *argv[])
}
#endif
#if (OPENTHREAD_CONFIG_LOG_OUTPUT == OPENTHREAD_CONFIG_LOG_OUTPUT_DEBUG_UART) && OPENTHREAD_EXAMPLES_POSIX
void Interpreter::ProcessLogFilename(int argc, char *argv[])
{
otError error = OT_ERROR_NONE;
if (argc == 1)
{
error = otPlatDebugUart_logfile(argv[0]);
SuccessOrExit(error);
}
else
{
error = OT_ERROR_PARSE;
}
exit:
AppendResult(error);
}
#endif
void Interpreter::ProcessExtPanId(int argc, char *argv[])
{
otError error = OT_ERROR_NONE;