#include <revolution/wpad.h>
#define WPAD_CHAN0 0
#define WPAD_CHAN1 1
#define WPAD_CHAN2 2
#define WPAD_CHAN3 3
#define WPAD_BATTERY_LEVEL_LOW 1
#define WPAD_BATTERY_LEVEL_MEDIUM 2
#define WPAD_BATTERY_LEVEL_HIGH 3
#define WPAD_BATTERY_LEVEL_MAX 4
#define WPAD_LED_CHAN_1 0x1
#define WPAD_LED_CHAN_2 0x2
#define WPAD_LED_CHAN_3 0x4
#define WPAD_LED_CHAN_4 0x8
typedef struct WPADInfo
{
BOOL dpd;
BOOL speaker;
BOOL attach;
BOOL lowBat;
u8 battery;
u8 led;
u8 protocol;
u8 firmware;
}
typedef void (*WPADCallback) ( s32 chan, s32 result );
s32 WPADGetInfoAsync( s32 chan, WPADInfo *info, WPADCallback callback );
chan |
One of WPAD_CHANn values. |
info |
A pointer to WPADInfo that copies the obtained information. |
info |
Callback function to notify about the result. |
Returns one of the following codes:
WPAD_ERR_NONE
WPAD_ERR_NO_CONTROLLER
WPAD_ERR_BUSY
Gets the status of the Wii Remote for the specified channel. This function registers the status-getting command in the WPAD library. The WPAD library processes registered commands when other commands are not running.
Can get the following status types.
dpd | The pointer's operational status. |
speaker | The speaker's operational status. |
attach | External extension controller connection status. |
lowBat | Whether the battery has fallen below a certain level. |
battery | Expresses the battery level in four (WPAD_BATTERY_LEVEL_*) levels. |
led | The illumination status (WPAD_LED_CHAN_*) of the four player indicators. |
protocol | Not used. |
firmware | Not used. |
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. |
WPAD_ERR_NO_CONTROLLER | The connection was broken. |
In addition, if a callback function is set, the callback function returns the following error codes when the processing is complete. Their meanings are as follows:
WPAD_ERR_NONE | Status was gotten normally. |
WPAD_ERR_TRANSFER | A communications error prevented normal processing of the command. |
WPAD_ERR_NO_CONTROLLER | The connection was broken. |
WPAD Functions
WPADGetInfo
WPADInfo
08/15/2006 Added a link to WPADInfo
06/19/2006 Initial version
CONFIDENTIAL