WPADProbe

Syntax

#include <cafe/pads/wpad/wpad.h>
#include <cafe/pads/wpad/wpadBalance.h>
#include <cafe/pads/wpad/wpadGuitar.h>
#include <cafe/pads/wpad/wpadDrum.h>
#include <cafe/pads/wpad/wpadTaiko.h>
#include <cafe/pads/wpad/wpadTrain.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_BALANCE_CHECKER      3
#define WPAD_DEV_MPLS                 5
#define WPAD_DEV_MPLS_FREESTYLE       6
#define WPAD_DEV_MPLS_CLASSIC         7
#define WPAD_DEV_TRAIN               16
#define WPAD_DEV_GUITAR              17
#define WPAD_DEV_DRUM                18
#define WPAD_DEV_TAIKO               19
#define WPAD_DEV_MPLS_FUTURE        250
#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

s32  WPADProbe( s32 chan, u32 *type );

Parameters

chan One of the WPAD_CHANn values.
type Pointer to the variable 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 device type.
WPAD_ERR_NO_CONTROLLER Indicates the Wii remote is not connected. The type variable does not contain a valid device type (it is undefined).
WPAD_ERR_BUSY Processing is being carried out for the Wii remote. The type variable does not contain a valid device type (it is undefined).

Description

Checks the device type of the specified channel.

You can also get the device type by using the WPADSetExtensionCallback function. The WPADSetExtensionCallback function registers a callback that sends notification of the new device type when the controller type has changed, so you can expect a lighter processing load than when the WPADProbe function is used to perform polling.

NOTE:
When a Wii remote is connected to a Wii U Console, the type of the external extension controller (if any) is not immediately known because recognition of the external extension controller only occurs after the Wii remote has completed its connection. Accordingly, the status obtained by the WPADProbe function changes over time. Immediately after the Wii remote is connected, the function returns WPAD_DEV_CORE. After that, the Wii remote notifies the console that it has an external extension controller attached, and the library checks the external extension controller's type. In the period between notification and verification of the controller's type, the function returns WPAD_DEV_UNKNOWN. Following verification, the function returns a value such as WPAD_DEV_FREESTYLE or WPAD_DEV_CLASSIC, depending on the 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_TRAIN Wii remote + Master Controller. If the WPADTrn library is not linked, the device is recognized as WPAD_DEV_FUTURE.
WPAD_DEV_GUITAR Wii remote + Guitar Controller. If the WPADGtr library is not linked, the device is recognized as WPAD_DEV_FUTURE.
WPAD_DEV_DRUM Wii remote + Drum Controller. If the WPADDrm library is not linked, the device is recognized as WPAD_DEV_FUTURE.
WPAD_DEV_TAIKO Wii remote + Taiko Drum Controller. If the WPADTko library is not linked, the device is recognized as WPAD_DEV_FUTURE.
WPAD_DEV_BALANCE_CHECKER Wii Balance Board. If the WUD library is not linked, a Wii Balance Board is not connected.
WPAD_DEV_MPLS MotionPlus Style.
WPAD_DEV_MPLS_FREESTYLE Nunchuk/MotionPlus Style.
WPAD_DEV_MPLS_CLASSIC Classic/MotionPlus Style. Not supported by Wii MotionPlus PP2.
WPAD_DEV_MPLS_FUTURE Status when a device other than a Nunchuk or Classic Controller has been plugged into the Wii MotionPlus while it is operating in extension mode. Not supported by Wii MotionPlus PP2.
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 can be operated as a Wii remote.
WPAD_DEV_NOT_SUPPORTED A device that cannot be used. This type is selected when an illegal device is plugged in or device recognition fails due to a poor connection with the external extension controller. It can 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 can be operated as a Wii remote.

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

WPADSetExtensionCallback

Revision History

2013-05-08 Automated cleanup pass.
2012-12-04 Removed references to WPADGetMplsStatus.
2008-12-26 Added WPAD_DEV_TAIKO.
2008-12-19 Added WPAD_DEV_DRUM.
2008-12-15 Added notes.
2008-11-26 Revised the description of device types.
2008-09-30 Added a description of WPAD_DEV_MPLS_CLASSIC and WPAD_DEV_MPLS_FUTURE.
2008-07-22 Added a description of WPAD_DEV_MPLS_FREESTYLE.
2008-07-18 Added a description of WPAD_DEV_MPLS.
2008-04-16 Deleted WPAD_ERR_TRANSFER. Added WPAD_DEV_TRAIN, WPAD_DEV_GUITAR, and WPAD_DEV_BALANCE_CHECKER.
2008-03-17 Revised the description of WPAD_DEV_NOT_SUPPORTED.
2007-05-02 Added an explanation for the WPADSetExtensionCallback function.
2006-09-06 Added WPAD_DEV_FUTURE and WPAD_DEV_NOT_SUPPORTED to the device types.
2006-06-19 Added WPAD_DEV_CLASSIC to the device types and revised the error status.
2005-10-27 Initial version.


CONFIDENTIAL