Sophie

Sophie

distrib > Mageia > 6 > i586 > media > core-release > by-pkgid > c6096529d306783d0895db365bd224ce > files > 34

xwiimote-2-7.mga6.i586.rpm

<!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.11"/>
<title>xwiimote: Kernel ABI</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="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtreedata.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript">
  $(document).ready(initResizable);
  $(window).load(resizeHeight);
</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">xwiimote
   &#160;<span id="projectnumber">2</span>
   </div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.11 -->
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Main&#160;Page</span></a></li>
      <li class="current"><a href="modules.html"><span>Modules</span></a></li>
      <li><a href="annotated.html"><span>Data&#160;Structures</span></a></li>
      <li><a href="files.html"><span>Files</span></a></li>
    </ul>
  </div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
      <div id="nav-sync" class="sync"></div>
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
$(document).ready(function(){initNavTree('group__kernel.html','');});
</script>
<div id="doc-content">
<div class="header">
  <div class="summary">
<a href="#define-members">Macros</a>  </div>
  <div class="headertitle">
<div class="title">Kernel ABI</div>  </div>
</div><!--header-->
<div class="contents">

<p>Kernel ABI constants.  
<a href="#details">More...</a></p>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="define-members"></a>
Macros</h2></td></tr>
<tr class="memitem:gab6985ea315ef150b1bd85326271e65a9"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="gab6985ea315ef150b1bd85326271e65a9"></a>
#define&#160;</td><td class="memItemRight" valign="bottom"><b>XWII__NAME</b>&#160;&#160;&#160;&quot;Nintendo Wii Remote&quot;</td></tr>
<tr class="separator:gab6985ea315ef150b1bd85326271e65a9"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga63f760605babf3238d2075a2b8f94935"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ga63f760605babf3238d2075a2b8f94935"></a>
#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__kernel.html#ga63f760605babf3238d2075a2b8f94935">XWII_NAME_CORE</a>&#160;&#160;&#160;XWII__NAME</td></tr>
<tr class="memdesc:ga63f760605babf3238d2075a2b8f94935"><td class="mdescLeft">&#160;</td><td class="mdescRight">Name of the core input device. <br /></td></tr>
<tr class="separator:ga63f760605babf3238d2075a2b8f94935"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gabd6fcb35096155e38041c58adddc1011"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="gabd6fcb35096155e38041c58adddc1011"></a>
#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__kernel.html#gabd6fcb35096155e38041c58adddc1011">XWII_NAME_ACCEL</a>&#160;&#160;&#160;XWII__NAME &quot; Accelerometer&quot;</td></tr>
<tr class="memdesc:gabd6fcb35096155e38041c58adddc1011"><td class="mdescLeft">&#160;</td><td class="mdescRight">Name of the accelerometer input device. <br /></td></tr>
<tr class="separator:gabd6fcb35096155e38041c58adddc1011"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga7ff8b1875db579e5ca29d410d1d49c2d"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ga7ff8b1875db579e5ca29d410d1d49c2d"></a>
#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__kernel.html#ga7ff8b1875db579e5ca29d410d1d49c2d">XWII_NAME_IR</a>&#160;&#160;&#160;XWII__NAME &quot; IR&quot;</td></tr>
<tr class="memdesc:ga7ff8b1875db579e5ca29d410d1d49c2d"><td class="mdescLeft">&#160;</td><td class="mdescRight">Name of the IR input device. <br /></td></tr>
<tr class="separator:ga7ff8b1875db579e5ca29d410d1d49c2d"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga94d4f435cca23a94fcf9b8d1dc3c8179"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ga94d4f435cca23a94fcf9b8d1dc3c8179"></a>
#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__kernel.html#ga94d4f435cca23a94fcf9b8d1dc3c8179">XWII_NAME_MOTION_PLUS</a>&#160;&#160;&#160;XWII__NAME &quot; Motion Plus&quot;</td></tr>
<tr class="memdesc:ga94d4f435cca23a94fcf9b8d1dc3c8179"><td class="mdescLeft">&#160;</td><td class="mdescRight">Name of the motion-plus input device. <br /></td></tr>
<tr class="separator:ga94d4f435cca23a94fcf9b8d1dc3c8179"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gab8774aa7766ab02d01014201cb0ce553"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="gab8774aa7766ab02d01014201cb0ce553"></a>
#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__kernel.html#gab8774aa7766ab02d01014201cb0ce553">XWII_NAME_NUNCHUK</a>&#160;&#160;&#160;XWII__NAME &quot; Nunchuk&quot;</td></tr>
<tr class="memdesc:gab8774aa7766ab02d01014201cb0ce553"><td class="mdescLeft">&#160;</td><td class="mdescRight">Name of the nunchuk input device. <br /></td></tr>
<tr class="separator:gab8774aa7766ab02d01014201cb0ce553"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gac1af11a16cd162b73868080582f107bf"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="gac1af11a16cd162b73868080582f107bf"></a>
#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__kernel.html#gac1af11a16cd162b73868080582f107bf">XWII_NAME_CLASSIC_CONTROLLER</a>&#160;&#160;&#160;XWII__NAME &quot; Classic Controller&quot;</td></tr>
<tr class="memdesc:gac1af11a16cd162b73868080582f107bf"><td class="mdescLeft">&#160;</td><td class="mdescRight">Name of the classic-controller input device. <br /></td></tr>
<tr class="separator:gac1af11a16cd162b73868080582f107bf"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga4cfb144b17da39cc2ea64d5e227ad0d8"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ga4cfb144b17da39cc2ea64d5e227ad0d8"></a>
#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__kernel.html#ga4cfb144b17da39cc2ea64d5e227ad0d8">XWII_NAME_BALANCE_BOARD</a>&#160;&#160;&#160;XWII__NAME &quot; Balance Board&quot;</td></tr>
<tr class="memdesc:ga4cfb144b17da39cc2ea64d5e227ad0d8"><td class="mdescLeft">&#160;</td><td class="mdescRight">Name of the balance-board input device. <br /></td></tr>
<tr class="separator:ga4cfb144b17da39cc2ea64d5e227ad0d8"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga5c30f3c5e94fa0eef6ddf005382783f6"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ga5c30f3c5e94fa0eef6ddf005382783f6"></a>
#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__kernel.html#ga5c30f3c5e94fa0eef6ddf005382783f6">XWII_NAME_PRO_CONTROLLER</a>&#160;&#160;&#160;XWII__NAME &quot; Pro Controller&quot;</td></tr>
<tr class="memdesc:ga5c30f3c5e94fa0eef6ddf005382783f6"><td class="mdescLeft">&#160;</td><td class="mdescRight">Name of the pro-controller input device. <br /></td></tr>
<tr class="separator:ga5c30f3c5e94fa0eef6ddf005382783f6"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<p>Kernel ABI constants. </p>
<p>Several constants and objects that are used by the kernel to communicate with user-space. These indirectly define the kernel ABI, which is guaranteed to be stable at all times. Note that the direct kernel ABI is defined through kernel headers. The ABI defined here extends it with information that we also guarantee to be stable but isn't part of the direct ABI.</p>
<p>The kernel ABI is almost complete abstracted by this library so these constants are only needed for integration into existing applications. You should try to avoid them and use them only if you need direct kernel access.</p>
<p>The kernel driver <b>hid-wiimote</b> provides connected Wii-Remotes, and all Nintendo or 3rd party devices that are compatible (including balance-boards, pro-controllers, gamepads, ...), as HID devices. All HID devices can be found in /sys/bus/hid/devices/. The kernel creates one directory for each device. A wiimote compatible device (<b>wiimote</b>) can be detected via normal udev-filters. The <b>subsystem</b> field is <b>hid</b> and the <b>driver</b> field is <b>wiimote</b>. If both match, the device is guaranteed to be handled by the hid-wiimote driver and compatible with this library.</p>
<p>Each wiimote provides several sub-devices as child-devices of the HID node. During device-setup and device-detection, the kernel sets up most of these nodes and sends a <b>change</b> event on the HID device after it is done. Userspace must react to this event by re-reading the device state. Otherwise, userspace might miss some nodes. For each hotpluggable sub-device (like extensions or motion-plus), the kernel attaches/detaches such nodes during runtime. Userspace must use udev-monitors to react to those events, if interested. All available interfaces on the HID device are explained below. From now on we assume that <code>/sys/bus/hid/devices/[dev]/</code> is a valid wiimote device.</p>
<h1>Global Interfaces </h1>
<p>The following interfaces are always present, regardless of the device-type and extension-type.</p>
<h2>devtype </h2>
<p>The HID device has a <b>devtype</b> attribute which can be found in <code>/sys/bus/hid/devices/[dev]/devtype</code>. This attribute provides a newline-terminated string which describes the device-type. If support for new devices is added to the kernel, new identifiers may be added. Valid values are:</p>
<ul>
<li><b>pending</b>: Device detection is not done, yet. The kernel will send a <b>change</b> uevent after it is done. A device must not be in this state for longer than a few hundred milliseconds.</li>
<li><b>unknown</b>: The device-type is unknown and couldn't be initialized. Such devices are normally useles and should be ignored by most applications.</li>
<li><b>generic</b>: The device-type could not be detected, but the device was successfully initialized. That means, most standard interfaces are available on this device, but may not function properly. Nearly all interfaces are enabled for such devices so no special policies apply.</li>
<li><b>gen1[num]</b>: First generation of Wii-Remotes. This is mostly <b>gen10</b>, but there are also 1st-gen devices with built-in motion-plus which might be reported as <b>gen15</b> or similar. Newer WiiRemotePlus devices with built-in motion-plus extensions belong to the 2nd-gen devices, though. Nearly all interfaces are enabled for such devices.</li>
<li><b>gen2[num]</b>: Second generation of Wii-Remotes. These are guaranteed to have motion-plus built-in and use a different bluetooth-chipset. Hence, there VID/PID changed and a few details differ to gen1 devices. Nearly all interfaces are enabled for such devices.</li>
<li><b>balanceboard</b>: Balance-boards and compatible devices. Nearly no interfaces are available on balance-boards. They are limited to an extension port (which is normally occupied by the balance-board extension), one LED and the battery interface. No MotionPlus is available.</li>
<li><b>procontroller</b>: Wii-U Pro Controller and compatible devices. Nearly no interfaces are available. One extension port is supported (which is normally occupied by the pro-controller extension), 4 LEDs and a battery. MotionPlus may be available but is currently not supported.</li>
</ul>
<p>Note that this attribute does not describe the extensions. Instead, it describes the type of device. So users might build custom extensions which allow a balance-board extension to be plugged on a regular WiiRemote. This would cause <b>devtype</b> to be <b>gen10</b> but <b>extension</b> to be <b>balanceboard</b>.</p>
<h2>extension </h2>
<p>An <b>extension</b> attribute is provided as <code>/sys/bus/hid/devices/[dev]/extension</code> and provides a newline-terminated string that describes the currently attached extension. New identifiers might be added if we add support for new extensions to the kernel driver. Note that normal Wii-Remotes provide a physical I2C extension port, but other devices might not. So if <b>devtype</b> reports a different device-type than a normal Wii-Remote, the extension might be built-in and not physically unpluggable. Valid values are:</p>
<ul>
<li><b>none</b>: No extension is plugged.</li>
<li><b>unknown</b>: An unknown extension is plugged or the driver failed to initialize it.</li>
<li><b>nunchuk</b>: A Nintendo Nunchuk extension is plugged.</li>
<li><b>classic</b>: A Classic Controller or Classic Controller Pro extension is plugged.</li>
<li><b>balanceboard</b>: A balance-board extension is plugged. This is normally a built-in extension.</li>
<li><b>procontroller</b>: A pro-controller extension is plugged. This is normally a built-in extension.</li>
</ul>
<h1>Device-dependant interfaces </h1>
<p>The following interfaces depend on the device-type. They may be present, depending on the device. However, not that even if they are present, they are not guaranteed to be physically available. For instance, many 3rd party-device pretend to have a built-in battery, but do not report real battery-capacity values. Instead they return a constant or fake value. All the following interfaces are created during device-detection. After device-detection is done, a <b>change</b> uevent is sent. Device-detection is normally performed only once, but may be triggered via debug-hooks from user-space at any time. Applications should be aware of that.</p>
<h2>Battery </h2>
<p>A <b>power_supply</b> device is available as <code>/sys/bus/hid/devices/[dev]/power_supply/wiimote_battery_[bdaddr]/</code> and the interface is defined by the kernel <b>power_supply</b> interface. <em>[bdaddr]</em> is the bluetooth-address of the remote device.</p>
<h2>LEDs </h2>
<p>Player-LEDs on a device are available as <code>/sys/bus/hid/devices/[dev]/leds/[dev]:blue:p[num]/</code> and the interface is defined by the kernel <b>led</b> interface. <em>[dev]</em> is the same as the device-name. <em>[num]</em> can be any non-negative integer and defines which LED this is. Normally these are 0-3 for the 4 player-LEDs which can be found on any Nintendo Remote. However, newer hardware may use more or less LEDs or skip some (unlikely).</p>
<h2>Input: Core </h2>
<p>Input-Core: Core input device. It is available as <code>/sys/bus/hid/device/[dev]/input/input[num]/</code> and can be detected via the device name <a class="el" href="group__kernel.html#ga63f760605babf3238d2075a2b8f94935">XWII_NAME_CORE</a>.</p>
<p>TODO: Describe the provided interface</p>
<h2>Input: Accelerometer </h2>
<p>Input-Accel: Accelerometer input device. Available as <code>/sys/bus/hid/device/[dev]/input/input[num]/</code> and can be detected via the device name <a class="el" href="group__kernel.html#gabd6fcb35096155e38041c58adddc1011">XWII_NAME_ACCEL</a>. If this input-interface is not opened by user-space, the accelerometer on the remote is disabled to save energy.</p>
<p>TODO: Describe the provided interface</p>
<h2>Input: IR </h2>
<p>IR input device. It is available as <code>/sys/bus/hid/device/[dev]/input/input[num]/</code> and can be detected via the device name <a class="el" href="group__kernel.html#ga7ff8b1875db579e5ca29d410d1d49c2d">XWII_NAME_IR</a>. If this input-interface is not opened by user-space, the IR-cam on the remote is disabled to save energy.</p>
<p>TODO: Describe the provided interface</p>
<h1>Motion-Plus Interfaces </h1>
<p>The following interfaces belong to motion-plus capabilities. Motion-Plus extension may be hotplugged or built-in. Even if built-in, they are handled as special hotplugged extensions. So if you want to use Motion-Plus, you must handle uevents properly. As MotionPlus hotplug events are not generated by the device, the kernel driver needs to periodically poll for them (only if not built-in). Hence, hotplug-events may be delayed by up to 5s. MotionPlus and related hardware is often abbreviated with <b>MP</b> or **M+**.</p>
<h2>Input: MP </h2>
<p>Motion-Plus input device. Is is available as <code>/sys/bus/hid/device/[dev]/input/input[num]/</code> and can be detected via the device name <a class="el" href="group__kernel.html#ga94d4f435cca23a94fcf9b8d1dc3c8179">XWII_NAME_MOTION_PLUS</a>. If this input-interface is not opened by user-space, the MP device is disabled to save energy. While the interface is opened, MP hardware hotplug events are generated by the remote device so we don't need to poll for MP availability.</p>
<p>TODO: Describe the provided interface</p>
<h1>Extension Interfaces </h1>
<p>The following interfaces are extension interfaces. They are created whenever an extension is hotplugged to a device. Only one extension-port is currently available on each hardware (exposed via <b>extension</b> attribute), but newer hardware may introduce more ports. Therefore, these extension might be available simultaneously. However, in this case additional <b>extension2</b> or similar attributes will also be introduced. Note that some devices have built-in extensions which cannot be hotplugged. But these extensions are handled as if they were normal hotpluggable extensions.</p>
<p>Extension-changes are advertized via udev uevents. The remote device sends hotplug-events for regular extensions so they are deteced immediately (in a few hundred milliseconds). Note that devices are not initialized unless userspace opens them. This saves energy as we don't need to power them up or stream any data.</p>
<h2>Input: Nunchuk </h2>
<p>Nunchuk extension input device. Available as <code>/sys/bus/hid/device/[dev]/input/input[num]/</code> and can be detected via the device name <a class="el" href="group__kernel.html#gab8774aa7766ab02d01014201cb0ce553">XWII_NAME_NUNCHUK</a>.</p>
<p>TODO: Describe the provided interface</p>
<h2>Input: Classic Controller </h2>
<p>Classic Controller extension input device. Available as <code>/sys/bus/hid/device/[dev]/input/input[num]/</code> and can be detected via the device name <a class="el" href="group__kernel.html#gac1af11a16cd162b73868080582f107bf">XWII_NAME_CLASSIC_CONTROLLER</a>. The Classic Controller Pro is also reported via this interface, but cannot be distinguished from a normal classic controller extension.</p>
<p>TODO: Describe the provided interface</p>
<h2>Input: Balance Board </h2>
<p>BalanceBoard extension input device. Available as <code>/sys/bus/hid/device/[dev]/input/input[num]/</code> and can be detected via the device name <a class="el" href="group__kernel.html#ga4cfb144b17da39cc2ea64d5e227ad0d8">XWII_NAME_BALANCE_BOARD</a>.</p>
<p>TODO: Describe the provided interface</p>
<h2>Input: Pro Controller </h2>
<p>Wii-U Pro Controller extension input device. Available as <code>/sys/bus/hid/device/[dev]/input/input[num]/</code> and can be detected via the device name <a class="el" href="group__kernel.html#ga5c30f3c5e94fa0eef6ddf005382783f6">XWII_NAME_PRO_CONTROLLER</a>.</p>
<p>TODO: Describe the provided interface </p>
</div><!-- contents -->
</div><!-- doc-content -->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
  <ul>
    <li class="footer">Generated on Mon Jan 4 2016 12:47:27 for xwiimote by
    <a href="http://www.doxygen.org/index.html">
    <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.8.11 </li>
  </ul>
</div>
</body>
</html>