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=utf-8"> 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<H2>Syntax</H2> 14<dl><dd><pre class="construction">#include <revolution/wpad.h> 15 16#define WPAD_CHAN0 0 17#define WPAD_CHAN1 1 18#define WPAD_CHAN2 2 19#define WPAD_CHAN3 3 20 21#define WPAD_BATTERY_LEVEL_CRITICAL 0 22#define WPAD_BATTERY_LEVEL_LOW 1 23#define WPAD_BATTERY_LEVEL_MEDIUM 2 24#define WPAD_BATTERY_LEVEL_HIGH 3 25#define WPAD_BATTERY_LEVEL_MAX 4 26 27#define WPAD_LED_CHAN_1 0x1 28#define WPAD_LED_CHAN_2 0x2 29#define WPAD_LED_CHAN_3 0x4 30#define WPAD_LED_CHAN_4 0x8 31 32 33typedef struct WPADInfo 34{ 35 BOOL dpd; 36 BOOL speaker; 37 BOOL attach; 38 BOOL lowBat; 39 BOOL nearempty; 40 u8 battery; 41 u8 led; 42 u8 protocol; 43 u8 firmware; 44} 45 46s32 WPADGetInfo( s32 chan, WPADInfo *info ); 47</pre></dd></dl> 48 49<H2>Arguments</H2> 50<TABLE class="arguments" border="1" > 51 <TBODY> 52 <TR> 53<TH>chan</TH> 54<TD>One of the <code>WPAD_CHAN<i>n</i></code> values.</TD> 55 </TR> 56 <TR> 57<TH>info</TH> 58<TD>A pointer to <code>WPADInfo</code> that copies the obtained information.</TD> 59 </TR> 60 </TBODY> 61</TABLE> 62 63<H2>Return Values</H2> 64<p> 65Returns one of the following codes: 66</p> 67<p> 68<code>WPAD_ERR_NONE</code><br> <code>WPAD_ERR_NO_CONTROLLER</code><br> <code>WPAD_ERR_BUSY</code><br> <code>WPAD_ERR_TRANSFER</code> 69 70</P> 71<H2>Description</H2> 72<p> 73Gets 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. 74</p> 75<p> 76<font color="red">Problems may arise if this function is called too frequently. For example, sound may not play from the Wii remote speaker. This function is also used by the HOME Menu library, so be particularly careful about calling this function when the HOME Menu is displayed.</font> 77</p> 78<p> 79Can get the following status types. 80</p> 81<TABLE class="arguments" border="1" > 82<tr><th>dpd</th><td>The Pointer's operational status.</td> 83<tr><th>speaker</th><td>The speaker's operational status.</td> 84<tr><th>attach</th><td>External extension controller connection status.</td> 85<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> 86<tr><th>nearempty</th><td>Whether there is a small amount of audio data left in the sound buffer.</td> 87<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> 88<tr><th>led</th><td>The illumination status (<code>WPAD_LED_CHAN_*</code>) of the four Player Indicators.</td> 89<tr><th>protocol</th><td>Not used.</td> 90<tr><th>firmware</th><td>Not used.</td> 91</table> 92<p> 93The return values have the following meanings: 94</p> 95<TABLE class="arguments" border="1" > 96<tr><th>WPAD_ERR_NONE</th><td>Status was retrieved normally.</td> 97<tr><th>WPAD_ERR_BUSY</th><td>The WPAD library was unable to receive a command.</td> 98<tr><th>WPAD_ERR_NO_CONTROLLER</th><td>The connection was broken.</td> 99<tr><th>WPAD_ERR_TRANSFER</th><td>A communications error prevented normal processing of the command.</td> 100</table> 101<p> 102<br><B>Note:</B><br> This function sometimes puts the current thread to sleep, so it cannot be called from callback functions. Refer to Interrupts and Callback Functions. 103</p> 104 105<H2>See Also</H2> 106<p class="reference"> 107<!--<A href="./toc.html" target="contents">WPAD関数</A>, --> <A href="./WPADGetInfoAsync.html">WPADGetInfoAsync</A><BR><a href="./WPADInfo.html">WPADInfo</a><BR><a href="../os/Interrupt/intro.html"><code>Interrupts and Callback Functions</code></a> 108</p> 109 110<H2>Revision History</H2> 111<p> 1122009/11/27 Added a caution regarding use while HOME menu is displaying.<br>2008/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>2007/09/11 Added a note related to Interrupts and Callback Functions.<br> 2006/09/06 Added <CODE>WPAD_BATTERY_LEVEL_CRITICAL</CODE>.<br>2006/08/15 Added <CODE>WPADInfo</CODE> to <B>See Also</B>.<br>2006/06/19 Initial version.<br> 113</p> 114<hr><p>CONFIDENTIAL</p></body> 115</HTML>