mirror of https://github.com/nirenjan/libx52.git
				
				
				
			
		
			
				
	
	
		
			172 lines
		
	
	
		
			9.0 KiB
		
	
	
	
		
			HTML
		
	
	
			
		
		
	
	
			172 lines
		
	
	
		
			9.0 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>x52pro-linux: Command Line Interface to libx52</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">x52pro-linux
 | |
|     <span id="projectnumber">0.2.1</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">Command Line Interface to libx52 </div>  </div>
 | |
| </div><!--header-->
 | |
| <div class="contents">
 | |
| <div class="textblock"><p> 
 | |
| <b>x52cli</b> - Command line interface to libx52
 | |
| </p>
 | |
| <h1><a class="anchor" id="autotoc_md3"></a>
 | |
| SYNOPSIS</h1>
 | |
| <p><code><b>x52cli</b> <em>commands</em> [<em>command-options</em>]</code></p>
 | |
| <h1><a class="anchor" id="autotoc_md4"></a>
 | |
| DESCRIPTION</h1>
 | |
| <p><b>x52cli</b> is a command line interface to the X52 library that allows you to set the LEDs and different parameters on the multifunction display (MFD).</p>
 | |
| <p>Running <b>x52cli</b> without any arguments will display a brief help message.</p>
 | |
| <h1><a class="anchor" id="autotoc_md5"></a>
 | |
| COMMANDS</h1>
 | |
| <p>Commands are not case sensitive.</p>
 | |
| <ul>
 | |
| <li><code><b>bri</b> { <b>mfd</b> | <b>led</b> } < <em>brightness</em> > </code><br  />
 | |
|   Set the brightness of the <b>MFD</b> or <b>LED</b>s. <em>brightness</em> can be any numeric value between 0 and 128. Higher values are accepted, but may not have the desired effect.</li>
 | |
| <li><code><b>mfd</b> < <em>line</em> > < <em>text</em> > </code><br  />
 | |
|   Set the text on the MFD <em>line</em>. <em>line</em> can be <code>0</code>, <code>1</code> or <code>2</code>, and refers to the first, second or third line of the multifunction display respectively. <em>text</em> cannot have embedded NUL characters (0x00) and must correspond with the character map fo the MFD. <em>text</em> should be quoted in order to preserve embedded whitespace. To pass raw hex values, use <b>printf(1)</b> as shown in the <a class="el" href="x52cli.html#x52cli_examples">EXAMPLES</a> section. Note that <em>text</em> is limited to a length of 16 characters. While you can pass in longer strings, they will be silenty truncated.</li>
 | |
| <li><code><b>led</b> < <em>led-id</em> > < <em>state</em> > </code><br  />
 | |
|   Set the LED <em>led-id</em> to <em>state</em>. See <a class="el" href="x52cli.html#x52cli_leds">LEDs</a> for a list of supported values.</li>
 | |
| <li><code><b>blink</b> { <b>on</b> | <b>off</b> } </code><br  />
 | |
|   Turn the <b>blink</b> state <b>on</b> or <b>off</b>.</li>
 | |
| <li><code><b>shift</b> { <b>on</b> | <b>off</b> } </code><br  />
 | |
|   Turn the <b>shift</b> indicator in the MFD <b>on</b> or <b>off</b>.</li>
 | |
| <li><code><b>clock</b> { <b>local</b> | <b>gmt</b> } { <b>12hr</b> | <b>24hr</b> } { <b>ddmmyy</b> | <b>mmddyy</b> | <b>yymmdd</b> }</code><br  />
 | |
|   Set the clock 1 display to the current <b>local</b> or <b>GMT</b> time and date. Clock can be configured to display in either <b>12hr</b> or <b>24hr</b> mode. Date can be displayed in one of the following formats: <b>DD-MM-YY</b>, <b>MM-DD-YY</b>, or <b>YY-MM-DD</b>.</li>
 | |
| <li><code><b>offset</b> { <b>2</b> | <b>3</b> } < <em>offset-val</em> > { <b>12hr</b> | <b>24hr</b> }</code><br  />
 | |
|   Set the offset for clock <b>2</b> or <b>3</b> and configure them to display in either <b>12hr</b> or <b>24hr</b> mode. <em>offset-val</em> is in minutes east of <b>UTC</b> and can range from <em>-1440</em> to <em>+1440</em>.</li>
 | |
| <li><code><b>time</b> < <em>hour</em> > < <em>minute</em> > { <b>12hr</b> | <b>24hr</b> }</code><br  />
 | |
|   Set the time for clock 1 to <em>hour:minute</em> and configure it to display in <b>12hr</b> or <b>24hr</b> mode.</li>
 | |
| <li><code><b>date</b> <<em>dd</em> > <<em>mm</em> > <<em>yy></em> { <b>ddmmyy</b> | <b>mmddyy</b> | <b>yymmdd</b> }</code><br  />
 | |
|   Set the date on the MFD to the values represented by <em>dd</em>, <em>mm</em> and <em>yy</em> in the requested format.</li>
 | |
| <li><code><b>raw</b> < <em>wIndex</em> > < <em>wValue</em> ></code><br  />
 | |
|   Send a raw vendor control request to the connected joystick.<br  />
 | |
|  <dl class="section warning"><dt>Warning</dt><dd>You should only use the raw command if you know what you are doing. Sending an invalid control sequence can potentially damage or destroy your device.</dd></dl>
 | |
| </li>
 | |
| </ul>
 | |
| <h1><a class="anchor" id="x52cli_leds"></a>
 | |
| LEDs</h1>
 | |
| <p>This is the list of LED IDs and corresponding states supported by the X52 Pro. Note that the <b>on</b> state is only allowed for the <b>fire</b> and <b>throttle</b> LEDs, and they do not support the <b>red</b>, <b>amber</b> and <b>green</b> states. The remaining LEDs do not support the <b>on</b> state, but support all the other states.</p>
 | |
| <dl class="section note"><dt>Note</dt><dd>The <b>led</b> command is only supported on the X52 Pro, not on the X52.</dd></dl>
 | |
| <h2><a class="anchor" id="autotoc_md6"></a>
 | |
| LED IDs</h2>
 | |
| <ul>
 | |
| <li><b>fire</b> </li>
 | |
| <li><b>a</b> </li>
 | |
| <li><b>b</b> </li>
 | |
| <li><b>d</b> </li>
 | |
| <li><b>e</b> </li>
 | |
| <li><b>t1</b> </li>
 | |
| <li><b>t2</b> </li>
 | |
| <li><b>t3</b> </li>
 | |
| <li><b>pov</b> </li>
 | |
| <li><b>clutch</b> </li>
 | |
| <li><b>throttle</b> </li>
 | |
| </ul>
 | |
| <h2><a class="anchor" id="autotoc_md7"></a>
 | |
| States</h2>
 | |
| <ul>
 | |
| <li><b>off</b> </li>
 | |
| <li><b>on</b> </li>
 | |
| <li><b>red</b> </li>
 | |
| <li><b>amber</b> </li>
 | |
| <li><b>green</b> </li>
 | |
| </ul>
 | |
| <h1><a class="anchor" id="autotoc_md8"></a>
 | |
| LIMITATIONS</h1>
 | |
| <p><b>x52cli</b> does not maintain any state between invocations. As a result the <b>clock</b> command will reset the relative offsets for clocks 2 and 3 back to 0 and configure them to be in 12 hour mode. To work around this, use the <b>date</b> and <b>time</b> commands instead to manually configure the date and time.</p>
 | |
| <h1><a class="anchor" id="autotoc_md9"></a>
 | |
| PERMISSIONS</h1>
 | |
| <p>You must have write permissions to the USB device in order to use the <b>libx52</b> library, and by extension, <b>x52cli</b>.</p>
 | |
| <p>The simplest method to obtain such permissions is to run <b>x52cli</b> as root, possibly through <b>sudo(8)</b> </p>
 | |
| <h1><a class="anchor" id="x52cli_examples"></a>
 | |
| EXAMPLES</h1>
 | |
| <ul>
 | |
| <li>Turn off the T1 LED. <blockquote class="doxtable">
 | |
| <p><code><b>x52cli</b> led t1 off</code> </p>
 | |
| </blockquote>
 | |
| </li>
 | |
| <li>Turn the B LED to Amber. <blockquote class="doxtable">
 | |
| <p><code><b>x52cli</b> led B amber</code> </p>
 | |
| </blockquote>
 | |
| </li>
 | |
| <li>Set line 1 of the MFD to display "Hello World" <blockquote class="doxtable">
 | |
| <p><code><b>x52cli</b> mfd 0 "Hello World"</code> </p>
 | |
| </blockquote>
 | |
| </li>
 | |
| <li>Set line 2 of the MFD to display "¿Cómo Estás?" <blockquote class="doxtable">
 | |
| <p><code><b>x52cli</b> mfd 1 "$(printf '\\x9FC\\xE2mo Est\\xE0s?')"</code> </p>
 | |
| </blockquote>
 | |
| </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>
 |