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 http-equiv="Content-Style-Type" content="text/css">
7<LINK rel="stylesheet" type="text/css" href="../CSS/revolution.css">
8<title>MPConfig</title>
9</head>
10
11<body>
12
13<h1>MPConfig</h1>
14
15<h2>Definitions</h2>
16<dl><dd>
17<pre><code>
18#include &lt;revolution/mp.h&gt;
19
20typedef struct MPConfig
21{
22    void*       (*alloc)(u32 size);
23    void        (*free) (void* ptr);
24
25    OSPriority  threadPriority;
26
27    u32         mode;
28
29    u32         ggid;
30    u32         tgid;
31    u32         channel;
32
33    s32         lifeTime;
34
35    // for parent mode
36    u32         beaconPeriod;
37    u32         maxNodes;
38    u32         parentMaxSize;
39    u32         childMaxSize;
40    s32         entryFlag;
41    s32         multiBootFlag;
42
43    s32         frequency;
44
45    u32         userGameInfoLength;
46    u8          userGameInfo[ MP_GAMEINFO_USER_SIZE_MAX ];
47
48    // callback
49    MPIndicationCallback indicationCallbackFunction;
50
51    // portConfig
52    <a href="./MPPortConfig.html">MPPortConfig</a> portConfig[MP_PORT_MAX];
53
54} MPConfig;
55</code></pre>
56</dd></dl>
57
58<H2>Description</H2>
59<p>
60The MPConfig structure is used to store the MP communications configuration information.
61</p>
62<TABLE border="1">
63  <TBODY>
64      <tr>
65<th><strong>Member</strong></th>
66<th><strong>Description</strong></th>
67      </tr>
68    <TR>
69<td valign="top" width="120" bgcolor="#ffffe8"><em><strong>alloc</strong></em></td>
70<TD width="520">Function to allocate memory for use inside the library. This memory region must be created in <code>MEM2</code> so that the start position is aligned with a 32-byte boundary. Currently, memory is allocated by processing performed in <CODE><a href="./MPStartup.html">MPStartup</a></CODE>, using a fixed value of 65KB or less.</TD>
71    </TR>
72    <TR>
73<td valign="top" width="120" bgcolor="#ffffe8"><em><strong>free</strong></em></td>
74<TD width="520">Function to allocate memory for use inside the library.</TD>
75    </TR>
76    <TR>
77<td valign="top" width="120" bgcolor="#ffffe8"><em><strong>threadPriority</strong></em></td>
78<TD width="520">The priority level of the MPs working thread.<br>The MP library creates working threads with four levels of priority: <CODE>threadPriority</CODE> to <CODE>threadPriority</CODE>+3. To conduct MP communications in real time, you must specify a priority for the working thread that is higher than the priority of the main thread.</TD>
79    </TR>
80    <TR>
81<td valign="top" width="120" bgcolor="#ffffe8"><em><strong>mode</strong></em></td>
82<TD width="520">MP operation mode<br>Usually specified as <CODE>MP_MODE_PARENT</CODE></TD>
83    </TR>
84    <TR>
85<td valign="top" width="120" bgcolor="#ffffe8"><em><strong>ggid</strong></em></td>
86<TD width="520">Game Group ID (GGID) provided by Nintendo for each title with MP communications capability.</TD>
87    </TR>
88    <TR>
89<td valign="top" width="120" bgcolor="#ffffe8"><em><strong>tgid</strong></em></td>
90<TD width="520">16-bit ID that must be generated each time a parent is started.<br>An appropriate value is automatically assigned to <CODE>MP_TGID_AUTO</CODE>. </TD>
91    </TR>
92    <TR>
93<td valign="top" width="120" bgcolor="#ffffe8"><em><strong>channel</strong></em></td>
94<TD width="520">The wireless channel that will be used.<br>Normally you specify <CODE>MP_CHANNEL_AUTO</CODE>, and the appropriate channel is selected automatically. </TD>
95    </TR>
96    <TR>
97<td valign="top" width="120" bgcolor="#ffffe8"><em><strong>lifeTime</strong></em></td>
98<TD width="520">Time limit for disconnecting if no communication is received. Specified in milliseconds.<BR>If 0 is specified, the lifetime feature is disabled.<BR>Normally, <CODE>MP_LIFETIME_DEFAULT</CODE> (4000) is specified.</TD>
99    </TR>
100    <TR>
101<td valign="top" width="120" bgcolor="#ffffe8"><em><strong>beaconPeriod</strong></em></td>
102<TD width="520">The beacon period (in milliseconds).<br>Normally you specify <CODE>MP_BEACON_PERIOD_AUTO</CODE> to create and set an appropriate value. </TD>
103    </TR>
104    <TR>
105<td valign="top" width="120" bgcolor="#ffffe8"><em><strong>maxNodes</strong></em></td>
106<TD width="520">Maximum number of child devices that can connect (up to 15)</TD>
107    </TR>
108    <TR>
109<td valign="top" width="120" bgcolor="#ffffe8"><em><strong>parentMaxSize</strong></em></td>
110<TD width="520">Maximum send size for the parent device. (See the NITRO-SDK documentation for more on limitations here.)</TD>
111    </TR>
112    <TR>
113<td valign="top" width="120" bgcolor="#ffffe8"><em><strong>childMaxSize</strong></em></td>
114<TD width="520">Maximum send size for the child device. (See the NITRO-SDK documentation for more on limitations here.)</TD>
115    </TR>
116    <TR>
117<td valign="top" width="120" bgcolor="#ffffe8"><em><strong>entryFlag</strong></em></td>
118<TD width="520">1, if child connections are allowed; otherwise, 0<br>This can be changed after communication has started using the <a href="./MPSetEntryFlag.html">MPSetEntryFlag()</a> function. </TD>
119    </TR>
120    <TR>
121<td valign="top" width="120" bgcolor="#ffffe8"><em><strong>multiBootFlag</strong></em></td>
122<TD width="520">Must normally be set to 0 for the parent device.</TD>
123    </TR>
124    <TR>
125<td valign="top" width="120" bgcolor="#ffffe8"><em><strong>frequency</strong></em></td>
126<TD width="520">Represents the number of MP communications performed during a 16.7ms time interval (0 indicates continuous communication)<BR>1 is recommended for ordinary communication applications.</TD>
127    </TR>
128    <TR>
129<td valign="top" width="120" bgcolor="#ffffe8"><em><strong>userGameInfoLength</strong></em></td>
130<TD width="520">Length of the user region within GameInfo to be included on the beacon<BR><CODE>MP_GAMEINFO_USER_SIZE</CODE> (112 bytes) or less</TD>
131    </TR>
132    <TR>
133<td valign="top" width="120" bgcolor="#ffffe8"><em><strong>userGameInfo</strong></em></td>
134<TD width="520">Data for the user region within GameInfo to be included on the beacon</TD>
135    </TR>
136    <TR>
137<td valign="top" width="120" bgcolor="#ffffe8"><em><strong>indicationCallbackFunction</strong></em></td>
138<TD width="520">Callback for notification of indication<br> This callback can be set using <code><a href="./MPSetIndicationConfig.html">MPSetIndicationConfig()</a></code>. </TD>
139    </TR>
140    <TR>
141<td valign="top" width="120" bgcolor="#ffffe8"><em><strong>portConfig</strong></em></td>
142<TD width="520">Receive callback for port.<br> This callback can be set using <code><a href="./MPSetPortConfig.html">MPSetPortConfig()</a></code>. </TD>
143    </TR>
144  </TBODY>
145</TABLE>
146
147<h2>See Also</h2>
148<p>
149<code><a href="./MPStartup.html">MPStartup()</a></code>, <code><a href="./MPSetIndicationConfig.html">MPSetIndicationConfig()</a></code>, <code><a href="./MPSetPortConfig.html">MPSetPortConfig()</a></code>, <code><a href="./MPPortConfig.html">MPPortConfig</a></code>
150</p>
151
152<H2>Revision History</H2>
153<p>
1542007/10/26  Added text to clarify the priority of internally generated threads.<br>2007/10/04 Changed the required memory size from 32k to 64k.<br>2007/10/04 Added a description of <CODE>MP_BEACON_PERIOD_AUTO</CODE> to <CODE>beaconPeriod</CODE>.<br>2007/05/02 Added a description of <CODE>MP_CHANNEL_AUTO</CODE> to <CODE>channel</CODE>.<br>2006/11/23 Added a description of the memory size allocated by <CODE>alloc</CODE>.<br>2006/11/21 Added information regarding the 32-byte boundary restriction.<br>2006/11/13 Added description of <CODE>MEM2</CODE> limitation on <CODE>alloc</CODE>.<br>2006/06/29 Initial version.
155</p>
156
157<hr><p>CONFIDENTIAL</p></body>
158</html>
159