Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
WiimoteReal: reimplement using HIDAPI
Using the HIDAPI library has the advantage that we get Wiimote and DolphinBar support on all platforms with only one IO implementation.
- Loading branch information
Showing
19 changed files
with
245 additions
and
1,703 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,9 @@ | ||
| find_path(HIDAPI_INCLUDE_DIR NAMES hidapi.h PATH_SUFFIXES hidapi) | ||
| find_library(HIDAPI_LIBRARY NAMES hidapi hidapi-hidraw hidapi-libusb) | ||
| set(HIDAPI_LIBRARIES ${HIDAPI_LIBRARY}) | ||
| set(HIDAPI_INCLUDE_DIRS ${HIDAPI_INCLUDE_DIR}) | ||
|
|
||
| include(FindPackageHandleStandardArgs) | ||
| find_package_handle_standard_args(HIDAPI DEFAULT_MSG HIDAPI_LIBRARY HIDAPI_INCLUDE_DIR) | ||
|
|
||
| mark_as_advanced(HIDAPI_INCLUDE_DIR HIDAPI_LIBRARY) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| add_library(hidapi-libusb hid.c) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| add_library(hidapi-hidraw hid.c) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| add_library(hidapi hid.c) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,17 @@ | ||
| # This file is only used for Android (because I'm lazy). | ||
| # We don't use CMake on Windows and just require libusb to be installed everywhere else. | ||
|
|
||
| set(SRCS | ||
| core.c | ||
| descriptor.c | ||
| hotplug.c | ||
| io.c | ||
| strerror.c | ||
| sync.c | ||
| ) | ||
|
|
||
| include_directories(BEFORE ../android) | ||
|
|
||
| add_subdirectory(os) | ||
| add_library(usb-1.0 STATIC ${SRCS}) | ||
| target_link_libraries(usb-1.0 usb-os) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| include_directories(..) | ||
| add_library(usb-os STATIC | ||
| linux_netlink.c | ||
| linux_usbfs.c | ||
| poll_posix.c | ||
| threads_posix.c | ||
| ) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,8 @@ | ||
| # This is how you can match Wiimotes (and Wiimote-emulating devices like the DolphinBar) in udev. | ||
| # If you are a package maintainer you'll probably want to restrict permissions to a group: GROUP="plugdev", MODE="0660". | ||
|
|
||
| # Wiimote or DolphinBar | ||
| SUBSYSTEMS=="hid", ATTRS{idVendor}=="057e", ATTRS{idProduct}=="0306", MODE="0666" | ||
|
|
||
| # newer Wiimotes (RVL-CNT-01-TR) | ||
| SUBSYSTEMS=="hid", ATTRS{idVendor}=="057e", ATTRS{idProduct}=="0330", MODE="0666" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.