15796c8dcSSimon Schubert /* Generic serial interface functions. 25796c8dcSSimon Schubert 3*ef5ccd6cSJohn Marino Copyright (C) 2005-2013 Free Software Foundation, Inc. 45796c8dcSSimon Schubert 55796c8dcSSimon Schubert This file is part of GDB. 65796c8dcSSimon Schubert 75796c8dcSSimon Schubert This program is free software; you can redistribute it and/or modify 85796c8dcSSimon Schubert it under the terms of the GNU General Public License as published by 95796c8dcSSimon Schubert the Free Software Foundation; either version 3 of the License, or 105796c8dcSSimon Schubert (at your option) any later version. 115796c8dcSSimon Schubert 125796c8dcSSimon Schubert This program is distributed in the hope that it will be useful, 135796c8dcSSimon Schubert but WITHOUT ANY WARRANTY; without even the implied warranty of 145796c8dcSSimon Schubert MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 155796c8dcSSimon Schubert GNU General Public License for more details. 165796c8dcSSimon Schubert 175796c8dcSSimon Schubert You should have received a copy of the GNU General Public License 185796c8dcSSimon Schubert along with this program. If not, see <http://www.gnu.org/licenses/>. */ 195796c8dcSSimon Schubert 205796c8dcSSimon Schubert #ifndef SER_BASE_H 215796c8dcSSimon Schubert #define SER_BASE_H 225796c8dcSSimon Schubert 235796c8dcSSimon Schubert struct serial; 245796c8dcSSimon Schubert struct ui_file; 255796c8dcSSimon Schubert 265796c8dcSSimon Schubert extern int generic_readchar (struct serial *scb, int timeout, 275796c8dcSSimon Schubert int (*do_readchar) (struct serial *scb, 285796c8dcSSimon Schubert int timeout)); 295796c8dcSSimon Schubert extern int ser_base_flush_output (struct serial *scb); 305796c8dcSSimon Schubert extern int ser_base_flush_input (struct serial *scb); 315796c8dcSSimon Schubert extern int ser_base_send_break (struct serial *scb); 325796c8dcSSimon Schubert extern void ser_base_raw (struct serial *scb); 335796c8dcSSimon Schubert extern serial_ttystate ser_base_get_tty_state (struct serial *scb); 34c50c785cSJohn Marino extern serial_ttystate ser_base_copy_tty_state (struct serial *scb, 35c50c785cSJohn Marino serial_ttystate ttystate); 365796c8dcSSimon Schubert extern int ser_base_set_tty_state (struct serial *scb, 375796c8dcSSimon Schubert serial_ttystate ttystate); 385796c8dcSSimon Schubert extern void ser_base_print_tty_state (struct serial *scb, 395796c8dcSSimon Schubert serial_ttystate ttystate, 405796c8dcSSimon Schubert struct ui_file *stream); 415796c8dcSSimon Schubert extern int ser_base_noflush_set_tty_state (struct serial *scb, 425796c8dcSSimon Schubert serial_ttystate new_ttystate, 435796c8dcSSimon Schubert serial_ttystate old_ttystate); 445796c8dcSSimon Schubert extern int ser_base_setbaudrate (struct serial *scb, int rate); 455796c8dcSSimon Schubert extern int ser_base_setstopbits (struct serial *scb, int rate); 465796c8dcSSimon Schubert extern int ser_base_drain_output (struct serial *scb); 475796c8dcSSimon Schubert 485796c8dcSSimon Schubert extern int ser_base_write (struct serial *scb, const char *str, int len); 495796c8dcSSimon Schubert 505796c8dcSSimon Schubert extern void ser_base_async (struct serial *scb, int async_p); 515796c8dcSSimon Schubert extern int ser_base_readchar (struct serial *scb, int timeout); 525796c8dcSSimon Schubert 535796c8dcSSimon Schubert #endif 54