\doxysection{trxc\+\_\+client.\+h}
\label{trxc__client_8h_source}\index{include/osmocom/trx/trxc\_client.h@{include/osmocom/trx/trxc\_client.h}}
\textbf{ Go to the documentation of this file.}
\begin{DoxyCode}{0}
\DoxyCodeLine{1 }
\DoxyCodeLine{3 \textcolor{preprocessor}{\#pragma once}}
\DoxyCodeLine{4 }
\DoxyCodeLine{5 \textcolor{preprocessor}{\#include <stdint.h>}}
\DoxyCodeLine{6 \textcolor{preprocessor}{\#include <stddef.h>}}
\DoxyCodeLine{7 }
\DoxyCodeLine{8 \textcolor{preprocessor}{\#include <osmocom/trx/trxc.h>}}
\DoxyCodeLine{9 }
\DoxyCodeLine{18 \textcolor{keyword}{struct }osmo\_trxc\_client;}
\DoxyCodeLine{19 }
\DoxyCodeLine{28 \textcolor{keyword}{typedef} \textcolor{keywordtype}{int} osmo\_trxc\_client\_rsp\_cb(\textcolor{keyword}{struct} osmo\_trxc\_client *client,}
\DoxyCodeLine{29                                     \textcolor{keyword}{const} \textcolor{keyword}{struct} osmo\_trxc\_msg *rsp,}
\DoxyCodeLine{30                                     \textcolor{keywordtype}{void} *cb\_data);}
\DoxyCodeLine{31 }
\DoxyCodeLine{40 \textcolor{keyword}{typedef} \textcolor{keywordtype}{int} osmo\_trxc\_client\_tx\_msg\_cb(\textcolor{keyword}{struct} osmo\_trxc\_client *client,}
\DoxyCodeLine{41                                        \textcolor{keyword}{const} \textcolor{keyword}{struct} osmo\_trxc\_msg *msg);}
\DoxyCodeLine{42 }
\DoxyCodeLine{49 \textcolor{keyword}{typedef} \textcolor{keywordtype}{void} osmo\_trxc\_client\_fatal\_error\_cb(\textcolor{keyword}{struct} osmo\_trxc\_client *client,}
\DoxyCodeLine{50                                              \textcolor{keyword}{const} \textcolor{keyword}{struct} osmo\_trxc\_msg *rsp);}
\DoxyCodeLine{51 }
\DoxyCodeLine{52 \textcolor{keyword}{struct }osmo\_trxc\_client *osmo\_trxc\_client\_alloc(\textcolor{keywordtype}{void} *ctx);}
\DoxyCodeLine{53 \textcolor{keywordtype}{void} osmo\_trxc\_client\_free(\textcolor{keyword}{struct} osmo\_trxc\_client *client);}
\DoxyCodeLine{54 \textcolor{keywordtype}{void} osmo\_trxc\_client\_set\_priv(\textcolor{keyword}{struct} osmo\_trxc\_client *client, \textcolor{keywordtype}{void} *priv);}
\DoxyCodeLine{55 \textcolor{keywordtype}{void} *osmo\_trxc\_client\_get\_priv(\textcolor{keyword}{const} \textcolor{keyword}{struct} osmo\_trxc\_client *client);}
\DoxyCodeLine{56 \textcolor{keywordtype}{int} osmo\_trxc\_client\_set\_name(\textcolor{keyword}{struct} osmo\_trxc\_client *client, \textcolor{keyword}{const} \textcolor{keywordtype}{char} *fmt, ...);}
\DoxyCodeLine{57 \textcolor{keywordtype}{void} osmo\_trxc\_client\_set\_log\_cat(\textcolor{keyword}{struct} osmo\_trxc\_client *client, \textcolor{keywordtype}{int} log\_cat);}
\DoxyCodeLine{58 \textcolor{keywordtype}{int} osmo\_trxc\_client\_set\_retrans(\textcolor{keyword}{struct} osmo\_trxc\_client *client, \textcolor{keywordtype}{unsigned} \textcolor{keywordtype}{int} sec);}
\DoxyCodeLine{59 \textcolor{keywordtype}{void} osmo\_trxc\_client\_set\_max\_retrans(\textcolor{keyword}{struct} osmo\_trxc\_client *client, \textcolor{keywordtype}{unsigned} \textcolor{keywordtype}{int} n);}
\DoxyCodeLine{61 \textcolor{keywordtype}{void} osmo\_trxc\_client\_set\_tx\_msg\_cb(\textcolor{keyword}{struct} osmo\_trxc\_client *client,}
\DoxyCodeLine{62                                     osmo\_trxc\_client\_tx\_msg\_cb *cb);}
\DoxyCodeLine{64 \textcolor{keywordtype}{void} osmo\_trxc\_client\_set\_fatal\_error\_cb(\textcolor{keyword}{struct} osmo\_trxc\_client *client,}
\DoxyCodeLine{65                                          osmo\_trxc\_client\_fatal\_error\_cb *cb);}
\DoxyCodeLine{66 }
\DoxyCodeLine{68 \textcolor{preprocessor}{\#define OSMO\_TRXC\_F\_CRITICAL            (1 << 0)}}
\DoxyCodeLine{70 \textcolor{preprocessor}{\#define OSMO\_TRXC\_F\_MATCH\_PARAMS        (1 << 1)}}
\DoxyCodeLine{71 }
\DoxyCodeLine{72 \textcolor{keywordtype}{int} osmo\_trxc\_client\_send\_cmd(\textcolor{keyword}{struct} osmo\_trxc\_client *client, uint32\_t flags,}
\DoxyCodeLine{73                               osmo\_trxc\_client\_rsp\_cb *cb, \textcolor{keywordtype}{void} *cb\_data,}
\DoxyCodeLine{74                               \textcolor{keyword}{const} \textcolor{keywordtype}{char} *cmd, \textcolor{keyword}{const} \textcolor{keywordtype}{char} *fmt, ...);}
\DoxyCodeLine{75 \textcolor{keywordtype}{void} osmo\_trxc\_client\_flush(\textcolor{keyword}{struct} osmo\_trxc\_client *client);}
\DoxyCodeLine{76 }
\DoxyCodeLine{77 \textcolor{keywordtype}{int} osmo\_trxc\_client\_rx\_msg(\textcolor{keyword}{struct} osmo\_trxc\_client *client,}
\DoxyCodeLine{78                             \textcolor{keyword}{const} \textcolor{keyword}{struct} osmo\_trxc\_msg *rsp);}
\DoxyCodeLine{79 \textcolor{keywordtype}{int} osmo\_trxc\_client\_rx(\textcolor{keyword}{struct} osmo\_trxc\_client *client, \textcolor{keyword}{const} \textcolor{keywordtype}{char} *buf, \textcolor{keywordtype}{size\_t} len);}
\DoxyCodeLine{80 }
\DoxyCodeLine{85 \textcolor{keyword}{typedef} \textcolor{keywordtype}{void} osmo\_trxc\_setformat\_cb(\textcolor{keyword}{struct} osmo\_trxc\_client *client,}
\DoxyCodeLine{86                                     uint8\_t ver\_use, \textcolor{keywordtype}{void} *cb\_data);}
\DoxyCodeLine{87 \textcolor{keywordtype}{int} osmo\_trxc\_client\_negotiate\_format(\textcolor{keyword}{struct} osmo\_trxc\_client *client,}
\DoxyCodeLine{88                                       uint8\_t ver\_max,}
\DoxyCodeLine{89                                       osmo\_trxc\_setformat\_cb *cb, \textcolor{keywordtype}{void} *cb\_data);}
\DoxyCodeLine{90 }
\DoxyCodeLine{91 \textcolor{comment}{/* Convenience wrappers for the common command set (thin, optional) */}}
\DoxyCodeLine{92 \textcolor{keyword}{static} \textcolor{keyword}{inline} \textcolor{keywordtype}{int} osmo\_trxc\_client\_poweron(\textcolor{keyword}{struct} osmo\_trxc\_client *client,}
\DoxyCodeLine{93                                            osmo\_trxc\_client\_rsp\_cb *cb, \textcolor{keywordtype}{void} *cb\_data)}
\DoxyCodeLine{94 \{}
\DoxyCodeLine{95         \textcolor{keywordflow}{return} osmo\_trxc\_client\_send\_cmd(client, OSMO\_TRXC\_F\_CRITICAL, cb, cb\_data,}
\DoxyCodeLine{96                                          OSMO\_TRXC\_CMD\_POWERON, NULL);}
\DoxyCodeLine{97 \}}
\DoxyCodeLine{98 \textcolor{keyword}{static} \textcolor{keyword}{inline} \textcolor{keywordtype}{int} osmo\_trxc\_client\_poweroff(\textcolor{keyword}{struct} osmo\_trxc\_client *client,}
\DoxyCodeLine{99                                             osmo\_trxc\_client\_rsp\_cb *cb, \textcolor{keywordtype}{void} *cb\_data)}
\DoxyCodeLine{100 \{}
\DoxyCodeLine{101         \textcolor{keywordflow}{return} osmo\_trxc\_client\_send\_cmd(client, OSMO\_TRXC\_F\_CRITICAL, cb, cb\_data,}
\DoxyCodeLine{102                                          OSMO\_TRXC\_CMD\_POWEROFF, NULL);}
\DoxyCodeLine{103 \}}
\DoxyCodeLine{104 \textcolor{keyword}{static} \textcolor{keyword}{inline} \textcolor{keywordtype}{int} osmo\_trxc\_client\_rxtune(\textcolor{keyword}{struct} osmo\_trxc\_client *client,}
\DoxyCodeLine{105                                           \textcolor{keywordtype}{unsigned} \textcolor{keywordtype}{int} freq\_khz,}
\DoxyCodeLine{106                                           osmo\_trxc\_client\_rsp\_cb *cb, \textcolor{keywordtype}{void} *cb\_data)}
\DoxyCodeLine{107 \{}
\DoxyCodeLine{108         \textcolor{keywordflow}{return} osmo\_trxc\_client\_send\_cmd(client, OSMO\_TRXC\_F\_CRITICAL, cb, cb\_data,}
\DoxyCodeLine{109                                          OSMO\_TRXC\_CMD\_RXTUNE, \textcolor{stringliteral}{"{}\%u"{}}, freq\_khz);}
\DoxyCodeLine{110 \}}
\DoxyCodeLine{111 \textcolor{keyword}{static} \textcolor{keyword}{inline} \textcolor{keywordtype}{int} osmo\_trxc\_client\_txtune(\textcolor{keyword}{struct} osmo\_trxc\_client *client,}
\DoxyCodeLine{112                                           \textcolor{keywordtype}{unsigned} \textcolor{keywordtype}{int} freq\_khz,}
\DoxyCodeLine{113                                           osmo\_trxc\_client\_rsp\_cb *cb, \textcolor{keywordtype}{void} *cb\_data)}
\DoxyCodeLine{114 \{}
\DoxyCodeLine{115         \textcolor{keywordflow}{return} osmo\_trxc\_client\_send\_cmd(client, OSMO\_TRXC\_F\_CRITICAL, cb, cb\_data,}
\DoxyCodeLine{116                                          OSMO\_TRXC\_CMD\_TXTUNE, \textcolor{stringliteral}{"{}\%u"{}}, freq\_khz);}
\DoxyCodeLine{117 \}}

\end{DoxyCode}
