From d75ad9918342d13d4018f7b33e35ee32692b619b Mon Sep 17 00:00:00 2001 From: Bas Buur Date: Wed, 9 May 2018 20:39:21 +0200 Subject: [PATCH 1/2] add support for Logitech G633 --- src/device_registry.c | 8 +++++--- src/devices/CMakeLists.txt | 2 ++ src/devices/logitech_g633.c | 29 +++++++++++++++++++++++++++++ src/devices/logitech_g633.h | 3 +++ udev/logitechg633.rules | 1 + 5 files changed, 40 insertions(+), 3 deletions(-) create mode 100644 src/devices/logitech_g633.c create mode 100644 src/devices/logitech_g633.h create mode 100644 udev/logitechg633.rules diff --git a/src/device_registry.c b/src/device_registry.c index 1147eae..e2fdb8c 100644 --- a/src/device_registry.c +++ b/src/device_registry.c @@ -4,13 +4,14 @@ #include "devices/corsair_voidpro.h" #include "devices/logitech_g430.h" #include "devices/logitech_g533.h" +#include "devices/logitech_g633.h" #include "devices/logitech_g930.h" #include "devices/steelseries_arctis7.h" #include -#define NUMDEVICES 6 +#define NUMDEVICES 7 // array of pointers to device static struct device *(devicelist[NUMDEVICES]); @@ -20,8 +21,9 @@ void init_devices() voidpro_init(&devicelist[1]); g430_init(&devicelist[2]); g533_init(&devicelist[3]); - g930_init(&devicelist[4]); - arctis7_init(&devicelist[5]); + g633_init(&devicelist[4]); + g930_init(&devicelist[5]); + arctis7_init(&devicelist[6]); } int get_device(struct device* device_found, uint16_t idVendor, uint16_t idProduct) diff --git a/src/devices/CMakeLists.txt b/src/devices/CMakeLists.txt index af8c69f..17fabcf 100644 --- a/src/devices/CMakeLists.txt +++ b/src/devices/CMakeLists.txt @@ -9,6 +9,8 @@ set(SOURCE_FILES ${SOURCE_FILES} ${CMAKE_CURRENT_SOURCE_DIR}/logitech_g430.h ${CMAKE_CURRENT_SOURCE_DIR}/logitech_g533.c ${CMAKE_CURRENT_SOURCE_DIR}/logitech_g533.h + ${CMAKE_CURRENT_SOURCE_DIR}/logitech_g633.c + ${CMAKE_CURRENT_SOURCE_DIR}/logitech_g633.h ${CMAKE_CURRENT_SOURCE_DIR}/steelseries_arctis7.c ${CMAKE_CURRENT_SOURCE_DIR}/steelseries_arctis7.h PARENT_SCOPE) diff --git a/src/devices/logitech_g633.c b/src/devices/logitech_g633.c new file mode 100644 index 0000000..894226c --- /dev/null +++ b/src/devices/logitech_g633.c @@ -0,0 +1,29 @@ +#include "../device.h" + +#include + +static struct device device_g633; + +static int g633_send_sidetone(hid_device *device_handle, uint8_t num); + +void g633_init(struct device** device) +{ + device_g633.idVendor = VENDOR_LOGITECH; + device_g633.idProduct = 0x0a5c; + + strcpy(device_g633.device_name, "Logitech G633 Gaming Headset"); + + device_g633.capabilities = CAP_SIDETONE; + device_g633.send_sidetone = &g633_send_sidetone; + + *device = &device_g633; +} + +static int g633_send_sidetone(hid_device *device_handle, uint8_t num) +{ + unsigned char data[5] = {0x11, 0xFF, 0x07, 0x1A, num}; + + return hid_write(device_handle, data, 5); +} + + diff --git a/src/devices/logitech_g633.h b/src/devices/logitech_g633.h new file mode 100644 index 0000000..f76fdde --- /dev/null +++ b/src/devices/logitech_g633.h @@ -0,0 +1,3 @@ +#pragma once + +void g633_init(struct device** device); diff --git a/udev/logitechg633.rules b/udev/logitechg633.rules new file mode 100644 index 0000000..0f68175 --- /dev/null +++ b/udev/logitechg633.rules @@ -0,0 +1 @@ +SUBSYSTEM=="usb", ENV{ID_MODEL}=="Logitech_G633_Gaming_Headset", MODE="0666" From 747d9a98c165ad9af37fbc789502b4882f182387 Mon Sep 17 00:00:00 2001 From: Bas Buur Date: Wed, 9 May 2018 20:43:34 +0200 Subject: [PATCH 2/2] add g633 support to readme --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 102b6d9..0162a06 100644 --- a/README.md +++ b/README.md @@ -9,6 +9,7 @@ Sidetone: - Corsair Void - Corsair Void Pro - Logitech G930 +- Logitech G633 - Logitech G533 - Logitech G430 (Last working on macOS in commit 41be99379f) - SteelSeries Arctis 7