@@ -23,23 +23,20 @@ static int g933_935_lights(hid_device* device_handle, uint8_t on);
2323
2424void g933_935_init (struct device * * device )
2525{
26- device_g933_935 .idVendor = VENDOR_LOGITECH ;
26+ device_g933_935 .idVendor = VENDOR_LOGITECH ;
2727 device_g933_935 .idProductsSupported = PRODUCT_IDS ;
28- device_g933_935 .numIdProducts = sizeof (PRODUCT_IDS ) / sizeof (PRODUCT_IDS [0 ]);
28+ device_g933_935 .numIdProducts = sizeof (PRODUCT_IDS ) / sizeof (PRODUCT_IDS [0 ]);
2929 strncpy (device_g933_935 .device_name , "Logitech G633/G635/G933/G935" , sizeof (device_g933_935 .device_name ));
3030
3131 device_g933_935 .capabilities = B (CAP_SIDETONE ) | B (CAP_BATTERY_STATUS ) | B (CAP_LIGHTS );
3232 /// TODO: usagepages and ids may not be correct for all features
33- device_g933_935 .capability_details [CAP_SIDETONE ] = (struct capability_detail )
34- { .usagepage = 0xff43 , .usageid = 0x0202 };
35- device_g933_935 .capability_details [CAP_BATTERY_STATUS ] = (struct capability_detail )
36- { .usagepage = 0xff43 , .usageid = 0x0202 };
37- device_g933_935 .capability_details [CAP_LIGHTS ] = (struct capability_detail )
38- { .usagepage = 0xff43 , .usageid = 0x0202 };
39-
40- device_g933_935 .send_sidetone = & g933_935_send_sidetone ;
33+ device_g933_935 .capability_details [CAP_SIDETONE ] = (struct capability_detail ) { .usagepage = 0xff43 , .usageid = 0x0202 };
34+ device_g933_935 .capability_details [CAP_BATTERY_STATUS ] = (struct capability_detail ) { .usagepage = 0xff43 , .usageid = 0x0202 };
35+ device_g933_935 .capability_details [CAP_LIGHTS ] = (struct capability_detail ) { .usagepage = 0xff43 , .usageid = 0x0202 };
36+
37+ device_g933_935 .send_sidetone = & g933_935_send_sidetone ;
4138 device_g933_935 .request_battery = & g933_935_request_battery ;
42- device_g933_935 .switch_lights = & g933_935_lights ;
39+ device_g933_935 .switch_lights = & g933_935_lights ;
4340
4441 * device = & device_g933_935 ;
4542}
@@ -114,7 +111,7 @@ static int g933_935_lights(hid_device* device_handle, uint8_t on)
114111 // off 11 ff 04 3c 01 (0 for logo) 00
115112 // logo and strips can be controlled individually
116113
117- uint8_t data_on [HIDPP_LONG_MESSAGE_LENGTH ] = { HIDPP_LONG_MESSAGE , HIDPP_DEVICE_RECEIVER , 0x04 , 0x3c , 0x01 , 0x02 , 0x00 , 0xb6 , 0xff , 0x0f , 0xa0 , 0x00 , 0x64 , 0x00 , 0x00 , 0x00 };
114+ uint8_t data_on [HIDPP_LONG_MESSAGE_LENGTH ] = { HIDPP_LONG_MESSAGE , HIDPP_DEVICE_RECEIVER , 0x04 , 0x3c , 0x01 , 0x02 , 0x00 , 0xb6 , 0xff , 0x0f , 0xa0 , 0x00 , 0x64 , 0x00 , 0x00 , 0x00 };
118115 uint8_t data_off [HIDPP_LONG_MESSAGE_LENGTH ] = { HIDPP_LONG_MESSAGE , HIDPP_DEVICE_RECEIVER , 0x04 , 0x3c , 0x01 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 };
119116 int res ;
120117 res = hid_write (device_handle , on ? data_on : data_off , HIDPP_LONG_MESSAGE_LENGTH );
@@ -124,9 +121,9 @@ static int g933_935_lights(hid_device* device_handle, uint8_t on)
124121 // TODO Investigate further.
125122 usleep (1 * 1000 ); // wait before next request, otherwise device ignores one of them, on windows at least.
126123 // turn logo lights on/off
127- uint8_t data_logo_on [HIDPP_LONG_MESSAGE_LENGTH ] = { HIDPP_LONG_MESSAGE , HIDPP_DEVICE_RECEIVER , 0x04 , 0x3c , 0x00 , 0x02 , 0x00 , 0xb6 , 0xff , 0x0f , 0xa0 , 0x00 , 0x64 , 0x00 , 0x00 , 0x00 };
124+ uint8_t data_logo_on [HIDPP_LONG_MESSAGE_LENGTH ] = { HIDPP_LONG_MESSAGE , HIDPP_DEVICE_RECEIVER , 0x04 , 0x3c , 0x00 , 0x02 , 0x00 , 0xb6 , 0xff , 0x0f , 0xa0 , 0x00 , 0x64 , 0x00 , 0x00 , 0x00 };
128125 uint8_t data_logo_off [HIDPP_LONG_MESSAGE_LENGTH ] = { HIDPP_LONG_MESSAGE , HIDPP_DEVICE_RECEIVER , 0x04 , 0x3c , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 };
129- res = hid_write (device_handle , on ? data_logo_on : data_logo_off , HIDPP_LONG_MESSAGE_LENGTH );
126+ res = hid_write (device_handle , on ? data_logo_on : data_logo_off , HIDPP_LONG_MESSAGE_LENGTH );
130127
131128 return res ;
132129}
0 commit comments