Co-processor Remote Procedure Call

This module includes functions that allow a Host processor to execute remote procedure calls on a co-processor over spinel.

Functions

void otCliAppendResult ( otError aError)
Append an error code to the output buffer.
void otCliSetUserCommandError ( otError aError)
This method sets the user command error.
otError otCRPCHandleCommand (void *aContext, uint8_t aArgsLength, char *aArgs[], uint8_t aCommandsLength, const otCliCommand aCommands[])
Call the corresponding handler for a command.
void otCliOutputBytes (const uint8_t *aBytes, uint8_t aLength)
Output a byte array as hex to the output buffer.
void otCliOutputCommands (const otCliCommand aCommands[], size_t aCommandsLength)
Write all command names in aCommands to the output buffer.
int otCliOutputFormatV (const char *aFormat, va_list aArguments)
Write formatted output to the output buffer.
void otCliOutputFormat (const char *aFmt,...)
Write formatted string to the output buffer.
int otCliOutputIp6Address (const otIp6Address *aAddress)
Write an IPv6 address to the output buffer.
otError otCRPCProcessCmd (uint8_t aArgsLength, char *aArgs[], char *aOutput, size_t aOutputMaxLen)
Process a command line.
void otCRPCProcessCmdLine (const char *aString, char *aOutput, size_t aOutputMaxLen)
Process a command-line string.
void otCRPCProcessHelp (void *aContext, uint8_t aArgsLength, char *aArgs[])
Output all available CRPC built-in commands and user commands.
void otCRPCSetUserCommands (const otCliCommand *aUserCommands, uint8_t aLength, void *aContext)
Set a user command table.

Detailed Description

This module includes functions that allow a Host processor to execute remote procedure calls on a co-processor over spinel.

Function Documentation

otCliAppendResult()

void otCliAppendResult ( otError aError )

Append an error code to the output buffer.

Parameters
[in] aError

otCliOutputBytes()

void otCliOutputBytes ( const uint8_t * aBytes,
uint8_t aLength
)

Output a byte array as hex to the output buffer.

Parameters
[in] aBytes Bytes to output
[in] aLength Number of bytes

otCliOutputCommands()

void otCliOutputCommands ( const otCliCommand aCommands[],
size_t aCommandsLength
)

Write all command names in aCommands to the output buffer.

Parameters
[in] aCommands an array of commands
[in] aCommandsLength length of aCommands

otCliOutputFormat()

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

Write formatted string to the output buffer.

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

otCliOutputFormatV()

int otCliOutputFormatV ( const char * aFormat,
va_list aArguments
)

Write formatted output to the output buffer.

Parameters
[in] aFormat A pointer to the format string.
[in] aArguments A variable list of arguments for format.
Returns
The number of bytes placed in the output buffer.

otCliOutputIp6Address()

int otCliOutputIp6Address ( const otIp6Address * aAddress )

Write an IPv6 address to the output buffer.

Parameters
[in] aAddress A pointer to the IPv6 address.
Returns
The number of bytes placed in the output queue.
Return values
-1 Driver is broken.

otCliSetUserCommandError()

void otCliSetUserCommandError ( otError aError )

This method sets the user command error.

Parameters
[in] aError An error

otCRPCHandleCommand()

otError otCRPCHandleCommand ( void * aContext,
uint8_t aArgsLength,
char * aArgs[],
uint8_t aCommandsLength,
const otCliCommand aCommands[]
)

Call the corresponding handler for a command.

This function will look through aCommands to find a command that matches aArgs [0]. If found, the handler function for the command will be called with the remaining args passed to it.

Parameters
[in] aContext a context
[in] aArgsLength number of args
[in] aArgs list of args
[in] aCommandsLength number of commands in aCommands
[in] aCommands list of commands
Return values

otCRPCProcessCmd()

otError otCRPCProcessCmd ( uint8_t aArgsLength,
char * aArgs[],
char * aOutput,
size_t aOutputMaxLen
)

Process a command line.

Parameters
[in] aArgsLength The number of elements in aArgs .
[in] aArgs An array of arguments.
[out] aOutput The execution result.
[in] aOutputMaxLen The output buffer size.
Return values
OT_ERROR_INVALID_ARGS The command is supported but invalid arguments provided.
OT_ERROR_NONE The command is successfully process.
OT_ERROR_NOT_IMPLEMENTED The command is not supported.

otCRPCProcessCmdLine()

void otCRPCProcessCmdLine ( const char * aString,
char * aOutput,
size_t aOutputMaxLen
)

Process a command-line string.

Parameters
[in] aString A NULL-terminated input string.
[out] aOutput The execution result.
[in] aOutputMaxLen The output buffer size.

otCRPCProcessHelp()

void otCRPCProcessHelp ( void * aContext,
uint8_t aArgsLength,
char * aArgs[]
)

Output all available CRPC built-in commands and user commands.

Parameters
aContext
aArgsLength
aArgs

otCRPCSetUserCommands()

void otCRPCSetUserCommands ( 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.