WPADControlExtGimmick

Syntax

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

#define WPAD_CHAN0               0
#define WPAD_CHAN1               1
#define WPAD_CHAN2               2
#define WPAD_CHAN3               3

#define WPAD_EXTGMK_OFF          0
#define WPAD_EXTGMK_ON           1

typedef void (*WPADCallback) ( s32 chan, s32 result );

s32 WPADControlExtGimmick( s32 chan, u32 command, WPADCallback callback );

Parameters

chan One of the WPAD_CHANn values.
command Either of:
  • WPAD_EXTGMK_OFF
  • WPAD_EXTGMK_ON
callback Callback function to report on the result. When NULL is specified, notification processing is omitted.

Return Values

WPAD_ERR_NONE The WPAD library received a command.
WPAD_ERR_NO_CONTROLLER The connection was broken.
WPAD_ERR_BUSY The WPAD library was unable to receive a command. Wait a short time and call it again.

Description

Controls the gimmicks of the external extension controller connected to the specified Wii remote.

Commands for controlling the gimmicks of the external extension controller are registered in the WPAD library by this function. The WPAD library processes registered commands when other commands are not running.

NOTE:
This function is meant for controlling gimmicks in External Extension Controllers that may be developed in the future. The Nunchuk and Classic Controller do not have gimmicks, so calling this function for them does nothing.

Callbacks

When a callback function has been set, the callback function is called together with the processing result. When the return value is WPAD_ERR_NONE, the callback function is called when the process is completed. Otherwise, it is called before the function escapes. The following error codes are passed to the callback function.

WPAD_ERR_NONE The command was processed normally.
WPAD_ERR_BUSY The WPAD library was unable to receive a command. Wait a short time and call it again.
WPAD_ERR_TRANSFER A communication error prevented normal processing of the command.
WPAD_ERR_NO_CONTROLLER The connection was broken.

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.

Revision History

2013/05/08 Automated cleanup pass.
2009/09/24 Explained the timing of the call to the callback function.
2007/09/18 Corrected a name mismatch between the argument list and the C specification.
2006/11/29 Initial version.


CONFIDENTIAL