Updated docs

This commit is contained in:
Kristian Sloth Lauszus 2013-08-14 01:16:29 +02:00
parent 5409d3b635
commit 986fb62320
387 changed files with 10544 additions and 7678 deletions

View file

@ -95,7 +95,7 @@ Include dependency graph for BTD.cpp:</div>
<div class="dyncontent">
<div class="center"><img src="_b_t_d_8cpp__incl.png" border="0" usemap="#_b_t_d_8cpp" alt=""/></div>
<map name="_b_t_d_8cpp" id="_b_t_d_8cpp">
<area shape="rect" id="node2" href="_b_t_d_8h.html" title="BTD.h" alt="" coords="560,75,605,96"/><area shape="rect" id="node3" href="_usb_8h.html" title="Usb.h" alt="" coords="287,213,329,235"/><area shape="rect" id="node19" href="confdescparser_8h.html" title="confdescparser.h" alt="" coords="649,144,732,165"/><area shape="rect" id="node6" href="avrpins_8h.html" title="avrpins.h" alt="" coords="30,352,84,373"/><area shape="rect" id="node8" href="max3421e_8h.html" title="max3421e.h" alt="" coords="261,352,328,373"/><area shape="rect" id="node9" href="usbhost_8h.html" title="usbhost.h" alt="" coords="169,283,225,304"/><area shape="rect" id="node10" href="usb__ch9_8h.html" title="usb_ch9.h" alt="" coords="109,352,168,373"/><area shape="rect" id="node12" href="address_8h.html" title="address.h" alt="" coords="377,283,433,304"/><area shape="rect" id="node15" href="message_8h.html" title="message.h" alt="" coords="696,283,757,304"/><area shape="rect" id="node17" href="printhex_8h.html" title="printhex.h" alt="" coords="686,421,743,443"/><area shape="rect" id="node18" href="hexdump_8h.html" title="hexdump.h" alt="" coords="731,352,792,373"/><area shape="rect" id="node20" href="parsetools_8h.html" title="parsetools.h" alt="" coords="729,213,793,235"/></map>
<area shape="rect" id="node2" href="_b_t_d_8h.html" title="BTD.h" alt="" coords="600,75,646,96"/><area shape="rect" id="node3" href="_usb_8h.html" title="Usb.h" alt="" coords="330,213,372,235"/><area shape="rect" id="node19" href="confdescparser_8h.html" title="confdescparser.h" alt="" coords="688,144,771,165"/><area shape="rect" id="node6" href="avrpins_8h.html" title="avrpins.h" alt="" coords="34,352,88,373"/><area shape="rect" id="node8" href="max3421e_8h.html" title="max3421e.h" alt="" coords="284,352,351,373"/><area shape="rect" id="node9" href="usbhost_8h.html" title="usbhost.h" alt="" coords="152,283,208,304"/><area shape="rect" id="node11" href="usb__ch9_8h.html" title="usb_ch9.h" alt="" coords="500,352,559,373"/><area shape="rect" id="node13" href="address_8h.html" title="address.h" alt="" coords="356,283,412,304"/><area shape="rect" id="node15" href="message_8h.html" title="message.h" alt="" coords="735,283,796,304"/><area shape="rect" id="node17" href="printhex_8h.html" title="printhex.h" alt="" coords="737,421,794,443"/><area shape="rect" id="node18" href="hexdump_8h.html" title="hexdump.h" alt="" coords="735,352,796,373"/><area shape="rect" id="node20" href="parsetools_8h.html" title="parsetools.h" alt="" coords="768,213,832,235"/></map>
</div>
</div>
<p><a href="_b_t_d_8cpp_source.html">Go to the source code of this file.</a></p>

View file

@ -1,14 +1,14 @@
<map id="BTD.cpp" name="BTD.cpp">
<area shape="rect" id="node2" href="$_b_t_d_8h.html" title="BTD.h" alt="" coords="560,75,605,96"/>
<area shape="rect" id="node3" href="$_usb_8h.html" title="Usb.h" alt="" coords="287,213,329,235"/>
<area shape="rect" id="node19" href="$confdescparser_8h.html" title="confdescparser.h" alt="" coords="649,144,732,165"/>
<area shape="rect" id="node6" href="$avrpins_8h.html" title="avrpins.h" alt="" coords="30,352,84,373"/>
<area shape="rect" id="node8" href="$max3421e_8h.html" title="max3421e.h" alt="" coords="261,352,328,373"/>
<area shape="rect" id="node9" href="$usbhost_8h.html" title="usbhost.h" alt="" coords="169,283,225,304"/>
<area shape="rect" id="node10" href="$usb__ch9_8h.html" title="usb_ch9.h" alt="" coords="109,352,168,373"/>
<area shape="rect" id="node12" href="$address_8h.html" title="address.h" alt="" coords="377,283,433,304"/>
<area shape="rect" id="node15" href="$message_8h.html" title="message.h" alt="" coords="696,283,757,304"/>
<area shape="rect" id="node17" href="$printhex_8h.html" title="printhex.h" alt="" coords="686,421,743,443"/>
<area shape="rect" id="node18" href="$hexdump_8h.html" title="hexdump.h" alt="" coords="731,352,792,373"/>
<area shape="rect" id="node20" href="$parsetools_8h.html" title="parsetools.h" alt="" coords="729,213,793,235"/>
<area shape="rect" id="node2" href="$_b_t_d_8h.html" title="BTD.h" alt="" coords="600,75,646,96"/>
<area shape="rect" id="node3" href="$_usb_8h.html" title="Usb.h" alt="" coords="330,213,372,235"/>
<area shape="rect" id="node19" href="$confdescparser_8h.html" title="confdescparser.h" alt="" coords="688,144,771,165"/>
<area shape="rect" id="node6" href="$avrpins_8h.html" title="avrpins.h" alt="" coords="34,352,88,373"/>
<area shape="rect" id="node8" href="$max3421e_8h.html" title="max3421e.h" alt="" coords="284,352,351,373"/>
<area shape="rect" id="node9" href="$usbhost_8h.html" title="usbhost.h" alt="" coords="152,283,208,304"/>
<area shape="rect" id="node11" href="$usb__ch9_8h.html" title="usb_ch9.h" alt="" coords="500,352,559,373"/>
<area shape="rect" id="node13" href="$address_8h.html" title="address.h" alt="" coords="356,283,412,304"/>
<area shape="rect" id="node15" href="$message_8h.html" title="message.h" alt="" coords="735,283,796,304"/>
<area shape="rect" id="node17" href="$printhex_8h.html" title="printhex.h" alt="" coords="737,421,794,443"/>
<area shape="rect" id="node18" href="$hexdump_8h.html" title="hexdump.h" alt="" coords="735,352,796,373"/>
<area shape="rect" id="node20" href="$parsetools_8h.html" title="parsetools.h" alt="" coords="768,213,832,235"/>
</map>

View file

@ -1 +1 @@
15e2215b6f2299b5052df2f131ec60f8
7529ebe55f58a22e586d9e98f0041b93

Binary file not shown.

Before

Width:  |  Height:  |  Size: 77 KiB

After

Width:  |  Height:  |  Size: 82 KiB

File diff suppressed because it is too large Load diff

View file

@ -99,7 +99,7 @@ Include dependency graph for BTD.h:</div>
<div class="dyncontent">
<div class="center"><img src="_b_t_d_8h__incl.png" border="0" usemap="#_b_t_d_8h" alt=""/></div>
<map name="_b_t_d_8h" id="_b_t_d_8h">
<area shape="rect" id="node2" href="_usb_8h.html" title="Usb.h" alt="" coords="287,144,329,165"/><area shape="rect" id="node18" href="confdescparser_8h.html" title="confdescparser.h" alt="" coords="649,75,732,96"/><area shape="rect" id="node5" href="avrpins_8h.html" title="avrpins.h" alt="" coords="30,283,84,304"/><area shape="rect" id="node7" href="max3421e_8h.html" title="max3421e.h" alt="" coords="261,283,328,304"/><area shape="rect" id="node8" href="usbhost_8h.html" title="usbhost.h" alt="" coords="169,213,225,235"/><area shape="rect" id="node9" href="usb__ch9_8h.html" title="usb_ch9.h" alt="" coords="109,283,168,304"/><area shape="rect" id="node11" href="address_8h.html" title="address.h" alt="" coords="377,213,433,235"/><area shape="rect" id="node14" href="message_8h.html" title="message.h" alt="" coords="696,213,757,235"/><area shape="rect" id="node16" href="printhex_8h.html" title="printhex.h" alt="" coords="686,352,743,373"/><area shape="rect" id="node17" href="hexdump_8h.html" title="hexdump.h" alt="" coords="731,283,792,304"/><area shape="rect" id="node19" href="parsetools_8h.html" title="parsetools.h" alt="" coords="729,144,793,165"/></map>
<area shape="rect" id="node2" href="_usb_8h.html" title="Usb.h" alt="" coords="330,144,372,165"/><area shape="rect" id="node18" href="confdescparser_8h.html" title="confdescparser.h" alt="" coords="688,75,771,96"/><area shape="rect" id="node5" href="avrpins_8h.html" title="avrpins.h" alt="" coords="34,283,88,304"/><area shape="rect" id="node7" href="max3421e_8h.html" title="max3421e.h" alt="" coords="284,283,351,304"/><area shape="rect" id="node8" href="usbhost_8h.html" title="usbhost.h" alt="" coords="152,213,208,235"/><area shape="rect" id="node10" href="usb__ch9_8h.html" title="usb_ch9.h" alt="" coords="500,283,559,304"/><area shape="rect" id="node12" href="address_8h.html" title="address.h" alt="" coords="356,213,412,235"/><area shape="rect" id="node14" href="message_8h.html" title="message.h" alt="" coords="735,213,796,235"/><area shape="rect" id="node16" href="printhex_8h.html" title="printhex.h" alt="" coords="737,352,794,373"/><area shape="rect" id="node17" href="hexdump_8h.html" title="hexdump.h" alt="" coords="735,283,796,304"/><area shape="rect" id="node19" href="parsetools_8h.html" title="parsetools.h" alt="" coords="768,144,832,165"/></map>
</div>
</div><div class="textblock"><div class="dynheader">
This graph shows which files directly or indirectly include this file:</div>
@ -128,6 +128,10 @@ Macros</h2></td></tr>
<tr class="separator:a54903b410722a45f8246653cd4d00632"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:afc242b8a1b867f79c49ad78e3a47b37f"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="_b_t_d_8h.html#afc242b8a1b867f79c49ad78e3a47b37f">PS3MOVE_PID</a>&#160;&#160;&#160;0x03D5</td></tr>
<tr class="separator:afc242b8a1b867f79c49ad78e3a47b37f"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a6a28bb0589fbe2da75b238d7568d894d"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="_b_t_d_8h.html#a6a28bb0589fbe2da75b238d7568d894d">IOGEAR_GBU521_VID</a>&#160;&#160;&#160;0x0A5C</td></tr>
<tr class="separator:a6a28bb0589fbe2da75b238d7568d894d"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aed4a7c4ebf618412176ef19023454fad"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="_b_t_d_8h.html#aed4a7c4ebf618412176ef19023454fad">IOGEAR_GBU521_PID</a>&#160;&#160;&#160;0x21E8</td></tr>
<tr class="separator:aed4a7c4ebf618412176ef19023454fad"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a32d591ef5742a99963130616ef146787"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="_b_t_d_8h.html#a32d591ef5742a99963130616ef146787">BULK_MAXPKTSIZE</a>&#160;&#160;&#160;64</td></tr>
<tr class="separator:a32d591ef5742a99963130616ef146787"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ad70df063f83bf7000558b1d73aa009e5"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="_b_t_d_8h.html#ad70df063f83bf7000558b1d73aa009e5">bmREQ_HCI_OUT</a>&#160;&#160;&#160;<a class="el" href="usb__ch9_8h.html#a610dad02930a3061c746f84885e1e11e">USB_SETUP_HOST_TO_DEVICE</a>|<a class="el" href="usb__ch9_8h.html#acf3fd30992e9fe01f1bac9aaa7fea61b">USB_SETUP_TYPE_CLASS</a>|<a class="el" href="usb__ch9_8h.html#ad48131dc5ca47b4b2def65e7bbc8442f">USB_SETUP_RECIPIENT_DEVICE</a></td></tr>
@ -344,6 +348,34 @@ Macros</h2></td></tr>
<p>Definition at line <a class="el" href="_b_t_d_8h_source.html#l00028">28</a> of file <a class="el" href="_b_t_d_8h_source.html">BTD.h</a>.</p>
</div>
</div>
<a class="anchor" id="a6a28bb0589fbe2da75b238d7568d894d"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">#define IOGEAR_GBU521_VID&#160;&#160;&#160;0x0A5C</td>
</tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="_b_t_d_8h_source.html#l00030">30</a> of file <a class="el" href="_b_t_d_8h_source.html">BTD.h</a>.</p>
</div>
</div>
<a class="anchor" id="aed4a7c4ebf618412176ef19023454fad"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">#define IOGEAR_GBU521_PID&#160;&#160;&#160;0x21E8</td>
</tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="_b_t_d_8h_source.html#l00031">31</a> of file <a class="el" href="_b_t_d_8h_source.html">BTD.h</a>.</p>
</div>
</div>
<a class="anchor" id="a32d591ef5742a99963130616ef146787"></a>
@ -356,7 +388,7 @@ Macros</h2></td></tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="_b_t_d_8h_source.html#l00031">31</a> of file <a class="el" href="_b_t_d_8h_source.html">BTD.h</a>.</p>
<p>Definition at line <a class="el" href="_b_t_d_8h_source.html#l00034">34</a> of file <a class="el" href="_b_t_d_8h_source.html">BTD.h</a>.</p>
</div>
</div>
@ -370,7 +402,7 @@ Macros</h2></td></tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="_b_t_d_8h_source.html#l00034">34</a> of file <a class="el" href="_b_t_d_8h_source.html">BTD.h</a>.</p>
<p>Definition at line <a class="el" href="_b_t_d_8h_source.html#l00037">37</a> of file <a class="el" href="_b_t_d_8h_source.html">BTD.h</a>.</p>
</div>
</div>
@ -384,7 +416,7 @@ Macros</h2></td></tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="_b_t_d_8h_source.html#l00036">36</a> of file <a class="el" href="_b_t_d_8h_source.html">BTD.h</a>.</p>
<p>Definition at line <a class="el" href="_b_t_d_8h_source.html#l00039">39</a> of file <a class="el" href="_b_t_d_8h_source.html">BTD.h</a>.</p>
</div>
</div>
@ -398,7 +430,7 @@ Macros</h2></td></tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="_b_t_d_8h_source.html#l00037">37</a> of file <a class="el" href="_b_t_d_8h_source.html">BTD.h</a>.</p>
<p>Definition at line <a class="el" href="_b_t_d_8h_source.html#l00040">40</a> of file <a class="el" href="_b_t_d_8h_source.html">BTD.h</a>.</p>
</div>
</div>
@ -412,7 +444,7 @@ Macros</h2></td></tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="_b_t_d_8h_source.html#l00040">40</a> of file <a class="el" href="_b_t_d_8h_source.html">BTD.h</a>.</p>
<p>Definition at line <a class="el" href="_b_t_d_8h_source.html#l00043">43</a> of file <a class="el" href="_b_t_d_8h_source.html">BTD.h</a>.</p>
</div>
</div>
@ -426,7 +458,7 @@ Macros</h2></td></tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="_b_t_d_8h_source.html#l00041">41</a> of file <a class="el" href="_b_t_d_8h_source.html">BTD.h</a>.</p>
<p>Definition at line <a class="el" href="_b_t_d_8h_source.html#l00044">44</a> of file <a class="el" href="_b_t_d_8h_source.html">BTD.h</a>.</p>
</div>
</div>
@ -440,7 +472,7 @@ Macros</h2></td></tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="_b_t_d_8h_source.html#l00042">42</a> of file <a class="el" href="_b_t_d_8h_source.html">BTD.h</a>.</p>
<p>Definition at line <a class="el" href="_b_t_d_8h_source.html#l00045">45</a> of file <a class="el" href="_b_t_d_8h_source.html">BTD.h</a>.</p>
</div>
</div>
@ -454,7 +486,7 @@ Macros</h2></td></tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="_b_t_d_8h_source.html#l00043">43</a> of file <a class="el" href="_b_t_d_8h_source.html">BTD.h</a>.</p>
<p>Definition at line <a class="el" href="_b_t_d_8h_source.html#l00046">46</a> of file <a class="el" href="_b_t_d_8h_source.html">BTD.h</a>.</p>
</div>
</div>
@ -468,7 +500,7 @@ Macros</h2></td></tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="_b_t_d_8h_source.html#l00044">44</a> of file <a class="el" href="_b_t_d_8h_source.html">BTD.h</a>.</p>
<p>Definition at line <a class="el" href="_b_t_d_8h_source.html#l00047">47</a> of file <a class="el" href="_b_t_d_8h_source.html">BTD.h</a>.</p>
</div>
</div>
@ -482,7 +514,7 @@ Macros</h2></td></tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="_b_t_d_8h_source.html#l00045">45</a> of file <a class="el" href="_b_t_d_8h_source.html">BTD.h</a>.</p>
<p>Definition at line <a class="el" href="_b_t_d_8h_source.html#l00048">48</a> of file <a class="el" href="_b_t_d_8h_source.html">BTD.h</a>.</p>
</div>
</div>
@ -496,7 +528,7 @@ Macros</h2></td></tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="_b_t_d_8h_source.html#l00046">46</a> of file <a class="el" href="_b_t_d_8h_source.html">BTD.h</a>.</p>
<p>Definition at line <a class="el" href="_b_t_d_8h_source.html#l00049">49</a> of file <a class="el" href="_b_t_d_8h_source.html">BTD.h</a>.</p>
</div>
</div>
@ -510,7 +542,7 @@ Macros</h2></td></tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="_b_t_d_8h_source.html#l00048">48</a> of file <a class="el" href="_b_t_d_8h_source.html">BTD.h</a>.</p>
<p>Definition at line <a class="el" href="_b_t_d_8h_source.html#l00051">51</a> of file <a class="el" href="_b_t_d_8h_source.html">BTD.h</a>.</p>
</div>
</div>
@ -524,7 +556,7 @@ Macros</h2></td></tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="_b_t_d_8h_source.html#l00049">49</a> of file <a class="el" href="_b_t_d_8h_source.html">BTD.h</a>.</p>
<p>Definition at line <a class="el" href="_b_t_d_8h_source.html#l00052">52</a> of file <a class="el" href="_b_t_d_8h_source.html">BTD.h</a>.</p>
</div>
</div>
@ -538,7 +570,7 @@ Macros</h2></td></tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="_b_t_d_8h_source.html#l00050">50</a> of file <a class="el" href="_b_t_d_8h_source.html">BTD.h</a>.</p>
<p>Definition at line <a class="el" href="_b_t_d_8h_source.html#l00053">53</a> of file <a class="el" href="_b_t_d_8h_source.html">BTD.h</a>.</p>
</div>
</div>
@ -552,7 +584,7 @@ Macros</h2></td></tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="_b_t_d_8h_source.html#l00052">52</a> of file <a class="el" href="_b_t_d_8h_source.html">BTD.h</a>.</p>
<p>Definition at line <a class="el" href="_b_t_d_8h_source.html#l00055">55</a> of file <a class="el" href="_b_t_d_8h_source.html">BTD.h</a>.</p>
</div>
</div>
@ -566,7 +598,7 @@ Macros</h2></td></tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="_b_t_d_8h_source.html#l00053">53</a> of file <a class="el" href="_b_t_d_8h_source.html">BTD.h</a>.</p>
<p>Definition at line <a class="el" href="_b_t_d_8h_source.html#l00056">56</a> of file <a class="el" href="_b_t_d_8h_source.html">BTD.h</a>.</p>
</div>
</div>
@ -580,7 +612,7 @@ Macros</h2></td></tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="_b_t_d_8h_source.html#l00054">54</a> of file <a class="el" href="_b_t_d_8h_source.html">BTD.h</a>.</p>
<p>Definition at line <a class="el" href="_b_t_d_8h_source.html#l00057">57</a> of file <a class="el" href="_b_t_d_8h_source.html">BTD.h</a>.</p>
</div>
</div>
@ -594,7 +626,7 @@ Macros</h2></td></tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="_b_t_d_8h_source.html#l00055">55</a> of file <a class="el" href="_b_t_d_8h_source.html">BTD.h</a>.</p>
<p>Definition at line <a class="el" href="_b_t_d_8h_source.html#l00058">58</a> of file <a class="el" href="_b_t_d_8h_source.html">BTD.h</a>.</p>
</div>
</div>
@ -608,7 +640,7 @@ Macros</h2></td></tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="_b_t_d_8h_source.html#l00056">56</a> of file <a class="el" href="_b_t_d_8h_source.html">BTD.h</a>.</p>
<p>Definition at line <a class="el" href="_b_t_d_8h_source.html#l00059">59</a> of file <a class="el" href="_b_t_d_8h_source.html">BTD.h</a>.</p>
</div>
</div>
@ -622,7 +654,7 @@ Macros</h2></td></tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="_b_t_d_8h_source.html#l00057">57</a> of file <a class="el" href="_b_t_d_8h_source.html">BTD.h</a>.</p>
<p>Definition at line <a class="el" href="_b_t_d_8h_source.html#l00060">60</a> of file <a class="el" href="_b_t_d_8h_source.html">BTD.h</a>.</p>
</div>
</div>
@ -636,7 +668,7 @@ Macros</h2></td></tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="_b_t_d_8h_source.html#l00058">58</a> of file <a class="el" href="_b_t_d_8h_source.html">BTD.h</a>.</p>
<p>Definition at line <a class="el" href="_b_t_d_8h_source.html#l00061">61</a> of file <a class="el" href="_b_t_d_8h_source.html">BTD.h</a>.</p>
</div>
</div>
@ -650,7 +682,7 @@ Macros</h2></td></tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="_b_t_d_8h_source.html#l00061">61</a> of file <a class="el" href="_b_t_d_8h_source.html">BTD.h</a>.</p>
<p>Definition at line <a class="el" href="_b_t_d_8h_source.html#l00064">64</a> of file <a class="el" href="_b_t_d_8h_source.html">BTD.h</a>.</p>
</div>
</div>
@ -664,7 +696,7 @@ Macros</h2></td></tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="_b_t_d_8h_source.html#l00062">62</a> of file <a class="el" href="_b_t_d_8h_source.html">BTD.h</a>.</p>
<p>Definition at line <a class="el" href="_b_t_d_8h_source.html#l00065">65</a> of file <a class="el" href="_b_t_d_8h_source.html">BTD.h</a>.</p>
</div>
</div>
@ -678,7 +710,7 @@ Macros</h2></td></tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="_b_t_d_8h_source.html#l00063">63</a> of file <a class="el" href="_b_t_d_8h_source.html">BTD.h</a>.</p>
<p>Definition at line <a class="el" href="_b_t_d_8h_source.html#l00066">66</a> of file <a class="el" href="_b_t_d_8h_source.html">BTD.h</a>.</p>
</div>
</div>
@ -692,7 +724,7 @@ Macros</h2></td></tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="_b_t_d_8h_source.html#l00064">64</a> of file <a class="el" href="_b_t_d_8h_source.html">BTD.h</a>.</p>
<p>Definition at line <a class="el" href="_b_t_d_8h_source.html#l00067">67</a> of file <a class="el" href="_b_t_d_8h_source.html">BTD.h</a>.</p>
</div>
</div>
@ -706,7 +738,7 @@ Macros</h2></td></tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="_b_t_d_8h_source.html#l00065">65</a> of file <a class="el" href="_b_t_d_8h_source.html">BTD.h</a>.</p>
<p>Definition at line <a class="el" href="_b_t_d_8h_source.html#l00068">68</a> of file <a class="el" href="_b_t_d_8h_source.html">BTD.h</a>.</p>
</div>
</div>
@ -720,7 +752,7 @@ Macros</h2></td></tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="_b_t_d_8h_source.html#l00066">66</a> of file <a class="el" href="_b_t_d_8h_source.html">BTD.h</a>.</p>
<p>Definition at line <a class="el" href="_b_t_d_8h_source.html#l00069">69</a> of file <a class="el" href="_b_t_d_8h_source.html">BTD.h</a>.</p>
</div>
</div>
@ -734,7 +766,7 @@ Macros</h2></td></tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="_b_t_d_8h_source.html#l00067">67</a> of file <a class="el" href="_b_t_d_8h_source.html">BTD.h</a>.</p>
<p>Definition at line <a class="el" href="_b_t_d_8h_source.html#l00070">70</a> of file <a class="el" href="_b_t_d_8h_source.html">BTD.h</a>.</p>
</div>
</div>
@ -748,7 +780,7 @@ Macros</h2></td></tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="_b_t_d_8h_source.html#l00068">68</a> of file <a class="el" href="_b_t_d_8h_source.html">BTD.h</a>.</p>
<p>Definition at line <a class="el" href="_b_t_d_8h_source.html#l00071">71</a> of file <a class="el" href="_b_t_d_8h_source.html">BTD.h</a>.</p>
</div>
</div>
@ -762,7 +794,7 @@ Macros</h2></td></tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="_b_t_d_8h_source.html#l00069">69</a> of file <a class="el" href="_b_t_d_8h_source.html">BTD.h</a>.</p>
<p>Definition at line <a class="el" href="_b_t_d_8h_source.html#l00072">72</a> of file <a class="el" href="_b_t_d_8h_source.html">BTD.h</a>.</p>
</div>
</div>
@ -776,7 +808,7 @@ Macros</h2></td></tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="_b_t_d_8h_source.html#l00072">72</a> of file <a class="el" href="_b_t_d_8h_source.html">BTD.h</a>.</p>
<p>Definition at line <a class="el" href="_b_t_d_8h_source.html#l00075">75</a> of file <a class="el" href="_b_t_d_8h_source.html">BTD.h</a>.</p>
</div>
</div>
@ -790,7 +822,7 @@ Macros</h2></td></tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="_b_t_d_8h_source.html#l00073">73</a> of file <a class="el" href="_b_t_d_8h_source.html">BTD.h</a>.</p>
<p>Definition at line <a class="el" href="_b_t_d_8h_source.html#l00076">76</a> of file <a class="el" href="_b_t_d_8h_source.html">BTD.h</a>.</p>
</div>
</div>
@ -804,7 +836,7 @@ Macros</h2></td></tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="_b_t_d_8h_source.html#l00074">74</a> of file <a class="el" href="_b_t_d_8h_source.html">BTD.h</a>.</p>
<p>Definition at line <a class="el" href="_b_t_d_8h_source.html#l00077">77</a> of file <a class="el" href="_b_t_d_8h_source.html">BTD.h</a>.</p>
</div>
</div>
@ -818,7 +850,7 @@ Macros</h2></td></tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="_b_t_d_8h_source.html#l00075">75</a> of file <a class="el" href="_b_t_d_8h_source.html">BTD.h</a>.</p>
<p>Definition at line <a class="el" href="_b_t_d_8h_source.html#l00078">78</a> of file <a class="el" href="_b_t_d_8h_source.html">BTD.h</a>.</p>
</div>
</div>
@ -832,7 +864,7 @@ Macros</h2></td></tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="_b_t_d_8h_source.html#l00076">76</a> of file <a class="el" href="_b_t_d_8h_source.html">BTD.h</a>.</p>
<p>Definition at line <a class="el" href="_b_t_d_8h_source.html#l00079">79</a> of file <a class="el" href="_b_t_d_8h_source.html">BTD.h</a>.</p>
</div>
</div>
@ -846,7 +878,7 @@ Macros</h2></td></tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="_b_t_d_8h_source.html#l00077">77</a> of file <a class="el" href="_b_t_d_8h_source.html">BTD.h</a>.</p>
<p>Definition at line <a class="el" href="_b_t_d_8h_source.html#l00080">80</a> of file <a class="el" href="_b_t_d_8h_source.html">BTD.h</a>.</p>
</div>
</div>
@ -860,7 +892,7 @@ Macros</h2></td></tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="_b_t_d_8h_source.html#l00078">78</a> of file <a class="el" href="_b_t_d_8h_source.html">BTD.h</a>.</p>
<p>Definition at line <a class="el" href="_b_t_d_8h_source.html#l00081">81</a> of file <a class="el" href="_b_t_d_8h_source.html">BTD.h</a>.</p>
</div>
</div>
@ -874,7 +906,7 @@ Macros</h2></td></tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="_b_t_d_8h_source.html#l00079">79</a> of file <a class="el" href="_b_t_d_8h_source.html">BTD.h</a>.</p>
<p>Definition at line <a class="el" href="_b_t_d_8h_source.html#l00082">82</a> of file <a class="el" href="_b_t_d_8h_source.html">BTD.h</a>.</p>
</div>
</div>
@ -888,7 +920,7 @@ Macros</h2></td></tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="_b_t_d_8h_source.html#l00080">80</a> of file <a class="el" href="_b_t_d_8h_source.html">BTD.h</a>.</p>
<p>Definition at line <a class="el" href="_b_t_d_8h_source.html#l00083">83</a> of file <a class="el" href="_b_t_d_8h_source.html">BTD.h</a>.</p>
</div>
</div>
@ -902,7 +934,7 @@ Macros</h2></td></tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="_b_t_d_8h_source.html#l00083">83</a> of file <a class="el" href="_b_t_d_8h_source.html">BTD.h</a>.</p>
<p>Definition at line <a class="el" href="_b_t_d_8h_source.html#l00086">86</a> of file <a class="el" href="_b_t_d_8h_source.html">BTD.h</a>.</p>
</div>
</div>
@ -916,7 +948,7 @@ Macros</h2></td></tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="_b_t_d_8h_source.html#l00084">84</a> of file <a class="el" href="_b_t_d_8h_source.html">BTD.h</a>.</p>
<p>Definition at line <a class="el" href="_b_t_d_8h_source.html#l00087">87</a> of file <a class="el" href="_b_t_d_8h_source.html">BTD.h</a>.</p>
</div>
</div>
@ -930,7 +962,7 @@ Macros</h2></td></tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="_b_t_d_8h_source.html#l00085">85</a> of file <a class="el" href="_b_t_d_8h_source.html">BTD.h</a>.</p>
<p>Definition at line <a class="el" href="_b_t_d_8h_source.html#l00088">88</a> of file <a class="el" href="_b_t_d_8h_source.html">BTD.h</a>.</p>
</div>
</div>
@ -944,7 +976,7 @@ Macros</h2></td></tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="_b_t_d_8h_source.html#l00086">86</a> of file <a class="el" href="_b_t_d_8h_source.html">BTD.h</a>.</p>
<p>Definition at line <a class="el" href="_b_t_d_8h_source.html#l00089">89</a> of file <a class="el" href="_b_t_d_8h_source.html">BTD.h</a>.</p>
</div>
</div>
@ -958,7 +990,7 @@ Macros</h2></td></tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="_b_t_d_8h_source.html#l00087">87</a> of file <a class="el" href="_b_t_d_8h_source.html">BTD.h</a>.</p>
<p>Definition at line <a class="el" href="_b_t_d_8h_source.html#l00090">90</a> of file <a class="el" href="_b_t_d_8h_source.html">BTD.h</a>.</p>
</div>
</div>
@ -972,7 +1004,7 @@ Macros</h2></td></tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="_b_t_d_8h_source.html#l00088">88</a> of file <a class="el" href="_b_t_d_8h_source.html">BTD.h</a>.</p>
<p>Definition at line <a class="el" href="_b_t_d_8h_source.html#l00091">91</a> of file <a class="el" href="_b_t_d_8h_source.html">BTD.h</a>.</p>
</div>
</div>
@ -986,7 +1018,7 @@ Macros</h2></td></tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="_b_t_d_8h_source.html#l00089">89</a> of file <a class="el" href="_b_t_d_8h_source.html">BTD.h</a>.</p>
<p>Definition at line <a class="el" href="_b_t_d_8h_source.html#l00092">92</a> of file <a class="el" href="_b_t_d_8h_source.html">BTD.h</a>.</p>
</div>
</div>
@ -1000,7 +1032,7 @@ Macros</h2></td></tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="_b_t_d_8h_source.html#l00090">90</a> of file <a class="el" href="_b_t_d_8h_source.html">BTD.h</a>.</p>
<p>Definition at line <a class="el" href="_b_t_d_8h_source.html#l00093">93</a> of file <a class="el" href="_b_t_d_8h_source.html">BTD.h</a>.</p>
</div>
</div>
@ -1014,7 +1046,7 @@ Macros</h2></td></tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="_b_t_d_8h_source.html#l00091">91</a> of file <a class="el" href="_b_t_d_8h_source.html">BTD.h</a>.</p>
<p>Definition at line <a class="el" href="_b_t_d_8h_source.html#l00094">94</a> of file <a class="el" href="_b_t_d_8h_source.html">BTD.h</a>.</p>
</div>
</div>
@ -1028,7 +1060,7 @@ Macros</h2></td></tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="_b_t_d_8h_source.html#l00092">92</a> of file <a class="el" href="_b_t_d_8h_source.html">BTD.h</a>.</p>
<p>Definition at line <a class="el" href="_b_t_d_8h_source.html#l00095">95</a> of file <a class="el" href="_b_t_d_8h_source.html">BTD.h</a>.</p>
</div>
</div>
@ -1042,7 +1074,7 @@ Macros</h2></td></tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="_b_t_d_8h_source.html#l00093">93</a> of file <a class="el" href="_b_t_d_8h_source.html">BTD.h</a>.</p>
<p>Definition at line <a class="el" href="_b_t_d_8h_source.html#l00096">96</a> of file <a class="el" href="_b_t_d_8h_source.html">BTD.h</a>.</p>
</div>
</div>
@ -1056,7 +1088,7 @@ Macros</h2></td></tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="_b_t_d_8h_source.html#l00094">94</a> of file <a class="el" href="_b_t_d_8h_source.html">BTD.h</a>.</p>
<p>Definition at line <a class="el" href="_b_t_d_8h_source.html#l00097">97</a> of file <a class="el" href="_b_t_d_8h_source.html">BTD.h</a>.</p>
</div>
</div>
@ -1070,7 +1102,7 @@ Macros</h2></td></tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="_b_t_d_8h_source.html#l00095">95</a> of file <a class="el" href="_b_t_d_8h_source.html">BTD.h</a>.</p>
<p>Definition at line <a class="el" href="_b_t_d_8h_source.html#l00098">98</a> of file <a class="el" href="_b_t_d_8h_source.html">BTD.h</a>.</p>
</div>
</div>
@ -1084,7 +1116,7 @@ Macros</h2></td></tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="_b_t_d_8h_source.html#l00096">96</a> of file <a class="el" href="_b_t_d_8h_source.html">BTD.h</a>.</p>
<p>Definition at line <a class="el" href="_b_t_d_8h_source.html#l00099">99</a> of file <a class="el" href="_b_t_d_8h_source.html">BTD.h</a>.</p>
</div>
</div>
@ -1098,7 +1130,7 @@ Macros</h2></td></tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="_b_t_d_8h_source.html#l00097">97</a> of file <a class="el" href="_b_t_d_8h_source.html">BTD.h</a>.</p>
<p>Definition at line <a class="el" href="_b_t_d_8h_source.html#l00100">100</a> of file <a class="el" href="_b_t_d_8h_source.html">BTD.h</a>.</p>
</div>
</div>
@ -1112,7 +1144,7 @@ Macros</h2></td></tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="_b_t_d_8h_source.html#l00098">98</a> of file <a class="el" href="_b_t_d_8h_source.html">BTD.h</a>.</p>
<p>Definition at line <a class="el" href="_b_t_d_8h_source.html#l00101">101</a> of file <a class="el" href="_b_t_d_8h_source.html">BTD.h</a>.</p>
</div>
</div>
@ -1126,7 +1158,7 @@ Macros</h2></td></tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="_b_t_d_8h_source.html#l00099">99</a> of file <a class="el" href="_b_t_d_8h_source.html">BTD.h</a>.</p>
<p>Definition at line <a class="el" href="_b_t_d_8h_source.html#l00102">102</a> of file <a class="el" href="_b_t_d_8h_source.html">BTD.h</a>.</p>
</div>
</div>
@ -1140,7 +1172,7 @@ Macros</h2></td></tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="_b_t_d_8h_source.html#l00100">100</a> of file <a class="el" href="_b_t_d_8h_source.html">BTD.h</a>.</p>
<p>Definition at line <a class="el" href="_b_t_d_8h_source.html#l00103">103</a> of file <a class="el" href="_b_t_d_8h_source.html">BTD.h</a>.</p>
</div>
</div>
@ -1154,7 +1186,7 @@ Macros</h2></td></tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="_b_t_d_8h_source.html#l00101">101</a> of file <a class="el" href="_b_t_d_8h_source.html">BTD.h</a>.</p>
<p>Definition at line <a class="el" href="_b_t_d_8h_source.html#l00104">104</a> of file <a class="el" href="_b_t_d_8h_source.html">BTD.h</a>.</p>
</div>
</div>
@ -1168,7 +1200,7 @@ Macros</h2></td></tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="_b_t_d_8h_source.html#l00102">102</a> of file <a class="el" href="_b_t_d_8h_source.html">BTD.h</a>.</p>
<p>Definition at line <a class="el" href="_b_t_d_8h_source.html#l00105">105</a> of file <a class="el" href="_b_t_d_8h_source.html">BTD.h</a>.</p>
</div>
</div>
@ -1182,7 +1214,7 @@ Macros</h2></td></tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="_b_t_d_8h_source.html#l00103">103</a> of file <a class="el" href="_b_t_d_8h_source.html">BTD.h</a>.</p>
<p>Definition at line <a class="el" href="_b_t_d_8h_source.html#l00106">106</a> of file <a class="el" href="_b_t_d_8h_source.html">BTD.h</a>.</p>
</div>
</div>
@ -1196,7 +1228,7 @@ Macros</h2></td></tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="_b_t_d_8h_source.html#l00104">104</a> of file <a class="el" href="_b_t_d_8h_source.html">BTD.h</a>.</p>
<p>Definition at line <a class="el" href="_b_t_d_8h_source.html#l00107">107</a> of file <a class="el" href="_b_t_d_8h_source.html">BTD.h</a>.</p>
</div>
</div>
@ -1210,7 +1242,7 @@ Macros</h2></td></tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="_b_t_d_8h_source.html#l00107">107</a> of file <a class="el" href="_b_t_d_8h_source.html">BTD.h</a>.</p>
<p>Definition at line <a class="el" href="_b_t_d_8h_source.html#l00110">110</a> of file <a class="el" href="_b_t_d_8h_source.html">BTD.h</a>.</p>
</div>
</div>
@ -1224,7 +1256,7 @@ Macros</h2></td></tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="_b_t_d_8h_source.html#l00108">108</a> of file <a class="el" href="_b_t_d_8h_source.html">BTD.h</a>.</p>
<p>Definition at line <a class="el" href="_b_t_d_8h_source.html#l00111">111</a> of file <a class="el" href="_b_t_d_8h_source.html">BTD.h</a>.</p>
</div>
</div>
@ -1238,7 +1270,7 @@ Macros</h2></td></tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="_b_t_d_8h_source.html#l00109">109</a> of file <a class="el" href="_b_t_d_8h_source.html">BTD.h</a>.</p>
<p>Definition at line <a class="el" href="_b_t_d_8h_source.html#l00112">112</a> of file <a class="el" href="_b_t_d_8h_source.html">BTD.h</a>.</p>
</div>
</div>
@ -1252,7 +1284,7 @@ Macros</h2></td></tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="_b_t_d_8h_source.html#l00110">110</a> of file <a class="el" href="_b_t_d_8h_source.html">BTD.h</a>.</p>
<p>Definition at line <a class="el" href="_b_t_d_8h_source.html#l00113">113</a> of file <a class="el" href="_b_t_d_8h_source.html">BTD.h</a>.</p>
</div>
</div>
@ -1266,7 +1298,7 @@ Macros</h2></td></tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="_b_t_d_8h_source.html#l00111">111</a> of file <a class="el" href="_b_t_d_8h_source.html">BTD.h</a>.</p>
<p>Definition at line <a class="el" href="_b_t_d_8h_source.html#l00114">114</a> of file <a class="el" href="_b_t_d_8h_source.html">BTD.h</a>.</p>
</div>
</div>
@ -1280,7 +1312,7 @@ Macros</h2></td></tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="_b_t_d_8h_source.html#l00112">112</a> of file <a class="el" href="_b_t_d_8h_source.html">BTD.h</a>.</p>
<p>Definition at line <a class="el" href="_b_t_d_8h_source.html#l00115">115</a> of file <a class="el" href="_b_t_d_8h_source.html">BTD.h</a>.</p>
</div>
</div>
@ -1294,7 +1326,7 @@ Macros</h2></td></tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="_b_t_d_8h_source.html#l00113">113</a> of file <a class="el" href="_b_t_d_8h_source.html">BTD.h</a>.</p>
<p>Definition at line <a class="el" href="_b_t_d_8h_source.html#l00116">116</a> of file <a class="el" href="_b_t_d_8h_source.html">BTD.h</a>.</p>
</div>
</div>
@ -1308,7 +1340,7 @@ Macros</h2></td></tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="_b_t_d_8h_source.html#l00114">114</a> of file <a class="el" href="_b_t_d_8h_source.html">BTD.h</a>.</p>
<p>Definition at line <a class="el" href="_b_t_d_8h_source.html#l00117">117</a> of file <a class="el" href="_b_t_d_8h_source.html">BTD.h</a>.</p>
</div>
</div>
@ -1322,7 +1354,7 @@ Macros</h2></td></tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="_b_t_d_8h_source.html#l00115">115</a> of file <a class="el" href="_b_t_d_8h_source.html">BTD.h</a>.</p>
<p>Definition at line <a class="el" href="_b_t_d_8h_source.html#l00118">118</a> of file <a class="el" href="_b_t_d_8h_source.html">BTD.h</a>.</p>
</div>
</div>
@ -1336,7 +1368,7 @@ Macros</h2></td></tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="_b_t_d_8h_source.html#l00118">118</a> of file <a class="el" href="_b_t_d_8h_source.html">BTD.h</a>.</p>
<p>Definition at line <a class="el" href="_b_t_d_8h_source.html#l00121">121</a> of file <a class="el" href="_b_t_d_8h_source.html">BTD.h</a>.</p>
</div>
</div>
@ -1350,7 +1382,7 @@ Macros</h2></td></tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="_b_t_d_8h_source.html#l00119">119</a> of file <a class="el" href="_b_t_d_8h_source.html">BTD.h</a>.</p>
<p>Definition at line <a class="el" href="_b_t_d_8h_source.html#l00122">122</a> of file <a class="el" href="_b_t_d_8h_source.html">BTD.h</a>.</p>
</div>
</div>
@ -1364,7 +1396,7 @@ Macros</h2></td></tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="_b_t_d_8h_source.html#l00122">122</a> of file <a class="el" href="_b_t_d_8h_source.html">BTD.h</a>.</p>
<p>Definition at line <a class="el" href="_b_t_d_8h_source.html#l00125">125</a> of file <a class="el" href="_b_t_d_8h_source.html">BTD.h</a>.</p>
</div>
</div>
@ -1378,7 +1410,7 @@ Macros</h2></td></tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="_b_t_d_8h_source.html#l00123">123</a> of file <a class="el" href="_b_t_d_8h_source.html">BTD.h</a>.</p>
<p>Definition at line <a class="el" href="_b_t_d_8h_source.html#l00126">126</a> of file <a class="el" href="_b_t_d_8h_source.html">BTD.h</a>.</p>
</div>
</div>
@ -1392,7 +1424,7 @@ Macros</h2></td></tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="_b_t_d_8h_source.html#l00124">124</a> of file <a class="el" href="_b_t_d_8h_source.html">BTD.h</a>.</p>
<p>Definition at line <a class="el" href="_b_t_d_8h_source.html#l00127">127</a> of file <a class="el" href="_b_t_d_8h_source.html">BTD.h</a>.</p>
</div>
</div>
@ -1406,7 +1438,7 @@ Macros</h2></td></tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="_b_t_d_8h_source.html#l00125">125</a> of file <a class="el" href="_b_t_d_8h_source.html">BTD.h</a>.</p>
<p>Definition at line <a class="el" href="_b_t_d_8h_source.html#l00128">128</a> of file <a class="el" href="_b_t_d_8h_source.html">BTD.h</a>.</p>
</div>
</div>
@ -1420,7 +1452,7 @@ Macros</h2></td></tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="_b_t_d_8h_source.html#l00128">128</a> of file <a class="el" href="_b_t_d_8h_source.html">BTD.h</a>.</p>
<p>Definition at line <a class="el" href="_b_t_d_8h_source.html#l00131">131</a> of file <a class="el" href="_b_t_d_8h_source.html">BTD.h</a>.</p>
</div>
</div>
@ -1434,7 +1466,7 @@ Macros</h2></td></tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="_b_t_d_8h_source.html#l00129">129</a> of file <a class="el" href="_b_t_d_8h_source.html">BTD.h</a>.</p>
<p>Definition at line <a class="el" href="_b_t_d_8h_source.html#l00132">132</a> of file <a class="el" href="_b_t_d_8h_source.html">BTD.h</a>.</p>
</div>
</div>
@ -1448,7 +1480,7 @@ Macros</h2></td></tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="_b_t_d_8h_source.html#l00131">131</a> of file <a class="el" href="_b_t_d_8h_source.html">BTD.h</a>.</p>
<p>Definition at line <a class="el" href="_b_t_d_8h_source.html#l00134">134</a> of file <a class="el" href="_b_t_d_8h_source.html">BTD.h</a>.</p>
</div>
</div>
@ -1462,7 +1494,7 @@ Macros</h2></td></tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="_b_t_d_8h_source.html#l00132">132</a> of file <a class="el" href="_b_t_d_8h_source.html">BTD.h</a>.</p>
<p>Definition at line <a class="el" href="_b_t_d_8h_source.html#l00135">135</a> of file <a class="el" href="_b_t_d_8h_source.html">BTD.h</a>.</p>
</div>
</div>

View file

@ -1,13 +1,13 @@
<map id="BTD.h" name="BTD.h">
<area shape="rect" id="node2" href="$_usb_8h.html" title="Usb.h" alt="" coords="287,144,329,165"/>
<area shape="rect" id="node18" href="$confdescparser_8h.html" title="confdescparser.h" alt="" coords="649,75,732,96"/>
<area shape="rect" id="node5" href="$avrpins_8h.html" title="avrpins.h" alt="" coords="30,283,84,304"/>
<area shape="rect" id="node7" href="$max3421e_8h.html" title="max3421e.h" alt="" coords="261,283,328,304"/>
<area shape="rect" id="node8" href="$usbhost_8h.html" title="usbhost.h" alt="" coords="169,213,225,235"/>
<area shape="rect" id="node9" href="$usb__ch9_8h.html" title="usb_ch9.h" alt="" coords="109,283,168,304"/>
<area shape="rect" id="node11" href="$address_8h.html" title="address.h" alt="" coords="377,213,433,235"/>
<area shape="rect" id="node14" href="$message_8h.html" title="message.h" alt="" coords="696,213,757,235"/>
<area shape="rect" id="node16" href="$printhex_8h.html" title="printhex.h" alt="" coords="686,352,743,373"/>
<area shape="rect" id="node17" href="$hexdump_8h.html" title="hexdump.h" alt="" coords="731,283,792,304"/>
<area shape="rect" id="node19" href="$parsetools_8h.html" title="parsetools.h" alt="" coords="729,144,793,165"/>
<area shape="rect" id="node2" href="$_usb_8h.html" title="Usb.h" alt="" coords="330,144,372,165"/>
<area shape="rect" id="node18" href="$confdescparser_8h.html" title="confdescparser.h" alt="" coords="688,75,771,96"/>
<area shape="rect" id="node5" href="$avrpins_8h.html" title="avrpins.h" alt="" coords="34,283,88,304"/>
<area shape="rect" id="node7" href="$max3421e_8h.html" title="max3421e.h" alt="" coords="284,283,351,304"/>
<area shape="rect" id="node8" href="$usbhost_8h.html" title="usbhost.h" alt="" coords="152,213,208,235"/>
<area shape="rect" id="node10" href="$usb__ch9_8h.html" title="usb_ch9.h" alt="" coords="500,283,559,304"/>
<area shape="rect" id="node12" href="$address_8h.html" title="address.h" alt="" coords="356,213,412,235"/>
<area shape="rect" id="node14" href="$message_8h.html" title="message.h" alt="" coords="735,213,796,235"/>
<area shape="rect" id="node16" href="$printhex_8h.html" title="printhex.h" alt="" coords="737,352,794,373"/>
<area shape="rect" id="node17" href="$hexdump_8h.html" title="hexdump.h" alt="" coords="735,283,796,304"/>
<area shape="rect" id="node19" href="$parsetools_8h.html" title="parsetools.h" alt="" coords="768,144,832,165"/>
</map>

View file

@ -1 +1 @@
7590baa2d3759abe3fcc949b887c64ce
1d31c5e59c7113c2b9f3932602cea4ca

Binary file not shown.

Before

Width:  |  Height:  |  Size: 76 KiB

After

Width:  |  Height:  |  Size: 81 KiB

View file

@ -118,247 +118,255 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
<div class="line"><a name="l00027"></a><span class="lineno"><a class="code" href="_b_t_d_8h.html#a54903b410722a45f8246653cd4d00632"> 27</a></span>&#160;<span class="preprocessor"></span><span class="preprocessor">#define PS3NAVIGATION_PID 0x042F // Navigation controller</span></div>
<div class="line"><a name="l00028"></a><span class="lineno"><a class="code" href="_b_t_d_8h.html#afc242b8a1b867f79c49ad78e3a47b37f"> 28</a></span>&#160;<span class="preprocessor"></span><span class="preprocessor">#define PS3MOVE_PID 0x03D5 // Motion controller</span></div>
<div class="line"><a name="l00029"></a><span class="lineno"> 29</span>&#160;<span class="preprocessor"></span></div>
<div class="line"><a name="l00030"></a><span class="lineno"> 30</span>&#160;<span class="comment">/* Bluetooth dongle data taken from descriptors */</span></div>
<div class="line"><a name="l00031"></a><span class="lineno"><a class="code" href="_b_t_d_8h.html#a32d591ef5742a99963130616ef146787"> 31</a></span>&#160;<span class="preprocessor">#define BULK_MAXPKTSIZE 64 // max size for ACL data</span></div>
<div class="line"><a name="l00030"></a><span class="lineno"><a class="code" href="_b_t_d_8h.html#a6a28bb0589fbe2da75b238d7568d894d"> 30</a></span>&#160;<span class="preprocessor">#define IOGEAR_GBU521_VID 0x0A5C // The IOGEAR GBU521 dongle does not presents itself correctly, so we have to check for it manually</span></div>
<div class="line"><a name="l00031"></a><span class="lineno"><a class="code" href="_b_t_d_8h.html#aed4a7c4ebf618412176ef19023454fad"> 31</a></span>&#160;<span class="preprocessor"></span><span class="preprocessor">#define IOGEAR_GBU521_PID 0x21E8</span></div>
<div class="line"><a name="l00032"></a><span class="lineno"> 32</span>&#160;<span class="preprocessor"></span></div>
<div class="line"><a name="l00033"></a><span class="lineno"> 33</span>&#160;<span class="comment">// Used in control endpoint header for HCI Commands</span></div>
<div class="line"><a name="l00034"></a><span class="lineno"><a class="code" href="_b_t_d_8h.html#ad70df063f83bf7000558b1d73aa009e5"> 34</a></span>&#160;<span class="preprocessor">#define bmREQ_HCI_OUT USB_SETUP_HOST_TO_DEVICE|USB_SETUP_TYPE_CLASS|USB_SETUP_RECIPIENT_DEVICE</span></div>
<div class="line"><a name="l00035"></a><span class="lineno"> 35</span>&#160;<span class="preprocessor"></span><span class="comment">// Used in control endpoint header for HID Commands</span></div>
<div class="line"><a name="l00036"></a><span class="lineno"><a class="code" href="_b_t_d_8h.html#a5bd4ea095da29635414952894bd527f5"> 36</a></span>&#160;<span class="preprocessor">#define bmREQ_HID_OUT USB_SETUP_HOST_TO_DEVICE|USB_SETUP_TYPE_CLASS|USB_SETUP_RECIPIENT_INTERFACE</span></div>
<div class="line"><a name="l00037"></a><span class="lineno"><a class="code" href="_b_t_d_8h.html#aee05d40a014750b24a7e9967f6f389f4"> 37</a></span>&#160;<span class="preprocessor"></span><span class="preprocessor">#define HID_REQUEST_SET_REPORT 0x09</span></div>
<div class="line"><a name="l00038"></a><span class="lineno"> 38</span>&#160;<span class="preprocessor"></span></div>
<div class="line"><a name="l00039"></a><span class="lineno"> 39</span>&#160;<span class="comment">/* Bluetooth HCI states for hci_task() */</span></div>
<div class="line"><a name="l00040"></a><span class="lineno"><a class="code" href="_b_t_d_8h.html#ac2b910cd6cc87c7bac09617815a1ee9a"> 40</a></span>&#160;<span class="preprocessor">#define HCI_INIT_STATE 0</span></div>
<div class="line"><a name="l00041"></a><span class="lineno"><a class="code" href="_b_t_d_8h.html#af3a7567dba1a0a7ed4272324d7684440"> 41</a></span>&#160;<span class="preprocessor"></span><span class="preprocessor">#define HCI_RESET_STATE 1</span></div>
<div class="line"><a name="l00042"></a><span class="lineno"><a class="code" href="_b_t_d_8h.html#aa4e852587db5ad51c6c5cfb8e9d4f002"> 42</a></span>&#160;<span class="preprocessor"></span><span class="preprocessor">#define HCI_CLASS_STATE 2</span></div>
<div class="line"><a name="l00043"></a><span class="lineno"><a class="code" href="_b_t_d_8h.html#a86fd72d2518d27c02c15af635b55fc8f"> 43</a></span>&#160;<span class="preprocessor"></span><span class="preprocessor">#define HCI_BDADDR_STATE 3</span></div>
<div class="line"><a name="l00044"></a><span class="lineno"><a class="code" href="_b_t_d_8h.html#a8f1d666addd0c2bba7602fbd7a692228"> 44</a></span>&#160;<span class="preprocessor"></span><span class="preprocessor">#define HCI_LOCAL_VERSION_STATE 4</span></div>
<div class="line"><a name="l00045"></a><span class="lineno"><a class="code" href="_b_t_d_8h.html#a1939cc2e06b3185be07a93c1ac7a10e1"> 45</a></span>&#160;<span class="preprocessor"></span><span class="preprocessor">#define HCI_SET_NAME_STATE 5</span></div>
<div class="line"><a name="l00046"></a><span class="lineno"><a class="code" href="_b_t_d_8h.html#a36daee23c5d0f4276e6eb32f3fd79124"> 46</a></span>&#160;<span class="preprocessor"></span><span class="preprocessor">#define HCI_CHECK_WII_SERVICE 6</span></div>
<div class="line"><a name="l00047"></a><span class="lineno"> 47</span>&#160;<span class="preprocessor"></span></div>
<div class="line"><a name="l00048"></a><span class="lineno"><a class="code" href="_b_t_d_8h.html#a09fa39bcefd3255f8ef762034e45679e"> 48</a></span>&#160;<span class="preprocessor">#define HCI_INQUIRY_STATE 7 // These three states are only used if it should pair and connect to a Wii controller</span></div>
<div class="line"><a name="l00049"></a><span class="lineno"><a class="code" href="_b_t_d_8h.html#a2733141c8dae8cd14f78b11b21d58ebb"> 49</a></span>&#160;<span class="preprocessor"></span><span class="preprocessor">#define HCI_CONNECT_WII_STATE 8</span></div>
<div class="line"><a name="l00050"></a><span class="lineno"><a class="code" href="_b_t_d_8h.html#ad497b58476b921e620f05791fa864f04"> 50</a></span>&#160;<span class="preprocessor"></span><span class="preprocessor">#define HCI_CONNECTED_WII_STATE 9</span></div>
<div class="line"><a name="l00051"></a><span class="lineno"> 51</span>&#160;<span class="preprocessor"></span></div>
<div class="line"><a name="l00052"></a><span class="lineno"><a class="code" href="_b_t_d_8h.html#acc9b6954b4bb6c19a9d25242869d5ddf"> 52</a></span>&#160;<span class="preprocessor">#define HCI_SCANNING_STATE 10</span></div>
<div class="line"><a name="l00053"></a><span class="lineno"><a class="code" href="_b_t_d_8h.html#a8bfcf6e1a0a044aba26d728fb0c6a17a"> 53</a></span>&#160;<span class="preprocessor"></span><span class="preprocessor">#define HCI_CONNECT_IN_STATE 11</span></div>
<div class="line"><a name="l00054"></a><span class="lineno"><a class="code" href="_b_t_d_8h.html#a4bad48092981dffe97edb052f5ae08bd"> 54</a></span>&#160;<span class="preprocessor"></span><span class="preprocessor">#define HCI_REMOTE_NAME_STATE 12</span></div>
<div class="line"><a name="l00055"></a><span class="lineno"><a class="code" href="_b_t_d_8h.html#ae0a16d1cc0142186a20379b5c68bd1e0"> 55</a></span>&#160;<span class="preprocessor"></span><span class="preprocessor">#define HCI_CONNECTED_STATE 13</span></div>
<div class="line"><a name="l00056"></a><span class="lineno"><a class="code" href="_b_t_d_8h.html#ad3500c7116f1bb564011dac09a387a5c"> 56</a></span>&#160;<span class="preprocessor"></span><span class="preprocessor">#define HCI_DISABLE_SCAN_STATE 14</span></div>
<div class="line"><a name="l00057"></a><span class="lineno"><a class="code" href="_b_t_d_8h.html#a20fc1ebfc3da8e048f6afe53330e6b8f"> 57</a></span>&#160;<span class="preprocessor"></span><span class="preprocessor">#define HCI_DONE_STATE 15</span></div>
<div class="line"><a name="l00058"></a><span class="lineno"><a class="code" href="_b_t_d_8h.html#a31398eae2e433d1b7b39ea3d6d07cdd0"> 58</a></span>&#160;<span class="preprocessor"></span><span class="preprocessor">#define HCI_DISCONNECT_STATE 16</span></div>
<div class="line"><a name="l00059"></a><span class="lineno"> 59</span>&#160;<span class="preprocessor"></span></div>
<div class="line"><a name="l00060"></a><span class="lineno"> 60</span>&#160;<span class="comment">/* HCI event flags*/</span></div>
<div class="line"><a name="l00061"></a><span class="lineno"><a class="code" href="_b_t_d_8h.html#a14087b750ea2da7f0cef4daaa7683d01"> 61</a></span>&#160;<span class="preprocessor">#define HCI_FLAG_CMD_COMPLETE 0x01</span></div>
<div class="line"><a name="l00062"></a><span class="lineno"><a class="code" href="_b_t_d_8h.html#aa05458d2a47122cd62cd0748c7e1e313"> 62</a></span>&#160;<span class="preprocessor"></span><span class="preprocessor">#define HCI_FLAG_CONN_COMPLETE 0x02</span></div>
<div class="line"><a name="l00063"></a><span class="lineno"><a class="code" href="_b_t_d_8h.html#aec17e7d699b1023a0b6f675feddd7d58"> 63</a></span>&#160;<span class="preprocessor"></span><span class="preprocessor">#define HCI_FLAG_DISCONN_COMPLETE 0x04</span></div>
<div class="line"><a name="l00064"></a><span class="lineno"><a class="code" href="_b_t_d_8h.html#a400af4b61f6e94ab821fa368d8bf2b07"> 64</a></span>&#160;<span class="preprocessor"></span><span class="preprocessor">#define HCI_FLAG_REMOTE_NAME_COMPLETE 0x08</span></div>
<div class="line"><a name="l00065"></a><span class="lineno"><a class="code" href="_b_t_d_8h.html#a0e8a8ce5838e265c1732795bf8822043"> 65</a></span>&#160;<span class="preprocessor"></span><span class="preprocessor">#define HCI_FLAG_INCOMING_REQUEST 0x10</span></div>
<div class="line"><a name="l00066"></a><span class="lineno"><a class="code" href="_b_t_d_8h.html#aabbf8a2ed694a2dc4d4e60fd389c44dd"> 66</a></span>&#160;<span class="preprocessor"></span><span class="preprocessor">#define HCI_FLAG_READ_BDADDR 0x20</span></div>
<div class="line"><a name="l00067"></a><span class="lineno"><a class="code" href="_b_t_d_8h.html#ab3b1f616c1e885e697806f0167b73e8e"> 67</a></span>&#160;<span class="preprocessor"></span><span class="preprocessor">#define HCI_FLAG_READ_VERSION 0x40</span></div>
<div class="line"><a name="l00068"></a><span class="lineno"><a class="code" href="_b_t_d_8h.html#aa991873698787cf45d26efaa370f34e2"> 68</a></span>&#160;<span class="preprocessor"></span><span class="preprocessor">#define HCI_FLAG_WII_FOUND 0x80</span></div>
<div class="line"><a name="l00069"></a><span class="lineno"><a class="code" href="_b_t_d_8h.html#ad14762241e9195fc9a3b0a69ef1ab7f3"> 69</a></span>&#160;<span class="preprocessor"></span><span class="preprocessor">#define HCI_FLAG_CONNECT_EVENT 0x100</span></div>
<div class="line"><a name="l00070"></a><span class="lineno"> 70</span>&#160;<span class="preprocessor"></span></div>
<div class="line"><a name="l00071"></a><span class="lineno"> 71</span>&#160;<span class="comment">/*Macros for HCI event flag tests */</span></div>
<div class="line"><a name="l00072"></a><span class="lineno"><a class="code" href="_b_t_d_8h.html#a9cc765dd92016efe6eaeff535a5193c1"> 72</a></span>&#160;<span class="preprocessor">#define hci_cmd_complete (hci_event_flag &amp; HCI_FLAG_CMD_COMPLETE)</span></div>
<div class="line"><a name="l00073"></a><span class="lineno"><a class="code" href="_b_t_d_8h.html#ae43eba7b19fa5c92de5344819b99ec61"> 73</a></span>&#160;<span class="preprocessor"></span><span class="preprocessor">#define hci_connect_complete (hci_event_flag &amp; HCI_FLAG_CONN_COMPLETE)</span></div>
<div class="line"><a name="l00074"></a><span class="lineno"><a class="code" href="_b_t_d_8h.html#ae67c9cc739a52a8f4a3c28871a07bf1b"> 74</a></span>&#160;<span class="preprocessor"></span><span class="preprocessor">#define hci_disconnect_complete (hci_event_flag &amp; HCI_FLAG_DISCONN_COMPLETE)</span></div>
<div class="line"><a name="l00075"></a><span class="lineno"><a class="code" href="_b_t_d_8h.html#a8f97f22fe3bc827916b8adb724b64a7f"> 75</a></span>&#160;<span class="preprocessor"></span><span class="preprocessor">#define hci_remote_name_complete (hci_event_flag &amp; HCI_FLAG_REMOTE_NAME_COMPLETE)</span></div>
<div class="line"><a name="l00076"></a><span class="lineno"><a class="code" href="_b_t_d_8h.html#aeb3a24db49f8158f85b928385e28d83a"> 76</a></span>&#160;<span class="preprocessor"></span><span class="preprocessor">#define hci_incoming_connect_request (hci_event_flag &amp; HCI_FLAG_INCOMING_REQUEST)</span></div>
<div class="line"><a name="l00077"></a><span class="lineno"><a class="code" href="_b_t_d_8h.html#afc5a7e103eb1301c12aa35af25cc8293"> 77</a></span>&#160;<span class="preprocessor"></span><span class="preprocessor">#define hci_read_bdaddr_complete (hci_event_flag &amp; HCI_FLAG_READ_BDADDR)</span></div>
<div class="line"><a name="l00078"></a><span class="lineno"><a class="code" href="_b_t_d_8h.html#ad205c180970335a666dfe5081b55ade4"> 78</a></span>&#160;<span class="preprocessor"></span><span class="preprocessor">#define hci_read_version_complete (hci_event_flag &amp; HCI_FLAG_READ_VERSION)</span></div>
<div class="line"><a name="l00079"></a><span class="lineno"><a class="code" href="_b_t_d_8h.html#aa12b77df715652f4735cb6620cd595a4"> 79</a></span>&#160;<span class="preprocessor"></span><span class="preprocessor">#define hci_wii_found (hci_event_flag &amp; HCI_FLAG_WII_FOUND)</span></div>
<div class="line"><a name="l00080"></a><span class="lineno"><a class="code" href="_b_t_d_8h.html#a11ae66a6caad9105b8e7658189dcfa7b"> 80</a></span>&#160;<span class="preprocessor"></span><span class="preprocessor">#define hci_connect_event (hci_event_flag &amp; HCI_FLAG_CONNECT_EVENT)</span></div>
<div class="line"><a name="l00081"></a><span class="lineno"> 81</span>&#160;<span class="preprocessor"></span></div>
<div class="line"><a name="l00082"></a><span class="lineno"> 82</span>&#160;<span class="comment">/* HCI Events managed */</span></div>
<div class="line"><a name="l00083"></a><span class="lineno"><a class="code" href="_b_t_d_8h.html#a4c6ca5696adeab36258b3b0c58d804e0"> 83</a></span>&#160;<span class="preprocessor">#define EV_INQUIRY_COMPLETE 0x01</span></div>
<div class="line"><a name="l00084"></a><span class="lineno"><a class="code" href="_b_t_d_8h.html#a335df6d48c8cac828d62196eeaff360b"> 84</a></span>&#160;<span class="preprocessor"></span><span class="preprocessor">#define EV_INQUIRY_RESULT 0x02</span></div>
<div class="line"><a name="l00085"></a><span class="lineno"><a class="code" href="_b_t_d_8h.html#ad4bce42e1ef20447655f8916f23d07a7"> 85</a></span>&#160;<span class="preprocessor"></span><span class="preprocessor">#define EV_CONNECT_COMPLETE 0x03</span></div>
<div class="line"><a name="l00086"></a><span class="lineno"><a class="code" href="_b_t_d_8h.html#af6c5584636f8958689f5cd67290254e1"> 86</a></span>&#160;<span class="preprocessor"></span><span class="preprocessor">#define EV_INCOMING_CONNECT 0x04</span></div>
<div class="line"><a name="l00087"></a><span class="lineno"><a class="code" href="_b_t_d_8h.html#a1cf7e4d4426dcabed8976b65beee0d99"> 87</a></span>&#160;<span class="preprocessor"></span><span class="preprocessor">#define EV_DISCONNECT_COMPLETE 0x05</span></div>
<div class="line"><a name="l00088"></a><span class="lineno"><a class="code" href="_b_t_d_8h.html#a68b8f78a0e0da80434afb1e6d40eacf4"> 88</a></span>&#160;<span class="preprocessor"></span><span class="preprocessor">#define EV_AUTHENTICATION_COMPLETE 0x06</span></div>
<div class="line"><a name="l00089"></a><span class="lineno"><a class="code" href="_b_t_d_8h.html#a29c1744f72f3cd85865c8173eace5a36"> 89</a></span>&#160;<span class="preprocessor"></span><span class="preprocessor">#define EV_REMOTE_NAME_COMPLETE 0x07</span></div>
<div class="line"><a name="l00090"></a><span class="lineno"><a class="code" href="_b_t_d_8h.html#aa0bf5ac66c412d3415dbb753630d0e58"> 90</a></span>&#160;<span class="preprocessor"></span><span class="preprocessor">#define EV_ENCRYPTION_CHANGE 0x08</span></div>
<div class="line"><a name="l00091"></a><span class="lineno"><a class="code" href="_b_t_d_8h.html#a3e107e9d07793ca5cfaeea8b2181d4a4"> 91</a></span>&#160;<span class="preprocessor"></span><span class="preprocessor">#define EV_CHANGE_CONNECTION_LINK 0x09</span></div>
<div class="line"><a name="l00092"></a><span class="lineno"><a class="code" href="_b_t_d_8h.html#ac61db50de3007a22e19e660bd7e68e69"> 92</a></span>&#160;<span class="preprocessor"></span><span class="preprocessor">#define EV_ROLE_CHANGED 0x12</span></div>
<div class="line"><a name="l00093"></a><span class="lineno"><a class="code" href="_b_t_d_8h.html#a0987119cfc40f3011a2cec69686034df"> 93</a></span>&#160;<span class="preprocessor"></span><span class="preprocessor">#define EV_NUM_COMPLETE_PKT 0x13</span></div>
<div class="line"><a name="l00094"></a><span class="lineno"><a class="code" href="_b_t_d_8h.html#a935633384e87daa14b60549134014ec4"> 94</a></span>&#160;<span class="preprocessor"></span><span class="preprocessor">#define EV_PIN_CODE_REQUEST 0x16</span></div>
<div class="line"><a name="l00095"></a><span class="lineno"><a class="code" href="_b_t_d_8h.html#a8c77c922bb61301760ebf5af5f1cc7f0"> 95</a></span>&#160;<span class="preprocessor"></span><span class="preprocessor">#define EV_LINK_KEY_REQUEST 0x17</span></div>
<div class="line"><a name="l00096"></a><span class="lineno"><a class="code" href="_b_t_d_8h.html#a8c662496af1164370e5fdf7149ecd842"> 96</a></span>&#160;<span class="preprocessor"></span><span class="preprocessor">#define EV_LINK_KEY_NOTIFICATION 0x18</span></div>
<div class="line"><a name="l00097"></a><span class="lineno"><a class="code" href="_b_t_d_8h.html#a6f8b4cf8546d9928a34c9c681dc5a6d5"> 97</a></span>&#160;<span class="preprocessor"></span><span class="preprocessor">#define EV_DATA_BUFFER_OVERFLOW 0x1A</span></div>
<div class="line"><a name="l00098"></a><span class="lineno"><a class="code" href="_b_t_d_8h.html#a2ad6543cdfe06cbf0924c287c08f36d7"> 98</a></span>&#160;<span class="preprocessor"></span><span class="preprocessor">#define EV_MAX_SLOTS_CHANGE 0x1B</span></div>
<div class="line"><a name="l00099"></a><span class="lineno"><a class="code" href="_b_t_d_8h.html#a830b2a3bcb09c4802910e8b05531d317"> 99</a></span>&#160;<span class="preprocessor"></span><span class="preprocessor">#define EV_READ_REMOTE_VERSION_INFORMATION_COMPLETE 0x0C</span></div>
<div class="line"><a name="l00100"></a><span class="lineno"><a class="code" href="_b_t_d_8h.html#a1b58792b76e0f216df8160bf055032c3"> 100</a></span>&#160;<span class="preprocessor"></span><span class="preprocessor">#define EV_QOS_SETUP_COMPLETE 0x0D</span></div>
<div class="line"><a name="l00101"></a><span class="lineno"><a class="code" href="_b_t_d_8h.html#a81b71e0ba648260143529b04ae84e528"> 101</a></span>&#160;<span class="preprocessor"></span><span class="preprocessor">#define EV_COMMAND_COMPLETE 0x0E</span></div>
<div class="line"><a name="l00102"></a><span class="lineno"><a class="code" href="_b_t_d_8h.html#a090ee10cc1a1c1c3bbb29a93c330d2d4"> 102</a></span>&#160;<span class="preprocessor"></span><span class="preprocessor">#define EV_COMMAND_STATUS 0x0F</span></div>
<div class="line"><a name="l00103"></a><span class="lineno"><a class="code" href="_b_t_d_8h.html#acd5f65703cc34b112a1f656d9a49551b"> 103</a></span>&#160;<span class="preprocessor"></span><span class="preprocessor">#define EV_LOOPBACK_COMMAND 0x19</span></div>
<div class="line"><a name="l00104"></a><span class="lineno"><a class="code" href="_b_t_d_8h.html#ad8481acc0b144d97017f8a06d63ff47c"> 104</a></span>&#160;<span class="preprocessor"></span><span class="preprocessor">#define EV_PAGE_SCAN_REP_MODE 0x20</span></div>
<div class="line"><a name="l00105"></a><span class="lineno"> 105</span>&#160;<span class="preprocessor"></span></div>
<div class="line"><a name="l00106"></a><span class="lineno"> 106</span>&#160;<span class="comment">/* L2CAP signaling commands */</span></div>
<div class="line"><a name="l00107"></a><span class="lineno"><a class="code" href="_b_t_d_8h.html#a6ffcd72787c86f248192eb06a3fe18cb"> 107</a></span>&#160;<span class="preprocessor">#define L2CAP_CMD_COMMAND_REJECT 0x01</span></div>
<div class="line"><a name="l00108"></a><span class="lineno"><a class="code" href="_b_t_d_8h.html#ac4bae0c65fd00ed849cb226302d19c85"> 108</a></span>&#160;<span class="preprocessor"></span><span class="preprocessor">#define L2CAP_CMD_CONNECTION_REQUEST 0x02</span></div>
<div class="line"><a name="l00109"></a><span class="lineno"><a class="code" href="_b_t_d_8h.html#aef7b306479de265d725dbe5816a8227b"> 109</a></span>&#160;<span class="preprocessor"></span><span class="preprocessor">#define L2CAP_CMD_CONNECTION_RESPONSE 0x03</span></div>
<div class="line"><a name="l00110"></a><span class="lineno"><a class="code" href="_b_t_d_8h.html#a48bcd73461d736d0ef889e1fe6e36f69"> 110</a></span>&#160;<span class="preprocessor"></span><span class="preprocessor">#define L2CAP_CMD_CONFIG_REQUEST 0x04</span></div>
<div class="line"><a name="l00111"></a><span class="lineno"><a class="code" href="_b_t_d_8h.html#a8151b1fe5d940a5a7a34f43a8b8ce434"> 111</a></span>&#160;<span class="preprocessor"></span><span class="preprocessor">#define L2CAP_CMD_CONFIG_RESPONSE 0x05</span></div>
<div class="line"><a name="l00112"></a><span class="lineno"><a class="code" href="_b_t_d_8h.html#a398676a2e9a2351a5a52afdddf4b660b"> 112</a></span>&#160;<span class="preprocessor"></span><span class="preprocessor">#define L2CAP_CMD_DISCONNECT_REQUEST 0x06</span></div>
<div class="line"><a name="l00113"></a><span class="lineno"><a class="code" href="_b_t_d_8h.html#a4c64a41200714e457b397496183dc0e4"> 113</a></span>&#160;<span class="preprocessor"></span><span class="preprocessor">#define L2CAP_CMD_DISCONNECT_RESPONSE 0x07</span></div>
<div class="line"><a name="l00114"></a><span class="lineno"><a class="code" href="_b_t_d_8h.html#a200eb6c7c905ec74a9daf0f262af0448"> 114</a></span>&#160;<span class="preprocessor"></span><span class="preprocessor">#define L2CAP_CMD_INFORMATION_REQUEST 0x0A</span></div>
<div class="line"><a name="l00115"></a><span class="lineno"><a class="code" href="_b_t_d_8h.html#af32d4c53927d596a8727ff232310dec1"> 115</a></span>&#160;<span class="preprocessor"></span><span class="preprocessor">#define L2CAP_CMD_INFORMATION_RESPONSE 0x0B</span></div>
<div class="line"><a name="l00116"></a><span class="lineno"> 116</span>&#160;<span class="preprocessor"></span></div>
<div class="line"><a name="l00117"></a><span class="lineno"> 117</span>&#160;<span class="comment">// Used For Connection Response - Remember to Include High Byte</span></div>
<div class="line"><a name="l00118"></a><span class="lineno"><a class="code" href="_b_t_d_8h.html#a9960d0d5ae92fc92c70bbb84c2a5c0cc"> 118</a></span>&#160;<span class="preprocessor">#define PENDING 0x01</span></div>
<div class="line"><a name="l00119"></a><span class="lineno"><a class="code" href="_b_t_d_8h.html#a1be7a56cdddcdb7dedf16d4dee381e93"> 119</a></span>&#160;<span class="preprocessor"></span><span class="preprocessor">#define SUCCESSFUL 0x00</span></div>
<div class="line"><a name="l00120"></a><span class="lineno"> 120</span>&#160;<span class="preprocessor"></span></div>
<div class="line"><a name="l00121"></a><span class="lineno"> 121</span>&#160;<span class="comment">/* Bluetooth L2CAP PSM - see http://www.bluetooth.org/Technical/AssignedNumbers/logical_link.htm */</span></div>
<div class="line"><a name="l00122"></a><span class="lineno"><a class="code" href="_b_t_d_8h.html#a25ce859d7ee2730e1d22d11c051ed60d"> 122</a></span>&#160;<span class="preprocessor">#define SDP_PSM 0x01 // Service Discovery Protocol PSM Value</span></div>
<div class="line"><a name="l00123"></a><span class="lineno"><a class="code" href="_b_t_d_8h.html#a2924020f2e7e82fe956574538e2bc3eb"> 123</a></span>&#160;<span class="preprocessor"></span><span class="preprocessor">#define RFCOMM_PSM 0x03 // RFCOMM PSM Value</span></div>
<div class="line"><a name="l00124"></a><span class="lineno"><a class="code" href="_b_t_d_8h.html#a1465673868452307bcdab8e201430c27"> 124</a></span>&#160;<span class="preprocessor"></span><span class="preprocessor">#define HID_CTRL_PSM 0x11 // HID_Control PSM Value</span></div>
<div class="line"><a name="l00125"></a><span class="lineno"><a class="code" href="_b_t_d_8h.html#a4c5ac96db74d61d4a5a5d945a400e7da"> 125</a></span>&#160;<span class="preprocessor"></span><span class="preprocessor">#define HID_INTR_PSM 0x13 // HID_Interrupt PSM Value</span></div>
<div class="line"><a name="l00126"></a><span class="lineno"> 126</span>&#160;<span class="preprocessor"></span></div>
<div class="line"><a name="l00127"></a><span class="lineno"> 127</span>&#160;<span class="comment">// Used to determine if it is a Bluetooth dongle</span></div>
<div class="line"><a name="l00128"></a><span class="lineno"><a class="code" href="_b_t_d_8h.html#a177fe269ddb7979d99b76d52bc281551"> 128</a></span>&#160;<span class="preprocessor">#define WI_SUBCLASS_RF 0x01 // RF Controller</span></div>
<div class="line"><a name="l00129"></a><span class="lineno"><a class="code" href="_b_t_d_8h.html#a05903a9351c5ced6b8be27b2869e62af"> 129</a></span>&#160;<span class="preprocessor"></span><span class="preprocessor">#define WI_PROTOCOL_BT 0x01 // Bluetooth Programming Interface</span></div>
<div class="line"><a name="l00130"></a><span class="lineno"> 130</span>&#160;<span class="preprocessor"></span></div>
<div class="line"><a name="l00131"></a><span class="lineno"><a class="code" href="_b_t_d_8h.html#aee41c4878894db24e7ad8cd6246595cd"> 131</a></span>&#160;<span class="preprocessor">#define BTD_MAX_ENDPOINTS 4</span></div>
<div class="line"><a name="l00132"></a><span class="lineno"><a class="code" href="_b_t_d_8h.html#a2222709eed4c8af293e881ea36f599b0"> 132</a></span>&#160;<span class="preprocessor"></span><span class="preprocessor">#define BTD_NUMSERVICES 4 // Max number of Bluetooth services - if you need more than four simply increase this number</span></div>
<div class="line"><a name="l00033"></a><span class="lineno"> 33</span>&#160;<span class="comment">/* Bluetooth dongle data taken from descriptors */</span></div>
<div class="line"><a name="l00034"></a><span class="lineno"><a class="code" href="_b_t_d_8h.html#a32d591ef5742a99963130616ef146787"> 34</a></span>&#160;<span class="preprocessor">#define BULK_MAXPKTSIZE 64 // max size for ACL data</span></div>
<div class="line"><a name="l00035"></a><span class="lineno"> 35</span>&#160;<span class="preprocessor"></span></div>
<div class="line"><a name="l00036"></a><span class="lineno"> 36</span>&#160;<span class="comment">// Used in control endpoint header for HCI Commands</span></div>
<div class="line"><a name="l00037"></a><span class="lineno"><a class="code" href="_b_t_d_8h.html#ad70df063f83bf7000558b1d73aa009e5"> 37</a></span>&#160;<span class="preprocessor">#define bmREQ_HCI_OUT USB_SETUP_HOST_TO_DEVICE|USB_SETUP_TYPE_CLASS|USB_SETUP_RECIPIENT_DEVICE</span></div>
<div class="line"><a name="l00038"></a><span class="lineno"> 38</span>&#160;<span class="preprocessor"></span><span class="comment">// Used in control endpoint header for HID Commands</span></div>
<div class="line"><a name="l00039"></a><span class="lineno"><a class="code" href="_b_t_d_8h.html#a5bd4ea095da29635414952894bd527f5"> 39</a></span>&#160;<span class="preprocessor">#define bmREQ_HID_OUT USB_SETUP_HOST_TO_DEVICE|USB_SETUP_TYPE_CLASS|USB_SETUP_RECIPIENT_INTERFACE</span></div>
<div class="line"><a name="l00040"></a><span class="lineno"><a class="code" href="_b_t_d_8h.html#aee05d40a014750b24a7e9967f6f389f4"> 40</a></span>&#160;<span class="preprocessor"></span><span class="preprocessor">#define HID_REQUEST_SET_REPORT 0x09</span></div>
<div class="line"><a name="l00041"></a><span class="lineno"> 41</span>&#160;<span class="preprocessor"></span></div>
<div class="line"><a name="l00042"></a><span class="lineno"> 42</span>&#160;<span class="comment">/* Bluetooth HCI states for hci_task() */</span></div>
<div class="line"><a name="l00043"></a><span class="lineno"><a class="code" href="_b_t_d_8h.html#ac2b910cd6cc87c7bac09617815a1ee9a"> 43</a></span>&#160;<span class="preprocessor">#define HCI_INIT_STATE 0</span></div>
<div class="line"><a name="l00044"></a><span class="lineno"><a class="code" href="_b_t_d_8h.html#af3a7567dba1a0a7ed4272324d7684440"> 44</a></span>&#160;<span class="preprocessor"></span><span class="preprocessor">#define HCI_RESET_STATE 1</span></div>
<div class="line"><a name="l00045"></a><span class="lineno"><a class="code" href="_b_t_d_8h.html#aa4e852587db5ad51c6c5cfb8e9d4f002"> 45</a></span>&#160;<span class="preprocessor"></span><span class="preprocessor">#define HCI_CLASS_STATE 2</span></div>
<div class="line"><a name="l00046"></a><span class="lineno"><a class="code" href="_b_t_d_8h.html#a86fd72d2518d27c02c15af635b55fc8f"> 46</a></span>&#160;<span class="preprocessor"></span><span class="preprocessor">#define HCI_BDADDR_STATE 3</span></div>
<div class="line"><a name="l00047"></a><span class="lineno"><a class="code" href="_b_t_d_8h.html#a8f1d666addd0c2bba7602fbd7a692228"> 47</a></span>&#160;<span class="preprocessor"></span><span class="preprocessor">#define HCI_LOCAL_VERSION_STATE 4</span></div>
<div class="line"><a name="l00048"></a><span class="lineno"><a class="code" href="_b_t_d_8h.html#a1939cc2e06b3185be07a93c1ac7a10e1"> 48</a></span>&#160;<span class="preprocessor"></span><span class="preprocessor">#define HCI_SET_NAME_STATE 5</span></div>
<div class="line"><a name="l00049"></a><span class="lineno"><a class="code" href="_b_t_d_8h.html#a36daee23c5d0f4276e6eb32f3fd79124"> 49</a></span>&#160;<span class="preprocessor"></span><span class="preprocessor">#define HCI_CHECK_WII_SERVICE 6</span></div>
<div class="line"><a name="l00050"></a><span class="lineno"> 50</span>&#160;<span class="preprocessor"></span></div>
<div class="line"><a name="l00051"></a><span class="lineno"><a class="code" href="_b_t_d_8h.html#a09fa39bcefd3255f8ef762034e45679e"> 51</a></span>&#160;<span class="preprocessor">#define HCI_INQUIRY_STATE 7 // These three states are only used if it should pair and connect to a Wii controller</span></div>
<div class="line"><a name="l00052"></a><span class="lineno"><a class="code" href="_b_t_d_8h.html#a2733141c8dae8cd14f78b11b21d58ebb"> 52</a></span>&#160;<span class="preprocessor"></span><span class="preprocessor">#define HCI_CONNECT_WII_STATE 8</span></div>
<div class="line"><a name="l00053"></a><span class="lineno"><a class="code" href="_b_t_d_8h.html#ad497b58476b921e620f05791fa864f04"> 53</a></span>&#160;<span class="preprocessor"></span><span class="preprocessor">#define HCI_CONNECTED_WII_STATE 9</span></div>
<div class="line"><a name="l00054"></a><span class="lineno"> 54</span>&#160;<span class="preprocessor"></span></div>
<div class="line"><a name="l00055"></a><span class="lineno"><a class="code" href="_b_t_d_8h.html#acc9b6954b4bb6c19a9d25242869d5ddf"> 55</a></span>&#160;<span class="preprocessor">#define HCI_SCANNING_STATE 10</span></div>
<div class="line"><a name="l00056"></a><span class="lineno"><a class="code" href="_b_t_d_8h.html#a8bfcf6e1a0a044aba26d728fb0c6a17a"> 56</a></span>&#160;<span class="preprocessor"></span><span class="preprocessor">#define HCI_CONNECT_IN_STATE 11</span></div>
<div class="line"><a name="l00057"></a><span class="lineno"><a class="code" href="_b_t_d_8h.html#a4bad48092981dffe97edb052f5ae08bd"> 57</a></span>&#160;<span class="preprocessor"></span><span class="preprocessor">#define HCI_REMOTE_NAME_STATE 12</span></div>
<div class="line"><a name="l00058"></a><span class="lineno"><a class="code" href="_b_t_d_8h.html#ae0a16d1cc0142186a20379b5c68bd1e0"> 58</a></span>&#160;<span class="preprocessor"></span><span class="preprocessor">#define HCI_CONNECTED_STATE 13</span></div>
<div class="line"><a name="l00059"></a><span class="lineno"><a class="code" href="_b_t_d_8h.html#ad3500c7116f1bb564011dac09a387a5c"> 59</a></span>&#160;<span class="preprocessor"></span><span class="preprocessor">#define HCI_DISABLE_SCAN_STATE 14</span></div>
<div class="line"><a name="l00060"></a><span class="lineno"><a class="code" href="_b_t_d_8h.html#a20fc1ebfc3da8e048f6afe53330e6b8f"> 60</a></span>&#160;<span class="preprocessor"></span><span class="preprocessor">#define HCI_DONE_STATE 15</span></div>
<div class="line"><a name="l00061"></a><span class="lineno"><a class="code" href="_b_t_d_8h.html#a31398eae2e433d1b7b39ea3d6d07cdd0"> 61</a></span>&#160;<span class="preprocessor"></span><span class="preprocessor">#define HCI_DISCONNECT_STATE 16</span></div>
<div class="line"><a name="l00062"></a><span class="lineno"> 62</span>&#160;<span class="preprocessor"></span></div>
<div class="line"><a name="l00063"></a><span class="lineno"> 63</span>&#160;<span class="comment">/* HCI event flags*/</span></div>
<div class="line"><a name="l00064"></a><span class="lineno"><a class="code" href="_b_t_d_8h.html#a14087b750ea2da7f0cef4daaa7683d01"> 64</a></span>&#160;<span class="preprocessor">#define HCI_FLAG_CMD_COMPLETE 0x01</span></div>
<div class="line"><a name="l00065"></a><span class="lineno"><a class="code" href="_b_t_d_8h.html#aa05458d2a47122cd62cd0748c7e1e313"> 65</a></span>&#160;<span class="preprocessor"></span><span class="preprocessor">#define HCI_FLAG_CONN_COMPLETE 0x02</span></div>
<div class="line"><a name="l00066"></a><span class="lineno"><a class="code" href="_b_t_d_8h.html#aec17e7d699b1023a0b6f675feddd7d58"> 66</a></span>&#160;<span class="preprocessor"></span><span class="preprocessor">#define HCI_FLAG_DISCONN_COMPLETE 0x04</span></div>
<div class="line"><a name="l00067"></a><span class="lineno"><a class="code" href="_b_t_d_8h.html#a400af4b61f6e94ab821fa368d8bf2b07"> 67</a></span>&#160;<span class="preprocessor"></span><span class="preprocessor">#define HCI_FLAG_REMOTE_NAME_COMPLETE 0x08</span></div>
<div class="line"><a name="l00068"></a><span class="lineno"><a class="code" href="_b_t_d_8h.html#a0e8a8ce5838e265c1732795bf8822043"> 68</a></span>&#160;<span class="preprocessor"></span><span class="preprocessor">#define HCI_FLAG_INCOMING_REQUEST 0x10</span></div>
<div class="line"><a name="l00069"></a><span class="lineno"><a class="code" href="_b_t_d_8h.html#aabbf8a2ed694a2dc4d4e60fd389c44dd"> 69</a></span>&#160;<span class="preprocessor"></span><span class="preprocessor">#define HCI_FLAG_READ_BDADDR 0x20</span></div>
<div class="line"><a name="l00070"></a><span class="lineno"><a class="code" href="_b_t_d_8h.html#ab3b1f616c1e885e697806f0167b73e8e"> 70</a></span>&#160;<span class="preprocessor"></span><span class="preprocessor">#define HCI_FLAG_READ_VERSION 0x40</span></div>
<div class="line"><a name="l00071"></a><span class="lineno"><a class="code" href="_b_t_d_8h.html#aa991873698787cf45d26efaa370f34e2"> 71</a></span>&#160;<span class="preprocessor"></span><span class="preprocessor">#define HCI_FLAG_WII_FOUND 0x80</span></div>
<div class="line"><a name="l00072"></a><span class="lineno"><a class="code" href="_b_t_d_8h.html#ad14762241e9195fc9a3b0a69ef1ab7f3"> 72</a></span>&#160;<span class="preprocessor"></span><span class="preprocessor">#define HCI_FLAG_CONNECT_EVENT 0x100</span></div>
<div class="line"><a name="l00073"></a><span class="lineno"> 73</span>&#160;<span class="preprocessor"></span></div>
<div class="line"><a name="l00074"></a><span class="lineno"> 74</span>&#160;<span class="comment">/*Macros for HCI event flag tests */</span></div>
<div class="line"><a name="l00075"></a><span class="lineno"><a class="code" href="_b_t_d_8h.html#a9cc765dd92016efe6eaeff535a5193c1"> 75</a></span>&#160;<span class="preprocessor">#define hci_cmd_complete (hci_event_flag &amp; HCI_FLAG_CMD_COMPLETE)</span></div>
<div class="line"><a name="l00076"></a><span class="lineno"><a class="code" href="_b_t_d_8h.html#ae43eba7b19fa5c92de5344819b99ec61"> 76</a></span>&#160;<span class="preprocessor"></span><span class="preprocessor">#define hci_connect_complete (hci_event_flag &amp; HCI_FLAG_CONN_COMPLETE)</span></div>
<div class="line"><a name="l00077"></a><span class="lineno"><a class="code" href="_b_t_d_8h.html#ae67c9cc739a52a8f4a3c28871a07bf1b"> 77</a></span>&#160;<span class="preprocessor"></span><span class="preprocessor">#define hci_disconnect_complete (hci_event_flag &amp; HCI_FLAG_DISCONN_COMPLETE)</span></div>
<div class="line"><a name="l00078"></a><span class="lineno"><a class="code" href="_b_t_d_8h.html#a8f97f22fe3bc827916b8adb724b64a7f"> 78</a></span>&#160;<span class="preprocessor"></span><span class="preprocessor">#define hci_remote_name_complete (hci_event_flag &amp; HCI_FLAG_REMOTE_NAME_COMPLETE)</span></div>
<div class="line"><a name="l00079"></a><span class="lineno"><a class="code" href="_b_t_d_8h.html#aeb3a24db49f8158f85b928385e28d83a"> 79</a></span>&#160;<span class="preprocessor"></span><span class="preprocessor">#define hci_incoming_connect_request (hci_event_flag &amp; HCI_FLAG_INCOMING_REQUEST)</span></div>
<div class="line"><a name="l00080"></a><span class="lineno"><a class="code" href="_b_t_d_8h.html#afc5a7e103eb1301c12aa35af25cc8293"> 80</a></span>&#160;<span class="preprocessor"></span><span class="preprocessor">#define hci_read_bdaddr_complete (hci_event_flag &amp; HCI_FLAG_READ_BDADDR)</span></div>
<div class="line"><a name="l00081"></a><span class="lineno"><a class="code" href="_b_t_d_8h.html#ad205c180970335a666dfe5081b55ade4"> 81</a></span>&#160;<span class="preprocessor"></span><span class="preprocessor">#define hci_read_version_complete (hci_event_flag &amp; HCI_FLAG_READ_VERSION)</span></div>
<div class="line"><a name="l00082"></a><span class="lineno"><a class="code" href="_b_t_d_8h.html#aa12b77df715652f4735cb6620cd595a4"> 82</a></span>&#160;<span class="preprocessor"></span><span class="preprocessor">#define hci_wii_found (hci_event_flag &amp; HCI_FLAG_WII_FOUND)</span></div>
<div class="line"><a name="l00083"></a><span class="lineno"><a class="code" href="_b_t_d_8h.html#a11ae66a6caad9105b8e7658189dcfa7b"> 83</a></span>&#160;<span class="preprocessor"></span><span class="preprocessor">#define hci_connect_event (hci_event_flag &amp; HCI_FLAG_CONNECT_EVENT)</span></div>
<div class="line"><a name="l00084"></a><span class="lineno"> 84</span>&#160;<span class="preprocessor"></span></div>
<div class="line"><a name="l00085"></a><span class="lineno"> 85</span>&#160;<span class="comment">/* HCI Events managed */</span></div>
<div class="line"><a name="l00086"></a><span class="lineno"><a class="code" href="_b_t_d_8h.html#a4c6ca5696adeab36258b3b0c58d804e0"> 86</a></span>&#160;<span class="preprocessor">#define EV_INQUIRY_COMPLETE 0x01</span></div>
<div class="line"><a name="l00087"></a><span class="lineno"><a class="code" href="_b_t_d_8h.html#a335df6d48c8cac828d62196eeaff360b"> 87</a></span>&#160;<span class="preprocessor"></span><span class="preprocessor">#define EV_INQUIRY_RESULT 0x02</span></div>
<div class="line"><a name="l00088"></a><span class="lineno"><a class="code" href="_b_t_d_8h.html#ad4bce42e1ef20447655f8916f23d07a7"> 88</a></span>&#160;<span class="preprocessor"></span><span class="preprocessor">#define EV_CONNECT_COMPLETE 0x03</span></div>
<div class="line"><a name="l00089"></a><span class="lineno"><a class="code" href="_b_t_d_8h.html#af6c5584636f8958689f5cd67290254e1"> 89</a></span>&#160;<span class="preprocessor"></span><span class="preprocessor">#define EV_INCOMING_CONNECT 0x04</span></div>
<div class="line"><a name="l00090"></a><span class="lineno"><a class="code" href="_b_t_d_8h.html#a1cf7e4d4426dcabed8976b65beee0d99"> 90</a></span>&#160;<span class="preprocessor"></span><span class="preprocessor">#define EV_DISCONNECT_COMPLETE 0x05</span></div>
<div class="line"><a name="l00091"></a><span class="lineno"><a class="code" href="_b_t_d_8h.html#a68b8f78a0e0da80434afb1e6d40eacf4"> 91</a></span>&#160;<span class="preprocessor"></span><span class="preprocessor">#define EV_AUTHENTICATION_COMPLETE 0x06</span></div>
<div class="line"><a name="l00092"></a><span class="lineno"><a class="code" href="_b_t_d_8h.html#a29c1744f72f3cd85865c8173eace5a36"> 92</a></span>&#160;<span class="preprocessor"></span><span class="preprocessor">#define EV_REMOTE_NAME_COMPLETE 0x07</span></div>
<div class="line"><a name="l00093"></a><span class="lineno"><a class="code" href="_b_t_d_8h.html#aa0bf5ac66c412d3415dbb753630d0e58"> 93</a></span>&#160;<span class="preprocessor"></span><span class="preprocessor">#define EV_ENCRYPTION_CHANGE 0x08</span></div>
<div class="line"><a name="l00094"></a><span class="lineno"><a class="code" href="_b_t_d_8h.html#a3e107e9d07793ca5cfaeea8b2181d4a4"> 94</a></span>&#160;<span class="preprocessor"></span><span class="preprocessor">#define EV_CHANGE_CONNECTION_LINK 0x09</span></div>
<div class="line"><a name="l00095"></a><span class="lineno"><a class="code" href="_b_t_d_8h.html#ac61db50de3007a22e19e660bd7e68e69"> 95</a></span>&#160;<span class="preprocessor"></span><span class="preprocessor">#define EV_ROLE_CHANGED 0x12</span></div>
<div class="line"><a name="l00096"></a><span class="lineno"><a class="code" href="_b_t_d_8h.html#a0987119cfc40f3011a2cec69686034df"> 96</a></span>&#160;<span class="preprocessor"></span><span class="preprocessor">#define EV_NUM_COMPLETE_PKT 0x13</span></div>
<div class="line"><a name="l00097"></a><span class="lineno"><a class="code" href="_b_t_d_8h.html#a935633384e87daa14b60549134014ec4"> 97</a></span>&#160;<span class="preprocessor"></span><span class="preprocessor">#define EV_PIN_CODE_REQUEST 0x16</span></div>
<div class="line"><a name="l00098"></a><span class="lineno"><a class="code" href="_b_t_d_8h.html#a8c77c922bb61301760ebf5af5f1cc7f0"> 98</a></span>&#160;<span class="preprocessor"></span><span class="preprocessor">#define EV_LINK_KEY_REQUEST 0x17</span></div>
<div class="line"><a name="l00099"></a><span class="lineno"><a class="code" href="_b_t_d_8h.html#a8c662496af1164370e5fdf7149ecd842"> 99</a></span>&#160;<span class="preprocessor"></span><span class="preprocessor">#define EV_LINK_KEY_NOTIFICATION 0x18</span></div>
<div class="line"><a name="l00100"></a><span class="lineno"><a class="code" href="_b_t_d_8h.html#a6f8b4cf8546d9928a34c9c681dc5a6d5"> 100</a></span>&#160;<span class="preprocessor"></span><span class="preprocessor">#define EV_DATA_BUFFER_OVERFLOW 0x1A</span></div>
<div class="line"><a name="l00101"></a><span class="lineno"><a class="code" href="_b_t_d_8h.html#a2ad6543cdfe06cbf0924c287c08f36d7"> 101</a></span>&#160;<span class="preprocessor"></span><span class="preprocessor">#define EV_MAX_SLOTS_CHANGE 0x1B</span></div>
<div class="line"><a name="l00102"></a><span class="lineno"><a class="code" href="_b_t_d_8h.html#a830b2a3bcb09c4802910e8b05531d317"> 102</a></span>&#160;<span class="preprocessor"></span><span class="preprocessor">#define EV_READ_REMOTE_VERSION_INFORMATION_COMPLETE 0x0C</span></div>
<div class="line"><a name="l00103"></a><span class="lineno"><a class="code" href="_b_t_d_8h.html#a1b58792b76e0f216df8160bf055032c3"> 103</a></span>&#160;<span class="preprocessor"></span><span class="preprocessor">#define EV_QOS_SETUP_COMPLETE 0x0D</span></div>
<div class="line"><a name="l00104"></a><span class="lineno"><a class="code" href="_b_t_d_8h.html#a81b71e0ba648260143529b04ae84e528"> 104</a></span>&#160;<span class="preprocessor"></span><span class="preprocessor">#define EV_COMMAND_COMPLETE 0x0E</span></div>
<div class="line"><a name="l00105"></a><span class="lineno"><a class="code" href="_b_t_d_8h.html#a090ee10cc1a1c1c3bbb29a93c330d2d4"> 105</a></span>&#160;<span class="preprocessor"></span><span class="preprocessor">#define EV_COMMAND_STATUS 0x0F</span></div>
<div class="line"><a name="l00106"></a><span class="lineno"><a class="code" href="_b_t_d_8h.html#acd5f65703cc34b112a1f656d9a49551b"> 106</a></span>&#160;<span class="preprocessor"></span><span class="preprocessor">#define EV_LOOPBACK_COMMAND 0x19</span></div>
<div class="line"><a name="l00107"></a><span class="lineno"><a class="code" href="_b_t_d_8h.html#ad8481acc0b144d97017f8a06d63ff47c"> 107</a></span>&#160;<span class="preprocessor"></span><span class="preprocessor">#define EV_PAGE_SCAN_REP_MODE 0x20</span></div>
<div class="line"><a name="l00108"></a><span class="lineno"> 108</span>&#160;<span class="preprocessor"></span></div>
<div class="line"><a name="l00109"></a><span class="lineno"> 109</span>&#160;<span class="comment">/* L2CAP signaling commands */</span></div>
<div class="line"><a name="l00110"></a><span class="lineno"><a class="code" href="_b_t_d_8h.html#a6ffcd72787c86f248192eb06a3fe18cb"> 110</a></span>&#160;<span class="preprocessor">#define L2CAP_CMD_COMMAND_REJECT 0x01</span></div>
<div class="line"><a name="l00111"></a><span class="lineno"><a class="code" href="_b_t_d_8h.html#ac4bae0c65fd00ed849cb226302d19c85"> 111</a></span>&#160;<span class="preprocessor"></span><span class="preprocessor">#define L2CAP_CMD_CONNECTION_REQUEST 0x02</span></div>
<div class="line"><a name="l00112"></a><span class="lineno"><a class="code" href="_b_t_d_8h.html#aef7b306479de265d725dbe5816a8227b"> 112</a></span>&#160;<span class="preprocessor"></span><span class="preprocessor">#define L2CAP_CMD_CONNECTION_RESPONSE 0x03</span></div>
<div class="line"><a name="l00113"></a><span class="lineno"><a class="code" href="_b_t_d_8h.html#a48bcd73461d736d0ef889e1fe6e36f69"> 113</a></span>&#160;<span class="preprocessor"></span><span class="preprocessor">#define L2CAP_CMD_CONFIG_REQUEST 0x04</span></div>
<div class="line"><a name="l00114"></a><span class="lineno"><a class="code" href="_b_t_d_8h.html#a8151b1fe5d940a5a7a34f43a8b8ce434"> 114</a></span>&#160;<span class="preprocessor"></span><span class="preprocessor">#define L2CAP_CMD_CONFIG_RESPONSE 0x05</span></div>
<div class="line"><a name="l00115"></a><span class="lineno"><a class="code" href="_b_t_d_8h.html#a398676a2e9a2351a5a52afdddf4b660b"> 115</a></span>&#160;<span class="preprocessor"></span><span class="preprocessor">#define L2CAP_CMD_DISCONNECT_REQUEST 0x06</span></div>
<div class="line"><a name="l00116"></a><span class="lineno"><a class="code" href="_b_t_d_8h.html#a4c64a41200714e457b397496183dc0e4"> 116</a></span>&#160;<span class="preprocessor"></span><span class="preprocessor">#define L2CAP_CMD_DISCONNECT_RESPONSE 0x07</span></div>
<div class="line"><a name="l00117"></a><span class="lineno"><a class="code" href="_b_t_d_8h.html#a200eb6c7c905ec74a9daf0f262af0448"> 117</a></span>&#160;<span class="preprocessor"></span><span class="preprocessor">#define L2CAP_CMD_INFORMATION_REQUEST 0x0A</span></div>
<div class="line"><a name="l00118"></a><span class="lineno"><a class="code" href="_b_t_d_8h.html#af32d4c53927d596a8727ff232310dec1"> 118</a></span>&#160;<span class="preprocessor"></span><span class="preprocessor">#define L2CAP_CMD_INFORMATION_RESPONSE 0x0B</span></div>
<div class="line"><a name="l00119"></a><span class="lineno"> 119</span>&#160;<span class="preprocessor"></span></div>
<div class="line"><a name="l00120"></a><span class="lineno"> 120</span>&#160;<span class="comment">// Used For Connection Response - Remember to Include High Byte</span></div>
<div class="line"><a name="l00121"></a><span class="lineno"><a class="code" href="_b_t_d_8h.html#a9960d0d5ae92fc92c70bbb84c2a5c0cc"> 121</a></span>&#160;<span class="preprocessor">#define PENDING 0x01</span></div>
<div class="line"><a name="l00122"></a><span class="lineno"><a class="code" href="_b_t_d_8h.html#a1be7a56cdddcdb7dedf16d4dee381e93"> 122</a></span>&#160;<span class="preprocessor"></span><span class="preprocessor">#define SUCCESSFUL 0x00</span></div>
<div class="line"><a name="l00123"></a><span class="lineno"> 123</span>&#160;<span class="preprocessor"></span></div>
<div class="line"><a name="l00124"></a><span class="lineno"> 124</span>&#160;<span class="comment">/* Bluetooth L2CAP PSM - see http://www.bluetooth.org/Technical/AssignedNumbers/logical_link.htm */</span></div>
<div class="line"><a name="l00125"></a><span class="lineno"><a class="code" href="_b_t_d_8h.html#a25ce859d7ee2730e1d22d11c051ed60d"> 125</a></span>&#160;<span class="preprocessor">#define SDP_PSM 0x01 // Service Discovery Protocol PSM Value</span></div>
<div class="line"><a name="l00126"></a><span class="lineno"><a class="code" href="_b_t_d_8h.html#a2924020f2e7e82fe956574538e2bc3eb"> 126</a></span>&#160;<span class="preprocessor"></span><span class="preprocessor">#define RFCOMM_PSM 0x03 // RFCOMM PSM Value</span></div>
<div class="line"><a name="l00127"></a><span class="lineno"><a class="code" href="_b_t_d_8h.html#a1465673868452307bcdab8e201430c27"> 127</a></span>&#160;<span class="preprocessor"></span><span class="preprocessor">#define HID_CTRL_PSM 0x11 // HID_Control PSM Value</span></div>
<div class="line"><a name="l00128"></a><span class="lineno"><a class="code" href="_b_t_d_8h.html#a4c5ac96db74d61d4a5a5d945a400e7da"> 128</a></span>&#160;<span class="preprocessor"></span><span class="preprocessor">#define HID_INTR_PSM 0x13 // HID_Interrupt PSM Value</span></div>
<div class="line"><a name="l00129"></a><span class="lineno"> 129</span>&#160;<span class="preprocessor"></span></div>
<div class="line"><a name="l00130"></a><span class="lineno"> 130</span>&#160;<span class="comment">// Used to determine if it is a Bluetooth dongle</span></div>
<div class="line"><a name="l00131"></a><span class="lineno"><a class="code" href="_b_t_d_8h.html#a177fe269ddb7979d99b76d52bc281551"> 131</a></span>&#160;<span class="preprocessor">#define WI_SUBCLASS_RF 0x01 // RF Controller</span></div>
<div class="line"><a name="l00132"></a><span class="lineno"><a class="code" href="_b_t_d_8h.html#a05903a9351c5ced6b8be27b2869e62af"> 132</a></span>&#160;<span class="preprocessor"></span><span class="preprocessor">#define WI_PROTOCOL_BT 0x01 // Bluetooth Programming Interface</span></div>
<div class="line"><a name="l00133"></a><span class="lineno"> 133</span>&#160;<span class="preprocessor"></span></div>
<div class="line"><a name="l00135"></a><span class="lineno"><a class="code" href="class_bluetooth_service.html"> 135</a></span>&#160;<span class="keyword">class </span><a class="code" href="class_bluetooth_service.html">BluetoothService</a> {</div>
<div class="line"><a name="l00136"></a><span class="lineno"> 136</span>&#160;<span class="keyword">public</span>:</div>
<div class="line"><a name="l00141"></a><span class="lineno"> 141</span>&#160; <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="class_bluetooth_service.html#a8dc98310fe481357eaa86c53e49af113">ACLData</a>(uint8_t* <a class="code" href="class_bluetooth_service.html#a8dc98310fe481357eaa86c53e49af113">ACLData</a>);</div>
<div class="line"><a name="l00143"></a><span class="lineno"> 143</span>&#160; <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="class_bluetooth_service.html#a680692ff13cb37eb81ddbb74bc9e0383">Run</a>();</div>
<div class="line"><a name="l00145"></a><span class="lineno"> 145</span>&#160; <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="class_bluetooth_service.html#a1dff7caf251f1d8a5f358b368445cb48">Reset</a>();</div>
<div class="line"><a name="l00147"></a><span class="lineno"> 147</span>&#160; <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="class_bluetooth_service.html#a66ee2f09c6087b82e3920c3d652a99b2">disconnect</a>();</div>
<div class="line"><a name="l00148"></a><span class="lineno"> 148</span>&#160;};</div>
<div class="line"><a name="l00149"></a><span class="lineno"> 149</span>&#160;</div>
<div class="line"><a name="l00154"></a><span class="lineno"><a class="code" href="class_b_t_d.html"> 154</a></span>&#160;<span class="keyword">class </span><a class="code" href="class_b_t_d.html">BTD</a> : <span class="keyword">public</span> <a class="code" href="class_u_s_b_device_config.html">USBDeviceConfig</a>, <span class="keyword">public</span> <a class="code" href="class_usb_config_xtracter.html">UsbConfigXtracter</a> {</div>
<div class="line"><a name="l00155"></a><span class="lineno"> 155</span>&#160;<span class="keyword">public</span>:</div>
<div class="line"><a name="l00160"></a><span class="lineno"> 160</span>&#160; <a class="code" href="class_b_t_d.html#a5f07597fe15a2b917cce405fe87f2981">BTD</a>(<a class="code" href="class_u_s_b.html">USB</a> *p);</div>
<div class="line"><a name="l00161"></a><span class="lineno"> 161</span>&#160;</div>
<div class="line"><a name="l00170"></a><span class="lineno"> 170</span>&#160; <span class="keyword">virtual</span> uint8_t <a class="code" href="class_b_t_d.html#a48608619d8253972dd132edbb3001c5f">Init</a>(uint8_t parent, uint8_t port, <span class="keywordtype">bool</span> lowspeed);</div>
<div class="line"><a name="l00175"></a><span class="lineno"> 175</span>&#160; <span class="keyword">virtual</span> uint8_t <a class="code" href="class_b_t_d.html#aa87c23bce56a20f2db47c6a40c8eda87">Release</a>();</div>
<div class="line"><a name="l00180"></a><span class="lineno"> 180</span>&#160; <span class="keyword">virtual</span> uint8_t <a class="code" href="class_b_t_d.html#a76e201c5b561e3a6d0405894ba5c2e41">Poll</a>();</div>
<div class="line"><a name="l00181"></a><span class="lineno"> 181</span>&#160;</div>
<div class="line"><a name="l00186"></a><span class="lineno"><a class="code" href="class_b_t_d.html#aecdd9d00fc9c12bb3677ed213a6687c3"> 186</a></span>&#160; <span class="keyword">virtual</span> uint8_t <a class="code" href="class_b_t_d.html#aecdd9d00fc9c12bb3677ed213a6687c3">GetAddress</a>() {</div>
<div class="line"><a name="l00187"></a><span class="lineno"> 187</span>&#160; <span class="keywordflow">return</span> <a class="code" href="class_b_t_d.html#a58f78a9a28db81858dcc34a32a2ec82c">bAddress</a>;</div>
<div class="line"><a name="l00188"></a><span class="lineno"> 188</span>&#160; };</div>
<div class="line"><a name="l00189"></a><span class="lineno"> 189</span>&#160;</div>
<div class="line"><a name="l00194"></a><span class="lineno"><a class="code" href="class_b_t_d.html#a1b2440748bdaaeb552a05b0f0902f5d8"> 194</a></span>&#160; <span class="keyword">virtual</span> <span class="keywordtype">bool</span> <a class="code" href="class_b_t_d.html#a1b2440748bdaaeb552a05b0f0902f5d8">isReady</a>() {</div>
<div class="line"><a name="l00195"></a><span class="lineno"> 195</span>&#160; <span class="keywordflow">return</span> bPollEnable;</div>
<div class="line"><a name="l00196"></a><span class="lineno"> 196</span>&#160; };</div>
<div class="line"><a name="l00208"></a><span class="lineno"> 208</span>&#160; <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="class_b_t_d.html#a23928cd0e5711a2433aec763cfa55773">EndpointXtract</a>(uint8_t conf, uint8_t iface, uint8_t alt, uint8_t proto, <span class="keyword">const</span> <a class="code" href="struct_u_s_b___e_n_d_p_o_i_n_t___d_e_s_c_r_i_p_t_o_r.html">USB_ENDPOINT_DESCRIPTOR</a> *ep);</div>
<div class="line"><a name="l00212"></a><span class="lineno"><a class="code" href="class_b_t_d.html#a610183f9ddf04155ef2612d1839af7da"> 212</a></span>&#160; <span class="keywordtype">void</span> <a class="code" href="class_b_t_d.html#a610183f9ddf04155ef2612d1839af7da">disconnect</a>() {</div>
<div class="line"><a name="l00213"></a><span class="lineno"> 213</span>&#160; <span class="keywordflow">for</span>(uint8_t i = 0; i &lt; <a class="code" href="_b_t_d_8h.html#a2222709eed4c8af293e881ea36f599b0">BTD_NUMSERVICES</a>; i++)</div>
<div class="line"><a name="l00214"></a><span class="lineno"> 214</span>&#160; <span class="keywordflow">if</span>(btService[i])</div>
<div class="line"><a name="l00215"></a><span class="lineno"> 215</span>&#160; btService[i]-&gt;<a class="code" href="class_bluetooth_service.html#a66ee2f09c6087b82e3920c3d652a99b2">disconnect</a>();</div>
<div class="line"><a name="l00134"></a><span class="lineno"><a class="code" href="_b_t_d_8h.html#aee41c4878894db24e7ad8cd6246595cd"> 134</a></span>&#160;<span class="preprocessor">#define BTD_MAX_ENDPOINTS 4</span></div>
<div class="line"><a name="l00135"></a><span class="lineno"><a class="code" href="_b_t_d_8h.html#a2222709eed4c8af293e881ea36f599b0"> 135</a></span>&#160;<span class="preprocessor"></span><span class="preprocessor">#define BTD_NUMSERVICES 4 // Max number of Bluetooth services - if you need more than four simply increase this number</span></div>
<div class="line"><a name="l00136"></a><span class="lineno"> 136</span>&#160;<span class="preprocessor"></span></div>
<div class="line"><a name="l00138"></a><span class="lineno"><a class="code" href="class_bluetooth_service.html"> 138</a></span>&#160;<span class="keyword">class </span><a class="code" href="class_bluetooth_service.html">BluetoothService</a> {</div>
<div class="line"><a name="l00139"></a><span class="lineno"> 139</span>&#160;<span class="keyword">public</span>:</div>
<div class="line"><a name="l00144"></a><span class="lineno"> 144</span>&#160; <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="class_bluetooth_service.html#a8dc98310fe481357eaa86c53e49af113">ACLData</a>(uint8_t* <a class="code" href="class_bluetooth_service.html#a8dc98310fe481357eaa86c53e49af113">ACLData</a>);</div>
<div class="line"><a name="l00146"></a><span class="lineno"> 146</span>&#160; <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="class_bluetooth_service.html#a680692ff13cb37eb81ddbb74bc9e0383">Run</a>();</div>
<div class="line"><a name="l00148"></a><span class="lineno"> 148</span>&#160; <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="class_bluetooth_service.html#a1dff7caf251f1d8a5f358b368445cb48">Reset</a>();</div>
<div class="line"><a name="l00150"></a><span class="lineno"> 150</span>&#160; <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="class_bluetooth_service.html#a66ee2f09c6087b82e3920c3d652a99b2">disconnect</a>();</div>
<div class="line"><a name="l00151"></a><span class="lineno"> 151</span>&#160;};</div>
<div class="line"><a name="l00152"></a><span class="lineno"> 152</span>&#160;</div>
<div class="line"><a name="l00157"></a><span class="lineno"><a class="code" href="class_b_t_d.html"> 157</a></span>&#160;<span class="keyword">class </span><a class="code" href="class_b_t_d.html">BTD</a> : <span class="keyword">public</span> <a class="code" href="class_u_s_b_device_config.html">USBDeviceConfig</a>, <span class="keyword">public</span> <a class="code" href="class_usb_config_xtracter.html">UsbConfigXtracter</a> {</div>
<div class="line"><a name="l00158"></a><span class="lineno"> 158</span>&#160;<span class="keyword">public</span>:</div>
<div class="line"><a name="l00163"></a><span class="lineno"> 163</span>&#160; <a class="code" href="class_b_t_d.html#a5f07597fe15a2b917cce405fe87f2981">BTD</a>(<a class="code" href="class_u_s_b.html">USB</a> *p);</div>
<div class="line"><a name="l00164"></a><span class="lineno"> 164</span>&#160;</div>
<div class="line"><a name="l00173"></a><span class="lineno"> 173</span>&#160; <span class="keyword">virtual</span> uint8_t <a class="code" href="class_b_t_d.html#a48608619d8253972dd132edbb3001c5f">Init</a>(uint8_t parent, uint8_t port, <span class="keywordtype">bool</span> lowspeed);</div>
<div class="line"><a name="l00178"></a><span class="lineno"> 178</span>&#160; <span class="keyword">virtual</span> uint8_t <a class="code" href="class_b_t_d.html#aa87c23bce56a20f2db47c6a40c8eda87">Release</a>();</div>
<div class="line"><a name="l00183"></a><span class="lineno"> 183</span>&#160; <span class="keyword">virtual</span> uint8_t <a class="code" href="class_b_t_d.html#a76e201c5b561e3a6d0405894ba5c2e41">Poll</a>();</div>
<div class="line"><a name="l00184"></a><span class="lineno"> 184</span>&#160;</div>
<div class="line"><a name="l00189"></a><span class="lineno"><a class="code" href="class_b_t_d.html#aecdd9d00fc9c12bb3677ed213a6687c3"> 189</a></span>&#160; <span class="keyword">virtual</span> uint8_t <a class="code" href="class_b_t_d.html#aecdd9d00fc9c12bb3677ed213a6687c3">GetAddress</a>() {</div>
<div class="line"><a name="l00190"></a><span class="lineno"> 190</span>&#160; <span class="keywordflow">return</span> <a class="code" href="class_b_t_d.html#a58f78a9a28db81858dcc34a32a2ec82c">bAddress</a>;</div>
<div class="line"><a name="l00191"></a><span class="lineno"> 191</span>&#160; };</div>
<div class="line"><a name="l00192"></a><span class="lineno"> 192</span>&#160;</div>
<div class="line"><a name="l00197"></a><span class="lineno"><a class="code" href="class_b_t_d.html#a1b2440748bdaaeb552a05b0f0902f5d8"> 197</a></span>&#160; <span class="keyword">virtual</span> <span class="keywordtype">bool</span> <a class="code" href="class_b_t_d.html#a1b2440748bdaaeb552a05b0f0902f5d8">isReady</a>() {</div>
<div class="line"><a name="l00198"></a><span class="lineno"> 198</span>&#160; <span class="keywordflow">return</span> bPollEnable;</div>
<div class="line"><a name="l00199"></a><span class="lineno"> 199</span>&#160; };</div>
<div class="line"><a name="l00205"></a><span class="lineno"><a class="code" href="class_b_t_d.html#a8760371377c1ba08292b6cc71824754e"> 205</a></span>&#160; <span class="keyword">virtual</span> <span class="keywordtype">boolean</span> <a class="code" href="class_b_t_d.html#a8760371377c1ba08292b6cc71824754e">DEVCLASSOK</a>(uint8_t klass) { <span class="keywordflow">return</span> (klass == <a class="code" href="_usb_8h.html#afce880b09049d7105f8e68ff36d9ad17">USB_CLASS_WIRELESS_CTRL</a>); }</div>
<div class="line"><a name="l00206"></a><span class="lineno"> 206</span>&#160;</div>
<div class="line"><a name="l00214"></a><span class="lineno"><a class="code" href="class_b_t_d.html#adf5dce0907ea33c919908fea5dc0cf21"> 214</a></span>&#160; <span class="keyword">virtual</span> <span class="keywordtype">boolean</span> <a class="code" href="class_b_t_d.html#adf5dce0907ea33c919908fea5dc0cf21">VIDPIDOK</a>(uint16_t vid, uint16_t pid) {</div>
<div class="line"><a name="l00215"></a><span class="lineno"> 215</span>&#160; <span class="keywordflow">return</span> ((vid == <a class="code" href="_b_t_d_8h.html#a5bb06f989db583d290ba79642d37c514">PS3_VID</a> || vid == <a class="code" href="_b_t_d_8h.html#a6a28bb0589fbe2da75b238d7568d894d">IOGEAR_GBU521_VID</a>) &amp;&amp; (pid == <a class="code" href="_b_t_d_8h.html#a0ae276efa5e73a4da658c714e70402c0">PS3_PID</a> || pid == <a class="code" href="_b_t_d_8h.html#a54903b410722a45f8246653cd4d00632">PS3NAVIGATION_PID</a> || pid == <a class="code" href="_b_t_d_8h.html#afc242b8a1b867f79c49ad78e3a47b37f">PS3MOVE_PID</a> || pid == <a class="code" href="_b_t_d_8h.html#aed4a7c4ebf618412176ef19023454fad">IOGEAR_GBU521_PID</a>));</div>
<div class="line"><a name="l00216"></a><span class="lineno"> 216</span>&#160; };</div>
<div class="line"><a name="l00217"></a><span class="lineno"> 217</span>&#160;</div>
<div class="line"><a name="l00223"></a><span class="lineno"><a class="code" href="class_b_t_d.html#a4adfc7e51ad3b3c03e7c37d1af159e73"> 223</a></span>&#160; int8_t <a class="code" href="class_b_t_d.html#a4adfc7e51ad3b3c03e7c37d1af159e73">registerServiceClass</a>(<a class="code" href="class_bluetooth_service.html">BluetoothService</a> *pService) {</div>
<div class="line"><a name="l00224"></a><span class="lineno"> 224</span>&#160; <span class="keywordflow">for</span>(uint8_t i = 0; i &lt; <a class="code" href="_b_t_d_8h.html#a2222709eed4c8af293e881ea36f599b0">BTD_NUMSERVICES</a>; i++) {</div>
<div class="line"><a name="l00225"></a><span class="lineno"> 225</span>&#160; <span class="keywordflow">if</span>(!btService[i]) {</div>
<div class="line"><a name="l00226"></a><span class="lineno"> 226</span>&#160; btService[i] = pService;</div>
<div class="line"><a name="l00227"></a><span class="lineno"> 227</span>&#160; <span class="keywordflow">return</span> i; <span class="comment">// Return ID</span></div>
<div class="line"><a name="l00228"></a><span class="lineno"> 228</span>&#160; }</div>
<div class="line"><a name="l00229"></a><span class="lineno"> 229</span>&#160; }</div>
<div class="line"><a name="l00230"></a><span class="lineno"> 230</span>&#160; <span class="keywordflow">return</span> -1; <span class="comment">// ErrorregisterServiceClass</span></div>
<div class="line"><a name="l00231"></a><span class="lineno"> 231</span>&#160; };</div>
<div class="line"><a name="l00232"></a><span class="lineno"> 232</span>&#160;</div>
<div class="line"><a name="l00239"></a><span class="lineno"> 239</span>&#160; <span class="keywordtype">void</span> <a class="code" href="class_b_t_d.html#af11ad71d20783d46fe42dd405d10dfda">HCI_Command</a>(uint8_t* data, uint16_t nbytes);</div>
<div class="line"><a name="l00241"></a><span class="lineno"> 241</span>&#160; <span class="keywordtype">void</span> <a class="code" href="class_b_t_d.html#ae6f942eabd29257bc4896e5f263275b6">hci_reset</a>();</div>
<div class="line"><a name="l00243"></a><span class="lineno"> 243</span>&#160; <span class="keywordtype">void</span> <a class="code" href="class_b_t_d.html#acb94a629477d85cebd16a9c5ecd4a8b3">hci_read_bdaddr</a>();</div>
<div class="line"><a name="l00245"></a><span class="lineno"> 245</span>&#160; <span class="keywordtype">void</span> <a class="code" href="class_b_t_d.html#ae2ba215b6942f4131e4c5fdef2771e22">hci_read_local_version_information</a>();</div>
<div class="line"><a name="l00250"></a><span class="lineno"> 250</span>&#160; <span class="keywordtype">void</span> <a class="code" href="class_b_t_d.html#a9a6747d58951f53389922d80e25b886c">hci_set_local_name</a>(<span class="keyword">const</span> <span class="keywordtype">char</span>* name);</div>
<div class="line"><a name="l00252"></a><span class="lineno"> 252</span>&#160; <span class="keywordtype">void</span> <a class="code" href="class_b_t_d.html#a7dd7faaec1d3d9a1d8159cc2a4190977">hci_write_scan_enable</a>();</div>
<div class="line"><a name="l00254"></a><span class="lineno"> 254</span>&#160; <span class="keywordtype">void</span> <a class="code" href="class_b_t_d.html#aff59ab45d917406141ae0c9c79047f08">hci_write_scan_disable</a>();</div>
<div class="line"><a name="l00256"></a><span class="lineno"> 256</span>&#160; <span class="keywordtype">void</span> <a class="code" href="class_b_t_d.html#a8767529bd203c549348a38ac9c6682b3">hci_remote_name</a>();</div>
<div class="line"><a name="l00258"></a><span class="lineno"> 258</span>&#160; <span class="keywordtype">void</span> <a class="code" href="class_b_t_d.html#a1cb07a155c69bb1fcf45ae030b8947ec">hci_accept_connection</a>();</div>
<div class="line"><a name="l00263"></a><span class="lineno"> 263</span>&#160; <span class="keywordtype">void</span> <a class="code" href="class_b_t_d.html#a1bea5dd793a2f47006b4a7642efc9e56">hci_disconnect</a>(uint16_t handle);</div>
<div class="line"><a name="l00269"></a><span class="lineno"> 269</span>&#160; <span class="keywordtype">void</span> <a class="code" href="class_b_t_d.html#a70047b0f624c3f0ef29f8b76b8a34938">hci_pin_code_request_reply</a>();</div>
<div class="line"><a name="l00271"></a><span class="lineno"> 271</span>&#160; <span class="keywordtype">void</span> <a class="code" href="class_b_t_d.html#a7114d2cb62aa413e5ecb25c45c76832b">hci_pin_code_negative_request_reply</a>();</div>
<div class="line"><a name="l00276"></a><span class="lineno"> 276</span>&#160; <span class="keywordtype">void</span> <a class="code" href="class_b_t_d.html#af4d28b9c1a3b9688a1871610caee2cfc">hci_link_key_request_negative_reply</a>();</div>
<div class="line"><a name="l00278"></a><span class="lineno"> 278</span>&#160; <span class="keywordtype">void</span> <a class="code" href="class_b_t_d.html#addd07c18c725a324a05792a83026d36d">hci_authentication_request</a>();</div>
<div class="line"><a name="l00280"></a><span class="lineno"> 280</span>&#160; <span class="keywordtype">void</span> <a class="code" href="class_b_t_d.html#a678f2c995553ce6a9f48f9b59f2f1555">hci_inquiry</a>();</div>
<div class="line"><a name="l00282"></a><span class="lineno"> 282</span>&#160; <span class="keywordtype">void</span> <a class="code" href="class_b_t_d.html#a45ffbc7a40bbb763b0ece907c3dfc9ff">hci_inquiry_cancel</a>();</div>
<div class="line"><a name="l00284"></a><span class="lineno"> 284</span>&#160; <span class="keywordtype">void</span> <a class="code" href="class_b_t_d.html#ae7066ea743f8907708db945ebef3ad76">hci_connect</a>();</div>
<div class="line"><a name="l00286"></a><span class="lineno"> 286</span>&#160; <span class="keywordtype">void</span> <a class="code" href="class_b_t_d.html#a9a17405df60591b909ff1502fb8f3141">hci_write_class_of_device</a>();</div>
<div class="line"><a name="l00298"></a><span class="lineno"> 298</span>&#160; <span class="keywordtype">void</span> <a class="code" href="class_b_t_d.html#aad7d8ef46e60b48ff4aaabefb0b290e7">L2CAP_Command</a>(uint16_t handle, uint8_t* data, uint8_t nbytes, uint8_t channelLow = 0x01, uint8_t channelHigh = 0x00);</div>
<div class="line"><a name="l00306"></a><span class="lineno"> 306</span>&#160; <span class="keywordtype">void</span> <a class="code" href="class_b_t_d.html#a55cf412a2053972a353b1ab964ca9d3e">l2cap_connection_request</a>(uint16_t handle, uint8_t rxid, uint8_t* scid, uint16_t psm);</div>
<div class="line"><a name="l00315"></a><span class="lineno"> 315</span>&#160; <span class="keywordtype">void</span> <a class="code" href="class_b_t_d.html#a7d34c62b1d561679dea5cd27356b38a7">l2cap_connection_response</a>(uint16_t handle, uint8_t rxid, uint8_t* dcid, uint8_t* scid, uint8_t result);</div>
<div class="line"><a name="l00322"></a><span class="lineno"> 322</span>&#160; <span class="keywordtype">void</span> <a class="code" href="class_b_t_d.html#ab646a59311344966f139bb3b78f30233">l2cap_config_request</a>(uint16_t handle, uint8_t rxid, uint8_t* dcid);</div>
<div class="line"><a name="l00329"></a><span class="lineno"> 329</span>&#160; <span class="keywordtype">void</span> <a class="code" href="class_b_t_d.html#a792ac4529b65235698ecf3d37982c05e">l2cap_config_response</a>(uint16_t handle, uint8_t rxid, uint8_t* scid);</div>
<div class="line"><a name="l00337"></a><span class="lineno"> 337</span>&#160; <span class="keywordtype">void</span> <a class="code" href="class_b_t_d.html#ac7053ef7ac690be3afbbdd985b163f10">l2cap_disconnection_request</a>(uint16_t handle, uint8_t rxid, uint8_t* dcid, uint8_t* scid);</div>
<div class="line"><a name="l00345"></a><span class="lineno"> 345</span>&#160; <span class="keywordtype">void</span> <a class="code" href="class_b_t_d.html#a29d176d9194e5c92fbe54791fc245407">l2cap_disconnection_response</a>(uint16_t handle, uint8_t rxid, uint8_t* dcid, uint8_t* scid);</div>
<div class="line"><a name="l00352"></a><span class="lineno"> 352</span>&#160; <span class="keywordtype">void</span> <a class="code" href="class_b_t_d.html#a91f61915c503fe7b861c88f5b3e6733c">l2cap_information_response</a>(uint16_t handle, uint8_t rxid, uint8_t infoTypeLow, uint8_t infoTypeHigh);</div>
<div class="line"><a name="l00356"></a><span class="lineno"><a class="code" href="class_b_t_d.html#aa7735da01865bab01b569ee836173737"> 356</a></span>&#160; <span class="keywordtype">bool</span> <a class="code" href="class_b_t_d.html#aa7735da01865bab01b569ee836173737">watingForConnection</a>;</div>
<div class="line"><a name="l00358"></a><span class="lineno"><a class="code" href="class_b_t_d.html#a0f1c28a03bcbe62cc7c083f97ea27594"> 358</a></span>&#160; <span class="keywordtype">bool</span> <a class="code" href="class_b_t_d.html#a0f1c28a03bcbe62cc7c083f97ea27594">l2capConnectionClaimed</a>;</div>
<div class="line"><a name="l00360"></a><span class="lineno"><a class="code" href="class_b_t_d.html#af5e5b085cec1da5c83c75e80e95b3590"> 360</a></span>&#160; <span class="keywordtype">bool</span> <a class="code" href="class_b_t_d.html#af5e5b085cec1da5c83c75e80e95b3590">sdpConnectionClaimed</a>;</div>
<div class="line"><a name="l00362"></a><span class="lineno"><a class="code" href="class_b_t_d.html#a9e5a34242007b64cd6a226cfd1901e74"> 362</a></span>&#160; <span class="keywordtype">bool</span> <a class="code" href="class_b_t_d.html#a9e5a34242007b64cd6a226cfd1901e74">rfcommConnectionClaimed</a>;</div>
<div class="line"><a name="l00363"></a><span class="lineno"> 363</span>&#160;</div>
<div class="line"><a name="l00365"></a><span class="lineno"><a class="code" href="class_b_t_d.html#a0359c0c158c864c27319810cbd1534f9"> 365</a></span>&#160; <span class="keyword">const</span> <span class="keywordtype">char</span>* <a class="code" href="class_b_t_d.html#a0359c0c158c864c27319810cbd1534f9">btdName</a>;</div>
<div class="line"><a name="l00367"></a><span class="lineno"><a class="code" href="class_b_t_d.html#a215cb939c01ed3ff56db37841224546c"> 367</a></span>&#160; <span class="keyword">const</span> <span class="keywordtype">char</span>* <a class="code" href="class_b_t_d.html#a215cb939c01ed3ff56db37841224546c">btdPin</a>;</div>
<div class="line"><a name="l00368"></a><span class="lineno"> 368</span>&#160;</div>
<div class="line"><a name="l00370"></a><span class="lineno"><a class="code" href="class_b_t_d.html#a1f8e9171a310e50f2c4a3c19066efe5a"> 370</a></span>&#160; uint8_t <a class="code" href="class_b_t_d.html#a1f8e9171a310e50f2c4a3c19066efe5a">my_bdaddr</a>[6];</div>
<div class="line"><a name="l00372"></a><span class="lineno"><a class="code" href="class_b_t_d.html#aa3bb6c692701cb33dfad1ea4d68b6f98"> 372</a></span>&#160; uint16_t <a class="code" href="class_b_t_d.html#aa3bb6c692701cb33dfad1ea4d68b6f98">hci_handle</a>;</div>
<div class="line"><a name="l00374"></a><span class="lineno"><a class="code" href="class_b_t_d.html#ab23f95f12675d7b4505ca6807d379182"> 374</a></span>&#160; uint8_t <a class="code" href="class_b_t_d.html#ab23f95f12675d7b4505ca6807d379182">disc_bdaddr</a>[6];</div>
<div class="line"><a name="l00376"></a><span class="lineno"><a class="code" href="class_b_t_d.html#aede42d995c384c238fd49d728df01e4e"> 376</a></span>&#160; uint8_t <a class="code" href="class_b_t_d.html#aede42d995c384c238fd49d728df01e4e">remote_name</a>[30];</div>
<div class="line"><a name="l00382"></a><span class="lineno"><a class="code" href="class_b_t_d.html#addaddee110af23a3195ad56f631e69ea"> 382</a></span>&#160; uint8_t <a class="code" href="class_b_t_d.html#addaddee110af23a3195ad56f631e69ea">hci_version</a>;</div>
<div class="line"><a name="l00228"></a><span class="lineno"> 228</span>&#160; <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="class_b_t_d.html#a23928cd0e5711a2433aec763cfa55773">EndpointXtract</a>(uint8_t conf, uint8_t iface, uint8_t alt, uint8_t proto, <span class="keyword">const</span> <a class="code" href="struct_u_s_b___e_n_d_p_o_i_n_t___d_e_s_c_r_i_p_t_o_r.html">USB_ENDPOINT_DESCRIPTOR</a> *ep);</div>
<div class="line"><a name="l00232"></a><span class="lineno"><a class="code" href="class_b_t_d.html#a610183f9ddf04155ef2612d1839af7da"> 232</a></span>&#160; <span class="keywordtype">void</span> <a class="code" href="class_b_t_d.html#a610183f9ddf04155ef2612d1839af7da">disconnect</a>() {</div>
<div class="line"><a name="l00233"></a><span class="lineno"> 233</span>&#160; <span class="keywordflow">for</span>(uint8_t i = 0; i &lt; <a class="code" href="_b_t_d_8h.html#a2222709eed4c8af293e881ea36f599b0">BTD_NUMSERVICES</a>; i++)</div>
<div class="line"><a name="l00234"></a><span class="lineno"> 234</span>&#160; <span class="keywordflow">if</span>(btService[i])</div>
<div class="line"><a name="l00235"></a><span class="lineno"> 235</span>&#160; btService[i]-&gt;<a class="code" href="class_bluetooth_service.html#a66ee2f09c6087b82e3920c3d652a99b2">disconnect</a>();</div>
<div class="line"><a name="l00236"></a><span class="lineno"> 236</span>&#160; };</div>
<div class="line"><a name="l00237"></a><span class="lineno"> 237</span>&#160;</div>
<div class="line"><a name="l00243"></a><span class="lineno"><a class="code" href="class_b_t_d.html#a4adfc7e51ad3b3c03e7c37d1af159e73"> 243</a></span>&#160; int8_t <a class="code" href="class_b_t_d.html#a4adfc7e51ad3b3c03e7c37d1af159e73">registerServiceClass</a>(<a class="code" href="class_bluetooth_service.html">BluetoothService</a> *pService) {</div>
<div class="line"><a name="l00244"></a><span class="lineno"> 244</span>&#160; <span class="keywordflow">for</span>(uint8_t i = 0; i &lt; <a class="code" href="_b_t_d_8h.html#a2222709eed4c8af293e881ea36f599b0">BTD_NUMSERVICES</a>; i++) {</div>
<div class="line"><a name="l00245"></a><span class="lineno"> 245</span>&#160; <span class="keywordflow">if</span>(!btService[i]) {</div>
<div class="line"><a name="l00246"></a><span class="lineno"> 246</span>&#160; btService[i] = pService;</div>
<div class="line"><a name="l00247"></a><span class="lineno"> 247</span>&#160; <span class="keywordflow">return</span> i; <span class="comment">// Return ID</span></div>
<div class="line"><a name="l00248"></a><span class="lineno"> 248</span>&#160; }</div>
<div class="line"><a name="l00249"></a><span class="lineno"> 249</span>&#160; }</div>
<div class="line"><a name="l00250"></a><span class="lineno"> 250</span>&#160; <span class="keywordflow">return</span> -1; <span class="comment">// ErrorregisterServiceClass</span></div>
<div class="line"><a name="l00251"></a><span class="lineno"> 251</span>&#160; };</div>
<div class="line"><a name="l00252"></a><span class="lineno"> 252</span>&#160;</div>
<div class="line"><a name="l00259"></a><span class="lineno"> 259</span>&#160; <span class="keywordtype">void</span> <a class="code" href="class_b_t_d.html#af11ad71d20783d46fe42dd405d10dfda">HCI_Command</a>(uint8_t* data, uint16_t nbytes);</div>
<div class="line"><a name="l00261"></a><span class="lineno"> 261</span>&#160; <span class="keywordtype">void</span> <a class="code" href="class_b_t_d.html#ae6f942eabd29257bc4896e5f263275b6">hci_reset</a>();</div>
<div class="line"><a name="l00263"></a><span class="lineno"> 263</span>&#160; <span class="keywordtype">void</span> <a class="code" href="class_b_t_d.html#acb94a629477d85cebd16a9c5ecd4a8b3">hci_read_bdaddr</a>();</div>
<div class="line"><a name="l00265"></a><span class="lineno"> 265</span>&#160; <span class="keywordtype">void</span> <a class="code" href="class_b_t_d.html#ae2ba215b6942f4131e4c5fdef2771e22">hci_read_local_version_information</a>();</div>
<div class="line"><a name="l00270"></a><span class="lineno"> 270</span>&#160; <span class="keywordtype">void</span> <a class="code" href="class_b_t_d.html#a9a6747d58951f53389922d80e25b886c">hci_set_local_name</a>(<span class="keyword">const</span> <span class="keywordtype">char</span>* name);</div>
<div class="line"><a name="l00272"></a><span class="lineno"> 272</span>&#160; <span class="keywordtype">void</span> <a class="code" href="class_b_t_d.html#a7dd7faaec1d3d9a1d8159cc2a4190977">hci_write_scan_enable</a>();</div>
<div class="line"><a name="l00274"></a><span class="lineno"> 274</span>&#160; <span class="keywordtype">void</span> <a class="code" href="class_b_t_d.html#aff59ab45d917406141ae0c9c79047f08">hci_write_scan_disable</a>();</div>
<div class="line"><a name="l00276"></a><span class="lineno"> 276</span>&#160; <span class="keywordtype">void</span> <a class="code" href="class_b_t_d.html#a8767529bd203c549348a38ac9c6682b3">hci_remote_name</a>();</div>
<div class="line"><a name="l00278"></a><span class="lineno"> 278</span>&#160; <span class="keywordtype">void</span> <a class="code" href="class_b_t_d.html#a1cb07a155c69bb1fcf45ae030b8947ec">hci_accept_connection</a>();</div>
<div class="line"><a name="l00283"></a><span class="lineno"> 283</span>&#160; <span class="keywordtype">void</span> <a class="code" href="class_b_t_d.html#a1bea5dd793a2f47006b4a7642efc9e56">hci_disconnect</a>(uint16_t handle);</div>
<div class="line"><a name="l00289"></a><span class="lineno"> 289</span>&#160; <span class="keywordtype">void</span> <a class="code" href="class_b_t_d.html#a70047b0f624c3f0ef29f8b76b8a34938">hci_pin_code_request_reply</a>();</div>
<div class="line"><a name="l00291"></a><span class="lineno"> 291</span>&#160; <span class="keywordtype">void</span> <a class="code" href="class_b_t_d.html#a7114d2cb62aa413e5ecb25c45c76832b">hci_pin_code_negative_request_reply</a>();</div>
<div class="line"><a name="l00296"></a><span class="lineno"> 296</span>&#160; <span class="keywordtype">void</span> <a class="code" href="class_b_t_d.html#af4d28b9c1a3b9688a1871610caee2cfc">hci_link_key_request_negative_reply</a>();</div>
<div class="line"><a name="l00298"></a><span class="lineno"> 298</span>&#160; <span class="keywordtype">void</span> <a class="code" href="class_b_t_d.html#addd07c18c725a324a05792a83026d36d">hci_authentication_request</a>();</div>
<div class="line"><a name="l00300"></a><span class="lineno"> 300</span>&#160; <span class="keywordtype">void</span> <a class="code" href="class_b_t_d.html#a678f2c995553ce6a9f48f9b59f2f1555">hci_inquiry</a>();</div>
<div class="line"><a name="l00302"></a><span class="lineno"> 302</span>&#160; <span class="keywordtype">void</span> <a class="code" href="class_b_t_d.html#a45ffbc7a40bbb763b0ece907c3dfc9ff">hci_inquiry_cancel</a>();</div>
<div class="line"><a name="l00304"></a><span class="lineno"> 304</span>&#160; <span class="keywordtype">void</span> <a class="code" href="class_b_t_d.html#ae7066ea743f8907708db945ebef3ad76">hci_connect</a>();</div>
<div class="line"><a name="l00306"></a><span class="lineno"> 306</span>&#160; <span class="keywordtype">void</span> <a class="code" href="class_b_t_d.html#a9a17405df60591b909ff1502fb8f3141">hci_write_class_of_device</a>();</div>
<div class="line"><a name="l00318"></a><span class="lineno"> 318</span>&#160; <span class="keywordtype">void</span> <a class="code" href="class_b_t_d.html#aad7d8ef46e60b48ff4aaabefb0b290e7">L2CAP_Command</a>(uint16_t handle, uint8_t* data, uint8_t nbytes, uint8_t channelLow = 0x01, uint8_t channelHigh = 0x00);</div>
<div class="line"><a name="l00326"></a><span class="lineno"> 326</span>&#160; <span class="keywordtype">void</span> <a class="code" href="class_b_t_d.html#a55cf412a2053972a353b1ab964ca9d3e">l2cap_connection_request</a>(uint16_t handle, uint8_t rxid, uint8_t* scid, uint16_t psm);</div>
<div class="line"><a name="l00335"></a><span class="lineno"> 335</span>&#160; <span class="keywordtype">void</span> <a class="code" href="class_b_t_d.html#a7d34c62b1d561679dea5cd27356b38a7">l2cap_connection_response</a>(uint16_t handle, uint8_t rxid, uint8_t* dcid, uint8_t* scid, uint8_t result);</div>
<div class="line"><a name="l00342"></a><span class="lineno"> 342</span>&#160; <span class="keywordtype">void</span> <a class="code" href="class_b_t_d.html#ab646a59311344966f139bb3b78f30233">l2cap_config_request</a>(uint16_t handle, uint8_t rxid, uint8_t* dcid);</div>
<div class="line"><a name="l00349"></a><span class="lineno"> 349</span>&#160; <span class="keywordtype">void</span> <a class="code" href="class_b_t_d.html#a792ac4529b65235698ecf3d37982c05e">l2cap_config_response</a>(uint16_t handle, uint8_t rxid, uint8_t* scid);</div>
<div class="line"><a name="l00357"></a><span class="lineno"> 357</span>&#160; <span class="keywordtype">void</span> <a class="code" href="class_b_t_d.html#ac7053ef7ac690be3afbbdd985b163f10">l2cap_disconnection_request</a>(uint16_t handle, uint8_t rxid, uint8_t* dcid, uint8_t* scid);</div>
<div class="line"><a name="l00365"></a><span class="lineno"> 365</span>&#160; <span class="keywordtype">void</span> <a class="code" href="class_b_t_d.html#a29d176d9194e5c92fbe54791fc245407">l2cap_disconnection_response</a>(uint16_t handle, uint8_t rxid, uint8_t* dcid, uint8_t* scid);</div>
<div class="line"><a name="l00372"></a><span class="lineno"> 372</span>&#160; <span class="keywordtype">void</span> <a class="code" href="class_b_t_d.html#a91f61915c503fe7b861c88f5b3e6733c">l2cap_information_response</a>(uint16_t handle, uint8_t rxid, uint8_t infoTypeLow, uint8_t infoTypeHigh);</div>
<div class="line"><a name="l00376"></a><span class="lineno"><a class="code" href="class_b_t_d.html#aa7735da01865bab01b569ee836173737"> 376</a></span>&#160; <span class="keywordtype">bool</span> <a class="code" href="class_b_t_d.html#aa7735da01865bab01b569ee836173737">watingForConnection</a>;</div>
<div class="line"><a name="l00378"></a><span class="lineno"><a class="code" href="class_b_t_d.html#a0f1c28a03bcbe62cc7c083f97ea27594"> 378</a></span>&#160; <span class="keywordtype">bool</span> <a class="code" href="class_b_t_d.html#a0f1c28a03bcbe62cc7c083f97ea27594">l2capConnectionClaimed</a>;</div>
<div class="line"><a name="l00380"></a><span class="lineno"><a class="code" href="class_b_t_d.html#af5e5b085cec1da5c83c75e80e95b3590"> 380</a></span>&#160; <span class="keywordtype">bool</span> <a class="code" href="class_b_t_d.html#af5e5b085cec1da5c83c75e80e95b3590">sdpConnectionClaimed</a>;</div>
<div class="line"><a name="l00382"></a><span class="lineno"><a class="code" href="class_b_t_d.html#a9e5a34242007b64cd6a226cfd1901e74"> 382</a></span>&#160; <span class="keywordtype">bool</span> <a class="code" href="class_b_t_d.html#a9e5a34242007b64cd6a226cfd1901e74">rfcommConnectionClaimed</a>;</div>
<div class="line"><a name="l00383"></a><span class="lineno"> 383</span>&#160;</div>
<div class="line"><a name="l00385"></a><span class="lineno"><a class="code" href="class_b_t_d.html#a6b66a27c0fd359e3129f53451352b55c"> 385</a></span>&#160; <span class="keywordtype">void</span> <a class="code" href="class_b_t_d.html#a6b66a27c0fd359e3129f53451352b55c">pairWithWiimote</a>() {</div>
<div class="line"><a name="l00386"></a><span class="lineno"> 386</span>&#160; <a class="code" href="class_b_t_d.html#a0c8cc2a2dd2cda3e760b8b4c1a2d169c">pairWithWii</a> = <span class="keyword">true</span>;</div>
<div class="line"><a name="l00387"></a><span class="lineno"> 387</span>&#160; hci_state = <a class="code" href="_b_t_d_8h.html#a36daee23c5d0f4276e6eb32f3fd79124">HCI_CHECK_WII_SERVICE</a>;</div>
<div class="line"><a name="l00388"></a><span class="lineno"><a class="code" href="class_b_t_d.html#ac7caac80fb6f5f0e794af3644887d88e"> 388</a></span>&#160; };</div>
<div class="line"><a name="l00390"></a><span class="lineno"> 390</span>&#160; <span class="keywordtype">bool</span> <a class="code" href="class_b_t_d.html#ac7caac80fb6f5f0e794af3644887d88e">connectToWii</a>;</div>
<div class="line"><a name="l00392"></a><span class="lineno"><a class="code" href="class_b_t_d.html#a4dc8f94fe85028f3d54f13dde1e5b4ee"> 392</a></span>&#160; <span class="keywordtype">bool</span> <a class="code" href="class_b_t_d.html#a4dc8f94fe85028f3d54f13dde1e5b4ee">incomingWii</a>;</div>
<div class="line"><a name="l00394"></a><span class="lineno"><a class="code" href="class_b_t_d.html#a0c8cc2a2dd2cda3e760b8b4c1a2d169c"> 394</a></span>&#160; <span class="keywordtype">bool</span> <a class="code" href="class_b_t_d.html#a0c8cc2a2dd2cda3e760b8b4c1a2d169c">pairWithWii</a>;</div>
<div class="line"><a name="l00396"></a><span class="lineno"><a class="code" href="class_b_t_d.html#a3aea445b2349e99ef057db1a4ffdd9dc"> 396</a></span>&#160; <span class="keywordtype">bool</span> <a class="code" href="class_b_t_d.html#a3aea445b2349e99ef057db1a4ffdd9dc">motionPlusInside</a>;</div>
<div class="line"><a name="l00398"></a><span class="lineno"><a class="code" href="class_b_t_d.html#a962a5714c225dcb633434f02e3657583"> 398</a></span>&#160; <span class="keywordtype">bool</span> <a class="code" href="class_b_t_d.html#a962a5714c225dcb633434f02e3657583">wiiUProController</a>;</div>
<div class="line"><a name="l00399"></a><span class="lineno"> 399</span>&#160;</div>
<div class="line"><a name="l00404"></a><span class="lineno"><a class="code" href="class_b_t_d.html#a2a9ecb996243e070e70972370e45e4fd"> 404</a></span>&#160; uint8_t <a class="code" href="class_b_t_d.html#a2a9ecb996243e070e70972370e45e4fd">readPollInterval</a>() {</div>
<div class="line"><a name="l00405"></a><span class="lineno"> 405</span>&#160; <span class="keywordflow">return</span> pollInterval;</div>
<div class="line"><a name="l00406"></a><span class="lineno"><a class="code" href="class_b_t_d.html#a4bcd1d622a6455ee3d0cccc4408700a1"> 406</a></span>&#160; };</div>
<div class="line"><a name="l00407"></a><span class="lineno"> 407</span>&#160;</div>
<div class="line"><a name="l00408"></a><span class="lineno"> 408</span>&#160;<span class="keyword">protected</span>:</div>
<div class="line"><a name="l00410"></a><span class="lineno"> 410</span>&#160; <a class="code" href="class_u_s_b.html">USB</a> *<a class="code" href="class_b_t_d.html#a4bcd1d622a6455ee3d0cccc4408700a1">pUsb</a>;</div>
<div class="line"><a name="l00412"></a><span class="lineno"><a class="code" href="class_b_t_d.html#a58f78a9a28db81858dcc34a32a2ec82c"> 412</a></span>&#160; uint8_t <a class="code" href="class_b_t_d.html#a58f78a9a28db81858dcc34a32a2ec82c">bAddress</a>;</div>
<div class="line"><a name="l00414"></a><span class="lineno"><a class="code" href="class_b_t_d.html#a91d92fee94e5a4cbca472bb3fd883e3e"> 414</a></span>&#160; <a class="code" href="struct_ep_info.html">EpInfo</a> <a class="code" href="class_b_t_d.html#a91d92fee94e5a4cbca472bb3fd883e3e">epInfo</a>[<a class="code" href="_b_t_d_8h.html#aee41c4878894db24e7ad8cd6246595cd">BTD_MAX_ENDPOINTS</a>];</div>
<div class="line"><a name="l00415"></a><span class="lineno"> 415</span>&#160;</div>
<div class="line"><a name="l00417"></a><span class="lineno"><a class="code" href="class_b_t_d.html#a10c34527ae90e95791ac48ac7d1154a2"> 417</a></span>&#160; uint8_t <a class="code" href="class_b_t_d.html#a10c34527ae90e95791ac48ac7d1154a2">bConfNum</a>;</div>
<div class="line"><a name="l00419"></a><span class="lineno"><a class="code" href="class_b_t_d.html#a893dd35932821cddda7e482a1904af66"> 419</a></span>&#160; uint8_t <a class="code" href="class_b_t_d.html#a893dd35932821cddda7e482a1904af66">bNumEP</a>;</div>
<div class="line"><a name="l00421"></a><span class="lineno"><a class="code" href="class_b_t_d.html#a52d6c7895f6bb01729d01ce28a2f3079"> 421</a></span>&#160; uint32_t <a class="code" href="class_b_t_d.html#a52d6c7895f6bb01729d01ce28a2f3079">qNextPollTime</a>;</div>
<div class="line"><a name="l00422"></a><span class="lineno"> 422</span>&#160;</div>
<div class="line"><a name="l00424"></a><span class="lineno"><a class="code" href="class_b_t_d.html#a49f433ab824f259c3815e180c73bb0ad"> 424</a></span>&#160; <span class="keyword">static</span> <span class="keyword">const</span> uint8_t <a class="code" href="class_b_t_d.html#a49f433ab824f259c3815e180c73bb0ad">BTD_CONTROL_PIPE</a>;</div>
<div class="line"><a name="l00426"></a><span class="lineno"><a class="code" href="class_b_t_d.html#a24166c9b308925eeb2f635fae43ca5ec"> 426</a></span>&#160; <span class="keyword">static</span> <span class="keyword">const</span> uint8_t <a class="code" href="class_b_t_d.html#a24166c9b308925eeb2f635fae43ca5ec">BTD_EVENT_PIPE</a>;</div>
<div class="line"><a name="l00428"></a><span class="lineno"><a class="code" href="class_b_t_d.html#a480510bd399ae74a97cd74c8474ef59c"> 428</a></span>&#160; <span class="keyword">static</span> <span class="keyword">const</span> uint8_t <a class="code" href="class_b_t_d.html#a480510bd399ae74a97cd74c8474ef59c">BTD_DATAIN_PIPE</a>;</div>
<div class="line"><a name="l00430"></a><span class="lineno"><a class="code" href="class_b_t_d.html#a0d82870f7eef8c27c33e6f5989d7a4dd"> 430</a></span>&#160; <span class="keyword">static</span> <span class="keyword">const</span> uint8_t <a class="code" href="class_b_t_d.html#a0d82870f7eef8c27c33e6f5989d7a4dd">BTD_DATAOUT_PIPE</a>;</div>
<div class="line"><a name="l00431"></a><span class="lineno"> 431</span>&#160;</div>
<div class="line"><a name="l00436"></a><span class="lineno"> 436</span>&#160; <span class="keywordtype">void</span> <a class="code" href="class_b_t_d.html#aa5976eead215a58553aee683d42405a0">PrintEndpointDescriptor</a>(<span class="keyword">const</span> <a class="code" href="struct_u_s_b___e_n_d_p_o_i_n_t___d_e_s_c_r_i_p_t_o_r.html">USB_ENDPOINT_DESCRIPTOR</a>* ep_ptr);</div>
<div class="line"><a name="l00437"></a><span class="lineno"> 437</span>&#160;</div>
<div class="line"><a name="l00438"></a><span class="lineno"> 438</span>&#160;<span class="keyword">private</span>:</div>
<div class="line"><a name="l00439"></a><span class="lineno"> 439</span>&#160; <a class="code" href="class_bluetooth_service.html">BluetoothService</a>* btService[<a class="code" href="_b_t_d_8h.html#a2222709eed4c8af293e881ea36f599b0">BTD_NUMSERVICES</a>];</div>
<div class="line"><a name="l00440"></a><span class="lineno"> 440</span>&#160;</div>
<div class="line"><a name="l00441"></a><span class="lineno"> 441</span>&#160; <span class="keywordtype">bool</span> bPollEnable;</div>
<div class="line"><a name="l00442"></a><span class="lineno"> 442</span>&#160; uint8_t pollInterval;</div>
<div class="line"><a name="l00443"></a><span class="lineno"> 443</span>&#160;</div>
<div class="line"><a name="l00444"></a><span class="lineno"> 444</span>&#160; <span class="comment">/* Variables used by high level HCI task */</span></div>
<div class="line"><a name="l00445"></a><span class="lineno"> 445</span>&#160; uint8_t hci_state; <span class="comment">//current state of bluetooth hci connection</span></div>
<div class="line"><a name="l00446"></a><span class="lineno"> 446</span>&#160; uint16_t hci_counter; <span class="comment">// counter used for bluetooth hci reset loops</span></div>
<div class="line"><a name="l00447"></a><span class="lineno"> 447</span>&#160; uint8_t hci_num_reset_loops; <span class="comment">// this value indicate how many times it should read before trying to reset</span></div>
<div class="line"><a name="l00448"></a><span class="lineno"> 448</span>&#160; uint16_t hci_event_flag; <span class="comment">// hci flags of received bluetooth events</span></div>
<div class="line"><a name="l00449"></a><span class="lineno"> 449</span>&#160; uint8_t inquiry_counter;</div>
<div class="line"><a name="l00450"></a><span class="lineno"> 450</span>&#160;</div>
<div class="line"><a name="l00451"></a><span class="lineno"> 451</span>&#160; uint8_t hcibuf[<a class="code" href="_b_t_d_8h.html#a32d591ef5742a99963130616ef146787">BULK_MAXPKTSIZE</a>]; <span class="comment">//General purpose buffer for hci data</span></div>
<div class="line"><a name="l00452"></a><span class="lineno"> 452</span>&#160; uint8_t l2capinbuf[<a class="code" href="_b_t_d_8h.html#a32d591ef5742a99963130616ef146787">BULK_MAXPKTSIZE</a>]; <span class="comment">//General purpose buffer for l2cap in data</span></div>
<div class="line"><a name="l00453"></a><span class="lineno"> 453</span>&#160; uint8_t l2capoutbuf[<a class="code" href="_b_t_d_8h.html#a32d591ef5742a99963130616ef146787">BULK_MAXPKTSIZE</a>]; <span class="comment">//General purpose buffer for l2cap out data</span></div>
<div class="line"><a name="l00454"></a><span class="lineno"> 454</span>&#160;</div>
<div class="line"><a name="l00455"></a><span class="lineno"> 455</span>&#160; <span class="comment">/* State machines */</span></div>
<div class="line"><a name="l00456"></a><span class="lineno"> 456</span>&#160; <span class="keywordtype">void</span> HCI_event_task(); <span class="comment">// Poll the HCI event pipe</span></div>
<div class="line"><a name="l00457"></a><span class="lineno"> 457</span>&#160; <span class="keywordtype">void</span> HCI_task(); <span class="comment">// HCI state machine</span></div>
<div class="line"><a name="l00458"></a><span class="lineno"> 458</span>&#160; <span class="keywordtype">void</span> ACL_event_task(); <span class="comment">// ACL input pipe</span></div>
<div class="line"><a name="l00459"></a><span class="lineno"> 459</span>&#160;</div>
<div class="line"><a name="l00460"></a><span class="lineno"> 460</span>&#160; <span class="comment">/* Used to set the Bluetooth Address internally to the PS3 Controllers */</span></div>
<div class="line"><a name="l00461"></a><span class="lineno"> 461</span>&#160; <span class="keywordtype">void</span> setBdaddr(uint8_t* BDADDR);</div>
<div class="line"><a name="l00462"></a><span class="lineno"> 462</span>&#160; <span class="keywordtype">void</span> setMoveBdaddr(uint8_t* BDADDR);</div>
<div class="line"><a name="l00463"></a><span class="lineno"> 463</span>&#160;};</div>
<div class="line"><a name="l00464"></a><span class="lineno"> 464</span>&#160;<span class="preprocessor">#endif</span></div>
<div class="line"><a name="l00385"></a><span class="lineno"><a class="code" href="class_b_t_d.html#a0359c0c158c864c27319810cbd1534f9"> 385</a></span>&#160; <span class="keyword">const</span> <span class="keywordtype">char</span>* <a class="code" href="class_b_t_d.html#a0359c0c158c864c27319810cbd1534f9">btdName</a>;</div>
<div class="line"><a name="l00387"></a><span class="lineno"><a class="code" href="class_b_t_d.html#a215cb939c01ed3ff56db37841224546c"> 387</a></span>&#160; <span class="keyword">const</span> <span class="keywordtype">char</span>* <a class="code" href="class_b_t_d.html#a215cb939c01ed3ff56db37841224546c">btdPin</a>;</div>
<div class="line"><a name="l00388"></a><span class="lineno"> 388</span>&#160;</div>
<div class="line"><a name="l00390"></a><span class="lineno"><a class="code" href="class_b_t_d.html#a1f8e9171a310e50f2c4a3c19066efe5a"> 390</a></span>&#160; uint8_t <a class="code" href="class_b_t_d.html#a1f8e9171a310e50f2c4a3c19066efe5a">my_bdaddr</a>[6];</div>
<div class="line"><a name="l00392"></a><span class="lineno"><a class="code" href="class_b_t_d.html#aa3bb6c692701cb33dfad1ea4d68b6f98"> 392</a></span>&#160; uint16_t <a class="code" href="class_b_t_d.html#aa3bb6c692701cb33dfad1ea4d68b6f98">hci_handle</a>;</div>
<div class="line"><a name="l00394"></a><span class="lineno"><a class="code" href="class_b_t_d.html#ab23f95f12675d7b4505ca6807d379182"> 394</a></span>&#160; uint8_t <a class="code" href="class_b_t_d.html#ab23f95f12675d7b4505ca6807d379182">disc_bdaddr</a>[6];</div>
<div class="line"><a name="l00396"></a><span class="lineno"><a class="code" href="class_b_t_d.html#aede42d995c384c238fd49d728df01e4e"> 396</a></span>&#160; uint8_t <a class="code" href="class_b_t_d.html#aede42d995c384c238fd49d728df01e4e">remote_name</a>[30];</div>
<div class="line"><a name="l00402"></a><span class="lineno"><a class="code" href="class_b_t_d.html#addaddee110af23a3195ad56f631e69ea"> 402</a></span>&#160; uint8_t <a class="code" href="class_b_t_d.html#addaddee110af23a3195ad56f631e69ea">hci_version</a>;</div>
<div class="line"><a name="l00403"></a><span class="lineno"> 403</span>&#160;</div>
<div class="line"><a name="l00405"></a><span class="lineno"><a class="code" href="class_b_t_d.html#a6b66a27c0fd359e3129f53451352b55c"> 405</a></span>&#160; <span class="keywordtype">void</span> <a class="code" href="class_b_t_d.html#a6b66a27c0fd359e3129f53451352b55c">pairWithWiimote</a>() {</div>
<div class="line"><a name="l00406"></a><span class="lineno"> 406</span>&#160; <a class="code" href="class_b_t_d.html#a0c8cc2a2dd2cda3e760b8b4c1a2d169c">pairWithWii</a> = <span class="keyword">true</span>;</div>
<div class="line"><a name="l00407"></a><span class="lineno"> 407</span>&#160; hci_state = <a class="code" href="_b_t_d_8h.html#a36daee23c5d0f4276e6eb32f3fd79124">HCI_CHECK_WII_SERVICE</a>;</div>
<div class="line"><a name="l00408"></a><span class="lineno"><a class="code" href="class_b_t_d.html#ac7caac80fb6f5f0e794af3644887d88e"> 408</a></span>&#160; };</div>
<div class="line"><a name="l00410"></a><span class="lineno"> 410</span>&#160; <span class="keywordtype">bool</span> <a class="code" href="class_b_t_d.html#ac7caac80fb6f5f0e794af3644887d88e">connectToWii</a>;</div>
<div class="line"><a name="l00412"></a><span class="lineno"><a class="code" href="class_b_t_d.html#a4dc8f94fe85028f3d54f13dde1e5b4ee"> 412</a></span>&#160; <span class="keywordtype">bool</span> <a class="code" href="class_b_t_d.html#a4dc8f94fe85028f3d54f13dde1e5b4ee">incomingWii</a>;</div>
<div class="line"><a name="l00414"></a><span class="lineno"><a class="code" href="class_b_t_d.html#a0c8cc2a2dd2cda3e760b8b4c1a2d169c"> 414</a></span>&#160; <span class="keywordtype">bool</span> <a class="code" href="class_b_t_d.html#a0c8cc2a2dd2cda3e760b8b4c1a2d169c">pairWithWii</a>;</div>
<div class="line"><a name="l00416"></a><span class="lineno"><a class="code" href="class_b_t_d.html#a3aea445b2349e99ef057db1a4ffdd9dc"> 416</a></span>&#160; <span class="keywordtype">bool</span> <a class="code" href="class_b_t_d.html#a3aea445b2349e99ef057db1a4ffdd9dc">motionPlusInside</a>;</div>
<div class="line"><a name="l00418"></a><span class="lineno"><a class="code" href="class_b_t_d.html#a962a5714c225dcb633434f02e3657583"> 418</a></span>&#160; <span class="keywordtype">bool</span> <a class="code" href="class_b_t_d.html#a962a5714c225dcb633434f02e3657583">wiiUProController</a>;</div>
<div class="line"><a name="l00419"></a><span class="lineno"> 419</span>&#160;</div>
<div class="line"><a name="l00424"></a><span class="lineno"><a class="code" href="class_b_t_d.html#a2a9ecb996243e070e70972370e45e4fd"> 424</a></span>&#160; uint8_t <a class="code" href="class_b_t_d.html#a2a9ecb996243e070e70972370e45e4fd">readPollInterval</a>() {</div>
<div class="line"><a name="l00425"></a><span class="lineno"> 425</span>&#160; <span class="keywordflow">return</span> pollInterval;</div>
<div class="line"><a name="l00426"></a><span class="lineno"><a class="code" href="class_b_t_d.html#a4bcd1d622a6455ee3d0cccc4408700a1"> 426</a></span>&#160; };</div>
<div class="line"><a name="l00427"></a><span class="lineno"> 427</span>&#160;</div>
<div class="line"><a name="l00428"></a><span class="lineno"> 428</span>&#160;<span class="keyword">protected</span>:</div>
<div class="line"><a name="l00430"></a><span class="lineno"> 430</span>&#160; <a class="code" href="class_u_s_b.html">USB</a> *<a class="code" href="class_b_t_d.html#a4bcd1d622a6455ee3d0cccc4408700a1">pUsb</a>;</div>
<div class="line"><a name="l00432"></a><span class="lineno"><a class="code" href="class_b_t_d.html#a58f78a9a28db81858dcc34a32a2ec82c"> 432</a></span>&#160; uint8_t <a class="code" href="class_b_t_d.html#a58f78a9a28db81858dcc34a32a2ec82c">bAddress</a>;</div>
<div class="line"><a name="l00434"></a><span class="lineno"><a class="code" href="class_b_t_d.html#a91d92fee94e5a4cbca472bb3fd883e3e"> 434</a></span>&#160; <a class="code" href="struct_ep_info.html">EpInfo</a> <a class="code" href="class_b_t_d.html#a91d92fee94e5a4cbca472bb3fd883e3e">epInfo</a>[<a class="code" href="_b_t_d_8h.html#aee41c4878894db24e7ad8cd6246595cd">BTD_MAX_ENDPOINTS</a>];</div>
<div class="line"><a name="l00435"></a><span class="lineno"> 435</span>&#160;</div>
<div class="line"><a name="l00437"></a><span class="lineno"><a class="code" href="class_b_t_d.html#a10c34527ae90e95791ac48ac7d1154a2"> 437</a></span>&#160; uint8_t <a class="code" href="class_b_t_d.html#a10c34527ae90e95791ac48ac7d1154a2">bConfNum</a>;</div>
<div class="line"><a name="l00439"></a><span class="lineno"><a class="code" href="class_b_t_d.html#a893dd35932821cddda7e482a1904af66"> 439</a></span>&#160; uint8_t <a class="code" href="class_b_t_d.html#a893dd35932821cddda7e482a1904af66">bNumEP</a>;</div>
<div class="line"><a name="l00441"></a><span class="lineno"><a class="code" href="class_b_t_d.html#a52d6c7895f6bb01729d01ce28a2f3079"> 441</a></span>&#160; uint32_t <a class="code" href="class_b_t_d.html#a52d6c7895f6bb01729d01ce28a2f3079">qNextPollTime</a>;</div>
<div class="line"><a name="l00442"></a><span class="lineno"> 442</span>&#160;</div>
<div class="line"><a name="l00444"></a><span class="lineno"><a class="code" href="class_b_t_d.html#a49f433ab824f259c3815e180c73bb0ad"> 444</a></span>&#160; <span class="keyword">static</span> <span class="keyword">const</span> uint8_t <a class="code" href="class_b_t_d.html#a49f433ab824f259c3815e180c73bb0ad">BTD_CONTROL_PIPE</a>;</div>
<div class="line"><a name="l00446"></a><span class="lineno"><a class="code" href="class_b_t_d.html#a24166c9b308925eeb2f635fae43ca5ec"> 446</a></span>&#160; <span class="keyword">static</span> <span class="keyword">const</span> uint8_t <a class="code" href="class_b_t_d.html#a24166c9b308925eeb2f635fae43ca5ec">BTD_EVENT_PIPE</a>;</div>
<div class="line"><a name="l00448"></a><span class="lineno"><a class="code" href="class_b_t_d.html#a480510bd399ae74a97cd74c8474ef59c"> 448</a></span>&#160; <span class="keyword">static</span> <span class="keyword">const</span> uint8_t <a class="code" href="class_b_t_d.html#a480510bd399ae74a97cd74c8474ef59c">BTD_DATAIN_PIPE</a>;</div>
<div class="line"><a name="l00450"></a><span class="lineno"><a class="code" href="class_b_t_d.html#a0d82870f7eef8c27c33e6f5989d7a4dd"> 450</a></span>&#160; <span class="keyword">static</span> <span class="keyword">const</span> uint8_t <a class="code" href="class_b_t_d.html#a0d82870f7eef8c27c33e6f5989d7a4dd">BTD_DATAOUT_PIPE</a>;</div>
<div class="line"><a name="l00451"></a><span class="lineno"> 451</span>&#160;</div>
<div class="line"><a name="l00456"></a><span class="lineno"> 456</span>&#160; <span class="keywordtype">void</span> <a class="code" href="class_b_t_d.html#aa5976eead215a58553aee683d42405a0">PrintEndpointDescriptor</a>(<span class="keyword">const</span> <a class="code" href="struct_u_s_b___e_n_d_p_o_i_n_t___d_e_s_c_r_i_p_t_o_r.html">USB_ENDPOINT_DESCRIPTOR</a>* ep_ptr);</div>
<div class="line"><a name="l00457"></a><span class="lineno"> 457</span>&#160;</div>
<div class="line"><a name="l00458"></a><span class="lineno"> 458</span>&#160;<span class="keyword">private</span>:</div>
<div class="line"><a name="l00459"></a><span class="lineno"> 459</span>&#160; <a class="code" href="class_bluetooth_service.html">BluetoothService</a>* btService[<a class="code" href="_b_t_d_8h.html#a2222709eed4c8af293e881ea36f599b0">BTD_NUMSERVICES</a>];</div>
<div class="line"><a name="l00460"></a><span class="lineno"> 460</span>&#160;</div>
<div class="line"><a name="l00461"></a><span class="lineno"> 461</span>&#160; <span class="keywordtype">bool</span> bPollEnable;</div>
<div class="line"><a name="l00462"></a><span class="lineno"> 462</span>&#160; uint8_t pollInterval;</div>
<div class="line"><a name="l00463"></a><span class="lineno"> 463</span>&#160;</div>
<div class="line"><a name="l00464"></a><span class="lineno"> 464</span>&#160; <span class="comment">/* Variables used by high level HCI task */</span></div>
<div class="line"><a name="l00465"></a><span class="lineno"> 465</span>&#160; uint8_t hci_state; <span class="comment">//current state of bluetooth hci connection</span></div>
<div class="line"><a name="l00466"></a><span class="lineno"> 466</span>&#160; uint16_t hci_counter; <span class="comment">// counter used for bluetooth hci reset loops</span></div>
<div class="line"><a name="l00467"></a><span class="lineno"> 467</span>&#160; uint8_t hci_num_reset_loops; <span class="comment">// this value indicate how many times it should read before trying to reset</span></div>
<div class="line"><a name="l00468"></a><span class="lineno"> 468</span>&#160; uint16_t hci_event_flag; <span class="comment">// hci flags of received bluetooth events</span></div>
<div class="line"><a name="l00469"></a><span class="lineno"> 469</span>&#160; uint8_t inquiry_counter;</div>
<div class="line"><a name="l00470"></a><span class="lineno"> 470</span>&#160;</div>
<div class="line"><a name="l00471"></a><span class="lineno"> 471</span>&#160; uint8_t hcibuf[<a class="code" href="_b_t_d_8h.html#a32d591ef5742a99963130616ef146787">BULK_MAXPKTSIZE</a>]; <span class="comment">//General purpose buffer for hci data</span></div>
<div class="line"><a name="l00472"></a><span class="lineno"> 472</span>&#160; uint8_t l2capinbuf[<a class="code" href="_b_t_d_8h.html#a32d591ef5742a99963130616ef146787">BULK_MAXPKTSIZE</a>]; <span class="comment">//General purpose buffer for l2cap in data</span></div>
<div class="line"><a name="l00473"></a><span class="lineno"> 473</span>&#160; uint8_t l2capoutbuf[14]; <span class="comment">//General purpose buffer for l2cap out data</span></div>
<div class="line"><a name="l00474"></a><span class="lineno"> 474</span>&#160;</div>
<div class="line"><a name="l00475"></a><span class="lineno"> 475</span>&#160; <span class="comment">/* State machines */</span></div>
<div class="line"><a name="l00476"></a><span class="lineno"> 476</span>&#160; <span class="keywordtype">void</span> HCI_event_task(); <span class="comment">// Poll the HCI event pipe</span></div>
<div class="line"><a name="l00477"></a><span class="lineno"> 477</span>&#160; <span class="keywordtype">void</span> HCI_task(); <span class="comment">// HCI state machine</span></div>
<div class="line"><a name="l00478"></a><span class="lineno"> 478</span>&#160; <span class="keywordtype">void</span> ACL_event_task(); <span class="comment">// ACL input pipe</span></div>
<div class="line"><a name="l00479"></a><span class="lineno"> 479</span>&#160;</div>
<div class="line"><a name="l00480"></a><span class="lineno"> 480</span>&#160; <span class="comment">/* Used to set the Bluetooth Address internally to the PS3 Controllers */</span></div>
<div class="line"><a name="l00481"></a><span class="lineno"> 481</span>&#160; <span class="keywordtype">void</span> setBdaddr(uint8_t* BDADDR);</div>
<div class="line"><a name="l00482"></a><span class="lineno"> 482</span>&#160; <span class="keywordtype">void</span> setMoveBdaddr(uint8_t* BDADDR);</div>
<div class="line"><a name="l00483"></a><span class="lineno"> 483</span>&#160;};</div>
<div class="line"><a name="l00484"></a><span class="lineno"> 484</span>&#160;<span class="preprocessor">#endif</span></div>
</div><!-- fragment --></div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>

View file

@ -95,7 +95,7 @@ Include dependency graph for PS3BT.cpp:</div>
<div class="dyncontent">
<div class="center"><img src="_p_s3_b_t_8cpp__incl.png" border="0" usemap="#_p_s3_b_t_8cpp" alt=""/></div>
<map name="_p_s3_b_t_8cpp" id="_p_s3_b_t_8cpp">
<area shape="rect" id="node2" href="_p_s3_b_t_8h.html" title="PS3BT.h" alt="" coords="477,75,531,96"/><area shape="rect" id="node3" href="_b_t_d_8h.html" title="BTD.h" alt="" coords="442,144,487,165"/><area shape="rect" id="node22" href="_p_s3_enums_8h.html" title="PS3Enums.h" alt="" coords="511,144,581,165"/><area shape="rect" id="node4" href="_usb_8h.html" title="Usb.h" alt="" coords="590,283,633,304"/><area shape="rect" id="node20" href="confdescparser_8h.html" title="confdescparser.h" alt="" coords="195,213,278,235"/><area shape="rect" id="node7" href="avrpins_8h.html" title="avrpins.h" alt="" coords="879,421,933,443"/><area shape="rect" id="node9" href="max3421e_8h.html" title="max3421e.h" alt="" coords="585,421,651,443"/><area shape="rect" id="node10" href="usbhost_8h.html" title="usbhost.h" alt="" coords="744,352,801,373"/><area shape="rect" id="node11" href="usb__ch9_8h.html" title="usb_ch9.h" alt="" coords="675,421,734,443"/><area shape="rect" id="node13" href="address_8h.html" title="address.h" alt="" coords="485,352,542,373"/><area shape="rect" id="node16" href="message_8h.html" title="message.h" alt="" coords="171,352,233,373"/><area shape="rect" id="node18" href="printhex_8h.html" title="printhex.h" alt="" coords="153,491,210,512"/><area shape="rect" id="node19" href="hexdump_8h.html" title="hexdump.h" alt="" coords="171,421,233,443"/><area shape="rect" id="node21" href="parsetools_8h.html" title="parsetools.h" alt="" coords="133,283,198,304"/><area shape="rect" id="node23" href="controller_enums_8h.html" title="controllerEnums.h" alt="" coords="503,213,589,235"/></map>
<area shape="rect" id="node2" href="_p_s3_b_t_8h.html" title="PS3BT.h" alt="" coords="494,75,548,96"/><area shape="rect" id="node3" href="_b_t_d_8h.html" title="BTD.h" alt="" coords="458,144,504,165"/><area shape="rect" id="node22" href="_p_s3_enums_8h.html" title="PS3Enums.h" alt="" coords="528,144,597,165"/><area shape="rect" id="node4" href="_usb_8h.html" title="Usb.h" alt="" coords="605,283,648,304"/><area shape="rect" id="node20" href="confdescparser_8h.html" title="confdescparser.h" alt="" coords="211,213,294,235"/><area shape="rect" id="node7" href="avrpins_8h.html" title="avrpins.h" alt="" coords="895,421,949,443"/><area shape="rect" id="node9" href="max3421e_8h.html" title="max3421e.h" alt="" coords="601,421,668,443"/><area shape="rect" id="node10" href="usbhost_8h.html" title="usbhost.h" alt="" coords="759,352,816,373"/><area shape="rect" id="node12" href="usb__ch9_8h.html" title="usb_ch9.h" alt="" coords="692,421,750,443"/><area shape="rect" id="node14" href="address_8h.html" title="address.h" alt="" coords="500,352,557,373"/><area shape="rect" id="node16" href="message_8h.html" title="message.h" alt="" coords="188,352,249,373"/><area shape="rect" id="node18" href="printhex_8h.html" title="printhex.h" alt="" coords="190,491,246,512"/><area shape="rect" id="node19" href="hexdump_8h.html" title="hexdump.h" alt="" coords="188,421,249,443"/><area shape="rect" id="node21" href="parsetools_8h.html" title="parsetools.h" alt="" coords="150,283,214,304"/><area shape="rect" id="node23" href="controller_enums_8h.html" title="controllerEnums.h" alt="" coords="519,213,605,235"/></map>
</div>
</div>
<p><a href="_p_s3_b_t_8cpp_source.html">Go to the source code of this file.</a></p>

View file

@ -1,17 +1,17 @@
<map id="PS3BT.cpp" name="PS3BT.cpp">
<area shape="rect" id="node2" href="$_p_s3_b_t_8h.html" title="PS3BT.h" alt="" coords="477,75,531,96"/>
<area shape="rect" id="node3" href="$_b_t_d_8h.html" title="BTD.h" alt="" coords="442,144,487,165"/>
<area shape="rect" id="node22" href="$_p_s3_enums_8h.html" title="PS3Enums.h" alt="" coords="511,144,581,165"/>
<area shape="rect" id="node4" href="$_usb_8h.html" title="Usb.h" alt="" coords="590,283,633,304"/>
<area shape="rect" id="node20" href="$confdescparser_8h.html" title="confdescparser.h" alt="" coords="195,213,278,235"/>
<area shape="rect" id="node7" href="$avrpins_8h.html" title="avrpins.h" alt="" coords="879,421,933,443"/>
<area shape="rect" id="node9" href="$max3421e_8h.html" title="max3421e.h" alt="" coords="585,421,651,443"/>
<area shape="rect" id="node10" href="$usbhost_8h.html" title="usbhost.h" alt="" coords="744,352,801,373"/>
<area shape="rect" id="node11" href="$usb__ch9_8h.html" title="usb_ch9.h" alt="" coords="675,421,734,443"/>
<area shape="rect" id="node13" href="$address_8h.html" title="address.h" alt="" coords="485,352,542,373"/>
<area shape="rect" id="node16" href="$message_8h.html" title="message.h" alt="" coords="171,352,233,373"/>
<area shape="rect" id="node18" href="$printhex_8h.html" title="printhex.h" alt="" coords="153,491,210,512"/>
<area shape="rect" id="node19" href="$hexdump_8h.html" title="hexdump.h" alt="" coords="171,421,233,443"/>
<area shape="rect" id="node21" href="$parsetools_8h.html" title="parsetools.h" alt="" coords="133,283,198,304"/>
<area shape="rect" id="node23" href="$controller_enums_8h.html" title="controllerEnums.h" alt="" coords="503,213,589,235"/>
<area shape="rect" id="node2" href="$_p_s3_b_t_8h.html" title="PS3BT.h" alt="" coords="494,75,548,96"/>
<area shape="rect" id="node3" href="$_b_t_d_8h.html" title="BTD.h" alt="" coords="458,144,504,165"/>
<area shape="rect" id="node22" href="$_p_s3_enums_8h.html" title="PS3Enums.h" alt="" coords="528,144,597,165"/>
<area shape="rect" id="node4" href="$_usb_8h.html" title="Usb.h" alt="" coords="605,283,648,304"/>
<area shape="rect" id="node20" href="$confdescparser_8h.html" title="confdescparser.h" alt="" coords="211,213,294,235"/>
<area shape="rect" id="node7" href="$avrpins_8h.html" title="avrpins.h" alt="" coords="895,421,949,443"/>
<area shape="rect" id="node9" href="$max3421e_8h.html" title="max3421e.h" alt="" coords="601,421,668,443"/>
<area shape="rect" id="node10" href="$usbhost_8h.html" title="usbhost.h" alt="" coords="759,352,816,373"/>
<area shape="rect" id="node12" href="$usb__ch9_8h.html" title="usb_ch9.h" alt="" coords="692,421,750,443"/>
<area shape="rect" id="node14" href="$address_8h.html" title="address.h" alt="" coords="500,352,557,373"/>
<area shape="rect" id="node16" href="$message_8h.html" title="message.h" alt="" coords="188,352,249,373"/>
<area shape="rect" id="node18" href="$printhex_8h.html" title="printhex.h" alt="" coords="190,491,246,512"/>
<area shape="rect" id="node19" href="$hexdump_8h.html" title="hexdump.h" alt="" coords="188,421,249,443"/>
<area shape="rect" id="node21" href="$parsetools_8h.html" title="parsetools.h" alt="" coords="150,283,214,304"/>
<area shape="rect" id="node23" href="$controller_enums_8h.html" title="controllerEnums.h" alt="" coords="519,213,605,235"/>
</map>

View file

@ -1 +1 @@
b3ed17f5aee67e9e9bf7a1eeff08c5fa
c9818ee4b6f8022146310289632b9ac6

Binary file not shown.

Before

Width:  |  Height:  |  Size: 82 KiB

After

Width:  |  Height:  |  Size: 88 KiB

View file

@ -346,11 +346,11 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
<div class="line"><a name="l00255"></a><span class="lineno"> 255</span>&#160; l2cap_state = <a class="code" href="_p_s3_b_t_8h.html#a15cc1db556ad9a4ec6144ca8a42f8919">L2CAP_WAIT</a>;</div>
<div class="line"><a name="l00256"></a><span class="lineno"> 256</span>&#160; <span class="keywordflow">for</span> (uint8_t i = 0; i &lt; 30; i++)</div>
<div class="line"><a name="l00257"></a><span class="lineno"> 257</span>&#160; remote_name[i] = pBtd-&gt;<a class="code" href="class_b_t_d.html#aede42d995c384c238fd49d728df01e4e">remote_name</a>[i]; <span class="comment">// Store the remote name for the connection</span></div>
<div class="line"><a name="l00258"></a><span class="lineno"> 258</span>&#160;#ifdef <a class="code" href="message_8h.html#aded3b733d68d3c49e69a3b87db37028c">DEBUG_USB_HOST</a></div>
<div class="line"><a name="l00258"></a><span class="lineno"> 258</span>&#160;#ifdef DEBUG_USB_HOST</div>
<div class="line"><a name="l00259"></a><span class="lineno"> 259</span>&#160; if (pBtd-&gt;<a class="code" href="class_b_t_d.html#addaddee110af23a3195ad56f631e69ea">hci_version</a> &lt; 3) { <span class="comment">// Check the HCI Version of the Bluetooth dongle</span></div>
<div class="line"><a name="l00260"></a><span class="lineno"> 260</span>&#160; <a class="code" href="message_8h.html#a747819b0aa34f5c3ba0332c2db28c846">Notify</a>(PSTR(<span class="stringliteral">&quot;\r\nYour dongle may not support reading the analog buttons, sensors and status\r\nYour HCI Version is: &quot;</span>), 0x80);</div>
<div class="line"><a name="l00261"></a><span class="lineno"> 261</span>&#160; <a class="code" href="message_8h.html#a747819b0aa34f5c3ba0332c2db28c846">Notify</a>(pBtd-&gt;<a class="code" href="class_b_t_d.html#addaddee110af23a3195ad56f631e69ea">hci_version</a>, 0x80);</div>
<div class="line"><a name="l00262"></a><span class="lineno"> 262</span>&#160; <a class="code" href="message_8h.html#a747819b0aa34f5c3ba0332c2db28c846">Notify</a>(PSTR(<span class="stringliteral">&quot;\r\nBut should be at least 3\r\nThis means that it doesn&#39;t support Bluetooth Version 2.0+EDR&quot;</span>), 0x80);</div>
<div class="line"><a name="l00260"></a><span class="lineno"> 260</span>&#160; <a class="code" href="message_8h.html#a27117e124c5d66d5512fe8d494fe6338">Notify</a>(PSTR(<span class="stringliteral">&quot;\r\nYour dongle may not support reading the analog buttons, sensors and status\r\nYour HCI Version is: &quot;</span>), 0x80);</div>
<div class="line"><a name="l00261"></a><span class="lineno"> 261</span>&#160; <a class="code" href="message_8h.html#a27117e124c5d66d5512fe8d494fe6338">Notify</a>(pBtd-&gt;<a class="code" href="class_b_t_d.html#addaddee110af23a3195ad56f631e69ea">hci_version</a>, 0x80);</div>
<div class="line"><a name="l00262"></a><span class="lineno"> 262</span>&#160; <a class="code" href="message_8h.html#a27117e124c5d66d5512fe8d494fe6338">Notify</a>(PSTR(<span class="stringliteral">&quot;\r\nBut should be at least 3\r\nThis means that it doesn&#39;t support Bluetooth Version 2.0+EDR&quot;</span>), 0x80);</div>
<div class="line"><a name="l00263"></a><span class="lineno"> 263</span>&#160; }</div>
<div class="line"><a name="l00264"></a><span class="lineno"> 264</span>&#160;<span class="preprocessor">#endif</span></div>
<div class="line"><a name="l00265"></a><span class="lineno"> 265</span>&#160;<span class="preprocessor"></span> }</div>
@ -362,30 +362,30 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
<div class="line"><a name="l00271"></a><span class="lineno"> 271</span>&#160; <span class="keywordflow">if</span> ((l2capinbuf[6] | (l2capinbuf[7] &lt;&lt; 8)) == 0x0001) { <span class="comment">//l2cap_control - Channel ID for ACL-U</span></div>
<div class="line"><a name="l00272"></a><span class="lineno"> 272</span>&#160; <span class="keywordflow">if</span> (l2capinbuf[8] == <a class="code" href="_b_t_d_8h.html#a6ffcd72787c86f248192eb06a3fe18cb">L2CAP_CMD_COMMAND_REJECT</a>) {</div>
<div class="line"><a name="l00273"></a><span class="lineno"> 273</span>&#160;<span class="preprocessor">#ifdef DEBUG_USB_HOST</span></div>
<div class="line"><a name="l00274"></a><span class="lineno"> 274</span>&#160;<span class="preprocessor"></span> <a class="code" href="message_8h.html#a747819b0aa34f5c3ba0332c2db28c846">Notify</a>(PSTR(<span class="stringliteral">&quot;\r\nL2CAP Command Rejected - Reason: &quot;</span>), 0x80);</div>
<div class="line"><a name="l00274"></a><span class="lineno"> 274</span>&#160;<span class="preprocessor"></span> <a class="code" href="message_8h.html#a27117e124c5d66d5512fe8d494fe6338">Notify</a>(PSTR(<span class="stringliteral">&quot;\r\nL2CAP Command Rejected - Reason: &quot;</span>), 0x80);</div>
<div class="line"><a name="l00275"></a><span class="lineno"> 275</span>&#160; D_PrintHex&lt;uint8_t &gt; (l2capinbuf[13], 0x80);</div>
<div class="line"><a name="l00276"></a><span class="lineno"> 276</span>&#160; <a class="code" href="message_8h.html#a747819b0aa34f5c3ba0332c2db28c846">Notify</a>(PSTR(<span class="stringliteral">&quot; &quot;</span>), 0x80);</div>
<div class="line"><a name="l00276"></a><span class="lineno"> 276</span>&#160; <a class="code" href="message_8h.html#a27117e124c5d66d5512fe8d494fe6338">Notify</a>(PSTR(<span class="stringliteral">&quot; &quot;</span>), 0x80);</div>
<div class="line"><a name="l00277"></a><span class="lineno"> 277</span>&#160; D_PrintHex&lt;uint8_t &gt; (l2capinbuf[12], 0x80);</div>
<div class="line"><a name="l00278"></a><span class="lineno"> 278</span>&#160; <a class="code" href="message_8h.html#a747819b0aa34f5c3ba0332c2db28c846">Notify</a>(PSTR(<span class="stringliteral">&quot; Data: &quot;</span>), 0x80);</div>
<div class="line"><a name="l00278"></a><span class="lineno"> 278</span>&#160; <a class="code" href="message_8h.html#a27117e124c5d66d5512fe8d494fe6338">Notify</a>(PSTR(<span class="stringliteral">&quot; Data: &quot;</span>), 0x80);</div>
<div class="line"><a name="l00279"></a><span class="lineno"> 279</span>&#160; D_PrintHex&lt;uint8_t &gt; (l2capinbuf[17], 0x80);</div>
<div class="line"><a name="l00280"></a><span class="lineno"> 280</span>&#160; <a class="code" href="message_8h.html#a747819b0aa34f5c3ba0332c2db28c846">Notify</a>(PSTR(<span class="stringliteral">&quot; &quot;</span>), 0x80);</div>
<div class="line"><a name="l00280"></a><span class="lineno"> 280</span>&#160; <a class="code" href="message_8h.html#a27117e124c5d66d5512fe8d494fe6338">Notify</a>(PSTR(<span class="stringliteral">&quot; &quot;</span>), 0x80);</div>
<div class="line"><a name="l00281"></a><span class="lineno"> 281</span>&#160; D_PrintHex&lt;uint8_t &gt; (l2capinbuf[16], 0x80);</div>
<div class="line"><a name="l00282"></a><span class="lineno"> 282</span>&#160; <a class="code" href="message_8h.html#a747819b0aa34f5c3ba0332c2db28c846">Notify</a>(PSTR(<span class="stringliteral">&quot; &quot;</span>), 0x80);</div>
<div class="line"><a name="l00282"></a><span class="lineno"> 282</span>&#160; <a class="code" href="message_8h.html#a27117e124c5d66d5512fe8d494fe6338">Notify</a>(PSTR(<span class="stringliteral">&quot; &quot;</span>), 0x80);</div>
<div class="line"><a name="l00283"></a><span class="lineno"> 283</span>&#160; D_PrintHex&lt;uint8_t &gt; (l2capinbuf[15], 0x80);</div>
<div class="line"><a name="l00284"></a><span class="lineno"> 284</span>&#160; <a class="code" href="message_8h.html#a747819b0aa34f5c3ba0332c2db28c846">Notify</a>(PSTR(<span class="stringliteral">&quot; &quot;</span>), 0x80);</div>
<div class="line"><a name="l00284"></a><span class="lineno"> 284</span>&#160; <a class="code" href="message_8h.html#a27117e124c5d66d5512fe8d494fe6338">Notify</a>(PSTR(<span class="stringliteral">&quot; &quot;</span>), 0x80);</div>
<div class="line"><a name="l00285"></a><span class="lineno"> 285</span>&#160; D_PrintHex&lt;uint8_t &gt; (l2capinbuf[14], 0x80);</div>
<div class="line"><a name="l00286"></a><span class="lineno"> 286</span>&#160;<span class="preprocessor">#endif</span></div>
<div class="line"><a name="l00287"></a><span class="lineno"> 287</span>&#160;<span class="preprocessor"></span> } <span class="keywordflow">else</span> <span class="keywordflow">if</span> (l2capinbuf[8] == <a class="code" href="_b_t_d_8h.html#ac4bae0c65fd00ed849cb226302d19c85">L2CAP_CMD_CONNECTION_REQUEST</a>) {</div>
<div class="line"><a name="l00288"></a><span class="lineno"> 288</span>&#160;<span class="preprocessor">#ifdef EXTRADEBUG</span></div>
<div class="line"><a name="l00289"></a><span class="lineno"> 289</span>&#160;<span class="preprocessor"></span> <a class="code" href="message_8h.html#a747819b0aa34f5c3ba0332c2db28c846">Notify</a>(PSTR(<span class="stringliteral">&quot;\r\nL2CAP Connection Request - PSM: &quot;</span>), 0x80);</div>
<div class="line"><a name="l00289"></a><span class="lineno"> 289</span>&#160;<span class="preprocessor"></span> <a class="code" href="message_8h.html#a27117e124c5d66d5512fe8d494fe6338">Notify</a>(PSTR(<span class="stringliteral">&quot;\r\nL2CAP Connection Request - PSM: &quot;</span>), 0x80);</div>
<div class="line"><a name="l00290"></a><span class="lineno"> 290</span>&#160; D_PrintHex&lt;uint8_t &gt; (l2capinbuf[13], 0x80);</div>
<div class="line"><a name="l00291"></a><span class="lineno"> 291</span>&#160; <a class="code" href="message_8h.html#a747819b0aa34f5c3ba0332c2db28c846">Notify</a>(PSTR(<span class="stringliteral">&quot; &quot;</span>), 0x80);</div>
<div class="line"><a name="l00291"></a><span class="lineno"> 291</span>&#160; <a class="code" href="message_8h.html#a27117e124c5d66d5512fe8d494fe6338">Notify</a>(PSTR(<span class="stringliteral">&quot; &quot;</span>), 0x80);</div>
<div class="line"><a name="l00292"></a><span class="lineno"> 292</span>&#160; D_PrintHex&lt;uint8_t &gt; (l2capinbuf[12], 0x80);</div>
<div class="line"><a name="l00293"></a><span class="lineno"> 293</span>&#160; <a class="code" href="message_8h.html#a747819b0aa34f5c3ba0332c2db28c846">Notify</a>(PSTR(<span class="stringliteral">&quot; SCID: &quot;</span>), 0x80);</div>
<div class="line"><a name="l00293"></a><span class="lineno"> 293</span>&#160; <a class="code" href="message_8h.html#a27117e124c5d66d5512fe8d494fe6338">Notify</a>(PSTR(<span class="stringliteral">&quot; SCID: &quot;</span>), 0x80);</div>
<div class="line"><a name="l00294"></a><span class="lineno"> 294</span>&#160; D_PrintHex&lt;uint8_t &gt; (l2capinbuf[15], 0x80);</div>
<div class="line"><a name="l00295"></a><span class="lineno"> 295</span>&#160; <a class="code" href="message_8h.html#a747819b0aa34f5c3ba0332c2db28c846">Notify</a>(PSTR(<span class="stringliteral">&quot; &quot;</span>), 0x80);</div>
<div class="line"><a name="l00295"></a><span class="lineno"> 295</span>&#160; <a class="code" href="message_8h.html#a27117e124c5d66d5512fe8d494fe6338">Notify</a>(PSTR(<span class="stringliteral">&quot; &quot;</span>), 0x80);</div>
<div class="line"><a name="l00296"></a><span class="lineno"> 296</span>&#160; D_PrintHex&lt;uint8_t &gt; (l2capinbuf[14], 0x80);</div>
<div class="line"><a name="l00297"></a><span class="lineno"> 297</span>&#160; <a class="code" href="message_8h.html#a747819b0aa34f5c3ba0332c2db28c846">Notify</a>(PSTR(<span class="stringliteral">&quot; Identifier: &quot;</span>), 0x80);</div>
<div class="line"><a name="l00297"></a><span class="lineno"> 297</span>&#160; <a class="code" href="message_8h.html#a27117e124c5d66d5512fe8d494fe6338">Notify</a>(PSTR(<span class="stringliteral">&quot; Identifier: &quot;</span>), 0x80);</div>
<div class="line"><a name="l00298"></a><span class="lineno"> 298</span>&#160; D_PrintHex&lt;uint8_t &gt; (l2capinbuf[9], 0x80);</div>
<div class="line"><a name="l00299"></a><span class="lineno"> 299</span>&#160;<span class="preprocessor">#endif</span></div>
<div class="line"><a name="l00300"></a><span class="lineno"> 300</span>&#160;<span class="preprocessor"></span> <span class="keywordflow">if</span> ((l2capinbuf[12] | (l2capinbuf[13] &lt;&lt; 8)) == <a class="code" href="_b_t_d_8h.html#a1465673868452307bcdab8e201430c27">HID_CTRL_PSM</a>) {</div>
@ -422,14 +422,14 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
<div class="line"><a name="l00331"></a><span class="lineno"> 331</span>&#160; } <span class="keywordflow">else</span> <span class="keywordflow">if</span> (l2capinbuf[8] == <a class="code" href="_b_t_d_8h.html#a398676a2e9a2351a5a52afdddf4b660b">L2CAP_CMD_DISCONNECT_REQUEST</a>) {</div>
<div class="line"><a name="l00332"></a><span class="lineno"> 332</span>&#160; <span class="keywordflow">if</span> (l2capinbuf[12] == control_dcid[0] &amp;&amp; l2capinbuf[13] == control_dcid[1]) {</div>
<div class="line"><a name="l00333"></a><span class="lineno"> 333</span>&#160;<span class="preprocessor">#ifdef DEBUG_USB_HOST</span></div>
<div class="line"><a name="l00334"></a><span class="lineno"> 334</span>&#160;<span class="preprocessor"></span> <a class="code" href="message_8h.html#a747819b0aa34f5c3ba0332c2db28c846">Notify</a>(PSTR(<span class="stringliteral">&quot;\r\nDisconnect Request: Control Channel&quot;</span>), 0x80);</div>
<div class="line"><a name="l00334"></a><span class="lineno"> 334</span>&#160;<span class="preprocessor"></span> <a class="code" href="message_8h.html#a27117e124c5d66d5512fe8d494fe6338">Notify</a>(PSTR(<span class="stringliteral">&quot;\r\nDisconnect Request: Control Channel&quot;</span>), 0x80);</div>
<div class="line"><a name="l00335"></a><span class="lineno"> 335</span>&#160;<span class="preprocessor">#endif</span></div>
<div class="line"><a name="l00336"></a><span class="lineno"> 336</span>&#160;<span class="preprocessor"></span> identifier = l2capinbuf[9];</div>
<div class="line"><a name="l00337"></a><span class="lineno"> 337</span>&#160; pBtd-&gt;<a class="code" href="class_b_t_d.html#a29d176d9194e5c92fbe54791fc245407">l2cap_disconnection_response</a>(hci_handle, identifier, control_dcid, control_scid);</div>
<div class="line"><a name="l00338"></a><span class="lineno"> 338</span>&#160; <a class="code" href="class_p_s3_b_t.html#a576d72cdf12af58ae59c8f2a02f99c0f">Reset</a>();</div>
<div class="line"><a name="l00339"></a><span class="lineno"> 339</span>&#160; } <span class="keywordflow">else</span> <span class="keywordflow">if</span> (l2capinbuf[12] == interrupt_dcid[0] &amp;&amp; l2capinbuf[13] == interrupt_dcid[1]) {</div>
<div class="line"><a name="l00340"></a><span class="lineno"> 340</span>&#160;<span class="preprocessor">#ifdef DEBUG_USB_HOST</span></div>
<div class="line"><a name="l00341"></a><span class="lineno"> 341</span>&#160;<span class="preprocessor"></span> <a class="code" href="message_8h.html#a747819b0aa34f5c3ba0332c2db28c846">Notify</a>(PSTR(<span class="stringliteral">&quot;\r\nDisconnect Request: Interrupt Channel&quot;</span>), 0x80);</div>
<div class="line"><a name="l00341"></a><span class="lineno"> 341</span>&#160;<span class="preprocessor"></span> <a class="code" href="message_8h.html#a27117e124c5d66d5512fe8d494fe6338">Notify</a>(PSTR(<span class="stringliteral">&quot;\r\nDisconnect Request: Interrupt Channel&quot;</span>), 0x80);</div>
<div class="line"><a name="l00342"></a><span class="lineno"> 342</span>&#160;<span class="preprocessor">#endif</span></div>
<div class="line"><a name="l00343"></a><span class="lineno"> 343</span>&#160;<span class="preprocessor"></span> identifier = l2capinbuf[9];</div>
<div class="line"><a name="l00344"></a><span class="lineno"> 344</span>&#160; pBtd-&gt;<a class="code" href="class_b_t_d.html#a29d176d9194e5c92fbe54791fc245407">l2cap_disconnection_response</a>(hci_handle, identifier, interrupt_dcid, interrupt_scid);</div>
@ -448,7 +448,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
<div class="line"><a name="l00357"></a><span class="lineno"> 357</span>&#160; }</div>
<div class="line"><a name="l00358"></a><span class="lineno"> 358</span>&#160;<span class="preprocessor">#ifdef EXTRADEBUG</span></div>
<div class="line"><a name="l00359"></a><span class="lineno"> 359</span>&#160;<span class="preprocessor"></span> <span class="keywordflow">else</span> {</div>
<div class="line"><a name="l00360"></a><span class="lineno"> 360</span>&#160; <a class="code" href="message_8h.html#a747819b0aa34f5c3ba0332c2db28c846">Notify</a>(PSTR(<span class="stringliteral">&quot;\r\nL2CAP Unknown Signaling Command: &quot;</span>), 0x80);</div>
<div class="line"><a name="l00360"></a><span class="lineno"> 360</span>&#160; <a class="code" href="message_8h.html#a27117e124c5d66d5512fe8d494fe6338">Notify</a>(PSTR(<span class="stringliteral">&quot;\r\nL2CAP Unknown Signaling Command: &quot;</span>), 0x80);</div>
<div class="line"><a name="l00361"></a><span class="lineno"> 361</span>&#160; D_PrintHex&lt;uint8_t &gt; (l2capinbuf[8], 0x80);</div>
<div class="line"><a name="l00362"></a><span class="lineno"> 362</span>&#160; }</div>
<div class="line"><a name="l00363"></a><span class="lineno"> 363</span>&#160;<span class="preprocessor">#endif</span></div>
@ -473,9 +473,9 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
<div class="line"><a name="l00382"></a><span class="lineno"> 382</span>&#160;<span class="preprocessor">#ifdef PRINTREPORT // Uncomment &quot;#define PRINTREPORT&quot; to print the report send by the PS3 Controllers</span></div>
<div class="line"><a name="l00383"></a><span class="lineno"> 383</span>&#160;<span class="preprocessor"></span> <span class="keywordflow">for</span> (uint8_t i = 10; i &lt; 58; i++) {</div>
<div class="line"><a name="l00384"></a><span class="lineno"> 384</span>&#160; D_PrintHex&lt;uint8_t &gt; (l2capinbuf[i], 0x80);</div>
<div class="line"><a name="l00385"></a><span class="lineno"> 385</span>&#160; <a class="code" href="message_8h.html#a747819b0aa34f5c3ba0332c2db28c846">Notify</a>(PSTR(<span class="stringliteral">&quot; &quot;</span>), 0x80);</div>
<div class="line"><a name="l00385"></a><span class="lineno"> 385</span>&#160; <a class="code" href="message_8h.html#a27117e124c5d66d5512fe8d494fe6338">Notify</a>(PSTR(<span class="stringliteral">&quot; &quot;</span>), 0x80);</div>
<div class="line"><a name="l00386"></a><span class="lineno"> 386</span>&#160; }</div>
<div class="line"><a name="l00387"></a><span class="lineno"> 387</span>&#160; <a class="code" href="message_8h.html#a747819b0aa34f5c3ba0332c2db28c846">Notify</a>(PSTR(<span class="stringliteral">&quot;\r\n&quot;</span>), 0x80);</div>
<div class="line"><a name="l00387"></a><span class="lineno"> 387</span>&#160; <a class="code" href="message_8h.html#a27117e124c5d66d5512fe8d494fe6338">Notify</a>(PSTR(<span class="stringliteral">&quot;\r\n&quot;</span>), 0x80);</div>
<div class="line"><a name="l00388"></a><span class="lineno"> 388</span>&#160;<span class="preprocessor">#endif</span></div>
<div class="line"><a name="l00389"></a><span class="lineno"> 389</span>&#160;<span class="preprocessor"></span> }</div>
<div class="line"><a name="l00390"></a><span class="lineno"> 390</span>&#160; }</div>
@ -489,7 +489,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
<div class="line"><a name="l00398"></a><span class="lineno"> 398</span>&#160; <span class="keywordflow">case</span> <a class="code" href="_p_s3_b_t_8h.html#a15cc1db556ad9a4ec6144ca8a42f8919">L2CAP_WAIT</a>:</div>
<div class="line"><a name="l00399"></a><span class="lineno"> 399</span>&#160; <span class="keywordflow">if</span> (<a class="code" href="_p_s3_b_t_8h.html#a728c7d92dd341dcc1b8f4bf95bb4826d">l2cap_connection_request_control_flag</a>) {</div>
<div class="line"><a name="l00400"></a><span class="lineno"> 400</span>&#160;<span class="preprocessor">#ifdef DEBUG_USB_HOST</span></div>
<div class="line"><a name="l00401"></a><span class="lineno"> 401</span>&#160;<span class="preprocessor"></span> <a class="code" href="message_8h.html#a747819b0aa34f5c3ba0332c2db28c846">Notify</a>(PSTR(<span class="stringliteral">&quot;\r\nHID Control Incoming Connection Request&quot;</span>), 0x80);</div>
<div class="line"><a name="l00401"></a><span class="lineno"> 401</span>&#160;<span class="preprocessor"></span> <a class="code" href="message_8h.html#a27117e124c5d66d5512fe8d494fe6338">Notify</a>(PSTR(<span class="stringliteral">&quot;\r\nHID Control Incoming Connection Request&quot;</span>), 0x80);</div>
<div class="line"><a name="l00402"></a><span class="lineno"> 402</span>&#160;<span class="preprocessor">#endif</span></div>
<div class="line"><a name="l00403"></a><span class="lineno"> 403</span>&#160;<span class="preprocessor"></span> pBtd-&gt;<a class="code" href="class_b_t_d.html#a7d34c62b1d561679dea5cd27356b38a7">l2cap_connection_response</a>(hci_handle, identifier, control_dcid, control_scid, <a class="code" href="_b_t_d_8h.html#a9960d0d5ae92fc92c70bbb84c2a5c0cc">PENDING</a>);</div>
<div class="line"><a name="l00404"></a><span class="lineno"> 404</span>&#160; delay(1);</div>
@ -503,7 +503,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
<div class="line"><a name="l00412"></a><span class="lineno"> 412</span>&#160; <span class="keywordflow">case</span> <a class="code" href="_p_s3_b_t_8h.html#ad98e60fcc8acca70e545ba7c248af65a">L2CAP_CONTROL_REQUEST</a>:</div>
<div class="line"><a name="l00413"></a><span class="lineno"> 413</span>&#160; <span class="keywordflow">if</span> (<a class="code" href="_p_s3_b_t_8h.html#a48b27c08aa64a339eb1d358707927d3e">l2cap_config_request_control_flag</a>) {</div>
<div class="line"><a name="l00414"></a><span class="lineno"> 414</span>&#160;<span class="preprocessor">#ifdef DEBUG_USB_HOST</span></div>
<div class="line"><a name="l00415"></a><span class="lineno"> 415</span>&#160;<span class="preprocessor"></span> <a class="code" href="message_8h.html#a747819b0aa34f5c3ba0332c2db28c846">Notify</a>(PSTR(<span class="stringliteral">&quot;\r\nHID Control Configuration Request&quot;</span>), 0x80);</div>
<div class="line"><a name="l00415"></a><span class="lineno"> 415</span>&#160;<span class="preprocessor"></span> <a class="code" href="message_8h.html#a27117e124c5d66d5512fe8d494fe6338">Notify</a>(PSTR(<span class="stringliteral">&quot;\r\nHID Control Configuration Request&quot;</span>), 0x80);</div>
<div class="line"><a name="l00416"></a><span class="lineno"> 416</span>&#160;<span class="preprocessor">#endif</span></div>
<div class="line"><a name="l00417"></a><span class="lineno"> 417</span>&#160;<span class="preprocessor"></span> pBtd-&gt;<a class="code" href="class_b_t_d.html#a792ac4529b65235698ecf3d37982c05e">l2cap_config_response</a>(hci_handle, identifier, control_scid);</div>
<div class="line"><a name="l00418"></a><span class="lineno"> 418</span>&#160; l2cap_state = <a class="code" href="_p_s3_b_t_8h.html#abac08b5b24a1cd2b12517cd9aa6c616b">L2CAP_CONTROL_SUCCESS</a>;</div>
@ -513,7 +513,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
<div class="line"><a name="l00422"></a><span class="lineno"> 422</span>&#160; <span class="keywordflow">case</span> <a class="code" href="_p_s3_b_t_8h.html#abac08b5b24a1cd2b12517cd9aa6c616b">L2CAP_CONTROL_SUCCESS</a>:</div>
<div class="line"><a name="l00423"></a><span class="lineno"> 423</span>&#160; <span class="keywordflow">if</span> (<a class="code" href="_p_s3_b_t_8h.html#a39a58b19fb4ef26cf503ed57a43570a4">l2cap_config_success_control_flag</a>) {</div>
<div class="line"><a name="l00424"></a><span class="lineno"> 424</span>&#160;<span class="preprocessor">#ifdef DEBUG_USB_HOST</span></div>
<div class="line"><a name="l00425"></a><span class="lineno"> 425</span>&#160;<span class="preprocessor"></span> <a class="code" href="message_8h.html#a747819b0aa34f5c3ba0332c2db28c846">Notify</a>(PSTR(<span class="stringliteral">&quot;\r\nHID Control Successfully Configured&quot;</span>), 0x80);</div>
<div class="line"><a name="l00425"></a><span class="lineno"> 425</span>&#160;<span class="preprocessor"></span> <a class="code" href="message_8h.html#a27117e124c5d66d5512fe8d494fe6338">Notify</a>(PSTR(<span class="stringliteral">&quot;\r\nHID Control Successfully Configured&quot;</span>), 0x80);</div>
<div class="line"><a name="l00426"></a><span class="lineno"> 426</span>&#160;<span class="preprocessor">#endif</span></div>
<div class="line"><a name="l00427"></a><span class="lineno"> 427</span>&#160;<span class="preprocessor"></span> l2cap_state = <a class="code" href="_p_s3_b_t_8h.html#ac7aa7fd7a8a34a6c9e420e3cb114737b">L2CAP_INTERRUPT_SETUP</a>;</div>
<div class="line"><a name="l00428"></a><span class="lineno"> 428</span>&#160; }</div>
@ -521,7 +521,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
<div class="line"><a name="l00430"></a><span class="lineno"> 430</span>&#160; <span class="keywordflow">case</span> <a class="code" href="_p_s3_b_t_8h.html#ac7aa7fd7a8a34a6c9e420e3cb114737b">L2CAP_INTERRUPT_SETUP</a>:</div>
<div class="line"><a name="l00431"></a><span class="lineno"> 431</span>&#160; <span class="keywordflow">if</span> (<a class="code" href="_p_s3_b_t_8h.html#a9fa7bceb44bbdff3229fd431627b9868">l2cap_connection_request_interrupt_flag</a>) {</div>
<div class="line"><a name="l00432"></a><span class="lineno"> 432</span>&#160;<span class="preprocessor">#ifdef DEBUG_USB_HOST</span></div>
<div class="line"><a name="l00433"></a><span class="lineno"> 433</span>&#160;<span class="preprocessor"></span> <a class="code" href="message_8h.html#a747819b0aa34f5c3ba0332c2db28c846">Notify</a>(PSTR(<span class="stringliteral">&quot;\r\nHID Interrupt Incoming Connection Request&quot;</span>), 0x80);</div>
<div class="line"><a name="l00433"></a><span class="lineno"> 433</span>&#160;<span class="preprocessor"></span> <a class="code" href="message_8h.html#a27117e124c5d66d5512fe8d494fe6338">Notify</a>(PSTR(<span class="stringliteral">&quot;\r\nHID Interrupt Incoming Connection Request&quot;</span>), 0x80);</div>
<div class="line"><a name="l00434"></a><span class="lineno"> 434</span>&#160;<span class="preprocessor">#endif</span></div>
<div class="line"><a name="l00435"></a><span class="lineno"> 435</span>&#160;<span class="preprocessor"></span> pBtd-&gt;<a class="code" href="class_b_t_d.html#a7d34c62b1d561679dea5cd27356b38a7">l2cap_connection_response</a>(hci_handle, identifier, interrupt_dcid, interrupt_scid, <a class="code" href="_b_t_d_8h.html#a9960d0d5ae92fc92c70bbb84c2a5c0cc">PENDING</a>);</div>
<div class="line"><a name="l00436"></a><span class="lineno"> 436</span>&#160; delay(1);</div>
@ -536,7 +536,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
<div class="line"><a name="l00445"></a><span class="lineno"> 445</span>&#160; <span class="keywordflow">case</span> <a class="code" href="_p_s3_b_t_8h.html#a0c004c746b90f2c8025bb1ddd20d811a">L2CAP_INTERRUPT_REQUEST</a>:</div>
<div class="line"><a name="l00446"></a><span class="lineno"> 446</span>&#160; <span class="keywordflow">if</span> (<a class="code" href="_p_s3_b_t_8h.html#ad5c6ab585a398e53f2ee5616fe0d4346">l2cap_config_request_interrupt_flag</a>) {</div>
<div class="line"><a name="l00447"></a><span class="lineno"> 447</span>&#160;<span class="preprocessor">#ifdef DEBUG_USB_HOST</span></div>
<div class="line"><a name="l00448"></a><span class="lineno"> 448</span>&#160;<span class="preprocessor"></span> <a class="code" href="message_8h.html#a747819b0aa34f5c3ba0332c2db28c846">Notify</a>(PSTR(<span class="stringliteral">&quot;\r\nHID Interrupt Configuration Request&quot;</span>), 0x80);</div>
<div class="line"><a name="l00448"></a><span class="lineno"> 448</span>&#160;<span class="preprocessor"></span> <a class="code" href="message_8h.html#a27117e124c5d66d5512fe8d494fe6338">Notify</a>(PSTR(<span class="stringliteral">&quot;\r\nHID Interrupt Configuration Request&quot;</span>), 0x80);</div>
<div class="line"><a name="l00449"></a><span class="lineno"> 449</span>&#160;<span class="preprocessor">#endif</span></div>
<div class="line"><a name="l00450"></a><span class="lineno"> 450</span>&#160;<span class="preprocessor"></span> pBtd-&gt;<a class="code" href="class_b_t_d.html#a792ac4529b65235698ecf3d37982c05e">l2cap_config_response</a>(hci_handle, identifier, interrupt_scid);</div>
<div class="line"><a name="l00451"></a><span class="lineno"> 451</span>&#160; l2cap_state = <a class="code" href="_p_s3_b_t_8h.html#ac2fdeba844d7f2021e0aed9616aad5e4">L2CAP_INTERRUPT_SUCCESS</a>;</div>
@ -545,211 +545,218 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
<div class="line"><a name="l00454"></a><span class="lineno"> 454</span>&#160; <span class="keywordflow">case</span> <a class="code" href="_p_s3_b_t_8h.html#ac2fdeba844d7f2021e0aed9616aad5e4">L2CAP_INTERRUPT_SUCCESS</a>:</div>
<div class="line"><a name="l00455"></a><span class="lineno"> 455</span>&#160; <span class="keywordflow">if</span> (<a class="code" href="_p_s3_b_t_8h.html#a9b3e87e1f460bc011e69f5e53e79c104">l2cap_config_success_interrupt_flag</a>) {</div>
<div class="line"><a name="l00456"></a><span class="lineno"> 456</span>&#160;<span class="preprocessor">#ifdef DEBUG_USB_HOST</span></div>
<div class="line"><a name="l00457"></a><span class="lineno"> 457</span>&#160;<span class="preprocessor"></span> <a class="code" href="message_8h.html#a747819b0aa34f5c3ba0332c2db28c846">Notify</a>(PSTR(<span class="stringliteral">&quot;\r\nHID Interrupt Successfully Configured&quot;</span>), 0x80);</div>
<div class="line"><a name="l00457"></a><span class="lineno"> 457</span>&#160;<span class="preprocessor"></span> <a class="code" href="message_8h.html#a27117e124c5d66d5512fe8d494fe6338">Notify</a>(PSTR(<span class="stringliteral">&quot;\r\nHID Interrupt Successfully Configured&quot;</span>), 0x80);</div>
<div class="line"><a name="l00458"></a><span class="lineno"> 458</span>&#160;<span class="preprocessor">#endif</span></div>
<div class="line"><a name="l00459"></a><span class="lineno"> 459</span>&#160;<span class="preprocessor"></span> <span class="keywordflow">if</span> (remote_name[0] == <span class="charliteral">&#39;M&#39;</span>) { <span class="comment">// First letter in Motion Controller (&#39;M&#39;)</span></div>
<div class="line"><a name="l00460"></a><span class="lineno"> 460</span>&#160; <span class="keywordflow">for</span> (uint8_t i = 0; i &lt; <a class="code" href="_b_t_d_8h.html#a32d591ef5742a99963130616ef146787">BULK_MAXPKTSIZE</a>; i++) <span class="comment">// Reset l2cap in buffer as it sometimes read it as a button has been pressed</span></div>
<div class="line"><a name="l00461"></a><span class="lineno"> 461</span>&#160; l2capinbuf[i] = 0;</div>
<div class="line"><a name="l00462"></a><span class="lineno"> 462</span>&#160; ButtonState = 0;</div>
<div class="line"><a name="l00463"></a><span class="lineno"> 463</span>&#160; OldButtonState = 0;</div>
<div class="line"><a name="l00464"></a><span class="lineno"> 464</span>&#160;</div>
<div class="line"><a name="l00465"></a><span class="lineno"> 465</span>&#160; l2cap_state = <a class="code" href="_p_s3_b_t_8h.html#a7e385f71ba4406d372f8210b48f5e133">L2CAP_HID_PS3_LED</a>;</div>
<div class="line"><a name="l00466"></a><span class="lineno"> 466</span>&#160; } <span class="keywordflow">else</span></div>
<div class="line"><a name="l00467"></a><span class="lineno"> 467</span>&#160; l2cap_state = <a class="code" href="_p_s3_b_t_8h.html#a8463be04d86ddc1d58f6388d5be501ad">L2CAP_HID_ENABLE_SIXAXIS</a>;</div>
<div class="line"><a name="l00468"></a><span class="lineno"> 468</span>&#160; timer = millis();</div>
<div class="line"><a name="l00469"></a><span class="lineno"> 469</span>&#160; }</div>
<div class="line"><a name="l00470"></a><span class="lineno"> 470</span>&#160; <span class="keywordflow">break</span>;</div>
<div class="line"><a name="l00471"></a><span class="lineno"> 471</span>&#160;</div>
<div class="line"><a name="l00472"></a><span class="lineno"> 472</span>&#160; <span class="comment">/* These states are handled in Run() */</span></div>
<div class="line"><a name="l00473"></a><span class="lineno"> 473</span>&#160;</div>
<div class="line"><a name="l00474"></a><span class="lineno"> 474</span>&#160; <span class="keywordflow">case</span> <a class="code" href="_p_s3_b_t_8h.html#ab569b2085ad29f41d1da9c0ed352bd65">L2CAP_INTERRUPT_DISCONNECT</a>:</div>
<div class="line"><a name="l00475"></a><span class="lineno"> 475</span>&#160; <span class="keywordflow">if</span> (<a class="code" href="_p_s3_b_t_8h.html#a667178a4486c4dee88e052b3562362cd">l2cap_disconnect_response_interrupt_flag</a>) {</div>
<div class="line"><a name="l00476"></a><span class="lineno"> 476</span>&#160;<span class="preprocessor">#ifdef DEBUG_USB_HOST</span></div>
<div class="line"><a name="l00477"></a><span class="lineno"> 477</span>&#160;<span class="preprocessor"></span> <a class="code" href="message_8h.html#a747819b0aa34f5c3ba0332c2db28c846">Notify</a>(PSTR(<span class="stringliteral">&quot;\r\nDisconnected Interrupt Channel&quot;</span>), 0x80);</div>
<div class="line"><a name="l00478"></a><span class="lineno"> 478</span>&#160;<span class="preprocessor">#endif</span></div>
<div class="line"><a name="l00479"></a><span class="lineno"> 479</span>&#160;<span class="preprocessor"></span> identifier++;</div>
<div class="line"><a name="l00480"></a><span class="lineno"> 480</span>&#160; pBtd-&gt;<a class="code" href="class_b_t_d.html#ac7053ef7ac690be3afbbdd985b163f10">l2cap_disconnection_request</a>(hci_handle, identifier, control_scid, control_dcid);</div>
<div class="line"><a name="l00481"></a><span class="lineno"> 481</span>&#160; l2cap_state = <a class="code" href="_p_s3_b_t_8h.html#a9b5140e7ca5941e5535c575255ffc1cc">L2CAP_CONTROL_DISCONNECT</a>;</div>
<div class="line"><a name="l00482"></a><span class="lineno"> 482</span>&#160; }</div>
<div class="line"><a name="l00483"></a><span class="lineno"> 483</span>&#160; <span class="keywordflow">break</span>;</div>
<div class="line"><a name="l00484"></a><span class="lineno"> 484</span>&#160;</div>
<div class="line"><a name="l00485"></a><span class="lineno"> 485</span>&#160; <span class="keywordflow">case</span> <a class="code" href="_p_s3_b_t_8h.html#a9b5140e7ca5941e5535c575255ffc1cc">L2CAP_CONTROL_DISCONNECT</a>:</div>
<div class="line"><a name="l00486"></a><span class="lineno"> 486</span>&#160; <span class="keywordflow">if</span> (<a class="code" href="_p_s3_b_t_8h.html#a7f0cab74308e812106252c53b18c0391">l2cap_disconnect_response_control_flag</a>) {</div>
<div class="line"><a name="l00487"></a><span class="lineno"> 487</span>&#160;<span class="preprocessor">#ifdef DEBUG_USB_HOST</span></div>
<div class="line"><a name="l00488"></a><span class="lineno"> 488</span>&#160;<span class="preprocessor"></span> <a class="code" href="message_8h.html#a747819b0aa34f5c3ba0332c2db28c846">Notify</a>(PSTR(<span class="stringliteral">&quot;\r\nDisconnected Control Channel&quot;</span>), 0x80);</div>
<div class="line"><a name="l00489"></a><span class="lineno"> 489</span>&#160;<span class="preprocessor">#endif</span></div>
<div class="line"><a name="l00490"></a><span class="lineno"> 490</span>&#160;<span class="preprocessor"></span> pBtd-&gt;<a class="code" href="class_b_t_d.html#a1bea5dd793a2f47006b4a7642efc9e56">hci_disconnect</a>(hci_handle);</div>
<div class="line"><a name="l00491"></a><span class="lineno"> 491</span>&#160; hci_handle = -1; <span class="comment">// Reset handle</span></div>
<div class="line"><a name="l00492"></a><span class="lineno"> 492</span>&#160; l2cap_event_flag = 0; <span class="comment">// Reset flags</span></div>
<div class="line"><a name="l00493"></a><span class="lineno"> 493</span>&#160; l2cap_state = <a class="code" href="_p_s3_b_t_8h.html#a15cc1db556ad9a4ec6144ca8a42f8919">L2CAP_WAIT</a>;</div>
<div class="line"><a name="l00494"></a><span class="lineno"> 494</span>&#160; }</div>
<div class="line"><a name="l00495"></a><span class="lineno"> 495</span>&#160; <span class="keywordflow">break</span>;</div>
<div class="line"><a name="l00496"></a><span class="lineno"> 496</span>&#160; }</div>
<div class="line"><a name="l00497"></a><span class="lineno"> 497</span>&#160;}</div>
<div class="line"><a name="l00498"></a><span class="lineno"> 498</span>&#160;</div>
<div class="line"><a name="l00499"></a><span class="lineno"><a class="code" href="class_p_s3_b_t.html#ab41f25f45573239990f68611dc825086"> 499</a></span>&#160;<span class="keywordtype">void</span> <a class="code" href="class_p_s3_b_t.html#ab41f25f45573239990f68611dc825086">PS3BT::Run</a>() {</div>
<div class="line"><a name="l00500"></a><span class="lineno"> 500</span>&#160; <span class="keywordflow">switch</span> (l2cap_state) {</div>
<div class="line"><a name="l00501"></a><span class="lineno"> 501</span>&#160; <span class="keywordflow">case</span> <a class="code" href="_p_s3_b_t_8h.html#a8463be04d86ddc1d58f6388d5be501ad">L2CAP_HID_ENABLE_SIXAXIS</a>:</div>
<div class="line"><a name="l00502"></a><span class="lineno"> 502</span>&#160; <span class="keywordflow">if</span> (millis() - timer &gt; 1000) { <span class="comment">// loop 1 second before sending the command</span></div>
<div class="line"><a name="l00503"></a><span class="lineno"> 503</span>&#160; <span class="keywordflow">for</span> (uint8_t i = 0; i &lt; <a class="code" href="_b_t_d_8h.html#a32d591ef5742a99963130616ef146787">BULK_MAXPKTSIZE</a>; i++) <span class="comment">// Reset l2cap in buffer as it sometimes read it as a button has been pressed</span></div>
<div class="line"><a name="l00504"></a><span class="lineno"> 504</span>&#160; l2capinbuf[i] = 0;</div>
<div class="line"><a name="l00505"></a><span class="lineno"> 505</span>&#160; ButtonState = 0;</div>
<div class="line"><a name="l00506"></a><span class="lineno"> 506</span>&#160; OldButtonState = 0;</div>
<div class="line"><a name="l00507"></a><span class="lineno"> 507</span>&#160;</div>
<div class="line"><a name="l00508"></a><span class="lineno"> 508</span>&#160; enable_sixaxis();</div>
<div class="line"><a name="l00509"></a><span class="lineno"> 509</span>&#160; <span class="keywordflow">for</span> (uint8_t i = 15; i &lt; 19; i++)</div>
<div class="line"><a name="l00510"></a><span class="lineno"> 510</span>&#160; l2capinbuf[i] = 0x7F; <span class="comment">// Set the analog joystick values to center position</span></div>
<div class="line"><a name="l00511"></a><span class="lineno"> 511</span>&#160; l2cap_state = <a class="code" href="_p_s3_b_t_8h.html#a7e385f71ba4406d372f8210b48f5e133">L2CAP_HID_PS3_LED</a>;</div>
<div class="line"><a name="l00512"></a><span class="lineno"> 512</span>&#160; timer = millis();</div>
<div class="line"><a name="l00513"></a><span class="lineno"> 513</span>&#160; }</div>
<div class="line"><a name="l00514"></a><span class="lineno"> 514</span>&#160; <span class="keywordflow">break</span>;</div>
<div class="line"><a name="l00515"></a><span class="lineno"> 515</span>&#160;</div>
<div class="line"><a name="l00516"></a><span class="lineno"> 516</span>&#160; <span class="keywordflow">case</span> <a class="code" href="_p_s3_b_t_8h.html#a7e385f71ba4406d372f8210b48f5e133">L2CAP_HID_PS3_LED</a>:</div>
<div class="line"><a name="l00517"></a><span class="lineno"> 517</span>&#160; <span class="keywordflow">if</span> (millis() - timer &gt; 1000) { <span class="comment">// loop 1 second before sending the command</span></div>
<div class="line"><a name="l00518"></a><span class="lineno"> 518</span>&#160; <span class="keywordflow">if</span> (remote_name[0] == <span class="charliteral">&#39;P&#39;</span>) { <span class="comment">// First letter in PLAYSTATION(R)3 Controller (&#39;P&#39;)</span></div>
<div class="line"><a name="l00519"></a><span class="lineno"> 519</span>&#160; <a class="code" href="class_p_s3_b_t.html#ad400e1ce37c2dadd48938187b5021d42">setLedOn</a>(<a class="code" href="controller_enums_8h.html#aadcb6002d2b42fdfe01490f730ab00a6adac6477842247cab1a8c02c65f431b44">LED1</a>);</div>
<div class="line"><a name="l00520"></a><span class="lineno"> 520</span>&#160;<span class="preprocessor">#ifdef DEBUG_USB_HOST</span></div>
<div class="line"><a name="l00521"></a><span class="lineno"> 521</span>&#160;<span class="preprocessor"></span> <a class="code" href="message_8h.html#a747819b0aa34f5c3ba0332c2db28c846">Notify</a>(PSTR(<span class="stringliteral">&quot;\r\nDualshock 3 Controller Enabled\r\n&quot;</span>), 0x80);</div>
<div class="line"><a name="l00522"></a><span class="lineno"> 522</span>&#160;<span class="preprocessor">#endif</span></div>
<div class="line"><a name="l00523"></a><span class="lineno"> 523</span>&#160;<span class="preprocessor"></span> <a class="code" href="class_p_s3_b_t.html#a2804535e3164eafca80a6f6c6bd9a4f9">PS3Connected</a> = <span class="keyword">true</span>;</div>
<div class="line"><a name="l00524"></a><span class="lineno"> 524</span>&#160; } <span class="keywordflow">else</span> <span class="keywordflow">if</span> (remote_name[0] == <span class="charliteral">&#39;N&#39;</span>) { <span class="comment">// First letter in Navigation Controller (&#39;N&#39;)</span></div>
<div class="line"><a name="l00525"></a><span class="lineno"> 525</span>&#160; <a class="code" href="class_p_s3_b_t.html#ad400e1ce37c2dadd48938187b5021d42">setLedOn</a>(<a class="code" href="controller_enums_8h.html#aadcb6002d2b42fdfe01490f730ab00a6adac6477842247cab1a8c02c65f431b44">LED1</a>); <span class="comment">// This just turns LED constantly on, on the Navigation controller</span></div>
<div class="line"><a name="l00526"></a><span class="lineno"> 526</span>&#160;<span class="preprocessor">#ifdef DEBUG_USB_HOST</span></div>
<div class="line"><a name="l00527"></a><span class="lineno"> 527</span>&#160;<span class="preprocessor"></span> <a class="code" href="message_8h.html#a747819b0aa34f5c3ba0332c2db28c846">Notify</a>(PSTR(<span class="stringliteral">&quot;\r\nNavigation Controller Enabled\r\n&quot;</span>), 0x80);</div>
<div class="line"><a name="l00528"></a><span class="lineno"> 528</span>&#160;<span class="preprocessor">#endif</span></div>
<div class="line"><a name="l00529"></a><span class="lineno"> 529</span>&#160;<span class="preprocessor"></span> <a class="code" href="class_p_s3_b_t.html#ab35277632083d43f8750d130bea6d430">PS3NavigationConnected</a> = <span class="keyword">true</span>;</div>
<div class="line"><a name="l00530"></a><span class="lineno"> 530</span>&#160; } <span class="keywordflow">else</span> <span class="keywordflow">if</span> (remote_name[0] == <span class="charliteral">&#39;M&#39;</span>) { <span class="comment">// First letter in Motion Controller (&#39;M&#39;)</span></div>
<div class="line"><a name="l00531"></a><span class="lineno"> 531</span>&#160; <a class="code" href="class_p_s3_b_t.html#ad0926b75edcbb12ddf76f78e66728782">moveSetBulb</a>(<a class="code" href="_p_s3_enums_8h.html#a55ecd4f2ec2ebfe8d5b0163e4ac2a967ad3163c1fcda01965b692ec2c3122b743">Red</a>);</div>
<div class="line"><a name="l00532"></a><span class="lineno"> 532</span>&#160; timerBulbRumble = millis();</div>
<div class="line"><a name="l00533"></a><span class="lineno"> 533</span>&#160;<span class="preprocessor">#ifdef DEBUG_USB_HOST</span></div>
<div class="line"><a name="l00534"></a><span class="lineno"> 534</span>&#160;<span class="preprocessor"></span> <a class="code" href="message_8h.html#a747819b0aa34f5c3ba0332c2db28c846">Notify</a>(PSTR(<span class="stringliteral">&quot;\r\nMotion Controller Enabled\r\n&quot;</span>), 0x80);</div>
<div class="line"><a name="l00535"></a><span class="lineno"> 535</span>&#160;<span class="preprocessor">#endif</span></div>
<div class="line"><a name="l00536"></a><span class="lineno"> 536</span>&#160;<span class="preprocessor"></span> <a class="code" href="class_p_s3_b_t.html#a9273b6796948b83772117b3805421b4a">PS3MoveConnected</a> = <span class="keyword">true</span>;</div>
<div class="line"><a name="l00537"></a><span class="lineno"> 537</span>&#160; }</div>
<div class="line"><a name="l00538"></a><span class="lineno"> 538</span>&#160; l2cap_state = <a class="code" href="_p_s3_b_t_8h.html#ae4da52ca67e1f8b977199b24e8f3a400">L2CAP_DONE</a>;</div>
<div class="line"><a name="l00539"></a><span class="lineno"> 539</span>&#160; }</div>
<div class="line"><a name="l00540"></a><span class="lineno"> 540</span>&#160; <span class="keywordflow">break</span>;</div>
<div class="line"><a name="l00541"></a><span class="lineno"> 541</span>&#160;</div>
<div class="line"><a name="l00542"></a><span class="lineno"> 542</span>&#160; <span class="keywordflow">case</span> <a class="code" href="_p_s3_b_t_8h.html#ae4da52ca67e1f8b977199b24e8f3a400">L2CAP_DONE</a>:</div>
<div class="line"><a name="l00543"></a><span class="lineno"> 543</span>&#160; <span class="keywordflow">if</span> (<a class="code" href="class_p_s3_b_t.html#a9273b6796948b83772117b3805421b4a">PS3MoveConnected</a>) { <span class="comment">//The Bulb and rumble values, has to be send at aproximatly every 5th second for it to stay on</span></div>
<div class="line"><a name="l00544"></a><span class="lineno"> 544</span>&#160; <span class="keywordflow">if</span> (millis() - timerBulbRumble &gt; 4000) { <span class="comment">//Send at least every 4th second</span></div>
<div class="line"><a name="l00545"></a><span class="lineno"> 545</span>&#160; HIDMove_Command(HIDMoveBuffer, <a class="code" href="_p_s3_b_t_8h.html#a465c4c33eae0fd5f934ae12bc8d6ca7e">HID_BUFFERSIZE</a>); <span class="comment">//The Bulb and rumble values, has to be written again and again, for it to stay turned on</span></div>
<div class="line"><a name="l00546"></a><span class="lineno"> 546</span>&#160; timerBulbRumble = millis();</div>
<div class="line"><a name="l00547"></a><span class="lineno"> 547</span>&#160; }</div>
<div class="line"><a name="l00548"></a><span class="lineno"> 548</span>&#160; }</div>
<div class="line"><a name="l00549"></a><span class="lineno"> 549</span>&#160; <span class="keywordflow">break</span>;</div>
<div class="line"><a name="l00550"></a><span class="lineno"> 550</span>&#160; }</div>
<div class="line"><a name="l00551"></a><span class="lineno"> 551</span>&#160;}</div>
<div class="line"><a name="l00462"></a><span class="lineno"> 462</span>&#160; l2cap_state = <a class="code" href="_p_s3_b_t_8h.html#a7e385f71ba4406d372f8210b48f5e133">L2CAP_HID_PS3_LED</a>;</div>
<div class="line"><a name="l00463"></a><span class="lineno"> 463</span>&#160; } <span class="keywordflow">else</span></div>
<div class="line"><a name="l00464"></a><span class="lineno"> 464</span>&#160; l2cap_state = <a class="code" href="_p_s3_b_t_8h.html#a8463be04d86ddc1d58f6388d5be501ad">L2CAP_HID_ENABLE_SIXAXIS</a>;</div>
<div class="line"><a name="l00465"></a><span class="lineno"> 465</span>&#160; timer = millis();</div>
<div class="line"><a name="l00466"></a><span class="lineno"> 466</span>&#160; }</div>
<div class="line"><a name="l00467"></a><span class="lineno"> 467</span>&#160; <span class="keywordflow">break</span>;</div>
<div class="line"><a name="l00468"></a><span class="lineno"> 468</span>&#160;</div>
<div class="line"><a name="l00469"></a><span class="lineno"> 469</span>&#160; <span class="comment">/* These states are handled in Run() */</span></div>
<div class="line"><a name="l00470"></a><span class="lineno"> 470</span>&#160;</div>
<div class="line"><a name="l00471"></a><span class="lineno"> 471</span>&#160; <span class="keywordflow">case</span> <a class="code" href="_p_s3_b_t_8h.html#ab569b2085ad29f41d1da9c0ed352bd65">L2CAP_INTERRUPT_DISCONNECT</a>:</div>
<div class="line"><a name="l00472"></a><span class="lineno"> 472</span>&#160; <span class="keywordflow">if</span> (<a class="code" href="_p_s3_b_t_8h.html#a667178a4486c4dee88e052b3562362cd">l2cap_disconnect_response_interrupt_flag</a>) {</div>
<div class="line"><a name="l00473"></a><span class="lineno"> 473</span>&#160;<span class="preprocessor">#ifdef DEBUG_USB_HOST</span></div>
<div class="line"><a name="l00474"></a><span class="lineno"> 474</span>&#160;<span class="preprocessor"></span> <a class="code" href="message_8h.html#a27117e124c5d66d5512fe8d494fe6338">Notify</a>(PSTR(<span class="stringliteral">&quot;\r\nDisconnected Interrupt Channel&quot;</span>), 0x80);</div>
<div class="line"><a name="l00475"></a><span class="lineno"> 475</span>&#160;<span class="preprocessor">#endif</span></div>
<div class="line"><a name="l00476"></a><span class="lineno"> 476</span>&#160;<span class="preprocessor"></span> identifier++;</div>
<div class="line"><a name="l00477"></a><span class="lineno"> 477</span>&#160; pBtd-&gt;<a class="code" href="class_b_t_d.html#ac7053ef7ac690be3afbbdd985b163f10">l2cap_disconnection_request</a>(hci_handle, identifier, control_scid, control_dcid);</div>
<div class="line"><a name="l00478"></a><span class="lineno"> 478</span>&#160; l2cap_state = <a class="code" href="_p_s3_b_t_8h.html#a9b5140e7ca5941e5535c575255ffc1cc">L2CAP_CONTROL_DISCONNECT</a>;</div>
<div class="line"><a name="l00479"></a><span class="lineno"> 479</span>&#160; }</div>
<div class="line"><a name="l00480"></a><span class="lineno"> 480</span>&#160; <span class="keywordflow">break</span>;</div>
<div class="line"><a name="l00481"></a><span class="lineno"> 481</span>&#160;</div>
<div class="line"><a name="l00482"></a><span class="lineno"> 482</span>&#160; <span class="keywordflow">case</span> <a class="code" href="_p_s3_b_t_8h.html#a9b5140e7ca5941e5535c575255ffc1cc">L2CAP_CONTROL_DISCONNECT</a>:</div>
<div class="line"><a name="l00483"></a><span class="lineno"> 483</span>&#160; <span class="keywordflow">if</span> (<a class="code" href="_p_s3_b_t_8h.html#a7f0cab74308e812106252c53b18c0391">l2cap_disconnect_response_control_flag</a>) {</div>
<div class="line"><a name="l00484"></a><span class="lineno"> 484</span>&#160;<span class="preprocessor">#ifdef DEBUG_USB_HOST</span></div>
<div class="line"><a name="l00485"></a><span class="lineno"> 485</span>&#160;<span class="preprocessor"></span> <a class="code" href="message_8h.html#a27117e124c5d66d5512fe8d494fe6338">Notify</a>(PSTR(<span class="stringliteral">&quot;\r\nDisconnected Control Channel&quot;</span>), 0x80);</div>
<div class="line"><a name="l00486"></a><span class="lineno"> 486</span>&#160;<span class="preprocessor">#endif</span></div>
<div class="line"><a name="l00487"></a><span class="lineno"> 487</span>&#160;<span class="preprocessor"></span> pBtd-&gt;<a class="code" href="class_b_t_d.html#a1bea5dd793a2f47006b4a7642efc9e56">hci_disconnect</a>(hci_handle);</div>
<div class="line"><a name="l00488"></a><span class="lineno"> 488</span>&#160; hci_handle = -1; <span class="comment">// Reset handle</span></div>
<div class="line"><a name="l00489"></a><span class="lineno"> 489</span>&#160; l2cap_event_flag = 0; <span class="comment">// Reset flags</span></div>
<div class="line"><a name="l00490"></a><span class="lineno"> 490</span>&#160; l2cap_state = <a class="code" href="_p_s3_b_t_8h.html#a15cc1db556ad9a4ec6144ca8a42f8919">L2CAP_WAIT</a>;</div>
<div class="line"><a name="l00491"></a><span class="lineno"> 491</span>&#160; }</div>
<div class="line"><a name="l00492"></a><span class="lineno"> 492</span>&#160; <span class="keywordflow">break</span>;</div>
<div class="line"><a name="l00493"></a><span class="lineno"> 493</span>&#160; }</div>
<div class="line"><a name="l00494"></a><span class="lineno"> 494</span>&#160;}</div>
<div class="line"><a name="l00495"></a><span class="lineno"> 495</span>&#160;</div>
<div class="line"><a name="l00496"></a><span class="lineno"><a class="code" href="class_p_s3_b_t.html#ab41f25f45573239990f68611dc825086"> 496</a></span>&#160;<span class="keywordtype">void</span> <a class="code" href="class_p_s3_b_t.html#ab41f25f45573239990f68611dc825086">PS3BT::Run</a>() {</div>
<div class="line"><a name="l00497"></a><span class="lineno"> 497</span>&#160; <span class="keywordflow">switch</span> (l2cap_state) {</div>
<div class="line"><a name="l00498"></a><span class="lineno"> 498</span>&#160; <span class="keywordflow">case</span> <a class="code" href="_p_s3_b_t_8h.html#a8463be04d86ddc1d58f6388d5be501ad">L2CAP_HID_ENABLE_SIXAXIS</a>:</div>
<div class="line"><a name="l00499"></a><span class="lineno"> 499</span>&#160; <span class="keywordflow">if</span> (millis() - timer &gt; 1000) { <span class="comment">// loop 1 second before sending the command</span></div>
<div class="line"><a name="l00500"></a><span class="lineno"> 500</span>&#160; <span class="keywordflow">for</span> (uint8_t i = 0; i &lt; <a class="code" href="_b_t_d_8h.html#a32d591ef5742a99963130616ef146787">BULK_MAXPKTSIZE</a>; i++) <span class="comment">// Reset l2cap in buffer as it sometimes read it as a button has been pressed</span></div>
<div class="line"><a name="l00501"></a><span class="lineno"> 501</span>&#160; l2capinbuf[i] = 0;</div>
<div class="line"><a name="l00502"></a><span class="lineno"> 502</span>&#160; <span class="keywordflow">for</span> (uint8_t i = 15; i &lt; 19; i++)</div>
<div class="line"><a name="l00503"></a><span class="lineno"> 503</span>&#160; l2capinbuf[i] = 0x7F; <span class="comment">// Set the analog joystick values to center position</span></div>
<div class="line"><a name="l00504"></a><span class="lineno"> 504</span>&#160; enable_sixaxis();</div>
<div class="line"><a name="l00505"></a><span class="lineno"> 505</span>&#160; l2cap_state = <a class="code" href="_p_s3_b_t_8h.html#a7e385f71ba4406d372f8210b48f5e133">L2CAP_HID_PS3_LED</a>;</div>
<div class="line"><a name="l00506"></a><span class="lineno"> 506</span>&#160; timer = millis();</div>
<div class="line"><a name="l00507"></a><span class="lineno"> 507</span>&#160; }</div>
<div class="line"><a name="l00508"></a><span class="lineno"> 508</span>&#160; <span class="keywordflow">break</span>;</div>
<div class="line"><a name="l00509"></a><span class="lineno"> 509</span>&#160;</div>
<div class="line"><a name="l00510"></a><span class="lineno"> 510</span>&#160; <span class="keywordflow">case</span> <a class="code" href="_p_s3_b_t_8h.html#a7e385f71ba4406d372f8210b48f5e133">L2CAP_HID_PS3_LED</a>:</div>
<div class="line"><a name="l00511"></a><span class="lineno"> 511</span>&#160; <span class="keywordflow">if</span> (millis() - timer &gt; 1000) { <span class="comment">// loop 1 second before sending the command</span></div>
<div class="line"><a name="l00512"></a><span class="lineno"> 512</span>&#160; <span class="keywordflow">if</span> (remote_name[0] == <span class="charliteral">&#39;P&#39;</span>) { <span class="comment">// First letter in PLAYSTATION(R)3 Controller (&#39;P&#39;)</span></div>
<div class="line"><a name="l00513"></a><span class="lineno"> 513</span>&#160;<span class="preprocessor">#ifdef DEBUG_USB_HOST</span></div>
<div class="line"><a name="l00514"></a><span class="lineno"> 514</span>&#160;<span class="preprocessor"></span> <a class="code" href="message_8h.html#a27117e124c5d66d5512fe8d494fe6338">Notify</a>(PSTR(<span class="stringliteral">&quot;\r\nDualshock 3 Controller Enabled\r\n&quot;</span>), 0x80);</div>
<div class="line"><a name="l00515"></a><span class="lineno"> 515</span>&#160;<span class="preprocessor">#endif</span></div>
<div class="line"><a name="l00516"></a><span class="lineno"> 516</span>&#160;<span class="preprocessor"></span> <a class="code" href="class_p_s3_b_t.html#a2804535e3164eafca80a6f6c6bd9a4f9">PS3Connected</a> = <span class="keyword">true</span>;</div>
<div class="line"><a name="l00517"></a><span class="lineno"> 517</span>&#160; } <span class="keywordflow">else</span> <span class="keywordflow">if</span> (remote_name[0] == <span class="charliteral">&#39;N&#39;</span>) { <span class="comment">// First letter in Navigation Controller (&#39;N&#39;)</span></div>
<div class="line"><a name="l00518"></a><span class="lineno"> 518</span>&#160;<span class="preprocessor">#ifdef DEBUG_USB_HOST</span></div>
<div class="line"><a name="l00519"></a><span class="lineno"> 519</span>&#160;<span class="preprocessor"></span> <a class="code" href="message_8h.html#a27117e124c5d66d5512fe8d494fe6338">Notify</a>(PSTR(<span class="stringliteral">&quot;\r\nNavigation Controller Enabled\r\n&quot;</span>), 0x80);</div>
<div class="line"><a name="l00520"></a><span class="lineno"> 520</span>&#160;<span class="preprocessor">#endif</span></div>
<div class="line"><a name="l00521"></a><span class="lineno"> 521</span>&#160;<span class="preprocessor"></span> <a class="code" href="class_p_s3_b_t.html#ab35277632083d43f8750d130bea6d430">PS3NavigationConnected</a> = <span class="keyword">true</span>;</div>
<div class="line"><a name="l00522"></a><span class="lineno"> 522</span>&#160; } <span class="keywordflow">else</span> <span class="keywordflow">if</span> (remote_name[0] == <span class="charliteral">&#39;M&#39;</span>) { <span class="comment">// First letter in Motion Controller (&#39;M&#39;)</span></div>
<div class="line"><a name="l00523"></a><span class="lineno"> 523</span>&#160; timerBulbRumble = millis();</div>
<div class="line"><a name="l00524"></a><span class="lineno"> 524</span>&#160;<span class="preprocessor">#ifdef DEBUG_USB_HOST</span></div>
<div class="line"><a name="l00525"></a><span class="lineno"> 525</span>&#160;<span class="preprocessor"></span> <a class="code" href="message_8h.html#a27117e124c5d66d5512fe8d494fe6338">Notify</a>(PSTR(<span class="stringliteral">&quot;\r\nMotion Controller Enabled\r\n&quot;</span>), 0x80);</div>
<div class="line"><a name="l00526"></a><span class="lineno"> 526</span>&#160;<span class="preprocessor">#endif</span></div>
<div class="line"><a name="l00527"></a><span class="lineno"> 527</span>&#160;<span class="preprocessor"></span> <a class="code" href="class_p_s3_b_t.html#a9273b6796948b83772117b3805421b4a">PS3MoveConnected</a> = <span class="keyword">true</span>;</div>
<div class="line"><a name="l00528"></a><span class="lineno"> 528</span>&#160; }</div>
<div class="line"><a name="l00529"></a><span class="lineno"> 529</span>&#160; ButtonState = 0; <span class="comment">// Clear all values</span></div>
<div class="line"><a name="l00530"></a><span class="lineno"> 530</span>&#160; OldButtonState = 0;</div>
<div class="line"><a name="l00531"></a><span class="lineno"> 531</span>&#160; ButtonClickState = 0;</div>
<div class="line"><a name="l00532"></a><span class="lineno"> 532</span>&#160; </div>
<div class="line"><a name="l00533"></a><span class="lineno"> 533</span>&#160; onInit(); <span class="comment">// Turn on the LED on the controller</span></div>
<div class="line"><a name="l00534"></a><span class="lineno"> 534</span>&#160; l2cap_state = <a class="code" href="_p_s3_b_t_8h.html#ae4da52ca67e1f8b977199b24e8f3a400">L2CAP_DONE</a>;</div>
<div class="line"><a name="l00535"></a><span class="lineno"> 535</span>&#160; }</div>
<div class="line"><a name="l00536"></a><span class="lineno"> 536</span>&#160; <span class="keywordflow">break</span>;</div>
<div class="line"><a name="l00537"></a><span class="lineno"> 537</span>&#160;</div>
<div class="line"><a name="l00538"></a><span class="lineno"> 538</span>&#160; <span class="keywordflow">case</span> <a class="code" href="_p_s3_b_t_8h.html#ae4da52ca67e1f8b977199b24e8f3a400">L2CAP_DONE</a>:</div>
<div class="line"><a name="l00539"></a><span class="lineno"> 539</span>&#160; <span class="keywordflow">if</span> (<a class="code" href="class_p_s3_b_t.html#a9273b6796948b83772117b3805421b4a">PS3MoveConnected</a>) { <span class="comment">//The Bulb and rumble values, has to be send at aproximatly every 5th second for it to stay on</span></div>
<div class="line"><a name="l00540"></a><span class="lineno"> 540</span>&#160; <span class="keywordflow">if</span> (millis() - timerBulbRumble &gt; 4000) { <span class="comment">//Send at least every 4th second</span></div>
<div class="line"><a name="l00541"></a><span class="lineno"> 541</span>&#160; HIDMove_Command(HIDMoveBuffer, <a class="code" href="_p_s3_b_t_8h.html#a465c4c33eae0fd5f934ae12bc8d6ca7e">HID_BUFFERSIZE</a>); <span class="comment">//The Bulb and rumble values, has to be written again and again, for it to stay turned on</span></div>
<div class="line"><a name="l00542"></a><span class="lineno"> 542</span>&#160; timerBulbRumble = millis();</div>
<div class="line"><a name="l00543"></a><span class="lineno"> 543</span>&#160; }</div>
<div class="line"><a name="l00544"></a><span class="lineno"> 544</span>&#160; }</div>
<div class="line"><a name="l00545"></a><span class="lineno"> 545</span>&#160; <span class="keywordflow">break</span>;</div>
<div class="line"><a name="l00546"></a><span class="lineno"> 546</span>&#160; }</div>
<div class="line"><a name="l00547"></a><span class="lineno"> 547</span>&#160;}</div>
<div class="line"><a name="l00548"></a><span class="lineno"> 548</span>&#160;</div>
<div class="line"><a name="l00549"></a><span class="lineno"> 549</span>&#160;<span class="comment">/************************************************************/</span></div>
<div class="line"><a name="l00550"></a><span class="lineno"> 550</span>&#160;<span class="comment">/* HID Commands */</span></div>
<div class="line"><a name="l00551"></a><span class="lineno"> 551</span>&#160;<span class="comment">/************************************************************/</span></div>
<div class="line"><a name="l00552"></a><span class="lineno"> 552</span>&#160;</div>
<div class="line"><a name="l00553"></a><span class="lineno"> 553</span>&#160;<span class="comment">/************************************************************/</span></div>
<div class="line"><a name="l00554"></a><span class="lineno"> 554</span>&#160;<span class="comment">/* HID Commands */</span></div>
<div class="line"><a name="l00555"></a><span class="lineno"> 555</span>&#160;<span class="comment">/************************************************************/</span></div>
<div class="line"><a name="l00556"></a><span class="lineno"> 556</span>&#160;</div>
<div class="line"><a name="l00557"></a><span class="lineno"> 557</span>&#160;<span class="comment">//Playstation Sixaxis Dualshock and Navigation Controller commands</span></div>
<div class="line"><a name="l00558"></a><span class="lineno"> 558</span>&#160;</div>
<div class="line"><a name="l00559"></a><span class="lineno"> 559</span>&#160;<span class="keywordtype">void</span> PS3BT::HID_Command(uint8_t* data, uint8_t nbytes) {</div>
<div class="line"><a name="l00560"></a><span class="lineno"> 560</span>&#160; <span class="keywordflow">if</span> (millis() - timerHID &lt;= 250)<span class="comment">// Check if is has been more than 250ms since last command</span></div>
<div class="line"><a name="l00561"></a><span class="lineno"> 561</span>&#160; delay((uint32_t)(250 - (millis() - timerHID))); <span class="comment">//There have to be a delay between commands</span></div>
<div class="line"><a name="l00562"></a><span class="lineno"> 562</span>&#160; pBtd-&gt;<a class="code" href="class_b_t_d.html#aad7d8ef46e60b48ff4aaabefb0b290e7">L2CAP_Command</a>(hci_handle, data, nbytes, control_scid[0], control_scid[1]); <span class="comment">// Both the Navigation and Dualshock controller sends data via the control channel</span></div>
<div class="line"><a name="l00563"></a><span class="lineno"> 563</span>&#160; timerHID = millis();</div>
<div class="line"><a name="l00564"></a><span class="lineno"> 564</span>&#160;}</div>
<div class="line"><a name="l00553"></a><span class="lineno"> 553</span>&#160;<span class="comment">//Playstation Sixaxis Dualshock and Navigation Controller commands</span></div>
<div class="line"><a name="l00554"></a><span class="lineno"> 554</span>&#160;</div>
<div class="line"><a name="l00555"></a><span class="lineno"> 555</span>&#160;<span class="keywordtype">void</span> PS3BT::HID_Command(uint8_t* data, uint8_t nbytes) {</div>
<div class="line"><a name="l00556"></a><span class="lineno"> 556</span>&#160; <span class="keywordflow">if</span> (millis() - timerHID &lt;= 250)<span class="comment">// Check if is has been more than 250ms since last command</span></div>
<div class="line"><a name="l00557"></a><span class="lineno"> 557</span>&#160; delay((uint32_t)(250 - (millis() - timerHID))); <span class="comment">//There have to be a delay between commands</span></div>
<div class="line"><a name="l00558"></a><span class="lineno"> 558</span>&#160; pBtd-&gt;<a class="code" href="class_b_t_d.html#aad7d8ef46e60b48ff4aaabefb0b290e7">L2CAP_Command</a>(hci_handle, data, nbytes, control_scid[0], control_scid[1]); <span class="comment">// Both the Navigation and Dualshock controller sends data via the control channel</span></div>
<div class="line"><a name="l00559"></a><span class="lineno"> 559</span>&#160; timerHID = millis();</div>
<div class="line"><a name="l00560"></a><span class="lineno"> 560</span>&#160;}</div>
<div class="line"><a name="l00561"></a><span class="lineno"> 561</span>&#160;</div>
<div class="line"><a name="l00562"></a><span class="lineno"><a class="code" href="class_p_s3_b_t.html#a6ee74242b0c1644496ff04b457f39cd2"> 562</a></span>&#160;<span class="keywordtype">void</span> <a class="code" href="class_p_s3_b_t.html#a6ee74242b0c1644496ff04b457f39cd2">PS3BT::setAllOff</a>() {</div>
<div class="line"><a name="l00563"></a><span class="lineno"> 563</span>&#160; <span class="keywordflow">for</span> (uint8_t i = 0; i &lt; <a class="code" href="_p_s3_enums_8h.html#a4898fccf5d2aa053bc67894aa3627e0f">PS3_REPORT_BUFFER_SIZE</a>; i++)</div>
<div class="line"><a name="l00564"></a><span class="lineno"> 564</span>&#160; HIDBuffer[i + 2] = pgm_read_byte(&amp;<a class="code" href="_p_s3_enums_8h.html#a8cf62ee374ebaa5f7582c073e624bc74">PS3_REPORT_BUFFER</a>[i]); <span class="comment">// First two bytes reserved for report type and ID</span></div>
<div class="line"><a name="l00565"></a><span class="lineno"> 565</span>&#160;</div>
<div class="line"><a name="l00566"></a><span class="lineno"><a class="code" href="class_p_s3_b_t.html#a6ee74242b0c1644496ff04b457f39cd2"> 566</a></span>&#160;<span class="keywordtype">void</span> <a class="code" href="class_p_s3_b_t.html#a6ee74242b0c1644496ff04b457f39cd2">PS3BT::setAllOff</a>() {</div>
<div class="line"><a name="l00567"></a><span class="lineno"> 567</span>&#160; <span class="keywordflow">for</span> (uint8_t i = 0; i &lt; <a class="code" href="_p_s3_enums_8h.html#a4898fccf5d2aa053bc67894aa3627e0f">PS3_REPORT_BUFFER_SIZE</a>; i++)</div>
<div class="line"><a name="l00568"></a><span class="lineno"> 568</span>&#160; HIDBuffer[i + 2] = pgm_read_byte(&amp;<a class="code" href="_p_s3_enums_8h.html#a8cf62ee374ebaa5f7582c073e624bc74">PS3_REPORT_BUFFER</a>[i]); <span class="comment">// First two bytes reserved for report type and ID</span></div>
<div class="line"><a name="l00569"></a><span class="lineno"> 569</span>&#160;</div>
<div class="line"><a name="l00570"></a><span class="lineno"> 570</span>&#160; HID_Command(HIDBuffer, <a class="code" href="_p_s3_b_t_8h.html#a465c4c33eae0fd5f934ae12bc8d6ca7e">HID_BUFFERSIZE</a>);</div>
<div class="line"><a name="l00571"></a><span class="lineno"> 571</span>&#160;}</div>
<div class="line"><a name="l00572"></a><span class="lineno"> 572</span>&#160;</div>
<div class="line"><a name="l00573"></a><span class="lineno"><a class="code" href="class_p_s3_b_t.html#a5c87e7db5311a5d56f78c994b5545e4e"> 573</a></span>&#160;<span class="keywordtype">void</span> <a class="code" href="class_p_s3_b_t.html#a5c87e7db5311a5d56f78c994b5545e4e">PS3BT::setRumbleOff</a>() {</div>
<div class="line"><a name="l00574"></a><span class="lineno"> 574</span>&#160; HIDBuffer[3] = 0x00;</div>
<div class="line"><a name="l00575"></a><span class="lineno"> 575</span>&#160; HIDBuffer[4] = 0x00;</div>
<div class="line"><a name="l00576"></a><span class="lineno"> 576</span>&#160; HIDBuffer[5] = 0x00;</div>
<div class="line"><a name="l00577"></a><span class="lineno"> 577</span>&#160; HIDBuffer[6] = 0x00;</div>
<div class="line"><a name="l00578"></a><span class="lineno"> 578</span>&#160;</div>
<div class="line"><a name="l00579"></a><span class="lineno"> 579</span>&#160; HID_Command(HIDBuffer, <a class="code" href="_p_s3_b_t_8h.html#a465c4c33eae0fd5f934ae12bc8d6ca7e">HID_BUFFERSIZE</a>);</div>
<div class="line"><a name="l00580"></a><span class="lineno"> 580</span>&#160;}</div>
<div class="line"><a name="l00581"></a><span class="lineno"> 581</span>&#160;</div>
<div class="line"><a name="l00582"></a><span class="lineno"><a class="code" href="class_p_s3_b_t.html#ad18e284705a4899d72937b97e27cb0a4"> 582</a></span>&#160;<span class="keywordtype">void</span> <a class="code" href="class_p_s3_b_t.html#ad18e284705a4899d72937b97e27cb0a4">PS3BT::setRumbleOn</a>(<a class="code" href="_p_s3_enums_8h.html#aff4be38428d075a117a5bb7f6209a231">Rumble</a> mode) {</div>
<div class="line"><a name="l00583"></a><span class="lineno"> 583</span>&#160; uint8_t power[2] = { 0xff, 0x00 }; <span class="comment">// Defaults to RumbleLow</span></div>
<div class="line"><a name="l00584"></a><span class="lineno"> 584</span>&#160; <span class="keywordflow">if</span> (mode == <a class="code" href="_p_s3_enums_8h.html#aff4be38428d075a117a5bb7f6209a231a5819f165165589a8e65b07bf46c7382b">RumbleHigh</a>) {</div>
<div class="line"><a name="l00585"></a><span class="lineno"> 585</span>&#160; power[0] = 0x00;</div>
<div class="line"><a name="l00586"></a><span class="lineno"> 586</span>&#160; power[1] = 0xff;</div>
<div class="line"><a name="l00587"></a><span class="lineno"> 587</span>&#160; }</div>
<div class="line"><a name="l00588"></a><span class="lineno"> 588</span>&#160; <a class="code" href="class_p_s3_b_t.html#ad18e284705a4899d72937b97e27cb0a4">setRumbleOn</a>(0xfe, power[0], 0xfe, power[1]);</div>
<div class="line"><a name="l00589"></a><span class="lineno"> 589</span>&#160;}</div>
<div class="line"><a name="l00590"></a><span class="lineno"> 590</span>&#160;</div>
<div class="line"><a name="l00591"></a><span class="lineno"><a class="code" href="class_p_s3_b_t.html#ae309556e995afc10b13dfbe4e6c32798"> 591</a></span>&#160;<span class="keywordtype">void</span> <a class="code" href="class_p_s3_b_t.html#ad18e284705a4899d72937b97e27cb0a4">PS3BT::setRumbleOn</a>(uint8_t rightDuration, uint8_t rightPower, uint8_t leftDuration, uint8_t leftPower) {</div>
<div class="line"><a name="l00592"></a><span class="lineno"> 592</span>&#160; HIDBuffer[3] = rightDuration;</div>
<div class="line"><a name="l00593"></a><span class="lineno"> 593</span>&#160; HIDBuffer[4] = rightPower;</div>
<div class="line"><a name="l00594"></a><span class="lineno"> 594</span>&#160; HIDBuffer[5] = leftDuration;</div>
<div class="line"><a name="l00595"></a><span class="lineno"> 595</span>&#160; HIDBuffer[6] = leftPower;</div>
<div class="line"><a name="l00596"></a><span class="lineno"> 596</span>&#160; HID_Command(HIDBuffer, <a class="code" href="_p_s3_b_t_8h.html#a465c4c33eae0fd5f934ae12bc8d6ca7e">HID_BUFFERSIZE</a>);</div>
<div class="line"><a name="l00597"></a><span class="lineno"> 597</span>&#160;}</div>
<div class="line"><a name="l00598"></a><span class="lineno"> 598</span>&#160;</div>
<div class="line"><a name="l00599"></a><span class="lineno"><a class="code" href="class_p_s3_b_t.html#a0acdc09661a8099b2d5e8b59cd8325bb"> 599</a></span>&#160;<span class="keywordtype">void</span> <a class="code" href="class_p_s3_b_t.html#a0acdc09661a8099b2d5e8b59cd8325bb">PS3BT::setLedRaw</a>(uint8_t value) {</div>
<div class="line"><a name="l00600"></a><span class="lineno"> 600</span>&#160; HIDBuffer[11] = value &lt;&lt; 1;</div>
<div class="line"><a name="l00566"></a><span class="lineno"> 566</span>&#160; HID_Command(HIDBuffer, <a class="code" href="_p_s3_b_t_8h.html#a465c4c33eae0fd5f934ae12bc8d6ca7e">HID_BUFFERSIZE</a>);</div>
<div class="line"><a name="l00567"></a><span class="lineno"> 567</span>&#160;}</div>
<div class="line"><a name="l00568"></a><span class="lineno"> 568</span>&#160;</div>
<div class="line"><a name="l00569"></a><span class="lineno"><a class="code" href="class_p_s3_b_t.html#a5c87e7db5311a5d56f78c994b5545e4e"> 569</a></span>&#160;<span class="keywordtype">void</span> <a class="code" href="class_p_s3_b_t.html#a5c87e7db5311a5d56f78c994b5545e4e">PS3BT::setRumbleOff</a>() {</div>
<div class="line"><a name="l00570"></a><span class="lineno"> 570</span>&#160; HIDBuffer[3] = 0x00;</div>
<div class="line"><a name="l00571"></a><span class="lineno"> 571</span>&#160; HIDBuffer[4] = 0x00;</div>
<div class="line"><a name="l00572"></a><span class="lineno"> 572</span>&#160; HIDBuffer[5] = 0x00;</div>
<div class="line"><a name="l00573"></a><span class="lineno"> 573</span>&#160; HIDBuffer[6] = 0x00;</div>
<div class="line"><a name="l00574"></a><span class="lineno"> 574</span>&#160;</div>
<div class="line"><a name="l00575"></a><span class="lineno"> 575</span>&#160; HID_Command(HIDBuffer, <a class="code" href="_p_s3_b_t_8h.html#a465c4c33eae0fd5f934ae12bc8d6ca7e">HID_BUFFERSIZE</a>);</div>
<div class="line"><a name="l00576"></a><span class="lineno"> 576</span>&#160;}</div>
<div class="line"><a name="l00577"></a><span class="lineno"> 577</span>&#160;</div>
<div class="line"><a name="l00578"></a><span class="lineno"><a class="code" href="class_p_s3_b_t.html#ad18e284705a4899d72937b97e27cb0a4"> 578</a></span>&#160;<span class="keywordtype">void</span> <a class="code" href="class_p_s3_b_t.html#ad18e284705a4899d72937b97e27cb0a4">PS3BT::setRumbleOn</a>(<a class="code" href="_p_s3_enums_8h.html#aff4be38428d075a117a5bb7f6209a231">Rumble</a> mode) {</div>
<div class="line"><a name="l00579"></a><span class="lineno"> 579</span>&#160; uint8_t power[2] = { 0xff, 0x00 }; <span class="comment">// Defaults to RumbleLow</span></div>
<div class="line"><a name="l00580"></a><span class="lineno"> 580</span>&#160; <span class="keywordflow">if</span> (mode == <a class="code" href="_p_s3_enums_8h.html#aff4be38428d075a117a5bb7f6209a231a5819f165165589a8e65b07bf46c7382b">RumbleHigh</a>) {</div>
<div class="line"><a name="l00581"></a><span class="lineno"> 581</span>&#160; power[0] = 0x00;</div>
<div class="line"><a name="l00582"></a><span class="lineno"> 582</span>&#160; power[1] = 0xff;</div>
<div class="line"><a name="l00583"></a><span class="lineno"> 583</span>&#160; }</div>
<div class="line"><a name="l00584"></a><span class="lineno"> 584</span>&#160; <a class="code" href="class_p_s3_b_t.html#ad18e284705a4899d72937b97e27cb0a4">setRumbleOn</a>(0xfe, power[0], 0xfe, power[1]);</div>
<div class="line"><a name="l00585"></a><span class="lineno"> 585</span>&#160;}</div>
<div class="line"><a name="l00586"></a><span class="lineno"> 586</span>&#160;</div>
<div class="line"><a name="l00587"></a><span class="lineno"><a class="code" href="class_p_s3_b_t.html#ae309556e995afc10b13dfbe4e6c32798"> 587</a></span>&#160;<span class="keywordtype">void</span> <a class="code" href="class_p_s3_b_t.html#ad18e284705a4899d72937b97e27cb0a4">PS3BT::setRumbleOn</a>(uint8_t rightDuration, uint8_t rightPower, uint8_t leftDuration, uint8_t leftPower) {</div>
<div class="line"><a name="l00588"></a><span class="lineno"> 588</span>&#160; HIDBuffer[3] = rightDuration;</div>
<div class="line"><a name="l00589"></a><span class="lineno"> 589</span>&#160; HIDBuffer[4] = rightPower;</div>
<div class="line"><a name="l00590"></a><span class="lineno"> 590</span>&#160; HIDBuffer[5] = leftDuration;</div>
<div class="line"><a name="l00591"></a><span class="lineno"> 591</span>&#160; HIDBuffer[6] = leftPower;</div>
<div class="line"><a name="l00592"></a><span class="lineno"> 592</span>&#160; HID_Command(HIDBuffer, <a class="code" href="_p_s3_b_t_8h.html#a465c4c33eae0fd5f934ae12bc8d6ca7e">HID_BUFFERSIZE</a>);</div>
<div class="line"><a name="l00593"></a><span class="lineno"> 593</span>&#160;}</div>
<div class="line"><a name="l00594"></a><span class="lineno"> 594</span>&#160;</div>
<div class="line"><a name="l00595"></a><span class="lineno"><a class="code" href="class_p_s3_b_t.html#a0acdc09661a8099b2d5e8b59cd8325bb"> 595</a></span>&#160;<span class="keywordtype">void</span> <a class="code" href="class_p_s3_b_t.html#a0acdc09661a8099b2d5e8b59cd8325bb">PS3BT::setLedRaw</a>(uint8_t value) {</div>
<div class="line"><a name="l00596"></a><span class="lineno"> 596</span>&#160; HIDBuffer[11] = value &lt;&lt; 1;</div>
<div class="line"><a name="l00597"></a><span class="lineno"> 597</span>&#160; HID_Command(HIDBuffer, <a class="code" href="_p_s3_b_t_8h.html#a465c4c33eae0fd5f934ae12bc8d6ca7e">HID_BUFFERSIZE</a>);</div>
<div class="line"><a name="l00598"></a><span class="lineno"> 598</span>&#160;}</div>
<div class="line"><a name="l00599"></a><span class="lineno"><a class="code" href="class_p_s3_b_t.html#aa84e4cb30f827c8d8d981c1de82c53ad"> 599</a></span>&#160;<span class="keywordtype">void</span> <a class="code" href="class_p_s3_b_t.html#aa84e4cb30f827c8d8d981c1de82c53ad">PS3BT::setLedOff</a>(<a class="code" href="controller_enums_8h.html#aadcb6002d2b42fdfe01490f730ab00a6">LED</a> a) {</div>
<div class="line"><a name="l00600"></a><span class="lineno"> 600</span>&#160; HIDBuffer[11] &amp;= ~((uint8_t)((pgm_read_byte(&amp;<a class="code" href="_p_s3_enums_8h.html#af83672eccf0c7a02847ce75bc5c55a1a">LEDS</a>[(uint8_t)a]) &amp; 0x0f) &lt;&lt; 1));</div>
<div class="line"><a name="l00601"></a><span class="lineno"> 601</span>&#160; HID_Command(HIDBuffer, <a class="code" href="_p_s3_b_t_8h.html#a465c4c33eae0fd5f934ae12bc8d6ca7e">HID_BUFFERSIZE</a>);</div>
<div class="line"><a name="l00602"></a><span class="lineno"> 602</span>&#160;}</div>
<div class="line"><a name="l00603"></a><span class="lineno"><a class="code" href="class_p_s3_b_t.html#aa84e4cb30f827c8d8d981c1de82c53ad"> 603</a></span>&#160;<span class="keywordtype">void</span> <a class="code" href="class_p_s3_b_t.html#aa84e4cb30f827c8d8d981c1de82c53ad">PS3BT::setLedOff</a>(<a class="code" href="controller_enums_8h.html#aadcb6002d2b42fdfe01490f730ab00a6">LED</a> a) {</div>
<div class="line"><a name="l00604"></a><span class="lineno"> 604</span>&#160; HIDBuffer[11] &amp;= ~((uint8_t)((pgm_read_byte(&amp;<a class="code" href="_p_s3_enums_8h.html#af83672eccf0c7a02847ce75bc5c55a1a">LEDS</a>[(uint8_t)a]) &amp; 0x0f) &lt;&lt; 1));</div>
<div class="line"><a name="l00605"></a><span class="lineno"> 605</span>&#160; HID_Command(HIDBuffer, <a class="code" href="_p_s3_b_t_8h.html#a465c4c33eae0fd5f934ae12bc8d6ca7e">HID_BUFFERSIZE</a>);</div>
<div class="line"><a name="l00606"></a><span class="lineno"> 606</span>&#160;}</div>
<div class="line"><a name="l00607"></a><span class="lineno"> 607</span>&#160;</div>
<div class="line"><a name="l00608"></a><span class="lineno"><a class="code" href="class_p_s3_b_t.html#ad400e1ce37c2dadd48938187b5021d42"> 608</a></span>&#160;<span class="keywordtype">void</span> <a class="code" href="class_p_s3_b_t.html#ad400e1ce37c2dadd48938187b5021d42">PS3BT::setLedOn</a>(<a class="code" href="controller_enums_8h.html#aadcb6002d2b42fdfe01490f730ab00a6">LED</a> a) {</div>
<div class="line"><a name="l00609"></a><span class="lineno"> 609</span>&#160; HIDBuffer[11] |= (uint8_t)((pgm_read_byte(&amp;<a class="code" href="_p_s3_enums_8h.html#af83672eccf0c7a02847ce75bc5c55a1a">LEDS</a>[(uint8_t)a]) &amp; 0x0f) &lt;&lt; 1);</div>
<div class="line"><a name="l00610"></a><span class="lineno"> 610</span>&#160; HID_Command(HIDBuffer, <a class="code" href="_p_s3_b_t_8h.html#a465c4c33eae0fd5f934ae12bc8d6ca7e">HID_BUFFERSIZE</a>);</div>
<div class="line"><a name="l00611"></a><span class="lineno"> 611</span>&#160;}</div>
<div class="line"><a name="l00612"></a><span class="lineno"> 612</span>&#160;</div>
<div class="line"><a name="l00613"></a><span class="lineno"><a class="code" href="class_p_s3_b_t.html#a313d4c962273fc7daccb0319d80c5f61"> 613</a></span>&#160;<span class="keywordtype">void</span> <a class="code" href="class_p_s3_b_t.html#a313d4c962273fc7daccb0319d80c5f61">PS3BT::setLedToggle</a>(<a class="code" href="controller_enums_8h.html#aadcb6002d2b42fdfe01490f730ab00a6">LED</a> a) {</div>
<div class="line"><a name="l00614"></a><span class="lineno"> 614</span>&#160; HIDBuffer[11] ^= (uint8_t)((pgm_read_byte(&amp;<a class="code" href="_p_s3_enums_8h.html#af83672eccf0c7a02847ce75bc5c55a1a">LEDS</a>[(uint8_t)a]) &amp; 0x0f) &lt;&lt; 1);</div>
<div class="line"><a name="l00615"></a><span class="lineno"> 615</span>&#160; HID_Command(HIDBuffer, <a class="code" href="_p_s3_b_t_8h.html#a465c4c33eae0fd5f934ae12bc8d6ca7e">HID_BUFFERSIZE</a>);</div>
<div class="line"><a name="l00616"></a><span class="lineno"> 616</span>&#160;}</div>
<div class="line"><a name="l00617"></a><span class="lineno"> 617</span>&#160;</div>
<div class="line"><a name="l00618"></a><span class="lineno"> 618</span>&#160;<span class="keywordtype">void</span> PS3BT::enable_sixaxis() { <span class="comment">//Command used to enable the Dualshock 3 and Navigation controller to send data via USB</span></div>
<div class="line"><a name="l00619"></a><span class="lineno"> 619</span>&#160; uint8_t cmd_buf[6];</div>
<div class="line"><a name="l00620"></a><span class="lineno"> 620</span>&#160; cmd_buf[0] = 0x53; <span class="comment">// HID BT Set_report (0x50) | Report Type (Feature 0x03)</span></div>
<div class="line"><a name="l00621"></a><span class="lineno"> 621</span>&#160; cmd_buf[1] = 0xF4; <span class="comment">// Report ID</span></div>
<div class="line"><a name="l00622"></a><span class="lineno"> 622</span>&#160; cmd_buf[2] = 0x42; <span class="comment">// Special PS3 Controller enable commands</span></div>
<div class="line"><a name="l00623"></a><span class="lineno"> 623</span>&#160; cmd_buf[3] = 0x03;</div>
<div class="line"><a name="l00624"></a><span class="lineno"> 624</span>&#160; cmd_buf[4] = 0x00;</div>
<div class="line"><a name="l00625"></a><span class="lineno"> 625</span>&#160; cmd_buf[5] = 0x00;</div>
<div class="line"><a name="l00626"></a><span class="lineno"> 626</span>&#160;</div>
<div class="line"><a name="l00627"></a><span class="lineno"> 627</span>&#160; HID_Command(cmd_buf, 6);</div>
<div class="line"><a name="l00628"></a><span class="lineno"> 628</span>&#160;}</div>
<div class="line"><a name="l00629"></a><span class="lineno"> 629</span>&#160;</div>
<div class="line"><a name="l00630"></a><span class="lineno"> 630</span>&#160;<span class="comment">//Playstation Move Controller commands</span></div>
<div class="line"><a name="l00631"></a><span class="lineno"> 631</span>&#160;</div>
<div class="line"><a name="l00632"></a><span class="lineno"> 632</span>&#160;<span class="keywordtype">void</span> PS3BT::HIDMove_Command(uint8_t* data, uint8_t nbytes) {</div>
<div class="line"><a name="l00633"></a><span class="lineno"> 633</span>&#160; <span class="keywordflow">if</span> (millis() - timerHID &lt;= 250)<span class="comment">// Check if is has been less than 200ms since last command</span></div>
<div class="line"><a name="l00634"></a><span class="lineno"> 634</span>&#160; delay((uint32_t)(250 - (millis() - timerHID))); <span class="comment">//There have to be a delay between commands</span></div>
<div class="line"><a name="l00635"></a><span class="lineno"> 635</span>&#160; pBtd-&gt;<a class="code" href="class_b_t_d.html#aad7d8ef46e60b48ff4aaabefb0b290e7">L2CAP_Command</a>(hci_handle, data, nbytes, interrupt_scid[0], interrupt_scid[1]); <span class="comment">// The Move controller sends it&#39;s data via the intterrupt channel</span></div>
<div class="line"><a name="l00636"></a><span class="lineno"> 636</span>&#160; timerHID = millis();</div>
<div class="line"><a name="l00637"></a><span class="lineno"> 637</span>&#160;}</div>
<div class="line"><a name="l00638"></a><span class="lineno"> 638</span>&#160;</div>
<div class="line"><a name="l00639"></a><span class="lineno"><a class="code" href="class_p_s3_b_t.html#ad0926b75edcbb12ddf76f78e66728782"> 639</a></span>&#160;<span class="keywordtype">void</span> <a class="code" href="class_p_s3_b_t.html#ad0926b75edcbb12ddf76f78e66728782">PS3BT::moveSetBulb</a>(uint8_t r, uint8_t g, uint8_t b) { <span class="comment">//Use this to set the Color using RGB values</span></div>
<div class="line"><a name="l00640"></a><span class="lineno"> 640</span>&#160; <span class="comment">//set the Bulb&#39;s values into the write buffer</span></div>
<div class="line"><a name="l00641"></a><span class="lineno"> 641</span>&#160; HIDMoveBuffer[3] = r;</div>
<div class="line"><a name="l00642"></a><span class="lineno"> 642</span>&#160; HIDMoveBuffer[4] = g;</div>
<div class="line"><a name="l00643"></a><span class="lineno"> 643</span>&#160; HIDMoveBuffer[5] = b;</div>
<div class="line"><a name="l00644"></a><span class="lineno"> 644</span>&#160;</div>
<div class="line"><a name="l00645"></a><span class="lineno"> 645</span>&#160; HIDMove_Command(HIDMoveBuffer, <a class="code" href="_p_s3_b_t_8h.html#a465c4c33eae0fd5f934ae12bc8d6ca7e">HID_BUFFERSIZE</a>);</div>
<div class="line"><a name="l00603"></a><span class="lineno"> 603</span>&#160;</div>
<div class="line"><a name="l00604"></a><span class="lineno"><a class="code" href="class_p_s3_b_t.html#ad400e1ce37c2dadd48938187b5021d42"> 604</a></span>&#160;<span class="keywordtype">void</span> <a class="code" href="class_p_s3_b_t.html#ad400e1ce37c2dadd48938187b5021d42">PS3BT::setLedOn</a>(<a class="code" href="controller_enums_8h.html#aadcb6002d2b42fdfe01490f730ab00a6">LED</a> a) {</div>
<div class="line"><a name="l00605"></a><span class="lineno"> 605</span>&#160; HIDBuffer[11] |= (uint8_t)((pgm_read_byte(&amp;<a class="code" href="_p_s3_enums_8h.html#af83672eccf0c7a02847ce75bc5c55a1a">LEDS</a>[(uint8_t)a]) &amp; 0x0f) &lt;&lt; 1);</div>
<div class="line"><a name="l00606"></a><span class="lineno"> 606</span>&#160; HID_Command(HIDBuffer, <a class="code" href="_p_s3_b_t_8h.html#a465c4c33eae0fd5f934ae12bc8d6ca7e">HID_BUFFERSIZE</a>);</div>
<div class="line"><a name="l00607"></a><span class="lineno"> 607</span>&#160;}</div>
<div class="line"><a name="l00608"></a><span class="lineno"> 608</span>&#160;</div>
<div class="line"><a name="l00609"></a><span class="lineno"><a class="code" href="class_p_s3_b_t.html#a313d4c962273fc7daccb0319d80c5f61"> 609</a></span>&#160;<span class="keywordtype">void</span> <a class="code" href="class_p_s3_b_t.html#a313d4c962273fc7daccb0319d80c5f61">PS3BT::setLedToggle</a>(<a class="code" href="controller_enums_8h.html#aadcb6002d2b42fdfe01490f730ab00a6">LED</a> a) {</div>
<div class="line"><a name="l00610"></a><span class="lineno"> 610</span>&#160; HIDBuffer[11] ^= (uint8_t)((pgm_read_byte(&amp;<a class="code" href="_p_s3_enums_8h.html#af83672eccf0c7a02847ce75bc5c55a1a">LEDS</a>[(uint8_t)a]) &amp; 0x0f) &lt;&lt; 1);</div>
<div class="line"><a name="l00611"></a><span class="lineno"> 611</span>&#160; HID_Command(HIDBuffer, <a class="code" href="_p_s3_b_t_8h.html#a465c4c33eae0fd5f934ae12bc8d6ca7e">HID_BUFFERSIZE</a>);</div>
<div class="line"><a name="l00612"></a><span class="lineno"> 612</span>&#160;}</div>
<div class="line"><a name="l00613"></a><span class="lineno"> 613</span>&#160;</div>
<div class="line"><a name="l00614"></a><span class="lineno"> 614</span>&#160;<span class="keywordtype">void</span> PS3BT::enable_sixaxis() { <span class="comment">//Command used to enable the Dualshock 3 and Navigation controller to send data via USB</span></div>
<div class="line"><a name="l00615"></a><span class="lineno"> 615</span>&#160; uint8_t cmd_buf[6];</div>
<div class="line"><a name="l00616"></a><span class="lineno"> 616</span>&#160; cmd_buf[0] = 0x53; <span class="comment">// HID BT Set_report (0x50) | Report Type (Feature 0x03)</span></div>
<div class="line"><a name="l00617"></a><span class="lineno"> 617</span>&#160; cmd_buf[1] = 0xF4; <span class="comment">// Report ID</span></div>
<div class="line"><a name="l00618"></a><span class="lineno"> 618</span>&#160; cmd_buf[2] = 0x42; <span class="comment">// Special PS3 Controller enable commands</span></div>
<div class="line"><a name="l00619"></a><span class="lineno"> 619</span>&#160; cmd_buf[3] = 0x03;</div>
<div class="line"><a name="l00620"></a><span class="lineno"> 620</span>&#160; cmd_buf[4] = 0x00;</div>
<div class="line"><a name="l00621"></a><span class="lineno"> 621</span>&#160; cmd_buf[5] = 0x00;</div>
<div class="line"><a name="l00622"></a><span class="lineno"> 622</span>&#160;</div>
<div class="line"><a name="l00623"></a><span class="lineno"> 623</span>&#160; HID_Command(cmd_buf, 6);</div>
<div class="line"><a name="l00624"></a><span class="lineno"> 624</span>&#160;}</div>
<div class="line"><a name="l00625"></a><span class="lineno"> 625</span>&#160;</div>
<div class="line"><a name="l00626"></a><span class="lineno"> 626</span>&#160;<span class="comment">//Playstation Move Controller commands</span></div>
<div class="line"><a name="l00627"></a><span class="lineno"> 627</span>&#160;</div>
<div class="line"><a name="l00628"></a><span class="lineno"> 628</span>&#160;<span class="keywordtype">void</span> PS3BT::HIDMove_Command(uint8_t* data, uint8_t nbytes) {</div>
<div class="line"><a name="l00629"></a><span class="lineno"> 629</span>&#160; <span class="keywordflow">if</span> (millis() - timerHID &lt;= 250)<span class="comment">// Check if is has been less than 200ms since last command</span></div>
<div class="line"><a name="l00630"></a><span class="lineno"> 630</span>&#160; delay((uint32_t)(250 - (millis() - timerHID))); <span class="comment">//There have to be a delay between commands</span></div>
<div class="line"><a name="l00631"></a><span class="lineno"> 631</span>&#160; pBtd-&gt;<a class="code" href="class_b_t_d.html#aad7d8ef46e60b48ff4aaabefb0b290e7">L2CAP_Command</a>(hci_handle, data, nbytes, interrupt_scid[0], interrupt_scid[1]); <span class="comment">// The Move controller sends it&#39;s data via the intterrupt channel</span></div>
<div class="line"><a name="l00632"></a><span class="lineno"> 632</span>&#160; timerHID = millis();</div>
<div class="line"><a name="l00633"></a><span class="lineno"> 633</span>&#160;}</div>
<div class="line"><a name="l00634"></a><span class="lineno"> 634</span>&#160;</div>
<div class="line"><a name="l00635"></a><span class="lineno"><a class="code" href="class_p_s3_b_t.html#ad0926b75edcbb12ddf76f78e66728782"> 635</a></span>&#160;<span class="keywordtype">void</span> <a class="code" href="class_p_s3_b_t.html#ad0926b75edcbb12ddf76f78e66728782">PS3BT::moveSetBulb</a>(uint8_t r, uint8_t g, uint8_t b) { <span class="comment">//Use this to set the Color using RGB values</span></div>
<div class="line"><a name="l00636"></a><span class="lineno"> 636</span>&#160; <span class="comment">//set the Bulb&#39;s values into the write buffer</span></div>
<div class="line"><a name="l00637"></a><span class="lineno"> 637</span>&#160; HIDMoveBuffer[3] = r;</div>
<div class="line"><a name="l00638"></a><span class="lineno"> 638</span>&#160; HIDMoveBuffer[4] = g;</div>
<div class="line"><a name="l00639"></a><span class="lineno"> 639</span>&#160; HIDMoveBuffer[5] = b;</div>
<div class="line"><a name="l00640"></a><span class="lineno"> 640</span>&#160;</div>
<div class="line"><a name="l00641"></a><span class="lineno"> 641</span>&#160; HIDMove_Command(HIDMoveBuffer, <a class="code" href="_p_s3_b_t_8h.html#a465c4c33eae0fd5f934ae12bc8d6ca7e">HID_BUFFERSIZE</a>);</div>
<div class="line"><a name="l00642"></a><span class="lineno"> 642</span>&#160;}</div>
<div class="line"><a name="l00643"></a><span class="lineno"> 643</span>&#160;</div>
<div class="line"><a name="l00644"></a><span class="lineno"><a class="code" href="class_p_s3_b_t.html#ae544ca1d76217d058c63d339d0701264"> 644</a></span>&#160;<span class="keywordtype">void</span> <a class="code" href="class_p_s3_b_t.html#ad0926b75edcbb12ddf76f78e66728782">PS3BT::moveSetBulb</a>(<a class="code" href="_p_s3_enums_8h.html#a55ecd4f2ec2ebfe8d5b0163e4ac2a967">Colors</a> color) { <span class="comment">//Use this to set the Color using the predefined colors in enum</span></div>
<div class="line"><a name="l00645"></a><span class="lineno"> 645</span>&#160; <a class="code" href="class_p_s3_b_t.html#ad0926b75edcbb12ddf76f78e66728782">moveSetBulb</a>((uint8_t)(color &gt;&gt; 16), (uint8_t)(color &gt;&gt; 8), (uint8_t)(color));</div>
<div class="line"><a name="l00646"></a><span class="lineno"> 646</span>&#160;}</div>
<div class="line"><a name="l00647"></a><span class="lineno"> 647</span>&#160;</div>
<div class="line"><a name="l00648"></a><span class="lineno"><a class="code" href="class_p_s3_b_t.html#ae544ca1d76217d058c63d339d0701264"> 648</a></span>&#160;<span class="keywordtype">void</span> <a class="code" href="class_p_s3_b_t.html#ad0926b75edcbb12ddf76f78e66728782">PS3BT::moveSetBulb</a>(<a class="code" href="_p_s3_enums_8h.html#a55ecd4f2ec2ebfe8d5b0163e4ac2a967">Colors</a> color) { <span class="comment">//Use this to set the Color using the predefined colors in enum</span></div>
<div class="line"><a name="l00649"></a><span class="lineno"> 649</span>&#160; <a class="code" href="class_p_s3_b_t.html#ad0926b75edcbb12ddf76f78e66728782">moveSetBulb</a>((uint8_t)(color &gt;&gt; 16), (uint8_t)(color &gt;&gt; 8), (uint8_t)(color));</div>
<div class="line"><a name="l00650"></a><span class="lineno"> 650</span>&#160;}</div>
<div class="line"><a name="l00651"></a><span class="lineno"> 651</span>&#160;</div>
<div class="line"><a name="l00652"></a><span class="lineno"><a class="code" href="class_p_s3_b_t.html#ac14d338ddb573d1c06f70749f9205689"> 652</a></span>&#160;<span class="keywordtype">void</span> <a class="code" href="class_p_s3_b_t.html#ac14d338ddb573d1c06f70749f9205689">PS3BT::moveSetRumble</a>(uint8_t rumble) {</div>
<div class="line"><a name="l00653"></a><span class="lineno"> 653</span>&#160;<span class="preprocessor">#ifdef DEBUG_USB_HOST</span></div>
<div class="line"><a name="l00654"></a><span class="lineno"> 654</span>&#160;<span class="preprocessor"></span> <span class="keywordflow">if</span> (rumble &lt; 64 &amp;&amp; rumble != 0) <span class="comment">// The rumble value has to at least 64, or approximately 25% (64/255*100)</span></div>
<div class="line"><a name="l00655"></a><span class="lineno"> 655</span>&#160; <a class="code" href="message_8h.html#a747819b0aa34f5c3ba0332c2db28c846">Notify</a>(PSTR(<span class="stringliteral">&quot;\r\nThe rumble value has to at least 64, or approximately 25%&quot;</span>), 0x80);</div>
<div class="line"><a name="l00656"></a><span class="lineno"> 656</span>&#160;<span class="preprocessor">#endif</span></div>
<div class="line"><a name="l00657"></a><span class="lineno"> 657</span>&#160;<span class="preprocessor"></span> <span class="comment">//set the rumble value into the write buffer</span></div>
<div class="line"><a name="l00658"></a><span class="lineno"> 658</span>&#160; HIDMoveBuffer[7] = rumble;</div>
<div class="line"><a name="l00659"></a><span class="lineno"> 659</span>&#160;</div>
<div class="line"><a name="l00660"></a><span class="lineno"> 660</span>&#160; HIDMove_Command(HIDMoveBuffer, <a class="code" href="_p_s3_b_t_8h.html#a465c4c33eae0fd5f934ae12bc8d6ca7e">HID_BUFFERSIZE</a>);</div>
<div class="line"><a name="l00661"></a><span class="lineno"> 661</span>&#160;}</div>
<div class="line"><a name="l00648"></a><span class="lineno"><a class="code" href="class_p_s3_b_t.html#ac14d338ddb573d1c06f70749f9205689"> 648</a></span>&#160;<span class="keywordtype">void</span> <a class="code" href="class_p_s3_b_t.html#ac14d338ddb573d1c06f70749f9205689">PS3BT::moveSetRumble</a>(uint8_t rumble) {</div>
<div class="line"><a name="l00649"></a><span class="lineno"> 649</span>&#160;<span class="preprocessor">#ifdef DEBUG_USB_HOST</span></div>
<div class="line"><a name="l00650"></a><span class="lineno"> 650</span>&#160;<span class="preprocessor"></span> <span class="keywordflow">if</span> (rumble &lt; 64 &amp;&amp; rumble != 0) <span class="comment">// The rumble value has to at least 64, or approximately 25% (64/255*100)</span></div>
<div class="line"><a name="l00651"></a><span class="lineno"> 651</span>&#160; <a class="code" href="message_8h.html#a27117e124c5d66d5512fe8d494fe6338">Notify</a>(PSTR(<span class="stringliteral">&quot;\r\nThe rumble value has to at least 64, or approximately 25%&quot;</span>), 0x80);</div>
<div class="line"><a name="l00652"></a><span class="lineno"> 652</span>&#160;<span class="preprocessor">#endif</span></div>
<div class="line"><a name="l00653"></a><span class="lineno"> 653</span>&#160;<span class="preprocessor"></span> <span class="comment">//set the rumble value into the write buffer</span></div>
<div class="line"><a name="l00654"></a><span class="lineno"> 654</span>&#160; HIDMoveBuffer[7] = rumble;</div>
<div class="line"><a name="l00655"></a><span class="lineno"> 655</span>&#160;</div>
<div class="line"><a name="l00656"></a><span class="lineno"> 656</span>&#160; HIDMove_Command(HIDMoveBuffer, <a class="code" href="_p_s3_b_t_8h.html#a465c4c33eae0fd5f934ae12bc8d6ca7e">HID_BUFFERSIZE</a>);</div>
<div class="line"><a name="l00657"></a><span class="lineno"> 657</span>&#160;}</div>
<div class="line"><a name="l00658"></a><span class="lineno"> 658</span>&#160;</div>
<div class="line"><a name="l00659"></a><span class="lineno"> 659</span>&#160;<span class="keywordtype">void</span> PS3BT::onInit() {</div>
<div class="line"><a name="l00660"></a><span class="lineno"> 660</span>&#160; <span class="keywordflow">if</span> (pFuncOnInit)</div>
<div class="line"><a name="l00661"></a><span class="lineno"> 661</span>&#160; pFuncOnInit(); <span class="comment">// Call the user function</span></div>
<div class="line"><a name="l00662"></a><span class="lineno"> 662</span>&#160; <span class="keywordflow">else</span> {</div>
<div class="line"><a name="l00663"></a><span class="lineno"> 663</span>&#160; <span class="keywordflow">if</span> (<a class="code" href="class_p_s3_b_t.html#a9273b6796948b83772117b3805421b4a">PS3MoveConnected</a>)</div>
<div class="line"><a name="l00664"></a><span class="lineno"> 664</span>&#160; <a class="code" href="class_p_s3_b_t.html#ad0926b75edcbb12ddf76f78e66728782">moveSetBulb</a>(<a class="code" href="_p_s3_enums_8h.html#a55ecd4f2ec2ebfe8d5b0163e4ac2a967ad3163c1fcda01965b692ec2c3122b743">Red</a>);</div>
<div class="line"><a name="l00665"></a><span class="lineno"> 665</span>&#160; <span class="keywordflow">else</span> <span class="comment">// Dualshock 3 or Navigation controller</span></div>
<div class="line"><a name="l00666"></a><span class="lineno"> 666</span>&#160; <a class="code" href="class_p_s3_b_t.html#ad400e1ce37c2dadd48938187b5021d42">setLedOn</a>(<a class="code" href="controller_enums_8h.html#aadcb6002d2b42fdfe01490f730ab00a6adac6477842247cab1a8c02c65f431b44">LED1</a>);</div>
<div class="line"><a name="l00667"></a><span class="lineno"> 667</span>&#160; }</div>
<div class="line"><a name="l00668"></a><span class="lineno"> 668</span>&#160;}</div>
</div><!-- fragment --></div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>

View file

@ -99,7 +99,7 @@ Include dependency graph for PS3BT.h:</div>
<div class="dyncontent">
<div class="center"><img src="_p_s3_b_t_8h__incl.png" border="0" usemap="#_p_s3_b_t_8h" alt=""/></div>
<map name="_p_s3_b_t_8h" id="_p_s3_b_t_8h">
<area shape="rect" id="node2" href="_b_t_d_8h.html" title="BTD.h" alt="" coords="442,75,487,96"/><area shape="rect" id="node21" href="_p_s3_enums_8h.html" title="PS3Enums.h" alt="" coords="511,75,581,96"/><area shape="rect" id="node3" href="_usb_8h.html" title="Usb.h" alt="" coords="590,213,633,235"/><area shape="rect" id="node19" href="confdescparser_8h.html" title="confdescparser.h" alt="" coords="195,144,278,165"/><area shape="rect" id="node6" href="avrpins_8h.html" title="avrpins.h" alt="" coords="879,352,933,373"/><area shape="rect" id="node8" href="max3421e_8h.html" title="max3421e.h" alt="" coords="585,352,651,373"/><area shape="rect" id="node9" href="usbhost_8h.html" title="usbhost.h" alt="" coords="744,283,801,304"/><area shape="rect" id="node10" href="usb__ch9_8h.html" title="usb_ch9.h" alt="" coords="675,352,734,373"/><area shape="rect" id="node12" href="address_8h.html" title="address.h" alt="" coords="485,283,542,304"/><area shape="rect" id="node15" href="message_8h.html" title="message.h" alt="" coords="171,283,233,304"/><area shape="rect" id="node17" href="printhex_8h.html" title="printhex.h" alt="" coords="153,421,210,443"/><area shape="rect" id="node18" href="hexdump_8h.html" title="hexdump.h" alt="" coords="171,352,233,373"/><area shape="rect" id="node20" href="parsetools_8h.html" title="parsetools.h" alt="" coords="133,213,198,235"/><area shape="rect" id="node22" href="controller_enums_8h.html" title="controllerEnums.h" alt="" coords="503,144,589,165"/></map>
<area shape="rect" id="node2" href="_b_t_d_8h.html" title="BTD.h" alt="" coords="458,75,504,96"/><area shape="rect" id="node21" href="_p_s3_enums_8h.html" title="PS3Enums.h" alt="" coords="528,75,597,96"/><area shape="rect" id="node3" href="_usb_8h.html" title="Usb.h" alt="" coords="605,213,648,235"/><area shape="rect" id="node19" href="confdescparser_8h.html" title="confdescparser.h" alt="" coords="211,144,294,165"/><area shape="rect" id="node6" href="avrpins_8h.html" title="avrpins.h" alt="" coords="895,352,949,373"/><area shape="rect" id="node8" href="max3421e_8h.html" title="max3421e.h" alt="" coords="601,352,668,373"/><area shape="rect" id="node9" href="usbhost_8h.html" title="usbhost.h" alt="" coords="759,283,816,304"/><area shape="rect" id="node11" href="usb__ch9_8h.html" title="usb_ch9.h" alt="" coords="692,352,750,373"/><area shape="rect" id="node13" href="address_8h.html" title="address.h" alt="" coords="500,283,557,304"/><area shape="rect" id="node15" href="message_8h.html" title="message.h" alt="" coords="188,283,249,304"/><area shape="rect" id="node17" href="printhex_8h.html" title="printhex.h" alt="" coords="190,421,246,443"/><area shape="rect" id="node18" href="hexdump_8h.html" title="hexdump.h" alt="" coords="188,352,249,373"/><area shape="rect" id="node20" href="parsetools_8h.html" title="parsetools.h" alt="" coords="150,213,214,235"/><area shape="rect" id="node22" href="controller_enums_8h.html" title="controllerEnums.h" alt="" coords="519,144,605,165"/></map>
</div>
</div><div class="textblock"><div class="dynheader">
This graph shows which files directly or indirectly include this file:</div>

View file

@ -1,16 +1,16 @@
<map id="PS3BT.h" name="PS3BT.h">
<area shape="rect" id="node2" href="$_b_t_d_8h.html" title="BTD.h" alt="" coords="442,75,487,96"/>
<area shape="rect" id="node21" href="$_p_s3_enums_8h.html" title="PS3Enums.h" alt="" coords="511,75,581,96"/>
<area shape="rect" id="node3" href="$_usb_8h.html" title="Usb.h" alt="" coords="590,213,633,235"/>
<area shape="rect" id="node19" href="$confdescparser_8h.html" title="confdescparser.h" alt="" coords="195,144,278,165"/>
<area shape="rect" id="node6" href="$avrpins_8h.html" title="avrpins.h" alt="" coords="879,352,933,373"/>
<area shape="rect" id="node8" href="$max3421e_8h.html" title="max3421e.h" alt="" coords="585,352,651,373"/>
<area shape="rect" id="node9" href="$usbhost_8h.html" title="usbhost.h" alt="" coords="744,283,801,304"/>
<area shape="rect" id="node10" href="$usb__ch9_8h.html" title="usb_ch9.h" alt="" coords="675,352,734,373"/>
<area shape="rect" id="node12" href="$address_8h.html" title="address.h" alt="" coords="485,283,542,304"/>
<area shape="rect" id="node15" href="$message_8h.html" title="message.h" alt="" coords="171,283,233,304"/>
<area shape="rect" id="node17" href="$printhex_8h.html" title="printhex.h" alt="" coords="153,421,210,443"/>
<area shape="rect" id="node18" href="$hexdump_8h.html" title="hexdump.h" alt="" coords="171,352,233,373"/>
<area shape="rect" id="node20" href="$parsetools_8h.html" title="parsetools.h" alt="" coords="133,213,198,235"/>
<area shape="rect" id="node22" href="$controller_enums_8h.html" title="controllerEnums.h" alt="" coords="503,144,589,165"/>
<area shape="rect" id="node2" href="$_b_t_d_8h.html" title="BTD.h" alt="" coords="458,75,504,96"/>
<area shape="rect" id="node21" href="$_p_s3_enums_8h.html" title="PS3Enums.h" alt="" coords="528,75,597,96"/>
<area shape="rect" id="node3" href="$_usb_8h.html" title="Usb.h" alt="" coords="605,213,648,235"/>
<area shape="rect" id="node19" href="$confdescparser_8h.html" title="confdescparser.h" alt="" coords="211,144,294,165"/>
<area shape="rect" id="node6" href="$avrpins_8h.html" title="avrpins.h" alt="" coords="895,352,949,373"/>
<area shape="rect" id="node8" href="$max3421e_8h.html" title="max3421e.h" alt="" coords="601,352,668,373"/>
<area shape="rect" id="node9" href="$usbhost_8h.html" title="usbhost.h" alt="" coords="759,283,816,304"/>
<area shape="rect" id="node11" href="$usb__ch9_8h.html" title="usb_ch9.h" alt="" coords="692,352,750,373"/>
<area shape="rect" id="node13" href="$address_8h.html" title="address.h" alt="" coords="500,283,557,304"/>
<area shape="rect" id="node15" href="$message_8h.html" title="message.h" alt="" coords="188,283,249,304"/>
<area shape="rect" id="node17" href="$printhex_8h.html" title="printhex.h" alt="" coords="190,421,246,443"/>
<area shape="rect" id="node18" href="$hexdump_8h.html" title="hexdump.h" alt="" coords="188,352,249,373"/>
<area shape="rect" id="node20" href="$parsetools_8h.html" title="parsetools.h" alt="" coords="150,213,214,235"/>
<area shape="rect" id="node22" href="$controller_enums_8h.html" title="controllerEnums.h" alt="" coords="519,144,605,165"/>
</map>

View file

@ -1 +1 @@
142644e07dee613f168dcc68a8cb7912
45e2d4cdf7248be76137773969f87724

Binary file not shown.

Before

Width:  |  Height:  |  Size: 81 KiB

After

Width:  |  Height:  |  Size: 86 KiB

View file

@ -179,51 +179,58 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
<div class="line"><a name="l00199"></a><span class="lineno"> 199</span>&#160; <span class="keywordtype">void</span> <a class="code" href="class_p_s3_b_t.html#ad0926b75edcbb12ddf76f78e66728782">moveSetBulb</a>(uint8_t r, uint8_t g, uint8_t b);</div>
<div class="line"><a name="l00204"></a><span class="lineno"> 204</span>&#160; <span class="keywordtype">void</span> <a class="code" href="class_p_s3_b_t.html#ad0926b75edcbb12ddf76f78e66728782">moveSetBulb</a>(<a class="code" href="_p_s3_enums_8h.html#a55ecd4f2ec2ebfe8d5b0163e4ac2a967">Colors</a> color);</div>
<div class="line"><a name="l00209"></a><span class="lineno"> 209</span>&#160; <span class="keywordtype">void</span> <a class="code" href="class_p_s3_b_t.html#ac14d338ddb573d1c06f70749f9205689">moveSetRumble</a>(uint8_t rumble);</div>
<div class="line"><a name="l00213"></a><span class="lineno"><a class="code" href="class_p_s3_b_t.html#a2804535e3164eafca80a6f6c6bd9a4f9"> 213</a></span>&#160; <span class="keywordtype">bool</span> <a class="code" href="class_p_s3_b_t.html#a2804535e3164eafca80a6f6c6bd9a4f9">PS3Connected</a>;</div>
<div class="line"><a name="l00215"></a><span class="lineno"><a class="code" href="class_p_s3_b_t.html#a9273b6796948b83772117b3805421b4a"> 215</a></span>&#160; <span class="keywordtype">bool</span> <a class="code" href="class_p_s3_b_t.html#a9273b6796948b83772117b3805421b4a">PS3MoveConnected</a>;</div>
<div class="line"><a name="l00217"></a><span class="lineno"><a class="code" href="class_p_s3_b_t.html#ab35277632083d43f8750d130bea6d430"> 217</a></span>&#160; <span class="keywordtype">bool</span> <a class="code" href="class_p_s3_b_t.html#ab35277632083d43f8750d130bea6d430">PS3NavigationConnected</a>;</div>
<div class="line"><a name="l00218"></a><span class="lineno"> 218</span>&#160;</div>
<div class="line"><a name="l00219"></a><span class="lineno"> 219</span>&#160;<span class="keyword">private</span>:</div>
<div class="line"><a name="l00220"></a><span class="lineno"> 220</span>&#160; <span class="comment">/* mandatory members */</span></div>
<div class="line"><a name="l00221"></a><span class="lineno"> 221</span>&#160; <a class="code" href="class_b_t_d.html">BTD</a> *pBtd;</div>
<div class="line"><a name="l00222"></a><span class="lineno"> 222</span>&#160;</div>
<div class="line"><a name="l00223"></a><span class="lineno"> 223</span>&#160; <span class="keywordtype">void</span> L2CAP_task(); <span class="comment">// L2CAP state machine</span></div>
<div class="line"><a name="l00224"></a><span class="lineno"> 224</span>&#160;</div>
<div class="line"><a name="l00225"></a><span class="lineno"> 225</span>&#160; <span class="comment">/* Variables filled from HCI event management */</span></div>
<div class="line"><a name="l00226"></a><span class="lineno"> 226</span>&#160; int16_t hci_handle;</div>
<div class="line"><a name="l00227"></a><span class="lineno"> 227</span>&#160; uint8_t remote_name[30]; <span class="comment">// First 30 chars of remote name</span></div>
<div class="line"><a name="l00228"></a><span class="lineno"> 228</span>&#160; <span class="keywordtype">bool</span> activeConnection; <span class="comment">// Used to indicate if it&#39;s already has established a connection</span></div>
<div class="line"><a name="l00229"></a><span class="lineno"> 229</span>&#160;</div>
<div class="line"><a name="l00230"></a><span class="lineno"> 230</span>&#160; <span class="comment">/* variables used by high level L2CAP task */</span></div>
<div class="line"><a name="l00231"></a><span class="lineno"> 231</span>&#160; uint8_t l2cap_state;</div>
<div class="line"><a name="l00232"></a><span class="lineno"> 232</span>&#160; uint16_t l2cap_event_flag; <span class="comment">// L2CAP flags of received bluetooth events</span></div>
<div class="line"><a name="l00233"></a><span class="lineno"> 233</span>&#160;</div>
<div class="line"><a name="l00234"></a><span class="lineno"> 234</span>&#160; <span class="keywordtype">unsigned</span> <span class="keywordtype">long</span> timer;</div>
<div class="line"><a name="l00235"></a><span class="lineno"> 235</span>&#160;</div>
<div class="line"><a name="l00236"></a><span class="lineno"> 236</span>&#160; uint32_t ButtonState;</div>
<div class="line"><a name="l00237"></a><span class="lineno"> 237</span>&#160; uint32_t OldButtonState;</div>
<div class="line"><a name="l00238"></a><span class="lineno"> 238</span>&#160; uint32_t ButtonClickState;</div>
<div class="line"><a name="l00239"></a><span class="lineno"> 239</span>&#160;</div>
<div class="line"><a name="l00240"></a><span class="lineno"> 240</span>&#160; uint32_t timerHID; <span class="comment">// Timer used see if there has to be a delay before a new HID command</span></div>
<div class="line"><a name="l00241"></a><span class="lineno"> 241</span>&#160; uint32_t timerBulbRumble; <span class="comment">// used to continuously set PS3 Move controller Bulb and rumble values</span></div>
<div class="line"><a name="l00242"></a><span class="lineno"> 242</span>&#160;</div>
<div class="line"><a name="l00243"></a><span class="lineno"> 243</span>&#160; uint8_t l2capinbuf[<a class="code" href="_b_t_d_8h.html#a32d591ef5742a99963130616ef146787">BULK_MAXPKTSIZE</a>]; <span class="comment">// General purpose buffer for L2CAP in data</span></div>
<div class="line"><a name="l00244"></a><span class="lineno"> 244</span>&#160; uint8_t HIDBuffer[<a class="code" href="_p_s3_b_t_8h.html#a465c4c33eae0fd5f934ae12bc8d6ca7e">HID_BUFFERSIZE</a>]; <span class="comment">// Used to store HID commands</span></div>
<div class="line"><a name="l00245"></a><span class="lineno"> 245</span>&#160; uint8_t HIDMoveBuffer[<a class="code" href="_p_s3_b_t_8h.html#a465c4c33eae0fd5f934ae12bc8d6ca7e">HID_BUFFERSIZE</a>]; <span class="comment">// Used to store HID commands for the Move controller</span></div>
<div class="line"><a name="l00246"></a><span class="lineno"> 246</span>&#160;</div>
<div class="line"><a name="l00247"></a><span class="lineno"> 247</span>&#160; <span class="comment">/* L2CAP Channels */</span></div>
<div class="line"><a name="l00248"></a><span class="lineno"> 248</span>&#160; uint8_t control_scid[2]; <span class="comment">// L2CAP source CID for HID_Control</span></div>
<div class="line"><a name="l00249"></a><span class="lineno"> 249</span>&#160; uint8_t control_dcid[2]; <span class="comment">// 0x0040</span></div>
<div class="line"><a name="l00250"></a><span class="lineno"> 250</span>&#160; uint8_t interrupt_scid[2]; <span class="comment">// L2CAP source CID for HID_Interrupt</span></div>
<div class="line"><a name="l00251"></a><span class="lineno"> 251</span>&#160; uint8_t interrupt_dcid[2]; <span class="comment">// 0x0041</span></div>
<div class="line"><a name="l00252"></a><span class="lineno"> 252</span>&#160; uint8_t identifier; <span class="comment">// Identifier for connection</span></div>
<div class="line"><a name="l00253"></a><span class="lineno"> 253</span>&#160;</div>
<div class="line"><a name="l00254"></a><span class="lineno"> 254</span>&#160; <span class="comment">/* HID Commands */</span></div>
<div class="line"><a name="l00255"></a><span class="lineno"> 255</span>&#160; <span class="keywordtype">void</span> HID_Command(uint8_t* data, uint8_t nbytes);</div>
<div class="line"><a name="l00256"></a><span class="lineno"> 256</span>&#160; <span class="keywordtype">void</span> HIDMove_Command(uint8_t* data, uint8_t nbytes);</div>
<div class="line"><a name="l00257"></a><span class="lineno"> 257</span>&#160; <span class="keywordtype">void</span> enable_sixaxis(); <span class="comment">// Command used to enable the Dualshock 3 and Navigation controller to send data via Bluetooth</span></div>
<div class="line"><a name="l00258"></a><span class="lineno"> 258</span>&#160;};</div>
<div class="line"><a name="l00259"></a><span class="lineno"> 259</span>&#160;<span class="preprocessor">#endif</span></div>
<div class="line"><a name="l00210"></a><span class="lineno"> 210</span>&#160;</div>
<div class="line"><a name="l00215"></a><span class="lineno"><a class="code" href="class_p_s3_b_t.html#a11a7a031b249e09c39aa0872fa1e4a6c"> 215</a></span>&#160; <span class="keywordtype">void</span> <a class="code" href="class_p_s3_b_t.html#a11a7a031b249e09c39aa0872fa1e4a6c">attachOnInit</a>(<span class="keywordtype">void</span> (*funcOnInit)(<span class="keywordtype">void</span>)) {</div>
<div class="line"><a name="l00216"></a><span class="lineno"> 216</span>&#160; pFuncOnInit = funcOnInit;</div>
<div class="line"><a name="l00217"></a><span class="lineno"><a class="code" href="class_p_s3_b_t.html#a2804535e3164eafca80a6f6c6bd9a4f9"> 217</a></span>&#160; };</div>
<div class="line"><a name="l00221"></a><span class="lineno"> 221</span>&#160; <span class="keywordtype">bool</span> <a class="code" href="class_p_s3_b_t.html#a2804535e3164eafca80a6f6c6bd9a4f9">PS3Connected</a>;</div>
<div class="line"><a name="l00223"></a><span class="lineno"><a class="code" href="class_p_s3_b_t.html#a9273b6796948b83772117b3805421b4a"> 223</a></span>&#160; <span class="keywordtype">bool</span> <a class="code" href="class_p_s3_b_t.html#a9273b6796948b83772117b3805421b4a">PS3MoveConnected</a>;</div>
<div class="line"><a name="l00225"></a><span class="lineno"><a class="code" href="class_p_s3_b_t.html#ab35277632083d43f8750d130bea6d430"> 225</a></span>&#160; <span class="keywordtype">bool</span> <a class="code" href="class_p_s3_b_t.html#ab35277632083d43f8750d130bea6d430">PS3NavigationConnected</a>;</div>
<div class="line"><a name="l00226"></a><span class="lineno"> 226</span>&#160;</div>
<div class="line"><a name="l00227"></a><span class="lineno"> 227</span>&#160;<span class="keyword">private</span>:</div>
<div class="line"><a name="l00228"></a><span class="lineno"> 228</span>&#160; <span class="comment">/* Mandatory members */</span></div>
<div class="line"><a name="l00229"></a><span class="lineno"> 229</span>&#160; <a class="code" href="class_b_t_d.html">BTD</a> *pBtd;</div>
<div class="line"><a name="l00230"></a><span class="lineno"> 230</span>&#160;</div>
<div class="line"><a name="l00236"></a><span class="lineno"> 236</span>&#160; <span class="keywordtype">void</span> onInit();</div>
<div class="line"><a name="l00237"></a><span class="lineno"> 237</span>&#160; void (*pFuncOnInit)(void); <span class="comment">// Pointer to function called in onInit()</span></div>
<div class="line"><a name="l00238"></a><span class="lineno"> 238</span>&#160;</div>
<div class="line"><a name="l00239"></a><span class="lineno"> 239</span>&#160; <span class="keywordtype">void</span> L2CAP_task(); <span class="comment">// L2CAP state machine</span></div>
<div class="line"><a name="l00240"></a><span class="lineno"> 240</span>&#160;</div>
<div class="line"><a name="l00241"></a><span class="lineno"> 241</span>&#160; <span class="comment">/* Variables filled from HCI event management */</span></div>
<div class="line"><a name="l00242"></a><span class="lineno"> 242</span>&#160; int16_t hci_handle;</div>
<div class="line"><a name="l00243"></a><span class="lineno"> 243</span>&#160; uint8_t remote_name[30]; <span class="comment">// First 30 chars of remote name</span></div>
<div class="line"><a name="l00244"></a><span class="lineno"> 244</span>&#160; <span class="keywordtype">bool</span> activeConnection; <span class="comment">// Used to indicate if it&#39;s already has established a connection</span></div>
<div class="line"><a name="l00245"></a><span class="lineno"> 245</span>&#160;</div>
<div class="line"><a name="l00246"></a><span class="lineno"> 246</span>&#160; <span class="comment">/* variables used by high level L2CAP task */</span></div>
<div class="line"><a name="l00247"></a><span class="lineno"> 247</span>&#160; uint8_t l2cap_state;</div>
<div class="line"><a name="l00248"></a><span class="lineno"> 248</span>&#160; uint16_t l2cap_event_flag; <span class="comment">// L2CAP flags of received Bluetooth events</span></div>
<div class="line"><a name="l00249"></a><span class="lineno"> 249</span>&#160;</div>
<div class="line"><a name="l00250"></a><span class="lineno"> 250</span>&#160; <span class="keywordtype">unsigned</span> <span class="keywordtype">long</span> timer;</div>
<div class="line"><a name="l00251"></a><span class="lineno"> 251</span>&#160;</div>
<div class="line"><a name="l00252"></a><span class="lineno"> 252</span>&#160; uint32_t ButtonState;</div>
<div class="line"><a name="l00253"></a><span class="lineno"> 253</span>&#160; uint32_t OldButtonState;</div>
<div class="line"><a name="l00254"></a><span class="lineno"> 254</span>&#160; uint32_t ButtonClickState;</div>
<div class="line"><a name="l00255"></a><span class="lineno"> 255</span>&#160;</div>
<div class="line"><a name="l00256"></a><span class="lineno"> 256</span>&#160; uint32_t timerHID; <span class="comment">// Timer used see if there has to be a delay before a new HID command</span></div>
<div class="line"><a name="l00257"></a><span class="lineno"> 257</span>&#160; uint32_t timerBulbRumble; <span class="comment">// used to continuously set PS3 Move controller Bulb and rumble values</span></div>
<div class="line"><a name="l00258"></a><span class="lineno"> 258</span>&#160;</div>
<div class="line"><a name="l00259"></a><span class="lineno"> 259</span>&#160; uint8_t l2capinbuf[<a class="code" href="_b_t_d_8h.html#a32d591ef5742a99963130616ef146787">BULK_MAXPKTSIZE</a>]; <span class="comment">// General purpose buffer for L2CAP in data</span></div>
<div class="line"><a name="l00260"></a><span class="lineno"> 260</span>&#160; uint8_t HIDBuffer[<a class="code" href="_p_s3_b_t_8h.html#a465c4c33eae0fd5f934ae12bc8d6ca7e">HID_BUFFERSIZE</a>]; <span class="comment">// Used to store HID commands</span></div>
<div class="line"><a name="l00261"></a><span class="lineno"> 261</span>&#160; uint8_t HIDMoveBuffer[<a class="code" href="_p_s3_b_t_8h.html#a465c4c33eae0fd5f934ae12bc8d6ca7e">HID_BUFFERSIZE</a>]; <span class="comment">// Used to store HID commands for the Move controller</span></div>
<div class="line"><a name="l00262"></a><span class="lineno"> 262</span>&#160;</div>
<div class="line"><a name="l00263"></a><span class="lineno"> 263</span>&#160; <span class="comment">/* L2CAP Channels */</span></div>
<div class="line"><a name="l00264"></a><span class="lineno"> 264</span>&#160; uint8_t control_scid[2]; <span class="comment">// L2CAP source CID for HID_Control</span></div>
<div class="line"><a name="l00265"></a><span class="lineno"> 265</span>&#160; uint8_t control_dcid[2]; <span class="comment">// 0x0040</span></div>
<div class="line"><a name="l00266"></a><span class="lineno"> 266</span>&#160; uint8_t interrupt_scid[2]; <span class="comment">// L2CAP source CID for HID_Interrupt</span></div>
<div class="line"><a name="l00267"></a><span class="lineno"> 267</span>&#160; uint8_t interrupt_dcid[2]; <span class="comment">// 0x0041</span></div>
<div class="line"><a name="l00268"></a><span class="lineno"> 268</span>&#160; uint8_t identifier; <span class="comment">// Identifier for connection</span></div>
<div class="line"><a name="l00269"></a><span class="lineno"> 269</span>&#160;</div>
<div class="line"><a name="l00270"></a><span class="lineno"> 270</span>&#160; <span class="comment">/* HID Commands */</span></div>
<div class="line"><a name="l00271"></a><span class="lineno"> 271</span>&#160; <span class="keywordtype">void</span> HID_Command(uint8_t* data, uint8_t nbytes);</div>
<div class="line"><a name="l00272"></a><span class="lineno"> 272</span>&#160; <span class="keywordtype">void</span> HIDMove_Command(uint8_t* data, uint8_t nbytes);</div>
<div class="line"><a name="l00273"></a><span class="lineno"> 273</span>&#160; <span class="keywordtype">void</span> enable_sixaxis(); <span class="comment">// Command used to enable the Dualshock 3 and Navigation controller to send data via Bluetooth</span></div>
<div class="line"><a name="l00274"></a><span class="lineno"> 274</span>&#160;};</div>
<div class="line"><a name="l00275"></a><span class="lineno"> 275</span>&#160;<span class="preprocessor">#endif</span></div>
</div><!-- fragment --></div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>

View file

@ -95,7 +95,7 @@ Include dependency graph for PS3USB.cpp:</div>
<div class="dyncontent">
<div class="center"><img src="_p_s3_u_s_b_8cpp__incl.png" border="0" usemap="#_p_s3_u_s_b_8cpp" alt=""/></div>
<map name="_p_s3_u_s_b_8cpp" id="_p_s3_u_s_b_8cpp">
<area shape="rect" id="node2" href="_p_s3_u_s_b_8h.html" title="PS3USB.h" alt="" coords="349,75,408,96"/><area shape="rect" id="node4" href="_usb_8h.html" title="Usb.h" alt="" coords="357,144,400,165"/><area shape="rect" id="node19" href="_p_s3_enums_8h.html" title="PS3Enums.h" alt="" coords="580,144,649,165"/><area shape="rect" id="node7" href="avrpins_8h.html" title="avrpins.h" alt="" coords="43,283,97,304"/><area shape="rect" id="node9" href="max3421e_8h.html" title="max3421e.h" alt="" coords="275,283,341,304"/><area shape="rect" id="node10" href="usbhost_8h.html" title="usbhost.h" alt="" coords="199,213,256,235"/><area shape="rect" id="node11" href="usb__ch9_8h.html" title="usb_ch9.h" alt="" coords="123,283,181,304"/><area shape="rect" id="node13" href="address_8h.html" title="address.h" alt="" coords="350,213,407,235"/><area shape="rect" id="node15" href="message_8h.html" title="message.h" alt="" coords="643,213,704,235"/><area shape="rect" id="node17" href="printhex_8h.html" title="printhex.h" alt="" coords="746,352,803,373"/><area shape="rect" id="node18" href="hexdump_8h.html" title="hexdump.h" alt="" coords="643,283,704,304"/><area shape="rect" id="node20" href="controller_enums_8h.html" title="controllerEnums.h" alt="" coords="729,213,815,235"/></map>
<area shape="rect" id="node2" href="_p_s3_u_s_b_8h.html" title="PS3USB.h" alt="" coords="411,75,471,96"/><area shape="rect" id="node4" href="_usb_8h.html" title="Usb.h" alt="" coords="420,144,463,165"/><area shape="rect" id="node19" href="_p_s3_enums_8h.html" title="PS3Enums.h" alt="" coords="725,144,795,165"/><area shape="rect" id="node7" href="avrpins_8h.html" title="avrpins.h" alt="" coords="43,283,97,304"/><area shape="rect" id="node9" href="max3421e_8h.html" title="max3421e.h" alt="" coords="325,283,392,304"/><area shape="rect" id="node10" href="usbhost_8h.html" title="usbhost.h" alt="" coords="186,213,243,235"/><area shape="rect" id="node11" href="usb__ch9_8h.html" title="usb_ch9.h" alt="" coords="243,283,301,304"/><area shape="rect" id="node13" href="address_8h.html" title="address.h" alt="" coords="413,213,469,235"/><area shape="rect" id="node15" href="message_8h.html" title="message.h" alt="" coords="659,213,720,235"/><area shape="rect" id="node17" href="printhex_8h.html" title="printhex.h" alt="" coords="627,352,684,373"/><area shape="rect" id="node18" href="hexdump_8h.html" title="hexdump.h" alt="" coords="693,283,755,304"/><area shape="rect" id="node20" href="controller_enums_8h.html" title="controllerEnums.h" alt="" coords="955,213,1041,235"/></map>
</div>
</div>
<p><a href="_p_s3_u_s_b_8cpp_source.html">Go to the source code of this file.</a></p>

View file

@ -1,14 +1,14 @@
<map id="PS3USB.cpp" name="PS3USB.cpp">
<area shape="rect" id="node2" href="$_p_s3_u_s_b_8h.html" title="PS3USB.h" alt="" coords="349,75,408,96"/>
<area shape="rect" id="node4" href="$_usb_8h.html" title="Usb.h" alt="" coords="357,144,400,165"/>
<area shape="rect" id="node19" href="$_p_s3_enums_8h.html" title="PS3Enums.h" alt="" coords="580,144,649,165"/>
<area shape="rect" id="node2" href="$_p_s3_u_s_b_8h.html" title="PS3USB.h" alt="" coords="411,75,471,96"/>
<area shape="rect" id="node4" href="$_usb_8h.html" title="Usb.h" alt="" coords="420,144,463,165"/>
<area shape="rect" id="node19" href="$_p_s3_enums_8h.html" title="PS3Enums.h" alt="" coords="725,144,795,165"/>
<area shape="rect" id="node7" href="$avrpins_8h.html" title="avrpins.h" alt="" coords="43,283,97,304"/>
<area shape="rect" id="node9" href="$max3421e_8h.html" title="max3421e.h" alt="" coords="275,283,341,304"/>
<area shape="rect" id="node10" href="$usbhost_8h.html" title="usbhost.h" alt="" coords="199,213,256,235"/>
<area shape="rect" id="node11" href="$usb__ch9_8h.html" title="usb_ch9.h" alt="" coords="123,283,181,304"/>
<area shape="rect" id="node13" href="$address_8h.html" title="address.h" alt="" coords="350,213,407,235"/>
<area shape="rect" id="node15" href="$message_8h.html" title="message.h" alt="" coords="643,213,704,235"/>
<area shape="rect" id="node17" href="$printhex_8h.html" title="printhex.h" alt="" coords="746,352,803,373"/>
<area shape="rect" id="node18" href="$hexdump_8h.html" title="hexdump.h" alt="" coords="643,283,704,304"/>
<area shape="rect" id="node20" href="$controller_enums_8h.html" title="controllerEnums.h" alt="" coords="729,213,815,235"/>
<area shape="rect" id="node9" href="$max3421e_8h.html" title="max3421e.h" alt="" coords="325,283,392,304"/>
<area shape="rect" id="node10" href="$usbhost_8h.html" title="usbhost.h" alt="" coords="186,213,243,235"/>
<area shape="rect" id="node11" href="$usb__ch9_8h.html" title="usb_ch9.h" alt="" coords="243,283,301,304"/>
<area shape="rect" id="node13" href="$address_8h.html" title="address.h" alt="" coords="413,213,469,235"/>
<area shape="rect" id="node15" href="$message_8h.html" title="message.h" alt="" coords="659,213,720,235"/>
<area shape="rect" id="node17" href="$printhex_8h.html" title="printhex.h" alt="" coords="627,352,684,373"/>
<area shape="rect" id="node18" href="$hexdump_8h.html" title="hexdump.h" alt="" coords="693,283,755,304"/>
<area shape="rect" id="node20" href="$controller_enums_8h.html" title="controllerEnums.h" alt="" coords="955,213,1041,235"/>
</map>

View file

@ -1 +1 @@
f5ae29b491763e0d6c2c12dc912b90be
940a938e101921693d8ab2fbeb381a38

Binary file not shown.

Before

Width:  |  Height:  |  Size: 62 KiB

After

Width:  |  Height:  |  Size: 68 KiB

View file

@ -145,12 +145,12 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
<div class="line"><a name="l00054"></a><span class="lineno"> 54</span>&#160; <span class="comment">// get memory address of USB device address pool</span></div>
<div class="line"><a name="l00055"></a><span class="lineno"> 55</span>&#160; <a class="code" href="class_address_pool.html">AddressPool</a> &amp;addrPool = <a class="code" href="class_p_s3_u_s_b.html#aa1873f41ae0da7c4568cfb7517560c48">pUsb</a>-&gt;<a class="code" href="class_u_s_b.html#a66ab8f5eda239e761d5a48741ea1f9d4">GetAddressPool</a>();</div>
<div class="line"><a name="l00056"></a><span class="lineno"> 56</span>&#160;<span class="preprocessor">#ifdef EXTRADEBUG</span></div>
<div class="line"><a name="l00057"></a><span class="lineno"> 57</span>&#160;<span class="preprocessor"></span> <a class="code" href="message_8h.html#a747819b0aa34f5c3ba0332c2db28c846">Notify</a>(PSTR(<span class="stringliteral">&quot;\r\nPS3USB Init&quot;</span>), 0x80);</div>
<div class="line"><a name="l00057"></a><span class="lineno"> 57</span>&#160;<span class="preprocessor"></span> <a class="code" href="message_8h.html#a27117e124c5d66d5512fe8d494fe6338">Notify</a>(PSTR(<span class="stringliteral">&quot;\r\nPS3USB Init&quot;</span>), 0x80);</div>
<div class="line"><a name="l00058"></a><span class="lineno"> 58</span>&#160;<span class="preprocessor">#endif</span></div>
<div class="line"><a name="l00059"></a><span class="lineno"> 59</span>&#160;<span class="preprocessor"></span> <span class="comment">// check if address has already been assigned to an instance</span></div>
<div class="line"><a name="l00060"></a><span class="lineno"> 60</span>&#160; <span class="keywordflow">if</span> (<a class="code" href="class_p_s3_u_s_b.html#a3f43df159277003acdf7dd107bda27fd">bAddress</a>) {</div>
<div class="line"><a name="l00061"></a><span class="lineno"> 61</span>&#160;<span class="preprocessor">#ifdef DEBUG_USB_HOST</span></div>
<div class="line"><a name="l00062"></a><span class="lineno"> 62</span>&#160;<span class="preprocessor"></span> <a class="code" href="message_8h.html#a747819b0aa34f5c3ba0332c2db28c846">Notify</a>(PSTR(<span class="stringliteral">&quot;\r\nAddress in use&quot;</span>), 0x80);</div>
<div class="line"><a name="l00062"></a><span class="lineno"> 62</span>&#160;<span class="preprocessor"></span> <a class="code" href="message_8h.html#a27117e124c5d66d5512fe8d494fe6338">Notify</a>(PSTR(<span class="stringliteral">&quot;\r\nAddress in use&quot;</span>), 0x80);</div>
<div class="line"><a name="l00063"></a><span class="lineno"> 63</span>&#160;<span class="preprocessor">#endif</span></div>
<div class="line"><a name="l00064"></a><span class="lineno"> 64</span>&#160;<span class="preprocessor"></span> <span class="keywordflow">return</span> <a class="code" href="_usb_8h.html#a44416ff64fc0e3691f98addac13d4595">USB_ERROR_CLASS_INSTANCE_ALREADY_IN_USE</a>;</div>
<div class="line"><a name="l00065"></a><span class="lineno"> 65</span>&#160; }</div>
@ -160,14 +160,14 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
<div class="line"><a name="l00069"></a><span class="lineno"> 69</span>&#160;</div>
<div class="line"><a name="l00070"></a><span class="lineno"> 70</span>&#160; <span class="keywordflow">if</span> (!p) {</div>
<div class="line"><a name="l00071"></a><span class="lineno"> 71</span>&#160;<span class="preprocessor">#ifdef DEBUG_USB_HOST</span></div>
<div class="line"><a name="l00072"></a><span class="lineno"> 72</span>&#160;<span class="preprocessor"></span> <a class="code" href="message_8h.html#a747819b0aa34f5c3ba0332c2db28c846">Notify</a>(PSTR(<span class="stringliteral">&quot;\r\nAddress not found&quot;</span>), 0x80);</div>
<div class="line"><a name="l00072"></a><span class="lineno"> 72</span>&#160;<span class="preprocessor"></span> <a class="code" href="message_8h.html#a27117e124c5d66d5512fe8d494fe6338">Notify</a>(PSTR(<span class="stringliteral">&quot;\r\nAddress not found&quot;</span>), 0x80);</div>
<div class="line"><a name="l00073"></a><span class="lineno"> 73</span>&#160;<span class="preprocessor">#endif</span></div>
<div class="line"><a name="l00074"></a><span class="lineno"> 74</span>&#160;<span class="preprocessor"></span> <span class="keywordflow">return</span> <a class="code" href="_usb_8h.html#afe2fedb4b0ccc89a688c0b4b59691ce0">USB_ERROR_ADDRESS_NOT_FOUND_IN_POOL</a>;</div>
<div class="line"><a name="l00075"></a><span class="lineno"> 75</span>&#160; }</div>
<div class="line"><a name="l00076"></a><span class="lineno"> 76</span>&#160;</div>
<div class="line"><a name="l00077"></a><span class="lineno"> 77</span>&#160; <span class="keywordflow">if</span> (!p-&gt;<a class="code" href="struct_usb_device.html#a410d39fb7758157f57794335e990ed02">epinfo</a>) {</div>
<div class="line"><a name="l00078"></a><span class="lineno"> 78</span>&#160;<span class="preprocessor">#ifdef DEBUG_USB_HOST</span></div>
<div class="line"><a name="l00079"></a><span class="lineno"> 79</span>&#160;<span class="preprocessor"></span> <a class="code" href="message_8h.html#a747819b0aa34f5c3ba0332c2db28c846">Notify</a>(PSTR(<span class="stringliteral">&quot;\r\nepinfo is null&quot;</span>), 0x80);</div>
<div class="line"><a name="l00079"></a><span class="lineno"> 79</span>&#160;<span class="preprocessor"></span> <a class="code" href="message_8h.html#a27117e124c5d66d5512fe8d494fe6338">Notify</a>(PSTR(<span class="stringliteral">&quot;\r\nepinfo is null&quot;</span>), 0x80);</div>
<div class="line"><a name="l00080"></a><span class="lineno"> 80</span>&#160;<span class="preprocessor">#endif</span></div>
<div class="line"><a name="l00081"></a><span class="lineno"> 81</span>&#160;<span class="preprocessor"></span> <span class="keywordflow">return</span> <a class="code" href="_usb_8h.html#af192c59cafe2192ad802b22e6dbc077d">USB_ERROR_EPINFO_IS_NULL</a>;</div>
<div class="line"><a name="l00082"></a><span class="lineno"> 82</span>&#160; }</div>
@ -210,425 +210,439 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
<div class="line"><a name="l00119"></a><span class="lineno"> 119</span>&#160; addrPool.<a class="code" href="class_address_pool.html#a15fde13223dcb1da89305ad229763562">FreeAddress</a>(<a class="code" href="class_p_s3_u_s_b.html#a3f43df159277003acdf7dd107bda27fd">bAddress</a>);</div>
<div class="line"><a name="l00120"></a><span class="lineno"> 120</span>&#160; <a class="code" href="class_p_s3_u_s_b.html#a3f43df159277003acdf7dd107bda27fd">bAddress</a> = 0;</div>
<div class="line"><a name="l00121"></a><span class="lineno"> 121</span>&#160;<span class="preprocessor">#ifdef DEBUG_USB_HOST</span></div>
<div class="line"><a name="l00122"></a><span class="lineno"> 122</span>&#160;<span class="preprocessor"></span> <a class="code" href="message_8h.html#a747819b0aa34f5c3ba0332c2db28c846">Notify</a>(PSTR(<span class="stringliteral">&quot;\r\nsetAddr: &quot;</span>), 0x80);</div>
<div class="line"><a name="l00123"></a><span class="lineno"> 123</span>&#160;<span class="preprocessor">#endif</span></div>
<div class="line"><a name="l00124"></a><span class="lineno"> 124</span>&#160;<span class="preprocessor"></span> D_PrintHex&lt;uint8_t &gt; (rcode, 0x80);</div>
<div class="line"><a name="l00125"></a><span class="lineno"> 125</span>&#160; <span class="keywordflow">return</span> rcode;</div>
<div class="line"><a name="l00122"></a><span class="lineno"> 122</span>&#160;<span class="preprocessor"></span> <a class="code" href="message_8h.html#a27117e124c5d66d5512fe8d494fe6338">Notify</a>(PSTR(<span class="stringliteral">&quot;\r\nsetAddr: &quot;</span>), 0x80);</div>
<div class="line"><a name="l00123"></a><span class="lineno"> 123</span>&#160; D_PrintHex&lt;uint8_t &gt; (rcode, 0x80);</div>
<div class="line"><a name="l00124"></a><span class="lineno"> 124</span>&#160;<span class="preprocessor">#endif</span></div>
<div class="line"><a name="l00125"></a><span class="lineno"> 125</span>&#160;<span class="preprocessor"></span> <span class="keywordflow">return</span> rcode;</div>
<div class="line"><a name="l00126"></a><span class="lineno"> 126</span>&#160; }</div>
<div class="line"><a name="l00127"></a><span class="lineno"> 127</span>&#160;<span class="preprocessor">#ifdef EXTRADEBUG</span></div>
<div class="line"><a name="l00128"></a><span class="lineno"> 128</span>&#160;<span class="preprocessor"></span> <a class="code" href="message_8h.html#a747819b0aa34f5c3ba0332c2db28c846">Notify</a>(PSTR(<span class="stringliteral">&quot;\r\nAddr: &quot;</span>), 0x80);</div>
<div class="line"><a name="l00128"></a><span class="lineno"> 128</span>&#160;<span class="preprocessor"></span> <a class="code" href="message_8h.html#a27117e124c5d66d5512fe8d494fe6338">Notify</a>(PSTR(<span class="stringliteral">&quot;\r\nAddr: &quot;</span>), 0x80);</div>
<div class="line"><a name="l00129"></a><span class="lineno"> 129</span>&#160; D_PrintHex&lt;uint8_t &gt; (<a class="code" href="class_p_s3_u_s_b.html#a3f43df159277003acdf7dd107bda27fd">bAddress</a>, 0x80);</div>
<div class="line"><a name="l00130"></a><span class="lineno"> 130</span>&#160;<span class="preprocessor">#endif</span></div>
<div class="line"><a name="l00131"></a><span class="lineno"> 131</span>&#160;<span class="preprocessor"></span> p-&gt;<a class="code" href="struct_usb_device.html#a86a815577ad7883437d3ca72b32b8e8a">lowspeed</a> = <span class="keyword">false</span>;</div>
<div class="line"><a name="l00132"></a><span class="lineno"> 132</span>&#160;</div>
<div class="line"><a name="l00133"></a><span class="lineno"> 133</span>&#160; <span class="comment">//get pointer to assigned address record</span></div>
<div class="line"><a name="l00134"></a><span class="lineno"> 134</span>&#160; p = addrPool.<a class="code" href="class_address_pool.html#aa92d7e8f0f515340ae2dc1679b627056">GetUsbDevicePtr</a>(bAddress);</div>
<div class="line"><a name="l00135"></a><span class="lineno"> 135</span>&#160; <span class="keywordflow">if</span> (!p)</div>
<div class="line"><a name="l00136"></a><span class="lineno"> 136</span>&#160; <span class="keywordflow">return</span> <a class="code" href="_usb_8h.html#afe2fedb4b0ccc89a688c0b4b59691ce0">USB_ERROR_ADDRESS_NOT_FOUND_IN_POOL</a>;</div>
<div class="line"><a name="l00137"></a><span class="lineno"> 137</span>&#160;</div>
<div class="line"><a name="l00138"></a><span class="lineno"> 138</span>&#160; p-&gt;<a class="code" href="struct_usb_device.html#a86a815577ad7883437d3ca72b32b8e8a">lowspeed</a> = lowspeed;</div>
<div class="line"><a name="l00131"></a><span class="lineno"> 131</span>&#160;<span class="preprocessor"></span> delay(300); <span class="comment">// Spec says you should wait at least 200ms</span></div>
<div class="line"><a name="l00132"></a><span class="lineno"> 132</span>&#160; </div>
<div class="line"><a name="l00133"></a><span class="lineno"> 133</span>&#160; p-&gt;<a class="code" href="struct_usb_device.html#a86a815577ad7883437d3ca72b32b8e8a">lowspeed</a> = <span class="keyword">false</span>;</div>
<div class="line"><a name="l00134"></a><span class="lineno"> 134</span>&#160;</div>
<div class="line"><a name="l00135"></a><span class="lineno"> 135</span>&#160; <span class="comment">//get pointer to assigned address record</span></div>
<div class="line"><a name="l00136"></a><span class="lineno"> 136</span>&#160; p = addrPool.<a class="code" href="class_address_pool.html#aa92d7e8f0f515340ae2dc1679b627056">GetUsbDevicePtr</a>(bAddress);</div>
<div class="line"><a name="l00137"></a><span class="lineno"> 137</span>&#160; <span class="keywordflow">if</span> (!p)</div>
<div class="line"><a name="l00138"></a><span class="lineno"> 138</span>&#160; <span class="keywordflow">return</span> <a class="code" href="_usb_8h.html#afe2fedb4b0ccc89a688c0b4b59691ce0">USB_ERROR_ADDRESS_NOT_FOUND_IN_POOL</a>;</div>
<div class="line"><a name="l00139"></a><span class="lineno"> 139</span>&#160;</div>
<div class="line"><a name="l00140"></a><span class="lineno"> 140</span>&#160; <span class="comment">// Assign epInfo to epinfo pointer - only EP0 is known</span></div>
<div class="line"><a name="l00141"></a><span class="lineno"> 141</span>&#160; rcode = <a class="code" href="class_p_s3_u_s_b.html#aa1873f41ae0da7c4568cfb7517560c48">pUsb</a>-&gt;<a class="code" href="class_u_s_b.html#a6c3ba3f7e6dccb450267011ce783d7ea">setEpInfoEntry</a>(bAddress, 1, <a class="code" href="class_p_s3_u_s_b.html#a394dbb0a59b587210e5958f08dac48f1">epInfo</a>);</div>
<div class="line"><a name="l00142"></a><span class="lineno"> 142</span>&#160; <span class="keywordflow">if</span> (rcode)</div>
<div class="line"><a name="l00143"></a><span class="lineno"> 143</span>&#160; <span class="keywordflow">goto</span> FailSetDevTblEntry;</div>
<div class="line"><a name="l00144"></a><span class="lineno"> 144</span>&#160;</div>
<div class="line"><a name="l00145"></a><span class="lineno"> 145</span>&#160;</div>
<div class="line"><a name="l00146"></a><span class="lineno"> 146</span>&#160; <span class="comment">/* The application will work in reduced host mode, so we can save program and data</span></div>
<div class="line"><a name="l00147"></a><span class="lineno"> 147</span>&#160;<span class="comment"> memory space. After verifying the PID and VID we will use known values for the</span></div>
<div class="line"><a name="l00148"></a><span class="lineno"> 148</span>&#160;<span class="comment"> configuration values for device, interface, endpoints and HID for the PS3 Controllers */</span></div>
<div class="line"><a name="l00149"></a><span class="lineno"> 149</span>&#160;</div>
<div class="line"><a name="l00150"></a><span class="lineno"> 150</span>&#160; <span class="comment">/* Initialize data structures for endpoints of device */</span></div>
<div class="line"><a name="l00151"></a><span class="lineno"> 151</span>&#160; <a class="code" href="class_p_s3_u_s_b.html#a394dbb0a59b587210e5958f08dac48f1">epInfo</a>[ <a class="code" href="_p_s3_u_s_b_8h.html#a0da271fcb10181b3ce15aefe76c259bb">PS3_OUTPUT_PIPE</a> ].<a class="code" href="struct_ep_info.html#a9f92be74c75c037b39e2cae1eb49b89b">epAddr</a> = 0x02; <span class="comment">// PS3 output endpoint</span></div>
<div class="line"><a name="l00152"></a><span class="lineno"> 152</span>&#160; <a class="code" href="class_p_s3_u_s_b.html#a394dbb0a59b587210e5958f08dac48f1">epInfo</a>[ <a class="code" href="_p_s3_u_s_b_8h.html#a0da271fcb10181b3ce15aefe76c259bb">PS3_OUTPUT_PIPE</a> ].<a class="code" href="struct_ep_info.html#a1dea928517c961235eef7b0876e69f10">epAttribs</a> = <a class="code" href="_p_s3_u_s_b_8h.html#ad4d26e1c566064f2259faf65f0858b6e">EP_INTERRUPT</a>;</div>
<div class="line"><a name="l00153"></a><span class="lineno"> 153</span>&#160; <a class="code" href="class_p_s3_u_s_b.html#a394dbb0a59b587210e5958f08dac48f1">epInfo</a>[ <a class="code" href="_p_s3_u_s_b_8h.html#a0da271fcb10181b3ce15aefe76c259bb">PS3_OUTPUT_PIPE</a> ].<a class="code" href="struct_ep_info.html#a3a5b1c017a034cd9e06e76729e727c46">bmNakPower</a> = <a class="code" href="address_8h.html#a660e8da9c1167a8450aef91c5c03761d">USB_NAK_NOWAIT</a>; <span class="comment">// Only poll once for interrupt endpoints</span></div>
<div class="line"><a name="l00154"></a><span class="lineno"> 154</span>&#160; <a class="code" href="class_p_s3_u_s_b.html#a394dbb0a59b587210e5958f08dac48f1">epInfo</a>[ <a class="code" href="_p_s3_u_s_b_8h.html#a0da271fcb10181b3ce15aefe76c259bb">PS3_OUTPUT_PIPE</a> ].<a class="code" href="struct_ep_info.html#aa2ca775b63736df4008e88da7dd4dddb">maxPktSize</a> = <a class="code" href="_p_s3_u_s_b_8h.html#abcb805b13bfd36145e252b0633bbcfc0">EP_MAXPKTSIZE</a>;</div>
<div class="line"><a name="l00155"></a><span class="lineno"> 155</span>&#160; <a class="code" href="class_p_s3_u_s_b.html#a394dbb0a59b587210e5958f08dac48f1">epInfo</a>[ <a class="code" href="_p_s3_u_s_b_8h.html#a0da271fcb10181b3ce15aefe76c259bb">PS3_OUTPUT_PIPE</a> ].<a class="code" href="struct_ep_info.html#ac85bff70ad0e5d71e50cb501f4d8caf3">bmSndToggle</a> = <a class="code" href="max3421e_8h.html#a4834ae7378471b63b9a1985c6294006f">bmSNDTOG0</a>;</div>
<div class="line"><a name="l00156"></a><span class="lineno"> 156</span>&#160; <a class="code" href="class_p_s3_u_s_b.html#a394dbb0a59b587210e5958f08dac48f1">epInfo</a>[ <a class="code" href="_p_s3_u_s_b_8h.html#a0da271fcb10181b3ce15aefe76c259bb">PS3_OUTPUT_PIPE</a> ].<a class="code" href="struct_ep_info.html#a9238dd40c096baedf041c98b19386a14">bmRcvToggle</a> = <a class="code" href="max3421e_8h.html#aca6a8aa4f0aebbe07c5e175572a92ef7">bmRCVTOG0</a>;</div>
<div class="line"><a name="l00157"></a><span class="lineno"> 157</span>&#160; <a class="code" href="class_p_s3_u_s_b.html#a394dbb0a59b587210e5958f08dac48f1">epInfo</a>[ <a class="code" href="_p_s3_u_s_b_8h.html#aca3cbaad8732d9185bb9bda1a32cd18d">PS3_INPUT_PIPE</a> ].<a class="code" href="struct_ep_info.html#a9f92be74c75c037b39e2cae1eb49b89b">epAddr</a> = 0x01; <span class="comment">// PS3 report endpoint</span></div>
<div class="line"><a name="l00158"></a><span class="lineno"> 158</span>&#160; <a class="code" href="class_p_s3_u_s_b.html#a394dbb0a59b587210e5958f08dac48f1">epInfo</a>[ <a class="code" href="_p_s3_u_s_b_8h.html#aca3cbaad8732d9185bb9bda1a32cd18d">PS3_INPUT_PIPE</a> ].<a class="code" href="struct_ep_info.html#a1dea928517c961235eef7b0876e69f10">epAttribs</a> = <a class="code" href="_p_s3_u_s_b_8h.html#ad4d26e1c566064f2259faf65f0858b6e">EP_INTERRUPT</a>;</div>
<div class="line"><a name="l00159"></a><span class="lineno"> 159</span>&#160; <a class="code" href="class_p_s3_u_s_b.html#a394dbb0a59b587210e5958f08dac48f1">epInfo</a>[ <a class="code" href="_p_s3_u_s_b_8h.html#aca3cbaad8732d9185bb9bda1a32cd18d">PS3_INPUT_PIPE</a> ].<a class="code" href="struct_ep_info.html#a3a5b1c017a034cd9e06e76729e727c46">bmNakPower</a> = <a class="code" href="address_8h.html#a660e8da9c1167a8450aef91c5c03761d">USB_NAK_NOWAIT</a>; <span class="comment">// Only poll once for interrupt endpoints</span></div>
<div class="line"><a name="l00160"></a><span class="lineno"> 160</span>&#160; <a class="code" href="class_p_s3_u_s_b.html#a394dbb0a59b587210e5958f08dac48f1">epInfo</a>[ <a class="code" href="_p_s3_u_s_b_8h.html#aca3cbaad8732d9185bb9bda1a32cd18d">PS3_INPUT_PIPE</a> ].<a class="code" href="struct_ep_info.html#aa2ca775b63736df4008e88da7dd4dddb">maxPktSize</a> = <a class="code" href="_p_s3_u_s_b_8h.html#abcb805b13bfd36145e252b0633bbcfc0">EP_MAXPKTSIZE</a>;</div>
<div class="line"><a name="l00161"></a><span class="lineno"> 161</span>&#160; <a class="code" href="class_p_s3_u_s_b.html#a394dbb0a59b587210e5958f08dac48f1">epInfo</a>[ <a class="code" href="_p_s3_u_s_b_8h.html#aca3cbaad8732d9185bb9bda1a32cd18d">PS3_INPUT_PIPE</a> ].<a class="code" href="struct_ep_info.html#ac85bff70ad0e5d71e50cb501f4d8caf3">bmSndToggle</a> = <a class="code" href="max3421e_8h.html#a4834ae7378471b63b9a1985c6294006f">bmSNDTOG0</a>;</div>
<div class="line"><a name="l00162"></a><span class="lineno"> 162</span>&#160; <a class="code" href="class_p_s3_u_s_b.html#a394dbb0a59b587210e5958f08dac48f1">epInfo</a>[ <a class="code" href="_p_s3_u_s_b_8h.html#aca3cbaad8732d9185bb9bda1a32cd18d">PS3_INPUT_PIPE</a> ].<a class="code" href="struct_ep_info.html#a9238dd40c096baedf041c98b19386a14">bmRcvToggle</a> = <a class="code" href="max3421e_8h.html#aca6a8aa4f0aebbe07c5e175572a92ef7">bmRCVTOG0</a>;</div>
<div class="line"><a name="l00163"></a><span class="lineno"> 163</span>&#160;</div>
<div class="line"><a name="l00164"></a><span class="lineno"> 164</span>&#160; rcode = <a class="code" href="class_p_s3_u_s_b.html#aa1873f41ae0da7c4568cfb7517560c48">pUsb</a>-&gt;<a class="code" href="class_u_s_b.html#a6c3ba3f7e6dccb450267011ce783d7ea">setEpInfoEntry</a>(bAddress, 3, <a class="code" href="class_p_s3_u_s_b.html#a394dbb0a59b587210e5958f08dac48f1">epInfo</a>);</div>
<div class="line"><a name="l00165"></a><span class="lineno"> 165</span>&#160; <span class="keywordflow">if</span> (rcode)</div>
<div class="line"><a name="l00166"></a><span class="lineno"> 166</span>&#160; <span class="keywordflow">goto</span> FailSetDevTblEntry;</div>
<div class="line"><a name="l00167"></a><span class="lineno"> 167</span>&#160;</div>
<div class="line"><a name="l00168"></a><span class="lineno"> 168</span>&#160; delay(200); <span class="comment">//Give time for address change</span></div>
<div class="line"><a name="l00140"></a><span class="lineno"> 140</span>&#160; p-&gt;<a class="code" href="struct_usb_device.html#a86a815577ad7883437d3ca72b32b8e8a">lowspeed</a> = lowspeed;</div>
<div class="line"><a name="l00141"></a><span class="lineno"> 141</span>&#160;</div>
<div class="line"><a name="l00142"></a><span class="lineno"> 142</span>&#160; <span class="comment">// Assign epInfo to epinfo pointer - only EP0 is known</span></div>
<div class="line"><a name="l00143"></a><span class="lineno"> 143</span>&#160; rcode = <a class="code" href="class_p_s3_u_s_b.html#aa1873f41ae0da7c4568cfb7517560c48">pUsb</a>-&gt;<a class="code" href="class_u_s_b.html#a6c3ba3f7e6dccb450267011ce783d7ea">setEpInfoEntry</a>(bAddress, 1, <a class="code" href="class_p_s3_u_s_b.html#a394dbb0a59b587210e5958f08dac48f1">epInfo</a>);</div>
<div class="line"><a name="l00144"></a><span class="lineno"> 144</span>&#160; <span class="keywordflow">if</span> (rcode)</div>
<div class="line"><a name="l00145"></a><span class="lineno"> 145</span>&#160; <span class="keywordflow">goto</span> FailSetDevTblEntry;</div>
<div class="line"><a name="l00146"></a><span class="lineno"> 146</span>&#160;</div>
<div class="line"><a name="l00147"></a><span class="lineno"> 147</span>&#160;</div>
<div class="line"><a name="l00148"></a><span class="lineno"> 148</span>&#160; <span class="comment">/* The application will work in reduced host mode, so we can save program and data</span></div>
<div class="line"><a name="l00149"></a><span class="lineno"> 149</span>&#160;<span class="comment"> memory space. After verifying the PID and VID we will use known values for the</span></div>
<div class="line"><a name="l00150"></a><span class="lineno"> 150</span>&#160;<span class="comment"> configuration values for device, interface, endpoints and HID for the PS3 Controllers */</span></div>
<div class="line"><a name="l00151"></a><span class="lineno"> 151</span>&#160;</div>
<div class="line"><a name="l00152"></a><span class="lineno"> 152</span>&#160; <span class="comment">/* Initialize data structures for endpoints of device */</span></div>
<div class="line"><a name="l00153"></a><span class="lineno"> 153</span>&#160; <a class="code" href="class_p_s3_u_s_b.html#a394dbb0a59b587210e5958f08dac48f1">epInfo</a>[ <a class="code" href="_p_s3_u_s_b_8h.html#a0da271fcb10181b3ce15aefe76c259bb">PS3_OUTPUT_PIPE</a> ].<a class="code" href="struct_ep_info.html#a9f92be74c75c037b39e2cae1eb49b89b">epAddr</a> = 0x02; <span class="comment">// PS3 output endpoint</span></div>
<div class="line"><a name="l00154"></a><span class="lineno"> 154</span>&#160; <a class="code" href="class_p_s3_u_s_b.html#a394dbb0a59b587210e5958f08dac48f1">epInfo</a>[ <a class="code" href="_p_s3_u_s_b_8h.html#a0da271fcb10181b3ce15aefe76c259bb">PS3_OUTPUT_PIPE</a> ].<a class="code" href="struct_ep_info.html#a1dea928517c961235eef7b0876e69f10">epAttribs</a> = <a class="code" href="_p_s3_u_s_b_8h.html#ad4d26e1c566064f2259faf65f0858b6e">EP_INTERRUPT</a>;</div>
<div class="line"><a name="l00155"></a><span class="lineno"> 155</span>&#160; <a class="code" href="class_p_s3_u_s_b.html#a394dbb0a59b587210e5958f08dac48f1">epInfo</a>[ <a class="code" href="_p_s3_u_s_b_8h.html#a0da271fcb10181b3ce15aefe76c259bb">PS3_OUTPUT_PIPE</a> ].<a class="code" href="struct_ep_info.html#a3a5b1c017a034cd9e06e76729e727c46">bmNakPower</a> = <a class="code" href="address_8h.html#a660e8da9c1167a8450aef91c5c03761d">USB_NAK_NOWAIT</a>; <span class="comment">// Only poll once for interrupt endpoints</span></div>
<div class="line"><a name="l00156"></a><span class="lineno"> 156</span>&#160; <a class="code" href="class_p_s3_u_s_b.html#a394dbb0a59b587210e5958f08dac48f1">epInfo</a>[ <a class="code" href="_p_s3_u_s_b_8h.html#a0da271fcb10181b3ce15aefe76c259bb">PS3_OUTPUT_PIPE</a> ].<a class="code" href="struct_ep_info.html#aa2ca775b63736df4008e88da7dd4dddb">maxPktSize</a> = <a class="code" href="_p_s3_u_s_b_8h.html#abcb805b13bfd36145e252b0633bbcfc0">EP_MAXPKTSIZE</a>;</div>
<div class="line"><a name="l00157"></a><span class="lineno"> 157</span>&#160; <a class="code" href="class_p_s3_u_s_b.html#a394dbb0a59b587210e5958f08dac48f1">epInfo</a>[ <a class="code" href="_p_s3_u_s_b_8h.html#a0da271fcb10181b3ce15aefe76c259bb">PS3_OUTPUT_PIPE</a> ].<a class="code" href="struct_ep_info.html#ac85bff70ad0e5d71e50cb501f4d8caf3">bmSndToggle</a> = <a class="code" href="max3421e_8h.html#a4834ae7378471b63b9a1985c6294006f">bmSNDTOG0</a>;</div>
<div class="line"><a name="l00158"></a><span class="lineno"> 158</span>&#160; <a class="code" href="class_p_s3_u_s_b.html#a394dbb0a59b587210e5958f08dac48f1">epInfo</a>[ <a class="code" href="_p_s3_u_s_b_8h.html#a0da271fcb10181b3ce15aefe76c259bb">PS3_OUTPUT_PIPE</a> ].<a class="code" href="struct_ep_info.html#a9238dd40c096baedf041c98b19386a14">bmRcvToggle</a> = <a class="code" href="max3421e_8h.html#aca6a8aa4f0aebbe07c5e175572a92ef7">bmRCVTOG0</a>;</div>
<div class="line"><a name="l00159"></a><span class="lineno"> 159</span>&#160; <a class="code" href="class_p_s3_u_s_b.html#a394dbb0a59b587210e5958f08dac48f1">epInfo</a>[ <a class="code" href="_p_s3_u_s_b_8h.html#aca3cbaad8732d9185bb9bda1a32cd18d">PS3_INPUT_PIPE</a> ].<a class="code" href="struct_ep_info.html#a9f92be74c75c037b39e2cae1eb49b89b">epAddr</a> = 0x01; <span class="comment">// PS3 report endpoint</span></div>
<div class="line"><a name="l00160"></a><span class="lineno"> 160</span>&#160; <a class="code" href="class_p_s3_u_s_b.html#a394dbb0a59b587210e5958f08dac48f1">epInfo</a>[ <a class="code" href="_p_s3_u_s_b_8h.html#aca3cbaad8732d9185bb9bda1a32cd18d">PS3_INPUT_PIPE</a> ].<a class="code" href="struct_ep_info.html#a1dea928517c961235eef7b0876e69f10">epAttribs</a> = <a class="code" href="_p_s3_u_s_b_8h.html#ad4d26e1c566064f2259faf65f0858b6e">EP_INTERRUPT</a>;</div>
<div class="line"><a name="l00161"></a><span class="lineno"> 161</span>&#160; <a class="code" href="class_p_s3_u_s_b.html#a394dbb0a59b587210e5958f08dac48f1">epInfo</a>[ <a class="code" href="_p_s3_u_s_b_8h.html#aca3cbaad8732d9185bb9bda1a32cd18d">PS3_INPUT_PIPE</a> ].<a class="code" href="struct_ep_info.html#a3a5b1c017a034cd9e06e76729e727c46">bmNakPower</a> = <a class="code" href="address_8h.html#a660e8da9c1167a8450aef91c5c03761d">USB_NAK_NOWAIT</a>; <span class="comment">// Only poll once for interrupt endpoints</span></div>
<div class="line"><a name="l00162"></a><span class="lineno"> 162</span>&#160; <a class="code" href="class_p_s3_u_s_b.html#a394dbb0a59b587210e5958f08dac48f1">epInfo</a>[ <a class="code" href="_p_s3_u_s_b_8h.html#aca3cbaad8732d9185bb9bda1a32cd18d">PS3_INPUT_PIPE</a> ].<a class="code" href="struct_ep_info.html#aa2ca775b63736df4008e88da7dd4dddb">maxPktSize</a> = <a class="code" href="_p_s3_u_s_b_8h.html#abcb805b13bfd36145e252b0633bbcfc0">EP_MAXPKTSIZE</a>;</div>
<div class="line"><a name="l00163"></a><span class="lineno"> 163</span>&#160; <a class="code" href="class_p_s3_u_s_b.html#a394dbb0a59b587210e5958f08dac48f1">epInfo</a>[ <a class="code" href="_p_s3_u_s_b_8h.html#aca3cbaad8732d9185bb9bda1a32cd18d">PS3_INPUT_PIPE</a> ].<a class="code" href="struct_ep_info.html#ac85bff70ad0e5d71e50cb501f4d8caf3">bmSndToggle</a> = <a class="code" href="max3421e_8h.html#a4834ae7378471b63b9a1985c6294006f">bmSNDTOG0</a>;</div>
<div class="line"><a name="l00164"></a><span class="lineno"> 164</span>&#160; <a class="code" href="class_p_s3_u_s_b.html#a394dbb0a59b587210e5958f08dac48f1">epInfo</a>[ <a class="code" href="_p_s3_u_s_b_8h.html#aca3cbaad8732d9185bb9bda1a32cd18d">PS3_INPUT_PIPE</a> ].<a class="code" href="struct_ep_info.html#a9238dd40c096baedf041c98b19386a14">bmRcvToggle</a> = <a class="code" href="max3421e_8h.html#aca6a8aa4f0aebbe07c5e175572a92ef7">bmRCVTOG0</a>;</div>
<div class="line"><a name="l00165"></a><span class="lineno"> 165</span>&#160;</div>
<div class="line"><a name="l00166"></a><span class="lineno"> 166</span>&#160; rcode = <a class="code" href="class_p_s3_u_s_b.html#aa1873f41ae0da7c4568cfb7517560c48">pUsb</a>-&gt;<a class="code" href="class_u_s_b.html#a6c3ba3f7e6dccb450267011ce783d7ea">setEpInfoEntry</a>(bAddress, 3, <a class="code" href="class_p_s3_u_s_b.html#a394dbb0a59b587210e5958f08dac48f1">epInfo</a>);</div>
<div class="line"><a name="l00167"></a><span class="lineno"> 167</span>&#160; <span class="keywordflow">if</span> (rcode)</div>
<div class="line"><a name="l00168"></a><span class="lineno"> 168</span>&#160; <span class="keywordflow">goto</span> FailSetDevTblEntry;</div>
<div class="line"><a name="l00169"></a><span class="lineno"> 169</span>&#160;</div>
<div class="line"><a name="l00170"></a><span class="lineno"> 170</span>&#160; rcode = <a class="code" href="class_p_s3_u_s_b.html#aa1873f41ae0da7c4568cfb7517560c48">pUsb</a>-&gt;<a class="code" href="class_u_s_b.html#a31e2c132ec32ffdde94dff72be87c378">setConf</a>(bAddress, <a class="code" href="class_p_s3_u_s_b.html#a394dbb0a59b587210e5958f08dac48f1">epInfo</a>[ <a class="code" href="_p_s3_u_s_b_8h.html#ae6276fa555fe14995bee0713be663333">PS3_CONTROL_PIPE</a> ].epAddr, 1);</div>
<div class="line"><a name="l00171"></a><span class="lineno"> 171</span>&#160; <span class="keywordflow">if</span> (rcode)</div>
<div class="line"><a name="l00172"></a><span class="lineno"> 172</span>&#160; <span class="keywordflow">goto</span> FailSetConfDescr;</div>
<div class="line"><a name="l00173"></a><span class="lineno"> 173</span>&#160;</div>
<div class="line"><a name="l00174"></a><span class="lineno"> 174</span>&#160; <span class="keywordflow">if</span> (PID == <a class="code" href="_b_t_d_8h.html#a0ae276efa5e73a4da658c714e70402c0">PS3_PID</a> || PID == <a class="code" href="_b_t_d_8h.html#a54903b410722a45f8246653cd4d00632">PS3NAVIGATION_PID</a>) {</div>
<div class="line"><a name="l00175"></a><span class="lineno"> 175</span>&#160; <span class="keywordflow">if</span> (PID == <a class="code" href="_b_t_d_8h.html#a0ae276efa5e73a4da658c714e70402c0">PS3_PID</a>) {</div>
<div class="line"><a name="l00176"></a><span class="lineno"> 176</span>&#160;<span class="preprocessor">#ifdef DEBUG_USB_HOST</span></div>
<div class="line"><a name="l00177"></a><span class="lineno"> 177</span>&#160;<span class="preprocessor"></span> <a class="code" href="message_8h.html#a747819b0aa34f5c3ba0332c2db28c846">Notify</a>(PSTR(<span class="stringliteral">&quot;\r\nDualshock 3 Controller Connected&quot;</span>), 0x80);</div>
<div class="line"><a name="l00178"></a><span class="lineno"> 178</span>&#160;<span class="preprocessor">#endif</span></div>
<div class="line"><a name="l00179"></a><span class="lineno"> 179</span>&#160;<span class="preprocessor"></span> <a class="code" href="class_p_s3_u_s_b.html#a0dad8754ff18d0c375c2569791d50876">PS3Connected</a> = <span class="keyword">true</span>;</div>
<div class="line"><a name="l00180"></a><span class="lineno"> 180</span>&#160; } <span class="keywordflow">else</span> { <span class="comment">// must be a navigation controller</span></div>
<div class="line"><a name="l00181"></a><span class="lineno"> 181</span>&#160;<span class="preprocessor">#ifdef DEBUG_USB_HOST</span></div>
<div class="line"><a name="l00182"></a><span class="lineno"> 182</span>&#160;<span class="preprocessor"></span> <a class="code" href="message_8h.html#a747819b0aa34f5c3ba0332c2db28c846">Notify</a>(PSTR(<span class="stringliteral">&quot;\r\nNavigation Controller Connected&quot;</span>), 0x80);</div>
<div class="line"><a name="l00183"></a><span class="lineno"> 183</span>&#160;<span class="preprocessor">#endif</span></div>
<div class="line"><a name="l00184"></a><span class="lineno"> 184</span>&#160;<span class="preprocessor"></span> <a class="code" href="class_p_s3_u_s_b.html#a54b2dcaa1e9acef83de2376b50c7ff09">PS3NavigationConnected</a> = <span class="keyword">true</span>;</div>
<div class="line"><a name="l00185"></a><span class="lineno"> 185</span>&#160; }</div>
<div class="line"><a name="l00186"></a><span class="lineno"> 186</span>&#160; <span class="comment">/* Set internal bluetooth address and request for data */</span></div>
<div class="line"><a name="l00187"></a><span class="lineno"> 187</span>&#160; <a class="code" href="class_p_s3_u_s_b.html#af13993073ab245ece6d3fe9e9f41df87">setBdaddr</a>(my_bdaddr);</div>
<div class="line"><a name="l00188"></a><span class="lineno"> 188</span>&#160; enable_sixaxis();</div>
<div class="line"><a name="l00189"></a><span class="lineno"> 189</span>&#160; <a class="code" href="class_p_s3_u_s_b.html#a44c4bff09064a09ef97c7bb6b8c0810b">setLedOn</a>(<a class="code" href="controller_enums_8h.html#aadcb6002d2b42fdfe01490f730ab00a6adac6477842247cab1a8c02c65f431b44">LED1</a>);</div>
<div class="line"><a name="l00190"></a><span class="lineno"> 190</span>&#160;</div>
<div class="line"><a name="l00191"></a><span class="lineno"> 191</span>&#160; <span class="comment">// Needed for PS3 Dualshock and Navigation commands to work</span></div>
<div class="line"><a name="l00192"></a><span class="lineno"> 192</span>&#160; <span class="keywordflow">for</span> (uint8_t i = 0; i &lt; <a class="code" href="_p_s3_enums_8h.html#a4898fccf5d2aa053bc67894aa3627e0f">PS3_REPORT_BUFFER_SIZE</a>; i++)</div>
<div class="line"><a name="l00193"></a><span class="lineno"> 193</span>&#160; writeBuf[i] = pgm_read_byte(&amp;<a class="code" href="_p_s3_enums_8h.html#a8cf62ee374ebaa5f7582c073e624bc74">PS3_REPORT_BUFFER</a>[i]);</div>
<div class="line"><a name="l00194"></a><span class="lineno"> 194</span>&#160;</div>
<div class="line"><a name="l00195"></a><span class="lineno"> 195</span>&#160; <span class="keywordflow">for</span> (uint8_t i = 6; i &lt; 10; i++)</div>
<div class="line"><a name="l00196"></a><span class="lineno"> 196</span>&#160; readBuf[i] = 0x7F; <span class="comment">// Set the analog joystick values to center position</span></div>
<div class="line"><a name="l00197"></a><span class="lineno"> 197</span>&#160; } <span class="keywordflow">else</span> { <span class="comment">// must be a Motion controller</span></div>
<div class="line"><a name="l00198"></a><span class="lineno"> 198</span>&#160;<span class="preprocessor">#ifdef DEBUG_USB_HOST</span></div>
<div class="line"><a name="l00199"></a><span class="lineno"> 199</span>&#160;<span class="preprocessor"></span> <a class="code" href="message_8h.html#a747819b0aa34f5c3ba0332c2db28c846">Notify</a>(PSTR(<span class="stringliteral">&quot;\r\nMotion Controller Connected&quot;</span>), 0x80);</div>
<div class="line"><a name="l00200"></a><span class="lineno"> 200</span>&#160;<span class="preprocessor">#endif</span></div>
<div class="line"><a name="l00201"></a><span class="lineno"> 201</span>&#160;<span class="preprocessor"></span> <a class="code" href="class_p_s3_u_s_b.html#a89aa4233f3eeeb99693a099da527ec28">PS3MoveConnected</a> = <span class="keyword">true</span>;</div>
<div class="line"><a name="l00202"></a><span class="lineno"> 202</span>&#160; <a class="code" href="class_p_s3_u_s_b.html#a3be69a3c6e24bf2b53bc06c85829e62a">setMoveBdaddr</a>(my_bdaddr); <span class="comment">// Set internal bluetooth address</span></div>
<div class="line"><a name="l00203"></a><span class="lineno"> 203</span>&#160; <a class="code" href="class_p_s3_u_s_b.html#ae9cfdaad3e54dbc271519e22082399c7">moveSetBulb</a>(<a class="code" href="_p_s3_enums_8h.html#a55ecd4f2ec2ebfe8d5b0163e4ac2a967ad3163c1fcda01965b692ec2c3122b743">Red</a>);</div>
<div class="line"><a name="l00204"></a><span class="lineno"> 204</span>&#160;</div>
<div class="line"><a name="l00205"></a><span class="lineno"> 205</span>&#160; writeBuf[0] = 0x02; <span class="comment">// Set report ID, this is needed for Move commands to work</span></div>
<div class="line"><a name="l00206"></a><span class="lineno"> 206</span>&#160; }</div>
<div class="line"><a name="l00207"></a><span class="lineno"> 207</span>&#160;</div>
<div class="line"><a name="l00208"></a><span class="lineno"> 208</span>&#160;<span class="preprocessor">#ifdef DEBUG_USB_HOST</span></div>
<div class="line"><a name="l00209"></a><span class="lineno"> 209</span>&#160;<span class="preprocessor"></span> <a class="code" href="message_8h.html#a747819b0aa34f5c3ba0332c2db28c846">Notify</a>(PSTR(<span class="stringliteral">&quot;\r\nBluetooth Address was set to: &quot;</span>), 0x80);</div>
<div class="line"><a name="l00210"></a><span class="lineno"> 210</span>&#160; <span class="keywordflow">for</span> (int8_t i = 5; i &gt; 0; i--) {</div>
<div class="line"><a name="l00211"></a><span class="lineno"> 211</span>&#160; D_PrintHex&lt;uint8_t &gt; (my_bdaddr[i], 0x80);</div>
<div class="line"><a name="l00212"></a><span class="lineno"> 212</span>&#160; <a class="code" href="message_8h.html#a747819b0aa34f5c3ba0332c2db28c846">Notify</a>(PSTR(<span class="stringliteral">&quot;:&quot;</span>), 0x80);</div>
<div class="line"><a name="l00213"></a><span class="lineno"> 213</span>&#160; }</div>
<div class="line"><a name="l00214"></a><span class="lineno"> 214</span>&#160; D_PrintHex&lt;uint8_t &gt; (my_bdaddr[0], 0x80);</div>
<div class="line"><a name="l00215"></a><span class="lineno"> 215</span>&#160;<span class="preprocessor">#endif</span></div>
<div class="line"><a name="l00216"></a><span class="lineno"> 216</span>&#160;<span class="preprocessor"></span></div>
<div class="line"><a name="l00217"></a><span class="lineno"> 217</span>&#160; bPollEnable = <span class="keyword">true</span>;</div>
<div class="line"><a name="l00218"></a><span class="lineno"> 218</span>&#160; <a class="code" href="message_8h.html#a747819b0aa34f5c3ba0332c2db28c846">Notify</a>(PSTR(<span class="stringliteral">&quot;\r\n&quot;</span>), 0x80);</div>
<div class="line"><a name="l00219"></a><span class="lineno"> 219</span>&#160; timer = millis();</div>
<div class="line"><a name="l00220"></a><span class="lineno"> 220</span>&#160; <span class="keywordflow">return</span> 0; <span class="comment">// successful configuration</span></div>
<div class="line"><a name="l00221"></a><span class="lineno"> 221</span>&#160;</div>
<div class="line"><a name="l00222"></a><span class="lineno"> 222</span>&#160; <span class="comment">/* diagnostic messages */</span></div>
<div class="line"><a name="l00223"></a><span class="lineno"> 223</span>&#160;FailGetDevDescr:</div>
<div class="line"><a name="l00224"></a><span class="lineno"> 224</span>&#160;<span class="preprocessor">#ifdef DEBUG_USB_HOST</span></div>
<div class="line"><a name="l00225"></a><span class="lineno"> 225</span>&#160;<span class="preprocessor"></span> <a class="code" href="message_8cpp.html#ace40a5d826a882de0c5a25aece111d3f">NotifyFailGetDevDescr</a>();</div>
<div class="line"><a name="l00226"></a><span class="lineno"> 226</span>&#160; <span class="keywordflow">goto</span> Fail;</div>
<div class="line"><a name="l00227"></a><span class="lineno"> 227</span>&#160;<span class="preprocessor">#endif</span></div>
<div class="line"><a name="l00228"></a><span class="lineno"> 228</span>&#160;<span class="preprocessor"></span>FailSetDevTblEntry:</div>
<div class="line"><a name="l00229"></a><span class="lineno"> 229</span>&#160;<span class="preprocessor">#ifdef DEBUG_USB_HOST</span></div>
<div class="line"><a name="l00230"></a><span class="lineno"> 230</span>&#160;<span class="preprocessor"></span> <a class="code" href="message_8cpp.html#aa65008f9251787149e391f89e68b32be">NotifyFailSetDevTblEntry</a>();</div>
<div class="line"><a name="l00231"></a><span class="lineno"> 231</span>&#160; <span class="keywordflow">goto</span> Fail;</div>
<div class="line"><a name="l00232"></a><span class="lineno"> 232</span>&#160;<span class="preprocessor">#endif</span></div>
<div class="line"><a name="l00233"></a><span class="lineno"> 233</span>&#160;<span class="preprocessor"></span></div>
<div class="line"><a name="l00234"></a><span class="lineno"> 234</span>&#160;FailSetConfDescr:</div>
<div class="line"><a name="l00235"></a><span class="lineno"> 235</span>&#160;<span class="preprocessor">#ifdef DEBUG_USB_HOST</span></div>
<div class="line"><a name="l00236"></a><span class="lineno"> 236</span>&#160;<span class="preprocessor"></span> <a class="code" href="message_8cpp.html#a08b840c377ca6f8154d6924d51338d89">NotifyFailSetConfDescr</a>();</div>
<div class="line"><a name="l00237"></a><span class="lineno"> 237</span>&#160;<span class="preprocessor">#endif</span></div>
<div class="line"><a name="l00238"></a><span class="lineno"> 238</span>&#160;<span class="preprocessor"></span> <span class="keywordflow">goto</span> Fail;</div>
<div class="line"><a name="l00239"></a><span class="lineno"> 239</span>&#160;FailUnknownDevice:</div>
<div class="line"><a name="l00240"></a><span class="lineno"> 240</span>&#160;<span class="preprocessor">#ifdef DEBUG_USB_HOST</span></div>
<div class="line"><a name="l00241"></a><span class="lineno"> 241</span>&#160;<span class="preprocessor"></span> <a class="code" href="message_8cpp.html#a7103129ed2b7b7896461c0a3cd924eb4">NotifyFailUnknownDevice</a>(VID, PID);</div>
<div class="line"><a name="l00242"></a><span class="lineno"> 242</span>&#160;<span class="preprocessor">#endif</span></div>
<div class="line"><a name="l00243"></a><span class="lineno"> 243</span>&#160;<span class="preprocessor"></span> rcode = <a class="code" href="_usb_8h.html#ae9e139d0fd29bb0b3e7afad2f76cd589">USB_DEV_CONFIG_ERROR_DEVICE_NOT_SUPPORTED</a>;</div>
<div class="line"><a name="l00244"></a><span class="lineno"> 244</span>&#160;Fail:</div>
<div class="line"><a name="l00245"></a><span class="lineno"> 245</span>&#160;</div>
<div class="line"><a name="l00246"></a><span class="lineno"> 246</span>&#160;<span class="preprocessor">#ifdef DEBUG_USB_HOST</span></div>
<div class="line"><a name="l00247"></a><span class="lineno"> 247</span>&#160;<span class="preprocessor"></span> <a class="code" href="message_8h.html#a747819b0aa34f5c3ba0332c2db28c846">Notify</a>(PSTR(<span class="stringliteral">&quot;\r\nPS3 Init Failed, error code: &quot;</span>), 0x80);</div>
<div class="line"><a name="l00248"></a><span class="lineno"> 248</span>&#160; <a class="code" href="message_8cpp.html#a5ae2cb9bf877595104f2425f50e2057f">NotifyFail</a>(rcode);</div>
<div class="line"><a name="l00249"></a><span class="lineno"> 249</span>&#160;<span class="preprocessor">#endif</span></div>
<div class="line"><a name="l00250"></a><span class="lineno"> 250</span>&#160;<span class="preprocessor"></span> <a class="code" href="class_p_s3_u_s_b.html#a5750c5448bf1ec73a7669ca2e4799c98">Release</a>();</div>
<div class="line"><a name="l00251"></a><span class="lineno"> 251</span>&#160; <span class="keywordflow">return</span> rcode;</div>
<div class="line"><a name="l00252"></a><span class="lineno"> 252</span>&#160;}</div>
<div class="line"><a name="l00253"></a><span class="lineno"> 253</span>&#160;</div>
<div class="line"><a name="l00254"></a><span class="lineno"> 254</span>&#160;<span class="comment">/* Performs a cleanup after failed Init() attempt */</span></div>
<div class="line"><a name="l00255"></a><span class="lineno"><a class="code" href="class_p_s3_u_s_b.html#a5750c5448bf1ec73a7669ca2e4799c98"> 255</a></span>&#160;uint8_t <a class="code" href="class_p_s3_u_s_b.html#a5750c5448bf1ec73a7669ca2e4799c98">PS3USB::Release</a>() {</div>
<div class="line"><a name="l00256"></a><span class="lineno"> 256</span>&#160; <a class="code" href="class_p_s3_u_s_b.html#a0dad8754ff18d0c375c2569791d50876">PS3Connected</a> = <span class="keyword">false</span>;</div>
<div class="line"><a name="l00257"></a><span class="lineno"> 257</span>&#160; <a class="code" href="class_p_s3_u_s_b.html#a89aa4233f3eeeb99693a099da527ec28">PS3MoveConnected</a> = <span class="keyword">false</span>;</div>
<div class="line"><a name="l00258"></a><span class="lineno"> 258</span>&#160; <a class="code" href="class_p_s3_u_s_b.html#a54b2dcaa1e9acef83de2376b50c7ff09">PS3NavigationConnected</a> = <span class="keyword">false</span>;</div>
<div class="line"><a name="l00259"></a><span class="lineno"> 259</span>&#160; <a class="code" href="class_p_s3_u_s_b.html#aa1873f41ae0da7c4568cfb7517560c48">pUsb</a>-&gt;<a class="code" href="class_u_s_b.html#a66ab8f5eda239e761d5a48741ea1f9d4">GetAddressPool</a>().<a class="code" href="class_address_pool.html#a15fde13223dcb1da89305ad229763562">FreeAddress</a>(<a class="code" href="class_p_s3_u_s_b.html#a3f43df159277003acdf7dd107bda27fd">bAddress</a>);</div>
<div class="line"><a name="l00260"></a><span class="lineno"> 260</span>&#160; <a class="code" href="class_p_s3_u_s_b.html#a3f43df159277003acdf7dd107bda27fd">bAddress</a> = 0;</div>
<div class="line"><a name="l00261"></a><span class="lineno"> 261</span>&#160; bPollEnable = <span class="keyword">false</span>;</div>
<div class="line"><a name="l00262"></a><span class="lineno"> 262</span>&#160; <span class="keywordflow">return</span> 0;</div>
<div class="line"><a name="l00263"></a><span class="lineno"> 263</span>&#160;}</div>
<div class="line"><a name="l00264"></a><span class="lineno"> 264</span>&#160;</div>
<div class="line"><a name="l00265"></a><span class="lineno"><a class="code" href="class_p_s3_u_s_b.html#a9068e2a036012614c0db163830cbcf00"> 265</a></span>&#160;uint8_t <a class="code" href="class_p_s3_u_s_b.html#a9068e2a036012614c0db163830cbcf00">PS3USB::Poll</a>() {</div>
<div class="line"><a name="l00266"></a><span class="lineno"> 266</span>&#160; <span class="keywordflow">if</span> (!bPollEnable)</div>
<div class="line"><a name="l00267"></a><span class="lineno"> 267</span>&#160; <span class="keywordflow">return</span> 0;</div>
<div class="line"><a name="l00268"></a><span class="lineno"> 268</span>&#160;</div>
<div class="line"><a name="l00269"></a><span class="lineno"> 269</span>&#160; <span class="keywordflow">if</span> (<a class="code" href="class_p_s3_u_s_b.html#a0dad8754ff18d0c375c2569791d50876">PS3Connected</a> || <a class="code" href="class_p_s3_u_s_b.html#a54b2dcaa1e9acef83de2376b50c7ff09">PS3NavigationConnected</a>) {</div>
<div class="line"><a name="l00270"></a><span class="lineno"> 270</span>&#160; uint16_t BUFFER_SIZE = <a class="code" href="_p_s3_u_s_b_8h.html#abcb805b13bfd36145e252b0633bbcfc0">EP_MAXPKTSIZE</a>;</div>
<div class="line"><a name="l00271"></a><span class="lineno"> 271</span>&#160; <a class="code" href="class_p_s3_u_s_b.html#aa1873f41ae0da7c4568cfb7517560c48">pUsb</a>-&gt;<a class="code" href="class_u_s_b.html#ad75d64f648b102fab2bd75e53e1324a4">inTransfer</a>(<a class="code" href="class_p_s3_u_s_b.html#a3f43df159277003acdf7dd107bda27fd">bAddress</a>, <a class="code" href="class_p_s3_u_s_b.html#a394dbb0a59b587210e5958f08dac48f1">epInfo</a>[ <a class="code" href="_p_s3_u_s_b_8h.html#aca3cbaad8732d9185bb9bda1a32cd18d">PS3_INPUT_PIPE</a> ].epAddr, &amp;BUFFER_SIZE, readBuf); <span class="comment">// input on endpoint 1</span></div>
<div class="line"><a name="l00272"></a><span class="lineno"> 272</span>&#160; <span class="keywordflow">if</span> (millis() - timer &gt; 100) { <span class="comment">// Loop 100ms before processing data</span></div>
<div class="line"><a name="l00273"></a><span class="lineno"> 273</span>&#160; readReport();</div>
<div class="line"><a name="l00274"></a><span class="lineno"> 274</span>&#160;<span class="preprocessor">#ifdef PRINTREPORT</span></div>
<div class="line"><a name="l00275"></a><span class="lineno"> 275</span>&#160;<span class="preprocessor"></span> printReport(); <span class="comment">// Uncomment &quot;#define PRINTREPORT&quot; to print the report send by the PS3 Controllers</span></div>
<div class="line"><a name="l00276"></a><span class="lineno"> 276</span>&#160;<span class="preprocessor">#endif</span></div>
<div class="line"><a name="l00277"></a><span class="lineno"> 277</span>&#160;<span class="preprocessor"></span> }</div>
<div class="line"><a name="l00278"></a><span class="lineno"> 278</span>&#160; } <span class="keywordflow">else</span> <span class="keywordflow">if</span> (<a class="code" href="class_p_s3_u_s_b.html#a89aa4233f3eeeb99693a099da527ec28">PS3MoveConnected</a>) { <span class="comment">// One can only set the color of the bulb, set the rumble, set and get the bluetooth address and calibrate the magnetometer via USB</span></div>
<div class="line"><a name="l00279"></a><span class="lineno"> 279</span>&#160; <span class="keywordflow">if</span> (millis() - timer &gt; 4000) <span class="comment">// Send at least every 4th second</span></div>
<div class="line"><a name="l00280"></a><span class="lineno"> 280</span>&#160; {</div>
<div class="line"><a name="l00281"></a><span class="lineno"> 281</span>&#160; Move_Command(writeBuf, <a class="code" href="_p_s3_enums_8h.html#a2c6c24a4b63d9a34926fb35d6b49cd17">MOVE_REPORT_BUFFER_SIZE</a>); <span class="comment">// The Bulb and rumble values, has to be written again and again, for it to stay turned on</span></div>
<div class="line"><a name="l00282"></a><span class="lineno"> 282</span>&#160; timer = millis();</div>
<div class="line"><a name="l00283"></a><span class="lineno"> 283</span>&#160; }</div>
<div class="line"><a name="l00284"></a><span class="lineno"> 284</span>&#160; }</div>
<div class="line"><a name="l00285"></a><span class="lineno"> 285</span>&#160; <span class="keywordflow">return</span> 0;</div>
<div class="line"><a name="l00286"></a><span class="lineno"> 286</span>&#160;}</div>
<div class="line"><a name="l00287"></a><span class="lineno"> 287</span>&#160;</div>
<div class="line"><a name="l00288"></a><span class="lineno"> 288</span>&#160;<span class="keywordtype">void</span> PS3USB::readReport() {</div>
<div class="line"><a name="l00289"></a><span class="lineno"> 289</span>&#160; <span class="keywordflow">if</span> (readBuf == NULL)</div>
<div class="line"><a name="l00290"></a><span class="lineno"> 290</span>&#160; <span class="keywordflow">return</span>;</div>
<div class="line"><a name="l00291"></a><span class="lineno"> 291</span>&#160;</div>
<div class="line"><a name="l00292"></a><span class="lineno"> 292</span>&#160; ButtonState = (uint32_t)(readBuf[2] | ((uint16_t)readBuf[3] &lt;&lt; 8) | ((uint32_t)readBuf[4] &lt;&lt; 16));</div>
<div class="line"><a name="l00293"></a><span class="lineno"> 293</span>&#160;</div>
<div class="line"><a name="l00294"></a><span class="lineno"> 294</span>&#160; <span class="comment">//Notify(PSTR(&quot;\r\nButtonState&quot;, 0x80);</span></div>
<div class="line"><a name="l00295"></a><span class="lineno"> 295</span>&#160; <span class="comment">//PrintHex&lt;uint32_t&gt;(ButtonState, 0x80);</span></div>
<div class="line"><a name="l00170"></a><span class="lineno"> 170</span>&#160; delay(200); <span class="comment">//Give time for address change</span></div>
<div class="line"><a name="l00171"></a><span class="lineno"> 171</span>&#160;</div>
<div class="line"><a name="l00172"></a><span class="lineno"> 172</span>&#160; rcode = <a class="code" href="class_p_s3_u_s_b.html#aa1873f41ae0da7c4568cfb7517560c48">pUsb</a>-&gt;<a class="code" href="class_u_s_b.html#a31e2c132ec32ffdde94dff72be87c378">setConf</a>(bAddress, <a class="code" href="class_p_s3_u_s_b.html#a394dbb0a59b587210e5958f08dac48f1">epInfo</a>[ <a class="code" href="_p_s3_u_s_b_8h.html#ae6276fa555fe14995bee0713be663333">PS3_CONTROL_PIPE</a> ].epAddr, 1);</div>
<div class="line"><a name="l00173"></a><span class="lineno"> 173</span>&#160; <span class="keywordflow">if</span> (rcode)</div>
<div class="line"><a name="l00174"></a><span class="lineno"> 174</span>&#160; <span class="keywordflow">goto</span> FailSetConfDescr;</div>
<div class="line"><a name="l00175"></a><span class="lineno"> 175</span>&#160;</div>
<div class="line"><a name="l00176"></a><span class="lineno"> 176</span>&#160; <span class="keywordflow">if</span> (PID == <a class="code" href="_b_t_d_8h.html#a0ae276efa5e73a4da658c714e70402c0">PS3_PID</a> || PID == <a class="code" href="_b_t_d_8h.html#a54903b410722a45f8246653cd4d00632">PS3NAVIGATION_PID</a>) {</div>
<div class="line"><a name="l00177"></a><span class="lineno"> 177</span>&#160; <span class="keywordflow">if</span> (PID == <a class="code" href="_b_t_d_8h.html#a0ae276efa5e73a4da658c714e70402c0">PS3_PID</a>) {</div>
<div class="line"><a name="l00178"></a><span class="lineno"> 178</span>&#160;<span class="preprocessor">#ifdef DEBUG_USB_HOST</span></div>
<div class="line"><a name="l00179"></a><span class="lineno"> 179</span>&#160;<span class="preprocessor"></span> <a class="code" href="message_8h.html#a27117e124c5d66d5512fe8d494fe6338">Notify</a>(PSTR(<span class="stringliteral">&quot;\r\nDualshock 3 Controller Connected&quot;</span>), 0x80);</div>
<div class="line"><a name="l00180"></a><span class="lineno"> 180</span>&#160;<span class="preprocessor">#endif</span></div>
<div class="line"><a name="l00181"></a><span class="lineno"> 181</span>&#160;<span class="preprocessor"></span> <a class="code" href="class_p_s3_u_s_b.html#a0dad8754ff18d0c375c2569791d50876">PS3Connected</a> = <span class="keyword">true</span>;</div>
<div class="line"><a name="l00182"></a><span class="lineno"> 182</span>&#160; } <span class="keywordflow">else</span> { <span class="comment">// must be a navigation controller</span></div>
<div class="line"><a name="l00183"></a><span class="lineno"> 183</span>&#160;<span class="preprocessor">#ifdef DEBUG_USB_HOST</span></div>
<div class="line"><a name="l00184"></a><span class="lineno"> 184</span>&#160;<span class="preprocessor"></span> <a class="code" href="message_8h.html#a27117e124c5d66d5512fe8d494fe6338">Notify</a>(PSTR(<span class="stringliteral">&quot;\r\nNavigation Controller Connected&quot;</span>), 0x80);</div>
<div class="line"><a name="l00185"></a><span class="lineno"> 185</span>&#160;<span class="preprocessor">#endif</span></div>
<div class="line"><a name="l00186"></a><span class="lineno"> 186</span>&#160;<span class="preprocessor"></span> <a class="code" href="class_p_s3_u_s_b.html#a54b2dcaa1e9acef83de2376b50c7ff09">PS3NavigationConnected</a> = <span class="keyword">true</span>;</div>
<div class="line"><a name="l00187"></a><span class="lineno"> 187</span>&#160; }</div>
<div class="line"><a name="l00188"></a><span class="lineno"> 188</span>&#160; enable_sixaxis(); <span class="comment">// The PS3 controller needs a special command before it starts sending data</span></div>
<div class="line"><a name="l00189"></a><span class="lineno"> 189</span>&#160;</div>
<div class="line"><a name="l00190"></a><span class="lineno"> 190</span>&#160; <span class="comment">// Needed for PS3 Dualshock and Navigation commands to work</span></div>
<div class="line"><a name="l00191"></a><span class="lineno"> 191</span>&#160; <span class="keywordflow">for</span> (uint8_t i = 0; i &lt; <a class="code" href="_p_s3_enums_8h.html#a4898fccf5d2aa053bc67894aa3627e0f">PS3_REPORT_BUFFER_SIZE</a>; i++)</div>
<div class="line"><a name="l00192"></a><span class="lineno"> 192</span>&#160; writeBuf[i] = pgm_read_byte(&amp;<a class="code" href="_p_s3_enums_8h.html#a8cf62ee374ebaa5f7582c073e624bc74">PS3_REPORT_BUFFER</a>[i]);</div>
<div class="line"><a name="l00193"></a><span class="lineno"> 193</span>&#160;</div>
<div class="line"><a name="l00194"></a><span class="lineno"> 194</span>&#160; <span class="keywordflow">for</span> (uint8_t i = 6; i &lt; 10; i++)</div>
<div class="line"><a name="l00195"></a><span class="lineno"> 195</span>&#160; readBuf[i] = 0x7F; <span class="comment">// Set the analog joystick values to center position</span></div>
<div class="line"><a name="l00196"></a><span class="lineno"> 196</span>&#160; } <span class="keywordflow">else</span> { <span class="comment">// must be a Motion controller</span></div>
<div class="line"><a name="l00197"></a><span class="lineno"> 197</span>&#160;<span class="preprocessor">#ifdef DEBUG_USB_HOST</span></div>
<div class="line"><a name="l00198"></a><span class="lineno"> 198</span>&#160;<span class="preprocessor"></span> <a class="code" href="message_8h.html#a27117e124c5d66d5512fe8d494fe6338">Notify</a>(PSTR(<span class="stringliteral">&quot;\r\nMotion Controller Connected&quot;</span>), 0x80);</div>
<div class="line"><a name="l00199"></a><span class="lineno"> 199</span>&#160;<span class="preprocessor">#endif</span></div>
<div class="line"><a name="l00200"></a><span class="lineno"> 200</span>&#160;<span class="preprocessor"></span> <a class="code" href="class_p_s3_u_s_b.html#a89aa4233f3eeeb99693a099da527ec28">PS3MoveConnected</a> = <span class="keyword">true</span>;</div>
<div class="line"><a name="l00201"></a><span class="lineno"> 201</span>&#160; writeBuf[0] = 0x02; <span class="comment">// Set report ID, this is needed for Move commands to work</span></div>
<div class="line"><a name="l00202"></a><span class="lineno"> 202</span>&#160; }</div>
<div class="line"><a name="l00203"></a><span class="lineno"> 203</span>&#160; <span class="keywordflow">if</span> (my_bdaddr[0] != 0x00 || my_bdaddr[1] != 0x00 || my_bdaddr[2] != 0x00 || my_bdaddr[3] != 0x00 || my_bdaddr[4] != 0x00 || my_bdaddr[5] != 0x00) {</div>
<div class="line"><a name="l00204"></a><span class="lineno"> 204</span>&#160; <span class="keywordflow">if</span> (<a class="code" href="class_p_s3_u_s_b.html#a89aa4233f3eeeb99693a099da527ec28">PS3MoveConnected</a>)</div>
<div class="line"><a name="l00205"></a><span class="lineno"> 205</span>&#160; <a class="code" href="class_p_s3_u_s_b.html#a3be69a3c6e24bf2b53bc06c85829e62a">setMoveBdaddr</a>(my_bdaddr); <span class="comment">// Set internal Bluetooth address</span></div>
<div class="line"><a name="l00206"></a><span class="lineno"> 206</span>&#160; <span class="keywordflow">else</span></div>
<div class="line"><a name="l00207"></a><span class="lineno"> 207</span>&#160; <a class="code" href="class_p_s3_u_s_b.html#af13993073ab245ece6d3fe9e9f41df87">setBdaddr</a>(my_bdaddr); <span class="comment">// Set internal Bluetooth address</span></div>
<div class="line"><a name="l00208"></a><span class="lineno"> 208</span>&#160;</div>
<div class="line"><a name="l00209"></a><span class="lineno"> 209</span>&#160;<span class="preprocessor">#ifdef DEBUG_USB_HOST</span></div>
<div class="line"><a name="l00210"></a><span class="lineno"> 210</span>&#160;<span class="preprocessor"></span> <a class="code" href="message_8h.html#a27117e124c5d66d5512fe8d494fe6338">Notify</a>(PSTR(<span class="stringliteral">&quot;\r\nBluetooth Address was set to: &quot;</span>), 0x80);</div>
<div class="line"><a name="l00211"></a><span class="lineno"> 211</span>&#160; <span class="keywordflow">for</span> (int8_t i = 5; i &gt; 0; i--) {</div>
<div class="line"><a name="l00212"></a><span class="lineno"> 212</span>&#160; D_PrintHex&lt;uint8_t &gt; (my_bdaddr[i], 0x80);</div>
<div class="line"><a name="l00213"></a><span class="lineno"> 213</span>&#160; <a class="code" href="message_8h.html#a27117e124c5d66d5512fe8d494fe6338">Notify</a>(PSTR(<span class="stringliteral">&quot;:&quot;</span>), 0x80);</div>
<div class="line"><a name="l00214"></a><span class="lineno"> 214</span>&#160; }</div>
<div class="line"><a name="l00215"></a><span class="lineno"> 215</span>&#160; D_PrintHex&lt;uint8_t &gt; (my_bdaddr[0], 0x80);</div>
<div class="line"><a name="l00216"></a><span class="lineno"> 216</span>&#160;<span class="preprocessor">#endif</span></div>
<div class="line"><a name="l00217"></a><span class="lineno"> 217</span>&#160;<span class="preprocessor"></span> }</div>
<div class="line"><a name="l00218"></a><span class="lineno"> 218</span>&#160; onInit();</div>
<div class="line"><a name="l00219"></a><span class="lineno"> 219</span>&#160;</div>
<div class="line"><a name="l00220"></a><span class="lineno"> 220</span>&#160; bPollEnable = <span class="keyword">true</span>;</div>
<div class="line"><a name="l00221"></a><span class="lineno"> 221</span>&#160; <a class="code" href="message_8h.html#a27117e124c5d66d5512fe8d494fe6338">Notify</a>(PSTR(<span class="stringliteral">&quot;\r\n&quot;</span>), 0x80);</div>
<div class="line"><a name="l00222"></a><span class="lineno"> 222</span>&#160; timer = millis();</div>
<div class="line"><a name="l00223"></a><span class="lineno"> 223</span>&#160; <span class="keywordflow">return</span> 0; <span class="comment">// successful configuration</span></div>
<div class="line"><a name="l00224"></a><span class="lineno"> 224</span>&#160;</div>
<div class="line"><a name="l00225"></a><span class="lineno"> 225</span>&#160; <span class="comment">/* diagnostic messages */</span></div>
<div class="line"><a name="l00226"></a><span class="lineno"> 226</span>&#160;FailGetDevDescr:</div>
<div class="line"><a name="l00227"></a><span class="lineno"> 227</span>&#160;<span class="preprocessor">#ifdef DEBUG_USB_HOST</span></div>
<div class="line"><a name="l00228"></a><span class="lineno"> 228</span>&#160;<span class="preprocessor"></span> <a class="code" href="message_8h.html#ae65e02f44cfdc490efd1b33f9882fbbd">NotifyFailGetDevDescr</a>();</div>
<div class="line"><a name="l00229"></a><span class="lineno"> 229</span>&#160; <span class="keywordflow">goto</span> Fail;</div>
<div class="line"><a name="l00230"></a><span class="lineno"> 230</span>&#160;<span class="preprocessor">#endif</span></div>
<div class="line"><a name="l00231"></a><span class="lineno"> 231</span>&#160;<span class="preprocessor"></span>FailSetDevTblEntry:</div>
<div class="line"><a name="l00232"></a><span class="lineno"> 232</span>&#160;<span class="preprocessor">#ifdef DEBUG_USB_HOST</span></div>
<div class="line"><a name="l00233"></a><span class="lineno"> 233</span>&#160;<span class="preprocessor"></span> <a class="code" href="message_8h.html#a69619d86b1636f141c830ca82c7f45e7">NotifyFailSetDevTblEntry</a>();</div>
<div class="line"><a name="l00234"></a><span class="lineno"> 234</span>&#160; <span class="keywordflow">goto</span> Fail;</div>
<div class="line"><a name="l00235"></a><span class="lineno"> 235</span>&#160;<span class="preprocessor">#endif</span></div>
<div class="line"><a name="l00236"></a><span class="lineno"> 236</span>&#160;<span class="preprocessor"></span></div>
<div class="line"><a name="l00237"></a><span class="lineno"> 237</span>&#160;FailSetConfDescr:</div>
<div class="line"><a name="l00238"></a><span class="lineno"> 238</span>&#160;<span class="preprocessor">#ifdef DEBUG_USB_HOST</span></div>
<div class="line"><a name="l00239"></a><span class="lineno"> 239</span>&#160;<span class="preprocessor"></span> <a class="code" href="message_8h.html#a03e4088aafca36fd7a4be69e3a22b601">NotifyFailSetConfDescr</a>();</div>
<div class="line"><a name="l00240"></a><span class="lineno"> 240</span>&#160;<span class="preprocessor">#endif</span></div>
<div class="line"><a name="l00241"></a><span class="lineno"> 241</span>&#160;<span class="preprocessor"></span> <span class="keywordflow">goto</span> Fail;</div>
<div class="line"><a name="l00242"></a><span class="lineno"> 242</span>&#160;FailUnknownDevice:</div>
<div class="line"><a name="l00243"></a><span class="lineno"> 243</span>&#160;<span class="preprocessor">#ifdef DEBUG_USB_HOST</span></div>
<div class="line"><a name="l00244"></a><span class="lineno"> 244</span>&#160;<span class="preprocessor"></span> <a class="code" href="message_8h.html#a0ce3a725ee65614d7f95cda10e4d2e91">NotifyFailUnknownDevice</a>(VID, PID);</div>
<div class="line"><a name="l00245"></a><span class="lineno"> 245</span>&#160;<span class="preprocessor">#endif</span></div>
<div class="line"><a name="l00246"></a><span class="lineno"> 246</span>&#160;<span class="preprocessor"></span> rcode = <a class="code" href="_usb_8h.html#ae9e139d0fd29bb0b3e7afad2f76cd589">USB_DEV_CONFIG_ERROR_DEVICE_NOT_SUPPORTED</a>;</div>
<div class="line"><a name="l00247"></a><span class="lineno"> 247</span>&#160;Fail:</div>
<div class="line"><a name="l00248"></a><span class="lineno"> 248</span>&#160;</div>
<div class="line"><a name="l00249"></a><span class="lineno"> 249</span>&#160;<span class="preprocessor">#ifdef DEBUG_USB_HOST</span></div>
<div class="line"><a name="l00250"></a><span class="lineno"> 250</span>&#160;<span class="preprocessor"></span> <a class="code" href="message_8h.html#a27117e124c5d66d5512fe8d494fe6338">Notify</a>(PSTR(<span class="stringliteral">&quot;\r\nPS3 Init Failed, error code: &quot;</span>), 0x80);</div>
<div class="line"><a name="l00251"></a><span class="lineno"> 251</span>&#160; <a class="code" href="message_8h.html#a22695bdc18ebde4a87dbe8633cb39593">NotifyFail</a>(rcode);</div>
<div class="line"><a name="l00252"></a><span class="lineno"> 252</span>&#160;<span class="preprocessor">#endif</span></div>
<div class="line"><a name="l00253"></a><span class="lineno"> 253</span>&#160;<span class="preprocessor"></span> <a class="code" href="class_p_s3_u_s_b.html#a5750c5448bf1ec73a7669ca2e4799c98">Release</a>();</div>
<div class="line"><a name="l00254"></a><span class="lineno"> 254</span>&#160; <span class="keywordflow">return</span> rcode;</div>
<div class="line"><a name="l00255"></a><span class="lineno"> 255</span>&#160;}</div>
<div class="line"><a name="l00256"></a><span class="lineno"> 256</span>&#160;</div>
<div class="line"><a name="l00257"></a><span class="lineno"> 257</span>&#160;<span class="comment">/* Performs a cleanup after failed Init() attempt */</span></div>
<div class="line"><a name="l00258"></a><span class="lineno"><a class="code" href="class_p_s3_u_s_b.html#a5750c5448bf1ec73a7669ca2e4799c98"> 258</a></span>&#160;uint8_t <a class="code" href="class_p_s3_u_s_b.html#a5750c5448bf1ec73a7669ca2e4799c98">PS3USB::Release</a>() {</div>
<div class="line"><a name="l00259"></a><span class="lineno"> 259</span>&#160; <a class="code" href="class_p_s3_u_s_b.html#a0dad8754ff18d0c375c2569791d50876">PS3Connected</a> = <span class="keyword">false</span>;</div>
<div class="line"><a name="l00260"></a><span class="lineno"> 260</span>&#160; <a class="code" href="class_p_s3_u_s_b.html#a89aa4233f3eeeb99693a099da527ec28">PS3MoveConnected</a> = <span class="keyword">false</span>;</div>
<div class="line"><a name="l00261"></a><span class="lineno"> 261</span>&#160; <a class="code" href="class_p_s3_u_s_b.html#a54b2dcaa1e9acef83de2376b50c7ff09">PS3NavigationConnected</a> = <span class="keyword">false</span>;</div>
<div class="line"><a name="l00262"></a><span class="lineno"> 262</span>&#160; <a class="code" href="class_p_s3_u_s_b.html#aa1873f41ae0da7c4568cfb7517560c48">pUsb</a>-&gt;<a class="code" href="class_u_s_b.html#a66ab8f5eda239e761d5a48741ea1f9d4">GetAddressPool</a>().<a class="code" href="class_address_pool.html#a15fde13223dcb1da89305ad229763562">FreeAddress</a>(<a class="code" href="class_p_s3_u_s_b.html#a3f43df159277003acdf7dd107bda27fd">bAddress</a>);</div>
<div class="line"><a name="l00263"></a><span class="lineno"> 263</span>&#160; <a class="code" href="class_p_s3_u_s_b.html#a3f43df159277003acdf7dd107bda27fd">bAddress</a> = 0;</div>
<div class="line"><a name="l00264"></a><span class="lineno"> 264</span>&#160; bPollEnable = <span class="keyword">false</span>;</div>
<div class="line"><a name="l00265"></a><span class="lineno"> 265</span>&#160; <span class="keywordflow">return</span> 0;</div>
<div class="line"><a name="l00266"></a><span class="lineno"> 266</span>&#160;}</div>
<div class="line"><a name="l00267"></a><span class="lineno"> 267</span>&#160;</div>
<div class="line"><a name="l00268"></a><span class="lineno"><a class="code" href="class_p_s3_u_s_b.html#a9068e2a036012614c0db163830cbcf00"> 268</a></span>&#160;uint8_t <a class="code" href="class_p_s3_u_s_b.html#a9068e2a036012614c0db163830cbcf00">PS3USB::Poll</a>() {</div>
<div class="line"><a name="l00269"></a><span class="lineno"> 269</span>&#160; <span class="keywordflow">if</span> (!bPollEnable)</div>
<div class="line"><a name="l00270"></a><span class="lineno"> 270</span>&#160; <span class="keywordflow">return</span> 0;</div>
<div class="line"><a name="l00271"></a><span class="lineno"> 271</span>&#160;</div>
<div class="line"><a name="l00272"></a><span class="lineno"> 272</span>&#160; <span class="keywordflow">if</span> (<a class="code" href="class_p_s3_u_s_b.html#a0dad8754ff18d0c375c2569791d50876">PS3Connected</a> || <a class="code" href="class_p_s3_u_s_b.html#a54b2dcaa1e9acef83de2376b50c7ff09">PS3NavigationConnected</a>) {</div>
<div class="line"><a name="l00273"></a><span class="lineno"> 273</span>&#160; uint16_t BUFFER_SIZE = <a class="code" href="_p_s3_u_s_b_8h.html#abcb805b13bfd36145e252b0633bbcfc0">EP_MAXPKTSIZE</a>;</div>
<div class="line"><a name="l00274"></a><span class="lineno"> 274</span>&#160; <a class="code" href="class_p_s3_u_s_b.html#aa1873f41ae0da7c4568cfb7517560c48">pUsb</a>-&gt;<a class="code" href="class_u_s_b.html#ad75d64f648b102fab2bd75e53e1324a4">inTransfer</a>(<a class="code" href="class_p_s3_u_s_b.html#a3f43df159277003acdf7dd107bda27fd">bAddress</a>, <a class="code" href="class_p_s3_u_s_b.html#a394dbb0a59b587210e5958f08dac48f1">epInfo</a>[ <a class="code" href="_p_s3_u_s_b_8h.html#aca3cbaad8732d9185bb9bda1a32cd18d">PS3_INPUT_PIPE</a> ].epAddr, &amp;BUFFER_SIZE, readBuf); <span class="comment">// input on endpoint 1</span></div>
<div class="line"><a name="l00275"></a><span class="lineno"> 275</span>&#160; <span class="keywordflow">if</span> (millis() - timer &gt; 100) { <span class="comment">// Loop 100ms before processing data</span></div>
<div class="line"><a name="l00276"></a><span class="lineno"> 276</span>&#160; readReport();</div>
<div class="line"><a name="l00277"></a><span class="lineno"> 277</span>&#160;<span class="preprocessor">#ifdef PRINTREPORT</span></div>
<div class="line"><a name="l00278"></a><span class="lineno"> 278</span>&#160;<span class="preprocessor"></span> printReport(); <span class="comment">// Uncomment &quot;#define PRINTREPORT&quot; to print the report send by the PS3 Controllers</span></div>
<div class="line"><a name="l00279"></a><span class="lineno"> 279</span>&#160;<span class="preprocessor">#endif</span></div>
<div class="line"><a name="l00280"></a><span class="lineno"> 280</span>&#160;<span class="preprocessor"></span> }</div>
<div class="line"><a name="l00281"></a><span class="lineno"> 281</span>&#160; } <span class="keywordflow">else</span> <span class="keywordflow">if</span> (<a class="code" href="class_p_s3_u_s_b.html#a89aa4233f3eeeb99693a099da527ec28">PS3MoveConnected</a>) { <span class="comment">// One can only set the color of the bulb, set the rumble, set and get the bluetooth address and calibrate the magnetometer via USB</span></div>
<div class="line"><a name="l00282"></a><span class="lineno"> 282</span>&#160; <span class="keywordflow">if</span> (millis() - timer &gt; 4000) <span class="comment">// Send at least every 4th second</span></div>
<div class="line"><a name="l00283"></a><span class="lineno"> 283</span>&#160; {</div>
<div class="line"><a name="l00284"></a><span class="lineno"> 284</span>&#160; Move_Command(writeBuf, <a class="code" href="_p_s3_enums_8h.html#a2c6c24a4b63d9a34926fb35d6b49cd17">MOVE_REPORT_BUFFER_SIZE</a>); <span class="comment">// The Bulb and rumble values, has to be written again and again, for it to stay turned on</span></div>
<div class="line"><a name="l00285"></a><span class="lineno"> 285</span>&#160; timer = millis();</div>
<div class="line"><a name="l00286"></a><span class="lineno"> 286</span>&#160; }</div>
<div class="line"><a name="l00287"></a><span class="lineno"> 287</span>&#160; }</div>
<div class="line"><a name="l00288"></a><span class="lineno"> 288</span>&#160; <span class="keywordflow">return</span> 0;</div>
<div class="line"><a name="l00289"></a><span class="lineno"> 289</span>&#160;}</div>
<div class="line"><a name="l00290"></a><span class="lineno"> 290</span>&#160;</div>
<div class="line"><a name="l00291"></a><span class="lineno"> 291</span>&#160;<span class="keywordtype">void</span> PS3USB::readReport() {</div>
<div class="line"><a name="l00292"></a><span class="lineno"> 292</span>&#160; <span class="keywordflow">if</span> (readBuf == NULL)</div>
<div class="line"><a name="l00293"></a><span class="lineno"> 293</span>&#160; <span class="keywordflow">return</span>;</div>
<div class="line"><a name="l00294"></a><span class="lineno"> 294</span>&#160;</div>
<div class="line"><a name="l00295"></a><span class="lineno"> 295</span>&#160; ButtonState = (uint32_t)(readBuf[2] | ((uint16_t)readBuf[3] &lt;&lt; 8) | ((uint32_t)readBuf[4] &lt;&lt; 16));</div>
<div class="line"><a name="l00296"></a><span class="lineno"> 296</span>&#160;</div>
<div class="line"><a name="l00297"></a><span class="lineno"> 297</span>&#160; <span class="keywordflow">if</span> (ButtonState != OldButtonState) {</div>
<div class="line"><a name="l00298"></a><span class="lineno"> 298</span>&#160; ButtonClickState = ButtonState &amp; ~OldButtonState; <span class="comment">// Update click state variable</span></div>
<div class="line"><a name="l00299"></a><span class="lineno"> 299</span>&#160; OldButtonState = ButtonState;</div>
<div class="line"><a name="l00300"></a><span class="lineno"> 300</span>&#160; }</div>
<div class="line"><a name="l00301"></a><span class="lineno"> 301</span>&#160;}</div>
<div class="line"><a name="l00302"></a><span class="lineno"> 302</span>&#160;</div>
<div class="line"><a name="l00303"></a><span class="lineno"> 303</span>&#160;<span class="keywordtype">void</span> PS3USB::printReport() { <span class="comment">//Uncomment &quot;#define PRINTREPORT&quot; to print the report send by the PS3 Controllers</span></div>
<div class="line"><a name="l00304"></a><span class="lineno"> 304</span>&#160;<span class="preprocessor">#ifdef PRINTREPORT</span></div>
<div class="line"><a name="l00305"></a><span class="lineno"> 305</span>&#160;<span class="preprocessor"></span> <span class="keywordflow">if</span> (readBuf == NULL)</div>
<div class="line"><a name="l00306"></a><span class="lineno"> 306</span>&#160; <span class="keywordflow">return</span>;</div>
<div class="line"><a name="l00307"></a><span class="lineno"> 307</span>&#160; <span class="keywordflow">for</span> (uint8_t i = 0; i &lt; <a class="code" href="_p_s3_enums_8h.html#a4898fccf5d2aa053bc67894aa3627e0f">PS3_REPORT_BUFFER_SIZE</a>; i++) {</div>
<div class="line"><a name="l00308"></a><span class="lineno"> 308</span>&#160; D_PrintHex&lt;uint8_t &gt; (readBuf[i], 0x80);</div>
<div class="line"><a name="l00309"></a><span class="lineno"> 309</span>&#160; <a class="code" href="message_8h.html#a747819b0aa34f5c3ba0332c2db28c846">Notify</a>(PSTR(<span class="stringliteral">&quot; &quot;</span>), 0x80);</div>
<div class="line"><a name="l00310"></a><span class="lineno"> 310</span>&#160; }</div>
<div class="line"><a name="l00311"></a><span class="lineno"> 311</span>&#160; <a class="code" href="message_8h.html#a747819b0aa34f5c3ba0332c2db28c846">Notify</a>(PSTR(<span class="stringliteral">&quot;\r\n&quot;</span>), 0x80);</div>
<div class="line"><a name="l00312"></a><span class="lineno"> 312</span>&#160;<span class="preprocessor">#endif</span></div>
<div class="line"><a name="l00313"></a><span class="lineno"> 313</span>&#160;<span class="preprocessor"></span>}</div>
<div class="line"><a name="l00314"></a><span class="lineno"> 314</span>&#160;</div>
<div class="line"><a name="l00315"></a><span class="lineno"><a class="code" href="class_p_s3_u_s_b.html#ad1de9af6fb34f4cff6c1ed0af21b0141"> 315</a></span>&#160;<span class="keywordtype">bool</span> <a class="code" href="class_p_s3_u_s_b.html#ad1de9af6fb34f4cff6c1ed0af21b0141">PS3USB::getButtonPress</a>(<a class="code" href="controller_enums_8h.html#a03bfec859eac87be20f8952c1eb89de0">Button</a> b) {</div>
<div class="line"><a name="l00316"></a><span class="lineno"> 316</span>&#160; <span class="keywordflow">return</span> (ButtonState &amp; pgm_read_dword(&amp;<a class="code" href="_p_s3_enums_8h.html#af3392eea150ac9151bef45148f0d7895">BUTTONS</a>[(uint8_t)b]));</div>
<div class="line"><a name="l00317"></a><span class="lineno"> 317</span>&#160;}</div>
<div class="line"><a name="l00318"></a><span class="lineno"> 318</span>&#160;</div>
<div class="line"><a name="l00319"></a><span class="lineno"><a class="code" href="class_p_s3_u_s_b.html#a9a50f5ed5b41232336cc6d1870795230"> 319</a></span>&#160;<span class="keywordtype">bool</span> <a class="code" href="class_p_s3_u_s_b.html#a9a50f5ed5b41232336cc6d1870795230">PS3USB::getButtonClick</a>(<a class="code" href="controller_enums_8h.html#a03bfec859eac87be20f8952c1eb89de0">Button</a> b) {</div>
<div class="line"><a name="l00320"></a><span class="lineno"> 320</span>&#160; uint32_t button = pgm_read_dword(&amp;<a class="code" href="_p_s3_enums_8h.html#af3392eea150ac9151bef45148f0d7895">BUTTONS</a>[(uint8_t)b]);</div>
<div class="line"><a name="l00321"></a><span class="lineno"> 321</span>&#160; <span class="keywordtype">bool</span> click = (ButtonClickState &amp; button);</div>
<div class="line"><a name="l00322"></a><span class="lineno"> 322</span>&#160; ButtonClickState &amp;= ~button; <span class="comment">// clear &quot;click&quot; event</span></div>
<div class="line"><a name="l00323"></a><span class="lineno"> 323</span>&#160; <span class="keywordflow">return</span> click;</div>
<div class="line"><a name="l00324"></a><span class="lineno"> 324</span>&#160;}</div>
<div class="line"><a name="l00325"></a><span class="lineno"> 325</span>&#160;</div>
<div class="line"><a name="l00326"></a><span class="lineno"><a class="code" href="class_p_s3_u_s_b.html#a2d30813a3f5c4729b5c1662832d5a6e0"> 326</a></span>&#160;uint8_t <a class="code" href="class_p_s3_u_s_b.html#a2d30813a3f5c4729b5c1662832d5a6e0">PS3USB::getAnalogButton</a>(<a class="code" href="controller_enums_8h.html#a03bfec859eac87be20f8952c1eb89de0">Button</a> a) {</div>
<div class="line"><a name="l00327"></a><span class="lineno"> 327</span>&#160; <span class="keywordflow">if</span> (readBuf == NULL)</div>
<div class="line"><a name="l00328"></a><span class="lineno"> 328</span>&#160; <span class="keywordflow">return</span> 0;</div>
<div class="line"><a name="l00329"></a><span class="lineno"> 329</span>&#160; <span class="keywordflow">return</span> (uint8_t)(readBuf[(pgm_read_byte(&amp;<a class="code" href="_p_s3_enums_8h.html#abb19c2ede75659ab3b926996a8a09f2f">ANALOGBUTTONS</a>[(uint8_t)a])) - 9]);</div>
<div class="line"><a name="l00330"></a><span class="lineno"> 330</span>&#160;}</div>
<div class="line"><a name="l00331"></a><span class="lineno"> 331</span>&#160;</div>
<div class="line"><a name="l00332"></a><span class="lineno"><a class="code" href="class_p_s3_u_s_b.html#a2b0f391b8ae3e80b18cf9108c3e8f7e3"> 332</a></span>&#160;uint8_t <a class="code" href="class_p_s3_u_s_b.html#a2b0f391b8ae3e80b18cf9108c3e8f7e3">PS3USB::getAnalogHat</a>(<a class="code" href="controller_enums_8h.html#aaaabdefc068fd57ec2bef2b62ea4ba92">AnalogHat</a> a) {</div>
<div class="line"><a name="l00333"></a><span class="lineno"> 333</span>&#160; <span class="keywordflow">if</span> (readBuf == NULL)</div>
<div class="line"><a name="l00334"></a><span class="lineno"> 334</span>&#160; <span class="keywordflow">return</span> 0;</div>
<div class="line"><a name="l00335"></a><span class="lineno"> 335</span>&#160; <span class="keywordflow">return</span> (uint8_t)(readBuf[((uint8_t)a + 6)]);</div>
<div class="line"><a name="l00336"></a><span class="lineno"> 336</span>&#160;}</div>
<div class="line"><a name="l00337"></a><span class="lineno"> 337</span>&#160;</div>
<div class="line"><a name="l00338"></a><span class="lineno"><a class="code" href="class_p_s3_u_s_b.html#a4fe61beae6f0e36e4df1ea388bed0783"> 338</a></span>&#160;uint16_t <a class="code" href="class_p_s3_u_s_b.html#a4fe61beae6f0e36e4df1ea388bed0783">PS3USB::getSensor</a>(<a class="code" href="_p_s3_enums_8h.html#a9628766e5f200cc84b296b071b09ff4a">Sensor</a> a) {</div>
<div class="line"><a name="l00339"></a><span class="lineno"> 339</span>&#160; <span class="keywordflow">if</span> (readBuf == NULL)</div>
<div class="line"><a name="l00340"></a><span class="lineno"> 340</span>&#160; <span class="keywordflow">return</span> 0;</div>
<div class="line"><a name="l00341"></a><span class="lineno"> 341</span>&#160; <span class="keywordflow">return</span> ((readBuf[((uint16_t)a) - 9] &lt;&lt; 8) | readBuf[((uint16_t)a + 1) - 9]);</div>
<div class="line"><a name="l00342"></a><span class="lineno"> 342</span>&#160;}</div>
<div class="line"><a name="l00343"></a><span class="lineno"> 343</span>&#160;</div>
<div class="line"><a name="l00344"></a><span class="lineno"><a class="code" href="class_p_s3_u_s_b.html#a9b9e5a3a3e80957f47f86f4155fee777"> 344</a></span>&#160;<span class="keywordtype">double</span> <a class="code" href="class_p_s3_u_s_b.html#a9b9e5a3a3e80957f47f86f4155fee777">PS3USB::getAngle</a>(<a class="code" href="_p_s3_enums_8h.html#a0200d2d1b3a7930d0be6c50e7c8ae7d1">Angle</a> a) {</div>
<div class="line"><a name="l00345"></a><span class="lineno"> 345</span>&#160; <span class="keywordflow">if</span> (<a class="code" href="class_p_s3_u_s_b.html#a0dad8754ff18d0c375c2569791d50876">PS3Connected</a>) {</div>
<div class="line"><a name="l00346"></a><span class="lineno"> 346</span>&#160; <span class="keywordtype">double</span> accXval;</div>
<div class="line"><a name="l00347"></a><span class="lineno"> 347</span>&#160; <span class="keywordtype">double</span> accYval;</div>
<div class="line"><a name="l00348"></a><span class="lineno"> 348</span>&#160; <span class="keywordtype">double</span> accZval;</div>
<div class="line"><a name="l00349"></a><span class="lineno"> 349</span>&#160;</div>
<div class="line"><a name="l00350"></a><span class="lineno"> 350</span>&#160; <span class="comment">// Data for the Kionix KXPC4 used in the DualShock 3</span></div>
<div class="line"><a name="l00351"></a><span class="lineno"> 351</span>&#160; <span class="keyword">const</span> <span class="keywordtype">double</span> zeroG = 511.5; <span class="comment">// 1.65/3.3*1023 (1,65V)</span></div>
<div class="line"><a name="l00352"></a><span class="lineno"> 352</span>&#160; accXval = -((double)<a class="code" href="class_p_s3_u_s_b.html#a4fe61beae6f0e36e4df1ea388bed0783">getSensor</a>(<a class="code" href="_p_s3_enums_8h.html#a9628766e5f200cc84b296b071b09ff4aa1b657addccd19368e17fd15ce396a2eb">aX</a>) - zeroG);</div>
<div class="line"><a name="l00353"></a><span class="lineno"> 353</span>&#160; accYval = -((double)<a class="code" href="class_p_s3_u_s_b.html#a4fe61beae6f0e36e4df1ea388bed0783">getSensor</a>(<a class="code" href="_p_s3_enums_8h.html#a9628766e5f200cc84b296b071b09ff4aaba377ea700e0cdf1c61034ef60b259bd">aY</a>) - zeroG);</div>
<div class="line"><a name="l00354"></a><span class="lineno"> 354</span>&#160; accZval = -((double)<a class="code" href="class_p_s3_u_s_b.html#a4fe61beae6f0e36e4df1ea388bed0783">getSensor</a>(<a class="code" href="_p_s3_enums_8h.html#a9628766e5f200cc84b296b071b09ff4aa4a709497e95c67840807ab9e99af2bbc">aZ</a>) - zeroG);</div>
<div class="line"><a name="l00355"></a><span class="lineno"> 355</span>&#160;</div>
<div class="line"><a name="l00356"></a><span class="lineno"> 356</span>&#160; <span class="comment">// Convert to 360 degrees resolution</span></div>
<div class="line"><a name="l00357"></a><span class="lineno"> 357</span>&#160; <span class="comment">// atan2 outputs the value of -π to π (radians)</span></div>
<div class="line"><a name="l00358"></a><span class="lineno"> 358</span>&#160; <span class="comment">// We are then converting it to 0 to 2π and then to degrees</span></div>
<div class="line"><a name="l00359"></a><span class="lineno"> 359</span>&#160; <span class="keywordflow">if</span> (a == <a class="code" href="_p_s3_enums_8h.html#a0200d2d1b3a7930d0be6c50e7c8ae7d1ae3a34b760fa4a6854f28852e91d8bb47">Pitch</a>) {</div>
<div class="line"><a name="l00360"></a><span class="lineno"> 360</span>&#160; <span class="keywordtype">double</span> angle = (atan2(accYval, accZval) + PI) * RAD_TO_DEG;</div>
<div class="line"><a name="l00361"></a><span class="lineno"> 361</span>&#160; <span class="keywordflow">return</span> angle;</div>
<div class="line"><a name="l00362"></a><span class="lineno"> 362</span>&#160; } <span class="keywordflow">else</span> {</div>
<div class="line"><a name="l00363"></a><span class="lineno"> 363</span>&#160; <span class="keywordtype">double</span> angle = (atan2(accXval, accZval) + PI) * RAD_TO_DEG;</div>
<div class="line"><a name="l00297"></a><span class="lineno"> 297</span>&#160; <span class="comment">//Notify(PSTR(&quot;\r\nButtonState&quot;, 0x80);</span></div>
<div class="line"><a name="l00298"></a><span class="lineno"> 298</span>&#160; <span class="comment">//PrintHex&lt;uint32_t&gt;(ButtonState, 0x80);</span></div>
<div class="line"><a name="l00299"></a><span class="lineno"> 299</span>&#160;</div>
<div class="line"><a name="l00300"></a><span class="lineno"> 300</span>&#160; <span class="keywordflow">if</span> (ButtonState != OldButtonState) {</div>
<div class="line"><a name="l00301"></a><span class="lineno"> 301</span>&#160; ButtonClickState = ButtonState &amp; ~OldButtonState; <span class="comment">// Update click state variable</span></div>
<div class="line"><a name="l00302"></a><span class="lineno"> 302</span>&#160; OldButtonState = ButtonState;</div>
<div class="line"><a name="l00303"></a><span class="lineno"> 303</span>&#160; }</div>
<div class="line"><a name="l00304"></a><span class="lineno"> 304</span>&#160;}</div>
<div class="line"><a name="l00305"></a><span class="lineno"> 305</span>&#160;</div>
<div class="line"><a name="l00306"></a><span class="lineno"> 306</span>&#160;<span class="keywordtype">void</span> PS3USB::printReport() { <span class="comment">//Uncomment &quot;#define PRINTREPORT&quot; to print the report send by the PS3 Controllers</span></div>
<div class="line"><a name="l00307"></a><span class="lineno"> 307</span>&#160;<span class="preprocessor">#ifdef PRINTREPORT</span></div>
<div class="line"><a name="l00308"></a><span class="lineno"> 308</span>&#160;<span class="preprocessor"></span> <span class="keywordflow">if</span> (readBuf == NULL)</div>
<div class="line"><a name="l00309"></a><span class="lineno"> 309</span>&#160; <span class="keywordflow">return</span>;</div>
<div class="line"><a name="l00310"></a><span class="lineno"> 310</span>&#160; <span class="keywordflow">for</span> (uint8_t i = 0; i &lt; <a class="code" href="_p_s3_enums_8h.html#a4898fccf5d2aa053bc67894aa3627e0f">PS3_REPORT_BUFFER_SIZE</a>; i++) {</div>
<div class="line"><a name="l00311"></a><span class="lineno"> 311</span>&#160; D_PrintHex&lt;uint8_t &gt; (readBuf[i], 0x80);</div>
<div class="line"><a name="l00312"></a><span class="lineno"> 312</span>&#160; <a class="code" href="message_8h.html#a27117e124c5d66d5512fe8d494fe6338">Notify</a>(PSTR(<span class="stringliteral">&quot; &quot;</span>), 0x80);</div>
<div class="line"><a name="l00313"></a><span class="lineno"> 313</span>&#160; }</div>
<div class="line"><a name="l00314"></a><span class="lineno"> 314</span>&#160; <a class="code" href="message_8h.html#a27117e124c5d66d5512fe8d494fe6338">Notify</a>(PSTR(<span class="stringliteral">&quot;\r\n&quot;</span>), 0x80);</div>
<div class="line"><a name="l00315"></a><span class="lineno"> 315</span>&#160;<span class="preprocessor">#endif</span></div>
<div class="line"><a name="l00316"></a><span class="lineno"> 316</span>&#160;<span class="preprocessor"></span>}</div>
<div class="line"><a name="l00317"></a><span class="lineno"> 317</span>&#160;</div>
<div class="line"><a name="l00318"></a><span class="lineno"><a class="code" href="class_p_s3_u_s_b.html#ad1de9af6fb34f4cff6c1ed0af21b0141"> 318</a></span>&#160;<span class="keywordtype">bool</span> <a class="code" href="class_p_s3_u_s_b.html#ad1de9af6fb34f4cff6c1ed0af21b0141">PS3USB::getButtonPress</a>(<a class="code" href="controller_enums_8h.html#a03bfec859eac87be20f8952c1eb89de0">Button</a> b) {</div>
<div class="line"><a name="l00319"></a><span class="lineno"> 319</span>&#160; <span class="keywordflow">return</span> (ButtonState &amp; pgm_read_dword(&amp;<a class="code" href="_p_s3_enums_8h.html#af3392eea150ac9151bef45148f0d7895">BUTTONS</a>[(uint8_t)b]));</div>
<div class="line"><a name="l00320"></a><span class="lineno"> 320</span>&#160;}</div>
<div class="line"><a name="l00321"></a><span class="lineno"> 321</span>&#160;</div>
<div class="line"><a name="l00322"></a><span class="lineno"><a class="code" href="class_p_s3_u_s_b.html#a9a50f5ed5b41232336cc6d1870795230"> 322</a></span>&#160;<span class="keywordtype">bool</span> <a class="code" href="class_p_s3_u_s_b.html#a9a50f5ed5b41232336cc6d1870795230">PS3USB::getButtonClick</a>(<a class="code" href="controller_enums_8h.html#a03bfec859eac87be20f8952c1eb89de0">Button</a> b) {</div>
<div class="line"><a name="l00323"></a><span class="lineno"> 323</span>&#160; uint32_t button = pgm_read_dword(&amp;<a class="code" href="_p_s3_enums_8h.html#af3392eea150ac9151bef45148f0d7895">BUTTONS</a>[(uint8_t)b]);</div>
<div class="line"><a name="l00324"></a><span class="lineno"> 324</span>&#160; <span class="keywordtype">bool</span> click = (ButtonClickState &amp; button);</div>
<div class="line"><a name="l00325"></a><span class="lineno"> 325</span>&#160; ButtonClickState &amp;= ~button; <span class="comment">// clear &quot;click&quot; event</span></div>
<div class="line"><a name="l00326"></a><span class="lineno"> 326</span>&#160; <span class="keywordflow">return</span> click;</div>
<div class="line"><a name="l00327"></a><span class="lineno"> 327</span>&#160;}</div>
<div class="line"><a name="l00328"></a><span class="lineno"> 328</span>&#160;</div>
<div class="line"><a name="l00329"></a><span class="lineno"><a class="code" href="class_p_s3_u_s_b.html#a2d30813a3f5c4729b5c1662832d5a6e0"> 329</a></span>&#160;uint8_t <a class="code" href="class_p_s3_u_s_b.html#a2d30813a3f5c4729b5c1662832d5a6e0">PS3USB::getAnalogButton</a>(<a class="code" href="controller_enums_8h.html#a03bfec859eac87be20f8952c1eb89de0">Button</a> a) {</div>
<div class="line"><a name="l00330"></a><span class="lineno"> 330</span>&#160; <span class="keywordflow">if</span> (readBuf == NULL)</div>
<div class="line"><a name="l00331"></a><span class="lineno"> 331</span>&#160; <span class="keywordflow">return</span> 0;</div>
<div class="line"><a name="l00332"></a><span class="lineno"> 332</span>&#160; <span class="keywordflow">return</span> (uint8_t)(readBuf[(pgm_read_byte(&amp;<a class="code" href="_p_s3_enums_8h.html#abb19c2ede75659ab3b926996a8a09f2f">ANALOGBUTTONS</a>[(uint8_t)a])) - 9]);</div>
<div class="line"><a name="l00333"></a><span class="lineno"> 333</span>&#160;}</div>
<div class="line"><a name="l00334"></a><span class="lineno"> 334</span>&#160;</div>
<div class="line"><a name="l00335"></a><span class="lineno"><a class="code" href="class_p_s3_u_s_b.html#a2b0f391b8ae3e80b18cf9108c3e8f7e3"> 335</a></span>&#160;uint8_t <a class="code" href="class_p_s3_u_s_b.html#a2b0f391b8ae3e80b18cf9108c3e8f7e3">PS3USB::getAnalogHat</a>(<a class="code" href="controller_enums_8h.html#aaaabdefc068fd57ec2bef2b62ea4ba92">AnalogHat</a> a) {</div>
<div class="line"><a name="l00336"></a><span class="lineno"> 336</span>&#160; <span class="keywordflow">if</span> (readBuf == NULL)</div>
<div class="line"><a name="l00337"></a><span class="lineno"> 337</span>&#160; <span class="keywordflow">return</span> 0;</div>
<div class="line"><a name="l00338"></a><span class="lineno"> 338</span>&#160; <span class="keywordflow">return</span> (uint8_t)(readBuf[((uint8_t)a + 6)]);</div>
<div class="line"><a name="l00339"></a><span class="lineno"> 339</span>&#160;}</div>
<div class="line"><a name="l00340"></a><span class="lineno"> 340</span>&#160;</div>
<div class="line"><a name="l00341"></a><span class="lineno"><a class="code" href="class_p_s3_u_s_b.html#a4fe61beae6f0e36e4df1ea388bed0783"> 341</a></span>&#160;uint16_t <a class="code" href="class_p_s3_u_s_b.html#a4fe61beae6f0e36e4df1ea388bed0783">PS3USB::getSensor</a>(<a class="code" href="_p_s3_enums_8h.html#a9628766e5f200cc84b296b071b09ff4a">Sensor</a> a) {</div>
<div class="line"><a name="l00342"></a><span class="lineno"> 342</span>&#160; <span class="keywordflow">if</span> (readBuf == NULL)</div>
<div class="line"><a name="l00343"></a><span class="lineno"> 343</span>&#160; <span class="keywordflow">return</span> 0;</div>
<div class="line"><a name="l00344"></a><span class="lineno"> 344</span>&#160; <span class="keywordflow">return</span> ((readBuf[((uint16_t)a) - 9] &lt;&lt; 8) | readBuf[((uint16_t)a + 1) - 9]);</div>
<div class="line"><a name="l00345"></a><span class="lineno"> 345</span>&#160;}</div>
<div class="line"><a name="l00346"></a><span class="lineno"> 346</span>&#160;</div>
<div class="line"><a name="l00347"></a><span class="lineno"><a class="code" href="class_p_s3_u_s_b.html#a9b9e5a3a3e80957f47f86f4155fee777"> 347</a></span>&#160;<span class="keywordtype">double</span> <a class="code" href="class_p_s3_u_s_b.html#a9b9e5a3a3e80957f47f86f4155fee777">PS3USB::getAngle</a>(<a class="code" href="_p_s3_enums_8h.html#a0200d2d1b3a7930d0be6c50e7c8ae7d1">Angle</a> a) {</div>
<div class="line"><a name="l00348"></a><span class="lineno"> 348</span>&#160; <span class="keywordflow">if</span> (<a class="code" href="class_p_s3_u_s_b.html#a0dad8754ff18d0c375c2569791d50876">PS3Connected</a>) {</div>
<div class="line"><a name="l00349"></a><span class="lineno"> 349</span>&#160; <span class="keywordtype">double</span> accXval;</div>
<div class="line"><a name="l00350"></a><span class="lineno"> 350</span>&#160; <span class="keywordtype">double</span> accYval;</div>
<div class="line"><a name="l00351"></a><span class="lineno"> 351</span>&#160; <span class="keywordtype">double</span> accZval;</div>
<div class="line"><a name="l00352"></a><span class="lineno"> 352</span>&#160;</div>
<div class="line"><a name="l00353"></a><span class="lineno"> 353</span>&#160; <span class="comment">// Data for the Kionix KXPC4 used in the DualShock 3</span></div>
<div class="line"><a name="l00354"></a><span class="lineno"> 354</span>&#160; <span class="keyword">const</span> <span class="keywordtype">double</span> zeroG = 511.5; <span class="comment">// 1.65/3.3*1023 (1,65V)</span></div>
<div class="line"><a name="l00355"></a><span class="lineno"> 355</span>&#160; accXval = -((double)<a class="code" href="class_p_s3_u_s_b.html#a4fe61beae6f0e36e4df1ea388bed0783">getSensor</a>(<a class="code" href="_p_s3_enums_8h.html#a9628766e5f200cc84b296b071b09ff4aa1b657addccd19368e17fd15ce396a2eb">aX</a>) - zeroG);</div>
<div class="line"><a name="l00356"></a><span class="lineno"> 356</span>&#160; accYval = -((double)<a class="code" href="class_p_s3_u_s_b.html#a4fe61beae6f0e36e4df1ea388bed0783">getSensor</a>(<a class="code" href="_p_s3_enums_8h.html#a9628766e5f200cc84b296b071b09ff4aaba377ea700e0cdf1c61034ef60b259bd">aY</a>) - zeroG);</div>
<div class="line"><a name="l00357"></a><span class="lineno"> 357</span>&#160; accZval = -((double)<a class="code" href="class_p_s3_u_s_b.html#a4fe61beae6f0e36e4df1ea388bed0783">getSensor</a>(<a class="code" href="_p_s3_enums_8h.html#a9628766e5f200cc84b296b071b09ff4aa4a709497e95c67840807ab9e99af2bbc">aZ</a>) - zeroG);</div>
<div class="line"><a name="l00358"></a><span class="lineno"> 358</span>&#160;</div>
<div class="line"><a name="l00359"></a><span class="lineno"> 359</span>&#160; <span class="comment">// Convert to 360 degrees resolution</span></div>
<div class="line"><a name="l00360"></a><span class="lineno"> 360</span>&#160; <span class="comment">// atan2 outputs the value of -π to π (radians)</span></div>
<div class="line"><a name="l00361"></a><span class="lineno"> 361</span>&#160; <span class="comment">// We are then converting it to 0 to 2π and then to degrees</span></div>
<div class="line"><a name="l00362"></a><span class="lineno"> 362</span>&#160; <span class="keywordflow">if</span> (a == <a class="code" href="_p_s3_enums_8h.html#a0200d2d1b3a7930d0be6c50e7c8ae7d1ae3a34b760fa4a6854f28852e91d8bb47">Pitch</a>) {</div>
<div class="line"><a name="l00363"></a><span class="lineno"> 363</span>&#160; <span class="keywordtype">double</span> angle = (atan2(accYval, accZval) + PI) * RAD_TO_DEG;</div>
<div class="line"><a name="l00364"></a><span class="lineno"> 364</span>&#160; <span class="keywordflow">return</span> angle;</div>
<div class="line"><a name="l00365"></a><span class="lineno"> 365</span>&#160; }</div>
<div class="line"><a name="l00366"></a><span class="lineno"> 366</span>&#160; } <span class="keywordflow">else</span></div>
<div class="line"><a name="l00367"></a><span class="lineno"> 367</span>&#160; <span class="keywordflow">return</span> 0;</div>
<div class="line"><a name="l00368"></a><span class="lineno"> 368</span>&#160;}</div>
<div class="line"><a name="l00369"></a><span class="lineno"> 369</span>&#160;</div>
<div class="line"><a name="l00370"></a><span class="lineno"><a class="code" href="class_p_s3_u_s_b.html#a09da3bcd33a8dd20d7cb06a70833e448"> 370</a></span>&#160;<span class="keywordtype">bool</span> <a class="code" href="class_p_s3_u_s_b.html#a09da3bcd33a8dd20d7cb06a70833e448">PS3USB::getStatus</a>(<a class="code" href="_p_s3_enums_8h.html#a67a0db04d321a74b7e7fcfd3f1a3f70b">Status</a> c) {</div>
<div class="line"><a name="l00371"></a><span class="lineno"> 371</span>&#160; <span class="keywordflow">if</span> (readBuf == NULL)</div>
<div class="line"><a name="l00372"></a><span class="lineno"> 372</span>&#160; <span class="keywordflow">return</span> <span class="keyword">false</span>;</div>
<div class="line"><a name="l00373"></a><span class="lineno"> 373</span>&#160; <span class="keywordflow">if</span> (readBuf[((uint16_t)c &gt;&gt; 8) - 9] == ((uint8_t)c &amp; 0xff))</div>
<div class="line"><a name="l00374"></a><span class="lineno"> 374</span>&#160; <span class="keywordflow">return</span> <span class="keyword">true</span>;</div>
<div class="line"><a name="l00365"></a><span class="lineno"> 365</span>&#160; } <span class="keywordflow">else</span> {</div>
<div class="line"><a name="l00366"></a><span class="lineno"> 366</span>&#160; <span class="keywordtype">double</span> angle = (atan2(accXval, accZval) + PI) * RAD_TO_DEG;</div>
<div class="line"><a name="l00367"></a><span class="lineno"> 367</span>&#160; <span class="keywordflow">return</span> angle;</div>
<div class="line"><a name="l00368"></a><span class="lineno"> 368</span>&#160; }</div>
<div class="line"><a name="l00369"></a><span class="lineno"> 369</span>&#160; } <span class="keywordflow">else</span></div>
<div class="line"><a name="l00370"></a><span class="lineno"> 370</span>&#160; <span class="keywordflow">return</span> 0;</div>
<div class="line"><a name="l00371"></a><span class="lineno"> 371</span>&#160;}</div>
<div class="line"><a name="l00372"></a><span class="lineno"> 372</span>&#160;</div>
<div class="line"><a name="l00373"></a><span class="lineno"><a class="code" href="class_p_s3_u_s_b.html#a09da3bcd33a8dd20d7cb06a70833e448"> 373</a></span>&#160;<span class="keywordtype">bool</span> <a class="code" href="class_p_s3_u_s_b.html#a09da3bcd33a8dd20d7cb06a70833e448">PS3USB::getStatus</a>(<a class="code" href="_p_s3_enums_8h.html#a67a0db04d321a74b7e7fcfd3f1a3f70b">Status</a> c) {</div>
<div class="line"><a name="l00374"></a><span class="lineno"> 374</span>&#160; <span class="keywordflow">if</span> (readBuf == NULL)</div>
<div class="line"><a name="l00375"></a><span class="lineno"> 375</span>&#160; <span class="keywordflow">return</span> <span class="keyword">false</span>;</div>
<div class="line"><a name="l00376"></a><span class="lineno"> 376</span>&#160;}</div>
<div class="line"><a name="l00377"></a><span class="lineno"> 377</span>&#160;</div>
<div class="line"><a name="l00378"></a><span class="lineno"><a class="code" href="class_p_s3_u_s_b.html#ae3f19089341bb545f31b3b01e77131ae"> 378</a></span>&#160;String <a class="code" href="class_p_s3_u_s_b.html#ae3f19089341bb545f31b3b01e77131ae">PS3USB::getStatusString</a>() {</div>
<div class="line"><a name="l00379"></a><span class="lineno"> 379</span>&#160; <span class="keywordflow">if</span> (<a class="code" href="class_p_s3_u_s_b.html#a0dad8754ff18d0c375c2569791d50876">PS3Connected</a> || <a class="code" href="class_p_s3_u_s_b.html#a54b2dcaa1e9acef83de2376b50c7ff09">PS3NavigationConnected</a>) {</div>
<div class="line"><a name="l00380"></a><span class="lineno"> 380</span>&#160; <span class="keywordtype">char</span> statusOutput[100];</div>
<div class="line"><a name="l00381"></a><span class="lineno"> 381</span>&#160;</div>
<div class="line"><a name="l00382"></a><span class="lineno"> 382</span>&#160; strcpy(statusOutput, <span class="stringliteral">&quot;ConnectionStatus: &quot;</span>);</div>
<div class="line"><a name="l00383"></a><span class="lineno"> 383</span>&#160;</div>
<div class="line"><a name="l00384"></a><span class="lineno"> 384</span>&#160; <span class="keywordflow">if</span> (<a class="code" href="class_p_s3_u_s_b.html#a09da3bcd33a8dd20d7cb06a70833e448">getStatus</a>(<a class="code" href="_p_s3_enums_8h.html#a67a0db04d321a74b7e7fcfd3f1a3f70baff01ce39b42bec30132b0fc53c882387">Plugged</a>)) strcat(statusOutput, <span class="stringliteral">&quot;Plugged&quot;</span>);</div>
<div class="line"><a name="l00385"></a><span class="lineno"> 385</span>&#160; <span class="keywordflow">else</span> <span class="keywordflow">if</span> (<a class="code" href="class_p_s3_u_s_b.html#a09da3bcd33a8dd20d7cb06a70833e448">getStatus</a>(<a class="code" href="_p_s3_enums_8h.html#a67a0db04d321a74b7e7fcfd3f1a3f70bae37160f3a65bb54a91fb5efb4f971924">Unplugged</a>)) strcat(statusOutput, <span class="stringliteral">&quot;Unplugged&quot;</span>);</div>
<div class="line"><a name="l00386"></a><span class="lineno"> 386</span>&#160; <span class="keywordflow">else</span> strcat(statusOutput, <span class="stringliteral">&quot;Error&quot;</span>);</div>
<div class="line"><a name="l00387"></a><span class="lineno"> 387</span>&#160;</div>
<div class="line"><a name="l00388"></a><span class="lineno"> 388</span>&#160;</div>
<div class="line"><a name="l00389"></a><span class="lineno"> 389</span>&#160; strcat(statusOutput, <span class="stringliteral">&quot; - PowerRating: &quot;</span>);</div>
<div class="line"><a name="l00376"></a><span class="lineno"> 376</span>&#160; <span class="keywordflow">if</span> (readBuf[((uint16_t)c &gt;&gt; 8) - 9] == ((uint8_t)c &amp; 0xff))</div>
<div class="line"><a name="l00377"></a><span class="lineno"> 377</span>&#160; <span class="keywordflow">return</span> <span class="keyword">true</span>;</div>
<div class="line"><a name="l00378"></a><span class="lineno"> 378</span>&#160; <span class="keywordflow">return</span> <span class="keyword">false</span>;</div>
<div class="line"><a name="l00379"></a><span class="lineno"> 379</span>&#160;}</div>
<div class="line"><a name="l00380"></a><span class="lineno"> 380</span>&#160;</div>
<div class="line"><a name="l00381"></a><span class="lineno"><a class="code" href="class_p_s3_u_s_b.html#ae3f19089341bb545f31b3b01e77131ae"> 381</a></span>&#160;String <a class="code" href="class_p_s3_u_s_b.html#ae3f19089341bb545f31b3b01e77131ae">PS3USB::getStatusString</a>() {</div>
<div class="line"><a name="l00382"></a><span class="lineno"> 382</span>&#160; <span class="keywordflow">if</span> (<a class="code" href="class_p_s3_u_s_b.html#a0dad8754ff18d0c375c2569791d50876">PS3Connected</a> || <a class="code" href="class_p_s3_u_s_b.html#a54b2dcaa1e9acef83de2376b50c7ff09">PS3NavigationConnected</a>) {</div>
<div class="line"><a name="l00383"></a><span class="lineno"> 383</span>&#160; <span class="keywordtype">char</span> statusOutput[100];</div>
<div class="line"><a name="l00384"></a><span class="lineno"> 384</span>&#160;</div>
<div class="line"><a name="l00385"></a><span class="lineno"> 385</span>&#160; strcpy(statusOutput, <span class="stringliteral">&quot;ConnectionStatus: &quot;</span>);</div>
<div class="line"><a name="l00386"></a><span class="lineno"> 386</span>&#160;</div>
<div class="line"><a name="l00387"></a><span class="lineno"> 387</span>&#160; <span class="keywordflow">if</span> (<a class="code" href="class_p_s3_u_s_b.html#a09da3bcd33a8dd20d7cb06a70833e448">getStatus</a>(<a class="code" href="_p_s3_enums_8h.html#a67a0db04d321a74b7e7fcfd3f1a3f70baff01ce39b42bec30132b0fc53c882387">Plugged</a>)) strcat(statusOutput, <span class="stringliteral">&quot;Plugged&quot;</span>);</div>
<div class="line"><a name="l00388"></a><span class="lineno"> 388</span>&#160; <span class="keywordflow">else</span> <span class="keywordflow">if</span> (<a class="code" href="class_p_s3_u_s_b.html#a09da3bcd33a8dd20d7cb06a70833e448">getStatus</a>(<a class="code" href="_p_s3_enums_8h.html#a67a0db04d321a74b7e7fcfd3f1a3f70bae37160f3a65bb54a91fb5efb4f971924">Unplugged</a>)) strcat(statusOutput, <span class="stringliteral">&quot;Unplugged&quot;</span>);</div>
<div class="line"><a name="l00389"></a><span class="lineno"> 389</span>&#160; <span class="keywordflow">else</span> strcat(statusOutput, <span class="stringliteral">&quot;Error&quot;</span>);</div>
<div class="line"><a name="l00390"></a><span class="lineno"> 390</span>&#160;</div>
<div class="line"><a name="l00391"></a><span class="lineno"> 391</span>&#160; <span class="keywordflow">if</span> (<a class="code" href="class_p_s3_u_s_b.html#a09da3bcd33a8dd20d7cb06a70833e448">getStatus</a>(<a class="code" href="_p_s3_enums_8h.html#a67a0db04d321a74b7e7fcfd3f1a3f70ba5a86ae1482947377a116685c168d1773">Charging</a>)) strcat(statusOutput, <span class="stringliteral">&quot;Charging&quot;</span>);</div>
<div class="line"><a name="l00392"></a><span class="lineno"> 392</span>&#160; <span class="keywordflow">else</span> <span class="keywordflow">if</span> (<a class="code" href="class_p_s3_u_s_b.html#a09da3bcd33a8dd20d7cb06a70833e448">getStatus</a>(<a class="code" href="_p_s3_enums_8h.html#a67a0db04d321a74b7e7fcfd3f1a3f70bac138cecbd4ef1ba0f9e0ab12440a6df6">NotCharging</a>)) strcat(statusOutput, <span class="stringliteral">&quot;Not Charging&quot;</span>);</div>
<div class="line"><a name="l00393"></a><span class="lineno"> 393</span>&#160; <span class="keywordflow">else</span> <span class="keywordflow">if</span> (<a class="code" href="class_p_s3_u_s_b.html#a09da3bcd33a8dd20d7cb06a70833e448">getStatus</a>(<a class="code" href="_p_s3_enums_8h.html#a67a0db04d321a74b7e7fcfd3f1a3f70ba82084136e62c38642986b05419b4e734">Shutdown</a>)) strcat(statusOutput, <span class="stringliteral">&quot;Shutdown&quot;</span>);</div>
<div class="line"><a name="l00394"></a><span class="lineno"> 394</span>&#160; <span class="keywordflow">else</span> <span class="keywordflow">if</span> (<a class="code" href="class_p_s3_u_s_b.html#a09da3bcd33a8dd20d7cb06a70833e448">getStatus</a>(<a class="code" href="_p_s3_enums_8h.html#a67a0db04d321a74b7e7fcfd3f1a3f70ba96cc2a0090ada376561406d48d1f2089">Dying</a>)) strcat(statusOutput, <span class="stringliteral">&quot;Dying&quot;</span>);</div>
<div class="line"><a name="l00395"></a><span class="lineno"> 395</span>&#160; <span class="keywordflow">else</span> <span class="keywordflow">if</span> (<a class="code" href="class_p_s3_u_s_b.html#a09da3bcd33a8dd20d7cb06a70833e448">getStatus</a>(<a class="code" href="_p_s3_enums_8h.html#a67a0db04d321a74b7e7fcfd3f1a3f70ba7a352a3dd2accc1dd65a4538c3754ee8">Low</a>)) strcat(statusOutput, <span class="stringliteral">&quot;Low&quot;</span>);</div>
<div class="line"><a name="l00396"></a><span class="lineno"> 396</span>&#160; <span class="keywordflow">else</span> <span class="keywordflow">if</span> (<a class="code" href="class_p_s3_u_s_b.html#a09da3bcd33a8dd20d7cb06a70833e448">getStatus</a>(<a class="code" href="_p_s3_enums_8h.html#a67a0db04d321a74b7e7fcfd3f1a3f70ba24c57acd029e3f96fede49402ea01e6f">High</a>)) strcat(statusOutput, <span class="stringliteral">&quot;High&quot;</span>);</div>
<div class="line"><a name="l00397"></a><span class="lineno"> 397</span>&#160; <span class="keywordflow">else</span> <span class="keywordflow">if</span> (<a class="code" href="class_p_s3_u_s_b.html#a09da3bcd33a8dd20d7cb06a70833e448">getStatus</a>(<a class="code" href="_p_s3_enums_8h.html#a67a0db04d321a74b7e7fcfd3f1a3f70ba8b7c5cd8bd8eb51ee6d3fd0eac584679">Full</a>)) strcat(statusOutput, <span class="stringliteral">&quot;Full&quot;</span>);</div>
<div class="line"><a name="l00398"></a><span class="lineno"> 398</span>&#160; <span class="keywordflow">else</span> strcat(statusOutput, <span class="stringliteral">&quot;Error&quot;</span>);</div>
<div class="line"><a name="l00399"></a><span class="lineno"> 399</span>&#160;</div>
<div class="line"><a name="l00400"></a><span class="lineno"> 400</span>&#160; strcat(statusOutput, <span class="stringliteral">&quot; - WirelessStatus: &quot;</span>);</div>
<div class="line"><a name="l00401"></a><span class="lineno"> 401</span>&#160;</div>
<div class="line"><a name="l00402"></a><span class="lineno"> 402</span>&#160; <span class="keywordflow">if</span> (<a class="code" href="class_p_s3_u_s_b.html#a09da3bcd33a8dd20d7cb06a70833e448">getStatus</a>(<a class="code" href="_p_s3_enums_8h.html#a67a0db04d321a74b7e7fcfd3f1a3f70ba71c14aef95c9953673a880e2633fa209">CableRumble</a>)) strcat(statusOutput, <span class="stringliteral">&quot;Cable - Rumble is on&quot;</span>);</div>
<div class="line"><a name="l00403"></a><span class="lineno"> 403</span>&#160; <span class="keywordflow">else</span> <span class="keywordflow">if</span> (<a class="code" href="class_p_s3_u_s_b.html#a09da3bcd33a8dd20d7cb06a70833e448">getStatus</a>(<a class="code" href="_p_s3_enums_8h.html#a67a0db04d321a74b7e7fcfd3f1a3f70ba1a36ca9a60a5e244f3404ec0db7b44a1">Cable</a>)) strcat(statusOutput, <span class="stringliteral">&quot;Cable - Rumble is off&quot;</span>);</div>
<div class="line"><a name="l00404"></a><span class="lineno"> 404</span>&#160; <span class="keywordflow">else</span> <span class="keywordflow">if</span> (<a class="code" href="class_p_s3_u_s_b.html#a09da3bcd33a8dd20d7cb06a70833e448">getStatus</a>(<a class="code" href="_p_s3_enums_8h.html#a67a0db04d321a74b7e7fcfd3f1a3f70ba27912f9ea05a45aada21fc375817342c">BluetoothRumble</a>)) strcat(statusOutput, <span class="stringliteral">&quot;Bluetooth - Rumble is on&quot;</span>);</div>
<div class="line"><a name="l00405"></a><span class="lineno"> 405</span>&#160; <span class="keywordflow">else</span> <span class="keywordflow">if</span> (<a class="code" href="class_p_s3_u_s_b.html#a09da3bcd33a8dd20d7cb06a70833e448">getStatus</a>(<a class="code" href="_p_s3_enums_8h.html#a67a0db04d321a74b7e7fcfd3f1a3f70ba730728c9aac83393ac83f96a8125b8bb">Bluetooth</a>)) strcat(statusOutput, <span class="stringliteral">&quot;Bluetooth - Rumble is off&quot;</span>);</div>
<div class="line"><a name="l00406"></a><span class="lineno"> 406</span>&#160; <span class="keywordflow">else</span> strcat(statusOutput, <span class="stringliteral">&quot;Error&quot;</span>);</div>
<div class="line"><a name="l00407"></a><span class="lineno"> 407</span>&#160;</div>
<div class="line"><a name="l00408"></a><span class="lineno"> 408</span>&#160; <span class="keywordflow">return</span> statusOutput;</div>
<div class="line"><a name="l00409"></a><span class="lineno"> 409</span>&#160; } <span class="keywordflow">else</span></div>
<div class="line"><a name="l00410"></a><span class="lineno"> 410</span>&#160; <span class="keywordflow">return</span> <span class="stringliteral">&quot;Error&quot;</span>;</div>
<div class="line"><a name="l00411"></a><span class="lineno"> 411</span>&#160;}</div>
<div class="line"><a name="l00412"></a><span class="lineno"> 412</span>&#160;</div>
<div class="line"><a name="l00413"></a><span class="lineno"> 413</span>&#160;<span class="comment">/* Playstation Sixaxis Dualshock and Navigation Controller commands */</span></div>
<div class="line"><a name="l00414"></a><span class="lineno"> 414</span>&#160;<span class="keywordtype">void</span> PS3USB::PS3_Command(uint8_t* data, uint16_t nbytes) {</div>
<div class="line"><a name="l00415"></a><span class="lineno"> 415</span>&#160; <span class="comment">//bmRequest = Host to device (0x00) | Class (0x20) | Interface (0x01) = 0x21, bRequest = Set Report (0x09), Report ID (0x01), Report Type (Output 0x02), interface (0x00), datalength, datalength, data)</span></div>
<div class="line"><a name="l00416"></a><span class="lineno"> 416</span>&#160; <a class="code" href="class_p_s3_u_s_b.html#aa1873f41ae0da7c4568cfb7517560c48">pUsb</a>-&gt;<a class="code" href="class_u_s_b.html#a636695a5c3d35cd6b9e31c54edfacd7c">ctrlReq</a>(<a class="code" href="class_p_s3_u_s_b.html#a3f43df159277003acdf7dd107bda27fd">bAddress</a>, <a class="code" href="class_p_s3_u_s_b.html#a394dbb0a59b587210e5958f08dac48f1">epInfo</a>[<a class="code" href="_p_s3_u_s_b_8h.html#ae6276fa555fe14995bee0713be663333">PS3_CONTROL_PIPE</a>].epAddr, <a class="code" href="_b_t_d_8h.html#a5bd4ea095da29635414952894bd527f5">bmREQ_HID_OUT</a>, <a class="code" href="_b_t_d_8h.html#aee05d40a014750b24a7e9967f6f389f4">HID_REQUEST_SET_REPORT</a>, 0x01, 0x02, 0x00, nbytes, nbytes, data, NULL);</div>
<div class="line"><a name="l00417"></a><span class="lineno"> 417</span>&#160;}</div>
<div class="line"><a name="l00418"></a><span class="lineno"> 418</span>&#160;</div>
<div class="line"><a name="l00419"></a><span class="lineno"><a class="code" href="class_p_s3_u_s_b.html#ac7adc7365bb45d15c37e22f26f012498"> 419</a></span>&#160;<span class="keywordtype">void</span> <a class="code" href="class_p_s3_u_s_b.html#ac7adc7365bb45d15c37e22f26f012498">PS3USB::setAllOff</a>() {</div>
<div class="line"><a name="l00420"></a><span class="lineno"> 420</span>&#160; <span class="keywordflow">for</span> (uint8_t i = 0; i &lt; <a class="code" href="_p_s3_enums_8h.html#a4898fccf5d2aa053bc67894aa3627e0f">PS3_REPORT_BUFFER_SIZE</a>; i++)</div>
<div class="line"><a name="l00421"></a><span class="lineno"> 421</span>&#160; writeBuf[i] = pgm_read_byte(&amp;<a class="code" href="_p_s3_enums_8h.html#a8cf62ee374ebaa5f7582c073e624bc74">PS3_REPORT_BUFFER</a>[i]); <span class="comment">// Reset buffer</span></div>
<div class="line"><a name="l00422"></a><span class="lineno"> 422</span>&#160;</div>
<div class="line"><a name="l00423"></a><span class="lineno"> 423</span>&#160; PS3_Command(writeBuf, PS3_REPORT_BUFFER_SIZE);</div>
<div class="line"><a name="l00424"></a><span class="lineno"> 424</span>&#160;}</div>
<div class="line"><a name="l00391"></a><span class="lineno"> 391</span>&#160;</div>
<div class="line"><a name="l00392"></a><span class="lineno"> 392</span>&#160; strcat(statusOutput, <span class="stringliteral">&quot; - PowerRating: &quot;</span>);</div>
<div class="line"><a name="l00393"></a><span class="lineno"> 393</span>&#160;</div>
<div class="line"><a name="l00394"></a><span class="lineno"> 394</span>&#160; <span class="keywordflow">if</span> (<a class="code" href="class_p_s3_u_s_b.html#a09da3bcd33a8dd20d7cb06a70833e448">getStatus</a>(<a class="code" href="_p_s3_enums_8h.html#a67a0db04d321a74b7e7fcfd3f1a3f70ba5a86ae1482947377a116685c168d1773">Charging</a>)) strcat(statusOutput, <span class="stringliteral">&quot;Charging&quot;</span>);</div>
<div class="line"><a name="l00395"></a><span class="lineno"> 395</span>&#160; <span class="keywordflow">else</span> <span class="keywordflow">if</span> (<a class="code" href="class_p_s3_u_s_b.html#a09da3bcd33a8dd20d7cb06a70833e448">getStatus</a>(<a class="code" href="_p_s3_enums_8h.html#a67a0db04d321a74b7e7fcfd3f1a3f70bac138cecbd4ef1ba0f9e0ab12440a6df6">NotCharging</a>)) strcat(statusOutput, <span class="stringliteral">&quot;Not Charging&quot;</span>);</div>
<div class="line"><a name="l00396"></a><span class="lineno"> 396</span>&#160; <span class="keywordflow">else</span> <span class="keywordflow">if</span> (<a class="code" href="class_p_s3_u_s_b.html#a09da3bcd33a8dd20d7cb06a70833e448">getStatus</a>(<a class="code" href="_p_s3_enums_8h.html#a67a0db04d321a74b7e7fcfd3f1a3f70ba82084136e62c38642986b05419b4e734">Shutdown</a>)) strcat(statusOutput, <span class="stringliteral">&quot;Shutdown&quot;</span>);</div>
<div class="line"><a name="l00397"></a><span class="lineno"> 397</span>&#160; <span class="keywordflow">else</span> <span class="keywordflow">if</span> (<a class="code" href="class_p_s3_u_s_b.html#a09da3bcd33a8dd20d7cb06a70833e448">getStatus</a>(<a class="code" href="_p_s3_enums_8h.html#a67a0db04d321a74b7e7fcfd3f1a3f70ba96cc2a0090ada376561406d48d1f2089">Dying</a>)) strcat(statusOutput, <span class="stringliteral">&quot;Dying&quot;</span>);</div>
<div class="line"><a name="l00398"></a><span class="lineno"> 398</span>&#160; <span class="keywordflow">else</span> <span class="keywordflow">if</span> (<a class="code" href="class_p_s3_u_s_b.html#a09da3bcd33a8dd20d7cb06a70833e448">getStatus</a>(<a class="code" href="_p_s3_enums_8h.html#a67a0db04d321a74b7e7fcfd3f1a3f70ba7a352a3dd2accc1dd65a4538c3754ee8">Low</a>)) strcat(statusOutput, <span class="stringliteral">&quot;Low&quot;</span>);</div>
<div class="line"><a name="l00399"></a><span class="lineno"> 399</span>&#160; <span class="keywordflow">else</span> <span class="keywordflow">if</span> (<a class="code" href="class_p_s3_u_s_b.html#a09da3bcd33a8dd20d7cb06a70833e448">getStatus</a>(<a class="code" href="_p_s3_enums_8h.html#a67a0db04d321a74b7e7fcfd3f1a3f70ba24c57acd029e3f96fede49402ea01e6f">High</a>)) strcat(statusOutput, <span class="stringliteral">&quot;High&quot;</span>);</div>
<div class="line"><a name="l00400"></a><span class="lineno"> 400</span>&#160; <span class="keywordflow">else</span> <span class="keywordflow">if</span> (<a class="code" href="class_p_s3_u_s_b.html#a09da3bcd33a8dd20d7cb06a70833e448">getStatus</a>(<a class="code" href="_p_s3_enums_8h.html#a67a0db04d321a74b7e7fcfd3f1a3f70ba8b7c5cd8bd8eb51ee6d3fd0eac584679">Full</a>)) strcat(statusOutput, <span class="stringliteral">&quot;Full&quot;</span>);</div>
<div class="line"><a name="l00401"></a><span class="lineno"> 401</span>&#160; <span class="keywordflow">else</span> strcat(statusOutput, <span class="stringliteral">&quot;Error&quot;</span>);</div>
<div class="line"><a name="l00402"></a><span class="lineno"> 402</span>&#160;</div>
<div class="line"><a name="l00403"></a><span class="lineno"> 403</span>&#160; strcat(statusOutput, <span class="stringliteral">&quot; - WirelessStatus: &quot;</span>);</div>
<div class="line"><a name="l00404"></a><span class="lineno"> 404</span>&#160;</div>
<div class="line"><a name="l00405"></a><span class="lineno"> 405</span>&#160; <span class="keywordflow">if</span> (<a class="code" href="class_p_s3_u_s_b.html#a09da3bcd33a8dd20d7cb06a70833e448">getStatus</a>(<a class="code" href="_p_s3_enums_8h.html#a67a0db04d321a74b7e7fcfd3f1a3f70ba71c14aef95c9953673a880e2633fa209">CableRumble</a>)) strcat(statusOutput, <span class="stringliteral">&quot;Cable - Rumble is on&quot;</span>);</div>
<div class="line"><a name="l00406"></a><span class="lineno"> 406</span>&#160; <span class="keywordflow">else</span> <span class="keywordflow">if</span> (<a class="code" href="class_p_s3_u_s_b.html#a09da3bcd33a8dd20d7cb06a70833e448">getStatus</a>(<a class="code" href="_p_s3_enums_8h.html#a67a0db04d321a74b7e7fcfd3f1a3f70ba1a36ca9a60a5e244f3404ec0db7b44a1">Cable</a>)) strcat(statusOutput, <span class="stringliteral">&quot;Cable - Rumble is off&quot;</span>);</div>
<div class="line"><a name="l00407"></a><span class="lineno"> 407</span>&#160; <span class="keywordflow">else</span> <span class="keywordflow">if</span> (<a class="code" href="class_p_s3_u_s_b.html#a09da3bcd33a8dd20d7cb06a70833e448">getStatus</a>(<a class="code" href="_p_s3_enums_8h.html#a67a0db04d321a74b7e7fcfd3f1a3f70ba27912f9ea05a45aada21fc375817342c">BluetoothRumble</a>)) strcat(statusOutput, <span class="stringliteral">&quot;Bluetooth - Rumble is on&quot;</span>);</div>
<div class="line"><a name="l00408"></a><span class="lineno"> 408</span>&#160; <span class="keywordflow">else</span> <span class="keywordflow">if</span> (<a class="code" href="class_p_s3_u_s_b.html#a09da3bcd33a8dd20d7cb06a70833e448">getStatus</a>(<a class="code" href="_p_s3_enums_8h.html#a67a0db04d321a74b7e7fcfd3f1a3f70ba730728c9aac83393ac83f96a8125b8bb">Bluetooth</a>)) strcat(statusOutput, <span class="stringliteral">&quot;Bluetooth - Rumble is off&quot;</span>);</div>
<div class="line"><a name="l00409"></a><span class="lineno"> 409</span>&#160; <span class="keywordflow">else</span> strcat(statusOutput, <span class="stringliteral">&quot;Error&quot;</span>);</div>
<div class="line"><a name="l00410"></a><span class="lineno"> 410</span>&#160;</div>
<div class="line"><a name="l00411"></a><span class="lineno"> 411</span>&#160; <span class="keywordflow">return</span> statusOutput;</div>
<div class="line"><a name="l00412"></a><span class="lineno"> 412</span>&#160; } <span class="keywordflow">else</span></div>
<div class="line"><a name="l00413"></a><span class="lineno"> 413</span>&#160; <span class="keywordflow">return</span> <span class="stringliteral">&quot;Error&quot;</span>;</div>
<div class="line"><a name="l00414"></a><span class="lineno"> 414</span>&#160;}</div>
<div class="line"><a name="l00415"></a><span class="lineno"> 415</span>&#160;</div>
<div class="line"><a name="l00416"></a><span class="lineno"> 416</span>&#160;<span class="comment">/* Playstation Sixaxis Dualshock and Navigation Controller commands */</span></div>
<div class="line"><a name="l00417"></a><span class="lineno"> 417</span>&#160;<span class="keywordtype">void</span> PS3USB::PS3_Command(uint8_t* data, uint16_t nbytes) {</div>
<div class="line"><a name="l00418"></a><span class="lineno"> 418</span>&#160; <span class="comment">//bmRequest = Host to device (0x00) | Class (0x20) | Interface (0x01) = 0x21, bRequest = Set Report (0x09), Report ID (0x01), Report Type (Output 0x02), interface (0x00), datalength, datalength, data)</span></div>
<div class="line"><a name="l00419"></a><span class="lineno"> 419</span>&#160; <a class="code" href="class_p_s3_u_s_b.html#aa1873f41ae0da7c4568cfb7517560c48">pUsb</a>-&gt;<a class="code" href="class_u_s_b.html#a636695a5c3d35cd6b9e31c54edfacd7c">ctrlReq</a>(<a class="code" href="class_p_s3_u_s_b.html#a3f43df159277003acdf7dd107bda27fd">bAddress</a>, <a class="code" href="class_p_s3_u_s_b.html#a394dbb0a59b587210e5958f08dac48f1">epInfo</a>[<a class="code" href="_p_s3_u_s_b_8h.html#ae6276fa555fe14995bee0713be663333">PS3_CONTROL_PIPE</a>].epAddr, <a class="code" href="_b_t_d_8h.html#a5bd4ea095da29635414952894bd527f5">bmREQ_HID_OUT</a>, <a class="code" href="_b_t_d_8h.html#aee05d40a014750b24a7e9967f6f389f4">HID_REQUEST_SET_REPORT</a>, 0x01, 0x02, 0x00, nbytes, nbytes, data, NULL);</div>
<div class="line"><a name="l00420"></a><span class="lineno"> 420</span>&#160;}</div>
<div class="line"><a name="l00421"></a><span class="lineno"> 421</span>&#160;</div>
<div class="line"><a name="l00422"></a><span class="lineno"><a class="code" href="class_p_s3_u_s_b.html#ac7adc7365bb45d15c37e22f26f012498"> 422</a></span>&#160;<span class="keywordtype">void</span> <a class="code" href="class_p_s3_u_s_b.html#ac7adc7365bb45d15c37e22f26f012498">PS3USB::setAllOff</a>() {</div>
<div class="line"><a name="l00423"></a><span class="lineno"> 423</span>&#160; <span class="keywordflow">for</span> (uint8_t i = 0; i &lt; <a class="code" href="_p_s3_enums_8h.html#a4898fccf5d2aa053bc67894aa3627e0f">PS3_REPORT_BUFFER_SIZE</a>; i++)</div>
<div class="line"><a name="l00424"></a><span class="lineno"> 424</span>&#160; writeBuf[i] = pgm_read_byte(&amp;<a class="code" href="_p_s3_enums_8h.html#a8cf62ee374ebaa5f7582c073e624bc74">PS3_REPORT_BUFFER</a>[i]); <span class="comment">// Reset buffer</span></div>
<div class="line"><a name="l00425"></a><span class="lineno"> 425</span>&#160;</div>
<div class="line"><a name="l00426"></a><span class="lineno"><a class="code" href="class_p_s3_u_s_b.html#aaa1e66d7397be6364d4f76749cbaad5a"> 426</a></span>&#160;<span class="keywordtype">void</span> <a class="code" href="class_p_s3_u_s_b.html#aaa1e66d7397be6364d4f76749cbaad5a">PS3USB::setRumbleOff</a>() {</div>
<div class="line"><a name="l00427"></a><span class="lineno"> 427</span>&#160; writeBuf[1] = 0x00;</div>
<div class="line"><a name="l00428"></a><span class="lineno"> 428</span>&#160; writeBuf[2] = 0x00; <span class="comment">//low mode off</span></div>
<div class="line"><a name="l00429"></a><span class="lineno"> 429</span>&#160; writeBuf[3] = 0x00;</div>
<div class="line"><a name="l00430"></a><span class="lineno"> 430</span>&#160; writeBuf[4] = 0x00; <span class="comment">//high mode off</span></div>
<div class="line"><a name="l00431"></a><span class="lineno"> 431</span>&#160;</div>
<div class="line"><a name="l00432"></a><span class="lineno"> 432</span>&#160; PS3_Command(writeBuf, PS3_REPORT_BUFFER_SIZE);</div>
<div class="line"><a name="l00433"></a><span class="lineno"> 433</span>&#160;}</div>
<div class="line"><a name="l00426"></a><span class="lineno"> 426</span>&#160; PS3_Command(writeBuf, PS3_REPORT_BUFFER_SIZE);</div>
<div class="line"><a name="l00427"></a><span class="lineno"> 427</span>&#160;}</div>
<div class="line"><a name="l00428"></a><span class="lineno"> 428</span>&#160;</div>
<div class="line"><a name="l00429"></a><span class="lineno"><a class="code" href="class_p_s3_u_s_b.html#aaa1e66d7397be6364d4f76749cbaad5a"> 429</a></span>&#160;<span class="keywordtype">void</span> <a class="code" href="class_p_s3_u_s_b.html#aaa1e66d7397be6364d4f76749cbaad5a">PS3USB::setRumbleOff</a>() {</div>
<div class="line"><a name="l00430"></a><span class="lineno"> 430</span>&#160; writeBuf[1] = 0x00;</div>
<div class="line"><a name="l00431"></a><span class="lineno"> 431</span>&#160; writeBuf[2] = 0x00; <span class="comment">//low mode off</span></div>
<div class="line"><a name="l00432"></a><span class="lineno"> 432</span>&#160; writeBuf[3] = 0x00;</div>
<div class="line"><a name="l00433"></a><span class="lineno"> 433</span>&#160; writeBuf[4] = 0x00; <span class="comment">//high mode off</span></div>
<div class="line"><a name="l00434"></a><span class="lineno"> 434</span>&#160;</div>
<div class="line"><a name="l00435"></a><span class="lineno"><a class="code" href="class_p_s3_u_s_b.html#a5dc4e5d1ebd5ca24da7cdc9dd08c94e1"> 435</a></span>&#160;<span class="keywordtype">void</span> <a class="code" href="class_p_s3_u_s_b.html#a5dc4e5d1ebd5ca24da7cdc9dd08c94e1">PS3USB::setRumbleOn</a>(<a class="code" href="_p_s3_enums_8h.html#aff4be38428d075a117a5bb7f6209a231">Rumble</a> mode) {</div>
<div class="line"><a name="l00436"></a><span class="lineno"> 436</span>&#160; <span class="keywordflow">if</span> ((mode &amp; 0x30) &gt; 0x00) {</div>
<div class="line"><a name="l00437"></a><span class="lineno"> 437</span>&#160; uint8_t power[2] = {0xff, 0x00}; <span class="comment">// Defaults to RumbleLow</span></div>
<div class="line"><a name="l00438"></a><span class="lineno"> 438</span>&#160; <span class="keywordflow">if</span> (mode == <a class="code" href="_p_s3_enums_8h.html#aff4be38428d075a117a5bb7f6209a231a5819f165165589a8e65b07bf46c7382b">RumbleHigh</a>) {</div>
<div class="line"><a name="l00439"></a><span class="lineno"> 439</span>&#160; power[0] = 0x00;</div>
<div class="line"><a name="l00440"></a><span class="lineno"> 440</span>&#160; power[1] = 0xff;</div>
<div class="line"><a name="l00441"></a><span class="lineno"> 441</span>&#160; }</div>
<div class="line"><a name="l00442"></a><span class="lineno"> 442</span>&#160; <a class="code" href="class_p_s3_u_s_b.html#a5dc4e5d1ebd5ca24da7cdc9dd08c94e1">setRumbleOn</a>(0xfe, power[0], 0xfe, power[1]);</div>
<div class="line"><a name="l00443"></a><span class="lineno"> 443</span>&#160; }</div>
<div class="line"><a name="l00444"></a><span class="lineno"> 444</span>&#160;}</div>
<div class="line"><a name="l00445"></a><span class="lineno"> 445</span>&#160;</div>
<div class="line"><a name="l00446"></a><span class="lineno"><a class="code" href="class_p_s3_u_s_b.html#a0c2015b53aa60081aa28299800509f80"> 446</a></span>&#160;<span class="keywordtype">void</span> <a class="code" href="class_p_s3_u_s_b.html#a5dc4e5d1ebd5ca24da7cdc9dd08c94e1">PS3USB::setRumbleOn</a>(uint8_t rightDuration, uint8_t rightPower, uint8_t leftDuration, uint8_t leftPower) {</div>
<div class="line"><a name="l00447"></a><span class="lineno"> 447</span>&#160; writeBuf[1] = rightDuration;</div>
<div class="line"><a name="l00448"></a><span class="lineno"> 448</span>&#160; writeBuf[2] = rightPower;</div>
<div class="line"><a name="l00449"></a><span class="lineno"> 449</span>&#160; writeBuf[3] = leftDuration;</div>
<div class="line"><a name="l00450"></a><span class="lineno"> 450</span>&#160; writeBuf[4] = leftPower;</div>
<div class="line"><a name="l00451"></a><span class="lineno"> 451</span>&#160; PS3_Command(writeBuf, PS3_REPORT_BUFFER_SIZE);</div>
<div class="line"><a name="l00452"></a><span class="lineno"> 452</span>&#160;}</div>
<div class="line"><a name="l00453"></a><span class="lineno"> 453</span>&#160;</div>
<div class="line"><a name="l00454"></a><span class="lineno"><a class="code" href="class_p_s3_u_s_b.html#aa0aac5ea016db4cd6736a15e9d6eb41b"> 454</a></span>&#160;<span class="keywordtype">void</span> <a class="code" href="class_p_s3_u_s_b.html#aa0aac5ea016db4cd6736a15e9d6eb41b">PS3USB::setLedRaw</a>(uint8_t value) {</div>
<div class="line"><a name="l00455"></a><span class="lineno"> 455</span>&#160; writeBuf[9] = value &lt;&lt; 1;</div>
<div class="line"><a name="l00456"></a><span class="lineno"> 456</span>&#160; PS3_Command(writeBuf, PS3_REPORT_BUFFER_SIZE);</div>
<div class="line"><a name="l00457"></a><span class="lineno"> 457</span>&#160;}</div>
<div class="line"><a name="l00458"></a><span class="lineno"> 458</span>&#160;</div>
<div class="line"><a name="l00459"></a><span class="lineno"><a class="code" href="class_p_s3_u_s_b.html#adb361fecbe4eb6fc5635dc7135cfff03"> 459</a></span>&#160;<span class="keywordtype">void</span> <a class="code" href="class_p_s3_u_s_b.html#adb361fecbe4eb6fc5635dc7135cfff03">PS3USB::setLedOff</a>(<a class="code" href="controller_enums_8h.html#aadcb6002d2b42fdfe01490f730ab00a6">LED</a> a) {</div>
<div class="line"><a name="l00460"></a><span class="lineno"> 460</span>&#160; writeBuf[9] &amp;= ~((uint8_t)((pgm_read_byte(&amp;<a class="code" href="_p_s3_enums_8h.html#af83672eccf0c7a02847ce75bc5c55a1a">LEDS</a>[(uint8_t)a]) &amp; 0x0f) &lt;&lt; 1));</div>
<div class="line"><a name="l00461"></a><span class="lineno"> 461</span>&#160; PS3_Command(writeBuf, PS3_REPORT_BUFFER_SIZE);</div>
<div class="line"><a name="l00462"></a><span class="lineno"> 462</span>&#160;}</div>
<div class="line"><a name="l00463"></a><span class="lineno"> 463</span>&#160;</div>
<div class="line"><a name="l00464"></a><span class="lineno"><a class="code" href="class_p_s3_u_s_b.html#a44c4bff09064a09ef97c7bb6b8c0810b"> 464</a></span>&#160;<span class="keywordtype">void</span> <a class="code" href="class_p_s3_u_s_b.html#a44c4bff09064a09ef97c7bb6b8c0810b">PS3USB::setLedOn</a>(<a class="code" href="controller_enums_8h.html#aadcb6002d2b42fdfe01490f730ab00a6">LED</a> a) {</div>
<div class="line"><a name="l00465"></a><span class="lineno"> 465</span>&#160; writeBuf[9] |= (uint8_t)((pgm_read_byte(&amp;<a class="code" href="_p_s3_enums_8h.html#af83672eccf0c7a02847ce75bc5c55a1a">LEDS</a>[(uint8_t)a]) &amp; 0x0f) &lt;&lt; 1);</div>
<div class="line"><a name="l00466"></a><span class="lineno"> 466</span>&#160; PS3_Command(writeBuf, PS3_REPORT_BUFFER_SIZE);</div>
<div class="line"><a name="l00467"></a><span class="lineno"> 467</span>&#160;}</div>
<div class="line"><a name="l00468"></a><span class="lineno"> 468</span>&#160;</div>
<div class="line"><a name="l00469"></a><span class="lineno"><a class="code" href="class_p_s3_u_s_b.html#acbab64f537f092e2fb125f9001f46090"> 469</a></span>&#160;<span class="keywordtype">void</span> <a class="code" href="class_p_s3_u_s_b.html#acbab64f537f092e2fb125f9001f46090">PS3USB::setLedToggle</a>(<a class="code" href="controller_enums_8h.html#aadcb6002d2b42fdfe01490f730ab00a6">LED</a> a) {</div>
<div class="line"><a name="l00470"></a><span class="lineno"> 470</span>&#160; writeBuf[9] ^= (uint8_t)((pgm_read_byte(&amp;<a class="code" href="_p_s3_enums_8h.html#af83672eccf0c7a02847ce75bc5c55a1a">LEDS</a>[(uint8_t)a]) &amp; 0x0f) &lt;&lt; 1);</div>
<div class="line"><a name="l00471"></a><span class="lineno"> 471</span>&#160; PS3_Command(writeBuf, PS3_REPORT_BUFFER_SIZE);</div>
<div class="line"><a name="l00472"></a><span class="lineno"> 472</span>&#160;}</div>
<div class="line"><a name="l00473"></a><span class="lineno"> 473</span>&#160;</div>
<div class="line"><a name="l00474"></a><span class="lineno"><a class="code" href="class_p_s3_u_s_b.html#af13993073ab245ece6d3fe9e9f41df87"> 474</a></span>&#160;<span class="keywordtype">void</span> <a class="code" href="class_p_s3_u_s_b.html#af13993073ab245ece6d3fe9e9f41df87">PS3USB::setBdaddr</a>(uint8_t* BDADDR) {</div>
<div class="line"><a name="l00475"></a><span class="lineno"> 475</span>&#160; <span class="comment">/* Set the internal bluetooth address */</span></div>
<div class="line"><a name="l00476"></a><span class="lineno"> 476</span>&#160; uint8_t buf[8];</div>
<div class="line"><a name="l00477"></a><span class="lineno"> 477</span>&#160; buf[0] = 0x01;</div>
<div class="line"><a name="l00478"></a><span class="lineno"> 478</span>&#160; buf[1] = 0x00;</div>
<div class="line"><a name="l00479"></a><span class="lineno"> 479</span>&#160; <span class="keywordflow">for</span> (uint8_t i = 0; i &lt; 6; i++)</div>
<div class="line"><a name="l00480"></a><span class="lineno"> 480</span>&#160; buf[i + 2] = BDADDR[5 - i]; <span class="comment">//Copy into buffer, has to be written reversed</span></div>
<div class="line"><a name="l00481"></a><span class="lineno"> 481</span>&#160;</div>
<div class="line"><a name="l00482"></a><span class="lineno"> 482</span>&#160; <span class="comment">//bmRequest = Host to device (0x00) | Class (0x20) | Interface (0x01) = 0x21, bRequest = Set Report (0x09), Report ID (0xF5), Report Type (Feature 0x03), interface (0x00), datalength, datalength, data)</span></div>
<div class="line"><a name="l00483"></a><span class="lineno"> 483</span>&#160; <a class="code" href="class_p_s3_u_s_b.html#aa1873f41ae0da7c4568cfb7517560c48">pUsb</a>-&gt;<a class="code" href="class_u_s_b.html#a636695a5c3d35cd6b9e31c54edfacd7c">ctrlReq</a>(<a class="code" href="class_p_s3_u_s_b.html#a3f43df159277003acdf7dd107bda27fd">bAddress</a>, <a class="code" href="class_p_s3_u_s_b.html#a394dbb0a59b587210e5958f08dac48f1">epInfo</a>[<a class="code" href="_p_s3_u_s_b_8h.html#ae6276fa555fe14995bee0713be663333">PS3_CONTROL_PIPE</a>].epAddr, <a class="code" href="_b_t_d_8h.html#a5bd4ea095da29635414952894bd527f5">bmREQ_HID_OUT</a>, <a class="code" href="_b_t_d_8h.html#aee05d40a014750b24a7e9967f6f389f4">HID_REQUEST_SET_REPORT</a>, 0xF5, 0x03, 0x00, 8, 8, buf, NULL);</div>
<div class="line"><a name="l00484"></a><span class="lineno"> 484</span>&#160;}</div>
<div class="line"><a name="l00485"></a><span class="lineno"> 485</span>&#160;</div>
<div class="line"><a name="l00486"></a><span class="lineno"> 486</span>&#160;<span class="keywordtype">void</span> PS3USB::enable_sixaxis() { <span class="comment">//Command used to enable the Dualshock 3 and Navigation controller to send data via USB</span></div>
<div class="line"><a name="l00487"></a><span class="lineno"> 487</span>&#160; uint8_t cmd_buf[4];</div>
<div class="line"><a name="l00488"></a><span class="lineno"> 488</span>&#160; cmd_buf[0] = 0x42; <span class="comment">// Special PS3 Controller enable commands</span></div>
<div class="line"><a name="l00489"></a><span class="lineno"> 489</span>&#160; cmd_buf[1] = 0x0c;</div>
<div class="line"><a name="l00490"></a><span class="lineno"> 490</span>&#160; cmd_buf[2] = 0x00;</div>
<div class="line"><a name="l00491"></a><span class="lineno"> 491</span>&#160; cmd_buf[3] = 0x00;</div>
<div class="line"><a name="l00492"></a><span class="lineno"> 492</span>&#160;</div>
<div class="line"><a name="l00493"></a><span class="lineno"> 493</span>&#160; <span class="comment">//bmRequest = Host to device (0x00) | Class (0x20) | Interface (0x01) = 0x21, bRequest = Set Report (0x09), Report ID (0xF4), Report Type (Feature 0x03), interface (0x00), datalength, datalength, data)</span></div>
<div class="line"><a name="l00494"></a><span class="lineno"> 494</span>&#160; <a class="code" href="class_p_s3_u_s_b.html#aa1873f41ae0da7c4568cfb7517560c48">pUsb</a>-&gt;<a class="code" href="class_u_s_b.html#a636695a5c3d35cd6b9e31c54edfacd7c">ctrlReq</a>(<a class="code" href="class_p_s3_u_s_b.html#a3f43df159277003acdf7dd107bda27fd">bAddress</a>, <a class="code" href="class_p_s3_u_s_b.html#a394dbb0a59b587210e5958f08dac48f1">epInfo</a>[<a class="code" href="_p_s3_u_s_b_8h.html#ae6276fa555fe14995bee0713be663333">PS3_CONTROL_PIPE</a>].epAddr, <a class="code" href="_b_t_d_8h.html#a5bd4ea095da29635414952894bd527f5">bmREQ_HID_OUT</a>, <a class="code" href="_b_t_d_8h.html#aee05d40a014750b24a7e9967f6f389f4">HID_REQUEST_SET_REPORT</a>, 0xF4, 0x03, 0x00, 4, 4, cmd_buf, NULL);</div>
<div class="line"><a name="l00495"></a><span class="lineno"> 495</span>&#160;}</div>
<div class="line"><a name="l00496"></a><span class="lineno"> 496</span>&#160;</div>
<div class="line"><a name="l00497"></a><span class="lineno"> 497</span>&#160;<span class="comment">/* Playstation Move Controller commands */</span></div>
<div class="line"><a name="l00498"></a><span class="lineno"> 498</span>&#160;<span class="keywordtype">void</span> PS3USB::Move_Command(uint8_t* data, uint16_t nbytes) {</div>
<div class="line"><a name="l00499"></a><span class="lineno"> 499</span>&#160; <a class="code" href="class_p_s3_u_s_b.html#aa1873f41ae0da7c4568cfb7517560c48">pUsb</a>-&gt;<a class="code" href="class_u_s_b.html#affbc018973a588995457d535b0ac7ee7">outTransfer</a>(<a class="code" href="class_p_s3_u_s_b.html#a3f43df159277003acdf7dd107bda27fd">bAddress</a>, <a class="code" href="class_p_s3_u_s_b.html#a394dbb0a59b587210e5958f08dac48f1">epInfo</a>[ <a class="code" href="_p_s3_u_s_b_8h.html#a0da271fcb10181b3ce15aefe76c259bb">PS3_OUTPUT_PIPE</a> ].epAddr, nbytes, data);</div>
<div class="line"><a name="l00500"></a><span class="lineno"> 500</span>&#160;}</div>
<div class="line"><a name="l00501"></a><span class="lineno"> 501</span>&#160;</div>
<div class="line"><a name="l00502"></a><span class="lineno"><a class="code" href="class_p_s3_u_s_b.html#ae9cfdaad3e54dbc271519e22082399c7"> 502</a></span>&#160;<span class="keywordtype">void</span> <a class="code" href="class_p_s3_u_s_b.html#ae9cfdaad3e54dbc271519e22082399c7">PS3USB::moveSetBulb</a>(uint8_t r, uint8_t g, uint8_t b) { <span class="comment">//Use this to set the Color using RGB values</span></div>
<div class="line"><a name="l00503"></a><span class="lineno"> 503</span>&#160; <span class="comment">// set the Bulb&#39;s values into the write buffer</span></div>
<div class="line"><a name="l00504"></a><span class="lineno"> 504</span>&#160; writeBuf[2] = r;</div>
<div class="line"><a name="l00505"></a><span class="lineno"> 505</span>&#160; writeBuf[3] = g;</div>
<div class="line"><a name="l00506"></a><span class="lineno"> 506</span>&#160; writeBuf[4] = b;</div>
<div class="line"><a name="l00507"></a><span class="lineno"> 507</span>&#160;</div>
<div class="line"><a name="l00508"></a><span class="lineno"> 508</span>&#160; Move_Command(writeBuf, <a class="code" href="_p_s3_enums_8h.html#a2c6c24a4b63d9a34926fb35d6b49cd17">MOVE_REPORT_BUFFER_SIZE</a>);</div>
<div class="line"><a name="l00509"></a><span class="lineno"> 509</span>&#160;}</div>
<div class="line"><a name="l00435"></a><span class="lineno"> 435</span>&#160; PS3_Command(writeBuf, PS3_REPORT_BUFFER_SIZE);</div>
<div class="line"><a name="l00436"></a><span class="lineno"> 436</span>&#160;}</div>
<div class="line"><a name="l00437"></a><span class="lineno"> 437</span>&#160;</div>
<div class="line"><a name="l00438"></a><span class="lineno"><a class="code" href="class_p_s3_u_s_b.html#a5dc4e5d1ebd5ca24da7cdc9dd08c94e1"> 438</a></span>&#160;<span class="keywordtype">void</span> <a class="code" href="class_p_s3_u_s_b.html#a5dc4e5d1ebd5ca24da7cdc9dd08c94e1">PS3USB::setRumbleOn</a>(<a class="code" href="_p_s3_enums_8h.html#aff4be38428d075a117a5bb7f6209a231">Rumble</a> mode) {</div>
<div class="line"><a name="l00439"></a><span class="lineno"> 439</span>&#160; <span class="keywordflow">if</span> ((mode &amp; 0x30) &gt; 0x00) {</div>
<div class="line"><a name="l00440"></a><span class="lineno"> 440</span>&#160; uint8_t power[2] = {0xff, 0x00}; <span class="comment">// Defaults to RumbleLow</span></div>
<div class="line"><a name="l00441"></a><span class="lineno"> 441</span>&#160; <span class="keywordflow">if</span> (mode == <a class="code" href="_p_s3_enums_8h.html#aff4be38428d075a117a5bb7f6209a231a5819f165165589a8e65b07bf46c7382b">RumbleHigh</a>) {</div>
<div class="line"><a name="l00442"></a><span class="lineno"> 442</span>&#160; power[0] = 0x00;</div>
<div class="line"><a name="l00443"></a><span class="lineno"> 443</span>&#160; power[1] = 0xff;</div>
<div class="line"><a name="l00444"></a><span class="lineno"> 444</span>&#160; }</div>
<div class="line"><a name="l00445"></a><span class="lineno"> 445</span>&#160; <a class="code" href="class_p_s3_u_s_b.html#a5dc4e5d1ebd5ca24da7cdc9dd08c94e1">setRumbleOn</a>(0xfe, power[0], 0xfe, power[1]);</div>
<div class="line"><a name="l00446"></a><span class="lineno"> 446</span>&#160; }</div>
<div class="line"><a name="l00447"></a><span class="lineno"> 447</span>&#160;}</div>
<div class="line"><a name="l00448"></a><span class="lineno"> 448</span>&#160;</div>
<div class="line"><a name="l00449"></a><span class="lineno"><a class="code" href="class_p_s3_u_s_b.html#a0c2015b53aa60081aa28299800509f80"> 449</a></span>&#160;<span class="keywordtype">void</span> <a class="code" href="class_p_s3_u_s_b.html#a5dc4e5d1ebd5ca24da7cdc9dd08c94e1">PS3USB::setRumbleOn</a>(uint8_t rightDuration, uint8_t rightPower, uint8_t leftDuration, uint8_t leftPower) {</div>
<div class="line"><a name="l00450"></a><span class="lineno"> 450</span>&#160; writeBuf[1] = rightDuration;</div>
<div class="line"><a name="l00451"></a><span class="lineno"> 451</span>&#160; writeBuf[2] = rightPower;</div>
<div class="line"><a name="l00452"></a><span class="lineno"> 452</span>&#160; writeBuf[3] = leftDuration;</div>
<div class="line"><a name="l00453"></a><span class="lineno"> 453</span>&#160; writeBuf[4] = leftPower;</div>
<div class="line"><a name="l00454"></a><span class="lineno"> 454</span>&#160; PS3_Command(writeBuf, PS3_REPORT_BUFFER_SIZE);</div>
<div class="line"><a name="l00455"></a><span class="lineno"> 455</span>&#160;}</div>
<div class="line"><a name="l00456"></a><span class="lineno"> 456</span>&#160;</div>
<div class="line"><a name="l00457"></a><span class="lineno"><a class="code" href="class_p_s3_u_s_b.html#aa0aac5ea016db4cd6736a15e9d6eb41b"> 457</a></span>&#160;<span class="keywordtype">void</span> <a class="code" href="class_p_s3_u_s_b.html#aa0aac5ea016db4cd6736a15e9d6eb41b">PS3USB::setLedRaw</a>(uint8_t value) {</div>
<div class="line"><a name="l00458"></a><span class="lineno"> 458</span>&#160; writeBuf[9] = value &lt;&lt; 1;</div>
<div class="line"><a name="l00459"></a><span class="lineno"> 459</span>&#160; PS3_Command(writeBuf, PS3_REPORT_BUFFER_SIZE);</div>
<div class="line"><a name="l00460"></a><span class="lineno"> 460</span>&#160;}</div>
<div class="line"><a name="l00461"></a><span class="lineno"> 461</span>&#160;</div>
<div class="line"><a name="l00462"></a><span class="lineno"><a class="code" href="class_p_s3_u_s_b.html#adb361fecbe4eb6fc5635dc7135cfff03"> 462</a></span>&#160;<span class="keywordtype">void</span> <a class="code" href="class_p_s3_u_s_b.html#adb361fecbe4eb6fc5635dc7135cfff03">PS3USB::setLedOff</a>(<a class="code" href="controller_enums_8h.html#aadcb6002d2b42fdfe01490f730ab00a6">LED</a> a) {</div>
<div class="line"><a name="l00463"></a><span class="lineno"> 463</span>&#160; writeBuf[9] &amp;= ~((uint8_t)((pgm_read_byte(&amp;<a class="code" href="_p_s3_enums_8h.html#af83672eccf0c7a02847ce75bc5c55a1a">LEDS</a>[(uint8_t)a]) &amp; 0x0f) &lt;&lt; 1));</div>
<div class="line"><a name="l00464"></a><span class="lineno"> 464</span>&#160; PS3_Command(writeBuf, PS3_REPORT_BUFFER_SIZE);</div>
<div class="line"><a name="l00465"></a><span class="lineno"> 465</span>&#160;}</div>
<div class="line"><a name="l00466"></a><span class="lineno"> 466</span>&#160;</div>
<div class="line"><a name="l00467"></a><span class="lineno"><a class="code" href="class_p_s3_u_s_b.html#a44c4bff09064a09ef97c7bb6b8c0810b"> 467</a></span>&#160;<span class="keywordtype">void</span> <a class="code" href="class_p_s3_u_s_b.html#a44c4bff09064a09ef97c7bb6b8c0810b">PS3USB::setLedOn</a>(<a class="code" href="controller_enums_8h.html#aadcb6002d2b42fdfe01490f730ab00a6">LED</a> a) {</div>
<div class="line"><a name="l00468"></a><span class="lineno"> 468</span>&#160; writeBuf[9] |= (uint8_t)((pgm_read_byte(&amp;<a class="code" href="_p_s3_enums_8h.html#af83672eccf0c7a02847ce75bc5c55a1a">LEDS</a>[(uint8_t)a]) &amp; 0x0f) &lt;&lt; 1);</div>
<div class="line"><a name="l00469"></a><span class="lineno"> 469</span>&#160; PS3_Command(writeBuf, PS3_REPORT_BUFFER_SIZE);</div>
<div class="line"><a name="l00470"></a><span class="lineno"> 470</span>&#160;}</div>
<div class="line"><a name="l00471"></a><span class="lineno"> 471</span>&#160;</div>
<div class="line"><a name="l00472"></a><span class="lineno"><a class="code" href="class_p_s3_u_s_b.html#acbab64f537f092e2fb125f9001f46090"> 472</a></span>&#160;<span class="keywordtype">void</span> <a class="code" href="class_p_s3_u_s_b.html#acbab64f537f092e2fb125f9001f46090">PS3USB::setLedToggle</a>(<a class="code" href="controller_enums_8h.html#aadcb6002d2b42fdfe01490f730ab00a6">LED</a> a) {</div>
<div class="line"><a name="l00473"></a><span class="lineno"> 473</span>&#160; writeBuf[9] ^= (uint8_t)((pgm_read_byte(&amp;<a class="code" href="_p_s3_enums_8h.html#af83672eccf0c7a02847ce75bc5c55a1a">LEDS</a>[(uint8_t)a]) &amp; 0x0f) &lt;&lt; 1);</div>
<div class="line"><a name="l00474"></a><span class="lineno"> 474</span>&#160; PS3_Command(writeBuf, PS3_REPORT_BUFFER_SIZE);</div>
<div class="line"><a name="l00475"></a><span class="lineno"> 475</span>&#160;}</div>
<div class="line"><a name="l00476"></a><span class="lineno"> 476</span>&#160;</div>
<div class="line"><a name="l00477"></a><span class="lineno"><a class="code" href="class_p_s3_u_s_b.html#af13993073ab245ece6d3fe9e9f41df87"> 477</a></span>&#160;<span class="keywordtype">void</span> <a class="code" href="class_p_s3_u_s_b.html#af13993073ab245ece6d3fe9e9f41df87">PS3USB::setBdaddr</a>(uint8_t* BDADDR) {</div>
<div class="line"><a name="l00478"></a><span class="lineno"> 478</span>&#160; <span class="comment">/* Set the internal bluetooth address */</span></div>
<div class="line"><a name="l00479"></a><span class="lineno"> 479</span>&#160; uint8_t buf[8];</div>
<div class="line"><a name="l00480"></a><span class="lineno"> 480</span>&#160; buf[0] = 0x01;</div>
<div class="line"><a name="l00481"></a><span class="lineno"> 481</span>&#160; buf[1] = 0x00;</div>
<div class="line"><a name="l00482"></a><span class="lineno"> 482</span>&#160; <span class="keywordflow">for</span> (uint8_t i = 0; i &lt; 6; i++)</div>
<div class="line"><a name="l00483"></a><span class="lineno"> 483</span>&#160; buf[i + 2] = BDADDR[5 - i]; <span class="comment">//Copy into buffer, has to be written reversed</span></div>
<div class="line"><a name="l00484"></a><span class="lineno"> 484</span>&#160;</div>
<div class="line"><a name="l00485"></a><span class="lineno"> 485</span>&#160; <span class="comment">//bmRequest = Host to device (0x00) | Class (0x20) | Interface (0x01) = 0x21, bRequest = Set Report (0x09), Report ID (0xF5), Report Type (Feature 0x03), interface (0x00), datalength, datalength, data)</span></div>
<div class="line"><a name="l00486"></a><span class="lineno"> 486</span>&#160; <a class="code" href="class_p_s3_u_s_b.html#aa1873f41ae0da7c4568cfb7517560c48">pUsb</a>-&gt;<a class="code" href="class_u_s_b.html#a636695a5c3d35cd6b9e31c54edfacd7c">ctrlReq</a>(<a class="code" href="class_p_s3_u_s_b.html#a3f43df159277003acdf7dd107bda27fd">bAddress</a>, <a class="code" href="class_p_s3_u_s_b.html#a394dbb0a59b587210e5958f08dac48f1">epInfo</a>[<a class="code" href="_p_s3_u_s_b_8h.html#ae6276fa555fe14995bee0713be663333">PS3_CONTROL_PIPE</a>].epAddr, <a class="code" href="_b_t_d_8h.html#a5bd4ea095da29635414952894bd527f5">bmREQ_HID_OUT</a>, <a class="code" href="_b_t_d_8h.html#aee05d40a014750b24a7e9967f6f389f4">HID_REQUEST_SET_REPORT</a>, 0xF5, 0x03, 0x00, 8, 8, buf, NULL);</div>
<div class="line"><a name="l00487"></a><span class="lineno"> 487</span>&#160;}</div>
<div class="line"><a name="l00488"></a><span class="lineno"> 488</span>&#160;</div>
<div class="line"><a name="l00489"></a><span class="lineno"> 489</span>&#160;<span class="keywordtype">void</span> PS3USB::enable_sixaxis() { <span class="comment">//Command used to enable the Dualshock 3 and Navigation controller to send data via USB</span></div>
<div class="line"><a name="l00490"></a><span class="lineno"> 490</span>&#160; uint8_t cmd_buf[4];</div>
<div class="line"><a name="l00491"></a><span class="lineno"> 491</span>&#160; cmd_buf[0] = 0x42; <span class="comment">// Special PS3 Controller enable commands</span></div>
<div class="line"><a name="l00492"></a><span class="lineno"> 492</span>&#160; cmd_buf[1] = 0x0c;</div>
<div class="line"><a name="l00493"></a><span class="lineno"> 493</span>&#160; cmd_buf[2] = 0x00;</div>
<div class="line"><a name="l00494"></a><span class="lineno"> 494</span>&#160; cmd_buf[3] = 0x00;</div>
<div class="line"><a name="l00495"></a><span class="lineno"> 495</span>&#160;</div>
<div class="line"><a name="l00496"></a><span class="lineno"> 496</span>&#160; <span class="comment">//bmRequest = Host to device (0x00) | Class (0x20) | Interface (0x01) = 0x21, bRequest = Set Report (0x09), Report ID (0xF4), Report Type (Feature 0x03), interface (0x00), datalength, datalength, data)</span></div>
<div class="line"><a name="l00497"></a><span class="lineno"> 497</span>&#160; <a class="code" href="class_p_s3_u_s_b.html#aa1873f41ae0da7c4568cfb7517560c48">pUsb</a>-&gt;<a class="code" href="class_u_s_b.html#a636695a5c3d35cd6b9e31c54edfacd7c">ctrlReq</a>(<a class="code" href="class_p_s3_u_s_b.html#a3f43df159277003acdf7dd107bda27fd">bAddress</a>, <a class="code" href="class_p_s3_u_s_b.html#a394dbb0a59b587210e5958f08dac48f1">epInfo</a>[<a class="code" href="_p_s3_u_s_b_8h.html#ae6276fa555fe14995bee0713be663333">PS3_CONTROL_PIPE</a>].epAddr, <a class="code" href="_b_t_d_8h.html#a5bd4ea095da29635414952894bd527f5">bmREQ_HID_OUT</a>, <a class="code" href="_b_t_d_8h.html#aee05d40a014750b24a7e9967f6f389f4">HID_REQUEST_SET_REPORT</a>, 0xF4, 0x03, 0x00, 4, 4, cmd_buf, NULL);</div>
<div class="line"><a name="l00498"></a><span class="lineno"> 498</span>&#160;}</div>
<div class="line"><a name="l00499"></a><span class="lineno"> 499</span>&#160;</div>
<div class="line"><a name="l00500"></a><span class="lineno"> 500</span>&#160;<span class="comment">/* Playstation Move Controller commands */</span></div>
<div class="line"><a name="l00501"></a><span class="lineno"> 501</span>&#160;<span class="keywordtype">void</span> PS3USB::Move_Command(uint8_t* data, uint16_t nbytes) {</div>
<div class="line"><a name="l00502"></a><span class="lineno"> 502</span>&#160; <a class="code" href="class_p_s3_u_s_b.html#aa1873f41ae0da7c4568cfb7517560c48">pUsb</a>-&gt;<a class="code" href="class_u_s_b.html#affbc018973a588995457d535b0ac7ee7">outTransfer</a>(<a class="code" href="class_p_s3_u_s_b.html#a3f43df159277003acdf7dd107bda27fd">bAddress</a>, <a class="code" href="class_p_s3_u_s_b.html#a394dbb0a59b587210e5958f08dac48f1">epInfo</a>[ <a class="code" href="_p_s3_u_s_b_8h.html#a0da271fcb10181b3ce15aefe76c259bb">PS3_OUTPUT_PIPE</a> ].epAddr, nbytes, data);</div>
<div class="line"><a name="l00503"></a><span class="lineno"> 503</span>&#160;}</div>
<div class="line"><a name="l00504"></a><span class="lineno"> 504</span>&#160;</div>
<div class="line"><a name="l00505"></a><span class="lineno"><a class="code" href="class_p_s3_u_s_b.html#ae9cfdaad3e54dbc271519e22082399c7"> 505</a></span>&#160;<span class="keywordtype">void</span> <a class="code" href="class_p_s3_u_s_b.html#ae9cfdaad3e54dbc271519e22082399c7">PS3USB::moveSetBulb</a>(uint8_t r, uint8_t g, uint8_t b) { <span class="comment">//Use this to set the Color using RGB values</span></div>
<div class="line"><a name="l00506"></a><span class="lineno"> 506</span>&#160; <span class="comment">// set the Bulb&#39;s values into the write buffer</span></div>
<div class="line"><a name="l00507"></a><span class="lineno"> 507</span>&#160; writeBuf[2] = r;</div>
<div class="line"><a name="l00508"></a><span class="lineno"> 508</span>&#160; writeBuf[3] = g;</div>
<div class="line"><a name="l00509"></a><span class="lineno"> 509</span>&#160; writeBuf[4] = b;</div>
<div class="line"><a name="l00510"></a><span class="lineno"> 510</span>&#160;</div>
<div class="line"><a name="l00511"></a><span class="lineno"><a class="code" href="class_p_s3_u_s_b.html#a34c83190306752e68c5704eece875d49"> 511</a></span>&#160;<span class="keywordtype">void</span> <a class="code" href="class_p_s3_u_s_b.html#ae9cfdaad3e54dbc271519e22082399c7">PS3USB::moveSetBulb</a>(<a class="code" href="_p_s3_enums_8h.html#a55ecd4f2ec2ebfe8d5b0163e4ac2a967">Colors</a> color) { <span class="comment">//Use this to set the Color using the predefined colors in &quot;enums.h&quot;</span></div>
<div class="line"><a name="l00512"></a><span class="lineno"> 512</span>&#160; <a class="code" href="class_p_s3_u_s_b.html#ae9cfdaad3e54dbc271519e22082399c7">moveSetBulb</a>((uint8_t)(color &gt;&gt; 16), (uint8_t)(color &gt;&gt; 8), (uint8_t)(color));</div>
<div class="line"><a name="l00513"></a><span class="lineno"> 513</span>&#160;}</div>
<div class="line"><a name="l00514"></a><span class="lineno"> 514</span>&#160;</div>
<div class="line"><a name="l00515"></a><span class="lineno"><a class="code" href="class_p_s3_u_s_b.html#a66d542c2cec73cefb3cdda36ff080e1a"> 515</a></span>&#160;<span class="keywordtype">void</span> <a class="code" href="class_p_s3_u_s_b.html#a66d542c2cec73cefb3cdda36ff080e1a">PS3USB::moveSetRumble</a>(uint8_t rumble) {</div>
<div class="line"><a name="l00516"></a><span class="lineno"> 516</span>&#160;<span class="preprocessor">#ifdef DEBUG_USB_HOST</span></div>
<div class="line"><a name="l00517"></a><span class="lineno"> 517</span>&#160;<span class="preprocessor"></span> <span class="keywordflow">if</span> (rumble &lt; 64 &amp;&amp; rumble != 0) <span class="comment">// The rumble value has to at least 64, or approximately 25% (64/255*100)</span></div>
<div class="line"><a name="l00518"></a><span class="lineno"> 518</span>&#160; <a class="code" href="message_8h.html#a747819b0aa34f5c3ba0332c2db28c846">Notify</a>(PSTR(<span class="stringliteral">&quot;\r\nThe rumble value has to at least 64, or approximately 25%&quot;</span>), 0x80);</div>
<div class="line"><a name="l00519"></a><span class="lineno"> 519</span>&#160;<span class="preprocessor">#endif</span></div>
<div class="line"><a name="l00520"></a><span class="lineno"> 520</span>&#160;<span class="preprocessor"></span> <span class="comment">//set the rumble value into the write buffer</span></div>
<div class="line"><a name="l00521"></a><span class="lineno"> 521</span>&#160; writeBuf[6] = rumble;</div>
<div class="line"><a name="l00522"></a><span class="lineno"> 522</span>&#160;</div>
<div class="line"><a name="l00523"></a><span class="lineno"> 523</span>&#160; Move_Command(writeBuf, <a class="code" href="_p_s3_enums_8h.html#a2c6c24a4b63d9a34926fb35d6b49cd17">MOVE_REPORT_BUFFER_SIZE</a>);</div>
<div class="line"><a name="l00524"></a><span class="lineno"> 524</span>&#160;}</div>
<div class="line"><a name="l00511"></a><span class="lineno"> 511</span>&#160; Move_Command(writeBuf, <a class="code" href="_p_s3_enums_8h.html#a2c6c24a4b63d9a34926fb35d6b49cd17">MOVE_REPORT_BUFFER_SIZE</a>);</div>
<div class="line"><a name="l00512"></a><span class="lineno"> 512</span>&#160;}</div>
<div class="line"><a name="l00513"></a><span class="lineno"> 513</span>&#160;</div>
<div class="line"><a name="l00514"></a><span class="lineno"><a class="code" href="class_p_s3_u_s_b.html#a34c83190306752e68c5704eece875d49"> 514</a></span>&#160;<span class="keywordtype">void</span> <a class="code" href="class_p_s3_u_s_b.html#ae9cfdaad3e54dbc271519e22082399c7">PS3USB::moveSetBulb</a>(<a class="code" href="_p_s3_enums_8h.html#a55ecd4f2ec2ebfe8d5b0163e4ac2a967">Colors</a> color) { <span class="comment">//Use this to set the Color using the predefined colors in &quot;enums.h&quot;</span></div>
<div class="line"><a name="l00515"></a><span class="lineno"> 515</span>&#160; <a class="code" href="class_p_s3_u_s_b.html#ae9cfdaad3e54dbc271519e22082399c7">moveSetBulb</a>((uint8_t)(color &gt;&gt; 16), (uint8_t)(color &gt;&gt; 8), (uint8_t)(color));</div>
<div class="line"><a name="l00516"></a><span class="lineno"> 516</span>&#160;}</div>
<div class="line"><a name="l00517"></a><span class="lineno"> 517</span>&#160;</div>
<div class="line"><a name="l00518"></a><span class="lineno"><a class="code" href="class_p_s3_u_s_b.html#a66d542c2cec73cefb3cdda36ff080e1a"> 518</a></span>&#160;<span class="keywordtype">void</span> <a class="code" href="class_p_s3_u_s_b.html#a66d542c2cec73cefb3cdda36ff080e1a">PS3USB::moveSetRumble</a>(uint8_t rumble) {</div>
<div class="line"><a name="l00519"></a><span class="lineno"> 519</span>&#160;<span class="preprocessor">#ifdef DEBUG_USB_HOST</span></div>
<div class="line"><a name="l00520"></a><span class="lineno"> 520</span>&#160;<span class="preprocessor"></span> <span class="keywordflow">if</span> (rumble &lt; 64 &amp;&amp; rumble != 0) <span class="comment">// The rumble value has to at least 64, or approximately 25% (64/255*100)</span></div>
<div class="line"><a name="l00521"></a><span class="lineno"> 521</span>&#160; <a class="code" href="message_8h.html#a27117e124c5d66d5512fe8d494fe6338">Notify</a>(PSTR(<span class="stringliteral">&quot;\r\nThe rumble value has to at least 64, or approximately 25%&quot;</span>), 0x80);</div>
<div class="line"><a name="l00522"></a><span class="lineno"> 522</span>&#160;<span class="preprocessor">#endif</span></div>
<div class="line"><a name="l00523"></a><span class="lineno"> 523</span>&#160;<span class="preprocessor"></span> <span class="comment">//set the rumble value into the write buffer</span></div>
<div class="line"><a name="l00524"></a><span class="lineno"> 524</span>&#160; writeBuf[6] = rumble;</div>
<div class="line"><a name="l00525"></a><span class="lineno"> 525</span>&#160;</div>
<div class="line"><a name="l00526"></a><span class="lineno"><a class="code" href="class_p_s3_u_s_b.html#a3be69a3c6e24bf2b53bc06c85829e62a"> 526</a></span>&#160;<span class="keywordtype">void</span> <a class="code" href="class_p_s3_u_s_b.html#a3be69a3c6e24bf2b53bc06c85829e62a">PS3USB::setMoveBdaddr</a>(uint8_t* BDADDR) {</div>
<div class="line"><a name="l00527"></a><span class="lineno"> 527</span>&#160; <span class="comment">/* Set the internal bluetooth address */</span></div>
<div class="line"><a name="l00528"></a><span class="lineno"> 528</span>&#160; uint8_t buf[11];</div>
<div class="line"><a name="l00529"></a><span class="lineno"> 529</span>&#160; buf[0] = 0x05;</div>
<div class="line"><a name="l00530"></a><span class="lineno"> 530</span>&#160; buf[7] = 0x10;</div>
<div class="line"><a name="l00531"></a><span class="lineno"> 531</span>&#160; buf[8] = 0x01;</div>
<div class="line"><a name="l00532"></a><span class="lineno"> 532</span>&#160; buf[9] = 0x02;</div>
<div class="line"><a name="l00533"></a><span class="lineno"> 533</span>&#160; buf[10] = 0x12;</div>
<div class="line"><a name="l00534"></a><span class="lineno"> 534</span>&#160;</div>
<div class="line"><a name="l00535"></a><span class="lineno"> 535</span>&#160; <span class="keywordflow">for</span> (uint8_t i = 0; i &lt; 6; i++)</div>
<div class="line"><a name="l00536"></a><span class="lineno"> 536</span>&#160; buf[i + 1] = BDADDR[i];</div>
<div class="line"><a name="l00526"></a><span class="lineno"> 526</span>&#160; Move_Command(writeBuf, <a class="code" href="_p_s3_enums_8h.html#a2c6c24a4b63d9a34926fb35d6b49cd17">MOVE_REPORT_BUFFER_SIZE</a>);</div>
<div class="line"><a name="l00527"></a><span class="lineno"> 527</span>&#160;}</div>
<div class="line"><a name="l00528"></a><span class="lineno"> 528</span>&#160;</div>
<div class="line"><a name="l00529"></a><span class="lineno"><a class="code" href="class_p_s3_u_s_b.html#a3be69a3c6e24bf2b53bc06c85829e62a"> 529</a></span>&#160;<span class="keywordtype">void</span> <a class="code" href="class_p_s3_u_s_b.html#a3be69a3c6e24bf2b53bc06c85829e62a">PS3USB::setMoveBdaddr</a>(uint8_t* BDADDR) {</div>
<div class="line"><a name="l00530"></a><span class="lineno"> 530</span>&#160; <span class="comment">/* Set the internal bluetooth address */</span></div>
<div class="line"><a name="l00531"></a><span class="lineno"> 531</span>&#160; uint8_t buf[11];</div>
<div class="line"><a name="l00532"></a><span class="lineno"> 532</span>&#160; buf[0] = 0x05;</div>
<div class="line"><a name="l00533"></a><span class="lineno"> 533</span>&#160; buf[7] = 0x10;</div>
<div class="line"><a name="l00534"></a><span class="lineno"> 534</span>&#160; buf[8] = 0x01;</div>
<div class="line"><a name="l00535"></a><span class="lineno"> 535</span>&#160; buf[9] = 0x02;</div>
<div class="line"><a name="l00536"></a><span class="lineno"> 536</span>&#160; buf[10] = 0x12;</div>
<div class="line"><a name="l00537"></a><span class="lineno"> 537</span>&#160;</div>
<div class="line"><a name="l00538"></a><span class="lineno"> 538</span>&#160; <span class="comment">//bmRequest = Host to device (0x00) | Class (0x20) | Interface (0x01) = 0x21, bRequest = Set Report (0x09), Report ID (0x05), Report Type (Feature 0x03), interface (0x00), datalength, datalength, data)</span></div>
<div class="line"><a name="l00539"></a><span class="lineno"> 539</span>&#160; <a class="code" href="class_p_s3_u_s_b.html#aa1873f41ae0da7c4568cfb7517560c48">pUsb</a>-&gt;<a class="code" href="class_u_s_b.html#a636695a5c3d35cd6b9e31c54edfacd7c">ctrlReq</a>(<a class="code" href="class_p_s3_u_s_b.html#a3f43df159277003acdf7dd107bda27fd">bAddress</a>, <a class="code" href="class_p_s3_u_s_b.html#a394dbb0a59b587210e5958f08dac48f1">epInfo</a>[<a class="code" href="_p_s3_u_s_b_8h.html#ae6276fa555fe14995bee0713be663333">PS3_CONTROL_PIPE</a>].epAddr, <a class="code" href="_b_t_d_8h.html#a5bd4ea095da29635414952894bd527f5">bmREQ_HID_OUT</a>, <a class="code" href="_b_t_d_8h.html#aee05d40a014750b24a7e9967f6f389f4">HID_REQUEST_SET_REPORT</a>, 0x05, 0x03, 0x00, 11, 11, buf, NULL);</div>
<div class="line"><a name="l00540"></a><span class="lineno"> 540</span>&#160;}</div>
<div class="line"><a name="l00538"></a><span class="lineno"> 538</span>&#160; <span class="keywordflow">for</span> (uint8_t i = 0; i &lt; 6; i++)</div>
<div class="line"><a name="l00539"></a><span class="lineno"> 539</span>&#160; buf[i + 1] = BDADDR[i];</div>
<div class="line"><a name="l00540"></a><span class="lineno"> 540</span>&#160;</div>
<div class="line"><a name="l00541"></a><span class="lineno"> 541</span>&#160; <span class="comment">//bmRequest = Host to device (0x00) | Class (0x20) | Interface (0x01) = 0x21, bRequest = Set Report (0x09), Report ID (0x05), Report Type (Feature 0x03), interface (0x00), datalength, datalength, data)</span></div>
<div class="line"><a name="l00542"></a><span class="lineno"> 542</span>&#160; <a class="code" href="class_p_s3_u_s_b.html#aa1873f41ae0da7c4568cfb7517560c48">pUsb</a>-&gt;<a class="code" href="class_u_s_b.html#a636695a5c3d35cd6b9e31c54edfacd7c">ctrlReq</a>(<a class="code" href="class_p_s3_u_s_b.html#a3f43df159277003acdf7dd107bda27fd">bAddress</a>, <a class="code" href="class_p_s3_u_s_b.html#a394dbb0a59b587210e5958f08dac48f1">epInfo</a>[<a class="code" href="_p_s3_u_s_b_8h.html#ae6276fa555fe14995bee0713be663333">PS3_CONTROL_PIPE</a>].epAddr, <a class="code" href="_b_t_d_8h.html#a5bd4ea095da29635414952894bd527f5">bmREQ_HID_OUT</a>, <a class="code" href="_b_t_d_8h.html#aee05d40a014750b24a7e9967f6f389f4">HID_REQUEST_SET_REPORT</a>, 0x05, 0x03, 0x00, 11, 11, buf, NULL);</div>
<div class="line"><a name="l00543"></a><span class="lineno"> 543</span>&#160;}</div>
<div class="line"><a name="l00544"></a><span class="lineno"> 544</span>&#160;</div>
<div class="line"><a name="l00545"></a><span class="lineno"> 545</span>&#160;<span class="keywordtype">void</span> PS3USB::onInit() {</div>
<div class="line"><a name="l00546"></a><span class="lineno"> 546</span>&#160; <span class="keywordflow">if</span> (pFuncOnInit)</div>
<div class="line"><a name="l00547"></a><span class="lineno"> 547</span>&#160; pFuncOnInit(); <span class="comment">// Call the user function</span></div>
<div class="line"><a name="l00548"></a><span class="lineno"> 548</span>&#160; <span class="keywordflow">else</span> {</div>
<div class="line"><a name="l00549"></a><span class="lineno"> 549</span>&#160; <span class="keywordflow">if</span> (<a class="code" href="class_p_s3_u_s_b.html#a89aa4233f3eeeb99693a099da527ec28">PS3MoveConnected</a>)</div>
<div class="line"><a name="l00550"></a><span class="lineno"> 550</span>&#160; <a class="code" href="class_p_s3_u_s_b.html#ae9cfdaad3e54dbc271519e22082399c7">moveSetBulb</a>(<a class="code" href="_p_s3_enums_8h.html#a55ecd4f2ec2ebfe8d5b0163e4ac2a967ad3163c1fcda01965b692ec2c3122b743">Red</a>);</div>
<div class="line"><a name="l00551"></a><span class="lineno"> 551</span>&#160; <span class="keywordflow">else</span> <span class="comment">// Dualshock 3 or Navigation controller</span></div>
<div class="line"><a name="l00552"></a><span class="lineno"> 552</span>&#160; <a class="code" href="class_p_s3_u_s_b.html#a44c4bff09064a09ef97c7bb6b8c0810b">setLedOn</a>(<a class="code" href="controller_enums_8h.html#aadcb6002d2b42fdfe01490f730ab00a6adac6477842247cab1a8c02c65f431b44">LED1</a>);</div>
<div class="line"><a name="l00553"></a><span class="lineno"> 553</span>&#160; }</div>
<div class="line"><a name="l00554"></a><span class="lineno"> 554</span>&#160;}</div>
</div><!-- fragment --></div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>

View file

@ -100,7 +100,7 @@ Include dependency graph for PS3USB.h:</div>
<div class="dyncontent">
<div class="center"><img src="_p_s3_u_s_b_8h__incl.png" border="0" usemap="#_p_s3_u_s_b_8h" alt=""/></div>
<map name="_p_s3_u_s_b_8h" id="_p_s3_u_s_b_8h">
<area shape="rect" id="node3" href="_usb_8h.html" title="Usb.h" alt="" coords="357,75,400,96"/><area shape="rect" id="node18" href="_p_s3_enums_8h.html" title="PS3Enums.h" alt="" coords="580,75,649,96"/><area shape="rect" id="node6" href="avrpins_8h.html" title="avrpins.h" alt="" coords="43,213,97,235"/><area shape="rect" id="node8" href="max3421e_8h.html" title="max3421e.h" alt="" coords="275,213,341,235"/><area shape="rect" id="node9" href="usbhost_8h.html" title="usbhost.h" alt="" coords="199,144,256,165"/><area shape="rect" id="node10" href="usb__ch9_8h.html" title="usb_ch9.h" alt="" coords="123,213,181,235"/><area shape="rect" id="node12" href="address_8h.html" title="address.h" alt="" coords="350,144,407,165"/><area shape="rect" id="node14" href="message_8h.html" title="message.h" alt="" coords="643,144,704,165"/><area shape="rect" id="node16" href="printhex_8h.html" title="printhex.h" alt="" coords="746,283,803,304"/><area shape="rect" id="node17" href="hexdump_8h.html" title="hexdump.h" alt="" coords="643,213,704,235"/><area shape="rect" id="node19" href="controller_enums_8h.html" title="controllerEnums.h" alt="" coords="729,144,815,165"/></map>
<area shape="rect" id="node3" href="_usb_8h.html" title="Usb.h" alt="" coords="420,75,463,96"/><area shape="rect" id="node18" href="_p_s3_enums_8h.html" title="PS3Enums.h" alt="" coords="725,75,795,96"/><area shape="rect" id="node6" href="avrpins_8h.html" title="avrpins.h" alt="" coords="43,213,97,235"/><area shape="rect" id="node8" href="max3421e_8h.html" title="max3421e.h" alt="" coords="325,213,392,235"/><area shape="rect" id="node9" href="usbhost_8h.html" title="usbhost.h" alt="" coords="186,144,243,165"/><area shape="rect" id="node10" href="usb__ch9_8h.html" title="usb_ch9.h" alt="" coords="243,213,301,235"/><area shape="rect" id="node12" href="address_8h.html" title="address.h" alt="" coords="413,144,469,165"/><area shape="rect" id="node14" href="message_8h.html" title="message.h" alt="" coords="659,144,720,165"/><area shape="rect" id="node16" href="printhex_8h.html" title="printhex.h" alt="" coords="627,283,684,304"/><area shape="rect" id="node17" href="hexdump_8h.html" title="hexdump.h" alt="" coords="693,213,755,235"/><area shape="rect" id="node19" href="controller_enums_8h.html" title="controllerEnums.h" alt="" coords="955,144,1041,165"/></map>
</div>
</div><div class="textblock"><div class="dynheader">
This graph shows which files directly or indirectly include this file:</div>

View file

@ -1,13 +1,13 @@
<map id="PS3USB.h" name="PS3USB.h">
<area shape="rect" id="node3" href="$_usb_8h.html" title="Usb.h" alt="" coords="357,75,400,96"/>
<area shape="rect" id="node18" href="$_p_s3_enums_8h.html" title="PS3Enums.h" alt="" coords="580,75,649,96"/>
<area shape="rect" id="node3" href="$_usb_8h.html" title="Usb.h" alt="" coords="420,75,463,96"/>
<area shape="rect" id="node18" href="$_p_s3_enums_8h.html" title="PS3Enums.h" alt="" coords="725,75,795,96"/>
<area shape="rect" id="node6" href="$avrpins_8h.html" title="avrpins.h" alt="" coords="43,213,97,235"/>
<area shape="rect" id="node8" href="$max3421e_8h.html" title="max3421e.h" alt="" coords="275,213,341,235"/>
<area shape="rect" id="node9" href="$usbhost_8h.html" title="usbhost.h" alt="" coords="199,144,256,165"/>
<area shape="rect" id="node10" href="$usb__ch9_8h.html" title="usb_ch9.h" alt="" coords="123,213,181,235"/>
<area shape="rect" id="node12" href="$address_8h.html" title="address.h" alt="" coords="350,144,407,165"/>
<area shape="rect" id="node14" href="$message_8h.html" title="message.h" alt="" coords="643,144,704,165"/>
<area shape="rect" id="node16" href="$printhex_8h.html" title="printhex.h" alt="" coords="746,283,803,304"/>
<area shape="rect" id="node17" href="$hexdump_8h.html" title="hexdump.h" alt="" coords="643,213,704,235"/>
<area shape="rect" id="node19" href="$controller_enums_8h.html" title="controllerEnums.h" alt="" coords="729,144,815,165"/>
<area shape="rect" id="node8" href="$max3421e_8h.html" title="max3421e.h" alt="" coords="325,213,392,235"/>
<area shape="rect" id="node9" href="$usbhost_8h.html" title="usbhost.h" alt="" coords="186,144,243,165"/>
<area shape="rect" id="node10" href="$usb__ch9_8h.html" title="usb_ch9.h" alt="" coords="243,213,301,235"/>
<area shape="rect" id="node12" href="$address_8h.html" title="address.h" alt="" coords="413,144,469,165"/>
<area shape="rect" id="node14" href="$message_8h.html" title="message.h" alt="" coords="659,144,720,165"/>
<area shape="rect" id="node16" href="$printhex_8h.html" title="printhex.h" alt="" coords="627,283,684,304"/>
<area shape="rect" id="node17" href="$hexdump_8h.html" title="hexdump.h" alt="" coords="693,213,755,235"/>
<area shape="rect" id="node19" href="$controller_enums_8h.html" title="controllerEnums.h" alt="" coords="955,144,1041,165"/>
</map>

View file

@ -1 +1 @@
0ac75f726e2de3191352863394f83430
997da459ce6865ea46e97e76129b7a25

Binary file not shown.

Before

Width:  |  Height:  |  Size: 60 KiB

After

Width:  |  Height:  |  Size: 67 KiB

View file

@ -156,62 +156,73 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
<div class="line"><a name="l00104"></a><span class="lineno"><a class="code" href="class_p_s3_u_s_b.html#a02a5b0244665d5a790d1020e51c94479"> 104</a></span>&#160; <span class="keyword">virtual</span> <span class="keywordtype">bool</span> <a class="code" href="class_p_s3_u_s_b.html#a02a5b0244665d5a790d1020e51c94479">isReady</a>() {</div>
<div class="line"><a name="l00105"></a><span class="lineno"> 105</span>&#160; <span class="keywordflow">return</span> bPollEnable;</div>
<div class="line"><a name="l00106"></a><span class="lineno"> 106</span>&#160; };</div>
<div class="line"><a name="l00113"></a><span class="lineno"> 113</span>&#160; <span class="keywordtype">void</span> <a class="code" href="class_p_s3_u_s_b.html#af13993073ab245ece6d3fe9e9f41df87">setBdaddr</a>(uint8_t* BDADDR);</div>
<div class="line"><a name="l00118"></a><span class="lineno"> 118</span>&#160; <span class="keywordtype">void</span> <a class="code" href="class_p_s3_u_s_b.html#a3be69a3c6e24bf2b53bc06c85829e62a">setMoveBdaddr</a>(uint8_t* BDADDR);</div>
<div class="line"><a name="l00119"></a><span class="lineno"> 119</span>&#160;</div>
<div class="line"><a name="l00129"></a><span class="lineno"> 129</span>&#160; <span class="keywordtype">bool</span> <a class="code" href="class_p_s3_u_s_b.html#ad1de9af6fb34f4cff6c1ed0af21b0141">getButtonPress</a>(<a class="code" href="controller_enums_8h.html#a03bfec859eac87be20f8952c1eb89de0">Button</a> b);</div>
<div class="line"><a name="l00130"></a><span class="lineno"> 130</span>&#160; <span class="keywordtype">bool</span> <a class="code" href="class_p_s3_u_s_b.html#a9a50f5ed5b41232336cc6d1870795230">getButtonClick</a>(<a class="code" href="controller_enums_8h.html#a03bfec859eac87be20f8952c1eb89de0">Button</a> b);</div>
<div class="line"><a name="l00141"></a><span class="lineno"> 141</span>&#160; uint8_t <a class="code" href="class_p_s3_u_s_b.html#a2d30813a3f5c4729b5c1662832d5a6e0">getAnalogButton</a>(<a class="code" href="controller_enums_8h.html#a03bfec859eac87be20f8952c1eb89de0">Button</a> a);</div>
<div class="line"><a name="l00147"></a><span class="lineno"> 147</span>&#160; uint8_t <a class="code" href="class_p_s3_u_s_b.html#a2b0f391b8ae3e80b18cf9108c3e8f7e3">getAnalogHat</a>(<a class="code" href="controller_enums_8h.html#aaaabdefc068fd57ec2bef2b62ea4ba92">AnalogHat</a> a);</div>
<div class="line"><a name="l00154"></a><span class="lineno"> 154</span>&#160; uint16_t <a class="code" href="class_p_s3_u_s_b.html#a4fe61beae6f0e36e4df1ea388bed0783">getSensor</a>(<a class="code" href="_p_s3_enums_8h.html#a9628766e5f200cc84b296b071b09ff4a">Sensor</a> a);</div>
<div class="line"><a name="l00160"></a><span class="lineno"> 160</span>&#160; <span class="keywordtype">double</span> <a class="code" href="class_p_s3_u_s_b.html#a9b9e5a3a3e80957f47f86f4155fee777">getAngle</a>(<a class="code" href="_p_s3_enums_8h.html#a0200d2d1b3a7930d0be6c50e7c8ae7d1">Angle</a> a);</div>
<div class="line"><a name="l00166"></a><span class="lineno"> 166</span>&#160; <span class="keywordtype">bool</span> <a class="code" href="class_p_s3_u_s_b.html#a09da3bcd33a8dd20d7cb06a70833e448">getStatus</a>(<a class="code" href="_p_s3_enums_8h.html#a67a0db04d321a74b7e7fcfd3f1a3f70b">Status</a> c);</div>
<div class="line"><a name="l00171"></a><span class="lineno"> 171</span>&#160; String <a class="code" href="class_p_s3_u_s_b.html#ae3f19089341bb545f31b3b01e77131ae">getStatusString</a>();</div>
<div class="line"><a name="l00172"></a><span class="lineno"> 172</span>&#160;</div>
<div class="line"><a name="l00174"></a><span class="lineno"> 174</span>&#160; <span class="keywordtype">void</span> <a class="code" href="class_p_s3_u_s_b.html#ac7adc7365bb45d15c37e22f26f012498">setAllOff</a>();</div>
<div class="line"><a name="l00176"></a><span class="lineno"> 176</span>&#160; <span class="keywordtype">void</span> <a class="code" href="class_p_s3_u_s_b.html#aaa1e66d7397be6364d4f76749cbaad5a">setRumbleOff</a>();</div>
<div class="line"><a name="l00181"></a><span class="lineno"> 181</span>&#160; <span class="keywordtype">void</span> <a class="code" href="class_p_s3_u_s_b.html#a5dc4e5d1ebd5ca24da7cdc9dd08c94e1">setRumbleOn</a>(<a class="code" href="_p_s3_enums_8h.html#aff4be38428d075a117a5bb7f6209a231">Rumble</a> mode);</div>
<div class="line"><a name="l00189"></a><span class="lineno"> 189</span>&#160; <span class="keywordtype">void</span> <a class="code" href="class_p_s3_u_s_b.html#a5dc4e5d1ebd5ca24da7cdc9dd08c94e1">setRumbleOn</a>(uint8_t rightDuration, uint8_t rightPower, uint8_t leftDuration, uint8_t leftPower);</div>
<div class="line"><a name="l00190"></a><span class="lineno"> 190</span>&#160;</div>
<div class="line"><a name="l00195"></a><span class="lineno"> 195</span>&#160; <span class="keywordtype">void</span> <a class="code" href="class_p_s3_u_s_b.html#aa0aac5ea016db4cd6736a15e9d6eb41b">setLedRaw</a>(uint8_t value);</div>
<div class="line"><a name="l00200"></a><span class="lineno"> 200</span>&#160; <span class="keywordtype">void</span> <a class="code" href="class_p_s3_u_s_b.html#adb361fecbe4eb6fc5635dc7135cfff03">setLedOff</a>(<a class="code" href="controller_enums_8h.html#aadcb6002d2b42fdfe01490f730ab00a6">LED</a> a);</div>
<div class="line"><a name="l00205"></a><span class="lineno"> 205</span>&#160; <span class="keywordtype">void</span> <a class="code" href="class_p_s3_u_s_b.html#a44c4bff09064a09ef97c7bb6b8c0810b">setLedOn</a>(<a class="code" href="controller_enums_8h.html#aadcb6002d2b42fdfe01490f730ab00a6">LED</a> a);</div>
<div class="line"><a name="l00210"></a><span class="lineno"> 210</span>&#160; <span class="keywordtype">void</span> <a class="code" href="class_p_s3_u_s_b.html#acbab64f537f092e2fb125f9001f46090">setLedToggle</a>(<a class="code" href="controller_enums_8h.html#aadcb6002d2b42fdfe01490f730ab00a6">LED</a> a);</div>
<div class="line"><a name="l00211"></a><span class="lineno"> 211</span>&#160;</div>
<div class="line"><a name="l00216"></a><span class="lineno"> 216</span>&#160; <span class="keywordtype">void</span> <a class="code" href="class_p_s3_u_s_b.html#ae9cfdaad3e54dbc271519e22082399c7">moveSetBulb</a>(uint8_t r, uint8_t g, uint8_t b);</div>
<div class="line"><a name="l00221"></a><span class="lineno"> 221</span>&#160; <span class="keywordtype">void</span> <a class="code" href="class_p_s3_u_s_b.html#ae9cfdaad3e54dbc271519e22082399c7">moveSetBulb</a>(<a class="code" href="_p_s3_enums_8h.html#a55ecd4f2ec2ebfe8d5b0163e4ac2a967">Colors</a> color);</div>
<div class="line"><a name="l00226"></a><span class="lineno"> 226</span>&#160; <span class="keywordtype">void</span> <a class="code" href="class_p_s3_u_s_b.html#a66d542c2cec73cefb3cdda36ff080e1a">moveSetRumble</a>(uint8_t rumble);</div>
<div class="line"><a name="l00230"></a><span class="lineno"><a class="code" href="class_p_s3_u_s_b.html#a0dad8754ff18d0c375c2569791d50876"> 230</a></span>&#160; <span class="keywordtype">bool</span> <a class="code" href="class_p_s3_u_s_b.html#a0dad8754ff18d0c375c2569791d50876">PS3Connected</a>;</div>
<div class="line"><a name="l00232"></a><span class="lineno"><a class="code" href="class_p_s3_u_s_b.html#a89aa4233f3eeeb99693a099da527ec28"> 232</a></span>&#160; <span class="keywordtype">bool</span> <a class="code" href="class_p_s3_u_s_b.html#a89aa4233f3eeeb99693a099da527ec28">PS3MoveConnected</a>;</div>
<div class="line"><a name="l00234"></a><span class="lineno"><a class="code" href="class_p_s3_u_s_b.html#a54b2dcaa1e9acef83de2376b50c7ff09"> 234</a></span>&#160; <span class="keywordtype">bool</span> <a class="code" href="class_p_s3_u_s_b.html#a54b2dcaa1e9acef83de2376b50c7ff09">PS3NavigationConnected</a>;</div>
<div class="line"><a name="l00235"></a><span class="lineno"> 235</span>&#160;</div>
<div class="line"><a name="l00236"></a><span class="lineno"> 236</span>&#160;<span class="keyword">protected</span>:</div>
<div class="line"><a name="l00238"></a><span class="lineno"><a class="code" href="class_p_s3_u_s_b.html#aa1873f41ae0da7c4568cfb7517560c48"> 238</a></span>&#160; <a class="code" href="class_u_s_b.html">USB</a> *<a class="code" href="class_p_s3_u_s_b.html#aa1873f41ae0da7c4568cfb7517560c48">pUsb</a>;</div>
<div class="line"><a name="l00240"></a><span class="lineno"><a class="code" href="class_p_s3_u_s_b.html#a3f43df159277003acdf7dd107bda27fd"> 240</a></span>&#160; uint8_t <a class="code" href="class_p_s3_u_s_b.html#a3f43df159277003acdf7dd107bda27fd">bAddress</a>;</div>
<div class="line"><a name="l00242"></a><span class="lineno"><a class="code" href="class_p_s3_u_s_b.html#a394dbb0a59b587210e5958f08dac48f1"> 242</a></span>&#160; <a class="code" href="struct_ep_info.html">EpInfo</a> <a class="code" href="class_p_s3_u_s_b.html#a394dbb0a59b587210e5958f08dac48f1">epInfo</a>[<a class="code" href="_p_s3_u_s_b_8h.html#a168ab47b14a95d7cf8066d553a9cb862">PS3_MAX_ENDPOINTS</a>];</div>
<div class="line"><a name="l00243"></a><span class="lineno"> 243</span>&#160;</div>
<div class="line"><a name="l00244"></a><span class="lineno"> 244</span>&#160;<span class="keyword">private</span>:</div>
<div class="line"><a name="l00245"></a><span class="lineno"> 245</span>&#160; <span class="keywordtype">bool</span> bPollEnable;</div>
<div class="line"><a name="l00246"></a><span class="lineno"> 246</span>&#160;</div>
<div class="line"><a name="l00247"></a><span class="lineno"> 247</span>&#160; uint32_t timer; <span class="comment">// used to continuously set PS3 Move controller Bulb and rumble values</span></div>
<div class="line"><a name="l00248"></a><span class="lineno"> 248</span>&#160;</div>
<div class="line"><a name="l00249"></a><span class="lineno"> 249</span>&#160; uint32_t ButtonState;</div>
<div class="line"><a name="l00250"></a><span class="lineno"> 250</span>&#160; uint32_t OldButtonState;</div>
<div class="line"><a name="l00251"></a><span class="lineno"> 251</span>&#160; uint32_t ButtonClickState;</div>
<div class="line"><a name="l00252"></a><span class="lineno"> 252</span>&#160;</div>
<div class="line"><a name="l00253"></a><span class="lineno"> 253</span>&#160; uint8_t my_bdaddr[6]; <span class="comment">// Change to your dongles Bluetooth address in the constructor</span></div>
<div class="line"><a name="l00254"></a><span class="lineno"> 254</span>&#160; uint8_t readBuf[<a class="code" href="_p_s3_u_s_b_8h.html#abcb805b13bfd36145e252b0633bbcfc0">EP_MAXPKTSIZE</a>]; <span class="comment">// General purpose buffer for input data</span></div>
<div class="line"><a name="l00255"></a><span class="lineno"> 255</span>&#160; uint8_t writeBuf[<a class="code" href="_p_s3_u_s_b_8h.html#abcb805b13bfd36145e252b0633bbcfc0">EP_MAXPKTSIZE</a>]; <span class="comment">// General purpose buffer for output data</span></div>
<div class="line"><a name="l00256"></a><span class="lineno"> 256</span>&#160;</div>
<div class="line"><a name="l00257"></a><span class="lineno"> 257</span>&#160; <span class="keywordtype">void</span> readReport(); <span class="comment">// read incoming data</span></div>
<div class="line"><a name="l00258"></a><span class="lineno"> 258</span>&#160; <span class="keywordtype">void</span> printReport(); <span class="comment">// print incoming date - Uncomment for debugging</span></div>
<div class="line"><a name="l00259"></a><span class="lineno"> 259</span>&#160;</div>
<div class="line"><a name="l00260"></a><span class="lineno"> 260</span>&#160; <span class="comment">/* Private commands */</span></div>
<div class="line"><a name="l00261"></a><span class="lineno"> 261</span>&#160; <span class="keywordtype">void</span> PS3_Command(uint8_t* data, uint16_t nbytes);</div>
<div class="line"><a name="l00262"></a><span class="lineno"> 262</span>&#160; <span class="keywordtype">void</span> enable_sixaxis(); <span class="comment">// Command used to enable the Dualshock 3 and Navigation controller to send data via USB</span></div>
<div class="line"><a name="l00263"></a><span class="lineno"> 263</span>&#160; <span class="keywordtype">void</span> Move_Command(uint8_t* data, uint16_t nbytes);</div>
<div class="line"><a name="l00264"></a><span class="lineno"> 264</span>&#160;};</div>
<div class="line"><a name="l00265"></a><span class="lineno"> 265</span>&#160;<span class="preprocessor">#endif</span></div>
<div class="line"><a name="l00107"></a><span class="lineno"> 107</span>&#160;</div>
<div class="line"><a name="l00114"></a><span class="lineno"><a class="code" href="class_p_s3_u_s_b.html#ababb6cbf8297581b27400f9a39d75e5a"> 114</a></span>&#160; <span class="keyword">virtual</span> <span class="keywordtype">boolean</span> <a class="code" href="class_p_s3_u_s_b.html#ababb6cbf8297581b27400f9a39d75e5a">VIDPIDOK</a>(uint16_t vid, uint16_t pid) {</div>
<div class="line"><a name="l00115"></a><span class="lineno"> 115</span>&#160; <span class="keywordflow">return</span> (vid == <a class="code" href="_p_s3_u_s_b_8h.html#a5bb06f989db583d290ba79642d37c514">PS3_VID</a> &amp;&amp; (pid == <a class="code" href="_p_s3_u_s_b_8h.html#a0ae276efa5e73a4da658c714e70402c0">PS3_PID</a> || pid == <a class="code" href="_p_s3_u_s_b_8h.html#a54903b410722a45f8246653cd4d00632">PS3NAVIGATION_PID</a> || pid == <a class="code" href="_p_s3_u_s_b_8h.html#afc242b8a1b867f79c49ad78e3a47b37f">PS3MOVE_PID</a>));</div>
<div class="line"><a name="l00116"></a><span class="lineno"> 116</span>&#160; };</div>
<div class="line"><a name="l00123"></a><span class="lineno"> 123</span>&#160; <span class="keywordtype">void</span> <a class="code" href="class_p_s3_u_s_b.html#af13993073ab245ece6d3fe9e9f41df87">setBdaddr</a>(uint8_t* BDADDR);</div>
<div class="line"><a name="l00128"></a><span class="lineno"> 128</span>&#160; <span class="keywordtype">void</span> <a class="code" href="class_p_s3_u_s_b.html#a3be69a3c6e24bf2b53bc06c85829e62a">setMoveBdaddr</a>(uint8_t* BDADDR);</div>
<div class="line"><a name="l00129"></a><span class="lineno"> 129</span>&#160;</div>
<div class="line"><a name="l00139"></a><span class="lineno"> 139</span>&#160; <span class="keywordtype">bool</span> <a class="code" href="class_p_s3_u_s_b.html#ad1de9af6fb34f4cff6c1ed0af21b0141">getButtonPress</a>(<a class="code" href="controller_enums_8h.html#a03bfec859eac87be20f8952c1eb89de0">Button</a> b);</div>
<div class="line"><a name="l00140"></a><span class="lineno"> 140</span>&#160; <span class="keywordtype">bool</span> <a class="code" href="class_p_s3_u_s_b.html#a9a50f5ed5b41232336cc6d1870795230">getButtonClick</a>(<a class="code" href="controller_enums_8h.html#a03bfec859eac87be20f8952c1eb89de0">Button</a> b);</div>
<div class="line"><a name="l00151"></a><span class="lineno"> 151</span>&#160; uint8_t <a class="code" href="class_p_s3_u_s_b.html#a2d30813a3f5c4729b5c1662832d5a6e0">getAnalogButton</a>(<a class="code" href="controller_enums_8h.html#a03bfec859eac87be20f8952c1eb89de0">Button</a> a);</div>
<div class="line"><a name="l00157"></a><span class="lineno"> 157</span>&#160; uint8_t <a class="code" href="class_p_s3_u_s_b.html#a2b0f391b8ae3e80b18cf9108c3e8f7e3">getAnalogHat</a>(<a class="code" href="controller_enums_8h.html#aaaabdefc068fd57ec2bef2b62ea4ba92">AnalogHat</a> a);</div>
<div class="line"><a name="l00164"></a><span class="lineno"> 164</span>&#160; uint16_t <a class="code" href="class_p_s3_u_s_b.html#a4fe61beae6f0e36e4df1ea388bed0783">getSensor</a>(<a class="code" href="_p_s3_enums_8h.html#a9628766e5f200cc84b296b071b09ff4a">Sensor</a> a);</div>
<div class="line"><a name="l00170"></a><span class="lineno"> 170</span>&#160; <span class="keywordtype">double</span> <a class="code" href="class_p_s3_u_s_b.html#a9b9e5a3a3e80957f47f86f4155fee777">getAngle</a>(<a class="code" href="_p_s3_enums_8h.html#a0200d2d1b3a7930d0be6c50e7c8ae7d1">Angle</a> a);</div>
<div class="line"><a name="l00176"></a><span class="lineno"> 176</span>&#160; <span class="keywordtype">bool</span> <a class="code" href="class_p_s3_u_s_b.html#a09da3bcd33a8dd20d7cb06a70833e448">getStatus</a>(<a class="code" href="_p_s3_enums_8h.html#a67a0db04d321a74b7e7fcfd3f1a3f70b">Status</a> c);</div>
<div class="line"><a name="l00181"></a><span class="lineno"> 181</span>&#160; String <a class="code" href="class_p_s3_u_s_b.html#ae3f19089341bb545f31b3b01e77131ae">getStatusString</a>();</div>
<div class="line"><a name="l00182"></a><span class="lineno"> 182</span>&#160;</div>
<div class="line"><a name="l00184"></a><span class="lineno"> 184</span>&#160; <span class="keywordtype">void</span> <a class="code" href="class_p_s3_u_s_b.html#ac7adc7365bb45d15c37e22f26f012498">setAllOff</a>();</div>
<div class="line"><a name="l00186"></a><span class="lineno"> 186</span>&#160; <span class="keywordtype">void</span> <a class="code" href="class_p_s3_u_s_b.html#aaa1e66d7397be6364d4f76749cbaad5a">setRumbleOff</a>();</div>
<div class="line"><a name="l00191"></a><span class="lineno"> 191</span>&#160; <span class="keywordtype">void</span> <a class="code" href="class_p_s3_u_s_b.html#a5dc4e5d1ebd5ca24da7cdc9dd08c94e1">setRumbleOn</a>(<a class="code" href="_p_s3_enums_8h.html#aff4be38428d075a117a5bb7f6209a231">Rumble</a> mode);</div>
<div class="line"><a name="l00199"></a><span class="lineno"> 199</span>&#160; <span class="keywordtype">void</span> <a class="code" href="class_p_s3_u_s_b.html#a5dc4e5d1ebd5ca24da7cdc9dd08c94e1">setRumbleOn</a>(uint8_t rightDuration, uint8_t rightPower, uint8_t leftDuration, uint8_t leftPower);</div>
<div class="line"><a name="l00200"></a><span class="lineno"> 200</span>&#160;</div>
<div class="line"><a name="l00205"></a><span class="lineno"> 205</span>&#160; <span class="keywordtype">void</span> <a class="code" href="class_p_s3_u_s_b.html#aa0aac5ea016db4cd6736a15e9d6eb41b">setLedRaw</a>(uint8_t value);</div>
<div class="line"><a name="l00210"></a><span class="lineno"> 210</span>&#160; <span class="keywordtype">void</span> <a class="code" href="class_p_s3_u_s_b.html#adb361fecbe4eb6fc5635dc7135cfff03">setLedOff</a>(<a class="code" href="controller_enums_8h.html#aadcb6002d2b42fdfe01490f730ab00a6">LED</a> a);</div>
<div class="line"><a name="l00215"></a><span class="lineno"> 215</span>&#160; <span class="keywordtype">void</span> <a class="code" href="class_p_s3_u_s_b.html#a44c4bff09064a09ef97c7bb6b8c0810b">setLedOn</a>(<a class="code" href="controller_enums_8h.html#aadcb6002d2b42fdfe01490f730ab00a6">LED</a> a);</div>
<div class="line"><a name="l00220"></a><span class="lineno"> 220</span>&#160; <span class="keywordtype">void</span> <a class="code" href="class_p_s3_u_s_b.html#acbab64f537f092e2fb125f9001f46090">setLedToggle</a>(<a class="code" href="controller_enums_8h.html#aadcb6002d2b42fdfe01490f730ab00a6">LED</a> a);</div>
<div class="line"><a name="l00221"></a><span class="lineno"> 221</span>&#160;</div>
<div class="line"><a name="l00226"></a><span class="lineno"> 226</span>&#160; <span class="keywordtype">void</span> <a class="code" href="class_p_s3_u_s_b.html#ae9cfdaad3e54dbc271519e22082399c7">moveSetBulb</a>(uint8_t r, uint8_t g, uint8_t b);</div>
<div class="line"><a name="l00231"></a><span class="lineno"> 231</span>&#160; <span class="keywordtype">void</span> <a class="code" href="class_p_s3_u_s_b.html#ae9cfdaad3e54dbc271519e22082399c7">moveSetBulb</a>(<a class="code" href="_p_s3_enums_8h.html#a55ecd4f2ec2ebfe8d5b0163e4ac2a967">Colors</a> color);</div>
<div class="line"><a name="l00236"></a><span class="lineno"> 236</span>&#160; <span class="keywordtype">void</span> <a class="code" href="class_p_s3_u_s_b.html#a66d542c2cec73cefb3cdda36ff080e1a">moveSetRumble</a>(uint8_t rumble);</div>
<div class="line"><a name="l00237"></a><span class="lineno"> 237</span>&#160;</div>
<div class="line"><a name="l00242"></a><span class="lineno"><a class="code" href="class_p_s3_u_s_b.html#ad06a172d85adf4ffc54dd8117b0be42e"> 242</a></span>&#160; <span class="keywordtype">void</span> <a class="code" href="class_p_s3_u_s_b.html#ad06a172d85adf4ffc54dd8117b0be42e">attachOnInit</a>(<span class="keywordtype">void</span> (*funcOnInit)(<span class="keywordtype">void</span>)) {</div>
<div class="line"><a name="l00243"></a><span class="lineno"> 243</span>&#160; pFuncOnInit = funcOnInit;</div>
<div class="line"><a name="l00244"></a><span class="lineno"><a class="code" href="class_p_s3_u_s_b.html#a0dad8754ff18d0c375c2569791d50876"> 244</a></span>&#160; };</div>
<div class="line"><a name="l00248"></a><span class="lineno"> 248</span>&#160; <span class="keywordtype">bool</span> <a class="code" href="class_p_s3_u_s_b.html#a0dad8754ff18d0c375c2569791d50876">PS3Connected</a>;</div>
<div class="line"><a name="l00250"></a><span class="lineno"><a class="code" href="class_p_s3_u_s_b.html#a89aa4233f3eeeb99693a099da527ec28"> 250</a></span>&#160; <span class="keywordtype">bool</span> <a class="code" href="class_p_s3_u_s_b.html#a89aa4233f3eeeb99693a099da527ec28">PS3MoveConnected</a>;</div>
<div class="line"><a name="l00252"></a><span class="lineno"><a class="code" href="class_p_s3_u_s_b.html#a54b2dcaa1e9acef83de2376b50c7ff09"> 252</a></span>&#160; <span class="keywordtype">bool</span> <a class="code" href="class_p_s3_u_s_b.html#a54b2dcaa1e9acef83de2376b50c7ff09">PS3NavigationConnected</a>;</div>
<div class="line"><a name="l00253"></a><span class="lineno"> 253</span>&#160;</div>
<div class="line"><a name="l00254"></a><span class="lineno"> 254</span>&#160;<span class="keyword">protected</span>:</div>
<div class="line"><a name="l00256"></a><span class="lineno"><a class="code" href="class_p_s3_u_s_b.html#aa1873f41ae0da7c4568cfb7517560c48"> 256</a></span>&#160; <a class="code" href="class_u_s_b.html">USB</a> *<a class="code" href="class_p_s3_u_s_b.html#aa1873f41ae0da7c4568cfb7517560c48">pUsb</a>;</div>
<div class="line"><a name="l00258"></a><span class="lineno"><a class="code" href="class_p_s3_u_s_b.html#a3f43df159277003acdf7dd107bda27fd"> 258</a></span>&#160; uint8_t <a class="code" href="class_p_s3_u_s_b.html#a3f43df159277003acdf7dd107bda27fd">bAddress</a>;</div>
<div class="line"><a name="l00260"></a><span class="lineno"><a class="code" href="class_p_s3_u_s_b.html#a394dbb0a59b587210e5958f08dac48f1"> 260</a></span>&#160; <a class="code" href="struct_ep_info.html">EpInfo</a> <a class="code" href="class_p_s3_u_s_b.html#a394dbb0a59b587210e5958f08dac48f1">epInfo</a>[<a class="code" href="_p_s3_u_s_b_8h.html#a168ab47b14a95d7cf8066d553a9cb862">PS3_MAX_ENDPOINTS</a>];</div>
<div class="line"><a name="l00261"></a><span class="lineno"> 261</span>&#160;</div>
<div class="line"><a name="l00262"></a><span class="lineno"> 262</span>&#160;<span class="keyword">private</span>:</div>
<div class="line"><a name="l00268"></a><span class="lineno"> 268</span>&#160; <span class="keywordtype">void</span> onInit();</div>
<div class="line"><a name="l00269"></a><span class="lineno"> 269</span>&#160; void (*pFuncOnInit)(void); <span class="comment">// Pointer to function called in onInit()</span></div>
<div class="line"><a name="l00270"></a><span class="lineno"> 270</span>&#160; </div>
<div class="line"><a name="l00271"></a><span class="lineno"> 271</span>&#160; <span class="keywordtype">bool</span> bPollEnable;</div>
<div class="line"><a name="l00272"></a><span class="lineno"> 272</span>&#160;</div>
<div class="line"><a name="l00273"></a><span class="lineno"> 273</span>&#160; uint32_t timer; <span class="comment">// used to continuously set PS3 Move controller Bulb and rumble values</span></div>
<div class="line"><a name="l00274"></a><span class="lineno"> 274</span>&#160;</div>
<div class="line"><a name="l00275"></a><span class="lineno"> 275</span>&#160; uint32_t ButtonState;</div>
<div class="line"><a name="l00276"></a><span class="lineno"> 276</span>&#160; uint32_t OldButtonState;</div>
<div class="line"><a name="l00277"></a><span class="lineno"> 277</span>&#160; uint32_t ButtonClickState;</div>
<div class="line"><a name="l00278"></a><span class="lineno"> 278</span>&#160;</div>
<div class="line"><a name="l00279"></a><span class="lineno"> 279</span>&#160; uint8_t my_bdaddr[6]; <span class="comment">// Change to your dongles Bluetooth address in the constructor</span></div>
<div class="line"><a name="l00280"></a><span class="lineno"> 280</span>&#160; uint8_t readBuf[<a class="code" href="_p_s3_u_s_b_8h.html#abcb805b13bfd36145e252b0633bbcfc0">EP_MAXPKTSIZE</a>]; <span class="comment">// General purpose buffer for input data</span></div>
<div class="line"><a name="l00281"></a><span class="lineno"> 281</span>&#160; uint8_t writeBuf[<a class="code" href="_p_s3_u_s_b_8h.html#abcb805b13bfd36145e252b0633bbcfc0">EP_MAXPKTSIZE</a>]; <span class="comment">// General purpose buffer for output data</span></div>
<div class="line"><a name="l00282"></a><span class="lineno"> 282</span>&#160;</div>
<div class="line"><a name="l00283"></a><span class="lineno"> 283</span>&#160; <span class="keywordtype">void</span> readReport(); <span class="comment">// read incoming data</span></div>
<div class="line"><a name="l00284"></a><span class="lineno"> 284</span>&#160; <span class="keywordtype">void</span> printReport(); <span class="comment">// print incoming date - Uncomment for debugging</span></div>
<div class="line"><a name="l00285"></a><span class="lineno"> 285</span>&#160;</div>
<div class="line"><a name="l00286"></a><span class="lineno"> 286</span>&#160; <span class="comment">/* Private commands */</span></div>
<div class="line"><a name="l00287"></a><span class="lineno"> 287</span>&#160; <span class="keywordtype">void</span> PS3_Command(uint8_t* data, uint16_t nbytes);</div>
<div class="line"><a name="l00288"></a><span class="lineno"> 288</span>&#160; <span class="keywordtype">void</span> enable_sixaxis(); <span class="comment">// Command used to enable the Dualshock 3 and Navigation controller to send data via USB</span></div>
<div class="line"><a name="l00289"></a><span class="lineno"> 289</span>&#160; <span class="keywordtype">void</span> Move_Command(uint8_t* data, uint16_t nbytes);</div>
<div class="line"><a name="l00290"></a><span class="lineno"> 290</span>&#160;};</div>
<div class="line"><a name="l00291"></a><span class="lineno"> 291</span>&#160;<span class="preprocessor">#endif</span></div>
</div><!-- fragment --></div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>

View file

@ -109,7 +109,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
<div class="line"><a name="l00022"></a><span class="lineno"> 22</span>&#160;<span class="stringliteral">* __Alexei Glushchenko, Circuits\@Home__ - &lt;alex-gl@mail.ru&gt;</span></div>
<div class="line"><a name="l00023"></a><span class="lineno"> 23</span>&#160;<span class="stringliteral"> * Developers of the USB Core, HID, FTDI, ADK, ACM, and PL2303 libraries</span></div>
<div class="line"><a name="l00024"></a><span class="lineno"> 24</span>&#160;<span class="stringliteral">* __Kristian Lauszus, TKJ Electronics__ - &lt;kristianl@tkjelectronics.com&gt;</span></div>
<div class="line"><a name="l00025"></a><span class="lineno"> 25</span>&#160;<span class="stringliteral"> * Developer of the BTD, SPP, PS3, Wii, and Xbox libraries</span></div>
<div class="line"><a name="l00025"></a><span class="lineno"> 25</span>&#160;<span class="stringliteral"> * Developer of the [BTD](#bluetooth-libraries), [SPP](#spp-library), [PS3](#ps3-library), [Wii](#wii-library), and [Xbox](#xbox-library) libraries</span></div>
<div class="line"><a name="l00026"></a><span class="lineno"> 26</span>&#160;<span class="stringliteral">* __Andrew Kroll__ - &lt;xxxajk@gmail.com&gt;</span></div>
<div class="line"><a name="l00027"></a><span class="lineno"> 27</span>&#160;<span class="stringliteral"> * Major contributor to mass storage code</span></div>
<div class="line"><a name="l00028"></a><span class="lineno"> 28</span>&#160;<span class="stringliteral"></span></div>
@ -140,124 +140,143 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
<div class="line"><a name="l00053"></a><span class="lineno"> 53</span>&#160;<span class="stringliteral"></span></div>
<div class="line"><a name="l00054"></a><span class="lineno"> 54</span>&#160;<span class="stringliteral">Documentation for the library can be found at the following link: &lt;http://felis.github.com/USB_Host_Shield_2.0/&gt;.</span></div>
<div class="line"><a name="l00055"></a><span class="lineno"> 55</span>&#160;<span class="stringliteral"></span></div>
<div class="line"><a name="l00056"></a><span class="lineno"> 56</span>&#160;<span class="stringliteral">### Arduino ADK</span></div>
<div class="line"><a name="l00057"></a><span class="lineno"> 57</span>&#160;<span class="stringliteral">To use this library with the official [Arduino ADK](http://arduino.cc/en/Main/ArduinoBoardADK) uncomment the following line in [avrpins.h](https://github.com/felis/USB_Host_Shield_2.0/blob/master/avrpins.h):</span></div>
<div class="line"><a name="l00058"></a><span class="lineno"> 58</span>&#160;<span class="stringliteral"></span></div>
<div class="line"><a name="l00059"></a><span class="lineno"> 59</span>&#160;<span class="stringliteral">&lt;code&gt;</span></div>
<div class="line"><a name="l00060"></a><span class="lineno"> 60</span>&#160;<span class="stringliteral">\#define BOARD\_MEGA_ADK</span></div>
<div class="line"><a name="l00061"></a><span class="lineno"> 61</span>&#160;<span class="stringliteral">&lt;/code&gt;</span></div>
<div class="line"><a name="l00056"></a><span class="lineno"> 56</span>&#160;<span class="stringliteral">### Enable debugging</span></div>
<div class="line"><a name="l00057"></a><span class="lineno"> 57</span>&#160;<span class="stringliteral"></span></div>
<div class="line"><a name="l00058"></a><span class="lineno"> 58</span>&#160;<span class="stringliteral">By default serial debugging is disabled. To turn it on uncomment ```DEBUG_USB_HOST``` in [message.h](message.h).</span></div>
<div class="line"><a name="l00059"></a><span class="lineno"> 59</span>&#160;<span class="stringliteral"></span></div>
<div class="line"><a name="l00060"></a><span class="lineno"> 60</span>&#160;<span class="stringliteral">### Arduino ADK</span></div>
<div class="line"><a name="l00061"></a><span class="lineno"> 61</span>&#160;<span class="stringliteral">To use this library with the official [Arduino ADK](http://arduino.cc/en/Main/ArduinoBoardADK) uncomment the following line in [avrpins.h](avrpins.h):</span></div>
<div class="line"><a name="l00062"></a><span class="lineno"> 62</span>&#160;<span class="stringliteral"></span></div>
<div class="line"><a name="l00063"></a><span class="lineno"> 63</span>&#160;<span class="stringliteral">### [Bluetooth libraries](https://github.com/felis/USB_Host_Shield_2.0/blob/master/BTD.cpp)</span></div>
<div class="line"><a name="l00064"></a><span class="lineno"> 64</span>&#160;<span class="stringliteral"></span></div>
<div class="line"><a name="l00065"></a><span class="lineno"> 65</span>&#160;<span class="stringliteral">The [BTD library](https://github.com/felis/USB_Host_Shield_2.0/blob/master/BTD.cpp) is a general purpose library for an ordinary Bluetooth dongle.</span></div>
<div class="line"><a name="l00066"></a><span class="lineno"> 66</span>&#160;<span class="stringliteral">This library make it easy to add support for different Bluetooth services like a PS3 or a Wii controller or SPP which is a virtual serial port via Bluetooth.</span></div>
<div class="line"><a name="l00067"></a><span class="lineno"> 67</span>&#160;<span class="stringliteral">Some different examples can be found in the [example directory](https://github.com/felis/USB_Host_Shield_2.0/tree/master/examples/Bluetooth).</span></div>
<div class="line"><a name="l00063"></a><span class="lineno"> 63</span>&#160;<span class="stringliteral">```</span></div>
<div class="line"><a name="l00064"></a><span class="lineno"> 64</span>&#160;<span class="stringliteral">#define BOARD_MEGA_ADK</span></div>
<div class="line"><a name="l00065"></a><span class="lineno"> 65</span>&#160;<span class="stringliteral">```</span></div>
<div class="line"><a name="l00066"></a><span class="lineno"> 66</span>&#160;<span class="stringliteral"></span></div>
<div class="line"><a name="l00067"></a><span class="lineno"> 67</span>&#160;<span class="stringliteral">### [Bluetooth libraries](BTD.cpp)</span></div>
<div class="line"><a name="l00068"></a><span class="lineno"> 68</span>&#160;<span class="stringliteral"></span></div>
<div class="line"><a name="l00069"></a><span class="lineno"> 69</span>&#160;<span class="stringliteral">The BTD library will also make it possible to use multiple services at once, the following example sketch is an example of this:</span></div>
<div class="line"><a name="l00070"></a><span class="lineno"> 70</span>&#160;<span class="stringliteral">&lt;https://github.com/felis/USB_Host_Shield_2.0/blob/master/examples/Bluetooth/PS3SPP/PS3SPP.ino&gt;</span></div>
<div class="line"><a name="l00071"></a><span class="lineno"> 71</span>&#160;<span class="stringliteral"></span></div>
<div class="line"><a name="l00072"></a><span class="lineno"> 72</span>&#160;<span class="stringliteral">### [SPP library](https://github.com/felis/USB_Host_Shield_2.0/blob/master/SPP.cpp)</span></div>
<div class="line"><a name="l00073"></a><span class="lineno"> 73</span>&#160;<span class="stringliteral"></span></div>
<div class="line"><a name="l00074"></a><span class="lineno"> 74</span>&#160;<span class="stringliteral">SPP stands for &quot;Serial Port Profile&quot; and is a Bluetooth protocol that implements a virtual comport which allows you to send data back and forth from your computer/phone to your Arduino via Bluetooth.</span></div>
<div class="line"><a name="l00075"></a><span class="lineno"> 75</span>&#160;<span class="stringliteral">It has been tested successfully on Windows, Mac OS X, Linux, and Android.</span></div>
<div class="line"><a name="l00076"></a><span class="lineno"> 76</span>&#160;<span class="stringliteral"></span></div>
<div class="line"><a name="l00077"></a><span class="lineno"> 77</span>&#160;<span class="stringliteral">More information can be found at these blog posts:</span></div>
<div class="line"><a name="l00078"></a><span class="lineno"> 78</span>&#160;<span class="stringliteral"></span></div>
<div class="line"><a name="l00079"></a><span class="lineno"> 79</span>&#160;<span class="stringliteral">* &lt;http://www.circuitsathome.com/mcu/bluetooth-rfcommspp-service-support-for-usb-host-2-0-library-released&gt;</span></div>
<div class="line"><a name="l00080"></a><span class="lineno"> 80</span>&#160;<span class="stringliteral">* &lt;http://blog.tkjelectronics.dk/2012/07/rfcommspp-library-for-arduino/&gt;</span></div>
<div class="line"><a name="l00081"></a><span class="lineno"> 81</span>&#160;<span class="stringliteral"></span></div>
<div class="line"><a name="l00082"></a><span class="lineno"> 82</span>&#160;<span class="stringliteral">To implement the SPP protocol I used a Bluetooth sniffing tool called [PacketLogger](http://www.tkjelectronics.com/uploads/PacketLogger.zip) developed by Apple. </span></div>
<div class="line"><a name="l00083"></a><span class="lineno"> 83</span>&#160;<span class="stringliteral">It enables me to see the Bluetooth communication between my Mac and any device.</span></div>
<div class="line"><a name="l00084"></a><span class="lineno"> 84</span>&#160;<span class="stringliteral"></span></div>
<div class="line"><a name="l00085"></a><span class="lineno"> 85</span>&#160;<span class="stringliteral">### PS3 Library</span></div>
<div class="line"><a name="l00086"></a><span class="lineno"> 86</span>&#160;<span class="stringliteral"></span></div>
<div class="line"><a name="l00087"></a><span class="lineno"> 87</span>&#160;<span class="stringliteral">These libraries consist of the [PS3BT](https://github.com/felis/USB_Host_Shield_2.0/blob/master/PS3BT.cpp) and [PS3USB](https://github.com/felis/USB_Host_Shield_2.0/blob/master/PS3USB.cpp). These libraries allows you to use a Dualshock 3, Navigation or a Motion controller with the USB Host Shield both via Bluetooth and USB.</span></div>
<div class="line"><a name="l00069"></a><span class="lineno"> 69</span>&#160;<span class="stringliteral">The [BTD library](BTD.cpp) is a general purpose library for an ordinary Bluetooth dongle.</span></div>
<div class="line"><a name="l00070"></a><span class="lineno"> 70</span>&#160;<span class="stringliteral">This library make it easy to add support for different Bluetooth services like a PS3 or a Wii controller or SPP which is a virtual serial port via Bluetooth.</span></div>
<div class="line"><a name="l00071"></a><span class="lineno"> 71</span>&#160;<span class="stringliteral">Some different examples can be found in the [example directory](examples/Bluetooth).</span></div>
<div class="line"><a name="l00072"></a><span class="lineno"> 72</span>&#160;<span class="stringliteral"></span></div>
<div class="line"><a name="l00073"></a><span class="lineno"> 73</span>&#160;<span class="stringliteral">The BTD library will also make it possible to use multiple services at once, the following example sketch is an example of this:</span></div>
<div class="line"><a name="l00074"></a><span class="lineno"> 74</span>&#160;<span class="stringliteral">&lt;https://github.com/felis/USB_Host_Shield_2.0/blob/master/examples/Bluetooth/PS3SPP/PS3SPP.ino&gt;</span></div>
<div class="line"><a name="l00075"></a><span class="lineno"> 75</span>&#160;<span class="stringliteral"></span></div>
<div class="line"><a name="l00076"></a><span class="lineno"> 76</span>&#160;<span class="stringliteral">### [SPP library](SPP.cpp)</span></div>
<div class="line"><a name="l00077"></a><span class="lineno"> 77</span>&#160;<span class="stringliteral"></span></div>
<div class="line"><a name="l00078"></a><span class="lineno"> 78</span>&#160;<span class="stringliteral">SPP stands for &quot;Serial Port Profile&quot; and is a Bluetooth protocol that implements a virtual comport which allows you to send data back and forth from your computer/phone to your Arduino via Bluetooth.</span></div>
<div class="line"><a name="l00079"></a><span class="lineno"> 79</span>&#160;<span class="stringliteral">It has been tested successfully on Windows, Mac OS X, Linux, and Android.</span></div>
<div class="line"><a name="l00080"></a><span class="lineno"> 80</span>&#160;<span class="stringliteral"></span></div>
<div class="line"><a name="l00081"></a><span class="lineno"> 81</span>&#160;<span class="stringliteral">More information can be found at these blog posts:</span></div>
<div class="line"><a name="l00082"></a><span class="lineno"> 82</span>&#160;<span class="stringliteral"></span></div>
<div class="line"><a name="l00083"></a><span class="lineno"> 83</span>&#160;<span class="stringliteral">* &lt;http://www.circuitsathome.com/mcu/bluetooth-rfcommspp-service-support-for-usb-host-2-0-library-released&gt;</span></div>
<div class="line"><a name="l00084"></a><span class="lineno"> 84</span>&#160;<span class="stringliteral">* &lt;http://blog.tkjelectronics.dk/2012/07/rfcommspp-library-for-arduino/&gt;</span></div>
<div class="line"><a name="l00085"></a><span class="lineno"> 85</span>&#160;<span class="stringliteral"></span></div>
<div class="line"><a name="l00086"></a><span class="lineno"> 86</span>&#160;<span class="stringliteral">To implement the SPP protocol I used a Bluetooth sniffing tool called [PacketLogger](http://www.tkjelectronics.com/uploads/PacketLogger.zip) developed by Apple. </span></div>
<div class="line"><a name="l00087"></a><span class="lineno"> 87</span>&#160;<span class="stringliteral">It enables me to see the Bluetooth communication between my Mac and any device.</span></div>
<div class="line"><a name="l00088"></a><span class="lineno"> 88</span>&#160;<span class="stringliteral"></span></div>
<div class="line"><a name="l00089"></a><span class="lineno"> 89</span>&#160;<span class="stringliteral">In order to use your Playstation controller via Bluetooth you have to set the Bluetooth address of the dongle internally to your PS3 Controller. This can be achieved by plugging the controller in via USB and letting the library set it automatically.</span></div>
<div class="line"><a name="l00089"></a><span class="lineno"> 89</span>&#160;<span class="stringliteral">### PS3 Library</span></div>
<div class="line"><a name="l00090"></a><span class="lineno"> 90</span>&#160;<span class="stringliteral"></span></div>
<div class="line"><a name="l00091"></a><span class="lineno"> 91</span>&#160;<span class="stringliteral">__Note:__ To obtain the address you have to plug in the Bluetooth dongle before connecting the controller, or alternatively you could set it in code like so: &lt;https://github.com/felis/USB_Host_Shield_2.0/blob/master/examples/Bluetooth/PS3BT/PS3BT.ino#L12&gt;.</span></div>
<div class="line"><a name="l00091"></a><span class="lineno"> 91</span>&#160;<span class="stringliteral">These libraries consist of the [PS3BT](PS3BT.cpp) and [PS3USB](PS3USB.cpp). These libraries allows you to use a Dualshock 3, Navigation or a Motion controller with the USB Host Shield both via Bluetooth and USB.</span></div>
<div class="line"><a name="l00092"></a><span class="lineno"> 92</span>&#160;<span class="stringliteral"></span></div>
<div class="line"><a name="l00093"></a><span class="lineno"> 93</span>&#160;<span class="stringliteral">For more information about the PS3 protocol see the official wiki: &lt;https://github.com/felis/USB_Host_Shield_2.0/wiki/PS3-Information&gt;.</span></div>
<div class="line"><a name="l00093"></a><span class="lineno"> 93</span>&#160;<span class="stringliteral">In order to use your Playstation controller via Bluetooth you have to set the Bluetooth address of the dongle internally to your PS3 Controller. This can be achieved by plugging the controller in via USB and letting the library set it automatically.</span></div>
<div class="line"><a name="l00094"></a><span class="lineno"> 94</span>&#160;<span class="stringliteral"></span></div>
<div class="line"><a name="l00095"></a><span class="lineno"> 95</span>&#160;<span class="stringliteral">Also take a look at the blog posts:</span></div>
<div class="line"><a name="l00095"></a><span class="lineno"> 95</span>&#160;<span class="stringliteral">__Note:__ To obtain the address you have to plug in the Bluetooth dongle before connecting the controller, or alternatively you could set it in code like so: &lt;https://github.com/felis/USB_Host_Shield_2.0/blob/master/examples/Bluetooth/PS3BT/PS3BT.ino#L12&gt;.</span></div>
<div class="line"><a name="l00096"></a><span class="lineno"> 96</span>&#160;<span class="stringliteral"></span></div>
<div class="line"><a name="l00097"></a><span class="lineno"> 97</span>&#160;<span class="stringliteral">* &lt;http://blog.tkjelectronics.dk/2012/01/ps3-controller-bt-library-for-arduino/&gt;</span></div>
<div class="line"><a name="l00098"></a><span class="lineno"> 98</span>&#160;<span class="stringliteral">* &lt;http://www.circuitsathome.com/mcu/sony-ps3-controller-support-added-to-usb-host-library&gt;</span></div>
<div class="line"><a name="l00099"></a><span class="lineno"> 99</span>&#160;<span class="stringliteral">* &lt;http://www.circuitsathome.com/mcu/arduino/interfacing-ps3-controllers-via-usb&gt;</span></div>
<div class="line"><a name="l00097"></a><span class="lineno"> 97</span>&#160;<span class="stringliteral">For more information about the PS3 protocol see the official wiki: &lt;https://github.com/felis/USB_Host_Shield_2.0/wiki/PS3-Information&gt;.</span></div>
<div class="line"><a name="l00098"></a><span class="lineno"> 98</span>&#160;<span class="stringliteral"></span></div>
<div class="line"><a name="l00099"></a><span class="lineno"> 99</span>&#160;<span class="stringliteral">Also take a look at the blog posts:</span></div>
<div class="line"><a name="l00100"></a><span class="lineno"> 100</span>&#160;<span class="stringliteral"></span></div>
<div class="line"><a name="l00101"></a><span class="lineno"> 101</span>&#160;<span class="stringliteral">A special thanks go to the following people:</span></div>
<div class="line"><a name="l00102"></a><span class="lineno"> 102</span>&#160;<span class="stringliteral"></span></div>
<div class="line"><a name="l00103"></a><span class="lineno"> 103</span>&#160;<span class="stringliteral">1. _Richard Ibbotson_ who made this excellent guide: &lt;http://www.circuitsathome.com/mcu/ps3-and-wiimote-game-controllers-on-the-arduino-host-shield-part&gt;</span></div>
<div class="line"><a name="l00104"></a><span class="lineno"> 104</span>&#160;<span class="stringliteral">2. _Tomoyuki Tanaka_ for releasing his code for the Arduino USB Host shield connected to the wiimote: &lt;http://www.circuitsathome.com/mcu/rc-car-controlled-by-wii-remote-on-arduino&gt;</span></div>
<div class="line"><a name="l00105"></a><span class="lineno"> 105</span>&#160;<span class="stringliteral"></span></div>
<div class="line"><a name="l00106"></a><span class="lineno"> 106</span>&#160;<span class="stringliteral">Also a big thanks all the people behind these sites about the Motion controller:</span></div>
<div class="line"><a name="l00107"></a><span class="lineno"> 107</span>&#160;<span class="stringliteral"></span></div>
<div class="line"><a name="l00108"></a><span class="lineno"> 108</span>&#160;<span class="stringliteral">* &lt;http://thp.io/2010/psmove/&gt;</span></div>
<div class="line"><a name="l00109"></a><span class="lineno"> 109</span>&#160;<span class="stringliteral">* &lt;http://www.copenhagengamecollective.org/unimove/&gt;</span></div>
<div class="line"><a name="l00110"></a><span class="lineno"> 110</span>&#160;<span class="stringliteral">* &lt;https://github.com/thp/psmoveapi&gt;</span></div>
<div class="line"><a name="l00111"></a><span class="lineno"> 111</span>&#160;<span class="stringliteral">* &lt;http://code.google.com/p/moveonpc/&gt;</span></div>
<div class="line"><a name="l00112"></a><span class="lineno"> 112</span>&#160;<span class="stringliteral"></span></div>
<div class="line"><a name="l00113"></a><span class="lineno"> 113</span>&#160;<span class="stringliteral">### Xbox 360 Library</span></div>
<div class="line"><a name="l00114"></a><span class="lineno"> 114</span>&#160;<span class="stringliteral"></span></div>
<div class="line"><a name="l00115"></a><span class="lineno"> 115</span>&#160;<span class="stringliteral">The library support one Xbox 360 via USB or up to four Xbox 360 controllers wirelessly by using a [Xbox 360 wireless receiver](http://blog.tkjelectronics.dk/wp-content/uploads/xbox360-wireless-receiver.jpg).</span></div>
<div class="line"><a name="l00101"></a><span class="lineno"> 101</span>&#160;<span class="stringliteral">* &lt;http://blog.tkjelectronics.dk/2012/01/ps3-controller-bt-library-for-arduino/&gt;</span></div>
<div class="line"><a name="l00102"></a><span class="lineno"> 102</span>&#160;<span class="stringliteral">* &lt;http://www.circuitsathome.com/mcu/sony-ps3-controller-support-added-to-usb-host-library&gt;</span></div>
<div class="line"><a name="l00103"></a><span class="lineno"> 103</span>&#160;<span class="stringliteral">* &lt;http://www.circuitsathome.com/mcu/arduino/interfacing-ps3-controllers-via-usb&gt;</span></div>
<div class="line"><a name="l00104"></a><span class="lineno"> 104</span>&#160;<span class="stringliteral"></span></div>
<div class="line"><a name="l00105"></a><span class="lineno"> 105</span>&#160;<span class="stringliteral">A special thanks go to the following people:</span></div>
<div class="line"><a name="l00106"></a><span class="lineno"> 106</span>&#160;<span class="stringliteral"></span></div>
<div class="line"><a name="l00107"></a><span class="lineno"> 107</span>&#160;<span class="stringliteral">1. _Richard Ibbotson_ who made this excellent guide: &lt;http://www.circuitsathome.com/mcu/ps3-and-wiimote-game-controllers-on-the-arduino-host-shield-part&gt;</span></div>
<div class="line"><a name="l00108"></a><span class="lineno"> 108</span>&#160;<span class="stringliteral">2. _Tomoyuki Tanaka_ for releasing his code for the Arduino USB Host shield connected to the wiimote: &lt;http://www.circuitsathome.com/mcu/rc-car-controlled-by-wii-remote-on-arduino&gt;</span></div>
<div class="line"><a name="l00109"></a><span class="lineno"> 109</span>&#160;<span class="stringliteral"></span></div>
<div class="line"><a name="l00110"></a><span class="lineno"> 110</span>&#160;<span class="stringliteral">Also a big thanks all the people behind these sites about the Motion controller:</span></div>
<div class="line"><a name="l00111"></a><span class="lineno"> 111</span>&#160;<span class="stringliteral"></span></div>
<div class="line"><a name="l00112"></a><span class="lineno"> 112</span>&#160;<span class="stringliteral">* &lt;http://thp.io/2010/psmove/&gt;</span></div>
<div class="line"><a name="l00113"></a><span class="lineno"> 113</span>&#160;<span class="stringliteral">* &lt;http://www.copenhagengamecollective.org/unimove/&gt;</span></div>
<div class="line"><a name="l00114"></a><span class="lineno"> 114</span>&#160;<span class="stringliteral">* &lt;https://github.com/thp/psmoveapi&gt;</span></div>
<div class="line"><a name="l00115"></a><span class="lineno"> 115</span>&#160;<span class="stringliteral">* &lt;http://code.google.com/p/moveonpc/&gt;</span></div>
<div class="line"><a name="l00116"></a><span class="lineno"> 116</span>&#160;<span class="stringliteral"></span></div>
<div class="line"><a name="l00117"></a><span class="lineno"> 117</span>&#160;<span class="stringliteral">To use it via USB use the [XBOXUSB](https://github.com/felis/USB_Host_Shield_2.0/blob/master/XBOXUSB.cpp) library or to use it wirelessly use the [XBOXRECV](https://github.com/felis/USB_Host_Shield_2.0/blob/master/XBOXRECV.cpp) library.</span></div>
<div class="line"><a name="l00117"></a><span class="lineno"> 117</span>&#160;<span class="stringliteral">### Xbox Libraries</span></div>
<div class="line"><a name="l00118"></a><span class="lineno"> 118</span>&#160;<span class="stringliteral"></span></div>
<div class="line"><a name="l00119"></a><span class="lineno"> 119</span>&#160;<span class="stringliteral">__Note that a Wireless controller can NOT be used via USB!__</span></div>
<div class="line"><a name="l00119"></a><span class="lineno"> 119</span>&#160;<span class="stringliteral">The library supports both the original Xbox controller via USB and the Xbox 360 controller both via USB and wirelessly.</span></div>
<div class="line"><a name="l00120"></a><span class="lineno"> 120</span>&#160;<span class="stringliteral"></span></div>
<div class="line"><a name="l00121"></a><span class="lineno"> 121</span>&#160;<span class="stringliteral">Examples code can be found in the [examples directory](https://github.com/felis/USB_Host_Shield_2.0/tree/master/examples/Xbox).</span></div>
<div class="line"><a name="l00121"></a><span class="lineno"> 121</span>&#160;<span class="stringliteral">#### Xbox library</span></div>
<div class="line"><a name="l00122"></a><span class="lineno"> 122</span>&#160;<span class="stringliteral"></span></div>
<div class="line"><a name="l00123"></a><span class="lineno"> 123</span>&#160;<span class="stringliteral">Also see the following blog posts:</span></div>
<div class="line"><a name="l00123"></a><span class="lineno"> 123</span>&#160;<span class="stringliteral">The [XBOXOLD](XBOXOLD.cpp) class implements support for the original Xbox controller via USB.</span></div>
<div class="line"><a name="l00124"></a><span class="lineno"> 124</span>&#160;<span class="stringliteral"></span></div>
<div class="line"><a name="l00125"></a><span class="lineno"> 125</span>&#160;<span class="stringliteral">* &lt;http://www.circuitsathome.com/mcu/xbox360-controller-support-added-to-usb-host-shield-2-0-library&gt;</span></div>
<div class="line"><a name="l00126"></a><span class="lineno"> 126</span>&#160;<span class="stringliteral">* &lt;http://blog.tkjelectronics.dk/2012/07/xbox-360-controller-support-added-to-the-usb-host-library/&gt;</span></div>
<div class="line"><a name="l00127"></a><span class="lineno"> 127</span>&#160;<span class="stringliteral">* &lt;http://blog.tkjelectronics.dk/2012/12/xbox-360-receiver-added-to-the-usb-host-library/&gt;</span></div>
<div class="line"><a name="l00128"></a><span class="lineno"> 128</span>&#160;<span class="stringliteral"></span></div>
<div class="line"><a name="l00129"></a><span class="lineno"> 129</span>&#160;<span class="stringliteral">All the information regarding the Xbox 360 controller protocol are form these sites:</span></div>
<div class="line"><a name="l00130"></a><span class="lineno"> 130</span>&#160;<span class="stringliteral"></span></div>
<div class="line"><a name="l00131"></a><span class="lineno"> 131</span>&#160;<span class="stringliteral">* &lt;http://tattiebogle.net/index.php/ProjectRoot/Xbox360Controller/UsbInfo&gt;</span></div>
<div class="line"><a name="l00132"></a><span class="lineno"> 132</span>&#160;<span class="stringliteral">* &lt;http://tattiebogle.net/index.php/ProjectRoot/Xbox360Controller/WirelessUsbInfo&gt;</span></div>
<div class="line"><a name="l00133"></a><span class="lineno"> 133</span>&#160;<span class="stringliteral">* &lt;https://github.com/Grumbel/xboxdrv/blob/master/PROTOCOL&gt;</span></div>
<div class="line"><a name="l00134"></a><span class="lineno"> 134</span>&#160;<span class="stringliteral"></span></div>
<div class="line"><a name="l00135"></a><span class="lineno"> 135</span>&#160;<span class="stringliteral">### [Wii library](https://github.com/felis/USB_Host_Shield_2.0/blob/master/Wii.cpp)</span></div>
<div class="line"><a name="l00136"></a><span class="lineno"> 136</span>&#160;<span class="stringliteral"></span></div>
<div class="line"><a name="l00137"></a><span class="lineno"> 137</span>&#160;<span class="stringliteral">The [Wii](https://github.com/felis/USB_Host_Shield_2.0/blob/master/Wii.cpp) library support the Wiimote, but also the Nunchuch and Motion Plus extensions via Bluetooth. The Wii U Pro Controller is also supported via Bluetooth.</span></div>
<div class="line"><a name="l00138"></a><span class="lineno"> 138</span>&#160;<span class="stringliteral"></span></div>
<div class="line"><a name="l00139"></a><span class="lineno"> 139</span>&#160;<span class="stringliteral">First you have to pair with the controller, this is done automatically by the library if you create the instance like so:</span></div>
<div class="line"><a name="l00140"></a><span class="lineno"> 140</span>&#160;<span class="stringliteral"></span></div>
<div class="line"><a name="l00141"></a><span class="lineno"> 141</span>&#160;<span class="stringliteral">&lt;code&gt;</span></div>
<div class="line"><a name="l00142"></a><span class="lineno"> 142</span>&#160;<span class="stringliteral">WII Wii(&amp;Btd,PAIR);</span></div>
<div class="line"><a name="l00143"></a><span class="lineno"> 143</span>&#160;<span class="stringliteral">&lt;/code&gt;</span></div>
<div class="line"><a name="l00144"></a><span class="lineno"> 144</span>&#160;<span class="stringliteral"></span></div>
<div class="line"><a name="l00145"></a><span class="lineno"> 145</span>&#160;<span class="stringliteral">And then press 1 &amp; 2 at once on the Wiimote or press sync if you are using a Wii U Pro Controller.</span></div>
<div class="line"><a name="l00146"></a><span class="lineno"> 146</span>&#160;<span class="stringliteral"></span></div>
<div class="line"><a name="l00147"></a><span class="lineno"> 147</span>&#160;<span class="stringliteral">After that you can simply create the instance like so:</span></div>
<div class="line"><a name="l00148"></a><span class="lineno"> 148</span>&#160;<span class="stringliteral"></span></div>
<div class="line"><a name="l00149"></a><span class="lineno"> 149</span>&#160;<span class="stringliteral">&lt;code&gt;</span></div>
<div class="line"><a name="l00150"></a><span class="lineno"> 150</span>&#160;<span class="stringliteral">WII Wii(&amp;Btd);</span></div>
<div class="line"><a name="l00151"></a><span class="lineno"> 151</span>&#160;<span class="stringliteral">&lt;/code&gt;</span></div>
<div class="line"><a name="l00152"></a><span class="lineno"> 152</span>&#160;<span class="stringliteral"></span></div>
<div class="line"><a name="l00153"></a><span class="lineno"> 153</span>&#160;<span class="stringliteral">Then just press any button any button on the Wiimote and it will connect to the dongle.</span></div>
<div class="line"><a name="l00154"></a><span class="lineno"> 154</span>&#160;<span class="stringliteral"></span></div>
<div class="line"><a name="l00155"></a><span class="lineno"> 155</span>&#160;<span class="stringliteral">Take a look at the example for more information: &lt;https://github.com/felis/USB_Host_Shield_2.0/blob/master/examples/Bluetooth/Wii/Wii.ino&gt;.</span></div>
<div class="line"><a name="l00156"></a><span class="lineno"> 156</span>&#160;<span class="stringliteral"></span></div>
<div class="line"><a name="l00157"></a><span class="lineno"> 157</span>&#160;<span class="stringliteral">Also take a look at the blog post:</span></div>
<div class="line"><a name="l00158"></a><span class="lineno"> 158</span>&#160;<span class="stringliteral"></span></div>
<div class="line"><a name="l00159"></a><span class="lineno"> 159</span>&#160;<span class="stringliteral">* &lt;http://blog.tkjelectronics.dk/2012/08/wiimote-added-to-usb-host-library/&gt;</span></div>
<div class="line"><a name="l00160"></a><span class="lineno"> 160</span>&#160;<span class="stringliteral"></span></div>
<div class="line"><a name="l00161"></a><span class="lineno"> 161</span>&#160;<span class="stringliteral">All the information about the Wii controllers are from these sites:</span></div>
<div class="line"><a name="l00162"></a><span class="lineno"> 162</span>&#160;<span class="stringliteral"></span></div>
<div class="line"><a name="l00163"></a><span class="lineno"> 163</span>&#160;<span class="stringliteral">* &lt;http://wiibrew.org/wiki/Wiimote&gt;</span></div>
<div class="line"><a name="l00164"></a><span class="lineno"> 164</span>&#160;<span class="stringliteral">* &lt;http://wiibrew.org/wiki/Wiimote/Extension_Controllers&gt;</span></div>
<div class="line"><a name="l00165"></a><span class="lineno"> 165</span>&#160;<span class="stringliteral">* &lt;http://wiibrew.org/wiki/Wiimote/Extension_Controllers/Nunchuck&gt;</span></div>
<div class="line"><a name="l00166"></a><span class="lineno"> 166</span>&#160;<span class="stringliteral">* &lt;http://wiibrew.org/wiki/Wiimote/Extension_Controllers/Wii_Motion_Plus&gt;</span></div>
<div class="line"><a name="l00167"></a><span class="lineno"> 167</span>&#160;<span class="stringliteral">* The old library created by _Tomoyuki Tanaka_: &lt;https://github.com/moyuchin/WiiRemote_on_Arduino&gt; also helped a lot.</span></div>
<div class="line"><a name="l00168"></a><span class="lineno"> 168</span>&#160;<span class="stringliteral"></span></div>
<div class="line"><a name="l00169"></a><span class="lineno"> 169</span>&#160;<span class="stringliteral"># FAQ</span></div>
<div class="line"><a name="l00170"></a><span class="lineno"> 170</span>&#160;<span class="stringliteral"></span></div>
<div class="line"><a name="l00171"></a><span class="lineno"> 171</span>&#160;<span class="stringliteral">&gt; When I plug my device into the USB connector nothing happens?</span></div>
<div class="line"><a name="l00172"></a><span class="lineno"> 172</span>&#160;<span class="stringliteral"></span></div>
<div class="line"><a name="l00173"></a><span class="lineno"> 173</span>&#160;<span class="stringliteral">Try to connect a external power supply to the Arduino - this solves the problem in most cases.</span></div>
<div class="line"><a name="l00125"></a><span class="lineno"> 125</span>&#160;<span class="stringliteral">All the information are from the following sites:</span></div>
<div class="line"><a name="l00126"></a><span class="lineno"> 126</span>&#160;<span class="stringliteral"></span></div>
<div class="line"><a name="l00127"></a><span class="lineno"> 127</span>&#160;<span class="stringliteral">* &lt;https://github.com/torvalds/linux/blob/master/Documentation/input/xpad.txt&gt;</span></div>
<div class="line"><a name="l00128"></a><span class="lineno"> 128</span>&#160;<span class="stringliteral">* &lt;https://github.com/torvalds/linux/blob/master/drivers/input/joystick/xpad.c&gt;</span></div>
<div class="line"><a name="l00129"></a><span class="lineno"> 129</span>&#160;<span class="stringliteral">* &lt;http://euc.jp/periphs/xbox-controller.ja.html&gt;</span></div>
<div class="line"><a name="l00130"></a><span class="lineno"> 130</span>&#160;<span class="stringliteral">* &lt;https://github.com/Grumbel/xboxdrv/blob/master/PROTOCOL#L15&gt;</span></div>
<div class="line"><a name="l00131"></a><span class="lineno"> 131</span>&#160;<span class="stringliteral"></span></div>
<div class="line"><a name="l00132"></a><span class="lineno"> 132</span>&#160;<span class="stringliteral">#### Xbox 360 Library</span></div>
<div class="line"><a name="l00133"></a><span class="lineno"> 133</span>&#160;<span class="stringliteral"></span></div>
<div class="line"><a name="l00134"></a><span class="lineno"> 134</span>&#160;<span class="stringliteral">The library support one Xbox 360 via USB or up to four Xbox 360 controllers wirelessly by using a [Xbox 360 wireless receiver](http://blog.tkjelectronics.dk/wp-content/uploads/xbox360-wireless-receiver.jpg).</span></div>
<div class="line"><a name="l00135"></a><span class="lineno"> 135</span>&#160;<span class="stringliteral"></span></div>
<div class="line"><a name="l00136"></a><span class="lineno"> 136</span>&#160;<span class="stringliteral">To use it via USB use the [XBOXUSB](XBOXUSB.cpp) library or to use it wirelessly use the [XBOXRECV](XBOXRECV.cpp) library.</span></div>
<div class="line"><a name="l00137"></a><span class="lineno"> 137</span>&#160;<span class="stringliteral"></span></div>
<div class="line"><a name="l00138"></a><span class="lineno"> 138</span>&#160;<span class="stringliteral">__Note that a Wireless controller can NOT be used via USB!__</span></div>
<div class="line"><a name="l00139"></a><span class="lineno"> 139</span>&#160;<span class="stringliteral"></span></div>
<div class="line"><a name="l00140"></a><span class="lineno"> 140</span>&#160;<span class="stringliteral">Examples code can be found in the [examples directory](examples/Xbox).</span></div>
<div class="line"><a name="l00141"></a><span class="lineno"> 141</span>&#160;<span class="stringliteral"></span></div>
<div class="line"><a name="l00142"></a><span class="lineno"> 142</span>&#160;<span class="stringliteral">Also see the following blog posts:</span></div>
<div class="line"><a name="l00143"></a><span class="lineno"> 143</span>&#160;<span class="stringliteral"></span></div>
<div class="line"><a name="l00144"></a><span class="lineno"> 144</span>&#160;<span class="stringliteral">* &lt;http://www.circuitsathome.com/mcu/xbox360-controller-support-added-to-usb-host-shield-2-0-library&gt;</span></div>
<div class="line"><a name="l00145"></a><span class="lineno"> 145</span>&#160;<span class="stringliteral">* &lt;http://blog.tkjelectronics.dk/2012/07/xbox-360-controller-support-added-to-the-usb-host-library/&gt;</span></div>
<div class="line"><a name="l00146"></a><span class="lineno"> 146</span>&#160;<span class="stringliteral">* &lt;http://blog.tkjelectronics.dk/2012/12/xbox-360-receiver-added-to-the-usb-host-library/&gt;</span></div>
<div class="line"><a name="l00147"></a><span class="lineno"> 147</span>&#160;<span class="stringliteral"></span></div>
<div class="line"><a name="l00148"></a><span class="lineno"> 148</span>&#160;<span class="stringliteral">All the information regarding the Xbox 360 controller protocol are form these sites:</span></div>
<div class="line"><a name="l00149"></a><span class="lineno"> 149</span>&#160;<span class="stringliteral"></span></div>
<div class="line"><a name="l00150"></a><span class="lineno"> 150</span>&#160;<span class="stringliteral">* &lt;http://tattiebogle.net/index.php/ProjectRoot/Xbox360Controller/UsbInfo&gt;</span></div>
<div class="line"><a name="l00151"></a><span class="lineno"> 151</span>&#160;<span class="stringliteral">* &lt;http://tattiebogle.net/index.php/ProjectRoot/Xbox360Controller/WirelessUsbInfo&gt;</span></div>
<div class="line"><a name="l00152"></a><span class="lineno"> 152</span>&#160;<span class="stringliteral">* &lt;https://github.com/Grumbel/xboxdrv/blob/master/PROTOCOL&gt;</span></div>
<div class="line"><a name="l00153"></a><span class="lineno"> 153</span>&#160;<span class="stringliteral"></span></div>
<div class="line"><a name="l00154"></a><span class="lineno"> 154</span>&#160;<span class="stringliteral">### [Wii library](Wii.cpp)</span></div>
<div class="line"><a name="l00155"></a><span class="lineno"> 155</span>&#160;<span class="stringliteral"></span></div>
<div class="line"><a name="l00156"></a><span class="lineno"> 156</span>&#160;<span class="stringliteral">The [Wii](Wii.cpp) library support the Wiimote, but also the Nunchuch and Motion Plus extensions via Bluetooth. The Wii U Pro Controller is also supported via Bluetooth.</span></div>
<div class="line"><a name="l00157"></a><span class="lineno"> 157</span>&#160;<span class="stringliteral"></span></div>
<div class="line"><a name="l00158"></a><span class="lineno"> 158</span>&#160;<span class="stringliteral">First you have to pair with the controller, this is done automatically by the library if you create the instance like so:</span></div>
<div class="line"><a name="l00159"></a><span class="lineno"> 159</span>&#160;<span class="stringliteral"></span></div>
<div class="line"><a name="l00160"></a><span class="lineno"> 160</span>&#160;<span class="stringliteral">```</span></div>
<div class="line"><a name="l00161"></a><span class="lineno"> 161</span>&#160;<span class="stringliteral">WII Wii(&amp;Btd,PAIR);</span></div>
<div class="line"><a name="l00162"></a><span class="lineno"> 162</span>&#160;<span class="stringliteral">```</span></div>
<div class="line"><a name="l00163"></a><span class="lineno"> 163</span>&#160;<span class="stringliteral"></span></div>
<div class="line"><a name="l00164"></a><span class="lineno"> 164</span>&#160;<span class="stringliteral">And then press 1 &amp; 2 at once on the Wiimote or press sync if you are using a Wii U Pro Controller.</span></div>
<div class="line"><a name="l00165"></a><span class="lineno"> 165</span>&#160;<span class="stringliteral"></span></div>
<div class="line"><a name="l00166"></a><span class="lineno"> 166</span>&#160;<span class="stringliteral">After that you can simply create the instance like so:</span></div>
<div class="line"><a name="l00167"></a><span class="lineno"> 167</span>&#160;<span class="stringliteral"></span></div>
<div class="line"><a name="l00168"></a><span class="lineno"> 168</span>&#160;<span class="stringliteral">```</span></div>
<div class="line"><a name="l00169"></a><span class="lineno"> 169</span>&#160;<span class="stringliteral">WII Wii(&amp;Btd);</span></div>
<div class="line"><a name="l00170"></a><span class="lineno"> 170</span>&#160;<span class="stringliteral">```</span></div>
<div class="line"><a name="l00171"></a><span class="lineno"> 171</span>&#160;<span class="stringliteral"></span></div>
<div class="line"><a name="l00172"></a><span class="lineno"> 172</span>&#160;<span class="stringliteral">Then just press any button any button on the Wiimote and it will connect to the dongle.</span></div>
<div class="line"><a name="l00173"></a><span class="lineno"> 173</span>&#160;<span class="stringliteral"></span></div>
<div class="line"><a name="l00174"></a><span class="lineno"> 174</span>&#160;<span class="stringliteral">Take a look at the example for more information: &lt;https://github.com/felis/USB_Host_Shield_2.0/blob/master/examples/Bluetooth/Wii/Wii.ino&gt;.</span></div>
<div class="line"><a name="l00175"></a><span class="lineno"> 175</span>&#160;<span class="stringliteral"></span></div>
<div class="line"><a name="l00176"></a><span class="lineno"> 176</span>&#160;<span class="stringliteral">Also take a look at the blog post:</span></div>
<div class="line"><a name="l00177"></a><span class="lineno"> 177</span>&#160;<span class="stringliteral"></span></div>
<div class="line"><a name="l00178"></a><span class="lineno"> 178</span>&#160;<span class="stringliteral">* &lt;http://blog.tkjelectronics.dk/2012/08/wiimote-added-to-usb-host-library/&gt;</span></div>
<div class="line"><a name="l00179"></a><span class="lineno"> 179</span>&#160;<span class="stringliteral"></span></div>
<div class="line"><a name="l00180"></a><span class="lineno"> 180</span>&#160;<span class="stringliteral">All the information about the Wii controllers are from these sites:</span></div>
<div class="line"><a name="l00181"></a><span class="lineno"> 181</span>&#160;<span class="stringliteral"></span></div>
<div class="line"><a name="l00182"></a><span class="lineno"> 182</span>&#160;<span class="stringliteral">* &lt;http://wiibrew.org/wiki/Wiimote&gt;</span></div>
<div class="line"><a name="l00183"></a><span class="lineno"> 183</span>&#160;<span class="stringliteral">* &lt;http://wiibrew.org/wiki/Wiimote/Extension_Controllers&gt;</span></div>
<div class="line"><a name="l00184"></a><span class="lineno"> 184</span>&#160;<span class="stringliteral">* &lt;http://wiibrew.org/wiki/Wiimote/Extension_Controllers/Nunchuck&gt;</span></div>
<div class="line"><a name="l00185"></a><span class="lineno"> 185</span>&#160;<span class="stringliteral">* &lt;http://wiibrew.org/wiki/Wiimote/Extension_Controllers/Wii_Motion_Plus&gt;</span></div>
<div class="line"><a name="l00186"></a><span class="lineno"> 186</span>&#160;<span class="stringliteral">* The old library created by _Tomoyuki Tanaka_: &lt;https://github.com/moyuchin/WiiRemote_on_Arduino&gt; also helped a lot.</span></div>
<div class="line"><a name="l00187"></a><span class="lineno"> 187</span>&#160;<span class="stringliteral"></span></div>
<div class="line"><a name="l00188"></a><span class="lineno"> 188</span>&#160;<span class="stringliteral"># FAQ</span></div>
<div class="line"><a name="l00189"></a><span class="lineno"> 189</span>&#160;<span class="stringliteral"></span></div>
<div class="line"><a name="l00190"></a><span class="lineno"> 190</span>&#160;<span class="stringliteral">&gt; When I plug my device into the USB connector nothing happens?</span></div>
<div class="line"><a name="l00191"></a><span class="lineno"> 191</span>&#160;<span class="stringliteral"></span></div>
<div class="line"><a name="l00192"></a><span class="lineno"> 192</span>&#160;<span class="stringliteral">Try to connect a external power supply to the Arduino - this solves the problem in most cases.</span></div>
</div><!-- fragment --></div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>

View file

@ -97,7 +97,7 @@ Include dependency graph for SPP.cpp:</div>
<div class="dyncontent">
<div class="center"><img src="_s_p_p_8cpp__incl.png" border="0" usemap="#_s_p_p_8cpp" alt=""/></div>
<map name="_s_p_p_8cpp" id="_s_p_p_8cpp">
<area shape="rect" id="node2" href="_s_p_p_8h.html" title="SPP.h" alt="" coords="560,75,605,96"/><area shape="rect" id="node3" href="_b_t_d_8h.html" title="BTD.h" alt="" coords="560,144,605,165"/><area shape="rect" id="node4" href="_usb_8h.html" title="Usb.h" alt="" coords="287,283,329,304"/><area shape="rect" id="node20" href="confdescparser_8h.html" title="confdescparser.h" alt="" coords="649,213,732,235"/><area shape="rect" id="node7" href="avrpins_8h.html" title="avrpins.h" alt="" coords="30,421,84,443"/><area shape="rect" id="node9" href="max3421e_8h.html" title="max3421e.h" alt="" coords="261,421,328,443"/><area shape="rect" id="node10" href="usbhost_8h.html" title="usbhost.h" alt="" coords="169,352,225,373"/><area shape="rect" id="node11" href="usb__ch9_8h.html" title="usb_ch9.h" alt="" coords="109,421,168,443"/><area shape="rect" id="node13" href="address_8h.html" title="address.h" alt="" coords="377,352,433,373"/><area shape="rect" id="node16" href="message_8h.html" title="message.h" alt="" coords="696,352,757,373"/><area shape="rect" id="node18" href="printhex_8h.html" title="printhex.h" alt="" coords="686,491,743,512"/><area shape="rect" id="node19" href="hexdump_8h.html" title="hexdump.h" alt="" coords="731,421,792,443"/><area shape="rect" id="node21" href="parsetools_8h.html" title="parsetools.h" alt="" coords="729,283,793,304"/></map>
<area shape="rect" id="node2" href="_s_p_p_8h.html" title="SPP.h" alt="" coords="600,75,646,96"/><area shape="rect" id="node3" href="_b_t_d_8h.html" title="BTD.h" alt="" coords="600,144,646,165"/><area shape="rect" id="node4" href="_usb_8h.html" title="Usb.h" alt="" coords="330,283,372,304"/><area shape="rect" id="node20" href="confdescparser_8h.html" title="confdescparser.h" alt="" coords="688,213,771,235"/><area shape="rect" id="node7" href="avrpins_8h.html" title="avrpins.h" alt="" coords="34,421,88,443"/><area shape="rect" id="node9" href="max3421e_8h.html" title="max3421e.h" alt="" coords="284,421,351,443"/><area shape="rect" id="node10" href="usbhost_8h.html" title="usbhost.h" alt="" coords="152,352,208,373"/><area shape="rect" id="node12" href="usb__ch9_8h.html" title="usb_ch9.h" alt="" coords="500,421,559,443"/><area shape="rect" id="node14" href="address_8h.html" title="address.h" alt="" coords="356,352,412,373"/><area shape="rect" id="node16" href="message_8h.html" title="message.h" alt="" coords="735,352,796,373"/><area shape="rect" id="node18" href="printhex_8h.html" title="printhex.h" alt="" coords="737,491,794,512"/><area shape="rect" id="node19" href="hexdump_8h.html" title="hexdump.h" alt="" coords="735,421,796,443"/><area shape="rect" id="node21" href="parsetools_8h.html" title="parsetools.h" alt="" coords="768,283,832,304"/></map>
</div>
</div>
<p><a href="_s_p_p_8cpp_source.html">Go to the source code of this file.</a></p>

View file

@ -1,15 +1,15 @@
<map id="SPP.cpp" name="SPP.cpp">
<area shape="rect" id="node2" href="$_s_p_p_8h.html" title="SPP.h" alt="" coords="560,75,605,96"/>
<area shape="rect" id="node3" href="$_b_t_d_8h.html" title="BTD.h" alt="" coords="560,144,605,165"/>
<area shape="rect" id="node4" href="$_usb_8h.html" title="Usb.h" alt="" coords="287,283,329,304"/>
<area shape="rect" id="node20" href="$confdescparser_8h.html" title="confdescparser.h" alt="" coords="649,213,732,235"/>
<area shape="rect" id="node7" href="$avrpins_8h.html" title="avrpins.h" alt="" coords="30,421,84,443"/>
<area shape="rect" id="node9" href="$max3421e_8h.html" title="max3421e.h" alt="" coords="261,421,328,443"/>
<area shape="rect" id="node10" href="$usbhost_8h.html" title="usbhost.h" alt="" coords="169,352,225,373"/>
<area shape="rect" id="node11" href="$usb__ch9_8h.html" title="usb_ch9.h" alt="" coords="109,421,168,443"/>
<area shape="rect" id="node13" href="$address_8h.html" title="address.h" alt="" coords="377,352,433,373"/>
<area shape="rect" id="node16" href="$message_8h.html" title="message.h" alt="" coords="696,352,757,373"/>
<area shape="rect" id="node18" href="$printhex_8h.html" title="printhex.h" alt="" coords="686,491,743,512"/>
<area shape="rect" id="node19" href="$hexdump_8h.html" title="hexdump.h" alt="" coords="731,421,792,443"/>
<area shape="rect" id="node21" href="$parsetools_8h.html" title="parsetools.h" alt="" coords="729,283,793,304"/>
<area shape="rect" id="node2" href="$_s_p_p_8h.html" title="SPP.h" alt="" coords="600,75,646,96"/>
<area shape="rect" id="node3" href="$_b_t_d_8h.html" title="BTD.h" alt="" coords="600,144,646,165"/>
<area shape="rect" id="node4" href="$_usb_8h.html" title="Usb.h" alt="" coords="330,283,372,304"/>
<area shape="rect" id="node20" href="$confdescparser_8h.html" title="confdescparser.h" alt="" coords="688,213,771,235"/>
<area shape="rect" id="node7" href="$avrpins_8h.html" title="avrpins.h" alt="" coords="34,421,88,443"/>
<area shape="rect" id="node9" href="$max3421e_8h.html" title="max3421e.h" alt="" coords="284,421,351,443"/>
<area shape="rect" id="node10" href="$usbhost_8h.html" title="usbhost.h" alt="" coords="152,352,208,373"/>
<area shape="rect" id="node12" href="$usb__ch9_8h.html" title="usb_ch9.h" alt="" coords="500,421,559,443"/>
<area shape="rect" id="node14" href="$address_8h.html" title="address.h" alt="" coords="356,352,412,373"/>
<area shape="rect" id="node16" href="$message_8h.html" title="message.h" alt="" coords="735,352,796,373"/>
<area shape="rect" id="node18" href="$printhex_8h.html" title="printhex.h" alt="" coords="737,491,794,512"/>
<area shape="rect" id="node19" href="$hexdump_8h.html" title="hexdump.h" alt="" coords="735,421,796,443"/>
<area shape="rect" id="node21" href="$parsetools_8h.html" title="parsetools.h" alt="" coords="768,283,832,304"/>
</map>

View file

@ -1 +1 @@
dee9d985871f3cf1594d8314992ecce9
8d742c290ffd813c9276b4445855a4c7

Binary file not shown.

Before

Width:  |  Height:  |  Size: 79 KiB

After

Width:  |  Height:  |  Size: 84 KiB

View file

@ -191,30 +191,30 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
<div class="line"><a name="l00100"></a><span class="lineno"> 100</span>&#160; <span class="keywordflow">if</span> ((l2capinbuf[6] | (l2capinbuf[7] &lt;&lt; 8)) == 0x0001) { <span class="comment">//l2cap_control - Channel ID for ACL-U</span></div>
<div class="line"><a name="l00101"></a><span class="lineno"> 101</span>&#160; <span class="keywordflow">if</span> (l2capinbuf[8] == <a class="code" href="_b_t_d_8h.html#a6ffcd72787c86f248192eb06a3fe18cb">L2CAP_CMD_COMMAND_REJECT</a>) {</div>
<div class="line"><a name="l00102"></a><span class="lineno"> 102</span>&#160;<span class="preprocessor">#ifdef DEBUG_USB_HOST</span></div>
<div class="line"><a name="l00103"></a><span class="lineno"> 103</span>&#160;<span class="preprocessor"></span> <a class="code" href="message_8h.html#a747819b0aa34f5c3ba0332c2db28c846">Notify</a>(PSTR(<span class="stringliteral">&quot;\r\nL2CAP Command Rejected - Reason: &quot;</span>), 0x80);</div>
<div class="line"><a name="l00103"></a><span class="lineno"> 103</span>&#160;<span class="preprocessor"></span> <a class="code" href="message_8h.html#a27117e124c5d66d5512fe8d494fe6338">Notify</a>(PSTR(<span class="stringliteral">&quot;\r\nL2CAP Command Rejected - Reason: &quot;</span>), 0x80);</div>
<div class="line"><a name="l00104"></a><span class="lineno"> 104</span>&#160; D_PrintHex&lt;uint8_t &gt; (l2capinbuf[13], 0x80);</div>
<div class="line"><a name="l00105"></a><span class="lineno"> 105</span>&#160; <a class="code" href="message_8h.html#a747819b0aa34f5c3ba0332c2db28c846">Notify</a>(PSTR(<span class="stringliteral">&quot; &quot;</span>), 0x80);</div>
<div class="line"><a name="l00105"></a><span class="lineno"> 105</span>&#160; <a class="code" href="message_8h.html#a27117e124c5d66d5512fe8d494fe6338">Notify</a>(PSTR(<span class="stringliteral">&quot; &quot;</span>), 0x80);</div>
<div class="line"><a name="l00106"></a><span class="lineno"> 106</span>&#160; D_PrintHex&lt;uint8_t &gt; (l2capinbuf[12], 0x80);</div>
<div class="line"><a name="l00107"></a><span class="lineno"> 107</span>&#160; <a class="code" href="message_8h.html#a747819b0aa34f5c3ba0332c2db28c846">Notify</a>(PSTR(<span class="stringliteral">&quot; Data: &quot;</span>), 0x80);</div>
<div class="line"><a name="l00107"></a><span class="lineno"> 107</span>&#160; <a class="code" href="message_8h.html#a27117e124c5d66d5512fe8d494fe6338">Notify</a>(PSTR(<span class="stringliteral">&quot; Data: &quot;</span>), 0x80);</div>
<div class="line"><a name="l00108"></a><span class="lineno"> 108</span>&#160; D_PrintHex&lt;uint8_t &gt; (l2capinbuf[17], 0x80);</div>
<div class="line"><a name="l00109"></a><span class="lineno"> 109</span>&#160; <a class="code" href="message_8h.html#a747819b0aa34f5c3ba0332c2db28c846">Notify</a>(PSTR(<span class="stringliteral">&quot; &quot;</span>), 0x80);</div>
<div class="line"><a name="l00109"></a><span class="lineno"> 109</span>&#160; <a class="code" href="message_8h.html#a27117e124c5d66d5512fe8d494fe6338">Notify</a>(PSTR(<span class="stringliteral">&quot; &quot;</span>), 0x80);</div>
<div class="line"><a name="l00110"></a><span class="lineno"> 110</span>&#160; D_PrintHex&lt;uint8_t &gt; (l2capinbuf[16], 0x80);</div>
<div class="line"><a name="l00111"></a><span class="lineno"> 111</span>&#160; <a class="code" href="message_8h.html#a747819b0aa34f5c3ba0332c2db28c846">Notify</a>(PSTR(<span class="stringliteral">&quot; &quot;</span>), 0x80);</div>
<div class="line"><a name="l00111"></a><span class="lineno"> 111</span>&#160; <a class="code" href="message_8h.html#a27117e124c5d66d5512fe8d494fe6338">Notify</a>(PSTR(<span class="stringliteral">&quot; &quot;</span>), 0x80);</div>
<div class="line"><a name="l00112"></a><span class="lineno"> 112</span>&#160; D_PrintHex&lt;uint8_t &gt; (l2capinbuf[15], 0x80);</div>
<div class="line"><a name="l00113"></a><span class="lineno"> 113</span>&#160; <a class="code" href="message_8h.html#a747819b0aa34f5c3ba0332c2db28c846">Notify</a>(PSTR(<span class="stringliteral">&quot; &quot;</span>), 0x80);</div>
<div class="line"><a name="l00113"></a><span class="lineno"> 113</span>&#160; <a class="code" href="message_8h.html#a27117e124c5d66d5512fe8d494fe6338">Notify</a>(PSTR(<span class="stringliteral">&quot; &quot;</span>), 0x80);</div>
<div class="line"><a name="l00114"></a><span class="lineno"> 114</span>&#160; D_PrintHex&lt;uint8_t &gt; (l2capinbuf[14], 0x80);</div>
<div class="line"><a name="l00115"></a><span class="lineno"> 115</span>&#160;<span class="preprocessor">#endif</span></div>
<div class="line"><a name="l00116"></a><span class="lineno"> 116</span>&#160;<span class="preprocessor"></span> } <span class="keywordflow">else</span> <span class="keywordflow">if</span> (l2capinbuf[8] == <a class="code" href="_b_t_d_8h.html#ac4bae0c65fd00ed849cb226302d19c85">L2CAP_CMD_CONNECTION_REQUEST</a>) {</div>
<div class="line"><a name="l00117"></a><span class="lineno"> 117</span>&#160;<span class="preprocessor">#ifdef EXTRADEBUG</span></div>
<div class="line"><a name="l00118"></a><span class="lineno"> 118</span>&#160;<span class="preprocessor"></span> <a class="code" href="message_8h.html#a747819b0aa34f5c3ba0332c2db28c846">Notify</a>(PSTR(<span class="stringliteral">&quot;\r\nL2CAP Connection Request - PSM: &quot;</span>), 0x80);</div>
<div class="line"><a name="l00118"></a><span class="lineno"> 118</span>&#160;<span class="preprocessor"></span> <a class="code" href="message_8h.html#a27117e124c5d66d5512fe8d494fe6338">Notify</a>(PSTR(<span class="stringliteral">&quot;\r\nL2CAP Connection Request - PSM: &quot;</span>), 0x80);</div>
<div class="line"><a name="l00119"></a><span class="lineno"> 119</span>&#160; D_PrintHex&lt;uint8_t &gt; (l2capinbuf[13], 0x80);</div>
<div class="line"><a name="l00120"></a><span class="lineno"> 120</span>&#160; <a class="code" href="message_8h.html#a747819b0aa34f5c3ba0332c2db28c846">Notify</a>(PSTR(<span class="stringliteral">&quot; &quot;</span>), 0x80);</div>
<div class="line"><a name="l00120"></a><span class="lineno"> 120</span>&#160; <a class="code" href="message_8h.html#a27117e124c5d66d5512fe8d494fe6338">Notify</a>(PSTR(<span class="stringliteral">&quot; &quot;</span>), 0x80);</div>
<div class="line"><a name="l00121"></a><span class="lineno"> 121</span>&#160; D_PrintHex&lt;uint8_t &gt; (l2capinbuf[12], 0x80);</div>
<div class="line"><a name="l00122"></a><span class="lineno"> 122</span>&#160; <a class="code" href="message_8h.html#a747819b0aa34f5c3ba0332c2db28c846">Notify</a>(PSTR(<span class="stringliteral">&quot; SCID: &quot;</span>), 0x80);</div>
<div class="line"><a name="l00122"></a><span class="lineno"> 122</span>&#160; <a class="code" href="message_8h.html#a27117e124c5d66d5512fe8d494fe6338">Notify</a>(PSTR(<span class="stringliteral">&quot; SCID: &quot;</span>), 0x80);</div>
<div class="line"><a name="l00123"></a><span class="lineno"> 123</span>&#160; D_PrintHex&lt;uint8_t &gt; (l2capinbuf[15], 0x80);</div>
<div class="line"><a name="l00124"></a><span class="lineno"> 124</span>&#160; <a class="code" href="message_8h.html#a747819b0aa34f5c3ba0332c2db28c846">Notify</a>(PSTR(<span class="stringliteral">&quot; &quot;</span>), 0x80);</div>
<div class="line"><a name="l00124"></a><span class="lineno"> 124</span>&#160; <a class="code" href="message_8h.html#a27117e124c5d66d5512fe8d494fe6338">Notify</a>(PSTR(<span class="stringliteral">&quot; &quot;</span>), 0x80);</div>
<div class="line"><a name="l00125"></a><span class="lineno"> 125</span>&#160; D_PrintHex&lt;uint8_t &gt; (l2capinbuf[14], 0x80);</div>
<div class="line"><a name="l00126"></a><span class="lineno"> 126</span>&#160; <a class="code" href="message_8h.html#a747819b0aa34f5c3ba0332c2db28c846">Notify</a>(PSTR(<span class="stringliteral">&quot; Identifier: &quot;</span>), 0x80);</div>
<div class="line"><a name="l00126"></a><span class="lineno"> 126</span>&#160; <a class="code" href="message_8h.html#a27117e124c5d66d5512fe8d494fe6338">Notify</a>(PSTR(<span class="stringliteral">&quot; Identifier: &quot;</span>), 0x80);</div>
<div class="line"><a name="l00127"></a><span class="lineno"> 127</span>&#160; D_PrintHex&lt;uint8_t &gt; (l2capinbuf[9], 0x80);</div>
<div class="line"><a name="l00128"></a><span class="lineno"> 128</span>&#160;<span class="preprocessor">#endif</span></div>
<div class="line"><a name="l00129"></a><span class="lineno"> 129</span>&#160;<span class="preprocessor"></span> <span class="keywordflow">if</span> ((l2capinbuf[12] | (l2capinbuf[13] &lt;&lt; 8)) == <a class="code" href="_b_t_d_8h.html#a25ce859d7ee2730e1d22d11c051ed60d">SDP_PSM</a>) { <span class="comment">// It doesn&#39;t matter if it receives another reqeust, since it waits for the channel to disconnect in the L2CAP_SDP_DONE state, and the l2cap_event_flag will be cleared if so</span></div>
@ -270,14 +270,14 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
<div class="line"><a name="l00179"></a><span class="lineno"> 179</span>&#160; }</div>
<div class="line"><a name="l00180"></a><span class="lineno"> 180</span>&#160; } <span class="keywordflow">else</span> <span class="keywordflow">if</span> (l2capinbuf[8] == <a class="code" href="_b_t_d_8h.html#a200eb6c7c905ec74a9daf0f262af0448">L2CAP_CMD_INFORMATION_REQUEST</a>) {</div>
<div class="line"><a name="l00181"></a><span class="lineno"> 181</span>&#160;<span class="preprocessor">#ifdef DEBUG_USB_HOST</span></div>
<div class="line"><a name="l00182"></a><span class="lineno"> 182</span>&#160;<span class="preprocessor"></span> <a class="code" href="message_8h.html#a747819b0aa34f5c3ba0332c2db28c846">Notify</a>(PSTR(<span class="stringliteral">&quot;\r\nInformation request&quot;</span>), 0x80);</div>
<div class="line"><a name="l00182"></a><span class="lineno"> 182</span>&#160;<span class="preprocessor"></span> <a class="code" href="message_8h.html#a27117e124c5d66d5512fe8d494fe6338">Notify</a>(PSTR(<span class="stringliteral">&quot;\r\nInformation request&quot;</span>), 0x80);</div>
<div class="line"><a name="l00183"></a><span class="lineno"> 183</span>&#160;<span class="preprocessor">#endif</span></div>
<div class="line"><a name="l00184"></a><span class="lineno"> 184</span>&#160;<span class="preprocessor"></span> identifier = l2capinbuf[9];</div>
<div class="line"><a name="l00185"></a><span class="lineno"> 185</span>&#160; pBtd-&gt;<a class="code" href="class_b_t_d.html#a91f61915c503fe7b861c88f5b3e6733c">l2cap_information_response</a>(hci_handle, identifier, l2capinbuf[12], l2capinbuf[13]);</div>
<div class="line"><a name="l00186"></a><span class="lineno"> 186</span>&#160; }</div>
<div class="line"><a name="l00187"></a><span class="lineno"> 187</span>&#160;<span class="preprocessor">#ifdef EXTRADEBUG</span></div>
<div class="line"><a name="l00188"></a><span class="lineno"> 188</span>&#160;<span class="preprocessor"></span> <span class="keywordflow">else</span> {</div>
<div class="line"><a name="l00189"></a><span class="lineno"> 189</span>&#160; <a class="code" href="message_8h.html#a747819b0aa34f5c3ba0332c2db28c846">Notify</a>(PSTR(<span class="stringliteral">&quot;\r\nL2CAP Unknown Signaling Command: &quot;</span>), 0x80);</div>
<div class="line"><a name="l00189"></a><span class="lineno"> 189</span>&#160; <a class="code" href="message_8h.html#a27117e124c5d66d5512fe8d494fe6338">Notify</a>(PSTR(<span class="stringliteral">&quot;\r\nL2CAP Unknown Signaling Command: &quot;</span>), 0x80);</div>
<div class="line"><a name="l00190"></a><span class="lineno"> 190</span>&#160; D_PrintHex&lt;uint8_t &gt; (l2capinbuf[8], 0x80);</div>
<div class="line"><a name="l00191"></a><span class="lineno"> 191</span>&#160; }</div>
<div class="line"><a name="l00192"></a><span class="lineno"> 192</span>&#160;<span class="preprocessor">#endif</span></div>
@ -302,7 +302,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
<div class="line"><a name="l00211"></a><span class="lineno"> 211</span>&#160; } <span class="keywordflow">else</span></div>
<div class="line"><a name="l00212"></a><span class="lineno"> 212</span>&#160; serviceNotSupported(l2capinbuf[9], l2capinbuf[10]); <span class="comment">// The service is not supported</span></div>
<div class="line"><a name="l00213"></a><span class="lineno"> 213</span>&#160;<span class="preprocessor">#ifdef EXTRADEBUG</span></div>
<div class="line"><a name="l00214"></a><span class="lineno"> 214</span>&#160;<span class="preprocessor"></span> <a class="code" href="message_8h.html#a747819b0aa34f5c3ba0332c2db28c846">Notify</a>(PSTR(<span class="stringliteral">&quot;\r\nUUID: &quot;</span>), 0x80);</div>
<div class="line"><a name="l00214"></a><span class="lineno"> 214</span>&#160;<span class="preprocessor"></span> <a class="code" href="message_8h.html#a27117e124c5d66d5512fe8d494fe6338">Notify</a>(PSTR(<span class="stringliteral">&quot;\r\nUUID: &quot;</span>), 0x80);</div>
<div class="line"><a name="l00215"></a><span class="lineno"> 215</span>&#160; uint16_t uuid;</div>
<div class="line"><a name="l00216"></a><span class="lineno"> 216</span>&#160; <span class="keywordflow">if</span>((l2capinbuf[16] &lt;&lt; 8 | l2capinbuf[17]) == 0x0000) <span class="comment">// Check if it&#39;s sending the UUID as a 128-bit UUID</span></div>
<div class="line"><a name="l00217"></a><span class="lineno"> 217</span>&#160; uuid = (l2capinbuf[18] &lt;&lt; 8 | l2capinbuf[19]);</div>
@ -310,19 +310,19 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
<div class="line"><a name="l00219"></a><span class="lineno"> 219</span>&#160; uuid = (l2capinbuf[16] &lt;&lt; 8 | l2capinbuf[17]);</div>
<div class="line"><a name="l00220"></a><span class="lineno"> 220</span>&#160; D_PrintHex&lt;uint16_t&gt; (uuid, 0x80);</div>
<div class="line"><a name="l00221"></a><span class="lineno"> 221</span>&#160;</div>
<div class="line"><a name="l00222"></a><span class="lineno"> 222</span>&#160; <a class="code" href="message_8h.html#a747819b0aa34f5c3ba0332c2db28c846">Notify</a>(PSTR(<span class="stringliteral">&quot;\r\nLength: &quot;</span>), 0x80);</div>
<div class="line"><a name="l00222"></a><span class="lineno"> 222</span>&#160; <a class="code" href="message_8h.html#a27117e124c5d66d5512fe8d494fe6338">Notify</a>(PSTR(<span class="stringliteral">&quot;\r\nLength: &quot;</span>), 0x80);</div>
<div class="line"><a name="l00223"></a><span class="lineno"> 223</span>&#160; uint16_t length = l2capinbuf[11] &lt;&lt; 8 | l2capinbuf[12];</div>
<div class="line"><a name="l00224"></a><span class="lineno"> 224</span>&#160; D_PrintHex&lt;uint16_t&gt; (length, 0x80);</div>
<div class="line"><a name="l00225"></a><span class="lineno"> 225</span>&#160; <a class="code" href="message_8h.html#a747819b0aa34f5c3ba0332c2db28c846">Notify</a>(PSTR(<span class="stringliteral">&quot;\r\nData: &quot;</span>), 0x80);</div>
<div class="line"><a name="l00225"></a><span class="lineno"> 225</span>&#160; <a class="code" href="message_8h.html#a27117e124c5d66d5512fe8d494fe6338">Notify</a>(PSTR(<span class="stringliteral">&quot;\r\nData: &quot;</span>), 0x80);</div>
<div class="line"><a name="l00226"></a><span class="lineno"> 226</span>&#160; <span class="keywordflow">for</span> (uint8_t i = 0; i &lt; length; i++) {</div>
<div class="line"><a name="l00227"></a><span class="lineno"> 227</span>&#160; D_PrintHex&lt;uint8_t&gt; (l2capinbuf[13+i], 0x80);</div>
<div class="line"><a name="l00228"></a><span class="lineno"> 228</span>&#160; <a class="code" href="message_8h.html#a747819b0aa34f5c3ba0332c2db28c846">Notify</a>(PSTR(<span class="stringliteral">&quot; &quot;</span>), 0x80);</div>
<div class="line"><a name="l00228"></a><span class="lineno"> 228</span>&#160; <a class="code" href="message_8h.html#a27117e124c5d66d5512fe8d494fe6338">Notify</a>(PSTR(<span class="stringliteral">&quot; &quot;</span>), 0x80);</div>
<div class="line"><a name="l00229"></a><span class="lineno"> 229</span>&#160; }</div>
<div class="line"><a name="l00230"></a><span class="lineno"> 230</span>&#160;<span class="preprocessor">#endif</span></div>
<div class="line"><a name="l00231"></a><span class="lineno"> 231</span>&#160;<span class="preprocessor"></span> }</div>
<div class="line"><a name="l00232"></a><span class="lineno"> 232</span>&#160;<span class="preprocessor">#ifdef EXTRADEBUG</span></div>
<div class="line"><a name="l00233"></a><span class="lineno"> 233</span>&#160;<span class="preprocessor"></span> <span class="keywordflow">else</span> {</div>
<div class="line"><a name="l00234"></a><span class="lineno"> 234</span>&#160; <a class="code" href="message_8h.html#a747819b0aa34f5c3ba0332c2db28c846">Notify</a>(PSTR(<span class="stringliteral">&quot;\r\nUnknown PDU: &quot;</span>));</div>
<div class="line"><a name="l00234"></a><span class="lineno"> 234</span>&#160; <a class="code" href="message_8h.html#a27117e124c5d66d5512fe8d494fe6338">Notify</a>(PSTR(<span class="stringliteral">&quot;\r\nUnknown PDU: &quot;</span>), 0x80);</div>
<div class="line"><a name="l00235"></a><span class="lineno"> 235</span>&#160; D_PrintHex&lt;uint8_t &gt; (l2capinbuf[8], 0x80);</div>
<div class="line"><a name="l00236"></a><span class="lineno"> 236</span>&#160; }</div>
<div class="line"><a name="l00237"></a><span class="lineno"> 237</span>&#160;<span class="preprocessor">#endif</span></div>
@ -337,20 +337,20 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
<div class="line"><a name="l00246"></a><span class="lineno"> 246</span>&#160; rfcommChannelConnection = rfcommChannel;</div>
<div class="line"><a name="l00247"></a><span class="lineno"> 247</span>&#160;</div>
<div class="line"><a name="l00248"></a><span class="lineno"> 248</span>&#160;<span class="preprocessor">#ifdef EXTRADEBUG</span></div>
<div class="line"><a name="l00249"></a><span class="lineno"> 249</span>&#160;<span class="preprocessor"></span> <a class="code" href="message_8h.html#a747819b0aa34f5c3ba0332c2db28c846">Notify</a>(PSTR(<span class="stringliteral">&quot;\r\nRFCOMM Channel: &quot;</span>), 0x80);</div>
<div class="line"><a name="l00249"></a><span class="lineno"> 249</span>&#160;<span class="preprocessor"></span> <a class="code" href="message_8h.html#a27117e124c5d66d5512fe8d494fe6338">Notify</a>(PSTR(<span class="stringliteral">&quot;\r\nRFCOMM Channel: &quot;</span>), 0x80);</div>
<div class="line"><a name="l00250"></a><span class="lineno"> 250</span>&#160; D_PrintHex&lt;uint8_t &gt; (rfcommChannel &gt;&gt; 3, 0x80);</div>
<div class="line"><a name="l00251"></a><span class="lineno"> 251</span>&#160; <a class="code" href="message_8h.html#a747819b0aa34f5c3ba0332c2db28c846">Notify</a>(PSTR(<span class="stringliteral">&quot; Direction: &quot;</span>), 0x80);</div>
<div class="line"><a name="l00251"></a><span class="lineno"> 251</span>&#160; <a class="code" href="message_8h.html#a27117e124c5d66d5512fe8d494fe6338">Notify</a>(PSTR(<span class="stringliteral">&quot; Direction: &quot;</span>), 0x80);</div>
<div class="line"><a name="l00252"></a><span class="lineno"> 252</span>&#160; D_PrintHex&lt;uint8_t &gt; (rfcommDirection &gt;&gt; 2, 0x80);</div>
<div class="line"><a name="l00253"></a><span class="lineno"> 253</span>&#160; <a class="code" href="message_8h.html#a747819b0aa34f5c3ba0332c2db28c846">Notify</a>(PSTR(<span class="stringliteral">&quot; CommandResponse: &quot;</span>), 0x80);</div>
<div class="line"><a name="l00253"></a><span class="lineno"> 253</span>&#160; <a class="code" href="message_8h.html#a27117e124c5d66d5512fe8d494fe6338">Notify</a>(PSTR(<span class="stringliteral">&quot; CommandResponse: &quot;</span>), 0x80);</div>
<div class="line"><a name="l00254"></a><span class="lineno"> 254</span>&#160; D_PrintHex&lt;uint8_t &gt; (rfcommCommandResponse &gt;&gt; 1, 0x80);</div>
<div class="line"><a name="l00255"></a><span class="lineno"> 255</span>&#160; <a class="code" href="message_8h.html#a747819b0aa34f5c3ba0332c2db28c846">Notify</a>(PSTR(<span class="stringliteral">&quot; ChannelType: &quot;</span>), 0x80);</div>
<div class="line"><a name="l00255"></a><span class="lineno"> 255</span>&#160; <a class="code" href="message_8h.html#a27117e124c5d66d5512fe8d494fe6338">Notify</a>(PSTR(<span class="stringliteral">&quot; ChannelType: &quot;</span>), 0x80);</div>
<div class="line"><a name="l00256"></a><span class="lineno"> 256</span>&#160; D_PrintHex&lt;uint8_t &gt; (rfcommChannelType, 0x80);</div>
<div class="line"><a name="l00257"></a><span class="lineno"> 257</span>&#160; <a class="code" href="message_8h.html#a747819b0aa34f5c3ba0332c2db28c846">Notify</a>(PSTR(<span class="stringliteral">&quot; PF_BIT: &quot;</span>), 0x80);</div>
<div class="line"><a name="l00257"></a><span class="lineno"> 257</span>&#160; <a class="code" href="message_8h.html#a27117e124c5d66d5512fe8d494fe6338">Notify</a>(PSTR(<span class="stringliteral">&quot; PF_BIT: &quot;</span>), 0x80);</div>
<div class="line"><a name="l00258"></a><span class="lineno"> 258</span>&#160; D_PrintHex&lt;uint8_t &gt; (rfcommPfBit, 0x80);</div>
<div class="line"><a name="l00259"></a><span class="lineno"> 259</span>&#160;<span class="preprocessor">#endif</span></div>
<div class="line"><a name="l00260"></a><span class="lineno"> 260</span>&#160;<span class="preprocessor"></span> <span class="keywordflow">if</span> (rfcommChannelType == <a class="code" href="_s_p_p_8h.html#a2c8ebc5e78dc22e7ae4e79370fada66f">RFCOMM_DISC</a>) {</div>
<div class="line"><a name="l00261"></a><span class="lineno"> 261</span>&#160;<span class="preprocessor">#ifdef DEBUG_USB_HOST</span></div>
<div class="line"><a name="l00262"></a><span class="lineno"> 262</span>&#160;<span class="preprocessor"></span> <a class="code" href="message_8h.html#a747819b0aa34f5c3ba0332c2db28c846">Notify</a>(PSTR(<span class="stringliteral">&quot;\r\nReceived Disconnect RFCOMM Command on channel: &quot;</span>), 0x80);</div>
<div class="line"><a name="l00262"></a><span class="lineno"> 262</span>&#160;<span class="preprocessor"></span> <a class="code" href="message_8h.html#a27117e124c5d66d5512fe8d494fe6338">Notify</a>(PSTR(<span class="stringliteral">&quot;\r\nReceived Disconnect RFCOMM Command on channel: &quot;</span>), 0x80);</div>
<div class="line"><a name="l00263"></a><span class="lineno"> 263</span>&#160; D_PrintHex&lt;uint8_t &gt; (rfcommChannel &gt;&gt; 3, 0x80);</div>
<div class="line"><a name="l00264"></a><span class="lineno"> 264</span>&#160;<span class="preprocessor">#endif</span></div>
<div class="line"><a name="l00265"></a><span class="lineno"> 265</span>&#160;<span class="preprocessor"></span> <a class="code" href="class_s_p_p.html#ade5d4f0ab50ddcad14f75fce4450a028">connected</a> = <span class="keyword">false</span>;</div>
@ -367,20 +367,20 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
<div class="line"><a name="l00276"></a><span class="lineno"> 276</span>&#160; rfcommAvailable += length;</div>
<div class="line"><a name="l00277"></a><span class="lineno"> 277</span>&#160; }</div>
<div class="line"><a name="l00278"></a><span class="lineno"> 278</span>&#160;<span class="preprocessor">#ifdef EXTRADEBUG</span></div>
<div class="line"><a name="l00279"></a><span class="lineno"> 279</span>&#160;<span class="preprocessor"></span> <a class="code" href="message_8h.html#a747819b0aa34f5c3ba0332c2db28c846">Notify</a>(PSTR(<span class="stringliteral">&quot;\r\nRFCOMM Data Available: &quot;</span>), 0x80);</div>
<div class="line"><a name="l00280"></a><span class="lineno"> 280</span>&#160; <a class="code" href="message_8h.html#a747819b0aa34f5c3ba0332c2db28c846">Notify</a>(rfcommAvailable, 0x80);</div>
<div class="line"><a name="l00279"></a><span class="lineno"> 279</span>&#160;<span class="preprocessor"></span> <a class="code" href="message_8h.html#a27117e124c5d66d5512fe8d494fe6338">Notify</a>(PSTR(<span class="stringliteral">&quot;\r\nRFCOMM Data Available: &quot;</span>), 0x80);</div>
<div class="line"><a name="l00280"></a><span class="lineno"> 280</span>&#160; <a class="code" href="message_8h.html#a27117e124c5d66d5512fe8d494fe6338">Notify</a>(rfcommAvailable, 0x80);</div>
<div class="line"><a name="l00281"></a><span class="lineno"> 281</span>&#160; <span class="keywordflow">if</span> (offset) {</div>
<div class="line"><a name="l00282"></a><span class="lineno"> 282</span>&#160; <a class="code" href="message_8h.html#a747819b0aa34f5c3ba0332c2db28c846">Notify</a>(PSTR(<span class="stringliteral">&quot; - Credit: 0x&quot;</span>), 0x80);</div>
<div class="line"><a name="l00282"></a><span class="lineno"> 282</span>&#160; <a class="code" href="message_8h.html#a27117e124c5d66d5512fe8d494fe6338">Notify</a>(PSTR(<span class="stringliteral">&quot; - Credit: 0x&quot;</span>), 0x80);</div>
<div class="line"><a name="l00283"></a><span class="lineno"> 283</span>&#160; D_PrintHex&lt;uint8_t &gt; (l2capinbuf[11], 0x80);</div>
<div class="line"><a name="l00284"></a><span class="lineno"> 284</span>&#160; }</div>
<div class="line"><a name="l00285"></a><span class="lineno"> 285</span>&#160;<span class="preprocessor">#endif</span></div>
<div class="line"><a name="l00286"></a><span class="lineno"> 286</span>&#160;<span class="preprocessor"></span><span class="preprocessor">#ifdef PRINTREPORT // Uncomment &quot;#define PRINTREPORT&quot; to print the report send to the Arduino via Bluetooth</span></div>
<div class="line"><a name="l00287"></a><span class="lineno"> 287</span>&#160;<span class="preprocessor"></span> <span class="keywordflow">for</span> (uint8_t i = 0; i &lt; length; i++)</div>
<div class="line"><a name="l00288"></a><span class="lineno"> 288</span>&#160; <a class="code" href="message_8h.html#a1cfb80dd289cf19d4d6c762e9891daf3">Notifyc</a>(l2capinbuf[i + 11 + offset], 0x80);</div>
<div class="line"><a name="l00288"></a><span class="lineno"> 288</span>&#160; <a class="code" href="message_8h.html#ab5d8177365493b21dbc092f6557bd508">Notifyc</a>(l2capinbuf[i + 11 + offset], 0x80);</div>
<div class="line"><a name="l00289"></a><span class="lineno"> 289</span>&#160;<span class="preprocessor">#endif</span></div>
<div class="line"><a name="l00290"></a><span class="lineno"> 290</span>&#160;<span class="preprocessor"></span> } <span class="keywordflow">else</span> <span class="keywordflow">if</span> (rfcommChannelType == <a class="code" href="_s_p_p_8h.html#ae9ffac80725386a879ba956251f64373">RFCOMM_UIH</a> &amp;&amp; l2capinbuf[11] == <a class="code" href="_s_p_p_8h.html#ad9b8c11f7f4f8e8d59ac77999b2ec4a3">BT_RFCOMM_RPN_CMD</a>) { <span class="comment">// UIH Remote Port Negotiation Command</span></div>
<div class="line"><a name="l00291"></a><span class="lineno"> 291</span>&#160;<span class="preprocessor">#ifdef DEBUG_USB_HOST</span></div>
<div class="line"><a name="l00292"></a><span class="lineno"> 292</span>&#160;<span class="preprocessor"></span> <a class="code" href="message_8h.html#a747819b0aa34f5c3ba0332c2db28c846">Notify</a>(PSTR(<span class="stringliteral">&quot;\r\nReceived UIH Remote Port Negotiation Command&quot;</span>), 0x80);</div>
<div class="line"><a name="l00292"></a><span class="lineno"> 292</span>&#160;<span class="preprocessor"></span> <a class="code" href="message_8h.html#a27117e124c5d66d5512fe8d494fe6338">Notify</a>(PSTR(<span class="stringliteral">&quot;\r\nReceived UIH Remote Port Negotiation Command&quot;</span>), 0x80);</div>
<div class="line"><a name="l00293"></a><span class="lineno"> 293</span>&#160;<span class="preprocessor">#endif</span></div>
<div class="line"><a name="l00294"></a><span class="lineno"> 294</span>&#160;<span class="preprocessor"></span> rfcommbuf[0] = <a class="code" href="_s_p_p_8h.html#a336bf1805637fdd66033c9040e606a6b">BT_RFCOMM_RPN_RSP</a>; <span class="comment">// Command</span></div>
<div class="line"><a name="l00295"></a><span class="lineno"> 295</span>&#160; rfcommbuf[1] = l2capinbuf[12]; <span class="comment">// Length and shiftet like so: length &lt;&lt; 1 | 1</span></div>
@ -395,7 +395,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
<div class="line"><a name="l00304"></a><span class="lineno"> 304</span>&#160; sendRfcomm(rfcommChannel, rfcommDirection, 0, <a class="code" href="_s_p_p_8h.html#ae9ffac80725386a879ba956251f64373">RFCOMM_UIH</a>, rfcommPfBit, rfcommbuf, 0x0A); <span class="comment">// UIH Remote Port Negotiation Response</span></div>
<div class="line"><a name="l00305"></a><span class="lineno"> 305</span>&#160; } <span class="keywordflow">else</span> <span class="keywordflow">if</span> (rfcommChannelType == <a class="code" href="_s_p_p_8h.html#ae9ffac80725386a879ba956251f64373">RFCOMM_UIH</a> &amp;&amp; l2capinbuf[11] == <a class="code" href="_s_p_p_8h.html#ad14b1def5eec64e94cc64a2dcba354ea">BT_RFCOMM_MSC_CMD</a>) { <span class="comment">// UIH Modem Status Command</span></div>
<div class="line"><a name="l00306"></a><span class="lineno"> 306</span>&#160;<span class="preprocessor">#ifdef DEBUG_USB_HOST</span></div>
<div class="line"><a name="l00307"></a><span class="lineno"> 307</span>&#160;<span class="preprocessor"></span> <a class="code" href="message_8h.html#a747819b0aa34f5c3ba0332c2db28c846">Notify</a>(PSTR(<span class="stringliteral">&quot;\r\nSend UIH Modem Status Response&quot;</span>), 0x80);</div>
<div class="line"><a name="l00307"></a><span class="lineno"> 307</span>&#160;<span class="preprocessor"></span> <a class="code" href="message_8h.html#a27117e124c5d66d5512fe8d494fe6338">Notify</a>(PSTR(<span class="stringliteral">&quot;\r\nSend UIH Modem Status Response&quot;</span>), 0x80);</div>
<div class="line"><a name="l00308"></a><span class="lineno"> 308</span>&#160;<span class="preprocessor">#endif</span></div>
<div class="line"><a name="l00309"></a><span class="lineno"> 309</span>&#160;<span class="preprocessor"></span> rfcommbuf[0] = <a class="code" href="_s_p_p_8h.html#ab68e7621ab822c3bfb9507c78d0d0550">BT_RFCOMM_MSC_RSP</a>; <span class="comment">// UIH Modem Status Response</span></div>
<div class="line"><a name="l00310"></a><span class="lineno"> 310</span>&#160; rfcommbuf[1] = 2 &lt;&lt; 1 | 1; <span class="comment">// Length and shiftet like so: length &lt;&lt; 1 | 1</span></div>
@ -406,12 +406,12 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
<div class="line"><a name="l00315"></a><span class="lineno"> 315</span>&#160; } <span class="keywordflow">else</span> {</div>
<div class="line"><a name="l00316"></a><span class="lineno"> 316</span>&#160; <span class="keywordflow">if</span> (rfcommChannelType == <a class="code" href="_s_p_p_8h.html#a5747e4c0826eb3341fe2476b5229e0d0">RFCOMM_SABM</a>) { <span class="comment">// SABM Command - this is sent twice: once for channel 0 and then for the channel to establish</span></div>
<div class="line"><a name="l00317"></a><span class="lineno"> 317</span>&#160;<span class="preprocessor">#ifdef DEBUG_USB_HOST</span></div>
<div class="line"><a name="l00318"></a><span class="lineno"> 318</span>&#160;<span class="preprocessor"></span> <a class="code" href="message_8h.html#a747819b0aa34f5c3ba0332c2db28c846">Notify</a>(PSTR(<span class="stringliteral">&quot;\r\nReceived SABM Command&quot;</span>), 0x80);</div>
<div class="line"><a name="l00318"></a><span class="lineno"> 318</span>&#160;<span class="preprocessor"></span> <a class="code" href="message_8h.html#a27117e124c5d66d5512fe8d494fe6338">Notify</a>(PSTR(<span class="stringliteral">&quot;\r\nReceived SABM Command&quot;</span>), 0x80);</div>
<div class="line"><a name="l00319"></a><span class="lineno"> 319</span>&#160;<span class="preprocessor">#endif</span></div>
<div class="line"><a name="l00320"></a><span class="lineno"> 320</span>&#160;<span class="preprocessor"></span> sendRfcomm(rfcommChannel, rfcommDirection, rfcommCommandResponse, <a class="code" href="_s_p_p_8h.html#a9f534220af893b5ae8c8927564db77c3">RFCOMM_UA</a>, rfcommPfBit, rfcommbuf, 0x00); <span class="comment">// UA Command</span></div>
<div class="line"><a name="l00321"></a><span class="lineno"> 321</span>&#160; } <span class="keywordflow">else</span> <span class="keywordflow">if</span> (rfcommChannelType == <a class="code" href="_s_p_p_8h.html#ae9ffac80725386a879ba956251f64373">RFCOMM_UIH</a> &amp;&amp; l2capinbuf[11] == <a class="code" href="_s_p_p_8h.html#a11185ec5287f08bf49c2c68d8cd52a16">BT_RFCOMM_PN_CMD</a>) { <span class="comment">// UIH Parameter Negotiation Command</span></div>
<div class="line"><a name="l00322"></a><span class="lineno"> 322</span>&#160;<span class="preprocessor">#ifdef DEBUG_USB_HOST</span></div>
<div class="line"><a name="l00323"></a><span class="lineno"> 323</span>&#160;<span class="preprocessor"></span> <a class="code" href="message_8h.html#a747819b0aa34f5c3ba0332c2db28c846">Notify</a>(PSTR(<span class="stringliteral">&quot;\r\nReceived UIH Parameter Negotiation Command&quot;</span>), 0x80);</div>
<div class="line"><a name="l00323"></a><span class="lineno"> 323</span>&#160;<span class="preprocessor"></span> <a class="code" href="message_8h.html#a27117e124c5d66d5512fe8d494fe6338">Notify</a>(PSTR(<span class="stringliteral">&quot;\r\nReceived UIH Parameter Negotiation Command&quot;</span>), 0x80);</div>
<div class="line"><a name="l00324"></a><span class="lineno"> 324</span>&#160;<span class="preprocessor">#endif</span></div>
<div class="line"><a name="l00325"></a><span class="lineno"> 325</span>&#160;<span class="preprocessor"></span> rfcommbuf[0] = <a class="code" href="_s_p_p_8h.html#a17b4a98661e30b6989cbe35ba5da4822">BT_RFCOMM_PN_RSP</a>; <span class="comment">// UIH Parameter Negotiation Response</span></div>
<div class="line"><a name="l00326"></a><span class="lineno"> 326</span>&#160; rfcommbuf[1] = l2capinbuf[12]; <span class="comment">// Length and shiftet like so: length &lt;&lt; 1 | 1</span></div>
@ -426,7 +426,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
<div class="line"><a name="l00335"></a><span class="lineno"> 335</span>&#160; sendRfcomm(rfcommChannel, rfcommDirection, 0, <a class="code" href="_s_p_p_8h.html#ae9ffac80725386a879ba956251f64373">RFCOMM_UIH</a>, rfcommPfBit, rfcommbuf, 0x0A);</div>
<div class="line"><a name="l00336"></a><span class="lineno"> 336</span>&#160; } <span class="keywordflow">else</span> <span class="keywordflow">if</span> (rfcommChannelType == <a class="code" href="_s_p_p_8h.html#ae9ffac80725386a879ba956251f64373">RFCOMM_UIH</a> &amp;&amp; l2capinbuf[11] == <a class="code" href="_s_p_p_8h.html#ad14b1def5eec64e94cc64a2dcba354ea">BT_RFCOMM_MSC_CMD</a>) { <span class="comment">// UIH Modem Status Command</span></div>
<div class="line"><a name="l00337"></a><span class="lineno"> 337</span>&#160;<span class="preprocessor">#ifdef DEBUG_USB_HOST</span></div>
<div class="line"><a name="l00338"></a><span class="lineno"> 338</span>&#160;<span class="preprocessor"></span> <a class="code" href="message_8h.html#a747819b0aa34f5c3ba0332c2db28c846">Notify</a>(PSTR(<span class="stringliteral">&quot;\r\nSend UIH Modem Status Response&quot;</span>), 0x80);</div>
<div class="line"><a name="l00338"></a><span class="lineno"> 338</span>&#160;<span class="preprocessor"></span> <a class="code" href="message_8h.html#a27117e124c5d66d5512fe8d494fe6338">Notify</a>(PSTR(<span class="stringliteral">&quot;\r\nSend UIH Modem Status Response&quot;</span>), 0x80);</div>
<div class="line"><a name="l00339"></a><span class="lineno"> 339</span>&#160;<span class="preprocessor">#endif</span></div>
<div class="line"><a name="l00340"></a><span class="lineno"> 340</span>&#160;<span class="preprocessor"></span> rfcommbuf[0] = <a class="code" href="_s_p_p_8h.html#ab68e7621ab822c3bfb9507c78d0d0550">BT_RFCOMM_MSC_RSP</a>; <span class="comment">// UIH Modem Status Response</span></div>
<div class="line"><a name="l00341"></a><span class="lineno"> 341</span>&#160; rfcommbuf[1] = 2 &lt;&lt; 1 | 1; <span class="comment">// Length and shiftet like so: length &lt;&lt; 1 | 1</span></div>
@ -436,7 +436,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
<div class="line"><a name="l00345"></a><span class="lineno"> 345</span>&#160;</div>
<div class="line"><a name="l00346"></a><span class="lineno"> 346</span>&#160; delay(1);</div>
<div class="line"><a name="l00347"></a><span class="lineno"> 347</span>&#160;<span class="preprocessor">#ifdef DEBUG_USB_HOST</span></div>
<div class="line"><a name="l00348"></a><span class="lineno"> 348</span>&#160;<span class="preprocessor"></span> <a class="code" href="message_8h.html#a747819b0aa34f5c3ba0332c2db28c846">Notify</a>(PSTR(<span class="stringliteral">&quot;\r\nSend UIH Modem Status Command&quot;</span>), 0x80);</div>
<div class="line"><a name="l00348"></a><span class="lineno"> 348</span>&#160;<span class="preprocessor"></span> <a class="code" href="message_8h.html#a27117e124c5d66d5512fe8d494fe6338">Notify</a>(PSTR(<span class="stringliteral">&quot;\r\nSend UIH Modem Status Command&quot;</span>), 0x80);</div>
<div class="line"><a name="l00349"></a><span class="lineno"> 349</span>&#160;<span class="preprocessor">#endif</span></div>
<div class="line"><a name="l00350"></a><span class="lineno"> 350</span>&#160;<span class="preprocessor"></span> rfcommbuf[0] = <a class="code" href="_s_p_p_8h.html#ad14b1def5eec64e94cc64a2dcba354ea">BT_RFCOMM_MSC_CMD</a>; <span class="comment">// UIH Modem Status Command</span></div>
<div class="line"><a name="l00351"></a><span class="lineno"> 351</span>&#160; rfcommbuf[1] = 2 &lt;&lt; 1 | 1; <span class="comment">// Length and shiftet like so: length &lt;&lt; 1 | 1</span></div>
@ -447,7 +447,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
<div class="line"><a name="l00356"></a><span class="lineno"> 356</span>&#160; } <span class="keywordflow">else</span> <span class="keywordflow">if</span> (rfcommChannelType == <a class="code" href="_s_p_p_8h.html#ae9ffac80725386a879ba956251f64373">RFCOMM_UIH</a> &amp;&amp; l2capinbuf[11] == <a class="code" href="_s_p_p_8h.html#ab68e7621ab822c3bfb9507c78d0d0550">BT_RFCOMM_MSC_RSP</a>) { <span class="comment">// UIH Modem Status Response</span></div>
<div class="line"><a name="l00357"></a><span class="lineno"> 357</span>&#160; <span class="keywordflow">if</span> (!creditSent) {</div>
<div class="line"><a name="l00358"></a><span class="lineno"> 358</span>&#160;<span class="preprocessor">#ifdef DEBUG_USB_HOST</span></div>
<div class="line"><a name="l00359"></a><span class="lineno"> 359</span>&#160;<span class="preprocessor"></span> <a class="code" href="message_8h.html#a747819b0aa34f5c3ba0332c2db28c846">Notify</a>(PSTR(<span class="stringliteral">&quot;\r\nSend UIH Command with credit&quot;</span>), 0x80);</div>
<div class="line"><a name="l00359"></a><span class="lineno"> 359</span>&#160;<span class="preprocessor"></span> <a class="code" href="message_8h.html#a27117e124c5d66d5512fe8d494fe6338">Notify</a>(PSTR(<span class="stringliteral">&quot;\r\nSend UIH Command with credit&quot;</span>), 0x80);</div>
<div class="line"><a name="l00360"></a><span class="lineno"> 360</span>&#160;<span class="preprocessor">#endif</span></div>
<div class="line"><a name="l00361"></a><span class="lineno"> 361</span>&#160;<span class="preprocessor"></span> sendRfcommCredit(rfcommChannelConnection, rfcommDirection, 0, <a class="code" href="_s_p_p_8h.html#ae9ffac80725386a879ba956251f64373">RFCOMM_UIH</a>, 0x10, <span class="keyword">sizeof</span> (rfcommDataBuffer)); <span class="comment">// Send credit</span></div>
<div class="line"><a name="l00362"></a><span class="lineno"> 362</span>&#160; creditSent = <span class="keyword">true</span>;</div>
@ -456,11 +456,11 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
<div class="line"><a name="l00365"></a><span class="lineno"> 365</span>&#160; }</div>
<div class="line"><a name="l00366"></a><span class="lineno"> 366</span>&#160; } <span class="keywordflow">else</span> <span class="keywordflow">if</span> (rfcommChannelType == <a class="code" href="_s_p_p_8h.html#ae9ffac80725386a879ba956251f64373">RFCOMM_UIH</a> &amp;&amp; l2capinbuf[10] == 0x01) { <span class="comment">// UIH Command with credit</span></div>
<div class="line"><a name="l00367"></a><span class="lineno"> 367</span>&#160;<span class="preprocessor">#ifdef DEBUG_USB_HOST</span></div>
<div class="line"><a name="l00368"></a><span class="lineno"> 368</span>&#160;<span class="preprocessor"></span> <a class="code" href="message_8h.html#a747819b0aa34f5c3ba0332c2db28c846">Notify</a>(PSTR(<span class="stringliteral">&quot;\r\nReceived UIH Command with credit&quot;</span>), 0x80);</div>
<div class="line"><a name="l00368"></a><span class="lineno"> 368</span>&#160;<span class="preprocessor"></span> <a class="code" href="message_8h.html#a27117e124c5d66d5512fe8d494fe6338">Notify</a>(PSTR(<span class="stringliteral">&quot;\r\nReceived UIH Command with credit&quot;</span>), 0x80);</div>
<div class="line"><a name="l00369"></a><span class="lineno"> 369</span>&#160;<span class="preprocessor">#endif</span></div>
<div class="line"><a name="l00370"></a><span class="lineno"> 370</span>&#160;<span class="preprocessor"></span> } <span class="keywordflow">else</span> <span class="keywordflow">if</span> (rfcommChannelType == <a class="code" href="_s_p_p_8h.html#ae9ffac80725386a879ba956251f64373">RFCOMM_UIH</a> &amp;&amp; l2capinbuf[11] == <a class="code" href="_s_p_p_8h.html#ad9b8c11f7f4f8e8d59ac77999b2ec4a3">BT_RFCOMM_RPN_CMD</a>) { <span class="comment">// UIH Remote Port Negotiation Command</span></div>
<div class="line"><a name="l00371"></a><span class="lineno"> 371</span>&#160;<span class="preprocessor">#ifdef DEBUG_USB_HOST</span></div>
<div class="line"><a name="l00372"></a><span class="lineno"> 372</span>&#160;<span class="preprocessor"></span> <a class="code" href="message_8h.html#a747819b0aa34f5c3ba0332c2db28c846">Notify</a>(PSTR(<span class="stringliteral">&quot;\r\nReceived UIH Remote Port Negotiation Command&quot;</span>), 0x80);</div>
<div class="line"><a name="l00372"></a><span class="lineno"> 372</span>&#160;<span class="preprocessor"></span> <a class="code" href="message_8h.html#a27117e124c5d66d5512fe8d494fe6338">Notify</a>(PSTR(<span class="stringliteral">&quot;\r\nReceived UIH Remote Port Negotiation Command&quot;</span>), 0x80);</div>
<div class="line"><a name="l00373"></a><span class="lineno"> 373</span>&#160;<span class="preprocessor">#endif</span></div>
<div class="line"><a name="l00374"></a><span class="lineno"> 374</span>&#160;<span class="preprocessor"></span> rfcommbuf[0] = <a class="code" href="_s_p_p_8h.html#a336bf1805637fdd66033c9040e606a6b">BT_RFCOMM_RPN_RSP</a>; <span class="comment">// Command</span></div>
<div class="line"><a name="l00375"></a><span class="lineno"> 375</span>&#160; rfcommbuf[1] = l2capinbuf[12]; <span class="comment">// Length and shiftet like so: length &lt;&lt; 1 | 1</span></div>
@ -474,7 +474,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
<div class="line"><a name="l00383"></a><span class="lineno"> 383</span>&#160; rfcommbuf[9] = l2capinbuf[20]; <span class="comment">// Number of Frames</span></div>
<div class="line"><a name="l00384"></a><span class="lineno"> 384</span>&#160; sendRfcomm(rfcommChannel, rfcommDirection, 0, <a class="code" href="_s_p_p_8h.html#ae9ffac80725386a879ba956251f64373">RFCOMM_UIH</a>, rfcommPfBit, rfcommbuf, 0x0A); <span class="comment">// UIH Remote Port Negotiation Response</span></div>
<div class="line"><a name="l00385"></a><span class="lineno"> 385</span>&#160;<span class="preprocessor">#ifdef DEBUG_USB_HOST</span></div>
<div class="line"><a name="l00386"></a><span class="lineno"> 386</span>&#160;<span class="preprocessor"></span> <a class="code" href="message_8h.html#a747819b0aa34f5c3ba0332c2db28c846">Notify</a>(PSTR(<span class="stringliteral">&quot;\r\nRFCOMM Connection is now established\r\n&quot;</span>), 0x80);</div>
<div class="line"><a name="l00386"></a><span class="lineno"> 386</span>&#160;<span class="preprocessor"></span> <a class="code" href="message_8h.html#a27117e124c5d66d5512fe8d494fe6338">Notify</a>(PSTR(<span class="stringliteral">&quot;\r\nRFCOMM Connection is now established\r\n&quot;</span>), 0x80);</div>
<div class="line"><a name="l00387"></a><span class="lineno"> 387</span>&#160;<span class="preprocessor">#endif</span></div>
<div class="line"><a name="l00388"></a><span class="lineno"> 388</span>&#160;<span class="preprocessor"></span> waitForLastCommand = <span class="keyword">false</span>;</div>
<div class="line"><a name="l00389"></a><span class="lineno"> 389</span>&#160; creditSent = <span class="keyword">false</span>;</div>
@ -483,9 +483,9 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
<div class="line"><a name="l00392"></a><span class="lineno"> 392</span>&#160; }</div>
<div class="line"><a name="l00393"></a><span class="lineno"> 393</span>&#160;<span class="preprocessor">#ifdef DEBUG_USB_HOST</span></div>
<div class="line"><a name="l00394"></a><span class="lineno"> 394</span>&#160;<span class="preprocessor"></span> <span class="keywordflow">else</span> <span class="keywordflow">if</span> (rfcommChannelType != <a class="code" href="_s_p_p_8h.html#a2c8ebc5e78dc22e7ae4e79370fada66f">RFCOMM_DISC</a>) {</div>
<div class="line"><a name="l00395"></a><span class="lineno"> 395</span>&#160; <a class="code" href="message_8h.html#a747819b0aa34f5c3ba0332c2db28c846">Notify</a>(PSTR(<span class="stringliteral">&quot;\r\nUnsupported RFCOMM Data - ChannelType: &quot;</span>), 0x80);</div>
<div class="line"><a name="l00395"></a><span class="lineno"> 395</span>&#160; <a class="code" href="message_8h.html#a27117e124c5d66d5512fe8d494fe6338">Notify</a>(PSTR(<span class="stringliteral">&quot;\r\nUnsupported RFCOMM Data - ChannelType: &quot;</span>), 0x80);</div>
<div class="line"><a name="l00396"></a><span class="lineno"> 396</span>&#160; D_PrintHex&lt;uint8_t &gt; (rfcommChannelType, 0x80);</div>
<div class="line"><a name="l00397"></a><span class="lineno"> 397</span>&#160; <a class="code" href="message_8h.html#a747819b0aa34f5c3ba0332c2db28c846">Notify</a>(PSTR(<span class="stringliteral">&quot; Command: &quot;</span>), 0x80);</div>
<div class="line"><a name="l00397"></a><span class="lineno"> 397</span>&#160; <a class="code" href="message_8h.html#a27117e124c5d66d5512fe8d494fe6338">Notify</a>(PSTR(<span class="stringliteral">&quot; Command: &quot;</span>), 0x80);</div>
<div class="line"><a name="l00398"></a><span class="lineno"> 398</span>&#160; D_PrintHex&lt;uint8_t &gt; (l2capinbuf[11], 0x80);</div>
<div class="line"><a name="l00399"></a><span class="lineno"> 399</span>&#160; }</div>
<div class="line"><a name="l00400"></a><span class="lineno"> 400</span>&#160;<span class="preprocessor">#endif</span></div>
@ -493,9 +493,9 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
<div class="line"><a name="l00402"></a><span class="lineno"> 402</span>&#160; }</div>
<div class="line"><a name="l00403"></a><span class="lineno"> 403</span>&#160;<span class="preprocessor">#ifdef EXTRADEBUG</span></div>
<div class="line"><a name="l00404"></a><span class="lineno"> 404</span>&#160;<span class="preprocessor"></span> <span class="keywordflow">else</span> {</div>
<div class="line"><a name="l00405"></a><span class="lineno"> 405</span>&#160; <a class="code" href="message_8h.html#a747819b0aa34f5c3ba0332c2db28c846">Notify</a>(PSTR(<span class="stringliteral">&quot;\r\nUnsupported L2CAP Data - Channel ID: &quot;</span>), 0x80);</div>
<div class="line"><a name="l00405"></a><span class="lineno"> 405</span>&#160; <a class="code" href="message_8h.html#a27117e124c5d66d5512fe8d494fe6338">Notify</a>(PSTR(<span class="stringliteral">&quot;\r\nUnsupported L2CAP Data - Channel ID: &quot;</span>), 0x80);</div>
<div class="line"><a name="l00406"></a><span class="lineno"> 406</span>&#160; D_PrintHex&lt;uint8_t &gt; (l2capinbuf[7], 0x80);</div>
<div class="line"><a name="l00407"></a><span class="lineno"> 407</span>&#160; <a class="code" href="message_8h.html#a747819b0aa34f5c3ba0332c2db28c846">Notify</a>(PSTR(<span class="stringliteral">&quot; &quot;</span>), 0x80);</div>
<div class="line"><a name="l00407"></a><span class="lineno"> 407</span>&#160; <a class="code" href="message_8h.html#a27117e124c5d66d5512fe8d494fe6338">Notify</a>(PSTR(<span class="stringliteral">&quot; &quot;</span>), 0x80);</div>
<div class="line"><a name="l00408"></a><span class="lineno"> 408</span>&#160; D_PrintHex&lt;uint8_t &gt; (l2capinbuf[6], 0x80);</div>
<div class="line"><a name="l00409"></a><span class="lineno"> 409</span>&#160; }</div>
<div class="line"><a name="l00410"></a><span class="lineno"> 410</span>&#160;<span class="preprocessor">#endif</span></div>
@ -507,7 +507,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
<div class="line"><a name="l00416"></a><span class="lineno"><a class="code" href="class_s_p_p.html#a2de67ee7ad1be9d2f3daf7dc08dc5f90"> 416</a></span>&#160;<span class="keywordtype">void</span> <a class="code" href="class_s_p_p.html#a2de67ee7ad1be9d2f3daf7dc08dc5f90">SPP::Run</a>() {</div>
<div class="line"><a name="l00417"></a><span class="lineno"> 417</span>&#160; <span class="keywordflow">if</span> (waitForLastCommand &amp;&amp; (millis() - timer) &gt; 100) { <span class="comment">// We will only wait 100ms and see if the UIH Remote Port Negotiation Command is send, as some deviced don&#39;t send it</span></div>
<div class="line"><a name="l00418"></a><span class="lineno"> 418</span>&#160;<span class="preprocessor">#ifdef DEBUG_USB_HOST</span></div>
<div class="line"><a name="l00419"></a><span class="lineno"> 419</span>&#160;<span class="preprocessor"></span> <a class="code" href="message_8h.html#a747819b0aa34f5c3ba0332c2db28c846">Notify</a>(PSTR(<span class="stringliteral">&quot;\r\nRFCOMM Connection is now established - Automatic\r\n&quot;</span>), 0x80);</div>
<div class="line"><a name="l00419"></a><span class="lineno"> 419</span>&#160;<span class="preprocessor"></span> <a class="code" href="message_8h.html#a27117e124c5d66d5512fe8d494fe6338">Notify</a>(PSTR(<span class="stringliteral">&quot;\r\nRFCOMM Connection is now established - Automatic\r\n&quot;</span>), 0x80);</div>
<div class="line"><a name="l00420"></a><span class="lineno"> 420</span>&#160;<span class="preprocessor">#endif</span></div>
<div class="line"><a name="l00421"></a><span class="lineno"> 421</span>&#160;<span class="preprocessor"></span> creditSent = <span class="keyword">false</span>;</div>
<div class="line"><a name="l00422"></a><span class="lineno"> 422</span>&#160; waitForLastCommand = <span class="keyword">false</span>;</div>
@ -523,7 +523,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
<div class="line"><a name="l00432"></a><span class="lineno"> 432</span>&#160; <span class="keywordflow">if</span> (<a class="code" href="_s_p_p_8h.html#a3b1cbac2f2fc44b393ff3cb96448892a">l2cap_connection_request_sdp_flag</a>) {</div>
<div class="line"><a name="l00433"></a><span class="lineno"> 433</span>&#160; l2cap_event_flag &amp;= ~<a class="code" href="_s_p_p_8h.html#a0d649771ff995585c2bff030b7c1a2d3">L2CAP_FLAG_CONNECTION_SDP_REQUEST</a>; <span class="comment">// Clear flag</span></div>
<div class="line"><a name="l00434"></a><span class="lineno"> 434</span>&#160;<span class="preprocessor">#ifdef DEBUG_USB_HOST</span></div>
<div class="line"><a name="l00435"></a><span class="lineno"> 435</span>&#160;<span class="preprocessor"></span> <a class="code" href="message_8h.html#a747819b0aa34f5c3ba0332c2db28c846">Notify</a>(PSTR(<span class="stringliteral">&quot;\r\nSDP Incoming Connection Request&quot;</span>), 0x80);</div>
<div class="line"><a name="l00435"></a><span class="lineno"> 435</span>&#160;<span class="preprocessor"></span> <a class="code" href="message_8h.html#a27117e124c5d66d5512fe8d494fe6338">Notify</a>(PSTR(<span class="stringliteral">&quot;\r\nSDP Incoming Connection Request&quot;</span>), 0x80);</div>
<div class="line"><a name="l00436"></a><span class="lineno"> 436</span>&#160;<span class="preprocessor">#endif</span></div>
<div class="line"><a name="l00437"></a><span class="lineno"> 437</span>&#160;<span class="preprocessor"></span> pBtd-&gt;<a class="code" href="class_b_t_d.html#a7d34c62b1d561679dea5cd27356b38a7">l2cap_connection_response</a>(hci_handle, identifier, sdp_dcid, sdp_scid, <a class="code" href="_b_t_d_8h.html#a9960d0d5ae92fc92c70bbb84c2a5c0cc">PENDING</a>);</div>
<div class="line"><a name="l00438"></a><span class="lineno"> 438</span>&#160; delay(1);</div>
@ -538,7 +538,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
<div class="line"><a name="l00447"></a><span class="lineno"> 447</span>&#160; <span class="keywordflow">if</span> (<a class="code" href="_s_p_p_8h.html#a5f5f1cfcc3f39ee032185cac348cb068">l2cap_config_request_sdp_flag</a>) {</div>
<div class="line"><a name="l00448"></a><span class="lineno"> 448</span>&#160; l2cap_event_flag &amp;= ~<a class="code" href="_s_p_p_8h.html#a52cc6e4a2a6d151dd5d0e788b937b2e8">L2CAP_FLAG_CONFIG_SDP_REQUEST</a>; <span class="comment">// Clear flag</span></div>
<div class="line"><a name="l00449"></a><span class="lineno"> 449</span>&#160;<span class="preprocessor">#ifdef DEBUG_USB_HOST</span></div>
<div class="line"><a name="l00450"></a><span class="lineno"> 450</span>&#160;<span class="preprocessor"></span> <a class="code" href="message_8h.html#a747819b0aa34f5c3ba0332c2db28c846">Notify</a>(PSTR(<span class="stringliteral">&quot;\r\nSDP Configuration Request&quot;</span>), 0x80);</div>
<div class="line"><a name="l00450"></a><span class="lineno"> 450</span>&#160;<span class="preprocessor"></span> <a class="code" href="message_8h.html#a27117e124c5d66d5512fe8d494fe6338">Notify</a>(PSTR(<span class="stringliteral">&quot;\r\nSDP Configuration Request&quot;</span>), 0x80);</div>
<div class="line"><a name="l00451"></a><span class="lineno"> 451</span>&#160;<span class="preprocessor">#endif</span></div>
<div class="line"><a name="l00452"></a><span class="lineno"> 452</span>&#160;<span class="preprocessor"></span> pBtd-&gt;<a class="code" href="class_b_t_d.html#a792ac4529b65235698ecf3d37982c05e">l2cap_config_response</a>(hci_handle, identifier, sdp_scid);</div>
<div class="line"><a name="l00453"></a><span class="lineno"> 453</span>&#160; l2cap_sdp_state = <a class="code" href="_s_p_p_8h.html#a1b8e3e654e4f55e27ca5054aef956edc">L2CAP_SDP_SUCCESS</a>;</div>
@ -548,7 +548,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
<div class="line"><a name="l00457"></a><span class="lineno"> 457</span>&#160; <span class="keywordflow">if</span> (<a class="code" href="_s_p_p_8h.html#a37d324cfd5a79f623dcd0fc8fa047447">l2cap_config_success_sdp_flag</a>) {</div>
<div class="line"><a name="l00458"></a><span class="lineno"> 458</span>&#160; l2cap_event_flag &amp;= ~<a class="code" href="_s_p_p_8h.html#a75ef214ce8a03e8d62a1b24554bc1a05">L2CAP_FLAG_CONFIG_SDP_SUCCESS</a>; <span class="comment">// Clear flag</span></div>
<div class="line"><a name="l00459"></a><span class="lineno"> 459</span>&#160;<span class="preprocessor">#ifdef DEBUG_USB_HOST</span></div>
<div class="line"><a name="l00460"></a><span class="lineno"> 460</span>&#160;<span class="preprocessor"></span> <a class="code" href="message_8h.html#a747819b0aa34f5c3ba0332c2db28c846">Notify</a>(PSTR(<span class="stringliteral">&quot;\r\nSDP Successfully Configured&quot;</span>), 0x80);</div>
<div class="line"><a name="l00460"></a><span class="lineno"> 460</span>&#160;<span class="preprocessor"></span> <a class="code" href="message_8h.html#a27117e124c5d66d5512fe8d494fe6338">Notify</a>(PSTR(<span class="stringliteral">&quot;\r\nSDP Successfully Configured&quot;</span>), 0x80);</div>
<div class="line"><a name="l00461"></a><span class="lineno"> 461</span>&#160;<span class="preprocessor">#endif</span></div>
<div class="line"><a name="l00462"></a><span class="lineno"> 462</span>&#160;<span class="preprocessor"></span> firstMessage = <span class="keyword">true</span>; <span class="comment">// Reset bool</span></div>
<div class="line"><a name="l00463"></a><span class="lineno"> 463</span>&#160; SDPConnected = <span class="keyword">true</span>;</div>
@ -560,7 +560,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
<div class="line"><a name="l00469"></a><span class="lineno"> 469</span>&#160; l2cap_event_flag &amp;= ~<a class="code" href="_s_p_p_8h.html#aac25fa1de5df70a97a6ccc6267d65fea">L2CAP_FLAG_DISCONNECT_SDP_REQUEST</a>; <span class="comment">// Clear flag</span></div>
<div class="line"><a name="l00470"></a><span class="lineno"> 470</span>&#160; SDPConnected = <span class="keyword">false</span>;</div>
<div class="line"><a name="l00471"></a><span class="lineno"> 471</span>&#160;<span class="preprocessor">#ifdef DEBUG_USB_HOST</span></div>
<div class="line"><a name="l00472"></a><span class="lineno"> 472</span>&#160;<span class="preprocessor"></span> <a class="code" href="message_8h.html#a747819b0aa34f5c3ba0332c2db28c846">Notify</a>(PSTR(<span class="stringliteral">&quot;\r\nDisconnected SDP Channel&quot;</span>), 0x80);</div>
<div class="line"><a name="l00472"></a><span class="lineno"> 472</span>&#160;<span class="preprocessor"></span> <a class="code" href="message_8h.html#a27117e124c5d66d5512fe8d494fe6338">Notify</a>(PSTR(<span class="stringliteral">&quot;\r\nDisconnected SDP Channel&quot;</span>), 0x80);</div>
<div class="line"><a name="l00473"></a><span class="lineno"> 473</span>&#160;<span class="preprocessor">#endif</span></div>
<div class="line"><a name="l00474"></a><span class="lineno"> 474</span>&#160;<span class="preprocessor"></span> pBtd-&gt;<a class="code" href="class_b_t_d.html#a29d176d9194e5c92fbe54791fc245407">l2cap_disconnection_response</a>(hci_handle, identifier, sdp_dcid, sdp_scid);</div>
<div class="line"><a name="l00475"></a><span class="lineno"> 475</span>&#160; l2cap_sdp_state = <a class="code" href="_s_p_p_8h.html#a72444116eaac116983a3dec35b1944f0">L2CAP_SDP_WAIT</a>;</div>
@ -570,7 +570,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
<div class="line"><a name="l00479"></a><span class="lineno"> 479</span>&#160; <span class="keywordflow">case</span> <a class="code" href="_s_p_p_8h.html#adf2585ad5d49cf2df2595d860ad6b258">L2CAP_DISCONNECT_RESPONSE</a>: <span class="comment">// This is for both disconnection response from the RFCOMM and SDP channel if they were connected</span></div>
<div class="line"><a name="l00480"></a><span class="lineno"> 480</span>&#160; <span class="keywordflow">if</span> (<a class="code" href="_s_p_p_8h.html#a1412e00ebed70b8d7b41afd769252530">l2cap_disconnect_response_flag</a>) {</div>
<div class="line"><a name="l00481"></a><span class="lineno"> 481</span>&#160;<span class="preprocessor">#ifdef DEBUG_USB_HOST</span></div>
<div class="line"><a name="l00482"></a><span class="lineno"> 482</span>&#160;<span class="preprocessor"></span> <a class="code" href="message_8h.html#a747819b0aa34f5c3ba0332c2db28c846">Notify</a>(PSTR(<span class="stringliteral">&quot;\r\nDisconnected L2CAP Connection&quot;</span>), 0x80);</div>
<div class="line"><a name="l00482"></a><span class="lineno"> 482</span>&#160;<span class="preprocessor"></span> <a class="code" href="message_8h.html#a27117e124c5d66d5512fe8d494fe6338">Notify</a>(PSTR(<span class="stringliteral">&quot;\r\nDisconnected L2CAP Connection&quot;</span>), 0x80);</div>
<div class="line"><a name="l00483"></a><span class="lineno"> 483</span>&#160;<span class="preprocessor">#endif</span></div>
<div class="line"><a name="l00484"></a><span class="lineno"> 484</span>&#160;<span class="preprocessor"></span> RFCOMMConnected = <span class="keyword">false</span>;</div>
<div class="line"><a name="l00485"></a><span class="lineno"> 485</span>&#160; SDPConnected = <span class="keyword">false</span>;</div>
@ -590,7 +590,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
<div class="line"><a name="l00499"></a><span class="lineno"> 499</span>&#160; <span class="keywordflow">if</span> (<a class="code" href="_s_p_p_8h.html#a28cbb8ce9ab60e04e2e131a87e06d5f0">l2cap_connection_request_rfcomm_flag</a>) {</div>
<div class="line"><a name="l00500"></a><span class="lineno"> 500</span>&#160; l2cap_event_flag &amp;= ~<a class="code" href="_s_p_p_8h.html#a61b15e54b1c5f9a28c996ae8e04ca3c0">L2CAP_FLAG_CONNECTION_RFCOMM_REQUEST</a>; <span class="comment">// Clear flag</span></div>
<div class="line"><a name="l00501"></a><span class="lineno"> 501</span>&#160;<span class="preprocessor">#ifdef DEBUG_USB_HOST</span></div>
<div class="line"><a name="l00502"></a><span class="lineno"> 502</span>&#160;<span class="preprocessor"></span> <a class="code" href="message_8h.html#a747819b0aa34f5c3ba0332c2db28c846">Notify</a>(PSTR(<span class="stringliteral">&quot;\r\nRFCOMM Incoming Connection Request&quot;</span>), 0x80);</div>
<div class="line"><a name="l00502"></a><span class="lineno"> 502</span>&#160;<span class="preprocessor"></span> <a class="code" href="message_8h.html#a27117e124c5d66d5512fe8d494fe6338">Notify</a>(PSTR(<span class="stringliteral">&quot;\r\nRFCOMM Incoming Connection Request&quot;</span>), 0x80);</div>
<div class="line"><a name="l00503"></a><span class="lineno"> 503</span>&#160;<span class="preprocessor">#endif</span></div>
<div class="line"><a name="l00504"></a><span class="lineno"> 504</span>&#160;<span class="preprocessor"></span> pBtd-&gt;<a class="code" href="class_b_t_d.html#a7d34c62b1d561679dea5cd27356b38a7">l2cap_connection_response</a>(hci_handle, identifier, rfcomm_dcid, rfcomm_scid, <a class="code" href="_b_t_d_8h.html#a9960d0d5ae92fc92c70bbb84c2a5c0cc">PENDING</a>);</div>
<div class="line"><a name="l00505"></a><span class="lineno"> 505</span>&#160; delay(1);</div>
@ -605,7 +605,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
<div class="line"><a name="l00514"></a><span class="lineno"> 514</span>&#160; <span class="keywordflow">if</span> (<a class="code" href="_s_p_p_8h.html#ae9459fccc82a24e23dc52ef0e0422273">l2cap_config_request_rfcomm_flag</a>) {</div>
<div class="line"><a name="l00515"></a><span class="lineno"> 515</span>&#160; l2cap_event_flag &amp;= ~<a class="code" href="_s_p_p_8h.html#abaa9eb6a1d27745243ef134ecad34bb2">L2CAP_FLAG_CONFIG_RFCOMM_REQUEST</a>; <span class="comment">// Clear flag</span></div>
<div class="line"><a name="l00516"></a><span class="lineno"> 516</span>&#160;<span class="preprocessor">#ifdef DEBUG_USB_HOST</span></div>
<div class="line"><a name="l00517"></a><span class="lineno"> 517</span>&#160;<span class="preprocessor"></span> <a class="code" href="message_8h.html#a747819b0aa34f5c3ba0332c2db28c846">Notify</a>(PSTR(<span class="stringliteral">&quot;\r\nRFCOMM Configuration Request&quot;</span>), 0x80);</div>
<div class="line"><a name="l00517"></a><span class="lineno"> 517</span>&#160;<span class="preprocessor"></span> <a class="code" href="message_8h.html#a27117e124c5d66d5512fe8d494fe6338">Notify</a>(PSTR(<span class="stringliteral">&quot;\r\nRFCOMM Configuration Request&quot;</span>), 0x80);</div>
<div class="line"><a name="l00518"></a><span class="lineno"> 518</span>&#160;<span class="preprocessor">#endif</span></div>
<div class="line"><a name="l00519"></a><span class="lineno"> 519</span>&#160;<span class="preprocessor"></span> pBtd-&gt;<a class="code" href="class_b_t_d.html#a792ac4529b65235698ecf3d37982c05e">l2cap_config_response</a>(hci_handle, identifier, rfcomm_scid);</div>
<div class="line"><a name="l00520"></a><span class="lineno"> 520</span>&#160; l2cap_rfcomm_state = <a class="code" href="_s_p_p_8h.html#a75321d181cfa3c485bcd96918c1b353e">L2CAP_RFCOMM_SUCCESS</a>;</div>
@ -615,7 +615,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
<div class="line"><a name="l00524"></a><span class="lineno"> 524</span>&#160; <span class="keywordflow">if</span> (<a class="code" href="_s_p_p_8h.html#a1c5c7dc5782a562f1b91e835f8aebdb4">l2cap_config_success_rfcomm_flag</a>) {</div>
<div class="line"><a name="l00525"></a><span class="lineno"> 525</span>&#160; l2cap_event_flag &amp;= ~<a class="code" href="_s_p_p_8h.html#a8af4ce4d4c42d85f0d84a514354fc570">L2CAP_FLAG_CONFIG_RFCOMM_SUCCESS</a>; <span class="comment">// Clear flag</span></div>
<div class="line"><a name="l00526"></a><span class="lineno"> 526</span>&#160;<span class="preprocessor">#ifdef DEBUG_USB_HOST</span></div>
<div class="line"><a name="l00527"></a><span class="lineno"> 527</span>&#160;<span class="preprocessor"></span> <a class="code" href="message_8h.html#a747819b0aa34f5c3ba0332c2db28c846">Notify</a>(PSTR(<span class="stringliteral">&quot;\r\nRFCOMM Successfully Configured&quot;</span>), 0x80);</div>
<div class="line"><a name="l00527"></a><span class="lineno"> 527</span>&#160;<span class="preprocessor"></span> <a class="code" href="message_8h.html#a27117e124c5d66d5512fe8d494fe6338">Notify</a>(PSTR(<span class="stringliteral">&quot;\r\nRFCOMM Successfully Configured&quot;</span>), 0x80);</div>
<div class="line"><a name="l00528"></a><span class="lineno"> 528</span>&#160;<span class="preprocessor">#endif</span></div>
<div class="line"><a name="l00529"></a><span class="lineno"> 529</span>&#160;<span class="preprocessor"></span> rfcommAvailable = 0; <span class="comment">// Reset number of bytes available</span></div>
<div class="line"><a name="l00530"></a><span class="lineno"> 530</span>&#160; bytesRead = 0; <span class="comment">// Reset number of bytes received</span></div>
@ -629,7 +629,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
<div class="line"><a name="l00538"></a><span class="lineno"> 538</span>&#160; RFCOMMConnected = <span class="keyword">false</span>;</div>
<div class="line"><a name="l00539"></a><span class="lineno"> 539</span>&#160; <a class="code" href="class_s_p_p.html#ade5d4f0ab50ddcad14f75fce4450a028">connected</a> = <span class="keyword">false</span>;</div>
<div class="line"><a name="l00540"></a><span class="lineno"> 540</span>&#160;<span class="preprocessor">#ifdef DEBUG_USB_HOST</span></div>
<div class="line"><a name="l00541"></a><span class="lineno"> 541</span>&#160;<span class="preprocessor"></span> <a class="code" href="message_8h.html#a747819b0aa34f5c3ba0332c2db28c846">Notify</a>(PSTR(<span class="stringliteral">&quot;\r\nDisconnected RFCOMM Channel&quot;</span>), 0x80);</div>
<div class="line"><a name="l00541"></a><span class="lineno"> 541</span>&#160;<span class="preprocessor"></span> <a class="code" href="message_8h.html#a27117e124c5d66d5512fe8d494fe6338">Notify</a>(PSTR(<span class="stringliteral">&quot;\r\nDisconnected RFCOMM Channel&quot;</span>), 0x80);</div>
<div class="line"><a name="l00542"></a><span class="lineno"> 542</span>&#160;<span class="preprocessor">#endif</span></div>
<div class="line"><a name="l00543"></a><span class="lineno"> 543</span>&#160;<span class="preprocessor"></span> pBtd-&gt;<a class="code" href="class_b_t_d.html#a29d176d9194e5c92fbe54791fc245407">l2cap_disconnection_response</a>(hci_handle, identifier, rfcomm_dcid, rfcomm_scid);</div>
<div class="line"><a name="l00544"></a><span class="lineno"> 544</span>&#160; l2cap_rfcomm_state = <a class="code" href="_s_p_p_8h.html#a0b7cbe1aa26664847a48bd4578bc50bd">L2CAP_RFCOMM_WAIT</a>;</div>
@ -787,10 +787,10 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
<div class="line"><a name="l00696"></a><span class="lineno"> 696</span>&#160; l2capoutbuf[i + 3] = data[i];</div>
<div class="line"><a name="l00697"></a><span class="lineno"> 697</span>&#160; l2capoutbuf[i + 3] = calcFcs(l2capoutbuf);</div>
<div class="line"><a name="l00698"></a><span class="lineno"> 698</span>&#160;<span class="preprocessor">#ifdef EXTRADEBUG</span></div>
<div class="line"><a name="l00699"></a><span class="lineno"> 699</span>&#160;<span class="preprocessor"></span> <a class="code" href="message_8h.html#a747819b0aa34f5c3ba0332c2db28c846">Notify</a>(PSTR(<span class="stringliteral">&quot; - RFCOMM Data: &quot;</span>), 0x80);</div>
<div class="line"><a name="l00699"></a><span class="lineno"> 699</span>&#160;<span class="preprocessor"></span> <a class="code" href="message_8h.html#a27117e124c5d66d5512fe8d494fe6338">Notify</a>(PSTR(<span class="stringliteral">&quot; - RFCOMM Data: &quot;</span>), 0x80);</div>
<div class="line"><a name="l00700"></a><span class="lineno"> 700</span>&#160; <span class="keywordflow">for</span> (i = 0; i &lt; length + 4; i++) {</div>
<div class="line"><a name="l00701"></a><span class="lineno"> 701</span>&#160; D_PrintHex&lt;uint8_t &gt; (l2capoutbuf[i], 0x80);</div>
<div class="line"><a name="l00702"></a><span class="lineno"> 702</span>&#160; <a class="code" href="message_8h.html#a747819b0aa34f5c3ba0332c2db28c846">Notify</a>(PSTR(<span class="stringliteral">&quot; &quot;</span>), 0x80);</div>
<div class="line"><a name="l00702"></a><span class="lineno"> 702</span>&#160; <a class="code" href="message_8h.html#a27117e124c5d66d5512fe8d494fe6338">Notify</a>(PSTR(<span class="stringliteral">&quot; &quot;</span>), 0x80);</div>
<div class="line"><a name="l00703"></a><span class="lineno"> 703</span>&#160; }</div>
<div class="line"><a name="l00704"></a><span class="lineno"> 704</span>&#160;<span class="preprocessor">#endif</span></div>
<div class="line"><a name="l00705"></a><span class="lineno"> 705</span>&#160;<span class="preprocessor"></span> RFCOMM_Command(l2capoutbuf, length + 4);</div>
@ -803,10 +803,10 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
<div class="line"><a name="l00712"></a><span class="lineno"> 712</span>&#160; l2capoutbuf[3] = credit; <span class="comment">// Credit</span></div>
<div class="line"><a name="l00713"></a><span class="lineno"> 713</span>&#160; l2capoutbuf[4] = calcFcs(l2capoutbuf);</div>
<div class="line"><a name="l00714"></a><span class="lineno"> 714</span>&#160;<span class="preprocessor">#ifdef EXTRADEBUG</span></div>
<div class="line"><a name="l00715"></a><span class="lineno"> 715</span>&#160;<span class="preprocessor"></span> <a class="code" href="message_8h.html#a747819b0aa34f5c3ba0332c2db28c846">Notify</a>(PSTR(<span class="stringliteral">&quot; - RFCOMM Credit Data: &quot;</span>), 0x80);</div>
<div class="line"><a name="l00715"></a><span class="lineno"> 715</span>&#160;<span class="preprocessor"></span> <a class="code" href="message_8h.html#a27117e124c5d66d5512fe8d494fe6338">Notify</a>(PSTR(<span class="stringliteral">&quot; - RFCOMM Credit Data: &quot;</span>), 0x80);</div>
<div class="line"><a name="l00716"></a><span class="lineno"> 716</span>&#160; <span class="keywordflow">for</span> (uint8_t i = 0; i &lt; 5; i++) {</div>
<div class="line"><a name="l00717"></a><span class="lineno"> 717</span>&#160; D_PrintHex&lt;uint8_t &gt; (l2capoutbuf[i], 0x80);</div>
<div class="line"><a name="l00718"></a><span class="lineno"> 718</span>&#160; <a class="code" href="message_8h.html#a747819b0aa34f5c3ba0332c2db28c846">Notify</a>(PSTR(<span class="stringliteral">&quot; &quot;</span>), 0x80);</div>
<div class="line"><a name="l00718"></a><span class="lineno"> 718</span>&#160; <a class="code" href="message_8h.html#a27117e124c5d66d5512fe8d494fe6338">Notify</a>(PSTR(<span class="stringliteral">&quot; &quot;</span>), 0x80);</div>
<div class="line"><a name="l00719"></a><span class="lineno"> 719</span>&#160; }</div>
<div class="line"><a name="l00720"></a><span class="lineno"> 720</span>&#160;<span class="preprocessor">#endif</span></div>
<div class="line"><a name="l00721"></a><span class="lineno"> 721</span>&#160;<span class="preprocessor"></span> RFCOMM_Command(l2capoutbuf, 5);</div>
@ -893,9 +893,9 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
<div class="line"><a name="l00802"></a><span class="lineno"> 802</span>&#160; bytesRead = 0;</div>
<div class="line"><a name="l00803"></a><span class="lineno"> 803</span>&#160; sendRfcommCredit(rfcommChannelConnection, rfcommDirection, 0, <a class="code" href="_s_p_p_8h.html#ae9ffac80725386a879ba956251f64373">RFCOMM_UIH</a>, 0x10, <span class="keyword">sizeof</span> (rfcommDataBuffer)); <span class="comment">// Send more credit</span></div>
<div class="line"><a name="l00804"></a><span class="lineno"> 804</span>&#160;<span class="preprocessor">#ifdef EXTRADEBUG</span></div>
<div class="line"><a name="l00805"></a><span class="lineno"> 805</span>&#160;<span class="preprocessor"></span> <a class="code" href="message_8h.html#a747819b0aa34f5c3ba0332c2db28c846">Notify</a>(PSTR(<span class="stringliteral">&quot;\r\nSent &quot;</span>), 0x80);</div>
<div class="line"><a name="l00806"></a><span class="lineno"> 806</span>&#160; <a class="code" href="message_8h.html#a747819b0aa34f5c3ba0332c2db28c846">Notify</a>((uint8_t)<span class="keyword">sizeof</span> (rfcommDataBuffer), 0x80);</div>
<div class="line"><a name="l00807"></a><span class="lineno"> 807</span>&#160; <a class="code" href="message_8h.html#a747819b0aa34f5c3ba0332c2db28c846">Notify</a>(PSTR(<span class="stringliteral">&quot; more credit&quot;</span>), 0x80);</div>
<div class="line"><a name="l00805"></a><span class="lineno"> 805</span>&#160;<span class="preprocessor"></span> <a class="code" href="message_8h.html#a27117e124c5d66d5512fe8d494fe6338">Notify</a>(PSTR(<span class="stringliteral">&quot;\r\nSent &quot;</span>), 0x80);</div>
<div class="line"><a name="l00806"></a><span class="lineno"> 806</span>&#160; <a class="code" href="message_8h.html#a27117e124c5d66d5512fe8d494fe6338">Notify</a>((uint8_t)<span class="keyword">sizeof</span> (rfcommDataBuffer), 0x80);</div>
<div class="line"><a name="l00807"></a><span class="lineno"> 807</span>&#160; <a class="code" href="message_8h.html#a27117e124c5d66d5512fe8d494fe6338">Notify</a>(PSTR(<span class="stringliteral">&quot; more credit&quot;</span>), 0x80);</div>
<div class="line"><a name="l00808"></a><span class="lineno"> 808</span>&#160;<span class="preprocessor">#endif</span></div>
<div class="line"><a name="l00809"></a><span class="lineno"> 809</span>&#160;<span class="preprocessor"></span> }</div>
<div class="line"><a name="l00810"></a><span class="lineno"> 810</span>&#160; <span class="keywordflow">return</span> output;</div>

View file

@ -98,7 +98,7 @@ Include dependency graph for SPP.h:</div>
<div class="dyncontent">
<div class="center"><img src="_s_p_p_8h__incl.png" border="0" usemap="#_s_p_p_8h" alt=""/></div>
<map name="_s_p_p_8h" id="_s_p_p_8h">
<area shape="rect" id="node2" href="_b_t_d_8h.html" title="BTD.h" alt="" coords="560,75,605,96"/><area shape="rect" id="node3" href="_usb_8h.html" title="Usb.h" alt="" coords="287,213,329,235"/><area shape="rect" id="node19" href="confdescparser_8h.html" title="confdescparser.h" alt="" coords="649,144,732,165"/><area shape="rect" id="node6" href="avrpins_8h.html" title="avrpins.h" alt="" coords="30,352,84,373"/><area shape="rect" id="node8" href="max3421e_8h.html" title="max3421e.h" alt="" coords="261,352,328,373"/><area shape="rect" id="node9" href="usbhost_8h.html" title="usbhost.h" alt="" coords="169,283,225,304"/><area shape="rect" id="node10" href="usb__ch9_8h.html" title="usb_ch9.h" alt="" coords="109,352,168,373"/><area shape="rect" id="node12" href="address_8h.html" title="address.h" alt="" coords="377,283,433,304"/><area shape="rect" id="node15" href="message_8h.html" title="message.h" alt="" coords="696,283,757,304"/><area shape="rect" id="node17" href="printhex_8h.html" title="printhex.h" alt="" coords="686,421,743,443"/><area shape="rect" id="node18" href="hexdump_8h.html" title="hexdump.h" alt="" coords="731,352,792,373"/><area shape="rect" id="node20" href="parsetools_8h.html" title="parsetools.h" alt="" coords="729,213,793,235"/></map>
<area shape="rect" id="node2" href="_b_t_d_8h.html" title="BTD.h" alt="" coords="600,75,646,96"/><area shape="rect" id="node3" href="_usb_8h.html" title="Usb.h" alt="" coords="330,213,372,235"/><area shape="rect" id="node19" href="confdescparser_8h.html" title="confdescparser.h" alt="" coords="688,144,771,165"/><area shape="rect" id="node6" href="avrpins_8h.html" title="avrpins.h" alt="" coords="34,352,88,373"/><area shape="rect" id="node8" href="max3421e_8h.html" title="max3421e.h" alt="" coords="284,352,351,373"/><area shape="rect" id="node9" href="usbhost_8h.html" title="usbhost.h" alt="" coords="152,283,208,304"/><area shape="rect" id="node11" href="usb__ch9_8h.html" title="usb_ch9.h" alt="" coords="500,352,559,373"/><area shape="rect" id="node13" href="address_8h.html" title="address.h" alt="" coords="356,283,412,304"/><area shape="rect" id="node15" href="message_8h.html" title="message.h" alt="" coords="735,283,796,304"/><area shape="rect" id="node17" href="printhex_8h.html" title="printhex.h" alt="" coords="737,421,794,443"/><area shape="rect" id="node18" href="hexdump_8h.html" title="hexdump.h" alt="" coords="735,352,796,373"/><area shape="rect" id="node20" href="parsetools_8h.html" title="parsetools.h" alt="" coords="768,213,832,235"/></map>
</div>
</div><div class="textblock"><div class="dynheader">
This graph shows which files directly or indirectly include this file:</div>

View file

@ -1,14 +1,14 @@
<map id="SPP.h" name="SPP.h">
<area shape="rect" id="node2" href="$_b_t_d_8h.html" title="BTD.h" alt="" coords="560,75,605,96"/>
<area shape="rect" id="node3" href="$_usb_8h.html" title="Usb.h" alt="" coords="287,213,329,235"/>
<area shape="rect" id="node19" href="$confdescparser_8h.html" title="confdescparser.h" alt="" coords="649,144,732,165"/>
<area shape="rect" id="node6" href="$avrpins_8h.html" title="avrpins.h" alt="" coords="30,352,84,373"/>
<area shape="rect" id="node8" href="$max3421e_8h.html" title="max3421e.h" alt="" coords="261,352,328,373"/>
<area shape="rect" id="node9" href="$usbhost_8h.html" title="usbhost.h" alt="" coords="169,283,225,304"/>
<area shape="rect" id="node10" href="$usb__ch9_8h.html" title="usb_ch9.h" alt="" coords="109,352,168,373"/>
<area shape="rect" id="node12" href="$address_8h.html" title="address.h" alt="" coords="377,283,433,304"/>
<area shape="rect" id="node15" href="$message_8h.html" title="message.h" alt="" coords="696,283,757,304"/>
<area shape="rect" id="node17" href="$printhex_8h.html" title="printhex.h" alt="" coords="686,421,743,443"/>
<area shape="rect" id="node18" href="$hexdump_8h.html" title="hexdump.h" alt="" coords="731,352,792,373"/>
<area shape="rect" id="node20" href="$parsetools_8h.html" title="parsetools.h" alt="" coords="729,213,793,235"/>
<area shape="rect" id="node2" href="$_b_t_d_8h.html" title="BTD.h" alt="" coords="600,75,646,96"/>
<area shape="rect" id="node3" href="$_usb_8h.html" title="Usb.h" alt="" coords="330,213,372,235"/>
<area shape="rect" id="node19" href="$confdescparser_8h.html" title="confdescparser.h" alt="" coords="688,144,771,165"/>
<area shape="rect" id="node6" href="$avrpins_8h.html" title="avrpins.h" alt="" coords="34,352,88,373"/>
<area shape="rect" id="node8" href="$max3421e_8h.html" title="max3421e.h" alt="" coords="284,352,351,373"/>
<area shape="rect" id="node9" href="$usbhost_8h.html" title="usbhost.h" alt="" coords="152,283,208,304"/>
<area shape="rect" id="node11" href="$usb__ch9_8h.html" title="usb_ch9.h" alt="" coords="500,352,559,373"/>
<area shape="rect" id="node13" href="$address_8h.html" title="address.h" alt="" coords="356,283,412,304"/>
<area shape="rect" id="node15" href="$message_8h.html" title="message.h" alt="" coords="735,283,796,304"/>
<area shape="rect" id="node17" href="$printhex_8h.html" title="printhex.h" alt="" coords="737,421,794,443"/>
<area shape="rect" id="node18" href="$hexdump_8h.html" title="hexdump.h" alt="" coords="735,352,796,373"/>
<area shape="rect" id="node20" href="$parsetools_8h.html" title="parsetools.h" alt="" coords="768,213,832,235"/>
</map>

View file

@ -1 +1 @@
2a91f81d018fc0d1ae460ca8166764ff
2a91c387635437451a0ae64cc99908a9

Binary file not shown.

Before

Width:  |  Height:  |  Size: 77 KiB

After

Width:  |  Height:  |  Size: 82 KiB

View file

@ -99,7 +99,7 @@ Include dependency graph for Usb.cpp:</div>
<div class="dyncontent">
<div class="center"><img src="_usb_8cpp__incl.png" border="0" usemap="#_usb_8cpp" alt=""/></div>
<map name="_usb_8cpp" id="_usb_8cpp">
<area shape="rect" id="node2" href="avrpins_8h.html" title="avrpins.h" alt="" coords="5,213,59,235"/><area shape="rect" id="node4" href="max3421e_8h.html" title="max3421e.h" alt="" coords="236,213,303,235"/><area shape="rect" id="node5" href="usbhost_8h.html" title="usbhost.h" alt="" coords="78,144,135,165"/><area shape="rect" id="node9" href="_usb_8h.html" title="Usb.h" alt="" coords="287,75,329,96"/><area shape="rect" id="node6" href="usb__ch9_8h.html" title="usb_ch9.h" alt="" coords="153,213,212,235"/><area shape="rect" id="node11" href="address_8h.html" title="address.h" alt="" coords="313,144,369,165"/><area shape="rect" id="node14" href="message_8h.html" title="message.h" alt="" coords="571,144,632,165"/><area shape="rect" id="node16" href="printhex_8h.html" title="printhex.h" alt="" coords="555,283,612,304"/><area shape="rect" id="node17" href="hexdump_8h.html" title="hexdump.h" alt="" coords="604,213,665,235"/></map>
<area shape="rect" id="node2" href="avrpins_8h.html" title="avrpins.h" alt="" coords="43,213,97,235"/><area shape="rect" id="node4" href="max3421e_8h.html" title="max3421e.h" alt="" coords="325,213,392,235"/><area shape="rect" id="node5" href="usbhost_8h.html" title="usbhost.h" alt="" coords="161,144,217,165"/><area shape="rect" id="node10" href="_usb_8h.html" title="Usb.h" alt="" coords="373,75,416,96"/><area shape="rect" id="node7" href="usb__ch9_8h.html" title="usb_ch9.h" alt="" coords="243,213,301,235"/><area shape="rect" id="node12" href="address_8h.html" title="address.h" alt="" coords="395,144,452,165"/><area shape="rect" id="node14" href="message_8h.html" title="message.h" alt="" coords="659,144,720,165"/><area shape="rect" id="node16" href="printhex_8h.html" title="printhex.h" alt="" coords="719,283,776,304"/><area shape="rect" id="node17" href="hexdump_8h.html" title="hexdump.h" alt="" coords="693,213,755,235"/></map>
</div>
</div>
<p><a href="_usb_8cpp_source.html">Go to the source code of this file.</a></p>

View file

@ -1,11 +1,11 @@
<map id="Usb.cpp" name="Usb.cpp">
<area shape="rect" id="node2" href="$avrpins_8h.html" title="avrpins.h" alt="" coords="5,213,59,235"/>
<area shape="rect" id="node4" href="$max3421e_8h.html" title="max3421e.h" alt="" coords="236,213,303,235"/>
<area shape="rect" id="node5" href="$usbhost_8h.html" title="usbhost.h" alt="" coords="78,144,135,165"/>
<area shape="rect" id="node9" href="$_usb_8h.html" title="Usb.h" alt="" coords="287,75,329,96"/>
<area shape="rect" id="node6" href="$usb__ch9_8h.html" title="usb_ch9.h" alt="" coords="153,213,212,235"/>
<area shape="rect" id="node11" href="$address_8h.html" title="address.h" alt="" coords="313,144,369,165"/>
<area shape="rect" id="node14" href="$message_8h.html" title="message.h" alt="" coords="571,144,632,165"/>
<area shape="rect" id="node16" href="$printhex_8h.html" title="printhex.h" alt="" coords="555,283,612,304"/>
<area shape="rect" id="node17" href="$hexdump_8h.html" title="hexdump.h" alt="" coords="604,213,665,235"/>
<area shape="rect" id="node2" href="$avrpins_8h.html" title="avrpins.h" alt="" coords="43,213,97,235"/>
<area shape="rect" id="node4" href="$max3421e_8h.html" title="max3421e.h" alt="" coords="325,213,392,235"/>
<area shape="rect" id="node5" href="$usbhost_8h.html" title="usbhost.h" alt="" coords="161,144,217,165"/>
<area shape="rect" id="node10" href="$_usb_8h.html" title="Usb.h" alt="" coords="373,75,416,96"/>
<area shape="rect" id="node7" href="$usb__ch9_8h.html" title="usb_ch9.h" alt="" coords="243,213,301,235"/>
<area shape="rect" id="node12" href="$address_8h.html" title="address.h" alt="" coords="395,144,452,165"/>
<area shape="rect" id="node14" href="$message_8h.html" title="message.h" alt="" coords="659,144,720,165"/>
<area shape="rect" id="node16" href="$printhex_8h.html" title="printhex.h" alt="" coords="719,283,776,304"/>
<area shape="rect" id="node17" href="$hexdump_8h.html" title="hexdump.h" alt="" coords="693,213,755,235"/>
</map>

View file

@ -1 +1 @@
1100db60c4ff669cb9f00b8be1d4b8fb
2c4125af802552f99104380c37456b8e

Binary file not shown.

Before

Width:  |  Height:  |  Size: 61 KiB

After

Width:  |  Height:  |  Size: 67 KiB

View file

@ -201,14 +201,14 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
<div class="line"><a name="l00110"></a><span class="lineno"> 110</span>&#160;<span class="comment"> USBTRACE(&quot;\r\n&quot;);</span></div>
<div class="line"><a name="l00111"></a><span class="lineno"> 111</span>&#160;<span class="comment"> */</span></div>
<div class="line"><a name="l00112"></a><span class="lineno"> 112</span>&#160; <a class="code" href="class_m_a_x3421e.html#a74e387200f57bc03152247d630c166aa">regWr</a>(<a class="code" href="max3421e_8h.html#ac6d86063950bdbf438d358c907aefbfa">rPERADDR</a>, addr); <span class="comment">//set peripheral address</span></div>
<div class="line"><a name="l00113"></a><span class="lineno"> 113</span>&#160; </div>
<div class="line"><a name="l00113"></a><span class="lineno"> 113</span>&#160;</div>
<div class="line"><a name="l00114"></a><span class="lineno"> 114</span>&#160; uint8_t mode = <a class="code" href="class_m_a_x3421e.html#ae7faae82a8d68c38b43833b8fddcb8e8">regRd</a>(<a class="code" href="max3421e_8h.html#a330db4fc764b8ccae5214645c1ee5423">rMODE</a>);</div>
<div class="line"><a name="l00115"></a><span class="lineno"> 115</span>&#160; </div>
<div class="line"><a name="l00115"></a><span class="lineno"> 115</span>&#160;</div>
<div class="line"><a name="l00116"></a><span class="lineno"> 116</span>&#160; <span class="comment">//Serial.print(&quot;\r\nMode: &quot;);</span></div>
<div class="line"><a name="l00117"></a><span class="lineno"> 117</span>&#160; <span class="comment">//Serial.println( mode, HEX);</span></div>
<div class="line"><a name="l00118"></a><span class="lineno"> 118</span>&#160; <span class="comment">//Serial.print(&quot;\r\nLS: &quot;);</span></div>
<div class="line"><a name="l00119"></a><span class="lineno"> 119</span>&#160; <span class="comment">//Serial.println(p-&gt;lowspeed, HEX);</span></div>
<div class="line"><a name="l00120"></a><span class="lineno"> 120</span>&#160; </div>
<div class="line"><a name="l00120"></a><span class="lineno"> 120</span>&#160;</div>
<div class="line"><a name="l00121"></a><span class="lineno"> 121</span>&#160;</div>
<div class="line"><a name="l00122"></a><span class="lineno"> 122</span>&#160;</div>
<div class="line"><a name="l00123"></a><span class="lineno"> 123</span>&#160; <span class="comment">// Set bmLOWSPEED and bmHUBPRE in case of low-speed device, reset them otherwise</span></div>
@ -543,9 +543,9 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
<div class="line"><a name="l00452"></a><span class="lineno"> 452</span>&#160; lowspeed = <span class="keyword">false</span>;</div>
<div class="line"><a name="l00453"></a><span class="lineno"> 453</span>&#160; <span class="keywordflow">break</span>;</div>
<div class="line"><a name="l00454"></a><span class="lineno"> 454</span>&#160; <span class="keywordflow">case</span> <a class="code" href="max3421e_8h.html#aa05ee2be883f4b96948e18b0d55ab5c2">LSHOST</a>:</div>
<div class="line"><a name="l00455"></a><span class="lineno"> 455</span>&#160; <span class="comment">// if ((usb_task_state &amp; USB_STATE_MASK) == USB_STATE_DETACHED) {</span></div>
<div class="line"><a name="l00455"></a><span class="lineno"> 455</span>&#160; </div>
<div class="line"><a name="l00456"></a><span class="lineno"> 456</span>&#160; lowspeed = <span class="keyword">true</span>;</div>
<div class="line"><a name="l00457"></a><span class="lineno"> 457</span>&#160; <span class="comment">// }</span></div>
<div class="line"><a name="l00457"></a><span class="lineno"> 457</span>&#160; <span class="comment">//intentional fallthrough</span></div>
<div class="line"><a name="l00458"></a><span class="lineno"> 458</span>&#160; <span class="keywordflow">case</span> <a class="code" href="max3421e_8h.html#a8ec45bdb8c5273e99c3ab89349cb43f9">FSHOST</a>: <span class="comment">//attached</span></div>
<div class="line"><a name="l00459"></a><span class="lineno"> 459</span>&#160; <span class="keywordflow">if</span> ((usb_task_state &amp; USB_STATE_MASK) == <a class="code" href="_usb_8h.html#ae7fd7c5bb6dc87f44724dde2ad57df87">USB_STATE_DETACHED</a>) {</div>
<div class="line"><a name="l00460"></a><span class="lineno"> 460</span>&#160; delay = millis() + <a class="code" href="_usb_8h.html#a1b082667723b29243b021a1829bdd8d6">USB_SETTLE_DELAY</a>;</div>
@ -603,10 +603,10 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
<div class="line"><a name="l00512"></a><span class="lineno"> 512</span>&#160; <span class="keywordflow">if</span> (delay &lt; millis()) usb_task_state = <a class="code" href="_usb_8h.html#aac8c844e6a20f42298d70e4438a029e5">USB_STATE_CONFIGURING</a>;</div>
<div class="line"><a name="l00513"></a><span class="lineno"> 513</span>&#160; <span class="keywordflow">break</span>;</div>
<div class="line"><a name="l00514"></a><span class="lineno"> 514</span>&#160; <span class="keywordflow">case</span> <a class="code" href="_usb_8h.html#aac8c844e6a20f42298d70e4438a029e5">USB_STATE_CONFIGURING</a>:</div>
<div class="line"><a name="l00515"></a><span class="lineno"> 515</span>&#160; </div>
<div class="line"><a name="l00515"></a><span class="lineno"> 515</span>&#160;</div>
<div class="line"><a name="l00516"></a><span class="lineno"> 516</span>&#160; <span class="comment">//Serial.print(&quot;\r\nConf.LS: &quot;);</span></div>
<div class="line"><a name="l00517"></a><span class="lineno"> 517</span>&#160; <span class="comment">//Serial.println(lowspeed, HEX);</span></div>
<div class="line"><a name="l00518"></a><span class="lineno"> 518</span>&#160; </div>
<div class="line"><a name="l00518"></a><span class="lineno"> 518</span>&#160;</div>
<div class="line"><a name="l00519"></a><span class="lineno"> 519</span>&#160; rcode = <a class="code" href="class_u_s_b.html#af4008dfc1c2d15c23cf8a7815cc17765">Configuring</a>(0, 0, lowspeed);</div>
<div class="line"><a name="l00520"></a><span class="lineno"> 520</span>&#160;</div>
<div class="line"><a name="l00521"></a><span class="lineno"> 521</span>&#160; <span class="keywordflow">if</span> (rcode) {</div>
@ -783,100 +783,99 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
<div class="line"><a name="l00692"></a><span class="lineno"> 692</span>&#160; <span class="keywordflow">for</span> (devConfigIndex = 0; devConfigIndex &lt; <a class="code" href="_usb_8h.html#a0282f9f7a0313f957e02449d7313b7b5">USB_NUMDEVICES</a>; devConfigIndex++) {</div>
<div class="line"><a name="l00693"></a><span class="lineno"> 693</span>&#160; <span class="keywordflow">if</span> (!devConfig[devConfigIndex]) <span class="keywordflow">continue</span>; <span class="comment">// no driver</span></div>
<div class="line"><a name="l00694"></a><span class="lineno"> 694</span>&#160; <span class="keywordflow">if</span> (devConfig[devConfigIndex]-&gt;GetAddress()) <span class="keywordflow">continue</span>; <span class="comment">// consumed</span></div>
<div class="line"><a name="l00695"></a><span class="lineno"> 695</span>&#160; <span class="keywordflow">if</span> (devConfig[devConfigIndex]-&gt;VIDPIDOK(vid, pid)) {</div>
<div class="line"><a name="l00695"></a><span class="lineno"> 695</span>&#160; <span class="keywordflow">if</span> (devConfig[devConfigIndex]-&gt;VIDPIDOK(vid, pid) || devConfig[devConfigIndex]-&gt;<a class="code" href="class_u_s_b_device_config.html#a7f13c42ed2c8e72e1f63562576ca82d2">DEVCLASSOK</a>(klass)) {</div>
<div class="line"><a name="l00696"></a><span class="lineno"> 696</span>&#160; rcode = AttemptConfig(devConfigIndex, parent, port, lowspeed);</div>
<div class="line"><a name="l00697"></a><span class="lineno"> 697</span>&#160; <span class="keywordflow">break</span>;</div>
<div class="line"><a name="l00698"></a><span class="lineno"> 698</span>&#160; } <span class="keywordflow">else</span> <span class="keywordflow">if</span> (devConfig[devConfigIndex]-&gt;DEVCLASSOK(klass)) {</div>
<div class="line"><a name="l00699"></a><span class="lineno"> 699</span>&#160; rcode = AttemptConfig(devConfigIndex, parent, port, lowspeed);</div>
<div class="line"><a name="l00700"></a><span class="lineno"> 700</span>&#160; <span class="keywordflow">if</span> (!rcode) <span class="keywordflow">break</span>;</div>
<div class="line"><a name="l00701"></a><span class="lineno"> 701</span>&#160; }</div>
<div class="line"><a name="l00702"></a><span class="lineno"> 702</span>&#160; }</div>
<div class="line"><a name="l00703"></a><span class="lineno"> 703</span>&#160;</div>
<div class="line"><a name="l00704"></a><span class="lineno"> 704</span>&#160; <span class="keywordflow">if</span> (devConfigIndex &lt; USB_NUMDEVICES) {</div>
<div class="line"><a name="l00705"></a><span class="lineno"> 705</span>&#160; <span class="keywordflow">return</span> rcode;</div>
<div class="line"><a name="l00706"></a><span class="lineno"> 706</span>&#160; }</div>
<div class="line"><a name="l00707"></a><span class="lineno"> 707</span>&#160;</div>
<div class="line"><a name="l00708"></a><span class="lineno"> 708</span>&#160;</div>
<div class="line"><a name="l00709"></a><span class="lineno"> 709</span>&#160; <span class="comment">// blindly attempt to configure</span></div>
<div class="line"><a name="l00710"></a><span class="lineno"> 710</span>&#160; <span class="keywordflow">for</span> (devConfigIndex = 0; devConfigIndex &lt; <a class="code" href="_usb_8h.html#a0282f9f7a0313f957e02449d7313b7b5">USB_NUMDEVICES</a>; devConfigIndex++) {</div>
<div class="line"><a name="l00711"></a><span class="lineno"> 711</span>&#160; <span class="keywordflow">if</span> (!devConfig[devConfigIndex]) <span class="keywordflow">continue</span>;</div>
<div class="line"><a name="l00712"></a><span class="lineno"> 712</span>&#160; <span class="keywordflow">if</span> (devConfig[devConfigIndex]-&gt;GetAddress()) <span class="keywordflow">continue</span>; <span class="comment">// consumed</span></div>
<div class="line"><a name="l00713"></a><span class="lineno"> 713</span>&#160; rcode = AttemptConfig(devConfigIndex, parent, port, lowspeed);</div>
<div class="line"><a name="l00714"></a><span class="lineno"> 714</span>&#160;</div>
<div class="line"><a name="l00715"></a><span class="lineno"> 715</span>&#160; <span class="comment">//printf(&quot;ERROR ENUMERATING %2.2x\r\n&quot;, rcode);</span></div>
<div class="line"><a name="l00716"></a><span class="lineno"> 716</span>&#160; <span class="keywordflow">if</span> (!(rcode == <a class="code" href="_usb_8h.html#ae9e139d0fd29bb0b3e7afad2f76cd589">USB_DEV_CONFIG_ERROR_DEVICE_NOT_SUPPORTED</a> || rcode == <a class="code" href="_usb_8h.html#a44416ff64fc0e3691f98addac13d4595">USB_ERROR_CLASS_INSTANCE_ALREADY_IN_USE</a>)) {</div>
<div class="line"><a name="l00717"></a><span class="lineno"> 717</span>&#160; <span class="comment">// in case of an error dev_index should be reset to 0</span></div>
<div class="line"><a name="l00718"></a><span class="lineno"> 718</span>&#160; <span class="comment">// in order to start from the very beginning the</span></div>
<div class="line"><a name="l00719"></a><span class="lineno"> 719</span>&#160; <span class="comment">// next time the program gets here</span></div>
<div class="line"><a name="l00720"></a><span class="lineno"> 720</span>&#160; <span class="comment">//if (rcode != USB_DEV_CONFIG_ERROR_DEVICE_INIT_INCOMPLETE)</span></div>
<div class="line"><a name="l00721"></a><span class="lineno"> 721</span>&#160; <span class="comment">// devConfigIndex = 0;</span></div>
<div class="line"><a name="l00722"></a><span class="lineno"> 722</span>&#160; <span class="keywordflow">return</span> rcode;</div>
<div class="line"><a name="l00697"></a><span class="lineno"> 697</span>&#160; <span class="keywordflow">if</span> (rcode != <a class="code" href="_usb_8h.html#ae9e139d0fd29bb0b3e7afad2f76cd589">USB_DEV_CONFIG_ERROR_DEVICE_NOT_SUPPORTED</a>)</div>
<div class="line"><a name="l00698"></a><span class="lineno"> 698</span>&#160; <span class="keywordflow">break</span>;</div>
<div class="line"><a name="l00699"></a><span class="lineno"> 699</span>&#160; }</div>
<div class="line"><a name="l00700"></a><span class="lineno"> 700</span>&#160; }</div>
<div class="line"><a name="l00701"></a><span class="lineno"> 701</span>&#160;</div>
<div class="line"><a name="l00702"></a><span class="lineno"> 702</span>&#160; <span class="keywordflow">if</span> (devConfigIndex &lt; USB_NUMDEVICES) {</div>
<div class="line"><a name="l00703"></a><span class="lineno"> 703</span>&#160; <span class="keywordflow">return</span> rcode;</div>
<div class="line"><a name="l00704"></a><span class="lineno"> 704</span>&#160; }</div>
<div class="line"><a name="l00705"></a><span class="lineno"> 705</span>&#160;</div>
<div class="line"><a name="l00706"></a><span class="lineno"> 706</span>&#160;</div>
<div class="line"><a name="l00707"></a><span class="lineno"> 707</span>&#160; <span class="comment">// blindly attempt to configure</span></div>
<div class="line"><a name="l00708"></a><span class="lineno"> 708</span>&#160; <span class="keywordflow">for</span> (devConfigIndex = 0; devConfigIndex &lt; <a class="code" href="_usb_8h.html#a0282f9f7a0313f957e02449d7313b7b5">USB_NUMDEVICES</a>; devConfigIndex++) {</div>
<div class="line"><a name="l00709"></a><span class="lineno"> 709</span>&#160; <span class="keywordflow">if</span> (!devConfig[devConfigIndex]) <span class="keywordflow">continue</span>;</div>
<div class="line"><a name="l00710"></a><span class="lineno"> 710</span>&#160; <span class="keywordflow">if</span> (devConfig[devConfigIndex]-&gt;GetAddress()) <span class="keywordflow">continue</span>; <span class="comment">// consumed</span></div>
<div class="line"><a name="l00711"></a><span class="lineno"> 711</span>&#160; <span class="keywordflow">if</span> (devConfig[devConfigIndex]-&gt;VIDPIDOK(vid, pid) || devConfig[devConfigIndex]-&gt;DEVCLASSOK(klass)) <span class="keywordflow">continue</span>; <span class="comment">// If this is true it means it must have returned USB_DEV_CONFIG_ERROR_DEVICE_NOT_SUPPORTED above</span></div>
<div class="line"><a name="l00712"></a><span class="lineno"> 712</span>&#160; rcode = AttemptConfig(devConfigIndex, parent, port, lowspeed);</div>
<div class="line"><a name="l00713"></a><span class="lineno"> 713</span>&#160;</div>
<div class="line"><a name="l00714"></a><span class="lineno"> 714</span>&#160; <span class="comment">//printf(&quot;ERROR ENUMERATING %2.2x\r\n&quot;, rcode);</span></div>
<div class="line"><a name="l00715"></a><span class="lineno"> 715</span>&#160; <span class="keywordflow">if</span> (!(rcode == <a class="code" href="_usb_8h.html#ae9e139d0fd29bb0b3e7afad2f76cd589">USB_DEV_CONFIG_ERROR_DEVICE_NOT_SUPPORTED</a> || rcode == <a class="code" href="_usb_8h.html#a44416ff64fc0e3691f98addac13d4595">USB_ERROR_CLASS_INSTANCE_ALREADY_IN_USE</a>)) {</div>
<div class="line"><a name="l00716"></a><span class="lineno"> 716</span>&#160; <span class="comment">// in case of an error dev_index should be reset to 0</span></div>
<div class="line"><a name="l00717"></a><span class="lineno"> 717</span>&#160; <span class="comment">// in order to start from the very beginning the</span></div>
<div class="line"><a name="l00718"></a><span class="lineno"> 718</span>&#160; <span class="comment">// next time the program gets here</span></div>
<div class="line"><a name="l00719"></a><span class="lineno"> 719</span>&#160; <span class="comment">//if (rcode != USB_DEV_CONFIG_ERROR_DEVICE_INIT_INCOMPLETE)</span></div>
<div class="line"><a name="l00720"></a><span class="lineno"> 720</span>&#160; <span class="comment">// devConfigIndex = 0;</span></div>
<div class="line"><a name="l00721"></a><span class="lineno"> 721</span>&#160; <span class="keywordflow">return</span> rcode;</div>
<div class="line"><a name="l00722"></a><span class="lineno"> 722</span>&#160; }</div>
<div class="line"><a name="l00723"></a><span class="lineno"> 723</span>&#160; }</div>
<div class="line"><a name="l00724"></a><span class="lineno"> 724</span>&#160; }</div>
<div class="line"><a name="l00725"></a><span class="lineno"> 725</span>&#160; <span class="comment">// if we get here that means that the device class is not supported by any of registered classes</span></div>
<div class="line"><a name="l00726"></a><span class="lineno"> 726</span>&#160; rcode = <a class="code" href="class_u_s_b.html#a5eb0d31372d26f0015a0d7be0b9ff4e1">DefaultAddressing</a>(parent, port, lowspeed);</div>
<div class="line"><a name="l00727"></a><span class="lineno"> 727</span>&#160;</div>
<div class="line"><a name="l00728"></a><span class="lineno"> 728</span>&#160; <span class="keywordflow">return</span> rcode;</div>
<div class="line"><a name="l00729"></a><span class="lineno"> 729</span>&#160;}</div>
<div class="line"><a name="l00730"></a><span class="lineno"> 730</span>&#160;</div>
<div class="line"><a name="l00731"></a><span class="lineno"><a class="code" href="class_u_s_b.html#ac681c6c98e1641f705bc14d670a2663a"> 731</a></span>&#160;uint8_t <a class="code" href="class_u_s_b.html#ac681c6c98e1641f705bc14d670a2663a">USB::ReleaseDevice</a>(uint8_t addr) {</div>
<div class="line"><a name="l00732"></a><span class="lineno"> 732</span>&#160; <span class="keywordflow">if</span> (!addr)</div>
<div class="line"><a name="l00733"></a><span class="lineno"> 733</span>&#160; <span class="keywordflow">return</span> 0;</div>
<div class="line"><a name="l00734"></a><span class="lineno"> 734</span>&#160;</div>
<div class="line"><a name="l00735"></a><span class="lineno"> 735</span>&#160; <span class="keywordflow">for</span> (uint8_t i = 0; i &lt; <a class="code" href="_usb_8h.html#a0282f9f7a0313f957e02449d7313b7b5">USB_NUMDEVICES</a>; i++) {</div>
<div class="line"><a name="l00736"></a><span class="lineno"> 736</span>&#160; <span class="keywordflow">if</span>(!devConfig[i]) <span class="keywordflow">continue</span>;</div>
<div class="line"><a name="l00737"></a><span class="lineno"> 737</span>&#160; <span class="keywordflow">if</span> (devConfig[i]-&gt;GetAddress() == addr)</div>
<div class="line"><a name="l00738"></a><span class="lineno"> 738</span>&#160; <span class="keywordflow">return</span> devConfig[i]-&gt;<a class="code" href="class_u_s_b_device_config.html#a61e301efedae55c6ac12c6cce154e432">Release</a>();</div>
<div class="line"><a name="l00739"></a><span class="lineno"> 739</span>&#160; }</div>
<div class="line"><a name="l00740"></a><span class="lineno"> 740</span>&#160; <span class="keywordflow">return</span> 0;</div>
<div class="line"><a name="l00741"></a><span class="lineno"> 741</span>&#160;}</div>
<div class="line"><a name="l00742"></a><span class="lineno"> 742</span>&#160;</div>
<div class="line"><a name="l00743"></a><span class="lineno"> 743</span>&#160;<span class="preprocessor">#if 1 </span></div>
<div class="line"><a name="l00744"></a><span class="lineno"> 744</span>&#160;<span class="preprocessor">//get device descriptor</span></div>
<div class="line"><a name="l00745"></a><span class="lineno"> 745</span>&#160;<span class="preprocessor"></span></div>
<div class="line"><a name="l00746"></a><span class="lineno"><a class="code" href="class_u_s_b.html#a193e63c149fad46adabd77ceb09b2b24"> 746</a></span>&#160;uint8_t <a class="code" href="class_u_s_b.html#a193e63c149fad46adabd77ceb09b2b24" title="defined(USB_METHODS_INLINE) ">USB::getDevDescr</a>(uint8_t addr, uint8_t ep, uint16_t nbytes, uint8_t* dataptr) {</div>
<div class="line"><a name="l00747"></a><span class="lineno"> 747</span>&#160; <span class="keywordflow">return</span> ( <a class="code" href="class_u_s_b.html#a636695a5c3d35cd6b9e31c54edfacd7c">ctrlReq</a>(addr, ep, <a class="code" href="_usb_8h.html#a060f3a6423f1e3640aa7b14d5ce72285">bmREQ_GET_DESCR</a>, <a class="code" href="usb__ch9_8h.html#a3572226ee2137c7fbf7487a02b0f560f">USB_REQUEST_GET_DESCRIPTOR</a>, 0x00, <a class="code" href="usb__ch9_8h.html#ac6d0566773ed4549fe1a7a932e6c46de">USB_DESCRIPTOR_DEVICE</a>, 0x0000, nbytes, nbytes, dataptr, NULL));</div>
<div class="line"><a name="l00748"></a><span class="lineno"> 748</span>&#160;}</div>
<div class="line"><a name="l00749"></a><span class="lineno"> 749</span>&#160;<span class="comment">//get configuration descriptor</span></div>
<div class="line"><a name="l00750"></a><span class="lineno"> 750</span>&#160;</div>
<div class="line"><a name="l00751"></a><span class="lineno"><a class="code" href="class_u_s_b.html#a618eedabc161d8315be45cae0c8b6f89"> 751</a></span>&#160;uint8_t <a class="code" href="class_u_s_b.html#a618eedabc161d8315be45cae0c8b6f89">USB::getConfDescr</a>(uint8_t addr, uint8_t ep, uint16_t nbytes, uint8_t conf, uint8_t* dataptr) {</div>
<div class="line"><a name="l00752"></a><span class="lineno"> 752</span>&#160; <span class="keywordflow">return</span> ( <a class="code" href="class_u_s_b.html#a636695a5c3d35cd6b9e31c54edfacd7c">ctrlReq</a>(addr, ep, <a class="code" href="_usb_8h.html#a060f3a6423f1e3640aa7b14d5ce72285">bmREQ_GET_DESCR</a>, <a class="code" href="usb__ch9_8h.html#a3572226ee2137c7fbf7487a02b0f560f">USB_REQUEST_GET_DESCRIPTOR</a>, conf, <a class="code" href="usb__ch9_8h.html#aa17b365c4eb8bd2f6a4d4e4fb5f881c7">USB_DESCRIPTOR_CONFIGURATION</a>, 0x0000, nbytes, nbytes, dataptr, NULL));</div>
<div class="line"><a name="l00753"></a><span class="lineno"> 753</span>&#160;}</div>
<div class="line"><a name="l00754"></a><span class="lineno"> 754</span>&#160;</div>
<div class="line"><a name="l00755"></a><span class="lineno"><a class="code" href="class_u_s_b.html#a9ebd4acdc37b12bbab2ca893cb899eba"> 755</a></span>&#160;uint8_t <a class="code" href="class_u_s_b.html#a618eedabc161d8315be45cae0c8b6f89">USB::getConfDescr</a>(uint8_t addr, uint8_t ep, uint8_t conf, <a class="code" href="class_u_s_b_read_parser.html">USBReadParser</a> *p) {</div>
<div class="line"><a name="l00756"></a><span class="lineno"> 756</span>&#160; <span class="keyword">const</span> uint8_t bufSize = 64;</div>
<div class="line"><a name="l00757"></a><span class="lineno"> 757</span>&#160; uint8_t buf[bufSize];</div>
<div class="line"><a name="l00758"></a><span class="lineno"> 758</span>&#160;</div>
<div class="line"><a name="l00759"></a><span class="lineno"> 759</span>&#160; uint8_t ret = <a class="code" href="class_u_s_b.html#a618eedabc161d8315be45cae0c8b6f89">getConfDescr</a>(addr, ep, 8, conf, buf);</div>
<div class="line"><a name="l00760"></a><span class="lineno"> 760</span>&#160;</div>
<div class="line"><a name="l00761"></a><span class="lineno"> 761</span>&#160; <span class="keywordflow">if</span> (ret)</div>
<div class="line"><a name="l00762"></a><span class="lineno"> 762</span>&#160; <span class="keywordflow">return</span> ret;</div>
<div class="line"><a name="l00763"></a><span class="lineno"> 763</span>&#160;</div>
<div class="line"><a name="l00764"></a><span class="lineno"> 764</span>&#160; uint16_t total = ((<a class="code" href="struct_u_s_b___c_o_n_f_i_g_u_r_a_t_i_o_n___d_e_s_c_r_i_p_t_o_r.html">USB_CONFIGURATION_DESCRIPTOR</a>*)buf)-&gt;wTotalLength;</div>
<div class="line"><a name="l00765"></a><span class="lineno"> 765</span>&#160;</div>
<div class="line"><a name="l00766"></a><span class="lineno"> 766</span>&#160; <span class="comment">//USBTRACE2(&quot;\r\ntotal conf.size:&quot;, total);</span></div>
<div class="line"><a name="l00767"></a><span class="lineno"> 767</span>&#160;</div>
<div class="line"><a name="l00768"></a><span class="lineno"> 768</span>&#160; <span class="keywordflow">return</span> ( <a class="code" href="class_u_s_b.html#a636695a5c3d35cd6b9e31c54edfacd7c">ctrlReq</a>(addr, ep, <a class="code" href="_usb_8h.html#a060f3a6423f1e3640aa7b14d5ce72285">bmREQ_GET_DESCR</a>, <a class="code" href="usb__ch9_8h.html#a3572226ee2137c7fbf7487a02b0f560f">USB_REQUEST_GET_DESCRIPTOR</a>, conf, <a class="code" href="usb__ch9_8h.html#aa17b365c4eb8bd2f6a4d4e4fb5f881c7">USB_DESCRIPTOR_CONFIGURATION</a>, 0x0000, total, bufSize, buf, p));</div>
<div class="line"><a name="l00769"></a><span class="lineno"> 769</span>&#160;}</div>
<div class="line"><a name="l00770"></a><span class="lineno"> 770</span>&#160;</div>
<div class="line"><a name="l00771"></a><span class="lineno"> 771</span>&#160;<span class="comment">//get string descriptor</span></div>
<div class="line"><a name="l00772"></a><span class="lineno"> 772</span>&#160;</div>
<div class="line"><a name="l00773"></a><span class="lineno"><a class="code" href="class_u_s_b.html#a372ecbe1d23955e8b04b5e95e0e4a833"> 773</a></span>&#160;uint8_t <a class="code" href="class_u_s_b.html#a372ecbe1d23955e8b04b5e95e0e4a833">USB::getStrDescr</a>(uint8_t addr, uint8_t ep, uint16_t ns, uint8_t index, uint16_t langid, uint8_t* dataptr) {</div>
<div class="line"><a name="l00774"></a><span class="lineno"> 774</span>&#160; <span class="keywordflow">return</span> ( <a class="code" href="class_u_s_b.html#a636695a5c3d35cd6b9e31c54edfacd7c">ctrlReq</a>(addr, ep, <a class="code" href="_usb_8h.html#a060f3a6423f1e3640aa7b14d5ce72285">bmREQ_GET_DESCR</a>, <a class="code" href="usb__ch9_8h.html#a3572226ee2137c7fbf7487a02b0f560f">USB_REQUEST_GET_DESCRIPTOR</a>, index, <a class="code" href="usb__ch9_8h.html#abbad38caa1ca9c52f47adccd3a850aed">USB_DESCRIPTOR_STRING</a>, langid, ns, ns, dataptr, NULL));</div>
<div class="line"><a name="l00775"></a><span class="lineno"> 775</span>&#160;}</div>
<div class="line"><a name="l00776"></a><span class="lineno"> 776</span>&#160;<span class="comment">//set address</span></div>
<div class="line"><a name="l00777"></a><span class="lineno"> 777</span>&#160;</div>
<div class="line"><a name="l00778"></a><span class="lineno"><a class="code" href="class_u_s_b.html#a3aea534daed66b5606fa798df7ad3c47"> 778</a></span>&#160;uint8_t <a class="code" href="class_u_s_b.html#a3aea534daed66b5606fa798df7ad3c47">USB::setAddr</a>(uint8_t oldaddr, uint8_t ep, uint8_t newaddr) {</div>
<div class="line"><a name="l00779"></a><span class="lineno"> 779</span>&#160; <span class="keywordflow">return</span> ( <a class="code" href="class_u_s_b.html#a636695a5c3d35cd6b9e31c54edfacd7c">ctrlReq</a>(oldaddr, ep, <a class="code" href="_usb_8h.html#af4965e768593007eacde7644979f56da">bmREQ_SET</a>, <a class="code" href="usb__ch9_8h.html#ac87659819bfd6491120c819fae2d46bc">USB_REQUEST_SET_ADDRESS</a>, newaddr, 0x00, 0x0000, 0x0000, 0x0000, NULL, NULL));</div>
<div class="line"><a name="l00780"></a><span class="lineno"> 780</span>&#160;}</div>
<div class="line"><a name="l00781"></a><span class="lineno"> 781</span>&#160;<span class="comment">//set configuration</span></div>
<div class="line"><a name="l00782"></a><span class="lineno"> 782</span>&#160;</div>
<div class="line"><a name="l00783"></a><span class="lineno"><a class="code" href="class_u_s_b.html#a31e2c132ec32ffdde94dff72be87c378"> 783</a></span>&#160;uint8_t <a class="code" href="class_u_s_b.html#a31e2c132ec32ffdde94dff72be87c378">USB::setConf</a>(uint8_t addr, uint8_t ep, uint8_t conf_value) {</div>
<div class="line"><a name="l00784"></a><span class="lineno"> 784</span>&#160; <span class="keywordflow">return</span> ( <a class="code" href="class_u_s_b.html#a636695a5c3d35cd6b9e31c54edfacd7c">ctrlReq</a>(addr, ep, <a class="code" href="_usb_8h.html#af4965e768593007eacde7644979f56da">bmREQ_SET</a>, <a class="code" href="usb__ch9_8h.html#aadef005acc40340955d34d9767ef297c">USB_REQUEST_SET_CONFIGURATION</a>, conf_value, 0x00, 0x0000, 0x0000, 0x0000, NULL, NULL));</div>
<div class="line"><a name="l00785"></a><span class="lineno"> 785</span>&#160;}</div>
<div class="line"><a name="l00786"></a><span class="lineno"> 786</span>&#160;</div>
<div class="line"><a name="l00787"></a><span class="lineno"> 787</span>&#160;<span class="preprocessor">#endif // defined(USB_METHODS_INLINE)</span></div>
<div class="line"><a name="l00788"></a><span class="lineno"> 788</span>&#160;<span class="preprocessor"></span></div>
<div class="line"><a name="l00724"></a><span class="lineno"> 724</span>&#160; <span class="comment">// if we get here that means that the device class is not supported by any of registered classes</span></div>
<div class="line"><a name="l00725"></a><span class="lineno"> 725</span>&#160; rcode = <a class="code" href="class_u_s_b.html#a5eb0d31372d26f0015a0d7be0b9ff4e1">DefaultAddressing</a>(parent, port, lowspeed);</div>
<div class="line"><a name="l00726"></a><span class="lineno"> 726</span>&#160;</div>
<div class="line"><a name="l00727"></a><span class="lineno"> 727</span>&#160; <span class="keywordflow">return</span> rcode;</div>
<div class="line"><a name="l00728"></a><span class="lineno"> 728</span>&#160;}</div>
<div class="line"><a name="l00729"></a><span class="lineno"> 729</span>&#160;</div>
<div class="line"><a name="l00730"></a><span class="lineno"><a class="code" href="class_u_s_b.html#ac681c6c98e1641f705bc14d670a2663a"> 730</a></span>&#160;uint8_t <a class="code" href="class_u_s_b.html#ac681c6c98e1641f705bc14d670a2663a">USB::ReleaseDevice</a>(uint8_t addr) {</div>
<div class="line"><a name="l00731"></a><span class="lineno"> 731</span>&#160; <span class="keywordflow">if</span> (!addr)</div>
<div class="line"><a name="l00732"></a><span class="lineno"> 732</span>&#160; <span class="keywordflow">return</span> 0;</div>
<div class="line"><a name="l00733"></a><span class="lineno"> 733</span>&#160;</div>
<div class="line"><a name="l00734"></a><span class="lineno"> 734</span>&#160; <span class="keywordflow">for</span> (uint8_t i = 0; i &lt; <a class="code" href="_usb_8h.html#a0282f9f7a0313f957e02449d7313b7b5">USB_NUMDEVICES</a>; i++) {</div>
<div class="line"><a name="l00735"></a><span class="lineno"> 735</span>&#160; <span class="keywordflow">if</span>(!devConfig[i]) <span class="keywordflow">continue</span>;</div>
<div class="line"><a name="l00736"></a><span class="lineno"> 736</span>&#160; <span class="keywordflow">if</span> (devConfig[i]-&gt;GetAddress() == addr)</div>
<div class="line"><a name="l00737"></a><span class="lineno"> 737</span>&#160; <span class="keywordflow">return</span> devConfig[i]-&gt;<a class="code" href="class_u_s_b_device_config.html#a61e301efedae55c6ac12c6cce154e432">Release</a>();</div>
<div class="line"><a name="l00738"></a><span class="lineno"> 738</span>&#160; }</div>
<div class="line"><a name="l00739"></a><span class="lineno"> 739</span>&#160; <span class="keywordflow">return</span> 0;</div>
<div class="line"><a name="l00740"></a><span class="lineno"> 740</span>&#160;}</div>
<div class="line"><a name="l00741"></a><span class="lineno"> 741</span>&#160;</div>
<div class="line"><a name="l00742"></a><span class="lineno"> 742</span>&#160;<span class="preprocessor">#if 1 </span></div>
<div class="line"><a name="l00743"></a><span class="lineno"> 743</span>&#160;<span class="preprocessor">//get device descriptor</span></div>
<div class="line"><a name="l00744"></a><span class="lineno"> 744</span>&#160;<span class="preprocessor"></span></div>
<div class="line"><a name="l00745"></a><span class="lineno"><a class="code" href="class_u_s_b.html#a193e63c149fad46adabd77ceb09b2b24"> 745</a></span>&#160;uint8_t <a class="code" href="class_u_s_b.html#a193e63c149fad46adabd77ceb09b2b24" title="defined(USB_METHODS_INLINE) ">USB::getDevDescr</a>(uint8_t addr, uint8_t ep, uint16_t nbytes, uint8_t* dataptr) {</div>
<div class="line"><a name="l00746"></a><span class="lineno"> 746</span>&#160; <span class="keywordflow">return</span> ( <a class="code" href="class_u_s_b.html#a636695a5c3d35cd6b9e31c54edfacd7c">ctrlReq</a>(addr, ep, <a class="code" href="_usb_8h.html#a060f3a6423f1e3640aa7b14d5ce72285">bmREQ_GET_DESCR</a>, <a class="code" href="usb__ch9_8h.html#a3572226ee2137c7fbf7487a02b0f560f">USB_REQUEST_GET_DESCRIPTOR</a>, 0x00, <a class="code" href="usb__ch9_8h.html#ac6d0566773ed4549fe1a7a932e6c46de">USB_DESCRIPTOR_DEVICE</a>, 0x0000, nbytes, nbytes, dataptr, NULL));</div>
<div class="line"><a name="l00747"></a><span class="lineno"> 747</span>&#160;}</div>
<div class="line"><a name="l00748"></a><span class="lineno"> 748</span>&#160;<span class="comment">//get configuration descriptor</span></div>
<div class="line"><a name="l00749"></a><span class="lineno"> 749</span>&#160;</div>
<div class="line"><a name="l00750"></a><span class="lineno"><a class="code" href="class_u_s_b.html#a618eedabc161d8315be45cae0c8b6f89"> 750</a></span>&#160;uint8_t <a class="code" href="class_u_s_b.html#a618eedabc161d8315be45cae0c8b6f89">USB::getConfDescr</a>(uint8_t addr, uint8_t ep, uint16_t nbytes, uint8_t conf, uint8_t* dataptr) {</div>
<div class="line"><a name="l00751"></a><span class="lineno"> 751</span>&#160; <span class="keywordflow">return</span> ( <a class="code" href="class_u_s_b.html#a636695a5c3d35cd6b9e31c54edfacd7c">ctrlReq</a>(addr, ep, <a class="code" href="_usb_8h.html#a060f3a6423f1e3640aa7b14d5ce72285">bmREQ_GET_DESCR</a>, <a class="code" href="usb__ch9_8h.html#a3572226ee2137c7fbf7487a02b0f560f">USB_REQUEST_GET_DESCRIPTOR</a>, conf, <a class="code" href="usb__ch9_8h.html#aa17b365c4eb8bd2f6a4d4e4fb5f881c7">USB_DESCRIPTOR_CONFIGURATION</a>, 0x0000, nbytes, nbytes, dataptr, NULL));</div>
<div class="line"><a name="l00752"></a><span class="lineno"> 752</span>&#160;}</div>
<div class="line"><a name="l00753"></a><span class="lineno"> 753</span>&#160;</div>
<div class="line"><a name="l00754"></a><span class="lineno"><a class="code" href="class_u_s_b.html#a9ebd4acdc37b12bbab2ca893cb899eba"> 754</a></span>&#160;uint8_t <a class="code" href="class_u_s_b.html#a618eedabc161d8315be45cae0c8b6f89">USB::getConfDescr</a>(uint8_t addr, uint8_t ep, uint8_t conf, <a class="code" href="class_u_s_b_read_parser.html">USBReadParser</a> *p) {</div>
<div class="line"><a name="l00755"></a><span class="lineno"> 755</span>&#160; <span class="keyword">const</span> uint8_t bufSize = 64;</div>
<div class="line"><a name="l00756"></a><span class="lineno"> 756</span>&#160; uint8_t buf[bufSize];</div>
<div class="line"><a name="l00757"></a><span class="lineno"> 757</span>&#160;</div>
<div class="line"><a name="l00758"></a><span class="lineno"> 758</span>&#160; uint8_t ret = <a class="code" href="class_u_s_b.html#a618eedabc161d8315be45cae0c8b6f89">getConfDescr</a>(addr, ep, 8, conf, buf);</div>
<div class="line"><a name="l00759"></a><span class="lineno"> 759</span>&#160;</div>
<div class="line"><a name="l00760"></a><span class="lineno"> 760</span>&#160; <span class="keywordflow">if</span> (ret)</div>
<div class="line"><a name="l00761"></a><span class="lineno"> 761</span>&#160; <span class="keywordflow">return</span> ret;</div>
<div class="line"><a name="l00762"></a><span class="lineno"> 762</span>&#160;</div>
<div class="line"><a name="l00763"></a><span class="lineno"> 763</span>&#160; uint16_t total = ((<a class="code" href="struct_u_s_b___c_o_n_f_i_g_u_r_a_t_i_o_n___d_e_s_c_r_i_p_t_o_r.html">USB_CONFIGURATION_DESCRIPTOR</a>*)buf)-&gt;wTotalLength;</div>
<div class="line"><a name="l00764"></a><span class="lineno"> 764</span>&#160;</div>
<div class="line"><a name="l00765"></a><span class="lineno"> 765</span>&#160; <span class="comment">//USBTRACE2(&quot;\r\ntotal conf.size:&quot;, total);</span></div>
<div class="line"><a name="l00766"></a><span class="lineno"> 766</span>&#160;</div>
<div class="line"><a name="l00767"></a><span class="lineno"> 767</span>&#160; <span class="keywordflow">return</span> ( <a class="code" href="class_u_s_b.html#a636695a5c3d35cd6b9e31c54edfacd7c">ctrlReq</a>(addr, ep, <a class="code" href="_usb_8h.html#a060f3a6423f1e3640aa7b14d5ce72285">bmREQ_GET_DESCR</a>, <a class="code" href="usb__ch9_8h.html#a3572226ee2137c7fbf7487a02b0f560f">USB_REQUEST_GET_DESCRIPTOR</a>, conf, <a class="code" href="usb__ch9_8h.html#aa17b365c4eb8bd2f6a4d4e4fb5f881c7">USB_DESCRIPTOR_CONFIGURATION</a>, 0x0000, total, bufSize, buf, p));</div>
<div class="line"><a name="l00768"></a><span class="lineno"> 768</span>&#160;}</div>
<div class="line"><a name="l00769"></a><span class="lineno"> 769</span>&#160;</div>
<div class="line"><a name="l00770"></a><span class="lineno"> 770</span>&#160;<span class="comment">//get string descriptor</span></div>
<div class="line"><a name="l00771"></a><span class="lineno"> 771</span>&#160;</div>
<div class="line"><a name="l00772"></a><span class="lineno"><a class="code" href="class_u_s_b.html#a372ecbe1d23955e8b04b5e95e0e4a833"> 772</a></span>&#160;uint8_t <a class="code" href="class_u_s_b.html#a372ecbe1d23955e8b04b5e95e0e4a833">USB::getStrDescr</a>(uint8_t addr, uint8_t ep, uint16_t ns, uint8_t index, uint16_t langid, uint8_t* dataptr) {</div>
<div class="line"><a name="l00773"></a><span class="lineno"> 773</span>&#160; <span class="keywordflow">return</span> ( <a class="code" href="class_u_s_b.html#a636695a5c3d35cd6b9e31c54edfacd7c">ctrlReq</a>(addr, ep, <a class="code" href="_usb_8h.html#a060f3a6423f1e3640aa7b14d5ce72285">bmREQ_GET_DESCR</a>, <a class="code" href="usb__ch9_8h.html#a3572226ee2137c7fbf7487a02b0f560f">USB_REQUEST_GET_DESCRIPTOR</a>, index, <a class="code" href="usb__ch9_8h.html#abbad38caa1ca9c52f47adccd3a850aed">USB_DESCRIPTOR_STRING</a>, langid, ns, ns, dataptr, NULL));</div>
<div class="line"><a name="l00774"></a><span class="lineno"> 774</span>&#160;}</div>
<div class="line"><a name="l00775"></a><span class="lineno"> 775</span>&#160;<span class="comment">//set address</span></div>
<div class="line"><a name="l00776"></a><span class="lineno"> 776</span>&#160;</div>
<div class="line"><a name="l00777"></a><span class="lineno"><a class="code" href="class_u_s_b.html#a3aea534daed66b5606fa798df7ad3c47"> 777</a></span>&#160;uint8_t <a class="code" href="class_u_s_b.html#a3aea534daed66b5606fa798df7ad3c47">USB::setAddr</a>(uint8_t oldaddr, uint8_t ep, uint8_t newaddr) {</div>
<div class="line"><a name="l00778"></a><span class="lineno"> 778</span>&#160; <span class="keywordflow">return</span> ( <a class="code" href="class_u_s_b.html#a636695a5c3d35cd6b9e31c54edfacd7c">ctrlReq</a>(oldaddr, ep, <a class="code" href="_usb_8h.html#af4965e768593007eacde7644979f56da">bmREQ_SET</a>, <a class="code" href="usb__ch9_8h.html#ac87659819bfd6491120c819fae2d46bc">USB_REQUEST_SET_ADDRESS</a>, newaddr, 0x00, 0x0000, 0x0000, 0x0000, NULL, NULL));</div>
<div class="line"><a name="l00779"></a><span class="lineno"> 779</span>&#160;}</div>
<div class="line"><a name="l00780"></a><span class="lineno"> 780</span>&#160;<span class="comment">//set configuration</span></div>
<div class="line"><a name="l00781"></a><span class="lineno"> 781</span>&#160;</div>
<div class="line"><a name="l00782"></a><span class="lineno"><a class="code" href="class_u_s_b.html#a31e2c132ec32ffdde94dff72be87c378"> 782</a></span>&#160;uint8_t <a class="code" href="class_u_s_b.html#a31e2c132ec32ffdde94dff72be87c378">USB::setConf</a>(uint8_t addr, uint8_t ep, uint8_t conf_value) {</div>
<div class="line"><a name="l00783"></a><span class="lineno"> 783</span>&#160; <span class="keywordflow">return</span> ( <a class="code" href="class_u_s_b.html#a636695a5c3d35cd6b9e31c54edfacd7c">ctrlReq</a>(addr, ep, <a class="code" href="_usb_8h.html#af4965e768593007eacde7644979f56da">bmREQ_SET</a>, <a class="code" href="usb__ch9_8h.html#aadef005acc40340955d34d9767ef297c">USB_REQUEST_SET_CONFIGURATION</a>, conf_value, 0x00, 0x0000, 0x0000, 0x0000, NULL, NULL));</div>
<div class="line"><a name="l00784"></a><span class="lineno"> 784</span>&#160;}</div>
<div class="line"><a name="l00785"></a><span class="lineno"> 785</span>&#160;</div>
<div class="line"><a name="l00786"></a><span class="lineno"> 786</span>&#160;<span class="preprocessor">#endif // defined(USB_METHODS_INLINE)</span></div>
<div class="line"><a name="l00787"></a><span class="lineno"> 787</span>&#160;<span class="preprocessor"></span></div>
</div><!-- fragment --></div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>

View file

@ -107,14 +107,14 @@ Include dependency graph for Usb.h:</div>
<div class="dyncontent">
<div class="center"><img src="_usb_8h__incl.png" border="0" usemap="#_usb_8h" alt=""/></div>
<map name="_usb_8h" id="_usb_8h">
<area shape="rect" id="node4" href="avrpins_8h.html" title="avrpins.h" alt="" coords="5,144,59,165"/><area shape="rect" id="node6" href="max3421e_8h.html" title="max3421e.h" alt="" coords="236,144,303,165"/><area shape="rect" id="node7" href="usbhost_8h.html" title="usbhost.h" alt="" coords="145,75,201,96"/><area shape="rect" id="node8" href="usb__ch9_8h.html" title="usb_ch9.h" alt="" coords="153,144,212,165"/><area shape="rect" id="node10" href="address_8h.html" title="address.h" alt="" coords="329,75,385,96"/><area shape="rect" id="node13" href="message_8h.html" title="message.h" alt="" coords="569,75,631,96"/><area shape="rect" id="node15" href="printhex_8h.html" title="printhex.h" alt="" coords="555,213,612,235"/><area shape="rect" id="node16" href="hexdump_8h.html" title="hexdump.h" alt="" coords="604,144,665,165"/></map>
<area shape="rect" id="node4" href="avrpins_8h.html" title="avrpins.h" alt="" coords="5,144,59,165"/><area shape="rect" id="node6" href="max3421e_8h.html" title="max3421e.h" alt="" coords="287,144,353,165"/><area shape="rect" id="node7" href="usbhost_8h.html" title="usbhost.h" alt="" coords="175,75,232,96"/><area shape="rect" id="node9" href="usb__ch9_8h.html" title="usb_ch9.h" alt="" coords="204,144,263,165"/><area shape="rect" id="node11" href="address_8h.html" title="address.h" alt="" coords="361,75,417,96"/><area shape="rect" id="node13" href="message_8h.html" title="message.h" alt="" coords="655,75,716,96"/><area shape="rect" id="node15" href="printhex_8h.html" title="printhex.h" alt="" coords="749,213,805,235"/><area shape="rect" id="node16" href="hexdump_8h.html" title="hexdump.h" alt="" coords="655,144,716,165"/></map>
</div>
</div><div class="textblock"><div class="dynheader">
This graph shows which files directly or indirectly include this file:</div>
<div class="dyncontent">
<div class="center"><img src="_usb_8h__dep__incl.png" border="0" usemap="#_usb_8hdep" alt=""/></div>
<map name="_usb_8hdep" id="_usb_8hdep">
<area shape="rect" id="node2" href="adk_8h.html" title="adk.h" alt="" coords="81,75,121,96"/><area shape="rect" id="node4" href="_b_t_d_8h.html" title="BTD.h" alt="" coords="217,75,263,96"/><area shape="rect" id="node12" href="cdcacm_8h.html" title="cdcacm.h" alt="" coords="464,75,520,96"/><area shape="rect" id="node16" href="cdcftdi_8h.html" title="cdcftdi.h" alt="" coords="629,75,680,96"/><area shape="rect" id="node14" href="cdcprolific_8h.html" title="cdcprolific.h" alt="" coords="460,144,524,165"/><area shape="rect" id="node18" href="hid_8h.html" title="hid.h" alt="" coords="812,75,852,96"/><area shape="rect" id="node20" href="hidboot_8h.html" title="hidboot.h" alt="" coords="633,144,687,165"/><area shape="rect" id="node22" href="hidescriptorparser_8h.html" title="hidescriptorparser.h" alt="" coords="880,144,973,165"/><area shape="rect" id="node26" href="masstorage_8h.html" title="masstorage.h" alt="" coords="930,75,1000,96"/><area shape="rect" id="node28" href="max___l_c_d_8h.html" title="max_LCD.h" alt="" coords="1025,75,1089,96"/><area shape="rect" id="node30" href="_p_s3_u_s_b_8h.html" title="PS3USB.h" alt="" coords="1114,75,1173,96"/><area shape="rect" id="node32" href="_usb_8cpp.html" title="Usb.cpp" alt="" coords="1198,75,1249,96"/><area shape="rect" id="node33" href="usbhub_8h.html" title="usbhub.h" alt="" coords="1279,75,1333,96"/><area shape="rect" id="node35" href="_x_b_o_x_r_e_c_v_8h.html" title="XBOXRECV.h" alt="" coords="1369,75,1441,96"/><area shape="rect" id="node37" href="_x_b_o_x_u_s_b_8h.html" title="XBOXUSB.h" alt="" coords="1487,75,1555,96"/><area shape="rect" id="node3" href="adk_8cpp.html" title="adk.cpp" alt="" coords="5,144,56,165"/><area shape="rect" id="node5" href="_b_t_d_8cpp.html" title="BTD.cpp" alt="" coords="213,144,267,165"/><area shape="rect" id="node6" href="_p_s3_b_t_8h.html" title="PS3BT.h" alt="" coords="291,144,345,165"/><area shape="rect" id="node8" href="_s_p_p_8h.html" title="SPP.h" alt="" coords="80,144,125,165"/><area shape="rect" id="node10" href="_wii_8h.html" title="Wii.h" alt="" coords="149,144,189,165"/><area shape="rect" id="node7" href="_p_s3_b_t_8cpp.html" title="PS3BT.cpp" alt="" coords="287,213,349,235"/><area shape="rect" id="node9" href="_s_p_p_8cpp.html" title="SPP.cpp" alt="" coords="72,213,125,235"/><area shape="rect" id="node11" href="_wii_8cpp.html" title="Wii.cpp" alt="" coords="149,213,197,235"/><area shape="rect" id="node13" href="cdcacm_8cpp.html" title="cdcacm.cpp" alt="" coords="370,144,435,165"/><area shape="rect" id="node15" href="cdcprolific_8cpp.html" title="cdcprolific.cpp" alt="" coords="455,213,528,235"/><area shape="rect" id="node17" href="cdcftdi_8cpp.html" title="cdcftdi.cpp" alt="" coords="549,144,608,165"/><area shape="rect" id="node19" href="hid_8cpp.html" title="hid.cpp" alt="" coords="808,144,856,165"/><area shape="rect" id="node24" href="hiduniversal_8h.html" title="hiduniversal.h" alt="" coords="712,144,784,165"/><area shape="rect" id="node21" href="hidboot_8cpp.html" title="hidboot.cpp" alt="" coords="624,213,688,235"/><area shape="rect" id="node23" href="hidescriptorparser_8cpp.html" title="hidescriptorparser.cpp" alt="" coords="876,213,977,235"/><area shape="rect" id="node25" href="hiduniversal_8cpp.html" title="hiduniversal.cpp" alt="" coords="712,213,792,235"/><area shape="rect" id="node27" href="masstorage_8cpp.html" title="masstorage.cpp" alt="" coords="998,144,1076,165"/><area shape="rect" id="node29" href="max___l_c_d_8cpp.html" title="max_LCD.cpp" alt="" coords="1101,144,1173,165"/><area shape="rect" id="node31" href="_p_s3_u_s_b_8cpp.html" title="PS3USB.cpp" alt="" coords="1199,144,1268,165"/><area shape="rect" id="node34" href="usbhub_8cpp.html" title="usbhub.cpp" alt="" coords="1292,144,1356,165"/><area shape="rect" id="node36" href="_x_b_o_x_r_e_c_v_8cpp.html" title="XBOXRECV.cpp" alt="" coords="1381,144,1461,165"/><area shape="rect" id="node38" href="_x_b_o_x_u_s_b_8cpp.html" title="XBOXUSB.cpp" alt="" coords="1486,144,1561,165"/></map>
<area shape="rect" id="node2" href="adk_8h.html" title="adk.h" alt="" coords="86,75,127,96"/><area shape="rect" id="node4" href="_b_t_d_8h.html" title="BTD.h" alt="" coords="227,75,272,96"/><area shape="rect" id="node12" href="cdcacm_8h.html" title="cdcacm.h" alt="" coords="465,75,521,96"/><area shape="rect" id="node16" href="cdcftdi_8h.html" title="cdcftdi.h" alt="" coords="625,75,676,96"/><area shape="rect" id="node14" href="cdcprolific_8h.html" title="cdcprolific.h" alt="" coords="461,144,525,165"/><area shape="rect" id="node18" href="hid_8h.html" title="hid.h" alt="" coords="801,75,841,96"/><area shape="rect" id="node20" href="hidboot_8h.html" title="hidboot.h" alt="" coords="634,144,688,165"/><area shape="rect" id="node22" href="hidescriptorparser_8h.html" title="hidescriptorparser.h" alt="" coords="881,144,975,165"/><area shape="rect" id="node26" href="masstorage_8h.html" title="masstorage.h" alt="" coords="954,75,1024,96"/><area shape="rect" id="node28" href="max___l_c_d_8h.html" title="max_LCD.h" alt="" coords="1049,75,1113,96"/><area shape="rect" id="node30" href="_p_s3_u_s_b_8h.html" title="PS3USB.h" alt="" coords="1138,75,1197,96"/><area shape="rect" id="node32" href="_usb_8cpp.html" title="Usb.cpp" alt="" coords="1222,75,1273,96"/><area shape="rect" id="node33" href="usbhub_8h.html" title="usbhub.h" alt="" coords="1298,75,1352,96"/><area shape="rect" id="node35" href="_x_b_o_x_o_l_d_8h.html" title="XBOXOLD.h" alt="" coords="1379,75,1447,96"/><area shape="rect" id="node37" href="_x_b_o_x_r_e_c_v_8h.html" title="XBOXRECV.h" alt="" coords="1478,75,1551,96"/><area shape="rect" id="node39" href="_x_b_o_x_u_s_b_8h.html" title="XBOXUSB.h" alt="" coords="1587,75,1655,96"/><area shape="rect" id="node3" href="adk_8cpp.html" title="adk.cpp" alt="" coords="5,144,56,165"/><area shape="rect" id="node5" href="_b_t_d_8cpp.html" title="BTD.cpp" alt="" coords="144,144,197,165"/><area shape="rect" id="node6" href="_p_s3_b_t_8h.html" title="PS3BT.h" alt="" coords="222,144,276,165"/><area shape="rect" id="node8" href="_s_p_p_8h.html" title="SPP.h" alt="" coords="301,144,347,165"/><area shape="rect" id="node10" href="_wii_8h.html" title="Wii.h" alt="" coords="80,144,120,165"/><area shape="rect" id="node7" href="_p_s3_b_t_8cpp.html" title="PS3BT.cpp" alt="" coords="214,213,276,235"/><area shape="rect" id="node9" href="_s_p_p_8cpp.html" title="SPP.cpp" alt="" coords="301,213,355,235"/><area shape="rect" id="node11" href="_wii_8cpp.html" title="Wii.cpp" alt="" coords="76,213,124,235"/><area shape="rect" id="node13" href="cdcacm_8cpp.html" title="cdcacm.cpp" alt="" coords="371,144,436,165"/><area shape="rect" id="node15" href="cdcprolific_8cpp.html" title="cdcprolific.cpp" alt="" coords="457,213,529,235"/><area shape="rect" id="node17" href="cdcftdi_8cpp.html" title="cdcftdi.cpp" alt="" coords="550,144,609,165"/><area shape="rect" id="node19" href="hid_8cpp.html" title="hid.cpp" alt="" coords="713,144,761,165"/><area shape="rect" id="node24" href="hiduniversal_8h.html" title="hiduniversal.h" alt="" coords="785,144,857,165"/><area shape="rect" id="node21" href="hidboot_8cpp.html" title="hidboot.cpp" alt="" coords="629,213,693,235"/><area shape="rect" id="node23" href="hidescriptorparser_8cpp.html" title="hidescriptorparser.cpp" alt="" coords="881,213,983,235"/><area shape="rect" id="node25" href="hiduniversal_8cpp.html" title="hiduniversal.cpp" alt="" coords="777,213,857,235"/><area shape="rect" id="node27" href="masstorage_8cpp.html" title="masstorage.cpp" alt="" coords="999,144,1077,165"/><area shape="rect" id="node29" href="max___l_c_d_8cpp.html" title="max_LCD.cpp" alt="" coords="1102,144,1175,165"/><area shape="rect" id="node31" href="_p_s3_u_s_b_8cpp.html" title="PS3USB.cpp" alt="" coords="1200,144,1269,165"/><area shape="rect" id="node34" href="usbhub_8cpp.html" title="usbhub.cpp" alt="" coords="1293,144,1357,165"/><area shape="rect" id="node36" href="_x_b_o_x_o_l_d_8cpp.html" title="XBOXOLD.cpp" alt="" coords="1382,144,1457,165"/><area shape="rect" id="node38" href="_x_b_o_x_r_e_c_v_8cpp.html" title="XBOXRECV.cpp" alt="" coords="1482,144,1563,165"/><area shape="rect" id="node40" href="_x_b_o_x_u_s_b_8cpp.html" title="XBOXUSB.cpp" alt="" coords="1587,144,1663,165"/></map>
</div>
</div>
<p><a href="_usb_8h_source.html">Go to the source code of this file.</a></p>
@ -132,9 +132,9 @@ Classes</h2></td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="define-members"></a>
Macros</h2></td></tr>
<tr class="memitem:afc6fe7f947af35317a49a4dcfc8189fd"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="_usb_8h.html#afc6fe7f947af35317a49a4dcfc8189fd">USBTRACE</a>(s)&#160;&#160;&#160;(<a class="el" href="message_8h.html#a747819b0aa34f5c3ba0332c2db28c846">Notify</a>(PSTR(s), 0x80))</td></tr>
<tr class="memitem:afc6fe7f947af35317a49a4dcfc8189fd"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="_usb_8h.html#afc6fe7f947af35317a49a4dcfc8189fd">USBTRACE</a>(s)&#160;&#160;&#160;(<a class="el" href="message_8h.html#a27117e124c5d66d5512fe8d494fe6338">Notify</a>(PSTR(s), 0x80))</td></tr>
<tr class="separator:afc6fe7f947af35317a49a4dcfc8189fd"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:adbe3f00986df48a9254f8bf0992041d3"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="_usb_8h.html#adbe3f00986df48a9254f8bf0992041d3">USBTRACE2</a>(s, r)&#160;&#160;&#160;(<a class="el" href="message_8h.html#a747819b0aa34f5c3ba0332c2db28c846">Notify</a>(PSTR(s), 0x80), D_PrintHex((r), 0x80), Notify(PSTR(&quot;\r\n&quot;), 0x80))</td></tr>
<tr class="memitem:adbe3f00986df48a9254f8bf0992041d3"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="_usb_8h.html#adbe3f00986df48a9254f8bf0992041d3">USBTRACE2</a>(s, r)&#160;&#160;&#160;(<a class="el" href="message_8h.html#a27117e124c5d66d5512fe8d494fe6338">Notify</a>(PSTR(s), 0x80), D_PrintHex((r), 0x80), Notify(PSTR(&quot;\r\n&quot;), 0x80))</td></tr>
<tr class="separator:adbe3f00986df48a9254f8bf0992041d3"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a060f3a6423f1e3640aa7b14d5ce72285"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="_usb_8h.html#a060f3a6423f1e3640aa7b14d5ce72285">bmREQ_GET_DESCR</a>&#160;&#160;&#160;<a class="el" href="usb__ch9_8h.html#a35c2a529dc87a274b2eb6f9e33682449">USB_SETUP_DEVICE_TO_HOST</a>|<a class="el" href="usb__ch9_8h.html#a3b51a35acaa76cafbb987c07186a7868">USB_SETUP_TYPE_STANDARD</a>|<a class="el" href="usb__ch9_8h.html#ad48131dc5ca47b4b2def65e7bbc8442f">USB_SETUP_RECIPIENT_DEVICE</a></td></tr>
<tr class="separator:a060f3a6423f1e3640aa7b14d5ce72285"><td class="memSeparator" colspan="2">&#160;</td></tr>
@ -270,7 +270,7 @@ Typedefs</h2></td></tr>
<td>(</td>
<td class="paramtype">&#160;</td>
<td class="paramname">s)</td><td></td>
<td>&#160;&#160;&#160;(<a class="el" href="message_8h.html#a747819b0aa34f5c3ba0332c2db28c846">Notify</a>(PSTR(s), 0x80))</td>
<td>&#160;&#160;&#160;(<a class="el" href="message_8h.html#a27117e124c5d66d5512fe8d494fe6338">Notify</a>(PSTR(s), 0x80))</td>
</tr>
</table>
</div><div class="memdoc">
@ -298,7 +298,7 @@ Typedefs</h2></td></tr>
<tr>
<td></td>
<td>)</td>
<td></td><td>&#160;&#160;&#160;(<a class="el" href="message_8h.html#a747819b0aa34f5c3ba0332c2db28c846">Notify</a>(PSTR(s), 0x80), D_PrintHex((r), 0x80), Notify(PSTR(&quot;\r\n&quot;), 0x80))</td>
<td></td><td>&#160;&#160;&#160;(<a class="el" href="message_8h.html#a27117e124c5d66d5512fe8d494fe6338">Notify</a>(PSTR(s), 0x80), D_PrintHex((r), 0x80), Notify(PSTR(&quot;\r\n&quot;), 0x80))</td>
</tr>
</table>
</div><div class="memdoc">

View file

@ -1,39 +1,41 @@
<map id="Usb.h" name="Usb.h">
<area shape="rect" id="node2" href="$adk_8h.html" title="adk.h" alt="" coords="81,75,121,96"/>
<area shape="rect" id="node4" href="$_b_t_d_8h.html" title="BTD.h" alt="" coords="217,75,263,96"/>
<area shape="rect" id="node12" href="$cdcacm_8h.html" title="cdcacm.h" alt="" coords="464,75,520,96"/>
<area shape="rect" id="node16" href="$cdcftdi_8h.html" title="cdcftdi.h" alt="" coords="629,75,680,96"/>
<area shape="rect" id="node14" href="$cdcprolific_8h.html" title="cdcprolific.h" alt="" coords="460,144,524,165"/>
<area shape="rect" id="node18" href="$hid_8h.html" title="hid.h" alt="" coords="812,75,852,96"/>
<area shape="rect" id="node20" href="$hidboot_8h.html" title="hidboot.h" alt="" coords="633,144,687,165"/>
<area shape="rect" id="node22" href="$hidescriptorparser_8h.html" title="hidescriptorparser.h" alt="" coords="880,144,973,165"/>
<area shape="rect" id="node26" href="$masstorage_8h.html" title="masstorage.h" alt="" coords="930,75,1000,96"/>
<area shape="rect" id="node28" href="$max___l_c_d_8h.html" title="max_LCD.h" alt="" coords="1025,75,1089,96"/>
<area shape="rect" id="node30" href="$_p_s3_u_s_b_8h.html" title="PS3USB.h" alt="" coords="1114,75,1173,96"/>
<area shape="rect" id="node32" href="$_usb_8cpp.html" title="Usb.cpp" alt="" coords="1198,75,1249,96"/>
<area shape="rect" id="node33" href="$usbhub_8h.html" title="usbhub.h" alt="" coords="1279,75,1333,96"/>
<area shape="rect" id="node35" href="$_x_b_o_x_r_e_c_v_8h.html" title="XBOXRECV.h" alt="" coords="1369,75,1441,96"/>
<area shape="rect" id="node37" href="$_x_b_o_x_u_s_b_8h.html" title="XBOXUSB.h" alt="" coords="1487,75,1555,96"/>
<area shape="rect" id="node2" href="$adk_8h.html" title="adk.h" alt="" coords="86,75,127,96"/>
<area shape="rect" id="node4" href="$_b_t_d_8h.html" title="BTD.h" alt="" coords="227,75,272,96"/>
<area shape="rect" id="node12" href="$cdcacm_8h.html" title="cdcacm.h" alt="" coords="465,75,521,96"/>
<area shape="rect" id="node16" href="$cdcftdi_8h.html" title="cdcftdi.h" alt="" coords="625,75,676,96"/>
<area shape="rect" id="node14" href="$cdcprolific_8h.html" title="cdcprolific.h" alt="" coords="461,144,525,165"/>
<area shape="rect" id="node18" href="$hid_8h.html" title="hid.h" alt="" coords="801,75,841,96"/>
<area shape="rect" id="node20" href="$hidboot_8h.html" title="hidboot.h" alt="" coords="634,144,688,165"/>
<area shape="rect" id="node22" href="$hidescriptorparser_8h.html" title="hidescriptorparser.h" alt="" coords="881,144,975,165"/>
<area shape="rect" id="node26" href="$masstorage_8h.html" title="masstorage.h" alt="" coords="954,75,1024,96"/>
<area shape="rect" id="node28" href="$max___l_c_d_8h.html" title="max_LCD.h" alt="" coords="1049,75,1113,96"/>
<area shape="rect" id="node30" href="$_p_s3_u_s_b_8h.html" title="PS3USB.h" alt="" coords="1138,75,1197,96"/>
<area shape="rect" id="node32" href="$_usb_8cpp.html" title="Usb.cpp" alt="" coords="1222,75,1273,96"/>
<area shape="rect" id="node33" href="$usbhub_8h.html" title="usbhub.h" alt="" coords="1298,75,1352,96"/>
<area shape="rect" id="node35" href="$_x_b_o_x_o_l_d_8h.html" title="XBOXOLD.h" alt="" coords="1379,75,1447,96"/>
<area shape="rect" id="node37" href="$_x_b_o_x_r_e_c_v_8h.html" title="XBOXRECV.h" alt="" coords="1478,75,1551,96"/>
<area shape="rect" id="node39" href="$_x_b_o_x_u_s_b_8h.html" title="XBOXUSB.h" alt="" coords="1587,75,1655,96"/>
<area shape="rect" id="node3" href="$adk_8cpp.html" title="adk.cpp" alt="" coords="5,144,56,165"/>
<area shape="rect" id="node5" href="$_b_t_d_8cpp.html" title="BTD.cpp" alt="" coords="213,144,267,165"/>
<area shape="rect" id="node6" href="$_p_s3_b_t_8h.html" title="PS3BT.h" alt="" coords="291,144,345,165"/>
<area shape="rect" id="node8" href="$_s_p_p_8h.html" title="SPP.h" alt="" coords="80,144,125,165"/>
<area shape="rect" id="node10" href="$_wii_8h.html" title="Wii.h" alt="" coords="149,144,189,165"/>
<area shape="rect" id="node7" href="$_p_s3_b_t_8cpp.html" title="PS3BT.cpp" alt="" coords="287,213,349,235"/>
<area shape="rect" id="node9" href="$_s_p_p_8cpp.html" title="SPP.cpp" alt="" coords="72,213,125,235"/>
<area shape="rect" id="node11" href="$_wii_8cpp.html" title="Wii.cpp" alt="" coords="149,213,197,235"/>
<area shape="rect" id="node13" href="$cdcacm_8cpp.html" title="cdcacm.cpp" alt="" coords="370,144,435,165"/>
<area shape="rect" id="node15" href="$cdcprolific_8cpp.html" title="cdcprolific.cpp" alt="" coords="455,213,528,235"/>
<area shape="rect" id="node17" href="$cdcftdi_8cpp.html" title="cdcftdi.cpp" alt="" coords="549,144,608,165"/>
<area shape="rect" id="node19" href="$hid_8cpp.html" title="hid.cpp" alt="" coords="808,144,856,165"/>
<area shape="rect" id="node24" href="$hiduniversal_8h.html" title="hiduniversal.h" alt="" coords="712,144,784,165"/>
<area shape="rect" id="node21" href="$hidboot_8cpp.html" title="hidboot.cpp" alt="" coords="624,213,688,235"/>
<area shape="rect" id="node23" href="$hidescriptorparser_8cpp.html" title="hidescriptorparser.cpp" alt="" coords="876,213,977,235"/>
<area shape="rect" id="node25" href="$hiduniversal_8cpp.html" title="hiduniversal.cpp" alt="" coords="712,213,792,235"/>
<area shape="rect" id="node27" href="$masstorage_8cpp.html" title="masstorage.cpp" alt="" coords="998,144,1076,165"/>
<area shape="rect" id="node29" href="$max___l_c_d_8cpp.html" title="max_LCD.cpp" alt="" coords="1101,144,1173,165"/>
<area shape="rect" id="node31" href="$_p_s3_u_s_b_8cpp.html" title="PS3USB.cpp" alt="" coords="1199,144,1268,165"/>
<area shape="rect" id="node34" href="$usbhub_8cpp.html" title="usbhub.cpp" alt="" coords="1292,144,1356,165"/>
<area shape="rect" id="node36" href="$_x_b_o_x_r_e_c_v_8cpp.html" title="XBOXRECV.cpp" alt="" coords="1381,144,1461,165"/>
<area shape="rect" id="node38" href="$_x_b_o_x_u_s_b_8cpp.html" title="XBOXUSB.cpp" alt="" coords="1486,144,1561,165"/>
<area shape="rect" id="node5" href="$_b_t_d_8cpp.html" title="BTD.cpp" alt="" coords="144,144,197,165"/>
<area shape="rect" id="node6" href="$_p_s3_b_t_8h.html" title="PS3BT.h" alt="" coords="222,144,276,165"/>
<area shape="rect" id="node8" href="$_s_p_p_8h.html" title="SPP.h" alt="" coords="301,144,347,165"/>
<area shape="rect" id="node10" href="$_wii_8h.html" title="Wii.h" alt="" coords="80,144,120,165"/>
<area shape="rect" id="node7" href="$_p_s3_b_t_8cpp.html" title="PS3BT.cpp" alt="" coords="214,213,276,235"/>
<area shape="rect" id="node9" href="$_s_p_p_8cpp.html" title="SPP.cpp" alt="" coords="301,213,355,235"/>
<area shape="rect" id="node11" href="$_wii_8cpp.html" title="Wii.cpp" alt="" coords="76,213,124,235"/>
<area shape="rect" id="node13" href="$cdcacm_8cpp.html" title="cdcacm.cpp" alt="" coords="371,144,436,165"/>
<area shape="rect" id="node15" href="$cdcprolific_8cpp.html" title="cdcprolific.cpp" alt="" coords="457,213,529,235"/>
<area shape="rect" id="node17" href="$cdcftdi_8cpp.html" title="cdcftdi.cpp" alt="" coords="550,144,609,165"/>
<area shape="rect" id="node19" href="$hid_8cpp.html" title="hid.cpp" alt="" coords="713,144,761,165"/>
<area shape="rect" id="node24" href="$hiduniversal_8h.html" title="hiduniversal.h" alt="" coords="785,144,857,165"/>
<area shape="rect" id="node21" href="$hidboot_8cpp.html" title="hidboot.cpp" alt="" coords="629,213,693,235"/>
<area shape="rect" id="node23" href="$hidescriptorparser_8cpp.html" title="hidescriptorparser.cpp" alt="" coords="881,213,983,235"/>
<area shape="rect" id="node25" href="$hiduniversal_8cpp.html" title="hiduniversal.cpp" alt="" coords="777,213,857,235"/>
<area shape="rect" id="node27" href="$masstorage_8cpp.html" title="masstorage.cpp" alt="" coords="999,144,1077,165"/>
<area shape="rect" id="node29" href="$max___l_c_d_8cpp.html" title="max_LCD.cpp" alt="" coords="1102,144,1175,165"/>
<area shape="rect" id="node31" href="$_p_s3_u_s_b_8cpp.html" title="PS3USB.cpp" alt="" coords="1200,144,1269,165"/>
<area shape="rect" id="node34" href="$usbhub_8cpp.html" title="usbhub.cpp" alt="" coords="1293,144,1357,165"/>
<area shape="rect" id="node36" href="$_x_b_o_x_o_l_d_8cpp.html" title="XBOXOLD.cpp" alt="" coords="1382,144,1457,165"/>
<area shape="rect" id="node38" href="$_x_b_o_x_r_e_c_v_8cpp.html" title="XBOXRECV.cpp" alt="" coords="1482,144,1563,165"/>
<area shape="rect" id="node40" href="$_x_b_o_x_u_s_b_8cpp.html" title="XBOXUSB.cpp" alt="" coords="1587,144,1663,165"/>
</map>

View file

@ -1 +1 @@
207a88a0652d96de0277d94f381679ac
8b47ac69fdc8cd76f60660a6c29d05dd

Binary file not shown.

Before

Width:  |  Height:  |  Size: 57 KiB

After

Width:  |  Height:  |  Size: 59 KiB

View file

@ -1,10 +1,10 @@
<map id="Usb.h" name="Usb.h">
<area shape="rect" id="node4" href="$avrpins_8h.html" title="avrpins.h" alt="" coords="5,144,59,165"/>
<area shape="rect" id="node6" href="$max3421e_8h.html" title="max3421e.h" alt="" coords="236,144,303,165"/>
<area shape="rect" id="node7" href="$usbhost_8h.html" title="usbhost.h" alt="" coords="145,75,201,96"/>
<area shape="rect" id="node8" href="$usb__ch9_8h.html" title="usb_ch9.h" alt="" coords="153,144,212,165"/>
<area shape="rect" id="node10" href="$address_8h.html" title="address.h" alt="" coords="329,75,385,96"/>
<area shape="rect" id="node13" href="$message_8h.html" title="message.h" alt="" coords="569,75,631,96"/>
<area shape="rect" id="node15" href="$printhex_8h.html" title="printhex.h" alt="" coords="555,213,612,235"/>
<area shape="rect" id="node16" href="$hexdump_8h.html" title="hexdump.h" alt="" coords="604,144,665,165"/>
<area shape="rect" id="node6" href="$max3421e_8h.html" title="max3421e.h" alt="" coords="287,144,353,165"/>
<area shape="rect" id="node7" href="$usbhost_8h.html" title="usbhost.h" alt="" coords="175,75,232,96"/>
<area shape="rect" id="node9" href="$usb__ch9_8h.html" title="usb_ch9.h" alt="" coords="204,144,263,165"/>
<area shape="rect" id="node11" href="$address_8h.html" title="address.h" alt="" coords="361,75,417,96"/>
<area shape="rect" id="node13" href="$message_8h.html" title="message.h" alt="" coords="655,75,716,96"/>
<area shape="rect" id="node15" href="$printhex_8h.html" title="printhex.h" alt="" coords="749,213,805,235"/>
<area shape="rect" id="node16" href="$hexdump_8h.html" title="hexdump.h" alt="" coords="655,144,716,165"/>
</map>

View file

@ -1 +1 @@
bbd5bd64f5e628b380c990e35c15c364
1163f5172f1686e1d40a075251da2864

Binary file not shown.

Before

Width:  |  Height:  |  Size: 47 KiB

After

Width:  |  Height:  |  Size: 52 KiB

View file

@ -97,7 +97,7 @@ Include dependency graph for Wii.cpp:</div>
<div class="dyncontent">
<div class="center"><img src="_wii_8cpp__incl.png" border="0" usemap="#_wii_8cpp" alt=""/></div>
<map name="_wii_8cpp" id="_wii_8cpp">
<area shape="rect" id="node2" href="_wii_8h.html" title="Wii.h" alt="" coords="608,75,648,96"/><area shape="rect" id="node3" href="_b_t_d_8h.html" title="BTD.h" alt="" coords="560,144,605,165"/><area shape="rect" id="node22" href="controller_enums_8h.html" title="controllerEnums.h" alt="" coords="630,144,716,165"/><area shape="rect" id="node4" href="_usb_8h.html" title="Usb.h" alt="" coords="287,283,329,304"/><area shape="rect" id="node20" href="confdescparser_8h.html" title="confdescparser.h" alt="" coords="649,213,732,235"/><area shape="rect" id="node7" href="avrpins_8h.html" title="avrpins.h" alt="" coords="30,421,84,443"/><area shape="rect" id="node9" href="max3421e_8h.html" title="max3421e.h" alt="" coords="261,421,328,443"/><area shape="rect" id="node10" href="usbhost_8h.html" title="usbhost.h" alt="" coords="169,352,225,373"/><area shape="rect" id="node11" href="usb__ch9_8h.html" title="usb_ch9.h" alt="" coords="109,421,168,443"/><area shape="rect" id="node13" href="address_8h.html" title="address.h" alt="" coords="377,352,433,373"/><area shape="rect" id="node16" href="message_8h.html" title="message.h" alt="" coords="696,352,757,373"/><area shape="rect" id="node18" href="printhex_8h.html" title="printhex.h" alt="" coords="686,491,743,512"/><area shape="rect" id="node19" href="hexdump_8h.html" title="hexdump.h" alt="" coords="731,421,792,443"/><area shape="rect" id="node21" href="parsetools_8h.html" title="parsetools.h" alt="" coords="729,283,793,304"/></map>
<area shape="rect" id="node2" href="_wii_8h.html" title="Wii.h" alt="" coords="648,75,688,96"/><area shape="rect" id="node3" href="_b_t_d_8h.html" title="BTD.h" alt="" coords="600,144,646,165"/><area shape="rect" id="node22" href="controller_enums_8h.html" title="controllerEnums.h" alt="" coords="670,144,756,165"/><area shape="rect" id="node4" href="_usb_8h.html" title="Usb.h" alt="" coords="330,283,372,304"/><area shape="rect" id="node20" href="confdescparser_8h.html" title="confdescparser.h" alt="" coords="688,213,771,235"/><area shape="rect" id="node7" href="avrpins_8h.html" title="avrpins.h" alt="" coords="34,421,88,443"/><area shape="rect" id="node9" href="max3421e_8h.html" title="max3421e.h" alt="" coords="284,421,351,443"/><area shape="rect" id="node10" href="usbhost_8h.html" title="usbhost.h" alt="" coords="152,352,208,373"/><area shape="rect" id="node12" href="usb__ch9_8h.html" title="usb_ch9.h" alt="" coords="500,421,559,443"/><area shape="rect" id="node14" href="address_8h.html" title="address.h" alt="" coords="356,352,412,373"/><area shape="rect" id="node16" href="message_8h.html" title="message.h" alt="" coords="735,352,796,373"/><area shape="rect" id="node18" href="printhex_8h.html" title="printhex.h" alt="" coords="737,491,794,512"/><area shape="rect" id="node19" href="hexdump_8h.html" title="hexdump.h" alt="" coords="735,421,796,443"/><area shape="rect" id="node21" href="parsetools_8h.html" title="parsetools.h" alt="" coords="768,283,832,304"/></map>
</div>
</div>
<p><a href="_wii_8cpp_source.html">Go to the source code of this file.</a></p>
@ -135,7 +135,7 @@ Variables</h2></td></tr>
<div class="line"> 0xF0 </div>
<div class="line">}</div>
</div><!-- fragment -->
<p>Definition at line <a class="el" href="_wii_8cpp_source.html#l00027">27</a> of file <a class="el" href="_wii_8cpp_source.html">Wii.cpp</a>.</p>
<p>Definition at line <a class="el" href="_wii_8cpp_source.html#l00025">25</a> of file <a class="el" href="_wii_8cpp_source.html">Wii.cpp</a>.</p>
</div>
</div>
@ -168,7 +168,7 @@ Variables</h2></td></tr>
<div class="line"> 0x00800 </div>
<div class="line">}</div>
</div><!-- fragment -->
<p>Definition at line <a class="el" href="_wii_8cpp_source.html#l00041">41</a> of file <a class="el" href="_wii_8cpp_source.html">Wii.cpp</a>.</p>
<p>Definition at line <a class="el" href="_wii_8cpp_source.html#l00039">39</a> of file <a class="el" href="_wii_8cpp_source.html">Wii.cpp</a>.</p>
</div>
</div>
@ -207,7 +207,7 @@ Variables</h2></td></tr>
<div class="line"> 0x00400 </div>
<div class="line">}</div>
</div><!-- fragment -->
<p>Definition at line <a class="el" href="_wii_8cpp_source.html#l00060">60</a> of file <a class="el" href="_wii_8cpp_source.html">Wii.cpp</a>.</p>
<p>Definition at line <a class="el" href="_wii_8cpp_source.html#l00058">58</a> of file <a class="el" href="_wii_8cpp_source.html">Wii.cpp</a>.</p>
</div>
</div>

View file

@ -1,16 +1,16 @@
<map id="Wii.cpp" name="Wii.cpp">
<area shape="rect" id="node2" href="$_wii_8h.html" title="Wii.h" alt="" coords="608,75,648,96"/>
<area shape="rect" id="node3" href="$_b_t_d_8h.html" title="BTD.h" alt="" coords="560,144,605,165"/>
<area shape="rect" id="node22" href="$controller_enums_8h.html" title="controllerEnums.h" alt="" coords="630,144,716,165"/>
<area shape="rect" id="node4" href="$_usb_8h.html" title="Usb.h" alt="" coords="287,283,329,304"/>
<area shape="rect" id="node20" href="$confdescparser_8h.html" title="confdescparser.h" alt="" coords="649,213,732,235"/>
<area shape="rect" id="node7" href="$avrpins_8h.html" title="avrpins.h" alt="" coords="30,421,84,443"/>
<area shape="rect" id="node9" href="$max3421e_8h.html" title="max3421e.h" alt="" coords="261,421,328,443"/>
<area shape="rect" id="node10" href="$usbhost_8h.html" title="usbhost.h" alt="" coords="169,352,225,373"/>
<area shape="rect" id="node11" href="$usb__ch9_8h.html" title="usb_ch9.h" alt="" coords="109,421,168,443"/>
<area shape="rect" id="node13" href="$address_8h.html" title="address.h" alt="" coords="377,352,433,373"/>
<area shape="rect" id="node16" href="$message_8h.html" title="message.h" alt="" coords="696,352,757,373"/>
<area shape="rect" id="node18" href="$printhex_8h.html" title="printhex.h" alt="" coords="686,491,743,512"/>
<area shape="rect" id="node19" href="$hexdump_8h.html" title="hexdump.h" alt="" coords="731,421,792,443"/>
<area shape="rect" id="node21" href="$parsetools_8h.html" title="parsetools.h" alt="" coords="729,283,793,304"/>
<area shape="rect" id="node2" href="$_wii_8h.html" title="Wii.h" alt="" coords="648,75,688,96"/>
<area shape="rect" id="node3" href="$_b_t_d_8h.html" title="BTD.h" alt="" coords="600,144,646,165"/>
<area shape="rect" id="node22" href="$controller_enums_8h.html" title="controllerEnums.h" alt="" coords="670,144,756,165"/>
<area shape="rect" id="node4" href="$_usb_8h.html" title="Usb.h" alt="" coords="330,283,372,304"/>
<area shape="rect" id="node20" href="$confdescparser_8h.html" title="confdescparser.h" alt="" coords="688,213,771,235"/>
<area shape="rect" id="node7" href="$avrpins_8h.html" title="avrpins.h" alt="" coords="34,421,88,443"/>
<area shape="rect" id="node9" href="$max3421e_8h.html" title="max3421e.h" alt="" coords="284,421,351,443"/>
<area shape="rect" id="node10" href="$usbhost_8h.html" title="usbhost.h" alt="" coords="152,352,208,373"/>
<area shape="rect" id="node12" href="$usb__ch9_8h.html" title="usb_ch9.h" alt="" coords="500,421,559,443"/>
<area shape="rect" id="node14" href="$address_8h.html" title="address.h" alt="" coords="356,352,412,373"/>
<area shape="rect" id="node16" href="$message_8h.html" title="message.h" alt="" coords="735,352,796,373"/>
<area shape="rect" id="node18" href="$printhex_8h.html" title="printhex.h" alt="" coords="737,491,794,512"/>
<area shape="rect" id="node19" href="$hexdump_8h.html" title="hexdump.h" alt="" coords="735,421,796,443"/>
<area shape="rect" id="node21" href="$parsetools_8h.html" title="parsetools.h" alt="" coords="768,283,832,304"/>
</map>

View file

@ -1 +1 @@
1b6e9f6e4815a9341cfa67dd5f9e34dc
12fdbbfcce1b39a1084ff516f4458fbd

Binary file not shown.

Before

Width:  |  Height:  |  Size: 81 KiB

After

Width:  |  Height:  |  Size: 86 KiB

File diff suppressed because it is too large Load diff

View file

@ -100,7 +100,7 @@ Include dependency graph for Wii.h:</div>
<div class="dyncontent">
<div class="center"><img src="_wii_8h__incl.png" border="0" usemap="#_wii_8h" alt=""/></div>
<map name="_wii_8h" id="_wii_8h">
<area shape="rect" id="node2" href="_b_t_d_8h.html" title="BTD.h" alt="" coords="560,75,605,96"/><area shape="rect" id="node21" href="controller_enums_8h.html" title="controllerEnums.h" alt="" coords="630,75,716,96"/><area shape="rect" id="node3" href="_usb_8h.html" title="Usb.h" alt="" coords="287,213,329,235"/><area shape="rect" id="node19" href="confdescparser_8h.html" title="confdescparser.h" alt="" coords="649,144,732,165"/><area shape="rect" id="node6" href="avrpins_8h.html" title="avrpins.h" alt="" coords="30,352,84,373"/><area shape="rect" id="node8" href="max3421e_8h.html" title="max3421e.h" alt="" coords="261,352,328,373"/><area shape="rect" id="node9" href="usbhost_8h.html" title="usbhost.h" alt="" coords="169,283,225,304"/><area shape="rect" id="node10" href="usb__ch9_8h.html" title="usb_ch9.h" alt="" coords="109,352,168,373"/><area shape="rect" id="node12" href="address_8h.html" title="address.h" alt="" coords="377,283,433,304"/><area shape="rect" id="node15" href="message_8h.html" title="message.h" alt="" coords="696,283,757,304"/><area shape="rect" id="node17" href="printhex_8h.html" title="printhex.h" alt="" coords="686,421,743,443"/><area shape="rect" id="node18" href="hexdump_8h.html" title="hexdump.h" alt="" coords="731,352,792,373"/><area shape="rect" id="node20" href="parsetools_8h.html" title="parsetools.h" alt="" coords="729,213,793,235"/></map>
<area shape="rect" id="node2" href="_b_t_d_8h.html" title="BTD.h" alt="" coords="600,75,646,96"/><area shape="rect" id="node21" href="controller_enums_8h.html" title="controllerEnums.h" alt="" coords="670,75,756,96"/><area shape="rect" id="node3" href="_usb_8h.html" title="Usb.h" alt="" coords="330,213,372,235"/><area shape="rect" id="node19" href="confdescparser_8h.html" title="confdescparser.h" alt="" coords="688,144,771,165"/><area shape="rect" id="node6" href="avrpins_8h.html" title="avrpins.h" alt="" coords="34,352,88,373"/><area shape="rect" id="node8" href="max3421e_8h.html" title="max3421e.h" alt="" coords="284,352,351,373"/><area shape="rect" id="node9" href="usbhost_8h.html" title="usbhost.h" alt="" coords="152,283,208,304"/><area shape="rect" id="node11" href="usb__ch9_8h.html" title="usb_ch9.h" alt="" coords="500,352,559,373"/><area shape="rect" id="node13" href="address_8h.html" title="address.h" alt="" coords="356,283,412,304"/><area shape="rect" id="node15" href="message_8h.html" title="message.h" alt="" coords="735,283,796,304"/><area shape="rect" id="node17" href="printhex_8h.html" title="printhex.h" alt="" coords="737,421,794,443"/><area shape="rect" id="node18" href="hexdump_8h.html" title="hexdump.h" alt="" coords="735,352,796,373"/><area shape="rect" id="node20" href="parsetools_8h.html" title="parsetools.h" alt="" coords="768,213,832,235"/></map>
</div>
</div><div class="textblock"><div class="dynheader">
This graph shows which files directly or indirectly include this file:</div>
@ -211,7 +211,7 @@ Enumerations</h2></td></tr>
</div><div class="memdoc">
<p>You will have to uncomment this to use the IR camera </p>
<p>Definition at line <a class="el" href="_wii_8h_source.html#l00029">29</a> of file <a class="el" href="_wii_8h_source.html">Wii.h</a>.</p>
<p>Definition at line <a class="el" href="_wii_8h_source.html#l00027">27</a> of file <a class="el" href="_wii_8h_source.html">Wii.h</a>.</p>
</div>
</div>
@ -225,7 +225,7 @@ Enumerations</h2></td></tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="_wii_8h_source.html#l00032">32</a> of file <a class="el" href="_wii_8h_source.html">Wii.h</a>.</p>
<p>Definition at line <a class="el" href="_wii_8h_source.html#l00030">30</a> of file <a class="el" href="_wii_8h_source.html">Wii.h</a>.</p>
</div>
</div>
@ -239,7 +239,7 @@ Enumerations</h2></td></tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="_wii_8h_source.html#l00035">35</a> of file <a class="el" href="_wii_8h_source.html">Wii.h</a>.</p>
<p>Definition at line <a class="el" href="_wii_8h_source.html#l00033">33</a> of file <a class="el" href="_wii_8h_source.html">Wii.h</a>.</p>
</div>
</div>
@ -253,7 +253,7 @@ Enumerations</h2></td></tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="_wii_8h_source.html#l00036">36</a> of file <a class="el" href="_wii_8h_source.html">Wii.h</a>.</p>
<p>Definition at line <a class="el" href="_wii_8h_source.html#l00034">34</a> of file <a class="el" href="_wii_8h_source.html">Wii.h</a>.</p>
</div>
</div>
@ -267,7 +267,7 @@ Enumerations</h2></td></tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="_wii_8h_source.html#l00039">39</a> of file <a class="el" href="_wii_8h_source.html">Wii.h</a>.</p>
<p>Definition at line <a class="el" href="_wii_8h_source.html#l00037">37</a> of file <a class="el" href="_wii_8h_source.html">Wii.h</a>.</p>
</div>
</div>
@ -281,7 +281,7 @@ Enumerations</h2></td></tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="_wii_8h_source.html#l00040">40</a> of file <a class="el" href="_wii_8h_source.html">Wii.h</a>.</p>
<p>Definition at line <a class="el" href="_wii_8h_source.html#l00038">38</a> of file <a class="el" href="_wii_8h_source.html">Wii.h</a>.</p>
</div>
</div>
@ -295,7 +295,7 @@ Enumerations</h2></td></tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="_wii_8h_source.html#l00041">41</a> of file <a class="el" href="_wii_8h_source.html">Wii.h</a>.</p>
<p>Definition at line <a class="el" href="_wii_8h_source.html#l00039">39</a> of file <a class="el" href="_wii_8h_source.html">Wii.h</a>.</p>
</div>
</div>
@ -309,7 +309,7 @@ Enumerations</h2></td></tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="_wii_8h_source.html#l00043">43</a> of file <a class="el" href="_wii_8h_source.html">Wii.h</a>.</p>
<p>Definition at line <a class="el" href="_wii_8h_source.html#l00041">41</a> of file <a class="el" href="_wii_8h_source.html">Wii.h</a>.</p>
</div>
</div>
@ -323,7 +323,7 @@ Enumerations</h2></td></tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="_wii_8h_source.html#l00045">45</a> of file <a class="el" href="_wii_8h_source.html">Wii.h</a>.</p>
<p>Definition at line <a class="el" href="_wii_8h_source.html#l00043">43</a> of file <a class="el" href="_wii_8h_source.html">Wii.h</a>.</p>
</div>
</div>
@ -337,7 +337,7 @@ Enumerations</h2></td></tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="_wii_8h_source.html#l00046">46</a> of file <a class="el" href="_wii_8h_source.html">Wii.h</a>.</p>
<p>Definition at line <a class="el" href="_wii_8h_source.html#l00044">44</a> of file <a class="el" href="_wii_8h_source.html">Wii.h</a>.</p>
</div>
</div>
@ -351,7 +351,7 @@ Enumerations</h2></td></tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="_wii_8h_source.html#l00047">47</a> of file <a class="el" href="_wii_8h_source.html">Wii.h</a>.</p>
<p>Definition at line <a class="el" href="_wii_8h_source.html#l00045">45</a> of file <a class="el" href="_wii_8h_source.html">Wii.h</a>.</p>
</div>
</div>
@ -365,7 +365,7 @@ Enumerations</h2></td></tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="_wii_8h_source.html#l00048">48</a> of file <a class="el" href="_wii_8h_source.html">Wii.h</a>.</p>
<p>Definition at line <a class="el" href="_wii_8h_source.html#l00046">46</a> of file <a class="el" href="_wii_8h_source.html">Wii.h</a>.</p>
</div>
</div>
@ -379,7 +379,7 @@ Enumerations</h2></td></tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="_wii_8h_source.html#l00049">49</a> of file <a class="el" href="_wii_8h_source.html">Wii.h</a>.</p>
<p>Definition at line <a class="el" href="_wii_8h_source.html#l00047">47</a> of file <a class="el" href="_wii_8h_source.html">Wii.h</a>.</p>
</div>
</div>
@ -393,7 +393,7 @@ Enumerations</h2></td></tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="_wii_8h_source.html#l00051">51</a> of file <a class="el" href="_wii_8h_source.html">Wii.h</a>.</p>
<p>Definition at line <a class="el" href="_wii_8h_source.html#l00049">49</a> of file <a class="el" href="_wii_8h_source.html">Wii.h</a>.</p>
</div>
</div>
@ -407,7 +407,7 @@ Enumerations</h2></td></tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="_wii_8h_source.html#l00052">52</a> of file <a class="el" href="_wii_8h_source.html">Wii.h</a>.</p>
<p>Definition at line <a class="el" href="_wii_8h_source.html#l00050">50</a> of file <a class="el" href="_wii_8h_source.html">Wii.h</a>.</p>
</div>
</div>
@ -421,7 +421,7 @@ Enumerations</h2></td></tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="_wii_8h_source.html#l00055">55</a> of file <a class="el" href="_wii_8h_source.html">Wii.h</a>.</p>
<p>Definition at line <a class="el" href="_wii_8h_source.html#l00053">53</a> of file <a class="el" href="_wii_8h_source.html">Wii.h</a>.</p>
</div>
</div>
@ -435,7 +435,7 @@ Enumerations</h2></td></tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="_wii_8h_source.html#l00056">56</a> of file <a class="el" href="_wii_8h_source.html">Wii.h</a>.</p>
<p>Definition at line <a class="el" href="_wii_8h_source.html#l00054">54</a> of file <a class="el" href="_wii_8h_source.html">Wii.h</a>.</p>
</div>
</div>
@ -449,7 +449,7 @@ Enumerations</h2></td></tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="_wii_8h_source.html#l00057">57</a> of file <a class="el" href="_wii_8h_source.html">Wii.h</a>.</p>
<p>Definition at line <a class="el" href="_wii_8h_source.html#l00055">55</a> of file <a class="el" href="_wii_8h_source.html">Wii.h</a>.</p>
</div>
</div>
@ -463,7 +463,7 @@ Enumerations</h2></td></tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="_wii_8h_source.html#l00058">58</a> of file <a class="el" href="_wii_8h_source.html">Wii.h</a>.</p>
<p>Definition at line <a class="el" href="_wii_8h_source.html#l00056">56</a> of file <a class="el" href="_wii_8h_source.html">Wii.h</a>.</p>
</div>
</div>
@ -477,7 +477,7 @@ Enumerations</h2></td></tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="_wii_8h_source.html#l00059">59</a> of file <a class="el" href="_wii_8h_source.html">Wii.h</a>.</p>
<p>Definition at line <a class="el" href="_wii_8h_source.html#l00057">57</a> of file <a class="el" href="_wii_8h_source.html">Wii.h</a>.</p>
</div>
</div>
@ -491,7 +491,7 @@ Enumerations</h2></td></tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="_wii_8h_source.html#l00060">60</a> of file <a class="el" href="_wii_8h_source.html">Wii.h</a>.</p>
<p>Definition at line <a class="el" href="_wii_8h_source.html#l00058">58</a> of file <a class="el" href="_wii_8h_source.html">Wii.h</a>.</p>
</div>
</div>
@ -505,7 +505,7 @@ Enumerations</h2></td></tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="_wii_8h_source.html#l00061">61</a> of file <a class="el" href="_wii_8h_source.html">Wii.h</a>.</p>
<p>Definition at line <a class="el" href="_wii_8h_source.html#l00059">59</a> of file <a class="el" href="_wii_8h_source.html">Wii.h</a>.</p>
</div>
</div>
@ -519,7 +519,7 @@ Enumerations</h2></td></tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="_wii_8h_source.html#l00062">62</a> of file <a class="el" href="_wii_8h_source.html">Wii.h</a>.</p>
<p>Definition at line <a class="el" href="_wii_8h_source.html#l00060">60</a> of file <a class="el" href="_wii_8h_source.html">Wii.h</a>.</p>
</div>
</div>
@ -533,7 +533,7 @@ Enumerations</h2></td></tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="_wii_8h_source.html#l00065">65</a> of file <a class="el" href="_wii_8h_source.html">Wii.h</a>.</p>
<p>Definition at line <a class="el" href="_wii_8h_source.html#l00063">63</a> of file <a class="el" href="_wii_8h_source.html">Wii.h</a>.</p>
</div>
</div>
@ -547,7 +547,7 @@ Enumerations</h2></td></tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="_wii_8h_source.html#l00066">66</a> of file <a class="el" href="_wii_8h_source.html">Wii.h</a>.</p>
<p>Definition at line <a class="el" href="_wii_8h_source.html#l00064">64</a> of file <a class="el" href="_wii_8h_source.html">Wii.h</a>.</p>
</div>
</div>
@ -561,7 +561,7 @@ Enumerations</h2></td></tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="_wii_8h_source.html#l00067">67</a> of file <a class="el" href="_wii_8h_source.html">Wii.h</a>.</p>
<p>Definition at line <a class="el" href="_wii_8h_source.html#l00065">65</a> of file <a class="el" href="_wii_8h_source.html">Wii.h</a>.</p>
</div>
</div>
@ -575,7 +575,7 @@ Enumerations</h2></td></tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="_wii_8h_source.html#l00068">68</a> of file <a class="el" href="_wii_8h_source.html">Wii.h</a>.</p>
<p>Definition at line <a class="el" href="_wii_8h_source.html#l00066">66</a> of file <a class="el" href="_wii_8h_source.html">Wii.h</a>.</p>
</div>
</div>
@ -589,7 +589,7 @@ Enumerations</h2></td></tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="_wii_8h_source.html#l00069">69</a> of file <a class="el" href="_wii_8h_source.html">Wii.h</a>.</p>
<p>Definition at line <a class="el" href="_wii_8h_source.html#l00067">67</a> of file <a class="el" href="_wii_8h_source.html">Wii.h</a>.</p>
</div>
</div>
@ -603,7 +603,7 @@ Enumerations</h2></td></tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="_wii_8h_source.html#l00070">70</a> of file <a class="el" href="_wii_8h_source.html">Wii.h</a>.</p>
<p>Definition at line <a class="el" href="_wii_8h_source.html#l00068">68</a> of file <a class="el" href="_wii_8h_source.html">Wii.h</a>.</p>
</div>
</div>
@ -617,7 +617,7 @@ Enumerations</h2></td></tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="_wii_8h_source.html#l00071">71</a> of file <a class="el" href="_wii_8h_source.html">Wii.h</a>.</p>
<p>Definition at line <a class="el" href="_wii_8h_source.html#l00069">69</a> of file <a class="el" href="_wii_8h_source.html">Wii.h</a>.</p>
</div>
</div>
@ -631,7 +631,7 @@ Enumerations</h2></td></tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="_wii_8h_source.html#l00072">72</a> of file <a class="el" href="_wii_8h_source.html">Wii.h</a>.</p>
<p>Definition at line <a class="el" href="_wii_8h_source.html#l00070">70</a> of file <a class="el" href="_wii_8h_source.html">Wii.h</a>.</p>
</div>
</div>
@ -645,7 +645,7 @@ Enumerations</h2></td></tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="_wii_8h_source.html#l00075">75</a> of file <a class="el" href="_wii_8h_source.html">Wii.h</a>.</p>
<p>Definition at line <a class="el" href="_wii_8h_source.html#l00073">73</a> of file <a class="el" href="_wii_8h_source.html">Wii.h</a>.</p>
</div>
</div>
@ -659,7 +659,7 @@ Enumerations</h2></td></tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="_wii_8h_source.html#l00076">76</a> of file <a class="el" href="_wii_8h_source.html">Wii.h</a>.</p>
<p>Definition at line <a class="el" href="_wii_8h_source.html#l00074">74</a> of file <a class="el" href="_wii_8h_source.html">Wii.h</a>.</p>
</div>
</div>
@ -673,7 +673,7 @@ Enumerations</h2></td></tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="_wii_8h_source.html#l00078">78</a> of file <a class="el" href="_wii_8h_source.html">Wii.h</a>.</p>
<p>Definition at line <a class="el" href="_wii_8h_source.html#l00076">76</a> of file <a class="el" href="_wii_8h_source.html">Wii.h</a>.</p>
</div>
</div>
@ -687,7 +687,7 @@ Enumerations</h2></td></tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="_wii_8h_source.html#l00079">79</a> of file <a class="el" href="_wii_8h_source.html">Wii.h</a>.</p>
<p>Definition at line <a class="el" href="_wii_8h_source.html#l00077">77</a> of file <a class="el" href="_wii_8h_source.html">Wii.h</a>.</p>
</div>
</div>
@ -701,7 +701,7 @@ Enumerations</h2></td></tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="_wii_8h_source.html#l00081">81</a> of file <a class="el" href="_wii_8h_source.html">Wii.h</a>.</p>
<p>Definition at line <a class="el" href="_wii_8h_source.html#l00079">79</a> of file <a class="el" href="_wii_8h_source.html">Wii.h</a>.</p>
</div>
</div>
@ -725,7 +725,7 @@ Enumerations</h2></td></tr>
</td></tr>
</table>
<p>Definition at line <a class="el" href="_wii_8h_source.html#l00084">84</a> of file <a class="el" href="_wii_8h_source.html">Wii.h</a>.</p>
<p>Definition at line <a class="el" href="_wii_8h_source.html#l00082">82</a> of file <a class="el" href="_wii_8h_source.html">Wii.h</a>.</p>
</div>
</div>

View file

@ -1,15 +1,15 @@
<map id="Wii.h" name="Wii.h">
<area shape="rect" id="node2" href="$_b_t_d_8h.html" title="BTD.h" alt="" coords="560,75,605,96"/>
<area shape="rect" id="node21" href="$controller_enums_8h.html" title="controllerEnums.h" alt="" coords="630,75,716,96"/>
<area shape="rect" id="node3" href="$_usb_8h.html" title="Usb.h" alt="" coords="287,213,329,235"/>
<area shape="rect" id="node19" href="$confdescparser_8h.html" title="confdescparser.h" alt="" coords="649,144,732,165"/>
<area shape="rect" id="node6" href="$avrpins_8h.html" title="avrpins.h" alt="" coords="30,352,84,373"/>
<area shape="rect" id="node8" href="$max3421e_8h.html" title="max3421e.h" alt="" coords="261,352,328,373"/>
<area shape="rect" id="node9" href="$usbhost_8h.html" title="usbhost.h" alt="" coords="169,283,225,304"/>
<area shape="rect" id="node10" href="$usb__ch9_8h.html" title="usb_ch9.h" alt="" coords="109,352,168,373"/>
<area shape="rect" id="node12" href="$address_8h.html" title="address.h" alt="" coords="377,283,433,304"/>
<area shape="rect" id="node15" href="$message_8h.html" title="message.h" alt="" coords="696,283,757,304"/>
<area shape="rect" id="node17" href="$printhex_8h.html" title="printhex.h" alt="" coords="686,421,743,443"/>
<area shape="rect" id="node18" href="$hexdump_8h.html" title="hexdump.h" alt="" coords="731,352,792,373"/>
<area shape="rect" id="node20" href="$parsetools_8h.html" title="parsetools.h" alt="" coords="729,213,793,235"/>
<area shape="rect" id="node2" href="$_b_t_d_8h.html" title="BTD.h" alt="" coords="600,75,646,96"/>
<area shape="rect" id="node21" href="$controller_enums_8h.html" title="controllerEnums.h" alt="" coords="670,75,756,96"/>
<area shape="rect" id="node3" href="$_usb_8h.html" title="Usb.h" alt="" coords="330,213,372,235"/>
<area shape="rect" id="node19" href="$confdescparser_8h.html" title="confdescparser.h" alt="" coords="688,144,771,165"/>
<area shape="rect" id="node6" href="$avrpins_8h.html" title="avrpins.h" alt="" coords="34,352,88,373"/>
<area shape="rect" id="node8" href="$max3421e_8h.html" title="max3421e.h" alt="" coords="284,352,351,373"/>
<area shape="rect" id="node9" href="$usbhost_8h.html" title="usbhost.h" alt="" coords="152,283,208,304"/>
<area shape="rect" id="node11" href="$usb__ch9_8h.html" title="usb_ch9.h" alt="" coords="500,352,559,373"/>
<area shape="rect" id="node13" href="$address_8h.html" title="address.h" alt="" coords="356,283,412,304"/>
<area shape="rect" id="node15" href="$message_8h.html" title="message.h" alt="" coords="735,283,796,304"/>
<area shape="rect" id="node17" href="$printhex_8h.html" title="printhex.h" alt="" coords="737,421,794,443"/>
<area shape="rect" id="node18" href="$hexdump_8h.html" title="hexdump.h" alt="" coords="735,352,796,373"/>
<area shape="rect" id="node20" href="$parsetools_8h.html" title="parsetools.h" alt="" coords="768,213,832,235"/>
</map>

View file

@ -1 +1 @@
380938360619b3d9afcd74c5043e5627
04eb8784e2fed1d9edf37be3ab5d7f9a

Binary file not shown.

Before

Width:  |  Height:  |  Size: 79 KiB

After

Width:  |  Height:  |  Size: 84 KiB

View file

@ -105,122 +105,121 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
<div class="line"><a name="l00014"></a><span class="lineno"> 14</span>&#160;<span class="comment"> Web : http://www.tkjelectronics.com</span></div>
<div class="line"><a name="l00015"></a><span class="lineno"> 15</span>&#160;<span class="comment"> e-mail : kristianl@tkjelectronics.com</span></div>
<div class="line"><a name="l00016"></a><span class="lineno"> 16</span>&#160;<span class="comment"></span></div>
<div class="line"><a name="l00017"></a><span class="lineno"> 17</span>&#160;<span class="comment"> IR camera support added by:</span></div>
<div class="line"><a name="l00018"></a><span class="lineno"> 18</span>&#160;<span class="comment"> Allan Glover</span></div>
<div class="line"><a name="l00019"></a><span class="lineno"> 19</span>&#160;<span class="comment"> adglover9.81@gmail.com</span></div>
<div class="line"><a name="l00020"></a><span class="lineno"> 20</span>&#160;<span class="comment"> */</span></div>
<div class="line"><a name="l00021"></a><span class="lineno"> 21</span>&#160;</div>
<div class="line"><a name="l00022"></a><span class="lineno"> 22</span>&#160;<span class="preprocessor">#ifndef _wii_h_</span></div>
<div class="line"><a name="l00023"></a><span class="lineno"> 23</span>&#160;<span class="preprocessor"></span><span class="preprocessor">#define _wii_h_</span></div>
<div class="line"><a name="l00024"></a><span class="lineno"> 24</span>&#160;<span class="preprocessor"></span></div>
<div class="line"><a name="l00025"></a><span class="lineno"> 25</span>&#160;<span class="preprocessor">#include &quot;<a class="code" href="_b_t_d_8h.html">BTD.h</a>&quot;</span></div>
<div class="line"><a name="l00026"></a><span class="lineno"> 26</span>&#160;<span class="preprocessor">#include &quot;<a class="code" href="controller_enums_8h.html">controllerEnums.h</a>&quot;</span></div>
<div class="line"><a name="l00027"></a><span class="lineno"> 27</span>&#160;</div>
<div class="line"><a name="l00029"></a><span class="lineno"><a class="code" href="_wii_8h.html#a8a70a2d3fd20f9005aa8dc5849beb147"> 29</a></span>&#160;<span class="preprocessor">#define WIICAMERA</span></div>
<div class="line"><a name="l00030"></a><span class="lineno"> 30</span>&#160;<span class="preprocessor"></span></div>
<div class="line"><a name="l00031"></a><span class="lineno"> 31</span>&#160;<span class="comment">/* Bluetooth L2CAP states for L2CAP_task() */</span></div>
<div class="line"><a name="l00032"></a><span class="lineno"><a class="code" href="_wii_8h.html#a15cc1db556ad9a4ec6144ca8a42f8919"> 32</a></span>&#160;<span class="preprocessor">#define L2CAP_WAIT 0</span></div>
<div class="line"><a name="l00033"></a><span class="lineno"> 33</span>&#160;<span class="preprocessor"></span></div>
<div class="line"><a name="l00034"></a><span class="lineno"> 34</span>&#160;<span class="comment">// These states are used if the Wiimote is the host</span></div>
<div class="line"><a name="l00035"></a><span class="lineno"><a class="code" href="_wii_8h.html#abac08b5b24a1cd2b12517cd9aa6c616b"> 35</a></span>&#160;<span class="preprocessor">#define L2CAP_CONTROL_SUCCESS 1</span></div>
<div class="line"><a name="l00036"></a><span class="lineno"><a class="code" href="_wii_8h.html#ac7aa7fd7a8a34a6c9e420e3cb114737b"> 36</a></span>&#160;<span class="preprocessor"></span><span class="preprocessor">#define L2CAP_INTERRUPT_SETUP 2</span></div>
<div class="line"><a name="l00037"></a><span class="lineno"> 37</span>&#160;<span class="preprocessor"></span></div>
<div class="line"><a name="l00038"></a><span class="lineno"> 38</span>&#160;<span class="comment">// These states are used if the Arduino is the host</span></div>
<div class="line"><a name="l00039"></a><span class="lineno"><a class="code" href="_wii_8h.html#a68bcdd68c269cd7970d5271a00bbe5fe"> 39</a></span>&#160;<span class="preprocessor">#define L2CAP_CONTROL_CONNECT_REQUEST 3</span></div>
<div class="line"><a name="l00040"></a><span class="lineno"><a class="code" href="_wii_8h.html#aaaf733ee2c84bd8df4d24f2ae1f3b378"> 40</a></span>&#160;<span class="preprocessor"></span><span class="preprocessor">#define L2CAP_CONTROL_CONFIG_REQUEST 4</span></div>
<div class="line"><a name="l00041"></a><span class="lineno"><a class="code" href="_wii_8h.html#af0b913a7e9e54b1f6ab95d82bd36f954"> 41</a></span>&#160;<span class="preprocessor"></span><span class="preprocessor">#define L2CAP_INTERRUPT_CONNECT_REQUEST 5</span></div>
<div class="line"><a name="l00017"></a><span class="lineno"> 17</span>&#160;<span class="comment"> IR camera support added by Allan Glover (adglover9.81@gmail.com) and Kristian Lauszus</span></div>
<div class="line"><a name="l00018"></a><span class="lineno"> 18</span>&#160;<span class="comment"> */</span></div>
<div class="line"><a name="l00019"></a><span class="lineno"> 19</span>&#160;</div>
<div class="line"><a name="l00020"></a><span class="lineno"> 20</span>&#160;<span class="preprocessor">#ifndef _wii_h_</span></div>
<div class="line"><a name="l00021"></a><span class="lineno"> 21</span>&#160;<span class="preprocessor"></span><span class="preprocessor">#define _wii_h_</span></div>
<div class="line"><a name="l00022"></a><span class="lineno"> 22</span>&#160;<span class="preprocessor"></span></div>
<div class="line"><a name="l00023"></a><span class="lineno"> 23</span>&#160;<span class="preprocessor">#include &quot;<a class="code" href="_b_t_d_8h.html">BTD.h</a>&quot;</span></div>
<div class="line"><a name="l00024"></a><span class="lineno"> 24</span>&#160;<span class="preprocessor">#include &quot;<a class="code" href="controller_enums_8h.html">controllerEnums.h</a>&quot;</span></div>
<div class="line"><a name="l00025"></a><span class="lineno"> 25</span>&#160;</div>
<div class="line"><a name="l00027"></a><span class="lineno"><a class="code" href="_wii_8h.html#a8a70a2d3fd20f9005aa8dc5849beb147"> 27</a></span>&#160;<span class="preprocessor">#define WIICAMERA</span></div>
<div class="line"><a name="l00028"></a><span class="lineno"> 28</span>&#160;<span class="preprocessor"></span></div>
<div class="line"><a name="l00029"></a><span class="lineno"> 29</span>&#160;<span class="comment">/* Bluetooth L2CAP states for L2CAP_task() */</span></div>
<div class="line"><a name="l00030"></a><span class="lineno"><a class="code" href="_wii_8h.html#a15cc1db556ad9a4ec6144ca8a42f8919"> 30</a></span>&#160;<span class="preprocessor">#define L2CAP_WAIT 0</span></div>
<div class="line"><a name="l00031"></a><span class="lineno"> 31</span>&#160;<span class="preprocessor"></span></div>
<div class="line"><a name="l00032"></a><span class="lineno"> 32</span>&#160;<span class="comment">// These states are used if the Wiimote is the host</span></div>
<div class="line"><a name="l00033"></a><span class="lineno"><a class="code" href="_wii_8h.html#abac08b5b24a1cd2b12517cd9aa6c616b"> 33</a></span>&#160;<span class="preprocessor">#define L2CAP_CONTROL_SUCCESS 1</span></div>
<div class="line"><a name="l00034"></a><span class="lineno"><a class="code" href="_wii_8h.html#ac7aa7fd7a8a34a6c9e420e3cb114737b"> 34</a></span>&#160;<span class="preprocessor"></span><span class="preprocessor">#define L2CAP_INTERRUPT_SETUP 2</span></div>
<div class="line"><a name="l00035"></a><span class="lineno"> 35</span>&#160;<span class="preprocessor"></span></div>
<div class="line"><a name="l00036"></a><span class="lineno"> 36</span>&#160;<span class="comment">// These states are used if the Arduino is the host</span></div>
<div class="line"><a name="l00037"></a><span class="lineno"><a class="code" href="_wii_8h.html#a68bcdd68c269cd7970d5271a00bbe5fe"> 37</a></span>&#160;<span class="preprocessor">#define L2CAP_CONTROL_CONNECT_REQUEST 3</span></div>
<div class="line"><a name="l00038"></a><span class="lineno"><a class="code" href="_wii_8h.html#aaaf733ee2c84bd8df4d24f2ae1f3b378"> 38</a></span>&#160;<span class="preprocessor"></span><span class="preprocessor">#define L2CAP_CONTROL_CONFIG_REQUEST 4</span></div>
<div class="line"><a name="l00039"></a><span class="lineno"><a class="code" href="_wii_8h.html#af0b913a7e9e54b1f6ab95d82bd36f954"> 39</a></span>&#160;<span class="preprocessor"></span><span class="preprocessor">#define L2CAP_INTERRUPT_CONNECT_REQUEST 5</span></div>
<div class="line"><a name="l00040"></a><span class="lineno"> 40</span>&#160;<span class="preprocessor"></span></div>
<div class="line"><a name="l00041"></a><span class="lineno"><a class="code" href="_wii_8h.html#a73e3a81d9a8850075fd10933acc5a035"> 41</a></span>&#160;<span class="preprocessor">#define L2CAP_INTERRUPT_CONFIG_REQUEST 6</span></div>
<div class="line"><a name="l00042"></a><span class="lineno"> 42</span>&#160;<span class="preprocessor"></span></div>
<div class="line"><a name="l00043"></a><span class="lineno"><a class="code" href="_wii_8h.html#a73e3a81d9a8850075fd10933acc5a035"> 43</a></span>&#160;<span class="preprocessor">#define L2CAP_INTERRUPT_CONFIG_REQUEST 6</span></div>
<div class="line"><a name="l00044"></a><span class="lineno"> 44</span>&#160;<span class="preprocessor"></span></div>
<div class="line"><a name="l00045"></a><span class="lineno"><a class="code" href="_wii_8h.html#a44edf5415459cba3cc378992fef7560b"> 45</a></span>&#160;<span class="preprocessor">#define L2CAP_CHECK_MOTION_PLUS_STATE 7</span></div>
<div class="line"><a name="l00046"></a><span class="lineno"><a class="code" href="_wii_8h.html#ab84d043703110a74ba9b8d7afa30c5de"> 46</a></span>&#160;<span class="preprocessor"></span><span class="preprocessor">#define L2CAP_CHECK_EXTENSION_STATE 8</span></div>
<div class="line"><a name="l00047"></a><span class="lineno"><a class="code" href="_wii_8h.html#a291cf8ab9832ac643cdbeaa5f0b84ed1"> 47</a></span>&#160;<span class="preprocessor"></span><span class="preprocessor">#define L2CAP_INIT_MOTION_PLUS_STATE 9</span></div>
<div class="line"><a name="l00048"></a><span class="lineno"><a class="code" href="_wii_8h.html#a11f7dbb22bf86e28848abc165e22c2de"> 48</a></span>&#160;<span class="preprocessor"></span><span class="preprocessor">#define L2CAP_LED_STATE 10</span></div>
<div class="line"><a name="l00049"></a><span class="lineno"><a class="code" href="_wii_8h.html#ae4da52ca67e1f8b977199b24e8f3a400"> 49</a></span>&#160;<span class="preprocessor"></span><span class="preprocessor">#define L2CAP_DONE 11</span></div>
<div class="line"><a name="l00050"></a><span class="lineno"> 50</span>&#160;<span class="preprocessor"></span></div>
<div class="line"><a name="l00051"></a><span class="lineno"><a class="code" href="_wii_8h.html#ab569b2085ad29f41d1da9c0ed352bd65"> 51</a></span>&#160;<span class="preprocessor">#define L2CAP_INTERRUPT_DISCONNECT 12</span></div>
<div class="line"><a name="l00052"></a><span class="lineno"><a class="code" href="_wii_8h.html#a9b5140e7ca5941e5535c575255ffc1cc"> 52</a></span>&#160;<span class="preprocessor"></span><span class="preprocessor">#define L2CAP_CONTROL_DISCONNECT 13</span></div>
<div class="line"><a name="l00053"></a><span class="lineno"> 53</span>&#160;<span class="preprocessor"></span></div>
<div class="line"><a name="l00054"></a><span class="lineno"> 54</span>&#160;<span class="comment">/* L2CAP event flags */</span></div>
<div class="line"><a name="l00055"></a><span class="lineno"><a class="code" href="_wii_8h.html#a2e5a9c283f0912833f3e0418d3feadd7"> 55</a></span>&#160;<span class="preprocessor">#define L2CAP_FLAG_CONTROL_CONNECTED 0x001</span></div>
<div class="line"><a name="l00056"></a><span class="lineno"><a class="code" href="_wii_8h.html#aad823543553cc7500ac49d7479eb858f"> 56</a></span>&#160;<span class="preprocessor"></span><span class="preprocessor">#define L2CAP_FLAG_INTERRUPT_CONNECTED 0x002</span></div>
<div class="line"><a name="l00057"></a><span class="lineno"><a class="code" href="_wii_8h.html#a0c444d5d06ec604820d426556c2f38d7"> 57</a></span>&#160;<span class="preprocessor"></span><span class="preprocessor">#define L2CAP_FLAG_CONFIG_CONTROL_SUCCESS 0x004</span></div>
<div class="line"><a name="l00058"></a><span class="lineno"><a class="code" href="_wii_8h.html#a2b3cdcd3124251a40ce825da0d8dcb6f"> 58</a></span>&#160;<span class="preprocessor"></span><span class="preprocessor">#define L2CAP_FLAG_CONFIG_INTERRUPT_SUCCESS 0x008</span></div>
<div class="line"><a name="l00059"></a><span class="lineno"><a class="code" href="_wii_8h.html#a27057737ae0b2246442511c01eeed192"> 59</a></span>&#160;<span class="preprocessor"></span><span class="preprocessor">#define L2CAP_FLAG_DISCONNECT_CONTROL_RESPONSE 0x040</span></div>
<div class="line"><a name="l00060"></a><span class="lineno"><a class="code" href="_wii_8h.html#acc096a05301f3cbdece4ad372cc149c3"> 60</a></span>&#160;<span class="preprocessor"></span><span class="preprocessor">#define L2CAP_FLAG_DISCONNECT_INTERRUPT_RESPONSE 0x080</span></div>
<div class="line"><a name="l00061"></a><span class="lineno"><a class="code" href="_wii_8h.html#a969a1ee84797f3ee5006c41f67373f96"> 61</a></span>&#160;<span class="preprocessor"></span><span class="preprocessor">#define L2CAP_FLAG_CONNECTION_CONTROL_REQUEST 0x100</span></div>
<div class="line"><a name="l00062"></a><span class="lineno"><a class="code" href="_wii_8h.html#a015f3b25bd7a2908c84b973dec453f45"> 62</a></span>&#160;<span class="preprocessor"></span><span class="preprocessor">#define L2CAP_FLAG_CONNECTION_INTERRUPT_REQUEST 0x200</span></div>
<div class="line"><a name="l00063"></a><span class="lineno"> 63</span>&#160;<span class="preprocessor"></span></div>
<div class="line"><a name="l00064"></a><span class="lineno"> 64</span>&#160;<span class="comment">/* Macros for L2CAP event flag tests */</span></div>
<div class="line"><a name="l00065"></a><span class="lineno"><a class="code" href="_wii_8h.html#acaec1ddc53593c80dc625c1f361e3a24"> 65</a></span>&#160;<span class="preprocessor">#define l2cap_connected_control_flag (l2cap_event_flag &amp; L2CAP_FLAG_CONTROL_CONNECTED)</span></div>
<div class="line"><a name="l00066"></a><span class="lineno"><a class="code" href="_wii_8h.html#ac72a2b645fafc5bdbd85c1f59cc937cc"> 66</a></span>&#160;<span class="preprocessor"></span><span class="preprocessor">#define l2cap_connected_interrupt_flag (l2cap_event_flag &amp; L2CAP_FLAG_INTERRUPT_CONNECTED)</span></div>
<div class="line"><a name="l00067"></a><span class="lineno"><a class="code" href="_wii_8h.html#a39a58b19fb4ef26cf503ed57a43570a4"> 67</a></span>&#160;<span class="preprocessor"></span><span class="preprocessor">#define l2cap_config_success_control_flag (l2cap_event_flag &amp; L2CAP_FLAG_CONFIG_CONTROL_SUCCESS)</span></div>
<div class="line"><a name="l00068"></a><span class="lineno"><a class="code" href="_wii_8h.html#a9b3e87e1f460bc011e69f5e53e79c104"> 68</a></span>&#160;<span class="preprocessor"></span><span class="preprocessor">#define l2cap_config_success_interrupt_flag (l2cap_event_flag &amp; L2CAP_FLAG_CONFIG_INTERRUPT_SUCCESS)</span></div>
<div class="line"><a name="l00069"></a><span class="lineno"><a class="code" href="_wii_8h.html#a7f0cab74308e812106252c53b18c0391"> 69</a></span>&#160;<span class="preprocessor"></span><span class="preprocessor">#define l2cap_disconnect_response_control_flag (l2cap_event_flag &amp; L2CAP_FLAG_DISCONNECT_CONTROL_RESPONSE)</span></div>
<div class="line"><a name="l00070"></a><span class="lineno"><a class="code" href="_wii_8h.html#a667178a4486c4dee88e052b3562362cd"> 70</a></span>&#160;<span class="preprocessor"></span><span class="preprocessor">#define l2cap_disconnect_response_interrupt_flag (l2cap_event_flag &amp; L2CAP_FLAG_DISCONNECT_INTERRUPT_RESPONSE)</span></div>
<div class="line"><a name="l00071"></a><span class="lineno"><a class="code" href="_wii_8h.html#a728c7d92dd341dcc1b8f4bf95bb4826d"> 71</a></span>&#160;<span class="preprocessor"></span><span class="preprocessor">#define l2cap_connection_request_control_flag (l2cap_event_flag &amp; L2CAP_FLAG_CONNECTION_CONTROL_REQUEST)</span></div>
<div class="line"><a name="l00072"></a><span class="lineno"><a class="code" href="_wii_8h.html#a9fa7bceb44bbdff3229fd431627b9868"> 72</a></span>&#160;<span class="preprocessor"></span><span class="preprocessor">#define l2cap_connection_request_interrupt_flag (l2cap_event_flag &amp; L2CAP_FLAG_CONNECTION_INTERRUPT_REQUEST)</span></div>
<div class="line"><a name="l00073"></a><span class="lineno"> 73</span>&#160;<span class="preprocessor"></span></div>
<div class="line"><a name="l00074"></a><span class="lineno"> 74</span>&#160;<span class="comment">/* Wii event flags */</span></div>
<div class="line"><a name="l00075"></a><span class="lineno"><a class="code" href="_wii_8h.html#a34631633d4557244dc8eda52e8505acd"> 75</a></span>&#160;<span class="preprocessor">#define WII_FLAG_MOTION_PLUS_CONNECTED 0x400</span></div>
<div class="line"><a name="l00076"></a><span class="lineno"><a class="code" href="_wii_8h.html#ae0ff99c8862a05df8877329982e1ef61"> 76</a></span>&#160;<span class="preprocessor"></span><span class="preprocessor">#define WII_FLAG_NUNCHUCK_CONNECTED 0x800</span></div>
<div class="line"><a name="l00077"></a><span class="lineno"> 77</span>&#160;<span class="preprocessor"></span></div>
<div class="line"><a name="l00078"></a><span class="lineno"><a class="code" href="_wii_8h.html#a3d4b4f06162f96e91d97650f5c2e60f7"> 78</a></span>&#160;<span class="preprocessor">#define motion_plus_connected_flag (l2cap_event_flag &amp; WII_FLAG_MOTION_PLUS_CONNECTED)</span></div>
<div class="line"><a name="l00079"></a><span class="lineno"><a class="code" href="_wii_8h.html#a7ae9154397104e4df34302ed0884bbfb"> 79</a></span>&#160;<span class="preprocessor"></span><span class="preprocessor">#define nunchuck_connected_flag (l2cap_event_flag &amp; WII_FLAG_NUNCHUCK_CONNECTED)</span></div>
<div class="line"><a name="l00043"></a><span class="lineno"><a class="code" href="_wii_8h.html#a44edf5415459cba3cc378992fef7560b"> 43</a></span>&#160;<span class="preprocessor">#define L2CAP_CHECK_MOTION_PLUS_STATE 7</span></div>
<div class="line"><a name="l00044"></a><span class="lineno"><a class="code" href="_wii_8h.html#ab84d043703110a74ba9b8d7afa30c5de"> 44</a></span>&#160;<span class="preprocessor"></span><span class="preprocessor">#define L2CAP_CHECK_EXTENSION_STATE 8</span></div>
<div class="line"><a name="l00045"></a><span class="lineno"><a class="code" href="_wii_8h.html#a291cf8ab9832ac643cdbeaa5f0b84ed1"> 45</a></span>&#160;<span class="preprocessor"></span><span class="preprocessor">#define L2CAP_INIT_MOTION_PLUS_STATE 9</span></div>
<div class="line"><a name="l00046"></a><span class="lineno"><a class="code" href="_wii_8h.html#a11f7dbb22bf86e28848abc165e22c2de"> 46</a></span>&#160;<span class="preprocessor"></span><span class="preprocessor">#define L2CAP_LED_STATE 10</span></div>
<div class="line"><a name="l00047"></a><span class="lineno"><a class="code" href="_wii_8h.html#ae4da52ca67e1f8b977199b24e8f3a400"> 47</a></span>&#160;<span class="preprocessor"></span><span class="preprocessor">#define L2CAP_DONE 11</span></div>
<div class="line"><a name="l00048"></a><span class="lineno"> 48</span>&#160;<span class="preprocessor"></span></div>
<div class="line"><a name="l00049"></a><span class="lineno"><a class="code" href="_wii_8h.html#ab569b2085ad29f41d1da9c0ed352bd65"> 49</a></span>&#160;<span class="preprocessor">#define L2CAP_INTERRUPT_DISCONNECT 12</span></div>
<div class="line"><a name="l00050"></a><span class="lineno"><a class="code" href="_wii_8h.html#a9b5140e7ca5941e5535c575255ffc1cc"> 50</a></span>&#160;<span class="preprocessor"></span><span class="preprocessor">#define L2CAP_CONTROL_DISCONNECT 13</span></div>
<div class="line"><a name="l00051"></a><span class="lineno"> 51</span>&#160;<span class="preprocessor"></span></div>
<div class="line"><a name="l00052"></a><span class="lineno"> 52</span>&#160;<span class="comment">/* L2CAP event flags */</span></div>
<div class="line"><a name="l00053"></a><span class="lineno"><a class="code" href="_wii_8h.html#a2e5a9c283f0912833f3e0418d3feadd7"> 53</a></span>&#160;<span class="preprocessor">#define L2CAP_FLAG_CONTROL_CONNECTED 0x001</span></div>
<div class="line"><a name="l00054"></a><span class="lineno"><a class="code" href="_wii_8h.html#aad823543553cc7500ac49d7479eb858f"> 54</a></span>&#160;<span class="preprocessor"></span><span class="preprocessor">#define L2CAP_FLAG_INTERRUPT_CONNECTED 0x002</span></div>
<div class="line"><a name="l00055"></a><span class="lineno"><a class="code" href="_wii_8h.html#a0c444d5d06ec604820d426556c2f38d7"> 55</a></span>&#160;<span class="preprocessor"></span><span class="preprocessor">#define L2CAP_FLAG_CONFIG_CONTROL_SUCCESS 0x004</span></div>
<div class="line"><a name="l00056"></a><span class="lineno"><a class="code" href="_wii_8h.html#a2b3cdcd3124251a40ce825da0d8dcb6f"> 56</a></span>&#160;<span class="preprocessor"></span><span class="preprocessor">#define L2CAP_FLAG_CONFIG_INTERRUPT_SUCCESS 0x008</span></div>
<div class="line"><a name="l00057"></a><span class="lineno"><a class="code" href="_wii_8h.html#a27057737ae0b2246442511c01eeed192"> 57</a></span>&#160;<span class="preprocessor"></span><span class="preprocessor">#define L2CAP_FLAG_DISCONNECT_CONTROL_RESPONSE 0x040</span></div>
<div class="line"><a name="l00058"></a><span class="lineno"><a class="code" href="_wii_8h.html#acc096a05301f3cbdece4ad372cc149c3"> 58</a></span>&#160;<span class="preprocessor"></span><span class="preprocessor">#define L2CAP_FLAG_DISCONNECT_INTERRUPT_RESPONSE 0x080</span></div>
<div class="line"><a name="l00059"></a><span class="lineno"><a class="code" href="_wii_8h.html#a969a1ee84797f3ee5006c41f67373f96"> 59</a></span>&#160;<span class="preprocessor"></span><span class="preprocessor">#define L2CAP_FLAG_CONNECTION_CONTROL_REQUEST 0x100</span></div>
<div class="line"><a name="l00060"></a><span class="lineno"><a class="code" href="_wii_8h.html#a015f3b25bd7a2908c84b973dec453f45"> 60</a></span>&#160;<span class="preprocessor"></span><span class="preprocessor">#define L2CAP_FLAG_CONNECTION_INTERRUPT_REQUEST 0x200</span></div>
<div class="line"><a name="l00061"></a><span class="lineno"> 61</span>&#160;<span class="preprocessor"></span></div>
<div class="line"><a name="l00062"></a><span class="lineno"> 62</span>&#160;<span class="comment">/* Macros for L2CAP event flag tests */</span></div>
<div class="line"><a name="l00063"></a><span class="lineno"><a class="code" href="_wii_8h.html#acaec1ddc53593c80dc625c1f361e3a24"> 63</a></span>&#160;<span class="preprocessor">#define l2cap_connected_control_flag (l2cap_event_flag &amp; L2CAP_FLAG_CONTROL_CONNECTED)</span></div>
<div class="line"><a name="l00064"></a><span class="lineno"><a class="code" href="_wii_8h.html#ac72a2b645fafc5bdbd85c1f59cc937cc"> 64</a></span>&#160;<span class="preprocessor"></span><span class="preprocessor">#define l2cap_connected_interrupt_flag (l2cap_event_flag &amp; L2CAP_FLAG_INTERRUPT_CONNECTED)</span></div>
<div class="line"><a name="l00065"></a><span class="lineno"><a class="code" href="_wii_8h.html#a39a58b19fb4ef26cf503ed57a43570a4"> 65</a></span>&#160;<span class="preprocessor"></span><span class="preprocessor">#define l2cap_config_success_control_flag (l2cap_event_flag &amp; L2CAP_FLAG_CONFIG_CONTROL_SUCCESS)</span></div>
<div class="line"><a name="l00066"></a><span class="lineno"><a class="code" href="_wii_8h.html#a9b3e87e1f460bc011e69f5e53e79c104"> 66</a></span>&#160;<span class="preprocessor"></span><span class="preprocessor">#define l2cap_config_success_interrupt_flag (l2cap_event_flag &amp; L2CAP_FLAG_CONFIG_INTERRUPT_SUCCESS)</span></div>
<div class="line"><a name="l00067"></a><span class="lineno"><a class="code" href="_wii_8h.html#a7f0cab74308e812106252c53b18c0391"> 67</a></span>&#160;<span class="preprocessor"></span><span class="preprocessor">#define l2cap_disconnect_response_control_flag (l2cap_event_flag &amp; L2CAP_FLAG_DISCONNECT_CONTROL_RESPONSE)</span></div>
<div class="line"><a name="l00068"></a><span class="lineno"><a class="code" href="_wii_8h.html#a667178a4486c4dee88e052b3562362cd"> 68</a></span>&#160;<span class="preprocessor"></span><span class="preprocessor">#define l2cap_disconnect_response_interrupt_flag (l2cap_event_flag &amp; L2CAP_FLAG_DISCONNECT_INTERRUPT_RESPONSE)</span></div>
<div class="line"><a name="l00069"></a><span class="lineno"><a class="code" href="_wii_8h.html#a728c7d92dd341dcc1b8f4bf95bb4826d"> 69</a></span>&#160;<span class="preprocessor"></span><span class="preprocessor">#define l2cap_connection_request_control_flag (l2cap_event_flag &amp; L2CAP_FLAG_CONNECTION_CONTROL_REQUEST)</span></div>
<div class="line"><a name="l00070"></a><span class="lineno"><a class="code" href="_wii_8h.html#a9fa7bceb44bbdff3229fd431627b9868"> 70</a></span>&#160;<span class="preprocessor"></span><span class="preprocessor">#define l2cap_connection_request_interrupt_flag (l2cap_event_flag &amp; L2CAP_FLAG_CONNECTION_INTERRUPT_REQUEST)</span></div>
<div class="line"><a name="l00071"></a><span class="lineno"> 71</span>&#160;<span class="preprocessor"></span></div>
<div class="line"><a name="l00072"></a><span class="lineno"> 72</span>&#160;<span class="comment">/* Wii event flags */</span></div>
<div class="line"><a name="l00073"></a><span class="lineno"><a class="code" href="_wii_8h.html#a34631633d4557244dc8eda52e8505acd"> 73</a></span>&#160;<span class="preprocessor">#define WII_FLAG_MOTION_PLUS_CONNECTED 0x400</span></div>
<div class="line"><a name="l00074"></a><span class="lineno"><a class="code" href="_wii_8h.html#ae0ff99c8862a05df8877329982e1ef61"> 74</a></span>&#160;<span class="preprocessor"></span><span class="preprocessor">#define WII_FLAG_NUNCHUCK_CONNECTED 0x800</span></div>
<div class="line"><a name="l00075"></a><span class="lineno"> 75</span>&#160;<span class="preprocessor"></span></div>
<div class="line"><a name="l00076"></a><span class="lineno"><a class="code" href="_wii_8h.html#a3d4b4f06162f96e91d97650f5c2e60f7"> 76</a></span>&#160;<span class="preprocessor">#define motion_plus_connected_flag (l2cap_event_flag &amp; WII_FLAG_MOTION_PLUS_CONNECTED)</span></div>
<div class="line"><a name="l00077"></a><span class="lineno"><a class="code" href="_wii_8h.html#a7ae9154397104e4df34302ed0884bbfb"> 77</a></span>&#160;<span class="preprocessor"></span><span class="preprocessor">#define nunchuck_connected_flag (l2cap_event_flag &amp; WII_FLAG_NUNCHUCK_CONNECTED)</span></div>
<div class="line"><a name="l00078"></a><span class="lineno"> 78</span>&#160;<span class="preprocessor"></span></div>
<div class="line"><a name="l00079"></a><span class="lineno"><a class="code" href="_wii_8h.html#a8f0b5b0dedaf5c25c4887f03ebfdd425"> 79</a></span>&#160;<span class="preprocessor">#define PAIR 1</span></div>
<div class="line"><a name="l00080"></a><span class="lineno"> 80</span>&#160;<span class="preprocessor"></span></div>
<div class="line"><a name="l00081"></a><span class="lineno"><a class="code" href="_wii_8h.html#a8f0b5b0dedaf5c25c4887f03ebfdd425"> 81</a></span>&#160;<span class="preprocessor">#define PAIR 1</span></div>
<div class="line"><a name="l00082"></a><span class="lineno"> 82</span>&#160;<span class="preprocessor"></span></div>
<div class="line"><a name="l00084"></a><span class="lineno"><a class="code" href="_wii_8h.html#a3edd2b2fd262b698309012868fad0be7"> 84</a></span>&#160;<span class="keyword">enum</span> <a class="code" href="_wii_8h.html#a3edd2b2fd262b698309012868fad0be7">Hat</a> {</div>
<div class="line"><a name="l00086"></a><span class="lineno"><a class="code" href="_wii_8h.html#a3edd2b2fd262b698309012868fad0be7aed1a7a35bf1b9c1003fbe3dd4a61a06d"> 86</a></span>&#160; <a class="code" href="_wii_8h.html#a3edd2b2fd262b698309012868fad0be7aed1a7a35bf1b9c1003fbe3dd4a61a06d">HatX</a> = 0,</div>
<div class="line"><a name="l00088"></a><span class="lineno"><a class="code" href="_wii_8h.html#a3edd2b2fd262b698309012868fad0be7ae2ac743b5ba1752933e09f1dac48d97b"> 88</a></span>&#160; <a class="code" href="_wii_8h.html#a3edd2b2fd262b698309012868fad0be7ae2ac743b5ba1752933e09f1dac48d97b">HatY</a> = 1,</div>
<div class="line"><a name="l00089"></a><span class="lineno"> 89</span>&#160;};</div>
<div class="line"><a name="l00090"></a><span class="lineno"> 90</span>&#160;</div>
<div class="line"><a name="l00096"></a><span class="lineno"><a class="code" href="class_w_i_i.html"> 96</a></span>&#160;<span class="keyword">class </span><a class="code" href="class_w_i_i.html">WII</a> : <span class="keyword">public</span> <a class="code" href="class_bluetooth_service.html">BluetoothService</a> {</div>
<div class="line"><a name="l00097"></a><span class="lineno"> 97</span>&#160;<span class="keyword">public</span>:</div>
<div class="line"><a name="l00104"></a><span class="lineno"> 104</span>&#160; <a class="code" href="class_w_i_i.html#a6597cb0e240a8ccb4ebdb236daef712e">WII</a>(<a class="code" href="class_b_t_d.html">BTD</a> *p, <span class="keywordtype">bool</span> <a class="code" href="class_w_i_i.html#a39c3101b26cc549d5258018b3d05c608">pair</a> = <span class="keyword">false</span>);</div>
<div class="line"><a name="l00105"></a><span class="lineno"> 105</span>&#160;</div>
<div class="line"><a name="l00111"></a><span class="lineno"> 111</span>&#160; <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="class_w_i_i.html#a81e1eb4d9ef9999a84e71d764d54dff7">ACLData</a>(uint8_t* <a class="code" href="class_w_i_i.html#a81e1eb4d9ef9999a84e71d764d54dff7">ACLData</a>);</div>
<div class="line"><a name="l00113"></a><span class="lineno"> 113</span>&#160; <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="class_w_i_i.html#ac5cd06f3e9aa2a0d9b9691f00c047e72">Run</a>();</div>
<div class="line"><a name="l00115"></a><span class="lineno"> 115</span>&#160; <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="class_w_i_i.html#a769ee2f9a0088da097438bc3cc677f7c">Reset</a>();</div>
<div class="line"><a name="l00117"></a><span class="lineno"> 117</span>&#160; <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="class_w_i_i.html#aabe4780f258dada1c0564a4ac7607370">disconnect</a>();</div>
<div class="line"><a name="l00129"></a><span class="lineno"> 129</span>&#160; <span class="keywordtype">bool</span> <a class="code" href="class_w_i_i.html#acf4b3ef0a4fa0cf71133a22213361288">getButtonPress</a>(<a class="code" href="controller_enums_8h.html#a03bfec859eac87be20f8952c1eb89de0">Button</a> b);</div>
<div class="line"><a name="l00130"></a><span class="lineno"> 130</span>&#160; <span class="keywordtype">bool</span> <a class="code" href="class_w_i_i.html#adbf9ccb1725dc432e07ca19468713116">getButtonClick</a>(<a class="code" href="controller_enums_8h.html#a03bfec859eac87be20f8952c1eb89de0">Button</a> b);</div>
<div class="line"><a name="l00135"></a><span class="lineno"><a class="code" href="class_w_i_i.html#a39c3101b26cc549d5258018b3d05c608"> 135</a></span>&#160; <span class="keywordtype">void</span> <a class="code" href="class_w_i_i.html#a39c3101b26cc549d5258018b3d05c608">pair</a>(<span class="keywordtype">void</span>) {</div>
<div class="line"><a name="l00136"></a><span class="lineno"> 136</span>&#160; <span class="keywordflow">if</span>(pBtd)</div>
<div class="line"><a name="l00137"></a><span class="lineno"> 137</span>&#160; pBtd-&gt;<a class="code" href="class_b_t_d.html#a6b66a27c0fd359e3129f53451352b55c">pairWithWiimote</a>();</div>
<div class="line"><a name="l00138"></a><span class="lineno"> 138</span>&#160; }</div>
<div class="line"><a name="l00144"></a><span class="lineno"> 144</span>&#160; uint8_t <a class="code" href="class_w_i_i.html#ab16e907132354be9848fd91a6a5171db">getAnalogHat</a>(<a class="code" href="_wii_8h.html#a3edd2b2fd262b698309012868fad0be7">Hat</a> a);</div>
<div class="line"><a name="l00150"></a><span class="lineno"> 150</span>&#160; uint16_t <a class="code" href="class_w_i_i.html#ab16e907132354be9848fd91a6a5171db">getAnalogHat</a>(<a class="code" href="controller_enums_8h.html#aaaabdefc068fd57ec2bef2b62ea4ba92">AnalogHat</a> a);</div>
<div class="line"><a name="l00151"></a><span class="lineno"> 151</span>&#160;</div>
<div class="line"><a name="l00156"></a><span class="lineno"><a class="code" href="class_w_i_i.html#a748172bd57804856594ea8e21601319e"> 156</a></span>&#160; <span class="keywordtype">double</span> <a class="code" href="class_w_i_i.html#a748172bd57804856594ea8e21601319e">getPitch</a>() {</div>
<div class="line"><a name="l00157"></a><span class="lineno"> 157</span>&#160; <span class="keywordflow">return</span> pitch;</div>
<div class="line"><a name="l00158"></a><span class="lineno"> 158</span>&#160; };</div>
<div class="line"><a name="l00159"></a><span class="lineno"> 159</span>&#160;</div>
<div class="line"><a name="l00164"></a><span class="lineno"><a class="code" href="class_w_i_i.html#a6ac037d884f97319892e8671ef070c03"> 164</a></span>&#160; <span class="keywordtype">double</span> <a class="code" href="class_w_i_i.html#a6ac037d884f97319892e8671ef070c03">getRoll</a>() {</div>
<div class="line"><a name="l00165"></a><span class="lineno"> 165</span>&#160; <span class="keywordflow">return</span> roll;</div>
<div class="line"><a name="l00166"></a><span class="lineno"> 166</span>&#160; };</div>
<div class="line"><a name="l00167"></a><span class="lineno"> 167</span>&#160;</div>
<div class="line"><a name="l00174"></a><span class="lineno"><a class="code" href="class_w_i_i.html#ae92e129c54c8131f4a2c55582dfd2f11"> 174</a></span>&#160; <span class="keywordtype">double</span> <a class="code" href="class_w_i_i.html#ae92e129c54c8131f4a2c55582dfd2f11">getYaw</a>() {</div>
<div class="line"><a name="l00175"></a><span class="lineno"> 175</span>&#160; <span class="keywordflow">return</span> <a class="code" href="class_w_i_i.html#a988db5b35cfc3c543f93f49587a50e62">gyroYaw</a>;</div>
<div class="line"><a name="l00176"></a><span class="lineno"> 176</span>&#160; };</div>
<div class="line"><a name="l00177"></a><span class="lineno"> 177</span>&#160;</div>
<div class="line"><a name="l00179"></a><span class="lineno"> 179</span>&#160; <span class="keywordtype">void</span> <a class="code" href="class_w_i_i.html#a6e97bfcfb134b63d7190ba1bc326e1d3">setAllOff</a>();</div>
<div class="line"><a name="l00181"></a><span class="lineno"> 181</span>&#160; <span class="keywordtype">void</span> <a class="code" href="class_w_i_i.html#a2c5c32841b020b248f757cb793acb936">setRumbleOff</a>();</div>
<div class="line"><a name="l00183"></a><span class="lineno"> 183</span>&#160; <span class="keywordtype">void</span> <a class="code" href="class_w_i_i.html#a0d9c869bd3677c4488a586c38558a137">setRumbleOn</a>();</div>
<div class="line"><a name="l00185"></a><span class="lineno"> 185</span>&#160; <span class="keywordtype">void</span> <a class="code" href="class_w_i_i.html#a841396b533cccccb05db37d35f6fef9c">setRumbleToggle</a>();</div>
<div class="line"><a name="l00186"></a><span class="lineno"> 186</span>&#160;</div>
<div class="line"><a name="l00191"></a><span class="lineno"> 191</span>&#160; <span class="keywordtype">void</span> <a class="code" href="class_w_i_i.html#ae7e07f929fba8f0ff061a1405baa2b58">setLedRaw</a>(uint8_t value);</div>
<div class="line"><a name="l00196"></a><span class="lineno"> 196</span>&#160; <span class="keywordtype">void</span> <a class="code" href="class_w_i_i.html#a7efe7577ba30c218f6fbd3804a53d242">setLedOff</a>(<a class="code" href="controller_enums_8h.html#aadcb6002d2b42fdfe01490f730ab00a6">LED</a> a);</div>
<div class="line"><a name="l00201"></a><span class="lineno"> 201</span>&#160; <span class="keywordtype">void</span> <a class="code" href="class_w_i_i.html#a3a7b9dd571c5a8597bfb194000bd517c">setLedOn</a>(<a class="code" href="controller_enums_8h.html#aadcb6002d2b42fdfe01490f730ab00a6">LED</a> a);</div>
<div class="line"><a name="l00206"></a><span class="lineno"> 206</span>&#160; <span class="keywordtype">void</span> <a class="code" href="class_w_i_i.html#af7755e2b2a161a550c99de2ca1018ce3">setLedToggle</a>(<a class="code" href="controller_enums_8h.html#aadcb6002d2b42fdfe01490f730ab00a6">LED</a> a);</div>
<div class="line"><a name="l00216"></a><span class="lineno"> 216</span>&#160; <span class="keywordtype">void</span> <a class="code" href="class_w_i_i.html#a5d3b4a33ebc2ca9ebb154e10a05dbdd4">setLedStatus</a>();</div>
<div class="line"><a name="l00217"></a><span class="lineno"> 217</span>&#160;</div>
<div class="line"><a name="l00221"></a><span class="lineno"> 221</span>&#160; <span class="keywordtype">void</span> <a class="code" href="class_w_i_i.html#acf275afab058a712ab84fac6c38f8f54">statusRequest</a>();</div>
<div class="line"><a name="l00226"></a><span class="lineno"><a class="code" href="class_w_i_i.html#ae946f7d6e9ce89fb083f5f138c0736c2"> 226</a></span>&#160; uint8_t <a class="code" href="class_w_i_i.html#ae946f7d6e9ce89fb083f5f138c0736c2">getBatteryLevel</a>() {</div>
<div class="line"><a name="l00227"></a><span class="lineno"> 227</span>&#160; <span class="keywordflow">return</span> batteryLevel;</div>
<div class="line"><a name="l00228"></a><span class="lineno"> 228</span>&#160; };</div>
<div class="line"><a name="l00233"></a><span class="lineno"><a class="code" href="class_w_i_i.html#a8e9ac1d379db5c07c478401046a1c0ac"> 233</a></span>&#160; uint8_t <a class="code" href="class_w_i_i.html#a8e9ac1d379db5c07c478401046a1c0ac">getWiiState</a>() {</div>
<div class="line"><a name="l00234"></a><span class="lineno"> 234</span>&#160; <span class="keywordflow">return</span> wiiState;</div>
<div class="line"><a name="l00082"></a><span class="lineno"><a class="code" href="_wii_8h.html#a3edd2b2fd262b698309012868fad0be7"> 82</a></span>&#160;<span class="keyword">enum</span> <a class="code" href="_wii_8h.html#a3edd2b2fd262b698309012868fad0be7">Hat</a> {</div>
<div class="line"><a name="l00084"></a><span class="lineno"><a class="code" href="_wii_8h.html#a3edd2b2fd262b698309012868fad0be7aed1a7a35bf1b9c1003fbe3dd4a61a06d"> 84</a></span>&#160; <a class="code" href="_wii_8h.html#a3edd2b2fd262b698309012868fad0be7aed1a7a35bf1b9c1003fbe3dd4a61a06d">HatX</a> = 0,</div>
<div class="line"><a name="l00086"></a><span class="lineno"><a class="code" href="_wii_8h.html#a3edd2b2fd262b698309012868fad0be7ae2ac743b5ba1752933e09f1dac48d97b"> 86</a></span>&#160; <a class="code" href="_wii_8h.html#a3edd2b2fd262b698309012868fad0be7ae2ac743b5ba1752933e09f1dac48d97b">HatY</a> = 1,</div>
<div class="line"><a name="l00087"></a><span class="lineno"> 87</span>&#160;};</div>
<div class="line"><a name="l00088"></a><span class="lineno"> 88</span>&#160;</div>
<div class="line"><a name="l00094"></a><span class="lineno"><a class="code" href="class_w_i_i.html"> 94</a></span>&#160;<span class="keyword">class </span><a class="code" href="class_w_i_i.html">WII</a> : <span class="keyword">public</span> <a class="code" href="class_bluetooth_service.html">BluetoothService</a> {</div>
<div class="line"><a name="l00095"></a><span class="lineno"> 95</span>&#160;<span class="keyword">public</span>:</div>
<div class="line"><a name="l00102"></a><span class="lineno"> 102</span>&#160; <a class="code" href="class_w_i_i.html#a6597cb0e240a8ccb4ebdb236daef712e">WII</a>(<a class="code" href="class_b_t_d.html">BTD</a> *p, <span class="keywordtype">bool</span> <a class="code" href="class_w_i_i.html#a39c3101b26cc549d5258018b3d05c608">pair</a> = <span class="keyword">false</span>);</div>
<div class="line"><a name="l00103"></a><span class="lineno"> 103</span>&#160;</div>
<div class="line"><a name="l00109"></a><span class="lineno"> 109</span>&#160; <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="class_w_i_i.html#a81e1eb4d9ef9999a84e71d764d54dff7">ACLData</a>(uint8_t* <a class="code" href="class_w_i_i.html#a81e1eb4d9ef9999a84e71d764d54dff7">ACLData</a>);</div>
<div class="line"><a name="l00111"></a><span class="lineno"> 111</span>&#160; <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="class_w_i_i.html#ac5cd06f3e9aa2a0d9b9691f00c047e72">Run</a>();</div>
<div class="line"><a name="l00113"></a><span class="lineno"> 113</span>&#160; <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="class_w_i_i.html#a769ee2f9a0088da097438bc3cc677f7c">Reset</a>();</div>
<div class="line"><a name="l00115"></a><span class="lineno"> 115</span>&#160; <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="class_w_i_i.html#aabe4780f258dada1c0564a4ac7607370">disconnect</a>();</div>
<div class="line"><a name="l00127"></a><span class="lineno"> 127</span>&#160; <span class="keywordtype">bool</span> <a class="code" href="class_w_i_i.html#acf4b3ef0a4fa0cf71133a22213361288">getButtonPress</a>(<a class="code" href="controller_enums_8h.html#a03bfec859eac87be20f8952c1eb89de0">Button</a> b);</div>
<div class="line"><a name="l00128"></a><span class="lineno"> 128</span>&#160; <span class="keywordtype">bool</span> <a class="code" href="class_w_i_i.html#adbf9ccb1725dc432e07ca19468713116">getButtonClick</a>(<a class="code" href="controller_enums_8h.html#a03bfec859eac87be20f8952c1eb89de0">Button</a> b);</div>
<div class="line"><a name="l00133"></a><span class="lineno"><a class="code" href="class_w_i_i.html#a39c3101b26cc549d5258018b3d05c608"> 133</a></span>&#160; <span class="keywordtype">void</span> <a class="code" href="class_w_i_i.html#a39c3101b26cc549d5258018b3d05c608">pair</a>(<span class="keywordtype">void</span>) {</div>
<div class="line"><a name="l00134"></a><span class="lineno"> 134</span>&#160; <span class="keywordflow">if</span>(pBtd)</div>
<div class="line"><a name="l00135"></a><span class="lineno"> 135</span>&#160; pBtd-&gt;<a class="code" href="class_b_t_d.html#a6b66a27c0fd359e3129f53451352b55c">pairWithWiimote</a>();</div>
<div class="line"><a name="l00136"></a><span class="lineno"> 136</span>&#160; }</div>
<div class="line"><a name="l00142"></a><span class="lineno"> 142</span>&#160; uint8_t <a class="code" href="class_w_i_i.html#ab16e907132354be9848fd91a6a5171db">getAnalogHat</a>(<a class="code" href="_wii_8h.html#a3edd2b2fd262b698309012868fad0be7">Hat</a> a);</div>
<div class="line"><a name="l00148"></a><span class="lineno"> 148</span>&#160; uint16_t <a class="code" href="class_w_i_i.html#ab16e907132354be9848fd91a6a5171db">getAnalogHat</a>(<a class="code" href="controller_enums_8h.html#aaaabdefc068fd57ec2bef2b62ea4ba92">AnalogHat</a> a);</div>
<div class="line"><a name="l00149"></a><span class="lineno"> 149</span>&#160;</div>
<div class="line"><a name="l00154"></a><span class="lineno"><a class="code" href="class_w_i_i.html#a748172bd57804856594ea8e21601319e"> 154</a></span>&#160; <span class="keywordtype">double</span> <a class="code" href="class_w_i_i.html#a748172bd57804856594ea8e21601319e">getPitch</a>() {</div>
<div class="line"><a name="l00155"></a><span class="lineno"> 155</span>&#160; <span class="keywordflow">return</span> pitch;</div>
<div class="line"><a name="l00156"></a><span class="lineno"> 156</span>&#160; };</div>
<div class="line"><a name="l00157"></a><span class="lineno"> 157</span>&#160;</div>
<div class="line"><a name="l00162"></a><span class="lineno"><a class="code" href="class_w_i_i.html#a6ac037d884f97319892e8671ef070c03"> 162</a></span>&#160; <span class="keywordtype">double</span> <a class="code" href="class_w_i_i.html#a6ac037d884f97319892e8671ef070c03">getRoll</a>() {</div>
<div class="line"><a name="l00163"></a><span class="lineno"> 163</span>&#160; <span class="keywordflow">return</span> roll;</div>
<div class="line"><a name="l00164"></a><span class="lineno"> 164</span>&#160; };</div>
<div class="line"><a name="l00165"></a><span class="lineno"> 165</span>&#160;</div>
<div class="line"><a name="l00172"></a><span class="lineno"><a class="code" href="class_w_i_i.html#ae92e129c54c8131f4a2c55582dfd2f11"> 172</a></span>&#160; <span class="keywordtype">double</span> <a class="code" href="class_w_i_i.html#ae92e129c54c8131f4a2c55582dfd2f11">getYaw</a>() {</div>
<div class="line"><a name="l00173"></a><span class="lineno"> 173</span>&#160; <span class="keywordflow">return</span> <a class="code" href="class_w_i_i.html#a988db5b35cfc3c543f93f49587a50e62">gyroYaw</a>;</div>
<div class="line"><a name="l00174"></a><span class="lineno"> 174</span>&#160; };</div>
<div class="line"><a name="l00175"></a><span class="lineno"> 175</span>&#160;</div>
<div class="line"><a name="l00177"></a><span class="lineno"> 177</span>&#160; <span class="keywordtype">void</span> <a class="code" href="class_w_i_i.html#a6e97bfcfb134b63d7190ba1bc326e1d3">setAllOff</a>();</div>
<div class="line"><a name="l00179"></a><span class="lineno"> 179</span>&#160; <span class="keywordtype">void</span> <a class="code" href="class_w_i_i.html#a2c5c32841b020b248f757cb793acb936">setRumbleOff</a>();</div>
<div class="line"><a name="l00181"></a><span class="lineno"> 181</span>&#160; <span class="keywordtype">void</span> <a class="code" href="class_w_i_i.html#a0d9c869bd3677c4488a586c38558a137">setRumbleOn</a>();</div>
<div class="line"><a name="l00183"></a><span class="lineno"> 183</span>&#160; <span class="keywordtype">void</span> <a class="code" href="class_w_i_i.html#a841396b533cccccb05db37d35f6fef9c">setRumbleToggle</a>();</div>
<div class="line"><a name="l00184"></a><span class="lineno"> 184</span>&#160;</div>
<div class="line"><a name="l00189"></a><span class="lineno"> 189</span>&#160; <span class="keywordtype">void</span> <a class="code" href="class_w_i_i.html#ae7e07f929fba8f0ff061a1405baa2b58">setLedRaw</a>(uint8_t value);</div>
<div class="line"><a name="l00194"></a><span class="lineno"> 194</span>&#160; <span class="keywordtype">void</span> <a class="code" href="class_w_i_i.html#a7efe7577ba30c218f6fbd3804a53d242">setLedOff</a>(<a class="code" href="controller_enums_8h.html#aadcb6002d2b42fdfe01490f730ab00a6">LED</a> a);</div>
<div class="line"><a name="l00199"></a><span class="lineno"> 199</span>&#160; <span class="keywordtype">void</span> <a class="code" href="class_w_i_i.html#a3a7b9dd571c5a8597bfb194000bd517c">setLedOn</a>(<a class="code" href="controller_enums_8h.html#aadcb6002d2b42fdfe01490f730ab00a6">LED</a> a);</div>
<div class="line"><a name="l00204"></a><span class="lineno"> 204</span>&#160; <span class="keywordtype">void</span> <a class="code" href="class_w_i_i.html#af7755e2b2a161a550c99de2ca1018ce3">setLedToggle</a>(<a class="code" href="controller_enums_8h.html#aadcb6002d2b42fdfe01490f730ab00a6">LED</a> a);</div>
<div class="line"><a name="l00214"></a><span class="lineno"> 214</span>&#160; <span class="keywordtype">void</span> <a class="code" href="class_w_i_i.html#a5d3b4a33ebc2ca9ebb154e10a05dbdd4">setLedStatus</a>();</div>
<div class="line"><a name="l00215"></a><span class="lineno"> 215</span>&#160;</div>
<div class="line"><a name="l00220"></a><span class="lineno"> 220</span>&#160; uint8_t <a class="code" href="class_w_i_i.html#ae946f7d6e9ce89fb083f5f138c0736c2">getBatteryLevel</a>();</div>
<div class="line"><a name="l00225"></a><span class="lineno"><a class="code" href="class_w_i_i.html#a8e9ac1d379db5c07c478401046a1c0ac"> 225</a></span>&#160; uint8_t <a class="code" href="class_w_i_i.html#a8e9ac1d379db5c07c478401046a1c0ac">getWiiState</a>() {</div>
<div class="line"><a name="l00226"></a><span class="lineno"> 226</span>&#160; <span class="keywordflow">return</span> wiiState;</div>
<div class="line"><a name="l00227"></a><span class="lineno"> 227</span>&#160; };</div>
<div class="line"><a name="l00228"></a><span class="lineno"> 228</span>&#160;</div>
<div class="line"><a name="l00233"></a><span class="lineno"><a class="code" href="class_w_i_i.html#af384f13c59fee08a4be0c541e6a9b387"> 233</a></span>&#160; <span class="keywordtype">void</span> <a class="code" href="class_w_i_i.html#af384f13c59fee08a4be0c541e6a9b387">attachOnInit</a>(<span class="keywordtype">void</span> (*funcOnInit)(<span class="keywordtype">void</span>)) {</div>
<div class="line"><a name="l00234"></a><span class="lineno"> 234</span>&#160; pFuncOnInit = funcOnInit;</div>
<div class="line"><a name="l00235"></a><span class="lineno"><a class="code" href="class_w_i_i.html#ae25a8ea1b0713801e0209e795b4596fa"> 235</a></span>&#160; };</div>
<div class="line"><a name="l00240"></a><span class="lineno"> 240</span>&#160; <span class="keywordtype">bool</span> <a class="code" href="class_w_i_i.html#ae25a8ea1b0713801e0209e795b4596fa">wiimoteConnected</a>;</div>
<div class="line"><a name="l00242"></a><span class="lineno"><a class="code" href="class_w_i_i.html#a7cb4cec343c65fd350e6b05043d7f1a8"> 242</a></span>&#160; <span class="keywordtype">bool</span> <a class="code" href="class_w_i_i.html#a7cb4cec343c65fd350e6b05043d7f1a8">nunchuckConnected</a>;</div>
@ -310,87 +309,93 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
<div class="line"><a name="l00418"></a><span class="lineno"> 418</span>&#160;<span class="preprocessor">#endif</span></div>
<div class="line"><a name="l00419"></a><span class="lineno"> 419</span>&#160;<span class="preprocessor"></span></div>
<div class="line"><a name="l00420"></a><span class="lineno"> 420</span>&#160;<span class="keyword">private</span>:</div>
<div class="line"><a name="l00421"></a><span class="lineno"> 421</span>&#160; <span class="comment">/* Mandatory members */</span></div>
<div class="line"><a name="l00422"></a><span class="lineno"> 422</span>&#160; <a class="code" href="class_b_t_d.html">BTD</a> *pBtd;</div>
<div class="line"><a name="l00423"></a><span class="lineno"> 423</span>&#160;</div>
<div class="line"><a name="l00424"></a><span class="lineno"> 424</span>&#160; <span class="keywordtype">void</span> L2CAP_task(); <span class="comment">// L2CAP state machine</span></div>
<div class="line"><a name="l00425"></a><span class="lineno"> 425</span>&#160;</div>
<div class="line"><a name="l00426"></a><span class="lineno"> 426</span>&#160; <span class="comment">/* Variables filled from HCI event management */</span></div>
<div class="line"><a name="l00427"></a><span class="lineno"> 427</span>&#160; uint16_t hci_handle;</div>
<div class="line"><a name="l00428"></a><span class="lineno"> 428</span>&#160; <span class="keywordtype">bool</span> activeConnection; <span class="comment">// Used to indicate if it&#39;s already has established a connection</span></div>
<div class="line"><a name="l00429"></a><span class="lineno"> 429</span>&#160;</div>
<div class="line"><a name="l00430"></a><span class="lineno"> 430</span>&#160; <span class="comment">/* variables used by high level L2CAP task */</span></div>
<div class="line"><a name="l00431"></a><span class="lineno"> 431</span>&#160; uint8_t l2cap_state;</div>
<div class="line"><a name="l00432"></a><span class="lineno"> 432</span>&#160; uint16_t l2cap_event_flag; <span class="comment">// l2cap flags of received bluetooth events</span></div>
<div class="line"><a name="l00433"></a><span class="lineno"> 433</span>&#160;</div>
<div class="line"><a name="l00434"></a><span class="lineno"> 434</span>&#160; uint32_t ButtonState;</div>
<div class="line"><a name="l00435"></a><span class="lineno"> 435</span>&#160; uint32_t OldButtonState;</div>
<div class="line"><a name="l00436"></a><span class="lineno"> 436</span>&#160; uint32_t ButtonClickState;</div>
<div class="line"><a name="l00437"></a><span class="lineno"> 437</span>&#160; uint16_t hatValues[4];</div>
<div class="line"><a name="l00438"></a><span class="lineno"> 438</span>&#160;</div>
<div class="line"><a name="l00439"></a><span class="lineno"> 439</span>&#160; uint8_t HIDBuffer[3]; <span class="comment">// Used to store HID commands</span></div>
<div class="line"><a name="l00421"></a><span class="lineno"> 421</span>&#160; <a class="code" href="class_b_t_d.html">BTD</a> *pBtd; <span class="comment">// Pointer to BTD instance</span></div>
<div class="line"><a name="l00422"></a><span class="lineno"> 422</span>&#160;</div>
<div class="line"><a name="l00428"></a><span class="lineno"> 428</span>&#160; <span class="keywordtype">void</span> onInit();</div>
<div class="line"><a name="l00429"></a><span class="lineno"> 429</span>&#160; void (*pFuncOnInit)(void); <span class="comment">// Pointer to function called in onInit()</span></div>
<div class="line"><a name="l00430"></a><span class="lineno"> 430</span>&#160;</div>
<div class="line"><a name="l00431"></a><span class="lineno"> 431</span>&#160; <span class="keywordtype">void</span> L2CAP_task(); <span class="comment">// L2CAP state machine</span></div>
<div class="line"><a name="l00432"></a><span class="lineno"> 432</span>&#160;</div>
<div class="line"><a name="l00433"></a><span class="lineno"> 433</span>&#160; <span class="comment">/* Variables filled from HCI event management */</span></div>
<div class="line"><a name="l00434"></a><span class="lineno"> 434</span>&#160; uint16_t hci_handle;</div>
<div class="line"><a name="l00435"></a><span class="lineno"> 435</span>&#160; <span class="keywordtype">bool</span> activeConnection; <span class="comment">// Used to indicate if it&#39;s already has established a connection</span></div>
<div class="line"><a name="l00436"></a><span class="lineno"> 436</span>&#160;</div>
<div class="line"><a name="l00437"></a><span class="lineno"> 437</span>&#160; <span class="comment">/* Variables used by high level L2CAP task */</span></div>
<div class="line"><a name="l00438"></a><span class="lineno"> 438</span>&#160; uint8_t l2cap_state;</div>
<div class="line"><a name="l00439"></a><span class="lineno"> 439</span>&#160; uint16_t l2cap_event_flag; <span class="comment">// l2cap flags of received Bluetooth events</span></div>
<div class="line"><a name="l00440"></a><span class="lineno"> 440</span>&#160;</div>
<div class="line"><a name="l00441"></a><span class="lineno"> 441</span>&#160; uint16_t stateCounter;</div>
<div class="line"><a name="l00442"></a><span class="lineno"> 442</span>&#160; <span class="keywordtype">bool</span> unknownExtensionConnected;</div>
<div class="line"><a name="l00443"></a><span class="lineno"> 443</span>&#160; <span class="keywordtype">bool</span> extensionConnected;</div>
<div class="line"><a name="l00444"></a><span class="lineno"> 444</span>&#160;</div>
<div class="line"><a name="l00445"></a><span class="lineno"> 445</span>&#160; <span class="comment">/* L2CAP Channels */</span></div>
<div class="line"><a name="l00446"></a><span class="lineno"> 446</span>&#160; uint8_t control_scid[2]; <span class="comment">// L2CAP source CID for HID_Control</span></div>
<div class="line"><a name="l00447"></a><span class="lineno"> 447</span>&#160; uint8_t control_dcid[2]; <span class="comment">// 0x0060</span></div>
<div class="line"><a name="l00448"></a><span class="lineno"> 448</span>&#160; uint8_t interrupt_scid[2]; <span class="comment">// L2CAP source CID for HID_Interrupt</span></div>
<div class="line"><a name="l00449"></a><span class="lineno"> 449</span>&#160; uint8_t interrupt_dcid[2]; <span class="comment">// 0x0061</span></div>
<div class="line"><a name="l00450"></a><span class="lineno"> 450</span>&#160; uint8_t identifier; <span class="comment">// Identifier for connection</span></div>
<div class="line"><a name="l00451"></a><span class="lineno"> 451</span>&#160;</div>
<div class="line"><a name="l00452"></a><span class="lineno"> 452</span>&#160; <span class="comment">/* HID Commands */</span></div>
<div class="line"><a name="l00453"></a><span class="lineno"> 453</span>&#160; <span class="keywordtype">void</span> HID_Command(uint8_t* data, uint8_t nbytes);</div>
<div class="line"><a name="l00454"></a><span class="lineno"> 454</span>&#160; <span class="keywordtype">void</span> setReportMode(<span class="keywordtype">bool</span> continuous, uint8_t mode);</div>
<div class="line"><a name="l00455"></a><span class="lineno"> 455</span>&#160;</div>
<div class="line"><a name="l00456"></a><span class="lineno"> 456</span>&#160; <span class="keywordtype">void</span> writeData(uint32_t offset, uint8_t size, uint8_t* data);</div>
<div class="line"><a name="l00457"></a><span class="lineno"> 457</span>&#160; <span class="keywordtype">void</span> initExtension1();</div>
<div class="line"><a name="l00458"></a><span class="lineno"> 458</span>&#160; <span class="keywordtype">void</span> initExtension2();</div>
<div class="line"><a name="l00459"></a><span class="lineno"> 459</span>&#160;</div>
<div class="line"><a name="l00460"></a><span class="lineno"> 460</span>&#160; <span class="keywordtype">void</span> readData(uint32_t offset, uint16_t size, <span class="keywordtype">bool</span> EEPROM);</div>
<div class="line"><a name="l00461"></a><span class="lineno"> 461</span>&#160; <span class="keywordtype">void</span> readExtensionType();</div>
<div class="line"><a name="l00462"></a><span class="lineno"> 462</span>&#160; <span class="keywordtype">void</span> readCalData();</div>
<div class="line"><a name="l00463"></a><span class="lineno"> 463</span>&#160;</div>
<div class="line"><a name="l00464"></a><span class="lineno"> 464</span>&#160; <span class="keywordtype">void</span> checkMotionPresent(); <span class="comment">// Used to see if a Motion Plus is connected to the Wiimote</span></div>
<div class="line"><a name="l00465"></a><span class="lineno"> 465</span>&#160; <span class="keywordtype">void</span> initMotionPlus();</div>
<div class="line"><a name="l00466"></a><span class="lineno"> 466</span>&#160; <span class="keywordtype">void</span> activateMotionPlus();</div>
<div class="line"><a name="l00467"></a><span class="lineno"> 467</span>&#160;</div>
<div class="line"><a name="l00468"></a><span class="lineno"> 468</span>&#160; <span class="keywordtype">double</span> pitch; <span class="comment">// Fusioned angle using a complimentary filter if the Motion Plus is connected</span></div>
<div class="line"><a name="l00469"></a><span class="lineno"> 469</span>&#160; <span class="keywordtype">double</span> roll; <span class="comment">// Fusioned angle using a complimentary filter if the Motion Plus is connected</span></div>
<div class="line"><a name="l00441"></a><span class="lineno"> 441</span>&#160; uint32_t ButtonState;</div>
<div class="line"><a name="l00442"></a><span class="lineno"> 442</span>&#160; uint32_t OldButtonState;</div>
<div class="line"><a name="l00443"></a><span class="lineno"> 443</span>&#160; uint32_t ButtonClickState;</div>
<div class="line"><a name="l00444"></a><span class="lineno"> 444</span>&#160; uint16_t hatValues[4];</div>
<div class="line"><a name="l00445"></a><span class="lineno"> 445</span>&#160;</div>
<div class="line"><a name="l00446"></a><span class="lineno"> 446</span>&#160; uint8_t HIDBuffer[3]; <span class="comment">// Used to store HID commands</span></div>
<div class="line"><a name="l00447"></a><span class="lineno"> 447</span>&#160;</div>
<div class="line"><a name="l00448"></a><span class="lineno"> 448</span>&#160; uint16_t stateCounter;</div>
<div class="line"><a name="l00449"></a><span class="lineno"> 449</span>&#160; <span class="keywordtype">bool</span> unknownExtensionConnected;</div>
<div class="line"><a name="l00450"></a><span class="lineno"> 450</span>&#160; <span class="keywordtype">bool</span> extensionConnected;</div>
<div class="line"><a name="l00451"></a><span class="lineno"> 451</span>&#160; <span class="keywordtype">bool</span> checkExtension; <span class="comment">// Set to false when getBatteryLevel() is called otherwise if should be true</span></div>
<div class="line"><a name="l00452"></a><span class="lineno"> 452</span>&#160; <span class="keywordtype">bool</span> motionPlusInside; <span class="comment">// True if it&#39;s a new Wiimote with the Motion Plus extension build into it</span></div>
<div class="line"><a name="l00453"></a><span class="lineno"> 453</span>&#160;</div>
<div class="line"><a name="l00454"></a><span class="lineno"> 454</span>&#160; <span class="comment">/* L2CAP Channels */</span></div>
<div class="line"><a name="l00455"></a><span class="lineno"> 455</span>&#160; uint8_t control_scid[2]; <span class="comment">// L2CAP source CID for HID_Control</span></div>
<div class="line"><a name="l00456"></a><span class="lineno"> 456</span>&#160; uint8_t control_dcid[2]; <span class="comment">// 0x0060</span></div>
<div class="line"><a name="l00457"></a><span class="lineno"> 457</span>&#160; uint8_t interrupt_scid[2]; <span class="comment">// L2CAP source CID for HID_Interrupt</span></div>
<div class="line"><a name="l00458"></a><span class="lineno"> 458</span>&#160; uint8_t interrupt_dcid[2]; <span class="comment">// 0x0061</span></div>
<div class="line"><a name="l00459"></a><span class="lineno"> 459</span>&#160; uint8_t identifier; <span class="comment">// Identifier for connection</span></div>
<div class="line"><a name="l00460"></a><span class="lineno"> 460</span>&#160;</div>
<div class="line"><a name="l00461"></a><span class="lineno"> 461</span>&#160; <span class="comment">/* HID Commands */</span></div>
<div class="line"><a name="l00462"></a><span class="lineno"> 462</span>&#160; <span class="keywordtype">void</span> HID_Command(uint8_t* data, uint8_t nbytes);</div>
<div class="line"><a name="l00463"></a><span class="lineno"> 463</span>&#160; <span class="keywordtype">void</span> setReportMode(<span class="keywordtype">bool</span> continuous, uint8_t mode);</div>
<div class="line"><a name="l00464"></a><span class="lineno"> 464</span>&#160;</div>
<div class="line"><a name="l00465"></a><span class="lineno"> 465</span>&#160; <span class="keywordtype">void</span> writeData(uint32_t offset, uint8_t size, uint8_t* data);</div>
<div class="line"><a name="l00466"></a><span class="lineno"> 466</span>&#160; <span class="keywordtype">void</span> initExtension1();</div>
<div class="line"><a name="l00467"></a><span class="lineno"> 467</span>&#160; <span class="keywordtype">void</span> initExtension2();</div>
<div class="line"><a name="l00468"></a><span class="lineno"> 468</span>&#160;</div>
<div class="line"><a name="l00469"></a><span class="lineno"> 469</span>&#160; <span class="keywordtype">void</span> statusRequest(); <span class="comment">// Used to update the Wiimote state and battery level</span></div>
<div class="line"><a name="l00470"></a><span class="lineno"> 470</span>&#160;</div>
<div class="line"><a name="l00471"></a><span class="lineno"> 471</span>&#160; <span class="keywordtype">bool</span> activateNunchuck;</div>
<div class="line"><a name="l00472"></a><span class="lineno"> 472</span>&#160; <span class="keywordtype">bool</span> motionValuesReset; <span class="comment">// This bool is true when the gyro values has been reset</span></div>
<div class="line"><a name="l00473"></a><span class="lineno"> 473</span>&#160; <span class="keywordtype">unsigned</span> <span class="keywordtype">long</span> timer;</div>
<div class="line"><a name="l00471"></a><span class="lineno"> 471</span>&#160; <span class="keywordtype">void</span> readData(uint32_t offset, uint16_t size, <span class="keywordtype">bool</span> EEPROM);</div>
<div class="line"><a name="l00472"></a><span class="lineno"> 472</span>&#160; <span class="keywordtype">void</span> readExtensionType();</div>
<div class="line"><a name="l00473"></a><span class="lineno"> 473</span>&#160; <span class="keywordtype">void</span> readCalData();</div>
<div class="line"><a name="l00474"></a><span class="lineno"> 474</span>&#160;</div>
<div class="line"><a name="l00475"></a><span class="lineno"> 475</span>&#160; uint8_t wiiState; <span class="comment">// Stores the value in l2capinbuf[12] - (0x01: Battery is nearly empty), (0x02: An Extension Controller is connected), (0x04: Speaker enabled), (0x08: IR enabled), (0x10: LED1, 0x20: LED2, 0x40: LED3, 0x80: LED4)</span></div>
<div class="line"><a name="l00476"></a><span class="lineno"> 476</span>&#160; uint8_t batteryLevel;</div>
<div class="line"><a name="l00477"></a><span class="lineno"> 477</span>&#160;</div>
<div class="line"><a name="l00478"></a><span class="lineno"> 478</span>&#160;<span class="preprocessor">#ifdef WIICAMERA</span></div>
<div class="line"><a name="l00479"></a><span class="lineno"> 479</span>&#160;<span class="preprocessor"></span> <span class="comment">/* Private function and variables for the readings from teh IR Camera */</span></div>
<div class="line"><a name="l00480"></a><span class="lineno"> 480</span>&#160; <span class="keywordtype">void</span> enableIRCamera1(); <span class="comment">// Sets bit 2 of output report 13</span></div>
<div class="line"><a name="l00481"></a><span class="lineno"> 481</span>&#160; <span class="keywordtype">void</span> enableIRCamera2(); <span class="comment">// Sets bit 2 of output report 1A</span></div>
<div class="line"><a name="l00482"></a><span class="lineno"> 482</span>&#160; <span class="keywordtype">void</span> writeSensitivityBlock1();</div>
<div class="line"><a name="l00483"></a><span class="lineno"> 483</span>&#160; <span class="keywordtype">void</span> writeSensitivityBlock2();</div>
<div class="line"><a name="l00484"></a><span class="lineno"> 484</span>&#160; <span class="keywordtype">void</span> write0x08Value();</div>
<div class="line"><a name="l00485"></a><span class="lineno"> 485</span>&#160; <span class="keywordtype">void</span> setWiiModeNumber(uint8_t mode_number);</div>
<div class="line"><a name="l00486"></a><span class="lineno"> 486</span>&#160;</div>
<div class="line"><a name="l00487"></a><span class="lineno"> 487</span>&#160; uint16_t IR_object_x1; <span class="comment">// IR x position 10 bits</span></div>
<div class="line"><a name="l00488"></a><span class="lineno"> 488</span>&#160; uint16_t IR_object_y1; <span class="comment">// IR y position 10 bits</span></div>
<div class="line"><a name="l00489"></a><span class="lineno"> 489</span>&#160; uint8_t IR_object_s1; <span class="comment">// IR size value</span></div>
<div class="line"><a name="l00490"></a><span class="lineno"> 490</span>&#160; uint16_t IR_object_x2;</div>
<div class="line"><a name="l00491"></a><span class="lineno"> 491</span>&#160; uint16_t IR_object_y2;</div>
<div class="line"><a name="l00492"></a><span class="lineno"> 492</span>&#160; uint8_t IR_object_s2;</div>
<div class="line"><a name="l00493"></a><span class="lineno"> 493</span>&#160; uint16_t IR_object_x3; <span class="comment">// IR x position 10 bits</span></div>
<div class="line"><a name="l00494"></a><span class="lineno"> 494</span>&#160; uint16_t IR_object_y3; <span class="comment">// IR y position 10 bits</span></div>
<div class="line"><a name="l00495"></a><span class="lineno"> 495</span>&#160; uint8_t IR_object_s3; <span class="comment">// IR size value</span></div>
<div class="line"><a name="l00496"></a><span class="lineno"> 496</span>&#160; uint16_t IR_object_x4;</div>
<div class="line"><a name="l00497"></a><span class="lineno"> 497</span>&#160; uint16_t IR_object_y4;</div>
<div class="line"><a name="l00498"></a><span class="lineno"> 498</span>&#160; uint8_t IR_object_s4;</div>
<div class="line"><a name="l00499"></a><span class="lineno"> 499</span>&#160;<span class="preprocessor">#endif</span></div>
<div class="line"><a name="l00500"></a><span class="lineno"> 500</span>&#160;<span class="preprocessor"></span>};</div>
<div class="line"><a name="l00501"></a><span class="lineno"> 501</span>&#160;<span class="preprocessor">#endif</span></div>
<div class="line"><a name="l00475"></a><span class="lineno"> 475</span>&#160; <span class="keywordtype">void</span> checkMotionPresent(); <span class="comment">// Used to see if a Motion Plus is connected to the Wiimote</span></div>
<div class="line"><a name="l00476"></a><span class="lineno"> 476</span>&#160; <span class="keywordtype">void</span> initMotionPlus();</div>
<div class="line"><a name="l00477"></a><span class="lineno"> 477</span>&#160; <span class="keywordtype">void</span> activateMotionPlus();</div>
<div class="line"><a name="l00478"></a><span class="lineno"> 478</span>&#160;</div>
<div class="line"><a name="l00479"></a><span class="lineno"> 479</span>&#160; <span class="keywordtype">double</span> pitch; <span class="comment">// Fusioned angle using a complimentary filter if the Motion Plus is connected</span></div>
<div class="line"><a name="l00480"></a><span class="lineno"> 480</span>&#160; <span class="keywordtype">double</span> roll; <span class="comment">// Fusioned angle using a complimentary filter if the Motion Plus is connected</span></div>
<div class="line"><a name="l00481"></a><span class="lineno"> 481</span>&#160;</div>
<div class="line"><a name="l00482"></a><span class="lineno"> 482</span>&#160; <span class="keywordtype">bool</span> activateNunchuck;</div>
<div class="line"><a name="l00483"></a><span class="lineno"> 483</span>&#160; <span class="keywordtype">bool</span> motionValuesReset; <span class="comment">// This bool is true when the gyro values has been reset</span></div>
<div class="line"><a name="l00484"></a><span class="lineno"> 484</span>&#160; <span class="keywordtype">unsigned</span> <span class="keywordtype">long</span> timer;</div>
<div class="line"><a name="l00485"></a><span class="lineno"> 485</span>&#160;</div>
<div class="line"><a name="l00486"></a><span class="lineno"> 486</span>&#160; uint8_t wiiState; <span class="comment">// Stores the value in l2capinbuf[12] - (0x01: Battery is nearly empty), (0x02: An Extension Controller is connected), (0x04: Speaker enabled), (0x08: IR enabled), (0x10: LED1, 0x20: LED2, 0x40: LED3, 0x80: LED4)</span></div>
<div class="line"><a name="l00487"></a><span class="lineno"> 487</span>&#160; uint8_t batteryLevel;</div>
<div class="line"><a name="l00488"></a><span class="lineno"> 488</span>&#160;</div>
<div class="line"><a name="l00489"></a><span class="lineno"> 489</span>&#160;<span class="preprocessor">#ifdef WIICAMERA</span></div>
<div class="line"><a name="l00490"></a><span class="lineno"> 490</span>&#160;<span class="preprocessor"></span> <span class="comment">/* Private function and variables for the readings from the IR Camera */</span></div>
<div class="line"><a name="l00491"></a><span class="lineno"> 491</span>&#160; <span class="keywordtype">void</span> enableIRCamera1(); <span class="comment">// Sets bit 2 of output report 13</span></div>
<div class="line"><a name="l00492"></a><span class="lineno"> 492</span>&#160; <span class="keywordtype">void</span> enableIRCamera2(); <span class="comment">// Sets bit 2 of output report 1A</span></div>
<div class="line"><a name="l00493"></a><span class="lineno"> 493</span>&#160; <span class="keywordtype">void</span> writeSensitivityBlock1();</div>
<div class="line"><a name="l00494"></a><span class="lineno"> 494</span>&#160; <span class="keywordtype">void</span> writeSensitivityBlock2();</div>
<div class="line"><a name="l00495"></a><span class="lineno"> 495</span>&#160; <span class="keywordtype">void</span> write0x08Value();</div>
<div class="line"><a name="l00496"></a><span class="lineno"> 496</span>&#160; <span class="keywordtype">void</span> setWiiModeNumber(uint8_t mode_number);</div>
<div class="line"><a name="l00497"></a><span class="lineno"> 497</span>&#160;</div>
<div class="line"><a name="l00498"></a><span class="lineno"> 498</span>&#160; uint16_t IR_object_x1; <span class="comment">// IR x position 10 bits</span></div>
<div class="line"><a name="l00499"></a><span class="lineno"> 499</span>&#160; uint16_t IR_object_y1; <span class="comment">// IR y position 10 bits</span></div>
<div class="line"><a name="l00500"></a><span class="lineno"> 500</span>&#160; uint8_t IR_object_s1; <span class="comment">// IR size value</span></div>
<div class="line"><a name="l00501"></a><span class="lineno"> 501</span>&#160; uint16_t IR_object_x2;</div>
<div class="line"><a name="l00502"></a><span class="lineno"> 502</span>&#160; uint16_t IR_object_y2;</div>
<div class="line"><a name="l00503"></a><span class="lineno"> 503</span>&#160; uint8_t IR_object_s2;</div>
<div class="line"><a name="l00504"></a><span class="lineno"> 504</span>&#160; uint16_t IR_object_x3; <span class="comment">// IR x position 10 bits</span></div>
<div class="line"><a name="l00505"></a><span class="lineno"> 505</span>&#160; uint16_t IR_object_y3; <span class="comment">// IR y position 10 bits</span></div>
<div class="line"><a name="l00506"></a><span class="lineno"> 506</span>&#160; uint8_t IR_object_s3; <span class="comment">// IR size value</span></div>
<div class="line"><a name="l00507"></a><span class="lineno"> 507</span>&#160; uint16_t IR_object_x4;</div>
<div class="line"><a name="l00508"></a><span class="lineno"> 508</span>&#160; uint16_t IR_object_y4;</div>
<div class="line"><a name="l00509"></a><span class="lineno"> 509</span>&#160; uint8_t IR_object_s4;</div>
<div class="line"><a name="l00510"></a><span class="lineno"> 510</span>&#160;<span class="preprocessor">#endif</span></div>
<div class="line"><a name="l00511"></a><span class="lineno"> 511</span>&#160;<span class="preprocessor"></span>};</div>
<div class="line"><a name="l00512"></a><span class="lineno"> 512</span>&#160;<span class="preprocessor">#endif</span></div>
</div><!-- fragment --></div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>

156
_x_b_o_x_o_l_d_8cpp.html Normal file
View file

@ -0,0 +1,156 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.4"/>
<title>USB Host Shield 2.0: XBOXOLD.cpp File Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/javascript">
$(document).ready(function() { searchBox.OnSelectItem(0); });
</script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
<link href="imageStyle.css" rel="stylesheet" type="text/css"/>
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
<tbody>
<tr style="height: 56px;">
<td style="padding-left: 0.5em;">
<div id="projectname">USB Host Shield 2.0
</div>
</td>
</tr>
</tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.4 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
<div id="navrow1" class="tabs">
<ul class="tablist">
<li><a href="index.html"><span>Main&#160;Page</span></a></li>
<li><a href="pages.html"><span>Related&#160;Pages</span></a></li>
<li><a href="annotated.html"><span>Classes</span></a></li>
<li class="current"><a href="files.html"><span>Files</span></a></li>
<li>
<div id="MSearchBox" class="MSearchBoxInactive">
<span class="left">
<img id="MSearchSelect" src="search/mag_sel.png"
onmouseover="return searchBox.OnSearchSelectShow()"
onmouseout="return searchBox.OnSearchSelectHide()"
alt=""/>
<input type="text" id="MSearchField" value="Search" accesskey="S"
onfocus="searchBox.OnSearchFieldFocus(true)"
onblur="searchBox.OnSearchFieldFocus(false)"
onkeyup="searchBox.OnSearchFieldChange(event)"/>
</span><span class="right">
<a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
</span>
</div>
</li>
</ul>
</div>
<div id="navrow2" class="tabs2">
<ul class="tablist">
<li><a href="files.html"><span>File&#160;List</span></a></li>
<li><a href="globals.html"><span>File&#160;Members</span></a></li>
</ul>
</div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
onmouseover="return searchBox.OnSearchSelectShow()"
onmouseout="return searchBox.OnSearchSelectHide()"
onkeydown="return searchBox.OnSearchSelectKey(event)">
<a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(0)"><span class="SelectionMark">&#160;</span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark">&#160;</span>Classes</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark">&#160;</span>Files</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark">&#160;</span>Functions</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(4)"><span class="SelectionMark">&#160;</span>Variables</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(5)"><span class="SelectionMark">&#160;</span>Typedefs</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(6)"><span class="SelectionMark">&#160;</span>Enumerations</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(7)"><span class="SelectionMark">&#160;</span>Enumerator</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(8)"><span class="SelectionMark">&#160;</span>Macros</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(9)"><span class="SelectionMark">&#160;</span>Pages</a></div>
<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0"
name="MSearchResults" id="MSearchResults">
</iframe>
</div>
<div id="nav-path" class="navpath">
<ul>
<li class="navelem"><a class="el" href="dir_e5fbe6d2783ccd4c93c7856d92d7be6e.html">GitHub</a></li><li class="navelem"><a class="el" href="dir_397a095372f04465e811d0ee219bbf8f.html">USB_Host_Shield_2.0</a></li> </ul>
</div>
</div><!-- top -->
<div class="header">
<div class="summary">
<a href="#var-members">Variables</a> </div>
<div class="headertitle">
<div class="title">XBOXOLD.cpp File Reference</div> </div>
</div><!--header-->
<div class="contents">
<div class="textblock"><code>#include &quot;<a class="el" href="_x_b_o_x_o_l_d_8h_source.html">XBOXOLD.h</a>&quot;</code><br/>
</div><div class="textblock"><div class="dynheader">
Include dependency graph for XBOXOLD.cpp:</div>
<div class="dyncontent">
<div class="center"><img src="_x_b_o_x_o_l_d_8cpp__incl.png" border="0" usemap="#_x_b_o_x_o_l_d_8cpp" alt=""/></div>
<map name="_x_b_o_x_o_l_d_8cpp" id="_x_b_o_x_o_l_d_8cpp">
<area shape="rect" id="node2" href="_x_b_o_x_o_l_d_8h.html" title="XBOXOLD.h" alt="" coords="255,75,323,96"/><area shape="rect" id="node4" href="_usb_8h.html" title="Usb.h" alt="" coords="268,144,311,165"/><area shape="rect" id="node19" href="controller_enums_8h.html" title="controllerEnums.h" alt="" coords="335,144,421,165"/><area shape="rect" id="node7" href="avrpins_8h.html" title="avrpins.h" alt="" coords="94,283,148,304"/><area shape="rect" id="node9" href="max3421e_8h.html" title="max3421e.h" alt="" coords="376,283,443,304"/><area shape="rect" id="node10" href="usbhost_8h.html" title="usbhost.h" alt="" coords="227,213,284,235"/><area shape="rect" id="node11" href="usb__ch9_8h.html" title="usb_ch9.h" alt="" coords="293,283,352,304"/><area shape="rect" id="node13" href="address_8h.html" title="address.h" alt="" coords="441,213,497,235"/><area shape="rect" id="node15" href="message_8h.html" title="message.h" alt="" coords="693,213,755,235"/><area shape="rect" id="node17" href="printhex_8h.html" title="printhex.h" alt="" coords="787,352,844,373"/><area shape="rect" id="node18" href="hexdump_8h.html" title="hexdump.h" alt="" coords="693,283,755,304"/></map>
</div>
</div>
<p><a href="_x_b_o_x_o_l_d_8cpp_source.html">Go to the source code of this file.</a></p>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="var-members"></a>
Variables</h2></td></tr>
<tr class="memitem:af4ccffb7f90c323a0eba09065159f74b"><td class="memItemLeft" align="right" valign="top">const uint8_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="_x_b_o_x_o_l_d_8cpp.html#af4ccffb7f90c323a0eba09065159f74b">XBOXOLDBUTTONS</a> []</td></tr>
<tr class="separator:af4ccffb7f90c323a0eba09065159f74b"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<h2 class="groupheader">Variable Documentation</h2>
<a class="anchor" id="af4ccffb7f90c323a0eba09065159f74b"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">const uint8_t XBOXOLDBUTTONS[]</td>
</tr>
</table>
</div><div class="memdoc">
<b>Initial value:</b><div class="fragment"><div class="line">= {</div>
<div class="line"> 0x01, </div>
<div class="line"> 0x08, </div>
<div class="line"> 0x02, </div>
<div class="line"> 0x04, </div>
<div class="line"></div>
<div class="line"> 0x20, </div>
<div class="line"> 0x10, </div>
<div class="line"> 0x40, </div>
<div class="line"> 0x80, </div>
<div class="line"></div>
<div class="line"> </div>
<div class="line"> 4, </div>
<div class="line"> 5, </div>
<div class="line"> 6, </div>
<div class="line"> 7, </div>
<div class="line"></div>
<div class="line"> 1, </div>
<div class="line"> 0, </div>
<div class="line"> 2, </div>
<div class="line"> 3, </div>
<div class="line">}</div>
</div><!-- fragment --><p>Buttons on the controllers </p>
<p>Definition at line <a class="el" href="_x_b_o_x_o_l_d_8cpp_source.html#l00024">24</a> of file <a class="el" href="_x_b_o_x_o_l_d_8cpp_source.html">XBOXOLD.cpp</a>.</p>
</div>
</div>
</div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.4
</small></address>
</body>
</html>

View file

@ -0,0 +1,13 @@
<map id="XBOXOLD.cpp" name="XBOXOLD.cpp">
<area shape="rect" id="node2" href="$_x_b_o_x_o_l_d_8h.html" title="XBOXOLD.h" alt="" coords="255,75,323,96"/>
<area shape="rect" id="node4" href="$_usb_8h.html" title="Usb.h" alt="" coords="268,144,311,165"/>
<area shape="rect" id="node19" href="$controller_enums_8h.html" title="controllerEnums.h" alt="" coords="335,144,421,165"/>
<area shape="rect" id="node7" href="$avrpins_8h.html" title="avrpins.h" alt="" coords="94,283,148,304"/>
<area shape="rect" id="node9" href="$max3421e_8h.html" title="max3421e.h" alt="" coords="376,283,443,304"/>
<area shape="rect" id="node10" href="$usbhost_8h.html" title="usbhost.h" alt="" coords="227,213,284,235"/>
<area shape="rect" id="node11" href="$usb__ch9_8h.html" title="usb_ch9.h" alt="" coords="293,283,352,304"/>
<area shape="rect" id="node13" href="$address_8h.html" title="address.h" alt="" coords="441,213,497,235"/>
<area shape="rect" id="node15" href="$message_8h.html" title="message.h" alt="" coords="693,213,755,235"/>
<area shape="rect" id="node17" href="$printhex_8h.html" title="printhex.h" alt="" coords="787,352,844,373"/>
<area shape="rect" id="node18" href="$hexdump_8h.html" title="hexdump.h" alt="" coords="693,283,755,304"/>
</map>

View file

@ -0,0 +1 @@
090c3aaec95e582786089053a4174da0

Binary file not shown.

After

Width:  |  Height:  |  Size: 61 KiB

View file

@ -0,0 +1,433 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.4"/>
<title>USB Host Shield 2.0: XBOXOLD.cpp Source File</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/javascript">
$(document).ready(function() { searchBox.OnSelectItem(0); });
</script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
<link href="imageStyle.css" rel="stylesheet" type="text/css"/>
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
<tbody>
<tr style="height: 56px;">
<td style="padding-left: 0.5em;">
<div id="projectname">USB Host Shield 2.0
</div>
</td>
</tr>
</tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.4 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
<div id="navrow1" class="tabs">
<ul class="tablist">
<li><a href="index.html"><span>Main&#160;Page</span></a></li>
<li><a href="pages.html"><span>Related&#160;Pages</span></a></li>
<li><a href="annotated.html"><span>Classes</span></a></li>
<li class="current"><a href="files.html"><span>Files</span></a></li>
<li>
<div id="MSearchBox" class="MSearchBoxInactive">
<span class="left">
<img id="MSearchSelect" src="search/mag_sel.png"
onmouseover="return searchBox.OnSearchSelectShow()"
onmouseout="return searchBox.OnSearchSelectHide()"
alt=""/>
<input type="text" id="MSearchField" value="Search" accesskey="S"
onfocus="searchBox.OnSearchFieldFocus(true)"
onblur="searchBox.OnSearchFieldFocus(false)"
onkeyup="searchBox.OnSearchFieldChange(event)"/>
</span><span class="right">
<a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
</span>
</div>
</li>
</ul>
</div>
<div id="navrow2" class="tabs2">
<ul class="tablist">
<li><a href="files.html"><span>File&#160;List</span></a></li>
<li><a href="globals.html"><span>File&#160;Members</span></a></li>
</ul>
</div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
onmouseover="return searchBox.OnSearchSelectShow()"
onmouseout="return searchBox.OnSearchSelectHide()"
onkeydown="return searchBox.OnSearchSelectKey(event)">
<a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(0)"><span class="SelectionMark">&#160;</span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark">&#160;</span>Classes</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark">&#160;</span>Files</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark">&#160;</span>Functions</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(4)"><span class="SelectionMark">&#160;</span>Variables</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(5)"><span class="SelectionMark">&#160;</span>Typedefs</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(6)"><span class="SelectionMark">&#160;</span>Enumerations</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(7)"><span class="SelectionMark">&#160;</span>Enumerator</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(8)"><span class="SelectionMark">&#160;</span>Macros</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(9)"><span class="SelectionMark">&#160;</span>Pages</a></div>
<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0"
name="MSearchResults" id="MSearchResults">
</iframe>
</div>
<div id="nav-path" class="navpath">
<ul>
<li class="navelem"><a class="el" href="dir_e5fbe6d2783ccd4c93c7856d92d7be6e.html">GitHub</a></li><li class="navelem"><a class="el" href="dir_397a095372f04465e811d0ee219bbf8f.html">USB_Host_Shield_2.0</a></li> </ul>
</div>
</div><!-- top -->
<div class="header">
<div class="headertitle">
<div class="title">XBOXOLD.cpp</div> </div>
</div><!--header-->
<div class="contents">
<a href="_x_b_o_x_o_l_d_8cpp.html">Go to the documentation of this file.</a><div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno"> 1</span>&#160;<span class="comment">/* Copyright (C) 2013 Kristian Lauszus, TKJ Electronics. All rights reserved.</span></div>
<div class="line"><a name="l00002"></a><span class="lineno"> 2</span>&#160;<span class="comment"></span></div>
<div class="line"><a name="l00003"></a><span class="lineno"> 3</span>&#160;<span class="comment"> This software may be distributed and modified under the terms of the GNU</span></div>
<div class="line"><a name="l00004"></a><span class="lineno"> 4</span>&#160;<span class="comment"> General Public License version 2 (GPL2) as published by the Free Software</span></div>
<div class="line"><a name="l00005"></a><span class="lineno"> 5</span>&#160;<span class="comment"> Foundation and appearing in the file GPL2.TXT included in the packaging of</span></div>
<div class="line"><a name="l00006"></a><span class="lineno"> 6</span>&#160;<span class="comment"> this file. Please note that GPL2 Section 2[b] requires that all works based</span></div>
<div class="line"><a name="l00007"></a><span class="lineno"> 7</span>&#160;<span class="comment"> on this software must also be made publicly available under the terms of</span></div>
<div class="line"><a name="l00008"></a><span class="lineno"> 8</span>&#160;<span class="comment"> the GPL2 (&quot;Copyleft&quot;).</span></div>
<div class="line"><a name="l00009"></a><span class="lineno"> 9</span>&#160;<span class="comment"></span></div>
<div class="line"><a name="l00010"></a><span class="lineno"> 10</span>&#160;<span class="comment"> Contact information</span></div>
<div class="line"><a name="l00011"></a><span class="lineno"> 11</span>&#160;<span class="comment"> -------------------</span></div>
<div class="line"><a name="l00012"></a><span class="lineno"> 12</span>&#160;<span class="comment"></span></div>
<div class="line"><a name="l00013"></a><span class="lineno"> 13</span>&#160;<span class="comment"> Kristian Lauszus, TKJ Electronics</span></div>
<div class="line"><a name="l00014"></a><span class="lineno"> 14</span>&#160;<span class="comment"> Web : http://www.tkjelectronics.com</span></div>
<div class="line"><a name="l00015"></a><span class="lineno"> 15</span>&#160;<span class="comment"> e-mail : kristianl@tkjelectronics.com</span></div>
<div class="line"><a name="l00016"></a><span class="lineno"> 16</span>&#160;<span class="comment"> */</span></div>
<div class="line"><a name="l00017"></a><span class="lineno"> 17</span>&#160;</div>
<div class="line"><a name="l00018"></a><span class="lineno"> 18</span>&#160;<span class="preprocessor">#include &quot;<a class="code" href="_x_b_o_x_o_l_d_8h.html">XBOXOLD.h</a>&quot;</span></div>
<div class="line"><a name="l00019"></a><span class="lineno"> 19</span>&#160;<span class="comment">// To enable serial debugging uncomment &quot;#define DEBUG_USB_HOST&quot; in message.h</span></div>
<div class="line"><a name="l00020"></a><span class="lineno"> 20</span>&#160;<span class="comment">//#define EXTRADEBUG // Uncomment to get even more debugging data</span></div>
<div class="line"><a name="l00021"></a><span class="lineno"> 21</span>&#160;<span class="comment">//#define PRINTREPORT // Uncomment to print the report send by the Xbox controller</span></div>
<div class="line"><a name="l00022"></a><span class="lineno"> 22</span>&#160;</div>
<div class="line"><a name="l00024"></a><span class="lineno"><a class="code" href="_x_b_o_x_o_l_d_8cpp.html#af4ccffb7f90c323a0eba09065159f74b"> 24</a></span>&#160;<span class="keyword">const</span> uint8_t <a class="code" href="_x_b_o_x_o_l_d_8cpp.html#af4ccffb7f90c323a0eba09065159f74b">XBOXOLDBUTTONS</a>[] PROGMEM = {</div>
<div class="line"><a name="l00025"></a><span class="lineno"> 25</span>&#160; 0x01, <span class="comment">// UP</span></div>
<div class="line"><a name="l00026"></a><span class="lineno"> 26</span>&#160; 0x08, <span class="comment">// RIGHT</span></div>
<div class="line"><a name="l00027"></a><span class="lineno"> 27</span>&#160; 0x02, <span class="comment">// DOWN</span></div>
<div class="line"><a name="l00028"></a><span class="lineno"> 28</span>&#160; 0x04, <span class="comment">// LEFT</span></div>
<div class="line"><a name="l00029"></a><span class="lineno"> 29</span>&#160;</div>
<div class="line"><a name="l00030"></a><span class="lineno"> 30</span>&#160; 0x20, <span class="comment">// BACK</span></div>
<div class="line"><a name="l00031"></a><span class="lineno"> 31</span>&#160; 0x10, <span class="comment">// START</span></div>
<div class="line"><a name="l00032"></a><span class="lineno"> 32</span>&#160; 0x40, <span class="comment">// L3</span></div>
<div class="line"><a name="l00033"></a><span class="lineno"> 33</span>&#160; 0x80, <span class="comment">// R3</span></div>
<div class="line"><a name="l00034"></a><span class="lineno"> 34</span>&#160;</div>
<div class="line"><a name="l00035"></a><span class="lineno"> 35</span>&#160; <span class="comment">// A, B, X, Y, BLACK, WHITE, L1, and R1 are analog buttons</span></div>
<div class="line"><a name="l00036"></a><span class="lineno"> 36</span>&#160; 4, <span class="comment">// BLACK</span></div>
<div class="line"><a name="l00037"></a><span class="lineno"> 37</span>&#160; 5, <span class="comment">// WHTIE</span></div>
<div class="line"><a name="l00038"></a><span class="lineno"> 38</span>&#160; 6, <span class="comment">// L1</span></div>
<div class="line"><a name="l00039"></a><span class="lineno"> 39</span>&#160; 7, <span class="comment">// R1</span></div>
<div class="line"><a name="l00040"></a><span class="lineno"> 40</span>&#160;</div>
<div class="line"><a name="l00041"></a><span class="lineno"> 41</span>&#160; 1, <span class="comment">// B</span></div>
<div class="line"><a name="l00042"></a><span class="lineno"> 42</span>&#160; 0, <span class="comment">// A</span></div>
<div class="line"><a name="l00043"></a><span class="lineno"> 43</span>&#160; 2, <span class="comment">// X</span></div>
<div class="line"><a name="l00044"></a><span class="lineno"> 44</span>&#160; 3, <span class="comment">// Y</span></div>
<div class="line"><a name="l00045"></a><span class="lineno"> 45</span>&#160;}; </div>
<div class="line"><a name="l00046"></a><span class="lineno"> 46</span>&#160;</div>
<div class="line"><a name="l00047"></a><span class="lineno"><a class="code" href="class_x_b_o_x_o_l_d.html#a119c511d09ecc777437584a86858d86f"> 47</a></span>&#160;<a class="code" href="class_x_b_o_x_o_l_d.html#a119c511d09ecc777437584a86858d86f">XBOXOLD::XBOXOLD</a>(<a class="code" href="class_u_s_b.html">USB</a> *p) :</div>
<div class="line"><a name="l00048"></a><span class="lineno"> 48</span>&#160;pUsb(p), <span class="comment">// pointer to USB class instance - mandatory</span></div>
<div class="line"><a name="l00049"></a><span class="lineno"> 49</span>&#160;bAddress(0), <span class="comment">// device address - mandatory</span></div>
<div class="line"><a name="l00050"></a><span class="lineno"> 50</span>&#160;bPollEnable(false) { <span class="comment">// don&#39;t start polling before dongle is connected</span></div>
<div class="line"><a name="l00051"></a><span class="lineno"> 51</span>&#160; <span class="keywordflow">for</span> (uint8_t i = 0; i &lt; <a class="code" href="_x_b_o_x_o_l_d_8h.html#af35f872fc33e690571eb99de648e8e96">XBOX_MAX_ENDPOINTS</a>; i++) {</div>
<div class="line"><a name="l00052"></a><span class="lineno"> 52</span>&#160; <a class="code" href="class_x_b_o_x_o_l_d.html#a06a318db8037f25a8d9bb62785dbacb9">epInfo</a>[i].<a class="code" href="struct_ep_info.html#a9f92be74c75c037b39e2cae1eb49b89b">epAddr</a> = 0;</div>
<div class="line"><a name="l00053"></a><span class="lineno"> 53</span>&#160; <a class="code" href="class_x_b_o_x_o_l_d.html#a06a318db8037f25a8d9bb62785dbacb9">epInfo</a>[i].<a class="code" href="struct_ep_info.html#aa2ca775b63736df4008e88da7dd4dddb">maxPktSize</a> = (i) ? 0 : 8;</div>
<div class="line"><a name="l00054"></a><span class="lineno"> 54</span>&#160; <a class="code" href="class_x_b_o_x_o_l_d.html#a06a318db8037f25a8d9bb62785dbacb9">epInfo</a>[i].<a class="code" href="struct_ep_info.html#a1dea928517c961235eef7b0876e69f10">epAttribs</a> = 0;</div>
<div class="line"><a name="l00055"></a><span class="lineno"> 55</span>&#160; <a class="code" href="class_x_b_o_x_o_l_d.html#a06a318db8037f25a8d9bb62785dbacb9">epInfo</a>[i].<a class="code" href="struct_ep_info.html#a3a5b1c017a034cd9e06e76729e727c46">bmNakPower</a> = (i) ? <a class="code" href="address_8h.html#a660e8da9c1167a8450aef91c5c03761d">USB_NAK_NOWAIT</a> : <a class="code" href="address_8h.html#a517dfa014946e2d087d197312234a1de">USB_NAK_MAX_POWER</a>;</div>
<div class="line"><a name="l00056"></a><span class="lineno"> 56</span>&#160; }</div>
<div class="line"><a name="l00057"></a><span class="lineno"> 57</span>&#160;</div>
<div class="line"><a name="l00058"></a><span class="lineno"> 58</span>&#160; <span class="keywordflow">if</span> (<a class="code" href="class_x_b_o_x_o_l_d.html#a2b4d7d994ab6f5e1d1344d4162e9f5fb">pUsb</a>) <span class="comment">// register in USB subsystem</span></div>
<div class="line"><a name="l00059"></a><span class="lineno"> 59</span>&#160; <a class="code" href="class_x_b_o_x_o_l_d.html#a2b4d7d994ab6f5e1d1344d4162e9f5fb">pUsb</a>-&gt;<a class="code" href="class_u_s_b.html#a3f66bf622590413ef2e1864f93a3e0d2">RegisterDeviceClass</a>(<span class="keyword">this</span>); <span class="comment">//set devConfig[] entry</span></div>
<div class="line"><a name="l00060"></a><span class="lineno"> 60</span>&#160;}</div>
<div class="line"><a name="l00061"></a><span class="lineno"> 61</span>&#160;</div>
<div class="line"><a name="l00062"></a><span class="lineno"><a class="code" href="class_x_b_o_x_o_l_d.html#a7260253c704b147e6dfd762e13222434"> 62</a></span>&#160;uint8_t <a class="code" href="class_x_b_o_x_o_l_d.html#a7260253c704b147e6dfd762e13222434">XBOXOLD::Init</a>(uint8_t parent, uint8_t port, <span class="keywordtype">bool</span> lowspeed) {</div>
<div class="line"><a name="l00063"></a><span class="lineno"> 63</span>&#160; uint8_t buf[<span class="keyword">sizeof</span> (<a class="code" href="struct_u_s_b___d_e_v_i_c_e___d_e_s_c_r_i_p_t_o_r.html">USB_DEVICE_DESCRIPTOR</a>)];</div>
<div class="line"><a name="l00064"></a><span class="lineno"> 64</span>&#160; uint8_t rcode;</div>
<div class="line"><a name="l00065"></a><span class="lineno"> 65</span>&#160; <a class="code" href="struct_usb_device.html">UsbDevice</a> *p = NULL;</div>
<div class="line"><a name="l00066"></a><span class="lineno"> 66</span>&#160; <a class="code" href="struct_ep_info.html">EpInfo</a> *oldep_ptr = NULL;</div>
<div class="line"><a name="l00067"></a><span class="lineno"> 67</span>&#160; uint16_t PID;</div>
<div class="line"><a name="l00068"></a><span class="lineno"> 68</span>&#160; uint16_t VID;</div>
<div class="line"><a name="l00069"></a><span class="lineno"> 69</span>&#160;</div>
<div class="line"><a name="l00070"></a><span class="lineno"> 70</span>&#160; <span class="comment">// get memory address of USB device address pool</span></div>
<div class="line"><a name="l00071"></a><span class="lineno"> 71</span>&#160; <a class="code" href="class_address_pool.html">AddressPool</a> &amp;addrPool = <a class="code" href="class_x_b_o_x_o_l_d.html#a2b4d7d994ab6f5e1d1344d4162e9f5fb">pUsb</a>-&gt;<a class="code" href="class_u_s_b.html#a66ab8f5eda239e761d5a48741ea1f9d4">GetAddressPool</a>();</div>
<div class="line"><a name="l00072"></a><span class="lineno"> 72</span>&#160;<span class="preprocessor">#ifdef EXTRADEBUG</span></div>
<div class="line"><a name="l00073"></a><span class="lineno"> 73</span>&#160;<span class="preprocessor"></span> <a class="code" href="message_8h.html#a27117e124c5d66d5512fe8d494fe6338">Notify</a>(PSTR(<span class="stringliteral">&quot;\r\nXBOXUSB Init&quot;</span>), 0x80);</div>
<div class="line"><a name="l00074"></a><span class="lineno"> 74</span>&#160;<span class="preprocessor">#endif</span></div>
<div class="line"><a name="l00075"></a><span class="lineno"> 75</span>&#160;<span class="preprocessor"></span> <span class="comment">// check if address has already been assigned to an instance</span></div>
<div class="line"><a name="l00076"></a><span class="lineno"> 76</span>&#160; <span class="keywordflow">if</span> (<a class="code" href="class_x_b_o_x_o_l_d.html#ae28d3306b484750d7067fa5f7ed0beae">bAddress</a>) {</div>
<div class="line"><a name="l00077"></a><span class="lineno"> 77</span>&#160;<span class="preprocessor">#ifdef DEBUG_USB_HOST</span></div>
<div class="line"><a name="l00078"></a><span class="lineno"> 78</span>&#160;<span class="preprocessor"></span> <a class="code" href="message_8h.html#a27117e124c5d66d5512fe8d494fe6338">Notify</a>(PSTR(<span class="stringliteral">&quot;\r\nAddress in use&quot;</span>), 0x80);</div>
<div class="line"><a name="l00079"></a><span class="lineno"> 79</span>&#160;<span class="preprocessor">#endif</span></div>
<div class="line"><a name="l00080"></a><span class="lineno"> 80</span>&#160;<span class="preprocessor"></span> <span class="keywordflow">return</span> <a class="code" href="_usb_8h.html#a44416ff64fc0e3691f98addac13d4595">USB_ERROR_CLASS_INSTANCE_ALREADY_IN_USE</a>;</div>
<div class="line"><a name="l00081"></a><span class="lineno"> 81</span>&#160; }</div>
<div class="line"><a name="l00082"></a><span class="lineno"> 82</span>&#160;</div>
<div class="line"><a name="l00083"></a><span class="lineno"> 83</span>&#160; <span class="comment">// Get pointer to pseudo device with address 0 assigned</span></div>
<div class="line"><a name="l00084"></a><span class="lineno"> 84</span>&#160; p = addrPool.<a class="code" href="class_address_pool.html#aa92d7e8f0f515340ae2dc1679b627056">GetUsbDevicePtr</a>(0);</div>
<div class="line"><a name="l00085"></a><span class="lineno"> 85</span>&#160;</div>
<div class="line"><a name="l00086"></a><span class="lineno"> 86</span>&#160; <span class="keywordflow">if</span> (!p) {</div>
<div class="line"><a name="l00087"></a><span class="lineno"> 87</span>&#160;<span class="preprocessor">#ifdef DEBUG_USB_HOST</span></div>
<div class="line"><a name="l00088"></a><span class="lineno"> 88</span>&#160;<span class="preprocessor"></span> <a class="code" href="message_8h.html#a27117e124c5d66d5512fe8d494fe6338">Notify</a>(PSTR(<span class="stringliteral">&quot;\r\nAddress not found&quot;</span>), 0x80);</div>
<div class="line"><a name="l00089"></a><span class="lineno"> 89</span>&#160;<span class="preprocessor">#endif</span></div>
<div class="line"><a name="l00090"></a><span class="lineno"> 90</span>&#160;<span class="preprocessor"></span> <span class="keywordflow">return</span> <a class="code" href="_usb_8h.html#afe2fedb4b0ccc89a688c0b4b59691ce0">USB_ERROR_ADDRESS_NOT_FOUND_IN_POOL</a>;</div>
<div class="line"><a name="l00091"></a><span class="lineno"> 91</span>&#160; }</div>
<div class="line"><a name="l00092"></a><span class="lineno"> 92</span>&#160;</div>
<div class="line"><a name="l00093"></a><span class="lineno"> 93</span>&#160; <span class="keywordflow">if</span> (!p-&gt;<a class="code" href="struct_usb_device.html#a410d39fb7758157f57794335e990ed02">epinfo</a>) {</div>
<div class="line"><a name="l00094"></a><span class="lineno"> 94</span>&#160;<span class="preprocessor">#ifdef DEBUG_USB_HOST</span></div>
<div class="line"><a name="l00095"></a><span class="lineno"> 95</span>&#160;<span class="preprocessor"></span> <a class="code" href="message_8h.html#a27117e124c5d66d5512fe8d494fe6338">Notify</a>(PSTR(<span class="stringliteral">&quot;\r\nepinfo is null&quot;</span>), 0x80);</div>
<div class="line"><a name="l00096"></a><span class="lineno"> 96</span>&#160;<span class="preprocessor">#endif</span></div>
<div class="line"><a name="l00097"></a><span class="lineno"> 97</span>&#160;<span class="preprocessor"></span> <span class="keywordflow">return</span> <a class="code" href="_usb_8h.html#af192c59cafe2192ad802b22e6dbc077d">USB_ERROR_EPINFO_IS_NULL</a>;</div>
<div class="line"><a name="l00098"></a><span class="lineno"> 98</span>&#160; }</div>
<div class="line"><a name="l00099"></a><span class="lineno"> 99</span>&#160;</div>
<div class="line"><a name="l00100"></a><span class="lineno"> 100</span>&#160; <span class="comment">// Save old pointer to EP_RECORD of address 0</span></div>
<div class="line"><a name="l00101"></a><span class="lineno"> 101</span>&#160; oldep_ptr = p-&gt;<a class="code" href="struct_usb_device.html#a410d39fb7758157f57794335e990ed02">epinfo</a>;</div>
<div class="line"><a name="l00102"></a><span class="lineno"> 102</span>&#160;</div>
<div class="line"><a name="l00103"></a><span class="lineno"> 103</span>&#160; <span class="comment">// Temporary assign new pointer to epInfo to p-&gt;epinfo in order to avoid toggle inconsistence</span></div>
<div class="line"><a name="l00104"></a><span class="lineno"> 104</span>&#160; p-&gt;<a class="code" href="struct_usb_device.html#a410d39fb7758157f57794335e990ed02">epinfo</a> = <a class="code" href="class_x_b_o_x_o_l_d.html#a06a318db8037f25a8d9bb62785dbacb9">epInfo</a>;</div>
<div class="line"><a name="l00105"></a><span class="lineno"> 105</span>&#160;</div>
<div class="line"><a name="l00106"></a><span class="lineno"> 106</span>&#160; p-&gt;<a class="code" href="struct_usb_device.html#a86a815577ad7883437d3ca72b32b8e8a">lowspeed</a> = lowspeed;</div>
<div class="line"><a name="l00107"></a><span class="lineno"> 107</span>&#160;</div>
<div class="line"><a name="l00108"></a><span class="lineno"> 108</span>&#160; <span class="comment">// Get device descriptor</span></div>
<div class="line"><a name="l00109"></a><span class="lineno"> 109</span>&#160; rcode = <a class="code" href="class_x_b_o_x_o_l_d.html#a2b4d7d994ab6f5e1d1344d4162e9f5fb">pUsb</a>-&gt;<a class="code" href="class_u_s_b.html#a193e63c149fad46adabd77ceb09b2b24" title="defined(USB_METHODS_INLINE) ">getDevDescr</a>(0, 0, <span class="keyword">sizeof</span> (<a class="code" href="struct_u_s_b___d_e_v_i_c_e___d_e_s_c_r_i_p_t_o_r.html">USB_DEVICE_DESCRIPTOR</a>), (uint8_t*)buf); <span class="comment">// Get device descriptor - addr, ep, nbytes, data</span></div>
<div class="line"><a name="l00110"></a><span class="lineno"> 110</span>&#160; <span class="comment">// Restore p-&gt;epinfo</span></div>
<div class="line"><a name="l00111"></a><span class="lineno"> 111</span>&#160; p-&gt;<a class="code" href="struct_usb_device.html#a410d39fb7758157f57794335e990ed02">epinfo</a> = oldep_ptr;</div>
<div class="line"><a name="l00112"></a><span class="lineno"> 112</span>&#160;</div>
<div class="line"><a name="l00113"></a><span class="lineno"> 113</span>&#160; <span class="keywordflow">if</span> (rcode)</div>
<div class="line"><a name="l00114"></a><span class="lineno"> 114</span>&#160; <span class="keywordflow">goto</span> FailGetDevDescr;</div>
<div class="line"><a name="l00115"></a><span class="lineno"> 115</span>&#160;</div>
<div class="line"><a name="l00116"></a><span class="lineno"> 116</span>&#160; VID = ((<a class="code" href="struct_u_s_b___d_e_v_i_c_e___d_e_s_c_r_i_p_t_o_r.html">USB_DEVICE_DESCRIPTOR</a>*)buf)-&gt;idVendor;</div>
<div class="line"><a name="l00117"></a><span class="lineno"> 117</span>&#160; PID = ((<a class="code" href="struct_u_s_b___d_e_v_i_c_e___d_e_s_c_r_i_p_t_o_r.html">USB_DEVICE_DESCRIPTOR</a>*)buf)-&gt;idProduct;</div>
<div class="line"><a name="l00118"></a><span class="lineno"> 118</span>&#160;</div>
<div class="line"><a name="l00119"></a><span class="lineno"> 119</span>&#160; <span class="keywordflow">if</span> ((VID != <a class="code" href="_x_b_o_x_o_l_d_8h.html#a8e7834e5604c4fb588cceab9258d0568">XBOX_VID</a> &amp;&amp; VID != <a class="code" href="_x_b_o_x_o_l_d_8h.html#a2f5523a1aaa6718e1d11c6bc5b29a575">MADCATZ_VID</a> &amp;&amp; VID != <a class="code" href="_x_b_o_x_o_l_d_8h.html#ab029b2c21fb0c240022cc50f465d4580">JOYTECH_VID</a>) || (PID != <a class="code" href="_x_b_o_x_o_l_d_8h.html#a8495cfaf2039ba2399a3c6f3e107c90c">XBOX_OLD_PID1</a> &amp;&amp; PID != <a class="code" href="_x_b_o_x_o_l_d_8h.html#a9c98134e7ea99b12f7e4724af5b9799c">XBOX_OLD_PID2</a> &amp;&amp; PID != <a class="code" href="_x_b_o_x_o_l_d_8h.html#a3856d8cf87b39551ed2278691ad891b8">XBOX_OLD_PID3</a> &amp;&amp; PID != <a class="code" href="_x_b_o_x_o_l_d_8h.html#a3bf8a81e24b9c3df304fdafb06bbeb4e">XBOX_OLD_PID4</a>)) <span class="comment">// Check if VID and PID match</span></div>
<div class="line"><a name="l00120"></a><span class="lineno"> 120</span>&#160; <span class="keywordflow">goto</span> FailUnknownDevice;</div>
<div class="line"><a name="l00121"></a><span class="lineno"> 121</span>&#160; </div>
<div class="line"><a name="l00122"></a><span class="lineno"> 122</span>&#160; <span class="comment">// Allocate new address according to device class</span></div>
<div class="line"><a name="l00123"></a><span class="lineno"> 123</span>&#160; <a class="code" href="class_x_b_o_x_o_l_d.html#ae28d3306b484750d7067fa5f7ed0beae">bAddress</a> = addrPool.<a class="code" href="class_address_pool.html#a97df4ef42e50960ce2165f4cdb53e590">AllocAddress</a>(parent, <span class="keyword">false</span>, port);</div>
<div class="line"><a name="l00124"></a><span class="lineno"> 124</span>&#160;</div>
<div class="line"><a name="l00125"></a><span class="lineno"> 125</span>&#160; <span class="keywordflow">if</span> (!<a class="code" href="class_x_b_o_x_o_l_d.html#ae28d3306b484750d7067fa5f7ed0beae">bAddress</a>)</div>
<div class="line"><a name="l00126"></a><span class="lineno"> 126</span>&#160; <span class="keywordflow">return</span> <a class="code" href="_usb_8h.html#a15370eb665cdded5514e69ca58d9f39d">USB_ERROR_OUT_OF_ADDRESS_SPACE_IN_POOL</a>;</div>
<div class="line"><a name="l00127"></a><span class="lineno"> 127</span>&#160;</div>
<div class="line"><a name="l00128"></a><span class="lineno"> 128</span>&#160; <span class="comment">// Extract Max Packet Size from device descriptor</span></div>
<div class="line"><a name="l00129"></a><span class="lineno"> 129</span>&#160; <a class="code" href="class_x_b_o_x_o_l_d.html#a06a318db8037f25a8d9bb62785dbacb9">epInfo</a>[0].<a class="code" href="struct_ep_info.html#aa2ca775b63736df4008e88da7dd4dddb">maxPktSize</a> = (uint8_t)((<a class="code" href="struct_u_s_b___d_e_v_i_c_e___d_e_s_c_r_i_p_t_o_r.html">USB_DEVICE_DESCRIPTOR</a>*)buf)-&gt;bMaxPacketSize0;</div>
<div class="line"><a name="l00130"></a><span class="lineno"> 130</span>&#160;</div>
<div class="line"><a name="l00131"></a><span class="lineno"> 131</span>&#160; <span class="comment">// Assign new address to the device</span></div>
<div class="line"><a name="l00132"></a><span class="lineno"> 132</span>&#160; rcode = <a class="code" href="class_x_b_o_x_o_l_d.html#a2b4d7d994ab6f5e1d1344d4162e9f5fb">pUsb</a>-&gt;<a class="code" href="class_u_s_b.html#a3aea534daed66b5606fa798df7ad3c47">setAddr</a>(0, 0, <a class="code" href="class_x_b_o_x_o_l_d.html#ae28d3306b484750d7067fa5f7ed0beae">bAddress</a>);</div>
<div class="line"><a name="l00133"></a><span class="lineno"> 133</span>&#160; <span class="keywordflow">if</span> (rcode) {</div>
<div class="line"><a name="l00134"></a><span class="lineno"> 134</span>&#160; p-&gt;<a class="code" href="struct_usb_device.html#a86a815577ad7883437d3ca72b32b8e8a">lowspeed</a> = <span class="keyword">false</span>;</div>
<div class="line"><a name="l00135"></a><span class="lineno"> 135</span>&#160; addrPool.<a class="code" href="class_address_pool.html#a15fde13223dcb1da89305ad229763562">FreeAddress</a>(<a class="code" href="class_x_b_o_x_o_l_d.html#ae28d3306b484750d7067fa5f7ed0beae">bAddress</a>);</div>
<div class="line"><a name="l00136"></a><span class="lineno"> 136</span>&#160; <a class="code" href="class_x_b_o_x_o_l_d.html#ae28d3306b484750d7067fa5f7ed0beae">bAddress</a> = 0;</div>
<div class="line"><a name="l00137"></a><span class="lineno"> 137</span>&#160;<span class="preprocessor">#ifdef DEBUG_USB_HOST</span></div>
<div class="line"><a name="l00138"></a><span class="lineno"> 138</span>&#160;<span class="preprocessor"></span> <a class="code" href="message_8h.html#a27117e124c5d66d5512fe8d494fe6338">Notify</a>(PSTR(<span class="stringliteral">&quot;\r\nsetAddr: &quot;</span>), 0x80);</div>
<div class="line"><a name="l00139"></a><span class="lineno"> 139</span>&#160; D_PrintHex&lt;uint8_t &gt; (rcode, 0x80);</div>
<div class="line"><a name="l00140"></a><span class="lineno"> 140</span>&#160;<span class="preprocessor">#endif</span></div>
<div class="line"><a name="l00141"></a><span class="lineno"> 141</span>&#160;<span class="preprocessor"></span> <span class="keywordflow">return</span> rcode;</div>
<div class="line"><a name="l00142"></a><span class="lineno"> 142</span>&#160; }</div>
<div class="line"><a name="l00143"></a><span class="lineno"> 143</span>&#160;<span class="preprocessor">#ifdef EXTRADEBUG</span></div>
<div class="line"><a name="l00144"></a><span class="lineno"> 144</span>&#160;<span class="preprocessor"></span> <a class="code" href="message_8h.html#a27117e124c5d66d5512fe8d494fe6338">Notify</a>(PSTR(<span class="stringliteral">&quot;\r\nAddr: &quot;</span>), 0x80);</div>
<div class="line"><a name="l00145"></a><span class="lineno"> 145</span>&#160; D_PrintHex&lt;uint8_t &gt; (<a class="code" href="class_x_b_o_x_o_l_d.html#ae28d3306b484750d7067fa5f7ed0beae">bAddress</a>, 0x80);</div>
<div class="line"><a name="l00146"></a><span class="lineno"> 146</span>&#160;<span class="preprocessor">#endif</span></div>
<div class="line"><a name="l00147"></a><span class="lineno"> 147</span>&#160;<span class="preprocessor"></span> delay(300); <span class="comment">// Spec says you should wait at least 200ms</span></div>
<div class="line"><a name="l00148"></a><span class="lineno"> 148</span>&#160; </div>
<div class="line"><a name="l00149"></a><span class="lineno"> 149</span>&#160; p-&gt;<a class="code" href="struct_usb_device.html#a86a815577ad7883437d3ca72b32b8e8a">lowspeed</a> = <span class="keyword">false</span>;</div>
<div class="line"><a name="l00150"></a><span class="lineno"> 150</span>&#160;</div>
<div class="line"><a name="l00151"></a><span class="lineno"> 151</span>&#160; <span class="comment">//get pointer to assigned address record</span></div>
<div class="line"><a name="l00152"></a><span class="lineno"> 152</span>&#160; p = addrPool.<a class="code" href="class_address_pool.html#aa92d7e8f0f515340ae2dc1679b627056">GetUsbDevicePtr</a>(bAddress);</div>
<div class="line"><a name="l00153"></a><span class="lineno"> 153</span>&#160; <span class="keywordflow">if</span> (!p)</div>
<div class="line"><a name="l00154"></a><span class="lineno"> 154</span>&#160; <span class="keywordflow">return</span> <a class="code" href="_usb_8h.html#afe2fedb4b0ccc89a688c0b4b59691ce0">USB_ERROR_ADDRESS_NOT_FOUND_IN_POOL</a>;</div>
<div class="line"><a name="l00155"></a><span class="lineno"> 155</span>&#160;</div>
<div class="line"><a name="l00156"></a><span class="lineno"> 156</span>&#160; p-&gt;<a class="code" href="struct_usb_device.html#a86a815577ad7883437d3ca72b32b8e8a">lowspeed</a> = lowspeed;</div>
<div class="line"><a name="l00157"></a><span class="lineno"> 157</span>&#160;</div>
<div class="line"><a name="l00158"></a><span class="lineno"> 158</span>&#160; <span class="comment">// Assign epInfo to epinfo pointer - only EP0 is known</span></div>
<div class="line"><a name="l00159"></a><span class="lineno"> 159</span>&#160; rcode = <a class="code" href="class_x_b_o_x_o_l_d.html#a2b4d7d994ab6f5e1d1344d4162e9f5fb">pUsb</a>-&gt;<a class="code" href="class_u_s_b.html#a6c3ba3f7e6dccb450267011ce783d7ea">setEpInfoEntry</a>(bAddress, 1, <a class="code" href="class_x_b_o_x_o_l_d.html#a06a318db8037f25a8d9bb62785dbacb9">epInfo</a>);</div>
<div class="line"><a name="l00160"></a><span class="lineno"> 160</span>&#160; <span class="keywordflow">if</span> (rcode)</div>
<div class="line"><a name="l00161"></a><span class="lineno"> 161</span>&#160; <span class="keywordflow">goto</span> FailSetDevTblEntry;</div>
<div class="line"><a name="l00162"></a><span class="lineno"> 162</span>&#160;</div>
<div class="line"><a name="l00163"></a><span class="lineno"> 163</span>&#160; <span class="comment">/* The application will work in reduced host mode, so we can save program and data</span></div>
<div class="line"><a name="l00164"></a><span class="lineno"> 164</span>&#160;<span class="comment"> memory space. After verifying the VID we will use known values for the</span></div>
<div class="line"><a name="l00165"></a><span class="lineno"> 165</span>&#160;<span class="comment"> configuration values for device, interface, endpoints and HID for the XBOX controllers */</span></div>
<div class="line"><a name="l00166"></a><span class="lineno"> 166</span>&#160;</div>
<div class="line"><a name="l00167"></a><span class="lineno"> 167</span>&#160; <span class="comment">/* Initialize data structures for endpoints of device */</span></div>
<div class="line"><a name="l00168"></a><span class="lineno"> 168</span>&#160; <a class="code" href="class_x_b_o_x_o_l_d.html#a06a318db8037f25a8d9bb62785dbacb9">epInfo</a>[ <a class="code" href="_x_b_o_x_o_l_d_8h.html#a4fd9ad9bf7a7d5767940c2ec224ef5e8">XBOX_INPUT_PIPE</a> ].<a class="code" href="struct_ep_info.html#a9f92be74c75c037b39e2cae1eb49b89b">epAddr</a> = 0x01; <span class="comment">// XBOX report endpoint</span></div>
<div class="line"><a name="l00169"></a><span class="lineno"> 169</span>&#160; <a class="code" href="class_x_b_o_x_o_l_d.html#a06a318db8037f25a8d9bb62785dbacb9">epInfo</a>[ <a class="code" href="_x_b_o_x_o_l_d_8h.html#a4fd9ad9bf7a7d5767940c2ec224ef5e8">XBOX_INPUT_PIPE</a> ].<a class="code" href="struct_ep_info.html#a1dea928517c961235eef7b0876e69f10">epAttribs</a> = <a class="code" href="_p_s3_u_s_b_8h.html#ad4d26e1c566064f2259faf65f0858b6e">EP_INTERRUPT</a>;</div>
<div class="line"><a name="l00170"></a><span class="lineno"> 170</span>&#160; <a class="code" href="class_x_b_o_x_o_l_d.html#a06a318db8037f25a8d9bb62785dbacb9">epInfo</a>[ <a class="code" href="_x_b_o_x_o_l_d_8h.html#a4fd9ad9bf7a7d5767940c2ec224ef5e8">XBOX_INPUT_PIPE</a> ].<a class="code" href="struct_ep_info.html#a3a5b1c017a034cd9e06e76729e727c46">bmNakPower</a> = <a class="code" href="address_8h.html#a660e8da9c1167a8450aef91c5c03761d">USB_NAK_NOWAIT</a>; <span class="comment">// Only poll once for interrupt endpoints</span></div>
<div class="line"><a name="l00171"></a><span class="lineno"> 171</span>&#160; <a class="code" href="class_x_b_o_x_o_l_d.html#a06a318db8037f25a8d9bb62785dbacb9">epInfo</a>[ <a class="code" href="_x_b_o_x_o_l_d_8h.html#a4fd9ad9bf7a7d5767940c2ec224ef5e8">XBOX_INPUT_PIPE</a> ].<a class="code" href="struct_ep_info.html#aa2ca775b63736df4008e88da7dd4dddb">maxPktSize</a> = <a class="code" href="_p_s3_u_s_b_8h.html#abcb805b13bfd36145e252b0633bbcfc0">EP_MAXPKTSIZE</a>;</div>
<div class="line"><a name="l00172"></a><span class="lineno"> 172</span>&#160; <a class="code" href="class_x_b_o_x_o_l_d.html#a06a318db8037f25a8d9bb62785dbacb9">epInfo</a>[ <a class="code" href="_x_b_o_x_o_l_d_8h.html#a4fd9ad9bf7a7d5767940c2ec224ef5e8">XBOX_INPUT_PIPE</a> ].<a class="code" href="struct_ep_info.html#ac85bff70ad0e5d71e50cb501f4d8caf3">bmSndToggle</a> = <a class="code" href="max3421e_8h.html#a4834ae7378471b63b9a1985c6294006f">bmSNDTOG0</a>;</div>
<div class="line"><a name="l00173"></a><span class="lineno"> 173</span>&#160; <a class="code" href="class_x_b_o_x_o_l_d.html#a06a318db8037f25a8d9bb62785dbacb9">epInfo</a>[ <a class="code" href="_x_b_o_x_o_l_d_8h.html#a4fd9ad9bf7a7d5767940c2ec224ef5e8">XBOX_INPUT_PIPE</a> ].<a class="code" href="struct_ep_info.html#a9238dd40c096baedf041c98b19386a14">bmRcvToggle</a> = <a class="code" href="max3421e_8h.html#aca6a8aa4f0aebbe07c5e175572a92ef7">bmRCVTOG0</a>;</div>
<div class="line"><a name="l00174"></a><span class="lineno"> 174</span>&#160; <a class="code" href="class_x_b_o_x_o_l_d.html#a06a318db8037f25a8d9bb62785dbacb9">epInfo</a>[ <a class="code" href="_x_b_o_x_o_l_d_8h.html#a92d2d844a70224a10c100c0a877aacfe">XBOX_OUTPUT_PIPE</a> ].<a class="code" href="struct_ep_info.html#a9f92be74c75c037b39e2cae1eb49b89b">epAddr</a> = 0x02; <span class="comment">// XBOX output endpoint</span></div>
<div class="line"><a name="l00175"></a><span class="lineno"> 175</span>&#160; <a class="code" href="class_x_b_o_x_o_l_d.html#a06a318db8037f25a8d9bb62785dbacb9">epInfo</a>[ <a class="code" href="_x_b_o_x_o_l_d_8h.html#a92d2d844a70224a10c100c0a877aacfe">XBOX_OUTPUT_PIPE</a> ].<a class="code" href="struct_ep_info.html#a1dea928517c961235eef7b0876e69f10">epAttribs</a> = <a class="code" href="_p_s3_u_s_b_8h.html#ad4d26e1c566064f2259faf65f0858b6e">EP_INTERRUPT</a>;</div>
<div class="line"><a name="l00176"></a><span class="lineno"> 176</span>&#160; <a class="code" href="class_x_b_o_x_o_l_d.html#a06a318db8037f25a8d9bb62785dbacb9">epInfo</a>[ <a class="code" href="_x_b_o_x_o_l_d_8h.html#a92d2d844a70224a10c100c0a877aacfe">XBOX_OUTPUT_PIPE</a> ].<a class="code" href="struct_ep_info.html#a3a5b1c017a034cd9e06e76729e727c46">bmNakPower</a> = <a class="code" href="address_8h.html#a660e8da9c1167a8450aef91c5c03761d">USB_NAK_NOWAIT</a>; <span class="comment">// Only poll once for interrupt endpoints</span></div>
<div class="line"><a name="l00177"></a><span class="lineno"> 177</span>&#160; <a class="code" href="class_x_b_o_x_o_l_d.html#a06a318db8037f25a8d9bb62785dbacb9">epInfo</a>[ <a class="code" href="_x_b_o_x_o_l_d_8h.html#a92d2d844a70224a10c100c0a877aacfe">XBOX_OUTPUT_PIPE</a> ].<a class="code" href="struct_ep_info.html#aa2ca775b63736df4008e88da7dd4dddb">maxPktSize</a> = <a class="code" href="_p_s3_u_s_b_8h.html#abcb805b13bfd36145e252b0633bbcfc0">EP_MAXPKTSIZE</a>;</div>
<div class="line"><a name="l00178"></a><span class="lineno"> 178</span>&#160; <a class="code" href="class_x_b_o_x_o_l_d.html#a06a318db8037f25a8d9bb62785dbacb9">epInfo</a>[ <a class="code" href="_x_b_o_x_o_l_d_8h.html#a92d2d844a70224a10c100c0a877aacfe">XBOX_OUTPUT_PIPE</a> ].<a class="code" href="struct_ep_info.html#ac85bff70ad0e5d71e50cb501f4d8caf3">bmSndToggle</a> = <a class="code" href="max3421e_8h.html#a4834ae7378471b63b9a1985c6294006f">bmSNDTOG0</a>;</div>
<div class="line"><a name="l00179"></a><span class="lineno"> 179</span>&#160; <a class="code" href="class_x_b_o_x_o_l_d.html#a06a318db8037f25a8d9bb62785dbacb9">epInfo</a>[ <a class="code" href="_x_b_o_x_o_l_d_8h.html#a92d2d844a70224a10c100c0a877aacfe">XBOX_OUTPUT_PIPE</a> ].<a class="code" href="struct_ep_info.html#a9238dd40c096baedf041c98b19386a14">bmRcvToggle</a> = <a class="code" href="max3421e_8h.html#aca6a8aa4f0aebbe07c5e175572a92ef7">bmRCVTOG0</a>;</div>
<div class="line"><a name="l00180"></a><span class="lineno"> 180</span>&#160;</div>
<div class="line"><a name="l00181"></a><span class="lineno"> 181</span>&#160; rcode = <a class="code" href="class_x_b_o_x_o_l_d.html#a2b4d7d994ab6f5e1d1344d4162e9f5fb">pUsb</a>-&gt;<a class="code" href="class_u_s_b.html#a6c3ba3f7e6dccb450267011ce783d7ea">setEpInfoEntry</a>(bAddress, 3, <a class="code" href="class_x_b_o_x_o_l_d.html#a06a318db8037f25a8d9bb62785dbacb9">epInfo</a>);</div>
<div class="line"><a name="l00182"></a><span class="lineno"> 182</span>&#160; <span class="keywordflow">if</span> (rcode)</div>
<div class="line"><a name="l00183"></a><span class="lineno"> 183</span>&#160; <span class="keywordflow">goto</span> FailSetDevTblEntry;</div>
<div class="line"><a name="l00184"></a><span class="lineno"> 184</span>&#160;</div>
<div class="line"><a name="l00185"></a><span class="lineno"> 185</span>&#160; delay(200); <span class="comment">// Give time for address change</span></div>
<div class="line"><a name="l00186"></a><span class="lineno"> 186</span>&#160;</div>
<div class="line"><a name="l00187"></a><span class="lineno"> 187</span>&#160; rcode = <a class="code" href="class_x_b_o_x_o_l_d.html#a2b4d7d994ab6f5e1d1344d4162e9f5fb">pUsb</a>-&gt;<a class="code" href="class_u_s_b.html#a31e2c132ec32ffdde94dff72be87c378">setConf</a>(bAddress, <a class="code" href="class_x_b_o_x_o_l_d.html#a06a318db8037f25a8d9bb62785dbacb9">epInfo</a>[ <a class="code" href="_x_b_o_x_o_l_d_8h.html#a8f4ee68cc0f05690f5f26104c7d9e490">XBOX_CONTROL_PIPE</a> ].epAddr, 1);</div>
<div class="line"><a name="l00188"></a><span class="lineno"> 188</span>&#160; <span class="keywordflow">if</span> (rcode)</div>
<div class="line"><a name="l00189"></a><span class="lineno"> 189</span>&#160; <span class="keywordflow">goto</span> FailSetConfDescr;</div>
<div class="line"><a name="l00190"></a><span class="lineno"> 190</span>&#160;</div>
<div class="line"><a name="l00191"></a><span class="lineno"> 191</span>&#160;<span class="preprocessor">#ifdef DEBUG_USB_HOST</span></div>
<div class="line"><a name="l00192"></a><span class="lineno"> 192</span>&#160;<span class="preprocessor"></span> <a class="code" href="message_8h.html#a27117e124c5d66d5512fe8d494fe6338">Notify</a>(PSTR(<span class="stringliteral">&quot;\r\nXbox Controller Connected\r\n&quot;</span>), 0x80);</div>
<div class="line"><a name="l00193"></a><span class="lineno"> 193</span>&#160;<span class="preprocessor">#endif</span></div>
<div class="line"><a name="l00194"></a><span class="lineno"> 194</span>&#160;<span class="preprocessor"></span> <span class="keywordflow">if</span> (pFuncOnInit)</div>
<div class="line"><a name="l00195"></a><span class="lineno"> 195</span>&#160; pFuncOnInit(); <span class="comment">// Call the user function</span></div>
<div class="line"><a name="l00196"></a><span class="lineno"> 196</span>&#160; <a class="code" href="class_x_b_o_x_o_l_d.html#aa091ff52ba7ad4216b0cd0f18651b755">XboxConnected</a> = <span class="keyword">true</span>;</div>
<div class="line"><a name="l00197"></a><span class="lineno"> 197</span>&#160; bPollEnable = <span class="keyword">true</span>;</div>
<div class="line"><a name="l00198"></a><span class="lineno"> 198</span>&#160; <span class="keywordflow">return</span> 0; <span class="comment">// Successful configuration</span></div>
<div class="line"><a name="l00199"></a><span class="lineno"> 199</span>&#160;</div>
<div class="line"><a name="l00200"></a><span class="lineno"> 200</span>&#160; <span class="comment">/* Diagnostic messages */</span></div>
<div class="line"><a name="l00201"></a><span class="lineno"> 201</span>&#160;FailGetDevDescr:</div>
<div class="line"><a name="l00202"></a><span class="lineno"> 202</span>&#160;<span class="preprocessor">#ifdef DEBUG_USB_HOST</span></div>
<div class="line"><a name="l00203"></a><span class="lineno"> 203</span>&#160;<span class="preprocessor"></span> <a class="code" href="message_8h.html#ae65e02f44cfdc490efd1b33f9882fbbd">NotifyFailGetDevDescr</a>();</div>
<div class="line"><a name="l00204"></a><span class="lineno"> 204</span>&#160; <span class="keywordflow">goto</span> Fail;</div>
<div class="line"><a name="l00205"></a><span class="lineno"> 205</span>&#160;<span class="preprocessor">#endif</span></div>
<div class="line"><a name="l00206"></a><span class="lineno"> 206</span>&#160;<span class="preprocessor"></span></div>
<div class="line"><a name="l00207"></a><span class="lineno"> 207</span>&#160;FailSetDevTblEntry:</div>
<div class="line"><a name="l00208"></a><span class="lineno"> 208</span>&#160;<span class="preprocessor">#ifdef DEBUG_USB_HOST</span></div>
<div class="line"><a name="l00209"></a><span class="lineno"> 209</span>&#160;<span class="preprocessor"></span> <a class="code" href="message_8h.html#a69619d86b1636f141c830ca82c7f45e7">NotifyFailSetDevTblEntry</a>();</div>
<div class="line"><a name="l00210"></a><span class="lineno"> 210</span>&#160; <span class="keywordflow">goto</span> Fail;</div>
<div class="line"><a name="l00211"></a><span class="lineno"> 211</span>&#160;<span class="preprocessor">#endif</span></div>
<div class="line"><a name="l00212"></a><span class="lineno"> 212</span>&#160;<span class="preprocessor"></span></div>
<div class="line"><a name="l00213"></a><span class="lineno"> 213</span>&#160;FailSetConfDescr:</div>
<div class="line"><a name="l00214"></a><span class="lineno"> 214</span>&#160;<span class="preprocessor">#ifdef DEBUG_USB_HOST</span></div>
<div class="line"><a name="l00215"></a><span class="lineno"> 215</span>&#160;<span class="preprocessor"></span> <a class="code" href="message_8h.html#a03e4088aafca36fd7a4be69e3a22b601">NotifyFailSetConfDescr</a>();</div>
<div class="line"><a name="l00216"></a><span class="lineno"> 216</span>&#160; <span class="keywordflow">goto</span> Fail;</div>
<div class="line"><a name="l00217"></a><span class="lineno"> 217</span>&#160;<span class="preprocessor">#endif</span></div>
<div class="line"><a name="l00218"></a><span class="lineno"> 218</span>&#160;<span class="preprocessor"></span>FailUnknownDevice:</div>
<div class="line"><a name="l00219"></a><span class="lineno"> 219</span>&#160;<span class="preprocessor">#ifdef DEBUG_USB_HOST</span></div>
<div class="line"><a name="l00220"></a><span class="lineno"> 220</span>&#160;<span class="preprocessor"></span> <a class="code" href="message_8h.html#a0ce3a725ee65614d7f95cda10e4d2e91">NotifyFailUnknownDevice</a>(VID, PID);</div>
<div class="line"><a name="l00221"></a><span class="lineno"> 221</span>&#160;<span class="preprocessor">#endif</span></div>
<div class="line"><a name="l00222"></a><span class="lineno"> 222</span>&#160;<span class="preprocessor"></span> rcode = <a class="code" href="_usb_8h.html#ae9e139d0fd29bb0b3e7afad2f76cd589">USB_DEV_CONFIG_ERROR_DEVICE_NOT_SUPPORTED</a>;</div>
<div class="line"><a name="l00223"></a><span class="lineno"> 223</span>&#160;</div>
<div class="line"><a name="l00224"></a><span class="lineno"> 224</span>&#160;Fail:</div>
<div class="line"><a name="l00225"></a><span class="lineno"> 225</span>&#160;<span class="preprocessor">#ifdef DEBUG_USB_HOST</span></div>
<div class="line"><a name="l00226"></a><span class="lineno"> 226</span>&#160;<span class="preprocessor"></span> <a class="code" href="message_8h.html#a27117e124c5d66d5512fe8d494fe6338">Notify</a>(PSTR(<span class="stringliteral">&quot;\r\nXbox Init Failed, error code: &quot;</span>), 0x80);</div>
<div class="line"><a name="l00227"></a><span class="lineno"> 227</span>&#160; <a class="code" href="message_8h.html#a22695bdc18ebde4a87dbe8633cb39593">NotifyFail</a>(rcode);</div>
<div class="line"><a name="l00228"></a><span class="lineno"> 228</span>&#160;<span class="preprocessor">#endif</span></div>
<div class="line"><a name="l00229"></a><span class="lineno"> 229</span>&#160;<span class="preprocessor"></span> <a class="code" href="class_x_b_o_x_o_l_d.html#a8245e0d30eed5fb7dc761fc350fd1765">Release</a>();</div>
<div class="line"><a name="l00230"></a><span class="lineno"> 230</span>&#160; <span class="keywordflow">return</span> rcode;</div>
<div class="line"><a name="l00231"></a><span class="lineno"> 231</span>&#160;}</div>
<div class="line"><a name="l00232"></a><span class="lineno"> 232</span>&#160;</div>
<div class="line"><a name="l00233"></a><span class="lineno"> 233</span>&#160;<span class="comment">/* Performs a cleanup after failed Init() attempt */</span></div>
<div class="line"><a name="l00234"></a><span class="lineno"><a class="code" href="class_x_b_o_x_o_l_d.html#a8245e0d30eed5fb7dc761fc350fd1765"> 234</a></span>&#160;uint8_t <a class="code" href="class_x_b_o_x_o_l_d.html#a8245e0d30eed5fb7dc761fc350fd1765">XBOXOLD::Release</a>() {</div>
<div class="line"><a name="l00235"></a><span class="lineno"> 235</span>&#160; <a class="code" href="class_x_b_o_x_o_l_d.html#aa091ff52ba7ad4216b0cd0f18651b755">XboxConnected</a> = <span class="keyword">false</span>;</div>
<div class="line"><a name="l00236"></a><span class="lineno"> 236</span>&#160; <a class="code" href="class_x_b_o_x_o_l_d.html#a2b4d7d994ab6f5e1d1344d4162e9f5fb">pUsb</a>-&gt;<a class="code" href="class_u_s_b.html#a66ab8f5eda239e761d5a48741ea1f9d4">GetAddressPool</a>().<a class="code" href="class_address_pool.html#a15fde13223dcb1da89305ad229763562">FreeAddress</a>(<a class="code" href="class_x_b_o_x_o_l_d.html#ae28d3306b484750d7067fa5f7ed0beae">bAddress</a>);</div>
<div class="line"><a name="l00237"></a><span class="lineno"> 237</span>&#160; <a class="code" href="class_x_b_o_x_o_l_d.html#ae28d3306b484750d7067fa5f7ed0beae">bAddress</a> = 0;</div>
<div class="line"><a name="l00238"></a><span class="lineno"> 238</span>&#160; bPollEnable = <span class="keyword">false</span>;</div>
<div class="line"><a name="l00239"></a><span class="lineno"> 239</span>&#160; <span class="keywordflow">return</span> 0;</div>
<div class="line"><a name="l00240"></a><span class="lineno"> 240</span>&#160;}</div>
<div class="line"><a name="l00241"></a><span class="lineno"> 241</span>&#160;</div>
<div class="line"><a name="l00242"></a><span class="lineno"><a class="code" href="class_x_b_o_x_o_l_d.html#a332bf499dd0434d70db8ad8a6f3f4850"> 242</a></span>&#160;uint8_t <a class="code" href="class_x_b_o_x_o_l_d.html#a332bf499dd0434d70db8ad8a6f3f4850">XBOXOLD::Poll</a>() {</div>
<div class="line"><a name="l00243"></a><span class="lineno"> 243</span>&#160; <span class="keywordflow">if</span> (!bPollEnable)</div>
<div class="line"><a name="l00244"></a><span class="lineno"> 244</span>&#160; <span class="keywordflow">return</span> 0;</div>
<div class="line"><a name="l00245"></a><span class="lineno"> 245</span>&#160; uint16_t BUFFER_SIZE = <a class="code" href="_p_s3_u_s_b_8h.html#abcb805b13bfd36145e252b0633bbcfc0">EP_MAXPKTSIZE</a>;</div>
<div class="line"><a name="l00246"></a><span class="lineno"> 246</span>&#160; <a class="code" href="class_x_b_o_x_o_l_d.html#a2b4d7d994ab6f5e1d1344d4162e9f5fb">pUsb</a>-&gt;<a class="code" href="class_u_s_b.html#ad75d64f648b102fab2bd75e53e1324a4">inTransfer</a>(<a class="code" href="class_x_b_o_x_o_l_d.html#ae28d3306b484750d7067fa5f7ed0beae">bAddress</a>, <a class="code" href="class_x_b_o_x_o_l_d.html#a06a318db8037f25a8d9bb62785dbacb9">epInfo</a>[ <a class="code" href="_x_b_o_x_o_l_d_8h.html#a4fd9ad9bf7a7d5767940c2ec224ef5e8">XBOX_INPUT_PIPE</a> ].epAddr, &amp;BUFFER_SIZE, readBuf); <span class="comment">// input on endpoint 1</span></div>
<div class="line"><a name="l00247"></a><span class="lineno"> 247</span>&#160; readReport();</div>
<div class="line"><a name="l00248"></a><span class="lineno"> 248</span>&#160;<span class="preprocessor">#ifdef PRINTREPORT</span></div>
<div class="line"><a name="l00249"></a><span class="lineno"> 249</span>&#160;<span class="preprocessor"></span> printReport(BUFFER_SIZE); <span class="comment">// Uncomment &quot;#define PRINTREPORT&quot; to print the report send by the Xbox controller</span></div>
<div class="line"><a name="l00250"></a><span class="lineno"> 250</span>&#160;<span class="preprocessor">#endif</span></div>
<div class="line"><a name="l00251"></a><span class="lineno"> 251</span>&#160;<span class="preprocessor"></span> <span class="keywordflow">return</span> 0;</div>
<div class="line"><a name="l00252"></a><span class="lineno"> 252</span>&#160;}</div>
<div class="line"><a name="l00253"></a><span class="lineno"> 253</span>&#160;</div>
<div class="line"><a name="l00254"></a><span class="lineno"> 254</span>&#160;<span class="keywordtype">void</span> XBOXOLD::readReport() {</div>
<div class="line"><a name="l00255"></a><span class="lineno"> 255</span>&#160; ButtonState = readBuf[2];</div>
<div class="line"><a name="l00256"></a><span class="lineno"> 256</span>&#160;</div>
<div class="line"><a name="l00257"></a><span class="lineno"> 257</span>&#160; <span class="keywordflow">for</span> (uint8_t i = 0; i &lt; <span class="keyword">sizeof</span>(buttonValues); i++)</div>
<div class="line"><a name="l00258"></a><span class="lineno"> 258</span>&#160; buttonValues[i] = readBuf[i + 4]; <span class="comment">// A, B, X, Y, BLACK, WHITE, L1, and R1</span></div>
<div class="line"><a name="l00259"></a><span class="lineno"> 259</span>&#160;</div>
<div class="line"><a name="l00260"></a><span class="lineno"> 260</span>&#160; hatValue[<a class="code" href="controller_enums_8h.html#aaaabdefc068fd57ec2bef2b62ea4ba92a383cb8895dd296b7f69ce845ed16b0ca">LeftHatX</a>] = (int16_t)(((uint16_t)readBuf[12] &lt;&lt; 8) | readBuf[13]);</div>
<div class="line"><a name="l00261"></a><span class="lineno"> 261</span>&#160; hatValue[<a class="code" href="controller_enums_8h.html#aaaabdefc068fd57ec2bef2b62ea4ba92af3f3925efa9762c4e9e71ac7da7a94a3">LeftHatY</a>] = (int16_t)(((uint16_t)readBuf[14] &lt;&lt; 8) | readBuf[15]);</div>
<div class="line"><a name="l00262"></a><span class="lineno"> 262</span>&#160; hatValue[<a class="code" href="controller_enums_8h.html#aaaabdefc068fd57ec2bef2b62ea4ba92aaeb027a0ae5bbc6ba25e1c78a6486c7b">RightHatX</a>] = (int16_t)(((uint16_t)readBuf[16] &lt;&lt; 8) | readBuf[17]);</div>
<div class="line"><a name="l00263"></a><span class="lineno"> 263</span>&#160; hatValue[<a class="code" href="controller_enums_8h.html#aaaabdefc068fd57ec2bef2b62ea4ba92a7f1fb2db5381286691f4dec179ed5d5a">RightHatY</a>] = (int16_t)(((uint16_t)readBuf[18] &lt;&lt; 8) | readBuf[19]);</div>
<div class="line"><a name="l00264"></a><span class="lineno"> 264</span>&#160;</div>
<div class="line"><a name="l00265"></a><span class="lineno"> 265</span>&#160; <span class="comment">//Notify(PSTR(&quot;\r\nButtonState&quot;), 0x80);</span></div>
<div class="line"><a name="l00266"></a><span class="lineno"> 266</span>&#160; <span class="comment">//PrintHex&lt;uint8_t&gt;(ButtonState, 0x80);</span></div>
<div class="line"><a name="l00267"></a><span class="lineno"> 267</span>&#160;</div>
<div class="line"><a name="l00268"></a><span class="lineno"> 268</span>&#160; <span class="keywordflow">if</span> (ButtonState != OldButtonState || memcmp(buttonValues, oldButtonValues, <span class="keyword">sizeof</span>(buttonValues)) != 0) {</div>
<div class="line"><a name="l00269"></a><span class="lineno"> 269</span>&#160; ButtonClickState = ButtonState &amp; ~OldButtonState; <span class="comment">// Update click state variable</span></div>
<div class="line"><a name="l00270"></a><span class="lineno"> 270</span>&#160; OldButtonState = ButtonState;</div>
<div class="line"><a name="l00271"></a><span class="lineno"> 271</span>&#160;</div>
<div class="line"><a name="l00272"></a><span class="lineno"> 272</span>&#160; <span class="keywordflow">for</span> (uint8_t i = 0; i &lt; <span class="keyword">sizeof</span>(buttonValues); i++) {</div>
<div class="line"><a name="l00273"></a><span class="lineno"> 273</span>&#160; <span class="keywordflow">if</span> (oldButtonValues[i] == 0 &amp;&amp; buttonValues[i] != 0)</div>
<div class="line"><a name="l00274"></a><span class="lineno"> 274</span>&#160; buttonClicked[i] = <span class="keyword">true</span>; <span class="comment">// Update A, B, X, Y, BLACK, WHITE, L1, and R1 click state</span></div>
<div class="line"><a name="l00275"></a><span class="lineno"> 275</span>&#160; oldButtonValues[i] = buttonValues[i];</div>
<div class="line"><a name="l00276"></a><span class="lineno"> 276</span>&#160; }</div>
<div class="line"><a name="l00277"></a><span class="lineno"> 277</span>&#160; }</div>
<div class="line"><a name="l00278"></a><span class="lineno"> 278</span>&#160;}</div>
<div class="line"><a name="l00279"></a><span class="lineno"> 279</span>&#160;</div>
<div class="line"><a name="l00280"></a><span class="lineno"> 280</span>&#160;<span class="keywordtype">void</span> XBOXOLD::printReport(uint16_t length) { <span class="comment">//Uncomment &quot;#define PRINTREPORT&quot; to print the report send by the Xbox controller</span></div>
<div class="line"><a name="l00281"></a><span class="lineno"> 281</span>&#160;<span class="preprocessor">#ifdef PRINTREPORT</span></div>
<div class="line"><a name="l00282"></a><span class="lineno"> 282</span>&#160;<span class="preprocessor"></span> <span class="keywordflow">if</span> (readBuf == NULL)</div>
<div class="line"><a name="l00283"></a><span class="lineno"> 283</span>&#160; <span class="keywordflow">return</span>;</div>
<div class="line"><a name="l00284"></a><span class="lineno"> 284</span>&#160; <span class="keywordflow">for</span> (uint8_t i = 0; i &lt; length; i++) {</div>
<div class="line"><a name="l00285"></a><span class="lineno"> 285</span>&#160; D_PrintHex&lt;uint8_t &gt; (readBuf[i], 0x80);</div>
<div class="line"><a name="l00286"></a><span class="lineno"> 286</span>&#160; <a class="code" href="message_8h.html#a27117e124c5d66d5512fe8d494fe6338">Notify</a>(PSTR(<span class="stringliteral">&quot; &quot;</span>), 0x80);</div>
<div class="line"><a name="l00287"></a><span class="lineno"> 287</span>&#160; }</div>
<div class="line"><a name="l00288"></a><span class="lineno"> 288</span>&#160; <a class="code" href="message_8h.html#a27117e124c5d66d5512fe8d494fe6338">Notify</a>(PSTR(<span class="stringliteral">&quot;\r\n&quot;</span>), 0x80);</div>
<div class="line"><a name="l00289"></a><span class="lineno"> 289</span>&#160;<span class="preprocessor">#endif</span></div>
<div class="line"><a name="l00290"></a><span class="lineno"> 290</span>&#160;<span class="preprocessor"></span>}</div>
<div class="line"><a name="l00291"></a><span class="lineno"> 291</span>&#160;</div>
<div class="line"><a name="l00292"></a><span class="lineno"><a class="code" href="class_x_b_o_x_o_l_d.html#a7943af8e86fd9612891b88c7c7fb586a"> 292</a></span>&#160;uint8_t <a class="code" href="class_x_b_o_x_o_l_d.html#a7943af8e86fd9612891b88c7c7fb586a">XBOXOLD::getButtonPress</a>(<a class="code" href="controller_enums_8h.html#a03bfec859eac87be20f8952c1eb89de0">Button</a> b) {</div>
<div class="line"><a name="l00293"></a><span class="lineno"> 293</span>&#160; <span class="keywordflow">if</span> (b == <a class="code" href="controller_enums_8h.html#a03bfec859eac87be20f8952c1eb89de0a42a4ade1acd55a49164099104990e09f">A</a> || b == <a class="code" href="controller_enums_8h.html#a03bfec859eac87be20f8952c1eb89de0a3f2a77ecd272aa6d6b5902faa5e5fc68">B</a> || b == <a class="code" href="controller_enums_8h.html#a03bfec859eac87be20f8952c1eb89de0a58833a3110c570fb05130d40c365d1e4">X</a> || b == <a class="code" href="controller_enums_8h.html#a03bfec859eac87be20f8952c1eb89de0a5596231eabd6cf29050967d5ac83ad84">Y</a> || b == <a class="code" href="controller_enums_8h.html#a03bfec859eac87be20f8952c1eb89de0af77fb67151d0c18d397069ad8c271ba3">BLACK</a> || b == <a class="code" href="controller_enums_8h.html#a03bfec859eac87be20f8952c1eb89de0a283fc479650da98250635b9c3c0e7e50">WHITE</a> || b == <a class="code" href="controller_enums_8h.html#a03bfec859eac87be20f8952c1eb89de0ae5bc7ee7d6dda5340a28f91834f10543">L1</a> || b == <a class="code" href="controller_enums_8h.html#a03bfec859eac87be20f8952c1eb89de0af8d87ff07efe24755164f550526f4dac">R1</a>) <span class="comment">// A, B, X, Y, BLACK, WHITE, L1, and R1 are analog buttons</span></div>
<div class="line"><a name="l00294"></a><span class="lineno"> 294</span>&#160; <span class="keywordflow">return</span> buttonValues[pgm_read_byte(&amp;<a class="code" href="_x_b_o_x_o_l_d_8cpp.html#af4ccffb7f90c323a0eba09065159f74b">XBOXOLDBUTTONS</a>[(uint8_t)b])]; <span class="comment">// Analog buttons</span></div>
<div class="line"><a name="l00295"></a><span class="lineno"> 295</span>&#160; <span class="keywordflow">return</span> (ButtonState &amp; pgm_read_byte(&amp;<a class="code" href="_x_b_o_x_o_l_d_8cpp.html#af4ccffb7f90c323a0eba09065159f74b">XBOXOLDBUTTONS</a>[(uint8_t)b])); <span class="comment">// Digital buttons</span></div>
<div class="line"><a name="l00296"></a><span class="lineno"> 296</span>&#160;}</div>
<div class="line"><a name="l00297"></a><span class="lineno"> 297</span>&#160;</div>
<div class="line"><a name="l00298"></a><span class="lineno"><a class="code" href="class_x_b_o_x_o_l_d.html#a16cecc4a0dc7e0f4bc84f4602da65214"> 298</a></span>&#160;<span class="keywordtype">bool</span> <a class="code" href="class_x_b_o_x_o_l_d.html#a16cecc4a0dc7e0f4bc84f4602da65214">XBOXOLD::getButtonClick</a>(<a class="code" href="controller_enums_8h.html#a03bfec859eac87be20f8952c1eb89de0">Button</a> b) {</div>
<div class="line"><a name="l00299"></a><span class="lineno"> 299</span>&#160; uint8_t button;</div>
<div class="line"><a name="l00300"></a><span class="lineno"> 300</span>&#160; <span class="keywordflow">if</span> (b == <a class="code" href="controller_enums_8h.html#a03bfec859eac87be20f8952c1eb89de0a42a4ade1acd55a49164099104990e09f">A</a> || b == <a class="code" href="controller_enums_8h.html#a03bfec859eac87be20f8952c1eb89de0a3f2a77ecd272aa6d6b5902faa5e5fc68">B</a> || b == <a class="code" href="controller_enums_8h.html#a03bfec859eac87be20f8952c1eb89de0a58833a3110c570fb05130d40c365d1e4">X</a> || b == <a class="code" href="controller_enums_8h.html#a03bfec859eac87be20f8952c1eb89de0a5596231eabd6cf29050967d5ac83ad84">Y</a> || b == <a class="code" href="controller_enums_8h.html#a03bfec859eac87be20f8952c1eb89de0af77fb67151d0c18d397069ad8c271ba3">BLACK</a> || b == <a class="code" href="controller_enums_8h.html#a03bfec859eac87be20f8952c1eb89de0a283fc479650da98250635b9c3c0e7e50">WHITE</a> || b == <a class="code" href="controller_enums_8h.html#a03bfec859eac87be20f8952c1eb89de0ae5bc7ee7d6dda5340a28f91834f10543">L1</a> || b == <a class="code" href="controller_enums_8h.html#a03bfec859eac87be20f8952c1eb89de0af8d87ff07efe24755164f550526f4dac">R1</a>) { <span class="comment">// A, B, X, Y, BLACK, WHITE, L1, and R1 are analog buttons</span></div>
<div class="line"><a name="l00301"></a><span class="lineno"> 301</span>&#160; button = pgm_read_byte(&amp;<a class="code" href="_x_b_o_x_o_l_d_8cpp.html#af4ccffb7f90c323a0eba09065159f74b">XBOXOLDBUTTONS</a>[(uint8_t)b]);</div>
<div class="line"><a name="l00302"></a><span class="lineno"> 302</span>&#160; <span class="keywordflow">if</span> (buttonClicked[button])</div>
<div class="line"><a name="l00303"></a><span class="lineno"> 303</span>&#160; buttonClicked[button] = <span class="keyword">false</span>;</div>
<div class="line"><a name="l00304"></a><span class="lineno"> 304</span>&#160; <span class="keywordflow">return</span> buttonClicked[button];</div>
<div class="line"><a name="l00305"></a><span class="lineno"> 305</span>&#160; }</div>
<div class="line"><a name="l00306"></a><span class="lineno"> 306</span>&#160;</div>
<div class="line"><a name="l00307"></a><span class="lineno"> 307</span>&#160; button = pgm_read_byte(&amp;<a class="code" href="_x_b_o_x_o_l_d_8cpp.html#af4ccffb7f90c323a0eba09065159f74b">XBOXOLDBUTTONS</a>[(uint8_t)b]); <span class="comment">// Digital buttons</span></div>
<div class="line"><a name="l00308"></a><span class="lineno"> 308</span>&#160; <span class="keywordtype">bool</span> click = (ButtonClickState &amp; button);</div>
<div class="line"><a name="l00309"></a><span class="lineno"> 309</span>&#160; ButtonClickState &amp;= ~button; <span class="comment">// clear &quot;click&quot; event</span></div>
<div class="line"><a name="l00310"></a><span class="lineno"> 310</span>&#160; <span class="keywordflow">return</span> click;</div>
<div class="line"><a name="l00311"></a><span class="lineno"> 311</span>&#160;}</div>
<div class="line"><a name="l00312"></a><span class="lineno"> 312</span>&#160;</div>
<div class="line"><a name="l00313"></a><span class="lineno"><a class="code" href="class_x_b_o_x_o_l_d.html#ad5a76d53ae0e101763ba5403707f5162"> 313</a></span>&#160;int16_t <a class="code" href="class_x_b_o_x_o_l_d.html#ad5a76d53ae0e101763ba5403707f5162">XBOXOLD::getAnalogHat</a>(<a class="code" href="controller_enums_8h.html#aaaabdefc068fd57ec2bef2b62ea4ba92">AnalogHat</a> a) {</div>
<div class="line"><a name="l00314"></a><span class="lineno"> 314</span>&#160; <span class="keywordflow">return</span> hatValue[a];</div>
<div class="line"><a name="l00315"></a><span class="lineno"> 315</span>&#160;}</div>
<div class="line"><a name="l00316"></a><span class="lineno"> 316</span>&#160;</div>
<div class="line"><a name="l00317"></a><span class="lineno"> 317</span>&#160;<span class="comment">/* Xbox Controller commands */</span></div>
<div class="line"><a name="l00318"></a><span class="lineno"> 318</span>&#160;<span class="keywordtype">void</span> XBOXOLD::XboxCommand(uint8_t* data, uint16_t nbytes) {</div>
<div class="line"><a name="l00319"></a><span class="lineno"> 319</span>&#160; <span class="comment">//bmRequest = Host to device (0x00) | Class (0x20) | Interface (0x01) = 0x21, bRequest = Set Report (0x09), Report ID (0x00), Report Type (Output 0x02), interface (0x00), datalength, datalength, data)</span></div>
<div class="line"><a name="l00320"></a><span class="lineno"> 320</span>&#160; <a class="code" href="class_x_b_o_x_o_l_d.html#a2b4d7d994ab6f5e1d1344d4162e9f5fb">pUsb</a>-&gt;<a class="code" href="class_u_s_b.html#a636695a5c3d35cd6b9e31c54edfacd7c">ctrlReq</a>(<a class="code" href="class_x_b_o_x_o_l_d.html#ae28d3306b484750d7067fa5f7ed0beae">bAddress</a>, <a class="code" href="class_x_b_o_x_o_l_d.html#a06a318db8037f25a8d9bb62785dbacb9">epInfo</a>[<a class="code" href="_x_b_o_x_o_l_d_8h.html#a8f4ee68cc0f05690f5f26104c7d9e490">XBOX_CONTROL_PIPE</a>].epAddr, <a class="code" href="_b_t_d_8h.html#a5bd4ea095da29635414952894bd527f5">bmREQ_HID_OUT</a>, <a class="code" href="_b_t_d_8h.html#aee05d40a014750b24a7e9967f6f389f4">HID_REQUEST_SET_REPORT</a>, 0x00, 0x02, 0x00, nbytes, nbytes, data, NULL);</div>
<div class="line"><a name="l00321"></a><span class="lineno"> 321</span>&#160;}</div>
<div class="line"><a name="l00322"></a><span class="lineno"> 322</span>&#160;</div>
<div class="line"><a name="l00323"></a><span class="lineno"><a class="code" href="class_x_b_o_x_o_l_d.html#ab69673ea316c30268a5eedc893bea3a9"> 323</a></span>&#160;<span class="keywordtype">void</span> <a class="code" href="class_x_b_o_x_o_l_d.html#ab69673ea316c30268a5eedc893bea3a9">XBOXOLD::setRumbleOn</a>(uint8_t lValue, uint8_t rValue) {</div>
<div class="line"><a name="l00324"></a><span class="lineno"> 324</span>&#160; uint8_t writeBuf[6];</div>
<div class="line"><a name="l00325"></a><span class="lineno"> 325</span>&#160;</div>
<div class="line"><a name="l00326"></a><span class="lineno"> 326</span>&#160; writeBuf[0] = 0x00;</div>
<div class="line"><a name="l00327"></a><span class="lineno"> 327</span>&#160; writeBuf[1] = 0x06;</div>
<div class="line"><a name="l00328"></a><span class="lineno"> 328</span>&#160; writeBuf[2] = 0x00;</div>
<div class="line"><a name="l00329"></a><span class="lineno"> 329</span>&#160; writeBuf[3] = rValue; <span class="comment">// small weight</span></div>
<div class="line"><a name="l00330"></a><span class="lineno"> 330</span>&#160; writeBuf[4] = 0x00;</div>
<div class="line"><a name="l00331"></a><span class="lineno"> 331</span>&#160; writeBuf[5] = lValue; <span class="comment">// big weight</span></div>
<div class="line"><a name="l00332"></a><span class="lineno"> 332</span>&#160;</div>
<div class="line"><a name="l00333"></a><span class="lineno"> 333</span>&#160; XboxCommand(writeBuf, 6);</div>
<div class="line"><a name="l00334"></a><span class="lineno"> 334</span>&#160;}</div>
</div><!-- fragment --></div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.4
</small></address>
</body>
</html>

372
_x_b_o_x_o_l_d_8h.html Normal file
View file

@ -0,0 +1,372 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.4"/>
<title>USB Host Shield 2.0: XBOXOLD.h File Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/javascript">
$(document).ready(function() { searchBox.OnSelectItem(0); });
</script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
<link href="imageStyle.css" rel="stylesheet" type="text/css"/>
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
<tbody>
<tr style="height: 56px;">
<td style="padding-left: 0.5em;">
<div id="projectname">USB Host Shield 2.0
</div>
</td>
</tr>
</tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.4 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
<div id="navrow1" class="tabs">
<ul class="tablist">
<li><a href="index.html"><span>Main&#160;Page</span></a></li>
<li><a href="pages.html"><span>Related&#160;Pages</span></a></li>
<li><a href="annotated.html"><span>Classes</span></a></li>
<li class="current"><a href="files.html"><span>Files</span></a></li>
<li>
<div id="MSearchBox" class="MSearchBoxInactive">
<span class="left">
<img id="MSearchSelect" src="search/mag_sel.png"
onmouseover="return searchBox.OnSearchSelectShow()"
onmouseout="return searchBox.OnSearchSelectHide()"
alt=""/>
<input type="text" id="MSearchField" value="Search" accesskey="S"
onfocus="searchBox.OnSearchFieldFocus(true)"
onblur="searchBox.OnSearchFieldFocus(false)"
onkeyup="searchBox.OnSearchFieldChange(event)"/>
</span><span class="right">
<a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
</span>
</div>
</li>
</ul>
</div>
<div id="navrow2" class="tabs2">
<ul class="tablist">
<li><a href="files.html"><span>File&#160;List</span></a></li>
<li><a href="globals.html"><span>File&#160;Members</span></a></li>
</ul>
</div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
onmouseover="return searchBox.OnSearchSelectShow()"
onmouseout="return searchBox.OnSearchSelectHide()"
onkeydown="return searchBox.OnSearchSelectKey(event)">
<a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(0)"><span class="SelectionMark">&#160;</span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark">&#160;</span>Classes</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark">&#160;</span>Files</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark">&#160;</span>Functions</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(4)"><span class="SelectionMark">&#160;</span>Variables</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(5)"><span class="SelectionMark">&#160;</span>Typedefs</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(6)"><span class="SelectionMark">&#160;</span>Enumerations</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(7)"><span class="SelectionMark">&#160;</span>Enumerator</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(8)"><span class="SelectionMark">&#160;</span>Macros</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(9)"><span class="SelectionMark">&#160;</span>Pages</a></div>
<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0"
name="MSearchResults" id="MSearchResults">
</iframe>
</div>
<div id="nav-path" class="navpath">
<ul>
<li class="navelem"><a class="el" href="dir_e5fbe6d2783ccd4c93c7856d92d7be6e.html">GitHub</a></li><li class="navelem"><a class="el" href="dir_397a095372f04465e811d0ee219bbf8f.html">USB_Host_Shield_2.0</a></li> </ul>
</div>
</div><!-- top -->
<div class="header">
<div class="summary">
<a href="#nested-classes">Classes</a> &#124;
<a href="#define-members">Macros</a> </div>
<div class="headertitle">
<div class="title">XBOXOLD.h File Reference</div> </div>
</div><!--header-->
<div class="contents">
<div class="textblock"><code>#include &quot;Arduino.h&quot;</code><br/>
<code>#include &quot;<a class="el" href="_usb_8h_source.html">Usb.h</a>&quot;</code><br/>
<code>#include &quot;<a class="el" href="controller_enums_8h_source.html">controllerEnums.h</a>&quot;</code><br/>
</div><div class="textblock"><div class="dynheader">
Include dependency graph for XBOXOLD.h:</div>
<div class="dyncontent">
<div class="center"><img src="_x_b_o_x_o_l_d_8h__incl.png" border="0" usemap="#_x_b_o_x_o_l_d_8h" alt=""/></div>
<map name="_x_b_o_x_o_l_d_8h" id="_x_b_o_x_o_l_d_8h">
<area shape="rect" id="node3" href="_usb_8h.html" title="Usb.h" alt="" coords="268,75,311,96"/><area shape="rect" id="node18" href="controller_enums_8h.html" title="controllerEnums.h" alt="" coords="335,75,421,96"/><area shape="rect" id="node6" href="avrpins_8h.html" title="avrpins.h" alt="" coords="94,213,148,235"/><area shape="rect" id="node8" href="max3421e_8h.html" title="max3421e.h" alt="" coords="376,213,443,235"/><area shape="rect" id="node9" href="usbhost_8h.html" title="usbhost.h" alt="" coords="227,144,284,165"/><area shape="rect" id="node10" href="usb__ch9_8h.html" title="usb_ch9.h" alt="" coords="293,213,352,235"/><area shape="rect" id="node12" href="address_8h.html" title="address.h" alt="" coords="441,144,497,165"/><area shape="rect" id="node14" href="message_8h.html" title="message.h" alt="" coords="693,144,755,165"/><area shape="rect" id="node16" href="printhex_8h.html" title="printhex.h" alt="" coords="787,283,844,304"/><area shape="rect" id="node17" href="hexdump_8h.html" title="hexdump.h" alt="" coords="693,213,755,235"/></map>
</div>
</div><div class="textblock"><div class="dynheader">
This graph shows which files directly or indirectly include this file:</div>
<div class="dyncontent">
<div class="center"><img src="_x_b_o_x_o_l_d_8h__dep__incl.png" border="0" usemap="#_x_b_o_x_o_l_d_8hdep" alt=""/></div>
<map name="_x_b_o_x_o_l_d_8hdep" id="_x_b_o_x_o_l_d_8hdep">
<area shape="rect" id="node2" href="_x_b_o_x_o_l_d_8cpp.html" title="XBOXOLD.cpp" alt="" coords="5,75,80,96"/></map>
</div>
</div>
<p><a href="_x_b_o_x_o_l_d_8h_source.html">Go to the source code of this file.</a></p>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="nested-classes"></a>
Classes</h2></td></tr>
<tr class="memitem:"><td class="memItemLeft" align="right" valign="top">class &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_x_b_o_x_o_l_d.html">XBOXOLD</a></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="define-members"></a>
Macros</h2></td></tr>
<tr class="memitem:abcb805b13bfd36145e252b0633bbcfc0"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="_x_b_o_x_o_l_d_8h.html#abcb805b13bfd36145e252b0633bbcfc0">EP_MAXPKTSIZE</a>&#160;&#160;&#160;32</td></tr>
<tr class="separator:abcb805b13bfd36145e252b0633bbcfc0"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ad4d26e1c566064f2259faf65f0858b6e"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="_x_b_o_x_o_l_d_8h.html#ad4d26e1c566064f2259faf65f0858b6e">EP_INTERRUPT</a>&#160;&#160;&#160;0x03</td></tr>
<tr class="separator:ad4d26e1c566064f2259faf65f0858b6e"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a8f4ee68cc0f05690f5f26104c7d9e490"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="_x_b_o_x_o_l_d_8h.html#a8f4ee68cc0f05690f5f26104c7d9e490">XBOX_CONTROL_PIPE</a>&#160;&#160;&#160;0</td></tr>
<tr class="separator:a8f4ee68cc0f05690f5f26104c7d9e490"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a4fd9ad9bf7a7d5767940c2ec224ef5e8"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="_x_b_o_x_o_l_d_8h.html#a4fd9ad9bf7a7d5767940c2ec224ef5e8">XBOX_INPUT_PIPE</a>&#160;&#160;&#160;1</td></tr>
<tr class="separator:a4fd9ad9bf7a7d5767940c2ec224ef5e8"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a92d2d844a70224a10c100c0a877aacfe"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="_x_b_o_x_o_l_d_8h.html#a92d2d844a70224a10c100c0a877aacfe">XBOX_OUTPUT_PIPE</a>&#160;&#160;&#160;2</td></tr>
<tr class="separator:a92d2d844a70224a10c100c0a877aacfe"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a8e7834e5604c4fb588cceab9258d0568"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="_x_b_o_x_o_l_d_8h.html#a8e7834e5604c4fb588cceab9258d0568">XBOX_VID</a>&#160;&#160;&#160;0x045E</td></tr>
<tr class="separator:a8e7834e5604c4fb588cceab9258d0568"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a2f5523a1aaa6718e1d11c6bc5b29a575"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="_x_b_o_x_o_l_d_8h.html#a2f5523a1aaa6718e1d11c6bc5b29a575">MADCATZ_VID</a>&#160;&#160;&#160;0x1BAD</td></tr>
<tr class="separator:a2f5523a1aaa6718e1d11c6bc5b29a575"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ab029b2c21fb0c240022cc50f465d4580"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="_x_b_o_x_o_l_d_8h.html#ab029b2c21fb0c240022cc50f465d4580">JOYTECH_VID</a>&#160;&#160;&#160;0x162E</td></tr>
<tr class="separator:ab029b2c21fb0c240022cc50f465d4580"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a8495cfaf2039ba2399a3c6f3e107c90c"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="_x_b_o_x_o_l_d_8h.html#a8495cfaf2039ba2399a3c6f3e107c90c">XBOX_OLD_PID1</a>&#160;&#160;&#160;0x0202</td></tr>
<tr class="separator:a8495cfaf2039ba2399a3c6f3e107c90c"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a9c98134e7ea99b12f7e4724af5b9799c"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="_x_b_o_x_o_l_d_8h.html#a9c98134e7ea99b12f7e4724af5b9799c">XBOX_OLD_PID2</a>&#160;&#160;&#160;0x0285</td></tr>
<tr class="separator:a9c98134e7ea99b12f7e4724af5b9799c"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a3856d8cf87b39551ed2278691ad891b8"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="_x_b_o_x_o_l_d_8h.html#a3856d8cf87b39551ed2278691ad891b8">XBOX_OLD_PID3</a>&#160;&#160;&#160;0x0287</td></tr>
<tr class="separator:a3856d8cf87b39551ed2278691ad891b8"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a3bf8a81e24b9c3df304fdafb06bbeb4e"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="_x_b_o_x_o_l_d_8h.html#a3bf8a81e24b9c3df304fdafb06bbeb4e">XBOX_OLD_PID4</a>&#160;&#160;&#160;0x0289</td></tr>
<tr class="separator:a3bf8a81e24b9c3df304fdafb06bbeb4e"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a5bd4ea095da29635414952894bd527f5"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="_x_b_o_x_o_l_d_8h.html#a5bd4ea095da29635414952894bd527f5">bmREQ_HID_OUT</a>&#160;&#160;&#160;<a class="el" href="usb__ch9_8h.html#a610dad02930a3061c746f84885e1e11e">USB_SETUP_HOST_TO_DEVICE</a>|<a class="el" href="usb__ch9_8h.html#acf3fd30992e9fe01f1bac9aaa7fea61b">USB_SETUP_TYPE_CLASS</a>|<a class="el" href="usb__ch9_8h.html#a59754621c21db801e11513ba06a3a02e">USB_SETUP_RECIPIENT_INTERFACE</a></td></tr>
<tr class="separator:a5bd4ea095da29635414952894bd527f5"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aee05d40a014750b24a7e9967f6f389f4"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="_x_b_o_x_o_l_d_8h.html#aee05d40a014750b24a7e9967f6f389f4">HID_REQUEST_SET_REPORT</a>&#160;&#160;&#160;0x09</td></tr>
<tr class="separator:aee05d40a014750b24a7e9967f6f389f4"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:af35f872fc33e690571eb99de648e8e96"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="_x_b_o_x_o_l_d_8h.html#af35f872fc33e690571eb99de648e8e96">XBOX_MAX_ENDPOINTS</a>&#160;&#160;&#160;3</td></tr>
<tr class="separator:af35f872fc33e690571eb99de648e8e96"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<h2 class="groupheader">Macro Definition Documentation</h2>
<a class="anchor" id="abcb805b13bfd36145e252b0633bbcfc0"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">#define EP_MAXPKTSIZE&#160;&#160;&#160;32</td>
</tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="_x_b_o_x_o_l_d_8h_source.html#l00031">31</a> of file <a class="el" href="_x_b_o_x_o_l_d_8h_source.html">XBOXOLD.h</a>.</p>
</div>
</div>
<a class="anchor" id="ad4d26e1c566064f2259faf65f0858b6e"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">#define EP_INTERRUPT&#160;&#160;&#160;0x03</td>
</tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="_x_b_o_x_o_l_d_8h_source.html#l00034">34</a> of file <a class="el" href="_x_b_o_x_o_l_d_8h_source.html">XBOXOLD.h</a>.</p>
</div>
</div>
<a class="anchor" id="a8f4ee68cc0f05690f5f26104c7d9e490"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">#define XBOX_CONTROL_PIPE&#160;&#160;&#160;0</td>
</tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="_x_b_o_x_o_l_d_8h_source.html#l00037">37</a> of file <a class="el" href="_x_b_o_x_o_l_d_8h_source.html">XBOXOLD.h</a>.</p>
</div>
</div>
<a class="anchor" id="a4fd9ad9bf7a7d5767940c2ec224ef5e8"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">#define XBOX_INPUT_PIPE&#160;&#160;&#160;1</td>
</tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="_x_b_o_x_o_l_d_8h_source.html#l00038">38</a> of file <a class="el" href="_x_b_o_x_o_l_d_8h_source.html">XBOXOLD.h</a>.</p>
</div>
</div>
<a class="anchor" id="a92d2d844a70224a10c100c0a877aacfe"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">#define XBOX_OUTPUT_PIPE&#160;&#160;&#160;2</td>
</tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="_x_b_o_x_o_l_d_8h_source.html#l00039">39</a> of file <a class="el" href="_x_b_o_x_o_l_d_8h_source.html">XBOXOLD.h</a>.</p>
</div>
</div>
<a class="anchor" id="a8e7834e5604c4fb588cceab9258d0568"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">#define XBOX_VID&#160;&#160;&#160;0x045E</td>
</tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="_x_b_o_x_o_l_d_8h_source.html#l00042">42</a> of file <a class="el" href="_x_b_o_x_o_l_d_8h_source.html">XBOXOLD.h</a>.</p>
</div>
</div>
<a class="anchor" id="a2f5523a1aaa6718e1d11c6bc5b29a575"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">#define MADCATZ_VID&#160;&#160;&#160;0x1BAD</td>
</tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="_x_b_o_x_o_l_d_8h_source.html#l00043">43</a> of file <a class="el" href="_x_b_o_x_o_l_d_8h_source.html">XBOXOLD.h</a>.</p>
</div>
</div>
<a class="anchor" id="ab029b2c21fb0c240022cc50f465d4580"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">#define JOYTECH_VID&#160;&#160;&#160;0x162E</td>
</tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="_x_b_o_x_o_l_d_8h_source.html#l00044">44</a> of file <a class="el" href="_x_b_o_x_o_l_d_8h_source.html">XBOXOLD.h</a>.</p>
</div>
</div>
<a class="anchor" id="a8495cfaf2039ba2399a3c6f3e107c90c"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">#define XBOX_OLD_PID1&#160;&#160;&#160;0x0202</td>
</tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="_x_b_o_x_o_l_d_8h_source.html#l00046">46</a> of file <a class="el" href="_x_b_o_x_o_l_d_8h_source.html">XBOXOLD.h</a>.</p>
</div>
</div>
<a class="anchor" id="a9c98134e7ea99b12f7e4724af5b9799c"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">#define XBOX_OLD_PID2&#160;&#160;&#160;0x0285</td>
</tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="_x_b_o_x_o_l_d_8h_source.html#l00047">47</a> of file <a class="el" href="_x_b_o_x_o_l_d_8h_source.html">XBOXOLD.h</a>.</p>
</div>
</div>
<a class="anchor" id="a3856d8cf87b39551ed2278691ad891b8"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">#define XBOX_OLD_PID3&#160;&#160;&#160;0x0287</td>
</tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="_x_b_o_x_o_l_d_8h_source.html#l00048">48</a> of file <a class="el" href="_x_b_o_x_o_l_d_8h_source.html">XBOXOLD.h</a>.</p>
</div>
</div>
<a class="anchor" id="a3bf8a81e24b9c3df304fdafb06bbeb4e"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">#define XBOX_OLD_PID4&#160;&#160;&#160;0x0289</td>
</tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="_x_b_o_x_o_l_d_8h_source.html#l00049">49</a> of file <a class="el" href="_x_b_o_x_o_l_d_8h_source.html">XBOXOLD.h</a>.</p>
</div>
</div>
<a class="anchor" id="a5bd4ea095da29635414952894bd527f5"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">#define bmREQ_HID_OUT&#160;&#160;&#160;<a class="el" href="usb__ch9_8h.html#a610dad02930a3061c746f84885e1e11e">USB_SETUP_HOST_TO_DEVICE</a>|<a class="el" href="usb__ch9_8h.html#acf3fd30992e9fe01f1bac9aaa7fea61b">USB_SETUP_TYPE_CLASS</a>|<a class="el" href="usb__ch9_8h.html#a59754621c21db801e11513ba06a3a02e">USB_SETUP_RECIPIENT_INTERFACE</a></td>
</tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="_x_b_o_x_o_l_d_8h_source.html#l00052">52</a> of file <a class="el" href="_x_b_o_x_o_l_d_8h_source.html">XBOXOLD.h</a>.</p>
</div>
</div>
<a class="anchor" id="aee05d40a014750b24a7e9967f6f389f4"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">#define HID_REQUEST_SET_REPORT&#160;&#160;&#160;0x09</td>
</tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="_x_b_o_x_o_l_d_8h_source.html#l00053">53</a> of file <a class="el" href="_x_b_o_x_o_l_d_8h_source.html">XBOXOLD.h</a>.</p>
</div>
</div>
<a class="anchor" id="af35f872fc33e690571eb99de648e8e96"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">#define XBOX_MAX_ENDPOINTS&#160;&#160;&#160;3</td>
</tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="_x_b_o_x_o_l_d_8h_source.html#l00055">55</a> of file <a class="el" href="_x_b_o_x_o_l_d_8h_source.html">XBOXOLD.h</a>.</p>
</div>
</div>
</div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.4
</small></address>
</body>
</html>

View file

@ -0,0 +1,3 @@
<map id="XBOXOLD.h" name="XBOXOLD.h">
<area shape="rect" id="node2" href="$_x_b_o_x_o_l_d_8cpp.html" title="XBOXOLD.cpp" alt="" coords="5,75,80,96"/>
</map>

View file

@ -0,0 +1 @@
e639bc29c7da8c50a5a337ffa1c05d31

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB

View file

@ -0,0 +1,12 @@
<map id="XBOXOLD.h" name="XBOXOLD.h">
<area shape="rect" id="node3" href="$_usb_8h.html" title="Usb.h" alt="" coords="268,75,311,96"/>
<area shape="rect" id="node18" href="$controller_enums_8h.html" title="controllerEnums.h" alt="" coords="335,75,421,96"/>
<area shape="rect" id="node6" href="$avrpins_8h.html" title="avrpins.h" alt="" coords="94,213,148,235"/>
<area shape="rect" id="node8" href="$max3421e_8h.html" title="max3421e.h" alt="" coords="376,213,443,235"/>
<area shape="rect" id="node9" href="$usbhost_8h.html" title="usbhost.h" alt="" coords="227,144,284,165"/>
<area shape="rect" id="node10" href="$usb__ch9_8h.html" title="usb_ch9.h" alt="" coords="293,213,352,235"/>
<area shape="rect" id="node12" href="$address_8h.html" title="address.h" alt="" coords="441,144,497,165"/>
<area shape="rect" id="node14" href="$message_8h.html" title="message.h" alt="" coords="693,144,755,165"/>
<area shape="rect" id="node16" href="$printhex_8h.html" title="printhex.h" alt="" coords="787,283,844,304"/>
<area shape="rect" id="node17" href="$hexdump_8h.html" title="hexdump.h" alt="" coords="693,213,755,235"/>
</map>

View file

@ -0,0 +1 @@
268da4236b31172a9a0b18542d4e65f1

BIN
_x_b_o_x_o_l_d_8h__incl.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 60 KiB

View file

@ -0,0 +1,220 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.4"/>
<title>USB Host Shield 2.0: XBOXOLD.h Source File</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/javascript">
$(document).ready(function() { searchBox.OnSelectItem(0); });
</script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
<link href="imageStyle.css" rel="stylesheet" type="text/css"/>
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
<tbody>
<tr style="height: 56px;">
<td style="padding-left: 0.5em;">
<div id="projectname">USB Host Shield 2.0
</div>
</td>
</tr>
</tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.4 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
<div id="navrow1" class="tabs">
<ul class="tablist">
<li><a href="index.html"><span>Main&#160;Page</span></a></li>
<li><a href="pages.html"><span>Related&#160;Pages</span></a></li>
<li><a href="annotated.html"><span>Classes</span></a></li>
<li class="current"><a href="files.html"><span>Files</span></a></li>
<li>
<div id="MSearchBox" class="MSearchBoxInactive">
<span class="left">
<img id="MSearchSelect" src="search/mag_sel.png"
onmouseover="return searchBox.OnSearchSelectShow()"
onmouseout="return searchBox.OnSearchSelectHide()"
alt=""/>
<input type="text" id="MSearchField" value="Search" accesskey="S"
onfocus="searchBox.OnSearchFieldFocus(true)"
onblur="searchBox.OnSearchFieldFocus(false)"
onkeyup="searchBox.OnSearchFieldChange(event)"/>
</span><span class="right">
<a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
</span>
</div>
</li>
</ul>
</div>
<div id="navrow2" class="tabs2">
<ul class="tablist">
<li><a href="files.html"><span>File&#160;List</span></a></li>
<li><a href="globals.html"><span>File&#160;Members</span></a></li>
</ul>
</div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
onmouseover="return searchBox.OnSearchSelectShow()"
onmouseout="return searchBox.OnSearchSelectHide()"
onkeydown="return searchBox.OnSearchSelectKey(event)">
<a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(0)"><span class="SelectionMark">&#160;</span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark">&#160;</span>Classes</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark">&#160;</span>Files</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark">&#160;</span>Functions</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(4)"><span class="SelectionMark">&#160;</span>Variables</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(5)"><span class="SelectionMark">&#160;</span>Typedefs</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(6)"><span class="SelectionMark">&#160;</span>Enumerations</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(7)"><span class="SelectionMark">&#160;</span>Enumerator</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(8)"><span class="SelectionMark">&#160;</span>Macros</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(9)"><span class="SelectionMark">&#160;</span>Pages</a></div>
<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0"
name="MSearchResults" id="MSearchResults">
</iframe>
</div>
<div id="nav-path" class="navpath">
<ul>
<li class="navelem"><a class="el" href="dir_e5fbe6d2783ccd4c93c7856d92d7be6e.html">GitHub</a></li><li class="navelem"><a class="el" href="dir_397a095372f04465e811d0ee219bbf8f.html">USB_Host_Shield_2.0</a></li> </ul>
</div>
</div><!-- top -->
<div class="header">
<div class="headertitle">
<div class="title">XBOXOLD.h</div> </div>
</div><!--header-->
<div class="contents">
<a href="_x_b_o_x_o_l_d_8h.html">Go to the documentation of this file.</a><div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno"> 1</span>&#160;<span class="comment">/* Copyright (C) 2013 Kristian Lauszus, TKJ Electronics. All rights reserved.</span></div>
<div class="line"><a name="l00002"></a><span class="lineno"> 2</span>&#160;<span class="comment"></span></div>
<div class="line"><a name="l00003"></a><span class="lineno"> 3</span>&#160;<span class="comment"> This software may be distributed and modified under the terms of the GNU</span></div>
<div class="line"><a name="l00004"></a><span class="lineno"> 4</span>&#160;<span class="comment"> General Public License version 2 (GPL2) as published by the Free Software</span></div>
<div class="line"><a name="l00005"></a><span class="lineno"> 5</span>&#160;<span class="comment"> Foundation and appearing in the file GPL2.TXT included in the packaging of</span></div>
<div class="line"><a name="l00006"></a><span class="lineno"> 6</span>&#160;<span class="comment"> this file. Please note that GPL2 Section 2[b] requires that all works based</span></div>
<div class="line"><a name="l00007"></a><span class="lineno"> 7</span>&#160;<span class="comment"> on this software must also be made publicly available under the terms of</span></div>
<div class="line"><a name="l00008"></a><span class="lineno"> 8</span>&#160;<span class="comment"> the GPL2 (&quot;Copyleft&quot;).</span></div>
<div class="line"><a name="l00009"></a><span class="lineno"> 9</span>&#160;<span class="comment"></span></div>
<div class="line"><a name="l00010"></a><span class="lineno"> 10</span>&#160;<span class="comment"> Contact information</span></div>
<div class="line"><a name="l00011"></a><span class="lineno"> 11</span>&#160;<span class="comment"> -------------------</span></div>
<div class="line"><a name="l00012"></a><span class="lineno"> 12</span>&#160;<span class="comment"></span></div>
<div class="line"><a name="l00013"></a><span class="lineno"> 13</span>&#160;<span class="comment"> Kristian Lauszus, TKJ Electronics</span></div>
<div class="line"><a name="l00014"></a><span class="lineno"> 14</span>&#160;<span class="comment"> Web : http://www.tkjelectronics.com</span></div>
<div class="line"><a name="l00015"></a><span class="lineno"> 15</span>&#160;<span class="comment"> e-mail : kristianl@tkjelectronics.com</span></div>
<div class="line"><a name="l00016"></a><span class="lineno"> 16</span>&#160;<span class="comment"> */</span></div>
<div class="line"><a name="l00017"></a><span class="lineno"> 17</span>&#160;</div>
<div class="line"><a name="l00018"></a><span class="lineno"> 18</span>&#160;<span class="preprocessor">#ifndef _xboxold_h_</span></div>
<div class="line"><a name="l00019"></a><span class="lineno"> 19</span>&#160;<span class="preprocessor"></span><span class="preprocessor">#define _xboxold_h_</span></div>
<div class="line"><a name="l00020"></a><span class="lineno"> 20</span>&#160;<span class="preprocessor"></span></div>
<div class="line"><a name="l00021"></a><span class="lineno"> 21</span>&#160;<span class="preprocessor">#if defined(ARDUINO) &amp;&amp; ARDUINO &gt;= 100</span></div>
<div class="line"><a name="l00022"></a><span class="lineno"> 22</span>&#160;<span class="preprocessor"></span><span class="preprocessor">#include &quot;Arduino.h&quot;</span></div>
<div class="line"><a name="l00023"></a><span class="lineno"> 23</span>&#160;<span class="preprocessor">#else</span></div>
<div class="line"><a name="l00024"></a><span class="lineno"> 24</span>&#160;<span class="preprocessor"></span><span class="preprocessor">#include &quot;WProgram.h&quot;</span></div>
<div class="line"><a name="l00025"></a><span class="lineno"> 25</span>&#160;<span class="preprocessor">#endif</span></div>
<div class="line"><a name="l00026"></a><span class="lineno"> 26</span>&#160;<span class="preprocessor"></span></div>
<div class="line"><a name="l00027"></a><span class="lineno"> 27</span>&#160;<span class="preprocessor">#include &quot;<a class="code" href="_usb_8h.html">Usb.h</a>&quot;</span></div>
<div class="line"><a name="l00028"></a><span class="lineno"> 28</span>&#160;<span class="preprocessor"> #include &quot;<a class="code" href="controller_enums_8h.html">controllerEnums.h</a>&quot;</span></div>
<div class="line"><a name="l00029"></a><span class="lineno"> 29</span>&#160;</div>
<div class="line"><a name="l00030"></a><span class="lineno"> 30</span>&#160;<span class="comment">/* Data Xbox taken from descriptors */</span></div>
<div class="line"><a name="l00031"></a><span class="lineno"><a class="code" href="_x_b_o_x_o_l_d_8h.html#abcb805b13bfd36145e252b0633bbcfc0"> 31</a></span>&#160;<span class="preprocessor">#define EP_MAXPKTSIZE 32 // Max size for data via USB</span></div>
<div class="line"><a name="l00032"></a><span class="lineno"> 32</span>&#160;<span class="preprocessor"></span></div>
<div class="line"><a name="l00033"></a><span class="lineno"> 33</span>&#160;<span class="comment">/* Endpoint types */</span></div>
<div class="line"><a name="l00034"></a><span class="lineno"><a class="code" href="_x_b_o_x_o_l_d_8h.html#ad4d26e1c566064f2259faf65f0858b6e"> 34</a></span>&#160;<span class="preprocessor">#define EP_INTERRUPT 0x03</span></div>
<div class="line"><a name="l00035"></a><span class="lineno"> 35</span>&#160;<span class="preprocessor"></span></div>
<div class="line"><a name="l00036"></a><span class="lineno"> 36</span>&#160;<span class="comment">/* Names we give to the 3 Xbox pipes */</span></div>
<div class="line"><a name="l00037"></a><span class="lineno"><a class="code" href="_x_b_o_x_o_l_d_8h.html#a8f4ee68cc0f05690f5f26104c7d9e490"> 37</a></span>&#160;<span class="preprocessor">#define XBOX_CONTROL_PIPE 0</span></div>
<div class="line"><a name="l00038"></a><span class="lineno"><a class="code" href="_x_b_o_x_o_l_d_8h.html#a4fd9ad9bf7a7d5767940c2ec224ef5e8"> 38</a></span>&#160;<span class="preprocessor"></span><span class="preprocessor">#define XBOX_INPUT_PIPE 1</span></div>
<div class="line"><a name="l00039"></a><span class="lineno"><a class="code" href="_x_b_o_x_o_l_d_8h.html#a92d2d844a70224a10c100c0a877aacfe"> 39</a></span>&#160;<span class="preprocessor"></span><span class="preprocessor">#define XBOX_OUTPUT_PIPE 2</span></div>
<div class="line"><a name="l00040"></a><span class="lineno"> 40</span>&#160;<span class="preprocessor"></span></div>
<div class="line"><a name="l00041"></a><span class="lineno"> 41</span>&#160;<span class="comment">// PID and VID of the different devices</span></div>
<div class="line"><a name="l00042"></a><span class="lineno"><a class="code" href="_x_b_o_x_o_l_d_8h.html#a8e7834e5604c4fb588cceab9258d0568"> 42</a></span>&#160;<span class="preprocessor">#define XBOX_VID 0x045E // Microsoft Corporation</span></div>
<div class="line"><a name="l00043"></a><span class="lineno"><a class="code" href="_x_b_o_x_o_l_d_8h.html#a2f5523a1aaa6718e1d11c6bc5b29a575"> 43</a></span>&#160;<span class="preprocessor"></span><span class="preprocessor">#define MADCATZ_VID 0x1BAD // For unofficial Mad Catz controllers</span></div>
<div class="line"><a name="l00044"></a><span class="lineno"><a class="code" href="_x_b_o_x_o_l_d_8h.html#ab029b2c21fb0c240022cc50f465d4580"> 44</a></span>&#160;<span class="preprocessor"></span><span class="preprocessor">#define JOYTECH_VID 0x162E // For unofficial Joytech controllers</span></div>
<div class="line"><a name="l00045"></a><span class="lineno"> 45</span>&#160;<span class="preprocessor"></span></div>
<div class="line"><a name="l00046"></a><span class="lineno"><a class="code" href="_x_b_o_x_o_l_d_8h.html#a8495cfaf2039ba2399a3c6f3e107c90c"> 46</a></span>&#160;<span class="preprocessor">#define XBOX_OLD_PID1 0x0202 // Original Microsoft Xbox controller (US)</span></div>
<div class="line"><a name="l00047"></a><span class="lineno"><a class="code" href="_x_b_o_x_o_l_d_8h.html#a9c98134e7ea99b12f7e4724af5b9799c"> 47</a></span>&#160;<span class="preprocessor"></span><span class="preprocessor">#define XBOX_OLD_PID2 0x0285 // Original Microsoft Xbox controller (Japan)</span></div>
<div class="line"><a name="l00048"></a><span class="lineno"><a class="code" href="_x_b_o_x_o_l_d_8h.html#a3856d8cf87b39551ed2278691ad891b8"> 48</a></span>&#160;<span class="preprocessor"></span><span class="preprocessor">#define XBOX_OLD_PID3 0x0287 // Microsoft Microsoft Xbox Controller S</span></div>
<div class="line"><a name="l00049"></a><span class="lineno"><a class="code" href="_x_b_o_x_o_l_d_8h.html#a3bf8a81e24b9c3df304fdafb06bbeb4e"> 49</a></span>&#160;<span class="preprocessor"></span><span class="preprocessor">#define XBOX_OLD_PID4 0x0289 // Smaller Microsoft Xbox controller (US)</span></div>
<div class="line"><a name="l00050"></a><span class="lineno"> 50</span>&#160;<span class="preprocessor"></span></div>
<div class="line"><a name="l00051"></a><span class="lineno"> 51</span>&#160;<span class="comment">// Used in control endpoint header for HID Commands</span></div>
<div class="line"><a name="l00052"></a><span class="lineno"><a class="code" href="_x_b_o_x_o_l_d_8h.html#a5bd4ea095da29635414952894bd527f5"> 52</a></span>&#160;<span class="preprocessor">#define bmREQ_HID_OUT USB_SETUP_HOST_TO_DEVICE|USB_SETUP_TYPE_CLASS|USB_SETUP_RECIPIENT_INTERFACE</span></div>
<div class="line"><a name="l00053"></a><span class="lineno"><a class="code" href="_x_b_o_x_o_l_d_8h.html#aee05d40a014750b24a7e9967f6f389f4"> 53</a></span>&#160;<span class="preprocessor"></span><span class="preprocessor">#define HID_REQUEST_SET_REPORT 0x09</span></div>
<div class="line"><a name="l00054"></a><span class="lineno"> 54</span>&#160;<span class="preprocessor"></span></div>
<div class="line"><a name="l00055"></a><span class="lineno"><a class="code" href="_x_b_o_x_o_l_d_8h.html#af35f872fc33e690571eb99de648e8e96"> 55</a></span>&#160;<span class="preprocessor">#define XBOX_MAX_ENDPOINTS 3</span></div>
<div class="line"><a name="l00056"></a><span class="lineno"> 56</span>&#160;<span class="preprocessor"></span></div>
<div class="line"><a name="l00058"></a><span class="lineno"><a class="code" href="class_x_b_o_x_o_l_d.html"> 58</a></span>&#160;<span class="keyword">class </span><a class="code" href="class_x_b_o_x_o_l_d.html">XBOXOLD</a> : <span class="keyword">public</span> <a class="code" href="class_u_s_b_device_config.html">USBDeviceConfig</a> {</div>
<div class="line"><a name="l00059"></a><span class="lineno"> 59</span>&#160;<span class="keyword">public</span>:</div>
<div class="line"><a name="l00064"></a><span class="lineno"> 64</span>&#160; <a class="code" href="class_x_b_o_x_o_l_d.html#a119c511d09ecc777437584a86858d86f">XBOXOLD</a>(<a class="code" href="class_u_s_b.html">USB</a> *<a class="code" href="class_x_b_o_x_o_l_d.html#a2b4d7d994ab6f5e1d1344d4162e9f5fb">pUsb</a>);</div>
<div class="line"><a name="l00065"></a><span class="lineno"> 65</span>&#160;</div>
<div class="line"><a name="l00074"></a><span class="lineno"> 74</span>&#160; <span class="keyword">virtual</span> uint8_t <a class="code" href="class_x_b_o_x_o_l_d.html#a7260253c704b147e6dfd762e13222434">Init</a>(uint8_t parent, uint8_t port, <span class="keywordtype">bool</span> lowspeed);</div>
<div class="line"><a name="l00079"></a><span class="lineno"> 79</span>&#160; <span class="keyword">virtual</span> uint8_t <a class="code" href="class_x_b_o_x_o_l_d.html#a8245e0d30eed5fb7dc761fc350fd1765">Release</a>();</div>
<div class="line"><a name="l00084"></a><span class="lineno"> 84</span>&#160; <span class="keyword">virtual</span> uint8_t <a class="code" href="class_x_b_o_x_o_l_d.html#a332bf499dd0434d70db8ad8a6f3f4850">Poll</a>();</div>
<div class="line"><a name="l00085"></a><span class="lineno"> 85</span>&#160;</div>
<div class="line"><a name="l00090"></a><span class="lineno"><a class="code" href="class_x_b_o_x_o_l_d.html#ac2db53abfe0aae15d56ef65b57a2b38a"> 90</a></span>&#160; <span class="keyword">virtual</span> uint8_t <a class="code" href="class_x_b_o_x_o_l_d.html#ac2db53abfe0aae15d56ef65b57a2b38a">GetAddress</a>() {</div>
<div class="line"><a name="l00091"></a><span class="lineno"> 91</span>&#160; <span class="keywordflow">return</span> <a class="code" href="class_x_b_o_x_o_l_d.html#ae28d3306b484750d7067fa5f7ed0beae">bAddress</a>;</div>
<div class="line"><a name="l00092"></a><span class="lineno"> 92</span>&#160; };</div>
<div class="line"><a name="l00093"></a><span class="lineno"> 93</span>&#160;</div>
<div class="line"><a name="l00098"></a><span class="lineno"><a class="code" href="class_x_b_o_x_o_l_d.html#af4d77a5108f2e6812ba00be1b0374829"> 98</a></span>&#160; <span class="keyword">virtual</span> <span class="keywordtype">bool</span> <a class="code" href="class_x_b_o_x_o_l_d.html#af4d77a5108f2e6812ba00be1b0374829">isReady</a>() {</div>
<div class="line"><a name="l00099"></a><span class="lineno"> 99</span>&#160; <span class="keywordflow">return</span> bPollEnable;</div>
<div class="line"><a name="l00100"></a><span class="lineno"> 100</span>&#160; };</div>
<div class="line"><a name="l00101"></a><span class="lineno"> 101</span>&#160;</div>
<div class="line"><a name="l00108"></a><span class="lineno"><a class="code" href="class_x_b_o_x_o_l_d.html#a20c8b928ca5e7c1a758a605ec45fe2ee"> 108</a></span>&#160; <span class="keyword">virtual</span> <span class="keywordtype">boolean</span> <a class="code" href="class_x_b_o_x_o_l_d.html#a20c8b928ca5e7c1a758a605ec45fe2ee">VIDPIDOK</a>(uint16_t vid, uint16_t pid) {</div>
<div class="line"><a name="l00109"></a><span class="lineno"> 109</span>&#160; <span class="keywordflow">return</span> ((vid == <a class="code" href="_x_b_o_x_o_l_d_8h.html#a8e7834e5604c4fb588cceab9258d0568">XBOX_VID</a> || vid == <a class="code" href="_x_b_o_x_o_l_d_8h.html#a2f5523a1aaa6718e1d11c6bc5b29a575">MADCATZ_VID</a> || vid == <a class="code" href="_x_b_o_x_o_l_d_8h.html#ab029b2c21fb0c240022cc50f465d4580">JOYTECH_VID</a>) &amp;&amp; (pid == <a class="code" href="_x_b_o_x_o_l_d_8h.html#a8495cfaf2039ba2399a3c6f3e107c90c">XBOX_OLD_PID1</a> || pid == <a class="code" href="_x_b_o_x_o_l_d_8h.html#a9c98134e7ea99b12f7e4724af5b9799c">XBOX_OLD_PID2</a> || pid == <a class="code" href="_x_b_o_x_o_l_d_8h.html#a3856d8cf87b39551ed2278691ad891b8">XBOX_OLD_PID3</a> || pid == <a class="code" href="_x_b_o_x_o_l_d_8h.html#a3bf8a81e24b9c3df304fdafb06bbeb4e">XBOX_OLD_PID4</a>));</div>
<div class="line"><a name="l00110"></a><span class="lineno"> 110</span>&#160; };</div>
<div class="line"><a name="l00125"></a><span class="lineno"> 125</span>&#160; uint8_t <a class="code" href="class_x_b_o_x_o_l_d.html#a7943af8e86fd9612891b88c7c7fb586a">getButtonPress</a>(<a class="code" href="controller_enums_8h.html#a03bfec859eac87be20f8952c1eb89de0">Button</a> b);</div>
<div class="line"><a name="l00126"></a><span class="lineno"> 126</span>&#160; <span class="keywordtype">bool</span> <a class="code" href="class_x_b_o_x_o_l_d.html#a16cecc4a0dc7e0f4bc84f4602da65214">getButtonClick</a>(<a class="code" href="controller_enums_8h.html#a03bfec859eac87be20f8952c1eb89de0">Button</a> b);</div>
<div class="line"><a name="l00135"></a><span class="lineno"> 135</span>&#160; int16_t <a class="code" href="class_x_b_o_x_o_l_d.html#ad5a76d53ae0e101763ba5403707f5162">getAnalogHat</a>(<a class="code" href="controller_enums_8h.html#aaaabdefc068fd57ec2bef2b62ea4ba92">AnalogHat</a> a);</div>
<div class="line"><a name="l00136"></a><span class="lineno"> 136</span>&#160;</div>
<div class="line"><a name="l00138"></a><span class="lineno"><a class="code" href="class_x_b_o_x_o_l_d.html#a8014cc70e141362e09beeedb49428746"> 138</a></span>&#160; <span class="keywordtype">void</span> <a class="code" href="class_x_b_o_x_o_l_d.html#a8014cc70e141362e09beeedb49428746">setRumbleOff</a>() {</div>
<div class="line"><a name="l00139"></a><span class="lineno"> 139</span>&#160; <a class="code" href="class_x_b_o_x_o_l_d.html#ab69673ea316c30268a5eedc893bea3a9">setRumbleOn</a>(0, 0);</div>
<div class="line"><a name="l00140"></a><span class="lineno"> 140</span>&#160; };</div>
<div class="line"><a name="l00146"></a><span class="lineno"> 146</span>&#160; <span class="keywordtype">void</span> <a class="code" href="class_x_b_o_x_o_l_d.html#ab69673ea316c30268a5eedc893bea3a9">setRumbleOn</a>(uint8_t lValue, uint8_t rValue);</div>
<div class="line"><a name="l00147"></a><span class="lineno"> 147</span>&#160;</div>
<div class="line"><a name="l00152"></a><span class="lineno"><a class="code" href="class_x_b_o_x_o_l_d.html#a7a7d0f28e51ef4650ac5e2b6c883b159"> 152</a></span>&#160; <span class="keywordtype">void</span> <a class="code" href="class_x_b_o_x_o_l_d.html#a7a7d0f28e51ef4650ac5e2b6c883b159">attachOnInit</a>(<span class="keywordtype">void</span> (*funcOnInit)(<span class="keywordtype">void</span>)) {</div>
<div class="line"><a name="l00153"></a><span class="lineno"> 153</span>&#160; pFuncOnInit = funcOnInit;</div>
<div class="line"><a name="l00154"></a><span class="lineno"><a class="code" href="class_x_b_o_x_o_l_d.html#aa091ff52ba7ad4216b0cd0f18651b755"> 154</a></span>&#160; };</div>
<div class="line"><a name="l00158"></a><span class="lineno"> 158</span>&#160; <span class="keywordtype">bool</span> <a class="code" href="class_x_b_o_x_o_l_d.html#aa091ff52ba7ad4216b0cd0f18651b755">XboxConnected</a>;</div>
<div class="line"><a name="l00159"></a><span class="lineno"> 159</span>&#160;</div>
<div class="line"><a name="l00160"></a><span class="lineno"> 160</span>&#160;<span class="keyword">protected</span>:</div>
<div class="line"><a name="l00162"></a><span class="lineno"><a class="code" href="class_x_b_o_x_o_l_d.html#a2b4d7d994ab6f5e1d1344d4162e9f5fb"> 162</a></span>&#160; <a class="code" href="class_u_s_b.html">USB</a> *<a class="code" href="class_x_b_o_x_o_l_d.html#a2b4d7d994ab6f5e1d1344d4162e9f5fb">pUsb</a>;</div>
<div class="line"><a name="l00164"></a><span class="lineno"><a class="code" href="class_x_b_o_x_o_l_d.html#ae28d3306b484750d7067fa5f7ed0beae"> 164</a></span>&#160; uint8_t <a class="code" href="class_x_b_o_x_o_l_d.html#ae28d3306b484750d7067fa5f7ed0beae">bAddress</a>;</div>
<div class="line"><a name="l00166"></a><span class="lineno"><a class="code" href="class_x_b_o_x_o_l_d.html#a06a318db8037f25a8d9bb62785dbacb9"> 166</a></span>&#160; <a class="code" href="struct_ep_info.html">EpInfo</a> <a class="code" href="class_x_b_o_x_o_l_d.html#a06a318db8037f25a8d9bb62785dbacb9">epInfo</a>[<a class="code" href="_x_b_o_x_o_l_d_8h.html#af35f872fc33e690571eb99de648e8e96">XBOX_MAX_ENDPOINTS</a>];</div>
<div class="line"><a name="l00167"></a><span class="lineno"> 167</span>&#160;</div>
<div class="line"><a name="l00168"></a><span class="lineno"> 168</span>&#160;<span class="keyword">private</span>:</div>
<div class="line"><a name="l00174"></a><span class="lineno"> 174</span>&#160; void (*pFuncOnInit)(void); <span class="comment">// Pointer to function called in onInit()</span></div>
<div class="line"><a name="l00175"></a><span class="lineno"> 175</span>&#160;</div>
<div class="line"><a name="l00176"></a><span class="lineno"> 176</span>&#160; <span class="keywordtype">bool</span> bPollEnable;</div>
<div class="line"><a name="l00177"></a><span class="lineno"> 177</span>&#160;</div>
<div class="line"><a name="l00178"></a><span class="lineno"> 178</span>&#160; <span class="comment">/* Variables to store the digital buttons */</span></div>
<div class="line"><a name="l00179"></a><span class="lineno"> 179</span>&#160; uint8_t ButtonState;</div>
<div class="line"><a name="l00180"></a><span class="lineno"> 180</span>&#160; uint8_t OldButtonState;</div>
<div class="line"><a name="l00181"></a><span class="lineno"> 181</span>&#160; uint8_t ButtonClickState;</div>
<div class="line"><a name="l00182"></a><span class="lineno"> 182</span>&#160;</div>
<div class="line"><a name="l00183"></a><span class="lineno"> 183</span>&#160; <span class="comment">/* Variables to store the analog buttons */</span></div>
<div class="line"><a name="l00184"></a><span class="lineno"> 184</span>&#160; uint8_t buttonValues[8]; <span class="comment">// A, B, X, Y, BLACK, WHITE, L1, and R1</span></div>
<div class="line"><a name="l00185"></a><span class="lineno"> 185</span>&#160; uint8_t oldButtonValues[8];</div>
<div class="line"><a name="l00186"></a><span class="lineno"> 186</span>&#160; <span class="keywordtype">bool</span> buttonClicked[8];</div>
<div class="line"><a name="l00187"></a><span class="lineno"> 187</span>&#160;</div>
<div class="line"><a name="l00188"></a><span class="lineno"> 188</span>&#160; int16_t hatValue[4]; <span class="comment">// Joystick values</span></div>
<div class="line"><a name="l00189"></a><span class="lineno"> 189</span>&#160;</div>
<div class="line"><a name="l00190"></a><span class="lineno"> 190</span>&#160; uint8_t readBuf[<a class="code" href="_x_b_o_x_o_l_d_8h.html#abcb805b13bfd36145e252b0633bbcfc0">EP_MAXPKTSIZE</a>]; <span class="comment">// General purpose buffer for input data</span></div>
<div class="line"><a name="l00191"></a><span class="lineno"> 191</span>&#160;</div>
<div class="line"><a name="l00192"></a><span class="lineno"> 192</span>&#160; <span class="keywordtype">void</span> readReport(); <span class="comment">// Read incoming data</span></div>
<div class="line"><a name="l00193"></a><span class="lineno"> 193</span>&#160; <span class="keywordtype">void</span> printReport(uint16_t length); <span class="comment">// Print incoming date</span></div>
<div class="line"><a name="l00194"></a><span class="lineno"> 194</span>&#160;</div>
<div class="line"><a name="l00195"></a><span class="lineno"> 195</span>&#160; <span class="comment">/* Private commands */</span></div>
<div class="line"><a name="l00196"></a><span class="lineno"> 196</span>&#160; <span class="keywordtype">void</span> XboxCommand(uint8_t* data, uint16_t nbytes);</div>
<div class="line"><a name="l00197"></a><span class="lineno"> 197</span>&#160;};</div>
<div class="line"><a name="l00198"></a><span class="lineno"> 198</span>&#160;<span class="preprocessor">#endif</span></div>
</div><!-- fragment --></div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.4
</small></address>
</body>
</html>

View file

@ -95,7 +95,7 @@ Include dependency graph for XBOXRECV.cpp:</div>
<div class="dyncontent">
<div class="center"><img src="_x_b_o_x_r_e_c_v_8cpp__incl.png" border="0" usemap="#_x_b_o_x_r_e_c_v_8cpp" alt=""/></div>
<map name="_x_b_o_x_r_e_c_v_8cpp" id="_x_b_o_x_r_e_c_v_8cpp">
<area shape="rect" id="node2" href="_x_b_o_x_r_e_c_v_8h.html" title="XBOXRECV.h" alt="" coords="342,75,415,96"/><area shape="rect" id="node4" href="_usb_8h.html" title="Usb.h" alt="" coords="357,144,400,165"/><area shape="rect" id="node19" href="xbox_enums_8h.html" title="xboxEnums.h" alt="" coords="581,144,651,165"/><area shape="rect" id="node7" href="avrpins_8h.html" title="avrpins.h" alt="" coords="43,283,97,304"/><area shape="rect" id="node9" href="max3421e_8h.html" title="max3421e.h" alt="" coords="275,283,341,304"/><area shape="rect" id="node10" href="usbhost_8h.html" title="usbhost.h" alt="" coords="199,213,256,235"/><area shape="rect" id="node11" href="usb__ch9_8h.html" title="usb_ch9.h" alt="" coords="123,283,181,304"/><area shape="rect" id="node13" href="address_8h.html" title="address.h" alt="" coords="350,213,407,235"/><area shape="rect" id="node15" href="message_8h.html" title="message.h" alt="" coords="643,213,704,235"/><area shape="rect" id="node17" href="printhex_8h.html" title="printhex.h" alt="" coords="746,352,803,373"/><area shape="rect" id="node18" href="hexdump_8h.html" title="hexdump.h" alt="" coords="643,283,704,304"/><area shape="rect" id="node20" href="controller_enums_8h.html" title="controllerEnums.h" alt="" coords="729,213,815,235"/></map>
<area shape="rect" id="node2" href="_x_b_o_x_r_e_c_v_8h.html" title="XBOXRECV.h" alt="" coords="405,75,477,96"/><area shape="rect" id="node4" href="_usb_8h.html" title="Usb.h" alt="" coords="420,144,463,165"/><area shape="rect" id="node19" href="xbox_enums_8h.html" title="xboxEnums.h" alt="" coords="725,144,795,165"/><area shape="rect" id="node7" href="avrpins_8h.html" title="avrpins.h" alt="" coords="43,283,97,304"/><area shape="rect" id="node9" href="max3421e_8h.html" title="max3421e.h" alt="" coords="325,283,392,304"/><area shape="rect" id="node10" href="usbhost_8h.html" title="usbhost.h" alt="" coords="186,213,243,235"/><area shape="rect" id="node11" href="usb__ch9_8h.html" title="usb_ch9.h" alt="" coords="243,283,301,304"/><area shape="rect" id="node13" href="address_8h.html" title="address.h" alt="" coords="413,213,469,235"/><area shape="rect" id="node15" href="message_8h.html" title="message.h" alt="" coords="659,213,720,235"/><area shape="rect" id="node17" href="printhex_8h.html" title="printhex.h" alt="" coords="627,352,684,373"/><area shape="rect" id="node18" href="hexdump_8h.html" title="hexdump.h" alt="" coords="693,283,755,304"/><area shape="rect" id="node20" href="controller_enums_8h.html" title="controllerEnums.h" alt="" coords="955,213,1041,235"/></map>
</div>
</div>
<p><a href="_x_b_o_x_r_e_c_v_8cpp_source.html">Go to the source code of this file.</a></p>

View file

@ -1,14 +1,14 @@
<map id="XBOXRECV.cpp" name="XBOXRECV.cpp">
<area shape="rect" id="node2" href="$_x_b_o_x_r_e_c_v_8h.html" title="XBOXRECV.h" alt="" coords="342,75,415,96"/>
<area shape="rect" id="node4" href="$_usb_8h.html" title="Usb.h" alt="" coords="357,144,400,165"/>
<area shape="rect" id="node19" href="$xbox_enums_8h.html" title="xboxEnums.h" alt="" coords="581,144,651,165"/>
<area shape="rect" id="node2" href="$_x_b_o_x_r_e_c_v_8h.html" title="XBOXRECV.h" alt="" coords="405,75,477,96"/>
<area shape="rect" id="node4" href="$_usb_8h.html" title="Usb.h" alt="" coords="420,144,463,165"/>
<area shape="rect" id="node19" href="$xbox_enums_8h.html" title="xboxEnums.h" alt="" coords="725,144,795,165"/>
<area shape="rect" id="node7" href="$avrpins_8h.html" title="avrpins.h" alt="" coords="43,283,97,304"/>
<area shape="rect" id="node9" href="$max3421e_8h.html" title="max3421e.h" alt="" coords="275,283,341,304"/>
<area shape="rect" id="node10" href="$usbhost_8h.html" title="usbhost.h" alt="" coords="199,213,256,235"/>
<area shape="rect" id="node11" href="$usb__ch9_8h.html" title="usb_ch9.h" alt="" coords="123,283,181,304"/>
<area shape="rect" id="node13" href="$address_8h.html" title="address.h" alt="" coords="350,213,407,235"/>
<area shape="rect" id="node15" href="$message_8h.html" title="message.h" alt="" coords="643,213,704,235"/>
<area shape="rect" id="node17" href="$printhex_8h.html" title="printhex.h" alt="" coords="746,352,803,373"/>
<area shape="rect" id="node18" href="$hexdump_8h.html" title="hexdump.h" alt="" coords="643,283,704,304"/>
<area shape="rect" id="node20" href="$controller_enums_8h.html" title="controllerEnums.h" alt="" coords="729,213,815,235"/>
<area shape="rect" id="node9" href="$max3421e_8h.html" title="max3421e.h" alt="" coords="325,283,392,304"/>
<area shape="rect" id="node10" href="$usbhost_8h.html" title="usbhost.h" alt="" coords="186,213,243,235"/>
<area shape="rect" id="node11" href="$usb__ch9_8h.html" title="usb_ch9.h" alt="" coords="243,283,301,304"/>
<area shape="rect" id="node13" href="$address_8h.html" title="address.h" alt="" coords="413,213,469,235"/>
<area shape="rect" id="node15" href="$message_8h.html" title="message.h" alt="" coords="659,213,720,235"/>
<area shape="rect" id="node17" href="$printhex_8h.html" title="printhex.h" alt="" coords="627,352,684,373"/>
<area shape="rect" id="node18" href="$hexdump_8h.html" title="hexdump.h" alt="" coords="693,283,755,304"/>
<area shape="rect" id="node20" href="$controller_enums_8h.html" title="controllerEnums.h" alt="" coords="955,213,1041,235"/>
</map>

View file

@ -1 +1 @@
aa22d4482e816e4553f3f0e12625c189
113568a635f3b275d62eb5c6b659f28a

Binary file not shown.

Before

Width:  |  Height:  |  Size: 62 KiB

After

Width:  |  Height:  |  Size: 69 KiB

View file

@ -117,7 +117,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
<div class="line"><a name="l00026"></a><span class="lineno"> 26</span>&#160;pUsb(p), <span class="comment">// pointer to USB class instance - mandatory</span></div>
<div class="line"><a name="l00027"></a><span class="lineno"> 27</span>&#160;bAddress(0), <span class="comment">// device address - mandatory</span></div>
<div class="line"><a name="l00028"></a><span class="lineno"> 28</span>&#160;bPollEnable(false) { <span class="comment">// don&#39;t start polling before dongle is connected</span></div>
<div class="line"><a name="l00029"></a><span class="lineno"> 29</span>&#160; <span class="keywordflow">for</span> (uint8_t i = 0; i &lt; <a class="code" href="_x_b_o_x_r_e_c_v_8h.html#af35f872fc33e690571eb99de648e8e96">XBOX_MAX_ENDPOINTS</a>; i++) {</div>
<div class="line"><a name="l00029"></a><span class="lineno"> 29</span>&#160; <span class="keywordflow">for</span> (uint8_t i = 0; i &lt; <a class="code" href="_x_b_o_x_o_l_d_8h.html#af35f872fc33e690571eb99de648e8e96">XBOX_MAX_ENDPOINTS</a>; i++) {</div>
<div class="line"><a name="l00030"></a><span class="lineno"> 30</span>&#160; <a class="code" href="class_x_b_o_x_r_e_c_v.html#af97c8d0efc945fa4ba1d120c8a5a9cbb">epInfo</a>[i].<a class="code" href="struct_ep_info.html#a9f92be74c75c037b39e2cae1eb49b89b">epAddr</a> = 0;</div>
<div class="line"><a name="l00031"></a><span class="lineno"> 31</span>&#160; <a class="code" href="class_x_b_o_x_r_e_c_v.html#af97c8d0efc945fa4ba1d120c8a5a9cbb">epInfo</a>[i].<a class="code" href="struct_ep_info.html#aa2ca775b63736df4008e88da7dd4dddb">maxPktSize</a> = (i) ? 0 : 8;</div>
<div class="line"><a name="l00032"></a><span class="lineno"> 32</span>&#160; <a class="code" href="class_x_b_o_x_r_e_c_v.html#af97c8d0efc945fa4ba1d120c8a5a9cbb">epInfo</a>[i].<a class="code" href="struct_ep_info.html#a1dea928517c961235eef7b0876e69f10">epAttribs</a> = 0;</div>
@ -139,12 +139,12 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
<div class="line"><a name="l00048"></a><span class="lineno"> 48</span>&#160; <span class="comment">// get memory address of USB device address pool</span></div>
<div class="line"><a name="l00049"></a><span class="lineno"> 49</span>&#160; <a class="code" href="class_address_pool.html">AddressPool</a> &amp;addrPool = <a class="code" href="class_x_b_o_x_r_e_c_v.html#a53047c86c8c2f625916af62238d50fc8">pUsb</a>-&gt;<a class="code" href="class_u_s_b.html#a66ab8f5eda239e761d5a48741ea1f9d4">GetAddressPool</a>();</div>
<div class="line"><a name="l00050"></a><span class="lineno"> 50</span>&#160;<span class="preprocessor">#ifdef EXTRADEBUG</span></div>
<div class="line"><a name="l00051"></a><span class="lineno"> 51</span>&#160;<span class="preprocessor"></span> <a class="code" href="message_8h.html#a747819b0aa34f5c3ba0332c2db28c846">Notify</a>(PSTR(<span class="stringliteral">&quot;\r\nXBOXRECV Init&quot;</span>), 0x80);</div>
<div class="line"><a name="l00051"></a><span class="lineno"> 51</span>&#160;<span class="preprocessor"></span> <a class="code" href="message_8h.html#a27117e124c5d66d5512fe8d494fe6338">Notify</a>(PSTR(<span class="stringliteral">&quot;\r\nXBOXRECV Init&quot;</span>), 0x80);</div>
<div class="line"><a name="l00052"></a><span class="lineno"> 52</span>&#160;<span class="preprocessor">#endif</span></div>
<div class="line"><a name="l00053"></a><span class="lineno"> 53</span>&#160;<span class="preprocessor"></span> <span class="comment">// check if address has already been assigned to an instance</span></div>
<div class="line"><a name="l00054"></a><span class="lineno"> 54</span>&#160; <span class="keywordflow">if</span> (<a class="code" href="class_x_b_o_x_r_e_c_v.html#a1d4bdb1b740c87fd51aca3969e67c730">bAddress</a>) {</div>
<div class="line"><a name="l00055"></a><span class="lineno"> 55</span>&#160;<span class="preprocessor">#ifdef DEBUG_USB_HOST</span></div>
<div class="line"><a name="l00056"></a><span class="lineno"> 56</span>&#160;<span class="preprocessor"></span> <a class="code" href="message_8h.html#a747819b0aa34f5c3ba0332c2db28c846">Notify</a>(PSTR(<span class="stringliteral">&quot;\r\nAddress in use&quot;</span>), 0x80);</div>
<div class="line"><a name="l00056"></a><span class="lineno"> 56</span>&#160;<span class="preprocessor"></span> <a class="code" href="message_8h.html#a27117e124c5d66d5512fe8d494fe6338">Notify</a>(PSTR(<span class="stringliteral">&quot;\r\nAddress in use&quot;</span>), 0x80);</div>
<div class="line"><a name="l00057"></a><span class="lineno"> 57</span>&#160;<span class="preprocessor">#endif</span></div>
<div class="line"><a name="l00058"></a><span class="lineno"> 58</span>&#160;<span class="preprocessor"></span> <span class="keywordflow">return</span> <a class="code" href="_usb_8h.html#a44416ff64fc0e3691f98addac13d4595">USB_ERROR_CLASS_INSTANCE_ALREADY_IN_USE</a>;</div>
<div class="line"><a name="l00059"></a><span class="lineno"> 59</span>&#160; }</div>
@ -154,14 +154,14 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
<div class="line"><a name="l00063"></a><span class="lineno"> 63</span>&#160;</div>
<div class="line"><a name="l00064"></a><span class="lineno"> 64</span>&#160; <span class="keywordflow">if</span> (!p) {</div>
<div class="line"><a name="l00065"></a><span class="lineno"> 65</span>&#160;<span class="preprocessor">#ifdef DEBUG_USB_HOST</span></div>
<div class="line"><a name="l00066"></a><span class="lineno"> 66</span>&#160;<span class="preprocessor"></span> <a class="code" href="message_8h.html#a747819b0aa34f5c3ba0332c2db28c846">Notify</a>(PSTR(<span class="stringliteral">&quot;\r\nAddress not found&quot;</span>), 0x80);</div>
<div class="line"><a name="l00066"></a><span class="lineno"> 66</span>&#160;<span class="preprocessor"></span> <a class="code" href="message_8h.html#a27117e124c5d66d5512fe8d494fe6338">Notify</a>(PSTR(<span class="stringliteral">&quot;\r\nAddress not found&quot;</span>), 0x80);</div>
<div class="line"><a name="l00067"></a><span class="lineno"> 67</span>&#160;<span class="preprocessor">#endif</span></div>
<div class="line"><a name="l00068"></a><span class="lineno"> 68</span>&#160;<span class="preprocessor"></span> <span class="keywordflow">return</span> <a class="code" href="_usb_8h.html#afe2fedb4b0ccc89a688c0b4b59691ce0">USB_ERROR_ADDRESS_NOT_FOUND_IN_POOL</a>;</div>
<div class="line"><a name="l00069"></a><span class="lineno"> 69</span>&#160; }</div>
<div class="line"><a name="l00070"></a><span class="lineno"> 70</span>&#160;</div>
<div class="line"><a name="l00071"></a><span class="lineno"> 71</span>&#160; <span class="keywordflow">if</span> (!p-&gt;<a class="code" href="struct_usb_device.html#a410d39fb7758157f57794335e990ed02">epinfo</a>) {</div>
<div class="line"><a name="l00072"></a><span class="lineno"> 72</span>&#160;<span class="preprocessor">#ifdef DEBUG_USB_HOST</span></div>
<div class="line"><a name="l00073"></a><span class="lineno"> 73</span>&#160;<span class="preprocessor"></span> <a class="code" href="message_8h.html#a747819b0aa34f5c3ba0332c2db28c846">Notify</a>(PSTR(<span class="stringliteral">&quot;\r\nepinfo is null&quot;</span>), 0x80);</div>
<div class="line"><a name="l00073"></a><span class="lineno"> 73</span>&#160;<span class="preprocessor"></span> <a class="code" href="message_8h.html#a27117e124c5d66d5512fe8d494fe6338">Notify</a>(PSTR(<span class="stringliteral">&quot;\r\nepinfo is null&quot;</span>), 0x80);</div>
<div class="line"><a name="l00074"></a><span class="lineno"> 74</span>&#160;<span class="preprocessor">#endif</span></div>
<div class="line"><a name="l00075"></a><span class="lineno"> 75</span>&#160;<span class="preprocessor"></span> <span class="keywordflow">return</span> <a class="code" href="_usb_8h.html#af192c59cafe2192ad802b22e6dbc077d">USB_ERROR_EPINFO_IS_NULL</a>;</div>
<div class="line"><a name="l00076"></a><span class="lineno"> 76</span>&#160; }</div>
@ -185,11 +185,11 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
<div class="line"><a name="l00094"></a><span class="lineno"> 94</span>&#160; VID = ((<a class="code" href="struct_u_s_b___d_e_v_i_c_e___d_e_s_c_r_i_p_t_o_r.html">USB_DEVICE_DESCRIPTOR</a>*)buf)-&gt;idVendor;</div>
<div class="line"><a name="l00095"></a><span class="lineno"> 95</span>&#160; PID = ((<a class="code" href="struct_u_s_b___d_e_v_i_c_e___d_e_s_c_r_i_p_t_o_r.html">USB_DEVICE_DESCRIPTOR</a>*)buf)-&gt;idProduct;</div>
<div class="line"><a name="l00096"></a><span class="lineno"> 96</span>&#160;</div>
<div class="line"><a name="l00097"></a><span class="lineno"> 97</span>&#160; <span class="keywordflow">if</span> (VID != <a class="code" href="_x_b_o_x_r_e_c_v_8h.html#a8e7834e5604c4fb588cceab9258d0568">XBOX_VID</a> &amp;&amp; VID != <a class="code" href="_x_b_o_x_r_e_c_v_8h.html#a2f5523a1aaa6718e1d11c6bc5b29a575">MADCATZ_VID</a>) <span class="comment">// We just check if it&#39;s a xbox receiver using the Vendor ID</span></div>
<div class="line"><a name="l00097"></a><span class="lineno"> 97</span>&#160; <span class="keywordflow">if</span> (VID != <a class="code" href="_x_b_o_x_o_l_d_8h.html#a8e7834e5604c4fb588cceab9258d0568">XBOX_VID</a> &amp;&amp; VID != <a class="code" href="_x_b_o_x_o_l_d_8h.html#a2f5523a1aaa6718e1d11c6bc5b29a575">MADCATZ_VID</a>) <span class="comment">// We just check if it&#39;s a Xbox receiver using the Vendor ID</span></div>
<div class="line"><a name="l00098"></a><span class="lineno"> 98</span>&#160; <span class="keywordflow">goto</span> FailUnknownDevice;</div>
<div class="line"><a name="l00099"></a><span class="lineno"> 99</span>&#160; <span class="keywordflow">else</span> <span class="keywordflow">if</span> (PID != <a class="code" href="_x_b_o_x_r_e_c_v_8h.html#a1a97ce2829a30b96ea6640d387d245a9">XBOX_WIRELESS_RECEIVER_PID</a> &amp;&amp; PID != <a class="code" href="_x_b_o_x_r_e_c_v_8h.html#a6842663964e470b86786f046e4bc30d9">XBOX_WIRELESS_RECEIVER_THIRD_PARTY_PID</a>) {</div>
<div class="line"><a name="l00099"></a><span class="lineno"> 99</span>&#160; <span class="keywordflow">else</span> <span class="keywordflow">if</span> (PID != <a class="code" href="_x_b_o_x_r_e_c_v_8h.html#a1a97ce2829a30b96ea6640d387d245a9">XBOX_WIRELESS_RECEIVER_PID</a> &amp;&amp; PID != <a class="code" href="_x_b_o_x_r_e_c_v_8h.html#a6842663964e470b86786f046e4bc30d9">XBOX_WIRELESS_RECEIVER_THIRD_PARTY_PID</a>) { <span class="comment">// Check the PID as well</span></div>
<div class="line"><a name="l00100"></a><span class="lineno"> 100</span>&#160;<span class="preprocessor">#ifdef DEBUG_USB_HOST</span></div>
<div class="line"><a name="l00101"></a><span class="lineno"> 101</span>&#160;<span class="preprocessor"></span> <a class="code" href="message_8h.html#a747819b0aa34f5c3ba0332c2db28c846">Notify</a>(PSTR(<span class="stringliteral">&quot;\r\nYou&#39;ll need a wireless receiver for this libary to work&quot;</span>), 0x80);</div>
<div class="line"><a name="l00101"></a><span class="lineno"> 101</span>&#160;<span class="preprocessor"></span> <a class="code" href="message_8h.html#a27117e124c5d66d5512fe8d494fe6338">Notify</a>(PSTR(<span class="stringliteral">&quot;\r\nYou&#39;ll need a wireless receiver for this libary to work&quot;</span>), 0x80);</div>
<div class="line"><a name="l00102"></a><span class="lineno"> 102</span>&#160;<span class="preprocessor">#endif</span></div>
<div class="line"><a name="l00103"></a><span class="lineno"> 103</span>&#160;<span class="preprocessor"></span> <span class="keywordflow">goto</span> FailUnknownDevice;</div>
<div class="line"><a name="l00104"></a><span class="lineno"> 104</span>&#160; }</div>
@ -210,416 +210,424 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
<div class="line"><a name="l00119"></a><span class="lineno"> 119</span>&#160; addrPool.<a class="code" href="class_address_pool.html#a15fde13223dcb1da89305ad229763562">FreeAddress</a>(<a class="code" href="class_x_b_o_x_r_e_c_v.html#a1d4bdb1b740c87fd51aca3969e67c730">bAddress</a>);</div>
<div class="line"><a name="l00120"></a><span class="lineno"> 120</span>&#160; <a class="code" href="class_x_b_o_x_r_e_c_v.html#a1d4bdb1b740c87fd51aca3969e67c730">bAddress</a> = 0;</div>
<div class="line"><a name="l00121"></a><span class="lineno"> 121</span>&#160;<span class="preprocessor">#ifdef DEBUG_USB_HOST</span></div>
<div class="line"><a name="l00122"></a><span class="lineno"> 122</span>&#160;<span class="preprocessor"></span> <a class="code" href="message_8h.html#a747819b0aa34f5c3ba0332c2db28c846">Notify</a>(PSTR(<span class="stringliteral">&quot;\r\nsetAddr: &quot;</span>), 0x80);</div>
<div class="line"><a name="l00122"></a><span class="lineno"> 122</span>&#160;<span class="preprocessor"></span> <a class="code" href="message_8h.html#a27117e124c5d66d5512fe8d494fe6338">Notify</a>(PSTR(<span class="stringliteral">&quot;\r\nsetAddr: &quot;</span>), 0x80);</div>
<div class="line"><a name="l00123"></a><span class="lineno"> 123</span>&#160; D_PrintHex&lt;uint8_t &gt; (rcode, 0x80);</div>
<div class="line"><a name="l00124"></a><span class="lineno"> 124</span>&#160;<span class="preprocessor">#endif</span></div>
<div class="line"><a name="l00125"></a><span class="lineno"> 125</span>&#160;<span class="preprocessor"></span> <span class="keywordflow">return</span> rcode;</div>
<div class="line"><a name="l00126"></a><span class="lineno"> 126</span>&#160; }</div>
<div class="line"><a name="l00127"></a><span class="lineno"> 127</span>&#160;<span class="preprocessor">#ifdef EXTRADEBUG</span></div>
<div class="line"><a name="l00128"></a><span class="lineno"> 128</span>&#160;<span class="preprocessor"></span> <a class="code" href="message_8h.html#a747819b0aa34f5c3ba0332c2db28c846">Notify</a>(PSTR(<span class="stringliteral">&quot;\r\nAddr: &quot;</span>), 0x80);</div>
<div class="line"><a name="l00128"></a><span class="lineno"> 128</span>&#160;<span class="preprocessor"></span> <a class="code" href="message_8h.html#a27117e124c5d66d5512fe8d494fe6338">Notify</a>(PSTR(<span class="stringliteral">&quot;\r\nAddr: &quot;</span>), 0x80);</div>
<div class="line"><a name="l00129"></a><span class="lineno"> 129</span>&#160; D_PrintHex&lt;uint8_t &gt; (<a class="code" href="class_x_b_o_x_r_e_c_v.html#a1d4bdb1b740c87fd51aca3969e67c730">bAddress</a>, 0x80);</div>
<div class="line"><a name="l00130"></a><span class="lineno"> 130</span>&#160;<span class="preprocessor">#endif</span></div>
<div class="line"><a name="l00131"></a><span class="lineno"> 131</span>&#160;<span class="preprocessor"></span> p-&gt;<a class="code" href="struct_usb_device.html#a86a815577ad7883437d3ca72b32b8e8a">lowspeed</a> = <span class="keyword">false</span>;</div>
<div class="line"><a name="l00132"></a><span class="lineno"> 132</span>&#160;</div>
<div class="line"><a name="l00133"></a><span class="lineno"> 133</span>&#160; <span class="comment">//get pointer to assigned address record</span></div>
<div class="line"><a name="l00134"></a><span class="lineno"> 134</span>&#160; p = addrPool.<a class="code" href="class_address_pool.html#aa92d7e8f0f515340ae2dc1679b627056">GetUsbDevicePtr</a>(bAddress);</div>
<div class="line"><a name="l00135"></a><span class="lineno"> 135</span>&#160; <span class="keywordflow">if</span> (!p)</div>
<div class="line"><a name="l00136"></a><span class="lineno"> 136</span>&#160; <span class="keywordflow">return</span> <a class="code" href="_usb_8h.html#afe2fedb4b0ccc89a688c0b4b59691ce0">USB_ERROR_ADDRESS_NOT_FOUND_IN_POOL</a>;</div>
<div class="line"><a name="l00137"></a><span class="lineno"> 137</span>&#160;</div>
<div class="line"><a name="l00138"></a><span class="lineno"> 138</span>&#160; p-&gt;<a class="code" href="struct_usb_device.html#a86a815577ad7883437d3ca72b32b8e8a">lowspeed</a> = lowspeed;</div>
<div class="line"><a name="l00131"></a><span class="lineno"> 131</span>&#160;<span class="preprocessor"></span> delay(300); <span class="comment">// Spec says you should wait at least 200ms</span></div>
<div class="line"><a name="l00132"></a><span class="lineno"> 132</span>&#160; </div>
<div class="line"><a name="l00133"></a><span class="lineno"> 133</span>&#160; p-&gt;<a class="code" href="struct_usb_device.html#a86a815577ad7883437d3ca72b32b8e8a">lowspeed</a> = <span class="keyword">false</span>;</div>
<div class="line"><a name="l00134"></a><span class="lineno"> 134</span>&#160;</div>
<div class="line"><a name="l00135"></a><span class="lineno"> 135</span>&#160; <span class="comment">//get pointer to assigned address record</span></div>
<div class="line"><a name="l00136"></a><span class="lineno"> 136</span>&#160; p = addrPool.<a class="code" href="class_address_pool.html#aa92d7e8f0f515340ae2dc1679b627056">GetUsbDevicePtr</a>(bAddress);</div>
<div class="line"><a name="l00137"></a><span class="lineno"> 137</span>&#160; <span class="keywordflow">if</span> (!p)</div>
<div class="line"><a name="l00138"></a><span class="lineno"> 138</span>&#160; <span class="keywordflow">return</span> <a class="code" href="_usb_8h.html#afe2fedb4b0ccc89a688c0b4b59691ce0">USB_ERROR_ADDRESS_NOT_FOUND_IN_POOL</a>;</div>
<div class="line"><a name="l00139"></a><span class="lineno"> 139</span>&#160;</div>
<div class="line"><a name="l00140"></a><span class="lineno"> 140</span>&#160; <span class="comment">// Assign epInfo to epinfo pointer - only EP0 is known</span></div>
<div class="line"><a name="l00141"></a><span class="lineno"> 141</span>&#160; rcode = <a class="code" href="class_x_b_o_x_r_e_c_v.html#a53047c86c8c2f625916af62238d50fc8">pUsb</a>-&gt;<a class="code" href="class_u_s_b.html#a6c3ba3f7e6dccb450267011ce783d7ea">setEpInfoEntry</a>(bAddress, 1, <a class="code" href="class_x_b_o_x_r_e_c_v.html#af97c8d0efc945fa4ba1d120c8a5a9cbb">epInfo</a>);</div>
<div class="line"><a name="l00142"></a><span class="lineno"> 142</span>&#160; <span class="keywordflow">if</span> (rcode)</div>
<div class="line"><a name="l00143"></a><span class="lineno"> 143</span>&#160; <span class="keywordflow">goto</span> FailSetDevTblEntry;</div>
<div class="line"><a name="l00144"></a><span class="lineno"> 144</span>&#160;</div>
<div class="line"><a name="l00145"></a><span class="lineno"> 145</span>&#160; <span class="comment">/* The application will work in reduced host mode, so we can save program and data</span></div>
<div class="line"><a name="l00146"></a><span class="lineno"> 146</span>&#160;<span class="comment"> memory space. After verifying the VID we will use known values for the</span></div>
<div class="line"><a name="l00147"></a><span class="lineno"> 147</span>&#160;<span class="comment"> configuration values for device, interface, endpoints and HID for the XBOX360 Wireless receiver */</span></div>
<div class="line"><a name="l00148"></a><span class="lineno"> 148</span>&#160;</div>
<div class="line"><a name="l00149"></a><span class="lineno"> 149</span>&#160; <span class="comment">/* Initialize data structures for endpoints of device */</span></div>
<div class="line"><a name="l00150"></a><span class="lineno"> 150</span>&#160; <a class="code" href="class_x_b_o_x_r_e_c_v.html#af97c8d0efc945fa4ba1d120c8a5a9cbb">epInfo</a>[ <a class="code" href="_x_b_o_x_r_e_c_v_8h.html#a2824b25aa9a384c29f27a4e1bb443799">XBOX_INPUT_PIPE_1</a> ].<a class="code" href="struct_ep_info.html#a9f92be74c75c037b39e2cae1eb49b89b">epAddr</a> = 0x01; <span class="comment">// XBOX 360 report endpoint - poll interval 1ms</span></div>
<div class="line"><a name="l00151"></a><span class="lineno"> 151</span>&#160; <a class="code" href="class_x_b_o_x_r_e_c_v.html#af97c8d0efc945fa4ba1d120c8a5a9cbb">epInfo</a>[ <a class="code" href="_x_b_o_x_r_e_c_v_8h.html#a2824b25aa9a384c29f27a4e1bb443799">XBOX_INPUT_PIPE_1</a> ].<a class="code" href="struct_ep_info.html#a1dea928517c961235eef7b0876e69f10">epAttribs</a> = <a class="code" href="_p_s3_u_s_b_8h.html#ad4d26e1c566064f2259faf65f0858b6e">EP_INTERRUPT</a>;</div>
<div class="line"><a name="l00152"></a><span class="lineno"> 152</span>&#160; <a class="code" href="class_x_b_o_x_r_e_c_v.html#af97c8d0efc945fa4ba1d120c8a5a9cbb">epInfo</a>[ <a class="code" href="_x_b_o_x_r_e_c_v_8h.html#a2824b25aa9a384c29f27a4e1bb443799">XBOX_INPUT_PIPE_1</a> ].<a class="code" href="struct_ep_info.html#a3a5b1c017a034cd9e06e76729e727c46">bmNakPower</a> = <a class="code" href="address_8h.html#a660e8da9c1167a8450aef91c5c03761d">USB_NAK_NOWAIT</a>; <span class="comment">// Only poll once for interrupt endpoints</span></div>
<div class="line"><a name="l00153"></a><span class="lineno"> 153</span>&#160; <a class="code" href="class_x_b_o_x_r_e_c_v.html#af97c8d0efc945fa4ba1d120c8a5a9cbb">epInfo</a>[ <a class="code" href="_x_b_o_x_r_e_c_v_8h.html#a2824b25aa9a384c29f27a4e1bb443799">XBOX_INPUT_PIPE_1</a> ].<a class="code" href="struct_ep_info.html#aa2ca775b63736df4008e88da7dd4dddb">maxPktSize</a> = <a class="code" href="_p_s3_u_s_b_8h.html#abcb805b13bfd36145e252b0633bbcfc0">EP_MAXPKTSIZE</a>;</div>
<div class="line"><a name="l00154"></a><span class="lineno"> 154</span>&#160; <a class="code" href="class_x_b_o_x_r_e_c_v.html#af97c8d0efc945fa4ba1d120c8a5a9cbb">epInfo</a>[ <a class="code" href="_x_b_o_x_r_e_c_v_8h.html#a2824b25aa9a384c29f27a4e1bb443799">XBOX_INPUT_PIPE_1</a> ].<a class="code" href="struct_ep_info.html#ac85bff70ad0e5d71e50cb501f4d8caf3">bmSndToggle</a> = <a class="code" href="max3421e_8h.html#a4834ae7378471b63b9a1985c6294006f">bmSNDTOG0</a>;</div>
<div class="line"><a name="l00155"></a><span class="lineno"> 155</span>&#160; <a class="code" href="class_x_b_o_x_r_e_c_v.html#af97c8d0efc945fa4ba1d120c8a5a9cbb">epInfo</a>[ <a class="code" href="_x_b_o_x_r_e_c_v_8h.html#a2824b25aa9a384c29f27a4e1bb443799">XBOX_INPUT_PIPE_1</a> ].<a class="code" href="struct_ep_info.html#a9238dd40c096baedf041c98b19386a14">bmRcvToggle</a> = <a class="code" href="max3421e_8h.html#aca6a8aa4f0aebbe07c5e175572a92ef7">bmRCVTOG0</a>;</div>
<div class="line"><a name="l00156"></a><span class="lineno"> 156</span>&#160; <a class="code" href="class_x_b_o_x_r_e_c_v.html#af97c8d0efc945fa4ba1d120c8a5a9cbb">epInfo</a>[ <a class="code" href="_x_b_o_x_r_e_c_v_8h.html#a962be1e740bce25cf37e111bd88be9bf">XBOX_OUTPUT_PIPE_1</a> ].<a class="code" href="struct_ep_info.html#a9f92be74c75c037b39e2cae1eb49b89b">epAddr</a> = 0x01; <span class="comment">// XBOX 360 output endpoint - poll interval 8ms</span></div>
<div class="line"><a name="l00157"></a><span class="lineno"> 157</span>&#160; <a class="code" href="class_x_b_o_x_r_e_c_v.html#af97c8d0efc945fa4ba1d120c8a5a9cbb">epInfo</a>[ <a class="code" href="_x_b_o_x_r_e_c_v_8h.html#a962be1e740bce25cf37e111bd88be9bf">XBOX_OUTPUT_PIPE_1</a> ].<a class="code" href="struct_ep_info.html#a1dea928517c961235eef7b0876e69f10">epAttribs</a> = <a class="code" href="_p_s3_u_s_b_8h.html#ad4d26e1c566064f2259faf65f0858b6e">EP_INTERRUPT</a>;</div>
<div class="line"><a name="l00158"></a><span class="lineno"> 158</span>&#160; <a class="code" href="class_x_b_o_x_r_e_c_v.html#af97c8d0efc945fa4ba1d120c8a5a9cbb">epInfo</a>[ <a class="code" href="_x_b_o_x_r_e_c_v_8h.html#a962be1e740bce25cf37e111bd88be9bf">XBOX_OUTPUT_PIPE_1</a> ].<a class="code" href="struct_ep_info.html#a3a5b1c017a034cd9e06e76729e727c46">bmNakPower</a> = <a class="code" href="address_8h.html#a660e8da9c1167a8450aef91c5c03761d">USB_NAK_NOWAIT</a>; <span class="comment">// Only poll once for interrupt endpoints</span></div>
<div class="line"><a name="l00159"></a><span class="lineno"> 159</span>&#160; <a class="code" href="class_x_b_o_x_r_e_c_v.html#af97c8d0efc945fa4ba1d120c8a5a9cbb">epInfo</a>[ <a class="code" href="_x_b_o_x_r_e_c_v_8h.html#a962be1e740bce25cf37e111bd88be9bf">XBOX_OUTPUT_PIPE_1</a> ].<a class="code" href="struct_ep_info.html#aa2ca775b63736df4008e88da7dd4dddb">maxPktSize</a> = <a class="code" href="_p_s3_u_s_b_8h.html#abcb805b13bfd36145e252b0633bbcfc0">EP_MAXPKTSIZE</a>;</div>
<div class="line"><a name="l00160"></a><span class="lineno"> 160</span>&#160; <a class="code" href="class_x_b_o_x_r_e_c_v.html#af97c8d0efc945fa4ba1d120c8a5a9cbb">epInfo</a>[ <a class="code" href="_x_b_o_x_r_e_c_v_8h.html#a962be1e740bce25cf37e111bd88be9bf">XBOX_OUTPUT_PIPE_1</a> ].<a class="code" href="struct_ep_info.html#ac85bff70ad0e5d71e50cb501f4d8caf3">bmSndToggle</a> = <a class="code" href="max3421e_8h.html#a4834ae7378471b63b9a1985c6294006f">bmSNDTOG0</a>;</div>
<div class="line"><a name="l00161"></a><span class="lineno"> 161</span>&#160; <a class="code" href="class_x_b_o_x_r_e_c_v.html#af97c8d0efc945fa4ba1d120c8a5a9cbb">epInfo</a>[ <a class="code" href="_x_b_o_x_r_e_c_v_8h.html#a962be1e740bce25cf37e111bd88be9bf">XBOX_OUTPUT_PIPE_1</a> ].<a class="code" href="struct_ep_info.html#a9238dd40c096baedf041c98b19386a14">bmRcvToggle</a> = <a class="code" href="max3421e_8h.html#aca6a8aa4f0aebbe07c5e175572a92ef7">bmRCVTOG0</a>;</div>
<div class="line"><a name="l00162"></a><span class="lineno"> 162</span>&#160;</div>
<div class="line"><a name="l00163"></a><span class="lineno"> 163</span>&#160; <a class="code" href="class_x_b_o_x_r_e_c_v.html#af97c8d0efc945fa4ba1d120c8a5a9cbb">epInfo</a>[ <a class="code" href="_x_b_o_x_r_e_c_v_8h.html#aab6feb681a78b190190bcc081868a485">XBOX_INPUT_PIPE_2</a> ].<a class="code" href="struct_ep_info.html#a9f92be74c75c037b39e2cae1eb49b89b">epAddr</a> = 0x03; <span class="comment">// XBOX 360 report endpoint - poll interval 1ms</span></div>
<div class="line"><a name="l00164"></a><span class="lineno"> 164</span>&#160; <a class="code" href="class_x_b_o_x_r_e_c_v.html#af97c8d0efc945fa4ba1d120c8a5a9cbb">epInfo</a>[ <a class="code" href="_x_b_o_x_r_e_c_v_8h.html#aab6feb681a78b190190bcc081868a485">XBOX_INPUT_PIPE_2</a> ].<a class="code" href="struct_ep_info.html#a1dea928517c961235eef7b0876e69f10">epAttribs</a> = <a class="code" href="_p_s3_u_s_b_8h.html#ad4d26e1c566064f2259faf65f0858b6e">EP_INTERRUPT</a>;</div>
<div class="line"><a name="l00165"></a><span class="lineno"> 165</span>&#160; <a class="code" href="class_x_b_o_x_r_e_c_v.html#af97c8d0efc945fa4ba1d120c8a5a9cbb">epInfo</a>[ <a class="code" href="_x_b_o_x_r_e_c_v_8h.html#aab6feb681a78b190190bcc081868a485">XBOX_INPUT_PIPE_2</a> ].<a class="code" href="struct_ep_info.html#a3a5b1c017a034cd9e06e76729e727c46">bmNakPower</a> = <a class="code" href="address_8h.html#a660e8da9c1167a8450aef91c5c03761d">USB_NAK_NOWAIT</a>; <span class="comment">// Only poll once for interrupt endpoints</span></div>
<div class="line"><a name="l00166"></a><span class="lineno"> 166</span>&#160; <a class="code" href="class_x_b_o_x_r_e_c_v.html#af97c8d0efc945fa4ba1d120c8a5a9cbb">epInfo</a>[ <a class="code" href="_x_b_o_x_r_e_c_v_8h.html#aab6feb681a78b190190bcc081868a485">XBOX_INPUT_PIPE_2</a> ].<a class="code" href="struct_ep_info.html#aa2ca775b63736df4008e88da7dd4dddb">maxPktSize</a> = <a class="code" href="_p_s3_u_s_b_8h.html#abcb805b13bfd36145e252b0633bbcfc0">EP_MAXPKTSIZE</a>;</div>
<div class="line"><a name="l00167"></a><span class="lineno"> 167</span>&#160; <a class="code" href="class_x_b_o_x_r_e_c_v.html#af97c8d0efc945fa4ba1d120c8a5a9cbb">epInfo</a>[ <a class="code" href="_x_b_o_x_r_e_c_v_8h.html#aab6feb681a78b190190bcc081868a485">XBOX_INPUT_PIPE_2</a> ].<a class="code" href="struct_ep_info.html#ac85bff70ad0e5d71e50cb501f4d8caf3">bmSndToggle</a> = <a class="code" href="max3421e_8h.html#a4834ae7378471b63b9a1985c6294006f">bmSNDTOG0</a>;</div>
<div class="line"><a name="l00168"></a><span class="lineno"> 168</span>&#160; <a class="code" href="class_x_b_o_x_r_e_c_v.html#af97c8d0efc945fa4ba1d120c8a5a9cbb">epInfo</a>[ <a class="code" href="_x_b_o_x_r_e_c_v_8h.html#aab6feb681a78b190190bcc081868a485">XBOX_INPUT_PIPE_2</a> ].<a class="code" href="struct_ep_info.html#a9238dd40c096baedf041c98b19386a14">bmRcvToggle</a> = <a class="code" href="max3421e_8h.html#aca6a8aa4f0aebbe07c5e175572a92ef7">bmRCVTOG0</a>;</div>
<div class="line"><a name="l00169"></a><span class="lineno"> 169</span>&#160; <a class="code" href="class_x_b_o_x_r_e_c_v.html#af97c8d0efc945fa4ba1d120c8a5a9cbb">epInfo</a>[ <a class="code" href="_x_b_o_x_r_e_c_v_8h.html#a8ba688a4bdb47869d7ee3f49b6d07b7c">XBOX_OUTPUT_PIPE_2</a> ].<a class="code" href="struct_ep_info.html#a9f92be74c75c037b39e2cae1eb49b89b">epAddr</a> = 0x03; <span class="comment">// XBOX 360 output endpoint - poll interval 8ms</span></div>
<div class="line"><a name="l00170"></a><span class="lineno"> 170</span>&#160; <a class="code" href="class_x_b_o_x_r_e_c_v.html#af97c8d0efc945fa4ba1d120c8a5a9cbb">epInfo</a>[ <a class="code" href="_x_b_o_x_r_e_c_v_8h.html#a8ba688a4bdb47869d7ee3f49b6d07b7c">XBOX_OUTPUT_PIPE_2</a> ].<a class="code" href="struct_ep_info.html#a1dea928517c961235eef7b0876e69f10">epAttribs</a> = <a class="code" href="_p_s3_u_s_b_8h.html#ad4d26e1c566064f2259faf65f0858b6e">EP_INTERRUPT</a>;</div>
<div class="line"><a name="l00171"></a><span class="lineno"> 171</span>&#160; <a class="code" href="class_x_b_o_x_r_e_c_v.html#af97c8d0efc945fa4ba1d120c8a5a9cbb">epInfo</a>[ <a class="code" href="_x_b_o_x_r_e_c_v_8h.html#a8ba688a4bdb47869d7ee3f49b6d07b7c">XBOX_OUTPUT_PIPE_2</a> ].<a class="code" href="struct_ep_info.html#a3a5b1c017a034cd9e06e76729e727c46">bmNakPower</a> = <a class="code" href="address_8h.html#a660e8da9c1167a8450aef91c5c03761d">USB_NAK_NOWAIT</a>; <span class="comment">// Only poll once for interrupt endpoints</span></div>
<div class="line"><a name="l00172"></a><span class="lineno"> 172</span>&#160; <a class="code" href="class_x_b_o_x_r_e_c_v.html#af97c8d0efc945fa4ba1d120c8a5a9cbb">epInfo</a>[ <a class="code" href="_x_b_o_x_r_e_c_v_8h.html#a8ba688a4bdb47869d7ee3f49b6d07b7c">XBOX_OUTPUT_PIPE_2</a> ].<a class="code" href="struct_ep_info.html#aa2ca775b63736df4008e88da7dd4dddb">maxPktSize</a> = <a class="code" href="_p_s3_u_s_b_8h.html#abcb805b13bfd36145e252b0633bbcfc0">EP_MAXPKTSIZE</a>;</div>
<div class="line"><a name="l00173"></a><span class="lineno"> 173</span>&#160; <a class="code" href="class_x_b_o_x_r_e_c_v.html#af97c8d0efc945fa4ba1d120c8a5a9cbb">epInfo</a>[ <a class="code" href="_x_b_o_x_r_e_c_v_8h.html#a8ba688a4bdb47869d7ee3f49b6d07b7c">XBOX_OUTPUT_PIPE_2</a> ].<a class="code" href="struct_ep_info.html#ac85bff70ad0e5d71e50cb501f4d8caf3">bmSndToggle</a> = <a class="code" href="max3421e_8h.html#a4834ae7378471b63b9a1985c6294006f">bmSNDTOG0</a>;</div>
<div class="line"><a name="l00174"></a><span class="lineno"> 174</span>&#160; <a class="code" href="class_x_b_o_x_r_e_c_v.html#af97c8d0efc945fa4ba1d120c8a5a9cbb">epInfo</a>[ <a class="code" href="_x_b_o_x_r_e_c_v_8h.html#a8ba688a4bdb47869d7ee3f49b6d07b7c">XBOX_OUTPUT_PIPE_2</a> ].<a class="code" href="struct_ep_info.html#a9238dd40c096baedf041c98b19386a14">bmRcvToggle</a> = <a class="code" href="max3421e_8h.html#aca6a8aa4f0aebbe07c5e175572a92ef7">bmRCVTOG0</a>;</div>
<div class="line"><a name="l00175"></a><span class="lineno"> 175</span>&#160;</div>
<div class="line"><a name="l00176"></a><span class="lineno"> 176</span>&#160; <a class="code" href="class_x_b_o_x_r_e_c_v.html#af97c8d0efc945fa4ba1d120c8a5a9cbb">epInfo</a>[ <a class="code" href="_x_b_o_x_r_e_c_v_8h.html#a86a3e5765d02bc043d5d1f674a7ffb0f">XBOX_INPUT_PIPE_3</a> ].<a class="code" href="struct_ep_info.html#a9f92be74c75c037b39e2cae1eb49b89b">epAddr</a> = 0x05; <span class="comment">// XBOX 360 report endpoint - poll interval 1ms</span></div>
<div class="line"><a name="l00177"></a><span class="lineno"> 177</span>&#160; <a class="code" href="class_x_b_o_x_r_e_c_v.html#af97c8d0efc945fa4ba1d120c8a5a9cbb">epInfo</a>[ <a class="code" href="_x_b_o_x_r_e_c_v_8h.html#a86a3e5765d02bc043d5d1f674a7ffb0f">XBOX_INPUT_PIPE_3</a> ].<a class="code" href="struct_ep_info.html#a1dea928517c961235eef7b0876e69f10">epAttribs</a> = <a class="code" href="_p_s3_u_s_b_8h.html#ad4d26e1c566064f2259faf65f0858b6e">EP_INTERRUPT</a>;</div>
<div class="line"><a name="l00178"></a><span class="lineno"> 178</span>&#160; <a class="code" href="class_x_b_o_x_r_e_c_v.html#af97c8d0efc945fa4ba1d120c8a5a9cbb">epInfo</a>[ <a class="code" href="_x_b_o_x_r_e_c_v_8h.html#a86a3e5765d02bc043d5d1f674a7ffb0f">XBOX_INPUT_PIPE_3</a> ].<a class="code" href="struct_ep_info.html#a3a5b1c017a034cd9e06e76729e727c46">bmNakPower</a> = <a class="code" href="address_8h.html#a660e8da9c1167a8450aef91c5c03761d">USB_NAK_NOWAIT</a>; <span class="comment">// Only poll once for interrupt endpoints</span></div>
<div class="line"><a name="l00179"></a><span class="lineno"> 179</span>&#160; <a class="code" href="class_x_b_o_x_r_e_c_v.html#af97c8d0efc945fa4ba1d120c8a5a9cbb">epInfo</a>[ <a class="code" href="_x_b_o_x_r_e_c_v_8h.html#a86a3e5765d02bc043d5d1f674a7ffb0f">XBOX_INPUT_PIPE_3</a> ].<a class="code" href="struct_ep_info.html#aa2ca775b63736df4008e88da7dd4dddb">maxPktSize</a> = <a class="code" href="_p_s3_u_s_b_8h.html#abcb805b13bfd36145e252b0633bbcfc0">EP_MAXPKTSIZE</a>;</div>
<div class="line"><a name="l00180"></a><span class="lineno"> 180</span>&#160; <a class="code" href="class_x_b_o_x_r_e_c_v.html#af97c8d0efc945fa4ba1d120c8a5a9cbb">epInfo</a>[ <a class="code" href="_x_b_o_x_r_e_c_v_8h.html#a86a3e5765d02bc043d5d1f674a7ffb0f">XBOX_INPUT_PIPE_3</a> ].<a class="code" href="struct_ep_info.html#ac85bff70ad0e5d71e50cb501f4d8caf3">bmSndToggle</a> = <a class="code" href="max3421e_8h.html#a4834ae7378471b63b9a1985c6294006f">bmSNDTOG0</a>;</div>
<div class="line"><a name="l00181"></a><span class="lineno"> 181</span>&#160; <a class="code" href="class_x_b_o_x_r_e_c_v.html#af97c8d0efc945fa4ba1d120c8a5a9cbb">epInfo</a>[ <a class="code" href="_x_b_o_x_r_e_c_v_8h.html#a86a3e5765d02bc043d5d1f674a7ffb0f">XBOX_INPUT_PIPE_3</a> ].<a class="code" href="struct_ep_info.html#a9238dd40c096baedf041c98b19386a14">bmRcvToggle</a> = <a class="code" href="max3421e_8h.html#aca6a8aa4f0aebbe07c5e175572a92ef7">bmRCVTOG0</a>;</div>
<div class="line"><a name="l00182"></a><span class="lineno"> 182</span>&#160; <a class="code" href="class_x_b_o_x_r_e_c_v.html#af97c8d0efc945fa4ba1d120c8a5a9cbb">epInfo</a>[ <a class="code" href="_x_b_o_x_r_e_c_v_8h.html#afce4154cabb3a0d2c7eeb39b1c15d353">XBOX_OUTPUT_PIPE_3</a> ].<a class="code" href="struct_ep_info.html#a9f92be74c75c037b39e2cae1eb49b89b">epAddr</a> = 0x05; <span class="comment">// XBOX 360 output endpoint - poll interval 8ms</span></div>
<div class="line"><a name="l00183"></a><span class="lineno"> 183</span>&#160; <a class="code" href="class_x_b_o_x_r_e_c_v.html#af97c8d0efc945fa4ba1d120c8a5a9cbb">epInfo</a>[ <a class="code" href="_x_b_o_x_r_e_c_v_8h.html#afce4154cabb3a0d2c7eeb39b1c15d353">XBOX_OUTPUT_PIPE_3</a> ].<a class="code" href="struct_ep_info.html#a1dea928517c961235eef7b0876e69f10">epAttribs</a> = <a class="code" href="_p_s3_u_s_b_8h.html#ad4d26e1c566064f2259faf65f0858b6e">EP_INTERRUPT</a>;</div>
<div class="line"><a name="l00184"></a><span class="lineno"> 184</span>&#160; <a class="code" href="class_x_b_o_x_r_e_c_v.html#af97c8d0efc945fa4ba1d120c8a5a9cbb">epInfo</a>[ <a class="code" href="_x_b_o_x_r_e_c_v_8h.html#afce4154cabb3a0d2c7eeb39b1c15d353">XBOX_OUTPUT_PIPE_3</a> ].<a class="code" href="struct_ep_info.html#a3a5b1c017a034cd9e06e76729e727c46">bmNakPower</a> = <a class="code" href="address_8h.html#a660e8da9c1167a8450aef91c5c03761d">USB_NAK_NOWAIT</a>; <span class="comment">// Only poll once for interrupt endpoints</span></div>
<div class="line"><a name="l00185"></a><span class="lineno"> 185</span>&#160; <a class="code" href="class_x_b_o_x_r_e_c_v.html#af97c8d0efc945fa4ba1d120c8a5a9cbb">epInfo</a>[ <a class="code" href="_x_b_o_x_r_e_c_v_8h.html#afce4154cabb3a0d2c7eeb39b1c15d353">XBOX_OUTPUT_PIPE_3</a> ].<a class="code" href="struct_ep_info.html#aa2ca775b63736df4008e88da7dd4dddb">maxPktSize</a> = <a class="code" href="_p_s3_u_s_b_8h.html#abcb805b13bfd36145e252b0633bbcfc0">EP_MAXPKTSIZE</a>;</div>
<div class="line"><a name="l00186"></a><span class="lineno"> 186</span>&#160; <a class="code" href="class_x_b_o_x_r_e_c_v.html#af97c8d0efc945fa4ba1d120c8a5a9cbb">epInfo</a>[ <a class="code" href="_x_b_o_x_r_e_c_v_8h.html#afce4154cabb3a0d2c7eeb39b1c15d353">XBOX_OUTPUT_PIPE_3</a> ].<a class="code" href="struct_ep_info.html#ac85bff70ad0e5d71e50cb501f4d8caf3">bmSndToggle</a> = <a class="code" href="max3421e_8h.html#a4834ae7378471b63b9a1985c6294006f">bmSNDTOG0</a>;</div>
<div class="line"><a name="l00187"></a><span class="lineno"> 187</span>&#160; <a class="code" href="class_x_b_o_x_r_e_c_v.html#af97c8d0efc945fa4ba1d120c8a5a9cbb">epInfo</a>[ <a class="code" href="_x_b_o_x_r_e_c_v_8h.html#afce4154cabb3a0d2c7eeb39b1c15d353">XBOX_OUTPUT_PIPE_3</a> ].<a class="code" href="struct_ep_info.html#a9238dd40c096baedf041c98b19386a14">bmRcvToggle</a> = <a class="code" href="max3421e_8h.html#aca6a8aa4f0aebbe07c5e175572a92ef7">bmRCVTOG0</a>;</div>
<div class="line"><a name="l00188"></a><span class="lineno"> 188</span>&#160;</div>
<div class="line"><a name="l00189"></a><span class="lineno"> 189</span>&#160; <a class="code" href="class_x_b_o_x_r_e_c_v.html#af97c8d0efc945fa4ba1d120c8a5a9cbb">epInfo</a>[ <a class="code" href="_x_b_o_x_r_e_c_v_8h.html#a5acfdaefe74aba1632c71acb79c49671">XBOX_INPUT_PIPE_4</a> ].<a class="code" href="struct_ep_info.html#a9f92be74c75c037b39e2cae1eb49b89b">epAddr</a> = 0x07; <span class="comment">// XBOX 360 report endpoint - poll interval 1ms</span></div>
<div class="line"><a name="l00190"></a><span class="lineno"> 190</span>&#160; <a class="code" href="class_x_b_o_x_r_e_c_v.html#af97c8d0efc945fa4ba1d120c8a5a9cbb">epInfo</a>[ <a class="code" href="_x_b_o_x_r_e_c_v_8h.html#a5acfdaefe74aba1632c71acb79c49671">XBOX_INPUT_PIPE_4</a> ].<a class="code" href="struct_ep_info.html#a1dea928517c961235eef7b0876e69f10">epAttribs</a> = <a class="code" href="_p_s3_u_s_b_8h.html#ad4d26e1c566064f2259faf65f0858b6e">EP_INTERRUPT</a>;</div>
<div class="line"><a name="l00191"></a><span class="lineno"> 191</span>&#160; <a class="code" href="class_x_b_o_x_r_e_c_v.html#af97c8d0efc945fa4ba1d120c8a5a9cbb">epInfo</a>[ <a class="code" href="_x_b_o_x_r_e_c_v_8h.html#a5acfdaefe74aba1632c71acb79c49671">XBOX_INPUT_PIPE_4</a> ].<a class="code" href="struct_ep_info.html#a3a5b1c017a034cd9e06e76729e727c46">bmNakPower</a> = <a class="code" href="address_8h.html#a660e8da9c1167a8450aef91c5c03761d">USB_NAK_NOWAIT</a>; <span class="comment">// Only poll once for interrupt endpoints</span></div>
<div class="line"><a name="l00192"></a><span class="lineno"> 192</span>&#160; <a class="code" href="class_x_b_o_x_r_e_c_v.html#af97c8d0efc945fa4ba1d120c8a5a9cbb">epInfo</a>[ <a class="code" href="_x_b_o_x_r_e_c_v_8h.html#a5acfdaefe74aba1632c71acb79c49671">XBOX_INPUT_PIPE_4</a> ].<a class="code" href="struct_ep_info.html#aa2ca775b63736df4008e88da7dd4dddb">maxPktSize</a> = <a class="code" href="_p_s3_u_s_b_8h.html#abcb805b13bfd36145e252b0633bbcfc0">EP_MAXPKTSIZE</a>;</div>
<div class="line"><a name="l00193"></a><span class="lineno"> 193</span>&#160; <a class="code" href="class_x_b_o_x_r_e_c_v.html#af97c8d0efc945fa4ba1d120c8a5a9cbb">epInfo</a>[ <a class="code" href="_x_b_o_x_r_e_c_v_8h.html#a5acfdaefe74aba1632c71acb79c49671">XBOX_INPUT_PIPE_4</a> ].<a class="code" href="struct_ep_info.html#ac85bff70ad0e5d71e50cb501f4d8caf3">bmSndToggle</a> = <a class="code" href="max3421e_8h.html#a4834ae7378471b63b9a1985c6294006f">bmSNDTOG0</a>;</div>
<div class="line"><a name="l00194"></a><span class="lineno"> 194</span>&#160; <a class="code" href="class_x_b_o_x_r_e_c_v.html#af97c8d0efc945fa4ba1d120c8a5a9cbb">epInfo</a>[ <a class="code" href="_x_b_o_x_r_e_c_v_8h.html#a5acfdaefe74aba1632c71acb79c49671">XBOX_INPUT_PIPE_4</a> ].<a class="code" href="struct_ep_info.html#a9238dd40c096baedf041c98b19386a14">bmRcvToggle</a> = <a class="code" href="max3421e_8h.html#aca6a8aa4f0aebbe07c5e175572a92ef7">bmRCVTOG0</a>;</div>
<div class="line"><a name="l00195"></a><span class="lineno"> 195</span>&#160; <a class="code" href="class_x_b_o_x_r_e_c_v.html#af97c8d0efc945fa4ba1d120c8a5a9cbb">epInfo</a>[ <a class="code" href="_x_b_o_x_r_e_c_v_8h.html#a7a74e0ea052831dbbb4a0973fffc8179">XBOX_OUTPUT_PIPE_4</a> ].<a class="code" href="struct_ep_info.html#a9f92be74c75c037b39e2cae1eb49b89b">epAddr</a> = 0x07; <span class="comment">// XBOX 360 output endpoint - poll interval 8ms</span></div>
<div class="line"><a name="l00196"></a><span class="lineno"> 196</span>&#160; <a class="code" href="class_x_b_o_x_r_e_c_v.html#af97c8d0efc945fa4ba1d120c8a5a9cbb">epInfo</a>[ <a class="code" href="_x_b_o_x_r_e_c_v_8h.html#a7a74e0ea052831dbbb4a0973fffc8179">XBOX_OUTPUT_PIPE_4</a> ].<a class="code" href="struct_ep_info.html#a1dea928517c961235eef7b0876e69f10">epAttribs</a> = <a class="code" href="_p_s3_u_s_b_8h.html#ad4d26e1c566064f2259faf65f0858b6e">EP_INTERRUPT</a>;</div>
<div class="line"><a name="l00197"></a><span class="lineno"> 197</span>&#160; <a class="code" href="class_x_b_o_x_r_e_c_v.html#af97c8d0efc945fa4ba1d120c8a5a9cbb">epInfo</a>[ <a class="code" href="_x_b_o_x_r_e_c_v_8h.html#a7a74e0ea052831dbbb4a0973fffc8179">XBOX_OUTPUT_PIPE_4</a> ].<a class="code" href="struct_ep_info.html#a3a5b1c017a034cd9e06e76729e727c46">bmNakPower</a> = <a class="code" href="address_8h.html#a660e8da9c1167a8450aef91c5c03761d">USB_NAK_NOWAIT</a>; <span class="comment">// Only poll once for interrupt endpoints</span></div>
<div class="line"><a name="l00198"></a><span class="lineno"> 198</span>&#160; <a class="code" href="class_x_b_o_x_r_e_c_v.html#af97c8d0efc945fa4ba1d120c8a5a9cbb">epInfo</a>[ <a class="code" href="_x_b_o_x_r_e_c_v_8h.html#a7a74e0ea052831dbbb4a0973fffc8179">XBOX_OUTPUT_PIPE_4</a> ].<a class="code" href="struct_ep_info.html#aa2ca775b63736df4008e88da7dd4dddb">maxPktSize</a> = <a class="code" href="_p_s3_u_s_b_8h.html#abcb805b13bfd36145e252b0633bbcfc0">EP_MAXPKTSIZE</a>;</div>
<div class="line"><a name="l00199"></a><span class="lineno"> 199</span>&#160; <a class="code" href="class_x_b_o_x_r_e_c_v.html#af97c8d0efc945fa4ba1d120c8a5a9cbb">epInfo</a>[ <a class="code" href="_x_b_o_x_r_e_c_v_8h.html#a7a74e0ea052831dbbb4a0973fffc8179">XBOX_OUTPUT_PIPE_4</a> ].<a class="code" href="struct_ep_info.html#ac85bff70ad0e5d71e50cb501f4d8caf3">bmSndToggle</a> = <a class="code" href="max3421e_8h.html#a4834ae7378471b63b9a1985c6294006f">bmSNDTOG0</a>;</div>
<div class="line"><a name="l00200"></a><span class="lineno"> 200</span>&#160; <a class="code" href="class_x_b_o_x_r_e_c_v.html#af97c8d0efc945fa4ba1d120c8a5a9cbb">epInfo</a>[ <a class="code" href="_x_b_o_x_r_e_c_v_8h.html#a7a74e0ea052831dbbb4a0973fffc8179">XBOX_OUTPUT_PIPE_4</a> ].<a class="code" href="struct_ep_info.html#a9238dd40c096baedf041c98b19386a14">bmRcvToggle</a> = <a class="code" href="max3421e_8h.html#aca6a8aa4f0aebbe07c5e175572a92ef7">bmRCVTOG0</a>;</div>
<div class="line"><a name="l00201"></a><span class="lineno"> 201</span>&#160;</div>
<div class="line"><a name="l00202"></a><span class="lineno"> 202</span>&#160; rcode = <a class="code" href="class_x_b_o_x_r_e_c_v.html#a53047c86c8c2f625916af62238d50fc8">pUsb</a>-&gt;<a class="code" href="class_u_s_b.html#a6c3ba3f7e6dccb450267011ce783d7ea">setEpInfoEntry</a>(bAddress, 9, <a class="code" href="class_x_b_o_x_r_e_c_v.html#af97c8d0efc945fa4ba1d120c8a5a9cbb">epInfo</a>);</div>
<div class="line"><a name="l00203"></a><span class="lineno"> 203</span>&#160; <span class="keywordflow">if</span> (rcode)</div>
<div class="line"><a name="l00204"></a><span class="lineno"> 204</span>&#160; <span class="keywordflow">goto</span> FailSetDevTblEntry;</div>
<div class="line"><a name="l00205"></a><span class="lineno"> 205</span>&#160;</div>
<div class="line"><a name="l00206"></a><span class="lineno"> 206</span>&#160; delay(200); <span class="comment">//Give time for address change</span></div>
<div class="line"><a name="l00140"></a><span class="lineno"> 140</span>&#160; p-&gt;<a class="code" href="struct_usb_device.html#a86a815577ad7883437d3ca72b32b8e8a">lowspeed</a> = lowspeed;</div>
<div class="line"><a name="l00141"></a><span class="lineno"> 141</span>&#160;</div>
<div class="line"><a name="l00142"></a><span class="lineno"> 142</span>&#160; <span class="comment">// Assign epInfo to epinfo pointer - only EP0 is known</span></div>
<div class="line"><a name="l00143"></a><span class="lineno"> 143</span>&#160; rcode = <a class="code" href="class_x_b_o_x_r_e_c_v.html#a53047c86c8c2f625916af62238d50fc8">pUsb</a>-&gt;<a class="code" href="class_u_s_b.html#a6c3ba3f7e6dccb450267011ce783d7ea">setEpInfoEntry</a>(bAddress, 1, <a class="code" href="class_x_b_o_x_r_e_c_v.html#af97c8d0efc945fa4ba1d120c8a5a9cbb">epInfo</a>);</div>
<div class="line"><a name="l00144"></a><span class="lineno"> 144</span>&#160; <span class="keywordflow">if</span> (rcode)</div>
<div class="line"><a name="l00145"></a><span class="lineno"> 145</span>&#160; <span class="keywordflow">goto</span> FailSetDevTblEntry;</div>
<div class="line"><a name="l00146"></a><span class="lineno"> 146</span>&#160;</div>
<div class="line"><a name="l00147"></a><span class="lineno"> 147</span>&#160; <span class="comment">/* The application will work in reduced host mode, so we can save program and data</span></div>
<div class="line"><a name="l00148"></a><span class="lineno"> 148</span>&#160;<span class="comment"> memory space. After verifying the VID we will use known values for the</span></div>
<div class="line"><a name="l00149"></a><span class="lineno"> 149</span>&#160;<span class="comment"> configuration values for device, interface, endpoints and HID for the XBOX360 Wireless receiver */</span></div>
<div class="line"><a name="l00150"></a><span class="lineno"> 150</span>&#160;</div>
<div class="line"><a name="l00151"></a><span class="lineno"> 151</span>&#160; <span class="comment">/* Initialize data structures for endpoints of device */</span></div>
<div class="line"><a name="l00152"></a><span class="lineno"> 152</span>&#160; <a class="code" href="class_x_b_o_x_r_e_c_v.html#af97c8d0efc945fa4ba1d120c8a5a9cbb">epInfo</a>[ <a class="code" href="_x_b_o_x_r_e_c_v_8h.html#a2824b25aa9a384c29f27a4e1bb443799">XBOX_INPUT_PIPE_1</a> ].<a class="code" href="struct_ep_info.html#a9f92be74c75c037b39e2cae1eb49b89b">epAddr</a> = 0x01; <span class="comment">// XBOX 360 report endpoint - poll interval 1ms</span></div>
<div class="line"><a name="l00153"></a><span class="lineno"> 153</span>&#160; <a class="code" href="class_x_b_o_x_r_e_c_v.html#af97c8d0efc945fa4ba1d120c8a5a9cbb">epInfo</a>[ <a class="code" href="_x_b_o_x_r_e_c_v_8h.html#a2824b25aa9a384c29f27a4e1bb443799">XBOX_INPUT_PIPE_1</a> ].<a class="code" href="struct_ep_info.html#a1dea928517c961235eef7b0876e69f10">epAttribs</a> = <a class="code" href="_p_s3_u_s_b_8h.html#ad4d26e1c566064f2259faf65f0858b6e">EP_INTERRUPT</a>;</div>
<div class="line"><a name="l00154"></a><span class="lineno"> 154</span>&#160; <a class="code" href="class_x_b_o_x_r_e_c_v.html#af97c8d0efc945fa4ba1d120c8a5a9cbb">epInfo</a>[ <a class="code" href="_x_b_o_x_r_e_c_v_8h.html#a2824b25aa9a384c29f27a4e1bb443799">XBOX_INPUT_PIPE_1</a> ].<a class="code" href="struct_ep_info.html#a3a5b1c017a034cd9e06e76729e727c46">bmNakPower</a> = <a class="code" href="address_8h.html#a660e8da9c1167a8450aef91c5c03761d">USB_NAK_NOWAIT</a>; <span class="comment">// Only poll once for interrupt endpoints</span></div>
<div class="line"><a name="l00155"></a><span class="lineno"> 155</span>&#160; <a class="code" href="class_x_b_o_x_r_e_c_v.html#af97c8d0efc945fa4ba1d120c8a5a9cbb">epInfo</a>[ <a class="code" href="_x_b_o_x_r_e_c_v_8h.html#a2824b25aa9a384c29f27a4e1bb443799">XBOX_INPUT_PIPE_1</a> ].<a class="code" href="struct_ep_info.html#aa2ca775b63736df4008e88da7dd4dddb">maxPktSize</a> = <a class="code" href="_p_s3_u_s_b_8h.html#abcb805b13bfd36145e252b0633bbcfc0">EP_MAXPKTSIZE</a>;</div>
<div class="line"><a name="l00156"></a><span class="lineno"> 156</span>&#160; <a class="code" href="class_x_b_o_x_r_e_c_v.html#af97c8d0efc945fa4ba1d120c8a5a9cbb">epInfo</a>[ <a class="code" href="_x_b_o_x_r_e_c_v_8h.html#a2824b25aa9a384c29f27a4e1bb443799">XBOX_INPUT_PIPE_1</a> ].<a class="code" href="struct_ep_info.html#ac85bff70ad0e5d71e50cb501f4d8caf3">bmSndToggle</a> = <a class="code" href="max3421e_8h.html#a4834ae7378471b63b9a1985c6294006f">bmSNDTOG0</a>;</div>
<div class="line"><a name="l00157"></a><span class="lineno"> 157</span>&#160; <a class="code" href="class_x_b_o_x_r_e_c_v.html#af97c8d0efc945fa4ba1d120c8a5a9cbb">epInfo</a>[ <a class="code" href="_x_b_o_x_r_e_c_v_8h.html#a2824b25aa9a384c29f27a4e1bb443799">XBOX_INPUT_PIPE_1</a> ].<a class="code" href="struct_ep_info.html#a9238dd40c096baedf041c98b19386a14">bmRcvToggle</a> = <a class="code" href="max3421e_8h.html#aca6a8aa4f0aebbe07c5e175572a92ef7">bmRCVTOG0</a>;</div>
<div class="line"><a name="l00158"></a><span class="lineno"> 158</span>&#160; <a class="code" href="class_x_b_o_x_r_e_c_v.html#af97c8d0efc945fa4ba1d120c8a5a9cbb">epInfo</a>[ <a class="code" href="_x_b_o_x_r_e_c_v_8h.html#a962be1e740bce25cf37e111bd88be9bf">XBOX_OUTPUT_PIPE_1</a> ].<a class="code" href="struct_ep_info.html#a9f92be74c75c037b39e2cae1eb49b89b">epAddr</a> = 0x01; <span class="comment">// XBOX 360 output endpoint - poll interval 8ms</span></div>
<div class="line"><a name="l00159"></a><span class="lineno"> 159</span>&#160; <a class="code" href="class_x_b_o_x_r_e_c_v.html#af97c8d0efc945fa4ba1d120c8a5a9cbb">epInfo</a>[ <a class="code" href="_x_b_o_x_r_e_c_v_8h.html#a962be1e740bce25cf37e111bd88be9bf">XBOX_OUTPUT_PIPE_1</a> ].<a class="code" href="struct_ep_info.html#a1dea928517c961235eef7b0876e69f10">epAttribs</a> = <a class="code" href="_p_s3_u_s_b_8h.html#ad4d26e1c566064f2259faf65f0858b6e">EP_INTERRUPT</a>;</div>
<div class="line"><a name="l00160"></a><span class="lineno"> 160</span>&#160; <a class="code" href="class_x_b_o_x_r_e_c_v.html#af97c8d0efc945fa4ba1d120c8a5a9cbb">epInfo</a>[ <a class="code" href="_x_b_o_x_r_e_c_v_8h.html#a962be1e740bce25cf37e111bd88be9bf">XBOX_OUTPUT_PIPE_1</a> ].<a class="code" href="struct_ep_info.html#a3a5b1c017a034cd9e06e76729e727c46">bmNakPower</a> = <a class="code" href="address_8h.html#a660e8da9c1167a8450aef91c5c03761d">USB_NAK_NOWAIT</a>; <span class="comment">// Only poll once for interrupt endpoints</span></div>
<div class="line"><a name="l00161"></a><span class="lineno"> 161</span>&#160; <a class="code" href="class_x_b_o_x_r_e_c_v.html#af97c8d0efc945fa4ba1d120c8a5a9cbb">epInfo</a>[ <a class="code" href="_x_b_o_x_r_e_c_v_8h.html#a962be1e740bce25cf37e111bd88be9bf">XBOX_OUTPUT_PIPE_1</a> ].<a class="code" href="struct_ep_info.html#aa2ca775b63736df4008e88da7dd4dddb">maxPktSize</a> = <a class="code" href="_p_s3_u_s_b_8h.html#abcb805b13bfd36145e252b0633bbcfc0">EP_MAXPKTSIZE</a>;</div>
<div class="line"><a name="l00162"></a><span class="lineno"> 162</span>&#160; <a class="code" href="class_x_b_o_x_r_e_c_v.html#af97c8d0efc945fa4ba1d120c8a5a9cbb">epInfo</a>[ <a class="code" href="_x_b_o_x_r_e_c_v_8h.html#a962be1e740bce25cf37e111bd88be9bf">XBOX_OUTPUT_PIPE_1</a> ].<a class="code" href="struct_ep_info.html#ac85bff70ad0e5d71e50cb501f4d8caf3">bmSndToggle</a> = <a class="code" href="max3421e_8h.html#a4834ae7378471b63b9a1985c6294006f">bmSNDTOG0</a>;</div>
<div class="line"><a name="l00163"></a><span class="lineno"> 163</span>&#160; <a class="code" href="class_x_b_o_x_r_e_c_v.html#af97c8d0efc945fa4ba1d120c8a5a9cbb">epInfo</a>[ <a class="code" href="_x_b_o_x_r_e_c_v_8h.html#a962be1e740bce25cf37e111bd88be9bf">XBOX_OUTPUT_PIPE_1</a> ].<a class="code" href="struct_ep_info.html#a9238dd40c096baedf041c98b19386a14">bmRcvToggle</a> = <a class="code" href="max3421e_8h.html#aca6a8aa4f0aebbe07c5e175572a92ef7">bmRCVTOG0</a>;</div>
<div class="line"><a name="l00164"></a><span class="lineno"> 164</span>&#160;</div>
<div class="line"><a name="l00165"></a><span class="lineno"> 165</span>&#160; <a class="code" href="class_x_b_o_x_r_e_c_v.html#af97c8d0efc945fa4ba1d120c8a5a9cbb">epInfo</a>[ <a class="code" href="_x_b_o_x_r_e_c_v_8h.html#aab6feb681a78b190190bcc081868a485">XBOX_INPUT_PIPE_2</a> ].<a class="code" href="struct_ep_info.html#a9f92be74c75c037b39e2cae1eb49b89b">epAddr</a> = 0x03; <span class="comment">// XBOX 360 report endpoint - poll interval 1ms</span></div>
<div class="line"><a name="l00166"></a><span class="lineno"> 166</span>&#160; <a class="code" href="class_x_b_o_x_r_e_c_v.html#af97c8d0efc945fa4ba1d120c8a5a9cbb">epInfo</a>[ <a class="code" href="_x_b_o_x_r_e_c_v_8h.html#aab6feb681a78b190190bcc081868a485">XBOX_INPUT_PIPE_2</a> ].<a class="code" href="struct_ep_info.html#a1dea928517c961235eef7b0876e69f10">epAttribs</a> = <a class="code" href="_p_s3_u_s_b_8h.html#ad4d26e1c566064f2259faf65f0858b6e">EP_INTERRUPT</a>;</div>
<div class="line"><a name="l00167"></a><span class="lineno"> 167</span>&#160; <a class="code" href="class_x_b_o_x_r_e_c_v.html#af97c8d0efc945fa4ba1d120c8a5a9cbb">epInfo</a>[ <a class="code" href="_x_b_o_x_r_e_c_v_8h.html#aab6feb681a78b190190bcc081868a485">XBOX_INPUT_PIPE_2</a> ].<a class="code" href="struct_ep_info.html#a3a5b1c017a034cd9e06e76729e727c46">bmNakPower</a> = <a class="code" href="address_8h.html#a660e8da9c1167a8450aef91c5c03761d">USB_NAK_NOWAIT</a>; <span class="comment">// Only poll once for interrupt endpoints</span></div>
<div class="line"><a name="l00168"></a><span class="lineno"> 168</span>&#160; <a class="code" href="class_x_b_o_x_r_e_c_v.html#af97c8d0efc945fa4ba1d120c8a5a9cbb">epInfo</a>[ <a class="code" href="_x_b_o_x_r_e_c_v_8h.html#aab6feb681a78b190190bcc081868a485">XBOX_INPUT_PIPE_2</a> ].<a class="code" href="struct_ep_info.html#aa2ca775b63736df4008e88da7dd4dddb">maxPktSize</a> = <a class="code" href="_p_s3_u_s_b_8h.html#abcb805b13bfd36145e252b0633bbcfc0">EP_MAXPKTSIZE</a>;</div>
<div class="line"><a name="l00169"></a><span class="lineno"> 169</span>&#160; <a class="code" href="class_x_b_o_x_r_e_c_v.html#af97c8d0efc945fa4ba1d120c8a5a9cbb">epInfo</a>[ <a class="code" href="_x_b_o_x_r_e_c_v_8h.html#aab6feb681a78b190190bcc081868a485">XBOX_INPUT_PIPE_2</a> ].<a class="code" href="struct_ep_info.html#ac85bff70ad0e5d71e50cb501f4d8caf3">bmSndToggle</a> = <a class="code" href="max3421e_8h.html#a4834ae7378471b63b9a1985c6294006f">bmSNDTOG0</a>;</div>
<div class="line"><a name="l00170"></a><span class="lineno"> 170</span>&#160; <a class="code" href="class_x_b_o_x_r_e_c_v.html#af97c8d0efc945fa4ba1d120c8a5a9cbb">epInfo</a>[ <a class="code" href="_x_b_o_x_r_e_c_v_8h.html#aab6feb681a78b190190bcc081868a485">XBOX_INPUT_PIPE_2</a> ].<a class="code" href="struct_ep_info.html#a9238dd40c096baedf041c98b19386a14">bmRcvToggle</a> = <a class="code" href="max3421e_8h.html#aca6a8aa4f0aebbe07c5e175572a92ef7">bmRCVTOG0</a>;</div>
<div class="line"><a name="l00171"></a><span class="lineno"> 171</span>&#160; <a class="code" href="class_x_b_o_x_r_e_c_v.html#af97c8d0efc945fa4ba1d120c8a5a9cbb">epInfo</a>[ <a class="code" href="_x_b_o_x_r_e_c_v_8h.html#a8ba688a4bdb47869d7ee3f49b6d07b7c">XBOX_OUTPUT_PIPE_2</a> ].<a class="code" href="struct_ep_info.html#a9f92be74c75c037b39e2cae1eb49b89b">epAddr</a> = 0x03; <span class="comment">// XBOX 360 output endpoint - poll interval 8ms</span></div>
<div class="line"><a name="l00172"></a><span class="lineno"> 172</span>&#160; <a class="code" href="class_x_b_o_x_r_e_c_v.html#af97c8d0efc945fa4ba1d120c8a5a9cbb">epInfo</a>[ <a class="code" href="_x_b_o_x_r_e_c_v_8h.html#a8ba688a4bdb47869d7ee3f49b6d07b7c">XBOX_OUTPUT_PIPE_2</a> ].<a class="code" href="struct_ep_info.html#a1dea928517c961235eef7b0876e69f10">epAttribs</a> = <a class="code" href="_p_s3_u_s_b_8h.html#ad4d26e1c566064f2259faf65f0858b6e">EP_INTERRUPT</a>;</div>
<div class="line"><a name="l00173"></a><span class="lineno"> 173</span>&#160; <a class="code" href="class_x_b_o_x_r_e_c_v.html#af97c8d0efc945fa4ba1d120c8a5a9cbb">epInfo</a>[ <a class="code" href="_x_b_o_x_r_e_c_v_8h.html#a8ba688a4bdb47869d7ee3f49b6d07b7c">XBOX_OUTPUT_PIPE_2</a> ].<a class="code" href="struct_ep_info.html#a3a5b1c017a034cd9e06e76729e727c46">bmNakPower</a> = <a class="code" href="address_8h.html#a660e8da9c1167a8450aef91c5c03761d">USB_NAK_NOWAIT</a>; <span class="comment">// Only poll once for interrupt endpoints</span></div>
<div class="line"><a name="l00174"></a><span class="lineno"> 174</span>&#160; <a class="code" href="class_x_b_o_x_r_e_c_v.html#af97c8d0efc945fa4ba1d120c8a5a9cbb">epInfo</a>[ <a class="code" href="_x_b_o_x_r_e_c_v_8h.html#a8ba688a4bdb47869d7ee3f49b6d07b7c">XBOX_OUTPUT_PIPE_2</a> ].<a class="code" href="struct_ep_info.html#aa2ca775b63736df4008e88da7dd4dddb">maxPktSize</a> = <a class="code" href="_p_s3_u_s_b_8h.html#abcb805b13bfd36145e252b0633bbcfc0">EP_MAXPKTSIZE</a>;</div>
<div class="line"><a name="l00175"></a><span class="lineno"> 175</span>&#160; <a class="code" href="class_x_b_o_x_r_e_c_v.html#af97c8d0efc945fa4ba1d120c8a5a9cbb">epInfo</a>[ <a class="code" href="_x_b_o_x_r_e_c_v_8h.html#a8ba688a4bdb47869d7ee3f49b6d07b7c">XBOX_OUTPUT_PIPE_2</a> ].<a class="code" href="struct_ep_info.html#ac85bff70ad0e5d71e50cb501f4d8caf3">bmSndToggle</a> = <a class="code" href="max3421e_8h.html#a4834ae7378471b63b9a1985c6294006f">bmSNDTOG0</a>;</div>
<div class="line"><a name="l00176"></a><span class="lineno"> 176</span>&#160; <a class="code" href="class_x_b_o_x_r_e_c_v.html#af97c8d0efc945fa4ba1d120c8a5a9cbb">epInfo</a>[ <a class="code" href="_x_b_o_x_r_e_c_v_8h.html#a8ba688a4bdb47869d7ee3f49b6d07b7c">XBOX_OUTPUT_PIPE_2</a> ].<a class="code" href="struct_ep_info.html#a9238dd40c096baedf041c98b19386a14">bmRcvToggle</a> = <a class="code" href="max3421e_8h.html#aca6a8aa4f0aebbe07c5e175572a92ef7">bmRCVTOG0</a>;</div>
<div class="line"><a name="l00177"></a><span class="lineno"> 177</span>&#160;</div>
<div class="line"><a name="l00178"></a><span class="lineno"> 178</span>&#160; <a class="code" href="class_x_b_o_x_r_e_c_v.html#af97c8d0efc945fa4ba1d120c8a5a9cbb">epInfo</a>[ <a class="code" href="_x_b_o_x_r_e_c_v_8h.html#a86a3e5765d02bc043d5d1f674a7ffb0f">XBOX_INPUT_PIPE_3</a> ].<a class="code" href="struct_ep_info.html#a9f92be74c75c037b39e2cae1eb49b89b">epAddr</a> = 0x05; <span class="comment">// XBOX 360 report endpoint - poll interval 1ms</span></div>
<div class="line"><a name="l00179"></a><span class="lineno"> 179</span>&#160; <a class="code" href="class_x_b_o_x_r_e_c_v.html#af97c8d0efc945fa4ba1d120c8a5a9cbb">epInfo</a>[ <a class="code" href="_x_b_o_x_r_e_c_v_8h.html#a86a3e5765d02bc043d5d1f674a7ffb0f">XBOX_INPUT_PIPE_3</a> ].<a class="code" href="struct_ep_info.html#a1dea928517c961235eef7b0876e69f10">epAttribs</a> = <a class="code" href="_p_s3_u_s_b_8h.html#ad4d26e1c566064f2259faf65f0858b6e">EP_INTERRUPT</a>;</div>
<div class="line"><a name="l00180"></a><span class="lineno"> 180</span>&#160; <a class="code" href="class_x_b_o_x_r_e_c_v.html#af97c8d0efc945fa4ba1d120c8a5a9cbb">epInfo</a>[ <a class="code" href="_x_b_o_x_r_e_c_v_8h.html#a86a3e5765d02bc043d5d1f674a7ffb0f">XBOX_INPUT_PIPE_3</a> ].<a class="code" href="struct_ep_info.html#a3a5b1c017a034cd9e06e76729e727c46">bmNakPower</a> = <a class="code" href="address_8h.html#a660e8da9c1167a8450aef91c5c03761d">USB_NAK_NOWAIT</a>; <span class="comment">// Only poll once for interrupt endpoints</span></div>
<div class="line"><a name="l00181"></a><span class="lineno"> 181</span>&#160; <a class="code" href="class_x_b_o_x_r_e_c_v.html#af97c8d0efc945fa4ba1d120c8a5a9cbb">epInfo</a>[ <a class="code" href="_x_b_o_x_r_e_c_v_8h.html#a86a3e5765d02bc043d5d1f674a7ffb0f">XBOX_INPUT_PIPE_3</a> ].<a class="code" href="struct_ep_info.html#aa2ca775b63736df4008e88da7dd4dddb">maxPktSize</a> = <a class="code" href="_p_s3_u_s_b_8h.html#abcb805b13bfd36145e252b0633bbcfc0">EP_MAXPKTSIZE</a>;</div>
<div class="line"><a name="l00182"></a><span class="lineno"> 182</span>&#160; <a class="code" href="class_x_b_o_x_r_e_c_v.html#af97c8d0efc945fa4ba1d120c8a5a9cbb">epInfo</a>[ <a class="code" href="_x_b_o_x_r_e_c_v_8h.html#a86a3e5765d02bc043d5d1f674a7ffb0f">XBOX_INPUT_PIPE_3</a> ].<a class="code" href="struct_ep_info.html#ac85bff70ad0e5d71e50cb501f4d8caf3">bmSndToggle</a> = <a class="code" href="max3421e_8h.html#a4834ae7378471b63b9a1985c6294006f">bmSNDTOG0</a>;</div>
<div class="line"><a name="l00183"></a><span class="lineno"> 183</span>&#160; <a class="code" href="class_x_b_o_x_r_e_c_v.html#af97c8d0efc945fa4ba1d120c8a5a9cbb">epInfo</a>[ <a class="code" href="_x_b_o_x_r_e_c_v_8h.html#a86a3e5765d02bc043d5d1f674a7ffb0f">XBOX_INPUT_PIPE_3</a> ].<a class="code" href="struct_ep_info.html#a9238dd40c096baedf041c98b19386a14">bmRcvToggle</a> = <a class="code" href="max3421e_8h.html#aca6a8aa4f0aebbe07c5e175572a92ef7">bmRCVTOG0</a>;</div>
<div class="line"><a name="l00184"></a><span class="lineno"> 184</span>&#160; <a class="code" href="class_x_b_o_x_r_e_c_v.html#af97c8d0efc945fa4ba1d120c8a5a9cbb">epInfo</a>[ <a class="code" href="_x_b_o_x_r_e_c_v_8h.html#afce4154cabb3a0d2c7eeb39b1c15d353">XBOX_OUTPUT_PIPE_3</a> ].<a class="code" href="struct_ep_info.html#a9f92be74c75c037b39e2cae1eb49b89b">epAddr</a> = 0x05; <span class="comment">// XBOX 360 output endpoint - poll interval 8ms</span></div>
<div class="line"><a name="l00185"></a><span class="lineno"> 185</span>&#160; <a class="code" href="class_x_b_o_x_r_e_c_v.html#af97c8d0efc945fa4ba1d120c8a5a9cbb">epInfo</a>[ <a class="code" href="_x_b_o_x_r_e_c_v_8h.html#afce4154cabb3a0d2c7eeb39b1c15d353">XBOX_OUTPUT_PIPE_3</a> ].<a class="code" href="struct_ep_info.html#a1dea928517c961235eef7b0876e69f10">epAttribs</a> = <a class="code" href="_p_s3_u_s_b_8h.html#ad4d26e1c566064f2259faf65f0858b6e">EP_INTERRUPT</a>;</div>
<div class="line"><a name="l00186"></a><span class="lineno"> 186</span>&#160; <a class="code" href="class_x_b_o_x_r_e_c_v.html#af97c8d0efc945fa4ba1d120c8a5a9cbb">epInfo</a>[ <a class="code" href="_x_b_o_x_r_e_c_v_8h.html#afce4154cabb3a0d2c7eeb39b1c15d353">XBOX_OUTPUT_PIPE_3</a> ].<a class="code" href="struct_ep_info.html#a3a5b1c017a034cd9e06e76729e727c46">bmNakPower</a> = <a class="code" href="address_8h.html#a660e8da9c1167a8450aef91c5c03761d">USB_NAK_NOWAIT</a>; <span class="comment">// Only poll once for interrupt endpoints</span></div>
<div class="line"><a name="l00187"></a><span class="lineno"> 187</span>&#160; <a class="code" href="class_x_b_o_x_r_e_c_v.html#af97c8d0efc945fa4ba1d120c8a5a9cbb">epInfo</a>[ <a class="code" href="_x_b_o_x_r_e_c_v_8h.html#afce4154cabb3a0d2c7eeb39b1c15d353">XBOX_OUTPUT_PIPE_3</a> ].<a class="code" href="struct_ep_info.html#aa2ca775b63736df4008e88da7dd4dddb">maxPktSize</a> = <a class="code" href="_p_s3_u_s_b_8h.html#abcb805b13bfd36145e252b0633bbcfc0">EP_MAXPKTSIZE</a>;</div>
<div class="line"><a name="l00188"></a><span class="lineno"> 188</span>&#160; <a class="code" href="class_x_b_o_x_r_e_c_v.html#af97c8d0efc945fa4ba1d120c8a5a9cbb">epInfo</a>[ <a class="code" href="_x_b_o_x_r_e_c_v_8h.html#afce4154cabb3a0d2c7eeb39b1c15d353">XBOX_OUTPUT_PIPE_3</a> ].<a class="code" href="struct_ep_info.html#ac85bff70ad0e5d71e50cb501f4d8caf3">bmSndToggle</a> = <a class="code" href="max3421e_8h.html#a4834ae7378471b63b9a1985c6294006f">bmSNDTOG0</a>;</div>
<div class="line"><a name="l00189"></a><span class="lineno"> 189</span>&#160; <a class="code" href="class_x_b_o_x_r_e_c_v.html#af97c8d0efc945fa4ba1d120c8a5a9cbb">epInfo</a>[ <a class="code" href="_x_b_o_x_r_e_c_v_8h.html#afce4154cabb3a0d2c7eeb39b1c15d353">XBOX_OUTPUT_PIPE_3</a> ].<a class="code" href="struct_ep_info.html#a9238dd40c096baedf041c98b19386a14">bmRcvToggle</a> = <a class="code" href="max3421e_8h.html#aca6a8aa4f0aebbe07c5e175572a92ef7">bmRCVTOG0</a>;</div>
<div class="line"><a name="l00190"></a><span class="lineno"> 190</span>&#160;</div>
<div class="line"><a name="l00191"></a><span class="lineno"> 191</span>&#160; <a class="code" href="class_x_b_o_x_r_e_c_v.html#af97c8d0efc945fa4ba1d120c8a5a9cbb">epInfo</a>[ <a class="code" href="_x_b_o_x_r_e_c_v_8h.html#a5acfdaefe74aba1632c71acb79c49671">XBOX_INPUT_PIPE_4</a> ].<a class="code" href="struct_ep_info.html#a9f92be74c75c037b39e2cae1eb49b89b">epAddr</a> = 0x07; <span class="comment">// XBOX 360 report endpoint - poll interval 1ms</span></div>
<div class="line"><a name="l00192"></a><span class="lineno"> 192</span>&#160; <a class="code" href="class_x_b_o_x_r_e_c_v.html#af97c8d0efc945fa4ba1d120c8a5a9cbb">epInfo</a>[ <a class="code" href="_x_b_o_x_r_e_c_v_8h.html#a5acfdaefe74aba1632c71acb79c49671">XBOX_INPUT_PIPE_4</a> ].<a class="code" href="struct_ep_info.html#a1dea928517c961235eef7b0876e69f10">epAttribs</a> = <a class="code" href="_p_s3_u_s_b_8h.html#ad4d26e1c566064f2259faf65f0858b6e">EP_INTERRUPT</a>;</div>
<div class="line"><a name="l00193"></a><span class="lineno"> 193</span>&#160; <a class="code" href="class_x_b_o_x_r_e_c_v.html#af97c8d0efc945fa4ba1d120c8a5a9cbb">epInfo</a>[ <a class="code" href="_x_b_o_x_r_e_c_v_8h.html#a5acfdaefe74aba1632c71acb79c49671">XBOX_INPUT_PIPE_4</a> ].<a class="code" href="struct_ep_info.html#a3a5b1c017a034cd9e06e76729e727c46">bmNakPower</a> = <a class="code" href="address_8h.html#a660e8da9c1167a8450aef91c5c03761d">USB_NAK_NOWAIT</a>; <span class="comment">// Only poll once for interrupt endpoints</span></div>
<div class="line"><a name="l00194"></a><span class="lineno"> 194</span>&#160; <a class="code" href="class_x_b_o_x_r_e_c_v.html#af97c8d0efc945fa4ba1d120c8a5a9cbb">epInfo</a>[ <a class="code" href="_x_b_o_x_r_e_c_v_8h.html#a5acfdaefe74aba1632c71acb79c49671">XBOX_INPUT_PIPE_4</a> ].<a class="code" href="struct_ep_info.html#aa2ca775b63736df4008e88da7dd4dddb">maxPktSize</a> = <a class="code" href="_p_s3_u_s_b_8h.html#abcb805b13bfd36145e252b0633bbcfc0">EP_MAXPKTSIZE</a>;</div>
<div class="line"><a name="l00195"></a><span class="lineno"> 195</span>&#160; <a class="code" href="class_x_b_o_x_r_e_c_v.html#af97c8d0efc945fa4ba1d120c8a5a9cbb">epInfo</a>[ <a class="code" href="_x_b_o_x_r_e_c_v_8h.html#a5acfdaefe74aba1632c71acb79c49671">XBOX_INPUT_PIPE_4</a> ].<a class="code" href="struct_ep_info.html#ac85bff70ad0e5d71e50cb501f4d8caf3">bmSndToggle</a> = <a class="code" href="max3421e_8h.html#a4834ae7378471b63b9a1985c6294006f">bmSNDTOG0</a>;</div>
<div class="line"><a name="l00196"></a><span class="lineno"> 196</span>&#160; <a class="code" href="class_x_b_o_x_r_e_c_v.html#af97c8d0efc945fa4ba1d120c8a5a9cbb">epInfo</a>[ <a class="code" href="_x_b_o_x_r_e_c_v_8h.html#a5acfdaefe74aba1632c71acb79c49671">XBOX_INPUT_PIPE_4</a> ].<a class="code" href="struct_ep_info.html#a9238dd40c096baedf041c98b19386a14">bmRcvToggle</a> = <a class="code" href="max3421e_8h.html#aca6a8aa4f0aebbe07c5e175572a92ef7">bmRCVTOG0</a>;</div>
<div class="line"><a name="l00197"></a><span class="lineno"> 197</span>&#160; <a class="code" href="class_x_b_o_x_r_e_c_v.html#af97c8d0efc945fa4ba1d120c8a5a9cbb">epInfo</a>[ <a class="code" href="_x_b_o_x_r_e_c_v_8h.html#a7a74e0ea052831dbbb4a0973fffc8179">XBOX_OUTPUT_PIPE_4</a> ].<a class="code" href="struct_ep_info.html#a9f92be74c75c037b39e2cae1eb49b89b">epAddr</a> = 0x07; <span class="comment">// XBOX 360 output endpoint - poll interval 8ms</span></div>
<div class="line"><a name="l00198"></a><span class="lineno"> 198</span>&#160; <a class="code" href="class_x_b_o_x_r_e_c_v.html#af97c8d0efc945fa4ba1d120c8a5a9cbb">epInfo</a>[ <a class="code" href="_x_b_o_x_r_e_c_v_8h.html#a7a74e0ea052831dbbb4a0973fffc8179">XBOX_OUTPUT_PIPE_4</a> ].<a class="code" href="struct_ep_info.html#a1dea928517c961235eef7b0876e69f10">epAttribs</a> = <a class="code" href="_p_s3_u_s_b_8h.html#ad4d26e1c566064f2259faf65f0858b6e">EP_INTERRUPT</a>;</div>
<div class="line"><a name="l00199"></a><span class="lineno"> 199</span>&#160; <a class="code" href="class_x_b_o_x_r_e_c_v.html#af97c8d0efc945fa4ba1d120c8a5a9cbb">epInfo</a>[ <a class="code" href="_x_b_o_x_r_e_c_v_8h.html#a7a74e0ea052831dbbb4a0973fffc8179">XBOX_OUTPUT_PIPE_4</a> ].<a class="code" href="struct_ep_info.html#a3a5b1c017a034cd9e06e76729e727c46">bmNakPower</a> = <a class="code" href="address_8h.html#a660e8da9c1167a8450aef91c5c03761d">USB_NAK_NOWAIT</a>; <span class="comment">// Only poll once for interrupt endpoints</span></div>
<div class="line"><a name="l00200"></a><span class="lineno"> 200</span>&#160; <a class="code" href="class_x_b_o_x_r_e_c_v.html#af97c8d0efc945fa4ba1d120c8a5a9cbb">epInfo</a>[ <a class="code" href="_x_b_o_x_r_e_c_v_8h.html#a7a74e0ea052831dbbb4a0973fffc8179">XBOX_OUTPUT_PIPE_4</a> ].<a class="code" href="struct_ep_info.html#aa2ca775b63736df4008e88da7dd4dddb">maxPktSize</a> = <a class="code" href="_p_s3_u_s_b_8h.html#abcb805b13bfd36145e252b0633bbcfc0">EP_MAXPKTSIZE</a>;</div>
<div class="line"><a name="l00201"></a><span class="lineno"> 201</span>&#160; <a class="code" href="class_x_b_o_x_r_e_c_v.html#af97c8d0efc945fa4ba1d120c8a5a9cbb">epInfo</a>[ <a class="code" href="_x_b_o_x_r_e_c_v_8h.html#a7a74e0ea052831dbbb4a0973fffc8179">XBOX_OUTPUT_PIPE_4</a> ].<a class="code" href="struct_ep_info.html#ac85bff70ad0e5d71e50cb501f4d8caf3">bmSndToggle</a> = <a class="code" href="max3421e_8h.html#a4834ae7378471b63b9a1985c6294006f">bmSNDTOG0</a>;</div>
<div class="line"><a name="l00202"></a><span class="lineno"> 202</span>&#160; <a class="code" href="class_x_b_o_x_r_e_c_v.html#af97c8d0efc945fa4ba1d120c8a5a9cbb">epInfo</a>[ <a class="code" href="_x_b_o_x_r_e_c_v_8h.html#a7a74e0ea052831dbbb4a0973fffc8179">XBOX_OUTPUT_PIPE_4</a> ].<a class="code" href="struct_ep_info.html#a9238dd40c096baedf041c98b19386a14">bmRcvToggle</a> = <a class="code" href="max3421e_8h.html#aca6a8aa4f0aebbe07c5e175572a92ef7">bmRCVTOG0</a>;</div>
<div class="line"><a name="l00203"></a><span class="lineno"> 203</span>&#160;</div>
<div class="line"><a name="l00204"></a><span class="lineno"> 204</span>&#160; rcode = <a class="code" href="class_x_b_o_x_r_e_c_v.html#a53047c86c8c2f625916af62238d50fc8">pUsb</a>-&gt;<a class="code" href="class_u_s_b.html#a6c3ba3f7e6dccb450267011ce783d7ea">setEpInfoEntry</a>(bAddress, 9, <a class="code" href="class_x_b_o_x_r_e_c_v.html#af97c8d0efc945fa4ba1d120c8a5a9cbb">epInfo</a>);</div>
<div class="line"><a name="l00205"></a><span class="lineno"> 205</span>&#160; <span class="keywordflow">if</span> (rcode)</div>
<div class="line"><a name="l00206"></a><span class="lineno"> 206</span>&#160; <span class="keywordflow">goto</span> FailSetDevTblEntry;</div>
<div class="line"><a name="l00207"></a><span class="lineno"> 207</span>&#160;</div>
<div class="line"><a name="l00208"></a><span class="lineno"> 208</span>&#160; rcode = <a class="code" href="class_x_b_o_x_r_e_c_v.html#a53047c86c8c2f625916af62238d50fc8">pUsb</a>-&gt;<a class="code" href="class_u_s_b.html#a31e2c132ec32ffdde94dff72be87c378">setConf</a>(bAddress, <a class="code" href="class_x_b_o_x_r_e_c_v.html#af97c8d0efc945fa4ba1d120c8a5a9cbb">epInfo</a>[ <a class="code" href="_x_b_o_x_r_e_c_v_8h.html#a8f4ee68cc0f05690f5f26104c7d9e490">XBOX_CONTROL_PIPE</a> ].epAddr, 1);</div>
<div class="line"><a name="l00209"></a><span class="lineno"> 209</span>&#160; <span class="keywordflow">if</span> (rcode)</div>
<div class="line"><a name="l00210"></a><span class="lineno"> 210</span>&#160; <span class="keywordflow">goto</span> FailSetConfDescr;</div>
<div class="line"><a name="l00211"></a><span class="lineno"> 211</span>&#160;</div>
<div class="line"><a name="l00212"></a><span class="lineno"> 212</span>&#160;<span class="preprocessor">#ifdef DEBUG_USB_HOST</span></div>
<div class="line"><a name="l00213"></a><span class="lineno"> 213</span>&#160;<span class="preprocessor"></span> <a class="code" href="message_8h.html#a747819b0aa34f5c3ba0332c2db28c846">Notify</a>(PSTR(<span class="stringliteral">&quot;\r\nXbox Wireless Receiver Connected\r\n&quot;</span>), 0x80);</div>
<div class="line"><a name="l00214"></a><span class="lineno"> 214</span>&#160;<span class="preprocessor">#endif</span></div>
<div class="line"><a name="l00215"></a><span class="lineno"> 215</span>&#160;<span class="preprocessor"></span> <a class="code" href="class_x_b_o_x_r_e_c_v.html#a5ff16bba78f05af3023f395a342b625c">XboxReceiverConnected</a> = <span class="keyword">true</span>;</div>
<div class="line"><a name="l00216"></a><span class="lineno"> 216</span>&#160; bPollEnable = <span class="keyword">true</span>;</div>
<div class="line"><a name="l00217"></a><span class="lineno"> 217</span>&#160; <span class="keywordflow">return</span> 0; <span class="comment">// successful configuration</span></div>
<div class="line"><a name="l00218"></a><span class="lineno"> 218</span>&#160;</div>
<div class="line"><a name="l00219"></a><span class="lineno"> 219</span>&#160; <span class="comment">/* diagnostic messages */</span></div>
<div class="line"><a name="l00220"></a><span class="lineno"> 220</span>&#160;FailGetDevDescr:</div>
<div class="line"><a name="l00221"></a><span class="lineno"> 221</span>&#160;<span class="preprocessor">#ifdef DEBUG_USB_HOST</span></div>
<div class="line"><a name="l00222"></a><span class="lineno"> 222</span>&#160;<span class="preprocessor"></span> <a class="code" href="message_8cpp.html#ace40a5d826a882de0c5a25aece111d3f">NotifyFailGetDevDescr</a>();</div>
<div class="line"><a name="l00223"></a><span class="lineno"> 223</span>&#160; <span class="keywordflow">goto</span> Fail;</div>
<div class="line"><a name="l00224"></a><span class="lineno"> 224</span>&#160;<span class="preprocessor">#endif</span></div>
<div class="line"><a name="l00225"></a><span class="lineno"> 225</span>&#160;<span class="preprocessor"></span></div>
<div class="line"><a name="l00226"></a><span class="lineno"> 226</span>&#160;FailSetDevTblEntry:</div>
<div class="line"><a name="l00227"></a><span class="lineno"> 227</span>&#160;<span class="preprocessor">#ifdef DEBUG_USB_HOST</span></div>
<div class="line"><a name="l00228"></a><span class="lineno"> 228</span>&#160;<span class="preprocessor"></span> <a class="code" href="message_8cpp.html#aa65008f9251787149e391f89e68b32be">NotifyFailSetDevTblEntry</a>();</div>
<div class="line"><a name="l00229"></a><span class="lineno"> 229</span>&#160; <span class="keywordflow">goto</span> Fail;</div>
<div class="line"><a name="l00230"></a><span class="lineno"> 230</span>&#160;<span class="preprocessor">#endif</span></div>
<div class="line"><a name="l00231"></a><span class="lineno"> 231</span>&#160;<span class="preprocessor"></span></div>
<div class="line"><a name="l00232"></a><span class="lineno"> 232</span>&#160;FailSetConfDescr:</div>
<div class="line"><a name="l00233"></a><span class="lineno"> 233</span>&#160;<span class="preprocessor">#ifdef DEBUG_USB_HOST</span></div>
<div class="line"><a name="l00234"></a><span class="lineno"> 234</span>&#160;<span class="preprocessor"></span> <a class="code" href="message_8cpp.html#a08b840c377ca6f8154d6924d51338d89">NotifyFailSetConfDescr</a>();</div>
<div class="line"><a name="l00235"></a><span class="lineno"> 235</span>&#160;<span class="preprocessor">#endif</span></div>
<div class="line"><a name="l00236"></a><span class="lineno"> 236</span>&#160;<span class="preprocessor"></span> <span class="keywordflow">goto</span> Fail;</div>
<div class="line"><a name="l00237"></a><span class="lineno"> 237</span>&#160;</div>
<div class="line"><a name="l00238"></a><span class="lineno"> 238</span>&#160;FailUnknownDevice:</div>
<div class="line"><a name="l00239"></a><span class="lineno"> 239</span>&#160;<span class="preprocessor">#ifdef DEBUG_USB_HOST</span></div>
<div class="line"><a name="l00240"></a><span class="lineno"> 240</span>&#160;<span class="preprocessor"></span> <a class="code" href="message_8cpp.html#a7103129ed2b7b7896461c0a3cd924eb4">NotifyFailUnknownDevice</a>(VID,PID);</div>
<div class="line"><a name="l00241"></a><span class="lineno"> 241</span>&#160;<span class="preprocessor">#endif</span></div>
<div class="line"><a name="l00242"></a><span class="lineno"> 242</span>&#160;<span class="preprocessor"></span> rcode = <a class="code" href="_usb_8h.html#ae9e139d0fd29bb0b3e7afad2f76cd589">USB_DEV_CONFIG_ERROR_DEVICE_NOT_SUPPORTED</a>;</div>
<div class="line"><a name="l00243"></a><span class="lineno"> 243</span>&#160;</div>
<div class="line"><a name="l00244"></a><span class="lineno"> 244</span>&#160;Fail:</div>
<div class="line"><a name="l00245"></a><span class="lineno"> 245</span>&#160;<span class="preprocessor">#ifdef DEBUG_USB_HOST</span></div>
<div class="line"><a name="l00246"></a><span class="lineno"> 246</span>&#160;<span class="preprocessor"></span> <a class="code" href="message_8h.html#a747819b0aa34f5c3ba0332c2db28c846">Notify</a>(PSTR(<span class="stringliteral">&quot;\r\nXbox 360 Init Failed, error code: &quot;</span>), 0x80);</div>
<div class="line"><a name="l00247"></a><span class="lineno"> 247</span>&#160; <a class="code" href="message_8cpp.html#a5ae2cb9bf877595104f2425f50e2057f">NotifyFail</a>(rcode);</div>
<div class="line"><a name="l00248"></a><span class="lineno"> 248</span>&#160;<span class="preprocessor">#endif</span></div>
<div class="line"><a name="l00249"></a><span class="lineno"> 249</span>&#160;<span class="preprocessor"></span> <a class="code" href="class_x_b_o_x_r_e_c_v.html#ad0e6b53a818516b7d6af0beaa8cebc7a">Release</a>();</div>
<div class="line"><a name="l00250"></a><span class="lineno"> 250</span>&#160; <span class="keywordflow">return</span> rcode;</div>
<div class="line"><a name="l00251"></a><span class="lineno"> 251</span>&#160;}</div>
<div class="line"><a name="l00252"></a><span class="lineno"> 252</span>&#160;</div>
<div class="line"><a name="l00253"></a><span class="lineno"> 253</span>&#160;<span class="comment">/* Performs a cleanup after failed Init() attempt */</span></div>
<div class="line"><a name="l00254"></a><span class="lineno"><a class="code" href="class_x_b_o_x_r_e_c_v.html#ad0e6b53a818516b7d6af0beaa8cebc7a"> 254</a></span>&#160;uint8_t <a class="code" href="class_x_b_o_x_r_e_c_v.html#ad0e6b53a818516b7d6af0beaa8cebc7a">XBOXRECV::Release</a>() {</div>
<div class="line"><a name="l00255"></a><span class="lineno"> 255</span>&#160; <a class="code" href="class_x_b_o_x_r_e_c_v.html#a5ff16bba78f05af3023f395a342b625c">XboxReceiverConnected</a> = <span class="keyword">false</span>;</div>
<div class="line"><a name="l00256"></a><span class="lineno"> 256</span>&#160; <span class="keywordflow">for</span> (uint8_t i = 0; i &lt; 4; i++)</div>
<div class="line"><a name="l00257"></a><span class="lineno"> 257</span>&#160; <a class="code" href="class_x_b_o_x_r_e_c_v.html#ac07faada38e159f1e7831d90863ebe3a">Xbox360Connected</a>[i] = 0x00;</div>
<div class="line"><a name="l00258"></a><span class="lineno"> 258</span>&#160; <a class="code" href="class_x_b_o_x_r_e_c_v.html#a53047c86c8c2f625916af62238d50fc8">pUsb</a>-&gt;<a class="code" href="class_u_s_b.html#a66ab8f5eda239e761d5a48741ea1f9d4">GetAddressPool</a>().<a class="code" href="class_address_pool.html#a15fde13223dcb1da89305ad229763562">FreeAddress</a>(<a class="code" href="class_x_b_o_x_r_e_c_v.html#a1d4bdb1b740c87fd51aca3969e67c730">bAddress</a>);</div>
<div class="line"><a name="l00259"></a><span class="lineno"> 259</span>&#160; <a class="code" href="class_x_b_o_x_r_e_c_v.html#a1d4bdb1b740c87fd51aca3969e67c730">bAddress</a> = 0;</div>
<div class="line"><a name="l00260"></a><span class="lineno"> 260</span>&#160; bPollEnable = <span class="keyword">false</span>;</div>
<div class="line"><a name="l00261"></a><span class="lineno"> 261</span>&#160; <span class="keywordflow">return</span> 0;</div>
<div class="line"><a name="l00262"></a><span class="lineno"> 262</span>&#160;}</div>
<div class="line"><a name="l00263"></a><span class="lineno"> 263</span>&#160;</div>
<div class="line"><a name="l00264"></a><span class="lineno"><a class="code" href="class_x_b_o_x_r_e_c_v.html#aafe1688ba3dc9b9ac425ebbbf001a1cc"> 264</a></span>&#160;uint8_t <a class="code" href="class_x_b_o_x_r_e_c_v.html#aafe1688ba3dc9b9ac425ebbbf001a1cc">XBOXRECV::Poll</a>() {</div>
<div class="line"><a name="l00265"></a><span class="lineno"> 265</span>&#160; <span class="keywordflow">if</span> (!bPollEnable)</div>
<div class="line"><a name="l00266"></a><span class="lineno"> 266</span>&#160; <span class="keywordflow">return</span> 0;</div>
<div class="line"><a name="l00267"></a><span class="lineno"> 267</span>&#160; <span class="keywordflow">if</span> (!timer || ((millis() - timer) &gt; 3000)) { <span class="comment">// Run checkStatus every 3 seconds</span></div>
<div class="line"><a name="l00268"></a><span class="lineno"> 268</span>&#160; timer = millis();</div>
<div class="line"><a name="l00269"></a><span class="lineno"> 269</span>&#160; checkStatus();</div>
<div class="line"><a name="l00270"></a><span class="lineno"> 270</span>&#160; }</div>
<div class="line"><a name="l00271"></a><span class="lineno"> 271</span>&#160; uint8_t inputPipe;</div>
<div class="line"><a name="l00272"></a><span class="lineno"> 272</span>&#160; uint16_t bufferSize;</div>
<div class="line"><a name="l00273"></a><span class="lineno"> 273</span>&#160; <span class="keywordflow">for</span> (uint8_t i = 0; i &lt; 4; i++) {</div>
<div class="line"><a name="l00274"></a><span class="lineno"> 274</span>&#160; <span class="keywordflow">switch</span> (i) {</div>
<div class="line"><a name="l00275"></a><span class="lineno"> 275</span>&#160; <span class="keywordflow">case</span> 0: inputPipe = <a class="code" href="_x_b_o_x_r_e_c_v_8h.html#a2824b25aa9a384c29f27a4e1bb443799">XBOX_INPUT_PIPE_1</a>;</div>
<div class="line"><a name="l00276"></a><span class="lineno"> 276</span>&#160; <span class="keywordflow">break</span>;</div>
<div class="line"><a name="l00277"></a><span class="lineno"> 277</span>&#160; <span class="keywordflow">case</span> 1: inputPipe = <a class="code" href="_x_b_o_x_r_e_c_v_8h.html#aab6feb681a78b190190bcc081868a485">XBOX_INPUT_PIPE_2</a>;</div>
<div class="line"><a name="l00208"></a><span class="lineno"> 208</span>&#160; delay(200); <span class="comment">//Give time for address change</span></div>
<div class="line"><a name="l00209"></a><span class="lineno"> 209</span>&#160;</div>
<div class="line"><a name="l00210"></a><span class="lineno"> 210</span>&#160; rcode = <a class="code" href="class_x_b_o_x_r_e_c_v.html#a53047c86c8c2f625916af62238d50fc8">pUsb</a>-&gt;<a class="code" href="class_u_s_b.html#a31e2c132ec32ffdde94dff72be87c378">setConf</a>(bAddress, <a class="code" href="class_x_b_o_x_r_e_c_v.html#af97c8d0efc945fa4ba1d120c8a5a9cbb">epInfo</a>[ <a class="code" href="_x_b_o_x_o_l_d_8h.html#a8f4ee68cc0f05690f5f26104c7d9e490">XBOX_CONTROL_PIPE</a> ].epAddr, 1);</div>
<div class="line"><a name="l00211"></a><span class="lineno"> 211</span>&#160; <span class="keywordflow">if</span> (rcode)</div>
<div class="line"><a name="l00212"></a><span class="lineno"> 212</span>&#160; <span class="keywordflow">goto</span> FailSetConfDescr;</div>
<div class="line"><a name="l00213"></a><span class="lineno"> 213</span>&#160;</div>
<div class="line"><a name="l00214"></a><span class="lineno"> 214</span>&#160;<span class="preprocessor">#ifdef DEBUG_USB_HOST</span></div>
<div class="line"><a name="l00215"></a><span class="lineno"> 215</span>&#160;<span class="preprocessor"></span> <a class="code" href="message_8h.html#a27117e124c5d66d5512fe8d494fe6338">Notify</a>(PSTR(<span class="stringliteral">&quot;\r\nXbox Wireless Receiver Connected\r\n&quot;</span>), 0x80);</div>
<div class="line"><a name="l00216"></a><span class="lineno"> 216</span>&#160;<span class="preprocessor">#endif</span></div>
<div class="line"><a name="l00217"></a><span class="lineno"> 217</span>&#160;<span class="preprocessor"></span> <a class="code" href="class_x_b_o_x_r_e_c_v.html#a5ff16bba78f05af3023f395a342b625c">XboxReceiverConnected</a> = <span class="keyword">true</span>;</div>
<div class="line"><a name="l00218"></a><span class="lineno"> 218</span>&#160; bPollEnable = <span class="keyword">true</span>;</div>
<div class="line"><a name="l00219"></a><span class="lineno"> 219</span>&#160; <span class="keywordflow">return</span> 0; <span class="comment">// successful configuration</span></div>
<div class="line"><a name="l00220"></a><span class="lineno"> 220</span>&#160;</div>
<div class="line"><a name="l00221"></a><span class="lineno"> 221</span>&#160; <span class="comment">/* diagnostic messages */</span></div>
<div class="line"><a name="l00222"></a><span class="lineno"> 222</span>&#160;FailGetDevDescr:</div>
<div class="line"><a name="l00223"></a><span class="lineno"> 223</span>&#160;<span class="preprocessor">#ifdef DEBUG_USB_HOST</span></div>
<div class="line"><a name="l00224"></a><span class="lineno"> 224</span>&#160;<span class="preprocessor"></span> <a class="code" href="message_8h.html#ae65e02f44cfdc490efd1b33f9882fbbd">NotifyFailGetDevDescr</a>();</div>
<div class="line"><a name="l00225"></a><span class="lineno"> 225</span>&#160; <span class="keywordflow">goto</span> Fail;</div>
<div class="line"><a name="l00226"></a><span class="lineno"> 226</span>&#160;<span class="preprocessor">#endif</span></div>
<div class="line"><a name="l00227"></a><span class="lineno"> 227</span>&#160;<span class="preprocessor"></span></div>
<div class="line"><a name="l00228"></a><span class="lineno"> 228</span>&#160;FailSetDevTblEntry:</div>
<div class="line"><a name="l00229"></a><span class="lineno"> 229</span>&#160;<span class="preprocessor">#ifdef DEBUG_USB_HOST</span></div>
<div class="line"><a name="l00230"></a><span class="lineno"> 230</span>&#160;<span class="preprocessor"></span> <a class="code" href="message_8h.html#a69619d86b1636f141c830ca82c7f45e7">NotifyFailSetDevTblEntry</a>();</div>
<div class="line"><a name="l00231"></a><span class="lineno"> 231</span>&#160; <span class="keywordflow">goto</span> Fail;</div>
<div class="line"><a name="l00232"></a><span class="lineno"> 232</span>&#160;<span class="preprocessor">#endif</span></div>
<div class="line"><a name="l00233"></a><span class="lineno"> 233</span>&#160;<span class="preprocessor"></span></div>
<div class="line"><a name="l00234"></a><span class="lineno"> 234</span>&#160;FailSetConfDescr:</div>
<div class="line"><a name="l00235"></a><span class="lineno"> 235</span>&#160;<span class="preprocessor">#ifdef DEBUG_USB_HOST</span></div>
<div class="line"><a name="l00236"></a><span class="lineno"> 236</span>&#160;<span class="preprocessor"></span> <a class="code" href="message_8h.html#a03e4088aafca36fd7a4be69e3a22b601">NotifyFailSetConfDescr</a>();</div>
<div class="line"><a name="l00237"></a><span class="lineno"> 237</span>&#160;<span class="preprocessor">#endif</span></div>
<div class="line"><a name="l00238"></a><span class="lineno"> 238</span>&#160;<span class="preprocessor"></span> <span class="keywordflow">goto</span> Fail;</div>
<div class="line"><a name="l00239"></a><span class="lineno"> 239</span>&#160;</div>
<div class="line"><a name="l00240"></a><span class="lineno"> 240</span>&#160;FailUnknownDevice:</div>
<div class="line"><a name="l00241"></a><span class="lineno"> 241</span>&#160;<span class="preprocessor">#ifdef DEBUG_USB_HOST</span></div>
<div class="line"><a name="l00242"></a><span class="lineno"> 242</span>&#160;<span class="preprocessor"></span> <a class="code" href="message_8h.html#a0ce3a725ee65614d7f95cda10e4d2e91">NotifyFailUnknownDevice</a>(VID,PID);</div>
<div class="line"><a name="l00243"></a><span class="lineno"> 243</span>&#160;<span class="preprocessor">#endif</span></div>
<div class="line"><a name="l00244"></a><span class="lineno"> 244</span>&#160;<span class="preprocessor"></span> rcode = <a class="code" href="_usb_8h.html#ae9e139d0fd29bb0b3e7afad2f76cd589">USB_DEV_CONFIG_ERROR_DEVICE_NOT_SUPPORTED</a>;</div>
<div class="line"><a name="l00245"></a><span class="lineno"> 245</span>&#160;</div>
<div class="line"><a name="l00246"></a><span class="lineno"> 246</span>&#160;Fail:</div>
<div class="line"><a name="l00247"></a><span class="lineno"> 247</span>&#160;<span class="preprocessor">#ifdef DEBUG_USB_HOST</span></div>
<div class="line"><a name="l00248"></a><span class="lineno"> 248</span>&#160;<span class="preprocessor"></span> <a class="code" href="message_8h.html#a27117e124c5d66d5512fe8d494fe6338">Notify</a>(PSTR(<span class="stringliteral">&quot;\r\nXbox 360 Init Failed, error code: &quot;</span>), 0x80);</div>
<div class="line"><a name="l00249"></a><span class="lineno"> 249</span>&#160; <a class="code" href="message_8h.html#a22695bdc18ebde4a87dbe8633cb39593">NotifyFail</a>(rcode);</div>
<div class="line"><a name="l00250"></a><span class="lineno"> 250</span>&#160;<span class="preprocessor">#endif</span></div>
<div class="line"><a name="l00251"></a><span class="lineno"> 251</span>&#160;<span class="preprocessor"></span> <a class="code" href="class_x_b_o_x_r_e_c_v.html#ad0e6b53a818516b7d6af0beaa8cebc7a">Release</a>();</div>
<div class="line"><a name="l00252"></a><span class="lineno"> 252</span>&#160; <span class="keywordflow">return</span> rcode;</div>
<div class="line"><a name="l00253"></a><span class="lineno"> 253</span>&#160;}</div>
<div class="line"><a name="l00254"></a><span class="lineno"> 254</span>&#160;</div>
<div class="line"><a name="l00255"></a><span class="lineno"> 255</span>&#160;<span class="comment">/* Performs a cleanup after failed Init() attempt */</span></div>
<div class="line"><a name="l00256"></a><span class="lineno"><a class="code" href="class_x_b_o_x_r_e_c_v.html#ad0e6b53a818516b7d6af0beaa8cebc7a"> 256</a></span>&#160;uint8_t <a class="code" href="class_x_b_o_x_r_e_c_v.html#ad0e6b53a818516b7d6af0beaa8cebc7a">XBOXRECV::Release</a>() {</div>
<div class="line"><a name="l00257"></a><span class="lineno"> 257</span>&#160; <a class="code" href="class_x_b_o_x_r_e_c_v.html#a5ff16bba78f05af3023f395a342b625c">XboxReceiverConnected</a> = <span class="keyword">false</span>;</div>
<div class="line"><a name="l00258"></a><span class="lineno"> 258</span>&#160; <span class="keywordflow">for</span> (uint8_t i = 0; i &lt; 4; i++)</div>
<div class="line"><a name="l00259"></a><span class="lineno"> 259</span>&#160; <a class="code" href="class_x_b_o_x_r_e_c_v.html#ac07faada38e159f1e7831d90863ebe3a">Xbox360Connected</a>[i] = 0x00;</div>
<div class="line"><a name="l00260"></a><span class="lineno"> 260</span>&#160; <a class="code" href="class_x_b_o_x_r_e_c_v.html#a53047c86c8c2f625916af62238d50fc8">pUsb</a>-&gt;<a class="code" href="class_u_s_b.html#a66ab8f5eda239e761d5a48741ea1f9d4">GetAddressPool</a>().<a class="code" href="class_address_pool.html#a15fde13223dcb1da89305ad229763562">FreeAddress</a>(<a class="code" href="class_x_b_o_x_r_e_c_v.html#a1d4bdb1b740c87fd51aca3969e67c730">bAddress</a>);</div>
<div class="line"><a name="l00261"></a><span class="lineno"> 261</span>&#160; <a class="code" href="class_x_b_o_x_r_e_c_v.html#a1d4bdb1b740c87fd51aca3969e67c730">bAddress</a> = 0;</div>
<div class="line"><a name="l00262"></a><span class="lineno"> 262</span>&#160; bPollEnable = <span class="keyword">false</span>;</div>
<div class="line"><a name="l00263"></a><span class="lineno"> 263</span>&#160; <span class="keywordflow">return</span> 0;</div>
<div class="line"><a name="l00264"></a><span class="lineno"> 264</span>&#160;}</div>
<div class="line"><a name="l00265"></a><span class="lineno"> 265</span>&#160;</div>
<div class="line"><a name="l00266"></a><span class="lineno"><a class="code" href="class_x_b_o_x_r_e_c_v.html#aafe1688ba3dc9b9ac425ebbbf001a1cc"> 266</a></span>&#160;uint8_t <a class="code" href="class_x_b_o_x_r_e_c_v.html#aafe1688ba3dc9b9ac425ebbbf001a1cc">XBOXRECV::Poll</a>() {</div>
<div class="line"><a name="l00267"></a><span class="lineno"> 267</span>&#160; <span class="keywordflow">if</span> (!bPollEnable)</div>
<div class="line"><a name="l00268"></a><span class="lineno"> 268</span>&#160; <span class="keywordflow">return</span> 0;</div>
<div class="line"><a name="l00269"></a><span class="lineno"> 269</span>&#160; <span class="keywordflow">if</span> (!timer || ((millis() - timer) &gt; 3000)) { <span class="comment">// Run checkStatus every 3 seconds</span></div>
<div class="line"><a name="l00270"></a><span class="lineno"> 270</span>&#160; timer = millis();</div>
<div class="line"><a name="l00271"></a><span class="lineno"> 271</span>&#160; checkStatus();</div>
<div class="line"><a name="l00272"></a><span class="lineno"> 272</span>&#160; }</div>
<div class="line"><a name="l00273"></a><span class="lineno"> 273</span>&#160; uint8_t inputPipe;</div>
<div class="line"><a name="l00274"></a><span class="lineno"> 274</span>&#160; uint16_t bufferSize;</div>
<div class="line"><a name="l00275"></a><span class="lineno"> 275</span>&#160; <span class="keywordflow">for</span> (uint8_t i = 0; i &lt; 4; i++) {</div>
<div class="line"><a name="l00276"></a><span class="lineno"> 276</span>&#160; <span class="keywordflow">switch</span> (i) {</div>
<div class="line"><a name="l00277"></a><span class="lineno"> 277</span>&#160; <span class="keywordflow">case</span> 0: inputPipe = <a class="code" href="_x_b_o_x_r_e_c_v_8h.html#a2824b25aa9a384c29f27a4e1bb443799">XBOX_INPUT_PIPE_1</a>;</div>
<div class="line"><a name="l00278"></a><span class="lineno"> 278</span>&#160; <span class="keywordflow">break</span>;</div>
<div class="line"><a name="l00279"></a><span class="lineno"> 279</span>&#160; <span class="keywordflow">case</span> 2: inputPipe = <a class="code" href="_x_b_o_x_r_e_c_v_8h.html#a86a3e5765d02bc043d5d1f674a7ffb0f">XBOX_INPUT_PIPE_3</a>;</div>
<div class="line"><a name="l00279"></a><span class="lineno"> 279</span>&#160; <span class="keywordflow">case</span> 1: inputPipe = <a class="code" href="_x_b_o_x_r_e_c_v_8h.html#aab6feb681a78b190190bcc081868a485">XBOX_INPUT_PIPE_2</a>;</div>
<div class="line"><a name="l00280"></a><span class="lineno"> 280</span>&#160; <span class="keywordflow">break</span>;</div>
<div class="line"><a name="l00281"></a><span class="lineno"> 281</span>&#160; <span class="keywordflow">case</span> 3: inputPipe = <a class="code" href="_x_b_o_x_r_e_c_v_8h.html#a5acfdaefe74aba1632c71acb79c49671">XBOX_INPUT_PIPE_4</a>;</div>
<div class="line"><a name="l00281"></a><span class="lineno"> 281</span>&#160; <span class="keywordflow">case</span> 2: inputPipe = <a class="code" href="_x_b_o_x_r_e_c_v_8h.html#a86a3e5765d02bc043d5d1f674a7ffb0f">XBOX_INPUT_PIPE_3</a>;</div>
<div class="line"><a name="l00282"></a><span class="lineno"> 282</span>&#160; <span class="keywordflow">break</span>;</div>
<div class="line"><a name="l00283"></a><span class="lineno"> 283</span>&#160; }</div>
<div class="line"><a name="l00284"></a><span class="lineno"> 284</span>&#160; bufferSize = <a class="code" href="_p_s3_u_s_b_8h.html#abcb805b13bfd36145e252b0633bbcfc0">EP_MAXPKTSIZE</a>; <span class="comment">// This is the maximum number of bytes we want to receive</span></div>
<div class="line"><a name="l00285"></a><span class="lineno"> 285</span>&#160; <a class="code" href="class_x_b_o_x_r_e_c_v.html#a53047c86c8c2f625916af62238d50fc8">pUsb</a>-&gt;<a class="code" href="class_u_s_b.html#ad75d64f648b102fab2bd75e53e1324a4">inTransfer</a>(<a class="code" href="class_x_b_o_x_r_e_c_v.html#a1d4bdb1b740c87fd51aca3969e67c730">bAddress</a>, <a class="code" href="class_x_b_o_x_r_e_c_v.html#af97c8d0efc945fa4ba1d120c8a5a9cbb">epInfo</a>[ inputPipe ].epAddr, &amp;bufferSize, readBuf);</div>
<div class="line"><a name="l00286"></a><span class="lineno"> 286</span>&#160; <span class="keywordflow">if</span> (bufferSize &gt; 0) { <span class="comment">// The number of received bytes</span></div>
<div class="line"><a name="l00287"></a><span class="lineno"> 287</span>&#160;<span class="preprocessor">#ifdef EXTRADEBUG</span></div>
<div class="line"><a name="l00288"></a><span class="lineno"> 288</span>&#160;<span class="preprocessor"></span> <a class="code" href="message_8h.html#a747819b0aa34f5c3ba0332c2db28c846">Notify</a>(PSTR(<span class="stringliteral">&quot;Bytes Received: &quot;</span>), 0x80);</div>
<div class="line"><a name="l00289"></a><span class="lineno"> 289</span>&#160; D_PrintHex&lt;uint16_t &gt; (bufferSize, 0x80);</div>
<div class="line"><a name="l00290"></a><span class="lineno"> 290</span>&#160; <a class="code" href="message_8h.html#a747819b0aa34f5c3ba0332c2db28c846">Notify</a>(PSTR(<span class="stringliteral">&quot;\r\n&quot;</span>), 0x80);</div>
<div class="line"><a name="l00291"></a><span class="lineno"> 291</span>&#160;<span class="preprocessor">#endif</span></div>
<div class="line"><a name="l00292"></a><span class="lineno"> 292</span>&#160;<span class="preprocessor"></span> readReport(i);</div>
<div class="line"><a name="l00293"></a><span class="lineno"> 293</span>&#160;<span class="preprocessor">#ifdef PRINTREPORT</span></div>
<div class="line"><a name="l00294"></a><span class="lineno"> 294</span>&#160;<span class="preprocessor"></span> printReport(i, bufferSize); <span class="comment">// Uncomment &quot;#define PRINTREPORT&quot; to print the report send by the Xbox 360 Controller</span></div>
<div class="line"><a name="l00295"></a><span class="lineno"> 295</span>&#160;<span class="preprocessor">#endif</span></div>
<div class="line"><a name="l00296"></a><span class="lineno"> 296</span>&#160;<span class="preprocessor"></span> }</div>
<div class="line"><a name="l00297"></a><span class="lineno"> 297</span>&#160; }</div>
<div class="line"><a name="l00298"></a><span class="lineno"> 298</span>&#160; <span class="keywordflow">return</span> 0;</div>
<div class="line"><a name="l00299"></a><span class="lineno"> 299</span>&#160;}</div>
<div class="line"><a name="l00300"></a><span class="lineno"> 300</span>&#160;</div>
<div class="line"><a name="l00301"></a><span class="lineno"> 301</span>&#160;<span class="keywordtype">void</span> XBOXRECV::readReport(uint8_t controller) {</div>
<div class="line"><a name="l00302"></a><span class="lineno"> 302</span>&#160; <span class="keywordflow">if</span> (readBuf == NULL)</div>
<div class="line"><a name="l00303"></a><span class="lineno"> 303</span>&#160; <span class="keywordflow">return</span>;</div>
<div class="line"><a name="l00304"></a><span class="lineno"> 304</span>&#160; <span class="comment">// This report is send when a controller is connected and disconnected</span></div>
<div class="line"><a name="l00305"></a><span class="lineno"> 305</span>&#160; <span class="keywordflow">if</span> (readBuf[0] == 0x08 &amp;&amp; readBuf[1] != <a class="code" href="class_x_b_o_x_r_e_c_v.html#ac07faada38e159f1e7831d90863ebe3a">Xbox360Connected</a>[controller]) {</div>
<div class="line"><a name="l00306"></a><span class="lineno"> 306</span>&#160; <a class="code" href="class_x_b_o_x_r_e_c_v.html#ac07faada38e159f1e7831d90863ebe3a">Xbox360Connected</a>[controller] = readBuf[1];</div>
<div class="line"><a name="l00307"></a><span class="lineno"> 307</span>&#160;<span class="preprocessor">#ifdef DEBUG_USB_HOST</span></div>
<div class="line"><a name="l00308"></a><span class="lineno"> 308</span>&#160;<span class="preprocessor"></span> <a class="code" href="message_8h.html#a747819b0aa34f5c3ba0332c2db28c846">Notify</a>(PSTR(<span class="stringliteral">&quot;Controller &quot;</span>), 0x80);</div>
<div class="line"><a name="l00309"></a><span class="lineno"> 309</span>&#160; <a class="code" href="message_8h.html#a747819b0aa34f5c3ba0332c2db28c846">Notify</a>(controller, 0x80);</div>
<div class="line"><a name="l00310"></a><span class="lineno"> 310</span>&#160;<span class="preprocessor">#endif</span></div>
<div class="line"><a name="l00311"></a><span class="lineno"> 311</span>&#160;<span class="preprocessor"></span> <span class="keywordflow">if</span> (<a class="code" href="class_x_b_o_x_r_e_c_v.html#ac07faada38e159f1e7831d90863ebe3a">Xbox360Connected</a>[controller]) {</div>
<div class="line"><a name="l00312"></a><span class="lineno"> 312</span>&#160;<span class="preprocessor">#ifdef DEBUG_USB_HOST</span></div>
<div class="line"><a name="l00313"></a><span class="lineno"> 313</span>&#160;<span class="preprocessor"></span> <span class="keywordtype">char</span>* str = 0;</div>
<div class="line"><a name="l00314"></a><span class="lineno"> 314</span>&#160; <span class="keywordflow">switch</span> (readBuf[1]) {</div>
<div class="line"><a name="l00315"></a><span class="lineno"> 315</span>&#160; <span class="keywordflow">case</span> 0x80: str = PSTR(<span class="stringliteral">&quot; as controller\r\n&quot;</span>);</div>
<div class="line"><a name="l00316"></a><span class="lineno"> 316</span>&#160; <span class="keywordflow">break</span>;</div>
<div class="line"><a name="l00317"></a><span class="lineno"> 317</span>&#160; <span class="keywordflow">case</span> 0x40: str = PSTR(<span class="stringliteral">&quot; as headset\r\n&quot;</span>);</div>
<div class="line"><a name="l00283"></a><span class="lineno"> 283</span>&#160; <span class="keywordflow">case</span> 3: inputPipe = <a class="code" href="_x_b_o_x_r_e_c_v_8h.html#a5acfdaefe74aba1632c71acb79c49671">XBOX_INPUT_PIPE_4</a>;</div>
<div class="line"><a name="l00284"></a><span class="lineno"> 284</span>&#160; <span class="keywordflow">break</span>;</div>
<div class="line"><a name="l00285"></a><span class="lineno"> 285</span>&#160; }</div>
<div class="line"><a name="l00286"></a><span class="lineno"> 286</span>&#160; bufferSize = <a class="code" href="_p_s3_u_s_b_8h.html#abcb805b13bfd36145e252b0633bbcfc0">EP_MAXPKTSIZE</a>; <span class="comment">// This is the maximum number of bytes we want to receive</span></div>
<div class="line"><a name="l00287"></a><span class="lineno"> 287</span>&#160; <a class="code" href="class_x_b_o_x_r_e_c_v.html#a53047c86c8c2f625916af62238d50fc8">pUsb</a>-&gt;<a class="code" href="class_u_s_b.html#ad75d64f648b102fab2bd75e53e1324a4">inTransfer</a>(<a class="code" href="class_x_b_o_x_r_e_c_v.html#a1d4bdb1b740c87fd51aca3969e67c730">bAddress</a>, <a class="code" href="class_x_b_o_x_r_e_c_v.html#af97c8d0efc945fa4ba1d120c8a5a9cbb">epInfo</a>[ inputPipe ].epAddr, &amp;bufferSize, readBuf);</div>
<div class="line"><a name="l00288"></a><span class="lineno"> 288</span>&#160; <span class="keywordflow">if</span> (bufferSize &gt; 0) { <span class="comment">// The number of received bytes</span></div>
<div class="line"><a name="l00289"></a><span class="lineno"> 289</span>&#160;<span class="preprocessor">#ifdef EXTRADEBUG</span></div>
<div class="line"><a name="l00290"></a><span class="lineno"> 290</span>&#160;<span class="preprocessor"></span> <a class="code" href="message_8h.html#a27117e124c5d66d5512fe8d494fe6338">Notify</a>(PSTR(<span class="stringliteral">&quot;Bytes Received: &quot;</span>), 0x80);</div>
<div class="line"><a name="l00291"></a><span class="lineno"> 291</span>&#160; D_PrintHex&lt;uint16_t &gt; (bufferSize, 0x80);</div>
<div class="line"><a name="l00292"></a><span class="lineno"> 292</span>&#160; <a class="code" href="message_8h.html#a27117e124c5d66d5512fe8d494fe6338">Notify</a>(PSTR(<span class="stringliteral">&quot;\r\n&quot;</span>), 0x80);</div>
<div class="line"><a name="l00293"></a><span class="lineno"> 293</span>&#160;<span class="preprocessor">#endif</span></div>
<div class="line"><a name="l00294"></a><span class="lineno"> 294</span>&#160;<span class="preprocessor"></span> readReport(i);</div>
<div class="line"><a name="l00295"></a><span class="lineno"> 295</span>&#160;<span class="preprocessor">#ifdef PRINTREPORT</span></div>
<div class="line"><a name="l00296"></a><span class="lineno"> 296</span>&#160;<span class="preprocessor"></span> printReport(i, bufferSize); <span class="comment">// Uncomment &quot;#define PRINTREPORT&quot; to print the report send by the Xbox 360 Controller</span></div>
<div class="line"><a name="l00297"></a><span class="lineno"> 297</span>&#160;<span class="preprocessor">#endif</span></div>
<div class="line"><a name="l00298"></a><span class="lineno"> 298</span>&#160;<span class="preprocessor"></span> }</div>
<div class="line"><a name="l00299"></a><span class="lineno"> 299</span>&#160; }</div>
<div class="line"><a name="l00300"></a><span class="lineno"> 300</span>&#160; <span class="keywordflow">return</span> 0;</div>
<div class="line"><a name="l00301"></a><span class="lineno"> 301</span>&#160;}</div>
<div class="line"><a name="l00302"></a><span class="lineno"> 302</span>&#160;</div>
<div class="line"><a name="l00303"></a><span class="lineno"> 303</span>&#160;<span class="keywordtype">void</span> XBOXRECV::readReport(uint8_t controller) {</div>
<div class="line"><a name="l00304"></a><span class="lineno"> 304</span>&#160; <span class="keywordflow">if</span> (readBuf == NULL)</div>
<div class="line"><a name="l00305"></a><span class="lineno"> 305</span>&#160; <span class="keywordflow">return</span>;</div>
<div class="line"><a name="l00306"></a><span class="lineno"> 306</span>&#160; <span class="comment">// This report is send when a controller is connected and disconnected</span></div>
<div class="line"><a name="l00307"></a><span class="lineno"> 307</span>&#160; <span class="keywordflow">if</span> (readBuf[0] == 0x08 &amp;&amp; readBuf[1] != <a class="code" href="class_x_b_o_x_r_e_c_v.html#ac07faada38e159f1e7831d90863ebe3a">Xbox360Connected</a>[controller]) {</div>
<div class="line"><a name="l00308"></a><span class="lineno"> 308</span>&#160; <a class="code" href="class_x_b_o_x_r_e_c_v.html#ac07faada38e159f1e7831d90863ebe3a">Xbox360Connected</a>[controller] = readBuf[1];</div>
<div class="line"><a name="l00309"></a><span class="lineno"> 309</span>&#160;<span class="preprocessor">#ifdef DEBUG_USB_HOST</span></div>
<div class="line"><a name="l00310"></a><span class="lineno"> 310</span>&#160;<span class="preprocessor"></span> <a class="code" href="message_8h.html#a27117e124c5d66d5512fe8d494fe6338">Notify</a>(PSTR(<span class="stringliteral">&quot;Controller &quot;</span>), 0x80);</div>
<div class="line"><a name="l00311"></a><span class="lineno"> 311</span>&#160; <a class="code" href="message_8h.html#a27117e124c5d66d5512fe8d494fe6338">Notify</a>(controller, 0x80);</div>
<div class="line"><a name="l00312"></a><span class="lineno"> 312</span>&#160;<span class="preprocessor">#endif</span></div>
<div class="line"><a name="l00313"></a><span class="lineno"> 313</span>&#160;<span class="preprocessor"></span> <span class="keywordflow">if</span> (<a class="code" href="class_x_b_o_x_r_e_c_v.html#ac07faada38e159f1e7831d90863ebe3a">Xbox360Connected</a>[controller]) {</div>
<div class="line"><a name="l00314"></a><span class="lineno"> 314</span>&#160;<span class="preprocessor">#ifdef DEBUG_USB_HOST</span></div>
<div class="line"><a name="l00315"></a><span class="lineno"> 315</span>&#160;<span class="preprocessor"></span> <span class="keyword">const</span> <span class="keywordtype">char</span>* str = 0;</div>
<div class="line"><a name="l00316"></a><span class="lineno"> 316</span>&#160; <span class="keywordflow">switch</span> (readBuf[1]) {</div>
<div class="line"><a name="l00317"></a><span class="lineno"> 317</span>&#160; <span class="keywordflow">case</span> 0x80: str = PSTR(<span class="stringliteral">&quot; as controller\r\n&quot;</span>);</div>
<div class="line"><a name="l00318"></a><span class="lineno"> 318</span>&#160; <span class="keywordflow">break</span>;</div>
<div class="line"><a name="l00319"></a><span class="lineno"> 319</span>&#160; <span class="keywordflow">case</span> 0xC0: str = PSTR(<span class="stringliteral">&quot; as controller+headset\r\n&quot;</span>);</div>
<div class="line"><a name="l00319"></a><span class="lineno"> 319</span>&#160; <span class="keywordflow">case</span> 0x40: str = PSTR(<span class="stringliteral">&quot; as headset\r\n&quot;</span>);</div>
<div class="line"><a name="l00320"></a><span class="lineno"> 320</span>&#160; <span class="keywordflow">break</span>;</div>
<div class="line"><a name="l00321"></a><span class="lineno"> 321</span>&#160; }</div>
<div class="line"><a name="l00322"></a><span class="lineno"> 322</span>&#160; <a class="code" href="message_8h.html#a747819b0aa34f5c3ba0332c2db28c846">Notify</a>(PSTR(<span class="stringliteral">&quot;: connected&quot;</span>), 0x80);</div>
<div class="line"><a name="l00323"></a><span class="lineno"> 323</span>&#160; <a class="code" href="message_8h.html#a747819b0aa34f5c3ba0332c2db28c846">Notify</a>(str, 0x80);</div>
<div class="line"><a name="l00324"></a><span class="lineno"> 324</span>&#160;<span class="preprocessor">#endif</span></div>
<div class="line"><a name="l00325"></a><span class="lineno"> 325</span>&#160;<span class="preprocessor"></span> <a class="code" href="controller_enums_8h.html#aadcb6002d2b42fdfe01490f730ab00a6">LED</a> led;</div>
<div class="line"><a name="l00326"></a><span class="lineno"> 326</span>&#160; <span class="keywordflow">switch</span> (controller) {</div>
<div class="line"><a name="l00327"></a><span class="lineno"> 327</span>&#160; <span class="keywordflow">case</span> 0: led = <a class="code" href="controller_enums_8h.html#aadcb6002d2b42fdfe01490f730ab00a6adac6477842247cab1a8c02c65f431b44">LED1</a>;</div>
<div class="line"><a name="l00328"></a><span class="lineno"> 328</span>&#160; <span class="keywordflow">break</span>;</div>
<div class="line"><a name="l00329"></a><span class="lineno"> 329</span>&#160; <span class="keywordflow">case</span> 1: led = <a class="code" href="controller_enums_8h.html#aadcb6002d2b42fdfe01490f730ab00a6a8379bbaa96d151e6adac488b2a147b7a">LED2</a>;</div>
<div class="line"><a name="l00330"></a><span class="lineno"> 330</span>&#160; <span class="keywordflow">break</span>;</div>
<div class="line"><a name="l00331"></a><span class="lineno"> 331</span>&#160; <span class="keywordflow">case</span> 2: led = <a class="code" href="controller_enums_8h.html#aadcb6002d2b42fdfe01490f730ab00a6a5dec293e081e0fc78369c842fab8452b">LED3</a>;</div>
<div class="line"><a name="l00332"></a><span class="lineno"> 332</span>&#160; <span class="keywordflow">break</span>;</div>
<div class="line"><a name="l00333"></a><span class="lineno"> 333</span>&#160; <span class="keywordflow">case</span> 3: led = <a class="code" href="controller_enums_8h.html#aadcb6002d2b42fdfe01490f730ab00a6ad60e39b8d1701d30aa64f80343217342">LED4</a>;</div>
<div class="line"><a name="l00334"></a><span class="lineno"> 334</span>&#160; <span class="keywordflow">break</span>;</div>
<div class="line"><a name="l00335"></a><span class="lineno"> 335</span>&#160; }</div>
<div class="line"><a name="l00336"></a><span class="lineno"> 336</span>&#160; <a class="code" href="class_x_b_o_x_r_e_c_v.html#a4ab056654c97c054aebb683cac95e21b">setLedOn</a>(led, controller);</div>
<div class="line"><a name="l00337"></a><span class="lineno"> 337</span>&#160; }</div>
<div class="line"><a name="l00338"></a><span class="lineno"> 338</span>&#160;<span class="preprocessor">#ifdef DEBUG_USB_HOST</span></div>
<div class="line"><a name="l00339"></a><span class="lineno"> 339</span>&#160;<span class="preprocessor"></span> <span class="keywordflow">else</span></div>
<div class="line"><a name="l00340"></a><span class="lineno"> 340</span>&#160; <a class="code" href="message_8h.html#a747819b0aa34f5c3ba0332c2db28c846">Notify</a>(PSTR(<span class="stringliteral">&quot;: disconnected\r\n&quot;</span>), 0x80);</div>
<div class="line"><a name="l00341"></a><span class="lineno"> 341</span>&#160;<span class="preprocessor">#endif</span></div>
<div class="line"><a name="l00342"></a><span class="lineno"> 342</span>&#160;<span class="preprocessor"></span> <span class="keywordflow">return</span>;</div>
<div class="line"><a name="l00343"></a><span class="lineno"> 343</span>&#160; }</div>
<div class="line"><a name="l00344"></a><span class="lineno"> 344</span>&#160; <span class="comment">// Controller status report</span></div>
<div class="line"><a name="l00345"></a><span class="lineno"> 345</span>&#160; <span class="keywordflow">if</span> (readBuf[1] == 0x00 &amp;&amp; readBuf[3] &amp; 0x13 &amp;&amp; readBuf[4] &gt;= 0x22) {</div>
<div class="line"><a name="l00346"></a><span class="lineno"> 346</span>&#160; controllerStatus[controller] = ((uint16_t)readBuf[3] &lt;&lt; 8) | readBuf[4];</div>
<div class="line"><a name="l00347"></a><span class="lineno"> 347</span>&#160; <span class="keywordflow">return</span>;</div>
<div class="line"><a name="l00348"></a><span class="lineno"> 348</span>&#160; }</div>
<div class="line"><a name="l00349"></a><span class="lineno"> 349</span>&#160; <span class="keywordflow">if</span> (readBuf[1] != 0x01) <span class="comment">// Check if it&#39;s the correct report - the receiver also sends different status reports</span></div>
<div class="line"><a name="l00350"></a><span class="lineno"> 350</span>&#160; <span class="keywordflow">return</span>;</div>
<div class="line"><a name="l00351"></a><span class="lineno"> 351</span>&#160;</div>
<div class="line"><a name="l00352"></a><span class="lineno"> 352</span>&#160; <span class="comment">// A controller must be connected if it&#39;s sending data</span></div>
<div class="line"><a name="l00353"></a><span class="lineno"> 353</span>&#160; <span class="keywordflow">if</span> (!<a class="code" href="class_x_b_o_x_r_e_c_v.html#ac07faada38e159f1e7831d90863ebe3a">Xbox360Connected</a>[controller])</div>
<div class="line"><a name="l00354"></a><span class="lineno"> 354</span>&#160; <a class="code" href="class_x_b_o_x_r_e_c_v.html#ac07faada38e159f1e7831d90863ebe3a">Xbox360Connected</a>[controller] |= 0x80;</div>
<div class="line"><a name="l00355"></a><span class="lineno"> 355</span>&#160;</div>
<div class="line"><a name="l00356"></a><span class="lineno"> 356</span>&#160; ButtonState[controller] = (uint32_t)(readBuf[9] | ((uint16_t)readBuf[8] &lt;&lt; 8) | ((uint32_t)readBuf[7] &lt;&lt; 16) | ((uint32_t)readBuf[6] &lt;&lt; 24));</div>
<div class="line"><a name="l00357"></a><span class="lineno"> 357</span>&#160;</div>
<div class="line"><a name="l00358"></a><span class="lineno"> 358</span>&#160; hatValue[controller][<a class="code" href="controller_enums_8h.html#aaaabdefc068fd57ec2bef2b62ea4ba92a383cb8895dd296b7f69ce845ed16b0ca">LeftHatX</a>] = (int16_t)(((uint16_t)readBuf[11] &lt;&lt; 8) | readBuf[10]);</div>
<div class="line"><a name="l00359"></a><span class="lineno"> 359</span>&#160; hatValue[controller][<a class="code" href="controller_enums_8h.html#aaaabdefc068fd57ec2bef2b62ea4ba92af3f3925efa9762c4e9e71ac7da7a94a3">LeftHatY</a>] = (int16_t)(((uint16_t)readBuf[13] &lt;&lt; 8) | readBuf[12]);</div>
<div class="line"><a name="l00360"></a><span class="lineno"> 360</span>&#160; hatValue[controller][<a class="code" href="controller_enums_8h.html#aaaabdefc068fd57ec2bef2b62ea4ba92aaeb027a0ae5bbc6ba25e1c78a6486c7b">RightHatX</a>] = (int16_t)(((uint16_t)readBuf[15] &lt;&lt; 8) | readBuf[14]);</div>
<div class="line"><a name="l00361"></a><span class="lineno"> 361</span>&#160; hatValue[controller][<a class="code" href="controller_enums_8h.html#aaaabdefc068fd57ec2bef2b62ea4ba92a7f1fb2db5381286691f4dec179ed5d5a">RightHatY</a>] = (int16_t)(((uint16_t)readBuf[17] &lt;&lt; 8) | readBuf[16]);</div>
<div class="line"><a name="l00362"></a><span class="lineno"> 362</span>&#160;</div>
<div class="line"><a name="l00363"></a><span class="lineno"> 363</span>&#160; <span class="comment">//Notify(PSTR(&quot;\r\nButtonState: &quot;), 0x80);</span></div>
<div class="line"><a name="l00364"></a><span class="lineno"> 364</span>&#160; <span class="comment">//PrintHex&lt;uint32_t&gt;(ButtonState[controller], 0x80);</span></div>
<div class="line"><a name="l00365"></a><span class="lineno"> 365</span>&#160;</div>
<div class="line"><a name="l00366"></a><span class="lineno"> 366</span>&#160; <span class="keywordflow">if</span> (ButtonState[controller] != OldButtonState[controller]) {</div>
<div class="line"><a name="l00367"></a><span class="lineno"> 367</span>&#160; buttonStateChanged[controller] = <span class="keyword">true</span>;</div>
<div class="line"><a name="l00368"></a><span class="lineno"> 368</span>&#160; ButtonClickState[controller] = (ButtonState[controller] &gt;&gt; 16) &amp; ((~OldButtonState[controller]) &gt;&gt; 16); <span class="comment">// Update click state variable, but don&#39;t include the two trigger buttons L2 and R2</span></div>
<div class="line"><a name="l00369"></a><span class="lineno"> 369</span>&#160; <span class="keywordflow">if</span> (((uint8_t)OldButtonState[controller]) == 0 &amp;&amp; ((uint8_t)ButtonState[controller]) != 0) <span class="comment">// The L2 and R2 buttons are special as they are analog buttons</span></div>
<div class="line"><a name="l00370"></a><span class="lineno"> 370</span>&#160; R2Clicked[controller] = <span class="keyword">true</span>;</div>
<div class="line"><a name="l00371"></a><span class="lineno"> 371</span>&#160; <span class="keywordflow">if</span> ((uint8_t)(OldButtonState[controller] &gt;&gt; 8) == 0 &amp;&amp; (uint8_t)(ButtonState[controller] &gt;&gt; 8) != 0)</div>
<div class="line"><a name="l00372"></a><span class="lineno"> 372</span>&#160; L2Clicked[controller] = <span class="keyword">true</span>;</div>
<div class="line"><a name="l00373"></a><span class="lineno"> 373</span>&#160; OldButtonState[controller] = ButtonState[controller];</div>
<div class="line"><a name="l00374"></a><span class="lineno"> 374</span>&#160; }</div>
<div class="line"><a name="l00375"></a><span class="lineno"> 375</span>&#160;}</div>
<div class="line"><a name="l00376"></a><span class="lineno"> 376</span>&#160;</div>
<div class="line"><a name="l00377"></a><span class="lineno"> 377</span>&#160;<span class="keywordtype">void</span> XBOXRECV::printReport(uint8_t controller, uint8_t nBytes) { <span class="comment">//Uncomment &quot;#define PRINTREPORT&quot; to print the report send by the Xbox 360 Controller</span></div>
<div class="line"><a name="l00378"></a><span class="lineno"> 378</span>&#160;<span class="preprocessor">#ifdef PRINTREPORT</span></div>
<div class="line"><a name="l00379"></a><span class="lineno"> 379</span>&#160;<span class="preprocessor"></span> <span class="keywordflow">if</span> (readBuf == NULL)</div>
<div class="line"><a name="l00380"></a><span class="lineno"> 380</span>&#160; <span class="keywordflow">return</span>;</div>
<div class="line"><a name="l00381"></a><span class="lineno"> 381</span>&#160; <a class="code" href="message_8h.html#a747819b0aa34f5c3ba0332c2db28c846">Notify</a>(PSTR(<span class="stringliteral">&quot;Controller &quot;</span>), 0x80);</div>
<div class="line"><a name="l00382"></a><span class="lineno"> 382</span>&#160; <a class="code" href="message_8h.html#a747819b0aa34f5c3ba0332c2db28c846">Notify</a>(controller, 0x80);</div>
<div class="line"><a name="l00383"></a><span class="lineno"> 383</span>&#160; <a class="code" href="message_8h.html#a747819b0aa34f5c3ba0332c2db28c846">Notify</a>(PSTR(<span class="stringliteral">&quot;: &quot;</span>), 0x80);</div>
<div class="line"><a name="l00384"></a><span class="lineno"> 384</span>&#160; <span class="keywordflow">for</span> (uint8_t i = 0; i &lt; nBytes; i++) {</div>
<div class="line"><a name="l00385"></a><span class="lineno"> 385</span>&#160; D_PrintHex&lt;uint8_t &gt; (readBuf[i], 0x80);</div>
<div class="line"><a name="l00386"></a><span class="lineno"> 386</span>&#160; <a class="code" href="message_8h.html#a747819b0aa34f5c3ba0332c2db28c846">Notify</a>(PSTR(<span class="stringliteral">&quot; &quot;</span>), 0x80);</div>
<div class="line"><a name="l00387"></a><span class="lineno"> 387</span>&#160; }</div>
<div class="line"><a name="l00388"></a><span class="lineno"> 388</span>&#160; <a class="code" href="message_8h.html#a747819b0aa34f5c3ba0332c2db28c846">Notify</a>(PSTR(<span class="stringliteral">&quot;\r\n&quot;</span>), 0x80);</div>
<div class="line"><a name="l00389"></a><span class="lineno"> 389</span>&#160;<span class="preprocessor">#endif</span></div>
<div class="line"><a name="l00390"></a><span class="lineno"> 390</span>&#160;<span class="preprocessor"></span>}</div>
<div class="line"><a name="l00391"></a><span class="lineno"> 391</span>&#160;</div>
<div class="line"><a name="l00392"></a><span class="lineno"><a class="code" href="class_x_b_o_x_r_e_c_v.html#a14f355acaf2cfad072c0c7c139a3e1b2"> 392</a></span>&#160;uint8_t <a class="code" href="class_x_b_o_x_r_e_c_v.html#a14f355acaf2cfad072c0c7c139a3e1b2">XBOXRECV::getButtonPress</a>(<a class="code" href="controller_enums_8h.html#a03bfec859eac87be20f8952c1eb89de0">Button</a> b, uint8_t controller) {</div>
<div class="line"><a name="l00393"></a><span class="lineno"> 393</span>&#160; <span class="keywordflow">if</span> (b == <a class="code" href="controller_enums_8h.html#a03bfec859eac87be20f8952c1eb89de0a0adffb24dae0c41be5b803f4d444f066">L2</a>) <span class="comment">// These are analog buttons</span></div>
<div class="line"><a name="l00394"></a><span class="lineno"> 394</span>&#160; <span class="keywordflow">return</span> (uint8_t)(ButtonState[controller] &gt;&gt; 8);</div>
<div class="line"><a name="l00395"></a><span class="lineno"> 395</span>&#160; <span class="keywordflow">else</span> <span class="keywordflow">if</span> (b == <a class="code" href="controller_enums_8h.html#a03bfec859eac87be20f8952c1eb89de0a629d7b403cea5f826352f3aefb9a6d6a">R2</a>)</div>
<div class="line"><a name="l00396"></a><span class="lineno"> 396</span>&#160; <span class="keywordflow">return</span> (uint8_t)ButtonState[controller];</div>
<div class="line"><a name="l00397"></a><span class="lineno"> 397</span>&#160; <span class="keywordflow">return</span> (<span class="keywordtype">bool</span>)(ButtonState[controller] &amp; ((uint32_t)pgm_read_word(&amp;<a class="code" href="xbox_enums_8h.html#a7e55826e75b9b88578c8b0edaaf523d7">XBOXBUTTONS</a>[(uint8_t)b]) &lt;&lt; 16));</div>
<div class="line"><a name="l00398"></a><span class="lineno"> 398</span>&#160;}</div>
<div class="line"><a name="l00399"></a><span class="lineno"> 399</span>&#160;</div>
<div class="line"><a name="l00400"></a><span class="lineno"><a class="code" href="class_x_b_o_x_r_e_c_v.html#a163310ab5d09b8192bebf57b4db9131f"> 400</a></span>&#160;<span class="keywordtype">bool</span> <a class="code" href="class_x_b_o_x_r_e_c_v.html#a163310ab5d09b8192bebf57b4db9131f">XBOXRECV::getButtonClick</a>(<a class="code" href="controller_enums_8h.html#a03bfec859eac87be20f8952c1eb89de0">Button</a> b, uint8_t controller) {</div>
<div class="line"><a name="l00401"></a><span class="lineno"> 401</span>&#160; <span class="keywordflow">if</span> (b == <a class="code" href="controller_enums_8h.html#a03bfec859eac87be20f8952c1eb89de0a0adffb24dae0c41be5b803f4d444f066">L2</a>) {</div>
<div class="line"><a name="l00402"></a><span class="lineno"> 402</span>&#160; <span class="keywordflow">if</span> (L2Clicked[controller]) {</div>
<div class="line"><a name="l00403"></a><span class="lineno"> 403</span>&#160; L2Clicked[controller] = <span class="keyword">false</span>;</div>
<div class="line"><a name="l00404"></a><span class="lineno"> 404</span>&#160; <span class="keywordflow">return</span> <span class="keyword">true</span>;</div>
<div class="line"><a name="l00405"></a><span class="lineno"> 405</span>&#160; }</div>
<div class="line"><a name="l00406"></a><span class="lineno"> 406</span>&#160; <span class="keywordflow">return</span> <span class="keyword">false</span>;</div>
<div class="line"><a name="l00407"></a><span class="lineno"> 407</span>&#160; } <span class="keywordflow">else</span> <span class="keywordflow">if</span> (b == <a class="code" href="controller_enums_8h.html#a03bfec859eac87be20f8952c1eb89de0a629d7b403cea5f826352f3aefb9a6d6a">R2</a>) {</div>
<div class="line"><a name="l00408"></a><span class="lineno"> 408</span>&#160; <span class="keywordflow">if</span> (R2Clicked[controller]) {</div>
<div class="line"><a name="l00409"></a><span class="lineno"> 409</span>&#160; R2Clicked[controller] = <span class="keyword">false</span>;</div>
<div class="line"><a name="l00410"></a><span class="lineno"> 410</span>&#160; <span class="keywordflow">return</span> <span class="keyword">true</span>;</div>
<div class="line"><a name="l00411"></a><span class="lineno"> 411</span>&#160; }</div>
<div class="line"><a name="l00412"></a><span class="lineno"> 412</span>&#160; <span class="keywordflow">return</span> <span class="keyword">false</span>;</div>
<div class="line"><a name="l00413"></a><span class="lineno"> 413</span>&#160; }</div>
<div class="line"><a name="l00414"></a><span class="lineno"> 414</span>&#160; uint16_t button = pgm_read_word(&amp;<a class="code" href="xbox_enums_8h.html#a7e55826e75b9b88578c8b0edaaf523d7">XBOXBUTTONS</a>[(uint8_t)b]);</div>
<div class="line"><a name="l00415"></a><span class="lineno"> 415</span>&#160; <span class="keywordtype">bool</span> click = (ButtonClickState[controller] &amp; button);</div>
<div class="line"><a name="l00416"></a><span class="lineno"> 416</span>&#160; ButtonClickState[controller] &amp;= ~button; <span class="comment">// clear &quot;click&quot; event</span></div>
<div class="line"><a name="l00417"></a><span class="lineno"> 417</span>&#160; <span class="keywordflow">return</span> click;</div>
<div class="line"><a name="l00418"></a><span class="lineno"> 418</span>&#160;}</div>
<div class="line"><a name="l00419"></a><span class="lineno"> 419</span>&#160;</div>
<div class="line"><a name="l00420"></a><span class="lineno"><a class="code" href="class_x_b_o_x_r_e_c_v.html#aef2c97b6f1d6eba631477f2d6c9f6de5"> 420</a></span>&#160;int16_t <a class="code" href="class_x_b_o_x_r_e_c_v.html#aef2c97b6f1d6eba631477f2d6c9f6de5">XBOXRECV::getAnalogHat</a>(<a class="code" href="controller_enums_8h.html#aaaabdefc068fd57ec2bef2b62ea4ba92">AnalogHat</a> a, uint8_t controller) {</div>
<div class="line"><a name="l00421"></a><span class="lineno"> 421</span>&#160; <span class="keywordflow">return</span> hatValue[controller][a];</div>
<div class="line"><a name="l00422"></a><span class="lineno"> 422</span>&#160;}</div>
<div class="line"><a name="l00423"></a><span class="lineno"> 423</span>&#160;</div>
<div class="line"><a name="l00424"></a><span class="lineno"><a class="code" href="class_x_b_o_x_r_e_c_v.html#ae78ddfff307d26b0ed35dfb75173adf7"> 424</a></span>&#160;<span class="keywordtype">bool</span> <a class="code" href="class_x_b_o_x_r_e_c_v.html#ae78ddfff307d26b0ed35dfb75173adf7">XBOXRECV::buttonChanged</a>(uint8_t controller) {</div>
<div class="line"><a name="l00425"></a><span class="lineno"> 425</span>&#160; <span class="keywordtype">bool</span> state = buttonStateChanged[controller];</div>
<div class="line"><a name="l00426"></a><span class="lineno"> 426</span>&#160; buttonStateChanged[controller] = <span class="keyword">false</span>;</div>
<div class="line"><a name="l00427"></a><span class="lineno"> 427</span>&#160; <span class="keywordflow">return</span> state;</div>
<div class="line"><a name="l00428"></a><span class="lineno"> 428</span>&#160;}</div>
<div class="line"><a name="l00429"></a><span class="lineno"> 429</span>&#160;</div>
<div class="line"><a name="l00430"></a><span class="lineno"> 430</span>&#160;<span class="comment">/*</span></div>
<div class="line"><a name="l00431"></a><span class="lineno"> 431</span>&#160;<span class="comment">ControllerStatus Breakdown</span></div>
<div class="line"><a name="l00432"></a><span class="lineno"> 432</span>&#160;<span class="comment"> ControllerStatus[controller] &amp; 0x0001 // 0</span></div>
<div class="line"><a name="l00433"></a><span class="lineno"> 433</span>&#160;<span class="comment"> ControllerStatus[controller] &amp; 0x0002 // normal batteries, no rechargeable battery pack</span></div>
<div class="line"><a name="l00434"></a><span class="lineno"> 434</span>&#160;<span class="comment"> ControllerStatus[controller] &amp; 0x0004 // controller starting up / settling</span></div>
<div class="line"><a name="l00435"></a><span class="lineno"> 435</span>&#160;<span class="comment"> ControllerStatus[controller] &amp; 0x0008 // headset adapter plugged in, but no headphones connected (mute?)</span></div>
<div class="line"><a name="l00436"></a><span class="lineno"> 436</span>&#160;<span class="comment"> ControllerStatus[controller] &amp; 0x0010 // 0</span></div>
<div class="line"><a name="l00437"></a><span class="lineno"> 437</span>&#160;<span class="comment"> ControllerStatus[controller] &amp; 0x0020 // 1</span></div>
<div class="line"><a name="l00438"></a><span class="lineno"> 438</span>&#160;<span class="comment"> ControllerStatus[controller] &amp; 0x0040 // battery level (high bit)</span></div>
<div class="line"><a name="l00439"></a><span class="lineno"> 439</span>&#160;<span class="comment"> ControllerStatus[controller] &amp; 0x0080 // battery level (low bit)</span></div>
<div class="line"><a name="l00440"></a><span class="lineno"> 440</span>&#160;<span class="comment"> ControllerStatus[controller] &amp; 0x0100 // 1</span></div>
<div class="line"><a name="l00441"></a><span class="lineno"> 441</span>&#160;<span class="comment"> ControllerStatus[controller] &amp; 0x0200 // 1</span></div>
<div class="line"><a name="l00442"></a><span class="lineno"> 442</span>&#160;<span class="comment"> ControllerStatus[controller] &amp; 0x0400 // headset adapter plugged in</span></div>
<div class="line"><a name="l00443"></a><span class="lineno"> 443</span>&#160;<span class="comment"> ControllerStatus[controller] &amp; 0x0800 // 0</span></div>
<div class="line"><a name="l00444"></a><span class="lineno"> 444</span>&#160;<span class="comment"> ControllerStatus[controller] &amp; 0x1000 // 1</span></div>
<div class="line"><a name="l00445"></a><span class="lineno"> 445</span>&#160;<span class="comment"> ControllerStatus[controller] &amp; 0x2000 // 0</span></div>
<div class="line"><a name="l00446"></a><span class="lineno"> 446</span>&#160;<span class="comment"> ControllerStatus[controller] &amp; 0x4000 // 0</span></div>
<div class="line"><a name="l00447"></a><span class="lineno"> 447</span>&#160;<span class="comment"> ControllerStatus[controller] &amp; 0x8000 // 0</span></div>
<div class="line"><a name="l00448"></a><span class="lineno"> 448</span>&#160;<span class="comment"> */</span></div>
<div class="line"><a name="l00449"></a><span class="lineno"><a class="code" href="class_x_b_o_x_r_e_c_v.html#aaa7a0d0861b8303a4b1654684d185b4f"> 449</a></span>&#160;uint8_t <a class="code" href="class_x_b_o_x_r_e_c_v.html#aaa7a0d0861b8303a4b1654684d185b4f">XBOXRECV::getBatteryLevel</a>(uint8_t controller) {</div>
<div class="line"><a name="l00450"></a><span class="lineno"> 450</span>&#160; <span class="keywordflow">return</span> ((controllerStatus[controller] &amp; 0x00C0) &gt;&gt; 6);</div>
<div class="line"><a name="l00451"></a><span class="lineno"> 451</span>&#160;}</div>
<div class="line"><a name="l00452"></a><span class="lineno"> 452</span>&#160;</div>
<div class="line"><a name="l00453"></a><span class="lineno"> 453</span>&#160;<span class="keywordtype">void</span> XBOXRECV::XboxCommand(uint8_t controller, uint8_t* data, uint16_t nbytes) {</div>
<div class="line"><a name="l00454"></a><span class="lineno"> 454</span>&#160; uint8_t rcode;</div>
<div class="line"><a name="l00455"></a><span class="lineno"> 455</span>&#160; uint8_t outputPipe;</div>
<div class="line"><a name="l00456"></a><span class="lineno"> 456</span>&#160; <span class="keywordflow">switch</span> (controller) {</div>
<div class="line"><a name="l00457"></a><span class="lineno"> 457</span>&#160; <span class="keywordflow">case</span> 0: outputPipe = <a class="code" href="_x_b_o_x_r_e_c_v_8h.html#a962be1e740bce25cf37e111bd88be9bf">XBOX_OUTPUT_PIPE_1</a>;</div>
<div class="line"><a name="l00458"></a><span class="lineno"> 458</span>&#160; <span class="keywordflow">break</span>;</div>
<div class="line"><a name="l00459"></a><span class="lineno"> 459</span>&#160; <span class="keywordflow">case</span> 1: outputPipe = <a class="code" href="_x_b_o_x_r_e_c_v_8h.html#a8ba688a4bdb47869d7ee3f49b6d07b7c">XBOX_OUTPUT_PIPE_2</a>;</div>
<div class="line"><a name="l00460"></a><span class="lineno"> 460</span>&#160; <span class="keywordflow">break</span>;</div>
<div class="line"><a name="l00461"></a><span class="lineno"> 461</span>&#160; <span class="keywordflow">case</span> 2: outputPipe = <a class="code" href="_x_b_o_x_r_e_c_v_8h.html#afce4154cabb3a0d2c7eeb39b1c15d353">XBOX_OUTPUT_PIPE_3</a>;</div>
<div class="line"><a name="l00462"></a><span class="lineno"> 462</span>&#160; <span class="keywordflow">break</span>;</div>
<div class="line"><a name="l00463"></a><span class="lineno"> 463</span>&#160; <span class="keywordflow">case</span> 3: outputPipe = <a class="code" href="_x_b_o_x_r_e_c_v_8h.html#a7a74e0ea052831dbbb4a0973fffc8179">XBOX_OUTPUT_PIPE_4</a>;</div>
<div class="line"><a name="l00464"></a><span class="lineno"> 464</span>&#160; <span class="keywordflow">break</span>;</div>
<div class="line"><a name="l00465"></a><span class="lineno"> 465</span>&#160; }</div>
<div class="line"><a name="l00466"></a><span class="lineno"> 466</span>&#160; rcode = <a class="code" href="class_x_b_o_x_r_e_c_v.html#a53047c86c8c2f625916af62238d50fc8">pUsb</a>-&gt;<a class="code" href="class_u_s_b.html#affbc018973a588995457d535b0ac7ee7">outTransfer</a>(<a class="code" href="class_x_b_o_x_r_e_c_v.html#a1d4bdb1b740c87fd51aca3969e67c730">bAddress</a>, <a class="code" href="class_x_b_o_x_r_e_c_v.html#af97c8d0efc945fa4ba1d120c8a5a9cbb">epInfo</a>[ outputPipe ].epAddr, nbytes, data);</div>
<div class="line"><a name="l00467"></a><span class="lineno"> 467</span>&#160;<span class="preprocessor">#ifdef EXTRADEBUG</span></div>
<div class="line"><a name="l00468"></a><span class="lineno"> 468</span>&#160;<span class="preprocessor"></span> <span class="keywordflow">if</span> (rcode)</div>
<div class="line"><a name="l00469"></a><span class="lineno"> 469</span>&#160; <a class="code" href="message_8h.html#a747819b0aa34f5c3ba0332c2db28c846">Notify</a>(PSTR(<span class="stringliteral">&quot;Error sending Xbox message\r\n&quot;</span>), 0x80);</div>
<div class="line"><a name="l00470"></a><span class="lineno"> 470</span>&#160;<span class="preprocessor">#endif</span></div>
<div class="line"><a name="l00471"></a><span class="lineno"> 471</span>&#160;<span class="preprocessor"></span>}</div>
<div class="line"><a name="l00321"></a><span class="lineno"> 321</span>&#160; <span class="keywordflow">case</span> 0xC0: str = PSTR(<span class="stringliteral">&quot; as controller+headset\r\n&quot;</span>);</div>
<div class="line"><a name="l00322"></a><span class="lineno"> 322</span>&#160; <span class="keywordflow">break</span>;</div>
<div class="line"><a name="l00323"></a><span class="lineno"> 323</span>&#160; }</div>
<div class="line"><a name="l00324"></a><span class="lineno"> 324</span>&#160; <a class="code" href="message_8h.html#a27117e124c5d66d5512fe8d494fe6338">Notify</a>(PSTR(<span class="stringliteral">&quot;: connected&quot;</span>), 0x80);</div>
<div class="line"><a name="l00325"></a><span class="lineno"> 325</span>&#160; <a class="code" href="message_8h.html#a27117e124c5d66d5512fe8d494fe6338">Notify</a>(str, 0x80);</div>
<div class="line"><a name="l00326"></a><span class="lineno"> 326</span>&#160;<span class="preprocessor">#endif</span></div>
<div class="line"><a name="l00327"></a><span class="lineno"> 327</span>&#160;<span class="preprocessor"></span> onInit(controller);</div>
<div class="line"><a name="l00328"></a><span class="lineno"> 328</span>&#160; }</div>
<div class="line"><a name="l00329"></a><span class="lineno"> 329</span>&#160;<span class="preprocessor">#ifdef DEBUG_USB_HOST</span></div>
<div class="line"><a name="l00330"></a><span class="lineno"> 330</span>&#160;<span class="preprocessor"></span> <span class="keywordflow">else</span></div>
<div class="line"><a name="l00331"></a><span class="lineno"> 331</span>&#160; <a class="code" href="message_8h.html#a27117e124c5d66d5512fe8d494fe6338">Notify</a>(PSTR(<span class="stringliteral">&quot;: disconnected\r\n&quot;</span>), 0x80);</div>
<div class="line"><a name="l00332"></a><span class="lineno"> 332</span>&#160;<span class="preprocessor">#endif</span></div>
<div class="line"><a name="l00333"></a><span class="lineno"> 333</span>&#160;<span class="preprocessor"></span> <span class="keywordflow">return</span>;</div>
<div class="line"><a name="l00334"></a><span class="lineno"> 334</span>&#160; }</div>
<div class="line"><a name="l00335"></a><span class="lineno"> 335</span>&#160; <span class="comment">// Controller status report</span></div>
<div class="line"><a name="l00336"></a><span class="lineno"> 336</span>&#160; <span class="keywordflow">if</span> (readBuf[1] == 0x00 &amp;&amp; readBuf[3] &amp; 0x13 &amp;&amp; readBuf[4] &gt;= 0x22) {</div>
<div class="line"><a name="l00337"></a><span class="lineno"> 337</span>&#160; controllerStatus[controller] = ((uint16_t)readBuf[3] &lt;&lt; 8) | readBuf[4];</div>
<div class="line"><a name="l00338"></a><span class="lineno"> 338</span>&#160; <span class="keywordflow">return</span>;</div>
<div class="line"><a name="l00339"></a><span class="lineno"> 339</span>&#160; }</div>
<div class="line"><a name="l00340"></a><span class="lineno"> 340</span>&#160; <span class="keywordflow">if</span> (readBuf[1] != 0x01) <span class="comment">// Check if it&#39;s the correct report - the receiver also sends different status reports</span></div>
<div class="line"><a name="l00341"></a><span class="lineno"> 341</span>&#160; <span class="keywordflow">return</span>;</div>
<div class="line"><a name="l00342"></a><span class="lineno"> 342</span>&#160;</div>
<div class="line"><a name="l00343"></a><span class="lineno"> 343</span>&#160; <span class="comment">// A controller must be connected if it&#39;s sending data</span></div>
<div class="line"><a name="l00344"></a><span class="lineno"> 344</span>&#160; <span class="keywordflow">if</span> (!<a class="code" href="class_x_b_o_x_r_e_c_v.html#ac07faada38e159f1e7831d90863ebe3a">Xbox360Connected</a>[controller])</div>
<div class="line"><a name="l00345"></a><span class="lineno"> 345</span>&#160; <a class="code" href="class_x_b_o_x_r_e_c_v.html#ac07faada38e159f1e7831d90863ebe3a">Xbox360Connected</a>[controller] |= 0x80;</div>
<div class="line"><a name="l00346"></a><span class="lineno"> 346</span>&#160;</div>
<div class="line"><a name="l00347"></a><span class="lineno"> 347</span>&#160; ButtonState[controller] = (uint32_t)(readBuf[9] | ((uint16_t)readBuf[8] &lt;&lt; 8) | ((uint32_t)readBuf[7] &lt;&lt; 16) | ((uint32_t)readBuf[6] &lt;&lt; 24));</div>
<div class="line"><a name="l00348"></a><span class="lineno"> 348</span>&#160;</div>
<div class="line"><a name="l00349"></a><span class="lineno"> 349</span>&#160; hatValue[controller][<a class="code" href="controller_enums_8h.html#aaaabdefc068fd57ec2bef2b62ea4ba92a383cb8895dd296b7f69ce845ed16b0ca">LeftHatX</a>] = (int16_t)(((uint16_t)readBuf[11] &lt;&lt; 8) | readBuf[10]);</div>
<div class="line"><a name="l00350"></a><span class="lineno"> 350</span>&#160; hatValue[controller][<a class="code" href="controller_enums_8h.html#aaaabdefc068fd57ec2bef2b62ea4ba92af3f3925efa9762c4e9e71ac7da7a94a3">LeftHatY</a>] = (int16_t)(((uint16_t)readBuf[13] &lt;&lt; 8) | readBuf[12]);</div>
<div class="line"><a name="l00351"></a><span class="lineno"> 351</span>&#160; hatValue[controller][<a class="code" href="controller_enums_8h.html#aaaabdefc068fd57ec2bef2b62ea4ba92aaeb027a0ae5bbc6ba25e1c78a6486c7b">RightHatX</a>] = (int16_t)(((uint16_t)readBuf[15] &lt;&lt; 8) | readBuf[14]);</div>
<div class="line"><a name="l00352"></a><span class="lineno"> 352</span>&#160; hatValue[controller][<a class="code" href="controller_enums_8h.html#aaaabdefc068fd57ec2bef2b62ea4ba92a7f1fb2db5381286691f4dec179ed5d5a">RightHatY</a>] = (int16_t)(((uint16_t)readBuf[17] &lt;&lt; 8) | readBuf[16]);</div>
<div class="line"><a name="l00353"></a><span class="lineno"> 353</span>&#160;</div>
<div class="line"><a name="l00354"></a><span class="lineno"> 354</span>&#160; <span class="comment">//Notify(PSTR(&quot;\r\nButtonState: &quot;), 0x80);</span></div>
<div class="line"><a name="l00355"></a><span class="lineno"> 355</span>&#160; <span class="comment">//PrintHex&lt;uint32_t&gt;(ButtonState[controller], 0x80);</span></div>
<div class="line"><a name="l00356"></a><span class="lineno"> 356</span>&#160;</div>
<div class="line"><a name="l00357"></a><span class="lineno"> 357</span>&#160; <span class="keywordflow">if</span> (ButtonState[controller] != OldButtonState[controller]) {</div>
<div class="line"><a name="l00358"></a><span class="lineno"> 358</span>&#160; buttonStateChanged[controller] = <span class="keyword">true</span>;</div>
<div class="line"><a name="l00359"></a><span class="lineno"> 359</span>&#160; ButtonClickState[controller] = (ButtonState[controller] &gt;&gt; 16) &amp; ((~OldButtonState[controller]) &gt;&gt; 16); <span class="comment">// Update click state variable, but don&#39;t include the two trigger buttons L2 and R2</span></div>
<div class="line"><a name="l00360"></a><span class="lineno"> 360</span>&#160; <span class="keywordflow">if</span> (((uint8_t)OldButtonState[controller]) == 0 &amp;&amp; ((uint8_t)ButtonState[controller]) != 0) <span class="comment">// The L2 and R2 buttons are special as they are analog buttons</span></div>
<div class="line"><a name="l00361"></a><span class="lineno"> 361</span>&#160; R2Clicked[controller] = <span class="keyword">true</span>;</div>
<div class="line"><a name="l00362"></a><span class="lineno"> 362</span>&#160; <span class="keywordflow">if</span> ((uint8_t)(OldButtonState[controller] &gt;&gt; 8) == 0 &amp;&amp; (uint8_t)(ButtonState[controller] &gt;&gt; 8) != 0)</div>
<div class="line"><a name="l00363"></a><span class="lineno"> 363</span>&#160; L2Clicked[controller] = <span class="keyword">true</span>;</div>
<div class="line"><a name="l00364"></a><span class="lineno"> 364</span>&#160; OldButtonState[controller] = ButtonState[controller];</div>
<div class="line"><a name="l00365"></a><span class="lineno"> 365</span>&#160; }</div>
<div class="line"><a name="l00366"></a><span class="lineno"> 366</span>&#160;}</div>
<div class="line"><a name="l00367"></a><span class="lineno"> 367</span>&#160;</div>
<div class="line"><a name="l00368"></a><span class="lineno"> 368</span>&#160;<span class="keywordtype">void</span> XBOXRECV::printReport(uint8_t controller, uint8_t nBytes) { <span class="comment">//Uncomment &quot;#define PRINTREPORT&quot; to print the report send by the Xbox 360 Controller</span></div>
<div class="line"><a name="l00369"></a><span class="lineno"> 369</span>&#160;<span class="preprocessor">#ifdef PRINTREPORT</span></div>
<div class="line"><a name="l00370"></a><span class="lineno"> 370</span>&#160;<span class="preprocessor"></span> <span class="keywordflow">if</span> (readBuf == NULL)</div>
<div class="line"><a name="l00371"></a><span class="lineno"> 371</span>&#160; <span class="keywordflow">return</span>;</div>
<div class="line"><a name="l00372"></a><span class="lineno"> 372</span>&#160; <a class="code" href="message_8h.html#a27117e124c5d66d5512fe8d494fe6338">Notify</a>(PSTR(<span class="stringliteral">&quot;Controller &quot;</span>), 0x80);</div>
<div class="line"><a name="l00373"></a><span class="lineno"> 373</span>&#160; <a class="code" href="message_8h.html#a27117e124c5d66d5512fe8d494fe6338">Notify</a>(controller, 0x80);</div>
<div class="line"><a name="l00374"></a><span class="lineno"> 374</span>&#160; <a class="code" href="message_8h.html#a27117e124c5d66d5512fe8d494fe6338">Notify</a>(PSTR(<span class="stringliteral">&quot;: &quot;</span>), 0x80);</div>
<div class="line"><a name="l00375"></a><span class="lineno"> 375</span>&#160; <span class="keywordflow">for</span> (uint8_t i = 0; i &lt; nBytes; i++) {</div>
<div class="line"><a name="l00376"></a><span class="lineno"> 376</span>&#160; D_PrintHex&lt;uint8_t &gt; (readBuf[i], 0x80);</div>
<div class="line"><a name="l00377"></a><span class="lineno"> 377</span>&#160; <a class="code" href="message_8h.html#a27117e124c5d66d5512fe8d494fe6338">Notify</a>(PSTR(<span class="stringliteral">&quot; &quot;</span>), 0x80);</div>
<div class="line"><a name="l00378"></a><span class="lineno"> 378</span>&#160; }</div>
<div class="line"><a name="l00379"></a><span class="lineno"> 379</span>&#160; <a class="code" href="message_8h.html#a27117e124c5d66d5512fe8d494fe6338">Notify</a>(PSTR(<span class="stringliteral">&quot;\r\n&quot;</span>), 0x80);</div>
<div class="line"><a name="l00380"></a><span class="lineno"> 380</span>&#160;<span class="preprocessor">#endif</span></div>
<div class="line"><a name="l00381"></a><span class="lineno"> 381</span>&#160;<span class="preprocessor"></span>}</div>
<div class="line"><a name="l00382"></a><span class="lineno"> 382</span>&#160;</div>
<div class="line"><a name="l00383"></a><span class="lineno"><a class="code" href="class_x_b_o_x_r_e_c_v.html#a14f355acaf2cfad072c0c7c139a3e1b2"> 383</a></span>&#160;uint8_t <a class="code" href="class_x_b_o_x_r_e_c_v.html#a14f355acaf2cfad072c0c7c139a3e1b2">XBOXRECV::getButtonPress</a>(<a class="code" href="controller_enums_8h.html#a03bfec859eac87be20f8952c1eb89de0">Button</a> b, uint8_t controller) {</div>
<div class="line"><a name="l00384"></a><span class="lineno"> 384</span>&#160; <span class="keywordflow">if</span> (b == <a class="code" href="controller_enums_8h.html#a03bfec859eac87be20f8952c1eb89de0a0adffb24dae0c41be5b803f4d444f066">L2</a>) <span class="comment">// These are analog buttons</span></div>
<div class="line"><a name="l00385"></a><span class="lineno"> 385</span>&#160; <span class="keywordflow">return</span> (uint8_t)(ButtonState[controller] &gt;&gt; 8);</div>
<div class="line"><a name="l00386"></a><span class="lineno"> 386</span>&#160; <span class="keywordflow">else</span> <span class="keywordflow">if</span> (b == <a class="code" href="controller_enums_8h.html#a03bfec859eac87be20f8952c1eb89de0a629d7b403cea5f826352f3aefb9a6d6a">R2</a>)</div>
<div class="line"><a name="l00387"></a><span class="lineno"> 387</span>&#160; <span class="keywordflow">return</span> (uint8_t)ButtonState[controller];</div>
<div class="line"><a name="l00388"></a><span class="lineno"> 388</span>&#160; <span class="keywordflow">return</span> (<span class="keywordtype">bool</span>)(ButtonState[controller] &amp; ((uint32_t)pgm_read_word(&amp;<a class="code" href="xbox_enums_8h.html#a7e55826e75b9b88578c8b0edaaf523d7">XBOXBUTTONS</a>[(uint8_t)b]) &lt;&lt; 16));</div>
<div class="line"><a name="l00389"></a><span class="lineno"> 389</span>&#160;}</div>
<div class="line"><a name="l00390"></a><span class="lineno"> 390</span>&#160;</div>
<div class="line"><a name="l00391"></a><span class="lineno"><a class="code" href="class_x_b_o_x_r_e_c_v.html#a163310ab5d09b8192bebf57b4db9131f"> 391</a></span>&#160;<span class="keywordtype">bool</span> <a class="code" href="class_x_b_o_x_r_e_c_v.html#a163310ab5d09b8192bebf57b4db9131f">XBOXRECV::getButtonClick</a>(<a class="code" href="controller_enums_8h.html#a03bfec859eac87be20f8952c1eb89de0">Button</a> b, uint8_t controller) {</div>
<div class="line"><a name="l00392"></a><span class="lineno"> 392</span>&#160; <span class="keywordflow">if</span> (b == <a class="code" href="controller_enums_8h.html#a03bfec859eac87be20f8952c1eb89de0a0adffb24dae0c41be5b803f4d444f066">L2</a>) {</div>
<div class="line"><a name="l00393"></a><span class="lineno"> 393</span>&#160; <span class="keywordflow">if</span> (L2Clicked[controller]) {</div>
<div class="line"><a name="l00394"></a><span class="lineno"> 394</span>&#160; L2Clicked[controller] = <span class="keyword">false</span>;</div>
<div class="line"><a name="l00395"></a><span class="lineno"> 395</span>&#160; <span class="keywordflow">return</span> <span class="keyword">true</span>;</div>
<div class="line"><a name="l00396"></a><span class="lineno"> 396</span>&#160; }</div>
<div class="line"><a name="l00397"></a><span class="lineno"> 397</span>&#160; <span class="keywordflow">return</span> <span class="keyword">false</span>;</div>
<div class="line"><a name="l00398"></a><span class="lineno"> 398</span>&#160; } <span class="keywordflow">else</span> <span class="keywordflow">if</span> (b == <a class="code" href="controller_enums_8h.html#a03bfec859eac87be20f8952c1eb89de0a629d7b403cea5f826352f3aefb9a6d6a">R2</a>) {</div>
<div class="line"><a name="l00399"></a><span class="lineno"> 399</span>&#160; <span class="keywordflow">if</span> (R2Clicked[controller]) {</div>
<div class="line"><a name="l00400"></a><span class="lineno"> 400</span>&#160; R2Clicked[controller] = <span class="keyword">false</span>;</div>
<div class="line"><a name="l00401"></a><span class="lineno"> 401</span>&#160; <span class="keywordflow">return</span> <span class="keyword">true</span>;</div>
<div class="line"><a name="l00402"></a><span class="lineno"> 402</span>&#160; }</div>
<div class="line"><a name="l00403"></a><span class="lineno"> 403</span>&#160; <span class="keywordflow">return</span> <span class="keyword">false</span>;</div>
<div class="line"><a name="l00404"></a><span class="lineno"> 404</span>&#160; }</div>
<div class="line"><a name="l00405"></a><span class="lineno"> 405</span>&#160; uint16_t button = pgm_read_word(&amp;<a class="code" href="xbox_enums_8h.html#a7e55826e75b9b88578c8b0edaaf523d7">XBOXBUTTONS</a>[(uint8_t)b]);</div>
<div class="line"><a name="l00406"></a><span class="lineno"> 406</span>&#160; <span class="keywordtype">bool</span> click = (ButtonClickState[controller] &amp; button);</div>
<div class="line"><a name="l00407"></a><span class="lineno"> 407</span>&#160; ButtonClickState[controller] &amp;= ~button; <span class="comment">// clear &quot;click&quot; event</span></div>
<div class="line"><a name="l00408"></a><span class="lineno"> 408</span>&#160; <span class="keywordflow">return</span> click;</div>
<div class="line"><a name="l00409"></a><span class="lineno"> 409</span>&#160;}</div>
<div class="line"><a name="l00410"></a><span class="lineno"> 410</span>&#160;</div>
<div class="line"><a name="l00411"></a><span class="lineno"><a class="code" href="class_x_b_o_x_r_e_c_v.html#aef2c97b6f1d6eba631477f2d6c9f6de5"> 411</a></span>&#160;int16_t <a class="code" href="class_x_b_o_x_r_e_c_v.html#aef2c97b6f1d6eba631477f2d6c9f6de5">XBOXRECV::getAnalogHat</a>(<a class="code" href="controller_enums_8h.html#aaaabdefc068fd57ec2bef2b62ea4ba92">AnalogHat</a> a, uint8_t controller) {</div>
<div class="line"><a name="l00412"></a><span class="lineno"> 412</span>&#160; <span class="keywordflow">return</span> hatValue[controller][a];</div>
<div class="line"><a name="l00413"></a><span class="lineno"> 413</span>&#160;}</div>
<div class="line"><a name="l00414"></a><span class="lineno"> 414</span>&#160;</div>
<div class="line"><a name="l00415"></a><span class="lineno"><a class="code" href="class_x_b_o_x_r_e_c_v.html#ae78ddfff307d26b0ed35dfb75173adf7"> 415</a></span>&#160;<span class="keywordtype">bool</span> <a class="code" href="class_x_b_o_x_r_e_c_v.html#ae78ddfff307d26b0ed35dfb75173adf7">XBOXRECV::buttonChanged</a>(uint8_t controller) {</div>
<div class="line"><a name="l00416"></a><span class="lineno"> 416</span>&#160; <span class="keywordtype">bool</span> state = buttonStateChanged[controller];</div>
<div class="line"><a name="l00417"></a><span class="lineno"> 417</span>&#160; buttonStateChanged[controller] = <span class="keyword">false</span>;</div>
<div class="line"><a name="l00418"></a><span class="lineno"> 418</span>&#160; <span class="keywordflow">return</span> state;</div>
<div class="line"><a name="l00419"></a><span class="lineno"> 419</span>&#160;}</div>
<div class="line"><a name="l00420"></a><span class="lineno"> 420</span>&#160;</div>
<div class="line"><a name="l00421"></a><span class="lineno"> 421</span>&#160;<span class="comment">/*</span></div>
<div class="line"><a name="l00422"></a><span class="lineno"> 422</span>&#160;<span class="comment">ControllerStatus Breakdown</span></div>
<div class="line"><a name="l00423"></a><span class="lineno"> 423</span>&#160;<span class="comment"> ControllerStatus[controller] &amp; 0x0001 // 0</span></div>
<div class="line"><a name="l00424"></a><span class="lineno"> 424</span>&#160;<span class="comment"> ControllerStatus[controller] &amp; 0x0002 // normal batteries, no rechargeable battery pack</span></div>
<div class="line"><a name="l00425"></a><span class="lineno"> 425</span>&#160;<span class="comment"> ControllerStatus[controller] &amp; 0x0004 // controller starting up / settling</span></div>
<div class="line"><a name="l00426"></a><span class="lineno"> 426</span>&#160;<span class="comment"> ControllerStatus[controller] &amp; 0x0008 // headset adapter plugged in, but no headphones connected (mute?)</span></div>
<div class="line"><a name="l00427"></a><span class="lineno"> 427</span>&#160;<span class="comment"> ControllerStatus[controller] &amp; 0x0010 // 0</span></div>
<div class="line"><a name="l00428"></a><span class="lineno"> 428</span>&#160;<span class="comment"> ControllerStatus[controller] &amp; 0x0020 // 1</span></div>
<div class="line"><a name="l00429"></a><span class="lineno"> 429</span>&#160;<span class="comment"> ControllerStatus[controller] &amp; 0x0040 // battery level (high bit)</span></div>
<div class="line"><a name="l00430"></a><span class="lineno"> 430</span>&#160;<span class="comment"> ControllerStatus[controller] &amp; 0x0080 // battery level (low bit)</span></div>
<div class="line"><a name="l00431"></a><span class="lineno"> 431</span>&#160;<span class="comment"> ControllerStatus[controller] &amp; 0x0100 // 1</span></div>
<div class="line"><a name="l00432"></a><span class="lineno"> 432</span>&#160;<span class="comment"> ControllerStatus[controller] &amp; 0x0200 // 1</span></div>
<div class="line"><a name="l00433"></a><span class="lineno"> 433</span>&#160;<span class="comment"> ControllerStatus[controller] &amp; 0x0400 // headset adapter plugged in</span></div>
<div class="line"><a name="l00434"></a><span class="lineno"> 434</span>&#160;<span class="comment"> ControllerStatus[controller] &amp; 0x0800 // 0</span></div>
<div class="line"><a name="l00435"></a><span class="lineno"> 435</span>&#160;<span class="comment"> ControllerStatus[controller] &amp; 0x1000 // 1</span></div>
<div class="line"><a name="l00436"></a><span class="lineno"> 436</span>&#160;<span class="comment"> ControllerStatus[controller] &amp; 0x2000 // 0</span></div>
<div class="line"><a name="l00437"></a><span class="lineno"> 437</span>&#160;<span class="comment"> ControllerStatus[controller] &amp; 0x4000 // 0</span></div>
<div class="line"><a name="l00438"></a><span class="lineno"> 438</span>&#160;<span class="comment"> ControllerStatus[controller] &amp; 0x8000 // 0</span></div>
<div class="line"><a name="l00439"></a><span class="lineno"> 439</span>&#160;<span class="comment"> */</span></div>
<div class="line"><a name="l00440"></a><span class="lineno"><a class="code" href="class_x_b_o_x_r_e_c_v.html#aaa7a0d0861b8303a4b1654684d185b4f"> 440</a></span>&#160;uint8_t <a class="code" href="class_x_b_o_x_r_e_c_v.html#aaa7a0d0861b8303a4b1654684d185b4f">XBOXRECV::getBatteryLevel</a>(uint8_t controller) {</div>
<div class="line"><a name="l00441"></a><span class="lineno"> 441</span>&#160; <span class="keywordflow">return</span> ((controllerStatus[controller] &amp; 0x00C0) &gt;&gt; 6);</div>
<div class="line"><a name="l00442"></a><span class="lineno"> 442</span>&#160;}</div>
<div class="line"><a name="l00443"></a><span class="lineno"> 443</span>&#160;</div>
<div class="line"><a name="l00444"></a><span class="lineno"> 444</span>&#160;<span class="keywordtype">void</span> XBOXRECV::XboxCommand(uint8_t controller, uint8_t* data, uint16_t nbytes) {</div>
<div class="line"><a name="l00445"></a><span class="lineno"> 445</span>&#160; uint8_t rcode;</div>
<div class="line"><a name="l00446"></a><span class="lineno"> 446</span>&#160; uint8_t outputPipe;</div>
<div class="line"><a name="l00447"></a><span class="lineno"> 447</span>&#160; <span class="keywordflow">switch</span> (controller) {</div>
<div class="line"><a name="l00448"></a><span class="lineno"> 448</span>&#160; <span class="keywordflow">case</span> 0: outputPipe = <a class="code" href="_x_b_o_x_r_e_c_v_8h.html#a962be1e740bce25cf37e111bd88be9bf">XBOX_OUTPUT_PIPE_1</a>;</div>
<div class="line"><a name="l00449"></a><span class="lineno"> 449</span>&#160; <span class="keywordflow">break</span>;</div>
<div class="line"><a name="l00450"></a><span class="lineno"> 450</span>&#160; <span class="keywordflow">case</span> 1: outputPipe = <a class="code" href="_x_b_o_x_r_e_c_v_8h.html#a8ba688a4bdb47869d7ee3f49b6d07b7c">XBOX_OUTPUT_PIPE_2</a>;</div>
<div class="line"><a name="l00451"></a><span class="lineno"> 451</span>&#160; <span class="keywordflow">break</span>;</div>
<div class="line"><a name="l00452"></a><span class="lineno"> 452</span>&#160; <span class="keywordflow">case</span> 2: outputPipe = <a class="code" href="_x_b_o_x_r_e_c_v_8h.html#afce4154cabb3a0d2c7eeb39b1c15d353">XBOX_OUTPUT_PIPE_3</a>;</div>
<div class="line"><a name="l00453"></a><span class="lineno"> 453</span>&#160; <span class="keywordflow">break</span>;</div>
<div class="line"><a name="l00454"></a><span class="lineno"> 454</span>&#160; <span class="keywordflow">case</span> 3: outputPipe = <a class="code" href="_x_b_o_x_r_e_c_v_8h.html#a7a74e0ea052831dbbb4a0973fffc8179">XBOX_OUTPUT_PIPE_4</a>;</div>
<div class="line"><a name="l00455"></a><span class="lineno"> 455</span>&#160; <span class="keywordflow">break</span>;</div>
<div class="line"><a name="l00456"></a><span class="lineno"> 456</span>&#160; }</div>
<div class="line"><a name="l00457"></a><span class="lineno"> 457</span>&#160; rcode = <a class="code" href="class_x_b_o_x_r_e_c_v.html#a53047c86c8c2f625916af62238d50fc8">pUsb</a>-&gt;<a class="code" href="class_u_s_b.html#affbc018973a588995457d535b0ac7ee7">outTransfer</a>(<a class="code" href="class_x_b_o_x_r_e_c_v.html#a1d4bdb1b740c87fd51aca3969e67c730">bAddress</a>, <a class="code" href="class_x_b_o_x_r_e_c_v.html#af97c8d0efc945fa4ba1d120c8a5a9cbb">epInfo</a>[ outputPipe ].epAddr, nbytes, data);</div>
<div class="line"><a name="l00458"></a><span class="lineno"> 458</span>&#160;<span class="preprocessor">#ifdef EXTRADEBUG</span></div>
<div class="line"><a name="l00459"></a><span class="lineno"> 459</span>&#160;<span class="preprocessor"></span> <span class="keywordflow">if</span> (rcode)</div>
<div class="line"><a name="l00460"></a><span class="lineno"> 460</span>&#160; <a class="code" href="message_8h.html#a27117e124c5d66d5512fe8d494fe6338">Notify</a>(PSTR(<span class="stringliteral">&quot;Error sending Xbox message\r\n&quot;</span>), 0x80);</div>
<div class="line"><a name="l00461"></a><span class="lineno"> 461</span>&#160;<span class="preprocessor">#endif</span></div>
<div class="line"><a name="l00462"></a><span class="lineno"> 462</span>&#160;<span class="preprocessor"></span>}</div>
<div class="line"><a name="l00463"></a><span class="lineno"> 463</span>&#160;</div>
<div class="line"><a name="l00464"></a><span class="lineno"><a class="code" href="class_x_b_o_x_r_e_c_v.html#a7986a3cf050bd91c7fed44a7e7eac125"> 464</a></span>&#160;<span class="keywordtype">void</span> <a class="code" href="class_x_b_o_x_r_e_c_v.html#a7986a3cf050bd91c7fed44a7e7eac125">XBOXRECV::setLedRaw</a>(uint8_t value, uint8_t controller) {</div>
<div class="line"><a name="l00465"></a><span class="lineno"> 465</span>&#160; writeBuf[0] = 0x00;</div>
<div class="line"><a name="l00466"></a><span class="lineno"> 466</span>&#160; writeBuf[1] = 0x00;</div>
<div class="line"><a name="l00467"></a><span class="lineno"> 467</span>&#160; writeBuf[2] = 0x08;</div>
<div class="line"><a name="l00468"></a><span class="lineno"> 468</span>&#160; writeBuf[3] = value | 0x40;</div>
<div class="line"><a name="l00469"></a><span class="lineno"> 469</span>&#160;</div>
<div class="line"><a name="l00470"></a><span class="lineno"> 470</span>&#160; XboxCommand(controller, writeBuf, 4);</div>
<div class="line"><a name="l00471"></a><span class="lineno"> 471</span>&#160;}</div>
<div class="line"><a name="l00472"></a><span class="lineno"> 472</span>&#160;</div>
<div class="line"><a name="l00473"></a><span class="lineno"><a class="code" href="class_x_b_o_x_r_e_c_v.html#a7986a3cf050bd91c7fed44a7e7eac125"> 473</a></span>&#160;<span class="keywordtype">void</span> <a class="code" href="class_x_b_o_x_r_e_c_v.html#a7986a3cf050bd91c7fed44a7e7eac125">XBOXRECV::setLedRaw</a>(uint8_t value, uint8_t controller) {</div>
<div class="line"><a name="l00474"></a><span class="lineno"> 474</span>&#160; writeBuf[0] = 0x00;</div>
<div class="line"><a name="l00475"></a><span class="lineno"> 475</span>&#160; writeBuf[1] = 0x00;</div>
<div class="line"><a name="l00476"></a><span class="lineno"> 476</span>&#160; writeBuf[2] = 0x08;</div>
<div class="line"><a name="l00477"></a><span class="lineno"> 477</span>&#160; writeBuf[3] = value | 0x40;</div>
<div class="line"><a name="l00478"></a><span class="lineno"> 478</span>&#160;</div>
<div class="line"><a name="l00479"></a><span class="lineno"> 479</span>&#160; XboxCommand(controller, writeBuf, 4);</div>
<div class="line"><a name="l00473"></a><span class="lineno"><a class="code" href="class_x_b_o_x_r_e_c_v.html#a4ab056654c97c054aebb683cac95e21b"> 473</a></span>&#160;<span class="keywordtype">void</span> <a class="code" href="class_x_b_o_x_r_e_c_v.html#a4ab056654c97c054aebb683cac95e21b">XBOXRECV::setLedOn</a>(<a class="code" href="controller_enums_8h.html#aadcb6002d2b42fdfe01490f730ab00a6">LED</a> led, uint8_t controller) {</div>
<div class="line"><a name="l00474"></a><span class="lineno"> 474</span>&#160; <span class="keywordflow">if</span> (led != <a class="code" href="controller_enums_8h.html#aadcb6002d2b42fdfe01490f730ab00a6ab1d5eac4b1dca480c8056eaea7663b7a">ALL</a>) <span class="comment">// All LEDs can&#39;t be on a the same time</span></div>
<div class="line"><a name="l00475"></a><span class="lineno"> 475</span>&#160; <a class="code" href="class_x_b_o_x_r_e_c_v.html#a7986a3cf050bd91c7fed44a7e7eac125">setLedRaw</a>(pgm_read_byte(&amp;<a class="code" href="xbox_enums_8h.html#a867f3bf7a14d4647290f1ac7f76b23ee">XBOXLEDS</a>[(uint8_t)led]) + 4, controller);</div>
<div class="line"><a name="l00476"></a><span class="lineno"> 476</span>&#160;}</div>
<div class="line"><a name="l00477"></a><span class="lineno"> 477</span>&#160;</div>
<div class="line"><a name="l00478"></a><span class="lineno"><a class="code" href="class_x_b_o_x_r_e_c_v.html#ad66796b66d332bfa1cb57b4ba76cb0fc"> 478</a></span>&#160;<span class="keywordtype">void</span> <a class="code" href="class_x_b_o_x_r_e_c_v.html#ad66796b66d332bfa1cb57b4ba76cb0fc">XBOXRECV::setLedBlink</a>(<a class="code" href="controller_enums_8h.html#aadcb6002d2b42fdfe01490f730ab00a6">LED</a> led, uint8_t controller) {</div>
<div class="line"><a name="l00479"></a><span class="lineno"> 479</span>&#160; <a class="code" href="class_x_b_o_x_r_e_c_v.html#a7986a3cf050bd91c7fed44a7e7eac125">setLedRaw</a>(pgm_read_byte(&amp;<a class="code" href="xbox_enums_8h.html#a867f3bf7a14d4647290f1ac7f76b23ee">XBOXLEDS</a>[(uint8_t)led]), controller);</div>
<div class="line"><a name="l00480"></a><span class="lineno"> 480</span>&#160;}</div>
<div class="line"><a name="l00481"></a><span class="lineno"> 481</span>&#160;</div>
<div class="line"><a name="l00482"></a><span class="lineno"><a class="code" href="class_x_b_o_x_r_e_c_v.html#a4ab056654c97c054aebb683cac95e21b"> 482</a></span>&#160;<span class="keywordtype">void</span> <a class="code" href="class_x_b_o_x_r_e_c_v.html#a4ab056654c97c054aebb683cac95e21b">XBOXRECV::setLedOn</a>(<a class="code" href="controller_enums_8h.html#aadcb6002d2b42fdfe01490f730ab00a6">LED</a> led, uint8_t controller) {</div>
<div class="line"><a name="l00483"></a><span class="lineno"> 483</span>&#160; <span class="keywordflow">if</span> (led != <a class="code" href="controller_enums_8h.html#aadcb6002d2b42fdfe01490f730ab00a6ab1d5eac4b1dca480c8056eaea7663b7a">ALL</a>) <span class="comment">// All LEDs can&#39;t be on a the same time</span></div>
<div class="line"><a name="l00484"></a><span class="lineno"> 484</span>&#160; <a class="code" href="class_x_b_o_x_r_e_c_v.html#a7986a3cf050bd91c7fed44a7e7eac125">setLedRaw</a>(pgm_read_byte(&amp;<a class="code" href="xbox_enums_8h.html#a867f3bf7a14d4647290f1ac7f76b23ee">XBOXLEDS</a>[(uint8_t)led]) + 4, controller);</div>
<div class="line"><a name="l00485"></a><span class="lineno"> 485</span>&#160;}</div>
<div class="line"><a name="l00486"></a><span class="lineno"> 486</span>&#160;</div>
<div class="line"><a name="l00487"></a><span class="lineno"><a class="code" href="class_x_b_o_x_r_e_c_v.html#ad66796b66d332bfa1cb57b4ba76cb0fc"> 487</a></span>&#160;<span class="keywordtype">void</span> <a class="code" href="class_x_b_o_x_r_e_c_v.html#ad66796b66d332bfa1cb57b4ba76cb0fc">XBOXRECV::setLedBlink</a>(<a class="code" href="controller_enums_8h.html#aadcb6002d2b42fdfe01490f730ab00a6">LED</a> led, uint8_t controller) {</div>
<div class="line"><a name="l00488"></a><span class="lineno"> 488</span>&#160; <a class="code" href="class_x_b_o_x_r_e_c_v.html#a7986a3cf050bd91c7fed44a7e7eac125">setLedRaw</a>(pgm_read_byte(&amp;<a class="code" href="xbox_enums_8h.html#a867f3bf7a14d4647290f1ac7f76b23ee">XBOXLEDS</a>[(uint8_t)led]), controller);</div>
<div class="line"><a name="l00489"></a><span class="lineno"> 489</span>&#160;}</div>
<div class="line"><a name="l00490"></a><span class="lineno"> 490</span>&#160;</div>
<div class="line"><a name="l00491"></a><span class="lineno"><a class="code" href="class_x_b_o_x_r_e_c_v.html#abb75b732b431a29b6fef0fd7c895f41b"> 491</a></span>&#160;<span class="keywordtype">void</span> <a class="code" href="class_x_b_o_x_r_e_c_v.html#abb75b732b431a29b6fef0fd7c895f41b">XBOXRECV::setLedMode</a>(<a class="code" href="xbox_enums_8h.html#a57effb96f46e458675a2653d4c543ca2">LEDMode</a> ledMode, uint8_t controller) { <span class="comment">// This function is used to do some speciel LED stuff the controller supports</span></div>
<div class="line"><a name="l00492"></a><span class="lineno"> 492</span>&#160; <a class="code" href="class_x_b_o_x_r_e_c_v.html#a7986a3cf050bd91c7fed44a7e7eac125">setLedRaw</a>((uint8_t)ledMode, controller);</div>
<div class="line"><a name="l00493"></a><span class="lineno"> 493</span>&#160;}</div>
<div class="line"><a name="l00494"></a><span class="lineno"> 494</span>&#160;</div>
<div class="line"><a name="l00495"></a><span class="lineno"> 495</span>&#160;<span class="comment">/* PC runs this at interval of approx 2 seconds</span></div>
<div class="line"><a name="l00496"></a><span class="lineno"> 496</span>&#160;<span class="comment">Thanks to BusHound from Perisoft.net for the Windows USB Analysis output</span></div>
<div class="line"><a name="l00497"></a><span class="lineno"> 497</span>&#160;<span class="comment">Found by timstamp.co.uk</span></div>
<div class="line"><a name="l00498"></a><span class="lineno"> 498</span>&#160;<span class="comment"> */</span></div>
<div class="line"><a name="l00499"></a><span class="lineno"> 499</span>&#160;<span class="keywordtype">void</span> XBOXRECV::checkStatus() {</div>
<div class="line"><a name="l00500"></a><span class="lineno"> 500</span>&#160; <span class="keywordflow">if</span> (!bPollEnable)</div>
<div class="line"><a name="l00501"></a><span class="lineno"> 501</span>&#160; <span class="keywordflow">return</span>;</div>
<div class="line"><a name="l00502"></a><span class="lineno"> 502</span>&#160; <span class="comment">// Get controller info</span></div>
<div class="line"><a name="l00503"></a><span class="lineno"> 503</span>&#160; writeBuf[0] = 0x08;</div>
<div class="line"><a name="l00504"></a><span class="lineno"> 504</span>&#160; writeBuf[1] = 0x00;</div>
<div class="line"><a name="l00505"></a><span class="lineno"> 505</span>&#160; writeBuf[2] = 0x0f;</div>
<div class="line"><a name="l00506"></a><span class="lineno"> 506</span>&#160; writeBuf[3] = 0xc0;</div>
<div class="line"><a name="l00507"></a><span class="lineno"> 507</span>&#160; <span class="keywordflow">for</span> (uint8_t i = 0; i &lt; 4; i++) {</div>
<div class="line"><a name="l00482"></a><span class="lineno"><a class="code" href="class_x_b_o_x_r_e_c_v.html#abb75b732b431a29b6fef0fd7c895f41b"> 482</a></span>&#160;<span class="keywordtype">void</span> <a class="code" href="class_x_b_o_x_r_e_c_v.html#abb75b732b431a29b6fef0fd7c895f41b">XBOXRECV::setLedMode</a>(<a class="code" href="xbox_enums_8h.html#a57effb96f46e458675a2653d4c543ca2">LEDMode</a> ledMode, uint8_t controller) { <span class="comment">// This function is used to do some speciel LED stuff the controller supports</span></div>
<div class="line"><a name="l00483"></a><span class="lineno"> 483</span>&#160; <a class="code" href="class_x_b_o_x_r_e_c_v.html#a7986a3cf050bd91c7fed44a7e7eac125">setLedRaw</a>((uint8_t)ledMode, controller);</div>
<div class="line"><a name="l00484"></a><span class="lineno"> 484</span>&#160;}</div>
<div class="line"><a name="l00485"></a><span class="lineno"> 485</span>&#160;</div>
<div class="line"><a name="l00486"></a><span class="lineno"> 486</span>&#160;<span class="comment">/* PC runs this at interval of approx 2 seconds</span></div>
<div class="line"><a name="l00487"></a><span class="lineno"> 487</span>&#160;<span class="comment">Thanks to BusHound from Perisoft.net for the Windows USB Analysis output</span></div>
<div class="line"><a name="l00488"></a><span class="lineno"> 488</span>&#160;<span class="comment">Found by timstamp.co.uk</span></div>
<div class="line"><a name="l00489"></a><span class="lineno"> 489</span>&#160;<span class="comment"> */</span></div>
<div class="line"><a name="l00490"></a><span class="lineno"> 490</span>&#160;<span class="keywordtype">void</span> XBOXRECV::checkStatus() {</div>
<div class="line"><a name="l00491"></a><span class="lineno"> 491</span>&#160; <span class="keywordflow">if</span> (!bPollEnable)</div>
<div class="line"><a name="l00492"></a><span class="lineno"> 492</span>&#160; <span class="keywordflow">return</span>;</div>
<div class="line"><a name="l00493"></a><span class="lineno"> 493</span>&#160; <span class="comment">// Get controller info</span></div>
<div class="line"><a name="l00494"></a><span class="lineno"> 494</span>&#160; writeBuf[0] = 0x08;</div>
<div class="line"><a name="l00495"></a><span class="lineno"> 495</span>&#160; writeBuf[1] = 0x00;</div>
<div class="line"><a name="l00496"></a><span class="lineno"> 496</span>&#160; writeBuf[2] = 0x0f;</div>
<div class="line"><a name="l00497"></a><span class="lineno"> 497</span>&#160; writeBuf[3] = 0xc0;</div>
<div class="line"><a name="l00498"></a><span class="lineno"> 498</span>&#160; <span class="keywordflow">for</span> (uint8_t i = 0; i &lt; 4; i++) {</div>
<div class="line"><a name="l00499"></a><span class="lineno"> 499</span>&#160; XboxCommand(i, writeBuf, 4);</div>
<div class="line"><a name="l00500"></a><span class="lineno"> 500</span>&#160; }</div>
<div class="line"><a name="l00501"></a><span class="lineno"> 501</span>&#160; <span class="comment">// Get battery status</span></div>
<div class="line"><a name="l00502"></a><span class="lineno"> 502</span>&#160; writeBuf[0] = 0x00;</div>
<div class="line"><a name="l00503"></a><span class="lineno"> 503</span>&#160; writeBuf[1] = 0x00;</div>
<div class="line"><a name="l00504"></a><span class="lineno"> 504</span>&#160; writeBuf[2] = 0x00;</div>
<div class="line"><a name="l00505"></a><span class="lineno"> 505</span>&#160; writeBuf[3] = 0x40;</div>
<div class="line"><a name="l00506"></a><span class="lineno"> 506</span>&#160; <span class="keywordflow">for</span> (uint8_t i = 0; i &lt; 4; i++) {</div>
<div class="line"><a name="l00507"></a><span class="lineno"> 507</span>&#160; <span class="keywordflow">if</span> (<a class="code" href="class_x_b_o_x_r_e_c_v.html#ac07faada38e159f1e7831d90863ebe3a">Xbox360Connected</a>[i])</div>
<div class="line"><a name="l00508"></a><span class="lineno"> 508</span>&#160; XboxCommand(i, writeBuf, 4);</div>
<div class="line"><a name="l00509"></a><span class="lineno"> 509</span>&#160; }</div>
<div class="line"><a name="l00510"></a><span class="lineno"> 510</span>&#160; <span class="comment">// Get battery status</span></div>
<div class="line"><a name="l00511"></a><span class="lineno"> 511</span>&#160; writeBuf[0] = 0x00;</div>
<div class="line"><a name="l00512"></a><span class="lineno"> 512</span>&#160; writeBuf[1] = 0x00;</div>
<div class="line"><a name="l00513"></a><span class="lineno"> 513</span>&#160; writeBuf[2] = 0x00;</div>
<div class="line"><a name="l00514"></a><span class="lineno"> 514</span>&#160; writeBuf[3] = 0x40;</div>
<div class="line"><a name="l00515"></a><span class="lineno"> 515</span>&#160; <span class="keywordflow">for</span> (uint8_t i = 0; i &lt; 4; i++) {</div>
<div class="line"><a name="l00516"></a><span class="lineno"> 516</span>&#160; <span class="keywordflow">if</span> (<a class="code" href="class_x_b_o_x_r_e_c_v.html#ac07faada38e159f1e7831d90863ebe3a">Xbox360Connected</a>[i])</div>
<div class="line"><a name="l00517"></a><span class="lineno"> 517</span>&#160; XboxCommand(i, writeBuf, 4);</div>
<div class="line"><a name="l00518"></a><span class="lineno"> 518</span>&#160; }</div>
<div class="line"><a name="l00519"></a><span class="lineno"> 519</span>&#160;}</div>
<div class="line"><a name="l00510"></a><span class="lineno"> 510</span>&#160;}</div>
<div class="line"><a name="l00511"></a><span class="lineno"> 511</span>&#160;</div>
<div class="line"><a name="l00512"></a><span class="lineno"><a class="code" href="class_x_b_o_x_r_e_c_v.html#addf7c0dcfbdb025f2283dcd118b5ab76"> 512</a></span>&#160;<span class="keywordtype">void</span> <a class="code" href="class_x_b_o_x_r_e_c_v.html#addf7c0dcfbdb025f2283dcd118b5ab76">XBOXRECV::setRumbleOn</a>(uint8_t lValue, uint8_t rValue, uint8_t controller) {</div>
<div class="line"><a name="l00513"></a><span class="lineno"> 513</span>&#160; writeBuf[0] = 0x00;</div>
<div class="line"><a name="l00514"></a><span class="lineno"> 514</span>&#160; writeBuf[1] = 0x01;</div>
<div class="line"><a name="l00515"></a><span class="lineno"> 515</span>&#160; writeBuf[2] = 0x0f;</div>
<div class="line"><a name="l00516"></a><span class="lineno"> 516</span>&#160; writeBuf[3] = 0xc0;</div>
<div class="line"><a name="l00517"></a><span class="lineno"> 517</span>&#160; writeBuf[4] = 0x00;</div>
<div class="line"><a name="l00518"></a><span class="lineno"> 518</span>&#160; writeBuf[5] = lValue; <span class="comment">// big weight</span></div>
<div class="line"><a name="l00519"></a><span class="lineno"> 519</span>&#160; writeBuf[6] = rValue; <span class="comment">// small weight</span></div>
<div class="line"><a name="l00520"></a><span class="lineno"> 520</span>&#160;</div>
<div class="line"><a name="l00521"></a><span class="lineno"><a class="code" href="class_x_b_o_x_r_e_c_v.html#addf7c0dcfbdb025f2283dcd118b5ab76"> 521</a></span>&#160;<span class="keywordtype">void</span> <a class="code" href="class_x_b_o_x_r_e_c_v.html#addf7c0dcfbdb025f2283dcd118b5ab76">XBOXRECV::setRumbleOn</a>(uint8_t lValue, uint8_t rValue, uint8_t controller) {</div>
<div class="line"><a name="l00522"></a><span class="lineno"> 522</span>&#160; writeBuf[0] = 0x00;</div>
<div class="line"><a name="l00523"></a><span class="lineno"> 523</span>&#160; writeBuf[1] = 0x01;</div>
<div class="line"><a name="l00524"></a><span class="lineno"> 524</span>&#160; writeBuf[2] = 0x0f;</div>
<div class="line"><a name="l00525"></a><span class="lineno"> 525</span>&#160; writeBuf[3] = 0xc0;</div>
<div class="line"><a name="l00526"></a><span class="lineno"> 526</span>&#160; writeBuf[4] = 0x00;</div>
<div class="line"><a name="l00527"></a><span class="lineno"> 527</span>&#160; writeBuf[5] = lValue; <span class="comment">// big weight</span></div>
<div class="line"><a name="l00528"></a><span class="lineno"> 528</span>&#160; writeBuf[6] = rValue; <span class="comment">// small weight</span></div>
<div class="line"><a name="l00529"></a><span class="lineno"> 529</span>&#160;</div>
<div class="line"><a name="l00530"></a><span class="lineno"> 530</span>&#160; XboxCommand(controller, writeBuf, 7);</div>
<div class="line"><a name="l00531"></a><span class="lineno"> 531</span>&#160;}</div>
<div class="line"><a name="l00521"></a><span class="lineno"> 521</span>&#160; XboxCommand(controller, writeBuf, 7);</div>
<div class="line"><a name="l00522"></a><span class="lineno"> 522</span>&#160;}</div>
<div class="line"><a name="l00523"></a><span class="lineno"> 523</span>&#160;</div>
<div class="line"><a name="l00524"></a><span class="lineno"> 524</span>&#160;<span class="keywordtype">void</span> XBOXRECV::onInit(uint8_t controller) {</div>
<div class="line"><a name="l00525"></a><span class="lineno"> 525</span>&#160; <span class="keywordflow">if</span> (pFuncOnInit)</div>
<div class="line"><a name="l00526"></a><span class="lineno"> 526</span>&#160; pFuncOnInit(); <span class="comment">// Call the user function</span></div>
<div class="line"><a name="l00527"></a><span class="lineno"> 527</span>&#160; <span class="keywordflow">else</span> {</div>
<div class="line"><a name="l00528"></a><span class="lineno"> 528</span>&#160; <a class="code" href="controller_enums_8h.html#aadcb6002d2b42fdfe01490f730ab00a6">LED</a> led;</div>
<div class="line"><a name="l00529"></a><span class="lineno"> 529</span>&#160; <span class="keywordflow">if</span> (controller == 0)</div>
<div class="line"><a name="l00530"></a><span class="lineno"> 530</span>&#160; led = <a class="code" href="controller_enums_8h.html#aadcb6002d2b42fdfe01490f730ab00a6adac6477842247cab1a8c02c65f431b44">LED1</a>;</div>
<div class="line"><a name="l00531"></a><span class="lineno"> 531</span>&#160; <span class="keywordflow">else</span> <span class="keywordflow">if</span> (controller == 1)</div>
<div class="line"><a name="l00532"></a><span class="lineno"> 532</span>&#160; led = <a class="code" href="controller_enums_8h.html#aadcb6002d2b42fdfe01490f730ab00a6a8379bbaa96d151e6adac488b2a147b7a">LED2</a>;</div>
<div class="line"><a name="l00533"></a><span class="lineno"> 533</span>&#160; <span class="keywordflow">else</span> <span class="keywordflow">if</span> (controller == 2)</div>
<div class="line"><a name="l00534"></a><span class="lineno"> 534</span>&#160; led = <a class="code" href="controller_enums_8h.html#aadcb6002d2b42fdfe01490f730ab00a6a5dec293e081e0fc78369c842fab8452b">LED3</a>;</div>
<div class="line"><a name="l00535"></a><span class="lineno"> 535</span>&#160; <span class="keywordflow">else</span></div>
<div class="line"><a name="l00536"></a><span class="lineno"> 536</span>&#160; led = <a class="code" href="controller_enums_8h.html#aadcb6002d2b42fdfe01490f730ab00a6ad60e39b8d1701d30aa64f80343217342">LED4</a>;</div>
<div class="line"><a name="l00537"></a><span class="lineno"> 537</span>&#160; <a class="code" href="class_x_b_o_x_r_e_c_v.html#a4ab056654c97c054aebb683cac95e21b">setLedOn</a>(led, controller);</div>
<div class="line"><a name="l00538"></a><span class="lineno"> 538</span>&#160; }</div>
<div class="line"><a name="l00539"></a><span class="lineno"> 539</span>&#160;}</div>
</div><!-- fragment --></div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>

View file

@ -100,7 +100,7 @@ Include dependency graph for XBOXRECV.h:</div>
<div class="dyncontent">
<div class="center"><img src="_x_b_o_x_r_e_c_v_8h__incl.png" border="0" usemap="#_x_b_o_x_r_e_c_v_8h" alt=""/></div>
<map name="_x_b_o_x_r_e_c_v_8h" id="_x_b_o_x_r_e_c_v_8h">
<area shape="rect" id="node3" href="_usb_8h.html" title="Usb.h" alt="" coords="357,75,400,96"/><area shape="rect" id="node18" href="xbox_enums_8h.html" title="xboxEnums.h" alt="" coords="581,75,651,96"/><area shape="rect" id="node6" href="avrpins_8h.html" title="avrpins.h" alt="" coords="43,213,97,235"/><area shape="rect" id="node8" href="max3421e_8h.html" title="max3421e.h" alt="" coords="275,213,341,235"/><area shape="rect" id="node9" href="usbhost_8h.html" title="usbhost.h" alt="" coords="199,144,256,165"/><area shape="rect" id="node10" href="usb__ch9_8h.html" title="usb_ch9.h" alt="" coords="123,213,181,235"/><area shape="rect" id="node12" href="address_8h.html" title="address.h" alt="" coords="350,144,407,165"/><area shape="rect" id="node14" href="message_8h.html" title="message.h" alt="" coords="643,144,704,165"/><area shape="rect" id="node16" href="printhex_8h.html" title="printhex.h" alt="" coords="746,283,803,304"/><area shape="rect" id="node17" href="hexdump_8h.html" title="hexdump.h" alt="" coords="643,213,704,235"/><area shape="rect" id="node19" href="controller_enums_8h.html" title="controllerEnums.h" alt="" coords="729,144,815,165"/></map>
<area shape="rect" id="node3" href="_usb_8h.html" title="Usb.h" alt="" coords="420,75,463,96"/><area shape="rect" id="node18" href="xbox_enums_8h.html" title="xboxEnums.h" alt="" coords="725,75,795,96"/><area shape="rect" id="node6" href="avrpins_8h.html" title="avrpins.h" alt="" coords="43,213,97,235"/><area shape="rect" id="node8" href="max3421e_8h.html" title="max3421e.h" alt="" coords="325,213,392,235"/><area shape="rect" id="node9" href="usbhost_8h.html" title="usbhost.h" alt="" coords="186,144,243,165"/><area shape="rect" id="node10" href="usb__ch9_8h.html" title="usb_ch9.h" alt="" coords="243,213,301,235"/><area shape="rect" id="node12" href="address_8h.html" title="address.h" alt="" coords="413,144,469,165"/><area shape="rect" id="node14" href="message_8h.html" title="message.h" alt="" coords="659,144,720,165"/><area shape="rect" id="node16" href="printhex_8h.html" title="printhex.h" alt="" coords="627,283,684,304"/><area shape="rect" id="node17" href="hexdump_8h.html" title="hexdump.h" alt="" coords="693,213,755,235"/><area shape="rect" id="node19" href="controller_enums_8h.html" title="controllerEnums.h" alt="" coords="955,144,1041,165"/></map>
</div>
</div><div class="textblock"><div class="dynheader">
This graph shows which files directly or indirectly include this file:</div>
@ -143,12 +143,14 @@ Macros</h2></td></tr>
<tr class="separator:a7a74e0ea052831dbbb4a0973fffc8179"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a8e7834e5604c4fb588cceab9258d0568"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="_x_b_o_x_r_e_c_v_8h.html#a8e7834e5604c4fb588cceab9258d0568">XBOX_VID</a>&#160;&#160;&#160;0x045E</td></tr>
<tr class="separator:a8e7834e5604c4fb588cceab9258d0568"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a2f5523a1aaa6718e1d11c6bc5b29a575"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="_x_b_o_x_r_e_c_v_8h.html#a2f5523a1aaa6718e1d11c6bc5b29a575">MADCATZ_VID</a>&#160;&#160;&#160;0x1BAD</td></tr>
<tr class="separator:a2f5523a1aaa6718e1d11c6bc5b29a575"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ab029b2c21fb0c240022cc50f465d4580"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="_x_b_o_x_r_e_c_v_8h.html#ab029b2c21fb0c240022cc50f465d4580">JOYTECH_VID</a>&#160;&#160;&#160;0x162E</td></tr>
<tr class="separator:ab029b2c21fb0c240022cc50f465d4580"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a1a97ce2829a30b96ea6640d387d245a9"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="_x_b_o_x_r_e_c_v_8h.html#a1a97ce2829a30b96ea6640d387d245a9">XBOX_WIRELESS_RECEIVER_PID</a>&#160;&#160;&#160;0x0719</td></tr>
<tr class="separator:a1a97ce2829a30b96ea6640d387d245a9"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a6842663964e470b86786f046e4bc30d9"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="_x_b_o_x_r_e_c_v_8h.html#a6842663964e470b86786f046e4bc30d9">XBOX_WIRELESS_RECEIVER_THIRD_PARTY_PID</a>&#160;&#160;&#160;0x0291</td></tr>
<tr class="separator:a6842663964e470b86786f046e4bc30d9"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a2f5523a1aaa6718e1d11c6bc5b29a575"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="_x_b_o_x_r_e_c_v_8h.html#a2f5523a1aaa6718e1d11c6bc5b29a575">MADCATZ_VID</a>&#160;&#160;&#160;0x1BAD</td></tr>
<tr class="separator:a2f5523a1aaa6718e1d11c6bc5b29a575"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:af35f872fc33e690571eb99de648e8e96"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="_x_b_o_x_r_e_c_v_8h.html#af35f872fc33e690571eb99de648e8e96">XBOX_MAX_ENDPOINTS</a>&#160;&#160;&#160;9</td></tr>
<tr class="separator:af35f872fc33e690571eb99de648e8e96"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
@ -319,6 +321,34 @@ Macros</h2></td></tr>
<p>Definition at line <a class="el" href="_x_b_o_x_r_e_c_v_8h_source.html#l00050">50</a> of file <a class="el" href="_x_b_o_x_r_e_c_v_8h_source.html">XBOXRECV.h</a>.</p>
</div>
</div>
<a class="anchor" id="a2f5523a1aaa6718e1d11c6bc5b29a575"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">#define MADCATZ_VID&#160;&#160;&#160;0x1BAD</td>
</tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="_x_b_o_x_r_e_c_v_8h_source.html#l00051">51</a> of file <a class="el" href="_x_b_o_x_r_e_c_v_8h_source.html">XBOXRECV.h</a>.</p>
</div>
</div>
<a class="anchor" id="ab029b2c21fb0c240022cc50f465d4580"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">#define JOYTECH_VID&#160;&#160;&#160;0x162E</td>
</tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="_x_b_o_x_r_e_c_v_8h_source.html#l00052">52</a> of file <a class="el" href="_x_b_o_x_r_e_c_v_8h_source.html">XBOXRECV.h</a>.</p>
</div>
</div>
<a class="anchor" id="a1a97ce2829a30b96ea6640d387d245a9"></a>
@ -331,7 +361,7 @@ Macros</h2></td></tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="_x_b_o_x_r_e_c_v_8h_source.html#l00051">51</a> of file <a class="el" href="_x_b_o_x_r_e_c_v_8h_source.html">XBOXRECV.h</a>.</p>
<p>Definition at line <a class="el" href="_x_b_o_x_r_e_c_v_8h_source.html#l00054">54</a> of file <a class="el" href="_x_b_o_x_r_e_c_v_8h_source.html">XBOXRECV.h</a>.</p>
</div>
</div>
@ -345,21 +375,7 @@ Macros</h2></td></tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="_x_b_o_x_r_e_c_v_8h_source.html#l00052">52</a> of file <a class="el" href="_x_b_o_x_r_e_c_v_8h_source.html">XBOXRECV.h</a>.</p>
</div>
</div>
<a class="anchor" id="a2f5523a1aaa6718e1d11c6bc5b29a575"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">#define MADCATZ_VID&#160;&#160;&#160;0x1BAD</td>
</tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="_x_b_o_x_r_e_c_v_8h_source.html#l00054">54</a> of file <a class="el" href="_x_b_o_x_r_e_c_v_8h_source.html">XBOXRECV.h</a>.</p>
<p>Definition at line <a class="el" href="_x_b_o_x_r_e_c_v_8h_source.html#l00055">55</a> of file <a class="el" href="_x_b_o_x_r_e_c_v_8h_source.html">XBOXRECV.h</a>.</p>
</div>
</div>
@ -373,7 +389,7 @@ Macros</h2></td></tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="_x_b_o_x_r_e_c_v_8h_source.html#l00056">56</a> of file <a class="el" href="_x_b_o_x_r_e_c_v_8h_source.html">XBOXRECV.h</a>.</p>
<p>Definition at line <a class="el" href="_x_b_o_x_r_e_c_v_8h_source.html#l00057">57</a> of file <a class="el" href="_x_b_o_x_r_e_c_v_8h_source.html">XBOXRECV.h</a>.</p>
</div>
</div>

View file

@ -1,13 +1,13 @@
<map id="XBOXRECV.h" name="XBOXRECV.h">
<area shape="rect" id="node3" href="$_usb_8h.html" title="Usb.h" alt="" coords="357,75,400,96"/>
<area shape="rect" id="node18" href="$xbox_enums_8h.html" title="xboxEnums.h" alt="" coords="581,75,651,96"/>
<area shape="rect" id="node3" href="$_usb_8h.html" title="Usb.h" alt="" coords="420,75,463,96"/>
<area shape="rect" id="node18" href="$xbox_enums_8h.html" title="xboxEnums.h" alt="" coords="725,75,795,96"/>
<area shape="rect" id="node6" href="$avrpins_8h.html" title="avrpins.h" alt="" coords="43,213,97,235"/>
<area shape="rect" id="node8" href="$max3421e_8h.html" title="max3421e.h" alt="" coords="275,213,341,235"/>
<area shape="rect" id="node9" href="$usbhost_8h.html" title="usbhost.h" alt="" coords="199,144,256,165"/>
<area shape="rect" id="node10" href="$usb__ch9_8h.html" title="usb_ch9.h" alt="" coords="123,213,181,235"/>
<area shape="rect" id="node12" href="$address_8h.html" title="address.h" alt="" coords="350,144,407,165"/>
<area shape="rect" id="node14" href="$message_8h.html" title="message.h" alt="" coords="643,144,704,165"/>
<area shape="rect" id="node16" href="$printhex_8h.html" title="printhex.h" alt="" coords="746,283,803,304"/>
<area shape="rect" id="node17" href="$hexdump_8h.html" title="hexdump.h" alt="" coords="643,213,704,235"/>
<area shape="rect" id="node19" href="$controller_enums_8h.html" title="controllerEnums.h" alt="" coords="729,144,815,165"/>
<area shape="rect" id="node8" href="$max3421e_8h.html" title="max3421e.h" alt="" coords="325,213,392,235"/>
<area shape="rect" id="node9" href="$usbhost_8h.html" title="usbhost.h" alt="" coords="186,144,243,165"/>
<area shape="rect" id="node10" href="$usb__ch9_8h.html" title="usb_ch9.h" alt="" coords="243,213,301,235"/>
<area shape="rect" id="node12" href="$address_8h.html" title="address.h" alt="" coords="413,144,469,165"/>
<area shape="rect" id="node14" href="$message_8h.html" title="message.h" alt="" coords="659,144,720,165"/>
<area shape="rect" id="node16" href="$printhex_8h.html" title="printhex.h" alt="" coords="627,283,684,304"/>
<area shape="rect" id="node17" href="$hexdump_8h.html" title="hexdump.h" alt="" coords="693,213,755,235"/>
<area shape="rect" id="node19" href="$controller_enums_8h.html" title="controllerEnums.h" alt="" coords="955,144,1041,165"/>
</map>

View file

@ -1 +1 @@
17a0a5cb3f51c98b8fdd7b345f1ab613
e0c357b5d8753a6656811410c807b605

Binary file not shown.

Before

Width:  |  Height:  |  Size: 60 KiB

After

Width:  |  Height:  |  Size: 67 KiB

View file

@ -139,86 +139,98 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
<div class="line"><a name="l00048"></a><span class="lineno"> 48</span>&#160;<span class="preprocessor"></span></div>
<div class="line"><a name="l00049"></a><span class="lineno"> 49</span>&#160;<span class="comment">// PID and VID of the different devices</span></div>
<div class="line"><a name="l00050"></a><span class="lineno"><a class="code" href="_x_b_o_x_r_e_c_v_8h.html#a8e7834e5604c4fb588cceab9258d0568"> 50</a></span>&#160;<span class="preprocessor">#define XBOX_VID 0x045E // Microsoft Corporation</span></div>
<div class="line"><a name="l00051"></a><span class="lineno"><a class="code" href="_x_b_o_x_r_e_c_v_8h.html#a1a97ce2829a30b96ea6640d387d245a9"> 51</a></span>&#160;<span class="preprocessor"></span><span class="preprocessor">#define XBOX_WIRELESS_RECEIVER_PID 0x0719 // Microsoft Wireless Gaming Receiver</span></div>
<div class="line"><a name="l00052"></a><span class="lineno"><a class="code" href="_x_b_o_x_r_e_c_v_8h.html#a6842663964e470b86786f046e4bc30d9"> 52</a></span>&#160;<span class="preprocessor"></span><span class="preprocessor">#define XBOX_WIRELESS_RECEIVER_THIRD_PARTY_PID 0x0291 // Third party Wireless Gaming Receiver</span></div>
<div class="line"><a name="l00051"></a><span class="lineno"><a class="code" href="_x_b_o_x_r_e_c_v_8h.html#a2f5523a1aaa6718e1d11c6bc5b29a575"> 51</a></span>&#160;<span class="preprocessor"></span><span class="preprocessor">#define MADCATZ_VID 0x1BAD // For unofficial Mad Catz receivers</span></div>
<div class="line"><a name="l00052"></a><span class="lineno"><a class="code" href="_x_b_o_x_r_e_c_v_8h.html#ab029b2c21fb0c240022cc50f465d4580"> 52</a></span>&#160;<span class="preprocessor"></span><span class="preprocessor">#define JOYTECH_VID 0x162E // For unofficial Joytech controllers</span></div>
<div class="line"><a name="l00053"></a><span class="lineno"> 53</span>&#160;<span class="preprocessor"></span></div>
<div class="line"><a name="l00054"></a><span class="lineno"><a class="code" href="_x_b_o_x_r_e_c_v_8h.html#a2f5523a1aaa6718e1d11c6bc5b29a575"> 54</a></span>&#160;<span class="preprocessor">#define MADCATZ_VID 0x1BAD // For unofficial Mad Catz receivers</span></div>
<div class="line"><a name="l00055"></a><span class="lineno"> 55</span>&#160;<span class="preprocessor"></span></div>
<div class="line"><a name="l00056"></a><span class="lineno"><a class="code" href="_x_b_o_x_r_e_c_v_8h.html#af35f872fc33e690571eb99de648e8e96"> 56</a></span>&#160;<span class="preprocessor">#define XBOX_MAX_ENDPOINTS 9</span></div>
<div class="line"><a name="l00057"></a><span class="lineno"> 57</span>&#160;<span class="preprocessor"></span></div>
<div class="line"><a name="l00063"></a><span class="lineno"><a class="code" href="class_x_b_o_x_r_e_c_v.html"> 63</a></span>&#160;<span class="keyword">class </span><a class="code" href="class_x_b_o_x_r_e_c_v.html">XBOXRECV</a> : <span class="keyword">public</span> <a class="code" href="class_u_s_b_device_config.html">USBDeviceConfig</a> {</div>
<div class="line"><a name="l00064"></a><span class="lineno"> 64</span>&#160;<span class="keyword">public</span>:</div>
<div class="line"><a name="l00069"></a><span class="lineno"> 69</span>&#160; <a class="code" href="class_x_b_o_x_r_e_c_v.html#ac856259af28db351f85302b5eddabf1d">XBOXRECV</a>(<a class="code" href="class_u_s_b.html">USB</a> *<a class="code" href="class_x_b_o_x_r_e_c_v.html#a53047c86c8c2f625916af62238d50fc8">pUsb</a>);</div>
<div class="line"><a name="l00070"></a><span class="lineno"> 70</span>&#160;</div>
<div class="line"><a name="l00079"></a><span class="lineno"> 79</span>&#160; <span class="keyword">virtual</span> uint8_t <a class="code" href="class_x_b_o_x_r_e_c_v.html#a07de216bf16a83501d74463c00bf1fc8">Init</a>(uint8_t parent, uint8_t port, <span class="keywordtype">bool</span> lowspeed);</div>
<div class="line"><a name="l00084"></a><span class="lineno"> 84</span>&#160; <span class="keyword">virtual</span> uint8_t <a class="code" href="class_x_b_o_x_r_e_c_v.html#ad0e6b53a818516b7d6af0beaa8cebc7a">Release</a>();</div>
<div class="line"><a name="l00089"></a><span class="lineno"> 89</span>&#160; <span class="keyword">virtual</span> uint8_t <a class="code" href="class_x_b_o_x_r_e_c_v.html#aafe1688ba3dc9b9ac425ebbbf001a1cc">Poll</a>();</div>
<div class="line"><a name="l00090"></a><span class="lineno"> 90</span>&#160;</div>
<div class="line"><a name="l00095"></a><span class="lineno"><a class="code" href="class_x_b_o_x_r_e_c_v.html#a2d58b0a20eb804d853713ade83d01631"> 95</a></span>&#160; <span class="keyword">virtual</span> uint8_t <a class="code" href="class_x_b_o_x_r_e_c_v.html#a2d58b0a20eb804d853713ade83d01631">GetAddress</a>() {</div>
<div class="line"><a name="l00096"></a><span class="lineno"> 96</span>&#160; <span class="keywordflow">return</span> <a class="code" href="class_x_b_o_x_r_e_c_v.html#a1d4bdb1b740c87fd51aca3969e67c730">bAddress</a>;</div>
<div class="line"><a name="l00097"></a><span class="lineno"> 97</span>&#160; };</div>
<div class="line"><a name="l00098"></a><span class="lineno"> 98</span>&#160;</div>
<div class="line"><a name="l00103"></a><span class="lineno"><a class="code" href="class_x_b_o_x_r_e_c_v.html#a570568108edafee8d060aad8fe40db57"> 103</a></span>&#160; <span class="keyword">virtual</span> <span class="keywordtype">bool</span> <a class="code" href="class_x_b_o_x_r_e_c_v.html#a570568108edafee8d060aad8fe40db57">isReady</a>() {</div>
<div class="line"><a name="l00104"></a><span class="lineno"> 104</span>&#160; <span class="keywordflow">return</span> bPollEnable;</div>
<div class="line"><a name="l00105"></a><span class="lineno"> 105</span>&#160; };</div>
<div class="line"><a name="l00121"></a><span class="lineno"> 121</span>&#160; uint8_t <a class="code" href="class_x_b_o_x_r_e_c_v.html#a14f355acaf2cfad072c0c7c139a3e1b2">getButtonPress</a>(<a class="code" href="controller_enums_8h.html#a03bfec859eac87be20f8952c1eb89de0">Button</a> b, uint8_t controller = 0);</div>
<div class="line"><a name="l00122"></a><span class="lineno"> 122</span>&#160; <span class="keywordtype">bool</span> <a class="code" href="class_x_b_o_x_r_e_c_v.html#a163310ab5d09b8192bebf57b4db9131f">getButtonClick</a>(<a class="code" href="controller_enums_8h.html#a03bfec859eac87be20f8952c1eb89de0">Button</a> b, uint8_t controller = 0);</div>
<div class="line"><a name="l00132"></a><span class="lineno"> 132</span>&#160; int16_t <a class="code" href="class_x_b_o_x_r_e_c_v.html#aef2c97b6f1d6eba631477f2d6c9f6de5">getAnalogHat</a>(<a class="code" href="controller_enums_8h.html#aaaabdefc068fd57ec2bef2b62ea4ba92">AnalogHat</a> a, uint8_t controller = 0);</div>
<div class="line"><a name="l00133"></a><span class="lineno"> 133</span>&#160;</div>
<div class="line"><a name="l00138"></a><span class="lineno"><a class="code" href="class_x_b_o_x_r_e_c_v.html#ad045d22c1e2f0657f72786539f418751"> 138</a></span>&#160; <span class="keywordtype">void</span> <a class="code" href="class_x_b_o_x_r_e_c_v.html#ad045d22c1e2f0657f72786539f418751">setAllOff</a>(uint8_t controller = 0) {</div>
<div class="line"><a name="l00139"></a><span class="lineno"> 139</span>&#160; <a class="code" href="class_x_b_o_x_r_e_c_v.html#addf7c0dcfbdb025f2283dcd118b5ab76">setRumbleOn</a>(0, 0, controller);</div>
<div class="line"><a name="l00140"></a><span class="lineno"> 140</span>&#160; <a class="code" href="class_x_b_o_x_r_e_c_v.html#a741fda8096331cf86cf8534b04373b4a">setLedOff</a>(controller);</div>
<div class="line"><a name="l00141"></a><span class="lineno"> 141</span>&#160; };</div>
<div class="line"><a name="l00142"></a><span class="lineno"> 142</span>&#160;</div>
<div class="line"><a name="l00147"></a><span class="lineno"><a class="code" href="class_x_b_o_x_r_e_c_v.html#a2931e13960cde2c20adbcaf34cee84c5"> 147</a></span>&#160; <span class="keywordtype">void</span> <a class="code" href="class_x_b_o_x_r_e_c_v.html#a2931e13960cde2c20adbcaf34cee84c5">setRumbleOff</a>(uint8_t controller = 0) {</div>
<div class="line"><a name="l00148"></a><span class="lineno"> 148</span>&#160; <a class="code" href="class_x_b_o_x_r_e_c_v.html#addf7c0dcfbdb025f2283dcd118b5ab76">setRumbleOn</a>(0, 0, controller);</div>
<div class="line"><a name="l00149"></a><span class="lineno"> 149</span>&#160; };</div>
<div class="line"><a name="l00156"></a><span class="lineno"> 156</span>&#160; <span class="keywordtype">void</span> <a class="code" href="class_x_b_o_x_r_e_c_v.html#addf7c0dcfbdb025f2283dcd118b5ab76">setRumbleOn</a>(uint8_t lValue, uint8_t rValue, uint8_t controller = 0);</div>
<div class="line"><a name="l00164"></a><span class="lineno"> 164</span>&#160; <span class="keywordtype">void</span> <a class="code" href="class_x_b_o_x_r_e_c_v.html#a7986a3cf050bd91c7fed44a7e7eac125">setLedRaw</a>(uint8_t value, uint8_t controller = 0);</div>
<div class="line"><a name="l00165"></a><span class="lineno"> 165</span>&#160;</div>
<div class="line"><a name="l00170"></a><span class="lineno"><a class="code" href="class_x_b_o_x_r_e_c_v.html#a741fda8096331cf86cf8534b04373b4a"> 170</a></span>&#160; <span class="keywordtype">void</span> <a class="code" href="class_x_b_o_x_r_e_c_v.html#a741fda8096331cf86cf8534b04373b4a">setLedOff</a>(uint8_t controller = 0) {</div>
<div class="line"><a name="l00171"></a><span class="lineno"> 171</span>&#160; <a class="code" href="class_x_b_o_x_r_e_c_v.html#a7986a3cf050bd91c7fed44a7e7eac125">setLedRaw</a>(0, controller);</div>
<div class="line"><a name="l00172"></a><span class="lineno"> 172</span>&#160; };</div>
<div class="line"><a name="l00178"></a><span class="lineno"> 178</span>&#160; <span class="keywordtype">void</span> <a class="code" href="class_x_b_o_x_r_e_c_v.html#a4ab056654c97c054aebb683cac95e21b">setLedOn</a>(<a class="code" href="controller_enums_8h.html#aadcb6002d2b42fdfe01490f730ab00a6">LED</a> l, uint8_t controller = 0);</div>
<div class="line"><a name="l00184"></a><span class="lineno"> 184</span>&#160; <span class="keywordtype">void</span> <a class="code" href="class_x_b_o_x_r_e_c_v.html#ad66796b66d332bfa1cb57b4ba76cb0fc">setLedBlink</a>(<a class="code" href="controller_enums_8h.html#aadcb6002d2b42fdfe01490f730ab00a6">LED</a> l, uint8_t controller = 0);</div>
<div class="line"><a name="l00190"></a><span class="lineno"> 190</span>&#160; <span class="keywordtype">void</span> <a class="code" href="class_x_b_o_x_r_e_c_v.html#abb75b732b431a29b6fef0fd7c895f41b">setLedMode</a>(<a class="code" href="xbox_enums_8h.html#a57effb96f46e458675a2653d4c543ca2">LEDMode</a> lm, uint8_t controller = 0);</div>
<div class="line"><a name="l00196"></a><span class="lineno"> 196</span>&#160; uint8_t <a class="code" href="class_x_b_o_x_r_e_c_v.html#aaa7a0d0861b8303a4b1654684d185b4f">getBatteryLevel</a>(uint8_t controller = 0);</div>
<div class="line"><a name="l00202"></a><span class="lineno"> 202</span>&#160; <span class="keywordtype">bool</span> <a class="code" href="class_x_b_o_x_r_e_c_v.html#ae78ddfff307d26b0ed35dfb75173adf7">buttonChanged</a>(uint8_t controller = 0);</div>
<div class="line"><a name="l00206"></a><span class="lineno"><a class="code" href="class_x_b_o_x_r_e_c_v.html#a5ff16bba78f05af3023f395a342b625c"> 206</a></span>&#160; <span class="keywordtype">bool</span> <a class="code" href="class_x_b_o_x_r_e_c_v.html#a5ff16bba78f05af3023f395a342b625c">XboxReceiverConnected</a>;</div>
<div class="line"><a name="l00208"></a><span class="lineno"><a class="code" href="class_x_b_o_x_r_e_c_v.html#ac07faada38e159f1e7831d90863ebe3a"> 208</a></span>&#160; uint8_t <a class="code" href="class_x_b_o_x_r_e_c_v.html#ac07faada38e159f1e7831d90863ebe3a">Xbox360Connected</a>[4];</div>
<div class="line"><a name="l00209"></a><span class="lineno"> 209</span>&#160;</div>
<div class="line"><a name="l00210"></a><span class="lineno"> 210</span>&#160;<span class="keyword">protected</span>:</div>
<div class="line"><a name="l00212"></a><span class="lineno"><a class="code" href="class_x_b_o_x_r_e_c_v.html#a53047c86c8c2f625916af62238d50fc8"> 212</a></span>&#160; <a class="code" href="class_u_s_b.html">USB</a> *<a class="code" href="class_x_b_o_x_r_e_c_v.html#a53047c86c8c2f625916af62238d50fc8">pUsb</a>;</div>
<div class="line"><a name="l00214"></a><span class="lineno"><a class="code" href="class_x_b_o_x_r_e_c_v.html#a1d4bdb1b740c87fd51aca3969e67c730"> 214</a></span>&#160; uint8_t <a class="code" href="class_x_b_o_x_r_e_c_v.html#a1d4bdb1b740c87fd51aca3969e67c730">bAddress</a>;</div>
<div class="line"><a name="l00216"></a><span class="lineno"><a class="code" href="class_x_b_o_x_r_e_c_v.html#af97c8d0efc945fa4ba1d120c8a5a9cbb"> 216</a></span>&#160; <a class="code" href="struct_ep_info.html">EpInfo</a> <a class="code" href="class_x_b_o_x_r_e_c_v.html#af97c8d0efc945fa4ba1d120c8a5a9cbb">epInfo</a>[<a class="code" href="_x_b_o_x_r_e_c_v_8h.html#af35f872fc33e690571eb99de648e8e96">XBOX_MAX_ENDPOINTS</a>];</div>
<div class="line"><a name="l00217"></a><span class="lineno"> 217</span>&#160;</div>
<div class="line"><a name="l00218"></a><span class="lineno"> 218</span>&#160;<span class="keyword">private</span>:</div>
<div class="line"><a name="l00219"></a><span class="lineno"> 219</span>&#160; <span class="keywordtype">bool</span> bPollEnable;</div>
<div class="line"><a name="l00220"></a><span class="lineno"> 220</span>&#160;</div>
<div class="line"><a name="l00221"></a><span class="lineno"> 221</span>&#160; <span class="comment">/* Variables to store the buttons */</span></div>
<div class="line"><a name="l00222"></a><span class="lineno"> 222</span>&#160; uint32_t ButtonState[4];</div>
<div class="line"><a name="l00223"></a><span class="lineno"> 223</span>&#160; uint32_t OldButtonState[4];</div>
<div class="line"><a name="l00224"></a><span class="lineno"> 224</span>&#160; uint16_t ButtonClickState[4];</div>
<div class="line"><a name="l00225"></a><span class="lineno"> 225</span>&#160; int16_t hatValue[4][4];</div>
<div class="line"><a name="l00226"></a><span class="lineno"> 226</span>&#160; uint16_t controllerStatus[4];</div>
<div class="line"><a name="l00227"></a><span class="lineno"> 227</span>&#160; <span class="keywordtype">bool</span> buttonStateChanged[4]; <span class="comment">// True if a button has changed</span></div>
<div class="line"><a name="l00054"></a><span class="lineno"><a class="code" href="_x_b_o_x_r_e_c_v_8h.html#a1a97ce2829a30b96ea6640d387d245a9"> 54</a></span>&#160;<span class="preprocessor">#define XBOX_WIRELESS_RECEIVER_PID 0x0719 // Microsoft Wireless Gaming Receiver</span></div>
<div class="line"><a name="l00055"></a><span class="lineno"><a class="code" href="_x_b_o_x_r_e_c_v_8h.html#a6842663964e470b86786f046e4bc30d9"> 55</a></span>&#160;<span class="preprocessor"></span><span class="preprocessor">#define XBOX_WIRELESS_RECEIVER_THIRD_PARTY_PID 0x0291 // Third party Wireless Gaming Receiver</span></div>
<div class="line"><a name="l00056"></a><span class="lineno"> 56</span>&#160;<span class="preprocessor"></span></div>
<div class="line"><a name="l00057"></a><span class="lineno"><a class="code" href="_x_b_o_x_r_e_c_v_8h.html#af35f872fc33e690571eb99de648e8e96"> 57</a></span>&#160;<span class="preprocessor">#define XBOX_MAX_ENDPOINTS 9</span></div>
<div class="line"><a name="l00058"></a><span class="lineno"> 58</span>&#160;<span class="preprocessor"></span></div>
<div class="line"><a name="l00064"></a><span class="lineno"><a class="code" href="class_x_b_o_x_r_e_c_v.html"> 64</a></span>&#160;<span class="keyword">class </span><a class="code" href="class_x_b_o_x_r_e_c_v.html">XBOXRECV</a> : <span class="keyword">public</span> <a class="code" href="class_u_s_b_device_config.html">USBDeviceConfig</a> {</div>
<div class="line"><a name="l00065"></a><span class="lineno"> 65</span>&#160;<span class="keyword">public</span>:</div>
<div class="line"><a name="l00070"></a><span class="lineno"> 70</span>&#160; <a class="code" href="class_x_b_o_x_r_e_c_v.html#ac856259af28db351f85302b5eddabf1d">XBOXRECV</a>(<a class="code" href="class_u_s_b.html">USB</a> *<a class="code" href="class_x_b_o_x_r_e_c_v.html#a53047c86c8c2f625916af62238d50fc8">pUsb</a>);</div>
<div class="line"><a name="l00071"></a><span class="lineno"> 71</span>&#160;</div>
<div class="line"><a name="l00080"></a><span class="lineno"> 80</span>&#160; <span class="keyword">virtual</span> uint8_t <a class="code" href="class_x_b_o_x_r_e_c_v.html#a07de216bf16a83501d74463c00bf1fc8">Init</a>(uint8_t parent, uint8_t port, <span class="keywordtype">bool</span> lowspeed);</div>
<div class="line"><a name="l00085"></a><span class="lineno"> 85</span>&#160; <span class="keyword">virtual</span> uint8_t <a class="code" href="class_x_b_o_x_r_e_c_v.html#ad0e6b53a818516b7d6af0beaa8cebc7a">Release</a>();</div>
<div class="line"><a name="l00090"></a><span class="lineno"> 90</span>&#160; <span class="keyword">virtual</span> uint8_t <a class="code" href="class_x_b_o_x_r_e_c_v.html#aafe1688ba3dc9b9ac425ebbbf001a1cc">Poll</a>();</div>
<div class="line"><a name="l00091"></a><span class="lineno"> 91</span>&#160;</div>
<div class="line"><a name="l00096"></a><span class="lineno"><a class="code" href="class_x_b_o_x_r_e_c_v.html#a2d58b0a20eb804d853713ade83d01631"> 96</a></span>&#160; <span class="keyword">virtual</span> uint8_t <a class="code" href="class_x_b_o_x_r_e_c_v.html#a2d58b0a20eb804d853713ade83d01631">GetAddress</a>() {</div>
<div class="line"><a name="l00097"></a><span class="lineno"> 97</span>&#160; <span class="keywordflow">return</span> <a class="code" href="class_x_b_o_x_r_e_c_v.html#a1d4bdb1b740c87fd51aca3969e67c730">bAddress</a>;</div>
<div class="line"><a name="l00098"></a><span class="lineno"> 98</span>&#160; };</div>
<div class="line"><a name="l00099"></a><span class="lineno"> 99</span>&#160;</div>
<div class="line"><a name="l00104"></a><span class="lineno"><a class="code" href="class_x_b_o_x_r_e_c_v.html#a570568108edafee8d060aad8fe40db57"> 104</a></span>&#160; <span class="keyword">virtual</span> <span class="keywordtype">bool</span> <a class="code" href="class_x_b_o_x_r_e_c_v.html#a570568108edafee8d060aad8fe40db57">isReady</a>() {</div>
<div class="line"><a name="l00105"></a><span class="lineno"> 105</span>&#160; <span class="keywordflow">return</span> bPollEnable;</div>
<div class="line"><a name="l00106"></a><span class="lineno"> 106</span>&#160; };</div>
<div class="line"><a name="l00107"></a><span class="lineno"> 107</span>&#160;</div>
<div class="line"><a name="l00114"></a><span class="lineno"><a class="code" href="class_x_b_o_x_r_e_c_v.html#a3881c65a52835e2eb824af1bde0a4192"> 114</a></span>&#160; <span class="keyword">virtual</span> <span class="keywordtype">boolean</span> <a class="code" href="class_x_b_o_x_r_e_c_v.html#a3881c65a52835e2eb824af1bde0a4192">VIDPIDOK</a>(uint16_t vid, uint16_t pid) {</div>
<div class="line"><a name="l00115"></a><span class="lineno"> 115</span>&#160; <span class="keywordflow">return</span> ((vid == <a class="code" href="_x_b_o_x_r_e_c_v_8h.html#a8e7834e5604c4fb588cceab9258d0568">XBOX_VID</a> || vid == <a class="code" href="_x_b_o_x_r_e_c_v_8h.html#a2f5523a1aaa6718e1d11c6bc5b29a575">MADCATZ_VID</a> || vid == <a class="code" href="_x_b_o_x_r_e_c_v_8h.html#ab029b2c21fb0c240022cc50f465d4580">JOYTECH_VID</a>) &amp;&amp; (pid == <a class="code" href="_x_b_o_x_r_e_c_v_8h.html#a1a97ce2829a30b96ea6640d387d245a9">XBOX_WIRELESS_RECEIVER_PID</a> || pid == <a class="code" href="_x_b_o_x_r_e_c_v_8h.html#a6842663964e470b86786f046e4bc30d9">XBOX_WIRELESS_RECEIVER_THIRD_PARTY_PID</a>));</div>
<div class="line"><a name="l00116"></a><span class="lineno"> 116</span>&#160; };</div>
<div class="line"><a name="l00132"></a><span class="lineno"> 132</span>&#160; uint8_t <a class="code" href="class_x_b_o_x_r_e_c_v.html#a14f355acaf2cfad072c0c7c139a3e1b2">getButtonPress</a>(<a class="code" href="controller_enums_8h.html#a03bfec859eac87be20f8952c1eb89de0">Button</a> b, uint8_t controller = 0);</div>
<div class="line"><a name="l00133"></a><span class="lineno"> 133</span>&#160; <span class="keywordtype">bool</span> <a class="code" href="class_x_b_o_x_r_e_c_v.html#a163310ab5d09b8192bebf57b4db9131f">getButtonClick</a>(<a class="code" href="controller_enums_8h.html#a03bfec859eac87be20f8952c1eb89de0">Button</a> b, uint8_t controller = 0);</div>
<div class="line"><a name="l00143"></a><span class="lineno"> 143</span>&#160; int16_t <a class="code" href="class_x_b_o_x_r_e_c_v.html#aef2c97b6f1d6eba631477f2d6c9f6de5">getAnalogHat</a>(<a class="code" href="controller_enums_8h.html#aaaabdefc068fd57ec2bef2b62ea4ba92">AnalogHat</a> a, uint8_t controller = 0);</div>
<div class="line"><a name="l00144"></a><span class="lineno"> 144</span>&#160;</div>
<div class="line"><a name="l00149"></a><span class="lineno"><a class="code" href="class_x_b_o_x_r_e_c_v.html#ad045d22c1e2f0657f72786539f418751"> 149</a></span>&#160; <span class="keywordtype">void</span> <a class="code" href="class_x_b_o_x_r_e_c_v.html#ad045d22c1e2f0657f72786539f418751">setAllOff</a>(uint8_t controller = 0) {</div>
<div class="line"><a name="l00150"></a><span class="lineno"> 150</span>&#160; <a class="code" href="class_x_b_o_x_r_e_c_v.html#addf7c0dcfbdb025f2283dcd118b5ab76">setRumbleOn</a>(0, 0, controller);</div>
<div class="line"><a name="l00151"></a><span class="lineno"> 151</span>&#160; <a class="code" href="class_x_b_o_x_r_e_c_v.html#a741fda8096331cf86cf8534b04373b4a">setLedOff</a>(controller);</div>
<div class="line"><a name="l00152"></a><span class="lineno"> 152</span>&#160; };</div>
<div class="line"><a name="l00153"></a><span class="lineno"> 153</span>&#160;</div>
<div class="line"><a name="l00158"></a><span class="lineno"><a class="code" href="class_x_b_o_x_r_e_c_v.html#a2931e13960cde2c20adbcaf34cee84c5"> 158</a></span>&#160; <span class="keywordtype">void</span> <a class="code" href="class_x_b_o_x_r_e_c_v.html#a2931e13960cde2c20adbcaf34cee84c5">setRumbleOff</a>(uint8_t controller = 0) {</div>
<div class="line"><a name="l00159"></a><span class="lineno"> 159</span>&#160; <a class="code" href="class_x_b_o_x_r_e_c_v.html#addf7c0dcfbdb025f2283dcd118b5ab76">setRumbleOn</a>(0, 0, controller);</div>
<div class="line"><a name="l00160"></a><span class="lineno"> 160</span>&#160; };</div>
<div class="line"><a name="l00167"></a><span class="lineno"> 167</span>&#160; <span class="keywordtype">void</span> <a class="code" href="class_x_b_o_x_r_e_c_v.html#addf7c0dcfbdb025f2283dcd118b5ab76">setRumbleOn</a>(uint8_t lValue, uint8_t rValue, uint8_t controller = 0);</div>
<div class="line"><a name="l00175"></a><span class="lineno"> 175</span>&#160; <span class="keywordtype">void</span> <a class="code" href="class_x_b_o_x_r_e_c_v.html#a7986a3cf050bd91c7fed44a7e7eac125">setLedRaw</a>(uint8_t value, uint8_t controller = 0);</div>
<div class="line"><a name="l00176"></a><span class="lineno"> 176</span>&#160;</div>
<div class="line"><a name="l00181"></a><span class="lineno"><a class="code" href="class_x_b_o_x_r_e_c_v.html#a741fda8096331cf86cf8534b04373b4a"> 181</a></span>&#160; <span class="keywordtype">void</span> <a class="code" href="class_x_b_o_x_r_e_c_v.html#a741fda8096331cf86cf8534b04373b4a">setLedOff</a>(uint8_t controller = 0) {</div>
<div class="line"><a name="l00182"></a><span class="lineno"> 182</span>&#160; <a class="code" href="class_x_b_o_x_r_e_c_v.html#a7986a3cf050bd91c7fed44a7e7eac125">setLedRaw</a>(0, controller);</div>
<div class="line"><a name="l00183"></a><span class="lineno"> 183</span>&#160; };</div>
<div class="line"><a name="l00189"></a><span class="lineno"> 189</span>&#160; <span class="keywordtype">void</span> <a class="code" href="class_x_b_o_x_r_e_c_v.html#a4ab056654c97c054aebb683cac95e21b">setLedOn</a>(<a class="code" href="controller_enums_8h.html#aadcb6002d2b42fdfe01490f730ab00a6">LED</a> l, uint8_t controller = 0);</div>
<div class="line"><a name="l00195"></a><span class="lineno"> 195</span>&#160; <span class="keywordtype">void</span> <a class="code" href="class_x_b_o_x_r_e_c_v.html#ad66796b66d332bfa1cb57b4ba76cb0fc">setLedBlink</a>(<a class="code" href="controller_enums_8h.html#aadcb6002d2b42fdfe01490f730ab00a6">LED</a> l, uint8_t controller = 0);</div>
<div class="line"><a name="l00201"></a><span class="lineno"> 201</span>&#160; <span class="keywordtype">void</span> <a class="code" href="class_x_b_o_x_r_e_c_v.html#abb75b732b431a29b6fef0fd7c895f41b">setLedMode</a>(<a class="code" href="xbox_enums_8h.html#a57effb96f46e458675a2653d4c543ca2">LEDMode</a> lm, uint8_t controller = 0);</div>
<div class="line"><a name="l00207"></a><span class="lineno"> 207</span>&#160; uint8_t <a class="code" href="class_x_b_o_x_r_e_c_v.html#aaa7a0d0861b8303a4b1654684d185b4f">getBatteryLevel</a>(uint8_t controller = 0);</div>
<div class="line"><a name="l00213"></a><span class="lineno"> 213</span>&#160; <span class="keywordtype">bool</span> <a class="code" href="class_x_b_o_x_r_e_c_v.html#ae78ddfff307d26b0ed35dfb75173adf7">buttonChanged</a>(uint8_t controller = 0);</div>
<div class="line"><a name="l00214"></a><span class="lineno"> 214</span>&#160;</div>
<div class="line"><a name="l00219"></a><span class="lineno"><a class="code" href="class_x_b_o_x_r_e_c_v.html#ababaa2f28de8bf6749fe649b4e93c583"> 219</a></span>&#160; <span class="keywordtype">void</span> <a class="code" href="class_x_b_o_x_r_e_c_v.html#ababaa2f28de8bf6749fe649b4e93c583">attachOnInit</a>(<span class="keywordtype">void</span> (*funcOnInit)(<span class="keywordtype">void</span>)) {</div>
<div class="line"><a name="l00220"></a><span class="lineno"> 220</span>&#160; pFuncOnInit = funcOnInit;</div>
<div class="line"><a name="l00221"></a><span class="lineno"><a class="code" href="class_x_b_o_x_r_e_c_v.html#a5ff16bba78f05af3023f395a342b625c"> 221</a></span>&#160; };</div>
<div class="line"><a name="l00225"></a><span class="lineno"> 225</span>&#160; <span class="keywordtype">bool</span> <a class="code" href="class_x_b_o_x_r_e_c_v.html#a5ff16bba78f05af3023f395a342b625c">XboxReceiverConnected</a>;</div>
<div class="line"><a name="l00227"></a><span class="lineno"><a class="code" href="class_x_b_o_x_r_e_c_v.html#ac07faada38e159f1e7831d90863ebe3a"> 227</a></span>&#160; uint8_t <a class="code" href="class_x_b_o_x_r_e_c_v.html#ac07faada38e159f1e7831d90863ebe3a">Xbox360Connected</a>[4];</div>
<div class="line"><a name="l00228"></a><span class="lineno"> 228</span>&#160;</div>
<div class="line"><a name="l00229"></a><span class="lineno"> 229</span>&#160; <span class="keywordtype">bool</span> L2Clicked[4]; <span class="comment">// These buttons are analog, so we use we use these bools to check if they where clicked or not</span></div>
<div class="line"><a name="l00230"></a><span class="lineno"> 230</span>&#160; <span class="keywordtype">bool</span> R2Clicked[4];</div>
<div class="line"><a name="l00231"></a><span class="lineno"> 231</span>&#160;</div>
<div class="line"><a name="l00232"></a><span class="lineno"> 232</span>&#160; <span class="keywordtype">unsigned</span> <span class="keywordtype">long</span> timer; <span class="comment">// Timing for checkStatus() signals</span></div>
<div class="line"><a name="l00233"></a><span class="lineno"> 233</span>&#160;</div>
<div class="line"><a name="l00234"></a><span class="lineno"> 234</span>&#160; uint8_t readBuf[<a class="code" href="_x_b_o_x_r_e_c_v_8h.html#abcb805b13bfd36145e252b0633bbcfc0">EP_MAXPKTSIZE</a>]; <span class="comment">// General purpose buffer for input data</span></div>
<div class="line"><a name="l00235"></a><span class="lineno"> 235</span>&#160; uint8_t writeBuf[<a class="code" href="_x_b_o_x_r_e_c_v_8h.html#abcb805b13bfd36145e252b0633bbcfc0">EP_MAXPKTSIZE</a>]; <span class="comment">// General purpose buffer for output data</span></div>
<div class="line"><a name="l00229"></a><span class="lineno"> 229</span>&#160;<span class="keyword">protected</span>:</div>
<div class="line"><a name="l00231"></a><span class="lineno"><a class="code" href="class_x_b_o_x_r_e_c_v.html#a53047c86c8c2f625916af62238d50fc8"> 231</a></span>&#160; <a class="code" href="class_u_s_b.html">USB</a> *<a class="code" href="class_x_b_o_x_r_e_c_v.html#a53047c86c8c2f625916af62238d50fc8">pUsb</a>;</div>
<div class="line"><a name="l00233"></a><span class="lineno"><a class="code" href="class_x_b_o_x_r_e_c_v.html#a1d4bdb1b740c87fd51aca3969e67c730"> 233</a></span>&#160; uint8_t <a class="code" href="class_x_b_o_x_r_e_c_v.html#a1d4bdb1b740c87fd51aca3969e67c730">bAddress</a>;</div>
<div class="line"><a name="l00235"></a><span class="lineno"><a class="code" href="class_x_b_o_x_r_e_c_v.html#af97c8d0efc945fa4ba1d120c8a5a9cbb"> 235</a></span>&#160; <a class="code" href="struct_ep_info.html">EpInfo</a> <a class="code" href="class_x_b_o_x_r_e_c_v.html#af97c8d0efc945fa4ba1d120c8a5a9cbb">epInfo</a>[<a class="code" href="_x_b_o_x_r_e_c_v_8h.html#af35f872fc33e690571eb99de648e8e96">XBOX_MAX_ENDPOINTS</a>];</div>
<div class="line"><a name="l00236"></a><span class="lineno"> 236</span>&#160;</div>
<div class="line"><a name="l00237"></a><span class="lineno"> 237</span>&#160; <span class="keywordtype">void</span> readReport(uint8_t controller); <span class="comment">// read incoming data</span></div>
<div class="line"><a name="l00238"></a><span class="lineno"> 238</span>&#160; <span class="keywordtype">void</span> printReport(uint8_t controller, uint8_t nBytes); <span class="comment">// print incoming date - Uncomment for debugging</span></div>
<div class="line"><a name="l00239"></a><span class="lineno"> 239</span>&#160;</div>
<div class="line"><a name="l00240"></a><span class="lineno"> 240</span>&#160; <span class="comment">/* Private commands */</span></div>
<div class="line"><a name="l00241"></a><span class="lineno"> 241</span>&#160; <span class="keywordtype">void</span> XboxCommand(uint8_t controller, uint8_t* data, uint16_t nbytes);</div>
<div class="line"><a name="l00242"></a><span class="lineno"> 242</span>&#160; <span class="keywordtype">void</span> checkStatus();</div>
<div class="line"><a name="l00243"></a><span class="lineno"> 243</span>&#160;};</div>
<div class="line"><a name="l00244"></a><span class="lineno"> 244</span>&#160;<span class="preprocessor">#endif</span></div>
<div class="line"><a name="l00237"></a><span class="lineno"> 237</span>&#160;<span class="keyword">private</span>:</div>
<div class="line"><a name="l00244"></a><span class="lineno"> 244</span>&#160; <span class="keywordtype">void</span> onInit(uint8_t controller);</div>
<div class="line"><a name="l00245"></a><span class="lineno"> 245</span>&#160; void (*pFuncOnInit)(void); <span class="comment">// Pointer to function called in onInit()</span></div>
<div class="line"><a name="l00246"></a><span class="lineno"> 246</span>&#160;</div>
<div class="line"><a name="l00247"></a><span class="lineno"> 247</span>&#160; <span class="keywordtype">bool</span> bPollEnable;</div>
<div class="line"><a name="l00248"></a><span class="lineno"> 248</span>&#160;</div>
<div class="line"><a name="l00249"></a><span class="lineno"> 249</span>&#160; <span class="comment">/* Variables to store the buttons */</span></div>
<div class="line"><a name="l00250"></a><span class="lineno"> 250</span>&#160; uint32_t ButtonState[4];</div>
<div class="line"><a name="l00251"></a><span class="lineno"> 251</span>&#160; uint32_t OldButtonState[4];</div>
<div class="line"><a name="l00252"></a><span class="lineno"> 252</span>&#160; uint16_t ButtonClickState[4];</div>
<div class="line"><a name="l00253"></a><span class="lineno"> 253</span>&#160; int16_t hatValue[4][4];</div>
<div class="line"><a name="l00254"></a><span class="lineno"> 254</span>&#160; uint16_t controllerStatus[4];</div>
<div class="line"><a name="l00255"></a><span class="lineno"> 255</span>&#160; <span class="keywordtype">bool</span> buttonStateChanged[4]; <span class="comment">// True if a button has changed</span></div>
<div class="line"><a name="l00256"></a><span class="lineno"> 256</span>&#160;</div>
<div class="line"><a name="l00257"></a><span class="lineno"> 257</span>&#160; <span class="keywordtype">bool</span> L2Clicked[4]; <span class="comment">// These buttons are analog, so we use we use these bools to check if they where clicked or not</span></div>
<div class="line"><a name="l00258"></a><span class="lineno"> 258</span>&#160; <span class="keywordtype">bool</span> R2Clicked[4];</div>
<div class="line"><a name="l00259"></a><span class="lineno"> 259</span>&#160;</div>
<div class="line"><a name="l00260"></a><span class="lineno"> 260</span>&#160; <span class="keywordtype">unsigned</span> <span class="keywordtype">long</span> timer; <span class="comment">// Timing for checkStatus() signals</span></div>
<div class="line"><a name="l00261"></a><span class="lineno"> 261</span>&#160;</div>
<div class="line"><a name="l00262"></a><span class="lineno"> 262</span>&#160; uint8_t readBuf[<a class="code" href="_x_b_o_x_r_e_c_v_8h.html#abcb805b13bfd36145e252b0633bbcfc0">EP_MAXPKTSIZE</a>]; <span class="comment">// General purpose buffer for input data</span></div>
<div class="line"><a name="l00263"></a><span class="lineno"> 263</span>&#160; uint8_t writeBuf[7]; <span class="comment">// General purpose buffer for output data</span></div>
<div class="line"><a name="l00264"></a><span class="lineno"> 264</span>&#160;</div>
<div class="line"><a name="l00265"></a><span class="lineno"> 265</span>&#160; <span class="keywordtype">void</span> readReport(uint8_t controller); <span class="comment">// read incoming data</span></div>
<div class="line"><a name="l00266"></a><span class="lineno"> 266</span>&#160; <span class="keywordtype">void</span> printReport(uint8_t controller, uint8_t nBytes); <span class="comment">// print incoming date - Uncomment for debugging</span></div>
<div class="line"><a name="l00267"></a><span class="lineno"> 267</span>&#160;</div>
<div class="line"><a name="l00268"></a><span class="lineno"> 268</span>&#160; <span class="comment">/* Private commands */</span></div>
<div class="line"><a name="l00269"></a><span class="lineno"> 269</span>&#160; <span class="keywordtype">void</span> XboxCommand(uint8_t controller, uint8_t* data, uint16_t nbytes);</div>
<div class="line"><a name="l00270"></a><span class="lineno"> 270</span>&#160; <span class="keywordtype">void</span> checkStatus();</div>
<div class="line"><a name="l00271"></a><span class="lineno"> 271</span>&#160;};</div>
<div class="line"><a name="l00272"></a><span class="lineno"> 272</span>&#160;<span class="preprocessor">#endif</span></div>
</div><!-- fragment --></div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>

View file

@ -95,7 +95,7 @@ Include dependency graph for XBOXUSB.cpp:</div>
<div class="dyncontent">
<div class="center"><img src="_x_b_o_x_u_s_b_8cpp__incl.png" border="0" usemap="#_x_b_o_x_u_s_b_8cpp" alt=""/></div>
<map name="_x_b_o_x_u_s_b_8cpp" id="_x_b_o_x_u_s_b_8cpp">
<area shape="rect" id="node2" href="_x_b_o_x_u_s_b_8h.html" title="XBOXUSB.h" alt="" coords="345,75,412,96"/><area shape="rect" id="node4" href="_usb_8h.html" title="Usb.h" alt="" coords="357,144,400,165"/><area shape="rect" id="node19" href="xbox_enums_8h.html" title="xboxEnums.h" alt="" coords="581,144,651,165"/><area shape="rect" id="node7" href="avrpins_8h.html" title="avrpins.h" alt="" coords="43,283,97,304"/><area shape="rect" id="node9" href="max3421e_8h.html" title="max3421e.h" alt="" coords="275,283,341,304"/><area shape="rect" id="node10" href="usbhost_8h.html" title="usbhost.h" alt="" coords="199,213,256,235"/><area shape="rect" id="node11" href="usb__ch9_8h.html" title="usb_ch9.h" alt="" coords="123,283,181,304"/><area shape="rect" id="node13" href="address_8h.html" title="address.h" alt="" coords="350,213,407,235"/><area shape="rect" id="node15" href="message_8h.html" title="message.h" alt="" coords="643,213,704,235"/><area shape="rect" id="node17" href="printhex_8h.html" title="printhex.h" alt="" coords="746,352,803,373"/><area shape="rect" id="node18" href="hexdump_8h.html" title="hexdump.h" alt="" coords="643,283,704,304"/><area shape="rect" id="node20" href="controller_enums_8h.html" title="controllerEnums.h" alt="" coords="729,213,815,235"/></map>
<area shape="rect" id="node2" href="_x_b_o_x_u_s_b_8h.html" title="XBOXUSB.h" alt="" coords="407,75,475,96"/><area shape="rect" id="node4" href="_usb_8h.html" title="Usb.h" alt="" coords="420,144,463,165"/><area shape="rect" id="node19" href="xbox_enums_8h.html" title="xboxEnums.h" alt="" coords="725,144,795,165"/><area shape="rect" id="node7" href="avrpins_8h.html" title="avrpins.h" alt="" coords="43,283,97,304"/><area shape="rect" id="node9" href="max3421e_8h.html" title="max3421e.h" alt="" coords="325,283,392,304"/><area shape="rect" id="node10" href="usbhost_8h.html" title="usbhost.h" alt="" coords="186,213,243,235"/><area shape="rect" id="node11" href="usb__ch9_8h.html" title="usb_ch9.h" alt="" coords="243,283,301,304"/><area shape="rect" id="node13" href="address_8h.html" title="address.h" alt="" coords="413,213,469,235"/><area shape="rect" id="node15" href="message_8h.html" title="message.h" alt="" coords="659,213,720,235"/><area shape="rect" id="node17" href="printhex_8h.html" title="printhex.h" alt="" coords="627,352,684,373"/><area shape="rect" id="node18" href="hexdump_8h.html" title="hexdump.h" alt="" coords="693,283,755,304"/><area shape="rect" id="node20" href="controller_enums_8h.html" title="controllerEnums.h" alt="" coords="955,213,1041,235"/></map>
</div>
</div>
<p><a href="_x_b_o_x_u_s_b_8cpp_source.html">Go to the source code of this file.</a></p>

View file

@ -1,14 +1,14 @@
<map id="XBOXUSB.cpp" name="XBOXUSB.cpp">
<area shape="rect" id="node2" href="$_x_b_o_x_u_s_b_8h.html" title="XBOXUSB.h" alt="" coords="345,75,412,96"/>
<area shape="rect" id="node4" href="$_usb_8h.html" title="Usb.h" alt="" coords="357,144,400,165"/>
<area shape="rect" id="node19" href="$xbox_enums_8h.html" title="xboxEnums.h" alt="" coords="581,144,651,165"/>
<area shape="rect" id="node2" href="$_x_b_o_x_u_s_b_8h.html" title="XBOXUSB.h" alt="" coords="407,75,475,96"/>
<area shape="rect" id="node4" href="$_usb_8h.html" title="Usb.h" alt="" coords="420,144,463,165"/>
<area shape="rect" id="node19" href="$xbox_enums_8h.html" title="xboxEnums.h" alt="" coords="725,144,795,165"/>
<area shape="rect" id="node7" href="$avrpins_8h.html" title="avrpins.h" alt="" coords="43,283,97,304"/>
<area shape="rect" id="node9" href="$max3421e_8h.html" title="max3421e.h" alt="" coords="275,283,341,304"/>
<area shape="rect" id="node10" href="$usbhost_8h.html" title="usbhost.h" alt="" coords="199,213,256,235"/>
<area shape="rect" id="node11" href="$usb__ch9_8h.html" title="usb_ch9.h" alt="" coords="123,283,181,304"/>
<area shape="rect" id="node13" href="$address_8h.html" title="address.h" alt="" coords="350,213,407,235"/>
<area shape="rect" id="node15" href="$message_8h.html" title="message.h" alt="" coords="643,213,704,235"/>
<area shape="rect" id="node17" href="$printhex_8h.html" title="printhex.h" alt="" coords="746,352,803,373"/>
<area shape="rect" id="node18" href="$hexdump_8h.html" title="hexdump.h" alt="" coords="643,283,704,304"/>
<area shape="rect" id="node20" href="$controller_enums_8h.html" title="controllerEnums.h" alt="" coords="729,213,815,235"/>
<area shape="rect" id="node9" href="$max3421e_8h.html" title="max3421e.h" alt="" coords="325,283,392,304"/>
<area shape="rect" id="node10" href="$usbhost_8h.html" title="usbhost.h" alt="" coords="186,213,243,235"/>
<area shape="rect" id="node11" href="$usb__ch9_8h.html" title="usb_ch9.h" alt="" coords="243,283,301,304"/>
<area shape="rect" id="node13" href="$address_8h.html" title="address.h" alt="" coords="413,213,469,235"/>
<area shape="rect" id="node15" href="$message_8h.html" title="message.h" alt="" coords="659,213,720,235"/>
<area shape="rect" id="node17" href="$printhex_8h.html" title="printhex.h" alt="" coords="627,352,684,373"/>
<area shape="rect" id="node18" href="$hexdump_8h.html" title="hexdump.h" alt="" coords="693,283,755,304"/>
<area shape="rect" id="node20" href="$controller_enums_8h.html" title="controllerEnums.h" alt="" coords="955,213,1041,235"/>
</map>

View file

@ -1 +1 @@
e0b5f50a0597a1ef535805e8be65fdb4
a1144df8abc2e97cc5b957e2a2e9cc4d

Binary file not shown.

Before

Width:  |  Height:  |  Size: 62 KiB

After

Width:  |  Height:  |  Size: 68 KiB

View file

@ -115,7 +115,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
<div class="line"><a name="l00024"></a><span class="lineno"> 24</span>&#160;pUsb(p), <span class="comment">// pointer to USB class instance - mandatory</span></div>
<div class="line"><a name="l00025"></a><span class="lineno"> 25</span>&#160;bAddress(0), <span class="comment">// device address - mandatory</span></div>
<div class="line"><a name="l00026"></a><span class="lineno"> 26</span>&#160;bPollEnable(false) { <span class="comment">// don&#39;t start polling before dongle is connected</span></div>
<div class="line"><a name="l00027"></a><span class="lineno"> 27</span>&#160; <span class="keywordflow">for</span> (uint8_t i = 0; i &lt; <a class="code" href="_x_b_o_x_r_e_c_v_8h.html#af35f872fc33e690571eb99de648e8e96">XBOX_MAX_ENDPOINTS</a>; i++) {</div>
<div class="line"><a name="l00027"></a><span class="lineno"> 27</span>&#160; <span class="keywordflow">for</span> (uint8_t i = 0; i &lt; <a class="code" href="_x_b_o_x_o_l_d_8h.html#af35f872fc33e690571eb99de648e8e96">XBOX_MAX_ENDPOINTS</a>; i++) {</div>
<div class="line"><a name="l00028"></a><span class="lineno"> 28</span>&#160; <a class="code" href="class_x_b_o_x_u_s_b.html#abef4a852d877d8136f198431ce54550f">epInfo</a>[i].<a class="code" href="struct_ep_info.html#a9f92be74c75c037b39e2cae1eb49b89b">epAddr</a> = 0;</div>
<div class="line"><a name="l00029"></a><span class="lineno"> 29</span>&#160; <a class="code" href="class_x_b_o_x_u_s_b.html#abef4a852d877d8136f198431ce54550f">epInfo</a>[i].<a class="code" href="struct_ep_info.html#aa2ca775b63736df4008e88da7dd4dddb">maxPktSize</a> = (i) ? 0 : 8;</div>
<div class="line"><a name="l00030"></a><span class="lineno"> 30</span>&#160; <a class="code" href="class_x_b_o_x_u_s_b.html#abef4a852d877d8136f198431ce54550f">epInfo</a>[i].<a class="code" href="struct_ep_info.html#a1dea928517c961235eef7b0876e69f10">epAttribs</a> = 0;</div>
@ -137,12 +137,12 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
<div class="line"><a name="l00046"></a><span class="lineno"> 46</span>&#160; <span class="comment">// get memory address of USB device address pool</span></div>
<div class="line"><a name="l00047"></a><span class="lineno"> 47</span>&#160; <a class="code" href="class_address_pool.html">AddressPool</a> &amp;addrPool = <a class="code" href="class_x_b_o_x_u_s_b.html#a9c701658d4f63b5407cbcd5b78d8eb18">pUsb</a>-&gt;<a class="code" href="class_u_s_b.html#a66ab8f5eda239e761d5a48741ea1f9d4">GetAddressPool</a>();</div>
<div class="line"><a name="l00048"></a><span class="lineno"> 48</span>&#160;<span class="preprocessor">#ifdef EXTRADEBUG</span></div>
<div class="line"><a name="l00049"></a><span class="lineno"> 49</span>&#160;<span class="preprocessor"></span> <a class="code" href="message_8h.html#a747819b0aa34f5c3ba0332c2db28c846">Notify</a>(PSTR(<span class="stringliteral">&quot;\r\nXBOXUSB Init&quot;</span>), 0x80);</div>
<div class="line"><a name="l00049"></a><span class="lineno"> 49</span>&#160;<span class="preprocessor"></span> <a class="code" href="message_8h.html#a27117e124c5d66d5512fe8d494fe6338">Notify</a>(PSTR(<span class="stringliteral">&quot;\r\nXBOXUSB Init&quot;</span>), 0x80);</div>
<div class="line"><a name="l00050"></a><span class="lineno"> 50</span>&#160;<span class="preprocessor">#endif</span></div>
<div class="line"><a name="l00051"></a><span class="lineno"> 51</span>&#160;<span class="preprocessor"></span> <span class="comment">// check if address has already been assigned to an instance</span></div>
<div class="line"><a name="l00052"></a><span class="lineno"> 52</span>&#160; <span class="keywordflow">if</span> (<a class="code" href="class_x_b_o_x_u_s_b.html#a5e9c00af9f4b978c53819791b0a0eb65">bAddress</a>) {</div>
<div class="line"><a name="l00053"></a><span class="lineno"> 53</span>&#160;<span class="preprocessor">#ifdef DEBUG_USB_HOST</span></div>
<div class="line"><a name="l00054"></a><span class="lineno"> 54</span>&#160;<span class="preprocessor"></span> <a class="code" href="message_8h.html#a747819b0aa34f5c3ba0332c2db28c846">Notify</a>(PSTR(<span class="stringliteral">&quot;\r\nAddress in use&quot;</span>), 0x80);</div>
<div class="line"><a name="l00054"></a><span class="lineno"> 54</span>&#160;<span class="preprocessor"></span> <a class="code" href="message_8h.html#a27117e124c5d66d5512fe8d494fe6338">Notify</a>(PSTR(<span class="stringliteral">&quot;\r\nAddress in use&quot;</span>), 0x80);</div>
<div class="line"><a name="l00055"></a><span class="lineno"> 55</span>&#160;<span class="preprocessor">#endif</span></div>
<div class="line"><a name="l00056"></a><span class="lineno"> 56</span>&#160;<span class="preprocessor"></span> <span class="keywordflow">return</span> <a class="code" href="_usb_8h.html#a44416ff64fc0e3691f98addac13d4595">USB_ERROR_CLASS_INSTANCE_ALREADY_IN_USE</a>;</div>
<div class="line"><a name="l00057"></a><span class="lineno"> 57</span>&#160; }</div>
@ -152,14 +152,14 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
<div class="line"><a name="l00061"></a><span class="lineno"> 61</span>&#160;</div>
<div class="line"><a name="l00062"></a><span class="lineno"> 62</span>&#160; <span class="keywordflow">if</span> (!p) {</div>
<div class="line"><a name="l00063"></a><span class="lineno"> 63</span>&#160;<span class="preprocessor">#ifdef DEBUG_USB_HOST</span></div>
<div class="line"><a name="l00064"></a><span class="lineno"> 64</span>&#160;<span class="preprocessor"></span> <a class="code" href="message_8h.html#a747819b0aa34f5c3ba0332c2db28c846">Notify</a>(PSTR(<span class="stringliteral">&quot;\r\nAddress not found&quot;</span>), 0x80);</div>
<div class="line"><a name="l00064"></a><span class="lineno"> 64</span>&#160;<span class="preprocessor"></span> <a class="code" href="message_8h.html#a27117e124c5d66d5512fe8d494fe6338">Notify</a>(PSTR(<span class="stringliteral">&quot;\r\nAddress not found&quot;</span>), 0x80);</div>
<div class="line"><a name="l00065"></a><span class="lineno"> 65</span>&#160;<span class="preprocessor">#endif</span></div>
<div class="line"><a name="l00066"></a><span class="lineno"> 66</span>&#160;<span class="preprocessor"></span> <span class="keywordflow">return</span> <a class="code" href="_usb_8h.html#afe2fedb4b0ccc89a688c0b4b59691ce0">USB_ERROR_ADDRESS_NOT_FOUND_IN_POOL</a>;</div>
<div class="line"><a name="l00067"></a><span class="lineno"> 67</span>&#160; }</div>
<div class="line"><a name="l00068"></a><span class="lineno"> 68</span>&#160;</div>
<div class="line"><a name="l00069"></a><span class="lineno"> 69</span>&#160; <span class="keywordflow">if</span> (!p-&gt;<a class="code" href="struct_usb_device.html#a410d39fb7758157f57794335e990ed02">epinfo</a>) {</div>
<div class="line"><a name="l00070"></a><span class="lineno"> 70</span>&#160;<span class="preprocessor">#ifdef DEBUG_USB_HOST</span></div>
<div class="line"><a name="l00071"></a><span class="lineno"> 71</span>&#160;<span class="preprocessor"></span> <a class="code" href="message_8h.html#a747819b0aa34f5c3ba0332c2db28c846">Notify</a>(PSTR(<span class="stringliteral">&quot;\r\nepinfo is null&quot;</span>), 0x80);</div>
<div class="line"><a name="l00071"></a><span class="lineno"> 71</span>&#160;<span class="preprocessor"></span> <a class="code" href="message_8h.html#a27117e124c5d66d5512fe8d494fe6338">Notify</a>(PSTR(<span class="stringliteral">&quot;\r\nepinfo is null&quot;</span>), 0x80);</div>
<div class="line"><a name="l00072"></a><span class="lineno"> 72</span>&#160;<span class="preprocessor">#endif</span></div>
<div class="line"><a name="l00073"></a><span class="lineno"> 73</span>&#160;<span class="preprocessor"></span> <span class="keywordflow">return</span> <a class="code" href="_usb_8h.html#af192c59cafe2192ad802b22e6dbc077d">USB_ERROR_EPINFO_IS_NULL</a>;</div>
<div class="line"><a name="l00074"></a><span class="lineno"> 74</span>&#160; }</div>
@ -183,259 +183,269 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
<div class="line"><a name="l00092"></a><span class="lineno"> 92</span>&#160; VID = ((<a class="code" href="struct_u_s_b___d_e_v_i_c_e___d_e_s_c_r_i_p_t_o_r.html">USB_DEVICE_DESCRIPTOR</a>*)buf)-&gt;idVendor;</div>
<div class="line"><a name="l00093"></a><span class="lineno"> 93</span>&#160; PID = ((<a class="code" href="struct_u_s_b___d_e_v_i_c_e___d_e_s_c_r_i_p_t_o_r.html">USB_DEVICE_DESCRIPTOR</a>*)buf)-&gt;idProduct;</div>
<div class="line"><a name="l00094"></a><span class="lineno"> 94</span>&#160;</div>
<div class="line"><a name="l00095"></a><span class="lineno"> 95</span>&#160; <span class="keywordflow">if</span> (VID != <a class="code" href="_x_b_o_x_r_e_c_v_8h.html#a8e7834e5604c4fb588cceab9258d0568">XBOX_VID</a> &amp;&amp; VID != <a class="code" href="_x_b_o_x_r_e_c_v_8h.html#a2f5523a1aaa6718e1d11c6bc5b29a575">MADCATZ_VID</a> &amp;&amp; VID != <a class="code" href="_x_b_o_x_u_s_b_8h.html#ab029b2c21fb0c240022cc50f465d4580">JOYTECH_VID</a>) <span class="comment">// We just check if it&#39;s a xbox controller using the Vendor ID</span></div>
<div class="line"><a name="l00095"></a><span class="lineno"> 95</span>&#160; <span class="keywordflow">if</span> (VID != <a class="code" href="_x_b_o_x_o_l_d_8h.html#a8e7834e5604c4fb588cceab9258d0568">XBOX_VID</a> &amp;&amp; VID != <a class="code" href="_x_b_o_x_o_l_d_8h.html#a2f5523a1aaa6718e1d11c6bc5b29a575">MADCATZ_VID</a> &amp;&amp; VID != <a class="code" href="_x_b_o_x_o_l_d_8h.html#ab029b2c21fb0c240022cc50f465d4580">JOYTECH_VID</a>) <span class="comment">// Check VID</span></div>
<div class="line"><a name="l00096"></a><span class="lineno"> 96</span>&#160; <span class="keywordflow">goto</span> FailUnknownDevice;</div>
<div class="line"><a name="l00097"></a><span class="lineno"> 97</span>&#160; <span class="keywordflow">if</span> (PID == <a class="code" href="_x_b_o_x_u_s_b_8h.html#a10c2a7a8da78e76d7020c2c347f0a687">XBOX_WIRELESS_PID</a>) {</div>
<div class="line"><a name="l00098"></a><span class="lineno"> 98</span>&#160;<span class="preprocessor">#ifdef DEBUG_USB_HOST</span></div>
<div class="line"><a name="l00099"></a><span class="lineno"> 99</span>&#160;<span class="preprocessor"></span> <a class="code" href="message_8h.html#a747819b0aa34f5c3ba0332c2db28c846">Notify</a>(PSTR(<span class="stringliteral">&quot;\r\nYou have plugged in a wireless Xbox 360 controller - it doesn&#39;t support USB communication&quot;</span>), 0x80);</div>
<div class="line"><a name="l00099"></a><span class="lineno"> 99</span>&#160;<span class="preprocessor"></span> <a class="code" href="message_8h.html#a27117e124c5d66d5512fe8d494fe6338">Notify</a>(PSTR(<span class="stringliteral">&quot;\r\nYou have plugged in a wireless Xbox 360 controller - it doesn&#39;t support USB communication&quot;</span>), 0x80);</div>
<div class="line"><a name="l00100"></a><span class="lineno"> 100</span>&#160;<span class="preprocessor">#endif</span></div>
<div class="line"><a name="l00101"></a><span class="lineno"> 101</span>&#160;<span class="preprocessor"></span> <span class="keywordflow">goto</span> FailUnknownDevice;</div>
<div class="line"><a name="l00102"></a><span class="lineno"> 102</span>&#160; } <span class="keywordflow">else</span> <span class="keywordflow">if</span> (PID == <a class="code" href="_x_b_o_x_r_e_c_v_8h.html#a1a97ce2829a30b96ea6640d387d245a9">XBOX_WIRELESS_RECEIVER_PID</a> || PID == <a class="code" href="_x_b_o_x_r_e_c_v_8h.html#a6842663964e470b86786f046e4bc30d9">XBOX_WIRELESS_RECEIVER_THIRD_PARTY_PID</a>) {</div>
<div class="line"><a name="l00103"></a><span class="lineno"> 103</span>&#160;<span class="preprocessor">#ifdef DEBUG_USB_HOST</span></div>
<div class="line"><a name="l00104"></a><span class="lineno"> 104</span>&#160;<span class="preprocessor"></span> <a class="code" href="message_8h.html#a747819b0aa34f5c3ba0332c2db28c846">Notify</a>(PSTR(<span class="stringliteral">&quot;\r\nThis library only supports Xbox 360 controllers via USB&quot;</span>), 0x80);</div>
<div class="line"><a name="l00104"></a><span class="lineno"> 104</span>&#160;<span class="preprocessor"></span> <a class="code" href="message_8h.html#a27117e124c5d66d5512fe8d494fe6338">Notify</a>(PSTR(<span class="stringliteral">&quot;\r\nThis library only supports Xbox 360 controllers via USB&quot;</span>), 0x80);</div>
<div class="line"><a name="l00105"></a><span class="lineno"> 105</span>&#160;<span class="preprocessor">#endif</span></div>
<div class="line"><a name="l00106"></a><span class="lineno"> 106</span>&#160;<span class="preprocessor"></span> <span class="keywordflow">goto</span> FailUnknownDevice;</div>
<div class="line"><a name="l00107"></a><span class="lineno"> 107</span>&#160; }</div>
<div class="line"><a name="l00108"></a><span class="lineno"> 108</span>&#160;</div>
<div class="line"><a name="l00109"></a><span class="lineno"> 109</span>&#160; <span class="comment">// Allocate new address according to device class</span></div>
<div class="line"><a name="l00110"></a><span class="lineno"> 110</span>&#160; <a class="code" href="class_x_b_o_x_u_s_b.html#a5e9c00af9f4b978c53819791b0a0eb65">bAddress</a> = addrPool.<a class="code" href="class_address_pool.html#a97df4ef42e50960ce2165f4cdb53e590">AllocAddress</a>(parent, <span class="keyword">false</span>, port);</div>
<div class="line"><a name="l00111"></a><span class="lineno"> 111</span>&#160;</div>
<div class="line"><a name="l00112"></a><span class="lineno"> 112</span>&#160; <span class="keywordflow">if</span> (!<a class="code" href="class_x_b_o_x_u_s_b.html#a5e9c00af9f4b978c53819791b0a0eb65">bAddress</a>)</div>
<div class="line"><a name="l00113"></a><span class="lineno"> 113</span>&#160; <span class="keywordflow">return</span> <a class="code" href="_usb_8h.html#a15370eb665cdded5514e69ca58d9f39d">USB_ERROR_OUT_OF_ADDRESS_SPACE_IN_POOL</a>;</div>
<div class="line"><a name="l00114"></a><span class="lineno"> 114</span>&#160;</div>
<div class="line"><a name="l00115"></a><span class="lineno"> 115</span>&#160; <span class="comment">// Extract Max Packet Size from device descriptor</span></div>
<div class="line"><a name="l00116"></a><span class="lineno"> 116</span>&#160; <a class="code" href="class_x_b_o_x_u_s_b.html#abef4a852d877d8136f198431ce54550f">epInfo</a>[0].<a class="code" href="struct_ep_info.html#aa2ca775b63736df4008e88da7dd4dddb">maxPktSize</a> = (uint8_t)((<a class="code" href="struct_u_s_b___d_e_v_i_c_e___d_e_s_c_r_i_p_t_o_r.html">USB_DEVICE_DESCRIPTOR</a>*)buf)-&gt;bMaxPacketSize0;</div>
<div class="line"><a name="l00117"></a><span class="lineno"> 117</span>&#160;</div>
<div class="line"><a name="l00118"></a><span class="lineno"> 118</span>&#160; <span class="comment">// Assign new address to the device</span></div>
<div class="line"><a name="l00119"></a><span class="lineno"> 119</span>&#160; rcode = <a class="code" href="class_x_b_o_x_u_s_b.html#a9c701658d4f63b5407cbcd5b78d8eb18">pUsb</a>-&gt;<a class="code" href="class_u_s_b.html#a3aea534daed66b5606fa798df7ad3c47">setAddr</a>(0, 0, <a class="code" href="class_x_b_o_x_u_s_b.html#a5e9c00af9f4b978c53819791b0a0eb65">bAddress</a>);</div>
<div class="line"><a name="l00120"></a><span class="lineno"> 120</span>&#160; <span class="keywordflow">if</span> (rcode) {</div>
<div class="line"><a name="l00121"></a><span class="lineno"> 121</span>&#160; p-&gt;<a class="code" href="struct_usb_device.html#a86a815577ad7883437d3ca72b32b8e8a">lowspeed</a> = <span class="keyword">false</span>;</div>
<div class="line"><a name="l00122"></a><span class="lineno"> 122</span>&#160; addrPool.<a class="code" href="class_address_pool.html#a15fde13223dcb1da89305ad229763562">FreeAddress</a>(<a class="code" href="class_x_b_o_x_u_s_b.html#a5e9c00af9f4b978c53819791b0a0eb65">bAddress</a>);</div>
<div class="line"><a name="l00123"></a><span class="lineno"> 123</span>&#160; <a class="code" href="class_x_b_o_x_u_s_b.html#a5e9c00af9f4b978c53819791b0a0eb65">bAddress</a> = 0;</div>
<div class="line"><a name="l00124"></a><span class="lineno"> 124</span>&#160;<span class="preprocessor">#ifdef DEBUG_USB_HOST</span></div>
<div class="line"><a name="l00125"></a><span class="lineno"> 125</span>&#160;<span class="preprocessor"></span> <a class="code" href="message_8h.html#a747819b0aa34f5c3ba0332c2db28c846">Notify</a>(PSTR(<span class="stringliteral">&quot;\r\nsetAddr: &quot;</span>), 0x80);</div>
<div class="line"><a name="l00126"></a><span class="lineno"> 126</span>&#160;<span class="preprocessor">#endif</span></div>
<div class="line"><a name="l00127"></a><span class="lineno"> 127</span>&#160;<span class="preprocessor"></span> D_PrintHex&lt;uint8_t &gt; (rcode, 0x80);</div>
<div class="line"><a name="l00128"></a><span class="lineno"> 128</span>&#160; <span class="keywordflow">return</span> rcode;</div>
<div class="line"><a name="l00129"></a><span class="lineno"> 129</span>&#160; }</div>
<div class="line"><a name="l00130"></a><span class="lineno"> 130</span>&#160;<span class="preprocessor">#ifdef EXTRADEBUG</span></div>
<div class="line"><a name="l00131"></a><span class="lineno"> 131</span>&#160;<span class="preprocessor"></span> <a class="code" href="message_8h.html#a747819b0aa34f5c3ba0332c2db28c846">Notify</a>(PSTR(<span class="stringliteral">&quot;\r\nAddr: &quot;</span>), 0x80);</div>
<div class="line"><a name="l00132"></a><span class="lineno"> 132</span>&#160; D_PrintHex&lt;uint8_t &gt; (<a class="code" href="class_x_b_o_x_u_s_b.html#a5e9c00af9f4b978c53819791b0a0eb65">bAddress</a>, 0x80);</div>
<div class="line"><a name="l00133"></a><span class="lineno"> 133</span>&#160;<span class="preprocessor">#endif</span></div>
<div class="line"><a name="l00134"></a><span class="lineno"> 134</span>&#160;<span class="preprocessor"></span> p-&gt;<a class="code" href="struct_usb_device.html#a86a815577ad7883437d3ca72b32b8e8a">lowspeed</a> = <span class="keyword">false</span>;</div>
<div class="line"><a name="l00135"></a><span class="lineno"> 135</span>&#160;</div>
<div class="line"><a name="l00136"></a><span class="lineno"> 136</span>&#160; <span class="comment">//get pointer to assigned address record</span></div>
<div class="line"><a name="l00137"></a><span class="lineno"> 137</span>&#160; p = addrPool.<a class="code" href="class_address_pool.html#aa92d7e8f0f515340ae2dc1679b627056">GetUsbDevicePtr</a>(bAddress);</div>
<div class="line"><a name="l00138"></a><span class="lineno"> 138</span>&#160; <span class="keywordflow">if</span> (!p)</div>
<div class="line"><a name="l00139"></a><span class="lineno"> 139</span>&#160; <span class="keywordflow">return</span> <a class="code" href="_usb_8h.html#afe2fedb4b0ccc89a688c0b4b59691ce0">USB_ERROR_ADDRESS_NOT_FOUND_IN_POOL</a>;</div>
<div class="line"><a name="l00140"></a><span class="lineno"> 140</span>&#160;</div>
<div class="line"><a name="l00141"></a><span class="lineno"> 141</span>&#160; p-&gt;<a class="code" href="struct_usb_device.html#a86a815577ad7883437d3ca72b32b8e8a">lowspeed</a> = lowspeed;</div>
<div class="line"><a name="l00142"></a><span class="lineno"> 142</span>&#160;</div>
<div class="line"><a name="l00143"></a><span class="lineno"> 143</span>&#160; <span class="comment">// Assign epInfo to epinfo pointer - only EP0 is known</span></div>
<div class="line"><a name="l00144"></a><span class="lineno"> 144</span>&#160; rcode = <a class="code" href="class_x_b_o_x_u_s_b.html#a9c701658d4f63b5407cbcd5b78d8eb18">pUsb</a>-&gt;<a class="code" href="class_u_s_b.html#a6c3ba3f7e6dccb450267011ce783d7ea">setEpInfoEntry</a>(bAddress, 1, <a class="code" href="class_x_b_o_x_u_s_b.html#abef4a852d877d8136f198431ce54550f">epInfo</a>);</div>
<div class="line"><a name="l00145"></a><span class="lineno"> 145</span>&#160; <span class="keywordflow">if</span> (rcode)</div>
<div class="line"><a name="l00146"></a><span class="lineno"> 146</span>&#160; <span class="keywordflow">goto</span> FailSetDevTblEntry;</div>
<div class="line"><a name="l00147"></a><span class="lineno"> 147</span>&#160;</div>
<div class="line"><a name="l00148"></a><span class="lineno"> 148</span>&#160; <span class="comment">/* The application will work in reduced host mode, so we can save program and data</span></div>
<div class="line"><a name="l00149"></a><span class="lineno"> 149</span>&#160;<span class="comment"> memory space. After verifying the VID we will use known values for the</span></div>
<div class="line"><a name="l00150"></a><span class="lineno"> 150</span>&#160;<span class="comment"> configuration values for device, interface, endpoints and HID for the XBOX360 Controllers */</span></div>
<div class="line"><a name="l00151"></a><span class="lineno"> 151</span>&#160;</div>
<div class="line"><a name="l00152"></a><span class="lineno"> 152</span>&#160; <span class="comment">/* Initialize data structures for endpoints of device */</span></div>
<div class="line"><a name="l00153"></a><span class="lineno"> 153</span>&#160; <a class="code" href="class_x_b_o_x_u_s_b.html#abef4a852d877d8136f198431ce54550f">epInfo</a>[ <a class="code" href="_x_b_o_x_u_s_b_8h.html#a4fd9ad9bf7a7d5767940c2ec224ef5e8">XBOX_INPUT_PIPE</a> ].<a class="code" href="struct_ep_info.html#a9f92be74c75c037b39e2cae1eb49b89b">epAddr</a> = 0x01; <span class="comment">// XBOX 360 report endpoint</span></div>
<div class="line"><a name="l00154"></a><span class="lineno"> 154</span>&#160; <a class="code" href="class_x_b_o_x_u_s_b.html#abef4a852d877d8136f198431ce54550f">epInfo</a>[ <a class="code" href="_x_b_o_x_u_s_b_8h.html#a4fd9ad9bf7a7d5767940c2ec224ef5e8">XBOX_INPUT_PIPE</a> ].<a class="code" href="struct_ep_info.html#a1dea928517c961235eef7b0876e69f10">epAttribs</a> = <a class="code" href="_p_s3_u_s_b_8h.html#ad4d26e1c566064f2259faf65f0858b6e">EP_INTERRUPT</a>;</div>
<div class="line"><a name="l00155"></a><span class="lineno"> 155</span>&#160; <a class="code" href="class_x_b_o_x_u_s_b.html#abef4a852d877d8136f198431ce54550f">epInfo</a>[ <a class="code" href="_x_b_o_x_u_s_b_8h.html#a4fd9ad9bf7a7d5767940c2ec224ef5e8">XBOX_INPUT_PIPE</a> ].<a class="code" href="struct_ep_info.html#a3a5b1c017a034cd9e06e76729e727c46">bmNakPower</a> = <a class="code" href="address_8h.html#a660e8da9c1167a8450aef91c5c03761d">USB_NAK_NOWAIT</a>; <span class="comment">// Only poll once for interrupt endpoints</span></div>
<div class="line"><a name="l00156"></a><span class="lineno"> 156</span>&#160; <a class="code" href="class_x_b_o_x_u_s_b.html#abef4a852d877d8136f198431ce54550f">epInfo</a>[ <a class="code" href="_x_b_o_x_u_s_b_8h.html#a4fd9ad9bf7a7d5767940c2ec224ef5e8">XBOX_INPUT_PIPE</a> ].<a class="code" href="struct_ep_info.html#aa2ca775b63736df4008e88da7dd4dddb">maxPktSize</a> = <a class="code" href="_p_s3_u_s_b_8h.html#abcb805b13bfd36145e252b0633bbcfc0">EP_MAXPKTSIZE</a>;</div>
<div class="line"><a name="l00157"></a><span class="lineno"> 157</span>&#160; <a class="code" href="class_x_b_o_x_u_s_b.html#abef4a852d877d8136f198431ce54550f">epInfo</a>[ <a class="code" href="_x_b_o_x_u_s_b_8h.html#a4fd9ad9bf7a7d5767940c2ec224ef5e8">XBOX_INPUT_PIPE</a> ].<a class="code" href="struct_ep_info.html#ac85bff70ad0e5d71e50cb501f4d8caf3">bmSndToggle</a> = <a class="code" href="max3421e_8h.html#a4834ae7378471b63b9a1985c6294006f">bmSNDTOG0</a>;</div>
<div class="line"><a name="l00158"></a><span class="lineno"> 158</span>&#160; <a class="code" href="class_x_b_o_x_u_s_b.html#abef4a852d877d8136f198431ce54550f">epInfo</a>[ <a class="code" href="_x_b_o_x_u_s_b_8h.html#a4fd9ad9bf7a7d5767940c2ec224ef5e8">XBOX_INPUT_PIPE</a> ].<a class="code" href="struct_ep_info.html#a9238dd40c096baedf041c98b19386a14">bmRcvToggle</a> = <a class="code" href="max3421e_8h.html#aca6a8aa4f0aebbe07c5e175572a92ef7">bmRCVTOG0</a>;</div>
<div class="line"><a name="l00159"></a><span class="lineno"> 159</span>&#160; <a class="code" href="class_x_b_o_x_u_s_b.html#abef4a852d877d8136f198431ce54550f">epInfo</a>[ <a class="code" href="_x_b_o_x_u_s_b_8h.html#a92d2d844a70224a10c100c0a877aacfe">XBOX_OUTPUT_PIPE</a> ].<a class="code" href="struct_ep_info.html#a9f92be74c75c037b39e2cae1eb49b89b">epAddr</a> = 0x02; <span class="comment">// XBOX 360 output endpoint</span></div>
<div class="line"><a name="l00160"></a><span class="lineno"> 160</span>&#160; <a class="code" href="class_x_b_o_x_u_s_b.html#abef4a852d877d8136f198431ce54550f">epInfo</a>[ <a class="code" href="_x_b_o_x_u_s_b_8h.html#a92d2d844a70224a10c100c0a877aacfe">XBOX_OUTPUT_PIPE</a> ].<a class="code" href="struct_ep_info.html#a1dea928517c961235eef7b0876e69f10">epAttribs</a> = <a class="code" href="_p_s3_u_s_b_8h.html#ad4d26e1c566064f2259faf65f0858b6e">EP_INTERRUPT</a>;</div>
<div class="line"><a name="l00161"></a><span class="lineno"> 161</span>&#160; <a class="code" href="class_x_b_o_x_u_s_b.html#abef4a852d877d8136f198431ce54550f">epInfo</a>[ <a class="code" href="_x_b_o_x_u_s_b_8h.html#a92d2d844a70224a10c100c0a877aacfe">XBOX_OUTPUT_PIPE</a> ].<a class="code" href="struct_ep_info.html#a3a5b1c017a034cd9e06e76729e727c46">bmNakPower</a> = <a class="code" href="address_8h.html#a660e8da9c1167a8450aef91c5c03761d">USB_NAK_NOWAIT</a>; <span class="comment">// Only poll once for interrupt endpoints</span></div>
<div class="line"><a name="l00162"></a><span class="lineno"> 162</span>&#160; <a class="code" href="class_x_b_o_x_u_s_b.html#abef4a852d877d8136f198431ce54550f">epInfo</a>[ <a class="code" href="_x_b_o_x_u_s_b_8h.html#a92d2d844a70224a10c100c0a877aacfe">XBOX_OUTPUT_PIPE</a> ].<a class="code" href="struct_ep_info.html#aa2ca775b63736df4008e88da7dd4dddb">maxPktSize</a> = <a class="code" href="_p_s3_u_s_b_8h.html#abcb805b13bfd36145e252b0633bbcfc0">EP_MAXPKTSIZE</a>;</div>
<div class="line"><a name="l00163"></a><span class="lineno"> 163</span>&#160; <a class="code" href="class_x_b_o_x_u_s_b.html#abef4a852d877d8136f198431ce54550f">epInfo</a>[ <a class="code" href="_x_b_o_x_u_s_b_8h.html#a92d2d844a70224a10c100c0a877aacfe">XBOX_OUTPUT_PIPE</a> ].<a class="code" href="struct_ep_info.html#ac85bff70ad0e5d71e50cb501f4d8caf3">bmSndToggle</a> = <a class="code" href="max3421e_8h.html#a4834ae7378471b63b9a1985c6294006f">bmSNDTOG0</a>;</div>
<div class="line"><a name="l00164"></a><span class="lineno"> 164</span>&#160; <a class="code" href="class_x_b_o_x_u_s_b.html#abef4a852d877d8136f198431ce54550f">epInfo</a>[ <a class="code" href="_x_b_o_x_u_s_b_8h.html#a92d2d844a70224a10c100c0a877aacfe">XBOX_OUTPUT_PIPE</a> ].<a class="code" href="struct_ep_info.html#a9238dd40c096baedf041c98b19386a14">bmRcvToggle</a> = <a class="code" href="max3421e_8h.html#aca6a8aa4f0aebbe07c5e175572a92ef7">bmRCVTOG0</a>;</div>
<div class="line"><a name="l00165"></a><span class="lineno"> 165</span>&#160;</div>
<div class="line"><a name="l00166"></a><span class="lineno"> 166</span>&#160; rcode = <a class="code" href="class_x_b_o_x_u_s_b.html#a9c701658d4f63b5407cbcd5b78d8eb18">pUsb</a>-&gt;<a class="code" href="class_u_s_b.html#a6c3ba3f7e6dccb450267011ce783d7ea">setEpInfoEntry</a>(bAddress, 3, <a class="code" href="class_x_b_o_x_u_s_b.html#abef4a852d877d8136f198431ce54550f">epInfo</a>);</div>
<div class="line"><a name="l00167"></a><span class="lineno"> 167</span>&#160; <span class="keywordflow">if</span> (rcode)</div>
<div class="line"><a name="l00168"></a><span class="lineno"> 168</span>&#160; <span class="keywordflow">goto</span> FailSetDevTblEntry;</div>
<div class="line"><a name="l00169"></a><span class="lineno"> 169</span>&#160;</div>
<div class="line"><a name="l00170"></a><span class="lineno"> 170</span>&#160; delay(200); <span class="comment">//Give time for address change</span></div>
<div class="line"><a name="l00171"></a><span class="lineno"> 171</span>&#160;</div>
<div class="line"><a name="l00172"></a><span class="lineno"> 172</span>&#160; rcode = <a class="code" href="class_x_b_o_x_u_s_b.html#a9c701658d4f63b5407cbcd5b78d8eb18">pUsb</a>-&gt;<a class="code" href="class_u_s_b.html#a31e2c132ec32ffdde94dff72be87c378">setConf</a>(bAddress, <a class="code" href="class_x_b_o_x_u_s_b.html#abef4a852d877d8136f198431ce54550f">epInfo</a>[ <a class="code" href="_x_b_o_x_r_e_c_v_8h.html#a8f4ee68cc0f05690f5f26104c7d9e490">XBOX_CONTROL_PIPE</a> ].epAddr, 1);</div>
<div class="line"><a name="l00173"></a><span class="lineno"> 173</span>&#160; <span class="keywordflow">if</span> (rcode)</div>
<div class="line"><a name="l00174"></a><span class="lineno"> 174</span>&#160; <span class="keywordflow">goto</span> FailSetConfDescr;</div>
<div class="line"><a name="l00175"></a><span class="lineno"> 175</span>&#160;</div>
<div class="line"><a name="l00176"></a><span class="lineno"> 176</span>&#160;<span class="preprocessor">#ifdef DEBUG_USB_HOST</span></div>
<div class="line"><a name="l00177"></a><span class="lineno"> 177</span>&#160;<span class="preprocessor"></span> <a class="code" href="message_8h.html#a747819b0aa34f5c3ba0332c2db28c846">Notify</a>(PSTR(<span class="stringliteral">&quot;\r\nXbox 360 Controller Connected\r\n&quot;</span>), 0x80);</div>
<div class="line"><a name="l00178"></a><span class="lineno"> 178</span>&#160;<span class="preprocessor">#endif</span></div>
<div class="line"><a name="l00179"></a><span class="lineno"> 179</span>&#160;<span class="preprocessor"></span> <a class="code" href="class_x_b_o_x_u_s_b.html#a2348a35d4302f0a76bbeb319e84349a1">setLedOn</a>(<a class="code" href="controller_enums_8h.html#aadcb6002d2b42fdfe01490f730ab00a6adac6477842247cab1a8c02c65f431b44">LED1</a>);</div>
<div class="line"><a name="l00180"></a><span class="lineno"> 180</span>&#160; <a class="code" href="class_x_b_o_x_u_s_b.html#a1c779ae5483a2f73426650242a37d868">Xbox360Connected</a> = <span class="keyword">true</span>;</div>
<div class="line"><a name="l00181"></a><span class="lineno"> 181</span>&#160; bPollEnable = <span class="keyword">true</span>;</div>
<div class="line"><a name="l00182"></a><span class="lineno"> 182</span>&#160; <span class="keywordflow">return</span> 0; <span class="comment">// successful configuration</span></div>
<div class="line"><a name="l00183"></a><span class="lineno"> 183</span>&#160;</div>
<div class="line"><a name="l00184"></a><span class="lineno"> 184</span>&#160; <span class="comment">/* diagnostic messages */</span></div>
<div class="line"><a name="l00185"></a><span class="lineno"> 185</span>&#160;FailGetDevDescr:</div>
<div class="line"><a name="l00186"></a><span class="lineno"> 186</span>&#160;<span class="preprocessor">#ifdef DEBUG_USB_HOST</span></div>
<div class="line"><a name="l00187"></a><span class="lineno"> 187</span>&#160;<span class="preprocessor"></span> <a class="code" href="message_8cpp.html#ace40a5d826a882de0c5a25aece111d3f">NotifyFailGetDevDescr</a>();</div>
<div class="line"><a name="l00188"></a><span class="lineno"> 188</span>&#160; <span class="keywordflow">goto</span> Fail;</div>
<div class="line"><a name="l00189"></a><span class="lineno"> 189</span>&#160;<span class="preprocessor">#endif</span></div>
<div class="line"><a name="l00190"></a><span class="lineno"> 190</span>&#160;<span class="preprocessor"></span></div>
<div class="line"><a name="l00191"></a><span class="lineno"> 191</span>&#160;FailSetDevTblEntry:</div>
<div class="line"><a name="l00192"></a><span class="lineno"> 192</span>&#160;<span class="preprocessor">#ifdef DEBUG_USB_HOST</span></div>
<div class="line"><a name="l00193"></a><span class="lineno"> 193</span>&#160;<span class="preprocessor"></span> <a class="code" href="message_8cpp.html#aa65008f9251787149e391f89e68b32be">NotifyFailSetDevTblEntry</a>();</div>
<div class="line"><a name="l00194"></a><span class="lineno"> 194</span>&#160; <span class="keywordflow">goto</span> Fail;</div>
<div class="line"><a name="l00195"></a><span class="lineno"> 195</span>&#160;<span class="preprocessor">#endif</span></div>
<div class="line"><a name="l00196"></a><span class="lineno"> 196</span>&#160;<span class="preprocessor"></span></div>
<div class="line"><a name="l00197"></a><span class="lineno"> 197</span>&#160;FailSetConfDescr:</div>
<div class="line"><a name="l00198"></a><span class="lineno"> 198</span>&#160;<span class="preprocessor">#ifdef DEBUG_USB_HOST</span></div>
<div class="line"><a name="l00199"></a><span class="lineno"> 199</span>&#160;<span class="preprocessor"></span> <a class="code" href="message_8cpp.html#a08b840c377ca6f8154d6924d51338d89">NotifyFailSetConfDescr</a>();</div>
<div class="line"><a name="l00200"></a><span class="lineno"> 200</span>&#160; <span class="keywordflow">goto</span> Fail;</div>
<div class="line"><a name="l00201"></a><span class="lineno"> 201</span>&#160;<span class="preprocessor">#endif</span></div>
<div class="line"><a name="l00202"></a><span class="lineno"> 202</span>&#160;<span class="preprocessor"></span>FailUnknownDevice:</div>
<div class="line"><a name="l00203"></a><span class="lineno"> 203</span>&#160;<span class="preprocessor">#ifdef DEBUG_USB_HOST</span></div>
<div class="line"><a name="l00204"></a><span class="lineno"> 204</span>&#160;<span class="preprocessor"></span> <a class="code" href="message_8cpp.html#a7103129ed2b7b7896461c0a3cd924eb4">NotifyFailUnknownDevice</a>(VID, PID);</div>
<div class="line"><a name="l00205"></a><span class="lineno"> 205</span>&#160;<span class="preprocessor">#endif</span></div>
<div class="line"><a name="l00206"></a><span class="lineno"> 206</span>&#160;<span class="preprocessor"></span> rcode = <a class="code" href="_usb_8h.html#ae9e139d0fd29bb0b3e7afad2f76cd589">USB_DEV_CONFIG_ERROR_DEVICE_NOT_SUPPORTED</a>;</div>
<div class="line"><a name="l00207"></a><span class="lineno"> 207</span>&#160;</div>
<div class="line"><a name="l00208"></a><span class="lineno"> 208</span>&#160;Fail:</div>
<div class="line"><a name="l00209"></a><span class="lineno"> 209</span>&#160;<span class="preprocessor">#ifdef DEBUG_USB_HOST</span></div>
<div class="line"><a name="l00210"></a><span class="lineno"> 210</span>&#160;<span class="preprocessor"></span> <a class="code" href="message_8h.html#a747819b0aa34f5c3ba0332c2db28c846">Notify</a>(PSTR(<span class="stringliteral">&quot;\r\nXbox 360 Init Failed, error code: &quot;</span>), 0x80);</div>
<div class="line"><a name="l00211"></a><span class="lineno"> 211</span>&#160; <a class="code" href="message_8cpp.html#a5ae2cb9bf877595104f2425f50e2057f">NotifyFail</a>(rcode);</div>
<div class="line"><a name="l00212"></a><span class="lineno"> 212</span>&#160;<span class="preprocessor">#endif</span></div>
<div class="line"><a name="l00213"></a><span class="lineno"> 213</span>&#160;<span class="preprocessor"></span> <a class="code" href="class_x_b_o_x_u_s_b.html#a9a296b98b40f5a36d46297d98ef0f9b5">Release</a>();</div>
<div class="line"><a name="l00214"></a><span class="lineno"> 214</span>&#160; <span class="keywordflow">return</span> rcode;</div>
<div class="line"><a name="l00215"></a><span class="lineno"> 215</span>&#160;}</div>
<div class="line"><a name="l00216"></a><span class="lineno"> 216</span>&#160;</div>
<div class="line"><a name="l00217"></a><span class="lineno"> 217</span>&#160;<span class="comment">/* Performs a cleanup after failed Init() attempt */</span></div>
<div class="line"><a name="l00218"></a><span class="lineno"><a class="code" href="class_x_b_o_x_u_s_b.html#a9a296b98b40f5a36d46297d98ef0f9b5"> 218</a></span>&#160;uint8_t <a class="code" href="class_x_b_o_x_u_s_b.html#a9a296b98b40f5a36d46297d98ef0f9b5">XBOXUSB::Release</a>() {</div>
<div class="line"><a name="l00219"></a><span class="lineno"> 219</span>&#160; <a class="code" href="class_x_b_o_x_u_s_b.html#a1c779ae5483a2f73426650242a37d868">Xbox360Connected</a> = <span class="keyword">false</span>;</div>
<div class="line"><a name="l00220"></a><span class="lineno"> 220</span>&#160; <a class="code" href="class_x_b_o_x_u_s_b.html#a9c701658d4f63b5407cbcd5b78d8eb18">pUsb</a>-&gt;<a class="code" href="class_u_s_b.html#a66ab8f5eda239e761d5a48741ea1f9d4">GetAddressPool</a>().<a class="code" href="class_address_pool.html#a15fde13223dcb1da89305ad229763562">FreeAddress</a>(<a class="code" href="class_x_b_o_x_u_s_b.html#a5e9c00af9f4b978c53819791b0a0eb65">bAddress</a>);</div>
<div class="line"><a name="l00221"></a><span class="lineno"> 221</span>&#160; <a class="code" href="class_x_b_o_x_u_s_b.html#a5e9c00af9f4b978c53819791b0a0eb65">bAddress</a> = 0;</div>
<div class="line"><a name="l00222"></a><span class="lineno"> 222</span>&#160; bPollEnable = <span class="keyword">false</span>;</div>
<div class="line"><a name="l00223"></a><span class="lineno"> 223</span>&#160; <span class="keywordflow">return</span> 0;</div>
<div class="line"><a name="l00224"></a><span class="lineno"> 224</span>&#160;}</div>
<div class="line"><a name="l00225"></a><span class="lineno"> 225</span>&#160;</div>
<div class="line"><a name="l00226"></a><span class="lineno"><a class="code" href="class_x_b_o_x_u_s_b.html#a2f4684fe0785e50de434d95f4336fa12"> 226</a></span>&#160;uint8_t <a class="code" href="class_x_b_o_x_u_s_b.html#a2f4684fe0785e50de434d95f4336fa12">XBOXUSB::Poll</a>() {</div>
<div class="line"><a name="l00227"></a><span class="lineno"> 227</span>&#160; <span class="keywordflow">if</span> (!bPollEnable)</div>
<div class="line"><a name="l00228"></a><span class="lineno"> 228</span>&#160; <span class="keywordflow">return</span> 0;</div>
<div class="line"><a name="l00229"></a><span class="lineno"> 229</span>&#160; uint16_t BUFFER_SIZE = <a class="code" href="_p_s3_u_s_b_8h.html#abcb805b13bfd36145e252b0633bbcfc0">EP_MAXPKTSIZE</a>;</div>
<div class="line"><a name="l00230"></a><span class="lineno"> 230</span>&#160; <a class="code" href="class_x_b_o_x_u_s_b.html#a9c701658d4f63b5407cbcd5b78d8eb18">pUsb</a>-&gt;<a class="code" href="class_u_s_b.html#ad75d64f648b102fab2bd75e53e1324a4">inTransfer</a>(<a class="code" href="class_x_b_o_x_u_s_b.html#a5e9c00af9f4b978c53819791b0a0eb65">bAddress</a>, <a class="code" href="class_x_b_o_x_u_s_b.html#abef4a852d877d8136f198431ce54550f">epInfo</a>[ <a class="code" href="_x_b_o_x_u_s_b_8h.html#a4fd9ad9bf7a7d5767940c2ec224ef5e8">XBOX_INPUT_PIPE</a> ].epAddr, &amp;BUFFER_SIZE, readBuf); <span class="comment">// input on endpoint 1</span></div>
<div class="line"><a name="l00231"></a><span class="lineno"> 231</span>&#160; readReport();</div>
<div class="line"><a name="l00232"></a><span class="lineno"> 232</span>&#160;<span class="preprocessor">#ifdef PRINTREPORT</span></div>
<div class="line"><a name="l00233"></a><span class="lineno"> 233</span>&#160;<span class="preprocessor"></span> printReport(); <span class="comment">// Uncomment &quot;#define PRINTREPORT&quot; to print the report send by the Xbox 360 Controller</span></div>
<div class="line"><a name="l00234"></a><span class="lineno"> 234</span>&#160;<span class="preprocessor">#endif</span></div>
<div class="line"><a name="l00235"></a><span class="lineno"> 235</span>&#160;<span class="preprocessor"></span> <span class="keywordflow">return</span> 0;</div>
<div class="line"><a name="l00236"></a><span class="lineno"> 236</span>&#160;}</div>
<div class="line"><a name="l00237"></a><span class="lineno"> 237</span>&#160;</div>
<div class="line"><a name="l00238"></a><span class="lineno"> 238</span>&#160;<span class="keywordtype">void</span> XBOXUSB::readReport() {</div>
<div class="line"><a name="l00239"></a><span class="lineno"> 239</span>&#160; <span class="keywordflow">if</span> (readBuf == NULL)</div>
<div class="line"><a name="l00240"></a><span class="lineno"> 240</span>&#160; <span class="keywordflow">return</span>;</div>
<div class="line"><a name="l00241"></a><span class="lineno"> 241</span>&#160; <span class="keywordflow">if</span> (readBuf[0] != 0x00 || readBuf[1] != 0x14) { <span class="comment">// Check if it&#39;s the correct report - the controller also sends different status reports</span></div>
<div class="line"><a name="l00242"></a><span class="lineno"> 242</span>&#160; <span class="keywordflow">return</span>;</div>
<div class="line"><a name="l00243"></a><span class="lineno"> 243</span>&#160; }</div>
<div class="line"><a name="l00244"></a><span class="lineno"> 244</span>&#160;</div>
<div class="line"><a name="l00245"></a><span class="lineno"> 245</span>&#160; ButtonState = (uint32_t)(readBuf[5] | ((uint16_t)readBuf[4] &lt;&lt; 8) | ((uint32_t)readBuf[3] &lt;&lt; 16) | ((uint32_t)readBuf[2] &lt;&lt; 24));</div>
<div class="line"><a name="l00246"></a><span class="lineno"> 246</span>&#160;</div>
<div class="line"><a name="l00247"></a><span class="lineno"> 247</span>&#160; hatValue[<a class="code" href="controller_enums_8h.html#aaaabdefc068fd57ec2bef2b62ea4ba92a383cb8895dd296b7f69ce845ed16b0ca">LeftHatX</a>] = (int16_t)(((uint16_t)readBuf[7] &lt;&lt; 8) | readBuf[6]);</div>
<div class="line"><a name="l00248"></a><span class="lineno"> 248</span>&#160; hatValue[<a class="code" href="controller_enums_8h.html#aaaabdefc068fd57ec2bef2b62ea4ba92af3f3925efa9762c4e9e71ac7da7a94a3">LeftHatY</a>] = (int16_t)(((uint16_t)readBuf[9] &lt;&lt; 8) | readBuf[8]);</div>
<div class="line"><a name="l00249"></a><span class="lineno"> 249</span>&#160; hatValue[<a class="code" href="controller_enums_8h.html#aaaabdefc068fd57ec2bef2b62ea4ba92aaeb027a0ae5bbc6ba25e1c78a6486c7b">RightHatX</a>] = (int16_t)(((uint16_t)readBuf[11] &lt;&lt; 8) | readBuf[10]);</div>
<div class="line"><a name="l00250"></a><span class="lineno"> 250</span>&#160; hatValue[<a class="code" href="controller_enums_8h.html#aaaabdefc068fd57ec2bef2b62ea4ba92a7f1fb2db5381286691f4dec179ed5d5a">RightHatY</a>] = (int16_t)(((uint16_t)readBuf[13] &lt;&lt; 8) | readBuf[12]);</div>
<div class="line"><a name="l00251"></a><span class="lineno"> 251</span>&#160;</div>
<div class="line"><a name="l00252"></a><span class="lineno"> 252</span>&#160; <span class="comment">//Notify(PSTR(&quot;\r\nButtonState&quot;), 0x80);</span></div>
<div class="line"><a name="l00253"></a><span class="lineno"> 253</span>&#160; <span class="comment">//PrintHex&lt;uint32_t&gt;(ButtonState, 0x80);</span></div>
<div class="line"><a name="l00107"></a><span class="lineno"> 107</span>&#160; } <span class="keywordflow">else</span> <span class="keywordflow">if</span> (PID != <a class="code" href="_x_b_o_x_u_s_b_8h.html#af2ec224ac142016119c418de89470f1f">XBOX_WIRED_PID</a>) <span class="comment">// Check PID</span></div>
<div class="line"><a name="l00108"></a><span class="lineno"> 108</span>&#160; <span class="keywordflow">goto</span> FailUnknownDevice;</div>
<div class="line"><a name="l00109"></a><span class="lineno"> 109</span>&#160;</div>
<div class="line"><a name="l00110"></a><span class="lineno"> 110</span>&#160; <span class="comment">// Allocate new address according to device class</span></div>
<div class="line"><a name="l00111"></a><span class="lineno"> 111</span>&#160; <a class="code" href="class_x_b_o_x_u_s_b.html#a5e9c00af9f4b978c53819791b0a0eb65">bAddress</a> = addrPool.<a class="code" href="class_address_pool.html#a97df4ef42e50960ce2165f4cdb53e590">AllocAddress</a>(parent, <span class="keyword">false</span>, port);</div>
<div class="line"><a name="l00112"></a><span class="lineno"> 112</span>&#160;</div>
<div class="line"><a name="l00113"></a><span class="lineno"> 113</span>&#160; <span class="keywordflow">if</span> (!<a class="code" href="class_x_b_o_x_u_s_b.html#a5e9c00af9f4b978c53819791b0a0eb65">bAddress</a>)</div>
<div class="line"><a name="l00114"></a><span class="lineno"> 114</span>&#160; <span class="keywordflow">return</span> <a class="code" href="_usb_8h.html#a15370eb665cdded5514e69ca58d9f39d">USB_ERROR_OUT_OF_ADDRESS_SPACE_IN_POOL</a>;</div>
<div class="line"><a name="l00115"></a><span class="lineno"> 115</span>&#160;</div>
<div class="line"><a name="l00116"></a><span class="lineno"> 116</span>&#160; <span class="comment">// Extract Max Packet Size from device descriptor</span></div>
<div class="line"><a name="l00117"></a><span class="lineno"> 117</span>&#160; <a class="code" href="class_x_b_o_x_u_s_b.html#abef4a852d877d8136f198431ce54550f">epInfo</a>[0].<a class="code" href="struct_ep_info.html#aa2ca775b63736df4008e88da7dd4dddb">maxPktSize</a> = (uint8_t)((<a class="code" href="struct_u_s_b___d_e_v_i_c_e___d_e_s_c_r_i_p_t_o_r.html">USB_DEVICE_DESCRIPTOR</a>*)buf)-&gt;bMaxPacketSize0;</div>
<div class="line"><a name="l00118"></a><span class="lineno"> 118</span>&#160;</div>
<div class="line"><a name="l00119"></a><span class="lineno"> 119</span>&#160; <span class="comment">// Assign new address to the device</span></div>
<div class="line"><a name="l00120"></a><span class="lineno"> 120</span>&#160; rcode = <a class="code" href="class_x_b_o_x_u_s_b.html#a9c701658d4f63b5407cbcd5b78d8eb18">pUsb</a>-&gt;<a class="code" href="class_u_s_b.html#a3aea534daed66b5606fa798df7ad3c47">setAddr</a>(0, 0, <a class="code" href="class_x_b_o_x_u_s_b.html#a5e9c00af9f4b978c53819791b0a0eb65">bAddress</a>);</div>
<div class="line"><a name="l00121"></a><span class="lineno"> 121</span>&#160; <span class="keywordflow">if</span> (rcode) {</div>
<div class="line"><a name="l00122"></a><span class="lineno"> 122</span>&#160; p-&gt;<a class="code" href="struct_usb_device.html#a86a815577ad7883437d3ca72b32b8e8a">lowspeed</a> = <span class="keyword">false</span>;</div>
<div class="line"><a name="l00123"></a><span class="lineno"> 123</span>&#160; addrPool.<a class="code" href="class_address_pool.html#a15fde13223dcb1da89305ad229763562">FreeAddress</a>(<a class="code" href="class_x_b_o_x_u_s_b.html#a5e9c00af9f4b978c53819791b0a0eb65">bAddress</a>);</div>
<div class="line"><a name="l00124"></a><span class="lineno"> 124</span>&#160; <a class="code" href="class_x_b_o_x_u_s_b.html#a5e9c00af9f4b978c53819791b0a0eb65">bAddress</a> = 0;</div>
<div class="line"><a name="l00125"></a><span class="lineno"> 125</span>&#160;<span class="preprocessor">#ifdef DEBUG_USB_HOST</span></div>
<div class="line"><a name="l00126"></a><span class="lineno"> 126</span>&#160;<span class="preprocessor"></span> <a class="code" href="message_8h.html#a27117e124c5d66d5512fe8d494fe6338">Notify</a>(PSTR(<span class="stringliteral">&quot;\r\nsetAddr: &quot;</span>), 0x80);</div>
<div class="line"><a name="l00127"></a><span class="lineno"> 127</span>&#160; D_PrintHex&lt;uint8_t &gt; (rcode, 0x80);</div>
<div class="line"><a name="l00128"></a><span class="lineno"> 128</span>&#160;<span class="preprocessor">#endif</span></div>
<div class="line"><a name="l00129"></a><span class="lineno"> 129</span>&#160;<span class="preprocessor"></span> <span class="keywordflow">return</span> rcode;</div>
<div class="line"><a name="l00130"></a><span class="lineno"> 130</span>&#160; }</div>
<div class="line"><a name="l00131"></a><span class="lineno"> 131</span>&#160;<span class="preprocessor">#ifdef EXTRADEBUG</span></div>
<div class="line"><a name="l00132"></a><span class="lineno"> 132</span>&#160;<span class="preprocessor"></span> <a class="code" href="message_8h.html#a27117e124c5d66d5512fe8d494fe6338">Notify</a>(PSTR(<span class="stringliteral">&quot;\r\nAddr: &quot;</span>), 0x80);</div>
<div class="line"><a name="l00133"></a><span class="lineno"> 133</span>&#160; D_PrintHex&lt;uint8_t &gt; (<a class="code" href="class_x_b_o_x_u_s_b.html#a5e9c00af9f4b978c53819791b0a0eb65">bAddress</a>, 0x80);</div>
<div class="line"><a name="l00134"></a><span class="lineno"> 134</span>&#160;<span class="preprocessor">#endif</span></div>
<div class="line"><a name="l00135"></a><span class="lineno"> 135</span>&#160;<span class="preprocessor"></span> delay(300); <span class="comment">// Spec says you should wait at least 200ms</span></div>
<div class="line"><a name="l00136"></a><span class="lineno"> 136</span>&#160; </div>
<div class="line"><a name="l00137"></a><span class="lineno"> 137</span>&#160; p-&gt;<a class="code" href="struct_usb_device.html#a86a815577ad7883437d3ca72b32b8e8a">lowspeed</a> = <span class="keyword">false</span>;</div>
<div class="line"><a name="l00138"></a><span class="lineno"> 138</span>&#160;</div>
<div class="line"><a name="l00139"></a><span class="lineno"> 139</span>&#160; <span class="comment">//get pointer to assigned address record</span></div>
<div class="line"><a name="l00140"></a><span class="lineno"> 140</span>&#160; p = addrPool.<a class="code" href="class_address_pool.html#aa92d7e8f0f515340ae2dc1679b627056">GetUsbDevicePtr</a>(bAddress);</div>
<div class="line"><a name="l00141"></a><span class="lineno"> 141</span>&#160; <span class="keywordflow">if</span> (!p)</div>
<div class="line"><a name="l00142"></a><span class="lineno"> 142</span>&#160; <span class="keywordflow">return</span> <a class="code" href="_usb_8h.html#afe2fedb4b0ccc89a688c0b4b59691ce0">USB_ERROR_ADDRESS_NOT_FOUND_IN_POOL</a>;</div>
<div class="line"><a name="l00143"></a><span class="lineno"> 143</span>&#160;</div>
<div class="line"><a name="l00144"></a><span class="lineno"> 144</span>&#160; p-&gt;<a class="code" href="struct_usb_device.html#a86a815577ad7883437d3ca72b32b8e8a">lowspeed</a> = lowspeed;</div>
<div class="line"><a name="l00145"></a><span class="lineno"> 145</span>&#160;</div>
<div class="line"><a name="l00146"></a><span class="lineno"> 146</span>&#160; <span class="comment">// Assign epInfo to epinfo pointer - only EP0 is known</span></div>
<div class="line"><a name="l00147"></a><span class="lineno"> 147</span>&#160; rcode = <a class="code" href="class_x_b_o_x_u_s_b.html#a9c701658d4f63b5407cbcd5b78d8eb18">pUsb</a>-&gt;<a class="code" href="class_u_s_b.html#a6c3ba3f7e6dccb450267011ce783d7ea">setEpInfoEntry</a>(bAddress, 1, <a class="code" href="class_x_b_o_x_u_s_b.html#abef4a852d877d8136f198431ce54550f">epInfo</a>);</div>
<div class="line"><a name="l00148"></a><span class="lineno"> 148</span>&#160; <span class="keywordflow">if</span> (rcode)</div>
<div class="line"><a name="l00149"></a><span class="lineno"> 149</span>&#160; <span class="keywordflow">goto</span> FailSetDevTblEntry;</div>
<div class="line"><a name="l00150"></a><span class="lineno"> 150</span>&#160;</div>
<div class="line"><a name="l00151"></a><span class="lineno"> 151</span>&#160; <span class="comment">/* The application will work in reduced host mode, so we can save program and data</span></div>
<div class="line"><a name="l00152"></a><span class="lineno"> 152</span>&#160;<span class="comment"> memory space. After verifying the VID we will use known values for the</span></div>
<div class="line"><a name="l00153"></a><span class="lineno"> 153</span>&#160;<span class="comment"> configuration values for device, interface, endpoints and HID for the XBOX360 Controllers */</span></div>
<div class="line"><a name="l00154"></a><span class="lineno"> 154</span>&#160;</div>
<div class="line"><a name="l00155"></a><span class="lineno"> 155</span>&#160; <span class="comment">/* Initialize data structures for endpoints of device */</span></div>
<div class="line"><a name="l00156"></a><span class="lineno"> 156</span>&#160; <a class="code" href="class_x_b_o_x_u_s_b.html#abef4a852d877d8136f198431ce54550f">epInfo</a>[ <a class="code" href="_x_b_o_x_o_l_d_8h.html#a4fd9ad9bf7a7d5767940c2ec224ef5e8">XBOX_INPUT_PIPE</a> ].<a class="code" href="struct_ep_info.html#a9f92be74c75c037b39e2cae1eb49b89b">epAddr</a> = 0x01; <span class="comment">// XBOX 360 report endpoint</span></div>
<div class="line"><a name="l00157"></a><span class="lineno"> 157</span>&#160; <a class="code" href="class_x_b_o_x_u_s_b.html#abef4a852d877d8136f198431ce54550f">epInfo</a>[ <a class="code" href="_x_b_o_x_o_l_d_8h.html#a4fd9ad9bf7a7d5767940c2ec224ef5e8">XBOX_INPUT_PIPE</a> ].<a class="code" href="struct_ep_info.html#a1dea928517c961235eef7b0876e69f10">epAttribs</a> = <a class="code" href="_p_s3_u_s_b_8h.html#ad4d26e1c566064f2259faf65f0858b6e">EP_INTERRUPT</a>;</div>
<div class="line"><a name="l00158"></a><span class="lineno"> 158</span>&#160; <a class="code" href="class_x_b_o_x_u_s_b.html#abef4a852d877d8136f198431ce54550f">epInfo</a>[ <a class="code" href="_x_b_o_x_o_l_d_8h.html#a4fd9ad9bf7a7d5767940c2ec224ef5e8">XBOX_INPUT_PIPE</a> ].<a class="code" href="struct_ep_info.html#a3a5b1c017a034cd9e06e76729e727c46">bmNakPower</a> = <a class="code" href="address_8h.html#a660e8da9c1167a8450aef91c5c03761d">USB_NAK_NOWAIT</a>; <span class="comment">// Only poll once for interrupt endpoints</span></div>
<div class="line"><a name="l00159"></a><span class="lineno"> 159</span>&#160; <a class="code" href="class_x_b_o_x_u_s_b.html#abef4a852d877d8136f198431ce54550f">epInfo</a>[ <a class="code" href="_x_b_o_x_o_l_d_8h.html#a4fd9ad9bf7a7d5767940c2ec224ef5e8">XBOX_INPUT_PIPE</a> ].<a class="code" href="struct_ep_info.html#aa2ca775b63736df4008e88da7dd4dddb">maxPktSize</a> = <a class="code" href="_p_s3_u_s_b_8h.html#abcb805b13bfd36145e252b0633bbcfc0">EP_MAXPKTSIZE</a>;</div>
<div class="line"><a name="l00160"></a><span class="lineno"> 160</span>&#160; <a class="code" href="class_x_b_o_x_u_s_b.html#abef4a852d877d8136f198431ce54550f">epInfo</a>[ <a class="code" href="_x_b_o_x_o_l_d_8h.html#a4fd9ad9bf7a7d5767940c2ec224ef5e8">XBOX_INPUT_PIPE</a> ].<a class="code" href="struct_ep_info.html#ac85bff70ad0e5d71e50cb501f4d8caf3">bmSndToggle</a> = <a class="code" href="max3421e_8h.html#a4834ae7378471b63b9a1985c6294006f">bmSNDTOG0</a>;</div>
<div class="line"><a name="l00161"></a><span class="lineno"> 161</span>&#160; <a class="code" href="class_x_b_o_x_u_s_b.html#abef4a852d877d8136f198431ce54550f">epInfo</a>[ <a class="code" href="_x_b_o_x_o_l_d_8h.html#a4fd9ad9bf7a7d5767940c2ec224ef5e8">XBOX_INPUT_PIPE</a> ].<a class="code" href="struct_ep_info.html#a9238dd40c096baedf041c98b19386a14">bmRcvToggle</a> = <a class="code" href="max3421e_8h.html#aca6a8aa4f0aebbe07c5e175572a92ef7">bmRCVTOG0</a>;</div>
<div class="line"><a name="l00162"></a><span class="lineno"> 162</span>&#160; <a class="code" href="class_x_b_o_x_u_s_b.html#abef4a852d877d8136f198431ce54550f">epInfo</a>[ <a class="code" href="_x_b_o_x_o_l_d_8h.html#a92d2d844a70224a10c100c0a877aacfe">XBOX_OUTPUT_PIPE</a> ].<a class="code" href="struct_ep_info.html#a9f92be74c75c037b39e2cae1eb49b89b">epAddr</a> = 0x02; <span class="comment">// XBOX 360 output endpoint</span></div>
<div class="line"><a name="l00163"></a><span class="lineno"> 163</span>&#160; <a class="code" href="class_x_b_o_x_u_s_b.html#abef4a852d877d8136f198431ce54550f">epInfo</a>[ <a class="code" href="_x_b_o_x_o_l_d_8h.html#a92d2d844a70224a10c100c0a877aacfe">XBOX_OUTPUT_PIPE</a> ].<a class="code" href="struct_ep_info.html#a1dea928517c961235eef7b0876e69f10">epAttribs</a> = <a class="code" href="_p_s3_u_s_b_8h.html#ad4d26e1c566064f2259faf65f0858b6e">EP_INTERRUPT</a>;</div>
<div class="line"><a name="l00164"></a><span class="lineno"> 164</span>&#160; <a class="code" href="class_x_b_o_x_u_s_b.html#abef4a852d877d8136f198431ce54550f">epInfo</a>[ <a class="code" href="_x_b_o_x_o_l_d_8h.html#a92d2d844a70224a10c100c0a877aacfe">XBOX_OUTPUT_PIPE</a> ].<a class="code" href="struct_ep_info.html#a3a5b1c017a034cd9e06e76729e727c46">bmNakPower</a> = <a class="code" href="address_8h.html#a660e8da9c1167a8450aef91c5c03761d">USB_NAK_NOWAIT</a>; <span class="comment">// Only poll once for interrupt endpoints</span></div>
<div class="line"><a name="l00165"></a><span class="lineno"> 165</span>&#160; <a class="code" href="class_x_b_o_x_u_s_b.html#abef4a852d877d8136f198431ce54550f">epInfo</a>[ <a class="code" href="_x_b_o_x_o_l_d_8h.html#a92d2d844a70224a10c100c0a877aacfe">XBOX_OUTPUT_PIPE</a> ].<a class="code" href="struct_ep_info.html#aa2ca775b63736df4008e88da7dd4dddb">maxPktSize</a> = <a class="code" href="_p_s3_u_s_b_8h.html#abcb805b13bfd36145e252b0633bbcfc0">EP_MAXPKTSIZE</a>;</div>
<div class="line"><a name="l00166"></a><span class="lineno"> 166</span>&#160; <a class="code" href="class_x_b_o_x_u_s_b.html#abef4a852d877d8136f198431ce54550f">epInfo</a>[ <a class="code" href="_x_b_o_x_o_l_d_8h.html#a92d2d844a70224a10c100c0a877aacfe">XBOX_OUTPUT_PIPE</a> ].<a class="code" href="struct_ep_info.html#ac85bff70ad0e5d71e50cb501f4d8caf3">bmSndToggle</a> = <a class="code" href="max3421e_8h.html#a4834ae7378471b63b9a1985c6294006f">bmSNDTOG0</a>;</div>
<div class="line"><a name="l00167"></a><span class="lineno"> 167</span>&#160; <a class="code" href="class_x_b_o_x_u_s_b.html#abef4a852d877d8136f198431ce54550f">epInfo</a>[ <a class="code" href="_x_b_o_x_o_l_d_8h.html#a92d2d844a70224a10c100c0a877aacfe">XBOX_OUTPUT_PIPE</a> ].<a class="code" href="struct_ep_info.html#a9238dd40c096baedf041c98b19386a14">bmRcvToggle</a> = <a class="code" href="max3421e_8h.html#aca6a8aa4f0aebbe07c5e175572a92ef7">bmRCVTOG0</a>;</div>
<div class="line"><a name="l00168"></a><span class="lineno"> 168</span>&#160;</div>
<div class="line"><a name="l00169"></a><span class="lineno"> 169</span>&#160; rcode = <a class="code" href="class_x_b_o_x_u_s_b.html#a9c701658d4f63b5407cbcd5b78d8eb18">pUsb</a>-&gt;<a class="code" href="class_u_s_b.html#a6c3ba3f7e6dccb450267011ce783d7ea">setEpInfoEntry</a>(bAddress, 3, <a class="code" href="class_x_b_o_x_u_s_b.html#abef4a852d877d8136f198431ce54550f">epInfo</a>);</div>
<div class="line"><a name="l00170"></a><span class="lineno"> 170</span>&#160; <span class="keywordflow">if</span> (rcode)</div>
<div class="line"><a name="l00171"></a><span class="lineno"> 171</span>&#160; <span class="keywordflow">goto</span> FailSetDevTblEntry;</div>
<div class="line"><a name="l00172"></a><span class="lineno"> 172</span>&#160;</div>
<div class="line"><a name="l00173"></a><span class="lineno"> 173</span>&#160; delay(200); <span class="comment">// Give time for address change</span></div>
<div class="line"><a name="l00174"></a><span class="lineno"> 174</span>&#160;</div>
<div class="line"><a name="l00175"></a><span class="lineno"> 175</span>&#160; rcode = <a class="code" href="class_x_b_o_x_u_s_b.html#a9c701658d4f63b5407cbcd5b78d8eb18">pUsb</a>-&gt;<a class="code" href="class_u_s_b.html#a31e2c132ec32ffdde94dff72be87c378">setConf</a>(bAddress, <a class="code" href="class_x_b_o_x_u_s_b.html#abef4a852d877d8136f198431ce54550f">epInfo</a>[ <a class="code" href="_x_b_o_x_o_l_d_8h.html#a8f4ee68cc0f05690f5f26104c7d9e490">XBOX_CONTROL_PIPE</a> ].epAddr, 1);</div>
<div class="line"><a name="l00176"></a><span class="lineno"> 176</span>&#160; <span class="keywordflow">if</span> (rcode)</div>
<div class="line"><a name="l00177"></a><span class="lineno"> 177</span>&#160; <span class="keywordflow">goto</span> FailSetConfDescr;</div>
<div class="line"><a name="l00178"></a><span class="lineno"> 178</span>&#160;</div>
<div class="line"><a name="l00179"></a><span class="lineno"> 179</span>&#160;<span class="preprocessor">#ifdef DEBUG_USB_HOST</span></div>
<div class="line"><a name="l00180"></a><span class="lineno"> 180</span>&#160;<span class="preprocessor"></span> <a class="code" href="message_8h.html#a27117e124c5d66d5512fe8d494fe6338">Notify</a>(PSTR(<span class="stringliteral">&quot;\r\nXbox 360 Controller Connected\r\n&quot;</span>), 0x80);</div>
<div class="line"><a name="l00181"></a><span class="lineno"> 181</span>&#160;<span class="preprocessor">#endif</span></div>
<div class="line"><a name="l00182"></a><span class="lineno"> 182</span>&#160;<span class="preprocessor"></span> onInit();</div>
<div class="line"><a name="l00183"></a><span class="lineno"> 183</span>&#160; <a class="code" href="class_x_b_o_x_u_s_b.html#a1c779ae5483a2f73426650242a37d868">Xbox360Connected</a> = <span class="keyword">true</span>;</div>
<div class="line"><a name="l00184"></a><span class="lineno"> 184</span>&#160; bPollEnable = <span class="keyword">true</span>;</div>
<div class="line"><a name="l00185"></a><span class="lineno"> 185</span>&#160; <span class="keywordflow">return</span> 0; <span class="comment">// Successful configuration</span></div>
<div class="line"><a name="l00186"></a><span class="lineno"> 186</span>&#160;</div>
<div class="line"><a name="l00187"></a><span class="lineno"> 187</span>&#160; <span class="comment">/* Diagnostic messages */</span></div>
<div class="line"><a name="l00188"></a><span class="lineno"> 188</span>&#160;FailGetDevDescr:</div>
<div class="line"><a name="l00189"></a><span class="lineno"> 189</span>&#160;<span class="preprocessor">#ifdef DEBUG_USB_HOST</span></div>
<div class="line"><a name="l00190"></a><span class="lineno"> 190</span>&#160;<span class="preprocessor"></span> <a class="code" href="message_8h.html#ae65e02f44cfdc490efd1b33f9882fbbd">NotifyFailGetDevDescr</a>();</div>
<div class="line"><a name="l00191"></a><span class="lineno"> 191</span>&#160; <span class="keywordflow">goto</span> Fail;</div>
<div class="line"><a name="l00192"></a><span class="lineno"> 192</span>&#160;<span class="preprocessor">#endif</span></div>
<div class="line"><a name="l00193"></a><span class="lineno"> 193</span>&#160;<span class="preprocessor"></span></div>
<div class="line"><a name="l00194"></a><span class="lineno"> 194</span>&#160;FailSetDevTblEntry:</div>
<div class="line"><a name="l00195"></a><span class="lineno"> 195</span>&#160;<span class="preprocessor">#ifdef DEBUG_USB_HOST</span></div>
<div class="line"><a name="l00196"></a><span class="lineno"> 196</span>&#160;<span class="preprocessor"></span> <a class="code" href="message_8h.html#a69619d86b1636f141c830ca82c7f45e7">NotifyFailSetDevTblEntry</a>();</div>
<div class="line"><a name="l00197"></a><span class="lineno"> 197</span>&#160; <span class="keywordflow">goto</span> Fail;</div>
<div class="line"><a name="l00198"></a><span class="lineno"> 198</span>&#160;<span class="preprocessor">#endif</span></div>
<div class="line"><a name="l00199"></a><span class="lineno"> 199</span>&#160;<span class="preprocessor"></span></div>
<div class="line"><a name="l00200"></a><span class="lineno"> 200</span>&#160;FailSetConfDescr:</div>
<div class="line"><a name="l00201"></a><span class="lineno"> 201</span>&#160;<span class="preprocessor">#ifdef DEBUG_USB_HOST</span></div>
<div class="line"><a name="l00202"></a><span class="lineno"> 202</span>&#160;<span class="preprocessor"></span> <a class="code" href="message_8h.html#a03e4088aafca36fd7a4be69e3a22b601">NotifyFailSetConfDescr</a>();</div>
<div class="line"><a name="l00203"></a><span class="lineno"> 203</span>&#160; <span class="keywordflow">goto</span> Fail;</div>
<div class="line"><a name="l00204"></a><span class="lineno"> 204</span>&#160;<span class="preprocessor">#endif</span></div>
<div class="line"><a name="l00205"></a><span class="lineno"> 205</span>&#160;<span class="preprocessor"></span>FailUnknownDevice:</div>
<div class="line"><a name="l00206"></a><span class="lineno"> 206</span>&#160;<span class="preprocessor">#ifdef DEBUG_USB_HOST</span></div>
<div class="line"><a name="l00207"></a><span class="lineno"> 207</span>&#160;<span class="preprocessor"></span> <a class="code" href="message_8h.html#a0ce3a725ee65614d7f95cda10e4d2e91">NotifyFailUnknownDevice</a>(VID, PID);</div>
<div class="line"><a name="l00208"></a><span class="lineno"> 208</span>&#160;<span class="preprocessor">#endif</span></div>
<div class="line"><a name="l00209"></a><span class="lineno"> 209</span>&#160;<span class="preprocessor"></span> rcode = <a class="code" href="_usb_8h.html#ae9e139d0fd29bb0b3e7afad2f76cd589">USB_DEV_CONFIG_ERROR_DEVICE_NOT_SUPPORTED</a>;</div>
<div class="line"><a name="l00210"></a><span class="lineno"> 210</span>&#160;</div>
<div class="line"><a name="l00211"></a><span class="lineno"> 211</span>&#160;Fail:</div>
<div class="line"><a name="l00212"></a><span class="lineno"> 212</span>&#160;<span class="preprocessor">#ifdef DEBUG_USB_HOST</span></div>
<div class="line"><a name="l00213"></a><span class="lineno"> 213</span>&#160;<span class="preprocessor"></span> <a class="code" href="message_8h.html#a27117e124c5d66d5512fe8d494fe6338">Notify</a>(PSTR(<span class="stringliteral">&quot;\r\nXbox 360 Init Failed, error code: &quot;</span>), 0x80);</div>
<div class="line"><a name="l00214"></a><span class="lineno"> 214</span>&#160; <a class="code" href="message_8h.html#a22695bdc18ebde4a87dbe8633cb39593">NotifyFail</a>(rcode);</div>
<div class="line"><a name="l00215"></a><span class="lineno"> 215</span>&#160;<span class="preprocessor">#endif</span></div>
<div class="line"><a name="l00216"></a><span class="lineno"> 216</span>&#160;<span class="preprocessor"></span> <a class="code" href="class_x_b_o_x_u_s_b.html#a9a296b98b40f5a36d46297d98ef0f9b5">Release</a>();</div>
<div class="line"><a name="l00217"></a><span class="lineno"> 217</span>&#160; <span class="keywordflow">return</span> rcode;</div>
<div class="line"><a name="l00218"></a><span class="lineno"> 218</span>&#160;}</div>
<div class="line"><a name="l00219"></a><span class="lineno"> 219</span>&#160;</div>
<div class="line"><a name="l00220"></a><span class="lineno"> 220</span>&#160;<span class="comment">/* Performs a cleanup after failed Init() attempt */</span></div>
<div class="line"><a name="l00221"></a><span class="lineno"><a class="code" href="class_x_b_o_x_u_s_b.html#a9a296b98b40f5a36d46297d98ef0f9b5"> 221</a></span>&#160;uint8_t <a class="code" href="class_x_b_o_x_u_s_b.html#a9a296b98b40f5a36d46297d98ef0f9b5">XBOXUSB::Release</a>() {</div>
<div class="line"><a name="l00222"></a><span class="lineno"> 222</span>&#160; <a class="code" href="class_x_b_o_x_u_s_b.html#a1c779ae5483a2f73426650242a37d868">Xbox360Connected</a> = <span class="keyword">false</span>;</div>
<div class="line"><a name="l00223"></a><span class="lineno"> 223</span>&#160; <a class="code" href="class_x_b_o_x_u_s_b.html#a9c701658d4f63b5407cbcd5b78d8eb18">pUsb</a>-&gt;<a class="code" href="class_u_s_b.html#a66ab8f5eda239e761d5a48741ea1f9d4">GetAddressPool</a>().<a class="code" href="class_address_pool.html#a15fde13223dcb1da89305ad229763562">FreeAddress</a>(<a class="code" href="class_x_b_o_x_u_s_b.html#a5e9c00af9f4b978c53819791b0a0eb65">bAddress</a>);</div>
<div class="line"><a name="l00224"></a><span class="lineno"> 224</span>&#160; <a class="code" href="class_x_b_o_x_u_s_b.html#a5e9c00af9f4b978c53819791b0a0eb65">bAddress</a> = 0;</div>
<div class="line"><a name="l00225"></a><span class="lineno"> 225</span>&#160; bPollEnable = <span class="keyword">false</span>;</div>
<div class="line"><a name="l00226"></a><span class="lineno"> 226</span>&#160; <span class="keywordflow">return</span> 0;</div>
<div class="line"><a name="l00227"></a><span class="lineno"> 227</span>&#160;}</div>
<div class="line"><a name="l00228"></a><span class="lineno"> 228</span>&#160;</div>
<div class="line"><a name="l00229"></a><span class="lineno"><a class="code" href="class_x_b_o_x_u_s_b.html#a2f4684fe0785e50de434d95f4336fa12"> 229</a></span>&#160;uint8_t <a class="code" href="class_x_b_o_x_u_s_b.html#a2f4684fe0785e50de434d95f4336fa12">XBOXUSB::Poll</a>() {</div>
<div class="line"><a name="l00230"></a><span class="lineno"> 230</span>&#160; <span class="keywordflow">if</span> (!bPollEnable)</div>
<div class="line"><a name="l00231"></a><span class="lineno"> 231</span>&#160; <span class="keywordflow">return</span> 0;</div>
<div class="line"><a name="l00232"></a><span class="lineno"> 232</span>&#160; uint16_t BUFFER_SIZE = <a class="code" href="_p_s3_u_s_b_8h.html#abcb805b13bfd36145e252b0633bbcfc0">EP_MAXPKTSIZE</a>;</div>
<div class="line"><a name="l00233"></a><span class="lineno"> 233</span>&#160; <a class="code" href="class_x_b_o_x_u_s_b.html#a9c701658d4f63b5407cbcd5b78d8eb18">pUsb</a>-&gt;<a class="code" href="class_u_s_b.html#ad75d64f648b102fab2bd75e53e1324a4">inTransfer</a>(<a class="code" href="class_x_b_o_x_u_s_b.html#a5e9c00af9f4b978c53819791b0a0eb65">bAddress</a>, <a class="code" href="class_x_b_o_x_u_s_b.html#abef4a852d877d8136f198431ce54550f">epInfo</a>[ <a class="code" href="_x_b_o_x_o_l_d_8h.html#a4fd9ad9bf7a7d5767940c2ec224ef5e8">XBOX_INPUT_PIPE</a> ].epAddr, &amp;BUFFER_SIZE, readBuf); <span class="comment">// input on endpoint 1</span></div>
<div class="line"><a name="l00234"></a><span class="lineno"> 234</span>&#160; readReport();</div>
<div class="line"><a name="l00235"></a><span class="lineno"> 235</span>&#160;<span class="preprocessor">#ifdef PRINTREPORT</span></div>
<div class="line"><a name="l00236"></a><span class="lineno"> 236</span>&#160;<span class="preprocessor"></span> printReport(); <span class="comment">// Uncomment &quot;#define PRINTREPORT&quot; to print the report send by the Xbox 360 Controller</span></div>
<div class="line"><a name="l00237"></a><span class="lineno"> 237</span>&#160;<span class="preprocessor">#endif</span></div>
<div class="line"><a name="l00238"></a><span class="lineno"> 238</span>&#160;<span class="preprocessor"></span> <span class="keywordflow">return</span> 0;</div>
<div class="line"><a name="l00239"></a><span class="lineno"> 239</span>&#160;}</div>
<div class="line"><a name="l00240"></a><span class="lineno"> 240</span>&#160;</div>
<div class="line"><a name="l00241"></a><span class="lineno"> 241</span>&#160;<span class="keywordtype">void</span> XBOXUSB::readReport() {</div>
<div class="line"><a name="l00242"></a><span class="lineno"> 242</span>&#160; <span class="keywordflow">if</span> (readBuf == NULL)</div>
<div class="line"><a name="l00243"></a><span class="lineno"> 243</span>&#160; <span class="keywordflow">return</span>;</div>
<div class="line"><a name="l00244"></a><span class="lineno"> 244</span>&#160; <span class="keywordflow">if</span> (readBuf[0] != 0x00 || readBuf[1] != 0x14) { <span class="comment">// Check if it&#39;s the correct report - the controller also sends different status reports</span></div>
<div class="line"><a name="l00245"></a><span class="lineno"> 245</span>&#160; <span class="keywordflow">return</span>;</div>
<div class="line"><a name="l00246"></a><span class="lineno"> 246</span>&#160; }</div>
<div class="line"><a name="l00247"></a><span class="lineno"> 247</span>&#160;</div>
<div class="line"><a name="l00248"></a><span class="lineno"> 248</span>&#160; ButtonState = (uint32_t)(readBuf[5] | ((uint16_t)readBuf[4] &lt;&lt; 8) | ((uint32_t)readBuf[3] &lt;&lt; 16) | ((uint32_t)readBuf[2] &lt;&lt; 24));</div>
<div class="line"><a name="l00249"></a><span class="lineno"> 249</span>&#160;</div>
<div class="line"><a name="l00250"></a><span class="lineno"> 250</span>&#160; hatValue[<a class="code" href="controller_enums_8h.html#aaaabdefc068fd57ec2bef2b62ea4ba92a383cb8895dd296b7f69ce845ed16b0ca">LeftHatX</a>] = (int16_t)(((uint16_t)readBuf[7] &lt;&lt; 8) | readBuf[6]);</div>
<div class="line"><a name="l00251"></a><span class="lineno"> 251</span>&#160; hatValue[<a class="code" href="controller_enums_8h.html#aaaabdefc068fd57ec2bef2b62ea4ba92af3f3925efa9762c4e9e71ac7da7a94a3">LeftHatY</a>] = (int16_t)(((uint16_t)readBuf[9] &lt;&lt; 8) | readBuf[8]);</div>
<div class="line"><a name="l00252"></a><span class="lineno"> 252</span>&#160; hatValue[<a class="code" href="controller_enums_8h.html#aaaabdefc068fd57ec2bef2b62ea4ba92aaeb027a0ae5bbc6ba25e1c78a6486c7b">RightHatX</a>] = (int16_t)(((uint16_t)readBuf[11] &lt;&lt; 8) | readBuf[10]);</div>
<div class="line"><a name="l00253"></a><span class="lineno"> 253</span>&#160; hatValue[<a class="code" href="controller_enums_8h.html#aaaabdefc068fd57ec2bef2b62ea4ba92a7f1fb2db5381286691f4dec179ed5d5a">RightHatY</a>] = (int16_t)(((uint16_t)readBuf[13] &lt;&lt; 8) | readBuf[12]);</div>
<div class="line"><a name="l00254"></a><span class="lineno"> 254</span>&#160;</div>
<div class="line"><a name="l00255"></a><span class="lineno"> 255</span>&#160; <span class="keywordflow">if</span> (ButtonState != OldButtonState) {</div>
<div class="line"><a name="l00256"></a><span class="lineno"> 256</span>&#160; ButtonClickState = (ButtonState &gt;&gt; 16) &amp; ((~OldButtonState) &gt;&gt; 16); <span class="comment">// Update click state variable, but don&#39;t include the two trigger buttons L2 and R2</span></div>
<div class="line"><a name="l00257"></a><span class="lineno"> 257</span>&#160; <span class="keywordflow">if</span> (((uint8_t)OldButtonState) == 0 &amp;&amp; ((uint8_t)ButtonState) != 0) <span class="comment">// The L2 and R2 buttons are special as they are analog buttons</span></div>
<div class="line"><a name="l00258"></a><span class="lineno"> 258</span>&#160; R2Clicked = <span class="keyword">true</span>;</div>
<div class="line"><a name="l00259"></a><span class="lineno"> 259</span>&#160; <span class="keywordflow">if</span> ((uint8_t)(OldButtonState &gt;&gt; 8) == 0 &amp;&amp; (uint8_t)(ButtonState &gt;&gt; 8) != 0)</div>
<div class="line"><a name="l00260"></a><span class="lineno"> 260</span>&#160; L2Clicked = <span class="keyword">true</span>;</div>
<div class="line"><a name="l00261"></a><span class="lineno"> 261</span>&#160; OldButtonState = ButtonState;</div>
<div class="line"><a name="l00262"></a><span class="lineno"> 262</span>&#160; }</div>
<div class="line"><a name="l00263"></a><span class="lineno"> 263</span>&#160;}</div>
<div class="line"><a name="l00264"></a><span class="lineno"> 264</span>&#160;</div>
<div class="line"><a name="l00265"></a><span class="lineno"> 265</span>&#160;<span class="keywordtype">void</span> XBOXUSB::printReport() { <span class="comment">//Uncomment &quot;#define PRINTREPORT&quot; to print the report send by the Xbox 360 Controller</span></div>
<div class="line"><a name="l00266"></a><span class="lineno"> 266</span>&#160;<span class="preprocessor">#ifdef PRINTREPORT</span></div>
<div class="line"><a name="l00267"></a><span class="lineno"> 267</span>&#160;<span class="preprocessor"></span> <span class="keywordflow">if</span> (readBuf == NULL)</div>
<div class="line"><a name="l00268"></a><span class="lineno"> 268</span>&#160; <span class="keywordflow">return</span>;</div>
<div class="line"><a name="l00269"></a><span class="lineno"> 269</span>&#160; <span class="keywordflow">for</span> (uint8_t i = 0; i &lt; <a class="code" href="_x_b_o_x_u_s_b_8h.html#aaa3e91675875fbf14a37369f9513874a">XBOX_REPORT_BUFFER_SIZE</a>; i++) {</div>
<div class="line"><a name="l00270"></a><span class="lineno"> 270</span>&#160; D_PrintHex&lt;uint8_t &gt; (readBuf[i], 0x80);</div>
<div class="line"><a name="l00271"></a><span class="lineno"> 271</span>&#160; <a class="code" href="message_8h.html#a747819b0aa34f5c3ba0332c2db28c846">Notify</a>(PSTR(<span class="stringliteral">&quot; &quot;</span>), 0x80);</div>
<div class="line"><a name="l00272"></a><span class="lineno"> 272</span>&#160; }</div>
<div class="line"><a name="l00273"></a><span class="lineno"> 273</span>&#160; <a class="code" href="message_8h.html#a747819b0aa34f5c3ba0332c2db28c846">Notify</a>(PSTR(<span class="stringliteral">&quot;\r\n&quot;</span>), 0x80);</div>
<div class="line"><a name="l00274"></a><span class="lineno"> 274</span>&#160;<span class="preprocessor">#endif</span></div>
<div class="line"><a name="l00275"></a><span class="lineno"> 275</span>&#160;<span class="preprocessor"></span>}</div>
<div class="line"><a name="l00276"></a><span class="lineno"> 276</span>&#160;</div>
<div class="line"><a name="l00277"></a><span class="lineno"><a class="code" href="class_x_b_o_x_u_s_b.html#ae18ff481e9dd91658e5e45e7958e7775"> 277</a></span>&#160;uint8_t <a class="code" href="class_x_b_o_x_u_s_b.html#ae18ff481e9dd91658e5e45e7958e7775">XBOXUSB::getButtonPress</a>(<a class="code" href="controller_enums_8h.html#a03bfec859eac87be20f8952c1eb89de0">Button</a> b) {</div>
<div class="line"><a name="l00278"></a><span class="lineno"> 278</span>&#160; <span class="keywordflow">if</span> (b == <a class="code" href="controller_enums_8h.html#a03bfec859eac87be20f8952c1eb89de0a0adffb24dae0c41be5b803f4d444f066">L2</a>) <span class="comment">// These are analog buttons</span></div>
<div class="line"><a name="l00279"></a><span class="lineno"> 279</span>&#160; <span class="keywordflow">return</span> (uint8_t)(ButtonState &gt;&gt; 8);</div>
<div class="line"><a name="l00280"></a><span class="lineno"> 280</span>&#160; <span class="keywordflow">else</span> <span class="keywordflow">if</span> (b == <a class="code" href="controller_enums_8h.html#a03bfec859eac87be20f8952c1eb89de0a629d7b403cea5f826352f3aefb9a6d6a">R2</a>)</div>
<div class="line"><a name="l00281"></a><span class="lineno"> 281</span>&#160; <span class="keywordflow">return</span> (uint8_t)ButtonState;</div>
<div class="line"><a name="l00282"></a><span class="lineno"> 282</span>&#160; <span class="keywordflow">return</span> (ButtonState &amp; ((uint32_t)pgm_read_word(&amp;<a class="code" href="xbox_enums_8h.html#a7e55826e75b9b88578c8b0edaaf523d7">XBOXBUTTONS</a>[(uint8_t)b]) &lt;&lt; 16));</div>
<div class="line"><a name="l00283"></a><span class="lineno"> 283</span>&#160;}</div>
<div class="line"><a name="l00284"></a><span class="lineno"> 284</span>&#160;</div>
<div class="line"><a name="l00285"></a><span class="lineno"><a class="code" href="class_x_b_o_x_u_s_b.html#ab85b8ce772b122f1b9df489c7e045635"> 285</a></span>&#160;<span class="keywordtype">bool</span> <a class="code" href="class_x_b_o_x_u_s_b.html#ab85b8ce772b122f1b9df489c7e045635">XBOXUSB::getButtonClick</a>(<a class="code" href="controller_enums_8h.html#a03bfec859eac87be20f8952c1eb89de0">Button</a> b) {</div>
<div class="line"><a name="l00286"></a><span class="lineno"> 286</span>&#160; <span class="keywordflow">if</span> (b == <a class="code" href="controller_enums_8h.html#a03bfec859eac87be20f8952c1eb89de0a0adffb24dae0c41be5b803f4d444f066">L2</a>) {</div>
<div class="line"><a name="l00287"></a><span class="lineno"> 287</span>&#160; <span class="keywordflow">if</span> (L2Clicked) {</div>
<div class="line"><a name="l00288"></a><span class="lineno"> 288</span>&#160; L2Clicked = <span class="keyword">false</span>;</div>
<div class="line"><a name="l00289"></a><span class="lineno"> 289</span>&#160; <span class="keywordflow">return</span> <span class="keyword">true</span>;</div>
<div class="line"><a name="l00290"></a><span class="lineno"> 290</span>&#160; }</div>
<div class="line"><a name="l00291"></a><span class="lineno"> 291</span>&#160; <span class="keywordflow">return</span> <span class="keyword">false</span>;</div>
<div class="line"><a name="l00292"></a><span class="lineno"> 292</span>&#160; } <span class="keywordflow">else</span> <span class="keywordflow">if</span> (b == <a class="code" href="controller_enums_8h.html#a03bfec859eac87be20f8952c1eb89de0a629d7b403cea5f826352f3aefb9a6d6a">R2</a>) {</div>
<div class="line"><a name="l00293"></a><span class="lineno"> 293</span>&#160; <span class="keywordflow">if</span> (R2Clicked) {</div>
<div class="line"><a name="l00294"></a><span class="lineno"> 294</span>&#160; R2Clicked = <span class="keyword">false</span>;</div>
<div class="line"><a name="l00295"></a><span class="lineno"> 295</span>&#160; <span class="keywordflow">return</span> <span class="keyword">true</span>;</div>
<div class="line"><a name="l00296"></a><span class="lineno"> 296</span>&#160; }</div>
<div class="line"><a name="l00297"></a><span class="lineno"> 297</span>&#160; <span class="keywordflow">return</span> <span class="keyword">false</span>;</div>
<div class="line"><a name="l00298"></a><span class="lineno"> 298</span>&#160; }</div>
<div class="line"><a name="l00299"></a><span class="lineno"> 299</span>&#160; uint16_t button = pgm_read_word(&amp;<a class="code" href="xbox_enums_8h.html#a7e55826e75b9b88578c8b0edaaf523d7">XBOXBUTTONS</a>[(uint8_t)b]);</div>
<div class="line"><a name="l00300"></a><span class="lineno"> 300</span>&#160; <span class="keywordtype">bool</span> click = (ButtonClickState &amp; button);</div>
<div class="line"><a name="l00301"></a><span class="lineno"> 301</span>&#160; ButtonClickState &amp;= ~button; <span class="comment">// clear &quot;click&quot; event</span></div>
<div class="line"><a name="l00302"></a><span class="lineno"> 302</span>&#160; <span class="keywordflow">return</span> click;</div>
<div class="line"><a name="l00303"></a><span class="lineno"> 303</span>&#160;}</div>
<div class="line"><a name="l00304"></a><span class="lineno"> 304</span>&#160;</div>
<div class="line"><a name="l00305"></a><span class="lineno"><a class="code" href="class_x_b_o_x_u_s_b.html#a7fcef8741de99d56f3a4d7fad9f954ff"> 305</a></span>&#160;int16_t <a class="code" href="class_x_b_o_x_u_s_b.html#a7fcef8741de99d56f3a4d7fad9f954ff">XBOXUSB::getAnalogHat</a>(<a class="code" href="controller_enums_8h.html#aaaabdefc068fd57ec2bef2b62ea4ba92">AnalogHat</a> a) {</div>
<div class="line"><a name="l00306"></a><span class="lineno"> 306</span>&#160; <span class="keywordflow">return</span> hatValue[a];</div>
<div class="line"><a name="l00307"></a><span class="lineno"> 307</span>&#160;}</div>
<div class="line"><a name="l00308"></a><span class="lineno"> 308</span>&#160;</div>
<div class="line"><a name="l00309"></a><span class="lineno"> 309</span>&#160;<span class="comment">/* Xbox Controller commands */</span></div>
<div class="line"><a name="l00310"></a><span class="lineno"> 310</span>&#160;<span class="keywordtype">void</span> XBOXUSB::XboxCommand(uint8_t* data, uint16_t nbytes) {</div>
<div class="line"><a name="l00311"></a><span class="lineno"> 311</span>&#160; <span class="comment">//bmRequest = Host to device (0x00) | Class (0x20) | Interface (0x01) = 0x21, bRequest = Set Report (0x09), Report ID (0x00), Report Type (Output 0x02), interface (0x00), datalength, datalength, data)</span></div>
<div class="line"><a name="l00312"></a><span class="lineno"> 312</span>&#160; <a class="code" href="class_x_b_o_x_u_s_b.html#a9c701658d4f63b5407cbcd5b78d8eb18">pUsb</a>-&gt;<a class="code" href="class_u_s_b.html#a636695a5c3d35cd6b9e31c54edfacd7c">ctrlReq</a>(<a class="code" href="class_x_b_o_x_u_s_b.html#a5e9c00af9f4b978c53819791b0a0eb65">bAddress</a>, <a class="code" href="class_x_b_o_x_u_s_b.html#abef4a852d877d8136f198431ce54550f">epInfo</a>[<a class="code" href="_x_b_o_x_r_e_c_v_8h.html#a8f4ee68cc0f05690f5f26104c7d9e490">XBOX_CONTROL_PIPE</a>].epAddr, <a class="code" href="_b_t_d_8h.html#a5bd4ea095da29635414952894bd527f5">bmREQ_HID_OUT</a>, <a class="code" href="_b_t_d_8h.html#aee05d40a014750b24a7e9967f6f389f4">HID_REQUEST_SET_REPORT</a>, 0x00, 0x02, 0x00, nbytes, nbytes, data, NULL);</div>
<div class="line"><a name="l00313"></a><span class="lineno"> 313</span>&#160;}</div>
<div class="line"><a name="l00314"></a><span class="lineno"> 314</span>&#160;</div>
<div class="line"><a name="l00315"></a><span class="lineno"><a class="code" href="class_x_b_o_x_u_s_b.html#a2cb9786f22e69ec3db26d9a55f95e22e"> 315</a></span>&#160;<span class="keywordtype">void</span> <a class="code" href="class_x_b_o_x_u_s_b.html#a2cb9786f22e69ec3db26d9a55f95e22e">XBOXUSB::setLedRaw</a>(uint8_t value) {</div>
<div class="line"><a name="l00316"></a><span class="lineno"> 316</span>&#160; writeBuf[0] = 0x01;</div>
<div class="line"><a name="l00317"></a><span class="lineno"> 317</span>&#160; writeBuf[1] = 0x03;</div>
<div class="line"><a name="l00318"></a><span class="lineno"> 318</span>&#160; writeBuf[2] = value;</div>
<div class="line"><a name="l00319"></a><span class="lineno"> 319</span>&#160;</div>
<div class="line"><a name="l00320"></a><span class="lineno"> 320</span>&#160; XboxCommand(writeBuf, 3);</div>
<div class="line"><a name="l00321"></a><span class="lineno"> 321</span>&#160;}</div>
<div class="line"><a name="l00255"></a><span class="lineno"> 255</span>&#160; <span class="comment">//Notify(PSTR(&quot;\r\nButtonState&quot;), 0x80);</span></div>
<div class="line"><a name="l00256"></a><span class="lineno"> 256</span>&#160; <span class="comment">//PrintHex&lt;uint32_t&gt;(ButtonState, 0x80);</span></div>
<div class="line"><a name="l00257"></a><span class="lineno"> 257</span>&#160;</div>
<div class="line"><a name="l00258"></a><span class="lineno"> 258</span>&#160; <span class="keywordflow">if</span> (ButtonState != OldButtonState) {</div>
<div class="line"><a name="l00259"></a><span class="lineno"> 259</span>&#160; ButtonClickState = (ButtonState &gt;&gt; 16) &amp; ((~OldButtonState) &gt;&gt; 16); <span class="comment">// Update click state variable, but don&#39;t include the two trigger buttons L2 and R2</span></div>
<div class="line"><a name="l00260"></a><span class="lineno"> 260</span>&#160; <span class="keywordflow">if</span> (((uint8_t)OldButtonState) == 0 &amp;&amp; ((uint8_t)ButtonState) != 0) <span class="comment">// The L2 and R2 buttons are special as they are analog buttons</span></div>
<div class="line"><a name="l00261"></a><span class="lineno"> 261</span>&#160; R2Clicked = <span class="keyword">true</span>;</div>
<div class="line"><a name="l00262"></a><span class="lineno"> 262</span>&#160; <span class="keywordflow">if</span> ((uint8_t)(OldButtonState &gt;&gt; 8) == 0 &amp;&amp; (uint8_t)(ButtonState &gt;&gt; 8) != 0)</div>
<div class="line"><a name="l00263"></a><span class="lineno"> 263</span>&#160; L2Clicked = <span class="keyword">true</span>;</div>
<div class="line"><a name="l00264"></a><span class="lineno"> 264</span>&#160; OldButtonState = ButtonState;</div>
<div class="line"><a name="l00265"></a><span class="lineno"> 265</span>&#160; }</div>
<div class="line"><a name="l00266"></a><span class="lineno"> 266</span>&#160;}</div>
<div class="line"><a name="l00267"></a><span class="lineno"> 267</span>&#160;</div>
<div class="line"><a name="l00268"></a><span class="lineno"> 268</span>&#160;<span class="keywordtype">void</span> XBOXUSB::printReport() { <span class="comment">//Uncomment &quot;#define PRINTREPORT&quot; to print the report send by the Xbox 360 Controller</span></div>
<div class="line"><a name="l00269"></a><span class="lineno"> 269</span>&#160;<span class="preprocessor">#ifdef PRINTREPORT</span></div>
<div class="line"><a name="l00270"></a><span class="lineno"> 270</span>&#160;<span class="preprocessor"></span> <span class="keywordflow">if</span> (readBuf == NULL)</div>
<div class="line"><a name="l00271"></a><span class="lineno"> 271</span>&#160; <span class="keywordflow">return</span>;</div>
<div class="line"><a name="l00272"></a><span class="lineno"> 272</span>&#160; <span class="keywordflow">for</span> (uint8_t i = 0; i &lt; <a class="code" href="_x_b_o_x_u_s_b_8h.html#aaa3e91675875fbf14a37369f9513874a">XBOX_REPORT_BUFFER_SIZE</a>; i++) {</div>
<div class="line"><a name="l00273"></a><span class="lineno"> 273</span>&#160; D_PrintHex&lt;uint8_t &gt; (readBuf[i], 0x80);</div>
<div class="line"><a name="l00274"></a><span class="lineno"> 274</span>&#160; <a class="code" href="message_8h.html#a27117e124c5d66d5512fe8d494fe6338">Notify</a>(PSTR(<span class="stringliteral">&quot; &quot;</span>), 0x80);</div>
<div class="line"><a name="l00275"></a><span class="lineno"> 275</span>&#160; }</div>
<div class="line"><a name="l00276"></a><span class="lineno"> 276</span>&#160; <a class="code" href="message_8h.html#a27117e124c5d66d5512fe8d494fe6338">Notify</a>(PSTR(<span class="stringliteral">&quot;\r\n&quot;</span>), 0x80);</div>
<div class="line"><a name="l00277"></a><span class="lineno"> 277</span>&#160;<span class="preprocessor">#endif</span></div>
<div class="line"><a name="l00278"></a><span class="lineno"> 278</span>&#160;<span class="preprocessor"></span>}</div>
<div class="line"><a name="l00279"></a><span class="lineno"> 279</span>&#160;</div>
<div class="line"><a name="l00280"></a><span class="lineno"><a class="code" href="class_x_b_o_x_u_s_b.html#ae18ff481e9dd91658e5e45e7958e7775"> 280</a></span>&#160;uint8_t <a class="code" href="class_x_b_o_x_u_s_b.html#ae18ff481e9dd91658e5e45e7958e7775">XBOXUSB::getButtonPress</a>(<a class="code" href="controller_enums_8h.html#a03bfec859eac87be20f8952c1eb89de0">Button</a> b) {</div>
<div class="line"><a name="l00281"></a><span class="lineno"> 281</span>&#160; <span class="keywordflow">if</span> (b == <a class="code" href="controller_enums_8h.html#a03bfec859eac87be20f8952c1eb89de0a0adffb24dae0c41be5b803f4d444f066">L2</a>) <span class="comment">// These are analog buttons</span></div>
<div class="line"><a name="l00282"></a><span class="lineno"> 282</span>&#160; <span class="keywordflow">return</span> (uint8_t)(ButtonState &gt;&gt; 8);</div>
<div class="line"><a name="l00283"></a><span class="lineno"> 283</span>&#160; <span class="keywordflow">else</span> <span class="keywordflow">if</span> (b == <a class="code" href="controller_enums_8h.html#a03bfec859eac87be20f8952c1eb89de0a629d7b403cea5f826352f3aefb9a6d6a">R2</a>)</div>
<div class="line"><a name="l00284"></a><span class="lineno"> 284</span>&#160; <span class="keywordflow">return</span> (uint8_t)ButtonState;</div>
<div class="line"><a name="l00285"></a><span class="lineno"> 285</span>&#160; <span class="keywordflow">return</span> (ButtonState &amp; ((uint32_t)pgm_read_word(&amp;<a class="code" href="xbox_enums_8h.html#a7e55826e75b9b88578c8b0edaaf523d7">XBOXBUTTONS</a>[(uint8_t)b]) &lt;&lt; 16));</div>
<div class="line"><a name="l00286"></a><span class="lineno"> 286</span>&#160;}</div>
<div class="line"><a name="l00287"></a><span class="lineno"> 287</span>&#160;</div>
<div class="line"><a name="l00288"></a><span class="lineno"><a class="code" href="class_x_b_o_x_u_s_b.html#ab85b8ce772b122f1b9df489c7e045635"> 288</a></span>&#160;<span class="keywordtype">bool</span> <a class="code" href="class_x_b_o_x_u_s_b.html#ab85b8ce772b122f1b9df489c7e045635">XBOXUSB::getButtonClick</a>(<a class="code" href="controller_enums_8h.html#a03bfec859eac87be20f8952c1eb89de0">Button</a> b) {</div>
<div class="line"><a name="l00289"></a><span class="lineno"> 289</span>&#160; <span class="keywordflow">if</span> (b == <a class="code" href="controller_enums_8h.html#a03bfec859eac87be20f8952c1eb89de0a0adffb24dae0c41be5b803f4d444f066">L2</a>) {</div>
<div class="line"><a name="l00290"></a><span class="lineno"> 290</span>&#160; <span class="keywordflow">if</span> (L2Clicked) {</div>
<div class="line"><a name="l00291"></a><span class="lineno"> 291</span>&#160; L2Clicked = <span class="keyword">false</span>;</div>
<div class="line"><a name="l00292"></a><span class="lineno"> 292</span>&#160; <span class="keywordflow">return</span> <span class="keyword">true</span>;</div>
<div class="line"><a name="l00293"></a><span class="lineno"> 293</span>&#160; }</div>
<div class="line"><a name="l00294"></a><span class="lineno"> 294</span>&#160; <span class="keywordflow">return</span> <span class="keyword">false</span>;</div>
<div class="line"><a name="l00295"></a><span class="lineno"> 295</span>&#160; } <span class="keywordflow">else</span> <span class="keywordflow">if</span> (b == <a class="code" href="controller_enums_8h.html#a03bfec859eac87be20f8952c1eb89de0a629d7b403cea5f826352f3aefb9a6d6a">R2</a>) {</div>
<div class="line"><a name="l00296"></a><span class="lineno"> 296</span>&#160; <span class="keywordflow">if</span> (R2Clicked) {</div>
<div class="line"><a name="l00297"></a><span class="lineno"> 297</span>&#160; R2Clicked = <span class="keyword">false</span>;</div>
<div class="line"><a name="l00298"></a><span class="lineno"> 298</span>&#160; <span class="keywordflow">return</span> <span class="keyword">true</span>;</div>
<div class="line"><a name="l00299"></a><span class="lineno"> 299</span>&#160; }</div>
<div class="line"><a name="l00300"></a><span class="lineno"> 300</span>&#160; <span class="keywordflow">return</span> <span class="keyword">false</span>;</div>
<div class="line"><a name="l00301"></a><span class="lineno"> 301</span>&#160; }</div>
<div class="line"><a name="l00302"></a><span class="lineno"> 302</span>&#160; uint16_t button = pgm_read_word(&amp;<a class="code" href="xbox_enums_8h.html#a7e55826e75b9b88578c8b0edaaf523d7">XBOXBUTTONS</a>[(uint8_t)b]);</div>
<div class="line"><a name="l00303"></a><span class="lineno"> 303</span>&#160; <span class="keywordtype">bool</span> click = (ButtonClickState &amp; button);</div>
<div class="line"><a name="l00304"></a><span class="lineno"> 304</span>&#160; ButtonClickState &amp;= ~button; <span class="comment">// clear &quot;click&quot; event</span></div>
<div class="line"><a name="l00305"></a><span class="lineno"> 305</span>&#160; <span class="keywordflow">return</span> click;</div>
<div class="line"><a name="l00306"></a><span class="lineno"> 306</span>&#160;}</div>
<div class="line"><a name="l00307"></a><span class="lineno"> 307</span>&#160;</div>
<div class="line"><a name="l00308"></a><span class="lineno"><a class="code" href="class_x_b_o_x_u_s_b.html#a7fcef8741de99d56f3a4d7fad9f954ff"> 308</a></span>&#160;int16_t <a class="code" href="class_x_b_o_x_u_s_b.html#a7fcef8741de99d56f3a4d7fad9f954ff">XBOXUSB::getAnalogHat</a>(<a class="code" href="controller_enums_8h.html#aaaabdefc068fd57ec2bef2b62ea4ba92">AnalogHat</a> a) {</div>
<div class="line"><a name="l00309"></a><span class="lineno"> 309</span>&#160; <span class="keywordflow">return</span> hatValue[a];</div>
<div class="line"><a name="l00310"></a><span class="lineno"> 310</span>&#160;}</div>
<div class="line"><a name="l00311"></a><span class="lineno"> 311</span>&#160;</div>
<div class="line"><a name="l00312"></a><span class="lineno"> 312</span>&#160;<span class="comment">/* Xbox Controller commands */</span></div>
<div class="line"><a name="l00313"></a><span class="lineno"> 313</span>&#160;<span class="keywordtype">void</span> XBOXUSB::XboxCommand(uint8_t* data, uint16_t nbytes) {</div>
<div class="line"><a name="l00314"></a><span class="lineno"> 314</span>&#160; <span class="comment">//bmRequest = Host to device (0x00) | Class (0x20) | Interface (0x01) = 0x21, bRequest = Set Report (0x09), Report ID (0x00), Report Type (Output 0x02), interface (0x00), datalength, datalength, data)</span></div>
<div class="line"><a name="l00315"></a><span class="lineno"> 315</span>&#160; <a class="code" href="class_x_b_o_x_u_s_b.html#a9c701658d4f63b5407cbcd5b78d8eb18">pUsb</a>-&gt;<a class="code" href="class_u_s_b.html#a636695a5c3d35cd6b9e31c54edfacd7c">ctrlReq</a>(<a class="code" href="class_x_b_o_x_u_s_b.html#a5e9c00af9f4b978c53819791b0a0eb65">bAddress</a>, <a class="code" href="class_x_b_o_x_u_s_b.html#abef4a852d877d8136f198431ce54550f">epInfo</a>[<a class="code" href="_x_b_o_x_o_l_d_8h.html#a8f4ee68cc0f05690f5f26104c7d9e490">XBOX_CONTROL_PIPE</a>].epAddr, <a class="code" href="_b_t_d_8h.html#a5bd4ea095da29635414952894bd527f5">bmREQ_HID_OUT</a>, <a class="code" href="_b_t_d_8h.html#aee05d40a014750b24a7e9967f6f389f4">HID_REQUEST_SET_REPORT</a>, 0x00, 0x02, 0x00, nbytes, nbytes, data, NULL);</div>
<div class="line"><a name="l00316"></a><span class="lineno"> 316</span>&#160;}</div>
<div class="line"><a name="l00317"></a><span class="lineno"> 317</span>&#160;</div>
<div class="line"><a name="l00318"></a><span class="lineno"><a class="code" href="class_x_b_o_x_u_s_b.html#a2cb9786f22e69ec3db26d9a55f95e22e"> 318</a></span>&#160;<span class="keywordtype">void</span> <a class="code" href="class_x_b_o_x_u_s_b.html#a2cb9786f22e69ec3db26d9a55f95e22e">XBOXUSB::setLedRaw</a>(uint8_t value) {</div>
<div class="line"><a name="l00319"></a><span class="lineno"> 319</span>&#160; writeBuf[0] = 0x01;</div>
<div class="line"><a name="l00320"></a><span class="lineno"> 320</span>&#160; writeBuf[1] = 0x03;</div>
<div class="line"><a name="l00321"></a><span class="lineno"> 321</span>&#160; writeBuf[2] = value;</div>
<div class="line"><a name="l00322"></a><span class="lineno"> 322</span>&#160;</div>
<div class="line"><a name="l00323"></a><span class="lineno"><a class="code" href="class_x_b_o_x_u_s_b.html#a2348a35d4302f0a76bbeb319e84349a1"> 323</a></span>&#160;<span class="keywordtype">void</span> <a class="code" href="class_x_b_o_x_u_s_b.html#a2348a35d4302f0a76bbeb319e84349a1">XBOXUSB::setLedOn</a>(<a class="code" href="controller_enums_8h.html#aadcb6002d2b42fdfe01490f730ab00a6">LED</a> led) {</div>
<div class="line"><a name="l00324"></a><span class="lineno"> 324</span>&#160; <span class="keywordflow">if</span> (led != <a class="code" href="controller_enums_8h.html#aadcb6002d2b42fdfe01490f730ab00a6ab1d5eac4b1dca480c8056eaea7663b7a">ALL</a>) <span class="comment">// All LEDs can&#39;t be on a the same time</span></div>
<div class="line"><a name="l00325"></a><span class="lineno"> 325</span>&#160; <a class="code" href="class_x_b_o_x_u_s_b.html#a2cb9786f22e69ec3db26d9a55f95e22e">setLedRaw</a>((pgm_read_byte(&amp;<a class="code" href="xbox_enums_8h.html#a867f3bf7a14d4647290f1ac7f76b23ee">XBOXLEDS</a>[(uint8_t)led])) + 4);</div>
<div class="line"><a name="l00326"></a><span class="lineno"> 326</span>&#160;}</div>
<div class="line"><a name="l00327"></a><span class="lineno"> 327</span>&#160;</div>
<div class="line"><a name="l00328"></a><span class="lineno"><a class="code" href="class_x_b_o_x_u_s_b.html#acc52982e6105d029d1e0980367dc10f6"> 328</a></span>&#160;<span class="keywordtype">void</span> <a class="code" href="class_x_b_o_x_u_s_b.html#acc52982e6105d029d1e0980367dc10f6">XBOXUSB::setLedBlink</a>(<a class="code" href="controller_enums_8h.html#aadcb6002d2b42fdfe01490f730ab00a6">LED</a> led) {</div>
<div class="line"><a name="l00329"></a><span class="lineno"> 329</span>&#160; <a class="code" href="class_x_b_o_x_u_s_b.html#a2cb9786f22e69ec3db26d9a55f95e22e">setLedRaw</a>(pgm_read_byte(&amp;<a class="code" href="xbox_enums_8h.html#a867f3bf7a14d4647290f1ac7f76b23ee">XBOXLEDS</a>[(uint8_t)led]));</div>
<div class="line"><a name="l00330"></a><span class="lineno"> 330</span>&#160;}</div>
<div class="line"><a name="l00331"></a><span class="lineno"> 331</span>&#160;</div>
<div class="line"><a name="l00332"></a><span class="lineno"><a class="code" href="class_x_b_o_x_u_s_b.html#a7426adef803da704df7593858389926e"> 332</a></span>&#160;<span class="keywordtype">void</span> <a class="code" href="class_x_b_o_x_u_s_b.html#a7426adef803da704df7593858389926e">XBOXUSB::setLedMode</a>(<a class="code" href="xbox_enums_8h.html#a57effb96f46e458675a2653d4c543ca2">LEDMode</a> ledMode) { <span class="comment">// This function is used to do some speciel LED stuff the controller supports</span></div>
<div class="line"><a name="l00333"></a><span class="lineno"> 333</span>&#160; <a class="code" href="class_x_b_o_x_u_s_b.html#a2cb9786f22e69ec3db26d9a55f95e22e">setLedRaw</a>((uint8_t)ledMode);</div>
<div class="line"><a name="l00334"></a><span class="lineno"> 334</span>&#160;}</div>
<div class="line"><a name="l00335"></a><span class="lineno"> 335</span>&#160;</div>
<div class="line"><a name="l00336"></a><span class="lineno"><a class="code" href="class_x_b_o_x_u_s_b.html#ae70ae50ed8188a2bf8c25d0ee17f54d9"> 336</a></span>&#160;<span class="keywordtype">void</span> <a class="code" href="class_x_b_o_x_u_s_b.html#ae70ae50ed8188a2bf8c25d0ee17f54d9">XBOXUSB::setRumbleOn</a>(uint8_t lValue, uint8_t rValue) {</div>
<div class="line"><a name="l00337"></a><span class="lineno"> 337</span>&#160; writeBuf[0] = 0x00;</div>
<div class="line"><a name="l00338"></a><span class="lineno"> 338</span>&#160; writeBuf[1] = 0x08;</div>
<div class="line"><a name="l00339"></a><span class="lineno"> 339</span>&#160; writeBuf[2] = 0x00;</div>
<div class="line"><a name="l00340"></a><span class="lineno"> 340</span>&#160; writeBuf[3] = lValue; <span class="comment">// big weight</span></div>
<div class="line"><a name="l00341"></a><span class="lineno"> 341</span>&#160; writeBuf[4] = rValue; <span class="comment">// small weight</span></div>
<div class="line"><a name="l00342"></a><span class="lineno"> 342</span>&#160; writeBuf[5] = 0x00;</div>
<div class="line"><a name="l00343"></a><span class="lineno"> 343</span>&#160; writeBuf[6] = 0x00;</div>
<div class="line"><a name="l00344"></a><span class="lineno"> 344</span>&#160; writeBuf[7] = 0x00;</div>
<div class="line"><a name="l00345"></a><span class="lineno"> 345</span>&#160;</div>
<div class="line"><a name="l00346"></a><span class="lineno"> 346</span>&#160; XboxCommand(writeBuf, 8);</div>
<div class="line"><a name="l00347"></a><span class="lineno"> 347</span>&#160;}</div>
<div class="line"><a name="l00323"></a><span class="lineno"> 323</span>&#160; XboxCommand(writeBuf, 3);</div>
<div class="line"><a name="l00324"></a><span class="lineno"> 324</span>&#160;}</div>
<div class="line"><a name="l00325"></a><span class="lineno"> 325</span>&#160;</div>
<div class="line"><a name="l00326"></a><span class="lineno"><a class="code" href="class_x_b_o_x_u_s_b.html#a2348a35d4302f0a76bbeb319e84349a1"> 326</a></span>&#160;<span class="keywordtype">void</span> <a class="code" href="class_x_b_o_x_u_s_b.html#a2348a35d4302f0a76bbeb319e84349a1">XBOXUSB::setLedOn</a>(<a class="code" href="controller_enums_8h.html#aadcb6002d2b42fdfe01490f730ab00a6">LED</a> led) {</div>
<div class="line"><a name="l00327"></a><span class="lineno"> 327</span>&#160; <span class="keywordflow">if</span> (led != <a class="code" href="controller_enums_8h.html#aadcb6002d2b42fdfe01490f730ab00a6ab1d5eac4b1dca480c8056eaea7663b7a">ALL</a>) <span class="comment">// All LEDs can&#39;t be on a the same time</span></div>
<div class="line"><a name="l00328"></a><span class="lineno"> 328</span>&#160; <a class="code" href="class_x_b_o_x_u_s_b.html#a2cb9786f22e69ec3db26d9a55f95e22e">setLedRaw</a>((pgm_read_byte(&amp;<a class="code" href="xbox_enums_8h.html#a867f3bf7a14d4647290f1ac7f76b23ee">XBOXLEDS</a>[(uint8_t)led])) + 4);</div>
<div class="line"><a name="l00329"></a><span class="lineno"> 329</span>&#160;}</div>
<div class="line"><a name="l00330"></a><span class="lineno"> 330</span>&#160;</div>
<div class="line"><a name="l00331"></a><span class="lineno"><a class="code" href="class_x_b_o_x_u_s_b.html#acc52982e6105d029d1e0980367dc10f6"> 331</a></span>&#160;<span class="keywordtype">void</span> <a class="code" href="class_x_b_o_x_u_s_b.html#acc52982e6105d029d1e0980367dc10f6">XBOXUSB::setLedBlink</a>(<a class="code" href="controller_enums_8h.html#aadcb6002d2b42fdfe01490f730ab00a6">LED</a> led) {</div>
<div class="line"><a name="l00332"></a><span class="lineno"> 332</span>&#160; <a class="code" href="class_x_b_o_x_u_s_b.html#a2cb9786f22e69ec3db26d9a55f95e22e">setLedRaw</a>(pgm_read_byte(&amp;<a class="code" href="xbox_enums_8h.html#a867f3bf7a14d4647290f1ac7f76b23ee">XBOXLEDS</a>[(uint8_t)led]));</div>
<div class="line"><a name="l00333"></a><span class="lineno"> 333</span>&#160;}</div>
<div class="line"><a name="l00334"></a><span class="lineno"> 334</span>&#160;</div>
<div class="line"><a name="l00335"></a><span class="lineno"><a class="code" href="class_x_b_o_x_u_s_b.html#a7426adef803da704df7593858389926e"> 335</a></span>&#160;<span class="keywordtype">void</span> <a class="code" href="class_x_b_o_x_u_s_b.html#a7426adef803da704df7593858389926e">XBOXUSB::setLedMode</a>(<a class="code" href="xbox_enums_8h.html#a57effb96f46e458675a2653d4c543ca2">LEDMode</a> ledMode) { <span class="comment">// This function is used to do some speciel LED stuff the controller supports</span></div>
<div class="line"><a name="l00336"></a><span class="lineno"> 336</span>&#160; <a class="code" href="class_x_b_o_x_u_s_b.html#a2cb9786f22e69ec3db26d9a55f95e22e">setLedRaw</a>((uint8_t)ledMode);</div>
<div class="line"><a name="l00337"></a><span class="lineno"> 337</span>&#160;}</div>
<div class="line"><a name="l00338"></a><span class="lineno"> 338</span>&#160;</div>
<div class="line"><a name="l00339"></a><span class="lineno"><a class="code" href="class_x_b_o_x_u_s_b.html#ae70ae50ed8188a2bf8c25d0ee17f54d9"> 339</a></span>&#160;<span class="keywordtype">void</span> <a class="code" href="class_x_b_o_x_u_s_b.html#ae70ae50ed8188a2bf8c25d0ee17f54d9">XBOXUSB::setRumbleOn</a>(uint8_t lValue, uint8_t rValue) {</div>
<div class="line"><a name="l00340"></a><span class="lineno"> 340</span>&#160; writeBuf[0] = 0x00;</div>
<div class="line"><a name="l00341"></a><span class="lineno"> 341</span>&#160; writeBuf[1] = 0x08;</div>
<div class="line"><a name="l00342"></a><span class="lineno"> 342</span>&#160; writeBuf[2] = 0x00;</div>
<div class="line"><a name="l00343"></a><span class="lineno"> 343</span>&#160; writeBuf[3] = lValue; <span class="comment">// big weight</span></div>
<div class="line"><a name="l00344"></a><span class="lineno"> 344</span>&#160; writeBuf[4] = rValue; <span class="comment">// small weight</span></div>
<div class="line"><a name="l00345"></a><span class="lineno"> 345</span>&#160; writeBuf[5] = 0x00;</div>
<div class="line"><a name="l00346"></a><span class="lineno"> 346</span>&#160; writeBuf[6] = 0x00;</div>
<div class="line"><a name="l00347"></a><span class="lineno"> 347</span>&#160; writeBuf[7] = 0x00;</div>
<div class="line"><a name="l00348"></a><span class="lineno"> 348</span>&#160;</div>
<div class="line"><a name="l00349"></a><span class="lineno"> 349</span>&#160; XboxCommand(writeBuf, 8);</div>
<div class="line"><a name="l00350"></a><span class="lineno"> 350</span>&#160;}</div>
<div class="line"><a name="l00351"></a><span class="lineno"> 351</span>&#160;</div>
<div class="line"><a name="l00352"></a><span class="lineno"> 352</span>&#160;<span class="keywordtype">void</span> XBOXUSB::onInit() {</div>
<div class="line"><a name="l00353"></a><span class="lineno"> 353</span>&#160; <span class="keywordflow">if</span> (pFuncOnInit)</div>
<div class="line"><a name="l00354"></a><span class="lineno"> 354</span>&#160; pFuncOnInit(); <span class="comment">// Call the user function</span></div>
<div class="line"><a name="l00355"></a><span class="lineno"> 355</span>&#160; <span class="keywordflow">else</span></div>
<div class="line"><a name="l00356"></a><span class="lineno"> 356</span>&#160; <a class="code" href="class_x_b_o_x_u_s_b.html#a2348a35d4302f0a76bbeb319e84349a1">setLedOn</a>(<a class="code" href="controller_enums_8h.html#aadcb6002d2b42fdfe01490f730ab00a6adac6477842247cab1a8c02c65f431b44">LED1</a>);</div>
<div class="line"><a name="l00357"></a><span class="lineno"> 357</span>&#160;}</div>
</div><!-- fragment --></div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>

View file

@ -100,7 +100,7 @@ Include dependency graph for XBOXUSB.h:</div>
<div class="dyncontent">
<div class="center"><img src="_x_b_o_x_u_s_b_8h__incl.png" border="0" usemap="#_x_b_o_x_u_s_b_8h" alt=""/></div>
<map name="_x_b_o_x_u_s_b_8h" id="_x_b_o_x_u_s_b_8h">
<area shape="rect" id="node3" href="_usb_8h.html" title="Usb.h" alt="" coords="357,75,400,96"/><area shape="rect" id="node18" href="xbox_enums_8h.html" title="xboxEnums.h" alt="" coords="581,75,651,96"/><area shape="rect" id="node6" href="avrpins_8h.html" title="avrpins.h" alt="" coords="43,213,97,235"/><area shape="rect" id="node8" href="max3421e_8h.html" title="max3421e.h" alt="" coords="275,213,341,235"/><area shape="rect" id="node9" href="usbhost_8h.html" title="usbhost.h" alt="" coords="199,144,256,165"/><area shape="rect" id="node10" href="usb__ch9_8h.html" title="usb_ch9.h" alt="" coords="123,213,181,235"/><area shape="rect" id="node12" href="address_8h.html" title="address.h" alt="" coords="350,144,407,165"/><area shape="rect" id="node14" href="message_8h.html" title="message.h" alt="" coords="643,144,704,165"/><area shape="rect" id="node16" href="printhex_8h.html" title="printhex.h" alt="" coords="746,283,803,304"/><area shape="rect" id="node17" href="hexdump_8h.html" title="hexdump.h" alt="" coords="643,213,704,235"/><area shape="rect" id="node19" href="controller_enums_8h.html" title="controllerEnums.h" alt="" coords="729,144,815,165"/></map>
<area shape="rect" id="node3" href="_usb_8h.html" title="Usb.h" alt="" coords="420,75,463,96"/><area shape="rect" id="node18" href="xbox_enums_8h.html" title="xboxEnums.h" alt="" coords="725,75,795,96"/><area shape="rect" id="node6" href="avrpins_8h.html" title="avrpins.h" alt="" coords="43,213,97,235"/><area shape="rect" id="node8" href="max3421e_8h.html" title="max3421e.h" alt="" coords="325,213,392,235"/><area shape="rect" id="node9" href="usbhost_8h.html" title="usbhost.h" alt="" coords="186,144,243,165"/><area shape="rect" id="node10" href="usb__ch9_8h.html" title="usb_ch9.h" alt="" coords="243,213,301,235"/><area shape="rect" id="node12" href="address_8h.html" title="address.h" alt="" coords="413,144,469,165"/><area shape="rect" id="node14" href="message_8h.html" title="message.h" alt="" coords="659,144,720,165"/><area shape="rect" id="node16" href="printhex_8h.html" title="printhex.h" alt="" coords="627,283,684,304"/><area shape="rect" id="node17" href="hexdump_8h.html" title="hexdump.h" alt="" coords="693,213,755,235"/><area shape="rect" id="node19" href="controller_enums_8h.html" title="controllerEnums.h" alt="" coords="955,144,1041,165"/></map>
</div>
</div><div class="textblock"><div class="dynheader">
This graph shows which files directly or indirectly include this file:</div>
@ -131,16 +131,18 @@ Macros</h2></td></tr>
<tr class="separator:a92d2d844a70224a10c100c0a877aacfe"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a8e7834e5604c4fb588cceab9258d0568"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="_x_b_o_x_u_s_b_8h.html#a8e7834e5604c4fb588cceab9258d0568">XBOX_VID</a>&#160;&#160;&#160;0x045E</td></tr>
<tr class="separator:a8e7834e5604c4fb588cceab9258d0568"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a2f5523a1aaa6718e1d11c6bc5b29a575"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="_x_b_o_x_u_s_b_8h.html#a2f5523a1aaa6718e1d11c6bc5b29a575">MADCATZ_VID</a>&#160;&#160;&#160;0x1BAD</td></tr>
<tr class="separator:a2f5523a1aaa6718e1d11c6bc5b29a575"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ab029b2c21fb0c240022cc50f465d4580"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="_x_b_o_x_u_s_b_8h.html#ab029b2c21fb0c240022cc50f465d4580">JOYTECH_VID</a>&#160;&#160;&#160;0x162E</td></tr>
<tr class="separator:ab029b2c21fb0c240022cc50f465d4580"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:af2ec224ac142016119c418de89470f1f"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="_x_b_o_x_u_s_b_8h.html#af2ec224ac142016119c418de89470f1f">XBOX_WIRED_PID</a>&#160;&#160;&#160;0x028E</td></tr>
<tr class="separator:af2ec224ac142016119c418de89470f1f"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a10c2a7a8da78e76d7020c2c347f0a687"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="_x_b_o_x_u_s_b_8h.html#a10c2a7a8da78e76d7020c2c347f0a687">XBOX_WIRELESS_PID</a>&#160;&#160;&#160;0x028F</td></tr>
<tr class="separator:a10c2a7a8da78e76d7020c2c347f0a687"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a1a97ce2829a30b96ea6640d387d245a9"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="_x_b_o_x_u_s_b_8h.html#a1a97ce2829a30b96ea6640d387d245a9">XBOX_WIRELESS_RECEIVER_PID</a>&#160;&#160;&#160;0x0719</td></tr>
<tr class="separator:a1a97ce2829a30b96ea6640d387d245a9"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a6842663964e470b86786f046e4bc30d9"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="_x_b_o_x_u_s_b_8h.html#a6842663964e470b86786f046e4bc30d9">XBOX_WIRELESS_RECEIVER_THIRD_PARTY_PID</a>&#160;&#160;&#160;0x0291</td></tr>
<tr class="separator:a6842663964e470b86786f046e4bc30d9"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a2f5523a1aaa6718e1d11c6bc5b29a575"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="_x_b_o_x_u_s_b_8h.html#a2f5523a1aaa6718e1d11c6bc5b29a575">MADCATZ_VID</a>&#160;&#160;&#160;0x1BAD</td></tr>
<tr class="separator:a2f5523a1aaa6718e1d11c6bc5b29a575"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ab029b2c21fb0c240022cc50f465d4580"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="_x_b_o_x_u_s_b_8h.html#ab029b2c21fb0c240022cc50f465d4580">JOYTECH_VID</a>&#160;&#160;&#160;0x162E</td></tr>
<tr class="separator:ab029b2c21fb0c240022cc50f465d4580"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aaa3e91675875fbf14a37369f9513874a"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="_x_b_o_x_u_s_b_8h.html#aaa3e91675875fbf14a37369f9513874a">XBOX_REPORT_BUFFER_SIZE</a>&#160;&#160;&#160;14</td></tr>
<tr class="separator:aaa3e91675875fbf14a37369f9513874a"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a5bd4ea095da29635414952894bd527f5"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="_x_b_o_x_u_s_b_8h.html#a5bd4ea095da29635414952894bd527f5">bmREQ_HID_OUT</a>&#160;&#160;&#160;<a class="el" href="usb__ch9_8h.html#a610dad02930a3061c746f84885e1e11e">USB_SETUP_HOST_TO_DEVICE</a>|<a class="el" href="usb__ch9_8h.html#acf3fd30992e9fe01f1bac9aaa7fea61b">USB_SETUP_TYPE_CLASS</a>|<a class="el" href="usb__ch9_8h.html#a59754621c21db801e11513ba06a3a02e">USB_SETUP_RECIPIENT_INTERFACE</a></td></tr>
@ -233,48 +235,6 @@ Macros</h2></td></tr>
<p>Definition at line <a class="el" href="_x_b_o_x_u_s_b_8h_source.html#l00042">42</a> of file <a class="el" href="_x_b_o_x_u_s_b_8h_source.html">XBOXUSB.h</a>.</p>
</div>
</div>
<a class="anchor" id="a10c2a7a8da78e76d7020c2c347f0a687"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">#define XBOX_WIRELESS_PID&#160;&#160;&#160;0x028F</td>
</tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="_x_b_o_x_u_s_b_8h_source.html#l00043">43</a> of file <a class="el" href="_x_b_o_x_u_s_b_8h_source.html">XBOXUSB.h</a>.</p>
</div>
</div>
<a class="anchor" id="a1a97ce2829a30b96ea6640d387d245a9"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">#define XBOX_WIRELESS_RECEIVER_PID&#160;&#160;&#160;0x0719</td>
</tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="_x_b_o_x_u_s_b_8h_source.html#l00044">44</a> of file <a class="el" href="_x_b_o_x_u_s_b_8h_source.html">XBOXUSB.h</a>.</p>
</div>
</div>
<a class="anchor" id="a6842663964e470b86786f046e4bc30d9"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">#define XBOX_WIRELESS_RECEIVER_THIRD_PARTY_PID&#160;&#160;&#160;0x0291</td>
</tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="_x_b_o_x_u_s_b_8h_source.html#l00045">45</a> of file <a class="el" href="_x_b_o_x_u_s_b_8h_source.html">XBOXUSB.h</a>.</p>
</div>
</div>
<a class="anchor" id="a2f5523a1aaa6718e1d11c6bc5b29a575"></a>
@ -287,7 +247,7 @@ Macros</h2></td></tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="_x_b_o_x_u_s_b_8h_source.html#l00047">47</a> of file <a class="el" href="_x_b_o_x_u_s_b_8h_source.html">XBOXUSB.h</a>.</p>
<p>Definition at line <a class="el" href="_x_b_o_x_u_s_b_8h_source.html#l00043">43</a> of file <a class="el" href="_x_b_o_x_u_s_b_8h_source.html">XBOXUSB.h</a>.</p>
</div>
</div>
@ -301,8 +261,64 @@ Macros</h2></td></tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="_x_b_o_x_u_s_b_8h_source.html#l00044">44</a> of file <a class="el" href="_x_b_o_x_u_s_b_8h_source.html">XBOXUSB.h</a>.</p>
</div>
</div>
<a class="anchor" id="af2ec224ac142016119c418de89470f1f"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">#define XBOX_WIRED_PID&#160;&#160;&#160;0x028E</td>
</tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="_x_b_o_x_u_s_b_8h_source.html#l00046">46</a> of file <a class="el" href="_x_b_o_x_u_s_b_8h_source.html">XBOXUSB.h</a>.</p>
</div>
</div>
<a class="anchor" id="a10c2a7a8da78e76d7020c2c347f0a687"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">#define XBOX_WIRELESS_PID&#160;&#160;&#160;0x028F</td>
</tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="_x_b_o_x_u_s_b_8h_source.html#l00047">47</a> of file <a class="el" href="_x_b_o_x_u_s_b_8h_source.html">XBOXUSB.h</a>.</p>
</div>
</div>
<a class="anchor" id="a1a97ce2829a30b96ea6640d387d245a9"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">#define XBOX_WIRELESS_RECEIVER_PID&#160;&#160;&#160;0x0719</td>
</tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="_x_b_o_x_u_s_b_8h_source.html#l00048">48</a> of file <a class="el" href="_x_b_o_x_u_s_b_8h_source.html">XBOXUSB.h</a>.</p>
</div>
</div>
<a class="anchor" id="a6842663964e470b86786f046e4bc30d9"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">#define XBOX_WIRELESS_RECEIVER_THIRD_PARTY_PID&#160;&#160;&#160;0x0291</td>
</tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="_x_b_o_x_u_s_b_8h_source.html#l00049">49</a> of file <a class="el" href="_x_b_o_x_u_s_b_8h_source.html">XBOXUSB.h</a>.</p>
</div>
</div>
<a class="anchor" id="aaa3e91675875fbf14a37369f9513874a"></a>
@ -315,7 +331,7 @@ Macros</h2></td></tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="_x_b_o_x_u_s_b_8h_source.html#l00050">50</a> of file <a class="el" href="_x_b_o_x_u_s_b_8h_source.html">XBOXUSB.h</a>.</p>
<p>Definition at line <a class="el" href="_x_b_o_x_u_s_b_8h_source.html#l00051">51</a> of file <a class="el" href="_x_b_o_x_u_s_b_8h_source.html">XBOXUSB.h</a>.</p>
</div>
</div>
@ -329,7 +345,7 @@ Macros</h2></td></tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="_x_b_o_x_u_s_b_8h_source.html#l00053">53</a> of file <a class="el" href="_x_b_o_x_u_s_b_8h_source.html">XBOXUSB.h</a>.</p>
<p>Definition at line <a class="el" href="_x_b_o_x_u_s_b_8h_source.html#l00054">54</a> of file <a class="el" href="_x_b_o_x_u_s_b_8h_source.html">XBOXUSB.h</a>.</p>
</div>
</div>
@ -343,7 +359,7 @@ Macros</h2></td></tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="_x_b_o_x_u_s_b_8h_source.html#l00054">54</a> of file <a class="el" href="_x_b_o_x_u_s_b_8h_source.html">XBOXUSB.h</a>.</p>
<p>Definition at line <a class="el" href="_x_b_o_x_u_s_b_8h_source.html#l00055">55</a> of file <a class="el" href="_x_b_o_x_u_s_b_8h_source.html">XBOXUSB.h</a>.</p>
</div>
</div>
@ -357,7 +373,7 @@ Macros</h2></td></tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="_x_b_o_x_u_s_b_8h_source.html#l00056">56</a> of file <a class="el" href="_x_b_o_x_u_s_b_8h_source.html">XBOXUSB.h</a>.</p>
<p>Definition at line <a class="el" href="_x_b_o_x_u_s_b_8h_source.html#l00057">57</a> of file <a class="el" href="_x_b_o_x_u_s_b_8h_source.html">XBOXUSB.h</a>.</p>
</div>
</div>

View file

@ -1,13 +1,13 @@
<map id="XBOXUSB.h" name="XBOXUSB.h">
<area shape="rect" id="node3" href="$_usb_8h.html" title="Usb.h" alt="" coords="357,75,400,96"/>
<area shape="rect" id="node18" href="$xbox_enums_8h.html" title="xboxEnums.h" alt="" coords="581,75,651,96"/>
<area shape="rect" id="node3" href="$_usb_8h.html" title="Usb.h" alt="" coords="420,75,463,96"/>
<area shape="rect" id="node18" href="$xbox_enums_8h.html" title="xboxEnums.h" alt="" coords="725,75,795,96"/>
<area shape="rect" id="node6" href="$avrpins_8h.html" title="avrpins.h" alt="" coords="43,213,97,235"/>
<area shape="rect" id="node8" href="$max3421e_8h.html" title="max3421e.h" alt="" coords="275,213,341,235"/>
<area shape="rect" id="node9" href="$usbhost_8h.html" title="usbhost.h" alt="" coords="199,144,256,165"/>
<area shape="rect" id="node10" href="$usb__ch9_8h.html" title="usb_ch9.h" alt="" coords="123,213,181,235"/>
<area shape="rect" id="node12" href="$address_8h.html" title="address.h" alt="" coords="350,144,407,165"/>
<area shape="rect" id="node14" href="$message_8h.html" title="message.h" alt="" coords="643,144,704,165"/>
<area shape="rect" id="node16" href="$printhex_8h.html" title="printhex.h" alt="" coords="746,283,803,304"/>
<area shape="rect" id="node17" href="$hexdump_8h.html" title="hexdump.h" alt="" coords="643,213,704,235"/>
<area shape="rect" id="node19" href="$controller_enums_8h.html" title="controllerEnums.h" alt="" coords="729,144,815,165"/>
<area shape="rect" id="node8" href="$max3421e_8h.html" title="max3421e.h" alt="" coords="325,213,392,235"/>
<area shape="rect" id="node9" href="$usbhost_8h.html" title="usbhost.h" alt="" coords="186,144,243,165"/>
<area shape="rect" id="node10" href="$usb__ch9_8h.html" title="usb_ch9.h" alt="" coords="243,213,301,235"/>
<area shape="rect" id="node12" href="$address_8h.html" title="address.h" alt="" coords="413,144,469,165"/>
<area shape="rect" id="node14" href="$message_8h.html" title="message.h" alt="" coords="659,144,720,165"/>
<area shape="rect" id="node16" href="$printhex_8h.html" title="printhex.h" alt="" coords="627,283,684,304"/>
<area shape="rect" id="node17" href="$hexdump_8h.html" title="hexdump.h" alt="" coords="693,213,755,235"/>
<area shape="rect" id="node19" href="$controller_enums_8h.html" title="controllerEnums.h" alt="" coords="955,144,1041,165"/>
</map>

View file

@ -1 +1 @@
5d51cb4fe0c3c9ec85174b689556eadf
99bca373ca57a28c752a0a1198ff9fde

Binary file not shown.

Before

Width:  |  Height:  |  Size: 60 KiB

After

Width:  |  Height:  |  Size: 67 KiB

View file

@ -131,87 +131,99 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
<div class="line"><a name="l00040"></a><span class="lineno"> 40</span>&#160;<span class="preprocessor"></span></div>
<div class="line"><a name="l00041"></a><span class="lineno"> 41</span>&#160;<span class="comment">// PID and VID of the different devices</span></div>
<div class="line"><a name="l00042"></a><span class="lineno"><a class="code" href="_x_b_o_x_u_s_b_8h.html#a8e7834e5604c4fb588cceab9258d0568"> 42</a></span>&#160;<span class="preprocessor">#define XBOX_VID 0x045E // Microsoft Corporation</span></div>
<div class="line"><a name="l00043"></a><span class="lineno"><a class="code" href="_x_b_o_x_u_s_b_8h.html#a10c2a7a8da78e76d7020c2c347f0a687"> 43</a></span>&#160;<span class="preprocessor"></span><span class="preprocessor">#define XBOX_WIRELESS_PID 0x028F // Wireless controller only support charging</span></div>
<div class="line"><a name="l00044"></a><span class="lineno"><a class="code" href="_x_b_o_x_u_s_b_8h.html#a1a97ce2829a30b96ea6640d387d245a9"> 44</a></span>&#160;<span class="preprocessor"></span><span class="preprocessor">#define XBOX_WIRELESS_RECEIVER_PID 0x0719 // Microsoft Wireless Gaming Receiver</span></div>
<div class="line"><a name="l00045"></a><span class="lineno"><a class="code" href="_x_b_o_x_u_s_b_8h.html#a6842663964e470b86786f046e4bc30d9"> 45</a></span>&#160;<span class="preprocessor"></span><span class="preprocessor">#define XBOX_WIRELESS_RECEIVER_THIRD_PARTY_PID 0x0291 // Third party Wireless Gaming Receiver</span></div>
<div class="line"><a name="l00046"></a><span class="lineno"> 46</span>&#160;<span class="preprocessor"></span></div>
<div class="line"><a name="l00047"></a><span class="lineno"><a class="code" href="_x_b_o_x_u_s_b_8h.html#a2f5523a1aaa6718e1d11c6bc5b29a575"> 47</a></span>&#160;<span class="preprocessor">#define MADCATZ_VID 0x1BAD // For unofficial Mad Catz controllers</span></div>
<div class="line"><a name="l00048"></a><span class="lineno"><a class="code" href="_x_b_o_x_u_s_b_8h.html#ab029b2c21fb0c240022cc50f465d4580"> 48</a></span>&#160;<span class="preprocessor"></span><span class="preprocessor">#define JOYTECH_VID 0x162E // For unofficial Joytech controllers</span></div>
<div class="line"><a name="l00049"></a><span class="lineno"> 49</span>&#160;<span class="preprocessor"></span></div>
<div class="line"><a name="l00050"></a><span class="lineno"><a class="code" href="_x_b_o_x_u_s_b_8h.html#aaa3e91675875fbf14a37369f9513874a"> 50</a></span>&#160;<span class="preprocessor">#define XBOX_REPORT_BUFFER_SIZE 14 // Size of the input report buffer</span></div>
<div class="line"><a name="l00051"></a><span class="lineno"> 51</span>&#160;<span class="preprocessor"></span></div>
<div class="line"><a name="l00052"></a><span class="lineno"> 52</span>&#160;<span class="comment">// Used in control endpoint header for HID Commands</span></div>
<div class="line"><a name="l00053"></a><span class="lineno"><a class="code" href="_x_b_o_x_u_s_b_8h.html#a5bd4ea095da29635414952894bd527f5"> 53</a></span>&#160;<span class="preprocessor">#define bmREQ_HID_OUT USB_SETUP_HOST_TO_DEVICE|USB_SETUP_TYPE_CLASS|USB_SETUP_RECIPIENT_INTERFACE</span></div>
<div class="line"><a name="l00054"></a><span class="lineno"><a class="code" href="_x_b_o_x_u_s_b_8h.html#aee05d40a014750b24a7e9967f6f389f4"> 54</a></span>&#160;<span class="preprocessor"></span><span class="preprocessor">#define HID_REQUEST_SET_REPORT 0x09</span></div>
<div class="line"><a name="l00055"></a><span class="lineno"> 55</span>&#160;<span class="preprocessor"></span></div>
<div class="line"><a name="l00056"></a><span class="lineno"><a class="code" href="_x_b_o_x_u_s_b_8h.html#af35f872fc33e690571eb99de648e8e96"> 56</a></span>&#160;<span class="preprocessor">#define XBOX_MAX_ENDPOINTS 3</span></div>
<div class="line"><a name="l00057"></a><span class="lineno"> 57</span>&#160;<span class="preprocessor"></span></div>
<div class="line"><a name="l00059"></a><span class="lineno"><a class="code" href="class_x_b_o_x_u_s_b.html"> 59</a></span>&#160;<span class="keyword">class </span><a class="code" href="class_x_b_o_x_u_s_b.html">XBOXUSB</a> : <span class="keyword">public</span> <a class="code" href="class_u_s_b_device_config.html">USBDeviceConfig</a> {</div>
<div class="line"><a name="l00060"></a><span class="lineno"> 60</span>&#160;<span class="keyword">public</span>:</div>
<div class="line"><a name="l00065"></a><span class="lineno"> 65</span>&#160; <a class="code" href="class_x_b_o_x_u_s_b.html#a4b676a33152112e6edfb14be125a78d2">XBOXUSB</a>(<a class="code" href="class_u_s_b.html">USB</a> *<a class="code" href="class_x_b_o_x_u_s_b.html#a9c701658d4f63b5407cbcd5b78d8eb18">pUsb</a>);</div>
<div class="line"><a name="l00066"></a><span class="lineno"> 66</span>&#160;</div>
<div class="line"><a name="l00075"></a><span class="lineno"> 75</span>&#160; <span class="keyword">virtual</span> uint8_t <a class="code" href="class_x_b_o_x_u_s_b.html#a9d2ad06354787bc252058bb28015b56e">Init</a>(uint8_t parent, uint8_t port, <span class="keywordtype">bool</span> lowspeed);</div>
<div class="line"><a name="l00080"></a><span class="lineno"> 80</span>&#160; <span class="keyword">virtual</span> uint8_t <a class="code" href="class_x_b_o_x_u_s_b.html#a9a296b98b40f5a36d46297d98ef0f9b5">Release</a>();</div>
<div class="line"><a name="l00085"></a><span class="lineno"> 85</span>&#160; <span class="keyword">virtual</span> uint8_t <a class="code" href="class_x_b_o_x_u_s_b.html#a2f4684fe0785e50de434d95f4336fa12">Poll</a>();</div>
<div class="line"><a name="l00086"></a><span class="lineno"> 86</span>&#160;</div>
<div class="line"><a name="l00091"></a><span class="lineno"><a class="code" href="class_x_b_o_x_u_s_b.html#a42c870e64582980634423248d64500b4"> 91</a></span>&#160; <span class="keyword">virtual</span> uint8_t <a class="code" href="class_x_b_o_x_u_s_b.html#a42c870e64582980634423248d64500b4">GetAddress</a>() {</div>
<div class="line"><a name="l00092"></a><span class="lineno"> 92</span>&#160; <span class="keywordflow">return</span> <a class="code" href="class_x_b_o_x_u_s_b.html#a5e9c00af9f4b978c53819791b0a0eb65">bAddress</a>;</div>
<div class="line"><a name="l00093"></a><span class="lineno"> 93</span>&#160; };</div>
<div class="line"><a name="l00094"></a><span class="lineno"> 94</span>&#160;</div>
<div class="line"><a name="l00099"></a><span class="lineno"><a class="code" href="class_x_b_o_x_u_s_b.html#ac2507bfe85896b7fcc772894a7a9f272"> 99</a></span>&#160; <span class="keyword">virtual</span> <span class="keywordtype">bool</span> <a class="code" href="class_x_b_o_x_u_s_b.html#ac2507bfe85896b7fcc772894a7a9f272">isReady</a>() {</div>
<div class="line"><a name="l00100"></a><span class="lineno"> 100</span>&#160; <span class="keywordflow">return</span> bPollEnable;</div>
<div class="line"><a name="l00101"></a><span class="lineno"> 101</span>&#160; };</div>
<div class="line"><a name="l00116"></a><span class="lineno"> 116</span>&#160; uint8_t <a class="code" href="class_x_b_o_x_u_s_b.html#ae18ff481e9dd91658e5e45e7958e7775">getButtonPress</a>(<a class="code" href="controller_enums_8h.html#a03bfec859eac87be20f8952c1eb89de0">Button</a> b);</div>
<div class="line"><a name="l00117"></a><span class="lineno"> 117</span>&#160; <span class="keywordtype">bool</span> <a class="code" href="class_x_b_o_x_u_s_b.html#ab85b8ce772b122f1b9df489c7e045635">getButtonClick</a>(<a class="code" href="controller_enums_8h.html#a03bfec859eac87be20f8952c1eb89de0">Button</a> b);</div>
<div class="line"><a name="l00126"></a><span class="lineno"> 126</span>&#160; int16_t <a class="code" href="class_x_b_o_x_u_s_b.html#a7fcef8741de99d56f3a4d7fad9f954ff">getAnalogHat</a>(<a class="code" href="controller_enums_8h.html#aaaabdefc068fd57ec2bef2b62ea4ba92">AnalogHat</a> a);</div>
<div class="line"><a name="l00127"></a><span class="lineno"> 127</span>&#160;</div>
<div class="line"><a name="l00129"></a><span class="lineno"><a class="code" href="class_x_b_o_x_u_s_b.html#a6200dc185ecb6e0d3ffdb2a9ecf49c40"> 129</a></span>&#160; <span class="keywordtype">void</span> <a class="code" href="class_x_b_o_x_u_s_b.html#a6200dc185ecb6e0d3ffdb2a9ecf49c40">setAllOff</a>() {</div>
<div class="line"><a name="l00130"></a><span class="lineno"> 130</span>&#160; <a class="code" href="class_x_b_o_x_u_s_b.html#ae70ae50ed8188a2bf8c25d0ee17f54d9">setRumbleOn</a>(0, 0);</div>
<div class="line"><a name="l00131"></a><span class="lineno"> 131</span>&#160; <a class="code" href="class_x_b_o_x_u_s_b.html#a2cb9786f22e69ec3db26d9a55f95e22e">setLedRaw</a>(0);</div>
<div class="line"><a name="l00132"></a><span class="lineno"> 132</span>&#160; };</div>
<div class="line"><a name="l00133"></a><span class="lineno"> 133</span>&#160;</div>
<div class="line"><a name="l00135"></a><span class="lineno"><a class="code" href="class_x_b_o_x_u_s_b.html#a5d9ac92da5086409ad864484bdf95871"> 135</a></span>&#160; <span class="keywordtype">void</span> <a class="code" href="class_x_b_o_x_u_s_b.html#a5d9ac92da5086409ad864484bdf95871">setRumbleOff</a>() {</div>
<div class="line"><a name="l00136"></a><span class="lineno"> 136</span>&#160; <a class="code" href="class_x_b_o_x_u_s_b.html#ae70ae50ed8188a2bf8c25d0ee17f54d9">setRumbleOn</a>(0, 0);</div>
<div class="line"><a name="l00137"></a><span class="lineno"> 137</span>&#160; };</div>
<div class="line"><a name="l00143"></a><span class="lineno"> 143</span>&#160; <span class="keywordtype">void</span> <a class="code" href="class_x_b_o_x_u_s_b.html#ae70ae50ed8188a2bf8c25d0ee17f54d9">setRumbleOn</a>(uint8_t lValue, uint8_t rValue);</div>
<div class="line"><a name="l00150"></a><span class="lineno"> 150</span>&#160; <span class="keywordtype">void</span> <a class="code" href="class_x_b_o_x_u_s_b.html#a2cb9786f22e69ec3db26d9a55f95e22e">setLedRaw</a>(uint8_t value);</div>
<div class="line"><a name="l00151"></a><span class="lineno"> 151</span>&#160;</div>
<div class="line"><a name="l00153"></a><span class="lineno"><a class="code" href="class_x_b_o_x_u_s_b.html#a155637a4ef946f19c7ee40c0fc1c6b98"> 153</a></span>&#160; <span class="keywordtype">void</span> <a class="code" href="class_x_b_o_x_u_s_b.html#a155637a4ef946f19c7ee40c0fc1c6b98">setLedOff</a>() {</div>
<div class="line"><a name="l00154"></a><span class="lineno"> 154</span>&#160; <a class="code" href="class_x_b_o_x_u_s_b.html#a2cb9786f22e69ec3db26d9a55f95e22e">setLedRaw</a>(0);</div>
<div class="line"><a name="l00155"></a><span class="lineno"> 155</span>&#160; };</div>
<div class="line"><a name="l00160"></a><span class="lineno"> 160</span>&#160; <span class="keywordtype">void</span> <a class="code" href="class_x_b_o_x_u_s_b.html#a2348a35d4302f0a76bbeb319e84349a1">setLedOn</a>(<a class="code" href="controller_enums_8h.html#aadcb6002d2b42fdfe01490f730ab00a6">LED</a> l);</div>
<div class="line"><a name="l00165"></a><span class="lineno"> 165</span>&#160; <span class="keywordtype">void</span> <a class="code" href="class_x_b_o_x_u_s_b.html#acc52982e6105d029d1e0980367dc10f6">setLedBlink</a>(<a class="code" href="controller_enums_8h.html#aadcb6002d2b42fdfe01490f730ab00a6">LED</a> l);</div>
<div class="line"><a name="l00170"></a><span class="lineno"> 170</span>&#160; <span class="keywordtype">void</span> <a class="code" href="class_x_b_o_x_u_s_b.html#a7426adef803da704df7593858389926e">setLedMode</a>(<a class="code" href="xbox_enums_8h.html#a57effb96f46e458675a2653d4c543ca2">LEDMode</a> lm);</div>
<div class="line"><a name="l00174"></a><span class="lineno"><a class="code" href="class_x_b_o_x_u_s_b.html#a1c779ae5483a2f73426650242a37d868"> 174</a></span>&#160; <span class="keywordtype">bool</span> <a class="code" href="class_x_b_o_x_u_s_b.html#a1c779ae5483a2f73426650242a37d868">Xbox360Connected</a>;</div>
<div class="line"><a name="l00175"></a><span class="lineno"> 175</span>&#160;</div>
<div class="line"><a name="l00176"></a><span class="lineno"> 176</span>&#160;<span class="keyword">protected</span>:</div>
<div class="line"><a name="l00178"></a><span class="lineno"><a class="code" href="class_x_b_o_x_u_s_b.html#a9c701658d4f63b5407cbcd5b78d8eb18"> 178</a></span>&#160; <a class="code" href="class_u_s_b.html">USB</a> *<a class="code" href="class_x_b_o_x_u_s_b.html#a9c701658d4f63b5407cbcd5b78d8eb18">pUsb</a>;</div>
<div class="line"><a name="l00180"></a><span class="lineno"><a class="code" href="class_x_b_o_x_u_s_b.html#a5e9c00af9f4b978c53819791b0a0eb65"> 180</a></span>&#160; uint8_t <a class="code" href="class_x_b_o_x_u_s_b.html#a5e9c00af9f4b978c53819791b0a0eb65">bAddress</a>;</div>
<div class="line"><a name="l00182"></a><span class="lineno"><a class="code" href="class_x_b_o_x_u_s_b.html#abef4a852d877d8136f198431ce54550f"> 182</a></span>&#160; <a class="code" href="struct_ep_info.html">EpInfo</a> <a class="code" href="class_x_b_o_x_u_s_b.html#abef4a852d877d8136f198431ce54550f">epInfo</a>[<a class="code" href="_x_b_o_x_u_s_b_8h.html#af35f872fc33e690571eb99de648e8e96">XBOX_MAX_ENDPOINTS</a>];</div>
<div class="line"><a name="l00183"></a><span class="lineno"> 183</span>&#160;</div>
<div class="line"><a name="l00184"></a><span class="lineno"> 184</span>&#160;<span class="keyword">private</span>:</div>
<div class="line"><a name="l00185"></a><span class="lineno"> 185</span>&#160; <span class="keywordtype">bool</span> bPollEnable;</div>
<div class="line"><a name="l00186"></a><span class="lineno"> 186</span>&#160;</div>
<div class="line"><a name="l00187"></a><span class="lineno"> 187</span>&#160; <span class="comment">/* Variables to store the buttons */</span></div>
<div class="line"><a name="l00188"></a><span class="lineno"> 188</span>&#160; uint32_t ButtonState;</div>
<div class="line"><a name="l00189"></a><span class="lineno"> 189</span>&#160; uint32_t OldButtonState;</div>
<div class="line"><a name="l00190"></a><span class="lineno"> 190</span>&#160; uint16_t ButtonClickState;</div>
<div class="line"><a name="l00191"></a><span class="lineno"> 191</span>&#160; int16_t hatValue[4];</div>
<div class="line"><a name="l00192"></a><span class="lineno"> 192</span>&#160; uint16_t controllerStatus;</div>
<div class="line"><a name="l00193"></a><span class="lineno"> 193</span>&#160;</div>
<div class="line"><a name="l00194"></a><span class="lineno"> 194</span>&#160; <span class="keywordtype">bool</span> L2Clicked; <span class="comment">// These buttons are analog, so we use we use these bools to check if they where clicked or not</span></div>
<div class="line"><a name="l00195"></a><span class="lineno"> 195</span>&#160; <span class="keywordtype">bool</span> R2Clicked;</div>
<div class="line"><a name="l00196"></a><span class="lineno"> 196</span>&#160;</div>
<div class="line"><a name="l00197"></a><span class="lineno"> 197</span>&#160; uint8_t readBuf[<a class="code" href="_x_b_o_x_u_s_b_8h.html#abcb805b13bfd36145e252b0633bbcfc0">EP_MAXPKTSIZE</a>]; <span class="comment">// General purpose buffer for input data</span></div>
<div class="line"><a name="l00198"></a><span class="lineno"> 198</span>&#160; uint8_t writeBuf[<a class="code" href="_x_b_o_x_u_s_b_8h.html#abcb805b13bfd36145e252b0633bbcfc0">EP_MAXPKTSIZE</a>]; <span class="comment">// General purpose buffer for output data</span></div>
<div class="line"><a name="l00199"></a><span class="lineno"> 199</span>&#160;</div>
<div class="line"><a name="l00200"></a><span class="lineno"> 200</span>&#160; <span class="keywordtype">void</span> readReport(); <span class="comment">// read incoming data</span></div>
<div class="line"><a name="l00201"></a><span class="lineno"> 201</span>&#160; <span class="keywordtype">void</span> printReport(); <span class="comment">// print incoming date - Uncomment for debugging</span></div>
<div class="line"><a name="l00043"></a><span class="lineno"><a class="code" href="_x_b_o_x_u_s_b_8h.html#a2f5523a1aaa6718e1d11c6bc5b29a575"> 43</a></span>&#160;<span class="preprocessor"></span><span class="preprocessor">#define MADCATZ_VID 0x1BAD // For unofficial Mad Catz controllers</span></div>
<div class="line"><a name="l00044"></a><span class="lineno"><a class="code" href="_x_b_o_x_u_s_b_8h.html#ab029b2c21fb0c240022cc50f465d4580"> 44</a></span>&#160;<span class="preprocessor"></span><span class="preprocessor">#define JOYTECH_VID 0x162E // For unofficial Joytech controllers</span></div>
<div class="line"><a name="l00045"></a><span class="lineno"> 45</span>&#160;<span class="preprocessor"></span></div>
<div class="line"><a name="l00046"></a><span class="lineno"><a class="code" href="_x_b_o_x_u_s_b_8h.html#af2ec224ac142016119c418de89470f1f"> 46</a></span>&#160;<span class="preprocessor">#define XBOX_WIRED_PID 0x028E // Microsoft 360 Wired controller</span></div>
<div class="line"><a name="l00047"></a><span class="lineno"><a class="code" href="_x_b_o_x_u_s_b_8h.html#a10c2a7a8da78e76d7020c2c347f0a687"> 47</a></span>&#160;<span class="preprocessor"></span><span class="preprocessor">#define XBOX_WIRELESS_PID 0x028F // Wireless controller only support charging</span></div>
<div class="line"><a name="l00048"></a><span class="lineno"><a class="code" href="_x_b_o_x_u_s_b_8h.html#a1a97ce2829a30b96ea6640d387d245a9"> 48</a></span>&#160;<span class="preprocessor"></span><span class="preprocessor">#define XBOX_WIRELESS_RECEIVER_PID 0x0719 // Microsoft Wireless Gaming Receiver</span></div>
<div class="line"><a name="l00049"></a><span class="lineno"><a class="code" href="_x_b_o_x_u_s_b_8h.html#a6842663964e470b86786f046e4bc30d9"> 49</a></span>&#160;<span class="preprocessor"></span><span class="preprocessor">#define XBOX_WIRELESS_RECEIVER_THIRD_PARTY_PID 0x0291 // Third party Wireless Gaming Receiver</span></div>
<div class="line"><a name="l00050"></a><span class="lineno"> 50</span>&#160;<span class="preprocessor"></span></div>
<div class="line"><a name="l00051"></a><span class="lineno"><a class="code" href="_x_b_o_x_u_s_b_8h.html#aaa3e91675875fbf14a37369f9513874a"> 51</a></span>&#160;<span class="preprocessor">#define XBOX_REPORT_BUFFER_SIZE 14 // Size of the input report buffer</span></div>
<div class="line"><a name="l00052"></a><span class="lineno"> 52</span>&#160;<span class="preprocessor"></span></div>
<div class="line"><a name="l00053"></a><span class="lineno"> 53</span>&#160;<span class="comment">// Used in control endpoint header for HID Commands</span></div>
<div class="line"><a name="l00054"></a><span class="lineno"><a class="code" href="_x_b_o_x_u_s_b_8h.html#a5bd4ea095da29635414952894bd527f5"> 54</a></span>&#160;<span class="preprocessor">#define bmREQ_HID_OUT USB_SETUP_HOST_TO_DEVICE|USB_SETUP_TYPE_CLASS|USB_SETUP_RECIPIENT_INTERFACE</span></div>
<div class="line"><a name="l00055"></a><span class="lineno"><a class="code" href="_x_b_o_x_u_s_b_8h.html#aee05d40a014750b24a7e9967f6f389f4"> 55</a></span>&#160;<span class="preprocessor"></span><span class="preprocessor">#define HID_REQUEST_SET_REPORT 0x09</span></div>
<div class="line"><a name="l00056"></a><span class="lineno"> 56</span>&#160;<span class="preprocessor"></span></div>
<div class="line"><a name="l00057"></a><span class="lineno"><a class="code" href="_x_b_o_x_u_s_b_8h.html#af35f872fc33e690571eb99de648e8e96"> 57</a></span>&#160;<span class="preprocessor">#define XBOX_MAX_ENDPOINTS 3</span></div>
<div class="line"><a name="l00058"></a><span class="lineno"> 58</span>&#160;<span class="preprocessor"></span></div>
<div class="line"><a name="l00060"></a><span class="lineno"><a class="code" href="class_x_b_o_x_u_s_b.html"> 60</a></span>&#160;<span class="keyword">class </span><a class="code" href="class_x_b_o_x_u_s_b.html">XBOXUSB</a> : <span class="keyword">public</span> <a class="code" href="class_u_s_b_device_config.html">USBDeviceConfig</a> {</div>
<div class="line"><a name="l00061"></a><span class="lineno"> 61</span>&#160;<span class="keyword">public</span>:</div>
<div class="line"><a name="l00066"></a><span class="lineno"> 66</span>&#160; <a class="code" href="class_x_b_o_x_u_s_b.html#a4b676a33152112e6edfb14be125a78d2">XBOXUSB</a>(<a class="code" href="class_u_s_b.html">USB</a> *<a class="code" href="class_x_b_o_x_u_s_b.html#a9c701658d4f63b5407cbcd5b78d8eb18">pUsb</a>);</div>
<div class="line"><a name="l00067"></a><span class="lineno"> 67</span>&#160;</div>
<div class="line"><a name="l00076"></a><span class="lineno"> 76</span>&#160; <span class="keyword">virtual</span> uint8_t <a class="code" href="class_x_b_o_x_u_s_b.html#a9d2ad06354787bc252058bb28015b56e">Init</a>(uint8_t parent, uint8_t port, <span class="keywordtype">bool</span> lowspeed);</div>
<div class="line"><a name="l00081"></a><span class="lineno"> 81</span>&#160; <span class="keyword">virtual</span> uint8_t <a class="code" href="class_x_b_o_x_u_s_b.html#a9a296b98b40f5a36d46297d98ef0f9b5">Release</a>();</div>
<div class="line"><a name="l00086"></a><span class="lineno"> 86</span>&#160; <span class="keyword">virtual</span> uint8_t <a class="code" href="class_x_b_o_x_u_s_b.html#a2f4684fe0785e50de434d95f4336fa12">Poll</a>();</div>
<div class="line"><a name="l00087"></a><span class="lineno"> 87</span>&#160;</div>
<div class="line"><a name="l00092"></a><span class="lineno"><a class="code" href="class_x_b_o_x_u_s_b.html#a42c870e64582980634423248d64500b4"> 92</a></span>&#160; <span class="keyword">virtual</span> uint8_t <a class="code" href="class_x_b_o_x_u_s_b.html#a42c870e64582980634423248d64500b4">GetAddress</a>() {</div>
<div class="line"><a name="l00093"></a><span class="lineno"> 93</span>&#160; <span class="keywordflow">return</span> <a class="code" href="class_x_b_o_x_u_s_b.html#a5e9c00af9f4b978c53819791b0a0eb65">bAddress</a>;</div>
<div class="line"><a name="l00094"></a><span class="lineno"> 94</span>&#160; };</div>
<div class="line"><a name="l00095"></a><span class="lineno"> 95</span>&#160;</div>
<div class="line"><a name="l00100"></a><span class="lineno"><a class="code" href="class_x_b_o_x_u_s_b.html#ac2507bfe85896b7fcc772894a7a9f272"> 100</a></span>&#160; <span class="keyword">virtual</span> <span class="keywordtype">bool</span> <a class="code" href="class_x_b_o_x_u_s_b.html#ac2507bfe85896b7fcc772894a7a9f272">isReady</a>() {</div>
<div class="line"><a name="l00101"></a><span class="lineno"> 101</span>&#160; <span class="keywordflow">return</span> bPollEnable;</div>
<div class="line"><a name="l00102"></a><span class="lineno"> 102</span>&#160; };</div>
<div class="line"><a name="l00103"></a><span class="lineno"> 103</span>&#160;</div>
<div class="line"><a name="l00110"></a><span class="lineno"><a class="code" href="class_x_b_o_x_u_s_b.html#aa25ae7e9161bf1f4cc03a007738a292b"> 110</a></span>&#160; <span class="keyword">virtual</span> <span class="keywordtype">boolean</span> <a class="code" href="class_x_b_o_x_u_s_b.html#aa25ae7e9161bf1f4cc03a007738a292b">VIDPIDOK</a>(uint16_t vid, uint16_t pid) {</div>
<div class="line"><a name="l00111"></a><span class="lineno"> 111</span>&#160; <span class="keywordflow">return</span> ((vid == <a class="code" href="_x_b_o_x_u_s_b_8h.html#a8e7834e5604c4fb588cceab9258d0568">XBOX_VID</a> || vid == <a class="code" href="_x_b_o_x_u_s_b_8h.html#a2f5523a1aaa6718e1d11c6bc5b29a575">MADCATZ_VID</a> || vid == <a class="code" href="_x_b_o_x_u_s_b_8h.html#ab029b2c21fb0c240022cc50f465d4580">JOYTECH_VID</a>) &amp;&amp; pid == <a class="code" href="_x_b_o_x_u_s_b_8h.html#af2ec224ac142016119c418de89470f1f">XBOX_WIRED_PID</a>);</div>
<div class="line"><a name="l00112"></a><span class="lineno"> 112</span>&#160; };</div>
<div class="line"><a name="l00127"></a><span class="lineno"> 127</span>&#160; uint8_t <a class="code" href="class_x_b_o_x_u_s_b.html#ae18ff481e9dd91658e5e45e7958e7775">getButtonPress</a>(<a class="code" href="controller_enums_8h.html#a03bfec859eac87be20f8952c1eb89de0">Button</a> b);</div>
<div class="line"><a name="l00128"></a><span class="lineno"> 128</span>&#160; <span class="keywordtype">bool</span> <a class="code" href="class_x_b_o_x_u_s_b.html#ab85b8ce772b122f1b9df489c7e045635">getButtonClick</a>(<a class="code" href="controller_enums_8h.html#a03bfec859eac87be20f8952c1eb89de0">Button</a> b);</div>
<div class="line"><a name="l00137"></a><span class="lineno"> 137</span>&#160; int16_t <a class="code" href="class_x_b_o_x_u_s_b.html#a7fcef8741de99d56f3a4d7fad9f954ff">getAnalogHat</a>(<a class="code" href="controller_enums_8h.html#aaaabdefc068fd57ec2bef2b62ea4ba92">AnalogHat</a> a);</div>
<div class="line"><a name="l00138"></a><span class="lineno"> 138</span>&#160;</div>
<div class="line"><a name="l00140"></a><span class="lineno"><a class="code" href="class_x_b_o_x_u_s_b.html#a6200dc185ecb6e0d3ffdb2a9ecf49c40"> 140</a></span>&#160; <span class="keywordtype">void</span> <a class="code" href="class_x_b_o_x_u_s_b.html#a6200dc185ecb6e0d3ffdb2a9ecf49c40">setAllOff</a>() {</div>
<div class="line"><a name="l00141"></a><span class="lineno"> 141</span>&#160; <a class="code" href="class_x_b_o_x_u_s_b.html#ae70ae50ed8188a2bf8c25d0ee17f54d9">setRumbleOn</a>(0, 0);</div>
<div class="line"><a name="l00142"></a><span class="lineno"> 142</span>&#160; <a class="code" href="class_x_b_o_x_u_s_b.html#a2cb9786f22e69ec3db26d9a55f95e22e">setLedRaw</a>(0);</div>
<div class="line"><a name="l00143"></a><span class="lineno"> 143</span>&#160; };</div>
<div class="line"><a name="l00144"></a><span class="lineno"> 144</span>&#160;</div>
<div class="line"><a name="l00146"></a><span class="lineno"><a class="code" href="class_x_b_o_x_u_s_b.html#a5d9ac92da5086409ad864484bdf95871"> 146</a></span>&#160; <span class="keywordtype">void</span> <a class="code" href="class_x_b_o_x_u_s_b.html#a5d9ac92da5086409ad864484bdf95871">setRumbleOff</a>() {</div>
<div class="line"><a name="l00147"></a><span class="lineno"> 147</span>&#160; <a class="code" href="class_x_b_o_x_u_s_b.html#ae70ae50ed8188a2bf8c25d0ee17f54d9">setRumbleOn</a>(0, 0);</div>
<div class="line"><a name="l00148"></a><span class="lineno"> 148</span>&#160; };</div>
<div class="line"><a name="l00154"></a><span class="lineno"> 154</span>&#160; <span class="keywordtype">void</span> <a class="code" href="class_x_b_o_x_u_s_b.html#ae70ae50ed8188a2bf8c25d0ee17f54d9">setRumbleOn</a>(uint8_t lValue, uint8_t rValue);</div>
<div class="line"><a name="l00161"></a><span class="lineno"> 161</span>&#160; <span class="keywordtype">void</span> <a class="code" href="class_x_b_o_x_u_s_b.html#a2cb9786f22e69ec3db26d9a55f95e22e">setLedRaw</a>(uint8_t value);</div>
<div class="line"><a name="l00162"></a><span class="lineno"> 162</span>&#160;</div>
<div class="line"><a name="l00164"></a><span class="lineno"><a class="code" href="class_x_b_o_x_u_s_b.html#a155637a4ef946f19c7ee40c0fc1c6b98"> 164</a></span>&#160; <span class="keywordtype">void</span> <a class="code" href="class_x_b_o_x_u_s_b.html#a155637a4ef946f19c7ee40c0fc1c6b98">setLedOff</a>() {</div>
<div class="line"><a name="l00165"></a><span class="lineno"> 165</span>&#160; <a class="code" href="class_x_b_o_x_u_s_b.html#a2cb9786f22e69ec3db26d9a55f95e22e">setLedRaw</a>(0);</div>
<div class="line"><a name="l00166"></a><span class="lineno"> 166</span>&#160; };</div>
<div class="line"><a name="l00171"></a><span class="lineno"> 171</span>&#160; <span class="keywordtype">void</span> <a class="code" href="class_x_b_o_x_u_s_b.html#a2348a35d4302f0a76bbeb319e84349a1">setLedOn</a>(<a class="code" href="controller_enums_8h.html#aadcb6002d2b42fdfe01490f730ab00a6">LED</a> l);</div>
<div class="line"><a name="l00176"></a><span class="lineno"> 176</span>&#160; <span class="keywordtype">void</span> <a class="code" href="class_x_b_o_x_u_s_b.html#acc52982e6105d029d1e0980367dc10f6">setLedBlink</a>(<a class="code" href="controller_enums_8h.html#aadcb6002d2b42fdfe01490f730ab00a6">LED</a> l);</div>
<div class="line"><a name="l00181"></a><span class="lineno"> 181</span>&#160; <span class="keywordtype">void</span> <a class="code" href="class_x_b_o_x_u_s_b.html#a7426adef803da704df7593858389926e">setLedMode</a>(<a class="code" href="xbox_enums_8h.html#a57effb96f46e458675a2653d4c543ca2">LEDMode</a> lm);</div>
<div class="line"><a name="l00182"></a><span class="lineno"> 182</span>&#160;</div>
<div class="line"><a name="l00187"></a><span class="lineno"><a class="code" href="class_x_b_o_x_u_s_b.html#a887b65866f96b5b1e1413ba1e4f19941"> 187</a></span>&#160; <span class="keywordtype">void</span> <a class="code" href="class_x_b_o_x_u_s_b.html#a887b65866f96b5b1e1413ba1e4f19941">attachOnInit</a>(<span class="keywordtype">void</span> (*funcOnInit)(<span class="keywordtype">void</span>)) {</div>
<div class="line"><a name="l00188"></a><span class="lineno"> 188</span>&#160; pFuncOnInit = funcOnInit;</div>
<div class="line"><a name="l00189"></a><span class="lineno"><a class="code" href="class_x_b_o_x_u_s_b.html#a1c779ae5483a2f73426650242a37d868"> 189</a></span>&#160; };</div>
<div class="line"><a name="l00193"></a><span class="lineno"> 193</span>&#160; <span class="keywordtype">bool</span> <a class="code" href="class_x_b_o_x_u_s_b.html#a1c779ae5483a2f73426650242a37d868">Xbox360Connected</a>;</div>
<div class="line"><a name="l00194"></a><span class="lineno"> 194</span>&#160;</div>
<div class="line"><a name="l00195"></a><span class="lineno"> 195</span>&#160;<span class="keyword">protected</span>:</div>
<div class="line"><a name="l00197"></a><span class="lineno"><a class="code" href="class_x_b_o_x_u_s_b.html#a9c701658d4f63b5407cbcd5b78d8eb18"> 197</a></span>&#160; <a class="code" href="class_u_s_b.html">USB</a> *<a class="code" href="class_x_b_o_x_u_s_b.html#a9c701658d4f63b5407cbcd5b78d8eb18">pUsb</a>;</div>
<div class="line"><a name="l00199"></a><span class="lineno"><a class="code" href="class_x_b_o_x_u_s_b.html#a5e9c00af9f4b978c53819791b0a0eb65"> 199</a></span>&#160; uint8_t <a class="code" href="class_x_b_o_x_u_s_b.html#a5e9c00af9f4b978c53819791b0a0eb65">bAddress</a>;</div>
<div class="line"><a name="l00201"></a><span class="lineno"><a class="code" href="class_x_b_o_x_u_s_b.html#abef4a852d877d8136f198431ce54550f"> 201</a></span>&#160; <a class="code" href="struct_ep_info.html">EpInfo</a> <a class="code" href="class_x_b_o_x_u_s_b.html#abef4a852d877d8136f198431ce54550f">epInfo</a>[<a class="code" href="_x_b_o_x_u_s_b_8h.html#af35f872fc33e690571eb99de648e8e96">XBOX_MAX_ENDPOINTS</a>];</div>
<div class="line"><a name="l00202"></a><span class="lineno"> 202</span>&#160;</div>
<div class="line"><a name="l00203"></a><span class="lineno"> 203</span>&#160; <span class="comment">/* Private commands */</span></div>
<div class="line"><a name="l00204"></a><span class="lineno"> 204</span>&#160; <span class="keywordtype">void</span> XboxCommand(uint8_t* data, uint16_t nbytes);</div>
<div class="line"><a name="l00205"></a><span class="lineno"> 205</span>&#160;};</div>
<div class="line"><a name="l00206"></a><span class="lineno"> 206</span>&#160;<span class="preprocessor">#endif</span></div>
<div class="line"><a name="l00203"></a><span class="lineno"> 203</span>&#160;<span class="keyword">private</span>:</div>
<div class="line"><a name="l00209"></a><span class="lineno"> 209</span>&#160; <span class="keywordtype">void</span> onInit();</div>
<div class="line"><a name="l00210"></a><span class="lineno"> 210</span>&#160; void (*pFuncOnInit)(void); <span class="comment">// Pointer to function called in onInit()</span></div>
<div class="line"><a name="l00211"></a><span class="lineno"> 211</span>&#160;</div>
<div class="line"><a name="l00212"></a><span class="lineno"> 212</span>&#160; <span class="keywordtype">bool</span> bPollEnable;</div>
<div class="line"><a name="l00213"></a><span class="lineno"> 213</span>&#160;</div>
<div class="line"><a name="l00214"></a><span class="lineno"> 214</span>&#160; <span class="comment">/* Variables to store the buttons */</span></div>
<div class="line"><a name="l00215"></a><span class="lineno"> 215</span>&#160; uint32_t ButtonState;</div>
<div class="line"><a name="l00216"></a><span class="lineno"> 216</span>&#160; uint32_t OldButtonState;</div>
<div class="line"><a name="l00217"></a><span class="lineno"> 217</span>&#160; uint16_t ButtonClickState;</div>
<div class="line"><a name="l00218"></a><span class="lineno"> 218</span>&#160; int16_t hatValue[4];</div>
<div class="line"><a name="l00219"></a><span class="lineno"> 219</span>&#160; uint16_t controllerStatus;</div>
<div class="line"><a name="l00220"></a><span class="lineno"> 220</span>&#160;</div>
<div class="line"><a name="l00221"></a><span class="lineno"> 221</span>&#160; <span class="keywordtype">bool</span> L2Clicked; <span class="comment">// These buttons are analog, so we use we use these bools to check if they where clicked or not</span></div>
<div class="line"><a name="l00222"></a><span class="lineno"> 222</span>&#160; <span class="keywordtype">bool</span> R2Clicked;</div>
<div class="line"><a name="l00223"></a><span class="lineno"> 223</span>&#160;</div>
<div class="line"><a name="l00224"></a><span class="lineno"> 224</span>&#160; uint8_t readBuf[<a class="code" href="_x_b_o_x_u_s_b_8h.html#abcb805b13bfd36145e252b0633bbcfc0">EP_MAXPKTSIZE</a>]; <span class="comment">// General purpose buffer for input data</span></div>
<div class="line"><a name="l00225"></a><span class="lineno"> 225</span>&#160; uint8_t writeBuf[8]; <span class="comment">// General purpose buffer for output data</span></div>
<div class="line"><a name="l00226"></a><span class="lineno"> 226</span>&#160;</div>
<div class="line"><a name="l00227"></a><span class="lineno"> 227</span>&#160; <span class="keywordtype">void</span> readReport(); <span class="comment">// read incoming data</span></div>
<div class="line"><a name="l00228"></a><span class="lineno"> 228</span>&#160; <span class="keywordtype">void</span> printReport(); <span class="comment">// print incoming date - Uncomment for debugging</span></div>
<div class="line"><a name="l00229"></a><span class="lineno"> 229</span>&#160;</div>
<div class="line"><a name="l00230"></a><span class="lineno"> 230</span>&#160; <span class="comment">/* Private commands */</span></div>
<div class="line"><a name="l00231"></a><span class="lineno"> 231</span>&#160; <span class="keywordtype">void</span> XboxCommand(uint8_t* data, uint16_t nbytes);</div>
<div class="line"><a name="l00232"></a><span class="lineno"> 232</span>&#160;};</div>
<div class="line"><a name="l00233"></a><span class="lineno"> 233</span>&#160;<span class="preprocessor">#endif</span></div>
</div><!-- fragment --></div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>

View file

@ -108,7 +108,7 @@ This graph shows which files directly or indirectly include this file:</div>
<div class="dyncontent">
<div class="center"><img src="address_8h__dep__incl.png" border="0" usemap="#address_8hdep" alt=""/></div>
<map name="address_8hdep" id="address_8hdep">
<area shape="rect" id="node2" href="_usb_8h.html" title="Usb.h" alt="" coords="871,75,913,96"/><area shape="rect" id="node3" href="adk_8h.html" title="adk.h" alt="" coords="81,144,121,165"/><area shape="rect" id="node5" href="_b_t_d_8h.html" title="BTD.h" alt="" coords="217,144,263,165"/><area shape="rect" id="node13" href="cdcacm_8h.html" title="cdcacm.h" alt="" coords="464,144,520,165"/><area shape="rect" id="node17" href="cdcftdi_8h.html" title="cdcftdi.h" alt="" coords="629,144,680,165"/><area shape="rect" id="node15" href="cdcprolific_8h.html" title="cdcprolific.h" alt="" coords="460,213,524,235"/><area shape="rect" id="node19" href="hid_8h.html" title="hid.h" alt="" coords="812,144,852,165"/><area shape="rect" id="node21" href="hidboot_8h.html" title="hidboot.h" alt="" coords="633,213,687,235"/><area shape="rect" id="node23" href="hidescriptorparser_8h.html" title="hidescriptorparser.h" alt="" coords="880,213,973,235"/><area shape="rect" id="node27" href="masstorage_8h.html" title="masstorage.h" alt="" coords="930,144,1000,165"/><area shape="rect" id="node29" href="max___l_c_d_8h.html" title="max_LCD.h" alt="" coords="1025,144,1089,165"/><area shape="rect" id="node31" href="_p_s3_u_s_b_8h.html" title="PS3USB.h" alt="" coords="1114,144,1173,165"/><area shape="rect" id="node33" href="_usb_8cpp.html" title="Usb.cpp" alt="" coords="1198,144,1249,165"/><area shape="rect" id="node34" href="usbhub_8h.html" title="usbhub.h" alt="" coords="1279,144,1333,165"/><area shape="rect" id="node36" href="_x_b_o_x_r_e_c_v_8h.html" title="XBOXRECV.h" alt="" coords="1369,144,1441,165"/><area shape="rect" id="node38" href="_x_b_o_x_u_s_b_8h.html" title="XBOXUSB.h" alt="" coords="1487,144,1555,165"/><area shape="rect" id="node4" href="adk_8cpp.html" title="adk.cpp" alt="" coords="5,213,56,235"/><area shape="rect" id="node6" href="_b_t_d_8cpp.html" title="BTD.cpp" alt="" coords="213,213,267,235"/><area shape="rect" id="node7" href="_p_s3_b_t_8h.html" title="PS3BT.h" alt="" coords="291,213,345,235"/><area shape="rect" id="node9" href="_s_p_p_8h.html" title="SPP.h" alt="" coords="80,213,125,235"/><area shape="rect" id="node11" href="_wii_8h.html" title="Wii.h" alt="" coords="149,213,189,235"/><area shape="rect" id="node8" href="_p_s3_b_t_8cpp.html" title="PS3BT.cpp" alt="" coords="287,283,349,304"/><area shape="rect" id="node10" href="_s_p_p_8cpp.html" title="SPP.cpp" alt="" coords="72,283,125,304"/><area shape="rect" id="node12" href="_wii_8cpp.html" title="Wii.cpp" alt="" coords="149,283,197,304"/><area shape="rect" id="node14" href="cdcacm_8cpp.html" title="cdcacm.cpp" alt="" coords="370,213,435,235"/><area shape="rect" id="node16" href="cdcprolific_8cpp.html" title="cdcprolific.cpp" alt="" coords="455,283,528,304"/><area shape="rect" id="node18" href="cdcftdi_8cpp.html" title="cdcftdi.cpp" alt="" coords="549,213,608,235"/><area shape="rect" id="node20" href="hid_8cpp.html" title="hid.cpp" alt="" coords="808,213,856,235"/><area shape="rect" id="node25" href="hiduniversal_8h.html" title="hiduniversal.h" alt="" coords="712,213,784,235"/><area shape="rect" id="node22" href="hidboot_8cpp.html" title="hidboot.cpp" alt="" coords="624,283,688,304"/><area shape="rect" id="node24" href="hidescriptorparser_8cpp.html" title="hidescriptorparser.cpp" alt="" coords="876,283,977,304"/><area shape="rect" id="node26" href="hiduniversal_8cpp.html" title="hiduniversal.cpp" alt="" coords="712,283,792,304"/><area shape="rect" id="node28" href="masstorage_8cpp.html" title="masstorage.cpp" alt="" coords="998,213,1076,235"/><area shape="rect" id="node30" href="max___l_c_d_8cpp.html" title="max_LCD.cpp" alt="" coords="1101,213,1173,235"/><area shape="rect" id="node32" href="_p_s3_u_s_b_8cpp.html" title="PS3USB.cpp" alt="" coords="1199,213,1268,235"/><area shape="rect" id="node35" href="usbhub_8cpp.html" title="usbhub.cpp" alt="" coords="1292,213,1356,235"/><area shape="rect" id="node37" href="_x_b_o_x_r_e_c_v_8cpp.html" title="XBOXRECV.cpp" alt="" coords="1381,213,1461,235"/><area shape="rect" id="node39" href="_x_b_o_x_u_s_b_8cpp.html" title="XBOXUSB.cpp" alt="" coords="1486,213,1561,235"/></map>
<area shape="rect" id="node2" href="_usb_8h.html" title="Usb.h" alt="" coords="931,75,973,96"/><area shape="rect" id="node3" href="adk_8h.html" title="adk.h" alt="" coords="86,144,127,165"/><area shape="rect" id="node5" href="_b_t_d_8h.html" title="BTD.h" alt="" coords="227,144,272,165"/><area shape="rect" id="node13" href="cdcacm_8h.html" title="cdcacm.h" alt="" coords="465,144,521,165"/><area shape="rect" id="node17" href="cdcftdi_8h.html" title="cdcftdi.h" alt="" coords="625,144,676,165"/><area shape="rect" id="node15" href="cdcprolific_8h.html" title="cdcprolific.h" alt="" coords="461,213,525,235"/><area shape="rect" id="node19" href="hid_8h.html" title="hid.h" alt="" coords="801,144,841,165"/><area shape="rect" id="node21" href="hidboot_8h.html" title="hidboot.h" alt="" coords="634,213,688,235"/><area shape="rect" id="node23" href="hidescriptorparser_8h.html" title="hidescriptorparser.h" alt="" coords="881,213,975,235"/><area shape="rect" id="node27" href="masstorage_8h.html" title="masstorage.h" alt="" coords="954,144,1024,165"/><area shape="rect" id="node29" href="max___l_c_d_8h.html" title="max_LCD.h" alt="" coords="1049,144,1113,165"/><area shape="rect" id="node31" href="_p_s3_u_s_b_8h.html" title="PS3USB.h" alt="" coords="1138,144,1197,165"/><area shape="rect" id="node33" href="_usb_8cpp.html" title="Usb.cpp" alt="" coords="1222,144,1273,165"/><area shape="rect" id="node34" href="usbhub_8h.html" title="usbhub.h" alt="" coords="1298,144,1352,165"/><area shape="rect" id="node36" href="_x_b_o_x_o_l_d_8h.html" title="XBOXOLD.h" alt="" coords="1379,144,1447,165"/><area shape="rect" id="node38" href="_x_b_o_x_r_e_c_v_8h.html" title="XBOXRECV.h" alt="" coords="1478,144,1551,165"/><area shape="rect" id="node40" href="_x_b_o_x_u_s_b_8h.html" title="XBOXUSB.h" alt="" coords="1587,144,1655,165"/><area shape="rect" id="node4" href="adk_8cpp.html" title="adk.cpp" alt="" coords="5,213,56,235"/><area shape="rect" id="node6" href="_b_t_d_8cpp.html" title="BTD.cpp" alt="" coords="144,213,197,235"/><area shape="rect" id="node7" href="_p_s3_b_t_8h.html" title="PS3BT.h" alt="" coords="222,213,276,235"/><area shape="rect" id="node9" href="_s_p_p_8h.html" title="SPP.h" alt="" coords="301,213,347,235"/><area shape="rect" id="node11" href="_wii_8h.html" title="Wii.h" alt="" coords="80,213,120,235"/><area shape="rect" id="node8" href="_p_s3_b_t_8cpp.html" title="PS3BT.cpp" alt="" coords="214,283,276,304"/><area shape="rect" id="node10" href="_s_p_p_8cpp.html" title="SPP.cpp" alt="" coords="301,283,355,304"/><area shape="rect" id="node12" href="_wii_8cpp.html" title="Wii.cpp" alt="" coords="76,283,124,304"/><area shape="rect" id="node14" href="cdcacm_8cpp.html" title="cdcacm.cpp" alt="" coords="371,213,436,235"/><area shape="rect" id="node16" href="cdcprolific_8cpp.html" title="cdcprolific.cpp" alt="" coords="457,283,529,304"/><area shape="rect" id="node18" href="cdcftdi_8cpp.html" title="cdcftdi.cpp" alt="" coords="550,213,609,235"/><area shape="rect" id="node20" href="hid_8cpp.html" title="hid.cpp" alt="" coords="713,213,761,235"/><area shape="rect" id="node25" href="hiduniversal_8h.html" title="hiduniversal.h" alt="" coords="785,213,857,235"/><area shape="rect" id="node22" href="hidboot_8cpp.html" title="hidboot.cpp" alt="" coords="629,283,693,304"/><area shape="rect" id="node24" href="hidescriptorparser_8cpp.html" title="hidescriptorparser.cpp" alt="" coords="881,283,983,304"/><area shape="rect" id="node26" href="hiduniversal_8cpp.html" title="hiduniversal.cpp" alt="" coords="777,283,857,304"/><area shape="rect" id="node28" href="masstorage_8cpp.html" title="masstorage.cpp" alt="" coords="999,213,1077,235"/><area shape="rect" id="node30" href="max___l_c_d_8cpp.html" title="max_LCD.cpp" alt="" coords="1102,213,1175,235"/><area shape="rect" id="node32" href="_p_s3_u_s_b_8cpp.html" title="PS3USB.cpp" alt="" coords="1200,213,1269,235"/><area shape="rect" id="node35" href="usbhub_8cpp.html" title="usbhub.cpp" alt="" coords="1293,213,1357,235"/><area shape="rect" id="node37" href="_x_b_o_x_o_l_d_8cpp.html" title="XBOXOLD.cpp" alt="" coords="1382,213,1457,235"/><area shape="rect" id="node39" href="_x_b_o_x_r_e_c_v_8cpp.html" title="XBOXRECV.cpp" alt="" coords="1482,213,1563,235"/><area shape="rect" id="node41" href="_x_b_o_x_u_s_b_8cpp.html" title="XBOXUSB.cpp" alt="" coords="1587,213,1663,235"/></map>
</div>
</div>
<p><a href="address_8h_source.html">Go to the source code of this file.</a></p>

View file

@ -1,40 +1,42 @@
<map id="address.h" name="address.h">
<area shape="rect" id="node2" href="$_usb_8h.html" title="Usb.h" alt="" coords="871,75,913,96"/>
<area shape="rect" id="node3" href="$adk_8h.html" title="adk.h" alt="" coords="81,144,121,165"/>
<area shape="rect" id="node5" href="$_b_t_d_8h.html" title="BTD.h" alt="" coords="217,144,263,165"/>
<area shape="rect" id="node13" href="$cdcacm_8h.html" title="cdcacm.h" alt="" coords="464,144,520,165"/>
<area shape="rect" id="node17" href="$cdcftdi_8h.html" title="cdcftdi.h" alt="" coords="629,144,680,165"/>
<area shape="rect" id="node15" href="$cdcprolific_8h.html" title="cdcprolific.h" alt="" coords="460,213,524,235"/>
<area shape="rect" id="node19" href="$hid_8h.html" title="hid.h" alt="" coords="812,144,852,165"/>
<area shape="rect" id="node21" href="$hidboot_8h.html" title="hidboot.h" alt="" coords="633,213,687,235"/>
<area shape="rect" id="node23" href="$hidescriptorparser_8h.html" title="hidescriptorparser.h" alt="" coords="880,213,973,235"/>
<area shape="rect" id="node27" href="$masstorage_8h.html" title="masstorage.h" alt="" coords="930,144,1000,165"/>
<area shape="rect" id="node29" href="$max___l_c_d_8h.html" title="max_LCD.h" alt="" coords="1025,144,1089,165"/>
<area shape="rect" id="node31" href="$_p_s3_u_s_b_8h.html" title="PS3USB.h" alt="" coords="1114,144,1173,165"/>
<area shape="rect" id="node33" href="$_usb_8cpp.html" title="Usb.cpp" alt="" coords="1198,144,1249,165"/>
<area shape="rect" id="node34" href="$usbhub_8h.html" title="usbhub.h" alt="" coords="1279,144,1333,165"/>
<area shape="rect" id="node36" href="$_x_b_o_x_r_e_c_v_8h.html" title="XBOXRECV.h" alt="" coords="1369,144,1441,165"/>
<area shape="rect" id="node38" href="$_x_b_o_x_u_s_b_8h.html" title="XBOXUSB.h" alt="" coords="1487,144,1555,165"/>
<area shape="rect" id="node2" href="$_usb_8h.html" title="Usb.h" alt="" coords="931,75,973,96"/>
<area shape="rect" id="node3" href="$adk_8h.html" title="adk.h" alt="" coords="86,144,127,165"/>
<area shape="rect" id="node5" href="$_b_t_d_8h.html" title="BTD.h" alt="" coords="227,144,272,165"/>
<area shape="rect" id="node13" href="$cdcacm_8h.html" title="cdcacm.h" alt="" coords="465,144,521,165"/>
<area shape="rect" id="node17" href="$cdcftdi_8h.html" title="cdcftdi.h" alt="" coords="625,144,676,165"/>
<area shape="rect" id="node15" href="$cdcprolific_8h.html" title="cdcprolific.h" alt="" coords="461,213,525,235"/>
<area shape="rect" id="node19" href="$hid_8h.html" title="hid.h" alt="" coords="801,144,841,165"/>
<area shape="rect" id="node21" href="$hidboot_8h.html" title="hidboot.h" alt="" coords="634,213,688,235"/>
<area shape="rect" id="node23" href="$hidescriptorparser_8h.html" title="hidescriptorparser.h" alt="" coords="881,213,975,235"/>
<area shape="rect" id="node27" href="$masstorage_8h.html" title="masstorage.h" alt="" coords="954,144,1024,165"/>
<area shape="rect" id="node29" href="$max___l_c_d_8h.html" title="max_LCD.h" alt="" coords="1049,144,1113,165"/>
<area shape="rect" id="node31" href="$_p_s3_u_s_b_8h.html" title="PS3USB.h" alt="" coords="1138,144,1197,165"/>
<area shape="rect" id="node33" href="$_usb_8cpp.html" title="Usb.cpp" alt="" coords="1222,144,1273,165"/>
<area shape="rect" id="node34" href="$usbhub_8h.html" title="usbhub.h" alt="" coords="1298,144,1352,165"/>
<area shape="rect" id="node36" href="$_x_b_o_x_o_l_d_8h.html" title="XBOXOLD.h" alt="" coords="1379,144,1447,165"/>
<area shape="rect" id="node38" href="$_x_b_o_x_r_e_c_v_8h.html" title="XBOXRECV.h" alt="" coords="1478,144,1551,165"/>
<area shape="rect" id="node40" href="$_x_b_o_x_u_s_b_8h.html" title="XBOXUSB.h" alt="" coords="1587,144,1655,165"/>
<area shape="rect" id="node4" href="$adk_8cpp.html" title="adk.cpp" alt="" coords="5,213,56,235"/>
<area shape="rect" id="node6" href="$_b_t_d_8cpp.html" title="BTD.cpp" alt="" coords="213,213,267,235"/>
<area shape="rect" id="node7" href="$_p_s3_b_t_8h.html" title="PS3BT.h" alt="" coords="291,213,345,235"/>
<area shape="rect" id="node9" href="$_s_p_p_8h.html" title="SPP.h" alt="" coords="80,213,125,235"/>
<area shape="rect" id="node11" href="$_wii_8h.html" title="Wii.h" alt="" coords="149,213,189,235"/>
<area shape="rect" id="node8" href="$_p_s3_b_t_8cpp.html" title="PS3BT.cpp" alt="" coords="287,283,349,304"/>
<area shape="rect" id="node10" href="$_s_p_p_8cpp.html" title="SPP.cpp" alt="" coords="72,283,125,304"/>
<area shape="rect" id="node12" href="$_wii_8cpp.html" title="Wii.cpp" alt="" coords="149,283,197,304"/>
<area shape="rect" id="node14" href="$cdcacm_8cpp.html" title="cdcacm.cpp" alt="" coords="370,213,435,235"/>
<area shape="rect" id="node16" href="$cdcprolific_8cpp.html" title="cdcprolific.cpp" alt="" coords="455,283,528,304"/>
<area shape="rect" id="node18" href="$cdcftdi_8cpp.html" title="cdcftdi.cpp" alt="" coords="549,213,608,235"/>
<area shape="rect" id="node20" href="$hid_8cpp.html" title="hid.cpp" alt="" coords="808,213,856,235"/>
<area shape="rect" id="node25" href="$hiduniversal_8h.html" title="hiduniversal.h" alt="" coords="712,213,784,235"/>
<area shape="rect" id="node22" href="$hidboot_8cpp.html" title="hidboot.cpp" alt="" coords="624,283,688,304"/>
<area shape="rect" id="node24" href="$hidescriptorparser_8cpp.html" title="hidescriptorparser.cpp" alt="" coords="876,283,977,304"/>
<area shape="rect" id="node26" href="$hiduniversal_8cpp.html" title="hiduniversal.cpp" alt="" coords="712,283,792,304"/>
<area shape="rect" id="node28" href="$masstorage_8cpp.html" title="masstorage.cpp" alt="" coords="998,213,1076,235"/>
<area shape="rect" id="node30" href="$max___l_c_d_8cpp.html" title="max_LCD.cpp" alt="" coords="1101,213,1173,235"/>
<area shape="rect" id="node32" href="$_p_s3_u_s_b_8cpp.html" title="PS3USB.cpp" alt="" coords="1199,213,1268,235"/>
<area shape="rect" id="node35" href="$usbhub_8cpp.html" title="usbhub.cpp" alt="" coords="1292,213,1356,235"/>
<area shape="rect" id="node37" href="$_x_b_o_x_r_e_c_v_8cpp.html" title="XBOXRECV.cpp" alt="" coords="1381,213,1461,235"/>
<area shape="rect" id="node39" href="$_x_b_o_x_u_s_b_8cpp.html" title="XBOXUSB.cpp" alt="" coords="1486,213,1561,235"/>
<area shape="rect" id="node6" href="$_b_t_d_8cpp.html" title="BTD.cpp" alt="" coords="144,213,197,235"/>
<area shape="rect" id="node7" href="$_p_s3_b_t_8h.html" title="PS3BT.h" alt="" coords="222,213,276,235"/>
<area shape="rect" id="node9" href="$_s_p_p_8h.html" title="SPP.h" alt="" coords="301,213,347,235"/>
<area shape="rect" id="node11" href="$_wii_8h.html" title="Wii.h" alt="" coords="80,213,120,235"/>
<area shape="rect" id="node8" href="$_p_s3_b_t_8cpp.html" title="PS3BT.cpp" alt="" coords="214,283,276,304"/>
<area shape="rect" id="node10" href="$_s_p_p_8cpp.html" title="SPP.cpp" alt="" coords="301,283,355,304"/>
<area shape="rect" id="node12" href="$_wii_8cpp.html" title="Wii.cpp" alt="" coords="76,283,124,304"/>
<area shape="rect" id="node14" href="$cdcacm_8cpp.html" title="cdcacm.cpp" alt="" coords="371,213,436,235"/>
<area shape="rect" id="node16" href="$cdcprolific_8cpp.html" title="cdcprolific.cpp" alt="" coords="457,283,529,304"/>
<area shape="rect" id="node18" href="$cdcftdi_8cpp.html" title="cdcftdi.cpp" alt="" coords="550,213,609,235"/>
<area shape="rect" id="node20" href="$hid_8cpp.html" title="hid.cpp" alt="" coords="713,213,761,235"/>
<area shape="rect" id="node25" href="$hiduniversal_8h.html" title="hiduniversal.h" alt="" coords="785,213,857,235"/>
<area shape="rect" id="node22" href="$hidboot_8cpp.html" title="hidboot.cpp" alt="" coords="629,283,693,304"/>
<area shape="rect" id="node24" href="$hidescriptorparser_8cpp.html" title="hidescriptorparser.cpp" alt="" coords="881,283,983,304"/>
<area shape="rect" id="node26" href="$hiduniversal_8cpp.html" title="hiduniversal.cpp" alt="" coords="777,283,857,304"/>
<area shape="rect" id="node28" href="$masstorage_8cpp.html" title="masstorage.cpp" alt="" coords="999,213,1077,235"/>
<area shape="rect" id="node30" href="$max___l_c_d_8cpp.html" title="max_LCD.cpp" alt="" coords="1102,213,1175,235"/>
<area shape="rect" id="node32" href="$_p_s3_u_s_b_8cpp.html" title="PS3USB.cpp" alt="" coords="1200,213,1269,235"/>
<area shape="rect" id="node35" href="$usbhub_8cpp.html" title="usbhub.cpp" alt="" coords="1293,213,1357,235"/>
<area shape="rect" id="node37" href="$_x_b_o_x_o_l_d_8cpp.html" title="XBOXOLD.cpp" alt="" coords="1382,213,1457,235"/>
<area shape="rect" id="node39" href="$_x_b_o_x_r_e_c_v_8cpp.html" title="XBOXRECV.cpp" alt="" coords="1482,213,1563,235"/>
<area shape="rect" id="node41" href="$_x_b_o_x_u_s_b_8cpp.html" title="XBOXUSB.cpp" alt="" coords="1587,213,1663,235"/>
</map>

View file

@ -1 +1 @@
f5c550b54537896a01440e4a9c721ac3
889fc9094aae1635944bb44c68f034b6

Binary file not shown.

Before

Width:  |  Height:  |  Size: 59 KiB

After

Width:  |  Height:  |  Size: 60 KiB

View file

@ -95,7 +95,7 @@ Include dependency graph for adk.cpp:</div>
<div class="dyncontent">
<div class="center"><img src="adk_8cpp__incl.png" border="0" usemap="#adk_8cpp" alt=""/></div>
<map name="adk_8cpp" id="adk_8cpp">
<area shape="rect" id="node2" href="adk_8h.html" title="adk.h" alt="" coords="553,75,593,96"/><area shape="rect" id="node5" href="avrpins_8h.html" title="avrpins.h" alt="" coords="126,283,180,304"/><area shape="rect" id="node7" href="max3421e_8h.html" title="max3421e.h" alt="" coords="280,283,347,304"/><area shape="rect" id="node8" href="usbhost_8h.html" title="usbhost.h" alt="" coords="195,213,252,235"/><area shape="rect" id="node9" href="usb__ch9_8h.html" title="usb_ch9.h" alt="" coords="556,283,615,304"/><area shape="rect" id="node11" href="_usb_8h.html" title="Usb.h" alt="" coords="476,144,519,165"/><area shape="rect" id="node17" href="printhex_8h.html" title="printhex.h" alt="" coords="1091,421,1148,443"/><area shape="rect" id="node18" href="hexdump_8h.html" title="hexdump.h" alt="" coords="1044,352,1105,373"/><area shape="rect" id="node16" href="message_8h.html" title="message.h" alt="" coords="976,283,1037,304"/><area shape="rect" id="node19" href="confdescparser_8h.html" title="confdescparser.h" alt="" coords="781,144,864,165"/><area shape="rect" id="node13" href="address_8h.html" title="address.h" alt="" coords="430,213,487,235"/><area shape="rect" id="node20" href="parsetools_8h.html" title="parsetools.h" alt="" coords="790,213,855,235"/></map>
<area shape="rect" id="node2" href="adk_8h.html" title="adk.h" alt="" coords="655,75,696,96"/><area shape="rect" id="node5" href="avrpins_8h.html" title="avrpins.h" alt="" coords="74,352,128,373"/><area shape="rect" id="node7" href="max3421e_8h.html" title="max3421e.h" alt="" coords="284,352,351,373"/><area shape="rect" id="node8" href="usbhost_8h.html" title="usbhost.h" alt="" coords="145,283,201,304"/><area shape="rect" id="node10" href="usb__ch9_8h.html" title="usb_ch9.h" alt="" coords="605,352,664,373"/><area shape="rect" id="node12" href="_usb_8h.html" title="Usb.h" alt="" coords="444,213,487,235"/><area shape="rect" id="node17" href="printhex_8h.html" title="printhex.h" alt="" coords="1062,421,1119,443"/><area shape="rect" id="node18" href="hexdump_8h.html" title="hexdump.h" alt="" coords="891,352,952,373"/><area shape="rect" id="node16" href="message_8h.html" title="message.h" alt="" coords="891,283,952,304"/><area shape="rect" id="node19" href="confdescparser_8h.html" title="confdescparser.h" alt="" coords="942,144,1025,165"/><area shape="rect" id="node14" href="address_8h.html" title="address.h" alt="" coords="403,283,460,304"/><area shape="rect" id="node20" href="parsetools_8h.html" title="parsetools.h" alt="" coords="993,213,1057,235"/></map>
</div>
</div>
<p><a href="adk_8cpp_source.html">Go to the source code of this file.</a></p>

Some files were not shown because too many files have changed in this diff Show more