smp_shell.h 622 B

12345678910111213141516171819202122232425262728293031323334
  1. #ifndef __SMP_SHELL_H__
  2. #define __SMP_SHELL_H__
  3. #include "stdint.h"
  4. #ifdef __cplusplus
  5. extern "C" {
  6. #endif
  7. #define SHELL_CMDLEN_MAX (128) // maximum string length of a command
  8. #define SHELL_ARGNUM_MAX (16) // maximum arg number of a command
  9. #define SHELL_FLAG_ARG_VLD (0x0001u)
  10. #define SHELL_FLAG_DEL_CH (0x0002u)
  11. #define SHELL_FLAG_ECHO_CH (0x0004u)
  12. typedef void (*cmd_func)(uint8_t argc, char **argv);
  13. typedef struct {
  14. char *name;
  15. char *help;
  16. cmd_func func;
  17. }Shell_Cmd_t;
  18. void ShellRxCh(uint8_t ch);
  19. void ShellHandler(void);
  20. #ifdef __cplusplus
  21. }
  22. #endif
  23. #endif