MQTTPacketOut_8c.html 37 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637
  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: MQTTPacketOut.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="#func-members">Functions</a> </div>
  65. <div class="headertitle">
  66. <div class="title">MQTTPacketOut.c File Reference</div> </div>
  67. </div><!--header-->
  68. <div class="contents">
  69. <p>functions to deal with reading and writing of MQTT packets from and to sockets
  70. <a href="#details">More...</a></p>
  71. <div class="textblock"><code>#include &quot;MQTTPacketOut.h&quot;</code><br />
  72. <code>#include &quot;Log.h&quot;</code><br />
  73. <code>#include &quot;StackTrace.h&quot;</code><br />
  74. <code>#include &lt;string.h&gt;</code><br />
  75. <code>#include &lt;stdlib.h&gt;</code><br />
  76. <code>#include &quot;Heap.h&quot;</code><br />
  77. </div><div class="textblock"><div class="dynheader">
  78. Include dependency graph for MQTTPacketOut.c:</div>
  79. <div class="dyncontent">
  80. <div class="center"><img src="MQTTPacketOut_8c__incl.png" border="0" usemap="#MQTTPacketOut_8c" alt=""/></div>
  81. <map name="MQTTPacketOut_8c" id="MQTTPacketOut_8c">
  82. <area shape="rect" title="functions to deal with reading and writing of MQTT packets from and to sockets" alt="" coords="16,5,147,32"/>
  83. <area shape="rect" title=" " alt="" coords="5,80,69,107"/>
  84. <area shape="rect" title=" " alt="" coords="94,80,157,107"/>
  85. </map>
  86. </div>
  87. </div><table class="memberdecls">
  88. <tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="func-members"></a>
  89. Functions</h2></td></tr>
  90. <tr class="memitem:ad3c3f0919760286998e9b9eafaa47a36"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="MQTTPacketOut_8c.html#ad3c3f0919760286998e9b9eafaa47a36">MQTTPacket_send_connect</a> (<a class="el" href="structClients.html">Clients</a> *client, int MQTTVersion, <a class="el" href="structMQTTProperties.html">MQTTProperties</a> *connectProperties, <a class="el" href="structMQTTProperties.html">MQTTProperties</a> *willProperties)</td></tr>
  91. <tr class="memdesc:ad3c3f0919760286998e9b9eafaa47a36"><td class="mdescLeft">&#160;</td><td class="mdescRight">Send an MQTT CONNECT packet down a socket for V5 or later. <a href="MQTTPacketOut_8c.html#ad3c3f0919760286998e9b9eafaa47a36">More...</a><br /></td></tr>
  92. <tr class="separator:ad3c3f0919760286998e9b9eafaa47a36"><td class="memSeparator" colspan="2">&#160;</td></tr>
  93. <tr class="memitem:ad05dd32a547e82e0741d9d8279568a65"><td class="memItemLeft" align="right" valign="top">void *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="MQTTPacketOut_8c.html#ad05dd32a547e82e0741d9d8279568a65">MQTTPacket_connack</a> (int MQTTVersion, unsigned char aHeader, char *data, size_t datalen)</td></tr>
  94. <tr class="memdesc:ad05dd32a547e82e0741d9d8279568a65"><td class="mdescLeft">&#160;</td><td class="mdescRight">Function used in the new packets table to create connack packets. <a href="MQTTPacketOut_8c.html#ad05dd32a547e82e0741d9d8279568a65">More...</a><br /></td></tr>
  95. <tr class="separator:ad05dd32a547e82e0741d9d8279568a65"><td class="memSeparator" colspan="2">&#160;</td></tr>
  96. <tr class="memitem:a49e8e6789e17a29f5a448b8fab0a4137"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="MQTTPacketOut_8c.html#a49e8e6789e17a29f5a448b8fab0a4137">MQTTPacket_freeConnack</a> (<a class="el" href="structConnack.html">Connack</a> *pack)</td></tr>
  97. <tr class="memdesc:a49e8e6789e17a29f5a448b8fab0a4137"><td class="mdescLeft">&#160;</td><td class="mdescRight">Free allocated storage for a connack packet. <a href="MQTTPacketOut_8c.html#a49e8e6789e17a29f5a448b8fab0a4137">More...</a><br /></td></tr>
  98. <tr class="separator:a49e8e6789e17a29f5a448b8fab0a4137"><td class="memSeparator" colspan="2">&#160;</td></tr>
  99. <tr class="memitem:acf4b3402e224ac22ffbe74731f374fe0"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="MQTTPacketOut_8c.html#acf4b3402e224ac22ffbe74731f374fe0">MQTTPacket_send_pingreq</a> (<a class="el" href="structnetworkHandles.html">networkHandles</a> *net, const char *clientID)</td></tr>
  100. <tr class="memdesc:acf4b3402e224ac22ffbe74731f374fe0"><td class="mdescLeft">&#160;</td><td class="mdescRight">Send an MQTT PINGREQ packet down a socket. <a href="MQTTPacketOut_8c.html#acf4b3402e224ac22ffbe74731f374fe0">More...</a><br /></td></tr>
  101. <tr class="separator:acf4b3402e224ac22ffbe74731f374fe0"><td class="memSeparator" colspan="2">&#160;</td></tr>
  102. <tr class="memitem:a90212ed29c311f52a1dce0617133b1a7"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="MQTTPacketOut_8c.html#a90212ed29c311f52a1dce0617133b1a7">MQTTPacket_send_subscribe</a> (<a class="el" href="structList.html">List</a> *topics, <a class="el" href="structList.html">List</a> *qoss, <a class="el" href="structMQTTSubscribe__options.html">MQTTSubscribe_options</a> *opts, <a class="el" href="structMQTTProperties.html">MQTTProperties</a> *props, int msgid, int dup, <a class="el" href="structClients.html">Clients</a> *client)</td></tr>
  103. <tr class="memdesc:a90212ed29c311f52a1dce0617133b1a7"><td class="mdescLeft">&#160;</td><td class="mdescRight">Send an MQTT subscribe packet down a socket. <a href="MQTTPacketOut_8c.html#a90212ed29c311f52a1dce0617133b1a7">More...</a><br /></td></tr>
  104. <tr class="separator:a90212ed29c311f52a1dce0617133b1a7"><td class="memSeparator" colspan="2">&#160;</td></tr>
  105. <tr class="memitem:aee4b3e106128629671828ae7bfa70850"><td class="memItemLeft" align="right" valign="top">void *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="MQTTPacketOut_8c.html#aee4b3e106128629671828ae7bfa70850">MQTTPacket_suback</a> (int MQTTVersion, unsigned char aHeader, char *data, size_t datalen)</td></tr>
  106. <tr class="memdesc:aee4b3e106128629671828ae7bfa70850"><td class="mdescLeft">&#160;</td><td class="mdescRight">Function used in the new packets table to create suback packets. <a href="MQTTPacketOut_8c.html#aee4b3e106128629671828ae7bfa70850">More...</a><br /></td></tr>
  107. <tr class="separator:aee4b3e106128629671828ae7bfa70850"><td class="memSeparator" colspan="2">&#160;</td></tr>
  108. <tr class="memitem:a1ad4c9b76c6ab88c394ee925eb4dcd44"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="MQTTPacketOut_8c.html#a1ad4c9b76c6ab88c394ee925eb4dcd44">MQTTPacket_send_unsubscribe</a> (<a class="el" href="structList.html">List</a> *topics, <a class="el" href="structMQTTProperties.html">MQTTProperties</a> *props, int msgid, int dup, <a class="el" href="structClients.html">Clients</a> *client)</td></tr>
  109. <tr class="memdesc:a1ad4c9b76c6ab88c394ee925eb4dcd44"><td class="mdescLeft">&#160;</td><td class="mdescRight">Send an MQTT unsubscribe packet down a socket. <a href="MQTTPacketOut_8c.html#a1ad4c9b76c6ab88c394ee925eb4dcd44">More...</a><br /></td></tr>
  110. <tr class="separator:a1ad4c9b76c6ab88c394ee925eb4dcd44"><td class="memSeparator" colspan="2">&#160;</td></tr>
  111. <tr class="memitem:a93f6aa4b23d30f6c8c5be87b0b58e37c"><td class="memItemLeft" align="right" valign="top">void *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="MQTTPacketOut_8c.html#a93f6aa4b23d30f6c8c5be87b0b58e37c">MQTTPacket_unsuback</a> (int MQTTVersion, unsigned char aHeader, char *data, size_t datalen)</td></tr>
  112. <tr class="memdesc:a93f6aa4b23d30f6c8c5be87b0b58e37c"><td class="mdescLeft">&#160;</td><td class="mdescRight">Function used in the new packets table to create unsuback packets. <a href="MQTTPacketOut_8c.html#a93f6aa4b23d30f6c8c5be87b0b58e37c">More...</a><br /></td></tr>
  113. <tr class="separator:a93f6aa4b23d30f6c8c5be87b0b58e37c"><td class="memSeparator" colspan="2">&#160;</td></tr>
  114. </table>
  115. <a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
  116. <div class="textblock"><p>functions to deal with reading and writing of MQTT packets from and to sockets </p>
  117. <p>Some other related functions are in the <a class="el" href="structMQTTPacket.html" title="Data for a packet with header only.">MQTTPacket</a> module </p>
  118. </div><h2 class="groupheader">Function Documentation</h2>
  119. <a id="ad05dd32a547e82e0741d9d8279568a65"></a>
  120. <h2 class="memtitle"><span class="permalink"><a href="#ad05dd32a547e82e0741d9d8279568a65">&#9670;&nbsp;</a></span>MQTTPacket_connack()</h2>
  121. <div class="memitem">
  122. <div class="memproto">
  123. <table class="memname">
  124. <tr>
  125. <td class="memname">void* MQTTPacket_connack </td>
  126. <td>(</td>
  127. <td class="paramtype">int&#160;</td>
  128. <td class="paramname"><em>MQTTVersion</em>, </td>
  129. </tr>
  130. <tr>
  131. <td class="paramkey"></td>
  132. <td></td>
  133. <td class="paramtype">unsigned char&#160;</td>
  134. <td class="paramname"><em>aHeader</em>, </td>
  135. </tr>
  136. <tr>
  137. <td class="paramkey"></td>
  138. <td></td>
  139. <td class="paramtype">char *&#160;</td>
  140. <td class="paramname"><em>data</em>, </td>
  141. </tr>
  142. <tr>
  143. <td class="paramkey"></td>
  144. <td></td>
  145. <td class="paramtype">size_t&#160;</td>
  146. <td class="paramname"><em>datalen</em>&#160;</td>
  147. </tr>
  148. <tr>
  149. <td></td>
  150. <td>)</td>
  151. <td></td><td></td>
  152. </tr>
  153. </table>
  154. </div><div class="memdoc">
  155. <p>Function used in the new packets table to create connack packets. </p>
  156. <dl class="params"><dt>Parameters</dt><dd>
  157. <table class="params">
  158. <tr><td class="paramname">MQTTVersion</td><td>MQTT 5 or less? </td></tr>
  159. <tr><td class="paramname">aHeader</td><td>the MQTT header byte </td></tr>
  160. <tr><td class="paramname">data</td><td>the rest of the packet </td></tr>
  161. <tr><td class="paramname">datalen</td><td>the length of the rest of the packet </td></tr>
  162. </table>
  163. </dd>
  164. </dl>
  165. <dl class="section return"><dt>Returns</dt><dd>pointer to the packet structure </dd></dl>
  166. <div class="dynheader">
  167. Here is the call graph for this function:</div>
  168. <div class="dyncontent">
  169. <div class="center"><img src="MQTTPacketOut_8c_ad05dd32a547e82e0741d9d8279568a65_cgraph.png" border="0" usemap="#MQTTPacketOut_8c_ad05dd32a547e82e0741d9d8279568a65_cgraph" alt=""/></div>
  170. <map name="MQTTPacketOut_8c_ad05dd32a547e82e0741d9d8279568a65_cgraph" id="MQTTPacketOut_8c_ad05dd32a547e82e0741d9d8279568a65_cgraph">
  171. <area shape="rect" title="Function used in the new packets table to create connack packets." alt="" coords="5,5,161,32"/>
  172. <area shape="rect" href="MQTTPacket_8c.html#aff1d10b221f5b4ce421b4c2588cbe511" title="Reads one character from the input buffer." alt="" coords="209,5,284,32"/>
  173. </map>
  174. </div>
  175. </div>
  176. </div>
  177. <a id="a49e8e6789e17a29f5a448b8fab0a4137"></a>
  178. <h2 class="memtitle"><span class="permalink"><a href="#a49e8e6789e17a29f5a448b8fab0a4137">&#9670;&nbsp;</a></span>MQTTPacket_freeConnack()</h2>
  179. <div class="memitem">
  180. <div class="memproto">
  181. <table class="memname">
  182. <tr>
  183. <td class="memname">void MQTTPacket_freeConnack </td>
  184. <td>(</td>
  185. <td class="paramtype"><a class="el" href="structConnack.html">Connack</a> *&#160;</td>
  186. <td class="paramname"><em>pack</em></td><td>)</td>
  187. <td></td>
  188. </tr>
  189. </table>
  190. </div><div class="memdoc">
  191. <p>Free allocated storage for a connack packet. </p>
  192. <dl class="params"><dt>Parameters</dt><dd>
  193. <table class="params">
  194. <tr><td class="paramname">pack</td><td>pointer to the connack packet structure </td></tr>
  195. </table>
  196. </dd>
  197. </dl>
  198. </div>
  199. </div>
  200. <a id="ad3c3f0919760286998e9b9eafaa47a36"></a>
  201. <h2 class="memtitle"><span class="permalink"><a href="#ad3c3f0919760286998e9b9eafaa47a36">&#9670;&nbsp;</a></span>MQTTPacket_send_connect()</h2>
  202. <div class="memitem">
  203. <div class="memproto">
  204. <table class="memname">
  205. <tr>
  206. <td class="memname">int MQTTPacket_send_connect </td>
  207. <td>(</td>
  208. <td class="paramtype"><a class="el" href="structClients.html">Clients</a> *&#160;</td>
  209. <td class="paramname"><em>client</em>, </td>
  210. </tr>
  211. <tr>
  212. <td class="paramkey"></td>
  213. <td></td>
  214. <td class="paramtype">int&#160;</td>
  215. <td class="paramname"><em>MQTTVersion</em>, </td>
  216. </tr>
  217. <tr>
  218. <td class="paramkey"></td>
  219. <td></td>
  220. <td class="paramtype"><a class="el" href="structMQTTProperties.html">MQTTProperties</a> *&#160;</td>
  221. <td class="paramname"><em>connectProperties</em>, </td>
  222. </tr>
  223. <tr>
  224. <td class="paramkey"></td>
  225. <td></td>
  226. <td class="paramtype"><a class="el" href="structMQTTProperties.html">MQTTProperties</a> *&#160;</td>
  227. <td class="paramname"><em>willProperties</em>&#160;</td>
  228. </tr>
  229. <tr>
  230. <td></td>
  231. <td>)</td>
  232. <td></td><td></td>
  233. </tr>
  234. </table>
  235. </div><div class="memdoc">
  236. <p>Send an MQTT CONNECT packet down a socket for V5 or later. </p>
  237. <dl class="params"><dt>Parameters</dt><dd>
  238. <table class="params">
  239. <tr><td class="paramname">client</td><td>a structure from which to get all the required values </td></tr>
  240. <tr><td class="paramname">MQTTVersion</td><td>the MQTT version to connect with </td></tr>
  241. <tr><td class="paramname">connectProperties</td><td>MQTT V5 properties for the connect packet </td></tr>
  242. <tr><td class="paramname">willProperties</td><td>MQTT V5 properties for the will message, if any </td></tr>
  243. </table>
  244. </dd>
  245. </dl>
  246. <dl class="section return"><dt>Returns</dt><dd>the completion code (e.g. TCPSOCKET_COMPLETE) </dd></dl>
  247. <div class="dynheader">
  248. Here is the call graph for this function:</div>
  249. <div class="dyncontent">
  250. <div class="center"><img src="MQTTPacketOut_8c_ad3c3f0919760286998e9b9eafaa47a36_cgraph.png" border="0" usemap="#MQTTPacketOut_8c_ad3c3f0919760286998e9b9eafaa47a36_cgraph" alt=""/></div>
  251. <map name="MQTTPacketOut_8c_ad3c3f0919760286998e9b9eafaa47a36_cgraph" id="MQTTPacketOut_8c_ad3c3f0919760286998e9b9eafaa47a36_cgraph">
  252. <area shape="rect" title="Send an MQTT CONNECT packet down a socket for V5 or later." alt="" coords="5,132,193,159"/>
  253. <area shape="rect" href="Log_8c.html#a669722e3f57811871f97c12392aba85d" title="Log a message." alt="" coords="287,5,331,32"/>
  254. <area shape="rect" href="MQTTPacket_8c.html#a51f58f1c7864f9fe87b55cc6ccb10129" title="Sends an MQTT packet in one system call write." alt="" coords="241,56,376,83"/>
  255. <area shape="rect" href="MQTTPacket_8c.html#ad29ec8b2fbf0ec0195621b44f8945923" title="Writes one character to an output buffer." alt="" coords="270,107,347,133"/>
  256. <area shape="rect" href="MQTTPacket_8c.html#a8886398fbf89872f8e593444d351a5aa" title="Writes length delimited data to an output buffer." alt="" coords="270,157,347,184"/>
  257. <area shape="rect" href="MQTTPacket_8c.html#a07aa0146eda3d32979142e7df8ad5fc3" title="Writes an integer as 2 bytes to an output buffer." alt="" coords="489,208,554,235"/>
  258. <area shape="rect" href="MQTTPacket_8c.html#af0fcaa11ac05ce448a433a53f9cae420" title="Writes a &quot;UTF&quot; string to an output buffer." alt="" coords="271,259,347,285"/>
  259. <area shape="rect" href="MQTTPacket_8c.html#aadd77a4fa1b2d5c7791e3542c56af856" title="Encodes the message length according to the MQTT algorithm." alt="" coords="447,5,596,32"/>
  260. <area shape="rect" href="MQTTPersistence_8c.html#a18eab666c3e6aecd92a6c8f10df808e3" title="Adds a record to the persistent store." alt="" coords="424,56,619,83"/>
  261. <area shape="rect" href="MQTTPacket_8c.html#a132d2d5b304d37cd2348a973f7b315de" title="Calculates an integer from two bytes read from the input buffer." alt="" coords="490,107,553,133"/>
  262. </map>
  263. </div>
  264. </div>
  265. </div>
  266. <a id="acf4b3402e224ac22ffbe74731f374fe0"></a>
  267. <h2 class="memtitle"><span class="permalink"><a href="#acf4b3402e224ac22ffbe74731f374fe0">&#9670;&nbsp;</a></span>MQTTPacket_send_pingreq()</h2>
  268. <div class="memitem">
  269. <div class="memproto">
  270. <table class="memname">
  271. <tr>
  272. <td class="memname">int MQTTPacket_send_pingreq </td>
  273. <td>(</td>
  274. <td class="paramtype"><a class="el" href="structnetworkHandles.html">networkHandles</a> *&#160;</td>
  275. <td class="paramname"><em>net</em>, </td>
  276. </tr>
  277. <tr>
  278. <td class="paramkey"></td>
  279. <td></td>
  280. <td class="paramtype">const char *&#160;</td>
  281. <td class="paramname"><em>clientID</em>&#160;</td>
  282. </tr>
  283. <tr>
  284. <td></td>
  285. <td>)</td>
  286. <td></td><td></td>
  287. </tr>
  288. </table>
  289. </div><div class="memdoc">
  290. <p>Send an MQTT PINGREQ packet down a socket. </p>
  291. <dl class="params"><dt>Parameters</dt><dd>
  292. <table class="params">
  293. <tr><td class="paramname">socket</td><td>the open socket to send the data to </td></tr>
  294. <tr><td class="paramname">clientID</td><td>the string client identifier, only used for tracing </td></tr>
  295. </table>
  296. </dd>
  297. </dl>
  298. <dl class="section return"><dt>Returns</dt><dd>the completion code (e.g. TCPSOCKET_COMPLETE) </dd></dl>
  299. <div class="dynheader">
  300. Here is the call graph for this function:</div>
  301. <div class="dyncontent">
  302. <div class="center"><img src="MQTTPacketOut_8c_acf4b3402e224ac22ffbe74731f374fe0_cgraph.png" border="0" usemap="#MQTTPacketOut_8c_acf4b3402e224ac22ffbe74731f374fe0_cgraph" alt=""/></div>
  303. <map name="MQTTPacketOut_8c_acf4b3402e224ac22ffbe74731f374fe0_cgraph" id="MQTTPacketOut_8c_acf4b3402e224ac22ffbe74731f374fe0_cgraph">
  304. <area shape="rect" title="Send an MQTT PINGREQ packet down a socket." alt="" coords="5,31,189,57"/>
  305. <area shape="rect" href="Log_8c.html#a669722e3f57811871f97c12392aba85d" title="Log a message." alt="" coords="283,5,327,32"/>
  306. <area shape="rect" href="MQTTPacket_8c.html#a51f58f1c7864f9fe87b55cc6ccb10129" title="Sends an MQTT packet in one system call write." alt="" coords="237,56,372,83"/>
  307. <area shape="rect" href="MQTTPacket_8c.html#aadd77a4fa1b2d5c7791e3542c56af856" title="Encodes the message length according to the MQTT algorithm." alt="" coords="443,5,592,32"/>
  308. <area shape="rect" href="MQTTPersistence_8c.html#a18eab666c3e6aecd92a6c8f10df808e3" title="Adds a record to the persistent store." alt="" coords="420,56,615,83"/>
  309. <area shape="rect" href="MQTTPacket_8c.html#a132d2d5b304d37cd2348a973f7b315de" title="Calculates an integer from two bytes read from the input buffer." alt="" coords="486,107,549,133"/>
  310. </map>
  311. </div>
  312. </div>
  313. </div>
  314. <a id="a90212ed29c311f52a1dce0617133b1a7"></a>
  315. <h2 class="memtitle"><span class="permalink"><a href="#a90212ed29c311f52a1dce0617133b1a7">&#9670;&nbsp;</a></span>MQTTPacket_send_subscribe()</h2>
  316. <div class="memitem">
  317. <div class="memproto">
  318. <table class="memname">
  319. <tr>
  320. <td class="memname">int MQTTPacket_send_subscribe </td>
  321. <td>(</td>
  322. <td class="paramtype"><a class="el" href="structList.html">List</a> *&#160;</td>
  323. <td class="paramname"><em>topics</em>, </td>
  324. </tr>
  325. <tr>
  326. <td class="paramkey"></td>
  327. <td></td>
  328. <td class="paramtype"><a class="el" href="structList.html">List</a> *&#160;</td>
  329. <td class="paramname"><em>qoss</em>, </td>
  330. </tr>
  331. <tr>
  332. <td class="paramkey"></td>
  333. <td></td>
  334. <td class="paramtype"><a class="el" href="structMQTTSubscribe__options.html">MQTTSubscribe_options</a> *&#160;</td>
  335. <td class="paramname"><em>opts</em>, </td>
  336. </tr>
  337. <tr>
  338. <td class="paramkey"></td>
  339. <td></td>
  340. <td class="paramtype"><a class="el" href="structMQTTProperties.html">MQTTProperties</a> *&#160;</td>
  341. <td class="paramname"><em>props</em>, </td>
  342. </tr>
  343. <tr>
  344. <td class="paramkey"></td>
  345. <td></td>
  346. <td class="paramtype">int&#160;</td>
  347. <td class="paramname"><em>msgid</em>, </td>
  348. </tr>
  349. <tr>
  350. <td class="paramkey"></td>
  351. <td></td>
  352. <td class="paramtype">int&#160;</td>
  353. <td class="paramname"><em>dup</em>, </td>
  354. </tr>
  355. <tr>
  356. <td class="paramkey"></td>
  357. <td></td>
  358. <td class="paramtype"><a class="el" href="structClients.html">Clients</a> *&#160;</td>
  359. <td class="paramname"><em>client</em>&#160;</td>
  360. </tr>
  361. <tr>
  362. <td></td>
  363. <td>)</td>
  364. <td></td><td></td>
  365. </tr>
  366. </table>
  367. </div><div class="memdoc">
  368. <p>Send an MQTT subscribe packet down a socket. </p>
  369. <dl class="params"><dt>Parameters</dt><dd>
  370. <table class="params">
  371. <tr><td class="paramname">topics</td><td>list of topics </td></tr>
  372. <tr><td class="paramname">qoss</td><td>list of corresponding QoSs </td></tr>
  373. <tr><td class="paramname">msgid</td><td>the MQTT message id to use </td></tr>
  374. <tr><td class="paramname">dup</td><td>boolean - whether to set the MQTT DUP flag </td></tr>
  375. <tr><td class="paramname">socket</td><td>the open socket to send the data to </td></tr>
  376. <tr><td class="paramname">clientID</td><td>the string client identifier, only used for tracing </td></tr>
  377. </table>
  378. </dd>
  379. </dl>
  380. <dl class="section return"><dt>Returns</dt><dd>the completion code (e.g. TCPSOCKET_COMPLETE) </dd></dl>
  381. <div class="dynheader">
  382. Here is the call graph for this function:</div>
  383. <div class="dyncontent">
  384. <div class="center"><img src="MQTTPacketOut_8c_a90212ed29c311f52a1dce0617133b1a7_cgraph.png" border="0" usemap="#MQTTPacketOut_8c_a90212ed29c311f52a1dce0617133b1a7_cgraph" alt=""/></div>
  385. <map name="MQTTPacketOut_8c_a90212ed29c311f52a1dce0617133b1a7_cgraph" id="MQTTPacketOut_8c_a90212ed29c311f52a1dce0617133b1a7_cgraph">
  386. <area shape="rect" title="Send an MQTT subscribe packet down a socket." alt="" coords="5,132,204,159"/>
  387. <area shape="rect" href="LinkedList_8c.html#a7c6fba7f4b569c69829676bed2852ee9" title="Forward iteration through a list." alt="" coords="260,5,379,32"/>
  388. <area shape="rect" href="Log_8c.html#a669722e3f57811871f97c12392aba85d" title="Log a message." alt="" coords="297,56,341,83"/>
  389. <area shape="rect" href="MQTTPacket_8c.html#a51f58f1c7864f9fe87b55cc6ccb10129" title="Sends an MQTT packet in one system call write." alt="" coords="252,107,387,133"/>
  390. <area shape="rect" href="MQTTPacket_8c.html#ad29ec8b2fbf0ec0195621b44f8945923" title="Writes one character to an output buffer." alt="" coords="281,157,358,184"/>
  391. <area shape="rect" href="MQTTPacket_8c.html#a07aa0146eda3d32979142e7df8ad5fc3" title="Writes an integer as 2 bytes to an output buffer." alt="" coords="499,233,565,260"/>
  392. <area shape="rect" href="MQTTPacket_8c.html#af0fcaa11ac05ce448a433a53f9cae420" title="Writes a &quot;UTF&quot; string to an output buffer." alt="" coords="281,259,357,285"/>
  393. <area shape="rect" href="MQTTPacket_8c.html#aadd77a4fa1b2d5c7791e3542c56af856" title="Encodes the message length according to the MQTT algorithm." alt="" coords="457,56,607,83"/>
  394. <area shape="rect" href="MQTTPersistence_8c.html#a18eab666c3e6aecd92a6c8f10df808e3" title="Adds a record to the persistent store." alt="" coords="435,107,629,133"/>
  395. <area shape="rect" href="MQTTPacket_8c.html#a132d2d5b304d37cd2348a973f7b315de" title="Calculates an integer from two bytes read from the input buffer." alt="" coords="501,157,563,184"/>
  396. </map>
  397. </div>
  398. </div>
  399. </div>
  400. <a id="a1ad4c9b76c6ab88c394ee925eb4dcd44"></a>
  401. <h2 class="memtitle"><span class="permalink"><a href="#a1ad4c9b76c6ab88c394ee925eb4dcd44">&#9670;&nbsp;</a></span>MQTTPacket_send_unsubscribe()</h2>
  402. <div class="memitem">
  403. <div class="memproto">
  404. <table class="memname">
  405. <tr>
  406. <td class="memname">int MQTTPacket_send_unsubscribe </td>
  407. <td>(</td>
  408. <td class="paramtype"><a class="el" href="structList.html">List</a> *&#160;</td>
  409. <td class="paramname"><em>topics</em>, </td>
  410. </tr>
  411. <tr>
  412. <td class="paramkey"></td>
  413. <td></td>
  414. <td class="paramtype"><a class="el" href="structMQTTProperties.html">MQTTProperties</a> *&#160;</td>
  415. <td class="paramname"><em>props</em>, </td>
  416. </tr>
  417. <tr>
  418. <td class="paramkey"></td>
  419. <td></td>
  420. <td class="paramtype">int&#160;</td>
  421. <td class="paramname"><em>msgid</em>, </td>
  422. </tr>
  423. <tr>
  424. <td class="paramkey"></td>
  425. <td></td>
  426. <td class="paramtype">int&#160;</td>
  427. <td class="paramname"><em>dup</em>, </td>
  428. </tr>
  429. <tr>
  430. <td class="paramkey"></td>
  431. <td></td>
  432. <td class="paramtype"><a class="el" href="structClients.html">Clients</a> *&#160;</td>
  433. <td class="paramname"><em>client</em>&#160;</td>
  434. </tr>
  435. <tr>
  436. <td></td>
  437. <td>)</td>
  438. <td></td><td></td>
  439. </tr>
  440. </table>
  441. </div><div class="memdoc">
  442. <p>Send an MQTT unsubscribe packet down a socket. </p>
  443. <dl class="params"><dt>Parameters</dt><dd>
  444. <table class="params">
  445. <tr><td class="paramname">topics</td><td>list of topics </td></tr>
  446. <tr><td class="paramname">msgid</td><td>the MQTT message id to use </td></tr>
  447. <tr><td class="paramname">dup</td><td>boolean - whether to set the MQTT DUP flag </td></tr>
  448. <tr><td class="paramname">socket</td><td>the open socket to send the data to </td></tr>
  449. <tr><td class="paramname">clientID</td><td>the string client identifier, only used for tracing </td></tr>
  450. </table>
  451. </dd>
  452. </dl>
  453. <dl class="section return"><dt>Returns</dt><dd>the completion code (e.g. TCPSOCKET_COMPLETE) </dd></dl>
  454. <div class="dynheader">
  455. Here is the call graph for this function:</div>
  456. <div class="dyncontent">
  457. <div class="center"><img src="MQTTPacketOut_8c_a1ad4c9b76c6ab88c394ee925eb4dcd44_cgraph.png" border="0" usemap="#MQTTPacketOut_8c_a1ad4c9b76c6ab88c394ee925eb4dcd44_cgraph" alt=""/></div>
  458. <map name="MQTTPacketOut_8c_a1ad4c9b76c6ab88c394ee925eb4dcd44_cgraph" id="MQTTPacketOut_8c_a1ad4c9b76c6ab88c394ee925eb4dcd44_cgraph">
  459. <area shape="rect" title="Send an MQTT unsubscribe packet down a socket." alt="" coords="5,107,217,133"/>
  460. <area shape="rect" href="LinkedList_8c.html#a7c6fba7f4b569c69829676bed2852ee9" title="Forward iteration through a list." alt="" coords="273,5,392,32"/>
  461. <area shape="rect" href="Log_8c.html#a669722e3f57811871f97c12392aba85d" title="Log a message." alt="" coords="311,56,355,83"/>
  462. <area shape="rect" href="MQTTPacket_8c.html#a51f58f1c7864f9fe87b55cc6ccb10129" title="Sends an MQTT packet in one system call write." alt="" coords="265,107,400,133"/>
  463. <area shape="rect" href="MQTTPacket_8c.html#a07aa0146eda3d32979142e7df8ad5fc3" title="Writes an integer as 2 bytes to an output buffer." alt="" coords="513,208,578,235"/>
  464. <area shape="rect" href="MQTTPacket_8c.html#af0fcaa11ac05ce448a433a53f9cae420" title="Writes a &quot;UTF&quot; string to an output buffer." alt="" coords="295,208,371,235"/>
  465. <area shape="rect" href="MQTTPacket_8c.html#aadd77a4fa1b2d5c7791e3542c56af856" title="Encodes the message length according to the MQTT algorithm." alt="" coords="471,56,620,83"/>
  466. <area shape="rect" href="MQTTPersistence_8c.html#a18eab666c3e6aecd92a6c8f10df808e3" title="Adds a record to the persistent store." alt="" coords="448,107,643,133"/>
  467. <area shape="rect" href="MQTTPacket_8c.html#a132d2d5b304d37cd2348a973f7b315de" title="Calculates an integer from two bytes read from the input buffer." alt="" coords="514,157,577,184"/>
  468. </map>
  469. </div>
  470. </div>
  471. </div>
  472. <a id="aee4b3e106128629671828ae7bfa70850"></a>
  473. <h2 class="memtitle"><span class="permalink"><a href="#aee4b3e106128629671828ae7bfa70850">&#9670;&nbsp;</a></span>MQTTPacket_suback()</h2>
  474. <div class="memitem">
  475. <div class="memproto">
  476. <table class="memname">
  477. <tr>
  478. <td class="memname">void* MQTTPacket_suback </td>
  479. <td>(</td>
  480. <td class="paramtype">int&#160;</td>
  481. <td class="paramname"><em>MQTTVersion</em>, </td>
  482. </tr>
  483. <tr>
  484. <td class="paramkey"></td>
  485. <td></td>
  486. <td class="paramtype">unsigned char&#160;</td>
  487. <td class="paramname"><em>aHeader</em>, </td>
  488. </tr>
  489. <tr>
  490. <td class="paramkey"></td>
  491. <td></td>
  492. <td class="paramtype">char *&#160;</td>
  493. <td class="paramname"><em>data</em>, </td>
  494. </tr>
  495. <tr>
  496. <td class="paramkey"></td>
  497. <td></td>
  498. <td class="paramtype">size_t&#160;</td>
  499. <td class="paramname"><em>datalen</em>&#160;</td>
  500. </tr>
  501. <tr>
  502. <td></td>
  503. <td>)</td>
  504. <td></td><td></td>
  505. </tr>
  506. </table>
  507. </div><div class="memdoc">
  508. <p>Function used in the new packets table to create suback packets. </p>
  509. <dl class="params"><dt>Parameters</dt><dd>
  510. <table class="params">
  511. <tr><td class="paramname">MQTTVersion</td><td>the version of MQTT </td></tr>
  512. <tr><td class="paramname">aHeader</td><td>the MQTT header byte </td></tr>
  513. <tr><td class="paramname">data</td><td>the rest of the packet </td></tr>
  514. <tr><td class="paramname">datalen</td><td>the length of the rest of the packet </td></tr>
  515. </table>
  516. </dd>
  517. </dl>
  518. <dl class="section return"><dt>Returns</dt><dd>pointer to the packet structure </dd></dl>
  519. <div class="dynheader">
  520. Here is the call graph for this function:</div>
  521. <div class="dyncontent">
  522. <div class="center"><img src="MQTTPacketOut_8c_aee4b3e106128629671828ae7bfa70850_cgraph.png" border="0" usemap="#MQTTPacketOut_8c_aee4b3e106128629671828ae7bfa70850_cgraph" alt=""/></div>
  523. <map name="MQTTPacketOut_8c_aee4b3e106128629671828ae7bfa70850_cgraph" id="MQTTPacketOut_8c_aee4b3e106128629671828ae7bfa70850_cgraph">
  524. <area shape="rect" title="Function used in the new packets table to create suback packets." alt="" coords="5,107,155,133"/>
  525. <area shape="rect" href="LinkedList_8c.html#abc7a28449893dfa775c2f709349968b4" title="Append an item to a list." alt="" coords="204,5,292,32"/>
  526. <area shape="rect" href="LinkedList_8c.html#a276950531b3f54e0dda27d597572c192" title="Removes and frees all items in a list, and frees the list itself." alt="" coords="213,56,283,83"/>
  527. <area shape="rect" href="LinkedList_8c.html#a27e2cccab9752618ead91eafbe2a9a46" title="Allocates and initializes a new list structure." alt="" coords="203,107,293,133"/>
  528. <area shape="rect" href="MQTTPacket_8c.html#aff1d10b221f5b4ce421b4c2588cbe511" title="Reads one character from the input buffer." alt="" coords="211,157,285,184"/>
  529. <area shape="rect" href="MQTTPacket_8c.html#a132d2d5b304d37cd2348a973f7b315de" title="Calculates an integer from two bytes read from the input buffer." alt="" coords="217,208,279,235"/>
  530. <area shape="rect" href="LinkedList_8c.html#a321a3598d6979c7af3f995b77ea2cec3" title="Append an already allocated ListElement and content to a list." alt="" coords="341,5,484,32"/>
  531. <area shape="rect" href="LinkedList_8c.html#a3cf8578dba23f97dd0411e85fe3b7ff2" title="Removes and frees all items in a list, leaving the list ready for new items." alt="" coords="373,56,453,83"/>
  532. <area shape="rect" href="LinkedList_8c.html#aa254fb1eab8e30d0e03859b333dc22ed" title="Sets a list structure to empty &#45; all null values." alt="" coords="377,107,448,133"/>
  533. </map>
  534. </div>
  535. </div>
  536. </div>
  537. <a id="a93f6aa4b23d30f6c8c5be87b0b58e37c"></a>
  538. <h2 class="memtitle"><span class="permalink"><a href="#a93f6aa4b23d30f6c8c5be87b0b58e37c">&#9670;&nbsp;</a></span>MQTTPacket_unsuback()</h2>
  539. <div class="memitem">
  540. <div class="memproto">
  541. <table class="memname">
  542. <tr>
  543. <td class="memname">void* MQTTPacket_unsuback </td>
  544. <td>(</td>
  545. <td class="paramtype">int&#160;</td>
  546. <td class="paramname"><em>MQTTVersion</em>, </td>
  547. </tr>
  548. <tr>
  549. <td class="paramkey"></td>
  550. <td></td>
  551. <td class="paramtype">unsigned char&#160;</td>
  552. <td class="paramname"><em>aHeader</em>, </td>
  553. </tr>
  554. <tr>
  555. <td class="paramkey"></td>
  556. <td></td>
  557. <td class="paramtype">char *&#160;</td>
  558. <td class="paramname"><em>data</em>, </td>
  559. </tr>
  560. <tr>
  561. <td class="paramkey"></td>
  562. <td></td>
  563. <td class="paramtype">size_t&#160;</td>
  564. <td class="paramname"><em>datalen</em>&#160;</td>
  565. </tr>
  566. <tr>
  567. <td></td>
  568. <td>)</td>
  569. <td></td><td></td>
  570. </tr>
  571. </table>
  572. </div><div class="memdoc">
  573. <p>Function used in the new packets table to create unsuback packets. </p>
  574. <dl class="params"><dt>Parameters</dt><dd>
  575. <table class="params">
  576. <tr><td class="paramname">MQTTVersion</td><td>the version of MQTT </td></tr>
  577. <tr><td class="paramname">aHeader</td><td>the MQTT header byte </td></tr>
  578. <tr><td class="paramname">data</td><td>the rest of the packet </td></tr>
  579. <tr><td class="paramname">datalen</td><td>the length of the rest of the packet </td></tr>
  580. </table>
  581. </dd>
  582. </dl>
  583. <dl class="section return"><dt>Returns</dt><dd>pointer to the packet structure </dd></dl>
  584. <div class="dynheader">
  585. Here is the call graph for this function:</div>
  586. <div class="dyncontent">
  587. <div class="center"><img src="MQTTPacketOut_8c_a93f6aa4b23d30f6c8c5be87b0b58e37c_cgraph.png" border="0" usemap="#MQTTPacketOut_8c_a93f6aa4b23d30f6c8c5be87b0b58e37c_cgraph" alt=""/></div>
  588. <map name="MQTTPacketOut_8c_a93f6aa4b23d30f6c8c5be87b0b58e37c_cgraph" id="MQTTPacketOut_8c_a93f6aa4b23d30f6c8c5be87b0b58e37c_cgraph">
  589. <area shape="rect" title="Function used in the new packets table to create unsuback packets." alt="" coords="5,107,168,133"/>
  590. <area shape="rect" href="LinkedList_8c.html#abc7a28449893dfa775c2f709349968b4" title="Append an item to a list." alt="" coords="217,5,305,32"/>
  591. <area shape="rect" href="LinkedList_8c.html#a276950531b3f54e0dda27d597572c192" title="Removes and frees all items in a list, and frees the list itself." alt="" coords="226,56,297,83"/>
  592. <area shape="rect" href="LinkedList_8c.html#a27e2cccab9752618ead91eafbe2a9a46" title="Allocates and initializes a new list structure." alt="" coords="216,107,307,133"/>
  593. <area shape="rect" href="MQTTPacket_8c.html#aff1d10b221f5b4ce421b4c2588cbe511" title="Reads one character from the input buffer." alt="" coords="224,157,299,184"/>
  594. <area shape="rect" href="MQTTPacket_8c.html#a132d2d5b304d37cd2348a973f7b315de" title="Calculates an integer from two bytes read from the input buffer." alt="" coords="230,208,293,235"/>
  595. <area shape="rect" href="LinkedList_8c.html#a321a3598d6979c7af3f995b77ea2cec3" title="Append an already allocated ListElement and content to a list." alt="" coords="355,5,497,32"/>
  596. <area shape="rect" href="LinkedList_8c.html#a3cf8578dba23f97dd0411e85fe3b7ff2" title="Removes and frees all items in a list, leaving the list ready for new items." alt="" coords="386,56,466,83"/>
  597. <area shape="rect" href="LinkedList_8c.html#aa254fb1eab8e30d0e03859b333dc22ed" title="Sets a list structure to empty &#45; all null values." alt="" coords="391,107,461,133"/>
  598. </map>
  599. </div>
  600. </div>
  601. </div>
  602. </div><!-- contents -->
  603. <!-- start footer part -->
  604. <hr class="footer"/><address class="footer"><small>
  605. 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">
  606. <img class="footer" src="doxygen.png" alt="doxygen"/>
  607. </a> 1.8.17
  608. </small></address>
  609. </body>
  610. </html>