blob: 0ac2968148d50b75a8862455ecd6b2d46157dd54 [file] [log] [blame]
Neels Hofmeyr17518fe2017-06-20 04:35:06 +02001/*! \file serial.h
2 * Osmocom serial port helpers. */
Sylvain Munautfe28ded2011-09-02 22:18:24 +02003/*
Sylvain Munautfe28ded2011-09-02 22:18:24 +02004 * Copyright (C) 2011 Sylvain Munaut <tnt@246tNt.com>
5 *
6 * All Rights Reserved
7 *
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License as published by
10 * the Free Software Foundation; either version 2 of the License, or
11 * (at your option) any later version.
12 *
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
Sylvain Munautfe28ded2011-09-02 22:18:24 +020017 */
18
19/*! \defgroup serial Utility functions to deal with serial ports
20 * @{
Neels Hofmeyr17518fe2017-06-20 04:35:06 +020021 * \file serial.h */
Sylvain Munautfe28ded2011-09-02 22:18:24 +020022
Sylvain Munaut12ba7782014-06-16 10:13:40 +020023#pragma once
Sylvain Munautfe28ded2011-09-02 22:18:24 +020024
25#include <termios.h>
26
27int osmo_serial_init(const char *dev, speed_t baudrate);
28int osmo_serial_set_baudrate(int fd, speed_t baudrate);
29int osmo_serial_set_custom_baudrate(int fd, int baudrate);
30int osmo_serial_clear_custom_baudrate(int fd);
Pau Espin Pedrol4fe8a752020-11-13 22:58:14 +010031int osmo_serial_speed_t(unsigned int baudrate, speed_t *speed);
Sylvain Munautfe28ded2011-09-02 22:18:24 +020032
Sylvain Munautdca7d2c2012-04-18 21:53:23 +020033/*! @} */