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>WPADControlBLC</title>
10</head>
11
12<body>
13
14<h1>WPADControlBLC</h1>
15
16
17<h2>Syntax</h2>
18
19<dl>
20  <dd><pre><code>#include &lt;revolution/wpadBalance.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_BLCMD_ON            0xaa
28#define WPAD_BLCMD_OFF           0x55
29#define WPAD_BLCMD_UPDATE_TEMP   0x00
30
31typedef void (*WPADCallback) ( s32 chan, s32 result );
32
33s32 WPADControlBLC( s32 chan, u8 command, WPADCallback callback );</code></pre>
34  </dd>
35</dl>
36
37<h2>Arguments</h2>
38<TABLE class="arguments" border="1">
39  <TBODY>
40    <TR>
41<TH>chan</TH>
42<TD>One of the <code>WPAD_CHAN<i>n</i></code> values.</TD>
43    </TR>
44    <TR>
45<TH>command</TH>
46<TD><code>Either <code>WPAD_BLCMD_ON</code>, <code>WPAD_BLCMD_OFF</code>, or <code>WPAD_BLCMD_UPDATE_TEMP</code>.</code></TD>
47    </TR>
48    <TR>
49<TH>callback</TH>
50<TD>Callback function to notify about the result. Notification processing is omitted if NULL is specified.</TD>
51    </TR>
52  </TBODY>
53</TABLE>
54<h2>Return Values</h2>
55<p>
56Returns one of the following codes:
57</p>
58<p>
59<code>WPAD_ERR_NONE</code><br> <code>WPAD_ERR_NO_CONTROLLER</code><br> <code>WPAD_ERR_BUSY</code><br>
60</P>
61<H2>Description</H2>
62<p>
63Controls the specified Wii Balance Board.
64</p>
65<p>
66This function registers Wii Balance Board control commands with the WPAD library. The WPAD library processes registered commands when other commands are not running.
67</p>
68<ul>
69<li>Commands</li>
70</ul>
71<p>
72The different commands are defined as follows.
73</p>
74<table class="arguments" border="1">
75<tr>
76<TH>WPAD_BLCMD_OFF</TH>
77<td>Stops the Wii Balance Board.</td>
78</tr>
79<tr>
80<TH>WPAD_BLCMD_ON</TH>
81<td>Starts the Wii Balance Board.</td>
82</tr>
83<tr>
84<TH>WPAD_BLCMD_UPDATE_TEMP</TH>
85<td>Updates the temperature value for the Wii Balance Board.</td>
86</tr>
87</table>
88<ul>
89<li>Error Codes</li>
90</ul>
91<p>
92The return values have the following meanings:
93</p>
94<table class="arguments" border="1">
95<tr>
96<TH>WPAD_ERR_NONE</TH>
97<td>The WPAD library received the command.</td>
98</tr>
99<tr>
100<TH>WPAD_ERR_BUSY</TH>
101<td>The WPAD library was unable to receive the command. Wait a short time and call the function again.</td>
102</tr>
103<tr>
104<TH>WPAD_ERR_NO_CONTROLLER</TH>
105<td>The connection was broken.</td>
106</tr>
107</table>
108
109<ul>
110<li>Callbacks</li>
111</ul>
112<p>
113When 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.
114</p>
115<table class="arguments" border="1">
116<tr>
117<TH>WPAD_ERR_NONE</TH>
118<td>The command was processed normally.</td>
119</tr>
120<tr>
121<TH>WPAD_ERR_BUSY</TH>
122<td>The WPAD library was unable to receive the command. Wait a short time and call the function again.</td>
123</tr>
124<tr>
125<TH>WPAD_ERR_TRANSFER</TH>
126<td>A communication error prevented normal processing of the command.</td>
127</tr>
128<tr>
129<TH>WPAD_ERR_NO_CONTROLLER</TH>
130<td>The connection was broken.</td>
131</tr>
132</table>
133
134<h2>See Also</h2>
135<p>
136None.
137</p>
138
139<H2>Revision History</H2>
140<P>
1412009/09/24 Explained the timing of the call to the callback function.<br>2007/09/11 Removed the command to obtain remaining battery power and added the command to obtain temperature. <br> 2007/05/31 Initial version.<br>
142</P>
143
144<hr><p>CONFIDENTIAL</p></body>
145</html>