mirror of
https://github.com/espressif/openthread.git
synced 2026-07-08 13:20:25 +00:00
[debug] add debug uart (#2082)
This commit is contained in:
committed by
Jonathan Hui
parent
5c52373c99
commit
e937542990
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user