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<H2>Syntax</H2>
14<dl><dd><pre class="construction">
15#include &lt;revolution/wpad.h&gt;
16
17#define WPAD_CHAN0                    0
18#define WPAD_CHAN1                    1
19#define WPAD_CHAN2                    2
20#define WPAD_CHAN3                    3
21
22#define WPAD_BATTERY_LEVEL_CRITICAL   0
23#define WPAD_BATTERY_LEVEL_LOW        1
24#define WPAD_BATTERY_LEVEL_MEDIUM     2
25#define WPAD_BATTERY_LEVEL_HIGH       3
26#define WPAD_BATTERY_LEVEL_MAX        4
27
28#define WPAD_LED_CHAN_1             0x1
29#define WPAD_LED_CHAN_2             0x2
30#define WPAD_LED_CHAN_3             0x4
31#define WPAD_LED_CHAN_4             0x8
32
33
34typedef struct WPADInfo
35{
36    BOOL dpd;
37    BOOL speaker;
38    BOOL attach;
39    BOOL lowBat;
40    BOOL nearempty;
41    u8 battery;
42    u8 led;
43    u8 protocol;
44    u8 firmware;
45}
46
47typedef void (*WPADCallback) ( s32 chan, s32 result );
48
49s32 WPADGetInfoAsync( s32 chan, WPADInfo *info, WPADCallback callback );
50</pre></dd></dl>
51
52<H2>Arguments</H2>
53<TABLE class="arguments" border="1" >
54  <TBODY>
55    <TR>
56<TH>chan</TH>
57<TD>One of the <code>WPAD_CHAN<i>n</i></code> values.</TD>
58    </TR>
59    <TR>
60<TH>info</TH>
61<TD>A pointer to <code>WPADInfo</code> that copies the obtained information.</TD>
62    </TR>
63    <TR>
64<TH>info</TH>
65<TD>Callback function to report on the result.</TD>
66    </TR>
67  </TBODY>
68</TABLE>
69
70<H2>Return Values</H2>
71<p>
72Returns one of the following codes:
73</p>
74<p>
75<code>WPAD_ERR_NONE</code><br>
76<code>WPAD_ERR_NO_CONTROLLER</code><br>
77<code>WPAD_ERR_BUSY</code><br>
78</P>
79
80<H2>Description</H2>
81<p>
82Gets 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.
83</p>
84<p>
85Can get the following status types.
86</p>
87<TABLE class="arguments" border="1" >
88<tr><th>dpd</th><td>The Pointer's operational status.</td>
89<tr><th>speaker</th><td>The speaker's operational status.</td>
90<tr><th>attach</th><td>External extension controller connection status.</td>
91<tr><th>lowBat</th><td>Whether the indicator brightness is dropping. Voltages that change the indicator brightness exhibit hysteresis. Note that the brightness will drop when the battery level reaches <code>WPAD_BATTERY_LEVEL_LOW</code>, but the brightness will not be restored immediately even if the battery level changes to <code>WPAD_BATTERY_LEVEL_MEDIUM</code> afterwards.</td>
92<tr><th>nearempty</th><td>Whether there is a small amount of audio data left in the sound buffer.</td>
93<tr><th>battery</th><td>The battery level, indicated on a scale of five (<code>WPAD_BATTERY_LEVEL_*</code>). Indicates how much battery charge currently remains.</td>
94<tr><th>led</th><td>The illumination status (<code>WPAD_LED_CHAN_*</code>) of the four Player Indicators.</td>
95<tr><th>protocol</th><td>Not used.</td>
96<tr><th>firmware</th><td>Not used.</td>
97</table>
98<p>
99The return values have the following meanings:
100</p>
101<TABLE class="arguments" border="1" >
102<tr><th>WPAD_ERR_NONE</th><td>The WPAD library received a command.</td>
103<tr><th>WPAD_ERR_BUSY</th><td>The WPAD library was unable to receive a command.</td>
104<tr><th>WPAD_ERR_NO_CONTROLLER</th><td>The connection was broken.</td>
105</table>
106<p>
107In 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:
108</p>
109<TABLE class="arguments" border="1" >
110<tr><th>WPAD_ERR_NONE</th><td>Status was retrieved normally.</td></tr>
111<tr><th>WPAD_ERR_BUSY</th><td>The WPAD library was unable to receive a command. Call it again later.</td></tr>
112<tr><th>WPAD_ERR_TRANSFER</th><td>A communications error prevented normal processing of the command.</td></tr>
113<tr><th>WPAD_ERR_NO_CONTROLLER</th><td>The connection was broken.</td></tr>
114</table>
115
116<H2>See Also</H2>
117<p class="reference">
118<A href="./WPADGetInfo.html">WPADGetInfo</A>,
119<A href="./WPADInfo.html">WPADInfo</A>
120</p>
121
122<H2>Revision History</H2>
123<p>
1242008/07/08 Added explanations related to <span class="argument">lowBat</span> and <span class="argument">battery</span>.<br>2007/09/18 Added <SPAN class="argument">nearempty</SPAN> to <CODE>WPADInfo</CODE>.<br>2006/11/29 Added <CODE>WPAD_ERR_BUSY</CODE>, which had been left out of the error codes passed by the callback.<br>2006/09/06 Added <CODE>WPAD_BATTERY_LEVEL_CRITICAL</CODE>.<br>2006/08/15 Added <CODE>WPADInfo</CODE> to See Also.<br>2006/06/19 Initial version.<br>
125</p>
126<hr><p>CONFIDENTIAL</p></body>
127</HTML>