\doxysection{src/core/serial.c File Reference}
\label{serial_8c}\index{src/core/serial.c@{src/core/serial.c}}


Utility functions to deal with serial ports.  


{\ttfamily \#include $<$errno.\+h$>$}\newline
{\ttfamily \#include $<$fcntl.\+h$>$}\newline
{\ttfamily \#include $<$stdio.\+h$>$}\newline
{\ttfamily \#include $<$termios.\+h$>$}\newline
{\ttfamily \#include $<$unistd.\+h$>$}\newline
{\ttfamily \#include $<$sys/ioctl.\+h$>$}\newline
{\ttfamily \#include $<$sys/types.\+h$>$}\newline
{\ttfamily \#include $<$sys/stat.\+h$>$}\newline
{\ttfamily \#include $<$osmocom/core/serial.\+h$>$}\newline
\doxysubsection*{Macros}
\begin{DoxyCompactItemize}
\item 
\#define \textbf{ dbg\+\_\+perror}(x)~do \{ \} while (0)
\end{DoxyCompactItemize}
\doxysubsection*{Functions}
\begin{DoxyCompactItemize}
\item 
int \textbf{ osmo\+\_\+serial\+\_\+init} (const char $\ast$dev, speed\+\_\+t baudrate)
\begin{DoxyCompactList}\small\item\em Open serial device and does base init. \end{DoxyCompactList}\item 
static int \textbf{ \+\_\+osmo\+\_\+serial\+\_\+set\+\_\+baudrate} (int fd, speed\+\_\+t baudrate)
\item 
int \textbf{ osmo\+\_\+serial\+\_\+set\+\_\+baudrate} (int fd, speed\+\_\+t baudrate)
\begin{DoxyCompactList}\small\item\em Change current baudrate. \end{DoxyCompactList}\item 
int \textbf{ osmo\+\_\+serial\+\_\+set\+\_\+custom\+\_\+baudrate} (int fd, int baudrate)
\begin{DoxyCompactList}\small\item\em Change current baudrate to a custom one using OS specific method. \end{DoxyCompactList}\item 
int \textbf{ osmo\+\_\+serial\+\_\+clear\+\_\+custom\+\_\+baudrate} (int fd)
\begin{DoxyCompactList}\small\item\em Clear any custom baudrate. \end{DoxyCompactList}\item 
int \textbf{ osmo\+\_\+serial\+\_\+speed\+\_\+t} (unsigned int baudrate, speed\+\_\+t $\ast$speed)
\begin{DoxyCompactList}\small\item\em Convert unsigned integer value to speed\+\_\+t. \end{DoxyCompactList}\end{DoxyCompactItemize}


\doxysubsection{Detailed Description}
Utility functions to deal with serial ports. 

