libx52/group__libx52dev.html

191 lines
11 KiB
HTML

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://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.17"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>libx52: Device Handling</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/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.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 id="projectalign" style="padding-left: 0.5em;">
<div id="projectname">libx52
&#160;<span id="projectnumber">0.2.3</span>
</div>
<div id="projectbrief">Saitek X52/X52Pro drivers for Linux/Unix</div>
</td>
</tr>
</tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.17 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
var searchBox = new SearchBox("searchBox", "search",false,'Search');
/* @license-end */
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
$(function() {
initMenu('',true,false,'search.php','Search');
$(document).ready(function() { init_search(); });
});
/* @license-end */</script>
<div id="main-nav"></div>
</div><!-- top -->
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
onmouseover="return searchBox.OnSearchSelectShow()"
onmouseout="return searchBox.OnSearchSelectHide()"
onkeydown="return searchBox.OnSearchSelectKey(event)">
</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 class="header">
<div class="summary">
<a href="#func-members">Functions</a> </div>
<div class="headertitle">
<div class="title">Device Handling</div> </div>
</div><!--header-->
<div class="contents">
<p>Handle connections to the device.
<a href="#details">More...</a></p>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="func-members"></a>
Functions</h2></td></tr>
<tr class="memitem:ga65998f1155fb093f45babfd0c2c138d9"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__libx52dev.html#ga65998f1155fb093f45babfd0c2c138d9">libx52_connect</a> (<a class="el" href="group__libx52init.html#gaca59b8d8f249fed58a0ec3253328e131">libx52_device</a> *dev)</td></tr>
<tr class="memdesc:ga65998f1155fb093f45babfd0c2c138d9"><td class="mdescLeft">&#160;</td><td class="mdescRight">Connect to the X52 device. <a href="group__libx52dev.html#ga65998f1155fb093f45babfd0c2c138d9">More...</a><br /></td></tr>
<tr class="separator:ga65998f1155fb093f45babfd0c2c138d9"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga82f3fb7f750aa5480d23b69875d3ebe8"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__libx52dev.html#ga82f3fb7f750aa5480d23b69875d3ebe8">libx52_disconnect</a> (<a class="el" href="group__libx52init.html#gaca59b8d8f249fed58a0ec3253328e131">libx52_device</a> *dev)</td></tr>
<tr class="memdesc:ga82f3fb7f750aa5480d23b69875d3ebe8"><td class="mdescLeft">&#160;</td><td class="mdescRight">Disconnect from the X52 device. <a href="group__libx52dev.html#ga82f3fb7f750aa5480d23b69875d3ebe8">More...</a><br /></td></tr>
<tr class="separator:ga82f3fb7f750aa5480d23b69875d3ebe8"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gaa2ec46eb779df5f33678defe3050b1d4"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__libx52dev.html#gaa2ec46eb779df5f33678defe3050b1d4">libx52_is_connected</a> (<a class="el" href="group__libx52init.html#gaca59b8d8f249fed58a0ec3253328e131">libx52_device</a> *dev)</td></tr>
<tr class="memdesc:gaa2ec46eb779df5f33678defe3050b1d4"><td class="mdescLeft">&#160;</td><td class="mdescRight">Check if joystick is connected. <a href="group__libx52dev.html#gaa2ec46eb779df5f33678defe3050b1d4">More...</a><br /></td></tr>
<tr class="separator:gaa2ec46eb779df5f33678defe3050b1d4"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<p>Handle connections to the device. </p>
<p>These functions allow the application to dynamically connect and disconnect from a supported device. </p>
<h2 class="groupheader">Function Documentation</h2>
<a id="ga65998f1155fb093f45babfd0c2c138d9"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga65998f1155fb093f45babfd0c2c138d9">&#9670;&nbsp;</a></span>libx52_connect()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">int libx52_connect </td>
<td>(</td>
<td class="paramtype"><a class="el" href="group__libx52init.html#gaca59b8d8f249fed58a0ec3253328e131">libx52_device</a> *&#160;</td>
<td class="paramname"><em>dev</em></td><td>)</td>
<td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Connect to the X52 device. </p>
<p>Attempt to connect to a supported X52/X52Pro joystick. If no supported joysticks are found, it will return <a class="el" href="group__libx52misc.html#gga93b777d9cea6e733b63c222e6115ccb7ad3e9a0e2e18b469ddc7135d73942e29a">LIBX52_ERROR_NO_DEVICE</a>. If any errors are encountered during device enumeration, it will return an appropriate <a class="el" href="group__libx52misc.html#ga93b777d9cea6e733b63c222e6115ccb7">libx52_error_code</a>.</p>
<p>If this function is called after it has already connected to a joystick, then it will re-enumerate the bus and ensure that it is still connected.</p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramdir">[in]</td><td class="paramname">dev</td><td>Pointer to the device context</td></tr>
</table>
</dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd><a class="el" href="group__libx52misc.html#ga93b777d9cea6e733b63c222e6115ccb7">libx52_error_code</a> indicating status </dd></dl>
</div>
</div>
<a id="ga82f3fb7f750aa5480d23b69875d3ebe8"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga82f3fb7f750aa5480d23b69875d3ebe8">&#9670;&nbsp;</a></span>libx52_disconnect()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">int libx52_disconnect </td>
<td>(</td>
<td class="paramtype"><a class="el" href="group__libx52init.html#gaca59b8d8f249fed58a0ec3253328e131">libx52_device</a> *&#160;</td>
<td class="paramname"><em>dev</em></td><td>)</td>
<td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Disconnect from the X52 device. </p>
<p>This function disconnects any active connections to supported joysticks. Applications must reconnect to the joystick using <a class="el" href="group__libx52dev.html#ga65998f1155fb093f45babfd0c2c138d9">libx52_connect</a> prior to calling <a class="el" href="group__libx52misc.html#ga5d1fdbcab1b1a6cf8a10c206f8e79f73">libx52_update</a>.</p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramdir">[in]</td><td class="paramname">dev</td><td>Pointer to the device context</td></tr>
</table>
</dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd><a class="el" href="group__libx52misc.html#ga93b777d9cea6e733b63c222e6115ccb7">libx52_error_code</a> indicating status </dd></dl>
</div>
</div>
<a id="gaa2ec46eb779df5f33678defe3050b1d4"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gaa2ec46eb779df5f33678defe3050b1d4">&#9670;&nbsp;</a></span>libx52_is_connected()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">bool libx52_is_connected </td>
<td>(</td>
<td class="paramtype"><a class="el" href="group__libx52init.html#gaca59b8d8f249fed58a0ec3253328e131">libx52_device</a> *&#160;</td>
<td class="paramname"><em>dev</em></td><td>)</td>
<td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Check if joystick is connected. </p>
<p>This function reports if it is possible to try to communicate with a supported joystick. The application can communicate with the joystick, only if the following conditions are met.</p>
<ol type="1">
<li>The joystick is plugged in and powered up.</li>
<li>The application has called <a class="el" href="group__libx52dev.html#ga65998f1155fb093f45babfd0c2c138d9">libx52_connect</a> to connect to the joystick.</li>
</ol>
<p>This function, however, does not check if the joystick is physically connected. A call to <a class="el" href="group__libx52misc.html#ga5d1fdbcab1b1a6cf8a10c206f8e79f73">libx52_update</a> or <a class="el" href="group__libx52misc.html#gac491f4fb8d37f477d83725cb472de030">libx52_vendor_command</a> will return an error of <a class="el" href="group__libx52misc.html#gga93b777d9cea6e733b63c222e6115ccb7ad3e9a0e2e18b469ddc7135d73942e29a">LIBX52_ERROR_NO_DEVICE</a> if the joystick has either been disconnected, or <a class="el" href="group__libx52dev.html#ga65998f1155fb093f45babfd0c2c138d9">libx52_connect</a> was never called.</p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramdir">[in]</td><td class="paramname">dev</td><td>Pointer to the device context</td></tr>
</table>
</dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>Boolean indicating if the internal device handle is valid. </dd></dl>
</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.17
</small></address>
</body>
</html>