Paparazzi UAS  v5.2.2_stable-0-gd6b9f29
Paparazzi is a free software Unmanned Aircraft System.
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
serial_port.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2010 Antoine Drouin <poinix@gmail.com>
3  *
4  * This file is part of paparazzi.
5  *
6  * paparazzi is free software; you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License as published by
8  * the Free Software Foundation; either version 2, or (at your option)
9  * any later version.
10  *
11  * paparazzi is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  * GNU General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public License
17  * along with paparazzi; see the file COPYING. If not, write to
18  * the Free Software Foundation, 59 Temple Place - Suite 330,
19  * Boston, MA 02111-1307, USA.
20  *
21  */
22 
23 #ifndef SERIAL_PORT_H
24 #define SERIAL_PORT_H
25 
26 #include <termios.h>
27 
28 struct SerialPort {
29  int fd; /* serial device fd */
30  struct termios orig_termios; /* saved tty state structure */
31  struct termios cur_termios; /* tty state structure */
32 };
33 
34 extern struct SerialPort* serial_port_new(void);
35 extern void serial_port_free(struct SerialPort* me);
36 extern void serial_port_flush(struct SerialPort* me);
37 extern void serial_port_flush_output(struct SerialPort* me);
38 extern int serial_port_open_raw(struct SerialPort* me, const char* device, speed_t speed);
39 extern int serial_port_open(struct SerialPort* me, const char* device,
40  void(*term_conf_callback)(struct termios*, speed_t*));
41 extern void serial_port_close(struct SerialPort* me);
42 
43 #endif /* SERIAL_PORT_H */
void serial_port_close(struct SerialPort *me)
Definition: serial_port.c:111
void serial_port_flush(struct SerialPort *me)
Definition: serial_port.c:26
struct termios orig_termios
Definition: serial_port.h:30
void serial_port_free(struct SerialPort *me)
Definition: serial_port.c:21
struct termios cur_termios
Definition: serial_port.h:31
struct SerialPort * serial_port_new(void)
Definition: serial_port.c:16
int serial_port_open(struct SerialPort *me, const char *device, void(*term_conf_callback)(struct termios *, speed_t *))
Definition: serial_port.c:81
int serial_port_open_raw(struct SerialPort *me, const char *device, speed_t speed)
Definition: serial_port.c:46
void serial_port_flush_output(struct SerialPort *me)
Definition: serial_port.c:36