Skip to content

Commit

Permalink
Merge pull request #19 from Moosieboy/master
Browse files Browse the repository at this point in the history
 add support for Logitech G633
  • Loading branch information
Sapd authored May 9, 2018
2 parents 4e8d256 + 747d9a9 commit 31154fb
Show file tree
Hide file tree
Showing 6 changed files with 41 additions and 3 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
8 changes: 5 additions & 3 deletions src/device_registry.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 <string.h>


#define NUMDEVICES 6
#define NUMDEVICES 7
// array of pointers to device
static struct device *(devicelist[NUMDEVICES]);

Expand All @@ -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)
Expand Down
2 changes: 2 additions & 0 deletions src/devices/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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)
29 changes: 29 additions & 0 deletions src/devices/logitech_g633.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
#include "../device.h"

#include <string.h>

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);
}


3 changes: 3 additions & 0 deletions src/devices/logitech_g633.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#pragma once

void g633_init(struct device** device);
1 change: 1 addition & 0 deletions udev/logitechg633.rules
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
SUBSYSTEM=="usb", ENV{ID_MODEL}=="Logitech_G633_Gaming_Headset", MODE="0666"

0 comments on commit 31154fb

Please sign in to comment.