1<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
2<html>
3<head>
4<META http-equiv="Content-Type" content="text/html; charset=windows-1252">
5<META http-equiv="Content-Style-Type" content="text/css">
6<LINK rel="stylesheet" type="text/css" href="../../CSS/revolution.css">
7<title>PMICRegisterErrorCallback</title>
8</head>
9
10<body>
11
12<h1>PMICRegisterErrorCallback</h1>
13
14<h2>Syntax</h2>
15<dl><dd><pre class="construction">
16#include &lt;revolution/pmic.h&gt;
17
18typedef void (*PMICCallback)(PMIC_ERR result, void* arg);
19
20PMICCallback PMICRegisterErrorCallback(PMICCallback cb, void* arg);
21</pre></dd></dl>
22
23<h2>Arguments</h2>
24<TABLE class="arguments" border="1" >
25  <tr>
26    <th>cb</th>
27    <td>Error notification callback to use while sending data to and receiving data from the Wii Speak.</td>
28  </tr>
29  <tr>
30    <th>arg</th>
31    <td>Passed as the second argument of the callback function above.</td>
32  </tr>
33</TABLE>
34
35<h2>Return Values</h2>
36<p>
37Returns a pointer to the error notification callback that was registered by this function the last time it was called.
38</p>
39
40<H2>Description</H2>
41<p>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.</p>
42
43<p>One of the following will be passed to <SPAN class="argument">result</SPAN>, the callback function's first argument.</p>
44
45<TABLE class="arguments" border="1" >
46  <tr>
47    <th>PMIC_ERR_USB_ERROR</th>
48    <td>An error occurred in USB communications. The Wii Speak will be closed temporarily because of unstable operation. Call the <code>PMICOpen(Async)</code> function before continuing to use the Wii Speak.</td>
49  </tr>
50  <tr>
51    <th>PMIC_ERR_INVALID_DATA</th>
52    <td>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.</td>
53  </tr>
54  <tr>
55    <th>PMIC_ERR_FATAL</th>
56    <td>A fatal error has occurred.</td>
57  </tr>
58</TABLE>
59
60<p>Of the aforementioned error codes, <code>PMIC_ERR_USB_ERROR</code> and <code>PMIC_ERR_FATAL</code> 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, <code>PMIC_ERR_INVALID_DATA</code> does not involve a state transition and may be passed many times while the Wii Speak is running.</p>
61
62<p>The error notification callback registered by this function is enabled immediately after the Wii Speak is successfully opened by the <code>PMICOpen(Async)</code> function, and may be called until the Wii Speak is closed by the <code>PMICClose(Async)</code> function.</p>
63
64<H2>See Also</H2>
65<p class="reference">
66<a href="PMICOpenAsync.html"><CODE>PMICOpenAsync</CODE></a><BR> <a href="PMICOpen.html"><CODE>PMICOpen</CODE></a><BR> <a href="PMICCloseAsync.html"><CODE>PMICCloseAsync</CODE></a><BR> <a href="PMICClose.html"><CODE>PMICClose</CODE></a>
67</p>
68
69<H2>Revision History</H2>
70<p>
712008/11/04 Added <B>Description</B>.<br> 2008/10/22 Revised <B>Description</B>. <br> 2008/10/21 Initial version.
72</p>
73
74<hr><p>CONFIDENTIAL</p></body>
75
76</html>
77