pax_global_header00006660000000000000000000000064121747660510014523gustar00rootroot0000000000000052 comment=2bc2942a553733585432d54c262cb454d21de212 xwiimote-2/000077500000000000000000000000001217476605100130735ustar00rootroot00000000000000xwiimote-2/.gitignore000066400000000000000000000006631217476605100150700ustar00rootroot00000000000000# Ignore generated files driver/.tmp_versions driver/Module.symvers driver/modules.order driver/.*.cmd driver/*.ko driver/*.mod.c driver/*.o *.swp *.o *.lo *.la Makefile Makefile.in aclocal.m4 autom4te.cache/ build-aux/ config.h config.h.in config.h.in~ config.log config.status configure *.tar.bz2 *.tar.xz libtool m4/ stamp-* .deps .dirstamp .libs xwiidump xwiishow xwiikeymap libxwiimote.pc doc/Doxyfile doc/html/ doc/stamp-doxygen xwiimote-2/COPYING000066400000000000000000000014321217476605100141260ustar00rootroot00000000000000= Licensing Information = This software package is licensed under a MIT-like license. See LICENSE for the licensing terms. This applies to all files (code, documentation, ...) shipped with this distribution. If a specific file has no license header, the header in LICENSE shall apply. If a file has a license header which differs from LICENSE, then the license terms specified in this file shall apply. == Developers == This software is written by: David Herrmann - dh.herrmann@gmail.com == Contributors == This project could not have been realized without several other software projects. We are very grateful to the following people and projects for their contributions: Linux Kernel - http://www.kernel.org BlueZ - http://www.bluez.org WiiBrew Project - http://www.wiibrew.org/ xwiimote-2/DEV000066400000000000000000000010371217476605100134350ustar00rootroot00000000000000= Development = This file contains information about the development of this software package. This contains no information for end-users. == Git == This software is developed in a git-repository hosted by github: https://github.com/dvdhrm/xwiimote The related linux device driver development is hosted at kernel.org: http://git.kernel.org The driver is developed upstream. Discussion takes place at linux-input@vger.kernel.org == Changelog == There is no classic changelog file. See the git history for a comprehensive changelog. xwiimote-2/LICENSE000066400000000000000000000021221217476605100140750ustar00rootroot00000000000000XWiimote License: Copyright (c) 2011-2013 David Herrmann Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. xwiimote-2/Makefile.am000066400000000000000000000051561217476605100151360ustar00rootroot00000000000000# # XWiimote - makefile # Written by David Herrmann, 2011-2013 # Dedicated to the Public Domain # # # Library Version Numbers # LIBXWIIMOTE_CURRENT = 2 LIBXWIIMOTE_REVISION = 0 LIBXWIIMOTE_AGE = 0 # # miscellaneous # ACLOCAL_AMFLAGS = -I m4 ${ACLOCAL_FLAGS} AM_MAKEFLAGS = --no-print-directory AUTOMAKE_OPTIONS = color-tests AM_DISTCHECK_CONFIGURE_FLAGS = --enable-debug SUBDIRS = . .DELETE_ON_ERROR: # # Distribution includes # EXTRA_DIST = \ README \ COPYING \ DEV \ LICENSE \ res/50-xorg-fix-xwiimote.conf \ libxwiimote.sym # # Build targets # lib_LTLIBRARIES = libxwiimote.la bin_PROGRAMS = xwiishow noinst_PROGRAMS = xwiidump include_HEADERS = lib/xwiimote.h man_MANS = \ doc/xwiimote.7 \ doc/libxwiimote.7 \ doc/xwiishow.1 EXTRA_DIST += $(man_MANS) pkgconfigdir = $(libdir)/pkgconfig pkgconfig_DATA = libxwiimote.pc EXTRA_DIST += \ $(pkgconfig_DATA) \ libxwiimote.pc.in # # Default c/l-flags # AM_CFLAGS = \ -Wall \ -pipe \ -fno-common \ -ffast-math \ -fdiagnostics-show-option \ -fno-strict-aliasing \ -fvisibility=hidden \ -ffunction-sections \ -fdata-sections \ -fstack-protector AM_CPPFLAGS = \ -include $(top_builddir)/config.h \ -I $(srcdir)/lib \ -D'XWII__EXPORT=__attribute__((visibility("default")))' AM_LDFLAGS = \ -Wall \ -Wl,--as-needed \ -Wl,--gc-sections \ -Wl,-z,relro \ -Wl,-z,now if DEBUG AM_CFLAGS += -O0 -g else AM_CFLAGS += -O2 endif # # libxwiimote # libxwiimote_la_SOURCES = \ lib/xwiimote.h \ lib/core.c \ lib/monitor.c EXTRA_libxwiimote_la_DEPENDENCIES = ${top_srcdir}/libxwiimote.sym libxwiimote_la_CPPFLAGS = \ $(AM_CPPFLAGS) \ $(UDEV_CFLAGS) libxwiimote_la_LIBADD = \ $(AM_LIBADD) \ $(UDEV_LIBS) libxwiimote_la_LDFLAGS = \ $(AM_LDFLAGS) \ -version-info $(LIBXWIIMOTE_CURRENT):$(LIBXWIIMOTE_REVISION):$(LIBXWIIMOTE_AGE) \ -Wl,--version-script=$(top_srcdir)/libxwiimote.sym # # xwiishow # xwiishow_SOURCES = \ tools/xwiishow.c xwiishow_CPPFLAGS = \ $(AM_CPPFLAGS) \ $(NCURSES_CFLAGS) xwiishow_LDADD = \ $(NCURSES_LIBS) \ libxwiimote.la \ -lm xwiishow_LDFLAGS = \ $(AM_LDFLAGS) # # xwiidump # xwiidump_SOURCES = \ tools/xwiidump.c xwiidump_CPPFLAGS = \ $(AM_CPPFLAGS) xwiidump_LDFLAGS = \ $(AM_LDFLAGS) # # doxygen # if HAVE_DOXYGEN doc: doc/stamp-doxygen clean-doc: clean-doxygen all-local:: doc clean-local:: clean-doc doc/stamp-doxygen: $(top_srcdir)/lib/xwiimote.h $(AM_V_GEN)$(DOXYGEN) doc/Doxyfile $(AM_V_at)touch $@ clean-doxygen: $(AM_V_at)rm -vrf doc/html doc/stamp-doxygen install-data-local:: doc $(MKDIR_P) $(DESTDIR)$(htmldir) $(INSTALL_DATA) doc/html/* $(DESTDIR)$(htmldir) uninstall-local:: rm -rf $(DESTDIR)$(htmldir) endif # HAVE_DOXYGEN xwiimote-2/README000066400000000000000000000106531217476605100137600ustar00rootroot00000000000000Overview {#mainpage} ======== xwiimote is an open-source device driver for Nintendo Wii / Wii U remotes. It contains tools and libraries which work together with the official hid-wiimote kernel driver, available since linux-3.1. If you want to use a Nintendo Wii Remote or any compatible device (including the Nintendo Wii Balance Board, Nintendo Wii U Pro Controller, and more) on your linux system, the xwiimote software stack provides everything you need. This distribution is hosted at: http://dvdhrm.github.io/xwiimote Use this website to contact the maintainers or developers or to file bug reports. Install ======= To install the libxwiimote.so library and the related tools, use: $ ./configure [--enable-debug] [--prefix=/usr] $ make $ make install If "configure" is not available, use: $ ./autogen.sh [] Dependencies: - libudev: Used for device enumeration - ncurses: Used for UI of xwiishow This software packages contains: libxwiimote.so: A userspace library which helps accessing connected Wii Remotes in the system. It can be used by applications to use Wii Remotes as input. You can also use the direct kernel interface, though. xwiishow: A test application which lists all connected Wii Remotes. If a Wii Remote is passed as argument, it continuously reads input from the device and prints it to the screen. 50-xorg-fix-xwiimote.conf: X configuration file which should be installed into /etc/X11/xorg.conf.d/ by your distribution. It adds all Wii Remotes to the input blacklist of the X-server. This is needed since the raw Wii Remote kernel interface is useless (even irritating) to the X-server. Instead the xf86-input-xwiimote driver should be used. manpages: Several manpages are provided. One overview page and several other pages for each tool and feature. They are installed by the autotools scripts automatically alongside the library and applications. The following tools are available but not installed into the system: xwiidump: A test application which reads the EEPROM memory of a connected Wii Remote and prints it to stdout. This requires debugfs support in the kernel and the hid-wiimote kernel module. Following software is not part of this package: hid-wiimote.ko: The wiimote kernel module is available in the official linux kernel sources and should already be installed in your system if you run linux-3.1 or newer. wiimote.so: The BlueZ bluetoothd wiimote plugin is part of the upstream BlueZ package and available since bluez-4.96. It should be already installed on your system. Usage ===== Please see the website for help: http://dvdhrm.github.io/xwiimote Documentation ============= ./doc/website/index.html: Official website of XWiimote and documentation ./doc/*.3: Manpages ./doc/DEVICES: Enumeration of all Nintendo Wii / Wii U related devices ./doc/DEV_*: Device communication/protocol descriptions Development =========== Please see ./DEV for development information. Copying ======= Please see ./COPYING for more information. Compatibility ============= Two other commonly used Wii-Remote libraries are cwiid and wiiuse. Both provide a full user-space driver and were used heavily in the past. We do not provide API compatibility to them as both APIs are very restricted: - cwiid: This API is highly asynchronous with threads. It does not allow a single-threaded application to use it. This makes it very hard to use and we decided not to provide a compatibility layer as we do not want to support such library-API designs. - wiiuse: This API is tightly bound to the idea that the application is supposed to discover and connect the Bluetooth devices. It uses a static array for all used Wii Remotes and requires callbacks for notification. Same as cwiid, we do not provide a compatibility layer as the API is very different from our API. We designed our API to have as few restrictions as possible. We do not force an application to use a special programming technique. Instead, an application can use our API to support event-based, callback-based or thread-based event-loops or any other kind that it wants. We achieve this by keeping the user-space API very similar to the kernel-API so the application can integrate this into any infrastructure it wants. Contact ======= Website: http://dvdhrm.github.io/xwiimote For email contact please see ./COPYING for a list of contributors or write an email to the current maintainer at: dh.herrmann@gmail.com xwiimote-2/autogen.sh000077500000000000000000000003511217476605100150730ustar00rootroot00000000000000#!/bin/sh # # XWiimote - Generate Build Files # Written by David Herrmann, 2011 # Dedicated to the Public Domain # set -e mkdir -p m4/ autoreconf -i if test ! "x$NOCONFIGURE" = "x1" ; then ./configure --enable-debug $* fi xwiimote-2/configure.ac000066400000000000000000000044501217476605100153640ustar00rootroot00000000000000# # XWiimote - configure # Written by David Herrmann, 2011 # Dedicated to the Public Domain # AC_PREREQ(2.68) AC_INIT([xwiimote], [2], [http://github.com/dvdhrm/xwiimote/issues], [xwiimote], [http://dvdhrm.github.io/xwiimote]) AC_CONFIG_SRCDIR([lib/xwiimote.h]) AC_CONFIG_AUX_DIR([build-aux]) AC_CONFIG_MACRO_DIR([m4]) AC_CONFIG_HEADER(config.h) AC_USE_SYSTEM_EXTENSIONS AC_SYS_LARGEFILE AM_INIT_AUTOMAKE([foreign 1.11 subdir-objects dist-xz no-dist-gzip tar-pax -Wall -Werror -Wno-portability]) AM_SILENT_RULES([yes]) # Don't add a default "-g -O2" if CFLAGS wasn't specified : ${CFLAGS=""} AC_PROG_CC AC_PROG_CC_C99 AM_PROG_CC_C_O m4_ifdef([AM_PROG_AR], [AM_PROG_AR]) LT_PREREQ(2.2) LT_INIT PKG_CHECK_MODULES([UDEV], [libudev]) AC_SUBST(UDEV_CFLAGS) AC_SUBST(UDEV_LIBS) PKG_CHECK_MODULES([NCURSES], [ncurses]) AC_SUBST(NCURSES_CFLAGS) AC_SUBST(NCURSES_LIBS) AC_MSG_CHECKING([whether to build with debugging on]) AC_ARG_ENABLE([debug], [AS_HELP_STRING([--enable-debug], [whether to build with debugging on)])], [debug="$enableval"], [debug=no; AC_DEFINE([NDEBUG], [1], [No Debug])]) AM_CONDITIONAL([DEBUG], [test x$debug = xyes]) AC_MSG_RESULT([$debug]) # # Check for doxygen # AC_ARG_VAR([DOXYGEN], [Path to doxygen command]) AC_ARG_WITH(doxygen, AS_HELP_STRING([--with-doxygen], [Use doxygen to generate documentation]), [use_doxygen=$withval], [use_doxygen=auto]) have_doxygen=no if test ! "x$use_doxygen" = "xno" ; then AC_PATH_PROG([DOXYGEN], [doxygen]) if test "x$DOXYGEN" = "x" ; then if test "x$use_doxygen" = "xyes" ; then AC_MSG_ERROR([--with-doxygen=yes specified but doxygen not found in PATH]) fi else have_doxygen=yes fi fi AM_CONDITIONAL([HAVE_DOXYGEN], [test "$have_doxygen" = yes]) # # Write configuration # AC_CONFIG_FILES([Makefile libxwiimote.pc doc/Doxyfile]) AC_OUTPUT AC_MSG_NOTICE([Build configuration: prefix: $prefix exec-prefix: $exec_prefix libdir: $libdir includedir: $includedir debug: $debug doxygen: $have_doxygen Run "${MAKE-make}" to start compilation process]) xwiimote-2/doc/000077500000000000000000000000001217476605100136405ustar00rootroot00000000000000xwiimote-2/doc/DEVICES000066400000000000000000000273241217476605100146550ustar00rootroot00000000000000= Nintendo Wii Devices = Nintendo produced many different devices for their Wii and Wii-U products. This file tries to list and describe all of these sorted by their model number. As there is no official documentation by Nintendo, there is no guarantee that this list is complete or correct. Feedback and contributions are welcome! This file tries to describe which devices exist and how their look differs from each other depending on the model number. However, this file does not describe any wire/wireless protocols or other software behavior. This file only describes the mechanics and physical views of the devices. See the DEV_* files for further information and communication details. == Device Identification == On each device you can always find a model number like "RVL-003", "WUP-005", ... These are always present and identify the type of device. However, there might be multiple revisions of a device that behave differently even though they have the same model number. Hence, you can often find additional numbers that identify the device revision. But these numbers aren't found on all devices and might be inconsistent. We haven't exactly figured out what all of these mean and we need much more data from people who own such devices. Therefore, please notify us if you have different devices that aren't listed here so we can extend this list continously. == Device List == Following a list of all devices with their respective model number and other device identifications. First, a list of Wii related products, then Wii U products. Many products work with both, Wii and Wii U, but Nintendo uses a different numbering scheme so we split them up here. === Nintendo Wii Products === Wii products have model numbers starting with "RVL". It probably stands for "ReVoLution" which was the codename of the Wii. RVL-001 Product: Wii Console Label: Wii Model: RVL-001 (EUR) Revision: C/RVL-EUR-1 Color: Black Year: 2006 Description: This is the Wii console. It exists in different colors but they seem to be the same hardware otherwise. It is unclear whether it was revised for multiple revisions or whether they differ according to the country-code. No differences have been discovered and it seems safe to assume that they are all the same. Additional Numbers: >ABS+PMMA< RVL-002 Product: Wii Console Power Supply Label: Wii Power Supply Model: RVL-002 (EUR) Revision: C/RVL-A-AD-EUR Color: Grey Year: 2006 Description: The main power supply for the Wii Console. The cold-plug differs depending on the country-code. No other differences have been found. Additional Numbers: D9PKU22 RVL-003 Product: Wii Remote Label: Wii Model: RVL-003 Revision: RVL(F)-1 Color: White Year: 2006 Description: This is the first Wii Remote controller that was produced together with the main console. No country-code has been found and only one revision is known. This is the version _without_ the builtin Motion Plus peripheral. Additional Numbers: B1UF123 >ABS< f7-4 [R] 204NY20600402 RVL-004 Product: Wii Remote Nunchuck Extension Label: Model: RVL-004 Revision: Color: White, Black Year: 2006 Description: The Nunchuck is an extension controller for the Wii Remote. It is connected with a cable and features 2 buttons and a joystick. No country-codes are known, neither does it have a revision number. Even the ACN code seems to be equal between all devices so there was probably only one type produced and never been revised. Additional Numbers: RVL-005 Product: Wii Remote Classic Controller Extension RVL-006 Product: Wii Optical Disc RVL-007 Product: Wii Optical Disc Case RVL-008 RVL-009 Product: Wii Cinch A/V Cable Label: Model: RVL-009 Revision: Color: Grey Year: 2006 Description: Standard connector for the Wii Console to a TV via analog signal. 6 pins on both ends. Simple adapter for A/V-Multi-Out to 3 cable cinch. Additional Numbers: RVL-010 Product: Wii S-Video S-VHS A/V Cable RVL-011 Product: Wii Component A/V Cable RVL-012 Product: Wii D-Terminal A/V Cable RVL-013 Product: Wii RGB A/V Cable RVL-014 Product: Wii Sensor Bar Label: Wii Sensor Bar Model: RVL-014 Revision: Color: Grey/Black Year: 2006 Description: Standard sensor bar with cable to connect to the console. The connector features 3 pins, but probably only 2 are used. The sensor bar has LEDs on both sides which are used to send infrared signals to the Wii Remotes for location tracking. Additional Numbers: RVL-015 Product: Wii USB Ethernet Adapter RVL-016 Product: Wii Sensor Bar Stand Label: Model: RVL-016 Revision: Color: Transparent/Grey Year: 2006 Description: Stand for Wii Sensor Bar. Additional Numbers: RVL-017 Product: Wii Console Stand Label: Wii Model: RVL-017 Revision: Color: Grey/Black Year: 2006 Description: Stand for Wii Console so the Console can stand safely on its side. Additional Numbers: RVL-018 Product: Wii Remote Wrist Strap Label: Model: RVL-018 Revision: Color: Grey Year: 2006 Description: Wrist strap for the Wii Remote. Comes in different colors and looks but always has the same model number. Additional Numbers: >ABS< m1-8 (found on white RVL-003) >ABS< H1-7 (found on white RVL-036 early revision) >ABS< t1-9 (found on black RVL-036 early revision) >ABS< m1E-8 (found on cyan RVL-036 late revision) RVL-019 Product: Wii Console Stand Plate Label: Model: RVL-019 Revision: Color: Transparent Year: 2006 Description: Stand plate for RVL-017 Wii Mounting. Additional Numbers: >PC< f5-1 RVL-020 Product: Wii SD-Memory Card 512 MB RVL-021 Product: Wii Balance Board RVL-022 Product: Wii Remote Jacket Label: Model: RVL-022 Revision: Color: Transparent, Black Year: 2006 Description: Jacket for Wii Remotes. Exists in different revisions. One for the classic RVL-003 remote, one for the new RVL-036 remote with gap for the sync-button. Additional Numbers: >VMQ< ma13-6 (without Sync-button gap) >VMQ< ha62-6 (with Sync-button gap) RVL-023 Product: Wii Zapper RVL-024 Product: Wii Wheel Label: Model: RVL-024 Revision: RVL-A-J-EUR Color: White Year: Description: Wheel peripheral for Wii Remotes. Additional Numbers: RVL-025 Product: Wii Balance Board Foot Extensions RVL-026 Product: Wii Motion Plus Extension Label: Model: RVL-026 Revision: Color: White Year: Description: Motion Plus extension for standard Wii Remote. Additional Numbers: C98M201 RVL-027 Product: Wii Remote with Motion Plus Jacket Label: Model: RVL-027 Revision: Color: Transparent Year: Description: Like the normal jacket RVL-022 but big enough for Wii Remotes with the Motion Plus extension attached. Additional Numbers: >VMQ< Lma51-1 RVL-028 RVL-029 Product: Wii Speak RVL-030 Product: Wii Lenses Cleaning Disk RVL-031 Product: Wii Lenses Cleaning Liquid RVL-032 Product: Wii Lenses Cleaning Pad RVL-033 Product: Wii SD Memory Card 2GB RVL-034 Product: Wii Cleaning Pad RVL-035 RVL-036 Product: Wii Remote Plus Label: Wii Model: RVL-036 Revisions: LMA-RVL-WR/M-C0 (White, early revision) LMB-RVL-WR/F-C0 (Black, early revision) LMA-RVL-WR/Z-C4 (Cyan, late revision) Color: White, Black, Cyan Year: Description: Wii Remote with built-in motion plus extension. Comes in two different revisions. One is mostly the same as the old Wii Remote RVL-003 with a plugged in Motion Plus extension. The late revision has changed a bit. It is more strict about the protocol, advertises a different name and changes some other bits. It seems like it is a whole new revision of the Wii Remote with the Motion Plus sensor really built-in instead of only attached internally. It also changed the Bluetooth chip from Broadcom to CSR, which explains why it differs so much. Probably also comes with different bug-fixes and _may_ contain compatibility fixes for the Wii-U. Additional Numbers: White, early revision: [R] 011WWA100008 D8RT510 >ABS< M5-1 Black, early revision: [R] 204WW21004200 D05F210 >ABS< f9-3 Cyan, late revision: [R] 007WWCUL0716 F1DTE40 >ABS< M1-2 === Nintendo Wii U Products === Wii U products have model numbers starting with "WUP". It may stand for "Wii U Project". WUP-001 Product: Wii U Console Label: Wii U Model: WUP-001(03) (white, 8GB) Revision: LTA1-WUP-S-EUR-C0 (white, 8GB) Color: White Year: 2012 Description: Wii U Console. Available in different colors and with different amount of internal storage. Apart from that, no differences were found. Additional Numbers: CA1-AGGA01 WUP-002 Product: Wii U AC Adapter Label: Wii U AC Adapter Model: WUP-002 (EUR) Revision: WUP-A-ADMM-EUR-C0 Color: Grey Year: 2012 Description: AC Adapter for main Wii U Console Additional Numbers: MKF913J01 WUP-003 WUP-004 WUP-005 Product: Wii U Pro Controller Label: Model: WUP-005 Revision: LTB-WUP-A-RC-EUR-C0 Color: Black Year: 2012 Description: Additional Numbers: F0TM101 WUP-006 WUP-007 WUP-008 Product: Wii HDMI Cable Label: Model: WUP-008 Revision: Color: Grey Year: 2012 Description: Wii U HDMI cable for audio/video transmission. Additional Numbers: WUP-009 WUP-010 Product: Wii U Gamepad Label: Wii U Model: WUP-010 (EUR) Revision: LTA-WUP-A-DH-EUR-C0 Color: White Year: 2012 Description: Gamepad for Wii U Console. Additional Numbers: BAA1-AA01 WUP-011 Product: Wii U Gamepad AC Adapter Label: AC Adapter Model: WUP-011 (EUR) Revision: WUP-A-ADMM-EUR-P0 Color: Grey Year: 2012 Description: AC Adapter for Wii U Gamepad. Additional Numbers: MFF906J01 WUP-012 WUP-013 WUP-014 WUP-015 Product: Wii U Gamepad Stylus Label: Model: WUP-015 Revision: Color: White Year: 2012 Description: Stylus pen found on the back of the Wii U Gamepad. Additional Numbers: t12 WUP-016 WUP-017 WUP-018 Product: Wii U Pro Controller USB Cable Label: Model: WUP-018 Revision: Color: Grey Year: 2012 Description: USB-Cable for Wii U Pro Controller for charging. Additional Numbers: xwiimote-2/doc/DEV_REMOTE000066400000000000000000000124671217476605100152660ustar00rootroot00000000000000= Nintendo Wii Remote Devices = The Wii Remote that was shipped with the Wii Console in late 2006 was the first peripheral with a new protocol and behavior. Later, many other mostly compatible devices were produced by Nintendo. This file tries to describe the behavior and software internals of all Wii Remote compatible devices. This information was gathered via reverse-engineering so it may contain errors. This file applies to: RVL-003: Wii Remote RVL-036: Wii Remote Plus WUP-005: Wii U Pro Controller == Stuff == Devices: 00:1E:35:3B:7E:6D: Wii Remote (white) 78:A2:A0:DD:F6:8A: Wii Remote Plus (white, early revision) D8:6B:F7:0D:3C:78: Wii Remote Plus (black, early revision) 2C:10:C1:B8:84:40: Wii Remote Plus (cyan, late revision) 34:AF:2C:18:AC:99: Wii U Pro Controller (black) Inquiry: $ hcitool inq 00:1E:35:3B:7E:6D clock offset: 0x0aa5 class: 0x002504 78:A2:A0:DD:F6:8A clock offset: 0x2e7c class: 0x002504 D8:6B:F7:0D:3C:78 clock offset: 0x4fbf class: 0x002504 2C:10:C1:B8:84:40 clock offset: 0x67c9 class: 0x000508 34:AF:2C:18:AC:99 clock offset: 0x3e97 class: 0x000508 Class 0x002504: - Major Service Class: - Limited Discoverable Mode - Major Device Class: - Peripheral (mouse, joystick, keyboard, ...) - Minor Device Class: - Joystick Class 0x000508: - Major Service Class: - (no flags set) - Major Device Class: - Peripheral (mouse, joystick, keyboard, ...) - Minor Device Class: - Gamepad $ hcitool info 00:1E:35:3B:7E:6D Requesting information ... BD Address: 00:1E:35:3B:7E:6D Device Name: Nintendo RVL-CNT-01 LMP Version: 1.2 (0x2) LMP Subversion: 0x229 Manufacturer: Broadcom Corporation (15) Features: 0xbc 0x02 0x04 0x38 0x08 0x00 0x00 0x00 $ hcitool info 78:A2:A0:DD:F6:8A $ hcitool info D8:6B:F7:0D:3C:78 Requesting information ... BD Address: 78:A2:A0:DD:F6:8A Device Name: Nintendo RVL-CNT-01 LMP Version: 2.0 (0x3) LMP Subversion: 0x31c Manufacturer: Broadcom Corporation (15) Features: 0xbc 0x02 0x04 0x38 0x08 0x00 0x00 0x00 $ hcitool info 2C:10:C1:B8:84:40 Requesting information ... BD Address: 2C:10:C1:B8:84:40 Device Name: Nintendo RVL-CNT-01-TR LMP Version: 2.0 (0x3) LMP Subversion: 0x1d8d Manufacturer: Cambridge Silicon Radio (10) Features: 0xbc 0x02 0x04 0x38 0x08 0x00 0x00 0x00 $ hcitool info 34:AF:2C:18:AC:99 Requesting information ... BD Address: 34:AF:2C:18:AC:99 Device Name: Nintendo RVL-CNT-01-UC LMP Version: 2.0 (0x3) LMP Subversion: 0x1d8d Manufacturer: Cambridge Silicon Radio (10) Features: 0xbc 0x02 0x04 0x38 0x08 0x00 0x00 0x00 == Connection Procedure == - Pressing red "sync" button on Wii Remote - 20s in discoverable mode with IAC=0x9e8b00 (LIAC) (not GIAC!) - Pressing red "sync" button on Wii Console - Wii performs BT inquiry with IAC=LIAC only. No GIAC devices are found! - use: hciconfig hci0 iac liac - Wii initiates baseband ACL connection to found devices - No role switch is performed - The Wii allows the device to switch to master - The remotes don't allow any role-switch - reading features/name can be done now: - Wii Console: Features: 0xff 0xff 0x8d 0xfe 0x9b 0xf9 0x00 0x80 bdaddr: A4:5C:27:DE:DC:B8 name: 'Wii' - Wii now opens l2cap channel on PSM 1 (SDP) - Must be accepted, otherwise Wii will disconnect - Wii requests MTU: 256 FlushTO: 65535 - Wii now performs SDP queries on this new channel: - asks for HID entry handle - then asks for attribute IDs on this handle - then reads all these attribute IDs at once - the whole WiiRemote HID SDP entry must be returned correctly - Wii then closes the SDP l2cap channel - If the HID SDP record was correctly parsed by the Wii, it assumes that the remote device is a valid WiiRemote. No other validation is known to be required. That is, no bdaddr-verification, no device-name comparison, no device-class tests, ... - Wii opens HID control channel l2cap PSM 17/0x11 - Must be accepted - Wii requests MTU: 640 FlushTO: 65535 - Wii now requests authentication - if no link-key exists, a PIN must be provided by both devices - PIN is the raw BD-Address of the Wii Console (6 bytes, big-endian) - (if connected non-permanently via Wii-Menu, PIN is the address of the Wii Remote instead of the Wii Console) - TBD xwiimote-2/doc/Doxyfile.in000066400000000000000000002355231217476605100157650ustar00rootroot00000000000000# Doxyfile 1.8.4 # This file describes the settings to be used by the documentation system # doxygen (www.doxygen.org) for a project. # # All text after a double hash (##) is considered a comment and is placed # in front of the TAG it is preceding . # All text after a hash (#) is considered a comment and will be ignored. # The format is: # TAG = value [value, ...] # For lists items can also be appended using: # TAG += value [value, ...] # Values that contain spaces should be placed between quotes (" "). #--------------------------------------------------------------------------- # Project related configuration options #--------------------------------------------------------------------------- # This tag specifies the encoding used for all characters in the config file # that follow. The default is UTF-8 which is also the encoding used for all # text before the first occurrence of this tag. Doxygen uses libiconv (or the # iconv built into libc) for the transcoding. See # http://www.gnu.org/software/libiconv for the list of possible encodings. DOXYFILE_ENCODING = UTF-8 # The PROJECT_NAME tag is a single word (or sequence of words) that should # identify the project. Note that if you do not use Doxywizard you need # to put quotes around the project name if it contains spaces. PROJECT_NAME = @PACKAGE_NAME@ # The PROJECT_NUMBER tag can be used to enter a project or revision number. # This could be handy for archiving the generated documentation or # if some version control system is used. PROJECT_NUMBER = @PACKAGE_VERSION@ # Using the PROJECT_BRIEF tag one can provide an optional one line description # for a project that appears at the top of each page and should give viewer # a quick idea about the purpose of the project. Keep the description short. PROJECT_BRIEF = # With the PROJECT_LOGO tag one can specify an logo or icon that is # included in the documentation. The maximum height of the logo should not # exceed 55 pixels and the maximum width should not exceed 200 pixels. # Doxygen will copy the logo to the output directory. PROJECT_LOGO = # The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute) # base path where the generated documentation will be put. # If a relative path is entered, it will be relative to the location # where doxygen was started. If left blank the current directory will be used. OUTPUT_DIRECTORY = doc # If the CREATE_SUBDIRS tag is set to YES, then doxygen will create # 4096 sub-directories (in 2 levels) under the output directory of each output # format and will distribute the generated files over these directories. # Enabling this option can be useful when feeding doxygen a huge amount of # source files, where putting all generated files in the same directory would # otherwise cause performance problems for the file system. CREATE_SUBDIRS = NO # The OUTPUT_LANGUAGE tag is used to specify the language in which all # documentation generated by doxygen is written. Doxygen will use this # information to generate all constant output in the proper language. # The default language is English, other supported languages are: # Afrikaans, Arabic, Brazilian, Catalan, Chinese, Chinese-Traditional, # Croatian, Czech, Danish, Dutch, Esperanto, Farsi, Finnish, French, German, # Greek, Hungarian, Italian, Japanese, Japanese-en (Japanese with English # messages), Korean, Korean-en, Latvian, Lithuanian, Norwegian, Macedonian, # Persian, Polish, Portuguese, Romanian, Russian, Serbian, Serbian-Cyrillic, # Slovak, Slovene, Spanish, Swedish, Ukrainian, and Vietnamese. OUTPUT_LANGUAGE = English # If the BRIEF_MEMBER_DESC tag is set to YES (the default) Doxygen will # include brief member descriptions after the members that are listed in # the file and class documentation (similar to JavaDoc). # Set to NO to disable this. BRIEF_MEMBER_DESC = YES # If the REPEAT_BRIEF tag is set to YES (the default) Doxygen will prepend # the brief description of a member or function before the detailed description. # Note: if both HIDE_UNDOC_MEMBERS and BRIEF_MEMBER_DESC are set to NO, the # brief descriptions will be completely suppressed. REPEAT_BRIEF = YES # This tag implements a quasi-intelligent brief description abbreviator # that is used to form the text in various listings. Each string # in this list, if found as the leading text of the brief description, will be # stripped from the text and the result after processing the whole list, is # used as the annotated text. Otherwise, the brief description is used as-is. # If left blank, the following values are used ("$name" is automatically # replaced with the name of the entity): "The $name class" "The $name widget" # "The $name file" "is" "provides" "specifies" "contains" # "represents" "a" "an" "the" ABBREVIATE_BRIEF = # If the ALWAYS_DETAILED_SEC and REPEAT_BRIEF tags are both set to YES then # Doxygen will generate a detailed section even if there is only a brief # description. ALWAYS_DETAILED_SEC = NO # If the INLINE_INHERITED_MEMB tag is set to YES, doxygen will show all # inherited members of a class in the documentation of that class as if those # members were ordinary class members. Constructors, destructors and assignment # operators of the base classes will not be shown. INLINE_INHERITED_MEMB = NO # If the FULL_PATH_NAMES tag is set to YES then Doxygen will prepend the full # path before files name in the file list and in the header files. If set # to NO the shortest path that makes the file name unique will be used. FULL_PATH_NAMES = YES # If the FULL_PATH_NAMES tag is set to YES then the STRIP_FROM_PATH tag # can be used to strip a user-defined part of the path. Stripping is # only done if one of the specified strings matches the left-hand part of # the path. The tag can be used to show relative paths in the file list. # If left blank the directory from which doxygen is run is used as the # path to strip. Note that you specify absolute paths here, but also # relative paths, which will be relative from the directory where doxygen is # started. STRIP_FROM_PATH = # The STRIP_FROM_INC_PATH tag can be used to strip a user-defined part of # the path mentioned in the documentation of a class, which tells # the reader which header file to include in order to use a class. # If left blank only the name of the header file containing the class # definition is used. Otherwise one should specify the include paths that # are normally passed to the compiler using the -I flag. STRIP_FROM_INC_PATH = # If the SHORT_NAMES tag is set to YES, doxygen will generate much shorter # (but less readable) file names. This can be useful if your file system # doesn't support long names like on DOS, Mac, or CD-ROM. SHORT_NAMES = NO # If the JAVADOC_AUTOBRIEF tag is set to YES then Doxygen # will interpret the first line (until the first dot) of a JavaDoc-style # comment as the brief description. If set to NO, the JavaDoc # comments will behave just like regular Qt-style comments # (thus requiring an explicit @brief command for a brief description.) JAVADOC_AUTOBRIEF = YES # If the QT_AUTOBRIEF tag is set to YES then Doxygen will # interpret the first line (until the first dot) of a Qt-style # comment as the brief description. If set to NO, the comments # will behave just like regular Qt-style comments (thus requiring # an explicit \brief command for a brief description.) QT_AUTOBRIEF = NO # The MULTILINE_CPP_IS_BRIEF tag can be set to YES to make Doxygen # treat a multi-line C++ special comment block (i.e. a block of //! or /// # comments) as a brief description. This used to be the default behaviour. # The new default is to treat a multi-line C++ comment block as a detailed # description. Set this tag to YES if you prefer the old behaviour instead. MULTILINE_CPP_IS_BRIEF = NO # If the INHERIT_DOCS tag is set to YES (the default) then an undocumented # member inherits the documentation from any documented member that it # re-implements. INHERIT_DOCS = YES # If the SEPARATE_MEMBER_PAGES tag is set to YES, then doxygen will produce # a new page for each member. If set to NO, the documentation of a member will # be part of the file/class/namespace that contains it. SEPARATE_MEMBER_PAGES = NO # The TAB_SIZE tag can be used to set the number of spaces in a tab. # Doxygen uses this value to replace tabs by spaces in code fragments. TAB_SIZE = 4 # This tag can be used to specify a number of aliases that acts # as commands in the documentation. An alias has the form "name=value". # For example adding "sideeffect=\par Side Effects:\n" will allow you to # put the command \sideeffect (or @sideeffect) in the documentation, which # will result in a user-defined paragraph with heading "Side Effects:". # You can put \n's in the value part of an alias to insert newlines. ALIASES = # This tag can be used to specify a number of word-keyword mappings (TCL only). # A mapping has the form "name=value". For example adding # "class=itcl::class" will allow you to use the command class in the # itcl::class meaning. TCL_SUBST = # Set the OPTIMIZE_OUTPUT_FOR_C tag to YES if your project consists of C # sources only. Doxygen will then generate output that is more tailored for C. # For instance, some of the names that are used will be different. The list # of all members will be omitted, etc. OPTIMIZE_OUTPUT_FOR_C = YES # Set the OPTIMIZE_OUTPUT_JAVA tag to YES if your project consists of Java # sources only. Doxygen will then generate output that is more tailored for # Java. For instance, namespaces will be presented as packages, qualified # scopes will look different, etc. OPTIMIZE_OUTPUT_JAVA = NO # Set the OPTIMIZE_FOR_FORTRAN tag to YES if your project consists of Fortran # sources only. Doxygen will then generate output that is more tailored for # Fortran. OPTIMIZE_FOR_FORTRAN = NO # Set the OPTIMIZE_OUTPUT_VHDL tag to YES if your project consists of VHDL # sources. Doxygen will then generate output that is tailored for # VHDL. OPTIMIZE_OUTPUT_VHDL = NO # Doxygen selects the parser to use depending on the extension of the files it # parses. With this tag you can assign which parser to use for a given # extension. Doxygen has a built-in mapping, but you can override or extend it # using this tag. The format is ext=language, where ext is a file extension, # and language is one of the parsers supported by doxygen: IDL, Java, # Javascript, CSharp, C, C++, D, PHP, Objective-C, Python, Fortran, VHDL, C, # C++. For instance to make doxygen treat .inc files as Fortran files (default # is PHP), and .f files as C (default is Fortran), use: inc=Fortran f=C. Note # that for custom extensions you also need to set FILE_PATTERNS otherwise the # files are not read by doxygen. EXTENSION_MAPPING = no_extension=md # If MARKDOWN_SUPPORT is enabled (the default) then doxygen pre-processes all # comments according to the Markdown format, which allows for more readable # documentation. See http://daringfireball.net/projects/markdown/ for details. # The output of markdown processing is further processed by doxygen, so you # can mix doxygen, HTML, and XML commands with Markdown formatting. # Disable only in case of backward compatibilities issues. MARKDOWN_SUPPORT = YES # When enabled doxygen tries to link words that correspond to documented # classes, or namespaces to their corresponding documentation. Such a link can # be prevented in individual cases by by putting a % sign in front of the word # or globally by setting AUTOLINK_SUPPORT to NO. AUTOLINK_SUPPORT = YES # If you use STL classes (i.e. std::string, std::vector, etc.) but do not want # to include (a tag file for) the STL sources as input, then you should # set this tag to YES in order to let doxygen match functions declarations and # definitions whose arguments contain STL classes (e.g. func(std::string); v.s. # func(std::string) {}). This also makes the inheritance and collaboration # diagrams that involve STL classes more complete and accurate. BUILTIN_STL_SUPPORT = NO # If you use Microsoft's C++/CLI language, you should set this option to YES to # enable parsing support. CPP_CLI_SUPPORT = NO # Set the SIP_SUPPORT tag to YES if your project consists of sip sources only. # Doxygen will parse them like normal C++ but will assume all classes use public # instead of private inheritance when no explicit protection keyword is present. SIP_SUPPORT = NO # For Microsoft's IDL there are propget and propput attributes to indicate # getter and setter methods for a property. Setting this option to YES (the # default) will make doxygen replace the get and set methods by a property in # the documentation. This will only work if the methods are indeed getting or # setting a simple type. If this is not the case, or you want to show the # methods anyway, you should set this option to NO. IDL_PROPERTY_SUPPORT = YES # If member grouping is used in the documentation and the DISTRIBUTE_GROUP_DOC # tag is set to YES, then doxygen will reuse the documentation of the first # member in the group (if any) for the other members of the group. By default # all members of a group must be documented explicitly. DISTRIBUTE_GROUP_DOC = NO # Set the SUBGROUPING tag to YES (the default) to allow class member groups of # the same type (for instance a group of public functions) to be put as a # subgroup of that type (e.g. under the Public Functions section). Set it to # NO to prevent subgrouping. Alternatively, this can be done per class using # the \nosubgrouping command. SUBGROUPING = YES # When the INLINE_GROUPED_CLASSES tag is set to YES, classes, structs and # unions are shown inside the group in which they are included (e.g. using # @ingroup) instead of on a separate page (for HTML and Man pages) or # section (for LaTeX and RTF). INLINE_GROUPED_CLASSES = NO # When the INLINE_SIMPLE_STRUCTS tag is set to YES, structs, classes, and # unions with only public data fields or simple typedef fields will be shown # inline in the documentation of the scope in which they are defined (i.e. file, # namespace, or group documentation), provided this scope is documented. If set # to NO (the default), structs, classes, and unions are shown on a separate # page (for HTML and Man pages) or section (for LaTeX and RTF). INLINE_SIMPLE_STRUCTS = NO # When TYPEDEF_HIDES_STRUCT is enabled, a typedef of a struct, union, or enum # is documented as struct, union, or enum with the name of the typedef. So # typedef struct TypeS {} TypeT, will appear in the documentation as a struct # with name TypeT. When disabled the typedef will appear as a member of a file, # namespace, or class. And the struct will be named TypeS. This can typically # be useful for C code in case the coding convention dictates that all compound # types are typedef'ed and only the typedef is referenced, never the tag name. TYPEDEF_HIDES_STRUCT = NO # The size of the symbol lookup cache can be set using LOOKUP_CACHE_SIZE. This # cache is used to resolve symbols given their name and scope. Since this can # be an expensive process and often the same symbol appear multiple times in # the code, doxygen keeps a cache of pre-resolved symbols. If the cache is too # small doxygen will become slower. If the cache is too large, memory is wasted. # The cache size is given by this formula: 2^(16+LOOKUP_CACHE_SIZE). The valid # range is 0..9, the default is 0, corresponding to a cache size of 2^16 = 65536 # symbols. LOOKUP_CACHE_SIZE = 0 #--------------------------------------------------------------------------- # Build related configuration options #--------------------------------------------------------------------------- # If the EXTRACT_ALL tag is set to YES doxygen will assume all entities in # documentation are documented, even if no documentation was available. # Private class members and static file members will be hidden unless # the EXTRACT_PRIVATE respectively EXTRACT_STATIC tags are set to YES EXTRACT_ALL = NO # If the EXTRACT_PRIVATE tag is set to YES all private members of a class # will be included in the documentation. EXTRACT_PRIVATE = NO # If the EXTRACT_PACKAGE tag is set to YES all members with package or internal # scope will be included in the documentation. EXTRACT_PACKAGE = NO # If the EXTRACT_STATIC tag is set to YES all static members of a file # will be included in the documentation. EXTRACT_STATIC = NO # If the EXTRACT_LOCAL_CLASSES tag is set to YES classes (and structs) # defined locally in source files will be included in the documentation. # If set to NO only classes defined in header files are included. EXTRACT_LOCAL_CLASSES = YES # This flag is only useful for Objective-C code. When set to YES local # methods, which are defined in the implementation section but not in # the interface are included in the documentation. # If set to NO (the default) only methods in the interface are included. EXTRACT_LOCAL_METHODS = NO # If this flag is set to YES, the members of anonymous namespaces will be # extracted and appear in the documentation as a namespace called # 'anonymous_namespace{file}', where file will be replaced with the base # name of the file that contains the anonymous namespace. By default # anonymous namespaces are hidden. EXTRACT_ANON_NSPACES = NO # If the HIDE_UNDOC_MEMBERS tag is set to YES, Doxygen will hide all # undocumented members of documented classes, files or namespaces. # If set to NO (the default) these members will be included in the # various overviews, but no documentation section is generated. # This option has no effect if EXTRACT_ALL is enabled. HIDE_UNDOC_MEMBERS = NO # If the HIDE_UNDOC_CLASSES tag is set to YES, Doxygen will hide all # undocumented classes that are normally visible in the class hierarchy. # If set to NO (the default) these classes will be included in the various # overviews. This option has no effect if EXTRACT_ALL is enabled. HIDE_UNDOC_CLASSES = NO # If the HIDE_FRIEND_COMPOUNDS tag is set to YES, Doxygen will hide all # friend (class|struct|union) declarations. # If set to NO (the default) these declarations will be included in the # documentation. HIDE_FRIEND_COMPOUNDS = NO # If the HIDE_IN_BODY_DOCS tag is set to YES, Doxygen will hide any # documentation blocks found inside the body of a function. # If set to NO (the default) these blocks will be appended to the # function's detailed documentation block. HIDE_IN_BODY_DOCS = NO # The INTERNAL_DOCS tag determines if documentation # that is typed after a \internal command is included. If the tag is set # to NO (the default) then the documentation will be excluded. # Set it to YES to include the internal documentation. INTERNAL_DOCS = NO # If the CASE_SENSE_NAMES tag is set to NO then Doxygen will only generate # file names in lower-case letters. If set to YES upper-case letters are also # allowed. This is useful if you have classes or files whose names only differ # in case and if your file system supports case sensitive file names. Windows # and Mac users are advised to set this option to NO. CASE_SENSE_NAMES = YES # If the HIDE_SCOPE_NAMES tag is set to NO (the default) then Doxygen # will show members with their full class and namespace scopes in the # documentation. If set to YES the scope will be hidden. HIDE_SCOPE_NAMES = NO # If the SHOW_INCLUDE_FILES tag is set to YES (the default) then Doxygen # will put a list of the files that are included by a file in the documentation # of that file. SHOW_INCLUDE_FILES = YES # If the FORCE_LOCAL_INCLUDES tag is set to YES then Doxygen # will list include files with double quotes in the documentation # rather than with sharp brackets. FORCE_LOCAL_INCLUDES = NO # If the INLINE_INFO tag is set to YES (the default) then a tag [inline] # is inserted in the documentation for inline members. INLINE_INFO = YES # If the SORT_MEMBER_DOCS tag is set to YES (the default) then doxygen # will sort the (detailed) documentation of file and class members # alphabetically by member name. If set to NO the members will appear in # declaration order. SORT_MEMBER_DOCS = NO # If the SORT_BRIEF_DOCS tag is set to YES then doxygen will sort the # brief documentation of file, namespace and class members alphabetically # by member name. If set to NO (the default) the members will appear in # declaration order. SORT_BRIEF_DOCS = NO # If the SORT_MEMBERS_CTORS_1ST tag is set to YES then doxygen # will sort the (brief and detailed) documentation of class members so that # constructors and destructors are listed first. If set to NO (the default) # the constructors will appear in the respective orders defined by # SORT_MEMBER_DOCS and SORT_BRIEF_DOCS. # This tag will be ignored for brief docs if SORT_BRIEF_DOCS is set to NO # and ignored for detailed docs if SORT_MEMBER_DOCS is set to NO. SORT_MEMBERS_CTORS_1ST = NO # If the SORT_GROUP_NAMES tag is set to YES then doxygen will sort the # hierarchy of group names into alphabetical order. If set to NO (the default) # the group names will appear in their defined order. SORT_GROUP_NAMES = NO # If the SORT_BY_SCOPE_NAME tag is set to YES, the class list will be # sorted by fully-qualified names, including namespaces. If set to # NO (the default), the class list will be sorted only by class name, # not including the namespace part. # Note: This option is not very useful if HIDE_SCOPE_NAMES is set to YES. # Note: This option applies only to the class list, not to the # alphabetical list. SORT_BY_SCOPE_NAME = NO # If the STRICT_PROTO_MATCHING option is enabled and doxygen fails to # do proper type resolution of all parameters of a function it will reject a # match between the prototype and the implementation of a member function even # if there is only one candidate or it is obvious which candidate to choose # by doing a simple string match. By disabling STRICT_PROTO_MATCHING doxygen # will still accept a match between prototype and implementation in such cases. STRICT_PROTO_MATCHING = NO # The GENERATE_TODOLIST tag can be used to enable (YES) or # disable (NO) the todo list. This list is created by putting \todo # commands in the documentation. GENERATE_TODOLIST = YES # The GENERATE_TESTLIST tag can be used to enable (YES) or # disable (NO) the test list. This list is created by putting \test # commands in the documentation. GENERATE_TESTLIST = YES # The GENERATE_BUGLIST tag can be used to enable (YES) or # disable (NO) the bug list. This list is created by putting \bug # commands in the documentation. GENERATE_BUGLIST = YES # The GENERATE_DEPRECATEDLIST tag can be used to enable (YES) or # disable (NO) the deprecated list. This list is created by putting # \deprecated commands in the documentation. GENERATE_DEPRECATEDLIST= YES # The ENABLED_SECTIONS tag can be used to enable conditional # documentation sections, marked by \if section-label ... \endif # and \cond section-label ... \endcond blocks. ENABLED_SECTIONS = # The MAX_INITIALIZER_LINES tag determines the maximum number of lines # the initial value of a variable or macro consists of for it to appear in # the documentation. If the initializer consists of more lines than specified # here it will be hidden. Use a value of 0 to hide initializers completely. # The appearance of the initializer of individual variables and macros in the # documentation can be controlled using \showinitializer or \hideinitializer # command in the documentation regardless of this setting. MAX_INITIALIZER_LINES = 30 # Set the SHOW_USED_FILES tag to NO to disable the list of files generated # at the bottom of the documentation of classes and structs. If set to YES the # list will mention the files that were used to generate the documentation. SHOW_USED_FILES = YES # Set the SHOW_FILES tag to NO to disable the generation of the Files page. # This will remove the Files entry from the Quick Index and from the # Folder Tree View (if specified). The default is YES. SHOW_FILES = YES # Set the SHOW_NAMESPACES tag to NO to disable the generation of the # Namespaces page. # This will remove the Namespaces entry from the Quick Index # and from the Folder Tree View (if specified). The default is YES. SHOW_NAMESPACES = YES # The FILE_VERSION_FILTER tag can be used to specify a program or script that # doxygen should invoke to get the current version for each file (typically from # the version control system). Doxygen will invoke the program by executing (via # popen()) the command , where is the value of # the FILE_VERSION_FILTER tag, and is the name of an input file # provided by doxygen. Whatever the program writes to standard output # is used as the file version. See the manual for examples. FILE_VERSION_FILTER = # The LAYOUT_FILE tag can be used to specify a layout file which will be parsed # by doxygen. The layout file controls the global structure of the generated # output files in an output format independent way. To create the layout file # that represents doxygen's defaults, run doxygen with the -l option. # You can optionally specify a file name after the option, if omitted # DoxygenLayout.xml will be used as the name of the layout file. LAYOUT_FILE = # The CITE_BIB_FILES tag can be used to specify one or more bib files # containing the references data. This must be a list of .bib files. The # .bib extension is automatically appended if omitted. Using this command # requires the bibtex tool to be installed. See also # http://en.wikipedia.org/wiki/BibTeX for more info. For LaTeX the style # of the bibliography can be controlled using LATEX_BIB_STYLE. To use this # feature you need bibtex and perl available in the search path. Do not use # file names with spaces, bibtex cannot handle them. CITE_BIB_FILES = #--------------------------------------------------------------------------- # configuration options related to warning and progress messages #--------------------------------------------------------------------------- # The QUIET tag can be used to turn on/off the messages that are generated # by doxygen. Possible values are YES and NO. If left blank NO is used. QUIET = YES # The WARNINGS tag can be used to turn on/off the warning messages that are # generated by doxygen. Possible values are YES and NO. If left blank # NO is used. WARNINGS = YES # If WARN_IF_UNDOCUMENTED is set to YES, then doxygen will generate warnings # for undocumented members. If EXTRACT_ALL is set to YES then this flag will # automatically be disabled. WARN_IF_UNDOCUMENTED = NO # If WARN_IF_DOC_ERROR is set to YES, doxygen will generate warnings for # potential errors in the documentation, such as not documenting some # parameters in a documented function, or documenting parameters that # don't exist or using markup commands wrongly. WARN_IF_DOC_ERROR = YES # The WARN_NO_PARAMDOC option can be enabled to get warnings for # functions that are documented, but have no documentation for their parameters # or return value. If set to NO (the default) doxygen will only warn about # wrong or incomplete parameter documentation, but not about the absence of # documentation. WARN_NO_PARAMDOC = NO # The WARN_FORMAT tag determines the format of the warning messages that # doxygen can produce. The string should contain the $file, $line, and $text # tags, which will be replaced by the file and line number from which the # warning originated and the warning text. Optionally the format may contain # $version, which will be replaced by the version of the file (if it could # be obtained via FILE_VERSION_FILTER) WARN_FORMAT = "$file:$line: $text" # The WARN_LOGFILE tag can be used to specify a file to which warning # and error messages should be written. If left blank the output is written # to stderr. WARN_LOGFILE = #--------------------------------------------------------------------------- # configuration options related to the input files #--------------------------------------------------------------------------- # The INPUT tag can be used to specify the files and/or directories that contain # documented source files. You may enter file names like "myfile.cpp" or # directories like "/usr/src/myproject". Separate the files or directories # with spaces. INPUT = @abs_top_srcdir@/lib/xwiimote.h \ @abs_top_srcdir@/README # This tag can be used to specify the character encoding of the source files # that doxygen parses. Internally doxygen uses the UTF-8 encoding, which is # also the default input encoding. Doxygen uses libiconv (or the iconv built # into libc) for the transcoding. See http://www.gnu.org/software/libiconv for # the list of possible encodings. INPUT_ENCODING = UTF-8 # If the value of the INPUT tag contains directories, you can use the # FILE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp # and *.h) to filter out the source-files in the directories. If left # blank the following patterns are tested: # *.c *.cc *.cxx *.cpp *.c++ *.d *.java *.ii *.ixx *.ipp *.i++ *.inl *.h *.hh # *.hxx *.hpp *.h++ *.idl *.odl *.cs *.php *.php3 *.inc *.m *.mm *.dox *.py # *.f90 *.f *.for *.vhd *.vhdl FILE_PATTERNS = *.c \ *.h # The RECURSIVE tag can be used to turn specify whether or not subdirectories # should be searched for input files as well. Possible values are YES and NO. # If left blank NO is used. RECURSIVE = YES # The EXCLUDE tag can be used to specify files and/or directories that should be # excluded from the INPUT source files. This way you can easily exclude a # subdirectory from a directory tree whose root is specified with the INPUT tag. # Note that relative paths are relative to the directory from which doxygen is # run. EXCLUDE = # The EXCLUDE_SYMLINKS tag can be used to select whether or not files or # directories that are symbolic links (a Unix file system feature) are excluded # from the input. EXCLUDE_SYMLINKS = NO # If the value of the INPUT tag contains directories, you can use the # EXCLUDE_PATTERNS tag to specify one or more wildcard patterns to exclude # certain files from those directories. Note that the wildcards are matched # against the file with absolute path, so to exclude all test directories # for example use the pattern */test/* EXCLUDE_PATTERNS = # The EXCLUDE_SYMBOLS tag can be used to specify one or more symbol names # (namespaces, classes, functions, etc.) that should be excluded from the # output. The symbol name can be a fully qualified name, a word, or if the # wildcard * is used, a substring. Examples: ANamespace, AClass, # AClass::ANamespace, ANamespace::*Test EXCLUDE_SYMBOLS = # The EXAMPLE_PATH tag can be used to specify one or more files or # directories that contain example code fragments that are included (see # the \include command). EXAMPLE_PATH = # If the value of the EXAMPLE_PATH tag contains directories, you can use the # EXAMPLE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp # and *.h) to filter out the source-files in the directories. If left # blank all files are included. EXAMPLE_PATTERNS = # If the EXAMPLE_RECURSIVE tag is set to YES then subdirectories will be # searched for input files to be used with the \include or \dontinclude # commands irrespective of the value of the RECURSIVE tag. # Possible values are YES and NO. If left blank NO is used. EXAMPLE_RECURSIVE = NO # The IMAGE_PATH tag can be used to specify one or more files or # directories that contain image that are included in the documentation (see # the \image command). IMAGE_PATH = # The INPUT_FILTER tag can be used to specify a program that doxygen should # invoke to filter for each input file. Doxygen will invoke the filter program # by executing (via popen()) the command , where # is the value of the INPUT_FILTER tag, and is the name of an # input file. Doxygen will then use the output that the filter program writes # to standard output. # If FILTER_PATTERNS is specified, this tag will be ignored. # Note that the filter must not add or remove lines; it is applied before the # code is scanned, but not when the output code is generated. If lines are added # or removed, the anchors will not be placed correctly. INPUT_FILTER = # The FILTER_PATTERNS tag can be used to specify filters on a per file pattern # basis. # Doxygen will compare the file name with each pattern and apply the # filter if there is a match. # The filters are a list of the form: # pattern=filter (like *.cpp=my_cpp_filter). See INPUT_FILTER for further # info on how filters are used. If FILTER_PATTERNS is empty or if # non of the patterns match the file name, INPUT_FILTER is applied. FILTER_PATTERNS = # If the FILTER_SOURCE_FILES tag is set to YES, the input filter (if set using # INPUT_FILTER) will be used to filter the input files when producing source # files to browse (i.e. when SOURCE_BROWSER is set to YES). FILTER_SOURCE_FILES = NO # The FILTER_SOURCE_PATTERNS tag can be used to specify source filters per file # pattern. A pattern will override the setting for FILTER_PATTERN (if any) # and it is also possible to disable source filtering for a specific pattern # using *.ext= (so without naming a filter). This option only has effect when # FILTER_SOURCE_FILES is enabled. FILTER_SOURCE_PATTERNS = # If the USE_MD_FILE_AS_MAINPAGE tag refers to the name of a markdown file that # is part of the input, its contents will be placed on the main page # (index.html). This can be useful if you have a project on for instance GitHub # and want reuse the introduction page also for the doxygen output. USE_MDFILE_AS_MAINPAGE = #--------------------------------------------------------------------------- # configuration options related to source browsing #--------------------------------------------------------------------------- # If the SOURCE_BROWSER tag is set to YES then a list of source files will # be generated. Documented entities will be cross-referenced with these sources. # Note: To get rid of all source code in the generated output, make sure also # VERBATIM_HEADERS is set to NO. SOURCE_BROWSER = NO # Setting the INLINE_SOURCES tag to YES will include the body # of functions and classes directly in the documentation. INLINE_SOURCES = NO # Setting the STRIP_CODE_COMMENTS tag to YES (the default) will instruct # doxygen to hide any special comment blocks from generated source code # fragments. Normal C, C++ and Fortran comments will always remain visible. STRIP_CODE_COMMENTS = YES # If the REFERENCED_BY_RELATION tag is set to YES # then for each documented function all documented # functions referencing it will be listed. REFERENCED_BY_RELATION = NO # If the REFERENCES_RELATION tag is set to YES # then for each documented function all documented entities # called/used by that function will be listed. REFERENCES_RELATION = NO # If the REFERENCES_LINK_SOURCE tag is set to YES (the default) # and SOURCE_BROWSER tag is set to YES, then the hyperlinks from # functions in REFERENCES_RELATION and REFERENCED_BY_RELATION lists will # link to the source code. # Otherwise they will link to the documentation. REFERENCES_LINK_SOURCE = YES # If the USE_HTAGS tag is set to YES then the references to source code # will point to the HTML generated by the htags(1) tool instead of doxygen # built-in source browser. The htags tool is part of GNU's global source # tagging system (see http://www.gnu.org/software/global/global.html). You # will need version 4.8.6 or higher. USE_HTAGS = NO # If the VERBATIM_HEADERS tag is set to YES (the default) then Doxygen # will generate a verbatim copy of the header file for each class for # which an include is specified. Set to NO to disable this. VERBATIM_HEADERS = YES #--------------------------------------------------------------------------- # configuration options related to the alphabetical class index #--------------------------------------------------------------------------- # If the ALPHABETICAL_INDEX tag is set to YES, an alphabetical index # of all compounds will be generated. Enable this if the project # contains a lot of classes, structs, unions or interfaces. ALPHABETICAL_INDEX = YES # If the alphabetical index is enabled (see ALPHABETICAL_INDEX) then # the COLS_IN_ALPHA_INDEX tag can be used to specify the number of columns # in which this list will be split (can be a number in the range [1..20]) COLS_IN_ALPHA_INDEX = 5 # In case all classes in a project start with a common prefix, all # classes will be put under the same header in the alphabetical index. # The IGNORE_PREFIX tag can be used to specify one or more prefixes that # should be ignored while generating the index headers. IGNORE_PREFIX = xwii_ \ XWII_ #--------------------------------------------------------------------------- # configuration options related to the HTML output #--------------------------------------------------------------------------- # If the GENERATE_HTML tag is set to YES (the default) Doxygen will # generate HTML output. GENERATE_HTML = YES # The HTML_OUTPUT tag is used to specify where the HTML docs will be put. # If a relative path is entered the value of OUTPUT_DIRECTORY will be # put in front of it. If left blank `html' will be used as the default path. HTML_OUTPUT = html # The HTML_FILE_EXTENSION tag can be used to specify the file extension for # each generated HTML page (for example: .htm,.php,.asp). If it is left blank # doxygen will generate files with .html extension. HTML_FILE_EXTENSION = .html # The HTML_HEADER tag can be used to specify a personal HTML header for # each generated HTML page. If it is left blank doxygen will generate a # standard header. Note that when using a custom header you are responsible # for the proper inclusion of any scripts and style sheets that doxygen # needs, which is dependent on the configuration options used. # It is advised to generate a default header using "doxygen -w html # header.html footer.html stylesheet.css YourConfigFile" and then modify # that header. Note that the header is subject to change so you typically # have to redo this when upgrading to a newer version of doxygen or when # changing the value of configuration settings such as GENERATE_TREEVIEW! HTML_HEADER = # The HTML_FOOTER tag can be used to specify a personal HTML footer for # each generated HTML page. If it is left blank doxygen will generate a # standard footer. HTML_FOOTER = # The HTML_STYLESHEET tag can be used to specify a user-defined cascading # style sheet that is used by each HTML page. It can be used to # fine-tune the look of the HTML output. If left blank doxygen will # generate a default style sheet. Note that it is recommended to use # HTML_EXTRA_STYLESHEET instead of this one, as it is more robust and this # tag will in the future become obsolete. HTML_STYLESHEET = # The HTML_EXTRA_STYLESHEET tag can be used to specify an additional # user-defined cascading style sheet that is included after the standard # style sheets created by doxygen. Using this option one can overrule # certain style aspects. This is preferred over using HTML_STYLESHEET # since it does not replace the standard style sheet and is therefor more # robust against future updates. Doxygen will copy the style sheet file to # the output directory. HTML_EXTRA_STYLESHEET = # The HTML_EXTRA_FILES tag can be used to specify one or more extra images or # other source files which should be copied to the HTML output directory. Note # that these files will be copied to the base HTML output directory. Use the # $relpath^ marker in the HTML_HEADER and/or HTML_FOOTER files to load these # files. In the HTML_STYLESHEET file, use the file name only. Also note that # the files will be copied as-is; there are no commands or markers available. HTML_EXTRA_FILES = # The HTML_COLORSTYLE_HUE tag controls the color of the HTML output. # Doxygen will adjust the colors in the style sheet and background images # according to this color. Hue is specified as an angle on a colorwheel, # see http://en.wikipedia.org/wiki/Hue for more information. # For instance the value 0 represents red, 60 is yellow, 120 is green, # 180 is cyan, 240 is blue, 300 purple, and 360 is red again. # The allowed range is 0 to 359. HTML_COLORSTYLE_HUE = 220 # The HTML_COLORSTYLE_SAT tag controls the purity (or saturation) of # the colors in the HTML output. For a value of 0 the output will use # grayscales only. A value of 255 will produce the most vivid colors. HTML_COLORSTYLE_SAT = 100 # The HTML_COLORSTYLE_GAMMA tag controls the gamma correction applied to # the luminance component of the colors in the HTML output. Values below # 100 gradually make the output lighter, whereas values above 100 make # the output darker. The value divided by 100 is the actual gamma applied, # so 80 represents a gamma of 0.8, The value 220 represents a gamma of 2.2, # and 100 does not change the gamma. HTML_COLORSTYLE_GAMMA = 80 # If the HTML_TIMESTAMP tag is set to YES then the footer of each generated HTML # page will contain the date and time when the page was generated. Setting # this to NO can help when comparing the output of multiple runs. HTML_TIMESTAMP = YES # If the HTML_DYNAMIC_SECTIONS tag is set to YES then the generated HTML # documentation will contain sections that can be hidden and shown after the # page has loaded. HTML_DYNAMIC_SECTIONS = NO # With HTML_INDEX_NUM_ENTRIES one can control the preferred number of # entries shown in the various tree structured indices initially; the user # can expand and collapse entries dynamically later on. Doxygen will expand # the tree to such a level that at most the specified number of entries are # visible (unless a fully collapsed tree already exceeds this amount). # So setting the number of entries 1 will produce a full collapsed tree by # default. 0 is a special value representing an infinite number of entries # and will result in a full expanded tree by default. HTML_INDEX_NUM_ENTRIES = 100 # If the GENERATE_DOCSET tag is set to YES, additional index files # will be generated that can be used as input for Apple's Xcode 3 # integrated development environment, introduced with OSX 10.5 (Leopard). # To create a documentation set, doxygen will generate a Makefile in the # HTML output directory. Running make will produce the docset in that # directory and running "make install" will install the docset in # ~/Library/Developer/Shared/Documentation/DocSets so that Xcode will find # it at startup. # See http://developer.apple.com/tools/creatingdocsetswithdoxygen.html # for more information. GENERATE_DOCSET = NO # When GENERATE_DOCSET tag is set to YES, this tag determines the name of the # feed. A documentation feed provides an umbrella under which multiple # documentation sets from a single provider (such as a company or product suite) # can be grouped. DOCSET_FEEDNAME = "Doxygen generated docs" # When GENERATE_DOCSET tag is set to YES, this tag specifies a string that # should uniquely identify the documentation set bundle. This should be a # reverse domain-name style string, e.g. com.mycompany.MyDocSet. Doxygen # will append .docset to the name. DOCSET_BUNDLE_ID = org.doxygen.Project # When GENERATE_PUBLISHER_ID tag specifies a string that should uniquely # identify the documentation publisher. This should be a reverse domain-name # style string, e.g. com.mycompany.MyDocSet.documentation. DOCSET_PUBLISHER_ID = org.doxygen.Publisher # The GENERATE_PUBLISHER_NAME tag identifies the documentation publisher. DOCSET_PUBLISHER_NAME = Publisher # If the GENERATE_HTMLHELP tag is set to YES, additional index files # will be generated that can be used as input for tools like the # Microsoft HTML help workshop to generate a compiled HTML help file (.chm) # of the generated HTML documentation. GENERATE_HTMLHELP = NO # If the GENERATE_HTMLHELP tag is set to YES, the CHM_FILE tag can # be used to specify the file name of the resulting .chm file. You # can add a path in front of the file if the result should not be # written to the html output directory. CHM_FILE = # If the GENERATE_HTMLHELP tag is set to YES, the HHC_LOCATION tag can # be used to specify the location (absolute path including file name) of # the HTML help compiler (hhc.exe). If non-empty doxygen will try to run # the HTML help compiler on the generated index.hhp. HHC_LOCATION = # If the GENERATE_HTMLHELP tag is set to YES, the GENERATE_CHI flag # controls if a separate .chi index file is generated (YES) or that # it should be included in the master .chm file (NO). GENERATE_CHI = NO # If the GENERATE_HTMLHELP tag is set to YES, the CHM_INDEX_ENCODING # is used to encode HtmlHelp index (hhk), content (hhc) and project file # content. CHM_INDEX_ENCODING = # If the GENERATE_HTMLHELP tag is set to YES, the BINARY_TOC flag # controls whether a binary table of contents is generated (YES) or a # normal table of contents (NO) in the .chm file. BINARY_TOC = NO # The TOC_EXPAND flag can be set to YES to add extra items for group members # to the contents of the HTML help documentation and to the tree view. TOC_EXPAND = NO # If the GENERATE_QHP tag is set to YES and both QHP_NAMESPACE and # QHP_VIRTUAL_FOLDER are set, an additional index file will be generated # that can be used as input for Qt's qhelpgenerator to generate a # Qt Compressed Help (.qch) of the generated HTML documentation. GENERATE_QHP = NO # If the QHG_LOCATION tag is specified, the QCH_FILE tag can # be used to specify the file name of the resulting .qch file. # The path specified is relative to the HTML output folder. QCH_FILE = # The QHP_NAMESPACE tag specifies the namespace to use when generating # Qt Help Project output. For more information please see # http://doc.trolltech.com/qthelpproject.html#namespace QHP_NAMESPACE = org.doxygen.Project # The QHP_VIRTUAL_FOLDER tag specifies the namespace to use when generating # Qt Help Project output. For more information please see # http://doc.trolltech.com/qthelpproject.html#virtual-folders QHP_VIRTUAL_FOLDER = doc # If QHP_CUST_FILTER_NAME is set, it specifies the name of a custom filter to # add. For more information please see # http://doc.trolltech.com/qthelpproject.html#custom-filters QHP_CUST_FILTER_NAME = # The QHP_CUST_FILT_ATTRS tag specifies the list of the attributes of the # custom filter to add. For more information please see # # Qt Help Project / Custom Filters. QHP_CUST_FILTER_ATTRS = # The QHP_SECT_FILTER_ATTRS tag specifies the list of the attributes this # project's # filter section matches. # # Qt Help Project / Filter Attributes. QHP_SECT_FILTER_ATTRS = # If the GENERATE_QHP tag is set to YES, the QHG_LOCATION tag can # be used to specify the location of Qt's qhelpgenerator. # If non-empty doxygen will try to run qhelpgenerator on the generated # .qhp file. QHG_LOCATION = # If the GENERATE_ECLIPSEHELP tag is set to YES, additional index files # will be generated, which together with the HTML files, form an Eclipse help # plugin. To install this plugin and make it available under the help contents # menu in Eclipse, the contents of the directory containing the HTML and XML # files needs to be copied into the plugins directory of eclipse. The name of # the directory within the plugins directory should be the same as # the ECLIPSE_DOC_ID value. After copying Eclipse needs to be restarted before # the help appears. GENERATE_ECLIPSEHELP = NO # A unique identifier for the eclipse help plugin. When installing the plugin # the directory name containing the HTML and XML files should also have # this name. ECLIPSE_DOC_ID = org.doxygen.Project # The DISABLE_INDEX tag can be used to turn on/off the condensed index (tabs) # at top of each HTML page. The value NO (the default) enables the index and # the value YES disables it. Since the tabs have the same information as the # navigation tree you can set this option to NO if you already set # GENERATE_TREEVIEW to YES. DISABLE_INDEX = NO # The GENERATE_TREEVIEW tag is used to specify whether a tree-like index # structure should be generated to display hierarchical information. # If the tag value is set to YES, a side panel will be generated # containing a tree-like index structure (just like the one that # is generated for HTML Help). For this to work a browser that supports # JavaScript, DHTML, CSS and frames is required (i.e. any modern browser). # Windows users are probably better off using the HTML help feature. # Since the tree basically has the same information as the tab index you # could consider to set DISABLE_INDEX to NO when enabling this option. GENERATE_TREEVIEW = YES # The ENUM_VALUES_PER_LINE tag can be used to set the number of enum values # (range [0,1..20]) that doxygen will group on one line in the generated HTML # documentation. Note that a value of 0 will completely suppress the enum # values from appearing in the overview section. ENUM_VALUES_PER_LINE = 1 # If the treeview is enabled (see GENERATE_TREEVIEW) then this tag can be # used to set the initial width (in pixels) of the frame in which the tree # is shown. TREEVIEW_WIDTH = 250 # When the EXT_LINKS_IN_WINDOW option is set to YES doxygen will open # links to external symbols imported via tag files in a separate window. EXT_LINKS_IN_WINDOW = NO # Use this tag to change the font size of Latex formulas included # as images in the HTML documentation. The default is 10. Note that # when you change the font size after a successful doxygen run you need # to manually remove any form_*.png images from the HTML output directory # to force them to be regenerated. FORMULA_FONTSIZE = 10 # Use the FORMULA_TRANPARENT tag to determine whether or not the images # generated for formulas are transparent PNGs. Transparent PNGs are # not supported properly for IE 6.0, but are supported on all modern browsers. # Note that when changing this option you need to delete any form_*.png files # in the HTML output before the changes have effect. FORMULA_TRANSPARENT = YES # Enable the USE_MATHJAX option to render LaTeX formulas using MathJax # (see http://www.mathjax.org) which uses client side Javascript for the # rendering instead of using prerendered bitmaps. Use this if you do not # have LaTeX installed or if you want to formulas look prettier in the HTML # output. When enabled you may also need to install MathJax separately and # configure the path to it using the MATHJAX_RELPATH option. USE_MATHJAX = NO # When MathJax is enabled you can set the default output format to be used for # the MathJax output. Supported types are HTML-CSS, NativeMML (i.e. MathML) and # SVG. The default value is HTML-CSS, which is slower, but has the best # compatibility. MATHJAX_FORMAT = HTML-CSS # When MathJax is enabled you need to specify the location relative to the # HTML output directory using the MATHJAX_RELPATH option. The destination # directory should contain the MathJax.js script. For instance, if the mathjax # directory is located at the same level as the HTML output directory, then # MATHJAX_RELPATH should be ../mathjax. The default value points to # the MathJax Content Delivery Network so you can quickly see the result without # installing MathJax. # However, it is strongly recommended to install a local # copy of MathJax from http://www.mathjax.org before deployment. MATHJAX_RELPATH = http://cdn.mathjax.org/mathjax/latest # The MATHJAX_EXTENSIONS tag can be used to specify one or MathJax extension # names that should be enabled during MathJax rendering. MATHJAX_EXTENSIONS = # The MATHJAX_CODEFILE tag can be used to specify a file with javascript # pieces of code that will be used on startup of the MathJax code. MATHJAX_CODEFILE = # When the SEARCHENGINE tag is enabled doxygen will generate a search box # for the HTML output. The underlying search engine uses javascript # and DHTML and should work on any modern browser. Note that when using # HTML help (GENERATE_HTMLHELP), Qt help (GENERATE_QHP), or docsets # (GENERATE_DOCSET) there is already a search function so this one should # typically be disabled. For large projects the javascript based search engine # can be slow, then enabling SERVER_BASED_SEARCH may provide a better solution. SEARCHENGINE = NO # When the SERVER_BASED_SEARCH tag is enabled the search engine will be # implemented using a web server instead of a web client using Javascript. # There are two flavours of web server based search depending on the # EXTERNAL_SEARCH setting. When disabled, doxygen will generate a PHP script for # searching and an index file used by the script. When EXTERNAL_SEARCH is # enabled the indexing and searching needs to be provided by external tools. # See the manual for details. SERVER_BASED_SEARCH = NO # When EXTERNAL_SEARCH is enabled doxygen will no longer generate the PHP # script for searching. Instead the search results are written to an XML file # which needs to be processed by an external indexer. Doxygen will invoke an # external search engine pointed to by the SEARCHENGINE_URL option to obtain # the search results. Doxygen ships with an example indexer (doxyindexer) and # search engine (doxysearch.cgi) which are based on the open source search # engine library Xapian. See the manual for configuration details. EXTERNAL_SEARCH = NO # The SEARCHENGINE_URL should point to a search engine hosted by a web server # which will returned the search results when EXTERNAL_SEARCH is enabled. # Doxygen ships with an example search engine (doxysearch) which is based on # the open source search engine library Xapian. See the manual for configuration # details. SEARCHENGINE_URL = # When SERVER_BASED_SEARCH and EXTERNAL_SEARCH are both enabled the unindexed # search data is written to a file for indexing by an external tool. With the # SEARCHDATA_FILE tag the name of this file can be specified. SEARCHDATA_FILE = searchdata.xml # When SERVER_BASED_SEARCH AND EXTERNAL_SEARCH are both enabled the # EXTERNAL_SEARCH_ID tag can be used as an identifier for the project. This is # useful in combination with EXTRA_SEARCH_MAPPINGS to search through multiple # projects and redirect the results back to the right project. EXTERNAL_SEARCH_ID = # The EXTRA_SEARCH_MAPPINGS tag can be used to enable searching through doxygen # projects other than the one defined by this configuration file, but that are # all added to the same external search index. Each project needs to have a # unique id set via EXTERNAL_SEARCH_ID. The search mapping then maps the id # of to a relative location where the documentation can be found. # The format is: EXTRA_SEARCH_MAPPINGS = id1=loc1 id2=loc2 ... EXTRA_SEARCH_MAPPINGS = #--------------------------------------------------------------------------- # configuration options related to the LaTeX output #--------------------------------------------------------------------------- # If the GENERATE_LATEX tag is set to YES (the default) Doxygen will # generate Latex output. GENERATE_LATEX = NO # The LATEX_OUTPUT tag is used to specify where the LaTeX docs will be put. # If a relative path is entered the value of OUTPUT_DIRECTORY will be # put in front of it. If left blank `latex' will be used as the default path. LATEX_OUTPUT = latex # The LATEX_CMD_NAME tag can be used to specify the LaTeX command name to be # invoked. If left blank `latex' will be used as the default command name. # Note that when enabling USE_PDFLATEX this option is only used for # generating bitmaps for formulas in the HTML output, but not in the # Makefile that is written to the output directory. LATEX_CMD_NAME = latex # The MAKEINDEX_CMD_NAME tag can be used to specify the command name to # generate index for LaTeX. If left blank `makeindex' will be used as the # default command name. MAKEINDEX_CMD_NAME = makeindex # If the COMPACT_LATEX tag is set to YES Doxygen generates more compact # LaTeX documents. This may be useful for small projects and may help to # save some trees in general. COMPACT_LATEX = NO # The PAPER_TYPE tag can be used to set the paper type that is used # by the printer. Possible values are: a4, letter, legal and # executive. If left blank a4 will be used. PAPER_TYPE = a4 # The EXTRA_PACKAGES tag can be to specify one or more names of LaTeX # packages that should be included in the LaTeX output. EXTRA_PACKAGES = # The LATEX_HEADER tag can be used to specify a personal LaTeX header for # the generated latex document. The header should contain everything until # the first chapter. If it is left blank doxygen will generate a # standard header. Notice: only use this tag if you know what you are doing! LATEX_HEADER = # The LATEX_FOOTER tag can be used to specify a personal LaTeX footer for # the generated latex document. The footer should contain everything after # the last chapter. If it is left blank doxygen will generate a # standard footer. Notice: only use this tag if you know what you are doing! LATEX_FOOTER = # The LATEX_EXTRA_FILES tag can be used to specify one or more extra images # or other source files which should be copied to the LaTeX output directory. # Note that the files will be copied as-is; there are no commands or markers # available. LATEX_EXTRA_FILES = # If the PDF_HYPERLINKS tag is set to YES, the LaTeX that is generated # is prepared for conversion to pdf (using ps2pdf). The pdf file will # contain links (just like the HTML output) instead of page references # This makes the output suitable for online browsing using a pdf viewer. PDF_HYPERLINKS = YES # If the USE_PDFLATEX tag is set to YES, pdflatex will be used instead of # plain latex in the generated Makefile. Set this option to YES to get a # higher quality PDF documentation. USE_PDFLATEX = YES # If the LATEX_BATCHMODE tag is set to YES, doxygen will add the \\batchmode. # command to the generated LaTeX files. This will instruct LaTeX to keep # running if errors occur, instead of asking the user for help. # This option is also used when generating formulas in HTML. LATEX_BATCHMODE = NO # If LATEX_HIDE_INDICES is set to YES then doxygen will not # include the index chapters (such as File Index, Compound Index, etc.) # in the output. LATEX_HIDE_INDICES = NO # If LATEX_SOURCE_CODE is set to YES then doxygen will include # source code with syntax highlighting in the LaTeX output. # Note that which sources are shown also depends on other settings # such as SOURCE_BROWSER. LATEX_SOURCE_CODE = NO # The LATEX_BIB_STYLE tag can be used to specify the style to use for the # bibliography, e.g. plainnat, or ieeetr. The default style is "plain". See # http://en.wikipedia.org/wiki/BibTeX for more info. LATEX_BIB_STYLE = plain #--------------------------------------------------------------------------- # configuration options related to the RTF output #--------------------------------------------------------------------------- # If the GENERATE_RTF tag is set to YES Doxygen will generate RTF output # The RTF output is optimized for Word 97 and may not look very pretty with # other RTF readers or editors. GENERATE_RTF = NO # The RTF_OUTPUT tag is used to specify where the RTF docs will be put. # If a relative path is entered the value of OUTPUT_DIRECTORY will be # put in front of it. If left blank `rtf' will be used as the default path. RTF_OUTPUT = rtf # If the COMPACT_RTF tag is set to YES Doxygen generates more compact # RTF documents. This may be useful for small projects and may help to # save some trees in general. COMPACT_RTF = NO # If the RTF_HYPERLINKS tag is set to YES, the RTF that is generated # will contain hyperlink fields. The RTF file will # contain links (just like the HTML output) instead of page references. # This makes the output suitable for online browsing using WORD or other # programs which support those fields. # Note: wordpad (write) and others do not support links. RTF_HYPERLINKS = NO # Load style sheet definitions from file. Syntax is similar to doxygen's # config file, i.e. a series of assignments. You only have to provide # replacements, missing definitions are set to their default value. RTF_STYLESHEET_FILE = # Set optional variables used in the generation of an rtf document. # Syntax is similar to doxygen's config file. RTF_EXTENSIONS_FILE = #--------------------------------------------------------------------------- # configuration options related to the man page output #--------------------------------------------------------------------------- # If the GENERATE_MAN tag is set to YES (the default) Doxygen will # generate man pages GENERATE_MAN = NO # The MAN_OUTPUT tag is used to specify where the man pages will be put. # If a relative path is entered the value of OUTPUT_DIRECTORY will be # put in front of it. If left blank `man' will be used as the default path. MAN_OUTPUT = man # The MAN_EXTENSION tag determines the extension that is added to # the generated man pages (default is the subroutine's section .3) MAN_EXTENSION = .3 # If the MAN_LINKS tag is set to YES and Doxygen generates man output, # then it will generate one additional man file for each entity # documented in the real man page(s). These additional files # only source the real man page, but without them the man command # would be unable to find the correct page. The default is NO. MAN_LINKS = NO #--------------------------------------------------------------------------- # configuration options related to the XML output #--------------------------------------------------------------------------- # If the GENERATE_XML tag is set to YES Doxygen will # generate an XML file that captures the structure of # the code including all documentation. GENERATE_XML = NO # The XML_OUTPUT tag is used to specify where the XML pages will be put. # If a relative path is entered the value of OUTPUT_DIRECTORY will be # put in front of it. If left blank `xml' will be used as the default path. XML_OUTPUT = xml # The XML_SCHEMA tag can be used to specify an XML schema, # which can be used by a validating XML parser to check the # syntax of the XML files. XML_SCHEMA = # The XML_DTD tag can be used to specify an XML DTD, # which can be used by a validating XML parser to check the # syntax of the XML files. XML_DTD = # If the XML_PROGRAMLISTING tag is set to YES Doxygen will # dump the program listings (including syntax highlighting # and cross-referencing information) to the XML output. Note that # enabling this will significantly increase the size of the XML output. XML_PROGRAMLISTING = YES #--------------------------------------------------------------------------- # configuration options related to the DOCBOOK output #--------------------------------------------------------------------------- # If the GENERATE_DOCBOOK tag is set to YES Doxygen will generate DOCBOOK files # that can be used to generate PDF. GENERATE_DOCBOOK = NO # The DOCBOOK_OUTPUT tag is used to specify where the DOCBOOK pages will be put. # If a relative path is entered the value of OUTPUT_DIRECTORY will be put in # front of it. If left blank docbook will be used as the default path. DOCBOOK_OUTPUT = docbook #--------------------------------------------------------------------------- # configuration options for the AutoGen Definitions output #--------------------------------------------------------------------------- # If the GENERATE_AUTOGEN_DEF tag is set to YES Doxygen will # generate an AutoGen Definitions (see autogen.sf.net) file # that captures the structure of the code including all # documentation. Note that this feature is still experimental # and incomplete at the moment. GENERATE_AUTOGEN_DEF = NO #--------------------------------------------------------------------------- # configuration options related to the Perl module output #--------------------------------------------------------------------------- # If the GENERATE_PERLMOD tag is set to YES Doxygen will # generate a Perl module file that captures the structure of # the code including all documentation. Note that this # feature is still experimental and incomplete at the # moment. GENERATE_PERLMOD = NO # If the PERLMOD_LATEX tag is set to YES Doxygen will generate # the necessary Makefile rules, Perl scripts and LaTeX code to be able # to generate PDF and DVI output from the Perl module output. PERLMOD_LATEX = NO # If the PERLMOD_PRETTY tag is set to YES the Perl module output will be # nicely formatted so it can be parsed by a human reader. # This is useful # if you want to understand what is going on. # On the other hand, if this # tag is set to NO the size of the Perl module output will be much smaller # and Perl will parse it just the same. PERLMOD_PRETTY = YES # The names of the make variables in the generated doxyrules.make file # are prefixed with the string contained in PERLMOD_MAKEVAR_PREFIX. # This is useful so different doxyrules.make files included by the same # Makefile don't overwrite each other's variables. PERLMOD_MAKEVAR_PREFIX = #--------------------------------------------------------------------------- # Configuration options related to the preprocessor #--------------------------------------------------------------------------- # If the ENABLE_PREPROCESSING tag is set to YES (the default) Doxygen will # evaluate all C-preprocessor directives found in the sources and include # files. ENABLE_PREPROCESSING = YES # If the MACRO_EXPANSION tag is set to YES Doxygen will expand all macro # names in the source code. If set to NO (the default) only conditional # compilation will be performed. Macro expansion can be done in a controlled # way by setting EXPAND_ONLY_PREDEF to YES. MACRO_EXPANSION = NO # If the EXPAND_ONLY_PREDEF and MACRO_EXPANSION tags are both set to YES # then the macro expansion is limited to the macros specified with the # PREDEFINED and EXPAND_AS_DEFINED tags. EXPAND_ONLY_PREDEF = NO # If the SEARCH_INCLUDES tag is set to YES (the default) the includes files # pointed to by INCLUDE_PATH will be searched when a #include is found. SEARCH_INCLUDES = YES # The INCLUDE_PATH tag can be used to specify one or more directories that # contain include files that are not input files but should be processed by # the preprocessor. INCLUDE_PATH = # You can use the INCLUDE_FILE_PATTERNS tag to specify one or more wildcard # patterns (like *.h and *.hpp) to filter out the header-files in the # directories. If left blank, the patterns specified with FILE_PATTERNS will # be used. INCLUDE_FILE_PATTERNS = # The PREDEFINED tag can be used to specify one or more macro names that # are defined before the preprocessor is started (similar to the -D option of # gcc). The argument of the tag is a list of macros of the form: name # or name=definition (no spaces). If the definition and the = are # omitted =1 is assumed. To prevent a macro definition from being # undefined via #undef or recursively expanded use the := operator # instead of the = operator. PREDEFINED = # If the MACRO_EXPANSION and EXPAND_ONLY_PREDEF tags are set to YES then # this tag can be used to specify a list of macro names that should be expanded. # The macro definition that is found in the sources will be used. # Use the PREDEFINED tag if you want to use a different macro definition that # overrules the definition found in the source code. EXPAND_AS_DEFINED = # If the SKIP_FUNCTION_MACROS tag is set to YES (the default) then # doxygen's preprocessor will remove all references to function-like macros # that are alone on a line, have an all uppercase name, and do not end with a # semicolon, because these will confuse the parser if not removed. SKIP_FUNCTION_MACROS = YES #--------------------------------------------------------------------------- # Configuration::additions related to external references #--------------------------------------------------------------------------- # The TAGFILES option can be used to specify one or more tagfiles. For each # tag file the location of the external documentation should be added. The # format of a tag file without this location is as follows: # # TAGFILES = file1 file2 ... # Adding location for the tag files is done as follows: # # TAGFILES = file1=loc1 "file2 = loc2" ... # where "loc1" and "loc2" can be relative or absolute paths # or URLs. Note that each tag file must have a unique name (where the name does # NOT include the path). If a tag file is not located in the directory in which # doxygen is run, you must also specify the path to the tagfile here. TAGFILES = # When a file name is specified after GENERATE_TAGFILE, doxygen will create # a tag file that is based on the input files it reads. GENERATE_TAGFILE = # If the ALLEXTERNALS tag is set to YES all external classes will be listed # in the class index. If set to NO only the inherited external classes # will be listed. ALLEXTERNALS = NO # If the EXTERNAL_GROUPS tag is set to YES all external groups will be listed # in the modules index. If set to NO, only the current project's groups will # be listed. EXTERNAL_GROUPS = YES # If the EXTERNAL_PAGES tag is set to YES all external pages will be listed # in the related pages index. If set to NO, only the current project's # pages will be listed. EXTERNAL_PAGES = YES # The PERL_PATH should be the absolute path and name of the perl script # interpreter (i.e. the result of `which perl'). PERL_PATH = /usr/bin/perl #--------------------------------------------------------------------------- # Configuration options related to the dot tool #--------------------------------------------------------------------------- # If the CLASS_DIAGRAMS tag is set to YES (the default) Doxygen will # generate a inheritance diagram (in HTML, RTF and LaTeX) for classes with base # or super classes. Setting the tag to NO turns the diagrams off. Note that # this option also works with HAVE_DOT disabled, but it is recommended to # install and use dot, since it yields more powerful graphs. CLASS_DIAGRAMS = YES # You can define message sequence charts within doxygen comments using the \msc # command. Doxygen will then run the mscgen tool (see # http://www.mcternan.me.uk/mscgen/) to produce the chart and insert it in the # documentation. The MSCGEN_PATH tag allows you to specify the directory where # the mscgen tool resides. If left empty the tool is assumed to be found in the # default search path. MSCGEN_PATH = # If set to YES, the inheritance and collaboration graphs will hide # inheritance and usage relations if the target is undocumented # or is not a class. HIDE_UNDOC_RELATIONS = YES # If you set the HAVE_DOT tag to YES then doxygen will assume the dot tool is # available from the path. This tool is part of Graphviz, a graph visualization # toolkit from AT&T and Lucent Bell Labs. The other options in this section # have no effect if this option is set to NO (the default) HAVE_DOT = NO # The DOT_NUM_THREADS specifies the number of dot invocations doxygen is # allowed to run in parallel. When set to 0 (the default) doxygen will # base this on the number of processors available in the system. You can set it # explicitly to a value larger than 0 to get control over the balance # between CPU load and processing speed. DOT_NUM_THREADS = 0 # By default doxygen will use the Helvetica font for all dot files that # doxygen generates. When you want a differently looking font you can specify # the font name using DOT_FONTNAME. You need to make sure dot is able to find # the font, which can be done by putting it in a standard location or by setting # the DOTFONTPATH environment variable or by setting DOT_FONTPATH to the # directory containing the font. DOT_FONTNAME = Helvetica # The DOT_FONTSIZE tag can be used to set the size of the font of dot graphs. # The default size is 10pt. DOT_FONTSIZE = 10 # By default doxygen will tell dot to use the Helvetica font. # If you specify a different font using DOT_FONTNAME you can use DOT_FONTPATH to # set the path where dot can find it. DOT_FONTPATH = # If the CLASS_GRAPH and HAVE_DOT tags are set to YES then doxygen # will generate a graph for each documented class showing the direct and # indirect inheritance relations. Setting this tag to YES will force the # CLASS_DIAGRAMS tag to NO. CLASS_GRAPH = YES # If the COLLABORATION_GRAPH and HAVE_DOT tags are set to YES then doxygen # will generate a graph for each documented class showing the direct and # indirect implementation dependencies (inheritance, containment, and # class references variables) of the class with other documented classes. COLLABORATION_GRAPH = YES # If the GROUP_GRAPHS and HAVE_DOT tags are set to YES then doxygen # will generate a graph for groups, showing the direct groups dependencies GROUP_GRAPHS = YES # If the UML_LOOK tag is set to YES doxygen will generate inheritance and # collaboration diagrams in a style similar to the OMG's Unified Modeling # Language. UML_LOOK = NO # If the UML_LOOK tag is enabled, the fields and methods are shown inside # the class node. If there are many fields or methods and many nodes the # graph may become too big to be useful. The UML_LIMIT_NUM_FIELDS # threshold limits the number of items for each type to make the size more # manageable. Set this to 0 for no limit. Note that the threshold may be # exceeded by 50% before the limit is enforced. UML_LIMIT_NUM_FIELDS = 10 # If set to YES, the inheritance and collaboration graphs will show the # relations between templates and their instances. TEMPLATE_RELATIONS = NO # If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDE_GRAPH, and HAVE_DOT # tags are set to YES then doxygen will generate a graph for each documented # file showing the direct and indirect include dependencies of the file with # other documented files. INCLUDE_GRAPH = YES # If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDED_BY_GRAPH, and # HAVE_DOT tags are set to YES then doxygen will generate a graph for each # documented header file showing the documented files that directly or # indirectly include this file. INCLUDED_BY_GRAPH = YES # If the CALL_GRAPH and HAVE_DOT options are set to YES then # doxygen will generate a call dependency graph for every global function # or class method. Note that enabling this option will significantly increase # the time of a run. So in most cases it will be better to enable call graphs # for selected functions only using the \callgraph command. CALL_GRAPH = NO # If the CALLER_GRAPH and HAVE_DOT tags are set to YES then # doxygen will generate a caller dependency graph for every global function # or class method. Note that enabling this option will significantly increase # the time of a run. So in most cases it will be better to enable caller # graphs for selected functions only using the \callergraph command. CALLER_GRAPH = NO # If the GRAPHICAL_HIERARCHY and HAVE_DOT tags are set to YES then doxygen # will generate a graphical hierarchy of all classes instead of a textual one. GRAPHICAL_HIERARCHY = YES # If the DIRECTORY_GRAPH and HAVE_DOT tags are set to YES # then doxygen will show the dependencies a directory has on other directories # in a graphical way. The dependency relations are determined by the #include # relations between the files in the directories. DIRECTORY_GRAPH = YES # The DOT_IMAGE_FORMAT tag can be used to set the image format of the images # generated by dot. Possible values are svg, png, jpg, or gif. # If left blank png will be used. If you choose svg you need to set # HTML_FILE_EXTENSION to xhtml in order to make the SVG files # visible in IE 9+ (other browsers do not have this requirement). DOT_IMAGE_FORMAT = png # If DOT_IMAGE_FORMAT is set to svg, then this option can be set to YES to # enable generation of interactive SVG images that allow zooming and panning. # Note that this requires a modern browser other than Internet Explorer. # Tested and working are Firefox, Chrome, Safari, and Opera. For IE 9+ you # need to set HTML_FILE_EXTENSION to xhtml in order to make the SVG files # visible. Older versions of IE do not have SVG support. INTERACTIVE_SVG = NO # The tag DOT_PATH can be used to specify the path where the dot tool can be # found. If left blank, it is assumed the dot tool can be found in the path. DOT_PATH = # The DOTFILE_DIRS tag can be used to specify one or more directories that # contain dot files that are included in the documentation (see the # \dotfile command). DOTFILE_DIRS = # The MSCFILE_DIRS tag can be used to specify one or more directories that # contain msc files that are included in the documentation (see the # \mscfile command). MSCFILE_DIRS = # The DOT_GRAPH_MAX_NODES tag can be used to set the maximum number of # nodes that will be shown in the graph. If the number of nodes in a graph # becomes larger than this value, doxygen will truncate the graph, which is # visualized by representing a node as a red box. Note that doxygen if the # number of direct children of the root node in a graph is already larger than # DOT_GRAPH_MAX_NODES then the graph will not be shown at all. Also note # that the size of a graph can be further restricted by MAX_DOT_GRAPH_DEPTH. DOT_GRAPH_MAX_NODES = 50 # The MAX_DOT_GRAPH_DEPTH tag can be used to set the maximum depth of the # graphs generated by dot. A depth value of 3 means that only nodes reachable # from the root by following a path via at most 3 edges will be shown. Nodes # that lay further from the root node will be omitted. Note that setting this # option to 1 or 2 may greatly reduce the computation time needed for large # code bases. Also note that the size of a graph can be further restricted by # DOT_GRAPH_MAX_NODES. Using a depth of 0 means no depth restriction. MAX_DOT_GRAPH_DEPTH = 0 # Set the DOT_TRANSPARENT tag to YES to generate images with a transparent # background. This is disabled by default, because dot on Windows does not # seem to support this out of the box. Warning: Depending on the platform used, # enabling this option may lead to badly anti-aliased labels on the edges of # a graph (i.e. they become hard to read). DOT_TRANSPARENT = NO # Set the DOT_MULTI_TARGETS tag to YES allow dot to generate multiple output # files in one run (i.e. multiple -o and -T options on the command line). This # makes dot run faster, but since only newer versions of dot (>1.8.10) # support this, this feature is disabled by default. DOT_MULTI_TARGETS = NO # If the GENERATE_LEGEND tag is set to YES (the default) Doxygen will # generate a legend page explaining the meaning of the various boxes and # arrows in the dot generated graphs. GENERATE_LEGEND = YES # If the DOT_CLEANUP tag is set to YES (the default) Doxygen will # remove the intermediate dot files that are used to generate # the various graphs. DOT_CLEANUP = YES xwiimote-2/doc/PROTOCOL000066400000000000000000000527241217476605100150360ustar00rootroot00000000000000= Nintendo Wii Remote Protocol = The wiimote communicates via standard bluetooth technology with the host. This document is divided into two parts. The first part described the low-level bluetooth connection that is established between the host and the wiimote with pairing support. The second part is about the protocol that is used to communicate with the wiimote. == Bluetooth Connection == The wiimote can be in the following states: off: The wiimote power is turned off and no interactions are possible. discoverable: The wiimote is not connected to any host but put into bluetooth discoverable mode. Furthermore, it is possible to establish a new bluetooth baseband connection to the wiimote. connecting: The wiimote is currently establishing a connection with a host or vice versa. connected: The wiimote is currently connected to a host. === Discoverable State === The wiimote is built around a Broadcom bluetooth chip that can be placed into discoverable mode in two ways: 1: Pressing the red sync-button behind the battery-cover on the back of the wiimote. This will place the wiimote directly into discoverable mode for exactly 20 seconds and then turn the wiimote off again. 2: Holding down the 1 and 2 buttons on the front of the wiimote will put the wiimote into discoverable mode. First, the wiimote performs auto-reconnect and if that fails it goes into discoverable mode. If the buttons are held down continuously, the wiimote will stay in discoverable mode, otherwise it turns off after 20 seconds. When in discoverable mode, the wiimote is seen as: "Nintendo RVL-CNT-01" For all later references in this document, we assume the wiimote has the following bluetooth address: "00:1E:35:3B:7E:6D" The binary representation of BD-addresses is in reversed order so this would be the six byte array: 0x6d 0x7e 0x3b 0x35 0x1e 0x00 When in discoverable mode, a host may establish a new bluetooth baseband connection to the wiimote. Every host is allowed to do that. No encryption nor pairing is required. When in discoverable mode, all four LEDs on the wiimote will blink when the battery is full. With lower battery status, less LEDs will blink. If the battery is nearly empty, only the left most LED blinks. === Connecting State === There are two ways to establish a connection with a wiimote: 1: Initiate a baseband connection to the wiimote while the wiimote is in discoverable state. 2: Let the wiimote auto-reconnect to your host. ==== Initiating a Connection ==== When the wiimote is in discoverable state, any bluetooth host can create a new baseband BR/EDR bluetooth connection to the wiimote. There are no special considerations or non-standard procedures. However, optionally, you may initiate pairing with the wiimote. This is not required and may be skipped, though, auto-reconnection can only be used when the host is paired with the wiimote. Pairing can be initiated by sending an HCI authentication request. The bluetooth stack will require a PIN for legacy pairing. This PIN depends on the method used to put the wiimote into discoverable mode. If method (1) was used (that means, the red sync button was pressed) then the PIN is the bluetooth address of the host in binary form (that is reversed order). If the buttons 1+2 were used (that is method (2)), then the PIN is the address of the wiimote in binary form. In our case this would be the 6-byte array: 0x6d 0x7e 0x3b 0x35 0x1e 0x00 When pairing is done, all further connections may use the new link-key instead of PIN-requests, but this should be handled by the bluetooth stack automatically. When the wiimote is paired with a host with method (1) (And only with this method! That is, red sync button!) then the wiimote will save the bluetooth address of the host for further reference so it can automatically reconnect to the host on disconnection. ==== Auto-Reconnection ==== The wiimote maintains a list of bluetooth addresses of hosts that it was connected to and paired with. If any single button on the wiimote is pressed while it is turned off, the wiimote turns on and tries to connect to one of the hosts in this list. It tries only once so you may need to press a single button multiple times to get connected to a host. It is currently impossible to control which host is tried first. Moreover, it is unknown how many addresses the wiimote can save so it may take many times (5 times, 10 times or even more) until the wiimote connects to an available host. If more than one host is available, it is not possible to predict what host the wiimote connects to. However, it seems that the wiimote maintains an internal sorted list of hosts and if it successfully connects to a host, this host is put on top of this list and hence tried first next time. When using auto-reconnection, no pairing is required and pairing does not provide any more functionality here. ==== SDP Information ==== When a low-level connection is established, you may query the SDP server of the xwiimote which returns a great deal of information: * Name: "Nintendo RVL-CNT-01" * PnP: VendorID: 0x057e ProductID: 0x0306 And a lot more PnP, SDP and HID related information. When the low-level baseband connection is established, the l2cap channels can be opened. On auto-reconnection, the wiimote will connect to the host (that is, the host must listen on the l2cap channels). If the connection is initiated by the host, then the wiimote listens for incoming connections on the l2cap channels. Two l2cap channels are used for communication: * Channel PSM 0x11 for sending data to the Wiimote * Channel PXM 0x13 for receiving data from the Wiimote Both must be opened for communication with the wiimote. No further steps are required to setup the connection with the wiimote. The wiimote is considered to be in "connected" state now. === Connected State === When in connected state, the host can communicate with the wiimote. The protocol used for communication is described below in "Fake-HID Protocol". To shutdown the connection, simply shut down the l2cap connections to the wiimote. The wiimote will shut down the connection when the "power"-button is pressed for 3 seconds. == Fake-HID Protocol == Communication is done via HID input/output reports. The wiimote's HID descriptor table does not contain any information about the reports except the data length. Many bits in the commands are still unknown and shall be initialized to 0 to avoid unwanted behaviour. === Reports === Following a list of all input and output reports. Many reports include the same information. These common structures are listed separately and each report that uses them just refers to them. Every report is built as a byte array of a fixed length. The array shall be initialized to 0 if not noted otherwise. If a report has a variable length parameter with a fixed maximum, then always the trailing bytes shall be padded with 0 if not used. Multibyte integers are always in big-endian format. A single report is constructred the following way: report[0] = 0xa1 (for input reports) report[0] = 0x52 (for output reports) report[1] = report[2-X] = The first byte is the HID command which is the same for all input and output reports. They are often omitted or automatically set by your HID layer. See your kernel/library documentation. The second byte is the report identifier. Byte 3 up to X is the report payload. Each report has a fixed length that specifies how long this payload is (without the report byte). A report with length 8 would need 10 bytes to be constructed: 8 payload bytes + 1 HID byte + 1 report byte = 10 bytes The "Data" decription of each report below gives a short overview of how the report is assembled. Each integer is given as hexadecimal number without the 0x prefix. Two characters form a single byte. ==== Common (Output) ==== Length: 1 Data: CC This is no real output report but rather a common structure that is used in almost all other output reports. Byte 1 (CC) contains the following flags: 0x01: This enables the rumble motor. This flag must be set on every output to keep the rumble motor running. If this flag is not set then the rumble is disabled. 0x02: This requests a report acknowledgement. The wiimote will send a 0x22 input report in response to this report. 0x04: Enable flag. This has different meanings depending on the output report but is generally used to enable/disable the requested feature. 0x08: unknown 0xf0: The upper bits are used by different output reports for special features. ==== Rumble Report (Output) ==== Report: 0x10 Length: 1 Data: 52 10 CC Payload information contains only the common output report. This report is no special rumble report, because rumble is enabled and disabled with every output report that includes the common output report. However, this report has no side effects so it may be used to affect the rumble motor without changing any other peripheral. ==== LED Report (Output) ==== Report: 0x11 Length: 1 Data: 52 11 CC Payload includes only the common output report. The upper 4 bits of the common output report set the different leds: 0x10: LED 1 0x20: LED 2 0x40: LED 3 0x80: LED 4 Turning all four LEDs off for too long is discouraged since it may lead the user to believe the wiimote is turned off while it is still turned on. Brightness modulation can be achieved by turning the leds off and on very fast. ==== DRM Set Report (Output) ==== Report: 0x12 Length: 2 Data: 52 12 CC MM The first byte is the common output report. The Enable Flag in the common output report (0x04) is used to enabled or disable continuous input reporting. If enabled, the wiimote continously sends input reports to the host. If disabled, the wiimote sends input reports only when data has changed. The second byte is used to request a specific data reporting mode (DRM). You should set it to the report identifier of the request input report. The wiimote will send data input reports always with the requested DRM. Upon powerup, the DRM defaults to 0x30. After an extension is (un)plugged, data reporting is disabled and needs to be reset with this report. A specific DRM does not explicitely enable or disable the peripherals of the wiimote. The wiimote simply pulls the data from its peripherals, puts it into the output report and sends it to the host. If the requested DRM needs data from a disabled peripheral, then the data is set to 0 in the input report. You have to enabled/disable the specific peripherals of the wiimote independently. Also the requested DRM should match the current data mode of each peripheral. For example if the IR is in extended state, then it reports IR data only if the requested DRM has 12 IR bytes. It must have exactly 12 bytes, not 10 and not 36! However, each peripheral will give hints what DRM to use below. ==== IR Set1 Report (Output) ==== Report: 0x13 Length: 1 Data: 52 13 CC This request is used to enable the IR camera. The payload is the common output report. The Enable Flag (0x04) of the common output report is used to enable or disable the IR camera. This is only one part of the initialization procedure of the IR camera. See below for full instructions how to initialize IR. ==== Speaker Set Report (Output) ==== Report: 0x14 Length: 1 Data: 52 14 CC This request is used to enable the speaker. The payload is the common output report. The Enable Flag (0x04) of the common output report is used to enable or disable the speaker. This is only one part of the initialization procedure of the speaker. See below for full instructions how to initialize the speaker. ==== Status Request Report (Output) ==== Report: 0x15 Length: 1 Data: 52 15 CC The payload is the common output report with no special flags. This report requests a status report from the wiimote. The wiimote will answer with input report 0x20. ==== Write Memory Report (Output) ==== Report: 0x16 Length: 21 Data: 52 16 CC OO OO OO SS DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD This writes data into the wiimote's EEPROM or registers. The first byte is the common output report. Its Enable Flag (0x04) specifies the namespace. If set, then the wiimote's registers are written, otherwise the EEPROM is written. The following 3 bytes OO OO OO specify the offset where to start the write followed by one byte SS specifying the size of the data that is written. SS can be a maximum of 16. The rest of the report is the data (DD). Trailing bytes are padded with 0. Acknowledgement is always received via input report 0x22. ==== Read Memory Report (Output) ==== Report: 0x17 Length: 6 Data: 52 17 CC OO OO OO SS SS This request a memory read of the wiimote's EEPROM or registers. The first byte (CC) is the common output report. Its Enable Flag (0x04) specifies whether EEPROM or registers shall be read. If set, the registers are read, otherwise internal EEPROM is read. The following three bytes OO OO OO specify the data offset where to start the memory read. The last two bytes SS SS specify the amount of data that is read starting at the offset. ==== Speaker Data Report (Output) ==== Report: 0x18 Length: 21 Data: 52 18 CC DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD This sends speaker data to the wiimote. The exact format of the data is described below in the speaker peripheral details. The first byte is the common output report. The upper 5 bits of the common output report specify the size of the data payload (they shall be shifted right for 3 bits). All following bytes (DD) contain the sound data that is sent to the speaker. ==== Speaker Mute Report (Output) ==== Report: 0x19 Length: 1 Data: 52 19 CC This mutes or unmutes the speaker. The payload is the common output report and the Enable Flag (0x04) specifies whether to mute (if enabled) or to unmute (if disabled) the speaker. ==== IR Set2 Report (Output) ==== Report: 0x1a Length: 1 Data: 52 1a CC This has the same syntax as "IR Set1 Report" and is also used to initialize the IR camera. ==== Common (Input) ==== Length: 2 Data: BB BB This is no real input report but rather a common structure that is used in almost all other input reports. The two BB BB bytes include the current state of the buttons on the wiimote. If the following flags are set, then the related button is currently pressed: Byte 1: Byte 2: 0x01: Left Two 0x02: Right One 0x04: Down B 0x08: Up A 0x10: Plus Minus 0x20: - - 0x40: - - 0x80: Home The power-button is never included in input reports. The 0x80 flag of byte one is never used. The bits 0x20 and 0x40 of both bytes are not used for button information but often include important LSB/MSBs or other flags of the surrounding input report. They are referred to as "Special Flags" of the common input report. The sync button on the back of the wiimote is also never included in the button input report. ==== Status Report (Input) ==== Report: 0x20 Length: 6 Data: a1 20 BB BB LF UU UU VV This is sent in request to Status Request Report (0x15) and also when an extension is plugged or unplugged. In the latter case you need to reset the DRM mode (see DRM Set Report), otherwise not further input reports will be sent. The first two bytes of this report include the common input report. The last byte VV is the current battery level from 0-255 where 0 is empty and 255 is full. The four upper bits of LF (L) are the leds: 0x10: LED 1 0x20: LED 2 0x40: LED 3 0x80: LED 4 These flags are set if the related LED is enabled. The lower 4 bits of LF (F) specfiy different things: 0x01: Set if battery is nearly empty 0x02: Set if an extension is plugged 0x04: Set if speaker is enabled 0x08: Set if IR is enabled The two bytes in between (UU UU) are always zero and its unknown why they exist. ==== Memory Report (Input) ==== Report: 0x21 Length: 21 Data: a1 21 BB BB SE OO OO DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD This is sent when data is read via read-memory request. The first two bytes include the common input information. The upper bits in SE are the size of the data that is read minus one (0xff => 16 byte, 0x00 => 1 byte) and the lower bits of SE are the error flag which is 0 when everything is ok, 7 when reading write-only memory and 8 when reading from unexisting memory. Other error flags are unknown. The two OO bytes are the lower 2 bytes of the offset. The upper two bytes are not reported back and must be known by the caller. The 16 DD bytes are the actual data and padded with zeros at the end if less data than 16 bytes were read. If the read-memory request has read more than 16 bytes, multiple responses are sent with the offset increased by 16 each time. Input reporting is disabled during those reads and continues after the read is done. ==== Result Report (Input) ==== Report: 0x22 Length: 4 Data: a1 22 BB BB RR EE This report is sent when a output report failed or explicit acknowledgement was requested by the caller via 0x02 bit in the common output request. The two BB bytes include the common input information, the RR byte is the number of the related report that this report is the result of. The EE byte is the error identifier: 0 if everything was ok, and >0 on error. The meaning of each error number is unknown. ==== DRM reports (Input) ==== All following reports are used to report input information to the host. The DRM-set output report is used to select the DRM report that is used for input reports. ==== DRM B ==== Report: 0x30 Length: 2 Data: a1 30 BB BB ==== DRM BA ==== Report: 0x31 Length: 5 Data: a1 31 BB BB AA AA AA ==== DRM BE ==== Report: 0x32 Length: 10 Data: a1 32 BB BB EE EE EE EE EE EE EE EE ==== DRM BAI ==== Report: 0x33 Length: 17 Data: a1 33 BB BB AA AA AA II II II II II II II II II II II II ==== DRM BEE ==== Report: 0x34 Length: 21 Data: a1 34 BB BB EE EE EE EE EE EE EE EE EE EE EE EE EE EE EE EE EE EE EE ==== DRM BAE ==== Report: 0x35 Length: 21 Data: a1 35 BB BB AA AA AA EE EE EE EE EE EE EE EE EE EE EE EE EE EE EE EE ==== DRM BIE ==== Report: 0x36 Length: 21 Data: a1 36 BB BB II II II II II II II II II II EE EE EE EE EE EE EE EE EE ==== DRM BAIE ==== Report: 0x37 Length: 21 Data: a1 37 BB BB AA AA AA II II II II II II II II II II EE EE EE EE EE EE ==== DRM E ==== Report: 0x3d Length: 21 Data: a1 3d EE EE EE EE EE EE EE EE EE EE EE EE EE EE EE EE EE EE EE EE EE ==== DRM SBAI1 ==== Report: 0x3e Length: 21 Data: a1 3e BB BB AA II II II II II II II II II II II II II II II II II II ==== DRM SBAI2 ==== Report: 0x3f Length: 21 Data: a1 3f BB BB AA II II II II II II II II II II II II II II II II II II == Authors == This document is written by: * David Herrmann - dh.herrmann@googlemail.com The following people contributed to this document: * WiiBrew Project: http://www.wiibrew.org/ http://www.wiibrew.org/wiki/Wiimote * BlueZ Mailing List: http://www.bluez.org/ * Wiimote Project: http://www.wiimoteproject.com/ * Wiiuse: http://sourceforge.net/projects/wiiuse * WiiYourself: http://wiiyourself.gl.tter.org/ == Links == * Gyro hardware: http://invensense.com/mems/gyro/idg650.html == Unknown == The following list contains protocol details which where not investigated and are still unknown: * What happens if two hosts try to connect to the wiimote? * Does the Wiimote implement the BT HID profile or just use HID commands via an l2cap channel? * How many host can be saved for auto-reconnection on the wiimote? * How to manage the list of auto-reconnection hosts? * How to reset the wiimote? * Is pairing possible when using auto-reconnection? Which key to use? xwiimote-2/doc/eeprom.dump000066400000000000000000001136451217476605100160300ustar00rootroot00000000000000This is a wiimote EEPROM dump using the 0x04 flag in READ_MEM requests. One byte is read per request. 0x00000000: 0x88 0x85 0x8b 0x8b 0x8a 0x97 0x3f 0x30 0x00000008: 0x8c 0x39 0xcd 0x88 0x85 0x8b 0x8b 0x8a 0x00000010: 0x97 0x3f 0x30 0x8c 0x39 0xcd 0x84 0x82 0x00000018: 0x86 0x30 0x9f 0x9d 0x9f 0x02 0x40 0x2e 0x00000020: 0x84 0x82 0x86 0x30 0x9f 0x9d 0x9f 0x02 0x00000028: 0x40 0x2e 0x00 0x00 0x00 0x00 0x00 0x00 0x00000030: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00000038: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00000040: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00000048: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00000050: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00000058: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00000060: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00000068: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00000070: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00000078: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00000080: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00000088: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00000090: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00000098: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x000000a0: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x000000a8: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x000000b0: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x000000b8: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x000000c0: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x000000c8: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x000000d0: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x000000d8: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x000000e0: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x000000e8: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x000000f0: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x000000f8: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00000100: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00000108: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00000110: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00000118: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00000120: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00000128: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00000130: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00000138: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00000140: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00000148: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00000150: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00000158: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00000160: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00000168: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00000170: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00000178: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00000180: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00000188: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00000190: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00000198: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x000001a0: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x000001a8: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x000001b0: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x000001b8: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x000001c0: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x000001c8: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x000001d0: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x000001d8: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x000001e0: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x000001e8: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x000001f0: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x000001f8: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00000200: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00000208: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00000210: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00000218: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00000220: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00000228: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00000230: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00000238: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00000240: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00000248: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00000250: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00000258: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00000260: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00000268: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00000270: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00000278: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00000280: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00000288: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00000290: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00000298: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x000002a0: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x000002a8: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x000002b0: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x000002b8: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x000002c0: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x000002c8: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x000002d0: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x000002d8: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x000002e0: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x000002e8: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x000002f0: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x000002f8: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00000300: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00000308: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00000310: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00000318: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00000320: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00000328: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00000330: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00000338: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00000340: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00000348: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00000350: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00000358: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00000360: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00000368: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00000370: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00000378: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00000380: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00000388: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00000390: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00000398: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x000003a0: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x000003a8: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x000003b0: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x000003b8: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x000003c0: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x000003c8: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x000003d0: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x000003d8: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x000003e0: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x000003e8: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x000003f0: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x000003f8: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00000400: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00000408: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00000410: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00000418: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00000420: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00000428: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00000430: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00000438: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00000440: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00000448: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00000450: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00000458: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00000460: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00000468: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00000470: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00000478: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00000480: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00000488: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00000490: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00000498: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x000004a0: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x000004a8: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x000004b0: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x000004b8: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x000004c0: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x000004c8: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x000004d0: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x000004d8: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x000004e0: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x000004e8: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x000004f0: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x000004f8: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00000500: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00000508: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00000510: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00000518: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00000520: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00000528: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00000530: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00000538: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00000540: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00000548: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00000550: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00000558: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00000560: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00000568: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00000570: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00000578: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00000580: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00000588: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00000590: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00000598: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x000005a0: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x000005a8: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x000005b0: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x000005b8: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x000005c0: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x000005c8: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x000005d0: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x000005d8: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x000005e0: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x000005e8: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x000005f0: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x000005f8: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00000600: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00000608: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00000610: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00000618: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00000620: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00000628: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00000630: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00000638: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00000640: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00000648: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00000650: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00000658: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00000660: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00000668: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00000670: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00000678: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00000680: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00000688: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00000690: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00000698: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x000006a0: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x000006a8: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x000006b0: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x000006b8: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x000006c0: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x000006c8: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x000006d0: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x000006d8: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x000006e0: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x000006e8: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x000006f0: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x000006f8: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00000700: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00000708: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00000710: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00000718: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00000720: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00000728: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00000730: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00000738: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00000740: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00000748: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00000750: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00000758: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00000760: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00000768: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00000770: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00000778: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00000780: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00000788: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00000790: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00000798: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x000007a0: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x000007a8: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x000007b0: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x000007b8: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x000007c0: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x000007c8: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x000007d0: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x000007d8: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x000007e0: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x000007e8: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x000007f0: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x000007f8: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00000800: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00000808: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00000810: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00000818: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00000820: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00000828: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00000830: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00000838: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00000840: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00000848: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00000850: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00000858: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00000860: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00000868: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00000870: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00000878: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00000880: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00000888: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00000890: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00000898: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x000008a0: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x000008a8: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x000008b0: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x000008b8: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x000008c0: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x000008c8: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x000008d0: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x000008d8: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x000008e0: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x000008e8: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x000008f0: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x000008f8: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00000900: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00000908: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00000910: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00000918: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00000920: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00000928: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00000930: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00000938: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00000940: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00000948: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00000950: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00000958: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00000960: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00000968: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00000970: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00000978: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00000980: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00000988: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00000990: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00000998: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x000009a0: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x000009a8: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x000009b0: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x000009b8: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x000009c0: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x000009c8: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x000009d0: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x000009d8: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x000009e0: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x000009e8: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x000009f0: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x000009f8: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00000a00: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00000a08: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00000a10: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00000a18: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00000a20: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00000a28: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00000a30: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00000a38: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00000a40: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00000a48: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00000a50: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00000a58: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00000a60: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00000a68: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00000a70: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00000a78: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00000a80: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00000a88: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00000a90: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00000a98: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00000aa0: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00000aa8: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00000ab0: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00000ab8: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00000ac0: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00000ac8: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00000ad0: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00000ad8: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00000ae0: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00000ae8: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00000af0: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00000af8: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00000b00: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00000b08: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00000b10: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00000b18: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00000b20: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00000b28: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00000b30: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00000b38: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00000b40: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00000b48: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00000b50: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00000b58: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00000b60: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00000b68: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00000b70: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00000b78: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00000b80: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00000b88: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00000b90: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00000b98: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00000ba0: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00000ba8: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00000bb0: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00000bb8: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00000bc0: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00000bc8: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00000bd0: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00000bd8: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00000be0: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00000be8: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00000bf0: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00000bf8: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00000c00: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00000c08: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00000c10: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00000c18: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00000c20: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00000c28: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00000c30: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00000c38: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00000c40: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00000c48: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00000c50: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00000c58: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00000c60: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00000c68: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00000c70: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00000c78: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00000c80: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00000c88: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00000c90: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00000c98: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00000ca0: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00000ca8: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00000cb0: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00000cb8: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00000cc0: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00000cc8: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00000cd0: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00000cd8: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00000ce0: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00000ce8: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00000cf0: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00000cf8: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00000d00: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00000d08: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00000d10: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00000d18: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00000d20: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00000d28: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00000d30: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00000d38: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00000d40: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00000d48: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00000d50: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00000d58: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00000d60: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00000d68: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00000d70: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00000d78: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00000d80: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00000d88: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00000d90: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00000d98: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00000da0: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00000da8: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00000db0: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00000db8: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00000dc0: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00000dc8: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00000dd0: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00000dd8: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00000de0: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00000de8: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00000df0: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00000df8: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00000e00: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00000e08: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00000e10: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00000e18: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00000e20: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00000e28: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00000e30: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00000e38: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00000e40: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00000e48: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00000e50: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00000e58: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00000e60: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00000e68: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00000e70: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00000e78: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00000e80: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00000e88: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00000e90: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00000e98: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00000ea0: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00000ea8: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00000eb0: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00000eb8: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00000ec0: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00000ec8: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00000ed0: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00000ed8: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00000ee0: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00000ee8: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00000ef0: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00000ef8: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00000f00: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00000f08: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00000f10: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00000f18: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00000f20: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00000f28: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00000f30: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00000f38: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00000f40: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00000f48: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00000f50: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00000f58: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00000f60: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00000f68: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00000f70: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00000f78: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00000f80: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00000f88: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00000f90: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00000f98: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00000fa0: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00000fa8: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00000fb0: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00000fb8: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00000fc0: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00000fc8: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00000fd0: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00000fd8: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00000fe0: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00000fe8: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00000ff0: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00000ff8: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00001000: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00001008: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00001010: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00001018: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00001020: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00001028: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00001030: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00001038: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00001040: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00001048: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00001050: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00001058: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00001060: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00001068: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00001070: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00001078: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00001080: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00001088: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00001090: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00001098: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x000010a0: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x000010a8: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x000010b0: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x000010b8: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x000010c0: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x000010c8: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x000010d0: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x000010d8: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x000010e0: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x000010e8: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x000010f0: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x000010f8: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00001100: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00001108: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00001110: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00001118: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00001120: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00001128: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00001130: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00001138: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00001140: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00001148: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00001150: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00001158: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00001160: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00001168: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00001170: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00001178: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00001180: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00001188: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00001190: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00001198: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x000011a0: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x000011a8: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x000011b0: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x000011b8: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x000011c0: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x000011c8: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x000011d0: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x000011d8: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x000011e0: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x000011e8: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x000011f0: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x000011f8: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00001200: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00001208: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00001210: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00001218: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00001220: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00001228: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00001230: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00001238: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00001240: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00001248: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00001250: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00001258: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00001260: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00001268: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00001270: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00001278: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00001280: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00001288: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00001290: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00001298: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x000012a0: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x000012a8: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x000012b0: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x000012b8: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x000012c0: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x000012c8: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x000012d0: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x000012d8: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x000012e0: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x000012e8: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x000012f0: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x000012f8: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00001300: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00001308: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00001310: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00001318: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00001320: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00001328: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00001330: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00001338: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00001340: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00001348: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00001350: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00001358: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00001360: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00001368: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00001370: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00001378: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00001380: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00001388: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00001390: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00001398: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x000013a0: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x000013a8: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x000013b0: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x000013b8: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x000013c0: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x000013c8: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x000013d0: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x000013d8: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x000013e0: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x000013e8: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x000013f0: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x000013f8: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00001400: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00001408: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00001410: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00001418: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00001420: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00001428: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00001430: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00001438: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00001440: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00001448: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00001450: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00001458: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00001460: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00001468: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00001470: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00001478: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00001480: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00001488: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00001490: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00001498: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x000014a0: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x000014a8: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x000014b0: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x000014b8: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x000014c0: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x000014c8: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x000014d0: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x000014d8: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x000014e0: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x000014e8: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x000014f0: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x000014f8: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00001500: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00001508: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00001510: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00001518: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00001520: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00001528: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00001530: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00001538: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00001540: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00001548: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00001550: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00001558: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00001560: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00001568: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00001570: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00001578: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00001580: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00001588: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00001590: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00001598: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x000015a0: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x000015a8: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x000015b0: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x000015b8: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x000015c0: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x000015c8: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x000015d0: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x000015d8: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x000015e0: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x000015e8: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x000015f0: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x000015f8: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00001600: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00001608: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00001610: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00001618: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00001620: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00001628: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00001630: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00001638: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00001640: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00001648: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00001650: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00001658: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00001660: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00001668: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00001670: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00001678: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00001680: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00001688: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00001690: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00001698: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x000016a0: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x000016a8: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x000016b0: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x000016b8: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x000016c0: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x000016c8: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x000016d0: 0x00 0x00 0x00 0xff 0x11 0xee 0x00 0x00 0x000016d8: 0x33 0xcc 0x44 0xbb 0x00 0x00 0x00 0x00 0x000016e0: 0x00 0x00 0x00 0x00 0x57 0x01 0x98 0x12 0x000016e8: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x000016f0: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x000016f8: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00001700: (read error 5) (read error 5) (read error 5) (read error 5) (read error 5) (read error 5) (read error 5) (read error 5) 0x00001708: (read error 5) (read error 5) (read error 5) (read error 5) (read error 5) (read error 5) (read error 5) (read error 5) ... continues with errors until 0x10000 ... The Block 0x0000 until 0x16ff is repeated at 0x10000. It is probably also repeated at 0x20000, 0x30000 and higher, but it is not tested. xwiimote-2/doc/libxwiimote.7000066400000000000000000000022041217476605100162620ustar00rootroot00000000000000.\" .\" Written 2012 by David Herrmann .\" Dedicated to the Public Domain .\" .TH "LIBXWIIMOTE" 7 "February 2012" "David Herrmann" "Wii Remote Driver" .SH NAME libxwiimote \- XWiimote user-space library .SH SYNOPSIS .B #include .SH DESCRIPTION The xwiimote library is a helper-library to manage connected Wii Remotes from user-space. If you write an application that wants to support Wii Remotes as input devics but you cannot rely on X or the kernel to provide a suitable input device for you (eg., because you need finer grained access), then you an use this library to access Wii Remotes. This library provides an simple, but still comprehensive, API to access connected Wii Remotes. The API documentation is still in process. Please read the tools in xwiimote/tools/ or the header in xwiimote/lib/xwiimote.h for information on the API. .SH BUGS The library does not support all Wii Remote peripherals, yet. Please consider contributing to the project if you need further functionality. .SH AUTHOR David Herrmann .br The XWiimote Project: http://dvdhrm.github.io/xwiimote .SH "SEE ALSO" .BR xwiimote (7), xwiimote-2/doc/rdesc.dump000066400000000000000000000244551217476605100156410ustar00rootroot00000000000000The HID report descriptor of a wiimote Raw dump (hexadecimal): 05 01 09 05 a1 01 85 10 15 00 26 ff 00 75 08 95 01 06 00 ff 09 01 91 00 85 11 95 01 09 01 91 00 85 12 95 02 09 01 91 00 85 13 95 01 09 01 91 00 85 14 95 01 09 01 91 00 85 15 95 01 09 01 91 00 85 16 95 15 09 01 91 00 85 17 95 06 09 01 91 00 85 18 95 15 09 01 91 00 85 19 95 01 09 01 91 00 85 1a 95 01 09 01 91 00 85 20 95 06 09 01 81 00 85 21 95 15 09 01 81 00 85 22 95 04 09 01 81 00 85 30 95 02 09 01 81 00 85 31 95 05 09 01 81 00 85 32 95 0a 09 01 81 00 85 33 95 11 09 01 81 00 85 34 95 15 09 01 81 00 85 35 95 15 09 01 81 00 85 36 95 15 09 01 81 00 85 37 95 15 09 01 81 00 85 3d 95 15 09 01 81 00 85 3e 95 15 09 01 81 00 85 3f 95 15 09 01 81 00 c0 00 Linux Kernel parsed HID output INPUT(32)[INPUT] Field(0) Usage(6) ff00.0001 ff00.0001 ff00.0001 ff00.0001 ff00.0001 ff00.0001 Logical Minimum(0) Logical Maximum(255) Report Size(8) Report Count(6) Report Offset(0) Flags( Array Absolute ) INPUT(33)[INPUT] Field(0) Usage(21) ff00.0001 ff00.0001 ff00.0001 ff00.0001 ff00.0001 ff00.0001 ff00.0001 ff00.0001 ff00.0001 ff00.0001 ff00.0001 ff00.0001 ff00.0001 ff00.0001 ff00.0001 ff00.0001 ff00.0001 ff00.0001 ff00.0001 ff00.0001 ff00.0001 Logical Minimum(0) Logical Maximum(255) Report Size(8) Report Count(21) Report Offset(0) Flags( Array Absolute ) INPUT(34)[INPUT] Field(0) Usage(4) ff00.0001 ff00.0001 ff00.0001 ff00.0001 Logical Minimum(0) Logical Maximum(255) Report Size(8) Report Count(4) Report Offset(0) Flags( Array Absolute ) INPUT(48)[INPUT] Field(0) Usage(2) ff00.0001 ff00.0001 Logical Minimum(0) Logical Maximum(255) Report Size(8) Report Count(2) Report Offset(0) Flags( Array Absolute ) INPUT(49)[INPUT] Field(0) Usage(5) ff00.0001 ff00.0001 ff00.0001 ff00.0001 ff00.0001 Logical Minimum(0) Logical Maximum(255) Report Size(8) Report Count(5) Report Offset(0) Flags( Array Absolute ) INPUT(50)[INPUT] Field(0) Usage(10) ff00.0001 ff00.0001 ff00.0001 ff00.0001 ff00.0001 ff00.0001 ff00.0001 ff00.0001 ff00.0001 ff00.0001 Logical Minimum(0) Logical Maximum(255) Report Size(8) Report Count(10) Report Offset(0) Flags( Array Absolute ) INPUT(51)[INPUT] Field(0) Usage(17) ff00.0001 ff00.0001 ff00.0001 ff00.0001 ff00.0001 ff00.0001 ff00.0001 ff00.0001 ff00.0001 ff00.0001 ff00.0001 ff00.0001 ff00.0001 ff00.0001 ff00.0001 ff00.0001 ff00.0001 Logical Minimum(0) Logical Maximum(255) Report Size(8) Report Count(17) Report Offset(0) Flags( Array Absolute ) INPUT(52)[INPUT] Field(0) Usage(21) ff00.0001 ff00.0001 ff00.0001 ff00.0001 ff00.0001 ff00.0001 ff00.0001 ff00.0001 ff00.0001 ff00.0001 ff00.0001 ff00.0001 ff00.0001 ff00.0001 ff00.0001 ff00.0001 ff00.0001 ff00.0001 ff00.0001 ff00.0001 ff00.0001 Logical Minimum(0) Logical Maximum(255) Report Size(8) Report Count(21) Report Offset(0) Flags( Array Absolute ) INPUT(53)[INPUT] Field(0) Usage(21) ff00.0001 ff00.0001 ff00.0001 ff00.0001 ff00.0001 ff00.0001 ff00.0001 ff00.0001 ff00.0001 ff00.0001 ff00.0001 ff00.0001 ff00.0001 ff00.0001 ff00.0001 ff00.0001 ff00.0001 ff00.0001 ff00.0001 ff00.0001 ff00.0001 Logical Minimum(0) Logical Maximum(255) Report Size(8) Report Count(21) Report Offset(0) Flags( Array Absolute ) INPUT(54)[INPUT] Field(0) Usage(21) ff00.0001 ff00.0001 ff00.0001 ff00.0001 ff00.0001 ff00.0001 ff00.0001 ff00.0001 ff00.0001 ff00.0001 ff00.0001 ff00.0001 ff00.0001 ff00.0001 ff00.0001 ff00.0001 ff00.0001 ff00.0001 ff00.0001 ff00.0001 ff00.0001 Logical Minimum(0) Logical Maximum(255) Report Size(8) Report Count(21) Report Offset(0) Flags( Array Absolute ) INPUT(55)[INPUT] Field(0) Usage(21) ff00.0001 ff00.0001 ff00.0001 ff00.0001 ff00.0001 ff00.0001 ff00.0001 ff00.0001 ff00.0001 ff00.0001 ff00.0001 ff00.0001 ff00.0001 ff00.0001 ff00.0001 ff00.0001 ff00.0001 ff00.0001 ff00.0001 ff00.0001 ff00.0001 Logical Minimum(0) Logical Maximum(255) Report Size(8) Report Count(21) Report Offset(0) Flags( Array Absolute ) INPUT(61)[INPUT] Field(0) Usage(21) ff00.0001 ff00.0001 ff00.0001 ff00.0001 ff00.0001 ff00.0001 ff00.0001 ff00.0001 ff00.0001 ff00.0001 ff00.0001 ff00.0001 ff00.0001 ff00.0001 ff00.0001 ff00.0001 ff00.0001 ff00.0001 ff00.0001 ff00.0001 ff00.0001 Logical Minimum(0) Logical Maximum(255) Report Size(8) Report Count(21) Report Offset(0) Flags( Array Absolute ) INPUT(62)[INPUT] Field(0) Usage(21) ff00.0001 ff00.0001 ff00.0001 ff00.0001 ff00.0001 ff00.0001 ff00.0001 ff00.0001 ff00.0001 ff00.0001 ff00.0001 ff00.0001 ff00.0001 ff00.0001 ff00.0001 ff00.0001 ff00.0001 ff00.0001 ff00.0001 ff00.0001 ff00.0001 Logical Minimum(0) Logical Maximum(255) Report Size(8) Report Count(21) Report Offset(0) Flags( Array Absolute ) INPUT(63)[INPUT] Field(0) Usage(21) ff00.0001 ff00.0001 ff00.0001 ff00.0001 ff00.0001 ff00.0001 ff00.0001 ff00.0001 ff00.0001 ff00.0001 ff00.0001 ff00.0001 ff00.0001 ff00.0001 ff00.0001 ff00.0001 ff00.0001 ff00.0001 ff00.0001 ff00.0001 ff00.0001 Logical Minimum(0) Logical Maximum(255) Report Size(8) Report Count(21) Report Offset(0) Flags( Array Absolute ) OUTPUT(16)[OUTPUT] Field(0) Usage(1) ff00.0001 Logical Minimum(0) Logical Maximum(255) Report Size(8) Report Count(1) Report Offset(0) Flags( Array Absolute ) OUTPUT(17)[OUTPUT] Field(0) Usage(1) ff00.0001 Logical Minimum(0) Logical Maximum(255) Report Size(8) Report Count(1) Report Offset(0) Flags( Array Absolute ) OUTPUT(18)[OUTPUT] Field(0) Usage(2) ff00.0001 ff00.0001 Logical Minimum(0) Logical Maximum(255) Report Size(8) Report Count(2) Report Offset(0) Flags( Array Absolute ) OUTPUT(19)[OUTPUT] Field(0) Usage(1) ff00.0001 Logical Minimum(0) Logical Maximum(255) Report Size(8) Report Count(1) Report Offset(0) Flags( Array Absolute ) OUTPUT(20)[OUTPUT] Field(0) Usage(1) ff00.0001 Logical Minimum(0) Logical Maximum(255) Report Size(8) Report Count(1) Report Offset(0) Flags( Array Absolute ) OUTPUT(21)[OUTPUT] Field(0) Usage(1) ff00.0001 Logical Minimum(0) Logical Maximum(255) Report Size(8) Report Count(1) Report Offset(0) Flags( Array Absolute ) OUTPUT(22)[OUTPUT] Field(0) Usage(21) ff00.0001 ff00.0001 ff00.0001 ff00.0001 ff00.0001 ff00.0001 ff00.0001 ff00.0001 ff00.0001 ff00.0001 ff00.0001 ff00.0001 ff00.0001 ff00.0001 ff00.0001 ff00.0001 ff00.0001 ff00.0001 ff00.0001 ff00.0001 ff00.0001 Logical Minimum(0) Logical Maximum(255) Report Size(8) Report Count(21) Report Offset(0) Flags( Array Absolute ) OUTPUT(23)[OUTPUT] Field(0) Usage(6) ff00.0001 ff00.0001 ff00.0001 ff00.0001 ff00.0001 ff00.0001 Logical Minimum(0) Logical Maximum(255) Report Size(8) Report Count(6) Report Offset(0) Flags( Array Absolute ) OUTPUT(24)[OUTPUT] Field(0) Usage(21) ff00.0001 ff00.0001 ff00.0001 ff00.0001 ff00.0001 ff00.0001 ff00.0001 ff00.0001 ff00.0001 ff00.0001 ff00.0001 ff00.0001 ff00.0001 ff00.0001 ff00.0001 ff00.0001 ff00.0001 ff00.0001 ff00.0001 ff00.0001 ff00.0001 Logical Minimum(0) Logical Maximum(255) Report Size(8) Report Count(21) Report Offset(0) Flags( Array Absolute ) OUTPUT(25)[OUTPUT] Field(0) Usage(1) ff00.0001 Logical Minimum(0) Logical Maximum(255) Report Size(8) Report Count(1) Report Offset(0) Flags( Array Absolute ) OUTPUT(26)[OUTPUT] Field(0) Usage(1) ff00.0001 Logical Minimum(0) Logical Maximum(255) Report Size(8) Report Count(1) Report Offset(0) Flags( Array Absolute ) xwiimote-2/doc/xwiimote.7000066400000000000000000000130561217476605100156020ustar00rootroot00000000000000.\" .\" Written 2012 by David Herrmann .\" Dedicated to the Public Domain .\" .TH "XWIIMOTE" 7 "August 2013" "David Herrmann" "Wii Remote Driver" .SH NAME XWiimote \- Nintendo Wii Remote Linux Device Driver .SH DESCRIPTION The XWiimote driver and utilities can be used to connect a Nintendo Wii Remote to your computer. It consists of a linux kernel driver, a BlueZ Bluetooth plugin and user-space utilities. They replace the old user-space drivers like .B cwiid or .B wiiuse. Since bluez-4.96 the .B wiimote plugin is available upstream and you should be able to pair your Wii Remote like any other Bluetooth device. If pairing fails, simply connect the Wii Remote without pairing/bonding. The .B linux kernel driver for the Wii Remote is available since linux-3.1 and full support for Wii Remotes since linux-3.3. It is called .B hid-wiimote and requires the HID core drivers to be loaded. No configuration is needed for the driver and plugin. The user-space utilities provide a library that can be used to monitor and access connected Wii Remotes and they provide several applications to manage connected Wii Remotes. .SS Connecting Wii Remotes To connect a Wii Remote to your host be sure that the official linux Bluetooth stack (BlueZ) is installed on your system and your kernel has the .B hid-wiimote kernel plugin loaded. Then connect your Wii Remote like any other Bluetooth device. The system log .B (dmesg) should print some messages about the new connected device. The Wii Remote can be put into discoverable mode by pressing the red sync-button behind the battery cover on the back. The Wii Remote will stay in discoverable mode for 20s. You can also hold the 1+2 buttons to put the Wii Remote into discoverable state. However, the first method works more reliably! If you are asked for PIN input while bonding the devices, then your BlueZ bluetoothd daemon does not include the wiimote plugin. See .B Bugs below for more information. If this does not help, you can still connect to your Wii Remote without pairing/bonding (i.e. not using authentication with a PIN). This should work with any BlueZ version. .SS User-Space Tools If you have a Wii Remote connected to your host you can test it with the .BR xwiishow (1) application. However, if you do not have the .B xwiimote user-space tools installed, you can find Wii Remotes with .br .B " ls /sys/module/hid_wiimote/drivers/hid:wiimote/" .br They are listed there with their device ID inside that directory. For example .B /sys/module/hid_wiimote/drivers/hid:wiimote/0005:057E:0306.0001 .br You can retrieve kernel information about the device by reading the files in this directory. .SS BlueZ wiimote plugin Since bluez-4.96 the bluetooth daemon includes a special wiimote plugin which handles wiimote pairing requests. If you pair a Wii Remote, the plugin will automatically generate the right PIN and pair the device. If you are asked for PIN input, you either do not have this plugin installed or your device is not detected. See .B BUGS for troubleshooting Wii Remote connection problems. .SS Wii Remote kernel driver The wiimote kernel driver is available since linux-3.1 in the official linux kernel. Since linux-3.2 the accelerometer and IR sensor are supported. Since linux-3.3 extension support is available. There is no need to configure this driver. All configuration should be done in the user-space utilities. The kernel driver provides a simple abstraction layer which does not need any configuration. With linux-3.11 the driver was rewritten to support extension hotplugging, device detection and more advanced functionality. It is highly recommended to use a kernel version greater than, or equal to 3.11. .SS libxwiimote The kernel API for the Wii Remote is quite complex. It is documented in the xwiimote source repository in .B doc/INTERFACE .br To help application developers to use special Wii Remote functionality, we developed the .BR libxwiimote (7) library which provides an easy API to manage connected Wii Remotes. If an application wants to use the IR or accelerometer sensors of a Wii Remote or if it requires advanced key-maps, it should use .B libxwiimote to access connected Wii Remotes. .SH BUGS .SS Connecting the Wii Remote requires PIN input If you are asked for PIN input while connecting your Wii Remote then you either do not have the BlueZ wiimote plugin installed or your device is not detected as a Wii Remote. This might happen with 3rd party Wii Remotes which are not sold by Nintendo. You can still use these devices by connecting them without pairing or bonding. Tools like gnome-bluetooth require you to select "Use no PIN" to connect devices without pairing/bonding. There are attempts to improve the detection of Wii Remotes in BlueZ. If you are sure that your device is not detected properly, please report a bug upstream. .SS The X-Server reacts weirdly on Wii Remote input By default the X-Server opens all input devices that are available on your machine. The Wii Remote input devices are very useless without a proper keymap so you should instruct your X-Server to ignore raw Wii Remotes input devices. The xwiimote source repository contains an xorg-config file .B res/50-xorg-disable-wiimote.conf which can be installed into .B /etc/X11/xorg.conf.d/ to ignore all raw Wii Remote input devices. .br This only ignores raw Wii Remote devices. If you used some of the user-space utilities to remap the buttons then the new devices will still be detected by your X-Server. .SH AUTHOR David Herrmann .br The XWiimote Project: http://dvdhrm.github.io/xwiimote .SH "SEE ALSO" .BR libxwiimote (7), .BR xwiishow (1) xwiimote-2/doc/xwiishow.1000066400000000000000000000034631217476605100156110ustar00rootroot00000000000000.\" .\" Written 2012 by David Herrmann .\" Dedicated to the Public Domain .\" .TH "XWIISHOW" 1 "February 2012" "David Herrmann" "Wii Remote Driver" .SH NAME xwiishow \- Test connected Wii Remote devices .SH SYNOPSIS .B xwiishow [-h] .br .B xwiishow list .br .B xwiishow .br .B xwiishow /sys/bus/hid/devices/ .SH DESCRIPTION The .B xwiishow tool, when called without arguments, shows a short usage information. If the .B list parameter is given, it lists all connected Wii Remotes. Each connected Wii Remote is given a number. If you pass this number to .B xwiishow then this device is opened and the UI shows a graphical representation of the device. Instead of passing this number you can also pass an absolute path to the device-root in the sysfs directory. In the ncurses-based interface you can press 'q' to quit the application, 'r' to toggle the rumble motor and 'a' to toggle the accelerometer. See the xwiishow help text for a more comprehensive list of shortcuts. .SH EXAMPLES .B $ xwiishow list .br No device path given. Listing devices: .br Found device: /sys/devices/pci0000:00/0000:00:1d.1/usb3/3-2/3-2:1.0/bluetooth/hci0/hci0:11/0005:057E:0306.0001 .br End of device list .B $ xwiishow /sys/devices/pci0000:00/0000:00:1d.1/usb3/3-2/3-2:1.0/bluetooth/hci0/hci0:11/0005:057E:0306.0001 .br .SH BUGS This tool is quite incomplete. It does not support all interfaces that are provided by the wiimote kernel driver. However, it provides enough functionality to test whether a Wii Remote is detected properly. The tool reads the input devices directly so you might need root rights to properly access the Wii Remote. .SH AUTHOR David Herrmann .br The XWiimote Project: http://dvdhrm.github.io/xwiimote .SH "SEE ALSO" .BR xwiimote (7), .BR libxwiimote (7), xwiimote-2/lib/000077500000000000000000000000001217476605100136415ustar00rootroot00000000000000xwiimote-2/lib/core.c000066400000000000000000000751451217476605100147510ustar00rootroot00000000000000/* * XWiimote - lib * Written 2010-2013 by David Herrmann * Dedicated to the Public Domain */ #include #include #include #include #include #include #include #include #include #include #include #include #include "xwiimote.h" /* interfaces */ enum xwii_if_base_idx { /* base interfaces */ XWII_IF_CORE, XWII_IF_ACCEL, XWII_IF_IR, /* extension interfaces */ XWII_IF_MOTION_PLUS, XWII_IF_NUNCHUK, XWII_IF_CLASSIC_CONTROLLER, XWII_IF_BALANCE_BOARD, XWII_IF_PRO_CONTROLLER, XWII_IF_NUM, }; /* event interface */ struct xwii_if { /* device node as /dev/input/eventX or NULL */ char *node; /* open file or -1 */ int fd; /* temporary state during device detection */ unsigned int available : 1; }; /* main device interface */ struct xwii_iface { /* reference count */ size_t ref; /* epoll file descriptor */ int efd; /* udev context */ struct udev *udev; /* main udev device */ struct udev_device *dev; /* udev monitor */ struct udev_monitor *umon; /* bitmask of open interfaces */ unsigned int ifaces; /* interfaces */ struct xwii_if ifs[XWII_IF_NUM]; /* device type attribute */ char *devtype_attr; /* extension attribute */ char *extension_attr; /* battery capacity attribute */ char *battery_attr; /* led brightness attributes */ char *led_attrs[4]; /* rumble-id for base-core interface force-feedback or -1 */ int rumble_id; /* accelerometer data cache */ struct xwii_event_abs accel_cache; /* IR data cache */ struct xwii_event_abs ir_cache[4]; /* balance board weight cache */ struct xwii_event_abs bboard_cache[4]; /* motion plus cache */ struct xwii_event_abs mp_cache; /* motion plus normalization */ struct xwii_event_abs mp_normalizer; int32_t mp_normalize_factor; /* pro controller cache */ struct xwii_event_abs pro_cache[2]; }; /* table to convert interface to name */ static const char *if_to_name_table[] = { [XWII_IF_CORE] = XWII_NAME_CORE, [XWII_IF_ACCEL] = XWII_NAME_ACCEL, [XWII_IF_IR] = XWII_NAME_IR, [XWII_IF_MOTION_PLUS] = XWII_NAME_MOTION_PLUS, [XWII_IF_NUNCHUK] = XWII_NAME_NUNCHUK, [XWII_IF_CLASSIC_CONTROLLER] = XWII_NAME_CLASSIC_CONTROLLER, [XWII_IF_BALANCE_BOARD] = XWII_NAME_BALANCE_BOARD, [XWII_IF_PRO_CONTROLLER] = XWII_NAME_PRO_CONTROLLER, [XWII_IF_NUM] = NULL, }; /* convert name to interface or -1 */ static int name_to_if(const char *name) { unsigned int i; for (i = 0; i < XWII_IF_NUM; ++i) if (!strcmp(name, if_to_name_table[i])) return i; return -1; } /* table to convert interface to public interface */ static unsigned int if_to_iface_table[] = { [XWII_IF_CORE] = XWII_IFACE_CORE, [XWII_IF_ACCEL] = XWII_IFACE_ACCEL, [XWII_IF_IR] = XWII_IFACE_IR, [XWII_IF_MOTION_PLUS] = XWII_IFACE_MOTION_PLUS, [XWII_IF_NUNCHUK] = XWII_IFACE_NUNCHUK, [XWII_IF_CLASSIC_CONTROLLER] = XWII_IFACE_CLASSIC_CONTROLLER, [XWII_IF_BALANCE_BOARD] = XWII_IFACE_BALANCE_BOARD, [XWII_IF_PRO_CONTROLLER] = XWII_IFACE_PRO_CONTROLLER, [XWII_IF_NUM] = 0, }; /* convert name to interface or -1 */ static int if_to_iface(unsigned int ifs) { return if_to_iface_table[ifs]; } /* * Scan the device \dev for child input devices and update our device-node * cache with the new information. This is called during device setup to * find all /dev/input/eventX nodes for all currently available interfaces. * We also cache attribute paths for sub-devices like LEDs or batteries. * * When called during hotplug-events, this updates all currently known * information and removes nodes that are no longer present. */ static int xwii_iface_read_nodes(struct xwii_iface *dev) { struct udev_enumerate *e; struct udev_list_entry *list; struct udev_device *d; const char *name, *node, *subs; char *n; int ret, prev_if, tif, len, i; unsigned int ifs; e = udev_enumerate_new(dev->udev); if (!e) return -ENOMEM; ret = udev_enumerate_add_match_subsystem(e, "input"); ret += udev_enumerate_add_match_subsystem(e, "leds"); ret += udev_enumerate_add_match_subsystem(e, "power_supply"); ret += udev_enumerate_add_match_parent(e, dev->dev); if (ret) { udev_enumerate_unref(e); return -ENOMEM; } ret = udev_enumerate_scan_devices(e); if (ret) { udev_enumerate_unref(e); return ret; } for (i = 0; i < XWII_IF_NUM; ++i) dev->ifs[i].available = 0; /* The returned list is sorted. So we first get an inputXY entry, * possibly followed by the inputXY/eventXY entry. We remember the type * of a found inputXY entry, and check the next list-entry, whether * it's an eventXY entry. If it is, we save the node, otherwise, it's * skipped. * For other subsystems we simply cache the attribute paths. */ prev_if = -1; for (list = udev_enumerate_get_list_entry(e); list; list = udev_list_entry_get_next(list), udev_device_unref(d)) { tif = prev_if; prev_if = -1; name = udev_list_entry_get_name(list); d = udev_device_new_from_syspath(dev->udev, name); if (!d) continue; subs = udev_device_get_subsystem(d); if (!strcmp(subs, "input")) { name = udev_device_get_sysname(d); if (!strncmp(name, "input", 5)) { name = udev_device_get_sysattr_value(d, "name"); if (!name) continue; tif = name_to_if(name); if (tif >= 0) prev_if = tif; } else if (!strncmp(name, "event", 5)) { if (tif < 0) continue; node = udev_device_get_devnode(d); if (!node) continue; if (dev->ifs[tif].node && !strcmp(node, dev->ifs[tif].node)) { dev->ifs[tif].available = 1; continue; } else if (dev->ifs[tif].node) { xwii_iface_close(dev, if_to_iface(tif)); free(dev->ifs[tif].node); dev->ifs[tif].node = NULL; } n = strdup(node); if (!n) continue; dev->ifs[tif].node = n; dev->ifs[tif].available = 1; } } else if (!strcmp(subs, "leds")) { len = strlen(name); if (name[len - 1] == '0') i = 0; else if (name[len - 1] == '1') i = 1; else if (name[len - 1] == '2') i = 2; else if (name[len - 1] == '3') i = 3; else continue; if (dev->led_attrs[i]) continue; ret = asprintf(&dev->led_attrs[i], "%s/%s", name, "brightness"); if (ret <= 0) dev->led_attrs[i] = NULL; } else if (!strcmp(subs, "power_supply")) { if (dev->battery_attr) continue; ret = asprintf(&dev->battery_attr, "%s/%s", name, "capacity"); if (ret <= 0) dev->battery_attr = NULL; } } udev_enumerate_unref(e); /* close no longer available ifaces */ ifs = 0; for (i = 0; i < XWII_IF_NUM; ++i) { if (!dev->ifs[i].available && dev->ifs[i].node) { free(dev->ifs[i].node); dev->ifs[i].node = NULL; ifs |= if_to_iface(i); } } xwii_iface_close(dev, ifs); return 0; } /* * Create new interface structure * This creates a new interface for a single Wii Remote device. \syspath must * point to the base-directory of the device. It can normally be found as: * /sys/bus/hid/devices/ * The device is validated and 0 is returned on success. On failure, a negative * error code is returned. * A pointer to the new object is stored in \dev. \dev is left untouched on * failure. * Initial refcount is 1 so you need to call *_unref() to free the device. */ XWII__EXPORT int xwii_iface_new(struct xwii_iface **dev, const char *syspath) { struct xwii_iface *d; const char *driver, *subs; int ret, i; if (!dev || !syspath) return -EINVAL; d = malloc(sizeof(*d)); if (!d) return -ENOMEM; memset(d, 0, sizeof(*d)); d->ref = 1; d->rumble_id = -1; for (i = 0; i < XWII_IF_NUM; ++i) d->ifs[i].fd = -1; d->efd = epoll_create1(EPOLL_CLOEXEC); if (d->efd < 0) { ret = -EFAULT; goto err_free; } d->udev = udev_new(); if (!d->udev) { ret = -ENOMEM; goto err_efd; } d->dev = udev_device_new_from_syspath(d->udev, syspath); if (!d->dev) { ret = -ENODEV; goto err_udev; } driver = udev_device_get_driver(d->dev); subs = udev_device_get_subsystem(d->dev); if (!driver || strcmp(driver, "wiimote") || !subs || strcmp(subs, "hid")) { ret = -ENODEV; goto err_dev; } ret = asprintf(&d->devtype_attr, "%s/%s", syspath, "devtype"); if (ret <= 0) { ret = -ENOMEM; goto err_dev; } ret = asprintf(&d->extension_attr, "%s/%s", syspath, "extension"); if (ret <= 0) { ret = -ENOMEM; goto err_attrs; } ret = xwii_iface_read_nodes(d); if (ret) goto err_attrs; *dev = d; return 0; err_attrs: free(d->extension_attr); free(d->devtype_attr); err_dev: udev_device_unref(d->dev); err_udev: udev_unref(d->udev); err_efd: close(d->efd); err_free: free(d); return ret; } XWII__EXPORT void xwii_iface_ref(struct xwii_iface *dev) { if (!dev || !dev->ref) return; dev->ref++; } XWII__EXPORT void xwii_iface_unref(struct xwii_iface *dev) { unsigned int i; if (!dev || !dev->ref || --dev->ref) return; xwii_iface_close(dev, XWII_IFACE_ALL); xwii_iface_watch(dev, false); for (i = 0; i < XWII_IF_NUM; ++i) free(dev->ifs[i].node); for (i = 0; i < 4; ++i) free(dev->led_attrs[i]); free(dev->battery_attr); free(dev->extension_attr); free(dev->devtype_attr); udev_device_unref(dev->dev); udev_unref(dev->udev); close(dev->efd); free(dev); } XWII__EXPORT int xwii_iface_get_fd(struct xwii_iface *dev) { if (!dev) return -1; return dev->efd; } XWII__EXPORT int xwii_iface_watch(struct xwii_iface *dev, bool watch) { int fd, ret; struct epoll_event ep; if (!dev) return -EINVAL; if (!watch) { /* remove device watch descriptor */ if (!dev->umon) return 0; fd = udev_monitor_get_fd(dev->umon); epoll_ctl(dev->efd, EPOLL_CTL_DEL, fd, NULL); udev_monitor_unref(dev->umon); dev->umon = NULL; return 0; } /* add device watch descriptor */ if (dev->umon) return 0; dev->umon = udev_monitor_new_from_netlink(dev->udev, "udev"); if (!dev->umon) return -ENOMEM; ret = udev_monitor_filter_add_match_subsystem_devtype(dev->umon, "input", NULL); if (ret) { ret = -errno; goto err_mon; } ret = udev_monitor_filter_add_match_subsystem_devtype(dev->umon, "hid", NULL); if (ret) { ret = -errno; goto err_mon; } ret = udev_monitor_enable_receiving(dev->umon); if (ret) { ret = -errno; goto err_mon; } fd = udev_monitor_get_fd(dev->umon); memset(&ep, 0, sizeof(ep)); ep.events = EPOLLIN; ep.data.ptr = dev->umon; ret = epoll_ctl(dev->efd, EPOLL_CTL_ADD, fd, &ep); if (ret) { ret = -errno; goto err_mon; } return 0; err_mon: udev_monitor_unref(dev->umon); dev->umon = NULL; return ret; } static int xwii_iface_open_if(struct xwii_iface *dev, unsigned int tif, bool wr) { char name[256]; struct epoll_event ep; unsigned int flags; int fd, err; if (dev->ifs[tif].fd >= 0) return 0; if (!dev->ifs[tif].node) return -ENODEV; flags = O_NONBLOCK | O_CLOEXEC; flags |= wr ? O_RDWR : O_RDONLY; fd = open(dev->ifs[tif].node, flags); if (fd < 0) return -errno; if (ioctl(fd, EVIOCGNAME(sizeof(name)), name) < 0) { close(fd); return -errno; } name[sizeof(name) - 1] = 0; if (strcmp(if_to_name_table[tif], name)) { close(fd); return -ENODEV; } memset(&ep, 0, sizeof(ep)); ep.events = EPOLLIN; ep.data.ptr = &dev->ifs[tif]; if (epoll_ctl(dev->efd, EPOLL_CTL_ADD, fd, &ep) < 0) { err = -errno; close(fd); return err; } dev->ifs[tif].fd = fd; return 0; } /* * Upload the generic rumble event to the device. This may later be used for * force-feedback effects. The event id is safed for later use. */ static void xwii_iface_upload_rumble(struct xwii_iface *dev) { struct ff_effect effect = { .type = FF_RUMBLE, .id = -1, .u.rumble.strong_magnitude = 1, .replay.length = 0, .replay.delay = 0, }; if (ioctl(dev->ifs[XWII_IF_CORE].fd, EVIOCSFF, &effect) != -1) dev->rumble_id = effect.id; } XWII__EXPORT int xwii_iface_open(struct xwii_iface *dev, unsigned int ifaces) { bool wr; int ret, err; if (!dev) return -EINVAL; wr = ifaces & XWII_IFACE_WRITABLE; ifaces &= XWII_IFACE_ALL; ifaces &= ~dev->ifaces; if (!ifaces) return 0; err = 0; if (ifaces & XWII_IFACE_CORE) { ret = xwii_iface_open_if(dev, XWII_IF_CORE, wr); if (!ret) { dev->ifaces |= XWII_IFACE_CORE; xwii_iface_upload_rumble(dev); } else { err = ret; } } if (ifaces & XWII_IFACE_ACCEL) { ret = xwii_iface_open_if(dev, XWII_IF_ACCEL, wr); if (!ret) dev->ifaces |= XWII_IFACE_ACCEL; else err = ret; } if (ifaces & XWII_IFACE_IR) { ret = xwii_iface_open_if(dev, XWII_IF_IR, wr); if (!ret) dev->ifaces |= XWII_IFACE_IR; else err = ret; } if (ifaces & XWII_IFACE_MOTION_PLUS) { ret = xwii_iface_open_if(dev, XWII_IF_MOTION_PLUS, wr); if (!ret) dev->ifaces |= XWII_IFACE_MOTION_PLUS; else err = ret; } if (ifaces & XWII_IFACE_BALANCE_BOARD) { ret = xwii_iface_open_if(dev, XWII_IF_BALANCE_BOARD, wr); if (!ret) dev->ifaces |= XWII_IFACE_BALANCE_BOARD; else err = ret; } if (ifaces & XWII_IFACE_PRO_CONTROLLER) { ret = xwii_iface_open_if(dev, XWII_IF_PRO_CONTROLLER, wr); if (!ret) dev->ifaces |= XWII_IFACE_PRO_CONTROLLER; else err = ret; } return err; } static void xwii_iface_close_if(struct xwii_iface *dev, unsigned int tif) { if (dev->ifs[tif].fd < 0) return; epoll_ctl(dev->efd, EPOLL_CTL_DEL, dev->ifs[tif].fd, NULL); close(dev->ifs[tif].fd); dev->ifs[tif].fd = -1; } XWII__EXPORT void xwii_iface_close(struct xwii_iface *dev, unsigned int ifaces) { if (!dev) return; ifaces &= XWII_IFACE_ALL; if (!ifaces) return; if (ifaces & XWII_IFACE_CORE) { xwii_iface_close_if(dev, XWII_IF_CORE); dev->rumble_id = -1; } if (ifaces & XWII_IFACE_ACCEL) xwii_iface_close_if(dev, XWII_IF_ACCEL); if (ifaces & XWII_IFACE_IR) xwii_iface_close_if(dev, XWII_IF_IR); if (ifaces & XWII_IFACE_MOTION_PLUS) xwii_iface_close_if(dev, XWII_IF_MOTION_PLUS); if (ifaces & XWII_IFACE_NUNCHUK) xwii_iface_close_if(dev, XWII_IF_NUNCHUK); if (ifaces & XWII_IFACE_CLASSIC_CONTROLLER) xwii_iface_close_if(dev, XWII_IF_CLASSIC_CONTROLLER); if (ifaces & XWII_IFACE_BALANCE_BOARD) xwii_iface_close_if(dev, XWII_IF_BALANCE_BOARD); if (ifaces & XWII_IFACE_PRO_CONTROLLER) xwii_iface_close_if(dev, XWII_IF_PRO_CONTROLLER); dev->ifaces &= ~ifaces; } XWII__EXPORT unsigned int xwii_iface_opened(struct xwii_iface *dev) { if (!dev) return 0; return dev->ifaces; } XWII__EXPORT unsigned int xwii_iface_available(struct xwii_iface *dev) { unsigned int ifs = 0, i; if (!dev) return 0; for (i = 0; i < XWII_IF_NUM; ++i) ifs |= dev->ifs[i].node ? if_to_iface(i) : 0; return ifs; } static int read_umon(struct xwii_iface *dev, struct epoll_event *ep, struct xwii_event *ev) { struct udev_device *ndev, *p; const char *act, *path, *npath, *ppath, *node; bool hotplug; if (ep->events & EPOLLIN) { hotplug = false; path = udev_device_get_syspath(dev->dev); /* try to merge as many hotplug events as possible */ while (true) { ndev = udev_monitor_receive_device(dev->umon); if (!ndev) break; /* We are interested in two kinds of events: * 1) "change" events on the main HID device notify * us of device-detection events. * 2) "add"/"remove" events on input events (not * the evdev events with "devnode") notify us * of extension changes. */ act = udev_device_get_action(ndev); npath = udev_device_get_syspath(ndev); node = udev_device_get_devnode(ndev); p = udev_device_get_parent_with_subsystem_devtype(ndev, "hid", NULL); if (p) ppath = udev_device_get_syspath(p); if (act && !strcmp(act, "change") && !strcmp(path, npath)) hotplug = true; else if (!node && p && !strcmp(ppath, path)) hotplug = true; udev_device_unref(ndev); } /* notify caller via generic hotplug event */ if (hotplug) { memset(ev, 0, sizeof(*ev)); ev->type = XWII_EVENT_WATCH; xwii_iface_read_nodes(dev); return 0; } } if (ep->events & (EPOLLHUP | EPOLLERR)) return -EPIPE; return -EAGAIN; } static int read_event(int fd, struct input_event *ev) { int ret; ret = read(fd, ev, sizeof(*ev)); if (ret < 0) return -errno; else if (ret == 0) return -EAGAIN; else if (ret != sizeof(*ev)) return -EIO; else return 0; } static int read_core(struct xwii_iface *dev, struct xwii_event *ev) { int ret, fd; struct input_event input; unsigned int key; fd = dev->ifs[XWII_IF_CORE].fd; if (fd < 0) return -EAGAIN; try_again: ret = read_event(fd, &input); if (ret == -EAGAIN) { return -EAGAIN; } else if (ret < 0) { xwii_iface_close(dev, XWII_IFACE_CORE); memset(ev, 0, sizeof(*ev)); ev->type = XWII_EVENT_WATCH; xwii_iface_read_nodes(dev); return 0; } if (input.type != EV_KEY) goto try_again; if (input.value < 0 || input.value > 2) goto try_again; switch (input.code) { case KEY_LEFT: key = XWII_KEY_LEFT; break; case KEY_RIGHT: key = XWII_KEY_RIGHT; break; case KEY_UP: key = XWII_KEY_UP; break; case KEY_DOWN: key = XWII_KEY_DOWN; break; case KEY_NEXT: key = XWII_KEY_PLUS; break; case KEY_PREVIOUS: key = XWII_KEY_MINUS; break; case BTN_1: key = XWII_KEY_ONE; break; case BTN_2: key = XWII_KEY_TWO; break; case BTN_A: key = XWII_KEY_A; break; case BTN_B: key = XWII_KEY_B; break; case BTN_MODE: key = XWII_KEY_HOME; break; default: goto try_again; } memset(ev, 0, sizeof(*ev)); memcpy(&ev->time, &input.time, sizeof(struct timeval)); ev->type = XWII_EVENT_KEY; ev->v.key.code = key; ev->v.key.state = input.value; return 0; } static int read_accel(struct xwii_iface *dev, struct xwii_event *ev) { int ret, fd; struct input_event input; fd = dev->ifs[XWII_IF_ACCEL].fd; if (fd < 0) return -EAGAIN; try_again: ret = read_event(fd, &input); if (ret == -EAGAIN) { return -EAGAIN; } else if (ret < 0) { xwii_iface_close(dev, XWII_IFACE_ACCEL); memset(ev, 0, sizeof(*ev)); ev->type = XWII_EVENT_WATCH; xwii_iface_read_nodes(dev); return 0; } if (input.type == EV_SYN) { memset(ev, 0, sizeof(*ev)); memcpy(&ev->time, &input.time, sizeof(struct timeval)); memcpy(ev->v.abs, &dev->accel_cache, sizeof(dev->accel_cache)); ev->type = XWII_EVENT_ACCEL; return 0; } if (input.type != EV_ABS) goto try_again; if (input.code == ABS_RX) dev->accel_cache.x = input.value; else if (input.code == ABS_RY) dev->accel_cache.y = input.value; else if (input.code == ABS_RZ) dev->accel_cache.z = input.value; goto try_again; } static int read_ir(struct xwii_iface *dev, struct xwii_event *ev) { int ret, fd; struct input_event input; fd = dev->ifs[XWII_IF_IR].fd; if (fd < 0) return -EAGAIN; try_again: ret = read_event(fd, &input); if (ret == -EAGAIN) { return -EAGAIN; } else if (ret < 0) { xwii_iface_close(dev, XWII_IFACE_IR); memset(ev, 0, sizeof(*ev)); ev->type = XWII_EVENT_WATCH; xwii_iface_read_nodes(dev); return 0; } if (input.type == EV_SYN) { memset(ev, 0, sizeof(*ev)); memcpy(&ev->time, &input.time, sizeof(struct timeval)); memcpy(&ev->v.abs, dev->ir_cache, sizeof(dev->ir_cache)); ev->type = XWII_EVENT_IR; return 0; } if (input.type != EV_ABS) goto try_again; if (input.code == ABS_HAT0X) dev->ir_cache[0].x = input.value; else if (input.code == ABS_HAT0Y) dev->ir_cache[0].y = input.value; else if (input.code == ABS_HAT1X) dev->ir_cache[1].x = input.value; else if (input.code == ABS_HAT1Y) dev->ir_cache[1].y = input.value; else if (input.code == ABS_HAT2X) dev->ir_cache[2].x = input.value; else if (input.code == ABS_HAT2Y) dev->ir_cache[2].y = input.value; else if (input.code == ABS_HAT3X) dev->ir_cache[3].x = input.value; else if (input.code == ABS_HAT3Y) dev->ir_cache[3].y = input.value; goto try_again; } static int read_mp(struct xwii_iface *dev, struct xwii_event *ev) { int ret, fd; struct input_event input; fd = dev->ifs[XWII_IF_MOTION_PLUS].fd; if (fd < 0) return -EAGAIN; try_again: ret = read_event(fd, &input); if (ret == -EAGAIN) { return -EAGAIN; } else if (ret < 0) { xwii_iface_close(dev, XWII_IFACE_MOTION_PLUS); memset(ev, 0, sizeof(*ev)); ev->type = XWII_EVENT_WATCH; xwii_iface_read_nodes(dev); return 0; } if (input.type == EV_SYN) { memset(ev, 0, sizeof(*ev)); memcpy(&ev->time, &input.time, sizeof(struct timeval)); ev->v.abs[0].x = dev->mp_cache.x - dev->mp_normalizer.x / 100; ev->v.abs[0].y = dev->mp_cache.y - dev->mp_normalizer.y / 100; ev->v.abs[0].z = dev->mp_cache.z - dev->mp_normalizer.z / 100; dev->mp_normalizer.x += dev->mp_normalize_factor * ((ev->v.abs[0].x > 0) ? 1 : -1); dev->mp_normalizer.y += dev->mp_normalize_factor * ((ev->v.abs[0].y > 0) ? 1 : -1); dev->mp_normalizer.z += dev->mp_normalize_factor * ((ev->v.abs[0].z > 0) ? 1 : -1); ev->type = XWII_EVENT_MOTION_PLUS; return 0; } if (input.type != EV_ABS) goto try_again; if (input.code == ABS_RX) dev->mp_cache.x = input.value; else if (input.code == ABS_RY) dev->mp_cache.y = input.value; else if (input.code == ABS_RZ) dev->mp_cache.z = input.value; goto try_again; } static int read_bboard(struct xwii_iface *dev, struct xwii_event *ev) { int ret, fd; struct input_event input; fd = dev->ifs[XWII_IF_BALANCE_BOARD].fd; if (fd < 0) return -EAGAIN; try_again: ret = read_event(fd, &input); if (ret == -EAGAIN) { return -EAGAIN; } else if (ret < 0) { xwii_iface_close(dev, XWII_IFACE_BALANCE_BOARD); memset(ev, 0, sizeof(*ev)); ev->type = XWII_EVENT_WATCH; xwii_iface_read_nodes(dev); return 0; } if (input.type == EV_SYN) { memset(ev, 0, sizeof(*ev)); memcpy(&ev->time, &input.time, sizeof(struct timeval)); memcpy(&ev->v.abs, dev->bboard_cache, sizeof(dev->bboard_cache)); ev->type = XWII_EVENT_BALANCE_BOARD; return 0; } if (input.type != EV_ABS) goto try_again; if (input.code == ABS_HAT0X) dev->bboard_cache[0].x = input.value; else if (input.code == ABS_HAT0Y) dev->bboard_cache[1].x = input.value; else if (input.code == ABS_HAT1X) dev->bboard_cache[2].x = input.value; else if (input.code == ABS_HAT1Y) dev->bboard_cache[3].x = input.value; goto try_again; } static int read_pro(struct xwii_iface *dev, struct xwii_event *ev) { int ret, fd; struct input_event input; unsigned int key; fd = dev->ifs[XWII_IF_PRO_CONTROLLER].fd; if (fd < 0) return -EAGAIN; try_again: ret = read_event(fd, &input); if (ret == -EAGAIN) { return -EAGAIN; } else if (ret < 0) { xwii_iface_close(dev, XWII_IFACE_PRO_CONTROLLER); memset(ev, 0, sizeof(*ev)); ev->type = XWII_EVENT_WATCH; xwii_iface_read_nodes(dev); return 0; } if (input.type == EV_KEY) { if (input.value < 0 || input.value > 2) goto try_again; switch (input.code) { #ifndef BTN_EAST #define BTN_EAST 0x131 #endif case BTN_EAST: key = XWII_KEY_A; break; #ifndef BTN_SOUTH #define BTN_SOUTH 0x130 #endif case BTN_SOUTH: key = XWII_KEY_B; break; #ifndef BTN_NORTH #define BTN_NORTH 0x133 #endif case BTN_NORTH: key = XWII_KEY_X; break; #ifndef BTN_WEST #define BTN_WEST 0x134 #endif case BTN_WEST: key = XWII_KEY_Y; break; case BTN_START: key = XWII_KEY_PLUS; break; case BTN_SELECT: key = XWII_KEY_MINUS; break; case BTN_MODE: key = XWII_KEY_HOME; break; #ifndef BTN_DPAD_LEFT #define BTN_DPAD_LEFT 0x222 #endif case BTN_DPAD_LEFT: key = XWII_KEY_LEFT; break; #ifndef BTN_DPAD_RIGHT #define BTN_DPAD_RIGHT 0x223 #endif case BTN_DPAD_RIGHT: key = XWII_KEY_RIGHT; break; #ifndef BTN_DPAD_UP #define BTN_DPAD_UP 0x220 #endif case BTN_DPAD_UP: key = XWII_KEY_UP; break; #ifndef BTN_DPAD_DOWN #define BTN_DPAD_DOWN 0x221 #endif case BTN_DPAD_DOWN: key = XWII_KEY_DOWN; break; case BTN_TL: key = XWII_KEY_TL; break; case BTN_TR: key = XWII_KEY_TR; break; case BTN_TL2: key = XWII_KEY_ZL; break; case BTN_TR2: key = XWII_KEY_ZR; break; case BTN_THUMBL: key = XWII_KEY_THUMBL; break; case BTN_THUMBR: key = XWII_KEY_THUMBR; break; default: goto try_again; } memset(ev, 0, sizeof(*ev)); memcpy(&ev->time, &input.time, sizeof(struct timeval)); ev->type = XWII_EVENT_PRO_CONTROLLER_KEY; ev->v.key.code = key; ev->v.key.state = input.value; return 0; } else if (input.type == EV_ABS) { if (input.code == ABS_X) dev->pro_cache[0].x = input.value; else if (input.code == ABS_Y) dev->pro_cache[0].y = input.value; else if (input.code == ABS_RX) dev->pro_cache[1].x = input.value; else if (input.code == ABS_RY) dev->pro_cache[1].y = input.value; } else if (input.type == EV_SYN) { memset(ev, 0, sizeof(*ev)); memcpy(&ev->time, &input.time, sizeof(struct timeval)); memcpy(&ev->v.abs, dev->pro_cache, sizeof(dev->pro_cache)); ev->type = XWII_EVENT_PRO_CONTROLLER_MOVE; return 0; } else { } goto try_again; } static int dispatch_event(struct xwii_iface *dev, struct epoll_event *ep, struct xwii_event *ev) { if (dev->umon && ep->data.ptr == dev->umon) return read_umon(dev, ep, ev); else if (ep->data.ptr == &dev->ifs[XWII_IF_CORE]) return read_core(dev, ev); else if (ep->data.ptr == &dev->ifs[XWII_IF_ACCEL]) return read_accel(dev, ev); else if (ep->data.ptr == &dev->ifs[XWII_IF_IR]) return read_ir(dev, ev); else if (ep->data.ptr == &dev->ifs[XWII_IF_MOTION_PLUS]) return read_mp(dev, ev); else if (ep->data.ptr == &dev->ifs[XWII_IF_BALANCE_BOARD]) return read_bboard(dev, ev); else if (ep->data.ptr == &dev->ifs[XWII_IF_PRO_CONTROLLER]) return read_pro(dev, ev); return -EAGAIN; } /* * Poll for events on device \dev. * * This function always performs any outstanding I/O. If this fails, an error * is returned. * * If @ev is NULL, nothing else is done and 0 is returned. * * If @ev is non-NULL, this function reads incoming events from the kernel. If * no event is available, -EAGAIN is returned. Otherwise, 0 is returned and a * single event is stored in @ev. You should call this function in a row until * it returns -EAGAIN to get all events. * * Once this function returns -EAGAIN, you must watch the descriptor returned * by xwii_iface_get_fd() for POLLIN/EPOLLIN/read-events. No other events * need to be watched for. * Once this fd is readable, you should call xwii_iface_poll() again. * * If an interface gets closed or some hotplug event is detected, this * function returns XWII_EVENT_WATCH. This event does not provide any payload * and you need to re-open any interfaces if they got closed. */ XWII__EXPORT int xwii_iface_poll(struct xwii_iface *dev, struct xwii_event *ev) { struct epoll_event ep[32]; int ret, i; size_t siz; if (!dev) return -EFAULT; /* write outgoing events here */ if (!ev) return 0; siz = sizeof(ep) / sizeof(*ep); ret = epoll_wait(dev->efd, ep, siz, 0); if (ret < 0) return -errno; if (ret > siz) ret = siz; for (i = 0; i < ret; ++i) { ret = dispatch_event(dev, &ep[i], ev); if (ret != -EAGAIN) return ret; } return -EAGAIN; } XWII__EXPORT int xwii_iface_dispatch(struct xwii_iface *dev, struct xwii_event *u_ev, size_t size) { struct epoll_event ep[32]; int ret, i; size_t siz; struct xwii_event ev; if (!dev) return -EFAULT; /* write outgoing events here */ if (!u_ev || size <= 0) return 0; if (size > sizeof(ev)) size = sizeof(ev); siz = sizeof(ep) / sizeof(*ep); ret = epoll_wait(dev->efd, ep, siz, 0); if (ret < 0) return -errno; if (ret > siz) ret = siz; for (i = 0; i < ret; ++i) { ret = dispatch_event(dev, &ep[i], &ev); if (ret != -EAGAIN) { if (!ret) memcpy(u_ev, &ev, size); return ret; } } return -EAGAIN; } /* * Toogle wiimote rumble motor * Enable or disable the rumble motor of \dev depending on \on. This requires * the core interface to be opened. */ XWII__EXPORT int xwii_iface_rumble(struct xwii_iface *dev, bool on) { struct input_event ev; int ret, fd; if (!dev) return -EINVAL; fd = dev->ifs[XWII_IF_CORE].fd; if (fd < 0 || dev->rumble_id < 0) return -ENODEV; ev.type = EV_FF; ev.code = dev->rumble_id; ev.value = on; ret = write(fd, &ev, sizeof(ev)); if (ret == -1) return -errno; else return 0; } static int read_line(const char *path, char **out) { FILE *f; char buf[4096], *line; f = fopen(path, "re"); if (!f) return -errno; if (!fgets(buf, sizeof(buf), f)) { if (ferror(f)) { fclose(f); return errno ? -errno : -EINVAL; } buf[0] = 0; } fclose(f); line = strdup(buf); if (!line) return -ENOMEM; line[strcspn(line, "\n")] = 0; *out = line; return 0; } static int write_string(const char *path, const char *line) { FILE *f; f = fopen(path, "we"); if (!f) return -errno; fputs(line, f); fflush(f); if (ferror(f)) { fclose(f); return errno ? -errno : -EINVAL; } fclose(f); return 0; } static int read_led(const char *path, bool *state) { int ret; char *line; ret = read_line(path, &line); if (ret) return ret; *state = !!atoi(line); free(line); return 0; } XWII__EXPORT int xwii_iface_get_led(struct xwii_iface *dev, unsigned int led, bool *state) { if (led > XWII_LED4 || led < XWII_LED1) return -EINVAL; if (!dev || !state) return -EINVAL; --led; if (!dev->led_attrs[led]) return -ENODEV; return read_led(dev->led_attrs[led], state); } XWII__EXPORT int xwii_iface_set_led(struct xwii_iface *dev, unsigned int led, bool state) { if (!dev || led > XWII_LED4 || led < XWII_LED1) return -EINVAL; --led; if (!dev->led_attrs[led]) return -ENODEV; return write_string(dev->led_attrs[led], state ? "1\n" : "0\n"); } static int read_battery(const char *path, uint8_t *capacity) { int ret; char *line; ret = read_line(path, &line); if (ret) return ret; *capacity = atoi(line); free(line); return 0; } XWII__EXPORT int xwii_iface_get_battery(struct xwii_iface *dev, uint8_t *capacity) { if (!dev || !capacity) return -EINVAL; if (!dev->battery_attr) return -ENODEV; return read_battery(dev->battery_attr, capacity); } XWII__EXPORT int xwii_iface_get_devtype(struct xwii_iface *dev, char **devtype) { if (!dev || !devtype) return -EINVAL; if (!dev->devtype_attr) return -ENODEV; return read_line(dev->devtype_attr, devtype); } XWII__EXPORT int xwii_iface_get_extension(struct xwii_iface *dev, char **extension) { if (!dev || !extension) return -EINVAL; if (!dev->extension_attr) return -ENODEV; return read_line(dev->extension_attr, extension); } XWII__EXPORT void xwii_iface_set_mp_normalization(struct xwii_iface *dev, int32_t x, int32_t y, int32_t z, int32_t factor) { if (!dev) return; dev->mp_normalizer.x = x * 100; dev->mp_normalizer.y = y * 100; dev->mp_normalizer.z = z * 100; dev->mp_normalize_factor = factor; } XWII__EXPORT void xwii_iface_get_mp_normalization(struct xwii_iface *dev, int32_t *x, int32_t *y, int32_t *z, int32_t *factor) { if (x) *x = dev ? dev->mp_normalizer.x / 100 : 0; if (y) *y = dev ? dev->mp_normalizer.y / 100 : 0; if (z) *z = dev ? dev->mp_normalizer.z / 100 : 0; if (factor) *factor = dev ? dev->mp_normalize_factor : 0; } xwiimote-2/lib/monitor.c000066400000000000000000000104011217476605100154700ustar00rootroot00000000000000/* * XWiimote - lib * Written 2010-2013 by David Herrmann * Dedicated to the Public Domain */ /* * Device Enumeration and Monitorig * Use libudev to enumerate all currently connected devices and allow * monitoring the system for new devices. * Normal applications should integrate this into their own udev-monitor. * However, smaller applications might not use udev on their own so this API * wraps the udev API in a small easy xwiimote API. */ #include #include #include #include #include #include #include "xwiimote.h" struct xwii_monitor { size_t ref; struct udev *udev; struct udev_enumerate *enumerate; struct udev_list_entry *entry; struct udev_monitor *monitor; }; XWII__EXPORT struct xwii_monitor *xwii_monitor_new(bool poll, bool direct) { struct udev *udev; struct udev_enumerate *enumerate = NULL; struct udev_list_entry *entry; struct udev_monitor *monitor = NULL; struct xwii_monitor *mon; udev = udev_new(); if (!udev) return NULL; enumerate = udev_enumerate_new(udev); if (!enumerate) goto out; if (0 != udev_enumerate_add_match_subsystem(enumerate, "hid")) goto out; if (0 != udev_enumerate_scan_devices(enumerate)) goto out; entry = udev_enumerate_get_list_entry(enumerate); if (poll) { monitor = udev_monitor_new_from_netlink(udev, direct ? "kernel" : "udev"); if (!monitor) goto out; if (udev_monitor_filter_add_match_subsystem_devtype(monitor, "hid", NULL)) goto out; if (udev_monitor_enable_receiving(monitor)) goto out; } mon = malloc(sizeof(*mon)); if (!mon) goto out; mon->ref = 1; mon->udev = udev; mon->enumerate = enumerate; mon->entry = entry; mon->monitor = monitor; return mon; out: if (monitor) udev_monitor_unref(monitor); if (enumerate) udev_enumerate_unref(enumerate); udev_unref(udev); return NULL; } XWII__EXPORT void xwii_monitor_ref(struct xwii_monitor *mon) { if (!mon || !mon->ref) return; mon->ref++; } static inline void free_enum(struct xwii_monitor *monitor) { if (monitor->enumerate) { udev_enumerate_unref(monitor->enumerate); monitor->enumerate = NULL; monitor->entry = NULL; } } XWII__EXPORT void xwii_monitor_unref(struct xwii_monitor *monitor) { if (!monitor || !monitor->ref) return; if (--monitor->ref) return; free_enum(monitor); if (monitor->monitor) udev_monitor_unref(monitor->monitor); udev_unref(monitor->udev); free(monitor); } XWII__EXPORT int xwii_monitor_get_fd(struct xwii_monitor *monitor, bool blocking) { signed int fd, set; if (!monitor || !monitor->monitor) return -1; fd = udev_monitor_get_fd(monitor->monitor); if (fd < 0) return -1; set = fcntl(fd, F_GETFL); if (set < 0) return -1; if (blocking) set &= ~O_NONBLOCK; else set |= O_NONBLOCK; if (0 != fcntl(fd, F_SETFL, set)) return -1; return fd; } static struct udev_device *next_enum(struct xwii_monitor *monitor) { struct udev_list_entry *e; struct udev_device *dev; const char *path; while (monitor->entry) { e = monitor->entry; monitor->entry = udev_list_entry_get_next(e); path = udev_list_entry_get_name(e); dev = udev_device_new_from_syspath(monitor->udev, path); if (dev) return dev; } free_enum(monitor); return NULL; } static char *make_device(struct udev_device *dev) { const char *tmp, *driver, *subs; char *ret = NULL; tmp = udev_device_get_action(dev); if (tmp && strcmp(tmp, "add")) goto out; driver = udev_device_get_driver(dev); subs = udev_device_get_subsystem(dev); if (!driver || strcmp(driver, "wiimote") || !subs || strcmp(subs, "hid")) goto out; tmp = udev_device_get_syspath(dev); if (tmp) ret = strdup(tmp); out: udev_device_unref(dev); return ret; } XWII__EXPORT char *xwii_monitor_poll(struct xwii_monitor *monitor) { struct udev_device *dev; char *ret; if (!monitor) return NULL; if (monitor->enumerate) { while (1) { dev = next_enum(monitor); if (!dev) /* notify application of end of enum */ return NULL; ret = make_device(dev); if (ret) return ret; } } else if (monitor->monitor) { while (1) { dev = udev_monitor_receive_device(monitor->monitor); if (!dev) return NULL; ret = make_device(dev); if (ret) return ret; } } return NULL; } xwiimote-2/lib/xwiimote.h000066400000000000000000001162141217476605100156640ustar00rootroot00000000000000/* * XWiimote - lib * Written 2010-2013 by David Herrmann * Dedicated to the Public Domain */ #ifndef XWII_XWIIMOTE_H #define XWII_XWIIMOTE_H #include #include #include #include #include #ifdef __cplusplus extern "C" { #endif /** * @file * Main libxwiimote API * * This file defines the public libxwiimote API and ABI. All identifiers are * prefixed either with **XWII_** or **xwii_**. Note that all identifiers * prefixed with a double-underscore (**XWII__** or **xwii__**) are not part * of the stable ABI and may change at any time. */ #if (__GNUC__ > 3) #define XWII__DEPRECATED __attribute__((__deprecated__)) #else #define XWII__DEPRECATED #endif /* __GNUC__ */ /** * @defgroup kernel Kernel ABI * Kernel ABI constants * * 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. * * 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. * * The kernel driver **hid-wiimote** 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 (**wiimote**) can be detected via normal * udev-filters. The **subsystem** field is **hid** and the **driver** field is * **wiimote**. If both match, the device is guaranteed to be handled by the * hid-wiimote driver and compatible with this library. * * 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 **change** 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 * `/sys/bus/hid/devices/[dev]/` is a valid wiimote device. * * Global Interfaces * ================= * * The following interfaces are always present, regardless of the device-type * and extension-type. * * devtype * ------- * * The HID device has a **devtype** attribute which can be found in * `/sys/bus/hid/devices/[dev]/devtype`. 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: * * * **pending**: Device detection is not done, yet. The kernel will * send a **change** uevent after it is done. A device * must not be in this state for longer than a few hundred * milliseconds. * * * **unknown**: The device-type is unknown and couldn't be initialized. * Such devices are normally useles and should be ignored * by most applications. * * * **generic**: 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. * * * **gen1[num]**: First generation of Wii-Remotes. This is mostly * **gen10**, but there are also 1st-gen devices with * built-in motion-plus which might be reported as * **gen15** 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. * * * **gen2[num]**: 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. * * * **balanceboard**: 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. * * * **procontroller**: 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. * * 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 **devtype** to be **gen10** but * **extension** to be **balanceboard**. * * extension * --------- * * An **extension** attribute is provided as * `/sys/bus/hid/devices/[dev]/extension` 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 **devtype** reports a different device-type * than a normal Wii-Remote, the extension might be built-in and not physically * unpluggable. Valid values are: * * * **none**: No extension is plugged. * * * **unknown**: An unknown extension is plugged or the driver * failed to initialize it. * * * **nunchuk**: A Nintendo Nunchuk extension is plugged. * * * **classic**: A Classic Controller or Classic Controller Pro * extension is plugged. * * * **balanceboard**: A balance-board extension is plugged. This is * normally a built-in extension. * * * **procontroller**: A pro-controller extension is plugged. This is * normally a built-in extension. * * Device-dependant interfaces * =========================== * * 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 **change** 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. * * Battery * ------- * * A **power_supply** device is available as * `/sys/bus/hid/devices/[dev]/power_supply/wiimote_battery_[bdaddr]/` * and the interface is defined by the kernel **power_supply** interface. * *[bdaddr]* is the bluetooth-address of the remote device. * * LEDs * ---- * * Player-LEDs on a device are available as * `/sys/bus/hid/devices/[dev]/leds/[dev]:blue:p[num]/` and the interface * is defined by the kernel **led** interface. *[dev]* is the same as the * device-name. *[num]* 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). * * Input: Core * ---------- * * Input-Core: Core input device. It is available as * `/sys/bus/hid/device/[dev]/input/input[num]/` and can be detected via the * device name @ref XWII_NAME_CORE. * * TODO: Describe the provided interface * * Input: Accelerometer * -------------------- * * Input-Accel: Accelerometer input device. Available as * `/sys/bus/hid/device/[dev]/input/input[num]/` and can be detected via the * device name @ref XWII_NAME_ACCEL. If this input-interface is not opened by * user-space, the accelerometer on the remote is disabled to save energy. * * TODO: Describe the provided interface * * Input: IR * --------- * * IR input device. It is available as * `/sys/bus/hid/device/[dev]/input/input[num]/` and can be detected via the * device name @ref XWII_NAME_IR. If this input-interface is not opened by * user-space, the IR-cam on the remote is disabled to save energy. * * TODO: Describe the provided interface * * Motion-Plus Interfaces * ====================== * * 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 **MP** or **M+**. * * Input: MP * --------- * * Motion-Plus input device. Is is available as * `/sys/bus/hid/device/[dev]/input/input[num]/` and can be detected via the * device name @ref XWII_NAME_MOTION_PLUS. 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. * * TODO: Describe the provided interface * * Extension Interfaces * ==================== * * 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 **extension** attribute), but newer * hardware may introduce more ports. Therefore, these extension might be * available simultaneously. However, in this case additional **extension2** * 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. * * 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. * * Input: Nunchuk * -------------- * * Nunchuk extension input device. Available as * `/sys/bus/hid/device/[dev]/input/input[num]/` and can be detected via the * device name @ref XWII_NAME_NUNCHUK. * * TODO: Describe the provided interface * * Input: Classic Controller * ------------------------- * * Classic Controller extension input device. Available as * `/sys/bus/hid/device/[dev]/input/input[num]/` and can be detected via the * device name @ref XWII_NAME_CLASSIC_CONTROLLER. The Classic Controller Pro is * also reported via this interface, but cannot be distinguished from a normal * classic controller extension. * * TODO: Describe the provided interface * * Input: Balance Board * -------------------- * * BalanceBoard extension input device. Available as * `/sys/bus/hid/device/[dev]/input/input[num]/` and can be detected via the * device name @ref XWII_NAME_BALANCE_BOARD. * * TODO: Describe the provided interface * * Input: Pro Controller * --------------------- * * Wii-U Pro Controller extension input device. Available as * `/sys/bus/hid/device/[dev]/input/input[num]/` and can be detected via the * device name @ref XWII_NAME_PRO_CONTROLLER. * * TODO: Describe the provided interface * * @{ */ #define XWII__NAME "Nintendo Wii Remote" /** Name of the core input device */ #define XWII_NAME_CORE XWII__NAME /** Name of the accelerometer input device */ #define XWII_NAME_ACCEL XWII__NAME " Accelerometer" /** Name of the IR input device */ #define XWII_NAME_IR XWII__NAME " IR" /** Name of the motion-plus input device */ #define XWII_NAME_MOTION_PLUS XWII__NAME " Motion Plus" /** Name of the nunchuk input device */ #define XWII_NAME_NUNCHUK XWII__NAME " Nunchuk" /** Name of the classic-controller input device */ #define XWII_NAME_CLASSIC_CONTROLLER XWII__NAME " Classic Controller" /** Name of the balance-board input device */ #define XWII_NAME_BALANCE_BOARD XWII__NAME " Balance Board" /** Name of the pro-controller input device */ #define XWII_NAME_PRO_CONTROLLER XWII__NAME " Pro Controller" /** @} */ /** * @defgroup events Device Events * Device event handling * * Devices notify users about any state-changes via events. These events can * contain peripheral-data, hotplug-information or more. * * @{ */ /** * Event Types * * Each event can be identified by the type field. New types might be added * at any time so unknown event-types must be ignored by applications. The * given payload of an event is described for each type. Unused payload-space * is zeroed by the library. However, the payload may be extended in new * revisions so applications must not depend on it being 0 or untouched. */ enum xwii_event_types { /** * Core-interface key event * * The payload of such events is struct xwii_event_key. Valid * key-events include all the events reported by the core-interface, * which is normally only LEFT, RIGHT, UP, DOWN, A, B, PLUS, MINUS, * HOME, ONE, TWO. */ XWII_EVENT_KEY, /** * Accelerometer event * * Provides accelerometer data. Payload is struct xwii_event_abs * and only the first element in the abs-array is used. The x, y and z * fields contain the accelerometer data. * Note that the accelerometer reports acceleration data, not speed * data! */ XWII_EVENT_ACCEL, /** * IR-Camera event * * Provides IR-camera events. The camera can track up two four IR * sources. As long as a single source is tracked, it stays at it's * pre-allocated slot. The four available slots are reported as * struct xwii_event_abs * payload. The x and y fields contain the position of each slot. * * Use xwii_event_ir_is_valid() to see whether a specific slot is * currently valid or whether it currently doesn't track any IR source. */ XWII_EVENT_IR, /** * Balance-Board event * * Provides balance-board weight data. Four sensors report weight-data * for each of the four edges of the board. The data is available as * struct xwii_event_abs * payload. The x fields of the first four array-entries contain the * weight-value. */ XWII_EVENT_BALANCE_BOARD, /** * Motion-Plus event * * Motion-Plus gyroscope events. These describe rotational speed, not * acceleration, of the motion-plus extension. The payload is available * as struct xwii_event_abs * and the x, y and z field of the first array-element describes the * motion-events in the 3 dimensions. */ XWII_EVENT_MOTION_PLUS, /** * Pro-Controller key event * * Button events of the pro-controller are reported via this interface * and not via the core-interface (which only reports core-buttons). * Valid buttons include: LEFT, RIGHT, UP, DOWN, PLUS, MINUS, HOME, X, * Y, A, B, TR, TL, ZR, ZL, THUMBL, THUMBR. * Payload type is struct xwii_event_key. */ XWII_EVENT_PRO_CONTROLLER_KEY, /** * Pro-Controller movement event * * Movement of analog sticks are reported via this event. The payload * is a struct xwii_event_abs * and the first two array elements contain the absolute x and y * position of both analog sticks. */ XWII_EVENT_PRO_CONTROLLER_MOVE, /** * Hotplug Event * * This event is sent whenever an extension was hotplugged (plugged or * unplugged), a device-detection finished or some other static data * changed which cannot be monitored separately. No payload is provided. * An application should check what changed by examining the device is * testing whether all required interfaces are still available. * Non-hotplug aware devices may discard this event. * * This event is also returned if an interface is closed because the * kernel closed our file-descriptor (for whatever reason). This is * returned regardless whether you watch for hotplug events or not. */ XWII_EVENT_WATCH, /** * Number of available event types * * The value of this constant may increase on each new library revision. * It is not guaranteed to stay constant. However, it may never shrink. */ XWII_EVENT_NUM }; /** * Key Event Identifiers * * For each key found on a supported device, a separate key identifier is * defined. Note that a device may have a specific key (for instance: HOME) on * the main device and on an extension device. An application can detect which * key was pressed examining the event-type field. * Some devices report common keys as both, extension and core events. In this * case the kernel is required to filter these and you should report it as a * bug. A single physical key-press should never be reported twice, even on two * different interfaces. * * Most of the key-names should be self-explanatory. */ enum xwii_event_keys { XWII_KEY_LEFT, XWII_KEY_RIGHT, XWII_KEY_UP, XWII_KEY_DOWN, XWII_KEY_A, XWII_KEY_B, XWII_KEY_PLUS, XWII_KEY_MINUS, XWII_KEY_HOME, XWII_KEY_ONE, XWII_KEY_TWO, XWII_KEY_X, XWII_KEY_Y, XWII_KEY_TL, XWII_KEY_TR, XWII_KEY_ZL, XWII_KEY_ZR, /** * Left thumb button * * This is reported if the left analog stick is pressed. Not all analog * sticks support this. The Wii-U Pro Controller is one of few devices * that report this event. */ XWII_KEY_THUMBL, /** * Right thumb button * * This is reported if the right analog stick is pressed. Not all analog * sticks support this. The Wii-U Pro Controller is one of few devices * that report this event. */ XWII_KEY_THUMBR, /** * Number of key identifiers * * This defines the number of available key-identifiers. It is not * guaranteed to stay constant and may change when new identifiers are * added. However, it will never shrink. */ XWII_KEY_NUM }; /** * Key Event Payload * * A key-event always uses this payload. */ struct xwii_event_key { /** key identifier defined as enum xwii_event_keys */ unsigned int code; /** key state copied from kernel (0: up, 1: down, 2: auto-repeat) */ unsigned int state; }; /** * Absolute Motion Payload * * This payload is used for absolute motion events. The meaning of the fields * depends on the event-type. */ struct xwii_event_abs { int32_t x; int32_t y; int32_t z; }; /** * Event Payload * * Payload of event objects. */ union xwii_event_union { /** key event payload */ struct xwii_event_key key; /** absolute motion event payload */ struct xwii_event_abs abs[4]; /** reserved; do not use! */ uint8_t reserved[128]; }; /** * Event Object * * Every event is reported via this structure. * Note that even though this object reserves some space, it may grow in the * future. It is not guaranteed to stay at this size. That's why functions * dealing with it always accept an additional size argument, which is used * for backwards-compatibility to not write beyond object-boundaries. */ struct xwii_event { /** timestamp when this event was generated (copied from kernel) */ struct timeval time; /** event type ref xwii_event_types */ unsigned int type; /** data payload */ union xwii_event_union v; }; /** * Test whether an IR event is valid * * If you receive an IR event, you can use this function on the first 4 * absolute motion payloads. It returns true iff the given slot currently tracks * a valid IR source. false is returned if the slot is invalid and currently * disabled (due to missing IR sources). */ static inline bool xwii_event_ir_is_valid(const struct xwii_event_abs *abs) { return abs->x != 1023 || abs->y != 1023; } /** @} */ /** * @defgroup device Device Interface * Communication between applications and devices * * The device interface provides a way to communicate with a connected remote * device. It reads events from the device and provides them to the application. * But it also allows applications to send events to devices. * * Note that devices cannot be connected or searched for with this API. Instead, * you should use your standard bluetooth tools to perform a bluetooth inquiry * and connect devices. You do the same with bluetooth keyboards and mice, don't * you? * * If you want to enumerate connected devices and monitor the system for hotplug * events, you should use the @ref monitor "monitor interface" or use libudev * directly. * * The device interface is split up into different sub-interfaces. Each of them * is related to specific hardware available on the remote device. If some * hardware is not present, the interfaces will not be provided to the * application and will return -ENODEV. * * Interfaces must be opened via xwii_iface_open() before you can use them. Once * opened, they return events via the event stream which is accessed via * xwii_iface_dispatch(). Furthermore, outgoing events can now be sent via the * different helper functions. * Some interfaces are static and don't need to be opened. You notice it if no * XWII_IFACE_* constant is provided. * * Once you are done with an interface, you should close it via * xwii_iface_close(). The kernel can deactivate unused hardware to safe energy. * If you keep them open, the kernel keeps them powered up. * * @{ */ /** * Device Object * * This object describes the communication with a single device. That is, you * create one for each device you use. All sub-interfaces are opened on this * object. */ struct xwii_iface; /** * Interfaces * * Each constant describes a single interface. These are bit-masks that can be * binary-ORed. If an interface does not provide such a constant, it is static * and can be used without opening/closing it. */ enum xwii_iface_type { /** Core interface */ XWII_IFACE_CORE = 0x000001, /** Accelerometer interface */ XWII_IFACE_ACCEL = 0x000002, /** IR interface */ XWII_IFACE_IR = 0x000004, /** MotionPlus extension interface */ XWII_IFACE_MOTION_PLUS = 0x000100, /** Nunchuk extension interface */ XWII_IFACE_NUNCHUK = 0x000200, /** ClassicController extension interface */ XWII_IFACE_CLASSIC_CONTROLLER = 0x000400, /** BalanceBoard extension interface */ XWII_IFACE_BALANCE_BOARD = 0x000800, /** ProController extension interface */ XWII_IFACE_PRO_CONTROLLER = 0x001000, /** Special flag ORed with all valid interfaces */ XWII_IFACE_ALL = XWII_IFACE_CORE | XWII_IFACE_ACCEL | XWII_IFACE_IR | XWII_IFACE_MOTION_PLUS | XWII_IFACE_NUNCHUK | XWII_IFACE_CLASSIC_CONTROLLER | XWII_IFACE_BALANCE_BOARD | XWII_IFACE_PRO_CONTROLLER, /** Special flag which causes the interfaces to be opened writable */ XWII_IFACE_WRITABLE = 0x010000, }; /** * LEDs * * One constant for each Player-LED. */ enum xwii_led { XWII_LED1 = 1, XWII_LED2 = 2, XWII_LED3 = 3, XWII_LED4 = 4, }; /** * Create enum xwii_led constants during runtime * * The argument is a number starting with 1. So XWII_LED([num]) produces the * same value as the constant XWII_LED[num] defined in enum xwii_led. */ #define XWII_LED(num) (XWII_LED1 + (num) - 1) /** * Create new device object from syspath path * * @param[out] dev Pointer to new opaque device is stored here * @param[in] syspath Sysfs path to root device node * * Creates a new device object. No interfaces on the device are opened by * default. @p syspath must be a valid path to a wiimote device, either * retrieved via a @ref monitor "monitor object" or via udev. It must point to * the hid device, which is normally /sys/bus/hid/devices/[dev]. * * If this function fails, @p dev is not touched at all (and not cleared!). A * new object always has an initial ref-count of 1. * * @returns 0 on success, negative error code on failure */ int xwii_iface_new(struct xwii_iface **dev, const char *syspath); /** * Increase ref-count by 1 * * @param[in] dev Valid device object */ void xwii_iface_ref(struct xwii_iface *dev); /** * Decrease ref-count by 1 * * @param[in] dev Valid device object * * If the ref-count drops below 1, the object is destroyed immediately. All * open interfaces are automatically closed and all allocated objects released * when the object is destroyed. */ void xwii_iface_unref(struct xwii_iface *dev); /** * Return file-descriptor * * @param[in] dev Valid device object * * Return the file-descriptor used by this device. If multiple file-descriptors * are used internally, they are multi-plexed through an epoll descriptor. * Therefore, this always returns the same single file-descriptor. You need to * watch this for readable-events (POLLIN/EPOLLIN) and call * xwii_iface_dispatch() whenever it is readable. * * This function always returns a valid file-descriptor. */ int xwii_iface_get_fd(struct xwii_iface *dev); /** * Watch device for hotplug events * * @param[in] dev Valid device object * @param[in] watch Whether to watch for hotplug events or not * * Toggle whether hotplug events should be reported or not. By default, no * hotplug events are reported so this is off. * * Note that this requires a separate udev-monitor for each device. Therefore, * if your application uses its own udev-monitor, you should instead integrate * the hotplug-detection into your udev-monitor. * * @returns 0 on success, negative error code on failure */ int xwii_iface_watch(struct xwii_iface *dev, bool watch); /** * Open interfaces on this device * * @param[in] dev Valid device object * @param[in] ifaces Bitmask of interfaces of type enum xwii_iface_type * * Open all the requested interfaces. If @ref XWII_IFACE_WRITABLE is also set, * the interfaces are opened with write-access. Note that interfaces that are * already opened are ignored and not touched. * If _any_ interface fails to open, this function still tries to open the other * requested interfaces and then returns the error afterwards. Hence, if this * function fails, you should use xwii_iface_opened() to get a bitmask of opened * interfaces and see which failed (if that is of interest). * * Note that interfaces may be closed automatically during runtime if the * kernel removes the interface or on error conditions. You always get an * @ref XWII_EVENT_WATCH event which you should react on. This is returned * regardless whether xwii_iface_watch() was enabled or not. * * @returns 0 on success, negative error code on failure. */ int xwii_iface_open(struct xwii_iface *dev, unsigned int ifaces); /** * Close interfaces on this device * * @param[in] dev Valid device object * @param[in] ifaces Bitmask of interfaces of type enum xwii_iface_type * * Close the requested interfaces. This never fails. */ void xwii_iface_close(struct xwii_iface *dev, unsigned int ifaces); /** * Return bitmask of opened interfaces * * @param[in] dev Valid device object * * Returns a bitmask of opened interfaces. Interfaces may be closed due to * error-conditions at any time. However, interfaces are never opened * automatically. * * You will get notified whenever this bitmask changes, except on explicit * calls to xwii_iface_open() and xwii_iface_close(). See the * @ref XWII_EVENT_WATCH event for more information. */ unsigned int xwii_iface_opened(struct xwii_iface *dev); /** * Return bitmask of available interfaces * * @param[in] dev Valid device object * * Return a bitmask of available devices. These devices can be opened and are * guaranteed to be present on the hardware at this time. If you watch your * device for hotplug events (see xwii_iface_watch()) you will get notified * whenever this bitmask changes. See the @ref XWII_EVENT_WATCH event for more * information. */ unsigned int xwii_iface_available(struct xwii_iface *dev); /** * Read incoming event-queue * * @param[in] dev Valid device object * @param[out] ev Pointer where to store a new event or NULL * * You should call this whenever the file-descriptor returned by * xwii_iface_get_fd() is reported as being readable. This function will perform * all non-blocking outstanding tasks and then return. * * This function always performs any background tasks and outgoing event-writes * if they don't block. It returns an error if they fail. * If @p ev is NULL, this function returns 0 on success after this has been * done. * * If @p ev is non-NULL, this function then tries to read a single incoming * event. If no event is available, it returns -EAGAIN and you should watch the * file-desciptor again until it is readable. Otherwise, you should call this * function in a row as long as it returns 0. It stores the event in @p ev which * you can then handle in your application. * * @returns 0 on success, -EAGAIN if no event can be read and @p ev is non-NULL * and a negative error-code on failure */ XWII__DEPRECATED int xwii_iface_poll(struct xwii_iface *dev, struct xwii_event *ev); /** * Read incoming event-queue * * @param[in] dev Valid device object * @param[out] ev Pointer where to store a new event or NULL * @param[in] size Size of @p ev if @p ev is non-NULL * * You should call this whenever the file-descriptor returned by * xwii_iface_get_fd() is reported as being readable. This function will perform * all non-blocking outstanding tasks and then return. * * This function always performs any background tasks and outgoing event-writes * if they don't block. It returns an error if they fail. * If @p ev is NULL, this function returns 0 on success after this has been * done. * * If @p ev is non-NULL, this function then tries to read a single incoming * event. If no event is available, it returns -EAGAIN and you should watch the * file-desciptor again until it is readable. Otherwise, you should call this * function in a row as long as it returns 0. It stores the event in @p ev which * you can then handle in your application. * * This function is the successor or xwii_iface_poll(). It takes an additional * @p size argument to provide backwards compatibility. * * @returns 0 on success, -EAGAIN if no event can be read and @p ev is non-NULL * and a negative error-code on failure */ int xwii_iface_dispatch(struct xwii_iface *dev, struct xwii_event *ev, size_t size); /** * Toggle rumble motor * * @param[in] dev Valid device object * @param[in] on New rumble motor state * * Toggle the rumble motor. This requires the core-interface to be opened in * writable mode. * * @returns 0 on success, negative error code on failure. */ int xwii_iface_rumble(struct xwii_iface *dev, bool on); /** * Read LED state * * @param[in] dev Valid device object * @param[in] led LED constant defined in enum xwii_led * @param[out] state Pointer where state should be written to * * Reads the current LED state of the given LED. @p state will be either true or * false depending on whether the LED is on or off. * * LEDs are a static interface that does not have to be opened first. * * @returns 0 on success, negative error code on failure */ int xwii_iface_get_led(struct xwii_iface *dev, unsigned int led, bool *state); /** * Set LED state * * @param[in] dev Valid device object * @param[in] led LED constant defined in enum xwii_led * @param[in] state State to set on the LED * * Changes the current LED state of the given LED. This has immediate effect. * * LEDs are a static interface that does not have to be opened first. * * @returns 0 on success, negative error code on failure */ int xwii_iface_set_led(struct xwii_iface *dev, unsigned int led, bool state); /** * Read battery state * * @param[in] dev Valid device object * @param[out] capacity Pointer where state should be written to * * Reads the current battery capacity and write it into @p capacity. This is * a value between 0 and 100, which describes the current capacity in per-cent. * * Batteries are a static interface that does not have to be opened first. * * @returns 0 on success, negative error code on failure */ int xwii_iface_get_battery(struct xwii_iface *dev, uint8_t *capacity); /** * Read device type * * @param[in] dev Valid device object * @param[out] devtype Pointer where the device type should be stored * * Reads the current device-type, allocates a string and stores a pointer to * the string in @p devtype. You must free it via free() after you are done. * * This is a static interface that does not have to be opened first. * * @returns 0 on success, negative error code on failure */ int xwii_iface_get_devtype(struct xwii_iface *dev, char **devtype); /** * Read extension type * * @param[in] dev Valid device object * @param[out] extension Pointer where the extension type should be stored * * Reads the current extension type, allocates a string and stores a pointer * to the string in @p extension. You must free it via free() after you are * done. * * This is a static interface that does not have to be opened first. * * @returns 0 on success, negative error code on failure */ int xwii_iface_get_extension(struct xwii_iface *dev, char **extension); /** * Set MP normalization and calibration * * @param[in] dev Valid device object * @param[in] x x-value to use or 0 * @param[in] y y-value to use or 0 * @param[in] z z-value to use or 0 * @param[in] factor factor-value to use or 0 * * Set MP-normalization and calibration values. The Motion-Plus sensor is very * sensitive and may return really crappy values. This interfaces allows to * apply 3 absolute offsets x, y and z which are subtracted from any MP data * before it is returned to the application. That is, if you set these values * to 0, this has no effect (which is also the initial state). * * The calibration factor @p factor is used to perform runtime calibration. If * it is 0 (the initial state), no runtime calibration is performed. Otherwise, * the factor is used to re-calibrate the zero-point of MP data depending on MP * input. This is an angoing calibration which modifies the internal state of * the x, y and z values. */ void xwii_iface_set_mp_normalization(struct xwii_iface *dev, int32_t x, int32_t y, int32_t z, int32_t factor); /** * Read MP normalization and calibration * * @param[in] dev Valid device object * @param[out] x Pointer where to store x-value or NULL * @param[out] y Pointer where to store y-value or NULL * @param[out] z Pointer where to store z-value or NULL * @param[out] factor Pointer where to store factor-value or NULL * * Reads the MP normalization and calibration values. Please see * xwii_iface_set_mp_normalization() how this is handled. * * Note that if the calibration factor is not 0, the normalization values may * change depending on incoming MP data. Therefore, the data read via this * function may differ from the values that you wrote to previously. However, * apart from applied calibration, these value are the same as were set * previously via xwii_iface_set_mp_normalization() and you can feed them back * in later. */ void xwii_iface_get_mp_normalization(struct xwii_iface *dev, int32_t *x, int32_t *y, int32_t *z, int32_t *factor); /** @} */ /** * @defgroup monitor Device Monitor * Monitor system for new wiimote devices. * * This monitor can be used to enumerate all connected wiimote devices and also * monitoring the system for hotplugged wiimote devices. * This is a simple wrapper around libudev and should only be used if your * application does not use udev on its own. * See the implementation of the monitor to integrate wiimote-monitoring into * your own udev routines. * * @{ */ /** * Monitor object * * Each object describes a separate monitor. A single monitor must not be * used from multiple threads without locking. Different monitors are * independent of each other and can be used simultaneously. */ struct xwii_monitor; /** * Create a new monitor * * Creates a new monitor and returns a pointer to the opaque object. NULL is * returned on failure. * * @param[in] poll True if this monitor should watch for hotplug events * @param[in] direct True if kernel uevents should be used instead of udevd * * A monitor always provides all devices that are available on a system. If * @p poll is true, the monitor also sets up a system-monitor to watch the * system for new hotplug events so new devices can be detected. * * A new monitor always has a ref-count of 1. */ struct xwii_monitor *xwii_monitor_new(bool poll, bool direct); /** * Increase monitor ref-count by 1 * * @param[in] mon Valid monitor object */ void xwii_monitor_ref(struct xwii_monitor *mon); /** * Decrease monitor ref-count by 1 * * @param[in] mon Valid monitor object * * If the ref-count drops below 1, the object is destroyed immediately. */ void xwii_monitor_unref(struct xwii_monitor *mon); /** * Return internal fd * * @param[in] monitor A valid monitor object * @param[in] blocking True to set the monitor in blocking mode * * Returns the file-descriptor used by this monitor. If @p blocking is true, * the FD is set into blocking mode. If false, it is set into non-blocking mode. * Only one file-descriptor exists, that is, this function always returns the * same descriptor. * * This returns -1 if this monitor was not created with a hotplug-monitor. So * you need this function only if you want to watch the system for hotplug * events. Whenever this descriptor is readable, you should call * xwii_monitor_poll() to read new incoming events. */ int xwii_monitor_get_fd(struct xwii_monitor *monitor, bool blocking); /** * Read incoming events * * @param[in] monitor A valid monitor object * * This returns a single device-name on each call. A device-name is actually * an absolute sysfs path to the device's root-node. This is normally a path * to /sys/bus/hid/devices/[dev]/. You can use this path to create a new * struct xwii_iface object. * * After a monitor was created, this function returns all currently available * devices. After all devices have been returned, this function returns NULL * _once_. After that, this function polls the monitor for hotplug events and * returns hotplugged devices, if the monitor was opened to watch the system for * hotplug events. * Use xwii_monitor_get_fd() to get notified when a new event is available. If * the fd is in non-blocking mode, this function never blocks but returns NULL * if no new event is available. * * The returned string must be freed with free() by the caller. */ char *xwii_monitor_poll(struct xwii_monitor *monitor); /** @} */ #ifdef __cplusplus } #endif #endif /* XWII_XWIIMOTE_H */ xwiimote-2/libxwiimote.pc.in000066400000000000000000000003741217476605100163640ustar00rootroot00000000000000prefix=@prefix@ exec_prefix=@exec_prefix@ libdir=@libdir@ includedir=@includedir@ Name: libxwiimote Description: Library to control Nintendo Wii Remotes Requires: libudev Version: @PACKAGE_VERSION@ Libs: -L${libdir} -lxwiimote Cflags: -I${includedir} xwiimote-2/libxwiimote.sym000066400000000000000000000010631217476605100161610ustar00rootroot00000000000000LIBXWIIMOTE_2 { global: xwii_iface_new; xwii_iface_ref; xwii_iface_unref; xwii_iface_get_fd; xwii_iface_watch; xwii_iface_open; xwii_iface_close; xwii_iface_opened; xwii_iface_available; xwii_iface_poll; xwii_iface_dispatch; xwii_iface_rumble; xwii_iface_get_led; xwii_iface_set_led; xwii_iface_get_battery; xwii_iface_get_devtype; xwii_iface_get_extension; xwii_iface_set_mp_normalization; xwii_iface_get_mp_normalization; xwii_monitor_new; xwii_monitor_ref; xwii_monitor_unref; xwii_monitor_get_fd; xwii_monitor_poll; local: *; }; xwiimote-2/res/000077500000000000000000000000001217476605100136645ustar00rootroot00000000000000xwiimote-2/res/50-xorg-fix-xwiimote.conf000066400000000000000000000010531217476605100203620ustar00rootroot00000000000000# X11 xorg Wii Remote raw input config # XWiimote reports accelerometer and IR data as absolute axes. Disable them to # avoid weird mouse behaviour. To use IR data as mouse input, use the xwiimote # tools or xf86-input-xwiimote which overwrites this. # This only disables the raw input from the kernel devices. If you use the # xwiimote tools to emulate mouses/keyboards, then they are not affected by # this. Section "InputClass" Identifier "Nintendo Wii Remote Raw Input Blacklist" MatchProduct "Nintendo Wii Remote" Option "Ignore" "on" EndSection xwiimote-2/tools/000077500000000000000000000000001217476605100142335ustar00rootroot00000000000000xwiimote-2/tools/xwiibind.sh000077500000000000000000000111521217476605100164070ustar00rootroot00000000000000#!/bin/sh # # XWiimote - tools # Written 2011-2013 by David Herrmann # Dedicated to the Public Domain # # # This script enables auto-reconnect on your wiimote. This script should only be # used if you really require auto-reconnect now. There is work going on to get # auto-reconnect of wiimotes into upstream bluez repository. # If you need this feature now, you may read below, but be aware that this # method described here is neither fast nor reliable. It is a small hack to get # it work. # # Please specify your device bdaddr as first argument to this script. # # To run this tool, you need: # - "simple-agent" # - "test-device" # - "test-input" # from the "test" directory of the bluez distribution. They are available here: # http://git.kernel.org/?p=bluetooth/bluez.git;a=tree;f=test # They are GPL licensed and hence not included here. They are simple python # scripts and can be just copied into this directory. # The scripts uses "bluez-" as default prefix for these tools. You can pass # another prefix as second argument to overwrite this. # You can also specify BIN_TESTINP, BIN_TESTDEV, BIN_SIMPLEA as environment # variables with the absolute/relative path to the given binaries. The prefix # will not be applied in this case. # # The python scripts need "python2" and are not python3 compatible, so specify # the python interpreter as "PYTHON" below if the default value does not work. # Or pass PYTHON="" as environment variable. # # This script REQUIRES that you have the "wiimote.so" plugin enabled in your # bluetoothd daemon. It is often NOT part of the official distribution package # so check whether it is installed and enabled. # # Please disable gnome-bluetooth, blueman or any similar bluetooth applet to # avoid inter-process conflicts. # # This script does not check for error codes, so if you see errors, abort the # script with ctrl+c. This script first removes the device. Then it connects to # the device without pairing and without connecting to the input service. It # does this just to retrieve SDP values. After that you should disconnect the # device again by pressing the power-button for 3 seconds. # Then press the red-sync button again, the script will now connect to the # device and perform pairing. If the script asks you for PIN input, then you did # not install the "wiimote.so" plugin for bluetoothd. # If you did, bluetoothd chooses the right PIN for you. After pairing it # directly connects to the input device. If this succeeds, the wiimote is ready # for auto-reconnect. # # To test auto-reconnect, disconnect your wiimote. Then invoke # "python2 ./simple-agent" # And you will have an agent that listens for incoming connections. Now a single # key-press on the remote should be enough to make the wiimote connect to your # host. You only need to acknowledge the connection in the simple-agent by # writing "yes" when it prompts you. # # pass PYTHON=xy to overwrite this if test "x$PYTHON" = "x" ; then PYTHON="python2" fi # first argument is bdaddr DEV="$1" if test "x$1" = "x" ; then echo "Please specify bdaddr of wiimote as first argument" exit 1 fi # optional second argument is binary prefix (default: "bluez-") PREFIX="bluez-" if test $# -gt 1 ; then PREFIX="$2" fi # Pass BIN_TESTDEV=test-device, BIN_SIMPLEA=simple-agent, BIN_TESTINP=test-input # to overwrite the "which" statements. ERR=0 if test "x$BIN_TESTDEV" = "x" ; then BIN_TESTDEV=`which "${PREFIX}test-device" 2>/dev/null` ERR=$(($ERR + $?)) fi if test "x$BIN_SIMPLEA" = "x" ; then BIN_SIMPLEA=`which "${PREFIX}simple-agent" 2>/dev/null` ERR=$(($ERR + $?)) fi if test "x$BIN_TESTINP" = "x" ; then BIN_TESTINP=`which "${PREFIX}test-input" 2>/dev/null` ERR=$(($ERR + $?)) fi if test ! "x$ERR" = "x0" ; then echo "Cannot find bluez '${PREFIX}test-device', '${PREFIX}simple-agent' or '${PREFIX}test-input' scripts" exit 1 fi echo "Removing device..." "$PYTHON" "$BIN_TESTDEV" remove "$DEV" echo "Device removed, press any key to continue" read tmp echo "Please press red sync-button on the back of the wiimote and press any key to continue" echo "If this asks you for PIN input, then your bluetoothd daemon does not include the wiimote.so plugin. Please install it or contact your distributor." read tmp "$PYTHON" "$BIN_TESTDEV" create "$DEV" echo "Please disconnect the device by pressing the power button and then press any key to continue" read tmp echo "Now press the red-sync button again and press any key to continue" read tmp echo "Pairing with the remote device..." "$PYTHON" "$BIN_SIMPLEA" "hci0" "$DEV" echo "Connecting to input device..." "$PYTHON" "$BIN_TESTINP" connect "$DEV" echo "Connected to input device. Autoconnect should be enabled now." xwiimote-2/tools/xwiidump.c000066400000000000000000000033271217476605100162520ustar00rootroot00000000000000/* * XWiimote - tools * Written 2010, 2011 by David Herrmann * Dedicated to the Public Domain */ /* * XWiimote EEPROM Dump * This tool reads the whole eeprom of a wiimote and dumps the output to * stdout. This requires debugfs support and euid 0/root. * Pass as argument the eeprom input file. This requires that debugfs is * mounted and compiled into the kernel. * * Debugfs compiled: * zgrep DEBUG_FS /proc/config.gz * Mount debugfs: * mount -t debugfs debugfs /sys/kernel/debug * Path to eeprom file: * /sys/kernel/debug/hid//eeprom */ #include #include #include #include #include static void show(const char *buf, size_t len) { size_t i; for (i = 0; i < len; ++i) printf(" 0x%02hhx", buf[i]); } static void dump(int fd) { char buf[1]; int ret; size_t off, i; off = 0; while (1) { printf("0x%08lx:", off); for (i = 0; i < 8; ++i) { ret = read(fd, buf, sizeof(buf)); if (ret > 0) { show(buf, ret); } else if (ret < 0) { printf(" (read error %d)", errno); if (lseek(fd, 1, SEEK_CUR) < 0) { printf(" (Seek failed %d)", errno); goto out; } } else { printf(" (eof)"); goto out; } ++off; } printf("\n"); } out: return; } static int open_eeprom(const char *file) { int fd; fd = open(file, O_RDONLY); if (fd < 0) fprintf(stderr, "Cannot open eeprom file %d\n", errno); return fd; } int main(int argc, char **argv) { int fd; if (argc < 2 || !*argv[1]) { fprintf(stderr, "Please give path to eeprom file as first argument\n"); return EXIT_FAILURE; } fd = open_eeprom(argv[1]); if (fd >= 0) { dump(fd); close(fd); } else { return EXIT_FAILURE; } return EXIT_SUCCESS; } xwiimote-2/tools/xwiishow.c000066400000000000000000001247031217476605100162670ustar00rootroot00000000000000/* * XWiimote - tools - xwiishow * Written 2010-2013 by David Herrmann * Dedicated to the Public Domain */ /* * Interactive Wiimote Testing Tool * If you run this tool without arguments, then it shows usage information. If * you pass "list" as first argument, it lists all connected Wii Remotes. * You need to pass one path as argument and the given wiimote is opened and * printed to the screen. When wiimote events are received, then the screen is * updated correspondingly. You can use the keyboard to control the wiimote. */ #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include "xwiimote.h" enum window_mode { MODE_ERROR, MODE_NORMAL, MODE_EXTENDED, }; static struct xwii_iface *iface; static unsigned int mode = MODE_ERROR; static bool freeze = false; /* error messages */ static void print_info(const char *format, ...) { va_list list; char str[58 + 1]; va_start(list, format); vsnprintf(str, sizeof(str), format, list); str[sizeof(str) - 1] = 0; va_end(list); mvprintw(22, 22, " "); mvprintw(22, 22, "%s", str); } static void print_error(const char *format, ...) { va_list list; char str[58 + 80 + 1]; va_start(list, format); vsnprintf(str, sizeof(str), format, list); if (mode == MODE_EXTENDED) str[sizeof(str) - 1] = 0; else str[58] = 0; va_end(list); mvprintw(23, 22, " "); if (mode == MODE_EXTENDED) mvprintw(23, 80, " "); mvprintw(23, 22, "%s", str); } /* key events */ static void key_show(const struct xwii_event *event) { unsigned int code = event->v.key.code; bool pressed = event->v.key.state; char *str = NULL; if (pressed) str = "X"; else str = " "; if (code == XWII_KEY_LEFT) { mvprintw(4, 7, "%s", str); } else if (code == XWII_KEY_RIGHT) { mvprintw(4, 11, "%s", str); } else if (code == XWII_KEY_UP) { mvprintw(2, 9, "%s", str); } else if (code == XWII_KEY_DOWN) { mvprintw(6, 9, "%s", str); } else if (code == XWII_KEY_A) { if (pressed) str = "A"; mvprintw(10, 5, "%s", str); } else if (code == XWII_KEY_B) { if (pressed) str = "B"; mvprintw(10, 13, "%s", str); } else if (code == XWII_KEY_HOME) { if (pressed) str = "HOME+"; else str = " "; mvprintw(13, 7, "%s", str); } else if (code == XWII_KEY_MINUS) { if (pressed) str = "-"; mvprintw(13, 3, "%s", str); } else if (code == XWII_KEY_PLUS) { if (pressed) str = "+"; mvprintw(13, 15, "%s", str); } else if (code == XWII_KEY_ONE) { if (pressed) str = "1"; mvprintw(20, 9, "%s", str); } else if (code == XWII_KEY_TWO) { if (pressed) str = "2"; mvprintw(21, 9, "%s", str); } } static void key_clear(void) { struct xwii_event ev; unsigned int i; ev.type = XWII_EVENT_KEY; for (i = 0; i < XWII_KEY_NUM; ++i) { ev.v.key.code = i; ev.v.key.state = 0; key_show(&ev); } } static void key_toggle(void) { int ret; if (xwii_iface_opened(iface) & XWII_IFACE_CORE) { xwii_iface_close(iface, XWII_IFACE_CORE); key_clear(); print_info("Info: Disable key events"); } else { ret = xwii_iface_open(iface, XWII_IFACE_CORE | XWII_IFACE_WRITABLE); if (ret) print_error("Error: Cannot enable key events: %d", ret); else print_error("Info: Enable key events"); } } /* accelerometer events */ static void accel_show_ext_x(double val) { if (val < -10) mvprintw(6, 81, "<=========## "); else if (val < -9) mvprintw(6, 81, " <========## "); else if (val < -8) mvprintw(6, 81, " <=======## "); else if (val < -7) mvprintw(6, 81, " <======## "); else if (val < -6) mvprintw(6, 81, " <=====## "); else if (val < -5) mvprintw(6, 81, " <====## "); else if (val < -4) mvprintw(6, 81, " <===## "); else if (val < -3) mvprintw(6, 81, " <==## "); else if (val < -2) mvprintw(6, 81, " <=## "); else if (val < -0.3) mvprintw(6, 81, " <## "); else if (val < 0.3) mvprintw(6, 81, " ## "); else if (val < 2) mvprintw(6, 81, " ##> "); else if (val < 3) mvprintw(6, 81, " ##=> "); else if (val < 4) mvprintw(6, 81, " ##==> "); else if (val < 5) mvprintw(6, 81, " ##===> "); else if (val < 6) mvprintw(6, 81, " ##====> "); else if (val < 7) mvprintw(6, 81, " ##=====> "); else if (val < 8) mvprintw(6, 81, " ##======> "); else if (val < 9) mvprintw(6, 81, " ##=======> "); else if (val < 10) mvprintw(6, 81, " ##========> "); else mvprintw(6, 81, " ##=========>"); } static void accel_show_ext_y(double val) { if (val > 5) { mvprintw(1, 93, " __."); mvprintw(2, 93, " //|"); mvprintw(3, 93, " // "); mvprintw(4, 93, " // "); mvprintw(5, 93, "// "); mvprintw(7, 86, " "); mvprintw(8, 86, " "); mvprintw(9, 86, " "); mvprintw(10, 86, " "); mvprintw(11, 86, " "); } else if (val > 4) { mvprintw(1, 93, " "); mvprintw(2, 93, " __. "); mvprintw(3, 93, " //|"); mvprintw(4, 93, " // "); mvprintw(5, 93, "// "); mvprintw(7, 86, " "); mvprintw(8, 86, " "); mvprintw(9, 86, " "); mvprintw(10, 86, " "); mvprintw(11, 86, " "); } else if (val > 3) { mvprintw(1, 93, " "); mvprintw(2, 93, " "); mvprintw(3, 93, " __. "); mvprintw(4, 93, " //|"); mvprintw(5, 93, "// "); mvprintw(7, 86, " "); mvprintw(8, 86, " "); mvprintw(9, 86, " "); mvprintw(10, 86, " "); mvprintw(11, 86, " "); } else if (val > 2) { mvprintw(1, 93, " "); mvprintw(2, 93, " "); mvprintw(3, 93, " "); mvprintw(4, 93, "__. "); mvprintw(5, 93, "//|"); mvprintw(7, 86, " "); mvprintw(8, 86, " "); mvprintw(9, 86, " "); mvprintw(10, 86, " "); mvprintw(11, 86, " "); } else if (val > 0.3) { mvprintw(1, 93, " "); mvprintw(2, 93, " "); mvprintw(3, 93, " "); mvprintw(4, 93, " "); mvprintw(5, 93, "-. "); mvprintw(7, 86, " "); mvprintw(8, 86, " "); mvprintw(9, 86, " "); mvprintw(10, 86, " "); mvprintw(11, 86, " "); } else if (val > -0.3) { mvprintw(1, 93, " "); mvprintw(2, 93, " "); mvprintw(3, 93, " "); mvprintw(4, 93, " "); mvprintw(5, 93, " "); mvprintw(7, 86, " "); mvprintw(8, 86, " "); mvprintw(9, 86, " "); mvprintw(10, 86, " "); mvprintw(11, 86, " "); } else if (val > -2) { mvprintw(1, 93, " "); mvprintw(2, 93, " "); mvprintw(3, 93, " "); mvprintw(4, 93, " "); mvprintw(5, 93, " "); mvprintw(7, 86, " *"); mvprintw(8, 86, " "); mvprintw(9, 86, " "); mvprintw(10, 86, " "); mvprintw(11, 86, " "); } else if (val > -3) { mvprintw(1, 93, " "); mvprintw(2, 93, " "); mvprintw(3, 93, " "); mvprintw(4, 93, " "); mvprintw(5, 93, " "); mvprintw(7, 86, " |//"); mvprintw(8, 86, " *-"); mvprintw(9, 86, " "); mvprintw(10, 86, " "); mvprintw(11, 86, " "); } else if (val > -4) { mvprintw(1, 93, " "); mvprintw(2, 93, " "); mvprintw(3, 93, " "); mvprintw(4, 93, " "); mvprintw(5, 93, " "); mvprintw(7, 86, " //"); mvprintw(8, 86, " |//"); mvprintw(9, 86, " *-"); mvprintw(10, 86, " "); mvprintw(11, 86, " "); } else if (val > -5) { mvprintw(1, 93, " "); mvprintw(2, 93, " "); mvprintw(3, 93, " "); mvprintw(4, 93, " "); mvprintw(5, 93, " "); mvprintw(7, 86, " //"); mvprintw(8, 86, " //"); mvprintw(9, 86, " |//"); mvprintw(10, 86, " *-"); mvprintw(11, 86, " "); } else { mvprintw(1, 93, " "); mvprintw(2, 93, " "); mvprintw(3, 93, " "); mvprintw(4, 93, " "); mvprintw(5, 93, " "); mvprintw(7, 86, " //"); mvprintw(8, 86, " //"); mvprintw(9, 86, " //"); mvprintw(10, 86, "|//"); mvprintw(11, 86, "*-"); } } static void accel_show_ext_z(double val) { if (val < -5) { mvprintw(1, 91, "/\\"); mvprintw(2, 91, "||"); mvprintw(3, 91, "||"); mvprintw(4, 91, "||"); mvprintw(5, 91, "||"); mvprintw(7, 91, " "); mvprintw(8, 91, " "); mvprintw(9, 91, " "); mvprintw(10, 91, " "); mvprintw(11, 91, " "); } else if (val < -4) { mvprintw(1, 91, " "); mvprintw(2, 91, "/\\"); mvprintw(3, 91, "||"); mvprintw(4, 91, "||"); mvprintw(5, 91, "||"); mvprintw(7, 91, " "); mvprintw(8, 91, " "); mvprintw(9, 91, " "); mvprintw(10, 91, " "); mvprintw(11, 91, " "); } else if (val < -3) { mvprintw(1, 91, " "); mvprintw(2, 91, " "); mvprintw(3, 91, "/\\"); mvprintw(4, 91, "||"); mvprintw(5, 91, "||"); mvprintw(7, 91, " "); mvprintw(8, 91, " "); mvprintw(9, 91, " "); mvprintw(10, 91, " "); mvprintw(11, 91, " "); } else if (val < -2) { mvprintw(5, 91, " "); mvprintw(1, 91, " "); mvprintw(2, 91, " "); mvprintw(3, 91, " "); mvprintw(4, 91, "/\\"); mvprintw(5, 91, "||"); mvprintw(7, 91, " "); mvprintw(8, 91, " "); mvprintw(9, 91, " "); mvprintw(10, 91, " "); mvprintw(11, 91, " "); } else if (val < -0.3) { mvprintw(1, 91, " "); mvprintw(2, 91, " "); mvprintw(3, 91, " "); mvprintw(4, 91, " "); mvprintw(5, 91, "/\\"); mvprintw(7, 91, " "); mvprintw(8, 91, " "); mvprintw(9, 91, " "); mvprintw(10, 91, " "); mvprintw(11, 91, " "); } else if (val < 0.3) { mvprintw(1, 91, " "); mvprintw(2, 91, " "); mvprintw(3, 91, " "); mvprintw(4, 91, " "); mvprintw(5, 91, " "); mvprintw(7, 91, " "); mvprintw(8, 91, " "); mvprintw(9, 91, " "); mvprintw(10, 91, " "); mvprintw(11, 91, " "); } else if (val < 2) { mvprintw(1, 91, " "); mvprintw(2, 91, " "); mvprintw(3, 91, " "); mvprintw(4, 91, " "); mvprintw(5, 91, " "); mvprintw(7, 91, "\\/"); mvprintw(8, 91, " "); mvprintw(9, 91, " "); mvprintw(10, 91, " "); mvprintw(11, 91, " "); } else if (val < 3) { mvprintw(1, 91, " "); mvprintw(2, 91, " "); mvprintw(3, 91, " "); mvprintw(4, 91, " "); mvprintw(5, 91, " "); mvprintw(7, 91, "||"); mvprintw(8, 91, "\\/"); mvprintw(9, 91, " "); mvprintw(10, 91, " "); mvprintw(11, 91, " "); } else if (val < 4) { mvprintw(1, 91, " "); mvprintw(2, 91, " "); mvprintw(3, 91, " "); mvprintw(4, 91, " "); mvprintw(5, 91, " "); mvprintw(7, 91, "||"); mvprintw(8, 91, "||"); mvprintw(9, 91, "\\/"); mvprintw(10, 91, " "); mvprintw(11, 91, " "); } else if (val < 5) { mvprintw(1, 91, " "); mvprintw(2, 91, " "); mvprintw(3, 91, " "); mvprintw(4, 91, " "); mvprintw(5, 91, " "); mvprintw(7, 91, "||"); mvprintw(8, 91, "||"); mvprintw(9, 91, "||"); mvprintw(10, 91, "\\/"); mvprintw(11, 91, " "); } else { mvprintw(1, 91, " "); mvprintw(2, 91, " "); mvprintw(3, 91, " "); mvprintw(4, 91, " "); mvprintw(5, 91, " "); mvprintw(7, 91, "||"); mvprintw(8, 91, "||"); mvprintw(9, 91, "||"); mvprintw(10, 91, "||"); mvprintw(11, 91, "\\/"); } } static void accel_show_ext(const struct xwii_event *event) { double val; /* pow(val, 1/4) for smoother interpolation around the origin */ val = event->v.abs[0].x; val /= 512; if (val >= 0) val = 10 * pow(val, 0.25); else val = -10 * pow(-val, 0.25); accel_show_ext_x(val); val = event->v.abs[0].z; val /= 512; if (val >= 0) val = 5 * pow(val, 0.25); else val = -5 * pow(-val, 0.25); accel_show_ext_z(val); val = event->v.abs[0].y; val /= 512; if (val >= 0) val = 5 * pow(val, 0.25); else val = -5 * pow(-val, 0.25); accel_show_ext_y(val); } static void accel_show(const struct xwii_event *event) { mvprintw(1, 39, "%5" PRId32, event->v.abs[0].x); mvprintw(1, 48, "%5" PRId32, event->v.abs[0].y); mvprintw(1, 57, "%5" PRId32, event->v.abs[0].z); } static void accel_clear(void) { struct xwii_event ev; ev.v.abs[0].x = 0; ev.v.abs[0].y = 0; ev.v.abs[0].z = 0; accel_show_ext(&ev); accel_show(&ev); } static void accel_toggle(void) { int ret; if (xwii_iface_opened(iface) & XWII_IFACE_ACCEL) { xwii_iface_close(iface, XWII_IFACE_ACCEL); accel_clear(); print_info("Info: Disable accelerometer"); } else { ret = xwii_iface_open(iface, XWII_IFACE_ACCEL); if (ret) print_error("Error: Cannot enable accelerometer: %d", ret); else print_error("Info: Enable accelerometer"); } } /* IR events */ static void ir_show_ext(const struct xwii_event *event) { double v; uint64_t x[4], y[4], i, j, num; char c; mvprintw(1, 106, " | "); mvprintw(2, 106, " "); mvprintw(3, 106, " | "); mvprintw(4, 106, " "); mvprintw(5, 106, " | "); mvprintw(6, 106, "- - - - - - - - - - - - - + - - - - - - - - - - - - -"); mvprintw(7, 106, " | "); mvprintw(8, 106, " "); mvprintw(9, 106, " | "); mvprintw(10, 106, " "); mvprintw(11, 106, " | "); for (i = 0; i < 4; ++i) { v = event->v.abs[i].x; v *= 52; v /= 1024; v += 0.5; x[i] = v; v = event->v.abs[i].y; v *= 10; v /= 768; v += 0.5; y[i] = v; } for (i = 0; i < 4; ++i) { if (!xwii_event_ir_is_valid(&event->v.abs[i])) continue; num = 0; for (j = 0; j < 4; ++j) { if (x[j] == x[i] && y[j] == y[i]) ++num; } if (num > 1) c = '#'; else if (i == 0) c = 'x'; else if (i == 1) c = '+'; else if (i == 2) c = '*'; else c = '-'; mvprintw(1 + y[i], 106 + x[i], "%c", c); } } static void ir_show(const struct xwii_event *event) { if (xwii_event_ir_is_valid(&event->v.abs[0])) { mvprintw(3, 27, "%04" PRId32, event->v.abs[0].x); mvprintw(3, 32, "%04" PRId32, event->v.abs[0].y); } else { mvprintw(3, 27, "N/A "); mvprintw(3, 32, " N/A"); } if (xwii_event_ir_is_valid(&event->v.abs[1])) { mvprintw(3, 41, "%04" PRId32, event->v.abs[1].x); mvprintw(3, 46, "%04" PRId32, event->v.abs[1].y); } else { mvprintw(3, 41, "N/A "); mvprintw(3, 46, " N/A"); } if (xwii_event_ir_is_valid(&event->v.abs[2])) { mvprintw(3, 55, "%04" PRId32, event->v.abs[2].x); mvprintw(3, 60, "%04" PRId32, event->v.abs[2].y); } else { mvprintw(3, 55, "N/A "); mvprintw(3, 60, " N/A"); } if (xwii_event_ir_is_valid(&event->v.abs[3])) { mvprintw(3, 69, "%04" PRId32, event->v.abs[3].x); mvprintw(3, 74, "%04" PRId32, event->v.abs[3].y); } else { mvprintw(3, 69, "N/A "); mvprintw(3, 74, " N/A"); } } static void ir_clear(void) { struct xwii_event ev; ev.v.abs[0].x = 1023; ev.v.abs[0].y = 1023; ev.v.abs[1].x = 1023; ev.v.abs[1].y = 1023; ev.v.abs[2].x = 1023; ev.v.abs[2].y = 1023; ev.v.abs[3].x = 1023; ev.v.abs[3].y = 1023; ir_show_ext(&ev); ir_show(&ev); } static void ir_toggle(void) { int ret; if (xwii_iface_opened(iface) & XWII_IFACE_IR) { xwii_iface_close(iface, XWII_IFACE_IR); ir_clear(); print_info("Info: Disable IR"); } else { ret = xwii_iface_open(iface, XWII_IFACE_IR); if (ret) print_error("Error: Cannot enable IR: %d", ret); else print_error("Info: Enable IR"); } } /* motion plus */ static bool mp_do_refresh; static void mp_show(const struct xwii_event *event) { int32_t x, y, z, factor; if (mp_do_refresh) { xwii_iface_get_mp_normalization(iface, &x, &y, &z, &factor); x = event->v.abs[0].x + x; y = event->v.abs[0].y + y; z = event->v.abs[0].z + z; xwii_iface_set_mp_normalization(iface, x, y, z, factor); /* try to stabilize calibration as MP tends to report huge * values during initialization for 1-2s. */ if (x < 5000 && y < 5000 && z < 5000) mp_do_refresh = false; } x = event->v.abs[0].x; y = event->v.abs[0].y; z = event->v.abs[0].z; mvprintw(5, 25, " %6d", (int16_t)x); mvprintw(5, 35, " %6d", (int16_t)y); mvprintw(5, 45, " %6d", (int16_t)z); } static void mp_clear(void) { struct xwii_event ev; ev.v.abs[0].x = 0; ev.v.abs[0].y = 0; ev.v.abs[0].z = 0; mp_show(&ev); } static void mp_toggle(void) { int ret; if (xwii_iface_opened(iface) & XWII_IFACE_MOTION_PLUS) { xwii_iface_close(iface, XWII_IFACE_MOTION_PLUS); mp_clear(); print_info("Info: Disable Motion Plus"); } else { ret = xwii_iface_open(iface, XWII_IFACE_MOTION_PLUS); if (ret) print_error("Error: Cannot enable MP: %d", ret); else print_info("Info: Enable Motion Plus"); } } static void mp_normalization_toggle(void) { int32_t x, y, z, factor; xwii_iface_get_mp_normalization(iface, &x, &y, &z, &factor); if (!factor) { xwii_iface_set_mp_normalization(iface, x, y, z, 50); print_info("Info: Enable MP Norm: (%i:%i:%i)", (int)x, (int)y, (int)z); } else { xwii_iface_set_mp_normalization(iface, x, y, z, 0); print_info("Info: Disable MP Norm: (%i:%i:%i)", (int)x, (int)y, (int)z); } } static void mp_refresh(void) { mp_do_refresh = true; } /* balance board */ static void bboard_show_ext(const struct xwii_event *event) { uint16_t w, x, y, z; w = event->v.abs[0].x; x = event->v.abs[1].x; y = event->v.abs[2].x; z = event->v.abs[3].x; mvprintw(17, 85, " %5d", y); mvprintw(17, 96, " %5d", w); mvprintw(20, 85, " %5d", z); mvprintw(20, 96, " %5d", x); mvprintw(13, 86, " %5d", w + x + y + z); } static void bboard_clear(void) { struct xwii_event ev; ev.v.abs[0].x = 0; ev.v.abs[1].x = 0; ev.v.abs[2].x = 0; ev.v.abs[3].x = 0; bboard_show_ext(&ev); } static void bboard_toggle(void) { int ret; if (xwii_iface_opened(iface) & XWII_IFACE_BALANCE_BOARD) { xwii_iface_close(iface, XWII_IFACE_BALANCE_BOARD); bboard_clear(); print_info("Info: Disable Balance Board"); } else { ret = xwii_iface_open(iface, XWII_IFACE_BALANCE_BOARD); if (ret) print_error("Error: Cannot enable Balance Board: %d", ret); else print_error("Info: Enable Balance Board"); } } /* pro controller */ static void pro_show_ext(const struct xwii_event *event) { uint16_t code = event->v.key.code; int32_t v; bool pressed = event->v.key.state; char *str = NULL; if (event->type == XWII_EVENT_PRO_CONTROLLER_MOVE) { v = event->v.abs[0].x; mvprintw(14, 116, "%5d", v); if (v > 1000) { mvprintw(16, 118, " "); mvprintw(16, 124, "#####"); } else if (v > 800) { mvprintw(16, 118, " "); mvprintw(16, 124, "#### "); } else if (v > 600) { mvprintw(16, 118, " "); mvprintw(16, 124, "### "); } else if (v > 400) { mvprintw(16, 118, " "); mvprintw(16, 124, "## "); } else if (v > 200) { mvprintw(16, 118, " "); mvprintw(16, 124, "# "); } else if (v > -200) { mvprintw(16, 118, " "); mvprintw(16, 124, " "); } else if (v > -400) { mvprintw(16, 118, " #"); mvprintw(16, 124, " "); } else if (v > -600) { mvprintw(16, 118, " ##"); mvprintw(16, 124, " "); } else if (v > -800) { mvprintw(16, 118, " ###"); mvprintw(16, 124, " "); } else if (v > -1000) { mvprintw(16, 118, " ####"); mvprintw(16, 124, " "); } else { mvprintw(16, 118, "#####"); mvprintw(16, 124, " "); } v = event->v.abs[0].y; mvprintw(14, 125, "%5d", v); if (v > 1000) { mvprintw(14, 123, "#"); mvprintw(15, 123, "#"); mvprintw(17, 123, " "); mvprintw(18, 123, " "); } else if (v > 200) { mvprintw(14, 123, " "); mvprintw(15, 123, "#"); mvprintw(17, 123, " "); mvprintw(18, 123, " "); } else if (v > -200) { mvprintw(14, 123, " "); mvprintw(15, 123, " "); mvprintw(17, 123, " "); mvprintw(18, 123, " "); } else if (v > -1000) { mvprintw(14, 123, " "); mvprintw(15, 123, " "); mvprintw(17, 123, "#"); mvprintw(18, 123, " "); } else { mvprintw(14, 123, " "); mvprintw(15, 123, " "); mvprintw(17, 123, "#"); mvprintw(18, 123, "#"); } v = event->v.abs[1].x; mvprintw(14, 134, "%5d", v); if (v > 1000) { mvprintw(16, 136, " "); mvprintw(16, 142, "#####"); } else if (v > 800) { mvprintw(16, 136, " "); mvprintw(16, 142, "#### "); } else if (v > 600) { mvprintw(16, 136, " "); mvprintw(16, 142, "### "); } else if (v > 400) { mvprintw(16, 136, " "); mvprintw(16, 142, "## "); } else if (v > 200) { mvprintw(16, 136, " "); mvprintw(16, 142, "# "); } else if (v > -200) { mvprintw(16, 136, " "); mvprintw(16, 142, " "); } else if (v > -400) { mvprintw(16, 136, " #"); mvprintw(16, 142, " "); } else if (v > -600) { mvprintw(16, 136, " ##"); mvprintw(16, 142, " "); } else if (v > -800) { mvprintw(16, 136, " ###"); mvprintw(16, 142, " "); } else if (v > -1000) { mvprintw(16, 136, " ####"); mvprintw(16, 142, " "); } else { mvprintw(16, 136, "#####"); mvprintw(16, 142, " "); } v = event->v.abs[1].y; mvprintw(14, 143, "%5d", v); if (v > 1000) { mvprintw(14, 141, "#"); mvprintw(15, 141, "#"); mvprintw(17, 141, " "); mvprintw(18, 141, " "); } else if (v > 200) { mvprintw(14, 141, " "); mvprintw(15, 141, "#"); mvprintw(17, 141, " "); mvprintw(18, 141, " "); } else if (v > -200) { mvprintw(14, 141, " "); mvprintw(15, 141, " "); mvprintw(17, 141, " "); mvprintw(18, 141, " "); } else if (v > -1000) { mvprintw(14, 141, " "); mvprintw(15, 141, " "); mvprintw(17, 141, "#"); mvprintw(18, 141, " "); } else { mvprintw(14, 141, " "); mvprintw(15, 141, " "); mvprintw(17, 141, "#"); mvprintw(18, 141, "#"); } } else if (event->type == XWII_EVENT_PRO_CONTROLLER_KEY) { if (pressed) str = "X"; else str = " "; if (code == XWII_KEY_A) { if (pressed) str = "A"; mvprintw(20, 156, "%s", str); } else if (code == XWII_KEY_B) { if (pressed) str = "B"; mvprintw(21, 154, "%s", str); } else if (code == XWII_KEY_X) { if (pressed) str = "X"; mvprintw(19, 154, "%s", str); } else if (code == XWII_KEY_Y) { if (pressed) str = "Y"; mvprintw(20, 152, "%s", str); } else if (code == XWII_KEY_PLUS) { if (pressed) str = "+"; mvprintw(21, 142, "%s", str); } else if (code == XWII_KEY_MINUS) { if (pressed) str = "-"; mvprintw(21, 122, "%s", str); } else if (code == XWII_KEY_HOME) { if (pressed) str = "HOME+"; else str = " "; mvprintw(21, 130, "%s", str); } else if (code == XWII_KEY_LEFT) { mvprintw(18, 108, "%s", str); } else if (code == XWII_KEY_RIGHT) { mvprintw(18, 112, "%s", str); } else if (code == XWII_KEY_UP) { mvprintw(16, 110, "%s", str); } else if (code == XWII_KEY_DOWN) { mvprintw(20, 110, "%s", str); } else if (code == XWII_KEY_TL) { if (pressed) str = "TL"; else str = " "; mvprintw(14, 108, "%s", str); } else if (code == XWII_KEY_TR) { if (pressed) str = "TR"; else str = " "; mvprintw(14, 155, "%s", str); } else if (code == XWII_KEY_ZL) { if (pressed) str = "ZL"; else str = " "; mvprintw(13, 108, "%s", str); } else if (code == XWII_KEY_ZR) { if (pressed) str = "ZR"; else str = " "; mvprintw(13, 155, "%s", str); } else if (code == XWII_KEY_THUMBL) { if (!pressed) str = "+"; mvprintw(16, 123, "%s", str); } else if (code == XWII_KEY_THUMBR) { if (!pressed) str = "+"; mvprintw(16, 141, "%s", str); } } } static void pro_clear(void) { struct xwii_event ev; unsigned int i; ev.type = XWII_EVENT_PRO_CONTROLLER_MOVE; ev.v.abs[0].x = 0; ev.v.abs[0].y = 0; ev.v.abs[1].x = 0; ev.v.abs[1].y = 0; pro_show_ext(&ev); ev.type = XWII_EVENT_PRO_CONTROLLER_KEY; ev.v.key.state = 0; for (i = 0; i < XWII_KEY_NUM; ++i) { ev.v.key.code = i; pro_show_ext(&ev); } } static void pro_toggle(void) { int ret; if (xwii_iface_opened(iface) & XWII_IFACE_PRO_CONTROLLER) { xwii_iface_close(iface, XWII_IFACE_PRO_CONTROLLER); pro_clear(); print_info("Info: Disable Pro Controller"); } else { ret = xwii_iface_open(iface, XWII_IFACE_PRO_CONTROLLER); if (ret) print_error("Error: Cannot enable Pro Controller: %d", ret); else print_error("Info: Enable Pro Controller"); } } /* rumble events */ static void rumble_show(bool on) { mvprintw(1, 21, on ? "RUMBLE" : " "); } static void rumble_toggle(void) { static bool on = false; int ret; on = !on; ret = xwii_iface_rumble(iface, on); if (ret) { print_error("Error: Cannot toggle rumble motor: %d", ret); on = !on; } rumble_show(on); } /* LEDs */ static bool led1_state; static void led1_show(bool on) { mvprintw(5, 59, on ? "(#1)" : " -1 "); } static void led1_toggle(void) { int ret; led1_state = !led1_state; ret = xwii_iface_set_led(iface, XWII_LED(1), led1_state); if (ret) { print_error("Error: Cannot toggle LED 1: %d", ret); led1_state = !led1_state; } led1_show(led1_state); } static void led1_refresh(void) { int ret; ret = xwii_iface_get_led(iface, XWII_LED(1), &led1_state); if (ret) print_error("Error: Cannot read LED state"); else led1_show(led1_state); } static bool led2_state; static void led2_show(bool on) { mvprintw(5, 64, on ? "(#2)" : " -2 "); } static void led2_toggle(void) { int ret; led2_state = !led2_state; ret = xwii_iface_set_led(iface, XWII_LED(2), led2_state); if (ret) { print_error("Error: Cannot toggle LED 2: %d", ret); led2_state = !led2_state; } led2_show(led2_state); } static void led2_refresh(void) { int ret; ret = xwii_iface_get_led(iface, XWII_LED(2), &led2_state); if (ret) print_error("Error: Cannot read LED state"); else led2_show(led2_state); } static bool led3_state; static void led3_show(bool on) { mvprintw(5, 69, on ? "(#3)" : " -3 "); } static void led3_toggle(void) { int ret; led3_state = !led3_state; ret = xwii_iface_set_led(iface, XWII_LED(3), led3_state); if (ret) { print_error("Error: Cannot toggle LED 3: %d", ret); led3_state = !led3_state; } led3_show(led3_state); } static void led3_refresh(void) { int ret; ret = xwii_iface_get_led(iface, XWII_LED(3), &led3_state); if (ret) print_error("Error: Cannot read LED state"); else led3_show(led3_state); } static bool led4_state; static void led4_show(bool on) { mvprintw(5, 74, on ? "(#4)" : " -4 "); } static void led4_toggle(void) { int ret; led4_state = !led4_state; ret = xwii_iface_set_led(iface, XWII_LED(4), led4_state); if (ret) { print_error("Error: Cannot toggle LED 4: %d", ret); led4_state = !led4_state; } led4_show(led4_state); } static void led4_refresh(void) { int ret; ret = xwii_iface_get_led(iface, XWII_LED(4), &led4_state); if (ret) print_error("Error: Cannot read LED state"); else led4_show(led4_state); } /* battery status */ static void battery_show(uint8_t capacity) { int i; mvprintw(7, 29, "%3u%%", capacity); mvprintw(7, 35, " "); for (i = 0; i * 10 < capacity; ++i) mvprintw(7, 35 + i, "#"); } static void battery_refresh(void) { int ret; uint8_t capacity; ret = xwii_iface_get_battery(iface, &capacity); if (ret) print_error("Error: Cannot read battery capacity"); else battery_show(capacity); } /* device type */ static void devtype_refresh(void) { int ret; char *name; ret = xwii_iface_get_devtype(iface, &name); if (ret) { print_error("Error: Cannot read device type"); } else { mvprintw(9, 28, " "); mvprintw(9, 28, "%s", name); free(name); } } /* extension type */ static void extension_refresh(void) { int ret; char *name; ret = xwii_iface_get_extension(iface, &name); if (ret) { print_error("Error: Cannot read extension type"); } else { mvprintw(7, 54, " "); mvprintw(7, 54, "%s", name); free(name); } if (xwii_iface_available(iface) & XWII_IFACE_MOTION_PLUS) mvprintw(7, 77, "M+"); else mvprintw(7, 77, " "); } /* basic window setup */ static void refresh_all(void) { battery_refresh(); led1_refresh(); led2_refresh(); led3_refresh(); led4_refresh(); devtype_refresh(); extension_refresh(); mp_refresh(); if (geteuid() != 0) mvprintw(20, 22, "Warning: Please run as root! (sysfs+evdev access needed)"); } static void setup_window(void) { size_t i; i = 0; /* 80x24 Box */ mvprintw(i++, 0, "+- Keys ----------+ +------+ +---------------------------------+---------------+"); mvprintw(i++, 0, "| +-+ | | | Accel x: y: z: | XWIIMOTE SHOW |"); mvprintw(i++, 0, "| | | | +------+ +---------------------------------+---------------+"); mvprintw(i++, 0, "| +-+ +-+ | IR #1: x #2: x #3: x #4: x |"); mvprintw(i++, 0, "| | | | +--------------------------------+-------------------------+"); mvprintw(i++, 0, "| +-+ +-+ | MP x: y: z: | LED -0 -1 -2 -3 |"); mvprintw(i++, 0, "| | | | +--------------------------+-----+----------------------+--+"); mvprintw(i++, 0, "| +-+ | Battery: | | | Ext: | |"); mvprintw(i++, 0, "| | +--------------------------+----------------------------+--+"); mvprintw(i++, 0, "| +-+ +-+ | Device: |"); mvprintw(i++, 0, "| | | | | | +----------------------------------------------------------+"); mvprintw(i++, 0, "| +-+ +-+ | |"); mvprintw(i++, 0, "| | |"); mvprintw(i++, 0, "| ( ) | | ( ) | |"); mvprintw(i++, 0, "| | |"); mvprintw(i++, 0, "| +++++ | |"); mvprintw(i++, 0, "| + + | |"); mvprintw(i++, 0, "| + + | |"); mvprintw(i++, 0, "| +++++ | |"); mvprintw(i++, 0, "| | +----------------------------------------------------------+"); mvprintw(i++, 0, "| | | | | |"); mvprintw(i++, 0, "| | | | +----------------------------------------------------------+"); mvprintw(i++, 0, "| | | "); mvprintw(i++, 0, "+-----------------+ |"); } static void setup_ext_window(void) { size_t i; i = 0; /* 160x40 Box */ mvprintw(i++, 80, " +- Accel -------------+ +- IR ---------------------+--------------------------+"); mvprintw(i++, 80, " | | | |"); mvprintw(i++, 80, " Z | | |"); mvprintw(i++, 80, " | | | |"); mvprintw(i++, 80, " | | |"); mvprintw(i++, 80, " | | | |"); mvprintw(i++, 80, " ## | +- - - - - - - - - - - - - + - - - - - - - - - - - - -+"); mvprintw(i++, 80, " X | | | |"); mvprintw(i++, 80, " | | |"); mvprintw(i++, 80, " | | | |"); mvprintw(i++, 80, " | | |"); mvprintw(i++, 80, " Y | | | |"); mvprintw(i++, 80, " +- Balance Board -----+ +- Pro Controller ---------+--------------------------+"); mvprintw(i++, 80, " Sum: | | |ZL| +-+ +-+ |ZR| |"); mvprintw(i++, 80, " | | |TL| | | | | |TR| |"); mvprintw(i++, 80, " | | | +-+ +--- ---+ +--- ---+ |"); mvprintw(i++, 80, " | | | | | | + | | + | |"); mvprintw(i++, 80, " #1: #2: | | +-+ +-+ +--- ---+ +--- ---+ |"); mvprintw(i++, 80, " | | | | | | | | | |"); mvprintw(i++, 80, " | | | +-+ +-+ +-+ +-+ |X| |"); mvprintw(i++, 80, " #3: #4: | | | | |Y| |A| |"); mvprintw(i++, 80, " | | +-+ (-) |HOME+| (+) |B| |"); mvprintw(i++, 80, " +---------------------+ +-----------------------------------------------------+"); i = 24; mvprintw(i++, 0, "+-------------------+----------------------------------------------------------+"); mvprintw(i++, 0, "| |"); mvprintw(i++, 0, "| |"); mvprintw(i++, 0, "| |"); mvprintw(i++, 0, "| |"); mvprintw(i++, 0, "| |"); mvprintw(i++, 0, "| |"); mvprintw(i++, 0, "| |"); mvprintw(i++, 0, "| |"); mvprintw(i++, 0, "| |"); mvprintw(i++, 0, "| |"); mvprintw(i++, 0, "| |"); mvprintw(i++, 0, "| |"); mvprintw(i++, 0, "| |"); mvprintw(i++, 0, "| |"); mvprintw(i++, 0, "+------------------------------------------------------------------------------+"); i = 24; mvprintw(i++, 80, " +-----------------------------------------------------------------------------+"); mvprintw(i++, 80, " |"); mvprintw(i++, 80, " |"); mvprintw(i++, 80, " |"); mvprintw(i++, 80, " |"); mvprintw(i++, 80, " |"); mvprintw(i++, 80, " |"); mvprintw(i++, 80, " |"); mvprintw(i++, 80, " |"); mvprintw(i++, 80, " |"); mvprintw(i++, 80, " |"); mvprintw(i++, 80, " |"); mvprintw(i++, 80, " |"); mvprintw(i++, 80, " |"); mvprintw(i++, 80, " |"); mvprintw(i++, 80, " +-----------------------------------------------------------------------------+"); } static void handle_resize(void) { if (LINES < 24 || COLS < 80) { mode = MODE_ERROR; erase(); mvprintw(0, 0, "Error: Screen smaller than 80x24; no view"); } else if (LINES < 40 || COLS < 160) { mode = MODE_NORMAL; erase(); setup_window(); refresh_all(); print_info("Info: Screen smaller than 160x40; limited view"); } else { mode = MODE_EXTENDED; erase(); setup_ext_window(); setup_window(); refresh_all(); print_info("Info: Screen initialized for extended view"); } } /* device watch events */ static void handle_watch(void) { static unsigned int num; int ret; print_info("Info: Watch Event #%u", ++num); ret = xwii_iface_open(iface, xwii_iface_available(iface) | XWII_IFACE_WRITABLE); if (ret) print_error("Error: Cannot open interface: %d", ret); refresh_all(); } /* keyboard handling */ static void freeze_toggle(void) { freeze = !freeze; print_info("Info: %sreeze screen", freeze ? "F" : "Unf"); } static int keyboard(void) { int key; key = getch(); if (key == ERR) return 0; switch (key) { case KEY_RESIZE: handle_resize(); break; case 'k': key_toggle(); break; case 'a': accel_toggle(); break; case 'i': ir_toggle(); break; case 'm': mp_toggle(); break; case 'n': mp_normalization_toggle(); break; case 'b': bboard_toggle(); break; case 'p': pro_toggle(); break; case 'r': rumble_toggle(); break; case '1': led1_toggle(); break; case '2': led2_toggle(); break; case '3': led3_toggle(); break; case '4': led4_toggle(); break; case 'f': freeze_toggle(); break; case 's': refresh_all(); break; case 'q': return -ECANCELED; } return 0; } static int run_iface(struct xwii_iface *iface) { struct xwii_event event; int ret = 0; struct pollfd fds[2]; handle_resize(); key_clear(); accel_clear(); ir_clear(); mp_clear(); bboard_clear(); pro_clear(); refresh_all(); refresh(); memset(fds, 0, sizeof(fds)); fds[0].fd = 0; fds[0].events = POLLIN; fds[1].fd = xwii_iface_get_fd(iface); fds[1].events = POLLIN; ret = xwii_iface_watch(iface, true); if (ret) print_error("Error: Cannot initialize hotplug watch descriptor"); while (true) { ret = poll(fds, 2, -1); if (ret < 0) { if (errno != EINTR) { ret = -errno; print_error("Error: Cannot poll fds: %d", ret); break; } } ret = xwii_iface_dispatch(iface, &event, sizeof(event)); if (ret) { if (ret != -EAGAIN) { print_error("Error: Read failed with err:%d", ret); break; } } else if (!freeze) { switch (event.type) { case XWII_EVENT_WATCH: handle_watch(); break; case XWII_EVENT_KEY: if (mode != MODE_ERROR) key_show(&event); break; case XWII_EVENT_ACCEL: if (mode == MODE_EXTENDED) accel_show_ext(&event); if (mode != MODE_ERROR) accel_show(&event); break; case XWII_EVENT_IR: if (mode == MODE_EXTENDED) ir_show_ext(&event); if (mode != MODE_ERROR) ir_show(&event); break; case XWII_EVENT_MOTION_PLUS: if (mode != MODE_ERROR) mp_show(&event); break; case XWII_EVENT_BALANCE_BOARD: if (mode == MODE_EXTENDED) bboard_show_ext(&event); break; case XWII_EVENT_PRO_CONTROLLER_KEY: case XWII_EVENT_PRO_CONTROLLER_MOVE: if (mode == MODE_EXTENDED) pro_show_ext(&event); break; } } ret = keyboard(); if (ret == -ECANCELED) return 0; else if (ret) return ret; refresh(); } return ret; } static int enumerate() { struct xwii_monitor *mon; char *ent; int num = 0; mon = xwii_monitor_new(false, false); if (!mon) { printf("Cannot create monitor\n"); return -EINVAL; } while ((ent = xwii_monitor_poll(mon))) { printf(" Found device #%d: %s\n", ++num, ent); free(ent); } xwii_monitor_unref(mon); return 0; } static char *get_dev(int num) { struct xwii_monitor *mon; char *ent; int i = 0; mon = xwii_monitor_new(false, false); if (!mon) { printf("Cannot create monitor\n"); return NULL; } while ((ent = xwii_monitor_poll(mon))) { if (++i == num) break; free(ent); } xwii_monitor_unref(mon); if (!ent) printf("Cannot find device with number #%d\n", num); return ent; } int main(int argc, char **argv) { int ret = 0; char *path = NULL; if (argc < 2 || !strcmp(argv[1], "-h")) { printf("Usage:\n"); printf("\txwiishow [-h]: Show help\n"); printf("\txwiishow list: List connected devices\n"); printf("\txwiishow : Show device with number #num\n"); printf("\txwiishow /sys/path/to/device: Show given device\n"); printf("UI commands:\n"); printf("\tq: Quit application\n"); printf("\tf: Freeze/Unfreeze screen\n"); printf("\ts: Refresh static values (like battery or calibration)\n"); printf("\tk: Toggle key events\n"); printf("\tr: Toggle rumble motor\n"); printf("\ta: Toggle accelerometer\n"); printf("\ti: Toggle IR camera\n"); printf("\tm: Toggle motion plus\n"); printf("\tn: Toggle normalization for motion plus\n"); printf("\tb: Toggle balance board\n"); printf("\tp: Toggle pro controller\n"); printf("\t1: Toggle LED 1\n"); printf("\t2: Toggle LED 2\n"); printf("\t3: Toggle LED 3\n"); printf("\t4: Toggle LED 4\n"); ret = -1; } else if (!strcmp(argv[1], "list")) { printf("Listing connected Wii Remote devices:\n"); ret = enumerate(); printf("End of device list\n"); } else { if (argv[1][0] != '/') path = get_dev(atoi(argv[1])); ret = xwii_iface_new(&iface, path ? path : argv[1]); free(path); if (ret) { printf("Cannot create xwii_iface '%s' err:%d\n", argv[1], ret); } else { initscr(); curs_set(0); raw(); noecho(); timeout(0); ret = xwii_iface_open(iface, xwii_iface_available(iface) | XWII_IFACE_WRITABLE); if (ret) print_error("Error: Cannot open interface: %d", ret); ret = run_iface(iface); xwii_iface_unref(iface); if (ret) { print_error("Program failed; press any key to exit"); refresh(); timeout(-1); getch(); } endwin(); } } return abs(ret); }