USB_Host_Shield_2.0/class_p_s4_parser.html

609 lines
33 KiB
HTML
Raw Normal View History

2014-01-19 17:17:06 +01:00
<!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.6"/>
<title>USB Host Shield 2.0: PS4Parser Class 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.6 -->
<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 class="current"><a href="annotated.html"><span>Classes</span></a></li>
<li><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="annotated.html"><span>Class&#160;List</span></a></li>
<li><a href="classes.html"><span>Class&#160;Index</span></a></li>
<li><a href="inherits.html"><span>Class&#160;Hierarchy</span></a></li>
<li><a href="functions.html"><span>Class&#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><!-- top -->
<div class="header">
<div class="summary">
<a href="#pub-methods">Public Member Functions</a> &#124;
<a href="#pro-methods">Protected Member Functions</a> &#124;
<a href="class_p_s4_parser-members.html">List of all members</a> </div>
<div class="headertitle">
<div class="title">PS4Parser Class Reference</div> </div>
</div><!--header-->
<div class="contents">
<p><code>#include &lt;<a class="el" href="_p_s4_parser_8h_source.html">PS4Parser.h</a>&gt;</code></p>
<div class="dynheader">
Inheritance diagram for PS4Parser:</div>
<div class="dyncontent">
<div class="center"><img src="class_p_s4_parser__inherit__graph.png" border="0" usemap="#_p_s4_parser_inherit__map" alt="Inheritance graph"/></div>
<map name="_p_s4_parser_inherit__map" id="_p_s4_parser_inherit__map">
<area shape="rect" id="node2" href="class_p_s4_b_t.html" title="PS4BT" alt="" coords="4,83,67,111"/><area shape="rect" id="node3" href="class_p_s4_u_s_b.html" title="PS4USB" alt="" coords="92,83,165,111"/></map>
<center><span class="legend">[<a href="graph_legend.html">legend</a>]</span></center></div>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-methods"></a>
Public Member Functions</h2></td></tr>
<tr class="memitem:a3ef06f8737f1088dbdbbc351b576c1cf"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_p_s4_parser.html#a3ef06f8737f1088dbdbbc351b576c1cf">PS4Parser</a> ()</td></tr>
<tr class="separator:a3ef06f8737f1088dbdbbc351b576c1cf"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr><td colspan="2"><div class="groupHeader">PS4 Controller functions</div></td></tr>
<tr class="memitem:ad352f30e4ab772246574bbf654248906"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_p_s4_parser.html#ad352f30e4ab772246574bbf654248906">getButtonPress</a> (<a class="el" href="controller_enums_8h.html#a94f7389d205c78830a5441370d7870fd">ButtonEnum</a> b)</td></tr>
<tr class="separator:ad352f30e4ab772246574bbf654248906"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a92a4ea3d328426b9f86be05cabaad91c"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_p_s4_parser.html#a92a4ea3d328426b9f86be05cabaad91c">getButtonClick</a> (<a class="el" href="controller_enums_8h.html#a94f7389d205c78830a5441370d7870fd">ButtonEnum</a> b)</td></tr>
<tr class="separator:a92a4ea3d328426b9f86be05cabaad91c"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a66151c4e4601f80492cd5b2451a2f87a"><td class="memItemLeft" align="right" valign="top">uint8_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_p_s4_parser.html#a66151c4e4601f80492cd5b2451a2f87a">getAnalogButton</a> (<a class="el" href="controller_enums_8h.html#a94f7389d205c78830a5441370d7870fd">ButtonEnum</a> b)</td></tr>
<tr class="separator:a66151c4e4601f80492cd5b2451a2f87a"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a9b11c5b27f9c9501fdb4f616cb3b194c"><td class="memItemLeft" align="right" valign="top">uint8_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_p_s4_parser.html#a9b11c5b27f9c9501fdb4f616cb3b194c">getAnalogHat</a> (<a class="el" href="controller_enums_8h.html#a34dad8f0a0927471137c403216597093">AnalogHatEnum</a> a)</td></tr>
<tr class="separator:a9b11c5b27f9c9501fdb4f616cb3b194c"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr><td colspan="2"><div class="groupHeader">Only available via USB at the moment</div></td></tr>
<tr class="memitem:aa149326d97c6231087f81d954a994493"><td class="memItemLeft" align="right" valign="top">uint16_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_p_s4_parser.html#aa149326d97c6231087f81d954a994493">getX</a> (uint8_t finger=0, uint8_t xyId=0)</td></tr>
<tr class="separator:aa149326d97c6231087f81d954a994493"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a9972eeb87f2ed4a96dcdccf2dabbbc5a"><td class="memItemLeft" align="right" valign="top">uint16_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_p_s4_parser.html#a9972eeb87f2ed4a96dcdccf2dabbbc5a">getY</a> (uint8_t finger=0, uint8_t xyId=0)</td></tr>
<tr class="separator:a9972eeb87f2ed4a96dcdccf2dabbbc5a"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a6770a72c17062c2e00fb3602435fcade"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_p_s4_parser.html#a6770a72c17062c2e00fb3602435fcade">isTouching</a> (uint8_t finger=0, uint8_t xyId=0)</td></tr>
<tr class="separator:a6770a72c17062c2e00fb3602435fcade"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a0b3de008ae8aaa057c571081b1b64e88"><td class="memItemLeft" align="right" valign="top">uint8_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_p_s4_parser.html#a0b3de008ae8aaa057c571081b1b64e88">getTouchCounter</a> (uint8_t finger=0, uint8_t xyId=0)</td></tr>
<tr class="separator:a0b3de008ae8aaa057c571081b1b64e88"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ac4b7e6c29af23a88d41a83e82c87c888"><td class="memItemLeft" align="right" valign="top">double&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_p_s4_parser.html#ac4b7e6c29af23a88d41a83e82c87c888">getAngle</a> (<a class="el" href="controller_enums_8h.html#a7c7824a10a9ffa8fea85602fcf4d84e6">AngleEnum</a> a)</td></tr>
<tr class="separator:ac4b7e6c29af23a88d41a83e82c87c888"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a2b06200adee0c8ed616c4d18c23a584a"><td class="memItemLeft" align="right" valign="top">int16_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_p_s4_parser.html#a2b06200adee0c8ed616c4d18c23a584a">getSensor</a> (<a class="el" href="controller_enums_8h.html#a00d5030559c481763282483889597d51">SensorEnum</a> s)</td></tr>
<tr class="separator:a2b06200adee0c8ed616c4d18c23a584a"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pro-methods"></a>
Protected Member Functions</h2></td></tr>
<tr class="memitem:a6498fdeb767364e84ce09ef208980622"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_p_s4_parser.html#a6498fdeb767364e84ce09ef208980622">Parse</a> (uint8_t len, uint8_t *buf)</td></tr>
<tr class="separator:a6498fdeb767364e84ce09ef208980622"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a24640b2362b0f6f51785fbd3dd4f13f9"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_p_s4_parser.html#a24640b2362b0f6f51785fbd3dd4f13f9">Reset</a> ()</td></tr>
<tr class="separator:a24640b2362b0f6f51785fbd3dd4f13f9"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<div class="textblock"><p>This class parses all the data sent by the PS4 controller </p>
<p>Definition at line <a class="el" href="_p_s4_parser_8h_source.html#l00125">125</a> of file <a class="el" href="_p_s4_parser_8h_source.html">PS4Parser.h</a>.</p>
</div><h2 class="groupheader">Constructor &amp; Destructor Documentation</h2>
<a class="anchor" id="a3ef06f8737f1088dbdbbc351b576c1cf"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">PS4Parser::PS4Parser </td>
<td>(</td>
<td class="paramname"></td><td>)</td>
<td></td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>Constructor for the <a class="el" href="class_p_s4_parser.html">PS4Parser</a> class. </p>
<p>Definition at line <a class="el" href="_p_s4_parser_8h_source.html#l00128">128</a> of file <a class="el" href="_p_s4_parser_8h_source.html">PS4Parser.h</a>.</p>
</div>
</div>
<h2 class="groupheader">Member Function Documentation</h2>
<a class="anchor" id="ad352f30e4ab772246574bbf654248906"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">bool PS4Parser::getButtonPress </td>
<td>(</td>
<td class="paramtype"><a class="el" href="controller_enums_8h.html#a94f7389d205c78830a5441370d7870fd">ButtonEnum</a>&#160;</td>
<td class="paramname"><em>b</em></td><td>)</td>
<td></td>
</tr>
</table>
</div><div class="memdoc">
<p><a class="el" href="class_p_s4_parser.html#ad352f30e4ab772246574bbf654248906">getButtonPress(ButtonEnum b)</a> will return true as long as the button is held down.</p>
<p>While <a class="el" href="class_p_s4_parser.html#a92a4ea3d328426b9f86be05cabaad91c">getButtonClick(ButtonEnum b)</a> will only return it once.</p>
<p>So you instance if you need to increase a variable once you would use <a class="el" href="class_p_s4_parser.html#a92a4ea3d328426b9f86be05cabaad91c">getButtonClick(ButtonEnum b)</a>, but if you need to drive a robot forward you would use <a class="el" href="class_p_s4_parser.html#ad352f30e4ab772246574bbf654248906">getButtonPress(ButtonEnum b)</a>. </p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">b</td><td><a class="el" href="controller_enums_8h.html#a94f7389d205c78830a5441370d7870fd">ButtonEnum</a> to read. </td></tr>
</table>
</dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd><a class="el" href="class_p_s4_parser.html#ad352f30e4ab772246574bbf654248906">getButtonPress(ButtonEnum b)</a> will return a true as long as a button is held down, while <a class="el" href="class_p_s4_parser.html#a92a4ea3d328426b9f86be05cabaad91c">getButtonClick(ButtonEnum b)</a> will return true once for each button press. </dd></dl>
<p>Definition at line <a class="el" href="_p_s4_parser_8cpp_source.html#l00038">38</a> of file <a class="el" href="_p_s4_parser_8cpp_source.html">PS4Parser.cpp</a>.</p>
</div>
</div>
<a class="anchor" id="a92a4ea3d328426b9f86be05cabaad91c"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">bool PS4Parser::getButtonClick </td>
<td>(</td>
<td class="paramtype"><a class="el" href="controller_enums_8h.html#a94f7389d205c78830a5441370d7870fd">ButtonEnum</a>&#160;</td>
<td class="paramname"><em>b</em></td><td>)</td>
<td></td>
</tr>
</table>
</div><div class="memdoc">
<p><a class="el" href="class_p_s4_parser.html#ad352f30e4ab772246574bbf654248906">getButtonPress(ButtonEnum b)</a> will return true as long as the button is held down.</p>
<p>While <a class="el" href="class_p_s4_parser.html#a92a4ea3d328426b9f86be05cabaad91c">getButtonClick(ButtonEnum b)</a> will only return it once.</p>
<p>So you instance if you need to increase a variable once you would use <a class="el" href="class_p_s4_parser.html#a92a4ea3d328426b9f86be05cabaad91c">getButtonClick(ButtonEnum b)</a>, but if you need to drive a robot forward you would use <a class="el" href="class_p_s4_parser.html#ad352f30e4ab772246574bbf654248906">getButtonPress(ButtonEnum b)</a>. </p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">b</td><td><a class="el" href="controller_enums_8h.html#a94f7389d205c78830a5441370d7870fd">ButtonEnum</a> to read. </td></tr>
</table>
</dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd><a class="el" href="class_p_s4_parser.html#ad352f30e4ab772246574bbf654248906">getButtonPress(ButtonEnum b)</a> will return a true as long as a button is held down, while <a class="el" href="class_p_s4_parser.html#a92a4ea3d328426b9f86be05cabaad91c">getButtonClick(ButtonEnum b)</a> will return true once for each button press. </dd></dl>
<p>Definition at line <a class="el" href="_p_s4_parser_8cpp_source.html#l00049">49</a> of file <a class="el" href="_p_s4_parser_8cpp_source.html">PS4Parser.cpp</a>.</p>
</div>
</div>
<a class="anchor" id="a66151c4e4601f80492cd5b2451a2f87a"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">uint8_t PS4Parser::getAnalogButton </td>
<td>(</td>
<td class="paramtype"><a class="el" href="controller_enums_8h.html#a94f7389d205c78830a5441370d7870fd">ButtonEnum</a>&#160;</td>
<td class="paramname"><em>b</em></td><td>)</td>
<td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Used to get the analog value from button presses. </p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">b</td><td>The <a class="el" href="controller_enums_8h.html#a94f7389d205c78830a5441370d7870fd">ButtonEnum</a> to read. The supported buttons are: <a class="el" href="controller_enums_8h.html#a94f7389d205c78830a5441370d7870fdaba595d8bca8bc5e67c37c0a9d89becfa">UP</a>, <a class="el" href="controller_enums_8h.html#a94f7389d205c78830a5441370d7870fdaec8379af7490bb9eaaf579cf17876f38">RIGHT</a>, <a class="el" href="controller_enums_8h.html#a94f7389d205c78830a5441370d7870fda9b0b4a95b99523966e0e34ffdadac9da">DOWN</a>, <a class="el" href="controller_enums_8h.html#a94f7389d205c78830a5441370d7870fdadb45120aafd37a973140edee24708065">LEFT</a>, <a class="el" href="controller_enums_8h.html#a94f7389d205c78830a5441370d7870fdae5bc7ee7d6dda5340a28f91834f10543">L1</a>, <a class="el" href="controller_enums_8h.html#a94f7389d205c78830a5441370d7870fda0adffb24dae0c41be5b803f4d444f066">L2</a>, <a class="el" href="controller_enums_8h.html#a94f7389d205c78830a5441370d7870fdaf8d87ff07efe24755164f550526f4dac">R1</a>, <a class="el" href="controller_enums_8h.html#a94f7389d205c78830a5441370d7870fda629d7b403cea5f826352f3aefb9a6d6a">R2</a>, <a class="el" href="controller_enums_8h.html#a94f7389d205c78830a5441370d7870fda2fd33892864d1c342d3bead2f2d9ad56">TRIANGLE</a>, <a class="el" href="controller_enums_8h.html#a94f7389d205c78830a5441370d7870fdaa79c827759ea48f0735386c4b1188911">CIRCLE</a>, <a class="el" href="controller_enums_8h.html#a94f7389d205c78830a5441370d7870fdad699bdf1731bd839b56c299536ba1d9d">CROSS</a>, <a class="el" href="controller_enums_8h.html#a94f7389d205c78830a5441370d7870fda4233fbf0cafb86abcee94b38d769fc59">SQUARE</a>, and <a class="el" href="controller_enums_8h.html#a94f7389d205c78830a5441370d7870fda21f40778b7db9343a6ca75ec2c41ccce">T</a>. </td></tr>
</table>
</dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>Analog value in the range of 0-255. </dd></dl>
<p>Definition at line <a class="el" href="_p_s4_parser_8cpp_source.html#l00064">64</a> of file <a class="el" href="_p_s4_parser_8cpp_source.html">PS4Parser.cpp</a>.</p>
</div>
</div>
<a class="anchor" id="a9b11c5b27f9c9501fdb4f616cb3b194c"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">uint8_t PS4Parser::getAnalogHat </td>
<td>(</td>
<td class="paramtype"><a class="el" href="controller_enums_8h.html#a34dad8f0a0927471137c403216597093">AnalogHatEnum</a>&#160;</td>
<td class="paramname"><em>a</em></td><td>)</td>
<td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Used to read the analog joystick. </p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">a</td><td><a class="el" href="controller_enums_8h.html#a34dad8f0a0927471137c403216597093a383cb8895dd296b7f69ce845ed16b0ca">LeftHatX</a>, <a class="el" href="controller_enums_8h.html#a34dad8f0a0927471137c403216597093af3f3925efa9762c4e9e71ac7da7a94a3">LeftHatY</a>, <a class="el" href="controller_enums_8h.html#a34dad8f0a0927471137c403216597093aaeb027a0ae5bbc6ba25e1c78a6486c7b">RightHatX</a>, and <a class="el" href="controller_enums_8h.html#a34dad8f0a0927471137c403216597093a7f1fb2db5381286691f4dec179ed5d5a">RightHatY</a>. </td></tr>
</table>
</dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>Return the analog value in the range of 0-255. </dd></dl>
<p>Definition at line <a class="el" href="_p_s4_parser_8cpp_source.html#l00072">72</a> of file <a class="el" href="_p_s4_parser_8cpp_source.html">PS4Parser.cpp</a>.</p>
</div>
</div>
<a class="anchor" id="aa149326d97c6231087f81d954a994493"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">uint16_t PS4Parser::getX </td>
<td>(</td>
<td class="paramtype">uint8_t&#160;</td>
<td class="paramname"><em>finger</em> = <code>0</code>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">uint8_t&#160;</td>
<td class="paramname"><em>xyId</em> = <code>0</code>&#160;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>Get the x-coordinate of the touchpad. Position 0 is in the top left. </p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">finger</td><td>0 = first finger, 1 = second finger. If omitted, then 0 will be used. </td></tr>
<tr><td class="paramname">xyId</td><td>The controller sends out three packets with the same structure. The third one will contain the last measure, but if you read from the controller then there is only be data in the first one. For that reason it will be set to 0 if the argument is omitted. </td></tr>
</table>
</dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>Returns the x-coordinate of the finger. </dd></dl>
<p>Definition at line <a class="el" href="_p_s4_parser_8h_source.html#l00174">174</a> of file <a class="el" href="_p_s4_parser_8h_source.html">PS4Parser.h</a>.</p>
</div>
</div>
<a class="anchor" id="a9972eeb87f2ed4a96dcdccf2dabbbc5a"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">uint16_t PS4Parser::getY </td>
<td>(</td>
<td class="paramtype">uint8_t&#160;</td>
<td class="paramname"><em>finger</em> = <code>0</code>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">uint8_t&#160;</td>
<td class="paramname"><em>xyId</em> = <code>0</code>&#160;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>Get the y-coordinate of the touchpad. Position 0 is in the top left. </p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">finger</td><td>0 = first finger, 1 = second finger. If omitted, then 0 will be used. </td></tr>
<tr><td class="paramname">xyId</td><td>The controller sends out three packets with the same structure. The third one will contain the last measure, but if you read from the controller then there is only be data in the first one. For that reason it will be set to 0 if the argument is omitted. </td></tr>
</table>
</dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>Returns the y-coordinate of the finger. </dd></dl>
<p>Definition at line <a class="el" href="_p_s4_parser_8h_source.html#l00186">186</a> of file <a class="el" href="_p_s4_parser_8h_source.html">PS4Parser.h</a>.</p>
</div>
</div>
<a class="anchor" id="a6770a72c17062c2e00fb3602435fcade"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">bool PS4Parser::isTouching </td>
<td>(</td>
<td class="paramtype">uint8_t&#160;</td>
<td class="paramname"><em>finger</em> = <code>0</code>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">uint8_t&#160;</td>
<td class="paramname"><em>xyId</em> = <code>0</code>&#160;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>Returns whenever the user is toucing the touchpad. </p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">finger</td><td>0 = first finger, 1 = second finger. If omitted, then 0 will be used. </td></tr>
<tr><td class="paramname">xyId</td><td>The controller sends out three packets with the same structure. The third one will contain the last measure, but if you read from the controller then there is only be data in the first one. For that reason it will be set to 0 if the argument is omitted. </td></tr>
</table>
</dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>Returns true if the specific finger is touching the touchpad. </dd></dl>
<p>Definition at line <a class="el" href="_p_s4_parser_8h_source.html#l00198">198</a> of file <a class="el" href="_p_s4_parser_8h_source.html">PS4Parser.h</a>.</p>
</div>
</div>
<a class="anchor" id="a0b3de008ae8aaa057c571081b1b64e88"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">uint8_t PS4Parser::getTouchCounter </td>
<td>(</td>
<td class="paramtype">uint8_t&#160;</td>
<td class="paramname"><em>finger</em> = <code>0</code>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">uint8_t&#160;</td>
<td class="paramname"><em>xyId</em> = <code>0</code>&#160;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>This counter increments every time a finger touches the touchpad. </p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">finger</td><td>0 = first finger, 1 = second finger. If omitted, then 0 will be used. </td></tr>
<tr><td class="paramname">xyId</td><td>The controller sends out three packets with the same structure. The third one will contain the last measure, but if you read from the controller then there is only be data in the first one. For that reason it will be set to 0 if the argument is omitted. </td></tr>
</table>
</dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>Return the value of the counter, note that it is only a 7-bit value. </dd></dl>
<p>Definition at line <a class="el" href="_p_s4_parser_8h_source.html#l00210">210</a> of file <a class="el" href="_p_s4_parser_8h_source.html">PS4Parser.h</a>.</p>
</div>
</div>
<a class="anchor" id="ac4b7e6c29af23a88d41a83e82c87c888"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">double PS4Parser::getAngle </td>
<td>(</td>
<td class="paramtype"><a class="el" href="controller_enums_8h.html#a7c7824a10a9ffa8fea85602fcf4d84e6">AngleEnum</a>&#160;</td>
<td class="paramname"><em>a</em></td><td>)</td>
<td></td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>Get the angle of the controller calculated using the accelerometer. </p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">a</td><td>Either <a class="el" href="controller_enums_8h.html#a7c7824a10a9ffa8fea85602fcf4d84e6ae3a34b760fa4a6854f28852e91d8bb47">Pitch</a> or <a class="el" href="controller_enums_8h.html#a7c7824a10a9ffa8fea85602fcf4d84e6a9d80e5f030503ccac779c6491826a173">Roll</a>. </td></tr>
</table>
</dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>Return the angle in the range of 0-360. </dd></dl>
<p>Definition at line <a class="el" href="_p_s4_parser_8h_source.html#l00219">219</a> of file <a class="el" href="_p_s4_parser_8h_source.html">PS4Parser.h</a>.</p>
</div>
</div>
<a class="anchor" id="a2b06200adee0c8ed616c4d18c23a584a"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">int16_t PS4Parser::getSensor </td>
<td>(</td>
<td class="paramtype"><a class="el" href="controller_enums_8h.html#a00d5030559c481763282483889597d51">SensorEnum</a>&#160;</td>
<td class="paramname"><em>s</em></td><td>)</td>
<td></td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>Used to get the raw values from the 3-axis gyroscope and 3-axis accelerometer inside the PS4 controller. </p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">s</td><td>The sensor to read. </td></tr>
</table>
</dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>Returns the raw sensor reading. </dd></dl>
<p>Definition at line <a class="el" href="_p_s4_parser_8h_source.html#l00231">231</a> of file <a class="el" href="_p_s4_parser_8h_source.html">PS4Parser.h</a>.</p>
</div>
</div>
<a class="anchor" id="a6498fdeb767364e84ce09ef208980622"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">void PS4Parser::Parse </td>
<td>(</td>
<td class="paramtype">uint8_t&#160;</td>
<td class="paramname"><em>len</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">uint8_t *&#160;</td>
<td class="paramname"><em>buf</em>&#160;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">protected</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>Used to parse data sent from the PS4 controller. </p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">len</td><td>Length of the data. </td></tr>
<tr><td class="paramname">buf</td><td>Pointer to the data buffer. </td></tr>
</table>
</dd>
</dl>
<p>Definition at line <a class="el" href="_p_s4_parser_8cpp_source.html#l00076">76</a> of file <a class="el" href="_p_s4_parser_8cpp_source.html">PS4Parser.cpp</a>.</p>
</div>
</div>
<a class="anchor" id="a24640b2362b0f6f51785fbd3dd4f13f9"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">void PS4Parser::Reset </td>
<td>(</td>
<td class="paramname"></td><td>)</td>
<td></td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span><span class="mlabel">protected</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>Used to reset the different buffers to their default values </p>
<p>Definition at line <a class="el" href="_p_s4_parser_8h_source.html#l00260">260</a> of file <a class="el" href="_p_s4_parser_8h_source.html">PS4Parser.h</a>.</p>
</div>
</div>
<hr/>The documentation for this class was generated from the following files:<ul>
<li><a class="el" href="_p_s4_parser_8h_source.html">PS4Parser.h</a></li>
<li><a class="el" href="_p_s4_parser_8cpp_source.html">PS4Parser.cpp</a></li>
</ul>
</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.6
</small></address>
</body>
</html>