Lines Matching defs:state

80 			  struct hardwire_ttystate * state);
82 struct hardwire_ttystate * state);
84 static int hardwire_set_tty_state (struct serial *scb, serial_ttystate state);
117 get_tty_state (struct serial *scb, struct hardwire_ttystate *state)
120 if (tcgetattr (scb->fd, &state->termios) < 0)
127 if (ioctl (scb->fd, TCGETA, &state->termio) < 0)
133 if (ioctl (scb->fd, TIOCGETP, &state->sgttyb) < 0)
135 if (ioctl (scb->fd, TIOCGETC, &state->tc) < 0)
137 if (ioctl (scb->fd, TIOCGLTC, &state->ltc) < 0)
139 if (ioctl (scb->fd, TIOCLGET, &state->lmode) < 0)
147 set_tty_state (struct serial *scb, struct hardwire_ttystate *state)
150 if (tcsetattr (scb->fd, TCSANOW, &state->termios) < 0)
157 if (ioctl (scb->fd, TCSETA, &state->termio) < 0)
163 if (ioctl (scb->fd, TIOCSETN, &state->sgttyb) < 0)
165 if (ioctl (scb->fd, TIOCSETC, &state->tc) < 0)
167 if (ioctl (scb->fd, TIOCSLTC, &state->ltc) < 0)
169 if (ioctl (scb->fd, TIOCLSET, &state->lmode) < 0)
179 struct hardwire_ttystate *state;
181 state = (struct hardwire_ttystate *) xmalloc (sizeof *state);
183 if (get_tty_state (scb, state))
186 return (serial_ttystate) state;
192 struct hardwire_ttystate *state;
194 state = (struct hardwire_ttystate *) ttystate;
196 return set_tty_state (scb, state);
206 struct hardwire_ttystate *state = (struct hardwire_ttystate *) old_ttystate;
216 if (state->sgttyb.sg_flags & RAW)
223 if (state->sgttyb.sg_flags & CBREAK)
237 struct hardwire_ttystate *state = (struct hardwire_ttystate *) ttystate;
242 (int) state->termios.c_iflag,
243 (int) state->termios.c_oflag);
245 (int) state->termios.c_cflag,
246 (int) state->termios.c_lflag);
250 fprintf_filtered (stream, "c_line = 0x%x.\n", state->termios.c_line);
254 fprintf_filtered (stream, "0x%x ", state->termios.c_cc[i]);
260 state->termio.c_iflag, state->termio.c_oflag);
262 state->termio.c_cflag, state->termio.c_lflag,
263 state->termio.c_line);
266 fprintf_filtered (stream, "0x%x ", state->termio.c_cc[i]);
272 state->sgttyb.sg_flags);
276 fprintf_filtered (stream, "0x%x ", ((unsigned char *) &state->tc)[i]);
281 fprintf_filtered (stream, "0x%x ", ((unsigned char *) &state->ltc)[i]);
284 fprintf_filtered (stream, "lmode: 0x%x\n", state->lmode);
302 /* Get the current state and then restore it using TIOCSETP,
306 struct hardwire_ttystate state;
307 if (get_tty_state (scb, &state))
313 return (ioctl (scb->fd, TIOCSETP, &state.sgttyb));
388 struct hardwire_ttystate state;
390 if (get_tty_state (scb, &state))
394 state.termios.c_iflag = 0;
395 state.termios.c_oflag = 0;
396 state.termios.c_lflag = 0;
397 state.termios.c_cflag &= ~(CSIZE | PARENB);
398 state.termios.c_cflag |= CLOCAL | CS8;
399 state.termios.c_cc[VMIN] = 0;
400 state.termios.c_cc[VTIME] = 0;
404 state.termio.c_iflag = 0;
405 state.termio.c_oflag = 0;
406 state.termio.c_lflag = 0;
407 state.termio.c_cflag &= ~(CSIZE | PARENB);
408 state.termio.c_cflag |= CLOCAL | CS8;
409 state.termio.c_cc[VMIN] = 0;
410 state.termio.c_cc[VTIME] = 0;
414 state.sgttyb.sg_flags |= RAW | ANYP;
415 state.sgttyb.sg_flags &= ~(CBREAK | ECHO);
420 if (set_tty_state (scb, &state))
484 struct hardwire_ttystate state;
486 if (get_tty_state (scb, &state))
493 state.termios.c_cc[VTIME] = 0;
494 state.termios.c_cc[VMIN] = 1;
498 state.termios.c_cc[VMIN] = 0;
499 state.termios.c_cc[VTIME] = timeout * 10;
500 if (state.termios.c_cc[VTIME] != timeout * 10)
508 state.termios.c_cc[VTIME] = scb->current_timeout * 10;
518 state.termio.c_cc[VTIME] = 0;
519 state.termio.c_cc[VMIN] = 1;
523 state.termio.c_cc[VMIN] = 0;
524 state.termio.c_cc[VTIME] = timeout * 10;
525 if (state.termio.c_cc[VTIME] != timeout * 10)
532 state.termio.c_cc[VTIME] = scb->current_timeout * 10;
538 if (set_tty_state (scb, &state))
783 struct hardwire_ttystate state;
794 if (get_tty_state (scb, &state))
798 cfsetospeed (&state.termios, baud_code);
799 cfsetispeed (&state.termios, baud_code);
807 state.termio.c_cflag &= ~(CBAUD | CIBAUD);
808 state.termio.c_cflag |= baud_code;
812 state.sgttyb.sg_ispeed = baud_code;
813 state.sgttyb.sg_ospeed = baud_code;
816 return set_tty_state (scb, &state);
822 struct hardwire_ttystate state;
825 if (get_tty_state (scb, &state))
843 state.termios.c_cflag &= ~CSTOPB;
845 state.termios.c_cflag |= CSTOPB; /* two bits */
850 state.termio.c_cflag &= ~CSTOPB;
852 state.termio.c_cflag |= CSTOPB; /* two bits */
859 return set_tty_state (scb, &state);
1170 /* The ID of the currently scheduled timer event. This state is
1172 event is delivered the state is shanged to NOTHING_SCHEDULED. */
1178 timer event has just gone off and the current state has been
1183 and scb->buf* (the input FIFO). A state machine is used to avoid