WPADControlMpls

Syntax

#include <revolution/wpad.h>

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

#define WPAD_MPLS_OFF            0
#define WPAD_MPLS_STD            4
#define WPAD_MPLS_EXP            5
#define WPAD_MPLS_FS             5
#define WPAD_MPLS_CL             7
#define WPAD_MPLS_ZRST           128

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

s32 WPADControlMpls( s32 chan, u8 command, WPADCallback callback );

Arguments

chan One of the WPAD_CHANn values.
command WPAD_MPLS_OFF, WPAD_MPLS_STD, or WPAD_MPLS_EXP.
callback Callback function to report the result. Notification processing is omitted if NULL is specified.

Return Values

Returns one of the following codes:

WPAD_ERR_NONE
WPAD_ERR_NO_CONTROLLER
WPAD_ERR_BUSY
WPAD_ERR_INVALID

Description

This function has been removed from use. Please use the KPAD library if you are using the Wii MotionPlus.

Controls the Wii MotionPlus connected to the Wii Remote on the specified channel.

This function registers the Wii MotionPlus control commands in the WPAD library. The WPAD library processes registered commands when other commands are not running.

The different commands are defined as follows.

WPAD_MPLS_OFF Stop the Wii MotionPlus.
WPAD_MPLS_STD Starts in a mode where the Wii MotionPlus is the only device running. While in this mode, the Wii console receives only Wii MotionPlus data even if a Nunchuk or other extension controller is plugged into the Wii MotionPlus.
WPAD_MPLS_FS (old WPAD_MPLS_EXP) Starts in a mode where the Wii MotionPlus and the Nunchuk connected to it run simultaneously. While in this mode, if a Nunchuk is plugged into the Wii MotionPlus, the Wii console alternately receives Wii MotionPlus data and Nunchuk data. If an extension controller other than a Nunchuk is plugged in, the Wii console alternately receives Wii MotionPlus data and data that cannot be resolved by the Wii console. If no device is plugged into the Wii MotionPlus, only Wii MotionPlus data is received, as is the case with WPAD_MPLS_STD.
Note: If some device is attached, the sampling rate is half what it would be otherwise.
WPAD_MPLS_CL Starts in a mode where the Wii MotionPlus and the Classic Controller connected to it run simultaneously. While in this mode, if a Classic Controller is plugged into the Wii MotionPlus, the Wii console alternately receives Wii MotionPlus data and Classic Controller data. If an extension controller other than a Classic Controller is plugged in, the Wii console alternately receives Wii MotionPlus data and data that cannot be resolved by the Wii console. If no device is plugged into the Wii MotionPlus, only Wii MotionPlus data is received, as is the case with WPAD_MPLS_STD.
Note: If some device is attached, the sampling rate is half what it would be otherwise.
WPAD_MPLS_ZRST Resets the at-rest (zero-point) value of Wii MotionPlus hardware. Be sure to send this command when Wii MotionPlus values are stable. If values are unstable, the zero-point value sent may drift.

The return values have the following meanings:

WPAD_ERR_NONE The WPAD library received a command.
WPAD_ERR_BUSY The WPAD library was unable to receive a command. Call it again later.
WPAD_ERR_NO_CONTROLLER The connection was broken.
WPAD_ERR_NO_INVALID The command was incorrect. This error is returned when an attempt is made to do something like process WPAD_MPLS_OFF or WPAD_MPLS_ZRST while the Wii MotionPlus is stopped, or to process WPAD_MPLS_STD, WPAD_MPLS_FS, or WPAD_MPLS_CL while a Wii MotionPlus is running. This error is also returned when an attempt is made to process WPAD_MPLS_CL for the Wii MotionPlus PP2 because the PP2 does not yet support this command.

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. Call it again later.
WPAD_ERR_TRANSFER A Wii MotionPlus is not connected to the Wii Remote, or a communications error prevented the command from being processed properly.
WPAD_ERR_NO_CONTROLLER The connection was broken.
WPAD_ERR_NO_INVALID The command was incorrect. This error is returned when an attempt is made to do something like process WPAD_MPLS_OFF or WPAD_MPLS_ZRST while the Wii MotionPlus is stopped, or to process WPAD_MPLS_STD, WPAD_MPLS_FS, or WPAD_MPLS_CL while a Wii MotionPlus is running. This error is also returned when an attempt is made to process WPAD_MPLS_CL for the Wii MotionPlus PP2 because the PP2 does not yet support this command.

See Also

Revision History

2009/09/24 Explained the timing of the call to the callback function.
2009/07/27 Explained that this has been made obsolete starting with SDK 3.3.
2008/12/03 Added a description of WPAD_MPLS_ZRST. Revised the description of PMIC_ERR_INVALID.
2008/09/30 Added a description of WPAD_MPLS_FS and WPAD_MPLS_CL.
2008/07/18 Initial version.


CONFIDENTIAL