WPADIsMplsAttached

Syntax

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

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

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

s8 WPADIsMplsAttached( s32 chan, BOOL *attached, WPADCallback callback );

Parameters

chan One of the WPAD_CHANn values.
attached A pointer to BOOL that copies the result.
callback Callback function to report on the result.

Return Values

Returns one of the following codes:

WPAD_ERR_NONEThe WPAD library received a command.
WPAD_ERR_NO_CONTROLLERThe connection was broken.
WPAD_ERR_BUSYThe WPAD library was unable to receive a command.

Description

Check if the Wii MotionPlus is attached to 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.

CAUTION:
Issues may arise if this function is called too frequently. For example, sound may not play from the Wii remote speaker.

When the attached is set to TRUE, Wii MotionPlus is attached to the Wii remote. If attached is FALSE Wii MotionPlus is not attached.

When a callback function has been set, the callback function is called together with the processing result. The value attached is set not when the API is called but when the callback function is called. 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_NONEStatus was retrieved normally.
WPAD_ERR_BUSYThe WPAD library was unable to receive a command. Call it again later.
WPAD_ERR_TRANSFERA communications error prevented normal processing of the command.
WPAD_ERR_NO_CONTROLLERThe connection was broken.

Do Not Call From

Background Do not call this function from the background.
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

WPADIsMplsIntegrated

Revision History

2013-05-08 Automated cleanup pass.
2012-02-27 Initial version.


CONFIDENTIAL