\doxysection{src/codec/ecu\+\_\+fr\+\_\+old.c File Reference} \label{ecu__fr__old_8c}\index{src/codec/ecu\_fr\_old.c@{src/codec/ecu\_fr\_old.c}} {\ttfamily \#include $<$stdbool.\+h$>$}\newline {\ttfamily \#include $<$string.\+h$>$}\newline {\ttfamily \#include $<$stdint.\+h$>$}\newline {\ttfamily \#include $<$errno.\+h$>$}\newline {\ttfamily \#include $<$osmocom/core/bitvec.\+h$>$}\newline {\ttfamily \#include $<$osmocom/codec/gsm610\+\_\+bits.\+h$>$}\newline {\ttfamily \#include $<$osmocom/codec/codec.\+h$>$}\newline {\ttfamily \#include $<$osmocom/codec/ecu.\+h$>$}\newline \doxysubsection*{Macros} \begin{DoxyCompactItemize} \item \#define \textbf{ GSM610\+\_\+\+XMAXC\+\_\+\+REDUCE}~4 \item \#define \textbf{ GSM610\+\_\+\+XMAXC\+\_\+\+LEN}~6 \end{DoxyCompactItemize} \doxysubsection*{Functions} \begin{DoxyCompactItemize} \item static bool \textbf{ reduce\+\_\+xmaxcr} (struct \textbf{ bitvec} $\ast$frame\+\_\+bitvec, const unsigned int index) \begin{DoxyCompactList}\small\item\em Reduce the XMAXC field. \end{DoxyCompactList}\item static bool \textbf{ reduce\+\_\+xmaxcr\+\_\+all} (struct \textbf{ bitvec} $\ast$frame\+\_\+bitvec) \begin{DoxyCompactList}\small\item\em Reduce all XMAXC fields in the frame. \end{DoxyCompactList}\item static int \textbf{ conceal\+\_\+frame} (uint8\+\_\+t $\ast$frame) \item void \textbf{ osmo\+\_\+ecu\+\_\+fr\+\_\+reset} (struct \textbf{ osmo\+\_\+ecu\+\_\+fr\+\_\+state} $\ast$state, const uint8\+\_\+t $\ast$frame) \begin{DoxyCompactList}\small\item\em To be called when a good frame is received. \end{DoxyCompactList}\item int \textbf{ osmo\+\_\+ecu\+\_\+fr\+\_\+conceal} (struct \textbf{ osmo\+\_\+ecu\+\_\+fr\+\_\+state} $\ast$state, uint8\+\_\+t $\ast$frame) \begin{DoxyCompactList}\small\item\em To be called when a bad frame is received. \end{DoxyCompactList}\end{DoxyCompactItemize} \doxysubsection{Macro Definition Documentation} \mbox{\label{ecu__fr__old_8c_a58b276a2088990247d6257708780e94a}} \index{ecu\_fr\_old.c@{ecu\_fr\_old.c}!GSM610\_XMAXC\_LEN@{GSM610\_XMAXC\_LEN}} \index{GSM610\_XMAXC\_LEN@{GSM610\_XMAXC\_LEN}!ecu\_fr\_old.c@{ecu\_fr\_old.c}} \doxysubsubsection{GSM610\_XMAXC\_LEN} {\footnotesize\ttfamily \#define GSM610\+\_\+\+XMAXC\+\_\+\+LEN~6} \mbox{\label{ecu__fr__old_8c_a43d9349be340f4739bf3ca9515791c36}} \index{ecu\_fr\_old.c@{ecu\_fr\_old.c}!GSM610\_XMAXC\_REDUCE@{GSM610\_XMAXC\_REDUCE}} \index{GSM610\_XMAXC\_REDUCE@{GSM610\_XMAXC\_REDUCE}!ecu\_fr\_old.c@{ecu\_fr\_old.c}} \doxysubsubsection{GSM610\_XMAXC\_REDUCE} {\footnotesize\ttfamily \#define GSM610\+\_\+\+XMAXC\+\_\+\+REDUCE~4} \doxysubsection{Function Documentation} \mbox{\label{ecu__fr__old_8c_aab99721365374c0a287be30ac5aea53a}} \index{ecu\_fr\_old.c@{ecu\_fr\_old.c}!conceal\_frame@{conceal\_frame}} \index{conceal\_frame@{conceal\_frame}!ecu\_fr\_old.c@{ecu\_fr\_old.c}} \doxysubsubsection{conceal\_frame()} {\footnotesize\ttfamily static int conceal\+\_\+frame (\begin{DoxyParamCaption}\item[{uint8\+\_\+t $\ast$}]{frame }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [static]}} References \textbf{ bitvec\+\_\+alloc()}, \textbf{ bitvec\+\_\+free()}, \textbf{ bitvec\+\_\+pack()}, \textbf{ bitvec\+\_\+unpack()}, \textbf{ GSM\+\_\+\+FR\+\_\+\+BYTES}, \textbf{ len()}, \textbf{ osmo\+\_\+fr\+\_\+check\+\_\+sid()}, and \textbf{ reduce\+\_\+xmaxcr\+\_\+all()}. Referenced by \textbf{ osmo\+\_\+ecu\+\_\+fr\+\_\+conceal()}. \mbox{\label{ecu__fr__old_8c_a2b7a9e808db71216f2e8d67d2ed729d7}} \index{ecu\_fr\_old.c@{ecu\_fr\_old.c}!osmo\_ecu\_fr\_conceal@{osmo\_ecu\_fr\_conceal}} \index{osmo\_ecu\_fr\_conceal@{osmo\_ecu\_fr\_conceal}!ecu\_fr\_old.c@{ecu\_fr\_old.c}} \doxysubsubsection{osmo\_ecu\_fr\_conceal()} {\footnotesize\ttfamily int osmo\+\_\+ecu\+\_\+fr\+\_\+conceal (\begin{DoxyParamCaption}\item[{struct \textbf{ osmo\+\_\+ecu\+\_\+fr\+\_\+state} $\ast$}]{state, }\item[{uint8\+\_\+t $\ast$}]{frame }\end{DoxyParamCaption})} To be called when a bad frame is received. This function will then generate a replacement frame that can be used to conceal the dropout. \begin{DoxyParams}[1]{Parameters} \mbox{\texttt{ in}} & {\em state} & The state object for the ECU \\ \hline \mbox{\texttt{ out}} & {\em frame} & The buffer to fill with GSM\+\_\+\+FR\+\_\+\+BYTES of replacement frame \\ \hline \end{DoxyParams} \begin{DoxyReturn}{Returns} 0 if the frame was successfully filled \end{DoxyReturn} References \textbf{ conceal\+\_\+frame()}, \textbf{ osmo\+\_\+ecu\+\_\+fr\+\_\+state\+::frame\+\_\+backup}, \textbf{ GSM\+\_\+\+FR\+\_\+\+BYTES}, and \textbf{ osmo\+\_\+ecu\+\_\+fr\+\_\+state\+::subsequent\+\_\+lost\+\_\+frame}. \mbox{\label{ecu__fr__old_8c_acd822882431255e3b0130f38b4e95f21}} \index{ecu\_fr\_old.c@{ecu\_fr\_old.c}!osmo\_ecu\_fr\_reset@{osmo\_ecu\_fr\_reset}} \index{osmo\_ecu\_fr\_reset@{osmo\_ecu\_fr\_reset}!ecu\_fr\_old.c@{ecu\_fr\_old.c}} \doxysubsubsection{osmo\_ecu\_fr\_reset()} {\footnotesize\ttfamily void osmo\+\_\+ecu\+\_\+fr\+\_\+reset (\begin{DoxyParamCaption}\item[{struct \textbf{ osmo\+\_\+ecu\+\_\+fr\+\_\+state} $\ast$}]{state, }\item[{const uint8\+\_\+t $\ast$}]{frame }\end{DoxyParamCaption})} To be called when a good frame is received. This function will then create a backup of the frame and reset the internal state. \begin{DoxyParams}[1]{Parameters} \mbox{\texttt{ in}} & {\em state} & The state object for the ECU \\ \hline \mbox{\texttt{ out}} & {\em frame} & The valid frame (GSM\+\_\+\+FR\+\_\+\+BYTES bytes in RTP payload format) \\ \hline \end{DoxyParams} References \textbf{ osmo\+\_\+ecu\+\_\+fr\+\_\+state\+::frame\+\_\+backup}, \textbf{ GSM\+\_\+\+FR\+\_\+\+BYTES}, and \textbf{ osmo\+\_\+ecu\+\_\+fr\+\_\+state\+::subsequent\+\_\+lost\+\_\+frame}. \mbox{\label{ecu__fr__old_8c_ad9863a1daedec921fb074fca58068d1a}} \index{ecu\_fr\_old.c@{ecu\_fr\_old.c}!reduce\_xmaxcr@{reduce\_xmaxcr}} \index{reduce\_xmaxcr@{reduce\_xmaxcr}!ecu\_fr\_old.c@{ecu\_fr\_old.c}} \doxysubsubsection{reduce\_xmaxcr()} {\footnotesize\ttfamily static bool reduce\+\_\+xmaxcr (\begin{DoxyParamCaption}\item[{struct \textbf{ bitvec} $\ast$}]{frame\+\_\+bitvec, }\item[{const unsigned int}]{index }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [static]}} Reduce the XMAXC field. When the XMAXC field reaches zero the function will return true. References \textbf{ bitvec\+\_\+read\+\_\+field()}, \textbf{ bitvec\+\_\+write\+\_\+field()}, \textbf{ GSM610\+\_\+\+XMAXC\+\_\+\+LEN}, and \textbf{ GSM610\+\_\+\+XMAXC\+\_\+\+REDUCE}. Referenced by \textbf{ reduce\+\_\+xmaxcr\+\_\+all()}. \mbox{\label{ecu__fr__old_8c_a5d5fcdc234721dfce6c2647091ed9beb}} \index{ecu\_fr\_old.c@{ecu\_fr\_old.c}!reduce\_xmaxcr\_all@{reduce\_xmaxcr\_all}} \index{reduce\_xmaxcr\_all@{reduce\_xmaxcr\_all}!ecu\_fr\_old.c@{ecu\_fr\_old.c}} \doxysubsubsection{reduce\_xmaxcr\_all()} {\footnotesize\ttfamily static bool reduce\+\_\+xmaxcr\+\_\+all (\begin{DoxyParamCaption}\item[{struct \textbf{ bitvec} $\ast$}]{frame\+\_\+bitvec }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [static]}} Reduce all XMAXC fields in the frame. When all XMAXC fields reach zero, then the function will return true. References \textbf{ GSM610\+\_\+\+RTP\+\_\+\+XMAXC00}, \textbf{ GSM610\+\_\+\+RTP\+\_\+\+XMAXC10}, \textbf{ GSM610\+\_\+\+RTP\+\_\+\+XMAXC20}, \textbf{ GSM610\+\_\+\+RTP\+\_\+\+XMAXC30}, and \textbf{ reduce\+\_\+xmaxcr()}. Referenced by \textbf{ conceal\+\_\+frame()}.