18 typedef void (*
cmd_fun_t)(
char *outbuf,
int len,
int argc,
char **argv);
27 #define SECTION(x) __attribute__((section(x)))
28 #define USED __attribute__((used))
40 #define ALIOS_CLI_CMD_REGISTER(name, cmd, desc) \
41 const char __clisym_##cmd##_name[] SECTION(".rodata") = #cmd; \
42 const char __clisym_##cmd##_desc[] SECTION(".rodata") = #desc; \
43 static void name##_stub(char *buf, int len, int argc, char **argv) \
47 USED const struct cli_region __clisym_##cmd SECTION("CliRegion") = \
49 __clisym_##cmd##_name, \
50 __clisym_##cmd##_desc, \
51 (cli_region_func)&name##_stub};
int aos_cli_register_command(const struct cli_command *cmd)
This function register a command with the command-line interface
int aos_cli_init(void)
Initialize the CLI module
int aos_cli_suspend(void)
Suspend cli task
int aos_cli_resume(void)
Resume cli task
void(* cmd_fun_t)(char *outbuf, int len, int argc, char **argv)
int aos_cli_unregister_commands(const struct cli_command *cmds, int num)
This function unregisters multi CLI commands
int(* cli_region_func)(int argc, char **argv)
int aos_cli_printf(const char *fmt,...)
use aos_cli_printf instead of printf in cli cmd
int aos_cli_register_commands(const struct cli_command *cmds, int num)
This function register multi CLI commands
int aos_cli_unregister_command(const struct cli_command *cmd)
This function unregister a command from the command-line interface