Disabling status messages means we don't need to filter them out of
the input stream.
Signed-off-by: Keith Packard <keithp@keithp.com>
int8_t ao_btm_stdio;
__xdata uint8_t ao_btm_connected;
int8_t ao_btm_stdio;
__xdata uint8_t ao_btm_connected;
-void
-ao_btm_putchar(char c);
-
#define AO_BTM_MAX_REPLY 16
__xdata char ao_btm_reply[AO_BTM_MAX_REPLY];
#define AO_BTM_MAX_REPLY 16
__xdata char ao_btm_reply[AO_BTM_MAX_REPLY];
ao_stdios[ao_btm_stdio].echo = echo;
}
ao_stdios[ao_btm_stdio].echo = echo;
}
-/*
- * A command line pre-processor to detect connect/disconnect messages
- * and update the internal state
- */
-
-uint8_t
-ao_cmd_filter(void)
-{
- if (ao_cur_stdio != ao_btm_stdio)
- return 0;
- ao_cmd_lex();
- while (ao_cmd_lex_c != '\n') {
- if (ao_match_word("CONNECT"))
- return 1;
- if (ao_match_word("DISCONNECT"))
- return 1;
- if (ao_match_word("ERROR"))
- return 1;
- if (ao_match_word("OK"))
- return 1;
- ao_cmd_lex();
- }
- ao_cmd_status = 0;
- return 0;
-}
-
/*
* Delay between command charaters; the BT module
* can't keep up with 57600 baud
/*
* Delay between command charaters; the BT module
* can't keep up with 57600 baud
for (;;) {
while (!ao_btm_connected)
ao_sleep(&ao_btm_connected);
for (;;) {
while (!ao_btm_connected)
ao_sleep(&ao_btm_connected);
-#if HAS_CMD_FILTER
- if (ao_cmd_filter())
- continue;
- cmd_i = 0;
-#endif
ao_cmd_lex();
ao_cmd_white();
c = ao_cmd_lex_c;
ao_cmd_lex();
ao_cmd_white();
c = ao_cmd_lex_c;
#define HAS_BEEP 0
#define HAS_SERIAL_1 1
#define USE_SERIAL_STDIN 1
#define HAS_BEEP 0
#define HAS_SERIAL_1 1
#define USE_SERIAL_STDIN 1
- #define HAS_CMD_FILTER 1
#define HAS_ADC 0
#define HAS_DBG 1
#define HAS_EEPROM 0
#define HAS_ADC 0
#define HAS_DBG 1
#define HAS_EEPROM 0