[] syntaxhighlighter_viewsource syntaxhighlighter_copycode
const CLI_Command_Definition_t xTest =
{
"test", /* The command string to type. */
"test:test <cmd> \r\n\ /* The help of the cmd. */
'version' list the software vesion.\r\n\
'reboot' reboot now.\r\n",
prvTestCommand, /* The function to run. */
1 /* The num of param. */
};
[] syntaxhighlighter_viewsource syntaxhighlighter_copycode
/* Obtain the parameter string. */
pcParameter = FreeRTOS_CLIGetParameter \
(
pcCommandString, /* The command string itself. */
1, /* Return the first parameter. */
&lParameterStringLength /* Store the parameter string length. */
);
/* Sanity check something was returned. */
configASSERT( pcParameter );
if( strncmp( pcParameter, "version", strlen( "version" ) ) == 0 )
{
printf("%s\r\n",versions_tab);
}
else if( strncmp( pcParameter, "reboot", strlen( "reboot" ) ) == 0 )
{
printf("reboot now.\r\n");
HAL_NVIC_SystemReset();
}
else
{
sprintf( pcWriteBuffer," '%s' Is Not a Valid parameters\r\n",pcParameter);
}