17#if !USE_ARBITRARY_BAUDRATE
20#include <linux/termios.h>
32 case B1200:
return 1200;
33 case B2400:
return 2400;
34 case B4800:
return 4800;
35 case B9600:
return 9600;
71#define TRACE(type,fmt,args...)
86#if !USE_ARBITRARY_BAUDRATE
122 me->cur_termios =
me->orig_termios;
136 me->cur_termios.c_cc[
VTIME] = 0;
137 me->cur_termios.c_cc[
VMIN] = 0;
167 me->cur_termios =
me->orig_termios;
188 if (!
me ||
me->fd < 0) {
213 if (!
me ||
me->fd < 0) {
227 if (!
me ||
me->fd < 0) {
233 me->cur_termios.c_cflag |=
CS7;
235 me->cur_termios.c_cflag |=
CS8;
304 me->cur_termios =
me->orig_termios;
318 me->cur_termios.c_cc[
VTIME] = 0;
319 me->cur_termios.c_cc[
VMIN] = 0;
356 if (!
me ||
me->fd < 0) {
381 if (!
me ||
me->fd < 0) {
403 if (!
me ||
me->fd < 0) {
409 me->cur_termios.c_cflag |=
CS7;
411 me->cur_termios.c_cflag |=
CS8;
423 me->cur_termios.c_iflag |=
INPCK;
427 me->cur_termios.c_iflag |=
INPCK;
#define TRACE(type, fmt, args...)
void serial_port_free(struct SerialPort *me)
void serial_port_close(struct SerialPort *me)
static int uart_speed(int def)
int serial_port_open_raw(struct SerialPort *me, const char *device, speed_t speed)
#define B100000
some definitions from PPRZ uart driver as we can't include it directly
struct SerialPort * serial_port_new(void)
void serial_port_flush_output(struct SerialPort *me)
int serial_port_set_bits_stop_parity(struct SerialPort *me, const int bits, const int stop, const int parity)
int serial_port_open(struct SerialPort *me, const char *device, void(*term_conf_callback)(struct termios *, speed_t *))
int serial_port_set_baudrate(struct SerialPort *me, speed_t speed)
void serial_port_flush(struct SerialPort *me)