WPADControlBLC

Syntax

#include <revolution/wpadBalance.h>

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

#define WPAD_BLCMD_ON            0xaa
#define WPAD_BLCMD_OFF           0x55
#define WPAD_BLCMD_UPDATE_TEMP   0x00

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

s32 WPADControlBLC( s32 chan, u8 command, WPADCallback callback );

Arguments

chan One of the WPAD_CHANn values.
command Either WPAD_BLCMD_ON, WPAD_BLCMD_OFF, or WPAD_BLCMD_UPDATE_TEMP.
callback Callback function to notify about the result. Notification processing is omitted if NULL is specified.

Return Values

Returns one of the following codes:

WPAD_ERR_NONE
WPAD_ERR_NO_CONTROLLER
WPAD_ERR_BUSY

Description

Controls the specified Wii Balance Board.

This function registers Wii Balance Board control commands with the WPAD library. The WPAD library processes registered commands when other commands are not running.

The different commands are defined as follows.

WPAD_BLCMD_OFF Stops the Wii Balance Board.
WPAD_BLCMD_ON Starts the Wii Balance Board.
WPAD_BLCMD_UPDATE_TEMP Updates the temperature value for the Wii Balance Board.

The return values have the following meanings:

WPAD_ERR_NONE The WPAD library received the command.
WPAD_ERR_BUSY The WPAD library was unable to receive the command. Wait a short time and call the function again.
WPAD_ERR_NO_CONTROLLER The connection was broken.

When a callback function has been set, the callback function is called together with the processing result. 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_NONE The command was processed normally.
WPAD_ERR_BUSY The WPAD library was unable to receive the command. Wait a short time and call the function again.
WPAD_ERR_TRANSFER A communication error prevented normal processing of the command.
WPAD_ERR_NO_CONTROLLER The connection was broken.

See Also

None.

Revision History

2009/09/24 Explained the timing of the call to the callback function.
2007/09/11 Removed the command to obtain remaining battery power and added the command to obtain temperature.
2007/05/31 Initial version.


CONFIDENTIAL