Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Linux: Allow connecting Wiimotes via L2CAP #1353

Merged
merged 25 commits into from
Dec 7, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
91679d5
Add `L2CapWiimote`
capitalistspz Sep 26, 2024
444a8de
Remove unnecessary != overload
capitalistspz Sep 26, 2024
32cb2bf
Create `L2CapWiimote` instances as `shared_ptr`
capitalistspz Sep 26, 2024
e5d1d0e
Allow `WiimoteControllerProvider` to receive `L2CapWiimote`s
capitalistspz Sep 26, 2024
b71ace1
Link `bluez`
capitalistspz Sep 26, 2024
0d4176a
Correct return value on `L2CapWiimote::write_data`
capitalistspz Sep 26, 2024
00ff45d
PairingDialog: Implement 'pairing' for bluez, reformat file
capitalistspz Sep 26, 2024
e6e437b
Fix periodic hitching when controller paired and connected
capitalistspz Sep 26, 2024
447d760
`WiimoteDevice`: Make equality actually constant
capitalistspz Sep 26, 2024
3c7768c
Fix Windows build error
capitalistspz Sep 26, 2024
667bf96
Use bdaddr to compare `L2CapWiimote`s
capitalistspz Sep 26, 2024
11656c3
`WiimoteControllerProvider`: Move device getting to another thread
capitalistspz Sep 26, 2024
cc2212a
Stop using `std::jthread`, because Mac doesn't support it
capitalistspz Sep 26, 2024
182e905
Make Bluez optional
capitalistspz Sep 26, 2024
7f58a20
Add bluez libs to dependency list
capitalistspz Sep 26, 2024
55e2403
Install `libbluetooth-dev` for AppImage too
capitalistspz Sep 26, 2024
e14c54b
Fix a crash from writing to a disconnected device
capitalistspz Sep 26, 2024
8ba4b05
Stop replacing non-duplicate controllers
capitalistspz Sep 26, 2024
f43f88f
Prevent storing duplicate addresses
capitalistspz Oct 1, 2024
0340e5e
Free BT resources acquired during pairing
capitalistspz Oct 3, 2024
9046dca
Show bluetooth address in correct order.
capitalistspz Oct 4, 2024
5184e63
Search for up to 4 devices at a time
capitalistspz Oct 10, 2024
cff8d90
Make cancellable between name reads, disable cancel button during inq…
capitalistspz Oct 21, 2024
08b0bfb
screaming case constexpr
capitalistspz Nov 22, 2024
a648fc7
Prevent connection attempts on still-connected controllers
capitalistspz Dec 3, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ jobs:
- name: "Install system dependencies"
run: |
sudo apt update -qq
sudo apt install -y clang-15 cmake freeglut3-dev libgcrypt20-dev libglm-dev libgtk-3-dev libpulse-dev libsecret-1-dev libsystemd-dev libudev-dev nasm ninja-build
sudo apt install -y clang-15 cmake freeglut3-dev libgcrypt20-dev libglm-dev libgtk-3-dev libpulse-dev libsecret-1-dev libsystemd-dev libudev-dev nasm ninja-build libbluetooth-dev
- name: "Setup cmake"
uses: jwlawson/actions-setup-cmake@v2
Expand Down Expand Up @@ -96,7 +96,7 @@ jobs:
- name: "Install system dependencies"
run: |
sudo apt update -qq
sudo apt install -y clang-15 cmake freeglut3-dev libgcrypt20-dev libglm-dev libgtk-3-dev libpulse-dev libsecret-1-dev libsystemd-dev nasm ninja-build appstream
sudo apt install -y clang-15 cmake freeglut3-dev libgcrypt20-dev libglm-dev libgtk-3-dev libpulse-dev libsecret-1-dev libsystemd-dev nasm ninja-build appstream libbluetooth-dev
- name: "Build AppImage"
run: |
Expand Down
6 changes: 3 additions & 3 deletions BUILD.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,18 +46,18 @@ To compile Cemu, a recent enough compiler and STL with C++20 support is required
### Dependencies

#### For Arch and derivatives:
`sudo pacman -S --needed base-devel clang cmake freeglut git glm gtk3 libgcrypt libpulse libsecret linux-headers llvm nasm ninja systemd unzip zip`
`sudo pacman -S --needed base-devel bluez-libs clang cmake freeglut git glm gtk3 libgcrypt libpulse libsecret linux-headers llvm nasm ninja systemd unzip zip`

#### For Debian, Ubuntu and derivatives:
`sudo apt install -y cmake curl clang-15 freeglut3-dev git libgcrypt20-dev libglm-dev libgtk-3-dev libpulse-dev libsecret-1-dev libsystemd-dev libtool nasm ninja-build`
`sudo apt install -y cmake curl clang-15 freeglut3-dev git libbluetooth-dev libgcrypt20-dev libglm-dev libgtk-3-dev libpulse-dev libsecret-1-dev libsystemd-dev libtool nasm ninja-build`

You may also need to install `libusb-1.0-0-dev` as a workaround for an issue with the vcpkg hidapi package.

At Step 3 in [Build Cemu using cmake and clang](#build-cemu-using-cmake-and-clang), use the following command instead:
`cmake -S . -B build -DCMAKE_BUILD_TYPE=release -DCMAKE_C_COMPILER=/usr/bin/clang-15 -DCMAKE_CXX_COMPILER=/usr/bin/clang++-15 -G Ninja -DCMAKE_MAKE_PROGRAM=/usr/bin/ninja`

#### For Fedora and derivatives:
`sudo dnf install clang cmake cubeb-devel freeglut-devel git glm-devel gtk3-devel kernel-headers libgcrypt-devel libsecret-devel libtool libusb1-devel llvm nasm ninja-build perl-core systemd-devel zlib-devel zlib-static`
`sudo dnf install bluez-libs clang cmake cubeb-devel freeglut-devel git glm-devel gtk3-devel kernel-headers libgcrypt-devel libsecret-devel libtool libusb1-devel llvm nasm ninja-build perl-core systemd-devel zlib-devel zlib-static`

### Build Cemu

Expand Down
7 changes: 7 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,7 @@ endif()
if (UNIX AND NOT APPLE)
option(ENABLE_WAYLAND "Build with Wayland support" ON)
option(ENABLE_FERAL_GAMEMODE "Enables Feral Interactive GameMode Support" ON)
option(ENABLE_BLUEZ "Build with Bluez support" ON)
endif()

option(ENABLE_OPENGL "Enables the OpenGL backend" ON)
Expand Down Expand Up @@ -179,6 +180,12 @@ if (UNIX AND NOT APPLE)
endif()
find_package(GTK3 REQUIRED)

if(ENABLE_BLUEZ)
find_package(bluez REQUIRED)
set(ENABLE_WIIMOTE ON)
add_compile_definitions(HAS_BLUEZ)
endif()

endif()

if (ENABLE_VULKAN)
Expand Down
20 changes: 20 additions & 0 deletions cmake/Findbluez.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# SPDX-FileCopyrightText: 2022 Andrea Pappacoda <[email protected]>
# SPDX-License-Identifier: ISC

find_package(bluez CONFIG)
if (NOT bluez_FOUND)
find_package(PkgConfig)
if (PKG_CONFIG_FOUND)
pkg_search_module(bluez IMPORTED_TARGET GLOBAL bluez-1.0 bluez)
if (bluez_FOUND)
add_library(bluez::bluez ALIAS PkgConfig::bluez)
endif ()
endif ()
endif ()

find_package_handle_standard_args(bluez
REQUIRED_VARS
bluez_LINK_LIBRARIES
bluez_FOUND
VERSION_VAR bluez_VERSION
)
Loading
Loading