

#include <nitro/wm.h>
WMErrCode WM_StartScan( WMCallbackFunc callback , const WMScanParam* param );
| 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. Note: The ARM7 processor writes the scan result information directly to param->scanBuf, so you must pay careful attention to the cache. |
Returns the results of the WMErrCode enumerated type process.
Use of this function is NOT recommended. 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 WM_StartScanEX function, which can get multiple sets of beacon information all at once.
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.
WM_EndScan, WM_StartConnect, WM_Disconnect, WM_GetAllowedChannel
2007/10/04 Clearly noted that use of this function is not recommended.
2005/06/08 Indicated that callbacks are called from the interrupt handler.
2004/10/22 Changed the return value type.
2004/09/21 Made additions to Description.
2004/08/10 Revised Description.
2004/08/02 Standardized structure names.
2004/07/29 Added to Description.
2004/07/23 Initial version.
CONFIDENTIAL