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<META name="GENERATOR" content="Microsoft FrontPage 5.0">
7<LINK rel="stylesheet" type="text/css" href="../CSS/revolution.css">
8<TITLE>WPADSetSamplingCallback</TITLE>
9</HEAD>
10<BODY>
11
12<H1>WPADSetSamplingCallback</H1>
13
14
15<H2>C Specification</H2>
16<DL>
17  <DD>
18<PRE><code>#include &lt;revolution/wpad.h&gt;
19
20#define WPAD_CHAN0               0
21#define WPAD_CHAN1               1
22#define WPAD_CHAN2               2
23#define WPAD_CHAN3               3
24
25typedef void (* WPADSamplingCallback )( s32 chan );
26
27WPADSamplingCallback WPADSetSamplingCallback( s32 chan, WPADSamplingCallback callback );</code></PRE>
28</DL>
29<H2>Arguments</H2>
30<TABLE border="1">
31  <TBODY>
32    <TR>
33<TD><code><b><i>chan</i></b></code></TD>
34<TD>One of <code>WPAD_CHAN<i>n</i></code> values.</TD>
35    </TR>
36    <TR>
37<TD><CODE><b><i>callback</i></b></CODE></TD>
38<TD>The callback function that indicates receipt of data from the Wii Remote.</TD>
39    </TR>
40  </TBODY>
41</TABLE>
42<H2>Return Values</H2>
43<P>Pointer to the most recently registered callback function.</P>
44<H2>Description</H2>
45<p>
46Registers the callback function that notifies the receipt of data by the Wii Remote Control at the specified channel. If NULL is specified, no notifications are made until reset.
47</p>
48<p>
49Although the Wii Remote sends data to the Wii Console approximately every five milliseconds, be sure to note that due to Wii hardware specifications, the registered callback function is not called at even intervals every 5 milliseconds, but rather is called at an interval of four milliseconds, then six milliseconds, then four milliseconds, then six milliseconds, and so on. Further note that the registered callback function is not always called at this interval due to the fact that the data frame from the Wii Remote may not be received by the Wii Console depending on ambient electromagnetic conditions.
50</p>
51<p>
52Note that the registered callback function is cleared in the following cases.
53<ul>
54<li>Communication with the controller is lost</li>
55</ul>
56</p>
57<p>
58In addition, the callback functions are not cleared when a controller is connected, so they can be registered in advance.
59</p>
60
61<H2>See Also</H2>
62<p>
63<A href="./toc.html" target="contents"><CODE>WPAD Functions</CODE></A><br>
64</p>
65
66<H2>Revision History</H2>
67<p>
6808/15/2006 Added a description of the time interval at which the callback function is called, and deleted that the callback is cleared when an External Extension Controller is connected or disconnected. Revised the sampling cycle to one of approximately 4ms.<BR>08/01/2005 Initial version.<br>
69</p>
70<hr>
71<P>CONFIDENTIAL</p>
72</BODY>
73</HTML>