PMICSetEcResetAsync

Syntax

#include <revolution/pmic.h>

// Echo canceler reset state
#define PMIC_EC_RESET_ON             0x0001
#define PMIC_EC_RESET_OFF            0x0000

typedef void (*PMICCallback)(PMIC_ERR result, void* arg);

PMIC_ERR PMICSetEcResetAsync(u16 state, PMICCallback cb, void* arg);

Arguments

state Sets the reset state (ON/OFF) for the Wii Speak's echo canceler.
cb Sets the callback function that will send notification of the execution results of this function.
arg Passed as the second argument of the callback function above.

Return Values

Returns one of the following.

PMIC_ERR_OK The function has been called normally.
PMIC_ERR_INVALID_ARGUMENTS The correct argument was not passed.
PMIC_ERR_INVALID_STATE The Wii Speak is not open.
PMIC_ERR_BUSY Cannot register the command. Call the function again.
PMIC_ERR_FATAL A fatal error has occurred.

Description

Asynchronously sets the reset state (ON/OFF) for the Wii Speak's echo canceler.

The echo canceler is reset automatically if the PMICStart or PMICStartAsync function is called to start the Wii Speak, so you do not normally need to use this function.

However, the echo canceler sometimes stops functioning properly if, for example, packets are lost and the other party's voice is interrupted during voice chat. At such times, use this function to reset the echo canceler. This allows you to return the echo canceler to a normal state without stopping the Wii Speak.

Call this function twice in the following order to reset the echo canceler.

(1) PMICSetEcResetAsync(PMIC_EC_RESET_ON,  (callback function), (parameters passed to the callback function));
(2) PMICSetEcResetAsync(PMIC_EC_RESET_OFF,  (callback function), (parameters passed to the callback function));

After the echo canceler is reset, it takes several seconds to begin having an effect on the echoes.

One of the following is passed to result, the callback function's first argument.

PMIC_ERR_OK The reset state was set successfully.
PMIC_ERR_NO_DEVICE The Wii Speak has been unplugged.
PMIC_ERR_INVALID_STATE The Wii Speak is not open. (Confirm that the Wii Speak cable is inserted in the USB port.)
PMIC_ERR_USB_ERROR An error occurred in USB communications. Call the function again.
PMIC_ERR_FATAL A fatal error has occurred.

See Also

PMICStartAsync
PMICStart

Revision History

2009/04/10 Revised the sample code explanation.
2008/10/24 Added Description.
2008/10/22 Initial version.


CONFIDENTIAL