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>KPADRead</title>
8</head>
9
10<body>
11
12
13
14<h1>KPADRead</h1>
15
16
17<h2>C Specification</h2>
18
19<dl>
20<dd><pre><code>#include &lt;revolution/kpad.h&gt;</code></pre>
21  </dd>
22<dd><pre><CODE>s32 KPADRead( s32 chan, KPADStatus samplingBufs[], u32 length );</CODE></pre>
23  </dd>
24</dl>
25
26<h2>Arguments</h2>
27<p>
28<TABLE border="1">
29  <TBODY>
30    <TR>
31<TD><code><b><i>chan</i></b></code></TD>
32<TD>One of <code>WPAD_CHAN<i>n</i></code> values.</TD>
33    </TR>
34    <TR>
35<TD><CODE><b><i>samplingBufs</i></b></CODE></TD>
36<TD>Pointer to the <a href="./KPADStatus.html"><code>KPADStatus</code></a> structure.</TD>
37    </TR>
38    <TR>
39<TD><CODE><b><i>length</i></b></CODE></TD>
40<TD>Maximum number of data sets to store. This value cannot exceed <CODE>KPAD_MAX_READ_BUFS</CODE>.</TD>
41    </TR>
42  </TBODY>
43</TABLE>
44
45</p>
46
47<h2>Return Values</h2>
48<p>Returns the number of data sets actually stored.</p>
49<p>
50Note, however, that the buffer specified by <b><i>samplingBufs</i></b> may be used internally as a work area. Contents of the buffer may therefore be rewritten even if the return value is zero, and values stored in the buffer cannot be guaranteed. When the return value is zero, we recommend using the value obtained previously.
51</p>
52
53<p>
54Because the Wii console and Wii Remote use wireless communication, cases exist where signal interference in the surroundings would block any data being transmitted between prior and current calls, and the function would return zero. Even in these circumstances the Wii console and Wii Remote maintain their connection status, so <font color="red"><b>their connection status cannot be judged from the return value of this function.</b></font>To judge connection status, use the <a href="../wpad/WPADProbe.html"><code>WPADProbe</code></a> or <a href="../wpad/WPADSetConnectCallback.html"><code>WPADSetConnectCallback</code></a> function.
55</p>
56
57<H2>Description</H2>
58<p>
59This function reads data in the <a href="./KPADStatus.html"><CODE>KPADStatus</CODE></a> structure type for each controller channel. We have assumed that this function will be called for each game frame. The buffer specified by the argument stores, from newest to oldest, the data sampled from the time of the previous call to the time of the current call. (In other words, the newest data is always stored at the beginning of the buffer.) However, button information references only the most recent value when <a href="./KPADRead.html"><CODE>KPADRead</CODE></a> is called, and this value is copied to all current sampling buffers.
60</p>
61
62<h2>See Also</h2>
63<p>
64<code><a href="./KPADStatus.html">KPADStatus</a></code>
65</p>
66
67<H2>Revision History</H2>
68<P>
692007/08/27 Added passages to the effect that this function's return value cannot be used to judge connection status and to use prior obtained values when the return value is zero.<br>2006/10/25 Revised description to match KPAD version 2.<br>2006/08/xx Added a link under See Also.<br>2006/03/01 Initial version. <BR>
70</P>
71
72</body>
73</html>