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_StartConnectEx</title>
9<LINK rel="stylesheet" href="../../css/nitro.css" type="text/css">
10</head>
11
12<body>
13
14<h1 align="left">WM_StartConnectEx&nbsp;<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_StartConnectEx(
20    <A href="WMCallbackFunc.html">WMCallbackFunc</A>  callback ,
21    const <A href="WMBssDesc.html">WMBssDesc</A>*  pInfo ,
22    const u8*         ssid ,
23    BOOL              powerSave ,
24    u16               authMode
25);
26</CODE></PRE></dd>
27</dl>
28
29<h2>Arguments</h2>
30<TABLE width="100%">
31  <tbody>
32    <TR>
33<TD width="200"><CODE>callback</CODE></TD>
34<TD width="800">Callback function to be called when the notification of the status for the asynchronous process is sent or when the asynchronous process completes. This callback is called from within the interrupt handler.</TD>
35    </TR>
36    <TR>
37<TD width="200"><CODE>pInfo</CODE></TD>
38<TD width="800">Information on the parent to be connected. <BR> Be sure to designate the structure obtained in <A href="WM_StartScan.html"><code>WM_StartScan</A> or <A href="WM_StartScanEx.html"><code>WM_StartScanEx</code></A> as is. Note that this structure entity will be forcibly cached.</TD>
39    </TR>
40    <TR>
41<TD width="200"><CODE>ssid</CODE></TD>
42<TD width="800">Child information, fixed at 24 bytes (<code>WM_SIZE_CHILD_SSID</code>), to be sent to the parent.<br />The specified data will be sent to the parent by the <A href="WMStartParentCallback.html">callback of <CODE>WM_StartParent</CODE></A>. If <CODE>NULL</CODE>, the 24 bytes of data will be set to all zeros.</TD>
43    </TR>
44    <TR>
45<TD width="200"><CODE>powerSave</CODE></TD>
46<TD width="800">Designate <CODE>TRUE</CODE> if the power-saving mode is being used or <CODE>FALSE</CODE> if the full-time response mode is being used. <BR> Normally, <CODE>TRUE</CODE> should be designated. FALSE should be assigned only when there is a need to perform relatively frequent data sending and receiving in infrastructure mode. If <CODE>FALSE</CODE> is designated, significantly more power will be consumed then in power-saving mode.</TD>
47    </TR>
48    <TR>
49<TD width="200"><CODE>authMode</CODE></TD>
50<TD width="800">Authentication mode. Normally, open system authentication (<code>WM_AUTHMODE_OPEN_SYSTEM</code>) should be designated. When designating shared-key authentication (<CODE>WM_AUTHMODE_SHARED_KEY</CODE>), authentication that uses WEP encryption will be performed, so a WEP key that is the same as that of the communication partner must be configured in advance of using a function such as <A href="WM_SetWEPKeyEx.html"><CODE>WM_SetWEPKeyEx</CODE></A>. No other values than these two can be designated.</TD>
51    </TR>
52   </tbody>
53</table>
54
55<h2>Return Values</h2>
56<p>Returns the results of the <A href="WMErrCode.html"><CODE>WMErrCode</CODE></A> enumerated type process.</p>
57
58<H2>Description</H2>
59<P>Initiates a connection process to a parent. When using infrastructure mode, etc., this function allows a finer degree of control over the connection operations than does <A href="WM_StartConnect.html"><CODE>WM_StartConnect</CODE></A>, but normally there is no need to use this. This function is executable only when the WM is in the <code>IDLE</code> state. If the return value for API is <code>WM_ERRCODE_OPERATING</code>, a callback is triggered when the connection process starts, the request is approved by the parent, and AID was allocated. The callback is also generated when the normal connection state could not be achieved after starting the connection process. When the connection is complete, the WM changes to the <code>CHILD</code> state. After the connection is established, the callback specified by this function is generated when the device is disconnected from the parent. The callback that was specified with this function is also generated if the beacon that was transmitted by the parent on a periodic basis was not received after a set period of time. If the connection process fails along the way and the callback is returned, it indicates that there is an error in the internal state, so try to call <A href="WM_Reset.html"><code>WM_Reset</code></A> before retrying <code>WM_StartConnectEx</code>.</P>
60
61<h2>Note</h2>
62<P>
63After calling this function, a callback will be generated when the connection as a child device completes as expected, but sometimes before the callback is generated a notification will be generated that shows that there was a beacon receive notification or a disconnect from the parent device. When performing an initialization process, etc., as the child device, perform it before this function is called rather than when the callback has been generated.<br><br> Because the API return value WM_ERRCODE_OVER_MAX_ENTRY sometimes occurs temporarily the instant another inappropriate child device without matching GGID or TGID connects to the parent, we recommend that you retry execution. <br>This problem can arise easily if another IPL child device arrives for a download connection based on the old beacon of the parent device, particularly in the case of connections made immediately before child device program boot during download play.
64</P>
65<P>The <CODE>pInfo</CODE> data is forcibly stored in the internal cache. To avoid overwriting surrounding memory regions, be sure to pass data that is 32-byte aligned.<BR>See the Wireless Communication Library Manual (AboutWirelessManager.pdf) for additional details.</P>
66<h2>See Also</h2>
67<P><A href="WM_StartConnect.html"><code>WM_StartConnect</code></A><BR> <A href="WM_StartScan.html"><code>WM_StartScan</code></A><BR> <A href="WM_EndScan.html"><code>WM_EndScan</code></A><BR> <A href="WM_Disconnect.html"><code>WM_Disconnect</code></A></P>
68
69<H2>Revision History</H2>
70<P>
712008/12/17 Added a note about how data passed in arguments is forcibly cached internally.<BR>2007/04/12 Added a note about <CODE>WM_ERRCODE_OVER_MAX_ENTRY</CODE>.<br>2005/06/08 Added the fact that the callback is called from the interrupt handler.<br>2005/03/02 Made addition to Description.<BR>2005/02/14 Initial version.<BR>
72</P>
73<hr><p>CONFIDENTIAL</p></body>
74</html>
75