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>WPADGetInfo</TITLE>
8</HEAD>
9<BODY>
10
11<H1>WPADGetInfo</H1>
12
13
14<H2>C Specification</H2>
15<DL>
16  <DD>
17  <PRE><code>#include &lt;revolution/wpad.h&gt;</CODE></PRE>
18  <DD>
19  <PRE><CODE>
20#define WPAD_CHAN0                    0
21#define WPAD_CHAN1                    1
22#define WPAD_CHAN2                    2
23#define WPAD_CHAN3                    3
24
25#define WPAD_BATTERY_LEVEL_CRITICAL   0
26#define WPAD_BATTERY_LEVEL_LOW        1
27#define WPAD_BATTERY_LEVEL_MEDIUM     2
28#define WPAD_BATTERY_LEVEL_HIGH       3
29#define WPAD_BATTERY_LEVEL_MAX        4
30
31#define WPAD_LED_CHAN_1             0x1
32#define WPAD_LED_CHAN_2             0x2
33#define WPAD_LED_CHAN_3             0x4
34#define WPAD_LED_CHAN_4             0x8
35
36
37typedef struct WPADInfo
38{
39<table>
40    <tr><td width="75"><code>BOOL</code></td><td><code> dpd;</code></td></tr>
41    <tr><td width="75"><code>BOOL</code></td><td><code> speaker;</code></td></tr>
42    <tr><td width="75"><code>BOOL</code></td><td><code> attach;</code></td></tr>
43    <tr><td width="75"><code>BOOL</code></td><td><code> lowBat;</code></td></tr>
44    <tr><td width="75"><code>u8</code></td><td><code>   battery;</code></td></tr>
45    <tr><td width="75"><code>u8</code></td><td><code>   led;</code></td></tr>
46    <tr><td width="75"><code>u8</code></td><td><code>   protocol;</code></td></tr>
47    <tr><td width="75"><code>u8</code></td><td><code>   firmware;</code></td></tr>
48</table>
49}
50
51s32 WPADGetInfo( s32 chan, WPADInfo *info );
52</code></PRE>
53</DL>
54<H2>Arguments</H2>
55<TABLE border="1">
56  <TBODY>
57    <TR>
58<TD width="120" bgcolor="#ffffe8"><code><b><i>chan</i></b></code></TD>
59<TD>One of the <code>WPAD_CHAN<i>n</i></code> values.</TD>
60    </TR>
61    <TR>
62<TD width="120" bgcolor="#ffffe8"><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  </TBODY>
66</TABLE>
67<H2>Return Values</H2>
68<p>
69Returns one of the following codes:
70</p>
71<p>
72<code>WPAD_ERR_NONE</code><br> <code>WPAD_ERR_NO_CONTROLLER</code><br> <code>WPAD_ERR_BUSY</code><br> <code>WPAD_ERR_TRANSFER</code>
73
74</P>
75<H2>Description</H2>
76<p>
77Gets the status of the Wii Remote for the specified channel. This function registers a status-requesting command to the WPAD library and waits for the WPAD library to complete its processes.
78</p>
79
80<p>
81Can get the following status types.
82</p>
83<table border="1">
84<tr><td><code>dpd</code></td><td>The pointer's operational status.</td>
85<tr><td><code>speaker</code></td><td>The speaker's operational status.</td>
86<tr><td><code>attach</code></td><td>External extension controller connection status.</td>
87<tr><td><code>lowBat</code></td><td>This indicates whether the battery charge has dropped below a certain level and the indicator has dimmed.</code></td>
88<tr><td><code>battery</code></td><td>The battery level, indicated on a scale of five (<code>WPAD_BATTERY_LEVEL_*</code>).</td>
89<tr><td><code>led</code></td><td>The illumination status (<code>WPAD_LED_CHAN_*</code>) of the four player indicators.</td>
90<tr><td><code>protocol</code></td><td>Not used.</td>
91<tr><td><code>firmware</code></td><td>Not used.</td>
92</table>
93<p>
94The return values have the following meanings:
95</p>
96<table border="1">
97<tr><td><code>WPAD_ERR_NONE</code></td><td>Status was retrieved normally.</td>
98<tr><td><code>WPAD_ERR_BUSY</code></td><td>The WPAD library was unable to receive a command.</td>
99<tr><td><code>WPAD_ERR_NO_CONTROLLER</code></td><td>The connection was broken.</td>
100<tr><td><code>WPAD_ERR_TRANSFER</code></td><td>A communications error prevented normal processing of the command.</td>
101</table>
102
103<H2>See Also</H2>
104<p>
105<A href="./toc.html" target="contents">WPAD Functions</A><br> <A href="./WPADGetInfoAsync.html"><CODE>WPADGetInfoAsync</code></a>, <a href="./WPADInfo.html"><code>WPADInfo</code></a><br>
106</p>
107
108<H2>Revision History</H2>
109<p>
1102006/09/06 Added WPAD_BATTERY_LEVEL_CRITICAL.<br>2006/08/15 Added a reference to WPADInfo.<br>2006/06/19 Initial version.<br>
111</p>
112<hr>
113<P>CONFIDENTIAL</p>
114</BODY>
115</HTML>