diff --git a/include/openthread/cli.h b/include/openthread/cli.h index 3f2bf4226..b4ebb75b8 100644 --- a/include/openthread/cli.h +++ b/include/openthread/cli.h @@ -121,7 +121,7 @@ void otCliUartSetUserCommands(const otCliCommand *aUserCommands, uint8_t aLength void otCliUartOutputBytes(const uint8_t *aBytes, uint8_t aLength); /** - * Write formatted string the CLI console + * Write formatted string to the CLI console * * @param[in] aFmt A pointer to the format string. * @param[in] ... A matching list of arguments. @@ -129,7 +129,15 @@ void otCliUartOutputBytes(const uint8_t *aBytes, uint8_t aLength); void otCliUartOutputFormat(const char *aFmt, ...); /** - * Write error code the CLI console + * Write string to the CLI console + * + * @param[in] aString A pointer to the string, which may not be null-terminated. + * @param[in] aLength Number of bytes. + */ +void otCliUartOutput(const char *aString, uint16_t aLength); + +/** + * Write error code to the CLI console * * @param[in] aError Error code value. */ diff --git a/src/cli/cli_uart.cpp b/src/cli/cli_uart.cpp index 0e780b3e5..7d571c106 100644 --- a/src/cli/cli_uart.cpp +++ b/src/cli/cli_uart.cpp @@ -87,6 +87,11 @@ extern "C" void otCliUartOutputFormat(const char *aFmt, ...) va_end(aAp); } +extern "C" void otCliUartOutput(const char *aString, uint16_t aLength) +{ + Uart::sUartServer->Output(aString, aLength); +} + extern "C" void otCliUartAppendResult(otError aError) { Uart::sUartServer->GetInterpreter().AppendResult(aError);