altos: Make cmd echo per-connection instead of global
[fw/altos] / src / ao.h
index 64f33f0b2c18a938320204709cd7e1e9173373fa..9b375894e0f20cd4c41aeaf110b88bbaed52324e 100644 (file)
--- a/src/ao.h
+++ b/src/ao.h
@@ -403,6 +403,14 @@ ao_cmd_register(__code struct ao_cmds *cmds);
 void
 ao_cmd_init(void);
 
+#if HAS_CMD_FILTER
+/*
+ * Provided by an external module to filter raw command lines
+ */
+uint8_t
+ao_cmd_filter(void);
+#endif
+
 /*
  * ao_dma.c
  */
@@ -927,6 +935,9 @@ ao_serial_set_stdin(uint8_t stdin);
 void
 ao_serial_putchar(char c) __critical;
 
+void
+ao_serial_drain(void) __critical;
+
 #define AO_SERIAL_SPEED_4800   0
 #define AO_SERIAL_SPEED_9600   1
 #define AO_SERIAL_SPEED_19200  2
@@ -1167,13 +1178,21 @@ struct ao_stdio {
        char    (*pollchar)(void);
        void    (*putchar)(char c) __reentrant;
        void    (*flush)(void);
+       uint8_t echo;
 };
 
+extern __xdata struct ao_stdio ao_stdios[];
+extern __data int8_t ao_cur_stdio;
+extern __data int8_t ao_num_stdios;
+
 void
 flush(void);
 
 extern __xdata uint8_t ao_stdin_ready;
 
+uint8_t
+ao_echo(void);
+
 void
 ao_add_stdio(char (*pollchar)(void),
             void (*putchar)(char) __reentrant,