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=utf-8"> 6<META name="GENERATOR" content="Microsoft FrontPage 5.0"> 7<META http-equiv="Content-Style-Type" content="text/css"> 8<LINK rel="stylesheet" type="text/css" href="../CSS/revolution.css"> 9<title>WPADControlMpls</title> 10</head> 11 12<body> 13 14<h1>WPADControlMpls</h1> 15 16 17<h2>Syntax</h2> 18 19<dl> 20 <dd><pre><code>#include <revolution/wpad.h> 21 22#define WPAD_CHAN0 0 23#define WPAD_CHAN1 1 24#define WPAD_CHAN2 2 25#define WPAD_CHAN3 3 26 27#define WPAD_MPLS_OFF 0 28#define WPAD_MPLS_STD 4 29#define WPAD_MPLS_EXP 5 30#define WPAD_MPLS_FS 5 31#define WPAD_MPLS_CL 7 32#define WPAD_MPLS_ZRST 128 33 34typedef void (*WPADCallback) ( s32 chan, s32 result ); 35 36s32 WPADControlMpls( s32 chan, u8 command, WPADCallback callback );</code></pre> 37 </dd> 38</dl> 39 40<h2>Arguments</h2> 41<TABLE class="arguments" border="1"> 42 <TBODY> 43 <TR> 44 <TD><code><b><i>chan</i></b></code></TD> 45 <TD>One of the <code>WPAD_CHAN<i>n</i></code> values.</TD> 46 </TR> 47 <TR> 48 <TD><CODE><b><i>command</i></b></CODE></TD> 49 <TD><code><CODE>WPAD_MPLS_OFF</CODE>, <CODE>WPAD_MPLS_STD</CODE>, or <CODE>WPAD_MPLS_EXP</CODE>.</code></TD> 50 </TR> 51 <TR> 52 <TD><CODE><b><i>callback</i></b></CODE></TD> 53 <TD>Callback function to report the result. Notification processing is omitted if <CODE>NULL</CODE> is specified.</TD> 54 </TR> 55 </TBODY> 56</TABLE> 57<h2>Return Values</h2> 58<p> 59Returns one of the following codes: 60</p> 61<p> 62<code>WPAD_ERR_NONE</code><br> <code>WPAD_ERR_NO_CONTROLLER</code><br> <code>WPAD_ERR_BUSY</code><br> <code>WPAD_ERR_INVALID</code><br> 63</P> 64<H2>Description</H2> 65<p> 66<font color="red"><b>This function has been removed from use. Please use the KPAD library if you are using the Wii MotionPlus.</b></font> 67</p> 68<p> 69Controls the Wii MotionPlus connected to the Wii Remote on the specified channel. 70</p> 71<p> 72This function registers the Wii MotionPlus control commands in the WPAD library. The WPAD library processes registered commands when other commands are not running. 73</p> 74<ul> 75<li>Commands</li> 76</ul> 77<p> 78The different commands are defined as follows. 79</p> 80<table class="arguments" border="1"> 81<tr> 82<td><code>WPAD_MPLS_OFF</code></td> 83<td>Stop the Wii MotionPlus.</td> 84</tr> 85<tr> 86<td><code>WPAD_MPLS_STD</code></td> 87<td> 88Starts in a mode where the Wii MotionPlus is the only device running. While in this mode, the Wii console receives only Wii MotionPlus data even if a Nunchuk or other extension controller is plugged into the Wii MotionPlus. 89</td> 90</tr> 91<tr> 92<td><code>WPAD_MPLS_FS (old WPAD_MPLS_EXP)</code></td> 93<td> 94Starts in a mode where the Wii MotionPlus and the Nunchuk connected to it run simultaneously. While in this mode, if a Nunchuk is plugged into the Wii MotionPlus, the Wii console alternately receives Wii MotionPlus data and Nunchuk data. If an extension controller other than a Nunchuk is plugged in, the Wii console alternately receives Wii MotionPlus data and data that cannot be resolved by the Wii console. If no device is plugged into the Wii MotionPlus, only Wii MotionPlus data is received, as is the case with <code>WPAD_MPLS_STD</code>.<br> <font color="red">Note: If some device is attached, the sampling rate is half what it would be otherwise.</font> 95</td> 96</tr> 97<tr> 98<td><code>WPAD_MPLS_CL</code></td> 99<td> 100Starts in a mode where the Wii MotionPlus and the Classic Controller connected to it run simultaneously. While in this mode, if a Classic Controller is plugged into the Wii MotionPlus, the Wii console alternately receives Wii MotionPlus data and Classic Controller data. If an extension controller other than a Classic Controller is plugged in, the Wii console alternately receives Wii MotionPlus data and data that cannot be resolved by the Wii console. If no device is plugged into the Wii MotionPlus, only Wii MotionPlus data is received, as is the case with <code>WPAD_MPLS_STD</code>.<br> <font color="red">Note: If some device is attached, the sampling rate is half what it would be otherwise.</font> 101</td> 102</tr> 103<tr> 104<td><code>WPAD_MPLS_ZRST</code></td> 105<td> 106Resets the at-rest (zero-point) value of Wii MotionPlus hardware. Be sure to send this command when Wii MotionPlus values are stable. If values are unstable, the zero-point value sent may drift. 107</td> 108</tr> 109</table> 110<ul> 111<li>Error Codes</li> 112</ul> 113<p> 114The return values have the following meanings: 115</p> 116<table border="1"> 117<tr> 118<td><code>WPAD_ERR_NONE</code></td> 119<td>The WPAD library received a command.</td> 120</tr> 121<tr> 122<td><code>WPAD_ERR_BUSY</code></td> 123<td>The WPAD library was unable to receive a command. Call it again later.</td> 124</tr> 125<tr> 126<td><code>WPAD_ERR_NO_CONTROLLER</code></td> 127<td>The connection was broken.</td> 128</tr> 129<tr> 130<td><code>WPAD_ERR_NO_INVALID</code></td> 131<td>The command was incorrect. This error is returned when an attempt is made to do something like process <code>WPAD_MPLS_OFF</code> or <code>WPAD_MPLS_ZRST</code> while the Wii MotionPlus is stopped, or to process <code>WPAD_MPLS_STD</code>, <code>WPAD_MPLS_FS</code>, or <code>WPAD_MPLS_CL</code> while a Wii MotionPlus is running. This error is also returned when an attempt is made to process <code>WPAD_MPLS_CL</code> for the Wii MotionPlus PP2 because the PP2 does not yet support this command.</td> 132</tr> 133</table> 134 135<ul> 136<li>Callbacks</li> 137</ul> 138<p> 139When a callback function has been set, the callback function is called together with the processing result. When the return value is <code>WPAD_ERR_NONE</code>, the callback function is called when the process is completed. Otherwise, it is called before the function escapes. The following error codes are passed to the callback function. 140</p> 141<table border="1"> 142<tr> 143<td><code>WPAD_ERR_NONE</code></td> 144<td>The command was processed normally.</td> 145</tr> 146<tr> 147<td><code>WPAD_ERR_BUSY</code></td> 148<td>The WPAD library was unable to receive a command. Call it again later.</td> 149</tr> 150<tr> 151<td><code>WPAD_ERR_TRANSFER</code></td> 152<td>A Wii MotionPlus is not connected to the Wii Remote, or a communications error prevented the command from being processed properly.</td> 153</tr> 154<tr> 155<td><code>WPAD_ERR_NO_CONTROLLER</code></td> 156<td>The connection was broken.</td> 157</tr> 158<tr> 159<td><code>WPAD_ERR_NO_INVALID</code></td> 160<td>The command was incorrect. This error is returned when an attempt is made to do something like process <code>WPAD_MPLS_OFF</code> or <code>WPAD_MPLS_ZRST</code> while the Wii MotionPlus is stopped, or to process <code>WPAD_MPLS_STD</code>, <code>WPAD_MPLS_FS</code>, or <code>WPAD_MPLS_CL</code> while a Wii MotionPlus is running. This error is also returned when an attempt is made to process <code>WPAD_MPLS_CL</code> for the Wii MotionPlus PP2 because the PP2 does not yet support this command.</td> 161</tr> 162</table> 163 164<h2>See Also</h2> 165<p> 166</p> 167 168<H2>Revision History</H2> 169<P> 1702009/09/24 Explained the timing of the call to the callback function.<br> 2009/07/27 Explained that this has been made obsolete starting with SDK 3.3.<br> 2008/12/03 Added a description of <code>WPAD_MPLS_ZRST</code>. Revised the description of <code>PMIC_ERR_INVALID</code>.<br> 2008/09/30 Added a description of <code>WPAD_MPLS_FS</code> and <code>WPAD_MPLS_CL</code>.<br> 2008/07/18 Initial version. 171</P> 172 173<hr><p>CONFIDENTIAL</p></body> 174</html> 175