#include <cafe/pads/wpad/wpad.h> #define WPAD_CHAN0 0 #define WPAD_CHAN1 1 #define WPAD_CHAN2 2 #define WPAD_CHAN3 3 #define WPAD_ERR_NONE 0 #define WPAD_ERR_NO_CONTROLLER -1 #define WPAD_ERR_BUSY -2 typedef void (* WPADConnectCallback )( s32 chan, s32 reason ); WPADConnectCallback WPADSetConnectCallback( s32 chan, WPADConnectCallback callback );
|chan||One of the
|callback||The callback function that notifies whether the Wii remote for the specified channel was connected or disconnected.|
Pointer to the most recently registered callback function.
Registers the callback function that provides notification when a Wii Remote or Wii Balance Board is connected or disconnected to the specified channel. If
NULL is specified, no notifications are made.
When a Wii remote or Wii Balance Board has been connected, the callback argument
WPAD_ERR_NONE to the callback function; at disconnection, it passes
The callback function registered through this function will be cleared by the
WPADInit function and so connection callbacks are typically registered shortly after
WPADInit (and it is requisite
WPADGetStatus readiness check) is called.
After a controller is connected, game applications can call
WPADProbe to get the connection status and device type of each controller. See
WPADProbe for a description of limitations about knowing the controller type.
To detect the insertion and removal of an external extension controller, use the
WPADSetExtensionCallback function to register a callback function for these events.
|Background||Do not call this function from the background.|
|Interrupt handler||Do not call this function from any interrupt handler.|
|Exception handler||Do not call this function from any exception handler.|
|Multiple Cores||Do not call this function from more than one Core.|
2013/05/08 Automated cleanup pass.
2008/04/16 Added description of the Wii Balance Board.
2006/10/23 Added a description for the connection event immediately after library initialization completes.
2006/09/18 Added mention of the fact that the function will be cleared after the
WPADInit function is called.
2006/06/19 Initial version.