/******************************************************************************** * @brief provide an interactive user interface. * * The commands, set/show parameters, and prompt are configured at the project level. *******************************************************************************/ #ifndef _UIF_H_ #define _UIF_H_ /********************************************************************/ /* * Function prototypes */ char * get_line (char *); uint32 get_value (char *, int *, int); void run_cmd (void); int make_argv (char *, char **); void uif_cmd_help (int, char **); void uif_cmd_set (int, char **); void uif_cmd_show (int, char **); /* * Maximum command line arguments */ #define UIF_MAX_ARGS 10 /* * Maximum length of the command line */ #define UIF_MAX_LINE 80 /* * The command table entry data structure */ typedef const struct { char * cmd; /* command name user types, ie. GO */ int min_args; /* min num of args command accepts */ int max_args; /* max num of args command accepts */ int flags; /* command flags (e.g. repeat) */ void (*func)(int, char **); /* actual function to call */ char * description; /* brief description of command */ char * syntax; /* syntax of command */ } UIF_CMD; /* * Prototype and macro for size of the command table */ extern UIF_CMD UIF_CMDTAB[]; extern const int UIF_NUM_CMD; #define UIF_CMDTAB_SIZE (sizeof(UIF_CMDTAB)/sizeof(UIF_CMD)) #define UIF_CMD_FLAG_REPEAT 0x1 /* * Macros for User InterFace command table entries */ #ifndef UIF_CMD_HELP #define UIF_CMD_HELP \ {"help",0,1,0,uif_cmd_help,"Help",""}, #endif #ifndef UIF_CMD_SET #define UIF_CMD_SET \ {"set",0,2,0,uif_cmd_set,"Set Config","