Ryan OShea | de36e4a | 2020-03-13 16:26:19 +0000 | [diff] [blame] | 1 | <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://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.13"/> |
| 7 | <meta name="viewport" content="width=device-width, initial-scale=1"/> |
| 8 | <title>ArmNN: GatordMockService Class 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="navtree.css" rel="stylesheet" type="text/css"/> |
| 13 | <script type="text/javascript" src="resize.js"></script> |
| 14 | <script type="text/javascript" src="navtreedata.js"></script> |
| 15 | <script type="text/javascript" src="navtree.js"></script> |
| 16 | <script type="text/javascript"> |
| 17 | $(document).ready(initResizable); |
| 18 | </script> |
| 19 | <link href="search/search.css" rel="stylesheet" type="text/css"/> |
| 20 | <script type="text/javascript" src="search/searchdata.js"></script> |
| 21 | <script type="text/javascript" src="search/search.js"></script> |
| 22 | <link href="doxygen.css" rel="stylesheet" type="text/css" /> |
| 23 | </head> |
| 24 | <body> |
| 25 | <div id="top"><!-- do not remove this div, it is closed by doxygen! --> |
| 26 | <div id="titlearea"> |
| 27 | <table cellspacing="0" cellpadding="0"> |
| 28 | <tbody> |
| 29 | <tr style="height: 56px;"> |
| 30 | <td id="projectalign" style="padding-left: 0.5em;"> |
| 31 | <div id="projectname">ArmNN |
| 32 |  <span id="projectnumber">NotReleased</span> |
| 33 | </div> |
| 34 | </td> |
| 35 | </tr> |
| 36 | </tbody> |
| 37 | </table> |
| 38 | </div> |
| 39 | <!-- end header part --> |
| 40 | <!-- Generated by Doxygen 1.8.13 --> |
| 41 | <script type="text/javascript"> |
| 42 | var searchBox = new SearchBox("searchBox", "search",false,'Search'); |
| 43 | </script> |
| 44 | <script type="text/javascript" src="menudata.js"></script> |
| 45 | <script type="text/javascript" src="menu.js"></script> |
| 46 | <script type="text/javascript"> |
| 47 | $(function() { |
| 48 | initMenu('',true,false,'search.php','Search'); |
| 49 | $(document).ready(function() { init_search(); }); |
| 50 | }); |
| 51 | </script> |
| 52 | <div id="main-nav"></div> |
| 53 | </div><!-- top --> |
| 54 | <div id="side-nav" class="ui-resizable side-nav-resizable"> |
| 55 | <div id="nav-tree"> |
| 56 | <div id="nav-tree-contents"> |
| 57 | <div id="nav-sync" class="sync"></div> |
| 58 | </div> |
| 59 | </div> |
| 60 | <div id="splitbar" style="-moz-user-select:none;" |
| 61 | class="ui-resizable-handle"> |
| 62 | </div> |
| 63 | </div> |
| 64 | <script type="text/javascript"> |
| 65 | $(document).ready(function(){initNavTree('classarmnn_1_1gatordmock_1_1_gatord_mock_service.html','');}); |
| 66 | </script> |
| 67 | <div id="doc-content"> |
| 68 | <!-- window showing the filter options --> |
| 69 | <div id="MSearchSelectWindow" |
| 70 | onmouseover="return searchBox.OnSearchSelectShow()" |
| 71 | onmouseout="return searchBox.OnSearchSelectHide()" |
| 72 | onkeydown="return searchBox.OnSearchSelectKey(event)"> |
| 73 | </div> |
| 74 | |
| 75 | <!-- iframe showing the search results (closed by default) --> |
| 76 | <div id="MSearchResultsWindow"> |
| 77 | <iframe src="javascript:void(0)" frameborder="0" |
| 78 | name="MSearchResults" id="MSearchResults"> |
| 79 | </iframe> |
| 80 | </div> |
| 81 | |
| 82 | <div class="header"> |
| 83 | <div class="summary"> |
| 84 | <a href="#pub-methods">Public Member Functions</a> | |
| 85 | <a href="classarmnn_1_1gatordmock_1_1_gatord_mock_service-members.html">List of all members</a> </div> |
| 86 | <div class="headertitle"> |
| 87 | <div class="title">GatordMockService Class Reference</div> </div> |
| 88 | </div><!--header--> |
| 89 | <div class="contents"> |
| 90 | |
| 91 | <p><code>#include <<a class="el" href="_gatord_mock_service_8hpp_source.html">GatordMockService.hpp</a>></code></p> |
| 92 | <table class="memberdecls"> |
| 93 | <tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-methods"></a> |
| 94 | Public Member Functions</h2></td></tr> |
| 95 | <tr class="memitem:a316aee098329a282e05c9beae9f67b58"><td class="memItemLeft" align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="classarmnn_1_1gatordmock_1_1_gatord_mock_service.html#a316aee098329a282e05c9beae9f67b58">GatordMockService</a> (<a class="el" href="classarmnn_1_1profiling_1_1_command_handler_registry.html">armnn::profiling::CommandHandlerRegistry</a> &registry, bool echoPackets)</td></tr> |
| 96 | <tr class="separator:a316aee098329a282e05c9beae9f67b58"><td class="memSeparator" colspan="2"> </td></tr> |
| 97 | <tr class="memitem:ae1a11e5360cb7940eb34f80ed0dba57b"><td class="memItemLeft" align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="classarmnn_1_1gatordmock_1_1_gatord_mock_service.html#ae1a11e5360cb7940eb34f80ed0dba57b">~GatordMockService</a> ()</td></tr> |
| 98 | <tr class="separator:ae1a11e5360cb7940eb34f80ed0dba57b"><td class="memSeparator" colspan="2"> </td></tr> |
| 99 | <tr class="memitem:aa03af06b5336e9ad43b374a03934c0f1"><td class="memItemLeft" align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><a class="el" href="classarmnn_1_1gatordmock_1_1_gatord_mock_service.html#aa03af06b5336e9ad43b374a03934c0f1">OpenListeningSocket</a> (std::string udsNamespace)</td></tr> |
| 100 | <tr class="separator:aa03af06b5336e9ad43b374a03934c0f1"><td class="memSeparator" colspan="2"> </td></tr> |
| 101 | <tr class="memitem:a4c7dcda01e81dbdc47ceb1c82f26039b"><td class="memItemLeft" align="right" valign="top">armnnUtils::Sockets::Socket </td><td class="memItemRight" valign="bottom"><a class="el" href="classarmnn_1_1gatordmock_1_1_gatord_mock_service.html#a4c7dcda01e81dbdc47ceb1c82f26039b">BlockForOneClient</a> ()</td></tr> |
| 102 | <tr class="separator:a4c7dcda01e81dbdc47ceb1c82f26039b"><td class="memSeparator" colspan="2"> </td></tr> |
| 103 | <tr class="memitem:ac07351dbc304681b2efd5df4958a6735"><td class="memItemLeft" align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><a class="el" href="classarmnn_1_1gatordmock_1_1_gatord_mock_service.html#ac07351dbc304681b2efd5df4958a6735">WaitForStreamMetaData</a> ()</td></tr> |
| 104 | <tr class="separator:ac07351dbc304681b2efd5df4958a6735"><td class="memSeparator" colspan="2"> </td></tr> |
| 105 | <tr class="memitem:a41eaa65cf4e7212f09b04d06c130cd83"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="classarmnn_1_1gatordmock_1_1_gatord_mock_service.html#a41eaa65cf4e7212f09b04d06c130cd83">SendConnectionAck</a> ()</td></tr> |
| 106 | <tr class="memdesc:a41eaa65cf4e7212f09b04d06c130cd83"><td class="mdescLeft"> </td><td class="mdescRight">Send a connection acknowledged packet back to the client. <a href="#a41eaa65cf4e7212f09b04d06c130cd83">More...</a><br /></td></tr> |
| 107 | <tr class="separator:a41eaa65cf4e7212f09b04d06c130cd83"><td class="memSeparator" colspan="2"> </td></tr> |
| 108 | <tr class="memitem:a2b9de2e6eee97f258fe2d7c765206e8a"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="classarmnn_1_1gatordmock_1_1_gatord_mock_service.html#a2b9de2e6eee97f258fe2d7c765206e8a">SendRequestCounterDir</a> ()</td></tr> |
| 109 | <tr class="memdesc:a2b9de2e6eee97f258fe2d7c765206e8a"><td class="mdescLeft"> </td><td class="mdescRight">Send a request counter directory packet back to the client. <a href="#a2b9de2e6eee97f258fe2d7c765206e8a">More...</a><br /></td></tr> |
| 110 | <tr class="separator:a2b9de2e6eee97f258fe2d7c765206e8a"><td class="memSeparator" colspan="2"> </td></tr> |
| 111 | <tr class="memitem:a5175305569ecb4e58004e977abeff61a"><td class="memItemLeft" align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><a class="el" href="classarmnn_1_1gatordmock_1_1_gatord_mock_service.html#a5175305569ecb4e58004e977abeff61a">LaunchReceivingThread</a> ()</td></tr> |
| 112 | <tr class="memdesc:a5175305569ecb4e58004e977abeff61a"><td class="mdescLeft"> </td><td class="mdescRight">Start the thread that will receive all packets and print them nicely to stdout. <a href="#a5175305569ecb4e58004e977abeff61a">More...</a><br /></td></tr> |
| 113 | <tr class="separator:a5175305569ecb4e58004e977abeff61a"><td class="memSeparator" colspan="2"> </td></tr> |
| 114 | <tr class="memitem:a4c9761eec8e1cd0bd73c6cdf2c2eda89"><td class="memItemLeft" align="right" valign="top">uint32_t </td><td class="memItemRight" valign="bottom"><a class="el" href="classarmnn_1_1gatordmock_1_1_gatord_mock_service.html#a4c9761eec8e1cd0bd73c6cdf2c2eda89">GetPacketsReceivedCount</a> ()</td></tr> |
| 115 | <tr class="separator:a4c9761eec8e1cd0bd73c6cdf2c2eda89"><td class="memSeparator" colspan="2"> </td></tr> |
| 116 | <tr class="memitem:a93617d8640d5e93831d06a2ef3c86bef"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="classarmnn_1_1gatordmock_1_1_gatord_mock_service.html#a93617d8640d5e93831d06a2ef3c86bef">WaitForReceivingThread</a> ()</td></tr> |
| 117 | <tr class="separator:a93617d8640d5e93831d06a2ef3c86bef"><td class="memSeparator" colspan="2"> </td></tr> |
| 118 | <tr class="memitem:a82bd11e044b4bc9c647fcaa9ce5b3e55"><td class="memItemLeft" align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><a class="el" href="classarmnn_1_1gatordmock_1_1_gatord_mock_service.html#a82bd11e044b4bc9c647fcaa9ce5b3e55">ReceiveThreadRunning</a> ()</td></tr> |
| 119 | <tr class="separator:a82bd11e044b4bc9c647fcaa9ce5b3e55"><td class="memSeparator" colspan="2"> </td></tr> |
| 120 | <tr class="memitem:abaf2feb0e79566de18721659d896dae1"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="classarmnn_1_1gatordmock_1_1_gatord_mock_service.html#abaf2feb0e79566de18721659d896dae1">SendPeriodicCounterSelectionList</a> (uint32_t period, std::vector< uint16_t > counters)</td></tr> |
| 121 | <tr class="memdesc:abaf2feb0e79566de18721659d896dae1"><td class="mdescLeft"> </td><td class="mdescRight">Send the counter list to ArmNN. <a href="#abaf2feb0e79566de18721659d896dae1">More...</a><br /></td></tr> |
| 122 | <tr class="separator:abaf2feb0e79566de18721659d896dae1"><td class="memSeparator" colspan="2"> </td></tr> |
| 123 | <tr class="memitem:a18f77daf6b32e5bb456c2bc860140669"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="classarmnn_1_1gatordmock_1_1_gatord_mock_service.html#a18f77daf6b32e5bb456c2bc860140669">WaitCommand</a> (uint32_t timeout)</td></tr> |
| 124 | <tr class="memdesc:a18f77daf6b32e5bb456c2bc860140669"><td class="mdescLeft"> </td><td class="mdescRight">Execute the WAIT command from the comamnd file. <a href="#a18f77daf6b32e5bb456c2bc860140669">More...</a><br /></td></tr> |
| 125 | <tr class="separator:a18f77daf6b32e5bb456c2bc860140669"><td class="memSeparator" colspan="2"> </td></tr> |
| 126 | <tr class="memitem:aaf9805c78f5073622573dd3d4ce1e188"><td class="memItemLeft" align="right" valign="top">uint32_t </td><td class="memItemRight" valign="bottom"><a class="el" href="classarmnn_1_1gatordmock_1_1_gatord_mock_service.html#aaf9805c78f5073622573dd3d4ce1e188">GetStreamMetadataVersion</a> ()</td></tr> |
| 127 | <tr class="separator:aaf9805c78f5073622573dd3d4ce1e188"><td class="memSeparator" colspan="2"> </td></tr> |
| 128 | <tr class="memitem:ab8fa64e5465395276e19780848dca811"><td class="memItemLeft" align="right" valign="top">uint32_t </td><td class="memItemRight" valign="bottom"><a class="el" href="classarmnn_1_1gatordmock_1_1_gatord_mock_service.html#ab8fa64e5465395276e19780848dca811">GetStreamMetadataMaxDataLen</a> ()</td></tr> |
| 129 | <tr class="separator:ab8fa64e5465395276e19780848dca811"><td class="memSeparator" colspan="2"> </td></tr> |
| 130 | <tr class="memitem:ad7330665da0f97c753eddeee2a09a1d9"><td class="memItemLeft" align="right" valign="top">uint32_t </td><td class="memItemRight" valign="bottom"><a class="el" href="classarmnn_1_1gatordmock_1_1_gatord_mock_service.html#ad7330665da0f97c753eddeee2a09a1d9">GetStreamMetadataPid</a> ()</td></tr> |
| 131 | <tr class="separator:ad7330665da0f97c753eddeee2a09a1d9"><td class="memSeparator" colspan="2"> </td></tr> |
| 132 | </table> |
| 133 | <a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2> |
| 134 | <div class="textblock"><p>A class that implements a Mock Gatord server. It will listen on a specified Unix domain socket (UDS) namespace for client connections. It will then allow opertaions to manage coutners while receiving counter data. </p> |
| 135 | |
| 136 | <p class="definition">Definition at line <a class="el" href="_gatord_mock_service_8hpp_source.html#l00037">37</a> of file <a class="el" href="_gatord_mock_service_8hpp_source.html">GatordMockService.hpp</a>.</p> |
| 137 | </div><h2 class="groupheader">Constructor & Destructor Documentation</h2> |
| 138 | <a id="a316aee098329a282e05c9beae9f67b58"></a> |
| 139 | <h2 class="memtitle"><span class="permalink"><a href="#a316aee098329a282e05c9beae9f67b58">◆ </a></span>GatordMockService()</h2> |
| 140 | |
| 141 | <div class="memitem"> |
| 142 | <div class="memproto"> |
| 143 | <table class="mlabels"> |
| 144 | <tr> |
| 145 | <td class="mlabels-left"> |
| 146 | <table class="memname"> |
| 147 | <tr> |
| 148 | <td class="memname"><a class="el" href="classarmnn_1_1gatordmock_1_1_gatord_mock_service.html">GatordMockService</a> </td> |
| 149 | <td>(</td> |
| 150 | <td class="paramtype"><a class="el" href="classarmnn_1_1profiling_1_1_command_handler_registry.html">armnn::profiling::CommandHandlerRegistry</a> & </td> |
| 151 | <td class="paramname"><em>registry</em>, </td> |
| 152 | </tr> |
| 153 | <tr> |
| 154 | <td class="paramkey"></td> |
| 155 | <td></td> |
| 156 | <td class="paramtype">bool </td> |
| 157 | <td class="paramname"><em>echoPackets</em> </td> |
| 158 | </tr> |
| 159 | <tr> |
| 160 | <td></td> |
| 161 | <td>)</td> |
| 162 | <td></td><td></td> |
| 163 | </tr> |
| 164 | </table> |
| 165 | </td> |
| 166 | <td class="mlabels-right"> |
| 167 | <span class="mlabels"><span class="mlabel">inline</span></span> </td> |
| 168 | </tr> |
| 169 | </table> |
| 170 | </div><div class="memdoc"> |
| 171 | <dl class="params"><dt>Parameters</dt><dd> |
| 172 | <table class="params"> |
| 173 | <tr><td class="paramname">registry</td><td>reference to a command handler registry. </td></tr> |
| 174 | <tr><td class="paramname">echoPackets</td><td>if true the raw packets will be printed to stdout. </td></tr> |
| 175 | </table> |
| 176 | </dd> |
| 177 | </dl> |
| 178 | |
| 179 | <p class="definition">Definition at line <a class="el" href="_gatord_mock_service_8hpp_source.html#l00042">42</a> of file <a class="el" href="_gatord_mock_service_8hpp_source.html">GatordMockService.hpp</a>.</p> |
| 180 | <div class="fragment"><div class="line"><a name="l00043"></a><span class="lineno"> 43</span>  : m_HandlerRegistry(registry)</div><div class="line"><a name="l00044"></a><span class="lineno"> 44</span>  , m_EchoPackets(echoPackets)</div><div class="line"><a name="l00045"></a><span class="lineno"> 45</span>  , m_CloseReceivingThread(<span class="keyword">false</span>)</div><div class="line"><a name="l00046"></a><span class="lineno"> 46</span>  {</div><div class="line"><a name="l00047"></a><span class="lineno"> 47</span>  m_PacketsReceivedCount.store(0, std::memory_order_relaxed);</div><div class="line"><a name="l00048"></a><span class="lineno"> 48</span>  }</div></div><!-- fragment --> |
| 181 | </div> |
| 182 | </div> |
| 183 | <a id="ae1a11e5360cb7940eb34f80ed0dba57b"></a> |
| 184 | <h2 class="memtitle"><span class="permalink"><a href="#ae1a11e5360cb7940eb34f80ed0dba57b">◆ </a></span>~GatordMockService()</h2> |
| 185 | |
| 186 | <div class="memitem"> |
| 187 | <div class="memproto"> |
| 188 | <table class="mlabels"> |
| 189 | <tr> |
| 190 | <td class="mlabels-left"> |
| 191 | <table class="memname"> |
| 192 | <tr> |
| 193 | <td class="memname">~<a class="el" href="classarmnn_1_1gatordmock_1_1_gatord_mock_service.html">GatordMockService</a> </td> |
| 194 | <td>(</td> |
| 195 | <td class="paramname"></td><td>)</td> |
| 196 | <td></td> |
| 197 | </tr> |
| 198 | </table> |
| 199 | </td> |
| 200 | <td class="mlabels-right"> |
| 201 | <span class="mlabels"><span class="mlabel">inline</span></span> </td> |
| 202 | </tr> |
| 203 | </table> |
| 204 | </div><div class="memdoc"> |
| 205 | |
| 206 | <p class="definition">Definition at line <a class="el" href="_gatord_mock_service_8hpp_source.html#l00050">50</a> of file <a class="el" href="_gatord_mock_service_8hpp_source.html">GatordMockService.hpp</a>.</p> |
| 207 | |
| 208 | <p class="reference">References <a class="el" href="_network_sockets_8cpp_source.html#l00028">armnnUtils::Sockets::Close()</a>.</p> |
| 209 | <div class="fragment"><div class="line"><a name="l00051"></a><span class="lineno"> 51</span>  {</div><div class="line"><a name="l00052"></a><span class="lineno"> 52</span>  <span class="comment">// We have set SOCK_CLOEXEC on these sockets but we'll close them to be good citizens.</span></div><div class="line"><a name="l00053"></a><span class="lineno"> 53</span>  <a class="code" href="namespacearmnn_utils_1_1_sockets.html#a72e0661331d20d0a352fb49c388a1b05">armnnUtils::Sockets::Close</a>(m_ClientConnection);</div><div class="line"><a name="l00054"></a><span class="lineno"> 54</span>  <a class="code" href="namespacearmnn_utils_1_1_sockets.html#a72e0661331d20d0a352fb49c388a1b05">armnnUtils::Sockets::Close</a>(m_ListeningSocket);</div><div class="line"><a name="l00055"></a><span class="lineno"> 55</span>  }</div><div class="ttc" id="namespacearmnn_utils_1_1_sockets_html_a72e0661331d20d0a352fb49c388a1b05"><div class="ttname"><a href="namespacearmnn_utils_1_1_sockets.html#a72e0661331d20d0a352fb49c388a1b05">armnnUtils::Sockets::Close</a></div><div class="ttdeci">int Close(Socket s)</div><div class="ttdef"><b>Definition:</b> <a href="_network_sockets_8cpp_source.html#l00028">NetworkSockets.cpp:28</a></div></div> |
| 210 | </div><!-- fragment --> |
| 211 | </div> |
| 212 | </div> |
| 213 | <h2 class="groupheader">Member Function Documentation</h2> |
| 214 | <a id="a4c7dcda01e81dbdc47ceb1c82f26039b"></a> |
| 215 | <h2 class="memtitle"><span class="permalink"><a href="#a4c7dcda01e81dbdc47ceb1c82f26039b">◆ </a></span>BlockForOneClient()</h2> |
| 216 | |
| 217 | <div class="memitem"> |
| 218 | <div class="memproto"> |
| 219 | <table class="memname"> |
| 220 | <tr> |
| 221 | <td class="memname">Sockets::Socket BlockForOneClient </td> |
| 222 | <td>(</td> |
| 223 | <td class="paramname"></td><td>)</td> |
| 224 | <td></td> |
| 225 | </tr> |
| 226 | </table> |
| 227 | </div><div class="memdoc"> |
| 228 | <p>Block waiting to accept one client to connect to the UDS. </p><dl class="section return"><dt>Returns</dt><dd>the file descriptor of the client connection. </dd></dl> |
| 229 | |
| 230 | <p class="definition">Definition at line <a class="el" href="_gatord_mock_service_8cpp_source.html#l00058">58</a> of file <a class="el" href="_gatord_mock_service_8cpp_source.html">GatordMockService.cpp</a>.</p> |
| 231 | |
| 232 | <p class="reference">References <a class="el" href="_network_sockets_8cpp_source.html#l00091">armnnUtils::Sockets::Accept()</a>.</p> |
| 233 | |
| 234 | <p class="reference">Referenced by <a class="el" href="_gatord_mock_tests_8cpp_source.html#l00105">BOOST_AUTO_TEST_CASE()</a>.</p> |
| 235 | <div class="fragment"><div class="line"><a name="l00059"></a><span class="lineno"> 59</span> {</div><div class="line"><a name="l00060"></a><span class="lineno"> 60</span>  m_ClientConnection = <a class="code" href="namespacearmnn_utils_1_1_sockets.html#ae7d45c832d3f9a398a08352442d20417">Sockets::Accept</a>(m_ListeningSocket, <span class="keyword">nullptr</span>, <span class="keyword">nullptr</span>, SOCK_CLOEXEC);</div><div class="line"><a name="l00061"></a><span class="lineno"> 61</span>  <span class="keywordflow">if</span> (-1 == m_ClientConnection)</div><div class="line"><a name="l00062"></a><span class="lineno"> 62</span>  {</div><div class="line"><a name="l00063"></a><span class="lineno"> 63</span>  std::cerr << <span class="stringliteral">": Failure when waiting for a client connection: "</span> << strerror(errno) << std::endl;</div><div class="line"><a name="l00064"></a><span class="lineno"> 64</span>  <span class="keywordflow">return</span> -1;</div><div class="line"><a name="l00065"></a><span class="lineno"> 65</span>  }</div><div class="line"><a name="l00066"></a><span class="lineno"> 66</span>  <span class="keywordflow">return</span> m_ClientConnection;</div><div class="line"><a name="l00067"></a><span class="lineno"> 67</span> }</div><div class="ttc" id="namespacearmnn_utils_1_1_sockets_html_ae7d45c832d3f9a398a08352442d20417"><div class="ttname"><a href="namespacearmnn_utils_1_1_sockets.html#ae7d45c832d3f9a398a08352442d20417">armnnUtils::Sockets::Accept</a></div><div class="ttdeci">armnnUtils::Sockets::Socket Accept(Socket s, sockaddr *addr, socklen_t *addrlen, int flags)</div><div class="ttdef"><b>Definition:</b> <a href="_network_sockets_8cpp_source.html#l00091">NetworkSockets.cpp:91</a></div></div> |
| 236 | </div><!-- fragment --> |
| 237 | </div> |
| 238 | </div> |
| 239 | <a id="a4c9761eec8e1cd0bd73c6cdf2c2eda89"></a> |
| 240 | <h2 class="memtitle"><span class="permalink"><a href="#a4c9761eec8e1cd0bd73c6cdf2c2eda89">◆ </a></span>GetPacketsReceivedCount()</h2> |
| 241 | |
| 242 | <div class="memitem"> |
| 243 | <div class="memproto"> |
| 244 | <table class="mlabels"> |
| 245 | <tr> |
| 246 | <td class="mlabels-left"> |
| 247 | <table class="memname"> |
| 248 | <tr> |
| 249 | <td class="memname">uint32_t GetPacketsReceivedCount </td> |
| 250 | <td>(</td> |
| 251 | <td class="paramname"></td><td>)</td> |
| 252 | <td></td> |
| 253 | </tr> |
| 254 | </table> |
| 255 | </td> |
| 256 | <td class="mlabels-right"> |
| 257 | <span class="mlabels"><span class="mlabel">inline</span></span> </td> |
| 258 | </tr> |
| 259 | </table> |
| 260 | </div><div class="memdoc"> |
| 261 | <p>Return the total number of periodic counter capture packets received since the receive thread started. </p><dl class="section return"><dt>Returns</dt><dd>number of periodic counter capture packets received. </dd></dl> |
| 262 | |
| 263 | <p class="definition">Definition at line <a class="el" href="_gatord_mock_service_8hpp_source.html#l00082">82</a> of file <a class="el" href="_gatord_mock_service_8hpp_source.html">GatordMockService.hpp</a>.</p> |
| 264 | <div class="fragment"><div class="line"><a name="l00083"></a><span class="lineno"> 83</span>  {</div><div class="line"><a name="l00084"></a><span class="lineno"> 84</span>  <span class="keywordflow">return</span> m_PacketsReceivedCount.load(std::memory_order_acquire);</div><div class="line"><a name="l00085"></a><span class="lineno"> 85</span>  }</div></div><!-- fragment --> |
| 265 | </div> |
| 266 | </div> |
| 267 | <a id="ab8fa64e5465395276e19780848dca811"></a> |
| 268 | <h2 class="memtitle"><span class="permalink"><a href="#ab8fa64e5465395276e19780848dca811">◆ </a></span>GetStreamMetadataMaxDataLen()</h2> |
| 269 | |
| 270 | <div class="memitem"> |
| 271 | <div class="memproto"> |
| 272 | <table class="mlabels"> |
| 273 | <tr> |
| 274 | <td class="mlabels-left"> |
| 275 | <table class="memname"> |
| 276 | <tr> |
| 277 | <td class="memname">uint32_t GetStreamMetadataMaxDataLen </td> |
| 278 | <td>(</td> |
| 279 | <td class="paramname"></td><td>)</td> |
| 280 | <td></td> |
| 281 | </tr> |
| 282 | </table> |
| 283 | </td> |
| 284 | <td class="mlabels-right"> |
| 285 | <span class="mlabels"><span class="mlabel">inline</span></span> </td> |
| 286 | </tr> |
| 287 | </table> |
| 288 | </div><div class="memdoc"> |
| 289 | |
| 290 | <p class="definition">Definition at line <a class="el" href="_gatord_mock_service_8hpp_source.html#l00108">108</a> of file <a class="el" href="_gatord_mock_service_8hpp_source.html">GatordMockService.hpp</a>.</p> |
| 291 | <div class="fragment"><div class="line"><a name="l00109"></a><span class="lineno"> 109</span>  {</div><div class="line"><a name="l00110"></a><span class="lineno"> 110</span>  <span class="keywordflow">return</span> m_StreamMetaDataMaxDataLen;</div><div class="line"><a name="l00111"></a><span class="lineno"> 111</span>  }</div></div><!-- fragment --> |
| 292 | </div> |
| 293 | </div> |
| 294 | <a id="ad7330665da0f97c753eddeee2a09a1d9"></a> |
| 295 | <h2 class="memtitle"><span class="permalink"><a href="#ad7330665da0f97c753eddeee2a09a1d9">◆ </a></span>GetStreamMetadataPid()</h2> |
| 296 | |
| 297 | <div class="memitem"> |
| 298 | <div class="memproto"> |
| 299 | <table class="mlabels"> |
| 300 | <tr> |
| 301 | <td class="mlabels-left"> |
| 302 | <table class="memname"> |
| 303 | <tr> |
| 304 | <td class="memname">uint32_t GetStreamMetadataPid </td> |
| 305 | <td>(</td> |
| 306 | <td class="paramname"></td><td>)</td> |
| 307 | <td></td> |
| 308 | </tr> |
| 309 | </table> |
| 310 | </td> |
| 311 | <td class="mlabels-right"> |
| 312 | <span class="mlabels"><span class="mlabel">inline</span></span> </td> |
| 313 | </tr> |
| 314 | </table> |
| 315 | </div><div class="memdoc"> |
| 316 | |
| 317 | <p class="definition">Definition at line <a class="el" href="_gatord_mock_service_8hpp_source.html#l00113">113</a> of file <a class="el" href="_gatord_mock_service_8hpp_source.html">GatordMockService.hpp</a>.</p> |
| 318 | <div class="fragment"><div class="line"><a name="l00114"></a><span class="lineno"> 114</span>  {</div><div class="line"><a name="l00115"></a><span class="lineno"> 115</span>  <span class="keywordflow">return</span> m_StreamMetaDataPid;</div><div class="line"><a name="l00116"></a><span class="lineno"> 116</span>  }</div></div><!-- fragment --> |
| 319 | </div> |
| 320 | </div> |
| 321 | <a id="aaf9805c78f5073622573dd3d4ce1e188"></a> |
| 322 | <h2 class="memtitle"><span class="permalink"><a href="#aaf9805c78f5073622573dd3d4ce1e188">◆ </a></span>GetStreamMetadataVersion()</h2> |
| 323 | |
| 324 | <div class="memitem"> |
| 325 | <div class="memproto"> |
| 326 | <table class="mlabels"> |
| 327 | <tr> |
| 328 | <td class="mlabels-left"> |
| 329 | <table class="memname"> |
| 330 | <tr> |
| 331 | <td class="memname">uint32_t GetStreamMetadataVersion </td> |
| 332 | <td>(</td> |
| 333 | <td class="paramname"></td><td>)</td> |
| 334 | <td></td> |
| 335 | </tr> |
| 336 | </table> |
| 337 | </td> |
| 338 | <td class="mlabels-right"> |
| 339 | <span class="mlabels"><span class="mlabel">inline</span></span> </td> |
| 340 | </tr> |
| 341 | </table> |
| 342 | </div><div class="memdoc"> |
| 343 | |
| 344 | <p class="definition">Definition at line <a class="el" href="_gatord_mock_service_8hpp_source.html#l00103">103</a> of file <a class="el" href="_gatord_mock_service_8hpp_source.html">GatordMockService.hpp</a>.</p> |
| 345 | <div class="fragment"><div class="line"><a name="l00104"></a><span class="lineno"> 104</span>  {</div><div class="line"><a name="l00105"></a><span class="lineno"> 105</span>  <span class="keywordflow">return</span> m_StreamMetaDataVersion;</div><div class="line"><a name="l00106"></a><span class="lineno"> 106</span>  }</div></div><!-- fragment --> |
| 346 | </div> |
| 347 | </div> |
| 348 | <a id="a5175305569ecb4e58004e977abeff61a"></a> |
| 349 | <h2 class="memtitle"><span class="permalink"><a href="#a5175305569ecb4e58004e977abeff61a">◆ </a></span>LaunchReceivingThread()</h2> |
| 350 | |
| 351 | <div class="memitem"> |
| 352 | <div class="memproto"> |
| 353 | <table class="memname"> |
| 354 | <tr> |
| 355 | <td class="memname">bool LaunchReceivingThread </td> |
| 356 | <td>(</td> |
| 357 | <td class="paramname"></td><td>)</td> |
| 358 | <td></td> |
| 359 | </tr> |
| 360 | </table> |
| 361 | </div><div class="memdoc"> |
| 362 | |
| 363 | <p>Start the thread that will receive all packets and print them nicely to stdout. </p> |
| 364 | |
| 365 | <p class="definition">Definition at line <a class="el" href="_gatord_mock_service_8cpp_source.html#l00149">149</a> of file <a class="el" href="_gatord_mock_service_8cpp_source.html">GatordMockService.cpp</a>.</p> |
| 366 | |
| 367 | <p class="reference">References <a class="el" href="_network_sockets_8cpp_source.html#l00028">armnnUtils::Sockets::Close()</a>, and <a class="el" href="_network_sockets_8cpp_source.html#l00038">armnnUtils::Sockets::SetNonBlocking()</a>.</p> |
| 368 | |
| 369 | <p class="reference">Referenced by <a class="el" href="_gatord_mock_tests_8cpp_source.html#l00105">BOOST_AUTO_TEST_CASE()</a>.</p> |
| 370 | <div class="fragment"><div class="line"><a name="l00150"></a><span class="lineno"> 150</span> {</div><div class="line"><a name="l00151"></a><span class="lineno"> 151</span>  <span class="keywordflow">if</span> (m_EchoPackets)</div><div class="line"><a name="l00152"></a><span class="lineno"> 152</span>  {</div><div class="line"><a name="l00153"></a><span class="lineno"> 153</span>  std::cout << <span class="stringliteral">"Launching receiving thread."</span> << std::endl;</div><div class="line"><a name="l00154"></a><span class="lineno"> 154</span>  }</div><div class="line"><a name="l00155"></a><span class="lineno"> 155</span>  <span class="comment">// At this point we want to make the socket non blocking.</span></div><div class="line"><a name="l00156"></a><span class="lineno"> 156</span>  <span class="keywordflow">if</span> (!<a class="code" href="namespacearmnn_utils_1_1_sockets.html#a8396c0d14fc0e7284b175fedfeceef37">Sockets::SetNonBlocking</a>(m_ClientConnection))</div><div class="line"><a name="l00157"></a><span class="lineno"> 157</span>  {</div><div class="line"><a name="l00158"></a><span class="lineno"> 158</span>  <a class="code" href="namespacearmnn_utils_1_1_sockets.html#a72e0661331d20d0a352fb49c388a1b05">Sockets::Close</a>(m_ClientConnection);</div><div class="line"><a name="l00159"></a><span class="lineno"> 159</span>  std::cerr << <span class="stringliteral">"Failed to set socket as non blocking: "</span> << strerror(errno) << std::endl;</div><div class="line"><a name="l00160"></a><span class="lineno"> 160</span>  <span class="keywordflow">return</span> <span class="keyword">false</span>;</div><div class="line"><a name="l00161"></a><span class="lineno"> 161</span>  }</div><div class="line"><a name="l00162"></a><span class="lineno"> 162</span>  m_ListeningThread = std::thread(&GatordMockService::ReceiveLoop, <span class="keyword">this</span>, std::ref(*<span class="keyword">this</span>));</div><div class="line"><a name="l00163"></a><span class="lineno"> 163</span>  <span class="keywordflow">return</span> <span class="keyword">true</span>;</div><div class="line"><a name="l00164"></a><span class="lineno"> 164</span> }</div><div class="ttc" id="namespacearmnn_utils_1_1_sockets_html_a72e0661331d20d0a352fb49c388a1b05"><div class="ttname"><a href="namespacearmnn_utils_1_1_sockets.html#a72e0661331d20d0a352fb49c388a1b05">armnnUtils::Sockets::Close</a></div><div class="ttdeci">int Close(Socket s)</div><div class="ttdef"><b>Definition:</b> <a href="_network_sockets_8cpp_source.html#l00028">NetworkSockets.cpp:28</a></div></div> |
| 371 | <div class="ttc" id="namespacearmnn_utils_1_1_sockets_html_a8396c0d14fc0e7284b175fedfeceef37"><div class="ttname"><a href="namespacearmnn_utils_1_1_sockets.html#a8396c0d14fc0e7284b175fedfeceef37">armnnUtils::Sockets::SetNonBlocking</a></div><div class="ttdeci">bool SetNonBlocking(Socket s)</div><div class="ttdef"><b>Definition:</b> <a href="_network_sockets_8cpp_source.html#l00038">NetworkSockets.cpp:38</a></div></div> |
| 372 | </div><!-- fragment --> |
| 373 | </div> |
| 374 | </div> |
| 375 | <a id="aa03af06b5336e9ad43b374a03934c0f1"></a> |
| 376 | <h2 class="memtitle"><span class="permalink"><a href="#aa03af06b5336e9ad43b374a03934c0f1">◆ </a></span>OpenListeningSocket()</h2> |
| 377 | |
| 378 | <div class="memitem"> |
| 379 | <div class="memproto"> |
| 380 | <table class="memname"> |
| 381 | <tr> |
| 382 | <td class="memname">bool OpenListeningSocket </td> |
| 383 | <td>(</td> |
| 384 | <td class="paramtype">std::string </td> |
| 385 | <td class="paramname"><em>udsNamespace</em></td><td>)</td> |
| 386 | <td></td> |
| 387 | </tr> |
| 388 | </table> |
| 389 | </div><div class="memdoc"> |
| 390 | <p>Establish the Unix domain socket and set it to listen for connections. </p><dl class="params"><dt>Parameters</dt><dd> |
| 391 | <table class="params"> |
| 392 | <tr><td class="paramname">udsNamespace</td><td>the namespace (socket address) associated with the listener. </td></tr> |
| 393 | </table> |
| 394 | </dd> |
| 395 | </dl> |
| 396 | <dl class="section return"><dt>Returns</dt><dd>true only if the socket has been correctly setup. </dd></dl> |
| 397 | |
| 398 | <p class="definition">Definition at line <a class="el" href="_gatord_mock_service_8cpp_source.html#l00027">27</a> of file <a class="el" href="_gatord_mock_service_8cpp_source.html">GatordMockService.cpp</a>.</p> |
| 399 | |
| 400 | <p class="reference">References <a class="el" href="_network_sockets_8cpp_source.html#l00018">armnnUtils::Sockets::Initialize()</a>.</p> |
| 401 | |
| 402 | <p class="reference">Referenced by <a class="el" href="_gatord_mock_tests_8cpp_source.html#l00105">BOOST_AUTO_TEST_CASE()</a>.</p> |
| 403 | <div class="fragment"><div class="line"><a name="l00028"></a><span class="lineno"> 28</span> {</div><div class="line"><a name="l00029"></a><span class="lineno"> 29</span>  <a class="code" href="namespacearmnn_utils_1_1_sockets.html#a248c764067ee60c03ee370784c49f353">Sockets::Initialize</a>();</div><div class="line"><a name="l00030"></a><span class="lineno"> 30</span>  m_ListeningSocket = socket(PF_UNIX, SOCK_STREAM | SOCK_CLOEXEC, 0);</div><div class="line"><a name="l00031"></a><span class="lineno"> 31</span>  <span class="keywordflow">if</span> (-1 == m_ListeningSocket)</div><div class="line"><a name="l00032"></a><span class="lineno"> 32</span>  {</div><div class="line"><a name="l00033"></a><span class="lineno"> 33</span>  std::cerr << <span class="stringliteral">": Socket construction failed: "</span> << strerror(errno) << std::endl;</div><div class="line"><a name="l00034"></a><span class="lineno"> 34</span>  <span class="keywordflow">return</span> <span class="keyword">false</span>;</div><div class="line"><a name="l00035"></a><span class="lineno"> 35</span>  }</div><div class="line"><a name="l00036"></a><span class="lineno"> 36</span> </div><div class="line"><a name="l00037"></a><span class="lineno"> 37</span>  sockaddr_un udsAddress;</div><div class="line"><a name="l00038"></a><span class="lineno"> 38</span>  memset(&udsAddress, 0, <span class="keyword">sizeof</span>(sockaddr_un));</div><div class="line"><a name="l00039"></a><span class="lineno"> 39</span>  <span class="comment">// We've set the first element of sun_path to be 0, skip over it and copy the namespace after it.</span></div><div class="line"><a name="l00040"></a><span class="lineno"> 40</span>  memcpy(udsAddress.sun_path + 1, udsNamespace.c_str(), strlen(udsNamespace.c_str()));</div><div class="line"><a name="l00041"></a><span class="lineno"> 41</span>  udsAddress.sun_family = AF_UNIX;</div><div class="line"><a name="l00042"></a><span class="lineno"> 42</span> </div><div class="line"><a name="l00043"></a><span class="lineno"> 43</span>  <span class="comment">// Bind the socket to the UDS namespace.</span></div><div class="line"><a name="l00044"></a><span class="lineno"> 44</span>  <span class="keywordflow">if</span> (-1 == bind(m_ListeningSocket, reinterpret_cast<const sockaddr*>(&udsAddress), <span class="keyword">sizeof</span>(sockaddr_un)))</div><div class="line"><a name="l00045"></a><span class="lineno"> 45</span>  {</div><div class="line"><a name="l00046"></a><span class="lineno"> 46</span>  std::cerr << <span class="stringliteral">": Binding on socket failed: "</span> << strerror(errno) << std::endl;</div><div class="line"><a name="l00047"></a><span class="lineno"> 47</span>  <span class="keywordflow">return</span> <span class="keyword">false</span>;</div><div class="line"><a name="l00048"></a><span class="lineno"> 48</span>  }</div><div class="line"><a name="l00049"></a><span class="lineno"> 49</span>  <span class="comment">// Listen for 1 connection.</span></div><div class="line"><a name="l00050"></a><span class="lineno"> 50</span>  <span class="keywordflow">if</span> (-1 == listen(m_ListeningSocket, 1))</div><div class="line"><a name="l00051"></a><span class="lineno"> 51</span>  {</div><div class="line"><a name="l00052"></a><span class="lineno"> 52</span>  std::cerr << <span class="stringliteral">": Listen call on socket failed: "</span> << strerror(errno) << std::endl;</div><div class="line"><a name="l00053"></a><span class="lineno"> 53</span>  <span class="keywordflow">return</span> <span class="keyword">false</span>;</div><div class="line"><a name="l00054"></a><span class="lineno"> 54</span>  }</div><div class="line"><a name="l00055"></a><span class="lineno"> 55</span>  <span class="keywordflow">return</span> <span class="keyword">true</span>;</div><div class="line"><a name="l00056"></a><span class="lineno"> 56</span> }</div><div class="ttc" id="namespacearmnn_utils_1_1_sockets_html_a248c764067ee60c03ee370784c49f353"><div class="ttname"><a href="namespacearmnn_utils_1_1_sockets.html#a248c764067ee60c03ee370784c49f353">armnnUtils::Sockets::Initialize</a></div><div class="ttdeci">bool Initialize()</div><div class="ttdoc">Performs any required one-time setup. </div><div class="ttdef"><b>Definition:</b> <a href="_network_sockets_8cpp_source.html#l00018">NetworkSockets.cpp:18</a></div></div> |
| 404 | </div><!-- fragment --> |
| 405 | </div> |
| 406 | </div> |
| 407 | <a id="a82bd11e044b4bc9c647fcaa9ce5b3e55"></a> |
| 408 | <h2 class="memtitle"><span class="permalink"><a href="#a82bd11e044b4bc9c647fcaa9ce5b3e55">◆ </a></span>ReceiveThreadRunning()</h2> |
| 409 | |
| 410 | <div class="memitem"> |
| 411 | <div class="memproto"> |
| 412 | <table class="mlabels"> |
| 413 | <tr> |
| 414 | <td class="mlabels-left"> |
| 415 | <table class="memname"> |
| 416 | <tr> |
| 417 | <td class="memname">bool ReceiveThreadRunning </td> |
| 418 | <td>(</td> |
| 419 | <td class="paramname"></td><td>)</td> |
| 420 | <td></td> |
| 421 | </tr> |
| 422 | </table> |
| 423 | </td> |
| 424 | <td class="mlabels-right"> |
| 425 | <span class="mlabels"><span class="mlabel">inline</span></span> </td> |
| 426 | </tr> |
| 427 | </table> |
| 428 | </div><div class="memdoc"> |
| 429 | |
| 430 | <p class="definition">Definition at line <a class="el" href="_gatord_mock_service_8hpp_source.html#l00092">92</a> of file <a class="el" href="_gatord_mock_service_8hpp_source.html">GatordMockService.hpp</a>.</p> |
| 431 | |
| 432 | <p class="reference">Referenced by <a class="el" href="_command_file_parser_8cpp_source.html#l00019">CommandFileParser::ParseFile()</a>, and <a class="el" href="_gatord_mock_service_8cpp_source.html#l00214">GatordMockService::WaitCommand()</a>.</p> |
| 433 | <div class="fragment"><div class="line"><a name="l00093"></a><span class="lineno"> 93</span>  {</div><div class="line"><a name="l00094"></a><span class="lineno"> 94</span>  <span class="keywordflow">return</span> !m_CloseReceivingThread.load();</div><div class="line"><a name="l00095"></a><span class="lineno"> 95</span>  }</div></div><!-- fragment --> |
| 434 | </div> |
| 435 | </div> |
| 436 | <a id="a41eaa65cf4e7212f09b04d06c130cd83"></a> |
| 437 | <h2 class="memtitle"><span class="permalink"><a href="#a41eaa65cf4e7212f09b04d06c130cd83">◆ </a></span>SendConnectionAck()</h2> |
| 438 | |
| 439 | <div class="memitem"> |
| 440 | <div class="memproto"> |
| 441 | <table class="memname"> |
| 442 | <tr> |
| 443 | <td class="memname">void SendConnectionAck </td> |
| 444 | <td>(</td> |
| 445 | <td class="paramname"></td><td>)</td> |
| 446 | <td></td> |
| 447 | </tr> |
| 448 | </table> |
| 449 | </div><div class="memdoc"> |
| 450 | |
| 451 | <p>Send a connection acknowledged packet back to the client. </p> |
| 452 | |
| 453 | <p class="definition">Definition at line <a class="el" href="_gatord_mock_service_8cpp_source.html#l00129">129</a> of file <a class="el" href="_gatord_mock_service_8cpp_source.html">GatordMockService.cpp</a>.</p> |
| 454 | |
| 455 | <p class="reference">Referenced by <a class="el" href="_gatord_mock_tests_8cpp_source.html#l00105">BOOST_AUTO_TEST_CASE()</a>.</p> |
| 456 | <div class="fragment"><div class="line"><a name="l00130"></a><span class="lineno"> 130</span> {</div><div class="line"><a name="l00131"></a><span class="lineno"> 131</span>  <span class="keywordflow">if</span> (m_EchoPackets)</div><div class="line"><a name="l00132"></a><span class="lineno"> 132</span>  {</div><div class="line"><a name="l00133"></a><span class="lineno"> 133</span>  std::cout << <span class="stringliteral">"Sending connection acknowledgement."</span> << std::endl;</div><div class="line"><a name="l00134"></a><span class="lineno"> 134</span>  }</div><div class="line"><a name="l00135"></a><span class="lineno"> 135</span>  <span class="comment">// The connection ack packet is an empty data packet with packetId == 1.</span></div><div class="line"><a name="l00136"></a><span class="lineno"> 136</span>  SendPacket(0, 1, <span class="keyword">nullptr</span>, 0);</div><div class="line"><a name="l00137"></a><span class="lineno"> 137</span> }</div></div><!-- fragment --> |
| 457 | </div> |
| 458 | </div> |
| 459 | <a id="abaf2feb0e79566de18721659d896dae1"></a> |
| 460 | <h2 class="memtitle"><span class="permalink"><a href="#abaf2feb0e79566de18721659d896dae1">◆ </a></span>SendPeriodicCounterSelectionList()</h2> |
| 461 | |
| 462 | <div class="memitem"> |
| 463 | <div class="memproto"> |
| 464 | <table class="memname"> |
| 465 | <tr> |
| 466 | <td class="memname">void SendPeriodicCounterSelectionList </td> |
| 467 | <td>(</td> |
| 468 | <td class="paramtype">uint32_t </td> |
| 469 | <td class="paramname"><em>period</em>, </td> |
| 470 | </tr> |
| 471 | <tr> |
| 472 | <td class="paramkey"></td> |
| 473 | <td></td> |
| 474 | <td class="paramtype">std::vector< uint16_t > </td> |
| 475 | <td class="paramname"><em>counters</em> </td> |
| 476 | </tr> |
| 477 | <tr> |
| 478 | <td></td> |
| 479 | <td>)</td> |
| 480 | <td></td><td></td> |
| 481 | </tr> |
| 482 | </table> |
| 483 | </div><div class="memdoc"> |
| 484 | |
| 485 | <p>Send the counter list to ArmNN. </p> |
| 486 | |
| 487 | <p class="definition">Definition at line <a class="el" href="_gatord_mock_service_8cpp_source.html#l00181">181</a> of file <a class="el" href="_gatord_mock_service_8cpp_source.html">GatordMockService.cpp</a>.</p> |
| 488 | |
| 489 | <p class="reference">References <a class="el" href="_profiling_utils_8cpp_source.html#l00126">armnn::profiling::WriteUint16()</a>, and <a class="el" href="_profiling_utils_8cpp_source.html#l00119">armnn::profiling::WriteUint32()</a>.</p> |
| 490 | |
| 491 | <p class="reference">Referenced by <a class="el" href="_command_file_parser_8cpp_source.html#l00019">CommandFileParser::ParseFile()</a>.</p> |
| 492 | <div class="fragment"><div class="line"><a name="l00182"></a><span class="lineno"> 182</span> {</div><div class="line"><a name="l00183"></a><span class="lineno"> 183</span>  <span class="comment">// The packet body consists of a UINT32 representing the period following by zero or more</span></div><div class="line"><a name="l00184"></a><span class="lineno"> 184</span>  <span class="comment">// UINT16's representing counter UID's. If the list is empty it implies all counters are to</span></div><div class="line"><a name="l00185"></a><span class="lineno"> 185</span>  <span class="comment">// be disabled.</span></div><div class="line"><a name="l00186"></a><span class="lineno"> 186</span> </div><div class="line"><a name="l00187"></a><span class="lineno"> 187</span>  <span class="keywordflow">if</span> (m_EchoPackets)</div><div class="line"><a name="l00188"></a><span class="lineno"> 188</span>  {</div><div class="line"><a name="l00189"></a><span class="lineno"> 189</span>  std::cout << <span class="stringliteral">"SendPeriodicCounterSelectionList: Period="</span> << std::dec << period << <span class="stringliteral">"uSec"</span> << std::endl;</div><div class="line"><a name="l00190"></a><span class="lineno"> 190</span>  std::cout << <span class="stringliteral">"List length="</span> << counters.size() << std::endl;</div><div class="line"><a name="l00191"></a><span class="lineno"> 191</span>  ;</div><div class="line"><a name="l00192"></a><span class="lineno"> 192</span>  }</div><div class="line"><a name="l00193"></a><span class="lineno"> 193</span>  <span class="comment">// Start by calculating the length of the packet body in bytes. This will be at least 4.</span></div><div class="line"><a name="l00194"></a><span class="lineno"> 194</span>  uint32_t dataLength = <span class="keyword">static_cast<</span>uint32_t<span class="keyword">></span>(4 + (counters.size() * 2));</div><div class="line"><a name="l00195"></a><span class="lineno"> 195</span> </div><div class="line"><a name="l00196"></a><span class="lineno"> 196</span>  std::unique_ptr<unsigned char[]> uniqueData = std::make_unique<unsigned char[]>(dataLength);</div><div class="line"><a name="l00197"></a><span class="lineno"> 197</span>  <span class="keywordtype">unsigned</span> <span class="keywordtype">char</span>* data = <span class="keyword">reinterpret_cast<</span><span class="keywordtype">unsigned</span> <span class="keywordtype">char</span>*<span class="keyword">></span>(uniqueData.get());</div><div class="line"><a name="l00198"></a><span class="lineno"> 198</span> </div><div class="line"><a name="l00199"></a><span class="lineno"> 199</span>  uint32_t offset = 0;</div><div class="line"><a name="l00200"></a><span class="lineno"> 200</span>  <a class="code" href="namespacearmnn_1_1profiling.html#a3e638748a39d46e2943dfcef94dcb828">profiling::WriteUint32</a>(data, offset, period);</div><div class="line"><a name="l00201"></a><span class="lineno"> 201</span>  offset += 4;</div><div class="line"><a name="l00202"></a><span class="lineno"> 202</span>  <span class="keywordflow">for</span> (std::vector<uint16_t>::iterator it = counters.begin(); it != counters.end(); ++it)</div><div class="line"><a name="l00203"></a><span class="lineno"> 203</span>  {</div><div class="line"><a name="l00204"></a><span class="lineno"> 204</span>  <a class="code" href="namespacearmnn_1_1profiling.html#ae5ace88c65e65ab7cf5572613601a60d">profiling::WriteUint16</a>(data, offset, *it);</div><div class="line"><a name="l00205"></a><span class="lineno"> 205</span>  offset += 2;</div><div class="line"><a name="l00206"></a><span class="lineno"> 206</span>  }</div><div class="line"><a name="l00207"></a><span class="lineno"> 207</span> </div><div class="line"><a name="l00208"></a><span class="lineno"> 208</span>  <span class="comment">// Send the packet.</span></div><div class="line"><a name="l00209"></a><span class="lineno"> 209</span>  SendPacket(0, 4, data, dataLength);</div><div class="line"><a name="l00210"></a><span class="lineno"> 210</span>  <span class="comment">// There will be an echo response packet sitting in the receive thread. PeriodicCounterSelectionResponseHandler</span></div><div class="line"><a name="l00211"></a><span class="lineno"> 211</span>  <span class="comment">// should deal with it.</span></div><div class="line"><a name="l00212"></a><span class="lineno"> 212</span> }</div><div class="ttc" id="namespacearmnn_1_1profiling_html_ae5ace88c65e65ab7cf5572613601a60d"><div class="ttname"><a href="namespacearmnn_1_1profiling.html#ae5ace88c65e65ab7cf5572613601a60d">armnn::profiling::WriteUint16</a></div><div class="ttdeci">void WriteUint16(const IPacketBufferPtr &packetBuffer, unsigned int offset, uint16_t value)</div><div class="ttdef"><b>Definition:</b> <a href="_profiling_utils_8cpp_source.html#l00126">ProfilingUtils.cpp:126</a></div></div> |
| 493 | <div class="ttc" id="namespacearmnn_1_1profiling_html_a3e638748a39d46e2943dfcef94dcb828"><div class="ttname"><a href="namespacearmnn_1_1profiling.html#a3e638748a39d46e2943dfcef94dcb828">armnn::profiling::WriteUint32</a></div><div class="ttdeci">void WriteUint32(const IPacketBufferPtr &packetBuffer, unsigned int offset, uint32_t value)</div><div class="ttdef"><b>Definition:</b> <a href="_profiling_utils_8cpp_source.html#l00119">ProfilingUtils.cpp:119</a></div></div> |
| 494 | </div><!-- fragment --> |
| 495 | </div> |
| 496 | </div> |
| 497 | <a id="a2b9de2e6eee97f258fe2d7c765206e8a"></a> |
| 498 | <h2 class="memtitle"><span class="permalink"><a href="#a2b9de2e6eee97f258fe2d7c765206e8a">◆ </a></span>SendRequestCounterDir()</h2> |
| 499 | |
| 500 | <div class="memitem"> |
| 501 | <div class="memproto"> |
| 502 | <table class="memname"> |
| 503 | <tr> |
| 504 | <td class="memname">void SendRequestCounterDir </td> |
| 505 | <td>(</td> |
| 506 | <td class="paramname"></td><td>)</td> |
| 507 | <td></td> |
| 508 | </tr> |
| 509 | </table> |
| 510 | </div><div class="memdoc"> |
| 511 | |
| 512 | <p>Send a request counter directory packet back to the client. </p> |
| 513 | |
| 514 | <p class="definition">Definition at line <a class="el" href="_gatord_mock_service_8cpp_source.html#l00139">139</a> of file <a class="el" href="_gatord_mock_service_8cpp_source.html">GatordMockService.cpp</a>.</p> |
| 515 | |
| 516 | <p class="reference">Referenced by <a class="el" href="_command_file_parser_8cpp_source.html#l00019">CommandFileParser::ParseFile()</a>.</p> |
| 517 | <div class="fragment"><div class="line"><a name="l00140"></a><span class="lineno"> 140</span> {</div><div class="line"><a name="l00141"></a><span class="lineno"> 141</span>  <span class="keywordflow">if</span> (m_EchoPackets)</div><div class="line"><a name="l00142"></a><span class="lineno"> 142</span>  {</div><div class="line"><a name="l00143"></a><span class="lineno"> 143</span>  std::cout << <span class="stringliteral">"Sending connection acknowledgement."</span> << std::endl;</div><div class="line"><a name="l00144"></a><span class="lineno"> 144</span>  }</div><div class="line"><a name="l00145"></a><span class="lineno"> 145</span>  <span class="comment">// The connection ack packet is an empty data packet with packetId == 1.</span></div><div class="line"><a name="l00146"></a><span class="lineno"> 146</span>  SendPacket(0, 3, <span class="keyword">nullptr</span>, 0);</div><div class="line"><a name="l00147"></a><span class="lineno"> 147</span> }</div></div><!-- fragment --> |
| 518 | </div> |
| 519 | </div> |
| 520 | <a id="a18f77daf6b32e5bb456c2bc860140669"></a> |
| 521 | <h2 class="memtitle"><span class="permalink"><a href="#a18f77daf6b32e5bb456c2bc860140669">◆ </a></span>WaitCommand()</h2> |
| 522 | |
| 523 | <div class="memitem"> |
| 524 | <div class="memproto"> |
| 525 | <table class="memname"> |
| 526 | <tr> |
| 527 | <td class="memname">void WaitCommand </td> |
| 528 | <td>(</td> |
| 529 | <td class="paramtype">uint32_t </td> |
| 530 | <td class="paramname"><em>timeout</em></td><td>)</td> |
| 531 | <td></td> |
| 532 | </tr> |
| 533 | </table> |
| 534 | </div><div class="memdoc"> |
| 535 | |
| 536 | <p>Execute the WAIT command from the comamnd file. </p> |
| 537 | |
| 538 | <p class="definition">Definition at line <a class="el" href="_gatord_mock_service_8cpp_source.html#l00214">214</a> of file <a class="el" href="_gatord_mock_service_8cpp_source.html">GatordMockService.cpp</a>.</p> |
| 539 | |
| 540 | <p class="reference">References <a class="el" href="namespacearmnn_1_1gatordmock.html#a006732ecc1f16712db06bf622eb79651aefe19217ee8d2186e7bbecbf2f171eb9">armnn::gatordmock::BeWire</a>, <a class="el" href="_encode_version_8hpp_source.html#l00045">Version::GetEncodedValue()</a>, <a class="el" href="_packet_8hpp_source.html#l00074">Packet::GetLength()</a>, <a class="el" href="_packet_8hpp_source.html#l00070">Packet::GetPacketFamily()</a>, <a class="el" href="_packet_8hpp_source.html#l00071">Packet::GetPacketId()</a>, <a class="el" href="_network_sockets_8cpp_source.html#l00069">armnnUtils::Sockets::Ioctl()</a>, <a class="el" href="_network_sockets_8cpp_source.html#l00081">armnnUtils::Sockets::Poll()</a>, <a class="el" href="_network_sockets_8cpp_source.html#l00060">armnnUtils::Sockets::Read()</a>, <a class="el" href="namespacearmnn_1_1gatordmock.html#aec1b34297cc8e184a2d3d2c6e20da955af44b1a9eb8e6ef1bea10617c1dfef07f">armnn::gatordmock::ReceivedData</a>, <a class="el" href="namespacearmnn_1_1gatordmock.html#aec1b34297cc8e184a2d3d2c6e20da955a2855fc8ecb116f85a4b09600fd1cd75f">armnn::gatordmock::ReceivedHeader</a>, <a class="el" href="_gatord_mock_service_8hpp_source.html#l00092">GatordMockService::ReceiveThreadRunning()</a>, <a class="el" href="_packet_version_resolver_8cpp_source.html#l00055">PacketVersionResolver::ResolvePacketVersion()</a>, <a class="el" href="namespacearmnn_1_1gatordmock.html#aec1b34297cc8e184a2d3d2c6e20da955ae4b0c2b6d59cb4cf3e169a9886008087">armnn::gatordmock::Sending</a>, <a class="el" href="_exceptions_8cpp_source.html#l00032">Exception::what()</a>, and <a class="el" href="_network_sockets_8cpp_source.html#l00050">armnnUtils::Sockets::Write()</a>.</p> |
| 541 | |
| 542 | <p class="reference">Referenced by <a class="el" href="_command_file_parser_8cpp_source.html#l00019">CommandFileParser::ParseFile()</a>.</p> |
| 543 | <div class="fragment"><div class="line"><a name="l00215"></a><span class="lineno"> 215</span> {</div><div class="line"><a name="l00216"></a><span class="lineno"> 216</span>  <span class="comment">// Wait for a maximum of timeout microseconds or if the receive thread has closed.</span></div><div class="line"><a name="l00217"></a><span class="lineno"> 217</span>  <span class="comment">// There is a certain level of rounding involved in this timing.</span></div><div class="line"><a name="l00218"></a><span class="lineno"> 218</span>  uint32_t iterations = timeout / 1000;</div><div class="line"><a name="l00219"></a><span class="lineno"> 219</span>  std::cout << std::dec << <span class="stringliteral">"Wait command with timeout of "</span> << timeout << <span class="stringliteral">" iterations = "</span> << iterations << std::endl;</div><div class="line"><a name="l00220"></a><span class="lineno"> 220</span>  uint32_t count = 0;</div><div class="line"><a name="l00221"></a><span class="lineno"> 221</span>  <span class="keywordflow">while</span> ((this-><a class="code" href="classarmnn_1_1gatordmock_1_1_gatord_mock_service.html#a82bd11e044b4bc9c647fcaa9ce5b3e55">ReceiveThreadRunning</a>() && (count < iterations)))</div><div class="line"><a name="l00222"></a><span class="lineno"> 222</span>  {</div><div class="line"><a name="l00223"></a><span class="lineno"> 223</span>  std::this_thread::sleep_for(std::chrono::microseconds(1000));</div><div class="line"><a name="l00224"></a><span class="lineno"> 224</span>  ++count;</div><div class="line"><a name="l00225"></a><span class="lineno"> 225</span>  }</div><div class="line"><a name="l00226"></a><span class="lineno"> 226</span>  <span class="keywordflow">if</span> (m_EchoPackets)</div><div class="line"><a name="l00227"></a><span class="lineno"> 227</span>  {</div><div class="line"><a name="l00228"></a><span class="lineno"> 228</span>  std::cout << std::dec << <span class="stringliteral">"Wait command with timeout of "</span> << timeout << <span class="stringliteral">" microseconds completed. "</span> << std::endl;</div><div class="line"><a name="l00229"></a><span class="lineno"> 229</span>  }</div><div class="line"><a name="l00230"></a><span class="lineno"> 230</span> }</div><div class="ttc" id="classarmnn_1_1gatordmock_1_1_gatord_mock_service_html_a82bd11e044b4bc9c647fcaa9ce5b3e55"><div class="ttname"><a href="classarmnn_1_1gatordmock_1_1_gatord_mock_service.html#a82bd11e044b4bc9c647fcaa9ce5b3e55">armnn::gatordmock::GatordMockService::ReceiveThreadRunning</a></div><div class="ttdeci">bool ReceiveThreadRunning()</div><div class="ttdef"><b>Definition:</b> <a href="_gatord_mock_service_8hpp_source.html#l00092">GatordMockService.hpp:92</a></div></div> |
| 544 | </div><!-- fragment --> |
| 545 | </div> |
| 546 | </div> |
| 547 | <a id="a93617d8640d5e93831d06a2ef3c86bef"></a> |
| 548 | <h2 class="memtitle"><span class="permalink"><a href="#a93617d8640d5e93831d06a2ef3c86bef">◆ </a></span>WaitForReceivingThread()</h2> |
| 549 | |
| 550 | <div class="memitem"> |
| 551 | <div class="memproto"> |
| 552 | <table class="memname"> |
| 553 | <tr> |
| 554 | <td class="memname">void WaitForReceivingThread </td> |
| 555 | <td>(</td> |
| 556 | <td class="paramname"></td><td>)</td> |
| 557 | <td></td> |
| 558 | </tr> |
| 559 | </table> |
| 560 | </div><div class="memdoc"> |
| 561 | <p>This is a placeholder method to prevent main exiting. It can be removed once the command handling code is added. </p> |
| 562 | |
| 563 | <p class="definition">Definition at line <a class="el" href="_gatord_mock_service_8cpp_source.html#l00166">166</a> of file <a class="el" href="_gatord_mock_service_8cpp_source.html">GatordMockService.cpp</a>.</p> |
| 564 | |
| 565 | <p class="reference">Referenced by <a class="el" href="_gatord_mock_tests_8cpp_source.html#l00105">BOOST_AUTO_TEST_CASE()</a>.</p> |
| 566 | <div class="fragment"><div class="line"><a name="l00167"></a><span class="lineno"> 167</span> {</div><div class="line"><a name="l00168"></a><span class="lineno"> 168</span>  <span class="comment">// The receiving thread may already have died.</span></div><div class="line"><a name="l00169"></a><span class="lineno"> 169</span>  <span class="keywordflow">if</span> (m_CloseReceivingThread != <span class="keyword">true</span>)</div><div class="line"><a name="l00170"></a><span class="lineno"> 170</span>  {</div><div class="line"><a name="l00171"></a><span class="lineno"> 171</span>  m_CloseReceivingThread.store(<span class="keyword">true</span>);</div><div class="line"><a name="l00172"></a><span class="lineno"> 172</span>  }</div><div class="line"><a name="l00173"></a><span class="lineno"> 173</span>  <span class="comment">// Check that the receiving thread is running</span></div><div class="line"><a name="l00174"></a><span class="lineno"> 174</span>  <span class="keywordflow">if</span> (m_ListeningThread.joinable())</div><div class="line"><a name="l00175"></a><span class="lineno"> 175</span>  {</div><div class="line"><a name="l00176"></a><span class="lineno"> 176</span>  <span class="comment">// Wait for the receiving thread to complete operations</span></div><div class="line"><a name="l00177"></a><span class="lineno"> 177</span>  m_ListeningThread.join();</div><div class="line"><a name="l00178"></a><span class="lineno"> 178</span>  }</div><div class="line"><a name="l00179"></a><span class="lineno"> 179</span> }</div></div><!-- fragment --> |
| 567 | </div> |
| 568 | </div> |
| 569 | <a id="ac07351dbc304681b2efd5df4958a6735"></a> |
| 570 | <h2 class="memtitle"><span class="permalink"><a href="#ac07351dbc304681b2efd5df4958a6735">◆ </a></span>WaitForStreamMetaData()</h2> |
| 571 | |
| 572 | <div class="memitem"> |
| 573 | <div class="memproto"> |
| 574 | <table class="memname"> |
| 575 | <tr> |
| 576 | <td class="memname">bool WaitForStreamMetaData </td> |
| 577 | <td>(</td> |
| 578 | <td class="paramname"></td><td>)</td> |
| 579 | <td></td> |
| 580 | </tr> |
| 581 | </table> |
| 582 | </div><div class="memdoc"> |
| 583 | <p>Once the connection is open wait to receive the stream meta data packet from the client. Reading this packet differs from others as we need to determine endianness. </p><dl class="section return"><dt>Returns</dt><dd>true only if a valid stream met data packet has been received. </dd></dl> |
| 584 | |
| 585 | <p class="definition">Definition at line <a class="el" href="_gatord_mock_service_8cpp_source.html#l00069">69</a> of file <a class="el" href="_gatord_mock_service_8cpp_source.html">GatordMockService.cpp</a>.</p> |
| 586 | |
| 587 | <p class="reference">References <a class="el" href="namespacearmnn_1_1gatordmock.html#a006732ecc1f16712db06bf622eb79651aefe19217ee8d2186e7bbecbf2f171eb9">armnn::gatordmock::BeWire</a>, <a class="el" href="namespacearmnn_1_1gatordmock.html#a006732ecc1f16712db06bf622eb79651ab2db365e5027e9a57988c7054e9bd6b7">armnn::gatordmock::LeWire</a>, <a class="el" href="_network_sockets_8cpp_source.html#l00060">armnnUtils::Sockets::Read()</a>, <a class="el" href="namespacearmnn_1_1gatordmock.html#aec1b34297cc8e184a2d3d2c6e20da955af44b1a9eb8e6ef1bea10617c1dfef07f">armnn::gatordmock::ReceivedData</a>, and <a class="el" href="namespacearmnn_1_1gatordmock.html#aec1b34297cc8e184a2d3d2c6e20da955a2855fc8ecb116f85a4b09600fd1cd75f">armnn::gatordmock::ReceivedHeader</a>.</p> |
| 588 | |
| 589 | <p class="reference">Referenced by <a class="el" href="_gatord_mock_tests_8cpp_source.html#l00105">BOOST_AUTO_TEST_CASE()</a>.</p> |
| 590 | <div class="fragment"><div class="line"><a name="l00070"></a><span class="lineno"> 70</span> {</div><div class="line"><a name="l00071"></a><span class="lineno"> 71</span>  <span class="keywordflow">if</span> (m_EchoPackets)</div><div class="line"><a name="l00072"></a><span class="lineno"> 72</span>  {</div><div class="line"><a name="l00073"></a><span class="lineno"> 73</span>  std::cout << <span class="stringliteral">"Waiting for stream meta data..."</span> << std::endl;</div><div class="line"><a name="l00074"></a><span class="lineno"> 74</span>  }</div><div class="line"><a name="l00075"></a><span class="lineno"> 75</span>  <span class="comment">// The start of the stream metadata is 2x32bit words, 0 and packet length.</span></div><div class="line"><a name="l00076"></a><span class="lineno"> 76</span>  uint8_t header[8];</div><div class="line"><a name="l00077"></a><span class="lineno"> 77</span>  <span class="keywordflow">if</span> (!ReadFromSocket(header, 8))</div><div class="line"><a name="l00078"></a><span class="lineno"> 78</span>  {</div><div class="line"><a name="l00079"></a><span class="lineno"> 79</span>  <span class="keywordflow">return</span> <span class="keyword">false</span>;</div><div class="line"><a name="l00080"></a><span class="lineno"> 80</span>  }</div><div class="line"><a name="l00081"></a><span class="lineno"> 81</span>  EchoPacket(<a class="code" href="namespacearmnn_1_1gatordmock.html#aec1b34297cc8e184a2d3d2c6e20da955a2855fc8ecb116f85a4b09600fd1cd75f">PacketDirection::ReceivedHeader</a>, header, 8);</div><div class="line"><a name="l00082"></a><span class="lineno"> 82</span>  <span class="comment">// The first word, stream_metadata_identifer, should always be 0.</span></div><div class="line"><a name="l00083"></a><span class="lineno"> 83</span>  <span class="keywordflow">if</span> (ToUint32(&header[0], <a class="code" href="namespacearmnn_1_1gatordmock.html#a006732ecc1f16712db06bf622eb79651aefe19217ee8d2186e7bbecbf2f171eb9">TargetEndianness::BeWire</a>) != 0)</div><div class="line"><a name="l00084"></a><span class="lineno"> 84</span>  {</div><div class="line"><a name="l00085"></a><span class="lineno"> 85</span>  std::cerr << <span class="stringliteral">": Protocol error. The stream_metadata_identifer was not 0."</span> << std::endl;</div><div class="line"><a name="l00086"></a><span class="lineno"> 86</span>  <span class="keywordflow">return</span> <span class="keyword">false</span>;</div><div class="line"><a name="l00087"></a><span class="lineno"> 87</span>  }</div><div class="line"><a name="l00088"></a><span class="lineno"> 88</span> </div><div class="line"><a name="l00089"></a><span class="lineno"> 89</span>  uint8_t pipeMagic[4];</div><div class="line"><a name="l00090"></a><span class="lineno"> 90</span>  <span class="keywordflow">if</span> (!ReadFromSocket(pipeMagic, 4))</div><div class="line"><a name="l00091"></a><span class="lineno"> 91</span>  {</div><div class="line"><a name="l00092"></a><span class="lineno"> 92</span>  <span class="keywordflow">return</span> <span class="keyword">false</span>;</div><div class="line"><a name="l00093"></a><span class="lineno"> 93</span>  }</div><div class="line"><a name="l00094"></a><span class="lineno"> 94</span>  EchoPacket(<a class="code" href="namespacearmnn_1_1gatordmock.html#aec1b34297cc8e184a2d3d2c6e20da955af44b1a9eb8e6ef1bea10617c1dfef07f">PacketDirection::ReceivedData</a>, pipeMagic, 4);</div><div class="line"><a name="l00095"></a><span class="lineno"> 95</span> </div><div class="line"><a name="l00096"></a><span class="lineno"> 96</span>  <span class="comment">// Before we interpret the length we need to read the pipe_magic word to determine endianness.</span></div><div class="line"><a name="l00097"></a><span class="lineno"> 97</span>  <span class="keywordflow">if</span> (ToUint32(&pipeMagic[0], <a class="code" href="namespacearmnn_1_1gatordmock.html#a006732ecc1f16712db06bf622eb79651aefe19217ee8d2186e7bbecbf2f171eb9">TargetEndianness::BeWire</a>) == PIPE_MAGIC)</div><div class="line"><a name="l00098"></a><span class="lineno"> 98</span>  {</div><div class="line"><a name="l00099"></a><span class="lineno"> 99</span>  m_Endianness = <a class="code" href="namespacearmnn_1_1gatordmock.html#a006732ecc1f16712db06bf622eb79651aefe19217ee8d2186e7bbecbf2f171eb9">TargetEndianness::BeWire</a>;</div><div class="line"><a name="l00100"></a><span class="lineno"> 100</span>  }</div><div class="line"><a name="l00101"></a><span class="lineno"> 101</span>  <span class="keywordflow">else</span> <span class="keywordflow">if</span> (ToUint32(&pipeMagic[0], <a class="code" href="namespacearmnn_1_1gatordmock.html#a006732ecc1f16712db06bf622eb79651ab2db365e5027e9a57988c7054e9bd6b7">TargetEndianness::LeWire</a>) == PIPE_MAGIC)</div><div class="line"><a name="l00102"></a><span class="lineno"> 102</span>  {</div><div class="line"><a name="l00103"></a><span class="lineno"> 103</span>  m_Endianness = <a class="code" href="namespacearmnn_1_1gatordmock.html#a006732ecc1f16712db06bf622eb79651ab2db365e5027e9a57988c7054e9bd6b7">TargetEndianness::LeWire</a>;</div><div class="line"><a name="l00104"></a><span class="lineno"> 104</span>  }</div><div class="line"><a name="l00105"></a><span class="lineno"> 105</span>  <span class="keywordflow">else</span></div><div class="line"><a name="l00106"></a><span class="lineno"> 106</span>  {</div><div class="line"><a name="l00107"></a><span class="lineno"> 107</span>  std::cerr << <span class="stringliteral">": Protocol read error. Unable to read PIPE_MAGIC value."</span> << std::endl;</div><div class="line"><a name="l00108"></a><span class="lineno"> 108</span>  <span class="keywordflow">return</span> <span class="keyword">false</span>;</div><div class="line"><a name="l00109"></a><span class="lineno"> 109</span>  }</div><div class="line"><a name="l00110"></a><span class="lineno"> 110</span>  <span class="comment">// Now we know the endianness we can get the length from the header.</span></div><div class="line"><a name="l00111"></a><span class="lineno"> 111</span>  <span class="comment">// Remember we already read the pipe magic 4 bytes.</span></div><div class="line"><a name="l00112"></a><span class="lineno"> 112</span>  uint32_t metaDataLength = ToUint32(&header[4], m_Endianness) - 4;</div><div class="line"><a name="l00113"></a><span class="lineno"> 113</span>  <span class="comment">// Read the entire packet.</span></div><div class="line"><a name="l00114"></a><span class="lineno"> 114</span>  std::vector<uint8_t> packetData(metaDataLength);</div><div class="line"><a name="l00115"></a><span class="lineno"> 115</span>  <span class="keywordflow">if</span> (metaDataLength !=</div><div class="line"><a name="l00116"></a><span class="lineno"> 116</span>  boost::numeric_cast<uint32_t>(<a class="code" href="namespacearmnn_utils_1_1_sockets.html#a7b2c6949d9d76d2c0ffca916175e5322">Sockets::Read</a>(m_ClientConnection, packetData.data(), metaDataLength)))</div><div class="line"><a name="l00117"></a><span class="lineno"> 117</span>  {</div><div class="line"><a name="l00118"></a><span class="lineno"> 118</span>  std::cerr << <span class="stringliteral">": Protocol read error. Data length mismatch."</span> << std::endl;</div><div class="line"><a name="l00119"></a><span class="lineno"> 119</span>  <span class="keywordflow">return</span> <span class="keyword">false</span>;</div><div class="line"><a name="l00120"></a><span class="lineno"> 120</span>  }</div><div class="line"><a name="l00121"></a><span class="lineno"> 121</span>  EchoPacket(<a class="code" href="namespacearmnn_1_1gatordmock.html#aec1b34297cc8e184a2d3d2c6e20da955af44b1a9eb8e6ef1bea10617c1dfef07f">PacketDirection::ReceivedData</a>, packetData.data(), metaDataLength);</div><div class="line"><a name="l00122"></a><span class="lineno"> 122</span>  m_StreamMetaDataVersion = ToUint32(&packetData[0], m_Endianness);</div><div class="line"><a name="l00123"></a><span class="lineno"> 123</span>  m_StreamMetaDataMaxDataLen = ToUint32(&packetData[4], m_Endianness);</div><div class="line"><a name="l00124"></a><span class="lineno"> 124</span>  m_StreamMetaDataPid = ToUint32(&packetData[8], m_Endianness);</div><div class="line"><a name="l00125"></a><span class="lineno"> 125</span> </div><div class="line"><a name="l00126"></a><span class="lineno"> 126</span>  <span class="keywordflow">return</span> <span class="keyword">true</span>;</div><div class="line"><a name="l00127"></a><span class="lineno"> 127</span> }</div><div class="ttc" id="namespacearmnn_1_1gatordmock_html_a006732ecc1f16712db06bf622eb79651ab2db365e5027e9a57988c7054e9bd6b7"><div class="ttname"><a href="namespacearmnn_1_1gatordmock.html#a006732ecc1f16712db06bf622eb79651ab2db365e5027e9a57988c7054e9bd6b7">armnn::gatordmock::TargetEndianness::LeWire</a></div></div> |
| 591 | <div class="ttc" id="namespacearmnn_utils_1_1_sockets_html_a7b2c6949d9d76d2c0ffca916175e5322"><div class="ttname"><a href="namespacearmnn_utils_1_1_sockets.html#a7b2c6949d9d76d2c0ffca916175e5322">armnnUtils::Sockets::Read</a></div><div class="ttdeci">long Read(Socket s, void *buf, size_t len)</div><div class="ttdef"><b>Definition:</b> <a href="_network_sockets_8cpp_source.html#l00060">NetworkSockets.cpp:60</a></div></div> |
| 592 | <div class="ttc" id="namespacearmnn_1_1gatordmock_html_aec1b34297cc8e184a2d3d2c6e20da955af44b1a9eb8e6ef1bea10617c1dfef07f"><div class="ttname"><a href="namespacearmnn_1_1gatordmock.html#aec1b34297cc8e184a2d3d2c6e20da955af44b1a9eb8e6ef1bea10617c1dfef07f">armnn::gatordmock::PacketDirection::ReceivedData</a></div></div> |
| 593 | <div class="ttc" id="namespacearmnn_1_1gatordmock_html_aec1b34297cc8e184a2d3d2c6e20da955a2855fc8ecb116f85a4b09600fd1cd75f"><div class="ttname"><a href="namespacearmnn_1_1gatordmock.html#aec1b34297cc8e184a2d3d2c6e20da955a2855fc8ecb116f85a4b09600fd1cd75f">armnn::gatordmock::PacketDirection::ReceivedHeader</a></div></div> |
| 594 | <div class="ttc" id="namespacearmnn_1_1gatordmock_html_a006732ecc1f16712db06bf622eb79651aefe19217ee8d2186e7bbecbf2f171eb9"><div class="ttname"><a href="namespacearmnn_1_1gatordmock.html#a006732ecc1f16712db06bf622eb79651aefe19217ee8d2186e7bbecbf2f171eb9">armnn::gatordmock::TargetEndianness::BeWire</a></div></div> |
| 595 | </div><!-- fragment --> |
| 596 | </div> |
| 597 | </div> |
| 598 | <hr/>The documentation for this class was generated from the following files:<ul> |
| 599 | <li>tests/profiling/gatordmock/<a class="el" href="_gatord_mock_service_8hpp_source.html">GatordMockService.hpp</a></li> |
| 600 | <li>tests/profiling/gatordmock/<a class="el" href="_gatord_mock_service_8cpp_source.html">GatordMockService.cpp</a></li> |
| 601 | </ul> |
| 602 | </div><!-- contents --> |
| 603 | </div><!-- doc-content --> |
| 604 | <!-- start footer part --> |
| 605 | <div id="nav-path" class="navpath"><!-- id is needed for treeview function! --> |
| 606 | <ul> |
| 607 | <li class="navelem"><a class="el" href="namespacearmnn.html">armnn</a></li><li class="navelem"><a class="el" href="namespacearmnn_1_1gatordmock.html">gatordmock</a></li><li class="navelem"><a class="el" href="classarmnn_1_1gatordmock_1_1_gatord_mock_service.html">GatordMockService</a></li> |
| 608 | <li class="footer">Generated on Fri Mar 13 2020 16:07:05 for ArmNN by |
| 609 | <a href="http://www.doxygen.org/index.html"> |
| 610 | <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.8.13 </li> |
| 611 | </ul> |
| 612 | </div> |
| 613 | </body> |
| 614 | </html> |