\hypertarget{mqttcommon_8h}{}\doxysection{mqtt/mqttcommon.h File Reference}
\label{mqttcommon_8h}\index{mqtt/mqttcommon.h@{mqtt/mqttcommon.h}}


Common macros and utility functions for G\+Streamer M\+Q\+TT plugins.  


{\ttfamily \#include $<$stdint.\+h$>$}\newline
Include dependency graph for mqttcommon.\+h\+:
\nopagebreak
\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=198pt]{mqttcommon_8h__incl}
\end{center}
\end{figure}
This graph shows which files directly or indirectly include this file\+:
\nopagebreak
\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=350pt]{mqttcommon_8h__dep__incl}
\end{center}
\end{figure}
\doxysubsection*{Classes}
\begin{DoxyCompactItemize}
\item 
struct \mbox{\hyperlink{struct__GstMQTTMessageHdr}{\+\_\+\+Gst\+M\+Q\+T\+T\+Message\+Hdr}}
\begin{DoxyCompactList}\small\item\em Defined a custom data type, Gst\+M\+Q\+T\+T\+Message\+Hdr. \end{DoxyCompactList}\end{DoxyCompactItemize}
\doxysubsection*{Macros}
\begin{DoxyCompactItemize}
\item 
\#define \mbox{\hyperlink{mqttcommon_8h_aea1d71af1a30c261dbd16745c82e94ba}{U\+N\+U\+S\+ED}}(expr)~do \{ (void)(expr); \} \mbox{\hyperlink{tensor__data_8c_a8ca9996595b367352d5665c3ee092ffa}{while}} (0)
\item 
\#define \mbox{\hyperlink{mqttcommon_8h_af872662f68cfffdc1cb6f16fa3205dab}{G\+S\+T\+\_\+\+M\+Q\+T\+T\+\_\+\+P\+A\+C\+K\+A\+GE}}~\char`\"{}G\+Streamer M\+Q\+TT Plugins\char`\"{}
\item 
\#define \mbox{\hyperlink{mqttcommon_8h_af5aa4ef985f05676d1895972b1ccbc8e}{G\+S\+T\+\_\+\+M\+Q\+T\+T\+\_\+\+E\+L\+E\+M\+\_\+\+N\+A\+M\+E\+\_\+\+S\+I\+NK}}~\char`\"{}mqttsink\char`\"{}
\item 
\#define \mbox{\hyperlink{mqttcommon_8h_a149f3af7244f50107ef140fedd399704}{G\+S\+T\+\_\+\+M\+Q\+T\+T\+\_\+\+E\+L\+E\+M\+\_\+\+N\+A\+M\+E\+\_\+\+S\+RC}}~\char`\"{}mqttsrc\char`\"{}
\item 
\#define \mbox{\hyperlink{mqttcommon_8h_aafb529b8f93203f57db2e4866154ec87}{G\+S\+T\+\_\+\+M\+Q\+T\+T\+\_\+\+L\+E\+N\+\_\+\+M\+S\+G\+\_\+\+H\+DR}}~1024
\item 
\#define \mbox{\hyperlink{mqttcommon_8h_a18df859b7a263de01316fbbc3a25a513}{G\+S\+T\+\_\+\+M\+Q\+T\+T\+\_\+\+M\+A\+X\+\_\+\+L\+E\+N\+\_\+\+G\+S\+T\+\_\+\+C\+A\+P\+S\+\_\+\+S\+TR}}~512
\item 
\#define \mbox{\hyperlink{mqttcommon_8h_aa36aacf318e31c69d441868b24a89bc1}{G\+S\+T\+\_\+\+M\+Q\+T\+T\+\_\+\+M\+A\+X\+\_\+\+N\+U\+M\+\_\+\+M\+E\+MS}}~16
\begin{DoxyCompactList}\small\item\em G\+S\+T\+\_\+\+B\+U\+F\+F\+E\+R\+\_\+\+M\+E\+M\+\_\+\+M\+AX in gstreamer/gstbuffer.\+c is 16. To represent each size of the memory block that the Gst\+Buffer contains, G\+S\+T\+\_\+\+M\+Q\+T\+T\+\_\+\+M\+A\+X\+\_\+\+N\+U\+M\+\_\+\+M\+E\+MS should be 16. \end{DoxyCompactList}\item 
\#define \mbox{\hyperlink{mqttcommon_8h_aafc33bc090c04c175fe61def3bdbd0f2}{G\+S\+T\+\_\+\+U\+S\+\_\+\+T\+O\+\_\+\+N\+S\+\_\+\+M\+U\+L\+T\+I\+P\+L\+I\+ER}}~1000
\item 
\#define \mbox{\hyperlink{mqttcommon_8h_a39a6cac680ef160b3d83e105c3c8ed03}{D\+E\+F\+A\+U\+L\+T\+\_\+\+M\+Q\+T\+T\+\_\+\+C\+O\+N\+N\+\_\+\+T\+I\+M\+E\+O\+U\+T\+\_\+\+S\+EC}}~5
\end{DoxyCompactItemize}
\doxysubsection*{Typedefs}
\begin{DoxyCompactItemize}
\item 
typedef struct \mbox{\hyperlink{struct__GstMQTTMessageHdr}{\+\_\+\+Gst\+M\+Q\+T\+T\+Message\+Hdr}} \mbox{\hyperlink{mqttcommon_8h_aebbdc549dc7aa1431f3b2b9a0b5e8f2c}{Gst\+M\+Q\+T\+T\+Message\+Hdr}}
\begin{DoxyCompactList}\small\item\em Defined a custom data type, Gst\+M\+Q\+T\+T\+Message\+Hdr. \end{DoxyCompactList}\item 
typedef int64\+\_\+t($\ast$ \mbox{\hyperlink{mqttcommon_8h_a2d669a47a3cb13e8e89c2e66832ee75d}{mqtt\+\_\+get\+\_\+unix\+\_\+epoch}}) (uint32\+\_\+t, char $\ast$$\ast$, uint16\+\_\+t $\ast$)
\end{DoxyCompactItemize}
\doxysubsection*{Functions}
\begin{DoxyCompactItemize}
\item 
static int64\+\_\+t \mbox{\hyperlink{mqttcommon_8h_a5046192460aad80a0381b2857210215f}{default\+\_\+mqtt\+\_\+get\+\_\+unix\+\_\+epoch}} (uint32\+\_\+t hnum, char $\ast$$\ast$hnames, uint16\+\_\+t $\ast$hports)
\begin{DoxyCompactList}\small\item\em A wrapper function of g\+\_\+get\+\_\+real\+\_\+time () to assign it to the function pointer, mqtt\+\_\+get\+\_\+unix\+\_\+epoch. \end{DoxyCompactList}\end{DoxyCompactItemize}


\doxysubsection{Detailed Description}
Common macros and utility functions for G\+Streamer M\+Q\+TT plugins. 

Copyright (C) 2021 Wook Song \href{mailto:wook16.song@samsung.com}{\texttt{ wook16.\+song@samsung.\+com}}

\begin{DoxyDate}{Date}
08 Mar 2021 
\end{DoxyDate}
\begin{DoxySeeAlso}{See also}
\href{https://github.com/nnstreamer/nnstreamer}{\texttt{ https\+://github.\+com/nnstreamer/nnstreamer}} 
\end{DoxySeeAlso}
\begin{DoxyAuthor}{Author}
Wook Song \href{mailto:wook16.song@samsung.com}{\texttt{ wook16.\+song@samsung.\+com}} 
\end{DoxyAuthor}
\begin{DoxyRefDesc}{Bug}
\item[\mbox{\hyperlink{bug__bug000016}{Bug}}]No known bugs except for N\+YI items \end{DoxyRefDesc}


\doxysubsection{Macro Definition Documentation}
\mbox{\Hypertarget{mqttcommon_8h_a39a6cac680ef160b3d83e105c3c8ed03}\label{mqttcommon_8h_a39a6cac680ef160b3d83e105c3c8ed03}} 
\index{mqttcommon.h@{mqttcommon.h}!DEFAULT\_MQTT\_CONN\_TIMEOUT\_SEC@{DEFAULT\_MQTT\_CONN\_TIMEOUT\_SEC}}
\index{DEFAULT\_MQTT\_CONN\_TIMEOUT\_SEC@{DEFAULT\_MQTT\_CONN\_TIMEOUT\_SEC}!mqttcommon.h@{mqttcommon.h}}
\doxysubsubsection{\texorpdfstring{DEFAULT\_MQTT\_CONN\_TIMEOUT\_SEC}{DEFAULT\_MQTT\_CONN\_TIMEOUT\_SEC}}
{\footnotesize\ttfamily \#define D\+E\+F\+A\+U\+L\+T\+\_\+\+M\+Q\+T\+T\+\_\+\+C\+O\+N\+N\+\_\+\+T\+I\+M\+E\+O\+U\+T\+\_\+\+S\+EC~5}



Definition at line 40 of file mqttcommon.\+h.

\mbox{\Hypertarget{mqttcommon_8h_af5aa4ef985f05676d1895972b1ccbc8e}\label{mqttcommon_8h_af5aa4ef985f05676d1895972b1ccbc8e}} 
\index{mqttcommon.h@{mqttcommon.h}!GST\_MQTT\_ELEM\_NAME\_SINK@{GST\_MQTT\_ELEM\_NAME\_SINK}}
\index{GST\_MQTT\_ELEM\_NAME\_SINK@{GST\_MQTT\_ELEM\_NAME\_SINK}!mqttcommon.h@{mqttcommon.h}}
\doxysubsubsection{\texorpdfstring{GST\_MQTT\_ELEM\_NAME\_SINK}{GST\_MQTT\_ELEM\_NAME\_SINK}}
{\footnotesize\ttfamily \#define G\+S\+T\+\_\+\+M\+Q\+T\+T\+\_\+\+E\+L\+E\+M\+\_\+\+N\+A\+M\+E\+\_\+\+S\+I\+NK~\char`\"{}mqttsink\char`\"{}}



Definition at line 26 of file mqttcommon.\+h.

\mbox{\Hypertarget{mqttcommon_8h_a149f3af7244f50107ef140fedd399704}\label{mqttcommon_8h_a149f3af7244f50107ef140fedd399704}} 
\index{mqttcommon.h@{mqttcommon.h}!GST\_MQTT\_ELEM\_NAME\_SRC@{GST\_MQTT\_ELEM\_NAME\_SRC}}
\index{GST\_MQTT\_ELEM\_NAME\_SRC@{GST\_MQTT\_ELEM\_NAME\_SRC}!mqttcommon.h@{mqttcommon.h}}
\doxysubsubsection{\texorpdfstring{GST\_MQTT\_ELEM\_NAME\_SRC}{GST\_MQTT\_ELEM\_NAME\_SRC}}
{\footnotesize\ttfamily \#define G\+S\+T\+\_\+\+M\+Q\+T\+T\+\_\+\+E\+L\+E\+M\+\_\+\+N\+A\+M\+E\+\_\+\+S\+RC~\char`\"{}mqttsrc\char`\"{}}



Definition at line 27 of file mqttcommon.\+h.

\mbox{\Hypertarget{mqttcommon_8h_aafb529b8f93203f57db2e4866154ec87}\label{mqttcommon_8h_aafb529b8f93203f57db2e4866154ec87}} 
\index{mqttcommon.h@{mqttcommon.h}!GST\_MQTT\_LEN\_MSG\_HDR@{GST\_MQTT\_LEN\_MSG\_HDR}}
\index{GST\_MQTT\_LEN\_MSG\_HDR@{GST\_MQTT\_LEN\_MSG\_HDR}!mqttcommon.h@{mqttcommon.h}}
\doxysubsubsection{\texorpdfstring{GST\_MQTT\_LEN\_MSG\_HDR}{GST\_MQTT\_LEN\_MSG\_HDR}}
{\footnotesize\ttfamily \#define G\+S\+T\+\_\+\+M\+Q\+T\+T\+\_\+\+L\+E\+N\+\_\+\+M\+S\+G\+\_\+\+H\+DR~1024}



Definition at line 29 of file mqttcommon.\+h.

\mbox{\Hypertarget{mqttcommon_8h_a18df859b7a263de01316fbbc3a25a513}\label{mqttcommon_8h_a18df859b7a263de01316fbbc3a25a513}} 
\index{mqttcommon.h@{mqttcommon.h}!GST\_MQTT\_MAX\_LEN\_GST\_CAPS\_STR@{GST\_MQTT\_MAX\_LEN\_GST\_CAPS\_STR}}
\index{GST\_MQTT\_MAX\_LEN\_GST\_CAPS\_STR@{GST\_MQTT\_MAX\_LEN\_GST\_CAPS\_STR}!mqttcommon.h@{mqttcommon.h}}
\doxysubsubsection{\texorpdfstring{GST\_MQTT\_MAX\_LEN\_GST\_CAPS\_STR}{GST\_MQTT\_MAX\_LEN\_GST\_CAPS\_STR}}
{\footnotesize\ttfamily \#define G\+S\+T\+\_\+\+M\+Q\+T\+T\+\_\+\+M\+A\+X\+\_\+\+L\+E\+N\+\_\+\+G\+S\+T\+\_\+\+C\+A\+P\+S\+\_\+\+S\+TR~512}



Definition at line 30 of file mqttcommon.\+h.

\mbox{\Hypertarget{mqttcommon_8h_aa36aacf318e31c69d441868b24a89bc1}\label{mqttcommon_8h_aa36aacf318e31c69d441868b24a89bc1}} 
\index{mqttcommon.h@{mqttcommon.h}!GST\_MQTT\_MAX\_NUM\_MEMS@{GST\_MQTT\_MAX\_NUM\_MEMS}}
\index{GST\_MQTT\_MAX\_NUM\_MEMS@{GST\_MQTT\_MAX\_NUM\_MEMS}!mqttcommon.h@{mqttcommon.h}}
\doxysubsubsection{\texorpdfstring{GST\_MQTT\_MAX\_NUM\_MEMS}{GST\_MQTT\_MAX\_NUM\_MEMS}}
{\footnotesize\ttfamily \#define G\+S\+T\+\_\+\+M\+Q\+T\+T\+\_\+\+M\+A\+X\+\_\+\+N\+U\+M\+\_\+\+M\+E\+MS~16}



G\+S\+T\+\_\+\+B\+U\+F\+F\+E\+R\+\_\+\+M\+E\+M\+\_\+\+M\+AX in gstreamer/gstbuffer.\+c is 16. To represent each size of the memory block that the Gst\+Buffer contains, G\+S\+T\+\_\+\+M\+Q\+T\+T\+\_\+\+M\+A\+X\+\_\+\+N\+U\+M\+\_\+\+M\+E\+MS should be 16. 



Definition at line 36 of file mqttcommon.\+h.

\mbox{\Hypertarget{mqttcommon_8h_af872662f68cfffdc1cb6f16fa3205dab}\label{mqttcommon_8h_af872662f68cfffdc1cb6f16fa3205dab}} 
\index{mqttcommon.h@{mqttcommon.h}!GST\_MQTT\_PACKAGE@{GST\_MQTT\_PACKAGE}}
\index{GST\_MQTT\_PACKAGE@{GST\_MQTT\_PACKAGE}!mqttcommon.h@{mqttcommon.h}}
\doxysubsubsection{\texorpdfstring{GST\_MQTT\_PACKAGE}{GST\_MQTT\_PACKAGE}}
{\footnotesize\ttfamily \#define G\+S\+T\+\_\+\+M\+Q\+T\+T\+\_\+\+P\+A\+C\+K\+A\+GE~\char`\"{}G\+Streamer M\+Q\+TT Plugins\char`\"{}}



Definition at line 23 of file mqttcommon.\+h.

\mbox{\Hypertarget{mqttcommon_8h_aafc33bc090c04c175fe61def3bdbd0f2}\label{mqttcommon_8h_aafc33bc090c04c175fe61def3bdbd0f2}} 
\index{mqttcommon.h@{mqttcommon.h}!GST\_US\_TO\_NS\_MULTIPLIER@{GST\_US\_TO\_NS\_MULTIPLIER}}
\index{GST\_US\_TO\_NS\_MULTIPLIER@{GST\_US\_TO\_NS\_MULTIPLIER}!mqttcommon.h@{mqttcommon.h}}
\doxysubsubsection{\texorpdfstring{GST\_US\_TO\_NS\_MULTIPLIER}{GST\_US\_TO\_NS\_MULTIPLIER}}
{\footnotesize\ttfamily \#define G\+S\+T\+\_\+\+U\+S\+\_\+\+T\+O\+\_\+\+N\+S\+\_\+\+M\+U\+L\+T\+I\+P\+L\+I\+ER~1000}



Definition at line 38 of file mqttcommon.\+h.

\mbox{\Hypertarget{mqttcommon_8h_aea1d71af1a30c261dbd16745c82e94ba}\label{mqttcommon_8h_aea1d71af1a30c261dbd16745c82e94ba}} 
\index{mqttcommon.h@{mqttcommon.h}!UNUSED@{UNUSED}}
\index{UNUSED@{UNUSED}!mqttcommon.h@{mqttcommon.h}}
\doxysubsubsection{\texorpdfstring{UNUSED}{UNUSED}}
{\footnotesize\ttfamily \#define U\+N\+U\+S\+ED(\begin{DoxyParamCaption}\item[{}]{expr }\end{DoxyParamCaption})~do \{ (void)(expr); \} \mbox{\hyperlink{tensor__data_8c_a8ca9996595b367352d5665c3ee092ffa}{while}} (0)}



Definition at line 19 of file mqttcommon.\+h.



\doxysubsection{Typedef Documentation}
\mbox{\Hypertarget{mqttcommon_8h_aebbdc549dc7aa1431f3b2b9a0b5e8f2c}\label{mqttcommon_8h_aebbdc549dc7aa1431f3b2b9a0b5e8f2c}} 
\index{mqttcommon.h@{mqttcommon.h}!GstMQTTMessageHdr@{GstMQTTMessageHdr}}
\index{GstMQTTMessageHdr@{GstMQTTMessageHdr}!mqttcommon.h@{mqttcommon.h}}
\doxysubsubsection{\texorpdfstring{GstMQTTMessageHdr}{GstMQTTMessageHdr}}
{\footnotesize\ttfamily typedef struct \mbox{\hyperlink{struct__GstMQTTMessageHdr}{\+\_\+\+Gst\+M\+Q\+T\+T\+Message\+Hdr}} \mbox{\hyperlink{mqttcommon_8h_aebbdc549dc7aa1431f3b2b9a0b5e8f2c}{Gst\+M\+Q\+T\+T\+Message\+Hdr}}}



Defined a custom data type, Gst\+M\+Q\+T\+T\+Message\+Hdr. 

Gst\+M\+Q\+T\+T\+Message\+Hdr contains the information needed to parse the message data at the subscriber side and is prepended to the original message data at the publisher side. \mbox{\Hypertarget{mqttcommon_8h_a2d669a47a3cb13e8e89c2e66832ee75d}\label{mqttcommon_8h_a2d669a47a3cb13e8e89c2e66832ee75d}} 
\index{mqttcommon.h@{mqttcommon.h}!mqtt\_get\_unix\_epoch@{mqtt\_get\_unix\_epoch}}
\index{mqtt\_get\_unix\_epoch@{mqtt\_get\_unix\_epoch}!mqttcommon.h@{mqttcommon.h}}
\doxysubsubsection{\texorpdfstring{mqtt\_get\_unix\_epoch}{mqtt\_get\_unix\_epoch}}
{\footnotesize\ttfamily typedef int64\+\_\+t($\ast$ mqtt\+\_\+get\+\_\+unix\+\_\+epoch) (uint32\+\_\+t, char $\ast$$\ast$, uint16\+\_\+t $\ast$)}



Definition at line 65 of file mqttcommon.\+h.



\doxysubsection{Function Documentation}
\mbox{\Hypertarget{mqttcommon_8h_a5046192460aad80a0381b2857210215f}\label{mqttcommon_8h_a5046192460aad80a0381b2857210215f}} 
\index{mqttcommon.h@{mqttcommon.h}!default\_mqtt\_get\_unix\_epoch@{default\_mqtt\_get\_unix\_epoch}}
\index{default\_mqtt\_get\_unix\_epoch@{default\_mqtt\_get\_unix\_epoch}!mqttcommon.h@{mqttcommon.h}}
\doxysubsubsection{\texorpdfstring{default\_mqtt\_get\_unix\_epoch()}{default\_mqtt\_get\_unix\_epoch()}}
{\footnotesize\ttfamily static int64\+\_\+t default\+\_\+mqtt\+\_\+get\+\_\+unix\+\_\+epoch (\begin{DoxyParamCaption}\item[{uint32\+\_\+t}]{hnum,  }\item[{char $\ast$$\ast$}]{hnames,  }\item[{uint16\+\_\+t $\ast$}]{hports }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [inline]}, {\ttfamily [static]}}



A wrapper function of g\+\_\+get\+\_\+real\+\_\+time () to assign it to the function pointer, mqtt\+\_\+get\+\_\+unix\+\_\+epoch. 



Definition at line 71 of file mqttcommon.\+h.

Here is the caller graph for this function\+:
\nopagebreak
\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=350pt]{mqttcommon_8h_a5046192460aad80a0381b2857210215f_icgraph}
\end{center}
\end{figure}
