Skip to content

Commit 68d2e46

Browse files
committed
Added switching lights for corsair void
1 parent 34c7002 commit 68d2e46

1 file changed

Lines changed: 9 additions & 1 deletion

File tree

src/devices/corsair_void.c

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ static struct device device_void;
1010
static int void_send_sidetone(hid_device *device_handle, uint8_t num);
1111
static int void_request_battery(hid_device *device_handle);
1212
static int void_notification_sound(hid_device *hid_device, uint8_t soundid);
13+
static int void_lights(hid_device *device_handle, uint8_t on);
1314

1415
void void_init(struct device** device)
1516
{
@@ -18,10 +19,11 @@ void void_init(struct device** device)
1819

1920
strcpy(device_void.device_name, "Corsair Void");
2021

21-
device_void.capabilities = CAP_SIDETONE | CAP_BATTERY_STATUS | CAP_NOTIFICATION_SOUND;
22+
device_void.capabilities = CAP_SIDETONE | CAP_BATTERY_STATUS | CAP_NOTIFICATION_SOUND | CAP_LIGHTS;
2223
device_void.send_sidetone = &void_send_sidetone;
2324
device_void.request_battery = &void_request_battery;
2425
device_void.notifcation_sound = &void_notification_sound;
26+
device_void.switch_lights = &void_lights;
2527

2628
*device = &device_void;
2729
}
@@ -75,3 +77,9 @@ static int void_notification_sound(hid_device* device_handle, uint8_t soundid)
7577

7678
return hid_write(device_handle, data, 3);
7779
}
80+
81+
static int void_lights(hid_device* device_handle, uint8_t on)
82+
{
83+
unsigned char data[3] = {0xC8, on ? 0x00 : 0x01, 0x00};
84+
return hid_write(device_handle, data, 3);
85+
}

0 commit comments

Comments
 (0)