WPADGetInfo

C Specification

#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;
} s32 WPADGetInfo( s32 chan, WPADInfo *info );

Arguments

chan One of WPAD_CHANn values.
info A pointer to WPADInfo that copies the obtained information.

Return Values

Returns one of the following codes:

WPAD_ERR_NONE
WPAD_ERR_NO_CONTROLLER
WPAD_ERR_BUSY
WPAD_ERR_TRANSFER

Description

Gets the status of the Wii Remote for the specified channel. This function registers a status-requesting command to the WPAD library, and waits for the WPAD library to complete its processes.

Can get the following status types.
dpdThe pointer's operational status.
speakerThe speaker's operational status.
attachExternal extension controller connection status.
lowBatWhether the battery has fallen below a certain level.
batteryExpresses the battery level in four (WPAD_BATTERY_LEVEL_*) levels.
ledThe illumination status (WPAD_LED_CHAN_*) of the four player indicators.
protocolNot used.
firmwareNot used.

The return values have the following meanings:
WPAD_ERR_NONEStatus was gotten normally.
WPAD_ERR_BUSYThe WPAD library was unable to receive a command.
WPAD_ERR_NO_CONTROLLERThe connection was broken.
WPAD_ERR_TRANSFERA communications error prevented normal processing of the command.

See Also

WPAD Functions
WPADGetInfoAsync
WPADInfo

Revision History

08/15/2006 Added a link to WPADInfo
06/19/2006 Initial version


CONFIDENTIAL