Skip to content

Conversation

@iv-m
Copy link
Contributor

@iv-m iv-m commented May 25, 2021

I've recently purchased SteelSeries Arctis 1 Wireless headset. After some experiments I've discovered that code that is used to get the battery status for "SteelSeries Arctis 1 Wireless for XBox" works for my headset, too, so I copied it over.

I also went further and merged the two drivers, as the difference between them was now vanishingly small:

$ sed -i 's,arctis_1_xbox_,arctis_1_,g' ./steelseries_arctis_1_xbox.c
[14:14:33 ~/src/open/HeadsetControl/src/devices]$ diff -u  steelseries_arctis_1.c steelseries_arctis_1_xbox.c
--- steelseries_arctis_1.c      2021-05-25 14:09:37.066872228 +0400
+++ steelseries_arctis_1_xbox.c 2021-05-25 14:14:33.548754808 +0400
@@ -9,9 +9,9 @@

 static struct device device_arctis;

-#define ID_ARCTIS_1 0x12b3
+#define ID_ARCTIS_1_XBOX 0x12b6

-static const uint16_t PRODUCT_IDS[] = { ID_ARCTIS_1 };
+static const uint16_t PRODUCT_IDS[] = { ID_ARCTIS_1_XBOX };

 static int arctis_1_send_sidetone(hid_device* device_handle, uint8_t num);
 static int arctis_1_request_battery(hid_device* device_handle);
@@ -26,9 +26,9 @@
     device_arctis.numIdProducts = sizeof(PRODUCT_IDS) / sizeof(PRODUCT_IDS[0]);
     device_arctis.idInterface = 0x03;

-    strncpy(device_arctis.device_name, "SteelSeries Arctis (1) Wireless", sizeof(device_arctis.device_name));
+    strncpy(device_arctis.device_name, "SteelSeries Arctis (1) Wireless For XBox", sizeof(device_arctis.device_name));

-    device_arctis.capabilities = CAP_SIDETONE | CAP_BATTERY_STATUS | CAP_INACTIVE_TIME;
+    device_arctis.capabilities = CAP_SIDETONE | CAP_INACTIVE_TIME | CAP_BATTERY_STATUS;
     device_arctis.send_sidetone = &arctis_1_send_sidetone;
     device_arctis.request_battery = &arctis_1_request_battery;
     device_arctis.send_inactive_time = &arctis_1_send_inactive_time;

The only thing that is lost in the merge is " For Xbox" suffix in device_arctis.device_name; I hope that doesn't matter much.

iv-m added 3 commits May 25, 2021 14:10
Battery requesting code from  SteelSeries Arctis 1 Wireless for XBOX
works just fine for my SteelSeries Arctis 1 Wireless.
Now SteelSeries Arctis 1 and SteelSeries Arctis 1 for XBox
differ only in function naming and device IDs, there is no
reason to keep two separate drivers for these two devices.
@iv-m iv-m force-pushed the arctics-1-battery branch from a966b92 to d0d9008 Compare May 25, 2021 11:12
@Sapd Sapd merged commit 0a1c2ef into Sapd:master May 25, 2021
rpbaptist pushed a commit to rpbaptist/HeadsetControl that referenced this pull request May 31, 2024
* SteelSeries Arctis 1: battery support

Battery requesting code from  SteelSeries Arctis 1 Wireless for XBOX
works just fine for my SteelSeries Arctis 1 Wireless.

* Merge SteelSeries Arctis 1 drivers

Now SteelSeries Arctis 1 and SteelSeries Arctis 1 for XBox
differ only in function naming and device IDs, there is no
reason to keep two separate drivers for these two devices.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants