1<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> 2<HTML> 3<HEAD> 4<META http-equiv="Content-Type" content="text/html; charset=windows-1252"> 5<META http-equiv="Content-Style-Type" content="text/css"> 6<LINK rel="stylesheet" type="text/css" href="../CSS/revolution.css"> 7<TITLE>WPADGetInfoAsync</TITLE> 8</HEAD> 9<BODY> 10 11<H1>WPADGetInfoAsync</H1> 12 13 14<H2>C Specification</H2> 15<DL> 16 <DD> 17<PRE><code>#include <revolution/wpad.h> 18 19#define WPAD_CHAN0 0 20#define WPAD_CHAN1 1 21#define WPAD_CHAN2 2 22#define WPAD_CHAN3 3 23 24#define WPAD_BATTERY_LEVEL_LOW 1 25#define WPAD_BATTERY_LEVEL_MEDIUM 2 26#define WPAD_BATTERY_LEVEL_HIGH 3 27#define WPAD_BATTERY_LEVEL_MAX 4 28 29#define WPAD_LED_CHAN_1 0x1 30#define WPAD_LED_CHAN_2 0x2 31#define WPAD_LED_CHAN_3 0x4 32#define WPAD_LED_CHAN_4 0x8 33 34 35typedef struct WPADInfo 36{ 37<table> 38<tr><td width="75"><code>BOOL</code></td><td><code> dpd;</code></td> 39<tr><td width="75"><code>BOOL</code></td><td><code> speaker;</code></td> 40<tr><td width="75"><code>BOOL</code></td><td><code> attach;</code></td> 41<tr><td width="75"><code>BOOL</code></td><td><code> lowBat;</code></td> 42<tr><td width="75"><code>u8</code></td><td><code> battery;</code></td> 43<tr><td width="75"><code>u8</code></td><td><code> led;</code></td> 44<tr><td width="75"><code>u8</code></td><td><code> protocol;</code></td> 45<tr><td width="75"><code>u8</code></td><td><code> firmware;</code></td> 46</table> 47} 48 49typedef void (*WPADCallback) ( s32 chan, s32 result ); 50 51s32 WPADGetInfoAsync( s32 chan, WPADInfo *info, WPADCallback callback ); 52</code></PRE> 53</DL> 54<H2>Arguments</H2> 55<TABLE border="1"> 56 <TBODY> 57 <TR> 58<TD><code><b><i>chan</i></b></code></TD> 59<TD>One of <code>WPAD_CHAN<i>n</i></code> values.</TD> 60 </TR> 61 <TR> 62<TD><code><b><i>info</i></b></code></TD> 63<TD>A pointer to <code>WPADInfo</code> that copies the obtained information.</TD> 64 </TR> 65 <TR> 66<TD><code><b><i>info</i></b></code></TD> 67<TD>Callback function to notify about the result.</TD> 68 </TR> 69 </TBODY> 70</TABLE> 71<H2>Return Values</H2> 72<p> 73Returns one of the following codes: 74</p> 75<p> 76<code>WPAD_ERR_NONE</code><br> <code>WPAD_ERR_NO_CONTROLLER</code><br> <code>WPAD_ERR_BUSY</code><br> 77</P> 78<H2>Description</H2> 79<p> 80Gets the status of the Wii Remote for the specified channel. This function registers the status-getting command in the WPAD library. The WPAD library processes registered commands when other commands are not running. 81</p> 82<p> 83Can get the following status types. 84<table border="1"> 85<tr><td><code>dpd</code></td><td><code>The pointer's operational status.</code></td> 86<tr><td><code>speaker</code></td><td><code>The speaker's operational status.</code></td> 87<tr><td><code>attach</code></td><td><code>External extension controller connection status.</code></td> 88<tr><td><code>lowBat</code></td><td><code>Whether the battery has fallen below a certain level.</code></td> 89<tr><td><code>battery</code></td><td>Expresses the battery level in four (<code>WPAD_BATTERY_LEVEL_*</code>) levels.</td> 90<tr><td><code>led</code></td><td>The illumination status (<code>WPAD_LED_CHAN_*</code>) of the four player indicators.</td> 91<tr><td><code>protocol</code></td><td><code>Not used.</code></td> 92<tr><td><code>firmware</code></td><td><code>Not used.</code></td> 93</table> 94</p> 95<p> 96The return values have the following meanings: 97<table border="1"> 98<tr><td><code>WPAD_ERR_NONE</code></td><td><code>The WPAD library received a command.</code></td> 99<tr><td><code>WPAD_ERR_BUSY</code></td><td><code>The WPAD library was unable to receive a command.</code></td> 100<tr><td><code>WPAD_ERR_NO_CONTROLLER</code></td><td><code>The connection was broken.</code></td> 101</table> 102</p> 103<p> 104In 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: 105<table border="1"> 106<tr><td><code>WPAD_ERR_NONE</code></td><td><code>Status was gotten normally.</code></td> 107<tr><td><code>WPAD_ERR_TRANSFER</code></td><td><code>A communications error prevented normal processing of the command.</code></td> 108<tr><td><code>WPAD_ERR_NO_CONTROLLER</code></td><td><code>The connection was broken.</code></td> 109</table> 110</p> 111 112<H2>See Also</H2> 113<p> 114<A href="./toc.html" target="contents"><CODE>WPAD</CODE> Functions</A><br> <A href="./WPADGetInfo.html"><CODE>WPADGetInfo</CODE></A><br> <A href="./WPADInfo.html"><CODE>WPADInfo</CODE></A><br> 115</p> 116 117<H2>Revision History</H2> 118<p> 11908/15/2006 Added a link to WPADInfo<BR>06/19/2006 Initial version<BR> 120</p> 121<hr> 122<P>CONFIDENTIAL</p> 123</BODY> 124</HTML>