1<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
2<html>
3
4<head>
5<META http-equiv="Content-Type" content="text/html; charset=utf-8">
6<META name="GENERATOR" content="Microsoft FrontPage 5.0">
7<META http-equiv="Content-Style-Type" content="text/css">
8<LINK rel="stylesheet" type="text/css" href="../CSS/revolution.css">
9<title>WPADControlDpd</title>
10</head>
11
12<body>
13
14<h1>WPADControlDpd</h1>
15
16<h2>Syntax</h2>
17<dl><dd><pre class="construction">
18#include &lt;revolution/wpad.h&gt;
19
20#define WPAD_CHAN0               0
21#define WPAD_CHAN1               1
22#define WPAD_CHAN2               2
23#define WPAD_CHAN3               3
24
25#define WPAD_DPD_OFF             0
26#define WPAD_DPD_STD             1
27#define WPAD_DPD_EXP             3
28#define WPAD_DPD_FULL		 5
29
30typedef void (*WPADCallback) ( s32 chan, s32 result );
31
32s32 WPADControlDpd( s32 chan, u32 command, WPADCallback callback );
33</pre></dd></dl>
34
35<h2>Arguments</h2>
36<TABLE class="arguments" border="1" >
37  <TBODY>
38    <TR>
39<TH>chan</TH>
40<TD>One of the <CODE>WPAD_CHAN<i>n</i></code> values.</TD>
41    </TR>
42    <TR>
43<TH>command</TH>
44<TD>One of the following: <CODE>WPAD_DPD_OFF</CODE>, <CODE>WPAD_DPD_STD</CODE>, <CODE>WPAD_DPD_EXP</CODE>, or <CODE>WPAD_DPD_FULL</CODE>.</TD>
45    </TR>
46    <TR>
47<TH>callback</TH>
48<TD>Callback function to report on the result. When <code>NULL</code> is specified, notification processing is omitted.</TD>
49    </TR>
50  </TBODY>
51</TABLE>
52
53<h2>Return Values</h2>
54<p>
55Returns one of the following codes:
56</p>
57<p>
58<code>WPAD_ERR_NONE</code><br> <code>WPAD_ERR_NO_CONTROLLER</code><br> <code>WPAD_ERR_BUSY</code><br>
59</P>
60
61<H2>Description</H2>
62<p>Controls the Pointer for the specified Wii Remote.</p>
63<p>
64This function registers the Pointer control command in the WPAD library. The WPAD library processes registered commands when other commands are not running.
65</p>
66<ul>
67<li>Commands</li>
68</ul>
69<p>
70The different commands are defined as follows. When changing from standard to expanded mode, or the reverse, there is no need to halt the pointer.
71</p>
72<TABLE class="arguments" border="1" >
73<tr>
74<th>WPAD_DPD_OFF</th>
75<td>Halts the pointer.</td>
76</tr>
77<tr>
78<th>WPAD_DPD_STD</th>
79<td>Starts the pointer in standard mode. Only object coordinates are valid in standard mode. A fixed value is returned for object size. This mode can only be used together with the pointer and external expansion controller data. Note that it cannot be used if an external expansion controller is not being used.</td>
80</tr>
81<tr>
82<th>WPAD_DPD_EXP</th>
83<td>Launches the pointer in expanded mode. Both object coordinates and size are valid in expanded mode. This mode cannot be used together with external expansion controller data. To use this mode, specify <code>WPAD_CORE_ACC_DPD</code> in the <a href="./WPADSetDataFormat.html"><code>WPADSetDataFormat</code></a> function.</td>
84</tr>
85<tr>
86<th>WPAD_DPD_FULL</th>
87<td>Launches the pointer in full mode. In full mode, the object coordinates, size, object radius, pixel value, and object range are valid, but the data rate is half the normal rate. In this mode, an external extension controller cannot be used.</td>
88</tr>
89</table>
90<ul>
91<li>Error Codes</li>
92</ul>
93<p>
94The different return values have the following meanings:
95</p>
96<TABLE class="arguments" border="1" >
97<tr>
98<th>WPAD_ERR_NONE</th>
99<td>The WPAD library received a command.</td>
100</tr>
101<tr>
102<th>WPAD_ERR_BUSY</th>
103<td>The WPAD library was unable to receive a command. Wait a short time and call it again.</td>
104</tr>
105<tr>
106<th>WPAD_ERR_NO_CONTROLLER</th>
107<td>The connection was broken.</td>
108</tr>
109</table>
110
111<ul>
112<li>Callbacks</li>
113</ul>
114<p>
115When a callback function has been set, the callback function is called together with the processing result. When the return value is <code>WPAD_ERR_NONE</code>, 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.
116</p>
117<TABLE class="arguments" border="1" >
118<tr>
119<th>WPAD_ERR_NONE</th>
120<td>The command was processed normally.</td>
121</tr>
122<tr>
123<th>WPAD_ERR_BUSY</th>
124<td>The WPAD library was unable to receive a command. Wait a short time and call it again.</td>
125</tr>
126<tr>
127<th>WPAD_ERR_TRANSFER</th>
128<td>A communications error prevented normal processing of the command.</td>
129</tr>
130<tr>
131<th>WPAD_ERR_NO_CONTROLLER</th>
132<td>The connection was broken.</td>
133</tr>
134</table>
135
136<P><B>Note: Problem with audio output from speaker at same time as WPADControlDpd</B><br>If the application attempts to output audio from the speaker after launching the pointer by using <CODE>WPADControlDpd</CODE>, the pointer's launch configuration may prevent sounds from playing initially. Accordingly, you should wait a brief period of time after launching the pointer before playing audio.</P>
137
138<h2>See Also</h2>
139<p class="reference">
140<!--<A href="./toc.html" target="contents">WPAD関数</A>, --> <A href="./WPADIsDpdEnabled.html">WPADIsDpdEnabled</A><br><a href="./WPADSetDataFormat.html">WPADSetDataFormat</a>
141</p>
142
143<H2>Revision History</H2>
144<P>
1452010/06/23 Added explanation about playing audio from speaker at same time as <CODE>WPADControlDpd</CODE>.<br>2009/09/24 Explained the timing of the call to the callback function.<br>2009/07/07 Revised the description of <CODE>WPAD_DPD_STD</CODE> and <CODE>WPAD_DPD_EXP</CODE>.<br>2007/09/18 Corrected a name mismatch between the argument list and the C specification.<BR>2006/11/29 Added <CODE>WPAD_ERR_BUSY</CODE>, which had been left out of the error codes passed by the callback.<br>2006/08/15 Described the DPD full mode.<br>2006/06/19 Initial version.<br>
146</P>
147
148<hr><p>CONFIDENTIAL</p></body>
149</html>