#include <revolution/wpad.h> #include <revolution/wpadBalance.h> #include <revolution/wpadGuitar.h> #include <revolution/wpadDrum.h> #include <revolution/wpadTaiko.h> #include <revolution/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 );
| chan | One of the WPAD_CHANn values. |
|---|---|
| type | Pointer to the variable for getting the controller type. |
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).
Checks the device type of the specified channel.
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 WPADDrmlibrary is not linked, the device is recognized asWPAD_DEV_FUTURE.WPAD_DEV_TAIKO Wii Remote + Taiko Drum Controller. If the WPADTkolibrary is not linked, the device is recognized asWPAD_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.
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:
If the operating mode of the Wii MotionPlus is obtained with the WPADGetMplsStatus function, the device type obtained with this function may be incorrect. For example, even if the operating mode is WPAD_MPLS_STD, the WPAD_DEV_MPLS_FREESTYLE device type results if a Nunchuk is plugged into the Wii MotionPlus. Even if the device type is WPAD_DEV_MPLS_FREESTYLE, the operating mode remains WPAD_MPLS_STD and only data for the Wii MotionPlus is sent to the Wii console.
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