# WM_StartScanEx

## Syntax

      #include <nitro/wm.h>

      WMErrCode WM_StartScanEx( WMCallbackFunc callback , const WMScanExParam* param );

## Arguments

`callback` | Designates the callback function to call when the asynchronous process completes. This callback is called from within the interrupt handler.
`param` | Designates a pointer to the structure that shows detailed scan control information. Pay attention to the cache because the ARM7 directly writes scan results to param &rarr; scanBuf. Specify a 32-byte aligned memory region, because this parameter is invalidated when the callback occurs.

## Return Values

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

## Description

Starts searching for a parent device. This function allows for finer control over the scan operations than `WM_StartScan`. 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. Though information about multiple parent devices can be obtained with one call, it is not the case that information about all parent devices can be obtained. This function must be called several times in order to obtain the information about all parent devices, and sometimes identical parent device information will be obtained. If no parent could be found after completing the scan, a callback is generated. 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 parent devices on all channels, scan on the application side with `WM_GetAllowedChannel` once the channels with parent devices have been marked. Also, when multiple channels have been designated, the scans will each be performed in order from the lower-numbered channels for a fixed amount of time. However, at the point where no more empty space can be allocated in the buffer to store the next scan results, the continuous scan process will be terminated. Be aware that because of this termination, even if multiple channels have been assigned, there may be times that the larger-numbered channels are not scanned.

## Notes

For additional details about caching the data passed in arguments, see the Wireless Communication Library Manual (AboutWirelessManager.pdf).

## See Also

`WM_StartScan
WM_EndScan
WM_StartConnect
WM_Disconnect
WM_GetAllowedChannel`

## Revision History

2008/12/17 Added a note about the caching of data passed in arguments and limitations on arguments.
2005/06/08 Added the fact that the callback is called from the interrupt handler.
2005/02/21 Initial version.

CONFIDENTIAL