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>WPADSetConnectCallback</TITLE>
9</HEAD>
10<BODY>
11
12<H1>WPADSetConnectCallback</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
25#define WPAD_ERR_NONE             0
26#define WPAD_ERR_NO_CONTROLLER   -1
27#define WPAD_ERR_BUSY            -2
28#define WPAD_ERR_TRANSFER        -3
29
30
31typedef void (* WPADConnectCallback )( s32 chan, s32 reason );
32
33WPADConnectCallback WPADSetConnectCallback( s32 chan, WPADConnectCallback callback );</code></PRE>
34</DL>
35<H2>Arguments</H2>
36<TABLE border="1">
37  <TBODY>
38    <TR>
39<TD><code><b><i>chan</i></b></code></TD>
40<TD>One of <code>WPAD_CHAN<i>n</i></code> values.</TD>
41    </TR>
42    <TR>
43<TD><CODE><b><i>callback</i></b></CODE></TD>
44      <TD>The callback function that notifies whether the Wii Remote for the specified channel was connected or disconnected.</TD>
45    </TR>
46  </TBODY>
47</TABLE>
48<H2>Return Values</H2>
49<P>Pointer to the most recently registered callback function.</P>
50<H2>Description</H2>
51<p>
52Registers the callback function that notifies whether the Wii Remote for the specified channel was connected or disconnected. If NULL is specified, no notifications are made until reset.
53</p>
54<p>
55When the Wii Remote is connected, <code>WPAD_ERR_NONE</code> is passed as the <code>result</code> argument that is passed to the callback function; at disconnection, <code>WPAD_ERR_NO_CONTROLLER</code> is passed.
56</p>
57<p>
58The callback functions registered with this function are not cleared when controllers are connected, disconnected or when an external controller is inserted or removed.
59</p>
60<H2>See Also</H2>
61<p>
62<A href="./toc.html" target="contents"><CODE>WPAD Functions</CODE></A><br>
63</p>
64
65<H2>Revision History</H2>
66<p>
6706/19/2006 Initial version.<BR>
68</p>
69</BODY>
70</HTML>