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="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>WPADControlExtGimmick</title>
10</head>
11
12<body>
13
14<h1>WPADControlExtGimmick</h1>
15
16<h2>Syntax</h2>
17<dl><dd><pre class="construction">
18#include &lt;revolution/wpad.h&gt;
19
20#define WPAD_CHAN0               0
21#define WPAD_CHAN1               1
22#define WPAD_CHAN2               2
23#define WPAD_CHAN3               3
24
25#define WPAD_EXTGMK_OFF          0
26#define WPAD_EXTGMK_ON           1
27
28typedef void (*WPADCallback) ( s32 chan, s32 result );
29
30s32 WPADControlExtGimmick( s32 chan, u32 command, WPADCallback callback );
31</pre></dd></dl>
32
33<h2>Arguments</h2>
34<TABLE class="arguments" border="1" >
35  <TBODY>
36    <TR>
37<TH>chan</TH>
38<TD>One of the <code>WPAD_CHAN<i>n</i></code> values.</TD>
39    </TR>
40    <TR>
41<TH>command</TH>
42<TD>Either <code>WPAD_EXTGMK_OFF</code> or <code>WPAD_EXTGMK_ON</code>.</TD>
43    </TR>
44    <TR>
45<TH>callback</TH>
46<TD>Callback function to report on the result. When <code>NULL</code> is specified, notification processing is omitted.</TD>
47    </TR>
48  </TBODY>
49</TABLE>
50
51<h2>Return Values</h2>
52<p>
53Returns one of the following codes:
54</p>
55<p>
56<code>WPAD_ERR_NONE</code><br> <code>WPAD_ERR_NO_CONTROLLER</code><br> <code>WPAD_ERR_BUSY</code><br>
57</P>
58
59<H2>Description</H2>
60<p>Controls the gimmicks of the external extension controller connected to the specified Wii Remote.</p>
61<p>
62Commands for controlling the gimmicks of the external extension controller are registered in the WPAD library by this function. The WPAD library processes registered commands when other commands are not running.
63</p>
64<p>
65<font color="red"><b>This function is meant for controlling gimmicks in External Extension Controllers that may be developed in the future. The Nunchuk and Classic Controller do not have gimmicks, so calling this function for them does nothing.</b></font>
66</p>
67
68<ul>
69<li>Error Codes</li>
70</ul>
71<p>
72The return values have the following meanings:
73</p>
74<TABLE class="arguments" border="1" >
75<tr>
76<th>WPAD_ERR_NONE</th>
77<td>The WPAD library received a command.</td>
78</tr>
79<tr>
80<th>WPAD_ERR_BUSY</th>
81<td>The WPAD library was unable to receive a command. Wait a short time and call it again.</td>
82</tr>
83<tr>
84<th>WPAD_ERR_NO_CONTROLLER</th>
85<td>The connection was broken.</td>
86</tr>
87</table>
88
89<ul>
90<li>Callbacks</li>
91</ul>
92<p>
93In addition, if a callback function is set, the callback function returns the following error codes when the processing is complete. Their meanings are as follows:
94</p>
95<TABLE class="arguments" border="1" >
96<tr>
97<th>WPAD_ERR_NONE</th>
98<td>The command was processed normally.</td>
99</tr>
100<tr>
101<th>WPAD_ERR_BUSY</th>
102<td>The WPAD library was unable to receive a command. Wait a short time and call it again.</td>
103</tr>
104<tr>
105<th>WPAD_ERR_TRANSFER</th>
106<td>A communication error prevented normal processing of the command.</td>
107</tr>
108<tr>
109<th>WPAD_ERR_NO_CONTROLLER</th>
110<td>The connection was broken.</td>
111</tr>
112</table>
113
114<h2>See Also</h2>
115<p>
116None.
117</p>
118
119<H2>Revision History</H2>
120<P>
1212007/09/18 Corrected a name mismatch between the argument list and the Syntax.<BR>2006/11/29 Initial version.<br>
122</P>
123
124<hr><p>CONFIDENTIAL</p></body>
125</html>