1<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> 2<HTML> 3<HEAD> 4<META http-equiv="Content-Type" content="text/html; charset=windows-1252"> 5<META http-equiv="Content-Style-Type" content="text/css"> 6 <TITLE>MP API Introduction</TITLE> 7<LINK rel="stylesheet" type="text/css" href="../CSS/revolution.css"> 8</HEAD> 9<BODY> 10 11<H1>MP API Introduction</H1> 12 13<H2>Introduction</H2> 14<p> 15The MP API is a library used to implement DS Wireless Play and DS Download Play with the Nintendo DS system. Communication among Nintendo DS systems is implemented using a unique protocol known as MP communications. This library enables MP communication on the Wii. 16</p> 17<p> 18For more on MP communications, see the Wireless Communications Library Description in the Nintendo DS developer's kit, NITRO-SDK. 19</p> 20 21<H2>Differences with the NITRO-SDK Communications Library</H2> 22<p> 23Due to hardware and software limitations, the following differences with the NITRO-SDK WM library exists. 24</p> 25 26<ul> 27<li>Parent only.<BR>Wii can only be a parent in MP communications. 28</li> 29 30<li>Changes to initialization and ending functions.<BR>Combined the initialization functions <CODE>WM_Initialize</CODE>, <CODE>WM_StartParent</CODE>, and <CODE>WM_StartMP</CODE> into the <CODE>MPStartup</CODE> function.<BR>Similarly, the ending functions were brought together as MPCleanup. 31</li> 32 33<li>Port settings can be changed only before communication begins.<BR>To set the callbacks for each port, you need to call and complete the MPSetPortConfig function before calling the <CODE>MPStartup</CODE> function.<BR>Changes to callback settings cannot occur during communication. 34</li> 35 36<li>In addition, communication parameters can also be changed only before communication begins.<BR>The MP parameters, including the parent and child device's send capacities, the MP communication frequency, and so on, must be specified in advance in the MPConfig structure, an argument to the <CODE>MPStartup</CODE> function. 37</li> 38 39<li>Priorities are now parameters for each port.<BR>The WM library allows you to specify priorities for each piece of send data. However, in the MP library priorities are set at the port level.<BR>These are specified in the <CODE>MPSetPortConfig</CODE> function. 40</li> 41 42<li>A synchronous version of the send function is available.<BR>Although the WM library had only an asynchronous version of the send function, the MP library has both a synchronous version, <CODE>MPSend()</CODE>, and an asynchronous version, <CODE>MPSendAsync()</CODE>.<BR>The MPSend function does not return until an attempt is made to send the specified data. An AID bit row in the *restBits argument stores whether the send succeeded. 43</li> 44 45<li>The beacon's data settings function has been changed.<BR>The beacon's <CODE>UserGameInfo</CODE> is not updated by directly creating the <CODE>GameInfo</CODE> structure as before, but new data is set with the <CODE>MPSetUserInfo</CODE> function. That update is sent and reflected in the beacon by the <CODE>MPUpdateBeacon</CODE> function. 46</li> 47 48<li>The beacon's send notification has been eliminated.<BR>In its place, the synchronous <CODE>MPUpdateBeacon</CODE> function is returned from the function when the first beacon is sent after being called. The asynchronous <CODE>MPUpdateBeaconAsync</CODE> function similarly calls a callback when the first beacon is sent after being called. 49</li> 50 51<li>The method for getting the link level has changed.<BR>To get the child device's link level, call the specialized function <CODE>MPGetLinkLevel()</CODE>. 52</li> 53 54<li>The same disconnect notification is issued whether you disconnect yourself or the child device disconnects you.<BR>While WM library divides notifications by type, the same notification is issued in both cases with the MP library. The cause of disconnection can be determined by passing the reason value to the function macro <CODE>MP_IS_DISCONNECTED_FROM_MYSELF</CODE>. 55</li> 56 57<li>The number of available channels may be lower.<BR>In some countries the Wii may be able to use only channels 1 through 11, whereas the Nintendo DS can use channels 1 through 13.<BR>In that case, MP communication on the Wii can use only channels 1 and 7. 58</li> 59 60<li>Asynchronous functions take the <CODE>MPCallbackInfo</CODE> structure as an argument.<BR>The <CODE>MPCallbackInfo</CODE> structure must be passed as an argument when calling an asynchronous function so there is a work region for asynchronous processes. 61</li> 62 63<li>There is no way to determine the usage status of a wireless channel.<BR>There is no function corresponding to <CODE>WM_MeasureChannel()</CODE>. Instead, the appropriate channel is automatically selected by specifying <CODE>MP_CHANNEL_AUTO</CODE> for <CODE>MPConfig.channel</CODE>. 64</li> 65 66<li>There is no way to find a permitted channel.<BR>When a specified channel cannot be used, the <CODE>MPStartup</CODE> function fails with <CODE>MP_RESULT_NOT_ALLOWED</CODE>. Assign <CODE>MP_CHANNEL_AUTO</CODE> to <CODE>MPConfig.channel</CODE> so that the library selects the appropriate channel in normal applications. 67</li> 68 69<li>Threads are created internally.<BR>Four threads are created internally for the processing of MP communication.<br>Use <CODE>MPConfig.threadPriority</CODE> to specify the highest priority for this created group of threads. The threads can have one of four levels of priority, ranging from <CODE>threadPriority</CODE> to <CODE>threadPriority</CODE>+3. To enable MP communications to proceed in real time, specify a priority that is higher than the priority of the main thread. 70</li> 71 72<li>Callbacks are called with interrupts enabled.<br>The callbacks for asynchronous functions labeled with Async and for the Receive callbacks set by <CODE>MPSetPortConfig()</CODE> are called with interrupts enabled from the thread for callbacks created by the MP library. Note that you should not issue the call to the next callback until the processing has completed for the current callback.<br>Further note that some internal processes of MP communications wait for related callbacks to completely end. For the sake of stable MP communications, do not perform processes that take several milliseconds of time during a callback. 73</li> 74 75<li>Wii does not perform V-Blank synchronization with a child DS.<br>Because the parent Wii cannot change the V-Blank period, the MP communications timing is controlled independently of the parent's V-Blank cycle.<br>V-Blank synchronization between child DS systems connected to a parent Wii will occur without a problem.<br>Please be particularly aware that the Wii V-Blank and MP communications cycles will be completely different in PAL's 50Hz cycle. The MP communications timing will be off little by little even when the V-Blank cycle is 60Hz. 76</li> 77 78<li>If using sequential communications, we recommend connecting only eight children at the most.<br>If you are using sequential communications on ports 12 through 15, we recommend restricting the number of children that connect to the Wii to eight. When more than eight children are connected, there is no guarantee with sequential communications that data sent 'successfully' has actually arrived. 79</li> 80 81<li>Data Sharing functionality is provided by the MPDS library.<BR>The library that carries out Data Sharing is the MPDS library, which is separate from the MP library.<br>Unlike <CODE>WM_StepDataSharing</CODE> from the NITRO-SDK, the <CODE>MPDSStep</CODE> function for sharing data is provided as a synchronous function so data can be shared even when the V-Blank period of the Wii differs from that of the DS. The separately provided <CODE>MPDSTryStep</CODE> function can perform processing in the conventional way. 82</li> 83 84<li>It may not be possible to use notifications from a child device to a parent device if the former used an SSID at connection time. <br>When using firmware with a version of 35 or earlier, the parent device cannot get the value that is set for the <CODE>ssid</CODE> argument of the child device's <CODE>WM_StartConnect()</CODE> function. <CODE>MPPortCallbackInfo_Connected.ssidUserData</CODE> is always zeroed out. This restriction has been fixed in versions 36 and later. 85</li> 86 87<li>Unique modes do not exist that allow any <CODE>PollBitmap</CODE> operation.<BR>There are no modes corresponding to <CODE>minPollBmpMode</CODE> in the WM library. 88</li> 89 90<li>There is no special mode for sending just one packet.<br>There is no mode for sending just one packet in a single MP sequence, such as when <CODE>singlePacketMode</CODE> is specified in the WM library. 91</li> 92 93<li>WEP keys cannot be used.<BR>Although the WM library allows WEP key authentication at connection time only, this is not supported. 94</li> 95</ul> 96 97<H2>Revision History</H2> 98<P> 992007/11/28 Made corrections in notation.<br>2007/11/21 Revised text specific to SSID notifications.<br>2007/10/26 Made changes in line with implementation of the MPDS library.<br>2007/09/26 Made changes in line with implementation of MP library features.<br>2007/07/25 Added an explanation of the problem that relates to SSID notifications from child devices at connection time.<br>2007/01/29 Revised text specific to sequential communications.<br>2007/01/29 Indicated the lack of V-Blank synchronization among the Wii and the DS devices.<br>2006/07/19 Eliminated restrictions related to V-Blank synchronization.<br>2006/06/29 Initial version. 100</P> 101 102<hr><p>CONFIDENTIAL</p></body> 103</HTML> 104