Lines Matching refs:serial
1 /* Remote serial support interface definitions for GDB, the GNU Debugger.
36 struct serial;
43 /* Parity for serial port */
47 /* Create a new serial for OPS. The new serial is not opened. */
49 /* Try to open NAME. Returns a new `struct serial *' on success, NULL
50 on failure. The new serial object has a reference count of 1.
56 extern struct serial *serial_open (const char *name);
58 /* Open a new serial stream using OPS. */
60 extern struct serial *serial_open_ops (const struct serial_ops *ops);
64 extern int serial_is_open (struct serial *scb);
66 /* Find an already opened serial stream using a file handle. */
68 extern struct serial *serial_for_fd (int fd);
70 /* Open a new serial stream using a file handle. */
72 extern struct serial *serial_fdopen (const int fd);
76 extern void serial_close (struct serial *scb);
80 extern void serial_ref (struct serial *scb);
84 extern void serial_unref (struct serial *scb);
92 /* Create a pipe with each end wrapped in a `struct serial' interface.
97 extern int serial_pipe (struct serial *scbs[2]);
101 extern void serial_un_fdopen (struct serial *scb);
103 /* Read one char from the serial device with TIMEOUT seconds to wait
120 extern int serial_readchar (struct serial *scb, int timeout);
125 extern void serial_write (struct serial *scb, const void *buf, size_t count);
127 /* Write a printf style string onto the serial port. */
129 extern void serial_printf (struct serial *desc,
134 extern int serial_drain_output (struct serial *);
139 extern int serial_flush_output (struct serial *);
144 extern int serial_flush_input (struct serial *);
148 extern void serial_send_break (struct serial *scb);
152 extern void serial_raw (struct serial *scb);
157 extern serial_ttystate serial_get_tty_state (struct serial *scb);
162 extern serial_ttystate serial_copy_tty_state (struct serial *scb,
170 extern int serial_set_tty_state (struct serial *scb, serial_ttystate ttystate);
176 extern void serial_print_tty_state (struct serial *scb,
183 extern void serial_setbaudrate (struct serial *scb, int rate);
192 extern int serial_setstopbits (struct serial *scb, int num);
198 /* Set parity for serial port. Returns 0 for success, -1 for failure. */
200 extern int serial_setparity (struct serial *scb, int parity);
202 /* Asynchronous serial interface: */
204 /* Can the serial device support asynchronous mode? */
206 extern int serial_can_async_p (struct serial *scb);
208 /* Has the serial device been put in asynchronous mode? */
210 extern int serial_is_async_p (struct serial *scb);
216 typedef void (serial_event_ftype) (struct serial *scb, void *context);
217 extern void serial_async (struct serial *scb,
225 extern void serial_debug (struct serial *scb, int debug_p);
227 extern int serial_debug_p (struct serial *scb);
230 /* Details of an instance of a serial object. */
232 struct serial
234 /* serial objects are ref counted (but not the underlying
252 struct serial *next; /* Pointer to the next `struct serial *' */
253 int debug_p; /* Trace this serial devices operation. */
262 void (*open) (struct serial *, const char *name);
263 void (*close) (struct serial *);
264 int (*fdopen) (struct serial *, int fd);
265 int (*readchar) (struct serial *, int timeout);
266 void (*write) (struct serial *, const void *buf, size_t count);
268 int (*flush_output) (struct serial *);
270 int (*flush_input) (struct serial *);
271 void (*send_break) (struct serial *);
272 void (*go_raw) (struct serial *);
273 serial_ttystate (*get_tty_state) (struct serial *);
274 serial_ttystate (*copy_tty_state) (struct serial *, serial_ttystate);
275 int (*set_tty_state) (struct serial *, serial_ttystate);
276 void (*print_tty_state) (struct serial *, serial_ttystate,
278 void (*setbaudrate) (struct serial *, int rate);
279 int (*setstopbits) (struct serial *, int num);
280 /* Set the value PARITY as parity setting for serial object.
282 int (*setparity) (struct serial *, int parity);
284 int (*drain_output) (struct serial *);
285 /* Change the serial device into/out of asynchronous mode, call
288 void (*async) (struct serial *scb, int async_p);
291 int (*read_prim)(struct serial *scb, size_t count);
294 int (*write_prim)(struct serial *scb, const void *buf, size_t count);
299 int (*avail)(struct serial *scb, int fd);
305 void (*wait_handle) (struct serial *scb, HANDLE *read, HANDLE *except);
306 void (*done_wait_handle) (struct serial *scb);
310 /* Add a new serial interface to the interface list. */
321 serial device. */
322 extern void serial_wait_handle (struct serial *, HANDLE *, HANDLE *);
325 extern void serial_done_wait_handle (struct serial *);