diff options
| author | Keith Packard <keithp@keithp.com> | 2011-04-19 13:27:40 -0700 | 
|---|---|---|
| committer | Keith Packard <keithp@keithp.com> | 2011-04-19 13:27:40 -0700 | 
| commit | ce7cf0c5ddc5405f6f474f4e20752fc0b02f3ecb (patch) | |
| tree | bc199db19cbebac6b902e3fc49afeb21538504b5 | |
| parent | e3d501940718428135e04995dff7fef691c08a20 (diff) | |
altos: Simplify BT communications
Eliminate stdio I/O wrappers
Signed-off-by: Keith Packard <keithp@keithp.com>
| -rw-r--r-- | src/ao_btm.c | 23 | 
1 files changed, 5 insertions, 18 deletions
diff --git a/src/ao_btm.c b/src/ao_btm.c index 784a566f..6ba5eb1a 100644 --- a/src/ao_btm.c +++ b/src/ao_btm.c @@ -143,29 +143,16 @@ ao_cmd_filter(void)  }  /* - * A wrapper for ao_serial_pollchar that - * doesn't return any characters while we're - * initializing the bluetooth device + * Delay between command charaters; the BT module + * can't keep up with 57600 baud   */ -char -ao_btm_pollchar(void) -{ -	char	c; -	if (!ao_btm_running) -		return AO_READ_AGAIN; -	c = ao_serial_pollchar(); -	if (c != AO_READ_AGAIN) -		ao_btm_log_in_char(c); -	return c; -}  void  ao_btm_putchar(char c)  {  	ao_btm_log_out_char(c);  	ao_serial_putchar(c); -	if (!ao_btm_running) -		ao_delay(1); +	ao_delay(1);  }  /* @@ -270,8 +257,8 @@ ao_btm(void)  	/* Turn off status reporting */  	ao_btm_cmd("ATQ1\r"); -	ao_btm_stdio = ao_add_stdio(ao_btm_pollchar, -				    ao_btm_putchar, +	ao_btm_stdio = ao_add_stdio(ao_serial_pollchar, +				    ao_serial_putchar,  				    NULL);  	ao_btm_echo(0);  | 
