1<!DOCTYPE HTML PUBLIC "-//W3C//Dtd HTML 4.01 Transitional//EN">
2<html>
3<head>
4<meta http-equiv="Content-Type" content="text/html; charset=windows-1252" />
5<meta http-equiv="Content-Style-Type" content="text/css" />
6<link rel="stylesheet" type="text/css" href="../CSS/rex.css" />
7<title>WDScanOnce</title>
8</head>
9<body>
10
11<h1>WDScanOnce</h1>
12
13<h2>C Specification</h2>
14<dl>
15  <dd><pre><code>#include &lt;revolution/wd/WDScan.h&gt;</code></pre>
16  </dd>
17  <dd><pre><code>WDError WDScanOnce( u16* <em>buf</em>,
18                    u16 <em>bufLen</em>,
19                    const <a href="WDScanParam.html">WDScanParam</a>* <em>param</em> );</code></pre>
20  </dd>
21</dl>
22
23<h2>Description</h2>
24<p>
25	Performs a wireless channel scan once.<br>The <CODE>WDScanOnce</CODE> blocks until the scan process, in conjunction with operation settings, is complete.
26</p>
27<h3>Scan Results</h3>
28<p>
29	The number of results found are stored in the first two bytes of the scan results buffer in <CODE>u16</CODE> format. From the third byte on, the basic service set (BSS) information continues without a break in the <CODE><a href="WDBssDesc.html">WDBssDesc</a></CODE> type. However, because each BSS's information is of variable length, it is necessary to calculate it using the <CODE><a href="WDBssDesc.html">WDBssDesc</a></CODE> structure's <CODE><strong><em>length</em></strong></CODE> field (itself two bytes in length) at the head of each consecutive BSS information segment.
30</p>
31
32<h2>Arguments</h2>
33<table border="1" cellpadding="3" cellspacing="0.1">
34	<tr>
35		<TH><em>buf</em></TH>
36		<TD>
37			Designates a pointer to the buffer that stores the information about the BSS information found as search results.
38			<P style="background-color:ffe8ff;padding-top:4px;padding-bottom:4px;padding-left:4px;padding-right:4px;">
39				<strong>Note: </strong>Due to hardware design, scan results must be stored in a <strong><font color=red>buffer made available in MEM2</font></strong>. In addition, if this buffer is not aligned to the data cache, it can damage unrelated adjacent buffers or be damaged itself. As such, specify the buffer with 32-byte borders at both its beginning and its end.
40			</P>
41		</TD>
42	</tr>
43	<tr>
44		<TH><em>bufLen</em></TH>
45		<TD>
46			Size of the buffer to store the scan results in bytes.
47		</TD>
48	</tr>
49	<tr>
50		<TH><em>param</em></TH>
51		<TD>
52			Pointer to the <CODE><a href="WDScanParam.html">WDScanParam</a></CODE> structure that performs that scan's operation settings.
53		</TD>
54	</tr>
55</table>
56
57<h2>Return Values</h2>
58<table border="1" cellpadding="3" cellspacing="0.1">
59	<tr>
60		<TH>WD_SUCCESS</TH>
61		<TD>Process was successful.</TD>
62	</tr>
63	<tr>
64		<TH>WD_ERR_FATAL</TH>
65		<TD>A fatal error occurred while running the firmware.</TD>
66	</tr>
67	<tr>
68		<TH>WD_ERR_ILLEGAL_PARAM</TH>
69		<TD>An operation setting specified in <CODE><strong><em>param</em></strong></CODE> was illegal.</TD>
70	</tr>
71	<tr>
72		<TH>WD_ERR_ILLEGAL_STATUS</TH>
73		<TD>A call from the exception handler.</TD>
74	</tr>
75	<tr>
76		<TH>WD_ERR_INPROGRESS</TH>
77		<TD>The firmware was not ready.</TD>
78	</tr>
79	<tr>
80		<TH>WD_ERR_EXCLUSIVE</TH>
81		<TD>The process failed because the WD library is exclusively controlled.</TD>
82	</tr>
83	<tr>
84		<TH>WD_ERR_INSUFFICIENT_BUF</TH>
85		<TD>Scan results could not be stored in the given buffer. BSS information is stored in the given buffer in the order in which it was found for as much as was possible.</TD>
86	</tr>
87</table>
88<P style="background-color:ffe8ff;padding-top:4px;padding-bottom:4px;padding-left:4px;padding-right:4px;">
89	<strong>Note: </strong>Errors may be added as the library is updated. With the exception of <CODE><strong>WD_ERR_INSUFFICIENT_BUF</strong></CODE>, handle all negative return values as general errors.
90</P>
91
92<h2>See Also</h2>
93<p>
94	<CODE><a href="WDCheckEnableChannel.html">WDCheckEnableChannel</a><br> <a href="WDScanParam.html">WDScanParam</a><br> <a href="WDBssDesc.html">WDBssDesc</a><br></CODE>
95</p>
96
97<h2>Revision History</h2>
98<p>
99	2006/12/12 Added description.<br>2006/11/09 Initial version.
100</p>
101<hr><p>CONFIDENTIAL</p></body>
102</html>
103