diff --git a/README.md b/README.md index 3bf2b1a2..fc77454b 100644 --- a/README.md +++ b/README.md @@ -14,6 +14,7 @@ talking. This differs from a simple loopback via PulseAudio as you won't have an | Corsair Headset Device | x | x | x | x | | | | | | | | | | HyperX Cloud Alpha Wireless | x | x | | | x | | x | | | | | | | HyperX Cloud Flight Wireless | | x | | | | | | | | | | | +| HyperX Cloud 3 | x | | | | | | | | | | | | | Logitech G430 | x | | | | | | | | | | | | | Logitech G432/G433 | x | | | | | | | | | | | | | Logitech G533 | x | x | | | x | | | | | | | | diff --git a/src/device_registry.c b/src/device_registry.c index 87394276..f981439d 100644 --- a/src/device_registry.c +++ b/src/device_registry.c @@ -4,6 +4,7 @@ #include "devices/headsetcontrol_test.h" #include "devices/hyperx_calphaw.h" #include "devices/hyperx_cflight.h" +#include "devices/hyperx_cloud_3.h" #include "devices/logitech_g430.h" #include "devices/logitech_g432.h" #include "devices/logitech_g533.h" @@ -42,6 +43,7 @@ void init_devices() // HyperX add_device(calphaw_init); add_device(cflight_init); + add_device(hyperx_cloud3_init); // Logitech add_device(g430_init); add_device(g432_init); diff --git a/src/devices/CMakeLists.txt b/src/devices/CMakeLists.txt index 91227c9c..2e39df31 100644 --- a/src/devices/CMakeLists.txt +++ b/src/devices/CMakeLists.txt @@ -3,6 +3,8 @@ set(SOURCE_FILES ${SOURCE_FILES} ${CMAKE_CURRENT_SOURCE_DIR}/hyperx_cflight.h ${CMAKE_CURRENT_SOURCE_DIR}/hyperx_calphaw.c ${CMAKE_CURRENT_SOURCE_DIR}/hyperx_calphaw.h + ${CMAKE_CURRENT_SOURCE_DIR}/hyperx_cloud_3.c + ${CMAKE_CURRENT_SOURCE_DIR}/hyperx_cloud_3.h ${CMAKE_CURRENT_SOURCE_DIR}/corsair_void.c ${CMAKE_CURRENT_SOURCE_DIR}/corsair_void.h ${CMAKE_CURRENT_SOURCE_DIR}/logitech_g930.c diff --git a/src/devices/hyperx_cloud_3.c b/src/devices/hyperx_cloud_3.c new file mode 100644 index 00000000..a696b535 --- /dev/null +++ b/src/devices/hyperx_cloud_3.c @@ -0,0 +1,39 @@ +#include "../device.h" +#include "../utility.h" + +#include +#include +#include + +#define VENDOR_HYPERX_CLOUD 0x03f0 +#define ID_CLOUD3_WIRE 0x089d + +static struct device device_c3; + +static const uint16_t PRODUCT_IDS[] = { ID_CLOUD3_WIRE }; + +static int hyperx_cloud3_send_sidetone(hid_device* device_handle, uint8_t num); + +void hyperx_cloud3_init(struct device** device) +{ + device_c3.idVendor = VENDOR_HYPERX_CLOUD; + device_c3.idProductsSupported = PRODUCT_IDS; + device_c3.numIdProducts = sizeof(PRODUCT_IDS) / sizeof(PRODUCT_IDS[0]); + strncpy(device_c3.device_name, "HyperX Cloud 3", sizeof(device_c3.device_name)); + + device_c3.capabilities = B(CAP_SIDETONE); + device_c3.send_sidetone = &hyperx_cloud3_send_sidetone; + + *device = &device_c3; +} + +static int hyperx_cloud3_send_sidetone(hid_device* device_handle, uint8_t num) +{ + // Supports only on/off + int on = num > 0 ? 1 : 0; + +#define MSG_SIZE 62 + uint8_t data[MSG_SIZE] = { 0x20, 0x86, on }; + + return hid_send_feature_report(device_handle, data, MSG_SIZE); +} diff --git a/src/devices/hyperx_cloud_3.h b/src/devices/hyperx_cloud_3.h new file mode 100644 index 00000000..839ab871 --- /dev/null +++ b/src/devices/hyperx_cloud_3.h @@ -0,0 +1 @@ +void hyperx_cloud3_init(struct device** device);