* serial.h ser-go32.c ser-go32-para.c ser-mac.c ser-tcp.c

ser-unix.c:  Add SERIAL_SETSTOPBITS to set the number of stopbits
	(needed for IDP board?!?!?).
This commit is contained in:
Stu Grossman 1995-03-07 09:03:37 +00:00
parent 7baea94608
commit 85c8b135fe
7 changed files with 121 additions and 1 deletions

View file

@ -627,6 +627,51 @@ hardwire_setbaudrate(scb, rate)
return set_tty_state (scb, &state);
}
static int
hardwire_setstopbits(scb, num)
serial_t scb;
int num;
{
struct hardwire_ttystate state;
int newbit;
if (get_tty_state(scb, &state))
return -1;
switch (num)
{
case SERIAL_1_STOPBITS:
newbit = 0;
break;
case SERIAL_1_AND_A_HALF_STOPBITS:
case SERIAL_2_STOPBITS:
newbit = 1;
break;
default:
return 1;
}
#ifdef HAVE_TERMIOS
if (!newbit)
state.termios.c_cflag &= ~CSTOPB;
else
state.termios.c_cflag |= CSTOPB; /* two bits */
#endif
#ifdef HAVE_TERMIO
if (!newbit)
state.termio.c_cflag &= ~CSTOPB;
else
state.termio.c_cflag |= CSTOPB; /* two bits */
#endif
#ifdef HAVE_SGTTY
return 0; /* sgtty doesn't support this */
#endif
return set_tty_state (scb, &state);
}
static int
hardwire_write(scb, str, len)
serial_t scb;
@ -675,6 +720,7 @@ static struct serial_ops hardwire_ops =
hardwire_print_tty_state,
hardwire_noflush_set_tty_state,
hardwire_setbaudrate,
hardwire_setstopbits,
};
void