mirror of https://github.com/nirenjan/libx52.git
122 lines
5.4 KiB
HTML
122 lines
5.4 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: X52 daemon socket communication protocol</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
|
|
 <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&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&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>
|
|
<!-- 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><!-- top -->
|
|
<div class="PageDoc"><div class="header">
|
|
<div class="headertitle">
|
|
<div class="title">X52 daemon socket communication protocol </div> </div>
|
|
</div><!--header-->
|
|
<div class="contents">
|
|
<div class="textblock"><p>The X52 daemon creates a Unix domain stream socket, by default at <code>/var/run/x52d.cmd</code> and listens for connection requests from clients at this location. This can be overridden by passing the -s flag when starting the daemon.</p>
|
|
<h1><a class="anchor" id="autotoc_md13"></a>
|
|
Protocol Overview</h1>
|
|
<p><b>x52d</b> requires that clients send it commands as a series of NUL terminated strings, without any interleaving space. The command should be sent in a single <code>send</code> call, and the client may expect a response in a single <code>recv</code> call.</p>
|
|
<p>The <code>send</code> call must send exactly the number of bytes in the command text. Extra bytes will be treated as additional arguments, which would cause the command to fail. It is recommended that the <code>recv</code> call uses a 1024 byte buffer to read the data. Responses will never exceed this length.</p>
|
|
<h1><a class="anchor" id="autotoc_md14"></a>
|
|
Responses</h1>
|
|
<p>The daemon sends the response as a series of NUL terminated strings, without any interleaving space. The first string is always one of the following:</p>
|
|
<ul>
|
|
<li><code>OK</code> </li>
|
|
<li><code>ERR</code> </li>
|
|
<li><code>DATA</code> </li>
|
|
</ul>
|
|
<p>This determines whether the request was successful or not, and subsequent strings describe the action, error or requested data.</p>
|
|
<h1><a class="anchor" id="autotoc_md15"></a>
|
|
Examples</h1>
|
|
<h2><a class="anchor" id="autotoc_md16"></a>
|
|
Reloading configuration</h2>
|
|
<ul>
|
|
<li><b>send</b> <code>config\0reload\0</code></li>
|
|
<li><b>recv</b> <code>OK\0config\0reload\0</code></li>
|
|
</ul>
|
|
<h2><a class="anchor" id="autotoc_md17"></a>
|
|
Reading mouse speed</h2>
|
|
<ul>
|
|
<li><b>send</b> <code>config\0get\0mouse\0speed\0</code></li>
|
|
<li><b>recv</b> <code>DATA\0mouse\0speed\010\0</code></li>
|
|
</ul>
|
|
<h2><a class="anchor" id="autotoc_md18"></a>
|
|
Sending an invalid command</h2>
|
|
<ul>
|
|
<li><b>send</b> <code>config reload</code></li>
|
|
<li><b>recv</b> <code>ERR\0Unknown command 'config reload'\0</code></li>
|
|
</ul>
|
|
<h1><a class="anchor" id="autotoc_md19"></a>
|
|
Commands</h1>
|
|
<p><b>x52d</b> commands are arranged in a hierarchical fashion as follows:</p>
|
|
<div class="fragment"><div class="line"><command-group> [<sub-command-group> [<sub-command-group> [...]]] <command> [<arguments>]</div>
|
|
</div><!-- fragment --><p>The list of supported commands are shown below:</p>
|
|
<ul>
|
|
<li><a class="el" href="proto_config.html">Configuration management</a> </li>
|
|
</ul>
|
|
</div></div><!-- contents -->
|
|
</div><!-- PageDoc -->
|
|
<!-- start footer part -->
|
|
<hr class="footer"/><address class="footer"><small>
|
|
Generated by  <a href="http://www.doxygen.org/index.html">
|
|
<img class="footer" src="doxygen.png" alt="doxygen"/>
|
|
</a> 1.8.17
|
|
</small></address>
|
|
</body>
|
|
</html>
|