WPADInfo

Syntax

#include <revolution/wpad.h>

#define WPAD_BATTERY_LEVEL_CRITICAL   0
#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;
    BOOL nearempty;
    u8 battery;
    u8 led;
    u8 protocol;
    u8 firmware;
}

Elements

dpdThe Pointer's operational status.
speakerThe speaker's operational status.
attachExternal extension controller connection status.
lowBatWhether the indicator brightness is dropping. Voltages that change the indicator brightness exhibit hysteresis. Note that the brightness will drop when the battery level reaches WPAD_BATTERY_LEVEL_LOW, but the brightness will not be restored immediately even if the battery level changes to WPAD_BATTERY_LEVEL_MEDIUM afterwards.
nearemptyWhether there is a small amount of audio data left in the sound buffer.
batteryThe battery level, indicated on a scale of five (WPAD_BATTERY_LEVEL_*). Indicates how much battery charge currently remains.
ledThe illumination status (WPAD_LED_CHAN_*) of the four Player Indicators.
protocolNot used.
firmwareNot used.

Description

This structure represents the status of the Wii Remote.

TRUE is stored when the Pointer has been launched with the WPADControlDpd function; FALSE is stored if it is stopped.
TRUE is stored when the speaker has been launched with the WPADControlSpeaker function; FALSE is stored if it is stopped.
TRUE is stored if an external extension controller is connected; FALSE is stored otherwise.
You can use battery to determine how much battery charge remains in the Wii Remote. While the Wii Remote is connecting or while it is being registered, the remaining battery charge is displayed with the four Player LEDs. battery is stored at one of five levels. If battery is WPAD_BATTERY_LEVEL_CRITICAL, the battery charge can be recognized as going down quickly. Because the battery charge can vary depending on the type of battery, the remaining operational time may range between 20 seconds to 16 minutes.
The Player Indicators on the Wii Remote will dim if the remaining battery charge gets low. You can use lowBat to determine if the current brightness is normal. Voltages that change the brightness of the Player Indicators exhibit hysteresis. The brightness will fall when battery is WPAD_BATTERY_LEVEL_LOW, and lowBat will be set to TRUE. Note that the brightness will not return immediately even if battery is set to WPAD_BATTERY_LEVEL_MEDIUM afterwards.
Stores TRUE if the audio data remaining in the sound buffer is close to empty, and FALSE otherwise.
The on/off status of the four Player Indicators for the Wii Remote is stored as a bit pattern. The lowest bit corresponds to the left of the player indicator.
This member is not used.
This member is not used.

See Also

WPADGetInfo, WPADGetInfoAsync

Revision History

2008/07/08 Revised explanations related to lowBat and battery.
2007/09/18 Added nearempty.
2006/09/06 Added WPAD_BATTERY_LEVEL_CRITICAL.
2006/08/15 Initial version.


CONFIDENTIAL