1 /* 2 * Copyright (C) 2015-2019 Alibaba Group Holding Limited 3 */ 4 5 #ifndef __AMP_REPL_H 6 #define __AMP_REPL_H 7 8 #include <stdint.h> 9 10 #ifdef __cplusplus 11 extern "C" { 12 #endif 13 14 #define REPL_OK 0 15 #define REPL_ERR_NOMEM -10000 16 #define REPL_ERR_DENIED -10001 17 #define REPL_ERR_INVALID -10002 18 #define REPL_ERR_BADCMD -10003 19 #define REPL_ERR_SYNTAX -10004 20 21 /* repl task stack size */ 22 #ifndef AMP_REPL_STACK_SIZE 23 #define REPL_STACK_SIZE 1024*4 24 #else 25 #define REPL_STACK_SIZE AMP_REPL_STACK_SIZE 26 #endif 27 28 #define REPL_INBUF_SIZE 256 29 #define REPL_OUTBUF_SIZE 1024 30 31 int32_t repl_printf(const char *buffer, ...); 32 int aos_repl_read(char *inbuf, uint32_t expected_length, uint32_t *recv_size); 33 int aos_repl_write(char *str); 34 void repl_read_task_start(void); 35 void aos_repl_init(void *arg); 36 37 #ifdef __cplusplus 38 } 39 #endif 40 41 #endif /* __AMP_REPL_H */ 42