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>WPADControlBLC</title> 10</head> 11 12<body> 13 14<h1>WPADControlBLC</h1> 15 16 17<h2>C Specification</h2> 18 19<dl> 20 <dd><pre><code>#include <revolution/wpadBalance.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_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 border="1"> 39 <TBODY> 40 <TR> 41<TD><code><b><i>chan</i></b></code></TD> 42<TD>Specify <code>WPAD_CHAN3</code> because Wii Balance Board accessorys connect to <code>WPAD_CHAN3</code>.</TD> 43 </TR> 44 <TR> 45<TD><CODE><b><i>command</i></b></CODE></TD> 46<TD>Either <code>WPAD_BLCMD_ON</code>, <code>WPAD_BLCMD_OFF</code>, or <code>WPAD_BLCMD_UPDATE_TEMP</code>.</TD> 47 </TR> 48 <TR> 49<TD><CODE><b><i>callback</i></b></CODE></TD> 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 Wii Balance Board accessory. 64</p> 65<p> 66This function registers Wii Balance Board accessory 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 border="1"> 75<tr> 76<td><code>WPAD_BLCMD_OFF</code></td> 77<td>Stops the Wii Balance Board accessory.</td> 78</tr> 79<tr> 80<td><code>WPAD_BLCMD_ON</code></td> 81<td>Starts the Wii Balance Board accessory.</td> 82</tr> 83<tr> 84<td><code>WPAD_BLCMD_UPDATE_TEMP</code></td> 85<td>Updates the temperature value for the Wii Balance Board accessory.</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 border="1"> 95<tr> 96<td><code>WPAD_ERR_NONE</code></td> 97<td>The WPAD library received the command.</td> 98</tr> 99<tr> 100<td><code>WPAD_ERR_BUSY</code></td> 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<td><code>WPAD_ERR_NO_CONTROLLER</code></td> 105<td>The connection was broken.</td> 106</tr> 107</table> 108 109<ul> 110<li>Callbacks</li> 111</ul> 112<p> 113In addition, if a callback function is set, the callback function returns the following error codes when its processing is complete. Their meanings are as follows: 114</p> 115<table border="1"> 116<tr> 117<td><code>WPAD_ERR_NONE</code></td> 118<td>The command was processed normally.</td> 119</tr> 120<tr> 121<td><code>WPAD_ERR_BUSY</code></td> 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<td><code>WPAD_ERR_TRANSFER</code></td> 126<td>A communication error prevented normal processing of the command.</td> 127</tr> 128<tr> 129<td><code>WPAD_ERR_NO_CONTROLLER</code></td> 130<td>The connection was broken.</td> 131</tr> 132</table> 133 134<h2>See Also</h2> 135<p> 136</p> 137 138<H2>Revision History</H2> 139<P> 1402007/11/15 Changed the device name to Wii Balance Board accessory. <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> 141</P> 142 143<hr><p>CONFIDENTIAL</p></body> 144</html>