WPADProbe

C Specification

#include <revolution/wpad.h>

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

#define WPAD_DEV_CORE              0
#define WPAD_DEV_FREESTYLE         1
#define WPAD_DEV_CLASSIC           2
#define WPAD_DEV_FUTURE          251
#define WPAD_DEV_NOT_SUPPORTED   252
#define WPAD_DEV_NOT_FOUND       253
#define WPAD_DEV_UNKNOWN         255

#define WPAD_ERR_NONE              0
#define WPAD_ERR_NO_CONTROLLER    -1
#define WPAD_ERR_BUSY             -2
#define WPAD_ERR_TRANSFER         -3

s32  WPADProbe( s32 chan, u32 *type );

Arguments

chan One of the WPAD_CHANn values.
type Pointer to the variable used for getting the controller type.

Return Values

Returns the error status.

Error statuses are defined with the following macro constants.
WPAD_ERR_NONE Communicated successfully with the Wii Remote. The type variable contains a valid controller type.
WPAD_ERR_NO_CONTROLLER The Wii Remote is not connected. The type variable does not contain a valid controller type (undefined).
WPAD_ERR_BUSY Processing is occurring for the Wii Remote. The type variable does not contain a valid controller type (undefined).
WPAD_ERR_TRANSFER A problem occurred during prior communications. The type variable does not contain a valid controller type (undefined).

Description

Checks the specified channel's controller type.

Controller types are defined with the following macro constants.
WPAD_DEV_NOT_FOUND Nothing is connected to the specified channel.
WPAD_DEV_CORE Wii Remote.
WPAD_DEV_FREESTYLE Nunchuk Style.
WPAD_DEV_CLASSIC Classic Style.
WPAD_DEV_FUTURE A device that will be supported in the future. The device is legitimate, but this External Extension Controller cannot be used with this title. It may be operated as a Wii Remote.
WPAD_DEV_NOT_SUPPORTED A device that cannot be used. This type is selected when device recognition fails or an illegal device is plugged in. It may be operated as a Wii Remote.
WPAD_DEV_UNKNOWN Unknown device. This type is selected during the period between insertion of an External Extension Controller and completion of the recognition process. It may be operated as a Wii Remote.

The controller type can be also obtained using the WPADSetExtensionCallback function.
Because the WPADSetExtensionCallback function registers a callback function for notifying about the changed controller type, you can expect a lighter load than when you poll using the WPADProbe function.

See Also

WPAD Function
WPADSetExtensionCallback

Revision History

2007/05/02 2007/05/02 Added a description for the WPADSetExtensionCallback function.
2006/09/06 Added WPAD_DEV_FUTURE and WPAD_DEV_NOT_SUPPORTED to the controller types.
2006/06/19 Added WPAD_DEV_CLASSIC to the controller types, and revised the error status.
2005/10/27 Initial version.


CONFIDENTIAL