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<H2>Syntax</H2> 15<dl><dd><pre class="construction"> 16#include <revolution/wpad.h> 17 18#define WPAD_CHAN0 0 19#define WPAD_CHAN1 1 20#define WPAD_CHAN2 2 21#define WPAD_CHAN3 3 22 23#define WPAD_ERR_NONE 0 24#define WPAD_ERR_NO_CONTROLLER -1 25#define WPAD_ERR_BUSY -2 26 27typedef void (* WPADConnectCallback )( s32 chan, s32 reason ); 28 29WPADConnectCallback WPADSetConnectCallback( s32 chan, WPADConnectCallback callback ); 30</pre></dd></dl> 31 32<H2>Arguments</H2> 33<TABLE class="arguments" border="1" > 34 <TBODY> 35 <TR> 36<TH>chan</TH> 37<TD>One of the <code>WPAD_CHAN<i>n</i></code> values.</TD> 38 </TR> 39 <TR> 40<TH>callback</TH> 41<TD>The callback function that notifies whether the Wii Remote for the specified channel was connected or disconnected.</TD> 42 </TR> 43 </TBODY> 44</TABLE> 45 46<H2>Return Values</H2> 47<P>Pointer to the most recently registered callback function.</P> 48 49<H2>Description</H2> 50<p> 51Registers the callback function that gives notification when a Wii Remote or Wii Balance Board was connected or disconnected to the specified channel. If <CODE>NULL</CODE> is specified, no notifications are made until the callback is reset. 52</p> 53<p> 54When a Wii Remote or Wii Balance Board has been connected, the callback argument <SPAN class="argument">reason</SPAN> passes <code>WPAD_ERR_NONE</code> to the callback function; at disconnection, it passes <code>WPAD_ERR_NO_CONTROLLER</code>. 55</p> 56<p> 57The callback function registered through this function will be cleared by the <a href="./WPADInit.html"><code>WPADInit</code></a> function. However, it will not be cleared when the Wii controller is connected or reconnected or when an External Extension Controller is connected or removed. After the <a href="./WPADInit.html"><code>WPADInit</code></a> function has been called, the <a href="./WPADGetStatus.html"><code>WPADGetStatus</code></a> function can be called on <code>WPAD_STATE_SETUP</code>. To obtain the connection immediately after the library initialization with a callback, register a callback function at this time. 58</p> 59<p> 60Use the <A href="./WPADProbe.html"><code>WPADProbe</code></A> function to check whether a Wii Remote or a Wii Balance Board was connected. 61</p> 62 63<H2>See Also</H2> 64<p class="reference"> 65<a href="./WPADInit.html">WPADInit</a>, 66<a href="./WPADProbe.html">WPADProbe</a> 67</p> 68 69<H2>Revision History</H2> 70<p> 712008/04/16 Added description of the Wii Balance Board.<br>2006/10/23 Added a description for the connection event immediately after library initialization completes.<br>2006/09/18 Added mention of the fact that the function will be cleared after the <a href="./WPADInit.html"><code>WPADInit</code></a> function is called.<br>2006/06/19 Initial version.<br> 72</p> 73<hr><p>CONFIDENTIAL</p></body> 74</HTML>