ser-base.h 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. /* Generic serial interface functions.
  2. Copyright (C) 2005-2022 Free Software Foundation, Inc.
  3. This file is part of GDB.
  4. This program is free software; you can redistribute it and/or modify
  5. it under the terms of the GNU General Public License as published by
  6. the Free Software Foundation; either version 3 of the License, or
  7. (at your option) any later version.
  8. This program is distributed in the hope that it will be useful,
  9. but WITHOUT ANY WARRANTY; without even the implied warranty of
  10. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  11. GNU General Public License for more details.
  12. You should have received a copy of the GNU General Public License
  13. along with this program. If not, see <http://www.gnu.org/licenses/>. */
  14. #ifndef SER_BASE_H
  15. #define SER_BASE_H
  16. #include "serial.h" /* For serial_ttystate. */
  17. struct serial;
  18. struct ui_file;
  19. extern int generic_readchar (struct serial *scb, int timeout,
  20. int (*do_readchar) (struct serial *scb,
  21. int timeout));
  22. extern int ser_base_flush_output (struct serial *scb);
  23. extern int ser_base_flush_input (struct serial *scb);
  24. extern int ser_base_send_break (struct serial *scb);
  25. extern void ser_base_raw (struct serial *scb);
  26. extern serial_ttystate ser_base_get_tty_state (struct serial *scb);
  27. extern serial_ttystate ser_base_copy_tty_state (struct serial *scb,
  28. serial_ttystate ttystate);
  29. extern int ser_base_set_tty_state (struct serial *scb,
  30. serial_ttystate ttystate);
  31. extern void ser_base_print_tty_state (struct serial *scb,
  32. serial_ttystate ttystate,
  33. struct ui_file *stream);
  34. extern int ser_base_setbaudrate (struct serial *scb, int rate);
  35. extern int ser_base_setstopbits (struct serial *scb, int num);
  36. extern int ser_base_setparity (struct serial *scb, int parity);
  37. extern int ser_base_drain_output (struct serial *scb);
  38. extern int ser_base_write (struct serial *scb, const void *buf, size_t count);
  39. extern void ser_base_async (struct serial *scb, int async_p);
  40. extern int ser_base_readchar (struct serial *scb, int timeout);
  41. #endif