PMICRegisterErrorCallback

Syntax

#include <revolution/pmic.h>

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

PMICCallback PMICRegisterErrorCallback(PMICCallback cb, void* arg);

Arguments

cb Error notification callback to use while sending data to and receiving data from the Wii Speak.
arg Passed as the second argument of the callback function above.

Return Values

Returns a pointer to the error notification callback that was registered by this function the last time it was called.

Description

Registers a callback function used to notify the application that an error occurred while receiving audio data from, or sending reference data to, the Wii Speak.

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

PMIC_ERR_USB_ERROR An error occurred in USB communications. The Wii Speak will be closed temporarily because of unstable operation. Call the PMICOpen(Async) function before continuing to use the Wii Speak.
PMIC_ERR_INVALID_DATA An error occurred in data sending/receiving. You can continue to use the Wii Speak, but the data may contain noise because it is not continuous.
PMIC_ERR_FATAL A fatal error has occurred.

Of the aforementioned error codes, PMIC_ERR_USB_ERROR and PMIC_ERR_FATAL indicate errors that occur at the same time as an internal library transition and are passed only once, when the error occurs. On the other hand, PMIC_ERR_INVALID_DATA does not involve a state transition and may be passed many times while the Wii Speak is running.

The error notification callback registered by this function is enabled immediately after the Wii Speak is successfully opened by the PMICOpen(Async) function, and may be called until the Wii Speak is closed by the PMICClose(Async) function.

See Also

PMICOpenAsync
PMICOpen
PMICCloseAsync
PMICClose

Revision History

2008/11/04 Added Description.
2008/10/22 Revised Description.
2008/10/21 Initial version.


CONFIDENTIAL