User Manual

 
 !"#$"$%
8
5.2. Add new command line function
The command line interface is extendable for user adding or modifying command
line functions. The adding function steps are:
i. Add new command line function body into cons_cmd.c.
ii. Add new data entry (contains function information) into command func-
tion table(cons_cmd_tbl.c).
After finishing these steps, we can type “hello” command to execute “cmd_hello”
const tCOMMAND atCmdTbl[] =
{ Data entry #n
{ “hello”, Command
(MyFunc)cmd_hello, Function name
“command line example”, Description
{ module”, (STRING_ARG | REQUIRED_ARG), Arguments and its
NULL, 0 Terminal property (string)
}
},
NULL
};
Ex:
void cmd_hello
( unsigned int iArgNum Number of argument
char * module)
{
c_printf(“\n\rHello %s!”, module);
}
AT-Command Interpreter ready
at$cons
cmd%>
at Internal AT command
ok
<
cmd% Command line function mode