1<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
2<html>
3
4<head>
5<META http-equiv="Content-Type" content="text/html; charset=windows-1252">
6<META name="GENERATOR" content="IBM WebSphere Studio Homepage Builder Version 8.0.2.0 for Windows">
7<META http-equiv="Content-Style-Type" content="text/css">
8<title>WM_StartScan</title>
9<LINK rel="stylesheet" href="../../css/nitro.css" type="text/css">
10</head>
11
12<body>
13
14<h1 align="left">WM_StartScan <img src="../../image/NTR.gif"><img src="../../image/TWL.gif"></H1>
15<h2>Syntax</h2>
16<dl>
17  <dd><PRE><CODE>#include &lt;nitro/wm.h&gt;
18
19<A href="WMErrCode.html">WMErrCode</A> WM_StartScan( <A href="WMCallbackFunc.html">WMCallbackFunc</A> callback , const <A href="WMScanParam.html">WMScanParam</A>* param );
20</CODE></PRE></dd>
21</dl>
22
23<h2>Arguments</h2>
24<table border="1" width="100%">
25  <tbody>
26    <TR>
27      <TD width="200"><EM><STRONG><FONT face="Courier New">callback</FONT></STRONG></EM></TD>
28      <TD width="800">Designates the callback function to call when the asynchronous process completes. This callback is called from within the interrupt handler.</TD>
29    </TR>
30    <TR>
31      <TD width="200"><EM><STRONG><FONT face="Courier New">param</FONT></STRONG></EM></TD>
32      <TD width="800">Pointer to the structure that shows scan information.<BR>
33      <STRONG>Note:</STRONG> The ARM7 processor writes the scan result information directly to <code>param-&gt;scanBuf</code>, so you must pay careful attention to the cache.</TD>
34    </TR>
35  </tbody>
36</table>
37
38<h2>Return Values</h2>
39<p>Returns the results of the <CODE><A href="WMErrCode.html">WMErrCode</A></CODE> enumerated type process.</p>
40
41<H2>Description</H2>
42<P><font color="red">Use of this function is NOT recommended. </font>In a wireless environment with multiple access points and parents, this function sometimes requires several tens of seconds to find a parent. Instead of this function, consider using the <A href="WM_StartScanEx.html"><CODE>WM_StartScanEX</CODE></A> function, which can get multiple sets of beacon information all at once.</P>
43<P>Starts the scan for a parent This function is only executable when the WM is in either the <A href="wm_state_diagram.html"><code>IDLE</code></A> or <A href="wm_state_diagram.html"><code>SCAN</code></A> state. If the WM is in the <A href="wm_state_diagram.html"><code>IDLE</code></A> state, this function changes the state to <A href="wm_state_diagram.html"><code>SCAN</code></A>. If the return value is <code>WM_ERRCODE_OPERATING</code>, a callback is generated after the scanning process has started properly. The callback is also generated when the scan process has completed. One callback can obtain information for no more than one parent machine. To obtain information from several parent machines, this function must be called several times. However, by doing so, there may be a possibility of getting the information from the same parent machine. If a parent could not be found after completing the scan, a callback is generated to indicate that no parent was found. You may continuously call <code>WM_StartScan</code> without calling <A href="WM_EndScan.html"><CODE>WM_EndScan</CODE></A>. Basically, this function searches only the wireless channel specified by <em><strong><code>param</code></strong></em>. However, there is a possibility of picking up the parent information on neighboring channels. When searching for the parent on all channels, use <CODE><A href="WM_GetAllowedChannel.html">WM_GetAllowedChannel</A></CODE> to make a guess at the channels that the parent may be using, and then make the application search for it.</P>
44
45<h2>See Also</h2>
46<p><A href="WM_EndScan.html"><code>WM_EndScan</code></A>, <A href="WM_StartConnect.html"><code>WM_StartConnect</code></A>, <A href="WM_Disconnect.html"><code>WM_Disconnect</code></A>, <a href="WM_GetAllowedChannel.html"><code>WM_GetAllowedChannel</code></a></p>
47
48<H2>Revision History</H2>
49<P>
502007/10/04 Clearly noted that use of this function is not recommended.<BR>2005/06/08 Indicated that callbacks are called from the interrupt handler.<br>2004/10/22 Changed the return value type.<BR>2004/09/21 Made additions to Description.<BR>2004/08/10 Revised Description.<BR>2004/08/02 Standardized structure names.<BR>2004/07/29 Added to Description.<br>2004/07/23 Initial version.<BR>
51</P>
52<hr><p>CONFIDENTIAL</p></body>
53</html>
54