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>WPADSetExtensionCallback</TITLE> 9</HEAD> 10<BODY> 11 12<H1>WPADSetExtensionCallback</H1> 13 14 15<H2>C Specification</H2> 16<DL> 17 <DD> 18 <PRE><code>#include <revolution/wpad.h> 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_DEV_CORE 0 26#define WPAD_DEV_FREESTYLE 1 27#define WPAD_DEV_CLASSIC 2 28#define WPAD_DEV_FUTURE 251 29#define WPAD_DEV_NOT_SUPPORTED 252 30#define WPAD_DEV_NOT_FOUND 253 31#define WPAD_DEV_UNKNOWN 255 32 33typedef void (* WPADExtensionCallback )( s32 chan, s32 result ); 34 35WPADExtensionCallback WPADSetExtensionCallback( s32 chan, WPADExtensionCallback callback );</code></PRE> 36</DL> 37<H2>Arguments</H2> 38<TABLE border="1"> 39 <TBODY> 40 <TR> 41 <TD width="120" bgcolor="#ffffe8"><code><b><i>chan</i></b></code></TD> 42 <TD>One of the <code>WPAD_CHAN<i>n</i></code> values.</TD> 43 </TR> 44 <TR> 45 <TD width="120" bgcolor="#ffffe8"><CODE><b><i>callback</i></b></CODE></TD> 46 <TD>The callback function that notifies of an event when an External Extension Controller is inserted or removed.</TD> 47 </TR> 48 </TBODY> 49</TABLE> 50<H2>Return Values</H2> 51<P>Pointer to the most recently registered callback function.</P> 52<H2>Description</H2> 53<p> 54Registers the callback function that notifies events when an External Extension Controller is inserted into or removed from a Wii Remote at the specified channel. If NULL is specified, no notifications are made until reset. 55</p> 56<p> 57The device type is passed to the callback function's <code>result</code> argument. 58</p> 59<p> 60When an External Extension Controller is inserted, this callback is called twice. This is because it takes some time to recognize the device type of the inserted External Extension Controller. When an External Extension Controller is inserted, it is not immediately recognized and <code>WPAD_DEV_UNKNOWN</code> is returned with the callback. Once the device type is known, the callback is called again with the device type. If the Controller is disconnected during the recognition process, then <code>WPAD_DEV_NOT_FOUND</code> gets passed. 61</p> 62<p> 63When the External Extension Controller is removed, this callback is called once and returned with <code>WPAD_DEV_CORE</code>. 64</p> 65<p> 66Be aware that callback functions registered by using this function will be cleared in the following circumstances. 67</p> 68<ul> 69<li>Controller is connected</li> 70<li>Communication with the controller is lost</li> 71</ul> 72 73<H2>See Also</H2> 74<p> 75<A href="./toc.html" target="contents">WPAD Functions</A><br> 76</p> 77 78<H2>Revision History</H2> 79<p> 802006/10/05 Added mention that the callback function is cleared when a controller is connected.<br>2006/09/06 Added description of the case where WPAD_DEV_NOT_FOUND is passed.<br>2006/08/15 Deleted mention that the callback function is cleared when external extension controller is connected/disconnected.<br>2006/06/19 Initial version.<br> 81</p> 82<hr> 83<P>CONFIDENTIAL</p> 84</BODY> 85</HTML>