#include <cafe/pads/kpad/kpad.h>

WPADConnectCallback KPADSetConnectCallback( s32 chan, WPADConnectCallback callback );


chan One of the WPAD_CHANn values.
callback A connection notification callback for applications that is called after the internal connection notification callback of the KPAD library is processed.

Return Values

Pointer to the most recently registered callback function.


Registers a communication notification callback for applications. If NULL is specified, the application callback is not called until reconfiguration.

The KPAD Library uses the WPAD library's connection notification callback. For this reason, the application cannot call a WPADSetConnectCallback function that controls the WPAD library connection notification callback. Use this function instead.

The callback registered through this function will not be released unless you either release it by specifying NULL for this function's argument or call the KPADShutdown function. Controller connection/disconnection will not release the callback.
Some WPAD and KPAD APIs that use callback functions will not function when run in the context of another WPAD/KPAD callback function. For example,
  • IF callback1 is a WPAD callback function,
  • AND another WPAD API is called from within callback1, setting callback2 as the callback function
  • THEN callback2 cannot run until callback1 returns, regardless of how long it takes.
In this case, callback2 may run, but only after callback1 completes. It would be an error to wait for the callback2 event from inside callback1: it will not happen.

WPAD APIs that use callbacks include: WPADSetSyncDeviceCallback, WPADIsMplsAttached, WPADSetSamplingCallback, WPADSetConnectCallback, WPADSetExtensionCallback, WPADGetInfo, WPADGetInfoAsync, WPADControlSpeaker, WPADControlDpd, and WPADControlBLC.

KPAD APIs that use callbacks include: KPADSetConnectCallback, KPADSetSamplingCallback, KPADSetControlDpdCallback, and KPADSetControlMplsCallback.

Do Not Call From

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.

See Also


Revision History

2013/05/08 Automated cleanup pass.
2009/10/21 Deleted text regarding KPADOld.
2008/12/15 Changed the return value from void to WPADConnectCallback.
2008/04/17 Initial version.