WPADGetInfo

Syntax

#include <cafe/pads/wpad/wpad.h>

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

s32 WPADGetInfo( s32 chan, WPADInfo *info );

Parameters

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

Return Values

WPAD_ERR_NONEStatus was retrieved normally.
WPAD_ERR_NO_CONTROLLERThe connection was broken.
WPAD_ERR_BUSYThe WPAD library was unable to receive a command.
WPAD_ERR_TRANSFERA communications error prevented normal processing of the command.

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.

CAUTION:
Problems may arise if this function is called too frequently. For example, sound may not play from the Wii remote speaker. This function is also used by the HOME Menu library, so be particularly careful about calling this function when the HOME Menu is displayed.

Can get the following status types.

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. 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.
NOTE:
This function occasionally puts the current thread to sleep, so it cannot be called from callback functions.

Do Not Call From

Background Do not call this function from the background.
Callbacks Do not call this function from any callback function.
Interrupt handler Do not call this function from any interrupt handler.
Exception handler Do not call this function from any exception handler.
Multiple Cores Do not call this function from more than one Core.

See Also

WPADGetInfoAsync
WPADInfo

Revision History

2014/03/05 Fixed WPADInfo struct.
2013/05/08 Automated cleanup pass.
2009/11/27 Added a caution regarding use while HOME Menu is displaying.
2008/07/08 Added explanations related to lowBat and battery.
2007/09/18 Added nearempty to WPADInfo.
2007/09/11 Added a note related to Interrupts and Callback Functions.
2006/09/06 Added WPAD_BATTERY_LEVEL_CRITICAL.
2006/08/15 Added WPADInfo to See Also.
2006/06/19 Initial version.


CONFIDENTIAL