* PARAMETERS
* kal_uint8 * cmd_string
* RETURNS
* none
*****************************************************************************/
void custom_command_hdlr(char *full_cmd_string)
{
char buffer[MAX_UART_LEN];
char cmd_name[15];
kal_uint8 index = 3; // we start parsing index after the CUSTOM_SYMBOL
kal_uint8 tmp_idx = 0;
while ((full_cmd_string[index] != '=' ) && //might be TEST command or EXE command
(full_cmd_string[index] != '?' ) && // might be READ command
(full_cmd_string[index] != 13 )) //carriage return
{
cmd_name[tmp_idx] = full_cmd_string[index] ;
tmp_idx ++;
index ++;
}
cmd_name[tmp_idx] = '\0' ;
/* just a very basic example : customer can implement their own */
文章来源于领测软件测试网 https://www.ltesting.net/