# WM_StartScan

## C Specification

      #include <nitro/wm.h>

      WMErrCode WM_StartScan( WMCallbackFunc callback , const WMScanParam* param );

## Arguments

`callback` | Designates the callback function to call when the asynchronous process completes. This callback is called from within the interrupt handler.
param | Pointer to the structure that shows scan information. The ARM7 processor writes the scan result information directly to `param->scanBuf`.

## Return Values

Returns the results of the `WMErrCode` enumerated type process.

## Description

Starts the scan for a parent This function is only executable when the WM is in either the `IDLE` or `SCAN` state. If the WM is in the `IDLE` state, this function changes the state to `SCAN`. If the return value is `WM_ERRCODE_OPERATING`, 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 `WM_StartScan` without calling `WM_EndScan`. Basically, this function searches only the wireless channel specified by `param`. However, there is a possibility of picking up the parent information on neighboring channels. When searching for the parent on all channels, use `WM_GetAllowedChannel` to make a guess at the channels that the parent may be using, and then make the application search for it.

## See Also

`WM_EndScan`, `WM_StartConnect`, `WM_Disconnect`, `WM_GetAllowedChannel`

## Revision History

06/08/2005 Added statement about callbacks being called from the interrupt handler.
10/22/2004 Changed return value type.
09/21/2004 Added to Description.
08/10/2004 Revised Description.
08/02/2004 Standardized structure names.
07/29/2004 Added to Description
07/23/2004 Initial version

CONFIDENTIAL