luat_shell.h 696 B

123456789101112131415161718192021222324252627282930313233
  1. #ifndef LUAT_SHELL_H
  2. #define LUAT_SHELL_H
  3. #include "luat_base.h"
  4. #define LUAT_CMUX_CMD_INIT "AT+CMUX=1,0,5"
  5. typedef struct luat_shell
  6. {
  7. uint8_t echo_enable;
  8. uint8_t ymodem_enable;
  9. }luat_shell_t;
  10. typedef void (*luat_shell_cmd)(char* buff, size_t len);
  11. typedef struct luat_shell_cmd_reg
  12. {
  13. const char* prefix;
  14. luat_shell_cmd cmd;
  15. }luat_shell_cmd_reg_t;
  16. void luat_shell_write(char* buff, size_t len);
  17. void luat_shell_print(const char* str);
  18. char* luat_shell_read(size_t *len);
  19. void luat_shell_notify_recv(void);
  20. void luat_shell_notify_read(void);
  21. void luat_shell_exec(char* uart_buff, size_t rcount);
  22. // new shell
  23. void luat_shell_push(char* uart_buff, size_t rcount);
  24. #endif