Command Line Interface

This module includes functions that control the Thread stack's execution.

Classes

struct otCliCommand
This structure represents a CLI command.

Typedefs

typedef int(* otCliConsoleOutputCallback ) (const char *aBuf, uint16_t aBufLength, void *aContext)
This function pointer is called to notify about Console output.
typedef struct otCliCommand otCliCommand

Functions

void otCliConsoleInit ( otInstance *aInstance, otCliConsoleOutputCallback aCallback, void *aContext)
Initialize the CLI CONSOLE module.
void otCliConsoleInputLine (char *aBuf, uint16_t aBufLength)
This method is called to feed in a console input line.
void otCliUartInit ( otInstance *aInstance)
Initialize the CLI UART module.
void otCliSetUserCommands (const otCliCommand *aUserCommands, uint8_t aLength, void *aContext)
Set a user command table.
void otCliOutputBytes (const uint8_t *aBytes, uint8_t aLength)
Write a number of bytes to the CLI console as a hex string.
void otCliOutputFormat (const char *aFmt,...)
Write formatted string to the CLI console.
void otCliOutput (const char *aString, uint16_t aLength)
Write string to the CLI console.
void otCliAppendResult ( otError aError)
Write error code to the CLI console.
void otCliPlatLogv ( otLogLevel aLogLevel, otLogRegion aLogRegion, const char *aFormat, va_list aArgs)
Callback to write the OpenThread Log to the CLI console.
void otCliPlatLogLine ( otLogLevel aLogLevel, otLogRegion aLogRegion, const char *aLogLine)
Function to write the OpenThread Log to the CLI console.

Detailed Description

This module includes functions that control the Thread stack's execution.

Typedef Documentation

otCliConsoleOutputCallback

typedef int(* otCliConsoleOutputCallback) (const char *aBuf, uint16_t aBufLength, void *aContext)

This function pointer is called to notify about Console output.

Parameters
[in] aBuf A pointer to a buffer with an output.
[in] aBufLength A length of the output data stored in the buffer.
[out] aContext A user context pointer.
Returns
Number of bytes processed by the callback.

Function Documentation

otCliAppendResult()

void otCliAppendResult ( otError aError )

Write error code to the CLI console.

If the aError is OT_ERROR_PENDING nothing will be outputted.

Parameters
[in] aError Error code value.

otCliConsoleInit()

void otCliConsoleInit ( otInstance * aInstance,
otCliConsoleOutputCallback aCallback,
void * aContext
)

Initialize the CLI CONSOLE module.

Parameters
[in] aInstance The OpenThread instance structure.
[in] aCallback A callback method called to process console output.
[in] aContext A user context pointer.

otCliConsoleInputLine()

void otCliConsoleInputLine ( char * aBuf,
uint16_t aBufLength
)

This method is called to feed in a console input line.

Parameters
[in] aBuf A pointer to a buffer with an input.
[in] aBufLength A length of the input data stored in the buffer.

otCliOutput()

void otCliOutput ( const char * aString,
uint16_t aLength
)

Write string to the CLI console.

Parameters
[in] aString A pointer to the string, which may not be null-terminated.
[in] aLength Number of bytes.

otCliOutputBytes()

void otCliOutputBytes ( const uint8_t * aBytes,
uint8_t aLength
)

Write a number of bytes to the CLI console as a hex string.

Parameters
[in] aBytes A pointer to data which should be printed.
[in] aLength aBytes length.

otCliOutputFormat()

void otCliOutputFormat ( const char * aFmt,
...
)

Write formatted string to the CLI console.

Parameters
[in] aFmt A pointer to the format string.
[in] ... A matching list of arguments.

otCliPlatLogLine()

void otCliPlatLogLine ( otLogLevel aLogLevel,
otLogRegion aLogRegion,
const char * aLogLine
)

Function to write the OpenThread Log to the CLI console.

Parameters
[in] aLogLevel The log level.
[in] aLogRegion The log region.
[in] aLogLine A pointer to the log line string.

otCliPlatLogv()

void otCliPlatLogv ( otLogLevel aLogLevel,
otLogRegion aLogRegion,
const char * aFormat,
va_list aArgs
)

Callback to write the OpenThread Log to the CLI console.

Parameters
[in] aLogLevel The log level.
[in] aLogRegion The log region.
[in] aFormat A pointer to the format string.
[in] aArgs va_list matching aFormat.

otCliSetUserCommands()

void otCliSetUserCommands ( const otCliCommand * aUserCommands,
uint8_t aLength,
void * aContext
)

Set a user command table.

Parameters
[in] aUserCommands A pointer to an array with user commands.
[in] aLength aUserCommands length.
[in] aContext The context passed to the handler.

otCliUartInit()

void otCliUartInit ( otInstance * aInstance )

Initialize the CLI UART module.

Parameters
[in] aInstance The OpenThread instance structure.