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.0.0 for Windows">
7<META http-equiv="Content-Style-Type" content="text/css">
8<title>WM_StartMP</title>
9<LINK rel="stylesheet" href="../../css/nitro.css" type="text/css">
10</head>
11
12<body>
13
14<h1 align="left">WM_StartMP <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_StartMP(
20        <A href="WMCallbackFunc.html">WMCallbackFunc</A>  callback ,
21        u16*            recvBuf ,
22        u16             recvBufSize ,
23        u16*            sendBuf ,
24        u16             sendBufSize ,
25        u16             mpFreq
26);
27</CODE></PRE></dd>
28</dl>
29
30<h2>Arguments</h2>
31<table border="1" width="100%">
32  <tbody>
33    <TR>
34      <TD width="200"><EM><STRONG><FONT face="Courier New">callback</FONT></STRONG></EM></TD>
35      <TD width="800">Specifies the 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>
36    </TR>
37    <TR>
38      <TD width="200"><EM><STRONG><FONT face="Courier New">recvBuf</FONT></STRONG></EM></TD>
39      <TD width="800">Receive data storage buffer that the SDK uses internally.
40      This value must be aligned to the 32-byte boundary.
41      Because the ARM7 processor writes directly to the buffer, be careful of coherency with the cache.</TD>
42    </TR>
43    <TR>
44      <TD width="200"><EM><STRONG><FONT face="Courier New">recvBufSize</FONT></STRONG></EM></TD>
45      <TD width="800">Size of the buffer that stores received data.
46      This value must be larger than the return value of <a href="WM_GetMPReceiveBufferSize.html"><code>WM_GetMPReceiveBufferSize</code></a>. This value must also be in multiples of 64 bytes.</TD>
47    </TR>
48    <TR>
49      <TD width="200"><EM><STRONG><FONT face="Courier New">sendBuf</FONT></STRONG></EM></TD>
50      <TD width="800">Send data storage buffer that the SDK uses internally.
51      This value must be aligned to the 32-byte boundary.
52      Because the ARM7 processor writes directly to the buffer, be careful of coherency with the cache.</TD>
53    </TR>
54    <TR>
55      <TD width="200"><EM><STRONG><FONT face="Courier New">sendBufSize</FONT></STRONG></EM></TD>
56      <TD width="800">Send data storage buffer size that the SDK uses internally.
57      This value must be larger than the return value of <A href="WM_GetMPSendBufferSize.html"><code>WM_GetMPSendBufferSize</code></a>. This value must also be in multiples of 32 bytes.</TD>
58    </TR>
59    <TR>
60      <TD width="200"><EM><STRONG><FONT face="Courier New">mpFreq</FONT></STRONG></EM></TD>
61      <TD width="800">Specifies how many times to perform MP communications in one frame.
62      If &quot;0&quot; is specified, the device enters the continuous communication mode.</TD>
63    </TR>
64  </tbody>
65</table>
66
67<h2>Return Values</h2>
68<p>Returns the results of the <CODE><A href="WMErrCode.html">WMErrCode</A></CODE> enumerated type process.</p>
69
70<H2>Description</H2>
71<P>Begins the MP mode. This function can be executed only if the WM is in either the <A href="wm_state_diagram.html">PARENT</A> state or the <A href="wm_state_diagram.html">CHILD</A> state. If the return value is <CODE>WM_ERRCODE_OPERATING</CODE>, a callback is generated after the MP mode change process is complete. The WM state changes to the appropriate <A href="wm_state_diagram.html"><code>MP_PARENT</code></A> or <A href="wm_state_diagram.html"><code>MP_CHILD</code></A> state. A callback is also generated when data is received through MP communication or when MP communication is complete. After entering the MP communication mode, the V-Blank synchronization process is executed automatically between connected devices. MP communication is attempted in each frame for the number of times that is specified by <em><strong><code>mpFreq</code></strong></em>. The number of attempts is not guaranteed and is dependent on the communication status. The maximum number of MP communication attempts that occur during a each frame varies with each communication parameter. <A href="WM_StartMPEx.html"><code>WM_StartMPEx</code></A> is a function that has similar features to <code>WM_StartMP</code> function. However, the use of the <code>WM_StartMP</code> function should be sufficient under normal circumstances.</P>
72
73<P>
74When a child performs MP communication, call <A href="WM_StartMP.html"><code>WM_StartMP</code></A> soon after the child connects to a parent using <A href="WM_StartConnect.html"><code>WM_StartConnect</code></A>. From the time the connection is established until <A href="WM_StartMP.html"><code>WM_StartMP</code></A> is called, the child does not respond to messages sent by the parent. When this status exceeds the parent CAM lifetime set by <a href="WM_SetLifeTime.html"><code>WM_SetLifeTime</code></a>, the child is disconnected from the parent.
75</P>
76
77<P>
78Also, do not continually call the <A href="WM_EndMP.html">WM_EndMP</A> function and the WM_StartMP function while connected with the goal of changing the MP communications parameters. MP communications internal information, such as Sequential communications information, will be initialized, so the consistency of communications before and afterwards will be lost. In order to change specific MP communications parameters such as MP communication frequency during MP communications, it is possible to use functions such as <A href="WM_SetMPFrequency.html">WM_SetMPFrequency</A> and <A href="WM_SetMPParameter.html">WM_SetMPParameter</A>.
79</P>
80
81<h2>See Also</h2>
82<p><CODE><A href="WM_StartMPEx.html">WM_StartMPEx</A>, <A href="WM_EndMP.html">WM_EndMP</A>, <A href="WM_SetMPDataToPort.html">WM_SetMPDataToPort</A>, <A href="WM_SetPortCallback.html">WM_SetPortCallback</A>, <A href="WM_SetMPFrequency.html">WM_SetMPFrequency</A>, <A href="WM_SetMPParameter.html">WM_SetMPParameter</A></CODE></p>
83
84<H2>Revision History</H2>
85<P>
862006/01/13 Added warnings related to changes in MP communications parameters during communications<BR> 2005/07/29 Corrected to reflect changes in conditions for generating a Null response<BR> 2005/06/08 Added text indicating the callback is called from the interrupt handler<br> 2004/11/09 Added explanation about Null response<BR> 2004/10/22 Changed return value types<BR> 2004/09/25 Added and revised descriptions<BR> 2004/08/18 Added sendBuf, sendBufSize, and mpFreq to arguments.<BR> 2004/08/11 Noted about callback when MP communications end<BR> 2004/08/02 Standardized structure names<BR> 2004/07/29 Added explanations etc.<BR> 2004/07/23 Initial Version<BR>
87</P>
88<hr><p>CONFIDENTIAL</p></body>
89</html>
90