mirror of
https://github.com/espressif/openthread.git
synced 2026-07-08 13:20:25 +00:00
[cli] refine CLI APIs (#3501)
This commit is contained in:
+43
-1
@@ -73,7 +73,6 @@
|
||||
#endif
|
||||
|
||||
#include "cli_dataset.hpp"
|
||||
#include "cli_uart.hpp"
|
||||
|
||||
#if OPENTHREAD_ENABLE_APPLICATION_COAP
|
||||
#include "cli_coap.hpp"
|
||||
@@ -95,6 +94,7 @@
|
||||
#include <openthread/platform/debug_uart.h>
|
||||
#endif
|
||||
|
||||
#include "cli_server.hpp"
|
||||
#include "common/encoding.hpp"
|
||||
|
||||
using ot::Encoding::BigEndian::HostSwap16;
|
||||
@@ -3902,5 +3902,47 @@ Interpreter &Interpreter::GetOwner(OwnerLocator &aOwnerLocator)
|
||||
return interpreter;
|
||||
}
|
||||
|
||||
extern "C" void otCliSetUserCommands(const otCliCommand *aUserCommands, uint8_t aLength)
|
||||
{
|
||||
Server::sServer->GetInterpreter().SetUserCommands(aUserCommands, aLength);
|
||||
}
|
||||
|
||||
extern "C" void otCliOutputBytes(const uint8_t *aBytes, uint8_t aLength)
|
||||
{
|
||||
Server::sServer->GetInterpreter().OutputBytes(aBytes, aLength);
|
||||
}
|
||||
|
||||
extern "C" void otCliOutputFormat(const char *aFmt, ...)
|
||||
{
|
||||
va_list aAp;
|
||||
va_start(aAp, aFmt);
|
||||
Server::sServer->OutputFormatV(aFmt, aAp);
|
||||
va_end(aAp);
|
||||
}
|
||||
|
||||
extern "C" void otCliOutput(const char *aString, uint16_t aLength)
|
||||
{
|
||||
Server::sServer->Output(aString, aLength);
|
||||
}
|
||||
|
||||
extern "C" void otCliAppendResult(otError aError)
|
||||
{
|
||||
Server::sServer->GetInterpreter().AppendResult(aError);
|
||||
}
|
||||
|
||||
extern "C" void otCliPlatLogv(otLogLevel aLogLevel, otLogRegion aLogRegion, const char *aFormat, va_list aArgs)
|
||||
{
|
||||
OT_UNUSED_VARIABLE(aLogLevel);
|
||||
OT_UNUSED_VARIABLE(aLogRegion);
|
||||
|
||||
VerifyOrExit(Server::sServer != NULL);
|
||||
|
||||
Server::sServer->OutputFormatV(aFormat, aArgs);
|
||||
Server::sServer->OutputFormat("\r\n");
|
||||
|
||||
exit:
|
||||
return;
|
||||
}
|
||||
|
||||
} // namespace Cli
|
||||
} // namespace ot
|
||||
|
||||
Reference in New Issue
Block a user