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>Syntax</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 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> 60<code>WPAD_ERR_NO_CONTROLLER</code><br> 61<code>WPAD_ERR_BUSY</code><br> 62</P> 63<H2>Description</H2> 64<p> 65Controls the specified Wii Balance Board. 66</p> 67<p> 68This function registers Wii Balance Board control commands with the WPAD library. The WPAD library processes registered commands when other commands are not running. 69</p> 70<ul> 71<li>Commands</li> 72</ul> 73<p> 74The different commands are defined as follows. 75</p> 76<table class="arguments" border="1"> 77<tr> 78<TH>WPAD_BLCMD_OFF</TH> 79<td>Stops the Wii Balance Board.</td> 80</tr> 81<tr> 82<TH>WPAD_BLCMD_ON</TH> 83<td>Starts the Wii Balance Board.</td> 84</tr> 85<tr> 86<TH>WPAD_BLCMD_UPDATE_TEMP</TH> 87<td>Updates the temperature value for the Wii Balance Board.</td> 88</tr> 89</table> 90<ul> 91<li>Error Codes</li> 92</ul> 93<p> 94The return values have the following meanings: 95</p> 96<table class="arguments" border="1"> 97<tr> 98<TH>WPAD_ERR_NONE</TH> 99<td>The WPAD library received the command.</td> 100</tr> 101<tr> 102<TH>WPAD_ERR_BUSY</TH> 103<td>The WPAD library was unable to receive the command. Wait a short time and call the function again.</td> 104</tr> 105<tr> 106<TH>WPAD_ERR_NO_CONTROLLER</TH> 107<td>The connection was broken.</td> 108</tr> 109</table> 110 111<ul> 112<li>Callbacks</li> 113</ul> 114<p> 115In 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: 116</p> 117<table class="arguments" border="1"> 118<tr> 119<TH>WPAD_ERR_NONE</TH> 120<td>The command was processed normally.</td> 121</tr> 122<tr> 123<TH>WPAD_ERR_BUSY</TH> 124<td>The WPAD library was unable to receive the command. Wait a short time and call the function again.</td> 125</tr> 126<tr> 127<TH>WPAD_ERR_TRANSFER</TH> 128<td>A communication error prevented normal processing of the command.</td> 129</tr> 130<tr> 131<TH>WPAD_ERR_NO_CONTROLLER</TH> 132<td>The connection was broken.</td> 133</tr> 134</table> 135 136<h2>See Also</h2> 137<p> 138None. 139</p> 140 141<H2>Revision History</H2> 142<P> 1432007/09/11 Removed the command to obtain remaining battery power and added the command to obtain temperature. <br> 2007/05/31 Initial version.<br> 144</P> 145 146<hr><p>CONFIDENTIAL</p></body> 147</html>