Command Line Interface

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

Summary

Typedefs

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

Functions

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

Typedefs

otCliConsoleOutputCallback

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

This function pointer is called to notify about Console output.

Details
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.

Functions

otCliConsoleInit

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

Initialize the CLI CONSOLE module.

Details
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.

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

otCliPlatLogv

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

Callback to write the OpenThread Log to the CLI console.

Details
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.

otCliUartAppendResult

void otCliUartAppendResult(
  otError aError
)

Write error code to the CLI console.

Details
Parameters
[in] aError
Error code value.

otCliUartInit

void otCliUartInit(
  otInstance *aInstance
)

Initialize the CLI UART module.

Details
Parameters
[in] aInstance
The OpenThread instance structure.

otCliUartOutput

void otCliUartOutput(
  const char *aString,
  uint16_t aLength
)

Write string to the CLI console.

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

otCliUartOutputBytes

void otCliUartOutputBytes(
  const uint8_t *aBytes,
  uint8_t aLength
)

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

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

otCliUartOutputFormat

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

Write formatted string to the CLI console.

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

otCliUartSetUserCommands

void otCliUartSetUserCommands(
  const otCliCommand *aUserCommands,
  uint8_t aLength
)

Set a user command table.

Details
Parameters
[in] aUserCommands
A pointer to an array with user commands.
[in] aLength
aUserCommands length.