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
17<h2>C Specification</h2>
18
19<dl>
20  <dd><pre><code>#include &lt;revolution/wpad.h&gt;
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_EXTGMK_OFF          0
28#define WPAD_EXTGMK_ON           1
29
30typedef void (*WPADCallback) ( s32 chan, s32 result );
31
32s32 WPADControlExtGimmick( s32 chan, u32 command, WPADCallback callback );</code></pre>
33  </dd>
34</dl>
35
36<h2>Arguments</h2>
37<TABLE border="1">
38  <TBODY>
39    <TR>
40<TD width="120" bgcolor="#ffffe8"><code><b><i>chan</i></b></code></TD>
41<TD>One of the <code>WPAD_CHAN<i>n</i></code> values.</TD>
42    </TR>
43    <TR>
44<TD width="120" bgcolor="#ffffe8"><CODE><b><i>pattern</i></b></CODE></TD>
45      <TD>Either <CODE>WPAD_EXTGMK_OFF</CODE> or <CODE>WPAD_EXTGMK_ON</CODE>.</TD>
46    </TR>
47    <TR>
48<TD width="120" bgcolor="#ffffe8"><CODE><b><i>callback</i></b></CODE></TD>
49<TD>Callback function to notify about the result. Notification processing is omitted if NULL is specified.</TD>
50    </TR>
51  </TBODY>
52</TABLE>
53<h2>Return Values</h2>
54<p>
55Returns one of the following codes:
56</p>
57<p>
58<code>WPAD_ERR_NONE</code><br> <code>WPAD_ERR_NO_CONTROLLER</code><br> <code>WPAD_ERR_BUSY</code><br>
59</P>
60<H2>Description</H2>
61<p>Controls the gimmicks of the External Extension Controller plugged into the specified Wii Remote.</p>
62<p>
63Commands 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.
64</p>
65<p>
66<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>
67</p>
68
69<ul>
70<li>Error Codes</li>
71</ul>
72<p>
73The return values have the following meanings:
74</p>
75<table border="1">
76<tr>
77<td><code>WPAD_ERR_NONE</code></td>
78<td>The WPAD library received a command.</td>
79</tr>
80<tr>
81<td><code>WPAD_ERR_BUSY</code></td>
82<td>The WPAD library was unable to receive a command. Call it again later.</td>
83</tr>
84<tr>
85<td><code>WPAD_ERR_NO_CONTROLLER</code></td>
86<td>The connection was broken.</td>
87</tr>
88</table>
89
90<ul>
91<li>Callbacks</li>
92</ul>
93<p>
94In 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:
95</p>
96<table border="1">
97<tr>
98<td><code>WPAD_ERR_NONE</code></td>
99<td>The command was processed normally.</td>
100</tr>
101<tr>
102<td><code>WPAD_ERR_BUSY</code></td>
103<td>The WPAD library was unable to receive a command. Call it again later.</td>
104</tr>
105<tr>
106<td><code>WPAD_ERR_TRANSFER</code></td>
107<td>A communication error prevented normal processing of the command.</td>
108</tr>
109<tr>
110<td><code>WPAD_ERR_NO_CONTROLLER</code></td>
111<td>The connection was broken.</td>
112</tr>
113</table>
114
115<h2>See Also</h2>
116<p>
117<A href="./toc.html" target="contents">WPAD Functions</A><br>
118</p>
119
120<H2>Revision History</H2>
121<P>
1222006/11/29 Initial version.
123</P>
124
125<hr>
126<P>CONFIDENTIAL</p>
127</BODY>
128</HTML>