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>WPADGetLatestIndexInBuf</TITLE>
8</HEAD>
9<BODY>
10
11<H1>WPADGetLatestIndexInBuf</H1>
12
13
14<H2>C Specification</H2>
15<DL>
16  <DD>
17  <PRE><code>#include &lt;revolution/wpad.h&gt;
18
19#define WPAD_CHAN0               0
20#define WPAD_CHAN1               1
21#define WPAD_CHAN2               2
22#define WPAD_CHAN3               3
23
24u32 WPADGetLatestIndexInBuf ( s32 chan );
25</code></PRE>
26</DL>
27<H2>Arguments</H2>
28<TABLE border="1">
29  <TBODY>
30    <TR>
31      <TD width="120" bgcolor="#ffffe8"><code><b><i>chan</i></b></code></TD>
32      <TD>One of the <code>WPAD_CHAN<i>n</i></code> values.</TD>
33    </TR>
34  </TBODY>
35</TABLE>
36<H2>Return Values</H2>
37<P>Returns the index of the ring buffer where the most recent data is stored. If no data has been obtained yet, returns 0.</P>
38<H2>Description</H2>
39<p>
40Gets the index to the data last stored in the ring buffer for the Wii Remote for the specified channel.
41</p>
42<p>
43Be aware that this function's return value will also be cleared when the ring buffer is cleared in the following circumstances.
44</p>
45<ul>
46<li>Controller is connected</li>
47<li>Communication with the controller is lost</li>
48</ul>
49
50
51<H2>See Also</H2>
52<p>
53<A href="./toc.html" target="contents">WPAD Functions</A><br> <A href="./WPADSetAutoSamplingBuf.html"><CODE>WPADSetAutoSamplingBuf</CODE></A><br>
54</p>
55
56<H2>Revision History</H2>
57<p>
582006/10/05 Added mention that values are cleared when a controller is connected.<br> 2006/07/24 Removed statement that values are cleared when an external extension controller is plugged into or unplugged from the console.<br> 2005/10/20 Added note about behavior when no data has been obtained. Added <code>WPAD_CHAN<i>n</i></code> macros.<br> 2005/08/01 Initial version.
59
60</p>
61<hr>
62<P>CONFIDENTIAL</p>
63</BODY>
64</HTML>