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 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"