MQTTPacket_8c.html 107 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888
  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: MQTTPacket.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="#func-members">Functions</a> &#124;
  66. <a href="#var-members">Variables</a> </div>
  67. <div class="headertitle">
  68. <div class="title">MQTTPacket.c File Reference</div> </div>
  69. </div><!--header-->
  70. <div class="contents">
  71. <p>functions to deal with reading and writing of MQTT packets from and to sockets
  72. <a href="#details">More...</a></p>
  73. <div class="textblock"><code>#include &quot;MQTTPacket.h&quot;</code><br />
  74. <code>#include &quot;Log.h&quot;</code><br />
  75. <code>#include &quot;MQTTPersistence.h&quot;</code><br />
  76. <code>#include &quot;Messages.h&quot;</code><br />
  77. <code>#include &quot;StackTrace.h&quot;</code><br />
  78. <code>#include &quot;WebSocket.h&quot;</code><br />
  79. <code>#include &quot;MQTTTime.h&quot;</code><br />
  80. <code>#include &lt;stdlib.h&gt;</code><br />
  81. <code>#include &lt;string.h&gt;</code><br />
  82. <code>#include &quot;Heap.h&quot;</code><br />
  83. </div><div class="textblock"><div class="dynheader">
  84. Include dependency graph for MQTTPacket.c:</div>
  85. <div class="dyncontent">
  86. <div class="center"><img src="MQTTPacket_8c__incl.png" border="0" usemap="#MQTTPacket_8c" alt=""/></div>
  87. <map name="MQTTPacket_8c" id="MQTTPacket_8c">
  88. <area shape="rect" title="functions to deal with reading and writing of MQTT packets from and to sockets" alt="" coords="25,5,136,32"/>
  89. <area shape="rect" title=" " alt="" coords="5,80,68,107"/>
  90. <area shape="rect" title=" " alt="" coords="93,80,157,107"/>
  91. </map>
  92. </div>
  93. </div><table class="memberdecls">
  94. <tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="define-members"></a>
  95. Macros</h2></td></tr>
  96. <tr class="memitem:a2d017cd3beb218080a7988e2deed2a11"><td class="memItemLeft" align="right" valign="top"><a id="a2d017cd3beb218080a7988e2deed2a11"></a>
  97. #define&#160;</td><td class="memItemRight" valign="bottom"><b>min</b>(A, B)&#160;&#160;&#160;( (A) &lt; (B) ? (A):(B))</td></tr>
  98. <tr class="separator:a2d017cd3beb218080a7988e2deed2a11"><td class="memSeparator" colspan="2">&#160;</td></tr>
  99. <tr class="memitem:a166c9117b1ef3db3292d475f300ca560"><td class="memItemLeft" align="right" valign="top"><a id="a166c9117b1ef3db3292d475f300ca560"></a>
  100. #define&#160;</td><td class="memItemRight" valign="bottom"><b>MAX_NO_OF_REMAINING_LENGTH_BYTES</b>&#160;&#160;&#160;4</td></tr>
  101. <tr class="separator:a166c9117b1ef3db3292d475f300ca560"><td class="memSeparator" colspan="2">&#160;</td></tr>
  102. <tr class="memitem:a166c9117b1ef3db3292d475f300ca560"><td class="memItemLeft" align="right" valign="top"><a id="a166c9117b1ef3db3292d475f300ca560"></a>
  103. #define&#160;</td><td class="memItemRight" valign="bottom"><b>MAX_NO_OF_REMAINING_LENGTH_BYTES</b>&#160;&#160;&#160;4</td></tr>
  104. <tr class="separator:a166c9117b1ef3db3292d475f300ca560"><td class="memSeparator" colspan="2">&#160;</td></tr>
  105. </table><table class="memberdecls">
  106. <tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="func-members"></a>
  107. Functions</h2></td></tr>
  108. <tr class="memitem:a9f9e58aba3ed5d513862d76bc5e29743"><td class="memItemLeft" align="right" valign="top">const char *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="MQTTPacket_8c.html#a9f9e58aba3ed5d513862d76bc5e29743">MQTTPacket_name</a> (int ptype)</td></tr>
  109. <tr class="memdesc:a9f9e58aba3ed5d513862d76bc5e29743"><td class="mdescLeft">&#160;</td><td class="mdescRight">Converts an MQTT packet code into its name. <a href="MQTTPacket_8c.html#a9f9e58aba3ed5d513862d76bc5e29743">More...</a><br /></td></tr>
  110. <tr class="separator:a9f9e58aba3ed5d513862d76bc5e29743"><td class="memSeparator" colspan="2">&#160;</td></tr>
  111. <tr class="memitem:ae1ec2d8714335c6ec88c93e957b644d2"><td class="memItemLeft" align="right" valign="top">static char *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="MQTTPacket_8c.html#ae1ec2d8714335c6ec88c93e957b644d2">readUTFlen</a> (char **pptr, char *enddata, int *<a class="el" href="utf-8_8c.html#afed088663f8704004425cdae2120b9b3">len</a>)</td></tr>
  112. <tr class="memdesc:ae1ec2d8714335c6ec88c93e957b644d2"><td class="mdescLeft">&#160;</td><td class="mdescRight">Reads a "UTF" string from the input buffer. <a href="MQTTPacket_8c.html#ae1ec2d8714335c6ec88c93e957b644d2">More...</a><br /></td></tr>
  113. <tr class="separator:ae1ec2d8714335c6ec88c93e957b644d2"><td class="memSeparator" colspan="2">&#160;</td></tr>
  114. <tr class="memitem:ad89e627a37f7f7eb4355b076cd46e0b0"><td class="memItemLeft" align="right" valign="top">static int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="MQTTPacket_8c.html#ad89e627a37f7f7eb4355b076cd46e0b0">MQTTPacket_send_ack</a> (int MQTTVersion, int type, int msgid, int dup, <a class="el" href="structnetworkHandles.html">networkHandles</a> *net)</td></tr>
  115. <tr class="memdesc:ad89e627a37f7f7eb4355b076cd46e0b0"><td class="mdescLeft">&#160;</td><td class="mdescRight">Send an MQTT acknowledgement packet down a socket. <a href="MQTTPacket_8c.html#ad89e627a37f7f7eb4355b076cd46e0b0">More...</a><br /></td></tr>
  116. <tr class="separator:ad89e627a37f7f7eb4355b076cd46e0b0"><td class="memSeparator" colspan="2">&#160;</td></tr>
  117. <tr class="memitem:af922033c495b05fe4242afc54211f20d"><td class="memItemLeft" align="right" valign="top">void *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="MQTTPacket_8c.html#af922033c495b05fe4242afc54211f20d">MQTTPacket_Factory</a> (int MQTTVersion, <a class="el" href="structnetworkHandles.html">networkHandles</a> *net, int *error)</td></tr>
  118. <tr class="memdesc:af922033c495b05fe4242afc54211f20d"><td class="mdescLeft">&#160;</td><td class="mdescRight">Reads one MQTT packet from a socket. <a href="MQTTPacket_8c.html#af922033c495b05fe4242afc54211f20d">More...</a><br /></td></tr>
  119. <tr class="separator:af922033c495b05fe4242afc54211f20d"><td class="memSeparator" colspan="2">&#160;</td></tr>
  120. <tr class="memitem:a51f58f1c7864f9fe87b55cc6ccb10129"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="MQTTPacket_8c.html#a51f58f1c7864f9fe87b55cc6ccb10129">MQTTPacket_send</a> (<a class="el" href="structnetworkHandles.html">networkHandles</a> *net, <a class="el" href="unionHeader.html">Header</a> header, char *buffer, size_t buflen, int freeData, int MQTTVersion)</td></tr>
  121. <tr class="memdesc:a51f58f1c7864f9fe87b55cc6ccb10129"><td class="mdescLeft">&#160;</td><td class="mdescRight">Sends an MQTT packet in one system call write. <a href="MQTTPacket_8c.html#a51f58f1c7864f9fe87b55cc6ccb10129">More...</a><br /></td></tr>
  122. <tr class="separator:a51f58f1c7864f9fe87b55cc6ccb10129"><td class="memSeparator" colspan="2">&#160;</td></tr>
  123. <tr class="memitem:a3635fd8035177b20c478daea6bad9328"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="MQTTPacket_8c.html#a3635fd8035177b20c478daea6bad9328">MQTTPacket_sends</a> (<a class="el" href="structnetworkHandles.html">networkHandles</a> *net, <a class="el" href="unionHeader.html">Header</a> header, <a class="el" href="structPacketBuffers.html">PacketBuffers</a> *bufs, int MQTTVersion)</td></tr>
  124. <tr class="memdesc:a3635fd8035177b20c478daea6bad9328"><td class="mdescLeft">&#160;</td><td class="mdescRight">Sends an MQTT packet from multiple buffers in one system call write. <a href="MQTTPacket_8c.html#a3635fd8035177b20c478daea6bad9328">More...</a><br /></td></tr>
  125. <tr class="separator:a3635fd8035177b20c478daea6bad9328"><td class="memSeparator" colspan="2">&#160;</td></tr>
  126. <tr class="memitem:aadd77a4fa1b2d5c7791e3542c56af856"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="MQTTPacket_8c.html#aadd77a4fa1b2d5c7791e3542c56af856">MQTTPacket_encode</a> (char *buf, size_t length)</td></tr>
  127. <tr class="memdesc:aadd77a4fa1b2d5c7791e3542c56af856"><td class="mdescLeft">&#160;</td><td class="mdescRight">Encodes the message length according to the MQTT algorithm. <a href="MQTTPacket_8c.html#aadd77a4fa1b2d5c7791e3542c56af856">More...</a><br /></td></tr>
  128. <tr class="separator:aadd77a4fa1b2d5c7791e3542c56af856"><td class="memSeparator" colspan="2">&#160;</td></tr>
  129. <tr class="memitem:ac1f61e571640513a9785b3164141dfbc"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="MQTTPacket_8c.html#ac1f61e571640513a9785b3164141dfbc">MQTTPacket_decode</a> (<a class="el" href="structnetworkHandles.html">networkHandles</a> *net, size_t *value)</td></tr>
  130. <tr class="memdesc:ac1f61e571640513a9785b3164141dfbc"><td class="mdescLeft">&#160;</td><td class="mdescRight">Decodes the message length according to the MQTT algorithm. <a href="MQTTPacket_8c.html#ac1f61e571640513a9785b3164141dfbc">More...</a><br /></td></tr>
  131. <tr class="separator:ac1f61e571640513a9785b3164141dfbc"><td class="memSeparator" colspan="2">&#160;</td></tr>
  132. <tr class="memitem:a132d2d5b304d37cd2348a973f7b315de"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="MQTTPacket_8c.html#a132d2d5b304d37cd2348a973f7b315de">readInt</a> (char **pptr)</td></tr>
  133. <tr class="memdesc:a132d2d5b304d37cd2348a973f7b315de"><td class="mdescLeft">&#160;</td><td class="mdescRight">Calculates an integer from two bytes read from the input buffer. <a href="MQTTPacket_8c.html#a132d2d5b304d37cd2348a973f7b315de">More...</a><br /></td></tr>
  134. <tr class="separator:a132d2d5b304d37cd2348a973f7b315de"><td class="memSeparator" colspan="2">&#160;</td></tr>
  135. <tr class="memitem:adca3afbe588ae7e6f342c5a697e4ee45"><td class="memItemLeft" align="right" valign="top">char *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="MQTTPacket_8c.html#adca3afbe588ae7e6f342c5a697e4ee45">readUTF</a> (char **pptr, char *enddata)</td></tr>
  136. <tr class="memdesc:adca3afbe588ae7e6f342c5a697e4ee45"><td class="mdescLeft">&#160;</td><td class="mdescRight">Reads a "UTF" string from the input buffer. <a href="MQTTPacket_8c.html#adca3afbe588ae7e6f342c5a697e4ee45">More...</a><br /></td></tr>
  137. <tr class="separator:adca3afbe588ae7e6f342c5a697e4ee45"><td class="memSeparator" colspan="2">&#160;</td></tr>
  138. <tr class="memitem:aff1d10b221f5b4ce421b4c2588cbe511"><td class="memItemLeft" align="right" valign="top">unsigned char&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="MQTTPacket_8c.html#aff1d10b221f5b4ce421b4c2588cbe511">readChar</a> (char **pptr)</td></tr>
  139. <tr class="memdesc:aff1d10b221f5b4ce421b4c2588cbe511"><td class="mdescLeft">&#160;</td><td class="mdescRight">Reads one character from the input buffer. <a href="MQTTPacket_8c.html#aff1d10b221f5b4ce421b4c2588cbe511">More...</a><br /></td></tr>
  140. <tr class="separator:aff1d10b221f5b4ce421b4c2588cbe511"><td class="memSeparator" colspan="2">&#160;</td></tr>
  141. <tr class="memitem:ad29ec8b2fbf0ec0195621b44f8945923"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="MQTTPacket_8c.html#ad29ec8b2fbf0ec0195621b44f8945923">writeChar</a> (char **pptr, char c)</td></tr>
  142. <tr class="memdesc:ad29ec8b2fbf0ec0195621b44f8945923"><td class="mdescLeft">&#160;</td><td class="mdescRight">Writes one character to an output buffer. <a href="MQTTPacket_8c.html#ad29ec8b2fbf0ec0195621b44f8945923">More...</a><br /></td></tr>
  143. <tr class="separator:ad29ec8b2fbf0ec0195621b44f8945923"><td class="memSeparator" colspan="2">&#160;</td></tr>
  144. <tr class="memitem:a07aa0146eda3d32979142e7df8ad5fc3"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="MQTTPacket_8c.html#a07aa0146eda3d32979142e7df8ad5fc3">writeInt</a> (char **pptr, int anInt)</td></tr>
  145. <tr class="memdesc:a07aa0146eda3d32979142e7df8ad5fc3"><td class="mdescLeft">&#160;</td><td class="mdescRight">Writes an integer as 2 bytes to an output buffer. <a href="MQTTPacket_8c.html#a07aa0146eda3d32979142e7df8ad5fc3">More...</a><br /></td></tr>
  146. <tr class="separator:a07aa0146eda3d32979142e7df8ad5fc3"><td class="memSeparator" colspan="2">&#160;</td></tr>
  147. <tr class="memitem:af0fcaa11ac05ce448a433a53f9cae420"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="MQTTPacket_8c.html#af0fcaa11ac05ce448a433a53f9cae420">writeUTF</a> (char **pptr, const char *string)</td></tr>
  148. <tr class="memdesc:af0fcaa11ac05ce448a433a53f9cae420"><td class="mdescLeft">&#160;</td><td class="mdescRight">Writes a "UTF" string to an output buffer. <a href="MQTTPacket_8c.html#af0fcaa11ac05ce448a433a53f9cae420">More...</a><br /></td></tr>
  149. <tr class="separator:af0fcaa11ac05ce448a433a53f9cae420"><td class="memSeparator" colspan="2">&#160;</td></tr>
  150. <tr class="memitem:a8886398fbf89872f8e593444d351a5aa"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="MQTTPacket_8c.html#a8886398fbf89872f8e593444d351a5aa">writeData</a> (char **pptr, const void *data, int datalen)</td></tr>
  151. <tr class="memdesc:a8886398fbf89872f8e593444d351a5aa"><td class="mdescLeft">&#160;</td><td class="mdescRight">Writes length delimited data to an output buffer. <a href="MQTTPacket_8c.html#a8886398fbf89872f8e593444d351a5aa">More...</a><br /></td></tr>
  152. <tr class="separator:a8886398fbf89872f8e593444d351a5aa"><td class="memSeparator" colspan="2">&#160;</td></tr>
  153. <tr class="memitem:af3ddd9c1a35d51bf70f44a1aa6fa0bba"><td class="memItemLeft" align="right" valign="top">void *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="MQTTPacket_8c.html#af3ddd9c1a35d51bf70f44a1aa6fa0bba">MQTTPacket_header_only</a> (int MQTTVersion, unsigned char aHeader, char *data, size_t datalen)</td></tr>
  154. <tr class="memdesc:af3ddd9c1a35d51bf70f44a1aa6fa0bba"><td class="mdescLeft">&#160;</td><td class="mdescRight">Function used in the new packets table to create packets which have only a header. <a href="MQTTPacket_8c.html#af3ddd9c1a35d51bf70f44a1aa6fa0bba">More...</a><br /></td></tr>
  155. <tr class="separator:af3ddd9c1a35d51bf70f44a1aa6fa0bba"><td class="memSeparator" colspan="2">&#160;</td></tr>
  156. <tr class="memitem:aa9e17261b4d09d802dba6a65bcdc44fa"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="MQTTPacket_8c.html#aa9e17261b4d09d802dba6a65bcdc44fa">MQTTPacket_send_disconnect</a> (<a class="el" href="structClients.html">Clients</a> *client, enum MQTTReasonCodes reason, <a class="el" href="structMQTTProperties.html">MQTTProperties</a> *props)</td></tr>
  157. <tr class="memdesc:aa9e17261b4d09d802dba6a65bcdc44fa"><td class="mdescLeft">&#160;</td><td class="mdescRight">Send an MQTT disconnect packet down a socket. <a href="MQTTPacket_8c.html#aa9e17261b4d09d802dba6a65bcdc44fa">More...</a><br /></td></tr>
  158. <tr class="separator:aa9e17261b4d09d802dba6a65bcdc44fa"><td class="memSeparator" colspan="2">&#160;</td></tr>
  159. <tr class="memitem:a58feb89ee5616f2ea6d222bbbef927bb"><td class="memItemLeft" align="right" valign="top">void *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="MQTTPacket_8c.html#a58feb89ee5616f2ea6d222bbbef927bb">MQTTPacket_publish</a> (int MQTTVersion, unsigned char aHeader, char *data, size_t datalen)</td></tr>
  160. <tr class="memdesc:a58feb89ee5616f2ea6d222bbbef927bb"><td class="mdescLeft">&#160;</td><td class="mdescRight">Function used in the new packets table to create publish packets. <a href="MQTTPacket_8c.html#a58feb89ee5616f2ea6d222bbbef927bb">More...</a><br /></td></tr>
  161. <tr class="separator:a58feb89ee5616f2ea6d222bbbef927bb"><td class="memSeparator" colspan="2">&#160;</td></tr>
  162. <tr class="memitem:a642e5f62d21f14e81f8fc70b491d89c8"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="MQTTPacket_8c.html#a642e5f62d21f14e81f8fc70b491d89c8">MQTTPacket_freePublish</a> (<a class="el" href="structPublish.html">Publish</a> *pack)</td></tr>
  163. <tr class="memdesc:a642e5f62d21f14e81f8fc70b491d89c8"><td class="mdescLeft">&#160;</td><td class="mdescRight">Free allocated storage for a publish packet. <a href="MQTTPacket_8c.html#a642e5f62d21f14e81f8fc70b491d89c8">More...</a><br /></td></tr>
  164. <tr class="separator:a642e5f62d21f14e81f8fc70b491d89c8"><td class="memSeparator" colspan="2">&#160;</td></tr>
  165. <tr class="memitem:a0ef92fb0207ed6272de9ebc749745d0c"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="MQTTPacket_8c.html#a0ef92fb0207ed6272de9ebc749745d0c">MQTTPacket_freeAck</a> (<a class="el" href="structAck.html">Ack</a> *pack)</td></tr>
  166. <tr class="memdesc:a0ef92fb0207ed6272de9ebc749745d0c"><td class="mdescLeft">&#160;</td><td class="mdescRight">Free allocated storage for an ack packet. <a href="MQTTPacket_8c.html#a0ef92fb0207ed6272de9ebc749745d0c">More...</a><br /></td></tr>
  167. <tr class="separator:a0ef92fb0207ed6272de9ebc749745d0c"><td class="memSeparator" colspan="2">&#160;</td></tr>
  168. <tr class="memitem:a8b93325a6a336406497b20b489d6c46a"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="MQTTPacket_8c.html#a8b93325a6a336406497b20b489d6c46a">MQTTPacket_send_puback</a> (int MQTTVersion, int msgid, <a class="el" href="structnetworkHandles.html">networkHandles</a> *net, const char *clientID)</td></tr>
  169. <tr class="memdesc:a8b93325a6a336406497b20b489d6c46a"><td class="mdescLeft">&#160;</td><td class="mdescRight">Send an MQTT PUBACK packet down a socket. <a href="MQTTPacket_8c.html#a8b93325a6a336406497b20b489d6c46a">More...</a><br /></td></tr>
  170. <tr class="separator:a8b93325a6a336406497b20b489d6c46a"><td class="memSeparator" colspan="2">&#160;</td></tr>
  171. <tr class="memitem:a4262b8f35885dc123f59268fb74cec3d"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="MQTTPacket_8c.html#a4262b8f35885dc123f59268fb74cec3d">MQTTPacket_freeSuback</a> (<a class="el" href="structSuback.html">Suback</a> *pack)</td></tr>
  172. <tr class="memdesc:a4262b8f35885dc123f59268fb74cec3d"><td class="mdescLeft">&#160;</td><td class="mdescRight">Free allocated storage for a suback packet. <a href="MQTTPacket_8c.html#a4262b8f35885dc123f59268fb74cec3d">More...</a><br /></td></tr>
  173. <tr class="separator:a4262b8f35885dc123f59268fb74cec3d"><td class="memSeparator" colspan="2">&#160;</td></tr>
  174. <tr class="memitem:a9dd0446112e7bc982f8e3bb8bbb6b409"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="MQTTPacket_8c.html#a9dd0446112e7bc982f8e3bb8bbb6b409">MQTTPacket_freeUnsuback</a> (<a class="el" href="structUnsuback.html">Unsuback</a> *pack)</td></tr>
  175. <tr class="memdesc:a9dd0446112e7bc982f8e3bb8bbb6b409"><td class="mdescLeft">&#160;</td><td class="mdescRight">Free allocated storage for a suback packet. <a href="MQTTPacket_8c.html#a9dd0446112e7bc982f8e3bb8bbb6b409">More...</a><br /></td></tr>
  176. <tr class="separator:a9dd0446112e7bc982f8e3bb8bbb6b409"><td class="memSeparator" colspan="2">&#160;</td></tr>
  177. <tr class="memitem:a8167e3188a4bdcfb30c10e0d76c82afe"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="MQTTPacket_8c.html#a8167e3188a4bdcfb30c10e0d76c82afe">MQTTPacket_send_pubrec</a> (int MQTTVersion, int msgid, <a class="el" href="structnetworkHandles.html">networkHandles</a> *net, const char *clientID)</td></tr>
  178. <tr class="memdesc:a8167e3188a4bdcfb30c10e0d76c82afe"><td class="mdescLeft">&#160;</td><td class="mdescRight">Send an MQTT PUBREC packet down a socket. <a href="MQTTPacket_8c.html#a8167e3188a4bdcfb30c10e0d76c82afe">More...</a><br /></td></tr>
  179. <tr class="separator:a8167e3188a4bdcfb30c10e0d76c82afe"><td class="memSeparator" colspan="2">&#160;</td></tr>
  180. <tr class="memitem:adec2c812b12255dab78f75163a4f1960"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="MQTTPacket_8c.html#adec2c812b12255dab78f75163a4f1960">MQTTPacket_send_pubrel</a> (int MQTTVersion, int msgid, int dup, <a class="el" href="structnetworkHandles.html">networkHandles</a> *net, const char *clientID)</td></tr>
  181. <tr class="memdesc:adec2c812b12255dab78f75163a4f1960"><td class="mdescLeft">&#160;</td><td class="mdescRight">Send an MQTT PUBREL packet down a socket. <a href="MQTTPacket_8c.html#adec2c812b12255dab78f75163a4f1960">More...</a><br /></td></tr>
  182. <tr class="separator:adec2c812b12255dab78f75163a4f1960"><td class="memSeparator" colspan="2">&#160;</td></tr>
  183. <tr class="memitem:a908f81381b1720e4a53d15c1c4690f5c"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="MQTTPacket_8c.html#a908f81381b1720e4a53d15c1c4690f5c">MQTTPacket_send_pubcomp</a> (int MQTTVersion, int msgid, <a class="el" href="structnetworkHandles.html">networkHandles</a> *net, const char *clientID)</td></tr>
  184. <tr class="memdesc:a908f81381b1720e4a53d15c1c4690f5c"><td class="mdescLeft">&#160;</td><td class="mdescRight">Send an MQTT PUBCOMP packet down a socket. <a href="MQTTPacket_8c.html#a908f81381b1720e4a53d15c1c4690f5c">More...</a><br /></td></tr>
  185. <tr class="separator:a908f81381b1720e4a53d15c1c4690f5c"><td class="memSeparator" colspan="2">&#160;</td></tr>
  186. <tr class="memitem:a93c155059c80bd01b4a1561d9bec1d13"><td class="memItemLeft" align="right" valign="top">void *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="MQTTPacket_8c.html#a93c155059c80bd01b4a1561d9bec1d13">MQTTPacket_ack</a> (int MQTTVersion, unsigned char aHeader, char *data, size_t datalen)</td></tr>
  187. <tr class="memdesc:a93c155059c80bd01b4a1561d9bec1d13"><td class="mdescLeft">&#160;</td><td class="mdescRight">Function used in the new packets table to create acknowledgement packets. <a href="MQTTPacket_8c.html#a93c155059c80bd01b4a1561d9bec1d13">More...</a><br /></td></tr>
  188. <tr class="separator:a93c155059c80bd01b4a1561d9bec1d13"><td class="memSeparator" colspan="2">&#160;</td></tr>
  189. <tr class="memitem:a9ebcf93ff2ba3bd103f016c975e9c9c4"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="MQTTPacket_8c.html#a9ebcf93ff2ba3bd103f016c975e9c9c4">MQTTPacket_send_publish</a> (<a class="el" href="structPublish.html">Publish</a> *pack, int dup, int qos, int retained, <a class="el" href="structnetworkHandles.html">networkHandles</a> *net, const char *clientID)</td></tr>
  190. <tr class="memdesc:a9ebcf93ff2ba3bd103f016c975e9c9c4"><td class="mdescLeft">&#160;</td><td class="mdescRight">Send an MQTT PUBLISH packet down a socket. <a href="MQTTPacket_8c.html#a9ebcf93ff2ba3bd103f016c975e9c9c4">More...</a><br /></td></tr>
  191. <tr class="separator:a9ebcf93ff2ba3bd103f016c975e9c9c4"><td class="memSeparator" colspan="2">&#160;</td></tr>
  192. <tr class="memitem:a28f1754fe1f090d54bc3b5687fb2dd8c"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="MQTTPacket_8c.html#a28f1754fe1f090d54bc3b5687fb2dd8c">MQTTPacket_free_packet</a> (<a class="el" href="structMQTTPacket.html">MQTTPacket</a> *pack)</td></tr>
  193. <tr class="memdesc:a28f1754fe1f090d54bc3b5687fb2dd8c"><td class="mdescLeft">&#160;</td><td class="mdescRight">Free allocated storage for a various packet tyoes. <a href="MQTTPacket_8c.html#a28f1754fe1f090d54bc3b5687fb2dd8c">More...</a><br /></td></tr>
  194. <tr class="separator:a28f1754fe1f090d54bc3b5687fb2dd8c"><td class="memSeparator" colspan="2">&#160;</td></tr>
  195. <tr class="memitem:aefc0aa52c1cb13fa7bfcd77810d6a617"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="MQTTPacket_8c.html#aefc0aa52c1cb13fa7bfcd77810d6a617">writeInt4</a> (char **pptr, int anInt)</td></tr>
  196. <tr class="memdesc:aefc0aa52c1cb13fa7bfcd77810d6a617"><td class="mdescLeft">&#160;</td><td class="mdescRight">Writes an integer as 4 bytes to an output buffer. <a href="MQTTPacket_8c.html#aefc0aa52c1cb13fa7bfcd77810d6a617">More...</a><br /></td></tr>
  197. <tr class="separator:aefc0aa52c1cb13fa7bfcd77810d6a617"><td class="memSeparator" colspan="2">&#160;</td></tr>
  198. <tr class="memitem:aa8fc559d3a1e58ab50e69146666f2f63"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="MQTTPacket_8c.html#aa8fc559d3a1e58ab50e69146666f2f63">readInt4</a> (char **pptr)</td></tr>
  199. <tr class="memdesc:aa8fc559d3a1e58ab50e69146666f2f63"><td class="mdescLeft">&#160;</td><td class="mdescRight">Calculates an integer from two bytes read from the input buffer. <a href="MQTTPacket_8c.html#aa8fc559d3a1e58ab50e69146666f2f63">More...</a><br /></td></tr>
  200. <tr class="separator:aa8fc559d3a1e58ab50e69146666f2f63"><td class="memSeparator" colspan="2">&#160;</td></tr>
  201. <tr class="memitem:a1721836572050b02dda48d9ec0509cf0"><td class="memItemLeft" align="right" valign="top"><a id="a1721836572050b02dda48d9ec0509cf0"></a>
  202. void&#160;</td><td class="memItemRight" valign="bottom"><b>writeMQTTLenString</b> (char **pptr, <a class="el" href="structMQTTLenString.html">MQTTLenString</a> lenstring)</td></tr>
  203. <tr class="separator:a1721836572050b02dda48d9ec0509cf0"><td class="memSeparator" colspan="2">&#160;</td></tr>
  204. <tr class="memitem:ae2d27b49d88f5c8c59e5bd03918e45f9"><td class="memItemLeft" align="right" valign="top"><a id="ae2d27b49d88f5c8c59e5bd03918e45f9"></a>
  205. int&#160;</td><td class="memItemRight" valign="bottom"><b>MQTTLenStringRead</b> (<a class="el" href="structMQTTLenString.html">MQTTLenString</a> *lenstring, char **pptr, char *enddata)</td></tr>
  206. <tr class="separator:ae2d27b49d88f5c8c59e5bd03918e45f9"><td class="memSeparator" colspan="2">&#160;</td></tr>
  207. <tr class="memitem:a1774533e9d0beb549eb9136c05775a5a"><td class="memItemLeft" align="right" valign="top"><a id="a1774533e9d0beb549eb9136c05775a5a"></a>
  208. int&#160;</td><td class="memItemRight" valign="bottom"><b>MQTTPacket_VBIlen</b> (int rem_len)</td></tr>
  209. <tr class="separator:a1774533e9d0beb549eb9136c05775a5a"><td class="memSeparator" colspan="2">&#160;</td></tr>
  210. <tr class="memitem:a4fc1ee4d2cf8fd9bd59d89aadab222df"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="MQTTPacket_8c.html#a4fc1ee4d2cf8fd9bd59d89aadab222df">MQTTPacket_VBIdecode</a> (int(*getcharfn)(char *, int), unsigned int *value)</td></tr>
  211. <tr class="memdesc:a4fc1ee4d2cf8fd9bd59d89aadab222df"><td class="mdescLeft">&#160;</td><td class="mdescRight">Decodes the message length according to the MQTT algorithm. <a href="MQTTPacket_8c.html#a4fc1ee4d2cf8fd9bd59d89aadab222df">More...</a><br /></td></tr>
  212. <tr class="separator:a4fc1ee4d2cf8fd9bd59d89aadab222df"><td class="memSeparator" colspan="2">&#160;</td></tr>
  213. <tr class="memitem:a4ac216a4deeff513193ce9d515d1e3b4"><td class="memItemLeft" align="right" valign="top"><a id="a4ac216a4deeff513193ce9d515d1e3b4"></a>
  214. int&#160;</td><td class="memItemRight" valign="bottom"><b>bufchar</b> (char *c, int count)</td></tr>
  215. <tr class="separator:a4ac216a4deeff513193ce9d515d1e3b4"><td class="memSeparator" colspan="2">&#160;</td></tr>
  216. <tr class="memitem:a3ce47d3140f32c7d38b4ab1468d4dbe4"><td class="memItemLeft" align="right" valign="top"><a id="a3ce47d3140f32c7d38b4ab1468d4dbe4"></a>
  217. int&#160;</td><td class="memItemRight" valign="bottom"><b>MQTTPacket_decodeBuf</b> (char *buf, unsigned int *value)</td></tr>
  218. <tr class="separator:a3ce47d3140f32c7d38b4ab1468d4dbe4"><td class="memSeparator" colspan="2">&#160;</td></tr>
  219. </table><table class="memberdecls">
  220. <tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="var-members"></a>
  221. Variables</h2></td></tr>
  222. <tr class="memitem:a4536b1c36ed06171f20baeb69c01aa02"><td class="memItemLeft" align="right" valign="top">static const char *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="MQTTPacket_8c.html#a4536b1c36ed06171f20baeb69c01aa02">packet_names</a> []</td></tr>
  223. <tr class="memdesc:a4536b1c36ed06171f20baeb69c01aa02"><td class="mdescLeft">&#160;</td><td class="mdescRight"><a class="el" href="structList.html" title="Structure to hold all data for one list.">List</a> of the predefined MQTT v3/v5 packet names. <a href="MQTTPacket_8c.html#a4536b1c36ed06171f20baeb69c01aa02">More...</a><br /></td></tr>
  224. <tr class="separator:a4536b1c36ed06171f20baeb69c01aa02"><td class="memSeparator" colspan="2">&#160;</td></tr>
  225. <tr class="memitem:a36755eeac28fc14f18486b5a2c6f3852"><td class="memItemLeft" align="right" valign="top"><a id="a36755eeac28fc14f18486b5a2c6f3852"></a>
  226. const char **&#160;</td><td class="memItemRight" valign="bottom"><b>MQTTClient_packet_names</b> = <a class="el" href="MQTTPacket_8c.html#a4536b1c36ed06171f20baeb69c01aa02">packet_names</a></td></tr>
  227. <tr class="separator:a36755eeac28fc14f18486b5a2c6f3852"><td class="memSeparator" colspan="2">&#160;</td></tr>
  228. <tr class="memitem:a210a7b616c27aa7247824022285da784"><td class="memItemLeft" align="right" valign="top">pf&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="MQTTPacket_8c.html#a210a7b616c27aa7247824022285da784">new_packets</a> []</td></tr>
  229. <tr class="memdesc:a210a7b616c27aa7247824022285da784"><td class="mdescLeft">&#160;</td><td class="mdescRight">Array of functions to build packets, indexed according to packet code. <a href="MQTTPacket_8c.html#a210a7b616c27aa7247824022285da784">More...</a><br /></td></tr>
  230. <tr class="separator:a210a7b616c27aa7247824022285da784"><td class="memSeparator" colspan="2">&#160;</td></tr>
  231. <tr class="memitem:a6b2413569ef95c163d3e4b8efed6891b"><td class="memItemLeft" align="right" valign="top"><a id="a6b2413569ef95c163d3e4b8efed6891b"></a>
  232. static char *&#160;</td><td class="memItemRight" valign="bottom"><b>bufptr</b></td></tr>
  233. <tr class="separator:a6b2413569ef95c163d3e4b8efed6891b"><td class="memSeparator" colspan="2">&#160;</td></tr>
  234. </table>
  235. <a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
  236. <div class="textblock"><p>functions to deal with reading and writing of MQTT packets from and to sockets </p>
  237. <p>Some other related functions are in the MQTTPacketOut module </p>
  238. </div><h2 class="groupheader">Function Documentation</h2>
  239. <a id="a93c155059c80bd01b4a1561d9bec1d13"></a>
  240. <h2 class="memtitle"><span class="permalink"><a href="#a93c155059c80bd01b4a1561d9bec1d13">&#9670;&nbsp;</a></span>MQTTPacket_ack()</h2>
  241. <div class="memitem">
  242. <div class="memproto">
  243. <table class="memname">
  244. <tr>
  245. <td class="memname">void* MQTTPacket_ack </td>
  246. <td>(</td>
  247. <td class="paramtype">int&#160;</td>
  248. <td class="paramname"><em>MQTTVersion</em>, </td>
  249. </tr>
  250. <tr>
  251. <td class="paramkey"></td>
  252. <td></td>
  253. <td class="paramtype">unsigned char&#160;</td>
  254. <td class="paramname"><em>aHeader</em>, </td>
  255. </tr>
  256. <tr>
  257. <td class="paramkey"></td>
  258. <td></td>
  259. <td class="paramtype">char *&#160;</td>
  260. <td class="paramname"><em>data</em>, </td>
  261. </tr>
  262. <tr>
  263. <td class="paramkey"></td>
  264. <td></td>
  265. <td class="paramtype">size_t&#160;</td>
  266. <td class="paramname"><em>datalen</em>&#160;</td>
  267. </tr>
  268. <tr>
  269. <td></td>
  270. <td>)</td>
  271. <td></td><td></td>
  272. </tr>
  273. </table>
  274. </div><div class="memdoc">
  275. <p>Function used in the new packets table to create acknowledgement packets. </p>
  276. <dl class="params"><dt>Parameters</dt><dd>
  277. <table class="params">
  278. <tr><td class="paramname">MQTTVersion</td><td>the version of MQTT being used </td></tr>
  279. <tr><td class="paramname">aHeader</td><td>the MQTT header byte </td></tr>
  280. <tr><td class="paramname">data</td><td>the rest of the packet </td></tr>
  281. <tr><td class="paramname">datalen</td><td>the length of the rest of the packet </td></tr>
  282. </table>
  283. </dd>
  284. </dl>
  285. <dl class="section return"><dt>Returns</dt><dd>pointer to the packet structure </dd></dl>
  286. <div class="dynheader">
  287. Here is the call graph for this function:</div>
  288. <div class="dyncontent">
  289. <div class="center"><img src="MQTTPacket_8c_a93c155059c80bd01b4a1561d9bec1d13_cgraph.png" border="0" usemap="#MQTTPacket_8c_a93c155059c80bd01b4a1561d9bec1d13_cgraph" alt=""/></div>
  290. <map name="MQTTPacket_8c_a93c155059c80bd01b4a1561d9bec1d13_cgraph" id="MQTTPacket_8c_a93c155059c80bd01b4a1561d9bec1d13_cgraph">
  291. <area shape="rect" title="Function used in the new packets table to create acknowledgement packets." alt="" coords="5,31,133,57"/>
  292. <area shape="rect" href="MQTTPacket_8c.html#aff1d10b221f5b4ce421b4c2588cbe511" title="Reads one character from the input buffer." alt="" coords="181,5,256,32"/>
  293. <area shape="rect" href="MQTTPacket_8c.html#a132d2d5b304d37cd2348a973f7b315de" title="Calculates an integer from two bytes read from the input buffer." alt="" coords="187,56,250,83"/>
  294. </map>
  295. </div>
  296. </div>
  297. </div>
  298. <a id="ac1f61e571640513a9785b3164141dfbc"></a>
  299. <h2 class="memtitle"><span class="permalink"><a href="#ac1f61e571640513a9785b3164141dfbc">&#9670;&nbsp;</a></span>MQTTPacket_decode()</h2>
  300. <div class="memitem">
  301. <div class="memproto">
  302. <table class="memname">
  303. <tr>
  304. <td class="memname">int MQTTPacket_decode </td>
  305. <td>(</td>
  306. <td class="paramtype"><a class="el" href="structnetworkHandles.html">networkHandles</a> *&#160;</td>
  307. <td class="paramname"><em>net</em>, </td>
  308. </tr>
  309. <tr>
  310. <td class="paramkey"></td>
  311. <td></td>
  312. <td class="paramtype">size_t *&#160;</td>
  313. <td class="paramname"><em>value</em>&#160;</td>
  314. </tr>
  315. <tr>
  316. <td></td>
  317. <td>)</td>
  318. <td></td><td></td>
  319. </tr>
  320. </table>
  321. </div><div class="memdoc">
  322. <p>Decodes the message length according to the MQTT algorithm. </p>
  323. <dl class="params"><dt>Parameters</dt><dd>
  324. <table class="params">
  325. <tr><td class="paramname">socket</td><td>the socket from which to read the bytes </td></tr>
  326. <tr><td class="paramname">value</td><td>the decoded length returned </td></tr>
  327. </table>
  328. </dd>
  329. </dl>
  330. <dl class="section return"><dt>Returns</dt><dd>the number of bytes read from the socket </dd></dl>
  331. </div>
  332. </div>
  333. <a id="aadd77a4fa1b2d5c7791e3542c56af856"></a>
  334. <h2 class="memtitle"><span class="permalink"><a href="#aadd77a4fa1b2d5c7791e3542c56af856">&#9670;&nbsp;</a></span>MQTTPacket_encode()</h2>
  335. <div class="memitem">
  336. <div class="memproto">
  337. <table class="memname">
  338. <tr>
  339. <td class="memname">int MQTTPacket_encode </td>
  340. <td>(</td>
  341. <td class="paramtype">char *&#160;</td>
  342. <td class="paramname"><em>buf</em>, </td>
  343. </tr>
  344. <tr>
  345. <td class="paramkey"></td>
  346. <td></td>
  347. <td class="paramtype">size_t&#160;</td>
  348. <td class="paramname"><em>length</em>&#160;</td>
  349. </tr>
  350. <tr>
  351. <td></td>
  352. <td>)</td>
  353. <td></td><td></td>
  354. </tr>
  355. </table>
  356. </div><div class="memdoc">
  357. <p>Encodes the message length according to the MQTT algorithm. </p>
  358. <dl class="params"><dt>Parameters</dt><dd>
  359. <table class="params">
  360. <tr><td class="paramname">buf</td><td>the buffer into which the encoded data is written </td></tr>
  361. <tr><td class="paramname">length</td><td>the length to be encoded </td></tr>
  362. </table>
  363. </dd>
  364. </dl>
  365. <dl class="section return"><dt>Returns</dt><dd>the number of bytes written to buffer </dd></dl>
  366. </div>
  367. </div>
  368. <a id="af922033c495b05fe4242afc54211f20d"></a>
  369. <h2 class="memtitle"><span class="permalink"><a href="#af922033c495b05fe4242afc54211f20d">&#9670;&nbsp;</a></span>MQTTPacket_Factory()</h2>
  370. <div class="memitem">
  371. <div class="memproto">
  372. <table class="memname">
  373. <tr>
  374. <td class="memname">void* MQTTPacket_Factory </td>
  375. <td>(</td>
  376. <td class="paramtype">int&#160;</td>
  377. <td class="paramname"><em>MQTTVersion</em>, </td>
  378. </tr>
  379. <tr>
  380. <td class="paramkey"></td>
  381. <td></td>
  382. <td class="paramtype"><a class="el" href="structnetworkHandles.html">networkHandles</a> *&#160;</td>
  383. <td class="paramname"><em>net</em>, </td>
  384. </tr>
  385. <tr>
  386. <td class="paramkey"></td>
  387. <td></td>
  388. <td class="paramtype">int *&#160;</td>
  389. <td class="paramname"><em>error</em>&#160;</td>
  390. </tr>
  391. <tr>
  392. <td></td>
  393. <td>)</td>
  394. <td></td><td></td>
  395. </tr>
  396. </table>
  397. </div><div class="memdoc">
  398. <p>Reads one MQTT packet from a socket. </p>
  399. <dl class="params"><dt>Parameters</dt><dd>
  400. <table class="params">
  401. <tr><td class="paramname">socket</td><td>a socket from which to read an MQTT packet </td></tr>
  402. <tr><td class="paramname">error</td><td>pointer to the error code which is completed if no packet is returned </td></tr>
  403. </table>
  404. </dd>
  405. </dl>
  406. <dl class="section return"><dt>Returns</dt><dd>the packet structure or NULL if there was an error </dd></dl>
  407. <div class="dynheader">
  408. Here is the call graph for this function:</div>
  409. <div class="dyncontent">
  410. <div class="center"><img src="MQTTPacket_8c_af922033c495b05fe4242afc54211f20d_cgraph.png" border="0" usemap="#MQTTPacket_8c_af922033c495b05fe4242afc54211f20d_cgraph" alt=""/></div>
  411. <map name="MQTTPacket_8c_af922033c495b05fe4242afc54211f20d_cgraph" id="MQTTPacket_8c_af922033c495b05fe4242afc54211f20d_cgraph">
  412. <area shape="rect" title="Reads one MQTT packet from a socket." alt="" coords="5,81,156,108"/>
  413. <area shape="rect" href="Log_8c.html#a669722e3f57811871f97c12392aba85d" title="Log a message." alt="" coords="279,5,323,32"/>
  414. <area shape="rect" href="MQTTPacket_8c.html#ac1f61e571640513a9785b3164141dfbc" title="Decodes the message length according to the MQTT algorithm." alt="" coords="227,56,376,83"/>
  415. <area shape="rect" href="MQTTPacket_8c.html#aadd77a4fa1b2d5c7791e3542c56af856" title="Encodes the message length according to the MQTT algorithm." alt="" coords="227,107,376,133"/>
  416. <area shape="rect" href="MQTTPersistence_8c.html#a18eab666c3e6aecd92a6c8f10df808e3" title="Adds a record to the persistent store." alt="" coords="204,157,399,184"/>
  417. </map>
  418. </div>
  419. </div>
  420. </div>
  421. <a id="a28f1754fe1f090d54bc3b5687fb2dd8c"></a>
  422. <h2 class="memtitle"><span class="permalink"><a href="#a28f1754fe1f090d54bc3b5687fb2dd8c">&#9670;&nbsp;</a></span>MQTTPacket_free_packet()</h2>
  423. <div class="memitem">
  424. <div class="memproto">
  425. <table class="memname">
  426. <tr>
  427. <td class="memname">void MQTTPacket_free_packet </td>
  428. <td>(</td>
  429. <td class="paramtype"><a class="el" href="structMQTTPacket.html">MQTTPacket</a> *&#160;</td>
  430. <td class="paramname"><em>pack</em></td><td>)</td>
  431. <td></td>
  432. </tr>
  433. </table>
  434. </div><div class="memdoc">
  435. <p>Free allocated storage for a various packet tyoes. </p>
  436. <dl class="params"><dt>Parameters</dt><dd>
  437. <table class="params">
  438. <tr><td class="paramname">pack</td><td>pointer to the suback packet structure </td></tr>
  439. </table>
  440. </dd>
  441. </dl>
  442. <div class="dynheader">
  443. Here is the call graph for this function:</div>
  444. <div class="dyncontent">
  445. <div class="center"><img src="MQTTPacket_8c_a28f1754fe1f090d54bc3b5687fb2dd8c_cgraph.png" border="0" usemap="#MQTTPacket_8c_a28f1754fe1f090d54bc3b5687fb2dd8c_cgraph" alt=""/></div>
  446. <map name="MQTTPacket_8c_a28f1754fe1f090d54bc3b5687fb2dd8c_cgraph" id="MQTTPacket_8c_a28f1754fe1f090d54bc3b5687fb2dd8c_cgraph">
  447. <area shape="rect" title="Free allocated storage for a various packet tyoes." alt="" coords="5,5,180,32"/>
  448. <area shape="rect" href="MQTTPacket_8c.html#a642e5f62d21f14e81f8fc70b491d89c8" title="Free allocated storage for a publish packet." alt="" coords="228,5,400,32"/>
  449. </map>
  450. </div>
  451. </div>
  452. </div>
  453. <a id="a0ef92fb0207ed6272de9ebc749745d0c"></a>
  454. <h2 class="memtitle"><span class="permalink"><a href="#a0ef92fb0207ed6272de9ebc749745d0c">&#9670;&nbsp;</a></span>MQTTPacket_freeAck()</h2>
  455. <div class="memitem">
  456. <div class="memproto">
  457. <table class="memname">
  458. <tr>
  459. <td class="memname">void MQTTPacket_freeAck </td>
  460. <td>(</td>
  461. <td class="paramtype"><a class="el" href="structAck.html">Ack</a> *&#160;</td>
  462. <td class="paramname"><em>pack</em></td><td>)</td>
  463. <td></td>
  464. </tr>
  465. </table>
  466. </div><div class="memdoc">
  467. <p>Free allocated storage for an ack packet. </p>
  468. <dl class="params"><dt>Parameters</dt><dd>
  469. <table class="params">
  470. <tr><td class="paramname">pack</td><td>pointer to the publish packet structure </td></tr>
  471. </table>
  472. </dd>
  473. </dl>
  474. </div>
  475. </div>
  476. <a id="a642e5f62d21f14e81f8fc70b491d89c8"></a>
  477. <h2 class="memtitle"><span class="permalink"><a href="#a642e5f62d21f14e81f8fc70b491d89c8">&#9670;&nbsp;</a></span>MQTTPacket_freePublish()</h2>
  478. <div class="memitem">
  479. <div class="memproto">
  480. <table class="memname">
  481. <tr>
  482. <td class="memname">void MQTTPacket_freePublish </td>
  483. <td>(</td>
  484. <td class="paramtype"><a class="el" href="structPublish.html">Publish</a> *&#160;</td>
  485. <td class="paramname"><em>pack</em></td><td>)</td>
  486. <td></td>
  487. </tr>
  488. </table>
  489. </div><div class="memdoc">
  490. <p>Free allocated storage for a publish packet. </p>
  491. <dl class="params"><dt>Parameters</dt><dd>
  492. <table class="params">
  493. <tr><td class="paramname">pack</td><td>pointer to the publish packet structure </td></tr>
  494. </table>
  495. </dd>
  496. </dl>
  497. </div>
  498. </div>
  499. <a id="a4262b8f35885dc123f59268fb74cec3d"></a>
  500. <h2 class="memtitle"><span class="permalink"><a href="#a4262b8f35885dc123f59268fb74cec3d">&#9670;&nbsp;</a></span>MQTTPacket_freeSuback()</h2>
  501. <div class="memitem">
  502. <div class="memproto">
  503. <table class="memname">
  504. <tr>
  505. <td class="memname">void MQTTPacket_freeSuback </td>
  506. <td>(</td>
  507. <td class="paramtype"><a class="el" href="structSuback.html">Suback</a> *&#160;</td>
  508. <td class="paramname"><em>pack</em></td><td>)</td>
  509. <td></td>
  510. </tr>
  511. </table>
  512. </div><div class="memdoc">
  513. <p>Free allocated storage for a suback packet. </p>
  514. <dl class="params"><dt>Parameters</dt><dd>
  515. <table class="params">
  516. <tr><td class="paramname">pack</td><td>pointer to the suback packet structure </td></tr>
  517. </table>
  518. </dd>
  519. </dl>
  520. <div class="dynheader">
  521. Here is the call graph for this function:</div>
  522. <div class="dyncontent">
  523. <div class="center"><img src="MQTTPacket_8c_a4262b8f35885dc123f59268fb74cec3d_cgraph.png" border="0" usemap="#MQTTPacket_8c_a4262b8f35885dc123f59268fb74cec3d_cgraph" alt=""/></div>
  524. <map name="MQTTPacket_8c_a4262b8f35885dc123f59268fb74cec3d_cgraph" id="MQTTPacket_8c_a4262b8f35885dc123f59268fb74cec3d_cgraph">
  525. <area shape="rect" title="Free allocated storage for a suback packet." alt="" coords="5,5,179,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="227,5,297,32"/>
  527. <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="345,5,425,32"/>
  528. </map>
  529. </div>
  530. </div>
  531. </div>
  532. <a id="a9dd0446112e7bc982f8e3bb8bbb6b409"></a>
  533. <h2 class="memtitle"><span class="permalink"><a href="#a9dd0446112e7bc982f8e3bb8bbb6b409">&#9670;&nbsp;</a></span>MQTTPacket_freeUnsuback()</h2>
  534. <div class="memitem">
  535. <div class="memproto">
  536. <table class="memname">
  537. <tr>
  538. <td class="memname">void MQTTPacket_freeUnsuback </td>
  539. <td>(</td>
  540. <td class="paramtype"><a class="el" href="structUnsuback.html">Unsuback</a> *&#160;</td>
  541. <td class="paramname"><em>pack</em></td><td>)</td>
  542. <td></td>
  543. </tr>
  544. </table>
  545. </div><div class="memdoc">
  546. <p>Free allocated storage for a suback packet. </p>
  547. <dl class="params"><dt>Parameters</dt><dd>
  548. <table class="params">
  549. <tr><td class="paramname">pack</td><td>pointer to the suback packet structure </td></tr>
  550. </table>
  551. </dd>
  552. </dl>
  553. <div class="dynheader">
  554. Here is the call graph for this function:</div>
  555. <div class="dyncontent">
  556. <div class="center"><img src="MQTTPacket_8c_a9dd0446112e7bc982f8e3bb8bbb6b409_cgraph.png" border="0" usemap="#MQTTPacket_8c_a9dd0446112e7bc982f8e3bb8bbb6b409_cgraph" alt=""/></div>
  557. <map name="MQTTPacket_8c_a9dd0446112e7bc982f8e3bb8bbb6b409_cgraph" id="MQTTPacket_8c_a9dd0446112e7bc982f8e3bb8bbb6b409_cgraph">
  558. <area shape="rect" title="Free allocated storage for a suback packet." alt="" coords="5,5,193,32"/>
  559. <area shape="rect" href="LinkedList_8c.html#a276950531b3f54e0dda27d597572c192" title="Removes and frees all items in a list, and frees the list itself." alt="" coords="241,5,312,32"/>
  560. <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="360,5,440,32"/>
  561. </map>
  562. </div>
  563. </div>
  564. </div>
  565. <a id="af3ddd9c1a35d51bf70f44a1aa6fa0bba"></a>
  566. <h2 class="memtitle"><span class="permalink"><a href="#af3ddd9c1a35d51bf70f44a1aa6fa0bba">&#9670;&nbsp;</a></span>MQTTPacket_header_only()</h2>
  567. <div class="memitem">
  568. <div class="memproto">
  569. <table class="memname">
  570. <tr>
  571. <td class="memname">void* MQTTPacket_header_only </td>
  572. <td>(</td>
  573. <td class="paramtype">int&#160;</td>
  574. <td class="paramname"><em>MQTTVersion</em>, </td>
  575. </tr>
  576. <tr>
  577. <td class="paramkey"></td>
  578. <td></td>
  579. <td class="paramtype">unsigned char&#160;</td>
  580. <td class="paramname"><em>aHeader</em>, </td>
  581. </tr>
  582. <tr>
  583. <td class="paramkey"></td>
  584. <td></td>
  585. <td class="paramtype">char *&#160;</td>
  586. <td class="paramname"><em>data</em>, </td>
  587. </tr>
  588. <tr>
  589. <td class="paramkey"></td>
  590. <td></td>
  591. <td class="paramtype">size_t&#160;</td>
  592. <td class="paramname"><em>datalen</em>&#160;</td>
  593. </tr>
  594. <tr>
  595. <td></td>
  596. <td>)</td>
  597. <td></td><td></td>
  598. </tr>
  599. </table>
  600. </div><div class="memdoc">
  601. <p>Function used in the new packets table to create packets which have only a header. </p>
  602. <dl class="params"><dt>Parameters</dt><dd>
  603. <table class="params">
  604. <tr><td class="paramname">MQTTVersion</td><td>the version of MQTT </td></tr>
  605. <tr><td class="paramname">aHeader</td><td>the MQTT header byte </td></tr>
  606. <tr><td class="paramname">data</td><td>the rest of the packet </td></tr>
  607. <tr><td class="paramname">datalen</td><td>the length of the rest of the packet </td></tr>
  608. </table>
  609. </dd>
  610. </dl>
  611. <dl class="section return"><dt>Returns</dt><dd>pointer to the packet structure </dd></dl>
  612. </div>
  613. </div>
  614. <a id="a9f9e58aba3ed5d513862d76bc5e29743"></a>
  615. <h2 class="memtitle"><span class="permalink"><a href="#a9f9e58aba3ed5d513862d76bc5e29743">&#9670;&nbsp;</a></span>MQTTPacket_name()</h2>
  616. <div class="memitem">
  617. <div class="memproto">
  618. <table class="memname">
  619. <tr>
  620. <td class="memname">const char* MQTTPacket_name </td>
  621. <td>(</td>
  622. <td class="paramtype">int&#160;</td>
  623. <td class="paramname"><em>ptype</em></td><td>)</td>
  624. <td></td>
  625. </tr>
  626. </table>
  627. </div><div class="memdoc">
  628. <p>Converts an MQTT packet code into its name. </p>
  629. <dl class="params"><dt>Parameters</dt><dd>
  630. <table class="params">
  631. <tr><td class="paramname">ptype</td><td>packet code </td></tr>
  632. </table>
  633. </dd>
  634. </dl>
  635. <dl class="section return"><dt>Returns</dt><dd>the corresponding string, or "UNKNOWN" </dd></dl>
  636. </div>
  637. </div>
  638. <a id="a58feb89ee5616f2ea6d222bbbef927bb"></a>
  639. <h2 class="memtitle"><span class="permalink"><a href="#a58feb89ee5616f2ea6d222bbbef927bb">&#9670;&nbsp;</a></span>MQTTPacket_publish()</h2>
  640. <div class="memitem">
  641. <div class="memproto">
  642. <table class="memname">
  643. <tr>
  644. <td class="memname">void* MQTTPacket_publish </td>
  645. <td>(</td>
  646. <td class="paramtype">int&#160;</td>
  647. <td class="paramname"><em>MQTTVersion</em>, </td>
  648. </tr>
  649. <tr>
  650. <td class="paramkey"></td>
  651. <td></td>
  652. <td class="paramtype">unsigned char&#160;</td>
  653. <td class="paramname"><em>aHeader</em>, </td>
  654. </tr>
  655. <tr>
  656. <td class="paramkey"></td>
  657. <td></td>
  658. <td class="paramtype">char *&#160;</td>
  659. <td class="paramname"><em>data</em>, </td>
  660. </tr>
  661. <tr>
  662. <td class="paramkey"></td>
  663. <td></td>
  664. <td class="paramtype">size_t&#160;</td>
  665. <td class="paramname"><em>datalen</em>&#160;</td>
  666. </tr>
  667. <tr>
  668. <td></td>
  669. <td>)</td>
  670. <td></td><td></td>
  671. </tr>
  672. </table>
  673. </div><div class="memdoc">
  674. <p>Function used in the new packets table to create publish packets. </p>
  675. <dl class="params"><dt>Parameters</dt><dd>
  676. <table class="params">
  677. <tr><td class="paramname">MQTTVersion</td><td></td></tr>
  678. <tr><td class="paramname">aHeader</td><td>the MQTT header byte </td></tr>
  679. <tr><td class="paramname">data</td><td>the rest of the packet </td></tr>
  680. <tr><td class="paramname">datalen</td><td>the length of the rest of the packet </td></tr>
  681. </table>
  682. </dd>
  683. </dl>
  684. <dl class="section return"><dt>Returns</dt><dd>pointer to the packet structure </dd></dl>
  685. <div class="dynheader">
  686. Here is the call graph for this function:</div>
  687. <div class="dyncontent">
  688. <div class="center"><img src="MQTTPacket_8c_a58feb89ee5616f2ea6d222bbbef927bb_cgraph.png" border="0" usemap="#MQTTPacket_8c_a58feb89ee5616f2ea6d222bbbef927bb_cgraph" alt=""/></div>
  689. <map name="MQTTPacket_8c_a58feb89ee5616f2ea6d222bbbef927bb_cgraph" id="MQTTPacket_8c_a58feb89ee5616f2ea6d222bbbef927bb_cgraph">
  690. <area shape="rect" title="Function used in the new packets table to create publish packets." alt="" coords="5,5,153,32"/>
  691. <area shape="rect" href="MQTTPacket_8c.html#a132d2d5b304d37cd2348a973f7b315de" title="Calculates an integer from two bytes read from the input buffer." alt="" coords="340,5,403,32"/>
  692. <area shape="rect" href="MQTTPacket_8c.html#ae1ec2d8714335c6ec88c93e957b644d2" title="Reads a &quot;UTF&quot; string from the input buffer." alt="" coords="201,31,292,57"/>
  693. </map>
  694. </div>
  695. </div>
  696. </div>
  697. <a id="a51f58f1c7864f9fe87b55cc6ccb10129"></a>
  698. <h2 class="memtitle"><span class="permalink"><a href="#a51f58f1c7864f9fe87b55cc6ccb10129">&#9670;&nbsp;</a></span>MQTTPacket_send()</h2>
  699. <div class="memitem">
  700. <div class="memproto">
  701. <table class="memname">
  702. <tr>
  703. <td class="memname">int MQTTPacket_send </td>
  704. <td>(</td>
  705. <td class="paramtype"><a class="el" href="structnetworkHandles.html">networkHandles</a> *&#160;</td>
  706. <td class="paramname"><em>net</em>, </td>
  707. </tr>
  708. <tr>
  709. <td class="paramkey"></td>
  710. <td></td>
  711. <td class="paramtype"><a class="el" href="unionHeader.html">Header</a>&#160;</td>
  712. <td class="paramname"><em>header</em>, </td>
  713. </tr>
  714. <tr>
  715. <td class="paramkey"></td>
  716. <td></td>
  717. <td class="paramtype">char *&#160;</td>
  718. <td class="paramname"><em>buffer</em>, </td>
  719. </tr>
  720. <tr>
  721. <td class="paramkey"></td>
  722. <td></td>
  723. <td class="paramtype">size_t&#160;</td>
  724. <td class="paramname"><em>buflen</em>, </td>
  725. </tr>
  726. <tr>
  727. <td class="paramkey"></td>
  728. <td></td>
  729. <td class="paramtype">int&#160;</td>
  730. <td class="paramname"><em>freeData</em>, </td>
  731. </tr>
  732. <tr>
  733. <td class="paramkey"></td>
  734. <td></td>
  735. <td class="paramtype">int&#160;</td>
  736. <td class="paramname"><em>MQTTVersion</em>&#160;</td>
  737. </tr>
  738. <tr>
  739. <td></td>
  740. <td>)</td>
  741. <td></td><td></td>
  742. </tr>
  743. </table>
  744. </div><div class="memdoc">
  745. <p>Sends an MQTT packet in one system call write. </p>
  746. <dl class="params"><dt>Parameters</dt><dd>
  747. <table class="params">
  748. <tr><td class="paramname">socket</td><td>the socket to which to write the data </td></tr>
  749. <tr><td class="paramname">header</td><td>the one-byte MQTT header </td></tr>
  750. <tr><td class="paramname">buffer</td><td>the rest of the buffer to write (not including remaining length) </td></tr>
  751. <tr><td class="paramname">buflen</td><td>the length of the data in buffer to be written </td></tr>
  752. <tr><td class="paramname">MQTTVersion</td><td>the version of MQTT being used </td></tr>
  753. </table>
  754. </dd>
  755. </dl>
  756. <dl class="section return"><dt>Returns</dt><dd>the completion code (TCPSOCKET_COMPLETE etc) </dd></dl>
  757. <div class="dynheader">
  758. Here is the call graph for this function:</div>
  759. <div class="dyncontent">
  760. <div class="center"><img src="MQTTPacket_8c_a51f58f1c7864f9fe87b55cc6ccb10129_cgraph.png" border="0" usemap="#MQTTPacket_8c_a51f58f1c7864f9fe87b55cc6ccb10129_cgraph" alt=""/></div>
  761. <map name="MQTTPacket_8c_a51f58f1c7864f9fe87b55cc6ccb10129_cgraph" id="MQTTPacket_8c_a51f58f1c7864f9fe87b55cc6ccb10129_cgraph">
  762. <area shape="rect" title="Sends an MQTT packet in one system call write." alt="" coords="5,56,140,83"/>
  763. <area shape="rect" href="MQTTPacket_8c.html#aadd77a4fa1b2d5c7791e3542c56af856" title="Encodes the message length according to the MQTT algorithm." alt="" coords="211,5,360,32"/>
  764. <area shape="rect" href="MQTTPersistence_8c.html#a18eab666c3e6aecd92a6c8f10df808e3" title="Adds a record to the persistent store." alt="" coords="188,56,383,83"/>
  765. <area shape="rect" href="MQTTPacket_8c.html#a132d2d5b304d37cd2348a973f7b315de" title="Calculates an integer from two bytes read from the input buffer." alt="" coords="254,107,317,133"/>
  766. </map>
  767. </div>
  768. </div>
  769. </div>
  770. <a id="ad89e627a37f7f7eb4355b076cd46e0b0"></a>
  771. <h2 class="memtitle"><span class="permalink"><a href="#ad89e627a37f7f7eb4355b076cd46e0b0">&#9670;&nbsp;</a></span>MQTTPacket_send_ack()</h2>
  772. <div class="memitem">
  773. <div class="memproto">
  774. <table class="mlabels">
  775. <tr>
  776. <td class="mlabels-left">
  777. <table class="memname">
  778. <tr>
  779. <td class="memname">static int MQTTPacket_send_ack </td>
  780. <td>(</td>
  781. <td class="paramtype">int&#160;</td>
  782. <td class="paramname"><em>MQTTVersion</em>, </td>
  783. </tr>
  784. <tr>
  785. <td class="paramkey"></td>
  786. <td></td>
  787. <td class="paramtype">int&#160;</td>
  788. <td class="paramname"><em>type</em>, </td>
  789. </tr>
  790. <tr>
  791. <td class="paramkey"></td>
  792. <td></td>
  793. <td class="paramtype">int&#160;</td>
  794. <td class="paramname"><em>msgid</em>, </td>
  795. </tr>
  796. <tr>
  797. <td class="paramkey"></td>
  798. <td></td>
  799. <td class="paramtype">int&#160;</td>
  800. <td class="paramname"><em>dup</em>, </td>
  801. </tr>
  802. <tr>
  803. <td class="paramkey"></td>
  804. <td></td>
  805. <td class="paramtype"><a class="el" href="structnetworkHandles.html">networkHandles</a> *&#160;</td>
  806. <td class="paramname"><em>net</em>&#160;</td>
  807. </tr>
  808. <tr>
  809. <td></td>
  810. <td>)</td>
  811. <td></td><td></td>
  812. </tr>
  813. </table>
  814. </td>
  815. <td class="mlabels-right">
  816. <span class="mlabels"><span class="mlabel">static</span></span> </td>
  817. </tr>
  818. </table>
  819. </div><div class="memdoc">
  820. <p>Send an MQTT acknowledgement packet down a socket. </p>
  821. <dl class="params"><dt>Parameters</dt><dd>
  822. <table class="params">
  823. <tr><td class="paramname">MQTTVersion</td><td>the version of MQTT being used </td></tr>
  824. <tr><td class="paramname">type</td><td>the MQTT packet type e.g. SUBACK </td></tr>
  825. <tr><td class="paramname">msgid</td><td>the MQTT message id to use </td></tr>
  826. <tr><td class="paramname">dup</td><td>boolean - whether to set the MQTT DUP flag </td></tr>
  827. <tr><td class="paramname">net</td><td>the network handle to send the data to </td></tr>
  828. </table>
  829. </dd>
  830. </dl>
  831. <dl class="section return"><dt>Returns</dt><dd>the completion code (e.g. TCPSOCKET_COMPLETE) </dd></dl>
  832. <div class="dynheader">
  833. Here is the call graph for this function:</div>
  834. <div class="dyncontent">
  835. <div class="center"><img src="MQTTPacket_8c_ad89e627a37f7f7eb4355b076cd46e0b0_cgraph.png" border="0" usemap="#MQTTPacket_8c_ad89e627a37f7f7eb4355b076cd46e0b0_cgraph" alt=""/></div>
  836. <map name="MQTTPacket_8c_ad89e627a37f7f7eb4355b076cd46e0b0_cgraph" id="MQTTPacket_8c_ad89e627a37f7f7eb4355b076cd46e0b0_cgraph">
  837. <area shape="rect" title="Send an MQTT acknowledgement packet down a socket." alt="" coords="5,81,168,108"/>
  838. <area shape="rect" href="MQTTPacket_8c.html#a51f58f1c7864f9fe87b55cc6ccb10129" title="Sends an MQTT packet in one system call write." alt="" coords="216,56,351,83"/>
  839. <area shape="rect" href="MQTTPacket_8c.html#a07aa0146eda3d32979142e7df8ad5fc3" title="Writes an integer as 2 bytes to an output buffer." alt="" coords="251,107,316,133"/>
  840. <area shape="rect" href="MQTTPacket_8c.html#aadd77a4fa1b2d5c7791e3542c56af856" title="Encodes the message length according to the MQTT algorithm." alt="" coords="421,5,571,32"/>
  841. <area shape="rect" href="MQTTPersistence_8c.html#a18eab666c3e6aecd92a6c8f10df808e3" title="Adds a record to the persistent store." alt="" coords="399,56,593,83"/>
  842. <area shape="rect" href="MQTTPacket_8c.html#a132d2d5b304d37cd2348a973f7b315de" title="Calculates an integer from two bytes read from the input buffer." alt="" coords="465,107,527,133"/>
  843. </map>
  844. </div>
  845. </div>
  846. </div>
  847. <a id="aa9e17261b4d09d802dba6a65bcdc44fa"></a>
  848. <h2 class="memtitle"><span class="permalink"><a href="#aa9e17261b4d09d802dba6a65bcdc44fa">&#9670;&nbsp;</a></span>MQTTPacket_send_disconnect()</h2>
  849. <div class="memitem">
  850. <div class="memproto">
  851. <table class="memname">
  852. <tr>
  853. <td class="memname">int MQTTPacket_send_disconnect </td>
  854. <td>(</td>
  855. <td class="paramtype"><a class="el" href="structClients.html">Clients</a> *&#160;</td>
  856. <td class="paramname"><em>client</em>, </td>
  857. </tr>
  858. <tr>
  859. <td class="paramkey"></td>
  860. <td></td>
  861. <td class="paramtype">enum MQTTReasonCodes&#160;</td>
  862. <td class="paramname"><em>reason</em>, </td>
  863. </tr>
  864. <tr>
  865. <td class="paramkey"></td>
  866. <td></td>
  867. <td class="paramtype"><a class="el" href="structMQTTProperties.html">MQTTProperties</a> *&#160;</td>
  868. <td class="paramname"><em>props</em>&#160;</td>
  869. </tr>
  870. <tr>
  871. <td></td>
  872. <td>)</td>
  873. <td></td><td></td>
  874. </tr>
  875. </table>
  876. </div><div class="memdoc">
  877. <p>Send an MQTT disconnect packet down a socket. </p>
  878. <dl class="params"><dt>Parameters</dt><dd>
  879. <table class="params">
  880. <tr><td class="paramname">socket</td><td>the open socket to send the data to </td></tr>
  881. </table>
  882. </dd>
  883. </dl>
  884. <dl class="section return"><dt>Returns</dt><dd>the completion code (e.g. TCPSOCKET_COMPLETE) </dd></dl>
  885. <div class="dynheader">
  886. Here is the call graph for this function:</div>
  887. <div class="dyncontent">
  888. <div class="center"><img src="MQTTPacket_8c_aa9e17261b4d09d802dba6a65bcdc44fa_cgraph.png" border="0" usemap="#MQTTPacket_8c_aa9e17261b4d09d802dba6a65bcdc44fa_cgraph" alt=""/></div>
  889. <map name="MQTTPacket_8c_aa9e17261b4d09d802dba6a65bcdc44fa_cgraph" id="MQTTPacket_8c_aa9e17261b4d09d802dba6a65bcdc44fa_cgraph">
  890. <area shape="rect" title="Send an MQTT disconnect packet down a socket." alt="" coords="5,56,211,83"/>
  891. <area shape="rect" href="Log_8c.html#a669722e3f57811871f97c12392aba85d" title="Log a message." alt="" coords="304,5,348,32"/>
  892. <area shape="rect" href="MQTTPacket_8c.html#a51f58f1c7864f9fe87b55cc6ccb10129" title="Sends an MQTT packet in one system call write." alt="" coords="259,56,393,83"/>
  893. <area shape="rect" href="MQTTPacket_8c.html#ad29ec8b2fbf0ec0195621b44f8945923" title="Writes one character to an output buffer." alt="" coords="287,107,365,133"/>
  894. <area shape="rect" href="MQTTPacket_8c.html#aadd77a4fa1b2d5c7791e3542c56af856" title="Encodes the message length according to the MQTT algorithm." alt="" coords="464,5,613,32"/>
  895. <area shape="rect" href="MQTTPersistence_8c.html#a18eab666c3e6aecd92a6c8f10df808e3" title="Adds a record to the persistent store." alt="" coords="441,56,636,83"/>
  896. <area shape="rect" href="MQTTPacket_8c.html#a132d2d5b304d37cd2348a973f7b315de" title="Calculates an integer from two bytes read from the input buffer." alt="" coords="507,107,570,133"/>
  897. </map>
  898. </div>
  899. </div>
  900. </div>
  901. <a id="a8b93325a6a336406497b20b489d6c46a"></a>
  902. <h2 class="memtitle"><span class="permalink"><a href="#a8b93325a6a336406497b20b489d6c46a">&#9670;&nbsp;</a></span>MQTTPacket_send_puback()</h2>
  903. <div class="memitem">
  904. <div class="memproto">
  905. <table class="memname">
  906. <tr>
  907. <td class="memname">int MQTTPacket_send_puback </td>
  908. <td>(</td>
  909. <td class="paramtype">int&#160;</td>
  910. <td class="paramname"><em>MQTTVersion</em>, </td>
  911. </tr>
  912. <tr>
  913. <td class="paramkey"></td>
  914. <td></td>
  915. <td class="paramtype">int&#160;</td>
  916. <td class="paramname"><em>msgid</em>, </td>
  917. </tr>
  918. <tr>
  919. <td class="paramkey"></td>
  920. <td></td>
  921. <td class="paramtype"><a class="el" href="structnetworkHandles.html">networkHandles</a> *&#160;</td>
  922. <td class="paramname"><em>net</em>, </td>
  923. </tr>
  924. <tr>
  925. <td class="paramkey"></td>
  926. <td></td>
  927. <td class="paramtype">const char *&#160;</td>
  928. <td class="paramname"><em>clientID</em>&#160;</td>
  929. </tr>
  930. <tr>
  931. <td></td>
  932. <td>)</td>
  933. <td></td><td></td>
  934. </tr>
  935. </table>
  936. </div><div class="memdoc">
  937. <p>Send an MQTT PUBACK packet down a socket. </p>
  938. <dl class="params"><dt>Parameters</dt><dd>
  939. <table class="params">
  940. <tr><td class="paramname">MQTTVersion</td><td>the version of MQTT being used </td></tr>
  941. <tr><td class="paramname">msgid</td><td>the MQTT message id to use </td></tr>
  942. <tr><td class="paramname">socket</td><td>the open socket to send the data to </td></tr>
  943. <tr><td class="paramname">clientID</td><td>the string client identifier, only used for tracing </td></tr>
  944. </table>
  945. </dd>
  946. </dl>
  947. <dl class="section return"><dt>Returns</dt><dd>the completion code (e.g. TCPSOCKET_COMPLETE) </dd></dl>
  948. <div class="dynheader">
  949. Here is the call graph for this function:</div>
  950. <div class="dyncontent">
  951. <div class="center"><img src="MQTTPacket_8c_a8b93325a6a336406497b20b489d6c46a_cgraph.png" border="0" usemap="#MQTTPacket_8c_a8b93325a6a336406497b20b489d6c46a_cgraph" alt=""/></div>
  952. <map name="MQTTPacket_8c_a8b93325a6a336406497b20b489d6c46a_cgraph" id="MQTTPacket_8c_a8b93325a6a336406497b20b489d6c46a_cgraph">
  953. <area shape="rect" title="Send an MQTT PUBACK packet down a socket." alt="" coords="5,56,189,83"/>
  954. <area shape="rect" href="Log_8c.html#a669722e3f57811871f97c12392aba85d" title="Log a message." alt="" coords="297,31,341,57"/>
  955. <area shape="rect" href="MQTTPacket_8c.html#ad89e627a37f7f7eb4355b076cd46e0b0" title="Send an MQTT acknowledgement packet down a socket." alt="" coords="237,81,400,108"/>
  956. <area shape="rect" href="MQTTPacket_8c.html#a51f58f1c7864f9fe87b55cc6ccb10129" title="Sends an MQTT packet in one system call write." alt="" coords="448,56,583,83"/>
  957. <area shape="rect" href="MQTTPacket_8c.html#a07aa0146eda3d32979142e7df8ad5fc3" title="Writes an integer as 2 bytes to an output buffer." alt="" coords="483,107,548,133"/>
  958. <area shape="rect" href="MQTTPacket_8c.html#aadd77a4fa1b2d5c7791e3542c56af856" title="Encodes the message length according to the MQTT algorithm." alt="" coords="653,5,803,32"/>
  959. <area shape="rect" href="MQTTPersistence_8c.html#a18eab666c3e6aecd92a6c8f10df808e3" title="Adds a record to the persistent store." alt="" coords="631,56,825,83"/>
  960. <area shape="rect" href="MQTTPacket_8c.html#a132d2d5b304d37cd2348a973f7b315de" title="Calculates an integer from two bytes read from the input buffer." alt="" coords="697,107,759,133"/>
  961. </map>
  962. </div>
  963. </div>
  964. </div>
  965. <a id="a908f81381b1720e4a53d15c1c4690f5c"></a>
  966. <h2 class="memtitle"><span class="permalink"><a href="#a908f81381b1720e4a53d15c1c4690f5c">&#9670;&nbsp;</a></span>MQTTPacket_send_pubcomp()</h2>
  967. <div class="memitem">
  968. <div class="memproto">
  969. <table class="memname">
  970. <tr>
  971. <td class="memname">int MQTTPacket_send_pubcomp </td>
  972. <td>(</td>
  973. <td class="paramtype">int&#160;</td>
  974. <td class="paramname"><em>MQTTVersion</em>, </td>
  975. </tr>
  976. <tr>
  977. <td class="paramkey"></td>
  978. <td></td>
  979. <td class="paramtype">int&#160;</td>
  980. <td class="paramname"><em>msgid</em>, </td>
  981. </tr>
  982. <tr>
  983. <td class="paramkey"></td>
  984. <td></td>
  985. <td class="paramtype"><a class="el" href="structnetworkHandles.html">networkHandles</a> *&#160;</td>
  986. <td class="paramname"><em>net</em>, </td>
  987. </tr>
  988. <tr>
  989. <td class="paramkey"></td>
  990. <td></td>
  991. <td class="paramtype">const char *&#160;</td>
  992. <td class="paramname"><em>clientID</em>&#160;</td>
  993. </tr>
  994. <tr>
  995. <td></td>
  996. <td>)</td>
  997. <td></td><td></td>
  998. </tr>
  999. </table>
  1000. </div><div class="memdoc">
  1001. <p>Send an MQTT PUBCOMP packet down a socket. </p>
  1002. <dl class="params"><dt>Parameters</dt><dd>
  1003. <table class="params">
  1004. <tr><td class="paramname">MQTTVersion</td><td>the version of MQTT being used </td></tr>
  1005. <tr><td class="paramname">msgid</td><td>the MQTT message id to use </td></tr>
  1006. <tr><td class="paramname">socket</td><td>the open socket to send the data to </td></tr>
  1007. <tr><td class="paramname">clientID</td><td>the string client identifier, only used for tracing </td></tr>
  1008. </table>
  1009. </dd>
  1010. </dl>
  1011. <dl class="section return"><dt>Returns</dt><dd>the completion code (e.g. TCPSOCKET_COMPLETE) </dd></dl>
  1012. <div class="dynheader">
  1013. Here is the call graph for this function:</div>
  1014. <div class="dyncontent">
  1015. <div class="center"><img src="MQTTPacket_8c_a908f81381b1720e4a53d15c1c4690f5c_cgraph.png" border="0" usemap="#MQTTPacket_8c_a908f81381b1720e4a53d15c1c4690f5c_cgraph" alt=""/></div>
  1016. <map name="MQTTPacket_8c_a908f81381b1720e4a53d15c1c4690f5c_cgraph" id="MQTTPacket_8c_a908f81381b1720e4a53d15c1c4690f5c_cgraph">
  1017. <area shape="rect" title="Send an MQTT PUBCOMP packet down a socket." alt="" coords="5,56,200,83"/>
  1018. <area shape="rect" href="Log_8c.html#a669722e3f57811871f97c12392aba85d" title="Log a message." alt="" coords="307,31,351,57"/>
  1019. <area shape="rect" href="MQTTPacket_8c.html#ad89e627a37f7f7eb4355b076cd46e0b0" title="Send an MQTT acknowledgement packet down a socket." alt="" coords="248,81,411,108"/>
  1020. <area shape="rect" href="MQTTPacket_8c.html#a51f58f1c7864f9fe87b55cc6ccb10129" title="Sends an MQTT packet in one system call write." alt="" coords="459,56,593,83"/>
  1021. <area shape="rect" href="MQTTPacket_8c.html#a07aa0146eda3d32979142e7df8ad5fc3" title="Writes an integer as 2 bytes to an output buffer." alt="" coords="493,107,559,133"/>
  1022. <area shape="rect" href="MQTTPacket_8c.html#aadd77a4fa1b2d5c7791e3542c56af856" title="Encodes the message length according to the MQTT algorithm." alt="" coords="664,5,813,32"/>
  1023. <area shape="rect" href="MQTTPersistence_8c.html#a18eab666c3e6aecd92a6c8f10df808e3" title="Adds a record to the persistent store." alt="" coords="641,56,836,83"/>
  1024. <area shape="rect" href="MQTTPacket_8c.html#a132d2d5b304d37cd2348a973f7b315de" title="Calculates an integer from two bytes read from the input buffer." alt="" coords="707,107,770,133"/>
  1025. </map>
  1026. </div>
  1027. </div>
  1028. </div>
  1029. <a id="a9ebcf93ff2ba3bd103f016c975e9c9c4"></a>
  1030. <h2 class="memtitle"><span class="permalink"><a href="#a9ebcf93ff2ba3bd103f016c975e9c9c4">&#9670;&nbsp;</a></span>MQTTPacket_send_publish()</h2>
  1031. <div class="memitem">
  1032. <div class="memproto">
  1033. <table class="memname">
  1034. <tr>
  1035. <td class="memname">int MQTTPacket_send_publish </td>
  1036. <td>(</td>
  1037. <td class="paramtype"><a class="el" href="structPublish.html">Publish</a> *&#160;</td>
  1038. <td class="paramname"><em>pack</em>, </td>
  1039. </tr>
  1040. <tr>
  1041. <td class="paramkey"></td>
  1042. <td></td>
  1043. <td class="paramtype">int&#160;</td>
  1044. <td class="paramname"><em>dup</em>, </td>
  1045. </tr>
  1046. <tr>
  1047. <td class="paramkey"></td>
  1048. <td></td>
  1049. <td class="paramtype">int&#160;</td>
  1050. <td class="paramname"><em>qos</em>, </td>
  1051. </tr>
  1052. <tr>
  1053. <td class="paramkey"></td>
  1054. <td></td>
  1055. <td class="paramtype">int&#160;</td>
  1056. <td class="paramname"><em>retained</em>, </td>
  1057. </tr>
  1058. <tr>
  1059. <td class="paramkey"></td>
  1060. <td></td>
  1061. <td class="paramtype"><a class="el" href="structnetworkHandles.html">networkHandles</a> *&#160;</td>
  1062. <td class="paramname"><em>net</em>, </td>
  1063. </tr>
  1064. <tr>
  1065. <td class="paramkey"></td>
  1066. <td></td>
  1067. <td class="paramtype">const char *&#160;</td>
  1068. <td class="paramname"><em>clientID</em>&#160;</td>
  1069. </tr>
  1070. <tr>
  1071. <td></td>
  1072. <td>)</td>
  1073. <td></td><td></td>
  1074. </tr>
  1075. </table>
  1076. </div><div class="memdoc">
  1077. <p>Send an MQTT PUBLISH packet down a socket. </p>
  1078. <dl class="params"><dt>Parameters</dt><dd>
  1079. <table class="params">
  1080. <tr><td class="paramname">pack</td><td>a structure from which to get some values to use, e.g topic, payload </td></tr>
  1081. <tr><td class="paramname">dup</td><td>boolean - whether to set the MQTT DUP flag </td></tr>
  1082. <tr><td class="paramname">qos</td><td>the value to use for the MQTT QoS setting </td></tr>
  1083. <tr><td class="paramname">retained</td><td>boolean - whether to set the MQTT retained flag </td></tr>
  1084. <tr><td class="paramname">socket</td><td>the open socket to send the data to </td></tr>
  1085. <tr><td class="paramname">clientID</td><td>the string client identifier, only used for tracing </td></tr>
  1086. </table>
  1087. </dd>
  1088. </dl>
  1089. <dl class="section return"><dt>Returns</dt><dd>the completion code (e.g. TCPSOCKET_COMPLETE) </dd></dl>
  1090. <div class="dynheader">
  1091. Here is the call graph for this function:</div>
  1092. <div class="dyncontent">
  1093. <div class="center"><img src="MQTTPacket_8c_a9ebcf93ff2ba3bd103f016c975e9c9c4_cgraph.png" border="0" usemap="#MQTTPacket_8c_a9ebcf93ff2ba3bd103f016c975e9c9c4_cgraph" alt=""/></div>
  1094. <map name="MQTTPacket_8c_a9ebcf93ff2ba3bd103f016c975e9c9c4_cgraph" id="MQTTPacket_8c_a9ebcf93ff2ba3bd103f016c975e9c9c4_cgraph">
  1095. <area shape="rect" title="Send an MQTT PUBLISH packet down a socket." alt="" coords="5,56,188,83"/>
  1096. <area shape="rect" href="Log_8c.html#a669722e3f57811871f97c12392aba85d" title="Log a message." alt="" coords="285,5,329,32"/>
  1097. <area shape="rect" href="MQTTPacket_8c.html#a3635fd8035177b20c478daea6bad9328" title="Sends an MQTT packet from multiple buffers in one system call write." alt="" coords="236,56,379,83"/>
  1098. <area shape="rect" href="MQTTPacket_8c.html#a07aa0146eda3d32979142e7df8ad5fc3" title="Writes an integer as 2 bytes to an output buffer." alt="" coords="275,107,340,133"/>
  1099. <area shape="rect" href="MQTTPacket_8c.html#aadd77a4fa1b2d5c7791e3542c56af856" title="Encodes the message length according to the MQTT algorithm." alt="" coords="449,5,599,32"/>
  1100. <area shape="rect" href="MQTTPersistence_8c.html#a18eab666c3e6aecd92a6c8f10df808e3" title="Adds a record to the persistent store." alt="" coords="427,56,621,83"/>
  1101. <area shape="rect" href="MQTTPacket_8c.html#a132d2d5b304d37cd2348a973f7b315de" title="Calculates an integer from two bytes read from the input buffer." alt="" coords="493,107,555,133"/>
  1102. </map>
  1103. </div>
  1104. </div>
  1105. </div>
  1106. <a id="a8167e3188a4bdcfb30c10e0d76c82afe"></a>
  1107. <h2 class="memtitle"><span class="permalink"><a href="#a8167e3188a4bdcfb30c10e0d76c82afe">&#9670;&nbsp;</a></span>MQTTPacket_send_pubrec()</h2>
  1108. <div class="memitem">
  1109. <div class="memproto">
  1110. <table class="memname">
  1111. <tr>
  1112. <td class="memname">int MQTTPacket_send_pubrec </td>
  1113. <td>(</td>
  1114. <td class="paramtype">int&#160;</td>
  1115. <td class="paramname"><em>MQTTVersion</em>, </td>
  1116. </tr>
  1117. <tr>
  1118. <td class="paramkey"></td>
  1119. <td></td>
  1120. <td class="paramtype">int&#160;</td>
  1121. <td class="paramname"><em>msgid</em>, </td>
  1122. </tr>
  1123. <tr>
  1124. <td class="paramkey"></td>
  1125. <td></td>
  1126. <td class="paramtype"><a class="el" href="structnetworkHandles.html">networkHandles</a> *&#160;</td>
  1127. <td class="paramname"><em>net</em>, </td>
  1128. </tr>
  1129. <tr>
  1130. <td class="paramkey"></td>
  1131. <td></td>
  1132. <td class="paramtype">const char *&#160;</td>
  1133. <td class="paramname"><em>clientID</em>&#160;</td>
  1134. </tr>
  1135. <tr>
  1136. <td></td>
  1137. <td>)</td>
  1138. <td></td><td></td>
  1139. </tr>
  1140. </table>
  1141. </div><div class="memdoc">
  1142. <p>Send an MQTT PUBREC packet down a socket. </p>
  1143. <dl class="params"><dt>Parameters</dt><dd>
  1144. <table class="params">
  1145. <tr><td class="paramname">MQTTVersion</td><td>the version of MQTT being used </td></tr>
  1146. <tr><td class="paramname">msgid</td><td>the MQTT message id to use </td></tr>
  1147. <tr><td class="paramname">socket</td><td>the open socket to send the data to </td></tr>
  1148. <tr><td class="paramname">clientID</td><td>the string client identifier, only used for tracing </td></tr>
  1149. </table>
  1150. </dd>
  1151. </dl>
  1152. <dl class="section return"><dt>Returns</dt><dd>the completion code (e.g. TCPSOCKET_COMPLETE) </dd></dl>
  1153. <div class="dynheader">
  1154. Here is the call graph for this function:</div>
  1155. <div class="dyncontent">
  1156. <div class="center"><img src="MQTTPacket_8c_a8167e3188a4bdcfb30c10e0d76c82afe_cgraph.png" border="0" usemap="#MQTTPacket_8c_a8167e3188a4bdcfb30c10e0d76c82afe_cgraph" alt=""/></div>
  1157. <map name="MQTTPacket_8c_a8167e3188a4bdcfb30c10e0d76c82afe_cgraph" id="MQTTPacket_8c_a8167e3188a4bdcfb30c10e0d76c82afe_cgraph">
  1158. <area shape="rect" title="Send an MQTT PUBREC packet down a socket." alt="" coords="5,56,187,83"/>
  1159. <area shape="rect" href="Log_8c.html#a669722e3f57811871f97c12392aba85d" title="Log a message." alt="" coords="294,31,338,57"/>
  1160. <area shape="rect" href="MQTTPacket_8c.html#ad89e627a37f7f7eb4355b076cd46e0b0" title="Send an MQTT acknowledgement packet down a socket." alt="" coords="235,81,397,108"/>
  1161. <area shape="rect" href="MQTTPacket_8c.html#a51f58f1c7864f9fe87b55cc6ccb10129" title="Sends an MQTT packet in one system call write." alt="" coords="445,56,580,83"/>
  1162. <area shape="rect" href="MQTTPacket_8c.html#a07aa0146eda3d32979142e7df8ad5fc3" title="Writes an integer as 2 bytes to an output buffer." alt="" coords="480,107,545,133"/>
  1163. <area shape="rect" href="MQTTPacket_8c.html#aadd77a4fa1b2d5c7791e3542c56af856" title="Encodes the message length according to the MQTT algorithm." alt="" coords="651,5,800,32"/>
  1164. <area shape="rect" href="MQTTPersistence_8c.html#a18eab666c3e6aecd92a6c8f10df808e3" title="Adds a record to the persistent store." alt="" coords="628,56,823,83"/>
  1165. <area shape="rect" href="MQTTPacket_8c.html#a132d2d5b304d37cd2348a973f7b315de" title="Calculates an integer from two bytes read from the input buffer." alt="" coords="694,107,757,133"/>
  1166. </map>
  1167. </div>
  1168. </div>
  1169. </div>
  1170. <a id="adec2c812b12255dab78f75163a4f1960"></a>
  1171. <h2 class="memtitle"><span class="permalink"><a href="#adec2c812b12255dab78f75163a4f1960">&#9670;&nbsp;</a></span>MQTTPacket_send_pubrel()</h2>
  1172. <div class="memitem">
  1173. <div class="memproto">
  1174. <table class="memname">
  1175. <tr>
  1176. <td class="memname">int MQTTPacket_send_pubrel </td>
  1177. <td>(</td>
  1178. <td class="paramtype">int&#160;</td>
  1179. <td class="paramname"><em>MQTTVersion</em>, </td>
  1180. </tr>
  1181. <tr>
  1182. <td class="paramkey"></td>
  1183. <td></td>
  1184. <td class="paramtype">int&#160;</td>
  1185. <td class="paramname"><em>msgid</em>, </td>
  1186. </tr>
  1187. <tr>
  1188. <td class="paramkey"></td>
  1189. <td></td>
  1190. <td class="paramtype">int&#160;</td>
  1191. <td class="paramname"><em>dup</em>, </td>
  1192. </tr>
  1193. <tr>
  1194. <td class="paramkey"></td>
  1195. <td></td>
  1196. <td class="paramtype"><a class="el" href="structnetworkHandles.html">networkHandles</a> *&#160;</td>
  1197. <td class="paramname"><em>net</em>, </td>
  1198. </tr>
  1199. <tr>
  1200. <td class="paramkey"></td>
  1201. <td></td>
  1202. <td class="paramtype">const char *&#160;</td>
  1203. <td class="paramname"><em>clientID</em>&#160;</td>
  1204. </tr>
  1205. <tr>
  1206. <td></td>
  1207. <td>)</td>
  1208. <td></td><td></td>
  1209. </tr>
  1210. </table>
  1211. </div><div class="memdoc">
  1212. <p>Send an MQTT PUBREL packet down a socket. </p>
  1213. <dl class="params"><dt>Parameters</dt><dd>
  1214. <table class="params">
  1215. <tr><td class="paramname">MQTTVersion</td><td>the version of MQTT being used </td></tr>
  1216. <tr><td class="paramname">msgid</td><td>the MQTT message id to use </td></tr>
  1217. <tr><td class="paramname">dup</td><td>boolean - whether to set the MQTT DUP flag </td></tr>
  1218. <tr><td class="paramname">socket</td><td>the open socket to send the data to </td></tr>
  1219. <tr><td class="paramname">clientID</td><td>the string client identifier, only used for tracing </td></tr>
  1220. </table>
  1221. </dd>
  1222. </dl>
  1223. <dl class="section return"><dt>Returns</dt><dd>the completion code (e.g. TCPSOCKET_COMPLETE) </dd></dl>
  1224. <div class="dynheader">
  1225. Here is the call graph for this function:</div>
  1226. <div class="dyncontent">
  1227. <div class="center"><img src="MQTTPacket_8c_adec2c812b12255dab78f75163a4f1960_cgraph.png" border="0" usemap="#MQTTPacket_8c_adec2c812b12255dab78f75163a4f1960_cgraph" alt=""/></div>
  1228. <map name="MQTTPacket_8c_adec2c812b12255dab78f75163a4f1960_cgraph" id="MQTTPacket_8c_adec2c812b12255dab78f75163a4f1960_cgraph">
  1229. <area shape="rect" title="Send an MQTT PUBREL packet down a socket." alt="" coords="5,56,183,83"/>
  1230. <area shape="rect" href="Log_8c.html#a669722e3f57811871f97c12392aba85d" title="Log a message." alt="" coords="290,31,334,57"/>
  1231. <area shape="rect" href="MQTTPacket_8c.html#ad89e627a37f7f7eb4355b076cd46e0b0" title="Send an MQTT acknowledgement packet down a socket." alt="" coords="231,81,393,108"/>
  1232. <area shape="rect" href="MQTTPacket_8c.html#a51f58f1c7864f9fe87b55cc6ccb10129" title="Sends an MQTT packet in one system call write." alt="" coords="441,56,576,83"/>
  1233. <area shape="rect" href="MQTTPacket_8c.html#a07aa0146eda3d32979142e7df8ad5fc3" title="Writes an integer as 2 bytes to an output buffer." alt="" coords="476,107,541,133"/>
  1234. <area shape="rect" href="MQTTPacket_8c.html#aadd77a4fa1b2d5c7791e3542c56af856" title="Encodes the message length according to the MQTT algorithm." alt="" coords="647,5,796,32"/>
  1235. <area shape="rect" href="MQTTPersistence_8c.html#a18eab666c3e6aecd92a6c8f10df808e3" title="Adds a record to the persistent store." alt="" coords="624,56,819,83"/>
  1236. <area shape="rect" href="MQTTPacket_8c.html#a132d2d5b304d37cd2348a973f7b315de" title="Calculates an integer from two bytes read from the input buffer." alt="" coords="690,107,753,133"/>
  1237. </map>
  1238. </div>
  1239. </div>
  1240. </div>
  1241. <a id="a3635fd8035177b20c478daea6bad9328"></a>
  1242. <h2 class="memtitle"><span class="permalink"><a href="#a3635fd8035177b20c478daea6bad9328">&#9670;&nbsp;</a></span>MQTTPacket_sends()</h2>
  1243. <div class="memitem">
  1244. <div class="memproto">
  1245. <table class="memname">
  1246. <tr>
  1247. <td class="memname">int MQTTPacket_sends </td>
  1248. <td>(</td>
  1249. <td class="paramtype"><a class="el" href="structnetworkHandles.html">networkHandles</a> *&#160;</td>
  1250. <td class="paramname"><em>net</em>, </td>
  1251. </tr>
  1252. <tr>
  1253. <td class="paramkey"></td>
  1254. <td></td>
  1255. <td class="paramtype"><a class="el" href="unionHeader.html">Header</a>&#160;</td>
  1256. <td class="paramname"><em>header</em>, </td>
  1257. </tr>
  1258. <tr>
  1259. <td class="paramkey"></td>
  1260. <td></td>
  1261. <td class="paramtype"><a class="el" href="structPacketBuffers.html">PacketBuffers</a> *&#160;</td>
  1262. <td class="paramname"><em>bufs</em>, </td>
  1263. </tr>
  1264. <tr>
  1265. <td class="paramkey"></td>
  1266. <td></td>
  1267. <td class="paramtype">int&#160;</td>
  1268. <td class="paramname"><em>MQTTVersion</em>&#160;</td>
  1269. </tr>
  1270. <tr>
  1271. <td></td>
  1272. <td>)</td>
  1273. <td></td><td></td>
  1274. </tr>
  1275. </table>
  1276. </div><div class="memdoc">
  1277. <p>Sends an MQTT packet from multiple buffers in one system call write. </p>
  1278. <dl class="params"><dt>Parameters</dt><dd>
  1279. <table class="params">
  1280. <tr><td class="paramname">socket</td><td>the socket to which to write the data </td></tr>
  1281. <tr><td class="paramname">header</td><td>the one-byte MQTT header </td></tr>
  1282. <tr><td class="paramname">count</td><td>the number of buffers </td></tr>
  1283. <tr><td class="paramname">buffers</td><td>the rest of the buffers to write (not including remaining length) </td></tr>
  1284. <tr><td class="paramname">buflens</td><td>the lengths of the data in the array of buffers to be written </td></tr>
  1285. <tr><td class="paramname">the</td><td>MQTT version being used </td></tr>
  1286. </table>
  1287. </dd>
  1288. </dl>
  1289. <dl class="section return"><dt>Returns</dt><dd>the completion code (TCPSOCKET_COMPLETE etc) </dd></dl>
  1290. <div class="dynheader">
  1291. Here is the call graph for this function:</div>
  1292. <div class="dyncontent">
  1293. <div class="center"><img src="MQTTPacket_8c_a3635fd8035177b20c478daea6bad9328_cgraph.png" border="0" usemap="#MQTTPacket_8c_a3635fd8035177b20c478daea6bad9328_cgraph" alt=""/></div>
  1294. <map name="MQTTPacket_8c_a3635fd8035177b20c478daea6bad9328_cgraph" id="MQTTPacket_8c_a3635fd8035177b20c478daea6bad9328_cgraph">
  1295. <area shape="rect" title="Sends an MQTT packet from multiple buffers in one system call write." alt="" coords="5,56,148,83"/>
  1296. <area shape="rect" href="MQTTPacket_8c.html#aadd77a4fa1b2d5c7791e3542c56af856" title="Encodes the message length according to the MQTT algorithm." alt="" coords="219,5,368,32"/>
  1297. <area shape="rect" href="MQTTPersistence_8c.html#a18eab666c3e6aecd92a6c8f10df808e3" title="Adds a record to the persistent store." alt="" coords="196,56,391,83"/>
  1298. <area shape="rect" href="MQTTPacket_8c.html#a132d2d5b304d37cd2348a973f7b315de" title="Calculates an integer from two bytes read from the input buffer." alt="" coords="262,107,325,133"/>
  1299. </map>
  1300. </div>
  1301. </div>
  1302. </div>
  1303. <a id="a4fc1ee4d2cf8fd9bd59d89aadab222df"></a>
  1304. <h2 class="memtitle"><span class="permalink"><a href="#a4fc1ee4d2cf8fd9bd59d89aadab222df">&#9670;&nbsp;</a></span>MQTTPacket_VBIdecode()</h2>
  1305. <div class="memitem">
  1306. <div class="memproto">
  1307. <table class="memname">
  1308. <tr>
  1309. <td class="memname">int MQTTPacket_VBIdecode </td>
  1310. <td>(</td>
  1311. <td class="paramtype">int(*)(char *, int)&#160;</td>
  1312. <td class="paramname"><em>getcharfn</em>, </td>
  1313. </tr>
  1314. <tr>
  1315. <td class="paramkey"></td>
  1316. <td></td>
  1317. <td class="paramtype">unsigned int *&#160;</td>
  1318. <td class="paramname"><em>value</em>&#160;</td>
  1319. </tr>
  1320. <tr>
  1321. <td></td>
  1322. <td>)</td>
  1323. <td></td><td></td>
  1324. </tr>
  1325. </table>
  1326. </div><div class="memdoc">
  1327. <p>Decodes the message length according to the MQTT algorithm. </p>
  1328. <dl class="params"><dt>Parameters</dt><dd>
  1329. <table class="params">
  1330. <tr><td class="paramname">getcharfn</td><td>pointer to function to read the next character from the data source </td></tr>
  1331. <tr><td class="paramname">value</td><td>the decoded length returned </td></tr>
  1332. </table>
  1333. </dd>
  1334. </dl>
  1335. <dl class="section return"><dt>Returns</dt><dd>the number of bytes read from the socket </dd></dl>
  1336. </div>
  1337. </div>
  1338. <a id="aff1d10b221f5b4ce421b4c2588cbe511"></a>
  1339. <h2 class="memtitle"><span class="permalink"><a href="#aff1d10b221f5b4ce421b4c2588cbe511">&#9670;&nbsp;</a></span>readChar()</h2>
  1340. <div class="memitem">
  1341. <div class="memproto">
  1342. <table class="memname">
  1343. <tr>
  1344. <td class="memname">unsigned char readChar </td>
  1345. <td>(</td>
  1346. <td class="paramtype">char **&#160;</td>
  1347. <td class="paramname"><em>pptr</em></td><td>)</td>
  1348. <td></td>
  1349. </tr>
  1350. </table>
  1351. </div><div class="memdoc">
  1352. <p>Reads one character from the input buffer. </p>
  1353. <dl class="params"><dt>Parameters</dt><dd>
  1354. <table class="params">
  1355. <tr><td class="paramname">pptr</td><td>pointer to the input buffer - incremented by the number of bytes used &amp; returned </td></tr>
  1356. </table>
  1357. </dd>
  1358. </dl>
  1359. <dl class="section return"><dt>Returns</dt><dd>the character read </dd></dl>
  1360. </div>
  1361. </div>
  1362. <a id="a132d2d5b304d37cd2348a973f7b315de"></a>
  1363. <h2 class="memtitle"><span class="permalink"><a href="#a132d2d5b304d37cd2348a973f7b315de">&#9670;&nbsp;</a></span>readInt()</h2>
  1364. <div class="memitem">
  1365. <div class="memproto">
  1366. <table class="memname">
  1367. <tr>
  1368. <td class="memname">int readInt </td>
  1369. <td>(</td>
  1370. <td class="paramtype">char **&#160;</td>
  1371. <td class="paramname"><em>pptr</em></td><td>)</td>
  1372. <td></td>
  1373. </tr>
  1374. </table>
  1375. </div><div class="memdoc">
  1376. <p>Calculates an integer from two bytes read from the input buffer. </p>
  1377. <dl class="params"><dt>Parameters</dt><dd>
  1378. <table class="params">
  1379. <tr><td class="paramname">pptr</td><td>pointer to the input buffer - incremented by the number of bytes used &amp; returned </td></tr>
  1380. </table>
  1381. </dd>
  1382. </dl>
  1383. <dl class="section return"><dt>Returns</dt><dd>the integer value calculated </dd></dl>
  1384. </div>
  1385. </div>
  1386. <a id="aa8fc559d3a1e58ab50e69146666f2f63"></a>
  1387. <h2 class="memtitle"><span class="permalink"><a href="#aa8fc559d3a1e58ab50e69146666f2f63">&#9670;&nbsp;</a></span>readInt4()</h2>
  1388. <div class="memitem">
  1389. <div class="memproto">
  1390. <table class="memname">
  1391. <tr>
  1392. <td class="memname">int readInt4 </td>
  1393. <td>(</td>
  1394. <td class="paramtype">char **&#160;</td>
  1395. <td class="paramname"><em>pptr</em></td><td>)</td>
  1396. <td></td>
  1397. </tr>
  1398. </table>
  1399. </div><div class="memdoc">
  1400. <p>Calculates an integer from two bytes read from the input buffer. </p>
  1401. <dl class="params"><dt>Parameters</dt><dd>
  1402. <table class="params">
  1403. <tr><td class="paramname">pptr</td><td>pointer to the input buffer - incremented by the number of bytes used &amp; returned </td></tr>
  1404. </table>
  1405. </dd>
  1406. </dl>
  1407. <dl class="section return"><dt>Returns</dt><dd>the integer value calculated </dd></dl>
  1408. </div>
  1409. </div>
  1410. <a id="adca3afbe588ae7e6f342c5a697e4ee45"></a>
  1411. <h2 class="memtitle"><span class="permalink"><a href="#adca3afbe588ae7e6f342c5a697e4ee45">&#9670;&nbsp;</a></span>readUTF()</h2>
  1412. <div class="memitem">
  1413. <div class="memproto">
  1414. <table class="memname">
  1415. <tr>
  1416. <td class="memname">char* readUTF </td>
  1417. <td>(</td>
  1418. <td class="paramtype">char **&#160;</td>
  1419. <td class="paramname"><em>pptr</em>, </td>
  1420. </tr>
  1421. <tr>
  1422. <td class="paramkey"></td>
  1423. <td></td>
  1424. <td class="paramtype">char *&#160;</td>
  1425. <td class="paramname"><em>enddata</em>&#160;</td>
  1426. </tr>
  1427. <tr>
  1428. <td></td>
  1429. <td>)</td>
  1430. <td></td><td></td>
  1431. </tr>
  1432. </table>
  1433. </div><div class="memdoc">
  1434. <p>Reads a "UTF" string from the input buffer. </p>
  1435. <p>UTF as in the MQTT v3 spec which really means a length delimited string. So it reads the two byte length then the data according to that length. The end of the buffer is provided too, so we can prevent buffer overruns caused by an incorrect length. </p><dl class="params"><dt>Parameters</dt><dd>
  1436. <table class="params">
  1437. <tr><td class="paramname">pptr</td><td>pointer to the input buffer - incremented by the number of bytes used &amp; returned </td></tr>
  1438. <tr><td class="paramname">enddata</td><td>pointer to the end of the buffer not to be read beyond </td></tr>
  1439. </table>
  1440. </dd>
  1441. </dl>
  1442. <dl class="section return"><dt>Returns</dt><dd>an allocated C string holding the characters read, or NULL if the length read would have caused an overrun. </dd></dl>
  1443. <div class="dynheader">
  1444. Here is the call graph for this function:</div>
  1445. <div class="dyncontent">
  1446. <div class="center"><img src="MQTTPacket_8c_adca3afbe588ae7e6f342c5a697e4ee45_cgraph.png" border="0" usemap="#MQTTPacket_8c_adca3afbe588ae7e6f342c5a697e4ee45_cgraph" alt=""/></div>
  1447. <map name="MQTTPacket_8c_adca3afbe588ae7e6f342c5a697e4ee45_cgraph" id="MQTTPacket_8c_adca3afbe588ae7e6f342c5a697e4ee45_cgraph">
  1448. <area shape="rect" title="Reads a &quot;UTF&quot; string from the input buffer." alt="" coords="5,5,79,32"/>
  1449. <area shape="rect" href="MQTTPacket_8c.html#ae1ec2d8714335c6ec88c93e957b644d2" title="Reads a &quot;UTF&quot; string from the input buffer." alt="" coords="127,5,217,32"/>
  1450. <area shape="rect" href="MQTTPacket_8c.html#a132d2d5b304d37cd2348a973f7b315de" title="Calculates an integer from two bytes read from the input buffer." alt="" coords="265,5,328,32"/>
  1451. </map>
  1452. </div>
  1453. </div>
  1454. </div>
  1455. <a id="ae1ec2d8714335c6ec88c93e957b644d2"></a>
  1456. <h2 class="memtitle"><span class="permalink"><a href="#ae1ec2d8714335c6ec88c93e957b644d2">&#9670;&nbsp;</a></span>readUTFlen()</h2>
  1457. <div class="memitem">
  1458. <div class="memproto">
  1459. <table class="mlabels">
  1460. <tr>
  1461. <td class="mlabels-left">
  1462. <table class="memname">
  1463. <tr>
  1464. <td class="memname">static char * readUTFlen </td>
  1465. <td>(</td>
  1466. <td class="paramtype">char **&#160;</td>
  1467. <td class="paramname"><em>pptr</em>, </td>
  1468. </tr>
  1469. <tr>
  1470. <td class="paramkey"></td>
  1471. <td></td>
  1472. <td class="paramtype">char *&#160;</td>
  1473. <td class="paramname"><em>enddata</em>, </td>
  1474. </tr>
  1475. <tr>
  1476. <td class="paramkey"></td>
  1477. <td></td>
  1478. <td class="paramtype">int *&#160;</td>
  1479. <td class="paramname"><em>len</em>&#160;</td>
  1480. </tr>
  1481. <tr>
  1482. <td></td>
  1483. <td>)</td>
  1484. <td></td><td></td>
  1485. </tr>
  1486. </table>
  1487. </td>
  1488. <td class="mlabels-right">
  1489. <span class="mlabels"><span class="mlabel">static</span></span> </td>
  1490. </tr>
  1491. </table>
  1492. </div><div class="memdoc">
  1493. <p>Reads a "UTF" string from the input buffer. </p>
  1494. <p>UTF as in the MQTT v3 spec which really means a length delimited string. So it reads the two byte length then the data according to that length. The end of the buffer is provided too, so we can prevent buffer overruns caused by an incorrect length. </p><dl class="params"><dt>Parameters</dt><dd>
  1495. <table class="params">
  1496. <tr><td class="paramname">pptr</td><td>pointer to the input buffer - incremented by the number of bytes used &amp; returned </td></tr>
  1497. <tr><td class="paramname">enddata</td><td>pointer to the end of the buffer not to be read beyond </td></tr>
  1498. <tr><td class="paramname">len</td><td>returns the calculcated value of the length bytes read </td></tr>
  1499. </table>
  1500. </dd>
  1501. </dl>
  1502. <dl class="section return"><dt>Returns</dt><dd>an allocated C string holding the characters read, or NULL if the length read would have caused an overrun. </dd></dl>
  1503. <div class="dynheader">
  1504. Here is the call graph for this function:</div>
  1505. <div class="dyncontent">
  1506. <div class="center"><img src="MQTTPacket_8c_ae1ec2d8714335c6ec88c93e957b644d2_cgraph.png" border="0" usemap="#MQTTPacket_8c_ae1ec2d8714335c6ec88c93e957b644d2_cgraph" alt=""/></div>
  1507. <map name="MQTTPacket_8c_ae1ec2d8714335c6ec88c93e957b644d2_cgraph" id="MQTTPacket_8c_ae1ec2d8714335c6ec88c93e957b644d2_cgraph">
  1508. <area shape="rect" title="Reads a &quot;UTF&quot; string from the input buffer." alt="" coords="5,5,96,32"/>
  1509. <area shape="rect" href="MQTTPacket_8c.html#a132d2d5b304d37cd2348a973f7b315de" title="Calculates an integer from two bytes read from the input buffer." alt="" coords="144,5,207,32"/>
  1510. </map>
  1511. </div>
  1512. </div>
  1513. </div>
  1514. <a id="ad29ec8b2fbf0ec0195621b44f8945923"></a>
  1515. <h2 class="memtitle"><span class="permalink"><a href="#ad29ec8b2fbf0ec0195621b44f8945923">&#9670;&nbsp;</a></span>writeChar()</h2>
  1516. <div class="memitem">
  1517. <div class="memproto">
  1518. <table class="memname">
  1519. <tr>
  1520. <td class="memname">void writeChar </td>
  1521. <td>(</td>
  1522. <td class="paramtype">char **&#160;</td>
  1523. <td class="paramname"><em>pptr</em>, </td>
  1524. </tr>
  1525. <tr>
  1526. <td class="paramkey"></td>
  1527. <td></td>
  1528. <td class="paramtype">char&#160;</td>
  1529. <td class="paramname"><em>c</em>&#160;</td>
  1530. </tr>
  1531. <tr>
  1532. <td></td>
  1533. <td>)</td>
  1534. <td></td><td></td>
  1535. </tr>
  1536. </table>
  1537. </div><div class="memdoc">
  1538. <p>Writes one character to an output buffer. </p>
  1539. <dl class="params"><dt>Parameters</dt><dd>
  1540. <table class="params">
  1541. <tr><td class="paramname">pptr</td><td>pointer to the output buffer - incremented by the number of bytes used &amp; returned </td></tr>
  1542. <tr><td class="paramname">c</td><td>the character to write </td></tr>
  1543. </table>
  1544. </dd>
  1545. </dl>
  1546. </div>
  1547. </div>
  1548. <a id="a8886398fbf89872f8e593444d351a5aa"></a>
  1549. <h2 class="memtitle"><span class="permalink"><a href="#a8886398fbf89872f8e593444d351a5aa">&#9670;&nbsp;</a></span>writeData()</h2>
  1550. <div class="memitem">
  1551. <div class="memproto">
  1552. <table class="memname">
  1553. <tr>
  1554. <td class="memname">void writeData </td>
  1555. <td>(</td>
  1556. <td class="paramtype">char **&#160;</td>
  1557. <td class="paramname"><em>pptr</em>, </td>
  1558. </tr>
  1559. <tr>
  1560. <td class="paramkey"></td>
  1561. <td></td>
  1562. <td class="paramtype">const void *&#160;</td>
  1563. <td class="paramname"><em>data</em>, </td>
  1564. </tr>
  1565. <tr>
  1566. <td class="paramkey"></td>
  1567. <td></td>
  1568. <td class="paramtype">int&#160;</td>
  1569. <td class="paramname"><em>datalen</em>&#160;</td>
  1570. </tr>
  1571. <tr>
  1572. <td></td>
  1573. <td>)</td>
  1574. <td></td><td></td>
  1575. </tr>
  1576. </table>
  1577. </div><div class="memdoc">
  1578. <p>Writes length delimited data to an output buffer. </p>
  1579. <dl class="params"><dt>Parameters</dt><dd>
  1580. <table class="params">
  1581. <tr><td class="paramname">pptr</td><td>pointer to the output buffer - incremented by the number of bytes used &amp; returned </td></tr>
  1582. <tr><td class="paramname">data</td><td>the data to write </td></tr>
  1583. <tr><td class="paramname">datalen</td><td>the length of the data to write </td></tr>
  1584. </table>
  1585. </dd>
  1586. </dl>
  1587. <div class="dynheader">
  1588. Here is the call graph for this function:</div>
  1589. <div class="dyncontent">
  1590. <div class="center"><img src="MQTTPacket_8c_a8886398fbf89872f8e593444d351a5aa_cgraph.png" border="0" usemap="#MQTTPacket_8c_a8886398fbf89872f8e593444d351a5aa_cgraph" alt=""/></div>
  1591. <map name="MQTTPacket_8c_a8886398fbf89872f8e593444d351a5aa_cgraph" id="MQTTPacket_8c_a8886398fbf89872f8e593444d351a5aa_cgraph">
  1592. <area shape="rect" title="Writes length delimited data to an output buffer." alt="" coords="5,5,83,32"/>
  1593. <area shape="rect" href="MQTTPacket_8c.html#a07aa0146eda3d32979142e7df8ad5fc3" title="Writes an integer as 2 bytes to an output buffer." alt="" coords="131,5,196,32"/>
  1594. </map>
  1595. </div>
  1596. </div>
  1597. </div>
  1598. <a id="a07aa0146eda3d32979142e7df8ad5fc3"></a>
  1599. <h2 class="memtitle"><span class="permalink"><a href="#a07aa0146eda3d32979142e7df8ad5fc3">&#9670;&nbsp;</a></span>writeInt()</h2>
  1600. <div class="memitem">
  1601. <div class="memproto">
  1602. <table class="memname">
  1603. <tr>
  1604. <td class="memname">void writeInt </td>
  1605. <td>(</td>
  1606. <td class="paramtype">char **&#160;</td>
  1607. <td class="paramname"><em>pptr</em>, </td>
  1608. </tr>
  1609. <tr>
  1610. <td class="paramkey"></td>
  1611. <td></td>
  1612. <td class="paramtype">int&#160;</td>
  1613. <td class="paramname"><em>anInt</em>&#160;</td>
  1614. </tr>
  1615. <tr>
  1616. <td></td>
  1617. <td>)</td>
  1618. <td></td><td></td>
  1619. </tr>
  1620. </table>
  1621. </div><div class="memdoc">
  1622. <p>Writes an integer as 2 bytes to an output buffer. </p>
  1623. <dl class="params"><dt>Parameters</dt><dd>
  1624. <table class="params">
  1625. <tr><td class="paramname">pptr</td><td>pointer to the output buffer - incremented by the number of bytes used &amp; returned </td></tr>
  1626. <tr><td class="paramname">anInt</td><td>the integer to write </td></tr>
  1627. </table>
  1628. </dd>
  1629. </dl>
  1630. </div>
  1631. </div>
  1632. <a id="aefc0aa52c1cb13fa7bfcd77810d6a617"></a>
  1633. <h2 class="memtitle"><span class="permalink"><a href="#aefc0aa52c1cb13fa7bfcd77810d6a617">&#9670;&nbsp;</a></span>writeInt4()</h2>
  1634. <div class="memitem">
  1635. <div class="memproto">
  1636. <table class="memname">
  1637. <tr>
  1638. <td class="memname">void writeInt4 </td>
  1639. <td>(</td>
  1640. <td class="paramtype">char **&#160;</td>
  1641. <td class="paramname"><em>pptr</em>, </td>
  1642. </tr>
  1643. <tr>
  1644. <td class="paramkey"></td>
  1645. <td></td>
  1646. <td class="paramtype">int&#160;</td>
  1647. <td class="paramname"><em>anInt</em>&#160;</td>
  1648. </tr>
  1649. <tr>
  1650. <td></td>
  1651. <td>)</td>
  1652. <td></td><td></td>
  1653. </tr>
  1654. </table>
  1655. </div><div class="memdoc">
  1656. <p>Writes an integer as 4 bytes to an output buffer. </p>
  1657. <dl class="params"><dt>Parameters</dt><dd>
  1658. <table class="params">
  1659. <tr><td class="paramname">pptr</td><td>pointer to the output buffer - incremented by the number of bytes used &amp; returned </td></tr>
  1660. <tr><td class="paramname">anInt</td><td>the integer to write </td></tr>
  1661. </table>
  1662. </dd>
  1663. </dl>
  1664. </div>
  1665. </div>
  1666. <a id="af0fcaa11ac05ce448a433a53f9cae420"></a>
  1667. <h2 class="memtitle"><span class="permalink"><a href="#af0fcaa11ac05ce448a433a53f9cae420">&#9670;&nbsp;</a></span>writeUTF()</h2>
  1668. <div class="memitem">
  1669. <div class="memproto">
  1670. <table class="memname">
  1671. <tr>
  1672. <td class="memname">void writeUTF </td>
  1673. <td>(</td>
  1674. <td class="paramtype">char **&#160;</td>
  1675. <td class="paramname"><em>pptr</em>, </td>
  1676. </tr>
  1677. <tr>
  1678. <td class="paramkey"></td>
  1679. <td></td>
  1680. <td class="paramtype">const char *&#160;</td>
  1681. <td class="paramname"><em>string</em>&#160;</td>
  1682. </tr>
  1683. <tr>
  1684. <td></td>
  1685. <td>)</td>
  1686. <td></td><td></td>
  1687. </tr>
  1688. </table>
  1689. </div><div class="memdoc">
  1690. <p>Writes a "UTF" string to an output buffer. </p>
  1691. <p>Converts C string to length-delimited. </p><dl class="params"><dt>Parameters</dt><dd>
  1692. <table class="params">
  1693. <tr><td class="paramname">pptr</td><td>pointer to the output buffer - incremented by the number of bytes used &amp; returned </td></tr>
  1694. <tr><td class="paramname">string</td><td>the C string to write </td></tr>
  1695. </table>
  1696. </dd>
  1697. </dl>
  1698. <div class="dynheader">
  1699. Here is the call graph for this function:</div>
  1700. <div class="dyncontent">
  1701. <div class="center"><img src="MQTTPacket_8c_af0fcaa11ac05ce448a433a53f9cae420_cgraph.png" border="0" usemap="#MQTTPacket_8c_af0fcaa11ac05ce448a433a53f9cae420_cgraph" alt=""/></div>
  1702. <map name="MQTTPacket_8c_af0fcaa11ac05ce448a433a53f9cae420_cgraph" id="MQTTPacket_8c_af0fcaa11ac05ce448a433a53f9cae420_cgraph">
  1703. <area shape="rect" title="Writes a &quot;UTF&quot; string to an output buffer." alt="" coords="5,5,81,32"/>
  1704. <area shape="rect" href="MQTTPacket_8c.html#a07aa0146eda3d32979142e7df8ad5fc3" title="Writes an integer as 2 bytes to an output buffer." alt="" coords="129,5,195,32"/>
  1705. </map>
  1706. </div>
  1707. </div>
  1708. </div>
  1709. <h2 class="groupheader">Variable Documentation</h2>
  1710. <a id="a210a7b616c27aa7247824022285da784"></a>
  1711. <h2 class="memtitle"><span class="permalink"><a href="#a210a7b616c27aa7247824022285da784">&#9670;&nbsp;</a></span>new_packets</h2>
  1712. <div class="memitem">
  1713. <div class="memproto">
  1714. <table class="memname">
  1715. <tr>
  1716. <td class="memname">pf new_packets[]</td>
  1717. </tr>
  1718. </table>
  1719. </div><div class="memdoc">
  1720. <b>Initial value:</b><div class="fragment"><div class="line">=</div>
  1721. <div class="line">{</div>
  1722. <div class="line"> NULL, </div>
  1723. <div class="line"> NULL, </div>
  1724. <div class="line"> <a class="code" href="MQTTPacketOut_8c.html#ad05dd32a547e82e0741d9d8279568a65">MQTTPacket_connack</a>, </div>
  1725. <div class="line"> <a class="code" href="MQTTPacket_8c.html#a58feb89ee5616f2ea6d222bbbef927bb">MQTTPacket_publish</a>, </div>
  1726. <div class="line"> <a class="code" href="MQTTPacket_8c.html#a93c155059c80bd01b4a1561d9bec1d13">MQTTPacket_ack</a>, </div>
  1727. <div class="line"> <a class="code" href="MQTTPacket_8c.html#a93c155059c80bd01b4a1561d9bec1d13">MQTTPacket_ack</a>, </div>
  1728. <div class="line"> <a class="code" href="MQTTPacket_8c.html#a93c155059c80bd01b4a1561d9bec1d13">MQTTPacket_ack</a>, </div>
  1729. <div class="line"> <a class="code" href="MQTTPacket_8c.html#a93c155059c80bd01b4a1561d9bec1d13">MQTTPacket_ack</a>, </div>
  1730. <div class="line"> NULL, </div>
  1731. <div class="line"> <a class="code" href="MQTTPacketOut_8c.html#aee4b3e106128629671828ae7bfa70850">MQTTPacket_suback</a>, </div>
  1732. <div class="line"> NULL, </div>
  1733. <div class="line"> <a class="code" href="MQTTPacketOut_8c.html#a93f6aa4b23d30f6c8c5be87b0b58e37c">MQTTPacket_unsuback</a>, </div>
  1734. <div class="line"> <a class="code" href="MQTTPacket_8c.html#af3ddd9c1a35d51bf70f44a1aa6fa0bba">MQTTPacket_header_only</a>, </div>
  1735. <div class="line"> <a class="code" href="MQTTPacket_8c.html#af3ddd9c1a35d51bf70f44a1aa6fa0bba">MQTTPacket_header_only</a>, </div>
  1736. <div class="line"> <a class="code" href="MQTTPacket_8c.html#a93c155059c80bd01b4a1561d9bec1d13">MQTTPacket_ack</a>, </div>
  1737. <div class="line"> <a class="code" href="MQTTPacket_8c.html#a93c155059c80bd01b4a1561d9bec1d13">MQTTPacket_ack</a> </div>
  1738. <div class="line">}</div>
  1739. </div><!-- fragment -->
  1740. <p>Array of functions to build packets, indexed according to packet code. </p>
  1741. </div>
  1742. </div>
  1743. <a id="a4536b1c36ed06171f20baeb69c01aa02"></a>
  1744. <h2 class="memtitle"><span class="permalink"><a href="#a4536b1c36ed06171f20baeb69c01aa02">&#9670;&nbsp;</a></span>packet_names</h2>
  1745. <div class="memitem">
  1746. <div class="memproto">
  1747. <table class="mlabels">
  1748. <tr>
  1749. <td class="mlabels-left">
  1750. <table class="memname">
  1751. <tr>
  1752. <td class="memname">const char* packet_names[]</td>
  1753. </tr>
  1754. </table>
  1755. </td>
  1756. <td class="mlabels-right">
  1757. <span class="mlabels"><span class="mlabel">static</span></span> </td>
  1758. </tr>
  1759. </table>
  1760. </div><div class="memdoc">
  1761. <b>Initial value:</b><div class="fragment"><div class="line">=</div>
  1762. <div class="line">{</div>
  1763. <div class="line"> <span class="stringliteral">&quot;RESERVED&quot;</span>, <span class="stringliteral">&quot;CONNECT&quot;</span>, <span class="stringliteral">&quot;CONNACK&quot;</span>, <span class="stringliteral">&quot;PUBLISH&quot;</span>, <span class="stringliteral">&quot;PUBACK&quot;</span>, <span class="stringliteral">&quot;PUBREC&quot;</span>, <span class="stringliteral">&quot;PUBREL&quot;</span>,</div>
  1764. <div class="line"> <span class="stringliteral">&quot;PUBCOMP&quot;</span>, <span class="stringliteral">&quot;SUBSCRIBE&quot;</span>, <span class="stringliteral">&quot;SUBACK&quot;</span>, <span class="stringliteral">&quot;UNSUBSCRIBE&quot;</span>, <span class="stringliteral">&quot;UNSUBACK&quot;</span>,</div>
  1765. <div class="line"> <span class="stringliteral">&quot;PINGREQ&quot;</span>, <span class="stringliteral">&quot;PINGRESP&quot;</span>, <span class="stringliteral">&quot;DISCONNECT&quot;</span>, <span class="stringliteral">&quot;AUTH&quot;</span></div>
  1766. <div class="line">}</div>
  1767. </div><!-- fragment -->
  1768. <p><a class="el" href="structList.html" title="Structure to hold all data for one list.">List</a> of the predefined MQTT v3/v5 packet names. </p>
  1769. </div>
  1770. </div>
  1771. </div><!-- contents -->
  1772. <div class="ttc" id="aMQTTPacketOut_8c_html_aee4b3e106128629671828ae7bfa70850"><div class="ttname"><a href="MQTTPacketOut_8c.html#aee4b3e106128629671828ae7bfa70850">MQTTPacket_suback</a></div><div class="ttdeci">void * MQTTPacket_suback(int MQTTVersion, unsigned char aHeader, char *data, size_t datalen)</div><div class="ttdoc">Function used in the new packets table to create suback packets.</div><div class="ttdef"><b>Definition:</b> MQTTPacketOut.c:290</div></div>
  1773. <div class="ttc" id="aMQTTPacket_8c_html_a93c155059c80bd01b4a1561d9bec1d13"><div class="ttname"><a href="MQTTPacket_8c.html#a93c155059c80bd01b4a1561d9bec1d13">MQTTPacket_ack</a></div><div class="ttdeci">void * MQTTPacket_ack(int MQTTVersion, unsigned char aHeader, char *data, size_t datalen)</div><div class="ttdoc">Function used in the new packets table to create acknowledgement packets.</div><div class="ttdef"><b>Definition:</b> MQTTPacket.c:794</div></div>
  1774. <div class="ttc" id="aMQTTPacketOut_8c_html_ad05dd32a547e82e0741d9d8279568a65"><div class="ttname"><a href="MQTTPacketOut_8c.html#ad05dd32a547e82e0741d9d8279568a65">MQTTPacket_connack</a></div><div class="ttdeci">void * MQTTPacket_connack(int MQTTVersion, unsigned char aHeader, char *data, size_t datalen)</div><div class="ttdoc">Function used in the new packets table to create connack packets.</div><div class="ttdef"><b>Definition:</b> MQTTPacketOut.c:142</div></div>
  1775. <div class="ttc" id="aMQTTPacketOut_8c_html_a93f6aa4b23d30f6c8c5be87b0b58e37c"><div class="ttname"><a href="MQTTPacketOut_8c.html#a93f6aa4b23d30f6c8c5be87b0b58e37c">MQTTPacket_unsuback</a></div><div class="ttdeci">void * MQTTPacket_unsuback(int MQTTVersion, unsigned char aHeader, char *data, size_t datalen)</div><div class="ttdoc">Function used in the new packets table to create unsuback packets.</div><div class="ttdef"><b>Definition:</b> MQTTPacketOut.c:411</div></div>
  1776. <div class="ttc" id="aMQTTPacket_8c_html_af3ddd9c1a35d51bf70f44a1aa6fa0bba"><div class="ttname"><a href="MQTTPacket_8c.html#af3ddd9c1a35d51bf70f44a1aa6fa0bba">MQTTPacket_header_only</a></div><div class="ttdeci">void * MQTTPacket_header_only(int MQTTVersion, unsigned char aHeader, char *data, size_t datalen)</div><div class="ttdoc">Function used in the new packets table to create packets which have only a header.</div><div class="ttdef"><b>Definition:</b> MQTTPacket.c:498</div></div>
  1777. <div class="ttc" id="aMQTTPacket_8c_html_a58feb89ee5616f2ea6d222bbbef927bb"><div class="ttname"><a href="MQTTPacket_8c.html#a58feb89ee5616f2ea6d222bbbef927bb">MQTTPacket_publish</a></div><div class="ttdeci">void * MQTTPacket_publish(int MQTTVersion, unsigned char aHeader, char *data, size_t datalen)</div><div class="ttdoc">Function used in the new packets table to create publish packets.</div><div class="ttdef"><b>Definition:</b> MQTTPacket.c:556</div></div>
  1778. <!-- start footer part -->
  1779. <hr class="footer"/><address class="footer"><small>
  1780. 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">
  1781. <img class="footer" src="doxygen.png" alt="doxygen"/>
  1782. </a> 1.8.17
  1783. </small></address>
  1784. </body>
  1785. </html>