Skip to content

Commit

Permalink
Merge pull request #38 from QuestofIranon/master
Browse files Browse the repository at this point in the history
Add support for the Seel Series Arctis Pro 2019 edition
  • Loading branch information
Sapd committed May 28, 2019
2 parents 865a8d5 + 8760e64 commit 3138482
Show file tree
Hide file tree
Showing 6 changed files with 67 additions and 2 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ talking. This differs from a simple loopback via PulseAudio as you won't have an
- Logitech G533
- Logitech G430 (Last working on macOS in commit 41be99379f)
- SteelSeries Arctis 7

- SteelSeries Arctis Pro 2019 Edition

### Other Features

Expand Down
4 changes: 3 additions & 1 deletion src/device_registry.c
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,12 @@
#include "devices/logitech_g633.h"
#include "devices/logitech_g930.h"
#include "devices/steelseries_arctis7.h"
#include "devices/steelseries_arctispro_2019.h"

#include <string.h>


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

Expand All @@ -26,6 +27,7 @@ void init_devices()
g633_init(&devicelist[5]);
g930_init(&devicelist[6]);
arctis7_init(&devicelist[7]);
arctispro_2019_init(&devicelist[8]);
}

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 @@ -15,4 +15,6 @@ set(SOURCE_FILES ${SOURCE_FILES}
${CMAKE_CURRENT_SOURCE_DIR}/logitech_g633.h
${CMAKE_CURRENT_SOURCE_DIR}/steelseries_arctis7.c
${CMAKE_CURRENT_SOURCE_DIR}/steelseries_arctis7.h
${CMAKE_CURRENT_SOURCE_DIR}/steelseries_arctispro_2019.c
${CMAKE_CURRENT_SOURCE_DIR}/steelseries_arctispro_2019.h
PARENT_SCOPE)
57 changes: 57 additions & 0 deletions src/devices/steelseries_arctispro_2019.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
#include "../device.h"
#include "../utility.h"

#include <hidapi.h>
#include <string.h>
#include <stdlib.h>

static struct device device_arctispro_2019;

static int arctispro_2019_send_sidetone(hid_device *device_handle, uint8_t num);

void arctispro_2019_init(struct device** device)
{
device_arctispro_2019.idVendor = VENDOR_STEELSERIES;
device_arctispro_2019.idProduct = 0x1252;
device_arctispro_2019.idInterface = 0x05;

strcpy(device_arctispro_2019.device_name, "Steel Series Arctis Pro 2019");

device_arctispro_2019.capabilities = CAP_SIDETONE;
device_arctispro_2019.send_sidetone = &arctispro_2019_send_sidetone;

*device = &device_arctispro_2019;
}

static int arctispro_2019_send_sidetone(hid_device *device_handle, uint8_t num)
{
int ret = -1;

// the range of the Arctis pro 2019 seems to be the same as the 7 - 0 to 0x12 (18)
num = map(num, 0, 128, 0x00, 0x12);

unsigned char *buf = calloc(31, 1);

if (!buf)
{
return ret;
}

const unsigned char data_on[5] = {0x06, 0x35, 0x01, 0x00, num};
const unsigned char data_off[2] = {0x06, 0x35};

if (num)
{
memmove(buf, data_on, sizeof(data_on));
}
else
{
memmove(buf, data_off, sizeof(data_off));
}

ret = hid_write(device_handle, buf, 31);

SAFE_FREE(buf);

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

void arctispro_2019_init(struct device** device);
1 change: 1 addition & 0 deletions udev/50-steelseries-arctis-pro-2019.rules
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
SUBSYSTEM=="hidraw", SUBSYSTEMS=="usb", ATTRS{idVendor}=="1038", ATTRS{idProduct}=="1252", MODE="0666"

0 comments on commit 3138482

Please sign in to comment.