summaryrefslogtreecommitdiff
path: root/docs/Driver/html/group__wifi__bypass__gr.html
blob: bd9de5ef7dca6ce6438d605fb92fdeca967db76b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<title>WiFi Bypass Mode</title>
<title>CMSIS-Driver: WiFi Bypass Mode</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="cmsis.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<script type="text/javascript" src="printComponentTabs.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript">
  $(document).ready(initResizable);
  $(window).load(resizeHeight);
</script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/javascript">
  $(document).ready(function() { searchBox.OnSelectItem(0); });
</script>
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 46px;">
  <td id="projectlogo"><img alt="Logo" src="CMSIS_Logo_Final.png"/></td>
  <td style="padding-left: 0.5em;">
   <div id="projectname">CMSIS-Driver
   &#160;<span id="projectnumber">Version 2.7.1</span>
   </div>
   <div id="projectbrief">Peripheral Interface for Middleware and Application Code</div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<div id="CMSISnav" class="tabs1">
    <ul class="tablist">
      <script type="text/javascript">
		<!--
		writeComponentTabs.call(this);
		//-->
      </script>
	  </ul>
</div>
<!-- Generated by Doxygen 1.8.6 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Main&#160;Page</span></a></li>
      <li><a href="pages.html"><span>Usage&#160;and&#160;Description</span></a></li>
      <li><a href="modules.html"><span>Reference</span></a></li>
      <li>
        <div id="MSearchBox" class="MSearchBoxInactive">
        <span class="left">
          <img id="MSearchSelect" src="search/mag_sel.png"
               onmouseover="return searchBox.OnSearchSelectShow()"
               onmouseout="return searchBox.OnSearchSelectHide()"
               alt=""/>
          <input type="text" id="MSearchField" value="Search" accesskey="S"
               onfocus="searchBox.OnSearchFieldFocus(true)" 
               onblur="searchBox.OnSearchFieldFocus(false)" 
               onkeyup="searchBox.OnSearchFieldChange(event)"/>
          </span><span class="right">
            <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
          </span>
        </div>
      </li>
    </ul>
  </div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
      <div id="nav-sync" class="sync"></div>
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
$(document).ready(function(){initNavTree('group__wifi__bypass__gr.html','');});
</script>
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
<a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(0)"><span class="SelectionMark">&#160;</span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark">&#160;</span>Data Structures</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark">&#160;</span>Files</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark">&#160;</span>Functions</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(4)"><span class="SelectionMark">&#160;</span>Variables</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(5)"><span class="SelectionMark">&#160;</span>Typedefs</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(6)"><span class="SelectionMark">&#160;</span>Enumerations</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(7)"><span class="SelectionMark">&#160;</span>Enumerator</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(8)"><span class="SelectionMark">&#160;</span>Macros</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(9)"><span class="SelectionMark">&#160;</span>Groups</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(10)"><span class="SelectionMark">&#160;</span>Pages</a></div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div class="header">
  <div class="summary">
<a href="#func-members">Functions</a>  </div>
  <div class="headertitle">
<div class="title">WiFi Bypass Mode<div class="ingroups"><a class="el" href="group__wifi__interface__gr.html">WiFi Interface</a></div></div>  </div>
</div><!--header-->
<div class="contents">

<p>Transfer Ethernet frames by WiFi module.  
<a href="#details">More...</a></p>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="func-members"></a>
Functions</h2></td></tr>
<tr class="memitem:ga678fa1aa06ca6aaa67c7eb7a7660730e"><td class="memItemLeft" align="right" valign="top">int32_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__wifi__bypass__gr.html#ga678fa1aa06ca6aaa67c7eb7a7660730e">ARM_WIFI_BypassControl</a> (uint32_t interface, uint32_t mode)</td></tr>
<tr class="memdesc:ga678fa1aa06ca6aaa67c7eb7a7660730e"><td class="mdescLeft">&#160;</td><td class="mdescRight">Enable or disable bypass (pass-through) mode. Transmit and receive Ethernet frames (IP layer bypassed and WiFi/Ethernet translation).  <a href="#ga678fa1aa06ca6aaa67c7eb7a7660730e">More...</a><br/></td></tr>
<tr class="separator:ga678fa1aa06ca6aaa67c7eb7a7660730e"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gac1da4619feaf62d0cc90cfe44642d16b"><td class="memItemLeft" align="right" valign="top">int32_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__wifi__bypass__gr.html#gac1da4619feaf62d0cc90cfe44642d16b">ARM_WIFI_EthSendFrame</a> (uint32_t interface, const uint8_t *frame, uint32_t len)</td></tr>
<tr class="memdesc:gac1da4619feaf62d0cc90cfe44642d16b"><td class="mdescLeft">&#160;</td><td class="mdescRight">Send Ethernet frame (in bypass mode only).  <a href="#gac1da4619feaf62d0cc90cfe44642d16b">More...</a><br/></td></tr>
<tr class="separator:gac1da4619feaf62d0cc90cfe44642d16b"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga1dbeb5528095af31a60560e0c48321d4"><td class="memItemLeft" align="right" valign="top">int32_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__wifi__bypass__gr.html#ga1dbeb5528095af31a60560e0c48321d4">ARM_WIFI_EthReadFrame</a> (uint32_t interface, uint8_t *frame, uint32_t len)</td></tr>
<tr class="memdesc:ga1dbeb5528095af31a60560e0c48321d4"><td class="mdescLeft">&#160;</td><td class="mdescRight">Read data of received Ethernet frame (in bypass mode only).  <a href="#ga1dbeb5528095af31a60560e0c48321d4">More...</a><br/></td></tr>
<tr class="separator:ga1dbeb5528095af31a60560e0c48321d4"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gab67442ff061d0c4311a7046bce8d0cd1"><td class="memItemLeft" align="right" valign="top">uint32_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__wifi__bypass__gr.html#gab67442ff061d0c4311a7046bce8d0cd1">ARM_WIFI_EthGetRxFrameSize</a> (uint32_t interface)</td></tr>
<tr class="memdesc:gab67442ff061d0c4311a7046bce8d0cd1"><td class="mdescLeft">&#160;</td><td class="mdescRight">Get size of received Ethernet frame (in bypass mode only).  <a href="#gab67442ff061d0c4311a7046bce8d0cd1">More...</a><br/></td></tr>
<tr class="separator:gab67442ff061d0c4311a7046bce8d0cd1"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Description</h2>
<p>Transfer Ethernet frames by WiFi module. </p>
<p>The <a class="el" href="group__wifi__bypass__gr.html">WiFi Bypass Mode</a> functions are an optional interface and enable the transmission of Ethernet frames with WiFi modules. The use of this interface requires that the IP stack is running on the microcontroller. The internal IP stack of the WiFi module is therefore not used, and this usually means that the <a class="el" href="group__wifi__socket__gr.html">WiFi Socket</a> functions can not be used. </p>
<h2 class="groupheader">Function Documentation</h2>
<a class="anchor" id="ga678fa1aa06ca6aaa67c7eb7a7660730e"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int32_t ARM_WIFI_BypassControl </td>
          <td>(</td>
          <td class="paramtype">uint32_t&#160;</td>
          <td class="paramname"><em>interface</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint32_t&#160;</td>
          <td class="paramname"><em>mode</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Enable or disable bypass (pass-through) mode. Transmit and receive Ethernet frames (IP layer bypassed and WiFi/Ethernet translation). </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">interface</td><td>Interface (0 = Station, 1 = Access Point) </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">mode</td><td><ul>
<li>value = 1: all packets bypass internal IP stack</li>
<li>value = 0: all packets processed by internal IP stack </li>
</ul>
</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>execution status<ul>
<li><a class="el" href="group__execution__status.html#ga85752c5de59e8adeb001e35ff5be6be7">ARM_DRIVER_OK</a> : Operation successful</li>
<li><a class="el" href="group__execution__status.html#ga2f627075447749bb368d3b768be107cb">ARM_DRIVER_ERROR</a> : Operation failed</li>
<li><a class="el" href="group__execution__status.html#ga2efa59e480d82697795439220e6884e4">ARM_DRIVER_ERROR_UNSUPPORTED</a> : Operation not supported</li>
<li><a class="el" href="group__execution__status.html#gac781d4b70ce17c4c2efe2db045be751c">ARM_DRIVER_ERROR_PARAMETER</a> : Parameter error (invalid interface or mode)</li>
</ul>
</dd></dl>
<p>The function <b>ARM_WIFI_BypassControl</b> enables or disables the WiFi bypass mode.</p>
<p>The WiFi Bypass mode can only be enabled, if there is a bypass mode supported in the WiFi driver. You can check this by checking the driver's capabilities.</p>
<dl class="section note"><dt>Note</dt><dd>Bypass mode is enabled by default if the module does not support the Socket interface.</dd></dl>
<p>The argument <em>mode</em> specifies the desired state of the WiFi Bypass mode, which is enabled or disabled.</p>
<p><b>Example:</b> </p>
<div class="fragment"><div class="line"><span class="keyword">extern</span> <a class="code" href="group__wifi__interface__gr.html#structARM__DRIVER__WIFI">ARM_DRIVER_WIFI</a> Driver_WiFi0;</div>
<div class="line"><span class="keyword">static</span> <a class="code" href="group__wifi__interface__gr.html#structARM__DRIVER__WIFI">ARM_DRIVER_WIFI</a> *wifi;</div>
<div class="line"><span class="keyword">static</span> <a class="code" href="group__eth__interface__gr.html#structARM__ETH__MAC__ADDR">ARM_ETH_MAC_ADDR</a> own_mac_address;</div>
<div class="line"> </div>
<div class="line"><span class="keyword">static</span> <span class="keywordtype">void</span> wifi_notify (uint32_t event, ,<span class="keywordtype">void</span> *arg) {</div>
<div class="line">  <span class="keywordflow">switch</span> (event)  {</div>
<div class="line">     :</div>
<div class="line">  }  </div>
<div class="line">}</div>
<div class="line"> </div>
<div class="line"><span class="keywordtype">void</span> initialize_wifi_bypass (<span class="keywordtype">void</span>) {</div>
<div class="line">  <a class="code" href="group__wifi__control__gr.html#structARM__WIFI__CAPABILITIES">ARM_WIFI_CAPABILITIES</a> capabilities;</div>
<div class="line"> </div>
<div class="line">  wifi = &amp;Driver_WiFi0;</div>
<div class="line">  capabilities = wifi-&gt;<a class="code" href="group__wifi__interface__gr.html#a1ced805656e067b5635f1af2292b69e1">GetCapabilities</a> ();</div>
<div class="line">  <span class="keywordflow">if</span> (capabilities.<a class="code" href="group__wifi__control__gr.html#adbcc47408fb8c50d262a3be535108186">bypass_mode</a> == 0) {</div>
<div class="line">    <span class="comment">// error handling </span></div>
<div class="line">  } </div>
<div class="line"> </div>
<div class="line">  <span class="comment">// Initialize and Power-on WiFi Interface</span></div>
<div class="line">  wifi-&gt;<a class="code" href="group__wifi__interface__gr.html#a99e597db8e61d0ff834561cb710e61ad">Initialize</a> ((capabilities.eth_rx_frame_event) ? wifi_notify : NULL);</div>
<div class="line">  wifi-&gt;<a class="code" href="group__wifi__interface__gr.html#aba8f1c8019af95ffe19c32403e3240ef">PowerControl</a> (<a class="code" href="Driver__Common_8h.html#ga47d6d7c31f88f3b8ae4aaf9d8444afa5abed52b77a9ce4775570e44a842b1295e">ARM_POWER_FULL</a>);</div>
<div class="line"> </div>
<div class="line">  <span class="comment">// populate own_mac_address with the address to use for station</span></div>
<div class="line">  wifi-&gt;<a class="code" href="group__wifi__interface__gr.html#a6b5e1c7fcea96ff13f6fd16d57c8b68f">SetOption</a>(0U, <a class="code" href="group__WiFi__option.html#gafefb0fe1e5cdfb71f7f8cc7606840865">ARM_WIFI_MAC</a>, &amp;own_mac_address, 6U);</div>
<div class="line"> </div>
<div class="line">  wifi-&gt;<a class="code" href="group__wifi__interface__gr.html#a18c6762aa46cec65b65135eaeadebf23">BypassControl</a> (0U, 1U); <span class="comment">// Enable bypass mode for station</span></div>
<div class="line">}</div>
</div><!-- fragment --> 
</div>
</div>
<a class="anchor" id="gac1da4619feaf62d0cc90cfe44642d16b"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int32_t ARM_WIFI_EthSendFrame </td>
          <td>(</td>
          <td class="paramtype">uint32_t&#160;</td>
          <td class="paramname"><em>interface</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const uint8_t *&#160;</td>
          <td class="paramname"><em>frame</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint32_t&#160;</td>
          <td class="paramname"><em>len</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Send Ethernet frame (in bypass mode only). </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">interface</td><td>Interface (0 = Station, 1 = Access Point) </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">frame</td><td>Pointer to frame buffer with data to send </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">len</td><td>Frame buffer length in bytes </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>execution status<ul>
<li><a class="el" href="group__execution__status.html#ga85752c5de59e8adeb001e35ff5be6be7">ARM_DRIVER_OK</a> : Operation successful</li>
<li><a class="el" href="group__execution__status.html#ga2f627075447749bb368d3b768be107cb">ARM_DRIVER_ERROR</a> : Operation failed</li>
<li><a class="el" href="group__execution__status.html#ga13c1123319c7b9a4735d63447f35116b">ARM_DRIVER_ERROR_BUSY</a> : Driver is busy</li>
<li><a class="el" href="group__execution__status.html#ga2efa59e480d82697795439220e6884e4">ARM_DRIVER_ERROR_UNSUPPORTED</a> : Operation not supported</li>
<li><a class="el" href="group__execution__status.html#gac781d4b70ce17c4c2efe2db045be751c">ARM_DRIVER_ERROR_PARAMETER</a> : Parameter error (invalid interface or NULL frame pointer)</li>
</ul>
</dd></dl>
<p>The function <b>ARM_WIFI_EthSendFrame</b> writes an <b>Ethernet frame</b> to the WiFi transmit buffer.</p>
<p>The WiFi bypass mode must be enabled by using the function <a class="el" href="group__wifi__bypass__gr.html#ga678fa1aa06ca6aaa67c7eb7a7660730e">ARM_WIFI_BypassControl</a> before a call to this function.</p>
<p>The frame data addressed by <em>frame</em> starts with MAC destination and ends with the last Payload data byte. The frame data is copied into the transmit buffer of the WiFi interface.</p>
<p>The maximum value for <em>len</em> is implied by the size restrictions of the Ethernet frame but is not verified. Using an invalid value for <em>len</em> may generate unpredicted results.</p>
<p><b>Example:</b> </p>
<div class="fragment"><div class="line">status = wifi-&gt;<a class="code" href="group__wifi__interface__gr.html#a2648d7e0d1c10c48923d8d20d99311ab">EthSendFrame</a> (0U, &amp;frame_data[0], frame_length);</div>
<div class="line"><span class="keywordflow">if</span> (status != <a class="code" href="group__execution__status.html#ga85752c5de59e8adeb001e35ff5be6be7">ARM_DRIVER_OK</a>)  {</div>
<div class="line">  <span class="comment">// error handling</span></div>
<div class="line">}</div>
</div><!-- fragment --> 
</div>
</div>
<a class="anchor" id="ga1dbeb5528095af31a60560e0c48321d4"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int32_t ARM_WIFI_EthReadFrame </td>
          <td>(</td>
          <td class="paramtype">uint32_t&#160;</td>
          <td class="paramname"><em>interface</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint8_t *&#160;</td>
          <td class="paramname"><em>frame</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint32_t&#160;</td>
          <td class="paramname"><em>len</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Read data of received Ethernet frame (in bypass mode only). </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">interface</td><td>Interface (0 = Station, 1 = Access Point) </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">frame</td><td>Pointer to frame buffer for data to read into </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">len</td><td>Frame buffer length in bytes </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>number of data bytes read or error code<ul>
<li>value &gt;= 0 : Number of data bytes read</li>
<li><a class="el" href="group__execution__status.html#ga2f627075447749bb368d3b768be107cb">ARM_DRIVER_ERROR</a> : Operation failed</li>
<li><a class="el" href="group__execution__status.html#ga2efa59e480d82697795439220e6884e4">ARM_DRIVER_ERROR_UNSUPPORTED</a> : Operation not supported</li>
<li><a class="el" href="group__execution__status.html#gac781d4b70ce17c4c2efe2db045be751c">ARM_DRIVER_ERROR_PARAMETER</a> : Parameter error (invalid interface or NULL frame pointer)</li>
</ul>
</dd></dl>
<p>The function <b>ARM_WIFI_EthReadFrame</b> reads an <b>Ethernet frame</b> from the WiFi interface in the bypass mode.</p>
<p>The <em>len</em> of the Ethernet frame can be checked using the function <a class="el" href="group__wifi__bypass__gr.html#gab67442ff061d0c4311a7046bce8d0cd1">ARM_WIFI_EthGetRxFrameSize</a>.</p>
<p>The frame data addressed by <em>frame</em> starts with MAC destination and ends with the last Payload data byte. The frame data is read from the receive buffer of the WiFi interface and the number of bytes written into the memory addressed by <em>frame</em> is returned. A negative return value indicates an error whereby the status code is defined with driver common return codes.</p>
<p>The function <a class="el" href="group__wifi__bypass__gr.html#ga1dbeb5528095af31a60560e0c48321d4">ARM_WIFI_EthReadFrame</a> may be called with <em>buf</em> = <span class="XML-Token">NULL</span> and <em>len</em> = <span class="XML-Token">0</span> to discard or release a frame. This is useful when an incorrect frame has been received or no memory is available to hold the Ethernet frame.</p>
<p><b>Example:</b> </p>
<div class="fragment"><div class="line">size = wifi-&gt;<a class="code" href="group__wifi__interface__gr.html#af7ecc54209ce3725037cb5c9629151cf">EthGetRxFrameSize</a> ();</div>
<div class="line"><span class="keywordflow">if</span> ((size &lt; 14) || (size &gt; 1514)) {    <span class="comment">// frame excludes CRC</span></div>
<div class="line">  wifi-&gt;<a class="code" href="group__wifi__interface__gr.html#a544ca40b7157efce5000cd83aa92f8a0">EthReadFrame</a> (NULL, 0);        <span class="comment">// Frame error, release it</span></div>
<div class="line">}</div>
<div class="line">len = wifi-&gt;ReadFrame (0U, &amp;frame_data[0], size);</div>
<div class="line"><span class="keywordflow">if</span> (len &lt; 0)  {</div>
<div class="line">  <span class="comment">// error handling</span></div>
<div class="line">}</div>
</div><!-- fragment --> 
</div>
</div>
<a class="anchor" id="gab67442ff061d0c4311a7046bce8d0cd1"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">uint32_t ARM_WIFI_EthGetRxFrameSize </td>
          <td>(</td>
          <td class="paramtype">uint32_t&#160;</td>
          <td class="paramname"><em>interface</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Get size of received Ethernet frame (in bypass mode only). </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">interface</td><td>Interface (0 = Station, 1 = Access Point) </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>number of bytes in received frame</dd></dl>
<p>The function <b>ARM_WIFI_EthGetRxFrameSize</b> returns the size of a received <b>Ethernet frame</b> in the bypass mode. This function can be called before <a class="el" href="group__wifi__bypass__gr.html#ga1dbeb5528095af31a60560e0c48321d4">ARM_WIFI_EthReadFrame</a> and retrieves the value <em>len</em>.</p>
<p>The frame size includes MAC destination and ends with the last Payload data byte. Value <span class="XML-Token">0</span> indicates that no Ethernet frame is available in the receive buffer. Values smaller than minimum size of Ethernet frame or larger than maximum size of Ethernet frame indicate an invalid frame which needs to be discarded by calling <a class="el" href="group__wifi__bypass__gr.html#ga1dbeb5528095af31a60560e0c48321d4">ARM_WIFI_EthReadFrame</a>.</p>
<p><b>Example:</b> </p>
<ul>
<li>see <a class="el" href="group__wifi__bypass__gr.html#ga1dbeb5528095af31a60560e0c48321d4">ARM_WIFI_EthReadFrame</a> </li>
</ul>

</div>
</div>
</div><!-- contents -->
</div><!-- doc-content -->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
  <ul>
    <li class="footer">Generated on Wed Jul 10 2019 15:20:32 for CMSIS-Driver Version 2.7.1 by Arm Ltd. All rights reserved.
	<!--
    <a href="http://www.doxygen.org/index.html">
    <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.8.6 
	-->
	</li>
  </ul>
</div>
</body>
</html>