MQTTVersion_8c.html 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221
  1. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  2. <html xmlns="http://www.w3.org/1999/xhtml">
  3. <head>
  4. <meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
  5. <meta http-equiv="X-UA-Compatible" content="IE=9"/>
  6. <meta name="generator" content="Doxygen 1.8.17"/>
  7. <meta name="viewport" content="width=device-width, initial-scale=1"/>
  8. <title>MQTT C Client Libraries Internals: MQTTVersion.c File Reference</title>
  9. <link href="tabs.css" rel="stylesheet" type="text/css"/>
  10. <script type="text/javascript" src="jquery.js"></script>
  11. <script type="text/javascript" src="dynsections.js"></script>
  12. <link href="search/search.css" rel="stylesheet" type="text/css"/>
  13. <script type="text/javascript" src="search/searchdata.js"></script>
  14. <script type="text/javascript" src="search/search.js"></script>
  15. <link href="doxygen.css" rel="stylesheet" type="text/css" />
  16. </head>
  17. <body>
  18. <div id="top"><!-- do not remove this div, it is closed by doxygen! -->
  19. <div id="titlearea">
  20. <table cellspacing="0" cellpadding="0">
  21. <tbody>
  22. <tr style="height: 56px;">
  23. <td id="projectlogo"><img alt="Logo" src="pahologo.png"/></td>
  24. <td id="projectalign" style="padding-left: 0.5em;">
  25. <div id="projectname">MQTT C Client Libraries Internals
  26. </div>
  27. </td>
  28. </tr>
  29. </tbody>
  30. </table>
  31. </div>
  32. <!-- end header part -->
  33. <!-- Generated by Doxygen 1.8.17 -->
  34. <script type="text/javascript">
  35. /* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
  36. var searchBox = new SearchBox("searchBox", "search",false,'Search');
  37. /* @license-end */
  38. </script>
  39. <script type="text/javascript" src="menudata.js"></script>
  40. <script type="text/javascript" src="menu.js"></script>
  41. <script type="text/javascript">
  42. /* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
  43. $(function() {
  44. initMenu('',true,false,'search.php','Search');
  45. $(document).ready(function() { init_search(); });
  46. });
  47. /* @license-end */</script>
  48. <div id="main-nav"></div>
  49. <!-- window showing the filter options -->
  50. <div id="MSearchSelectWindow"
  51. onmouseover="return searchBox.OnSearchSelectShow()"
  52. onmouseout="return searchBox.OnSearchSelectHide()"
  53. onkeydown="return searchBox.OnSearchSelectKey(event)">
  54. </div>
  55. <!-- iframe showing the search results (closed by default) -->
  56. <div id="MSearchResultsWindow">
  57. <iframe src="javascript:void(0)" frameborder="0"
  58. name="MSearchResults" id="MSearchResults">
  59. </iframe>
  60. </div>
  61. </div><!-- top -->
  62. <div class="header">
  63. <div class="summary">
  64. <a href="#define-members">Macros</a> &#124;
  65. <a href="#typedef-members">Typedefs</a> &#124;
  66. <a href="#func-members">Functions</a> &#124;
  67. <a href="#var-members">Variables</a> </div>
  68. <div class="headertitle">
  69. <div class="title">MQTTVersion.c File Reference</div> </div>
  70. </div><!--header-->
  71. <div class="contents">
  72. <p>MQTTVersion - display the version and build information strings for a library.
  73. <a href="#details">More...</a></p>
  74. <div class="textblock"><code>#include &lt;stdio.h&gt;</code><br />
  75. <code>#include &lt;stdlib.h&gt;</code><br />
  76. <code>#include &lt;string.h&gt;</code><br />
  77. <code>#include &lt;errno.h&gt;</code><br />
  78. <code>#include &lt;fcntl.h&gt;</code><br />
  79. <code>#include &lt;sys/types.h&gt;</code><br />
  80. <code>#include &lt;ctype.h&gt;</code><br />
  81. <code>#include &quot;MQTTAsync.h&quot;</code><br />
  82. <code>#include &lt;dlfcn.h&gt;</code><br />
  83. <code>#include &lt;sys/mman.h&gt;</code><br />
  84. <code>#include &lt;unistd.h&gt;</code><br />
  85. </div><div class="textblock"><div class="dynheader">
  86. Include dependency graph for MQTTVersion.c:</div>
  87. <div class="dyncontent">
  88. <div class="center"><img src="MQTTVersion_8c__incl.png" border="0" usemap="#MQTTVersion_8c" alt=""/></div>
  89. <map name="MQTTVersion_8c" id="MQTTVersion_8c">
  90. <area shape="rect" title="MQTTVersion &#45; display the version and build information strings for a library." alt="" coords="371,5,484,32"/>
  91. <area shape="rect" title=" " alt="" coords="5,80,65,107"/>
  92. <area shape="rect" title=" " alt="" coords="89,80,152,107"/>
  93. <area shape="rect" title=" " alt="" coords="177,80,241,107"/>
  94. <area shape="rect" title=" " alt="" coords="265,80,326,107"/>
  95. <area shape="rect" title=" " alt="" coords="351,80,408,107"/>
  96. <area shape="rect" title=" " alt="" coords="432,80,519,107"/>
  97. <area shape="rect" title=" " alt="" coords="543,80,605,107"/>
  98. <area shape="rect" title=" " alt="" coords="629,80,689,107"/>
  99. <area shape="rect" title=" " alt="" coords="713,80,805,107"/>
  100. <area shape="rect" title=" " alt="" coords="830,80,897,107"/>
  101. </map>
  102. </div>
  103. </div><table class="memberdecls">
  104. <tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="define-members"></a>
  105. Macros</h2></td></tr>
  106. <tr class="memitem:a25f003de16c08a4888b69f619d70f427"><td class="memItemLeft" align="right" valign="top"><a id="a25f003de16c08a4888b69f619d70f427"></a>
  107. #define&#160;</td><td class="memItemRight" valign="bottom"><b>ARRAY_SIZE</b>(a)&#160;&#160;&#160;(sizeof(a) / sizeof(a[0]))</td></tr>
  108. <tr class="separator:a25f003de16c08a4888b69f619d70f427"><td class="memSeparator" colspan="2">&#160;</td></tr>
  109. </table><table class="memberdecls">
  110. <tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="typedef-members"></a>
  111. Typedefs</h2></td></tr>
  112. <tr class="memitem:a03af212f14771e3a937b54f0b82b5528"><td class="memItemLeft" align="right" valign="top"><a id="a03af212f14771e3a937b54f0b82b5528"></a>
  113. typedef <a class="el" href="structMQTTAsync__nameValue.html">MQTTAsync_nameValue</a> *(*&#160;</td><td class="memItemRight" valign="bottom"><b>func_type</b>) (void)</td></tr>
  114. <tr class="separator:a03af212f14771e3a937b54f0b82b5528"><td class="memSeparator" colspan="2">&#160;</td></tr>
  115. </table><table class="memberdecls">
  116. <tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="func-members"></a>
  117. Functions</h2></td></tr>
  118. <tr class="memitem:a60231c316988ddb6d3ecf20a3195fe8d"><td class="memItemLeft" align="right" valign="top">char *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="MQTTVersion_8c.html#a60231c316988ddb6d3ecf20a3195fe8d">FindString</a> (char *filename, const char *eyecatcher_input)</td></tr>
  119. <tr class="memdesc:a60231c316988ddb6d3ecf20a3195fe8d"><td class="mdescLeft">&#160;</td><td class="mdescRight">Finds an eyecatcher in a binary file and returns the following value. <a href="MQTTVersion_8c.html#a60231c316988ddb6d3ecf20a3195fe8d">More...</a><br /></td></tr>
  120. <tr class="separator:a60231c316988ddb6d3ecf20a3195fe8d"><td class="memSeparator" colspan="2">&#160;</td></tr>
  121. <tr class="memitem:a7a069c25310a625d77a9ed2324e0f5ab"><td class="memItemLeft" align="right" valign="top"><a id="a7a069c25310a625d77a9ed2324e0f5ab"></a>
  122. int&#160;</td><td class="memItemRight" valign="bottom"><b>printVersionInfo</b> (<a class="el" href="structMQTTAsync__nameValue.html">MQTTAsync_nameValue</a> *info)</td></tr>
  123. <tr class="separator:a7a069c25310a625d77a9ed2324e0f5ab"><td class="memSeparator" colspan="2">&#160;</td></tr>
  124. <tr class="memitem:a00e897e753d83550bb5094bcb153828a"><td class="memItemLeft" align="right" valign="top"><a id="a00e897e753d83550bb5094bcb153828a"></a>
  125. int&#160;</td><td class="memItemRight" valign="bottom"><b>loadandcall</b> (const char *libname)</td></tr>
  126. <tr class="separator:a00e897e753d83550bb5094bcb153828a"><td class="memSeparator" colspan="2">&#160;</td></tr>
  127. <tr class="memitem:a889e1ee5b289c4b99cbd5f0ca7e8cbdb"><td class="memItemLeft" align="right" valign="top"><a id="a889e1ee5b289c4b99cbd5f0ca7e8cbdb"></a>
  128. void&#160;</td><td class="memItemRight" valign="bottom"><b>printEyecatchers</b> (char *filename)</td></tr>
  129. <tr class="separator:a889e1ee5b289c4b99cbd5f0ca7e8cbdb"><td class="memSeparator" colspan="2">&#160;</td></tr>
  130. <tr class="memitem:a3c04138a5bfe5d72780bb7e82a18e627"><td class="memItemLeft" align="right" valign="top"><a id="a3c04138a5bfe5d72780bb7e82a18e627"></a>
  131. int&#160;</td><td class="memItemRight" valign="bottom"><b>main</b> (int argc, char **argv)</td></tr>
  132. <tr class="separator:a3c04138a5bfe5d72780bb7e82a18e627"><td class="memSeparator" colspan="2">&#160;</td></tr>
  133. </table><table class="memberdecls">
  134. <tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="var-members"></a>
  135. Variables</h2></td></tr>
  136. <tr class="memitem:a79de8d8beaad5d50b6f3c6cff3b574f5"><td class="memItemLeft" align="right" valign="top"><a id="a79de8d8beaad5d50b6f3c6cff3b574f5"></a>
  137. static const char *&#160;</td><td class="memItemRight" valign="bottom"><b>libraries</b> [] = {&quot;paho-mqtt3c&quot;, &quot;paho-mqtt3cs&quot;, &quot;paho-mqtt3a&quot;, &quot;paho-mqtt3as&quot;}</td></tr>
  138. <tr class="separator:a79de8d8beaad5d50b6f3c6cff3b574f5"><td class="memSeparator" colspan="2">&#160;</td></tr>
  139. <tr class="memitem:affd3a14730545c8f212ab574376b0824"><td class="memItemLeft" align="right" valign="top">static const char *&#160;</td><td class="memItemRight" valign="bottom"><b>eyecatchers</b> []</td></tr>
  140. <tr class="separator:affd3a14730545c8f212ab574376b0824"><td class="memSeparator" colspan="2">&#160;</td></tr>
  141. </table>
  142. <a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
  143. <div class="textblock"><p>MQTTVersion - display the version and build information strings for a library. </p>
  144. <p>With no arguments, we try to load and call the version string for the libraries we know about: mqttv3c, mqttv3cs, mqttv3a, mqttv3as. With an argument: 1) we try to load the named library, call getVersionInfo and display those values. 2) If that doesn't work, we look through the binary for eyecatchers, and display those. <br />
  145. This will work if the library is not executable in the current environment. </p>
  146. </div><h2 class="groupheader">Function Documentation</h2>
  147. <a id="a60231c316988ddb6d3ecf20a3195fe8d"></a>
  148. <h2 class="memtitle"><span class="permalink"><a href="#a60231c316988ddb6d3ecf20a3195fe8d">&#9670;&nbsp;</a></span>FindString()</h2>
  149. <div class="memitem">
  150. <div class="memproto">
  151. <table class="memname">
  152. <tr>
  153. <td class="memname">char * FindString </td>
  154. <td>(</td>
  155. <td class="paramtype">char *&#160;</td>
  156. <td class="paramname"><em>filename</em>, </td>
  157. </tr>
  158. <tr>
  159. <td class="paramkey"></td>
  160. <td></td>
  161. <td class="paramtype">const char *&#160;</td>
  162. <td class="paramname"><em>eyecatcher_input</em>&#160;</td>
  163. </tr>
  164. <tr>
  165. <td></td>
  166. <td>)</td>
  167. <td></td><td></td>
  168. </tr>
  169. </table>
  170. </div><div class="memdoc">
  171. <p>Finds an eyecatcher in a binary file and returns the following value. </p>
  172. <dl class="params"><dt>Parameters</dt><dd>
  173. <table class="params">
  174. <tr><td class="paramname">filename</td><td>the name of the file </td></tr>
  175. <tr><td class="paramname">eyecatcher_input</td><td>the eyecatcher string to look for </td></tr>
  176. </table>
  177. </dd>
  178. </dl>
  179. <dl class="section return"><dt>Returns</dt><dd>the value found - "" if not found </dd></dl>
  180. </div>
  181. </div>
  182. <h2 class="groupheader">Variable Documentation</h2>
  183. <a id="affd3a14730545c8f212ab574376b0824"></a>
  184. <h2 class="memtitle"><span class="permalink"><a href="#affd3a14730545c8f212ab574376b0824">&#9670;&nbsp;</a></span>eyecatchers</h2>
  185. <div class="memitem">
  186. <div class="memproto">
  187. <table class="mlabels">
  188. <tr>
  189. <td class="mlabels-left">
  190. <table class="memname">
  191. <tr>
  192. <td class="memname">const char* eyecatchers[]</td>
  193. </tr>
  194. </table>
  195. </td>
  196. <td class="mlabels-right">
  197. <span class="mlabels"><span class="mlabel">static</span></span> </td>
  198. </tr>
  199. </table>
  200. </div><div class="memdoc">
  201. <b>Initial value:</b><div class="fragment"><div class="line">= {<span class="stringliteral">&quot;MQTTAsyncV3_Version&quot;</span>, <span class="stringliteral">&quot;MQTTAsyncV3_Timestamp&quot;</span>,</div>
  202. <div class="line"> <span class="stringliteral">&quot;MQTTClientV3_Version&quot;</span>, <span class="stringliteral">&quot;MQTTClientV3_Timestamp&quot;</span>}</div>
  203. </div><!-- fragment -->
  204. </div>
  205. </div>
  206. </div><!-- contents -->
  207. <!-- start footer part -->
  208. <hr class="footer"/><address class="footer"><small>
  209. Generated on Thu Sep 29 2022 11:34:46 for MQTT C Client Libraries Internals by &#160;<a href="http://www.doxygen.org/index.html">
  210. <img class="footer" src="doxygen.png" alt="doxygen"/>
  211. </a> 1.8.17
  212. </small></address>
  213. </body>
  214. </html>