<divclass="textblock"><p>This class parses all the data sent by the Switch Pro controller </p>
<pclass="definition">Definition at line <aclass="el"href="_switch_pro_parser_8h_source.html#l00141">141</a> of file <aclass="el"href="_switch_pro_parser_8h_source.html">SwitchProParser.h</a>.</p>
</div><h2class="groupheader">Constructor & Destructor Documentation</h2>
<p>Constructor for the <aclass="el"href="class_switch_pro_parser.html">SwitchProParser</a> class. </p>
<pclass="definition">Definition at line <aclass="el"href="_switch_pro_parser_8h_source.html#l00144">144</a> of file <aclass="el"href="_switch_pro_parser_8h_source.html">SwitchProParser.h</a>.</p>
</div>
</div>
<h2class="groupheader">Member Function Documentation</h2>
<p><aclass="el"href="class_switch_pro_parser.html#a292e664f95d4c5b410ca79a9450c46a3">getButtonPress(ButtonEnum b)</a> will return true as long as the button is held down.</p>
<p>While <aclass="el"href="class_switch_pro_parser.html#a163612831c3f1f9327f085a3104ed0d4">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 <aclass="el"href="class_switch_pro_parser.html#a163612831c3f1f9327f085a3104ed0d4">getButtonClick(ButtonEnum b)</a>, but if you need to drive a robot forward you would use <aclass="el"href="class_switch_pro_parser.html#a292e664f95d4c5b410ca79a9450c46a3">getButtonPress(ButtonEnum b)</a>. </p><dlclass="params"><dt>Parameters</dt><dd>
<tableclass="params">
<tr><tdclass="paramname">b</td><td><aclass="el"href="controller_enums_8h.html#a94f7389d205c78830a5441370d7870fd">ButtonEnum</a> to read. </td></tr>
</table>
</dd>
</dl>
<dlclass="section return"><dt>Returns</dt><dd><aclass="el"href="class_switch_pro_parser.html#a292e664f95d4c5b410ca79a9450c46a3">getButtonPress(ButtonEnum b)</a> will return a true as long as a button is held down, while <aclass="el"href="class_switch_pro_parser.html#a163612831c3f1f9327f085a3104ed0d4">getButtonClick(ButtonEnum b)</a> will return true once for each button press. </dd></dl>
<pclass="definition">Definition at line <aclass="el"href="_switch_pro_parser_8cpp_source.html#l00029">29</a> of file <aclass="el"href="_switch_pro_parser_8cpp_source.html">SwitchProParser.cpp</a>.</p>
<p>Allow derived classes to access the output variables. </p>
<pclass="definition">Definition at line <aclass="el"href="_switch_pro_parser_8cpp_source.html#l00034">34</a> of file <aclass="el"href="_switch_pro_parser_8cpp_source.html">SwitchProParser.cpp</a>.</p>
<p>Used to read the analog joystick. </p><dlclass="params"><dt>Parameters</dt><dd>
<tableclass="params">
<tr><tdclass="paramname">a</td><td><aclass="el"href="controller_enums_8h.html#a34dad8f0a0927471137c403216597093a383cb8895dd296b7f69ce845ed16b0ca">LeftHatX</a>, <aclass="el"href="controller_enums_8h.html#a34dad8f0a0927471137c403216597093af3f3925efa9762c4e9e71ac7da7a94a3">LeftHatY</a>, <aclass="el"href="controller_enums_8h.html#a34dad8f0a0927471137c403216597093aaeb027a0ae5bbc6ba25e1c78a6486c7b">RightHatX</a>, and <aclass="el"href="controller_enums_8h.html#a34dad8f0a0927471137c403216597093a7f1fb2db5381286691f4dec179ed5d5a">RightHatY</a>. </td></tr>
</table>
</dd>
</dl>
<dlclass="section return"><dt>Returns</dt><dd>Return the analog value as a signed 16-bit value. </dd></dl>
<pclass="definition">Definition at line <aclass="el"href="_switch_pro_parser_8cpp_source.html#l00042">42</a> of file <aclass="el"href="_switch_pro_parser_8cpp_source.html">SwitchProParser.cpp</a>.</p>
<p>Used to enable/disable the IMU. By default it is disabled. </p><dlclass="params"><dt>Parameters</dt><dd>
<tableclass="params">
<tr><tdclass="paramname">enable</td><td>Enable/disable the IMU. </td></tr>
</table>
</dd>
</dl>
<pclass="definition">Definition at line <aclass="el"href="_switch_pro_parser_8h_source.html#l00174">174</a> of file <aclass="el"href="_switch_pro_parser_8h_source.html">SwitchProParser.h</a>.</p>
<p>Get the angle of the controller calculated using the accelerometer. </p><dlclass="params"><dt>Parameters</dt><dd>
<tableclass="params">
<tr><tdclass="paramname">a</td><td>Either <aclass="el"href="controller_enums_8h.html#a7c7824a10a9ffa8fea85602fcf4d84e6ae3a34b760fa4a6854f28852e91d8bb47">Pitch</a> or <aclass="el"href="controller_enums_8h.html#a7c7824a10a9ffa8fea85602fcf4d84e6a9d80e5f030503ccac779c6491826a173">Roll</a>. </td></tr>
</table>
</dd>
</dl>
<dlclass="section return"><dt>Returns</dt><dd>Return the angle in the range of 0-360. </dd></dl>
<pclass="definition">Definition at line <aclass="el"href="_switch_pro_parser_8h_source.html#l00184">184</a> of file <aclass="el"href="_switch_pro_parser_8h_source.html">SwitchProParser.h</a>.</p>
<p>Used to get the raw values from the 3-axis gyroscope and 3-axis accelerometer inside the PS5 controller. </p><dlclass="params"><dt>Parameters</dt><dd>
<tableclass="params">
<tr><tdclass="paramname">s</td><td>The sensor to read. </td></tr>
</table>
</dd>
</dl>
<dlclass="section return"><dt>Returns</dt><dd>Returns the raw sensor reading. </dd></dl>
<pclass="definition">Definition at line <aclass="el"href="_switch_pro_parser_8h_source.html#l00196">196</a> of file <aclass="el"href="_switch_pro_parser_8h_source.html">SwitchProParser.h</a>.</p>
<pclass="definition">Definition at line <aclass="el"href="_switch_pro_parser_8h_source.html#l00216">216</a> of file <aclass="el"href="_switch_pro_parser_8h_source.html">SwitchProParser.h</a>.</p>
<pclass="definition">Definition at line <aclass="el"href="_switch_pro_parser_8h_source.html#l00223">223</a> of file <aclass="el"href="_switch_pro_parser_8h_source.html">SwitchProParser.h</a>.</p>
<pclass="definition">Definition at line <aclass="el"href="_switch_pro_parser_8h_source.html#l00228">228</a> of file <aclass="el"href="_switch_pro_parser_8h_source.html">SwitchProParser.h</a>.</p>
<tr><tdclass="paramname">leftRumbleOn</td><td>Turn on/off left rumble motor. </td></tr>
<tr><tdclass="paramname">rightRumbleOn</td><td>Turn on/off right rumble motor. </td></tr>
</table>
</dd>
</dl>
<pclass="definition">Definition at line <aclass="el"href="_switch_pro_parser_8h_source.html#l00237">237</a> of file <aclass="el"href="_switch_pro_parser_8h_source.html">SwitchProParser.h</a>.</p>
<p>Turn on/off the left rumble. </p><dlclass="params"><dt>Parameters</dt><dd>
<tableclass="params">
<tr><tdclass="paramname">on</td><td>Turn on/off left rumble motor. </td></tr>
</table>
</dd>
</dl>
<pclass="definition">Definition at line <aclass="el"href="_switch_pro_parser_8h_source.html#l00247">247</a> of file <aclass="el"href="_switch_pro_parser_8h_source.html">SwitchProParser.h</a>.</p>
<p>Turn on/off the right rumble. </p><dlclass="params"><dt>Parameters</dt><dd>
<tableclass="params">
<tr><tdclass="paramname">on</td><td>Turn on/off right rumble motor. </td></tr>
</table>
</dd>
</dl>
<pclass="definition">Definition at line <aclass="el"href="_switch_pro_parser_8h_source.html#l00256">256</a> of file <aclass="el"href="_switch_pro_parser_8h_source.html">SwitchProParser.h</a>.</p>
<p>Set LED value without using the <aclass="el"href="controller_enums_8h.html#a70df64e026046bc352983127b7ae2cf0">LEDEnum</a>. This can also be used to flash the LEDs by setting the high 4-bits of the mask. </p><dlclass="params"><dt>Parameters</dt><dd>
<pclass="definition">Definition at line <aclass="el"href="_switch_pro_parser_8h_source.html#l00266">266</a> of file <aclass="el"href="_switch_pro_parser_8h_source.html">SwitchProParser.h</a>.</p>
<pclass="definition">Definition at line <aclass="el"href="_switch_pro_parser_8h_source.html#l00272">272</a> of file <aclass="el"href="_switch_pro_parser_8h_source.html">SwitchProParser.h</a>.</p>
<p>Turn the specific <aclass="el"href="controller_enums_8h.html#a70df64e026046bc352983127b7ae2cf0">LEDEnum</a> off. </p><dlclass="params"><dt>Parameters</dt><dd>
<tableclass="params">
<tr><tdclass="paramname">a</td><td>The <aclass="el"href="controller_enums_8h.html#a70df64e026046bc352983127b7ae2cf0">LEDEnum</a> to turn off. </td></tr>
</table>
</dd>
</dl>
<pclass="definition">Definition at line <aclass="el"href="_switch_pro_parser_8h_source.html#l00280">280</a> of file <aclass="el"href="_switch_pro_parser_8h_source.html">SwitchProParser.h</a>.</p>
<p>Turn the specific <aclass="el"href="controller_enums_8h.html#a70df64e026046bc352983127b7ae2cf0">LEDEnum</a> on. </p><dlclass="params"><dt>Parameters</dt><dd>
<tableclass="params">
<tr><tdclass="paramname">a</td><td>The <aclass="el"href="controller_enums_8h.html#a70df64e026046bc352983127b7ae2cf0">LEDEnum</a> to turn on. </td></tr>
</table>
</dd>
</dl>
<pclass="definition">Definition at line <aclass="el"href="_switch_pro_parser_8h_source.html#l00289">289</a> of file <aclass="el"href="_switch_pro_parser_8h_source.html">SwitchProParser.h</a>.</p>
<p>Toggle the specific <aclass="el"href="controller_enums_8h.html#a70df64e026046bc352983127b7ae2cf0">LEDEnum</a>. </p><dlclass="params"><dt>Parameters</dt><dd>
<tableclass="params">
<tr><tdclass="paramname">a</td><td>The <aclass="el"href="controller_enums_8h.html#a70df64e026046bc352983127b7ae2cf0">LEDEnum</a> to toggle. </td></tr>
</table>
</dd>
</dl>
<pclass="definition">Definition at line <aclass="el"href="_switch_pro_parser_8h_source.html#l00298">298</a> of file <aclass="el"href="_switch_pro_parser_8h_source.html">SwitchProParser.h</a>.</p>
<pclass="definition">Definition at line <aclass="el"href="_switch_pro_parser_8h_source.html#l00304">304</a> of file <aclass="el"href="_switch_pro_parser_8h_source.html">SwitchProParser.h</a>.</p>
<pclass="definition">Definition at line <aclass="el"href="_switch_pro_parser_8h_source.html#l00310">310</a> of file <aclass="el"href="_switch_pro_parser_8h_source.html">SwitchProParser.h</a>.</p>
<pclass="definition">Definition at line <aclass="el"href="_switch_pro_parser_8h_source.html#l00316">316</a> of file <aclass="el"href="_switch_pro_parser_8h_source.html">SwitchProParser.h</a>.</p>
<pclass="definition">Definition at line <aclass="el"href="_switch_pro_parser_8h_source.html#l00322">322</a> of file <aclass="el"href="_switch_pro_parser_8h_source.html">SwitchProParser.h</a>.</p>
<p>Return the battery level of the Switch Pro Controller. </p><dlclass="section return"><dt>Returns</dt><dd>The battery level as a bit mask according to ::SwitchProBatteryLevel: 4=full, 3=medium, 2=low, 1=critical, 0=empty. </dd></dl>
<pclass="definition">Definition at line <aclass="el"href="_switch_pro_parser_8h_source.html#l00331">331</a> of file <aclass="el"href="_switch_pro_parser_8h_source.html">SwitchProParser.h</a>.</p>
<p>Returns whenever the controller is plugged in and charging. </p><dlclass="section return"><dt>Returns</dt><dd>Returns True if the controller is charging. </dd></dl>
<pclass="definition">Definition at line <aclass="el"href="_switch_pro_parser_8h_source.html#l00339">339</a> of file <aclass="el"href="_switch_pro_parser_8h_source.html">SwitchProParser.h</a>.</p>
<p>Used to parse data sent from the Switch Pro controller. </p><dlclass="params"><dt>Parameters</dt><dd>
<tableclass="params">
<tr><tdclass="paramname">len</td><td>Length of the data. </td></tr>
<tr><tdclass="paramname">buf</td><td>Pointer to the data buffer. </td></tr>
</table>
</dd>
</dl>
<pclass="definition">Definition at line <aclass="el"href="_switch_pro_parser_8cpp_source.html#l00055">55</a> of file <aclass="el"href="_switch_pro_parser_8cpp_source.html">SwitchProParser.cpp</a>.</p>
<p>Used to reset the different buffers to their default values </p>
<pclass="definition">Definition at line <aclass="el"href="_switch_pro_parser_8cpp_source.html#l00231">231</a> of file <aclass="el"href="_switch_pro_parser_8cpp_source.html">SwitchProParser.cpp</a>.</p>
<p>Send the output to the Switch Pro controller. This is implemented in <aclass="el"href="_switch_pro_b_t_8h.html">SwitchProBT.h</a> and <aclass="el"href="_switch_pro_u_s_b_8h.html">SwitchProUSB.h</a>. </p><dlclass="params"><dt>Parameters</dt><dd>
<tableclass="params">
<tr><tdclass="paramname">data</td><td>Pointer to buffer to send by the derived class. </td></tr>
<tr><tdclass="paramname">len</td><td>Length of buffer. </td></tr>
</table>
</dd>
</dl>
<p>Implemented in <aclass="el"href="class_switch_pro_u_s_b.html#a7c29494aae157c4e268247b02132f54f">SwitchProUSB</a>, and <aclass="el"href="class_switch_pro_b_t.html#a7b394d6ccc473f158d19e5354a257fdd">SwitchProBT</a>.</p>
<p>Used to send a handshake command via <aclass="el"href="class_u_s_b.html">USB</a> before disabling the timeout. </p>
<p>Reimplemented in <aclass="el"href="class_switch_pro_u_s_b.html#abbeb301f7638c60bde9e183d7229fca9">SwitchProUSB</a>.</p>
<pclass="definition">Definition at line <aclass="el"href="_switch_pro_parser_8h_source.html#l00362">362</a> of file <aclass="el"href="_switch_pro_parser_8h_source.html">SwitchProParser.h</a>.</p>
<p>Needed to disable <aclass="el"href="class_u_s_b.html">USB</a> timeout for the controller, so it sends out data without the host having to send data continuously. </p>
<p>Reimplemented in <aclass="el"href="class_switch_pro_u_s_b.html#a2019333fe0252d0911037762fd69856e">SwitchProUSB</a>.</p>
<pclass="definition">Definition at line <aclass="el"href="_switch_pro_parser_8h_source.html#l00368">368</a> of file <aclass="el"href="_switch_pro_parser_8h_source.html">SwitchProParser.h</a>.</p>
</div>
</div>
<h2class="groupheader">Member Data Documentation</h2>
<p>Allow derived classes to access the output variables. </p>
<pclass="definition">Definition at line <aclass="el"href="_switch_pro_parser_8h_source.html#l00371">371</a> of file <aclass="el"href="_switch_pro_parser_8h_source.html">SwitchProParser.h</a>.</p>
</div>
</div>
<hr/>The documentation for this class was generated from the following files:<ul>