[cli] add an API to write string to UART (#3365)

This commit is contained in:
Yakun Xu
2018-12-11 22:00:30 -08:00
committed by Jonathan Hui
parent edb7982f02
commit c281f284ff
2 changed files with 15 additions and 2 deletions
+10 -2
View File
@@ -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.
*/
+5
View File
@@ -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);